/* Versa Link by DesignVersa. Design system: tokens, components, app shell, marketing pages. */
:root {
  --ink: #0b1020;
  --text: #1f2937;
  --muted: #6b7280;
  --faint: #9aa1b2;
  --line: #e6e8ef;
  --line-strong: #d5d9e4;
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #f9fafc;
  --accent: #4f46e5;
  --accent-2: #7c3aed;
  --accent-ink: #ffffff;
  --accent-soft: #eef0ff;
  --accent-text: #4338ca;
  --ok: #15803d;
  --ok-soft: #e8f7ee;
  --warn: #b45309;
  --warn-soft: #fff6e5;
  --bad: #dc2626;
  --bad-soft: #fdecec;
  --info: #0369a1;
  --info-soft: #e7f4fb;
  --c1: #4f46e5; --c2: #0ea5a4; --c3: #f59e0b; --c4: #ec4899; --c5: #64748b;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 8px 24px rgba(16, 24, 40, .06);
  --shadow-lg: 0 24px 60px -12px rgba(16, 24, 40, .22);
  --r: 14px;
  --r-sm: 10px;
  --r-lg: 22px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --grad: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  --ring: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent);
  color-scheme: light;
}
[data-theme="dark"] {
  --ink: #f3f4fb;
  --text: #d6d9e6;
  --muted: #9097ad;
  --faint: #6b7288;
  --line: #222842;
  --line-strong: #2e3554;
  --bg: #0b1020;
  --surface: #121933;
  --surface-2: #0f1630;
  --accent: #818cf8;
  --accent-2: #a78bfa;
  --accent-ink: #0b1020;
  --accent-soft: #1e2350;
  --accent-text: #a5b4fc;
  --ok: #4ade80; --ok-soft: #10291c;
  --warn: #fbbf24; --warn-soft: #2b2110;
  --bad: #f87171; --bad-soft: #321417;
  --info: #38bdf8; --info-soft: #0c2533;
  --c1: #818cf8; --c2: #2dd4bf; --c3: #fbbf24; --c4: #f472b6; --c5: #94a3b8;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  --shadow-lg: 0 24px 60px -12px rgba(0, 0, 0, .6);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.55; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; font-feature-settings: "cv11", "ss01"; }
img, svg { max-width: 100%; }
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { color: var(--ink); line-height: 1.2; letter-spacing: -.02em; margin: 0 0 .5em; }
h1 { font-size: clamp(28px, 4vw, 40px); font-weight: 800; }
h2 { font-size: 22px; font-weight: 750; }
h3 { font-size: 17px; font-weight: 700; }
p { margin: 0 0 1em; }
code, .mono { font-family: var(--mono); font-size: .9em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 24px 0; }
::selection { background: color-mix(in srgb, var(--accent) 25%, transparent); }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Icons: inline SVG sprite */
.i { width: 18px; height: 18px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }
.i-sm { width: 15px; height: 15px; }
.i-lg { width: 22px; height: 22px; }

/* Brand mark */
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; color: var(--ink); font-size: 18px; letter-spacing: -.02em; text-decoration: none !important; }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; background: var(--grad); display: grid; place-items: center; box-shadow: 0 6px 16px -6px color-mix(in srgb, var(--accent) 70%, transparent); }
.brand-mark svg { width: 20px; height: 20px; }
.brand img { height: 34px; width: auto; }
.brand small { font-weight: 600; color: var(--muted); font-size: 12px; letter-spacing: 0; }

/* Buttons */
.btn { --b-bg: var(--surface); --b-fg: var(--ink); --b-bd: var(--line-strong); display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-weight: 650; font-size: 14px; line-height: 1; padding: 11px 16px; border-radius: 11px; border: 1px solid var(--b-bd); background: var(--b-bg); color: var(--b-fg); cursor: pointer; text-decoration: none !important; white-space: nowrap; transition: transform .12s ease, background .15s, border-color .15s, box-shadow .15s; }
.btn:hover { border-color: var(--faint); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn-primary { --b-bg: var(--accent); --b-fg: var(--accent-ink); --b-bd: transparent; box-shadow: 0 6px 18px -8px color-mix(in srgb, var(--accent) 80%, transparent); }
.btn-primary:hover { --b-bg: color-mix(in srgb, var(--accent) 88%, #000); border-color: transparent; }
.btn-grad { --b-bg: var(--grad); background: var(--grad); --b-fg: #fff; --b-bd: transparent; box-shadow: 0 10px 24px -10px color-mix(in srgb, var(--accent) 90%, transparent); }
.btn-grad:hover { filter: brightness(1.06); border-color: transparent; }
.btn-ghost { --b-bg: transparent; --b-bd: transparent; --b-fg: var(--text); }
.btn-ghost:hover { --b-bg: var(--surface-2); border-color: transparent; }
.btn-soft { --b-bg: var(--accent-soft); --b-fg: var(--accent-text); --b-bd: transparent; }
.btn-danger { --b-bg: var(--bad-soft); --b-fg: var(--bad); --b-bd: transparent; }
.btn-danger:hover { --b-bg: var(--bad); --b-fg: #fff; }
.btn-sm { padding: 8px 12px; font-size: 13px; border-radius: 9px; }
.btn-xs { padding: 5px 9px; font-size: 12px; border-radius: 8px; gap: 5px; }
.btn-lg { padding: 15px 22px; font-size: 16px; border-radius: 13px; }
.btn-block { width: 100%; }
.btn-icon { padding: 9px; }
.btn[disabled], .btn.is-loading { opacity: .6; pointer-events: none; }
.btn.is-loading::after { content: ""; width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Forms */
.field { display: grid; gap: 6px; margin-bottom: 16px; }
.field > label, .label { font-weight: 650; font-size: 13px; color: var(--ink); }
.hint { font-size: 12.5px; color: var(--muted); }
.error-text { font-size: 12.5px; color: var(--bad); }
.input, .select, .textarea { width: 100%; font: inherit; font-size: 14px; color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 11px; padding: 10px 12px; transition: border-color .15s, box-shadow .15s; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
.textarea.code { font-family: var(--mono); font-size: 13px; min-height: 180px; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%239aa1b2' stroke-width='2'%3E%3Cpath d='m1 1.5 5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 34px; }
.input-group { display: flex; align-items: stretch; border: 1px solid var(--line-strong); border-radius: 11px; background: var(--surface); overflow: hidden; }
.input-group:focus-within { border-color: var(--accent); box-shadow: var(--ring); }
.input-group .input, .input-group .select { border: 0; box-shadow: none !important; border-radius: 0; }
.input-group .addon { display: flex; align-items: center; padding: 0 12px; background: var(--surface-2); color: var(--muted); font-size: 13px; border-right: 1px solid var(--line); white-space: nowrap; }
.input-group .select.addon-select { width: auto; max-width: 46%; background-color: var(--surface-2); border-right: 1px solid var(--line); color: var(--muted); }
.input[type="color"] { padding: 4px; height: 42px; cursor: pointer; }
.check { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); margin-top: 1px; flex-shrink: 0; }
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .track { width: 40px; height: 23px; border-radius: 99px; background: var(--line-strong); position: relative; transition: background .2s; flex-shrink: 0; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 17px; height: 17px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s; }
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track::after { transform: translateX(17px); }
.switch input:focus-visible + .track { box-shadow: var(--ring); }
.row { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.row-2 { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.row-3 { display: grid; gap: 16px; grid-template-columns: repeat(3, 1fr); }
.form-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.color-field { display: flex; gap: 8px; align-items: center; }
.color-field .input[type="color"] { width: 46px; flex-shrink: 0; }

/* Cards, tiles, layout helpers */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }
.card-body { padding: 22px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.card-head h2, .card-head h3 { margin: 0; font-size: 16px; }
.card-foot { padding: 14px 22px; border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 var(--r-lg) var(--r-lg); }
.stack { display: grid; gap: 18px; }
.stack-sm { display: grid; gap: 10px; }
.flex { display: flex; align-items: center; gap: 10px; }
.flex-wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.strong { font-weight: 700; color: var(--ink); }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.center { text-align: center; }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; } .mt { margin-top: 18px; } .mb { margin-bottom: 18px; }
.grid-2 { display: grid; gap: 18px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { display: grid; gap: 18px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { display: grid; gap: 18px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-main { display: grid; gap: 18px; grid-template-columns: minmax(0, 1fr) var(--side, 340px); align-items: start; }
.docs-grid { grid-template-columns: 240px minmax(0, 1fr); gap: 40px; }

.stat { padding: 18px 20px; display: grid; gap: 4px; position: relative; overflow: hidden; }
.stat .label { color: var(--muted); font-weight: 600; font-size: 12.5px; display: flex; align-items: center; gap: 8px; }
.stat .value { font-size: 28px; font-weight: 800; color: var(--ink); letter-spacing: -.03em; line-height: 1.1; }
.stat .delta { font-size: 12px; font-weight: 700; }
.stat .delta.up { color: var(--ok); } .stat .delta.down { color: var(--bad); }
.stat .ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); position: absolute; right: 16px; top: 16px; }

.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 700; padding: 3px 8px; border-radius: 99px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.badge.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.badge.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.badge.accent { background: var(--accent-soft); color: var(--accent-text); border-color: transparent; }
.badge.info { background: var(--info-soft); color: var(--info); border-color: transparent; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; display: inline-block; }

.alert { display: flex; gap: 12px; align-items: flex-start; padding: 13px 16px; border-radius: 13px; font-size: 14px; border: 1px solid transparent; margin-bottom: 18px; }
.alert.ok { background: var(--ok-soft); color: var(--ok); }
.alert.bad { background: var(--bad-soft); color: var(--bad); }
.alert.warn { background: var(--warn-soft); color: var(--warn); }
.alert.info { background: var(--accent-soft); color: var(--accent-text); }
.alert ul { margin: 4px 0 0; padding-left: 18px; }

.progress { height: 7px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--grad); border-radius: 99px; }
.progress.full > span { background: var(--bad); }

/* Tables */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 11px 16px; border-bottom: 1px solid var(--line); background: var(--surface-2); white-space: nowrap; }
.table td { padding: 13px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: color-mix(in srgb, var(--surface-2) 70%, transparent); }
.table .actions { text-align: right; white-space: nowrap; }
.list-item { display: flex; align-items: center; gap: 14px; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.list-item:last-child { border-bottom: 0; }

/* Link rows */
.link-row { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.link-row:last-child { border-bottom: 0; }
.fav { width: 40px; height: 40px; border-radius: 11px; background: var(--surface-2); border: 1px solid var(--line); display: grid; place-items: center; overflow: hidden; }
.fav img { width: 20px; height: 20px; }
.link-short { font-weight: 700; color: var(--ink); font-size: 15px; }
.link-long { color: var(--muted); font-size: 13px; }
.link-meta { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); margin-top: 4px; align-items: center; }
.link-meta .i { width: 14px; height: 14px; }
.clicks-pill { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: var(--ink); font-size: 13px; background: var(--surface-2); border: 1px solid var(--line); padding: 6px 10px; border-radius: 10px; }

/* Tabs and segmented control */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; scrollbar-width: none; }
.tabs a, .tabs button { font: inherit; background: none; border: 0; padding: 10px 14px; font-weight: 650; font-size: 14px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer; white-space: nowrap; text-decoration: none !important; display: inline-flex; gap: 7px; align-items: center; }
.tabs .active, .tabs [aria-selected="true"] { color: var(--accent-text); border-bottom-color: var(--accent); }
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 11px; padding: 3px; gap: 2px; }
.seg a, .seg button, .seg label { font: inherit; font-size: 13px; font-weight: 650; padding: 6px 12px; border-radius: 8px; color: var(--muted); border: 0; background: none; cursor: pointer; text-decoration: none !important; }
.seg .active, .seg input:checked + span { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.seg label input { display: none; }
.seg label span { display: block; padding: 0; }
.panel[hidden] { display: none !important; }

/* Dropdown */
.dropdown { position: relative; }
.menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 210px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 6px; z-index: 60; display: none; }
.dropdown.open .menu { display: block; animation: pop .14s ease-out; }
.menu a, .menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 11px; border-radius: 9px; font: inherit; font-size: 14px; color: var(--text); background: none; border: 0; text-align: left; cursor: pointer; text-decoration: none !important; }
.menu a:hover, .menu button:hover { background: var(--surface-2); color: var(--ink); }
.menu .danger { color: var(--bad); }
.menu hr { margin: 6px 0; }
.menu-left { left: 0; right: auto; }
@keyframes pop { from { opacity: 0; transform: translateY(-4px) scale(.98); } }

/* Modal */
.modal { position: fixed; inset: 0; z-index: 80; display: none; align-items: center; justify-content: center; padding: 16px; background: rgba(11, 16, 32, .55); backdrop-filter: blur(3px); }
.modal.open { display: flex; animation: fade .15s ease-out; }
.modal-box { width: 100%; max-width: 520px; max-height: calc(100vh - 32px); overflow-y: auto; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); border: 1px solid var(--line); animation: pop .18s ease-out; }
.modal-box.wide { max-width: 760px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 0; }
.modal-body { padding: 22px; }
@keyframes fade { from { opacity: 0; } }

/* Toasts */
.toasts { position: fixed; bottom: 20px; right: 20px; z-index: 100; display: grid; gap: 10px; }
.toast { display: flex; gap: 10px; align-items: center; background: var(--ink); color: var(--bg); padding: 12px 16px; border-radius: 13px; box-shadow: var(--shadow-lg); font-size: 14px; font-weight: 600; animation: pop .2s ease-out; max-width: 360px; }
.toast.bad { background: var(--bad); color: #fff; }

/* Empty state */
.empty { text-align: center; padding: 48px 20px; }
.empty .art { width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 18px; background: var(--accent-soft); color: var(--accent-text); display: grid; place-items: center; }
.empty .art .i { width: 28px; height: 28px; }
.empty h3 { margin-bottom: 6px; }
.empty p { color: var(--muted); max-width: 380px; margin: 0 auto 18px; }

/* Pagination */
.pager { display: flex; gap: 6px; justify-content: center; padding: 16px; flex-wrap: wrap; }
.pager a, .pager span { min-width: 36px; height: 36px; display: inline-grid; place-items: center; padding: 0 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font-size: 14px; font-weight: 600; text-decoration: none !important; }
.pager .active { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.pager .disabled { opacity: .45; }

/* ============ App shell ============ */
.app { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--surface); border-right: 1px solid var(--line); padding: 18px 14px; display: flex; flex-direction: column; gap: 6px; }
.sidebar .brand { padding: 4px 8px 14px; }
.nav-label { font-size: 11px; font-weight: 750; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); padding: 14px 10px 6px; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 10px; color: var(--text); font-weight: 600; font-size: 14px; text-decoration: none !important; position: relative; }
.nav a:hover { background: var(--surface-2); color: var(--ink); }
.nav a.active { background: var(--accent-soft); color: var(--accent-text); }
.nav a.active::before { content: ""; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.nav a .count { margin-left: auto; font-size: 11px; font-weight: 700; color: var(--muted); }
.nav a .badge { margin-left: auto; }
.sidebar-foot { margin-top: auto; padding-top: 14px; }
.plan-box { border: 1px solid var(--line); border-radius: 16px; padding: 14px; background: var(--surface-2); display: grid; gap: 10px; }
.plan-box .strong { font-size: 14px; }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 12px; padding: 12px 28px; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.topbar .search { flex: 1; max-width: 420px; }
.topbar .search .input { padding-left: 38px; background: var(--surface); }
.topbar .search { position: relative; }
.topbar .search .i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--faint); }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--grad); color: #fff; display: grid; place-items: center; font-weight: 750; font-size: 13px; overflow: hidden; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--line); flex-shrink: 0; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.sm { width: 28px; height: 28px; font-size: 11px; }
.content { padding: 28px; max-width: 1240px; width: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { font-size: 26px; margin: 0 0 4px; }
.page-head p { color: var(--muted); margin: 0; }
.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 6px; display: flex; gap: 6px; align-items: center; }
.crumbs a { color: var(--muted); }
.menu-toggle { display: none; }
.workspace-switch { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); width: 100%; font: inherit; cursor: pointer; text-align: left; color: var(--ink); }
.workspace-switch .grow { font-weight: 650; font-size: 13.5px; }

/* Quick shorten bar */
.shorten-bar { display: flex; gap: 10px; padding: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); }
.shorten-bar .input { border: 0; box-shadow: none !important; font-size: 15px; background: transparent; }
.shorten-result { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 14px; background: var(--accent-soft); margin-top: 12px; }
.shorten-result a { font-weight: 750; color: var(--accent-text); }

/* Charts */
.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .grid-line { stroke: var(--line); stroke-width: 1; }
.chart .axis { fill: var(--faint); font-size: 11px; font-family: var(--font); }
.chart .tip { position: absolute; pointer-events: none; background: var(--ink); color: var(--bg); padding: 7px 10px; border-radius: 9px; font-size: 12px; font-weight: 650; transform: translate(-50%, -110%); white-space: nowrap; opacity: 0; transition: opacity .1s; box-shadow: var(--shadow); }
.chart .tip.show { opacity: 1; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.bars { display: grid; gap: 12px; }
.bar-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; font-size: 13.5px; align-items: center; }
.bar-row .name { display: flex; gap: 8px; align-items: center; min-width: 0; }
.bar-row .name span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-row .num { font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.bar-row .track { grid-column: 1 / -1; height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.bar-row .track span { display: block; height: 100%; border-radius: 99px; background: var(--accent); }
.flag { font-size: 18px; line-height: 1; }

/* Builder: repeaters, block editor */
.repeater { display: grid; gap: 10px; }
.repeater-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) auto; gap: 8px; align-items: center; }
.repeater-row.three { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.4fr) auto; }
.option-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.option-card { position: relative; border: 1.5px solid var(--line); border-radius: 14px; padding: 12px; cursor: pointer; display: grid; gap: 6px; font-size: 13px; background: var(--surface); transition: border-color .15s, box-shadow .15s; }
.option-card:hover { border-color: var(--line-strong); }
.option-card input { position: absolute; opacity: 0; pointer-events: none; }
.option-card:has(input:checked) { border-color: var(--accent); box-shadow: var(--ring); }
.option-card .strong { font-size: 13.5px; }
.swatch { height: 46px; border-radius: 10px; border: 1px solid var(--line); }
.blocks { display: grid; gap: 10px; }
.block { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.block-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px; cursor: pointer; user-select: none; }
.block-head .handle { cursor: grab; color: var(--faint); }
.block-head .title { flex: 1; min-width: 0; font-weight: 650; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.block-body { padding: 4px 14px 14px; border-top: 1px dashed var(--line); display: none; }
.block.open .block-body { display: block; padding-top: 14px; }
.block.dragging { opacity: .5; }
.block-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.block-picker button { display: flex; align-items: center; gap: 8px; font: inherit; font-size: 13px; font-weight: 600; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--text); cursor: pointer; text-align: left; }
.block-picker button:hover { border-color: var(--accent); color: var(--accent-text); }

/* Phone preview */
.phone { width: 300px; max-width: 100%; aspect-ratio: 9 / 18.5; border-radius: 42px; border: 10px solid #0b1020; background: #0b1020; box-shadow: var(--shadow-lg); overflow: hidden; margin: 0 auto; position: relative; }
.phone::before { content: ""; position: absolute; top: 8px; left: 50%; transform: translateX(-50%); width: 84px; height: 22px; border-radius: 99px; background: #0b1020; z-index: 2; }
.phone iframe { width: 100%; height: 100%; border: 0; border-radius: 32px; background: #fff; }
.sticky-side { position: sticky; top: 84px; }

/* QR */
.qr-preview { background: repeating-conic-gradient(var(--surface-2) 0% 25%, var(--surface) 0% 50%) 50% / 18px 18px; border: 1px solid var(--line); border-radius: 20px; padding: 22px; display: grid; place-items: center; min-height: 300px; }
.qr-preview img, .qr-preview svg { width: 100%; max-width: 280px; height: auto; filter: drop-shadow(0 10px 22px rgba(11, 16, 32, .12)); }
.qr-card { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 16px; }
.qr-card .thumb { background: var(--surface-2); border-radius: 14px; padding: 14px; display: grid; place-items: center; aspect-ratio: 1; }
.qr-card .thumb img { width: 100%; height: 100%; object-fit: contain; }

/* Copy chip */
.copy { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }

/* ============ Marketing site ============ */
.site-header { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 80%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent); }
.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.site-nav { display: flex; align-items: center; gap: 28px; height: 70px; }
.site-nav .links { display: flex; gap: 6px; margin-left: 8px; }
.site-nav .links a { color: var(--text); font-weight: 600; font-size: 14.5px; padding: 8px 12px; border-radius: 10px; text-decoration: none !important; }
.site-nav .links a:hover, .site-nav .links a.active { background: var(--surface); color: var(--ink); }
.site-nav .right { margin-left: auto; display: flex; gap: 10px; align-items: center; }
.hero { position: relative; padding: 84px 0 60px; overflow: hidden; }
.hero::before { content: ""; position: absolute; inset: -40% -10% auto; height: 760px; background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 22%, transparent), transparent 70%), radial-gradient(closest-side at 70% 40%, color-mix(in srgb, var(--accent-2) 18%, transparent), transparent 70%); pointer-events: none; z-index: -1; }
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 48px; align-items: center; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: var(--accent-text); background: var(--accent-soft); padding: 6px 12px 6px 6px; border-radius: 99px; margin-bottom: 18px; }
.eyebrow b { background: var(--accent); color: var(--accent-ink); padding: 2px 8px; border-radius: 99px; font-size: 11px; }
.hero h1 { font-size: clamp(36px, 5.6vw, 62px); line-height: 1.04; letter-spacing: -.035em; margin-bottom: 18px; }
.hero h1 em { font-style: normal; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero .lead { font-size: 18px; color: var(--muted); max-width: 540px; margin-bottom: 28px; }
.hero-shorten { max-width: 560px; }
.hero-proof { display: flex; gap: 22px; margin-top: 24px; color: var(--muted); font-size: 13.5px; flex-wrap: wrap; }
.hero-proof span { display: inline-flex; gap: 7px; align-items: center; }
.hero-proof .i { color: var(--ok); }
.showcase { position: relative; }
.show-card { background: var(--surface); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow-lg); padding: 20px; }
.show-float { position: absolute; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-lg); padding: 14px; }
.section { padding: 80px 0; }
.section.alt { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-head { text-align: center; max-width: 680px; margin: 0 auto 46px; }
.section-head h2 { font-size: clamp(28px, 3.6vw, 40px); letter-spacing: -.03em; margin-bottom: 12px; }
.section-head p { color: var(--muted); font-size: 17px; }
.kicker { font-size: 12.5px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--accent-text); margin-bottom: 10px; display: block; }
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.feature { padding: 26px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); transition: transform .2s, box-shadow .2s, border-color .2s; }
.feature:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--line-strong); }
.feature .ico { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); margin-bottom: 16px; }
.feature .ico .i { width: 22px; height: 22px; }
.feature h3 { margin-bottom: 8px; }
.feature p { color: var(--muted); font-size: 14.5px; margin: 0; }
.split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 56px; align-items: center; }
.split + .split { margin-top: 90px; }
.split.flip > :first-child { order: 2; }
.checks { list-style: none; padding: 0; margin: 20px 0 0; display: grid; gap: 12px; }
.checks li { display: flex; gap: 10px; align-items: flex-start; }
.checks .i { color: var(--accent); margin-top: 2px; }
.pricing { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 18px; align-items: stretch; }
.price-card { position: relative; padding: 28px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 16px; }
.price-card.featured { border: 2px solid var(--accent); box-shadow: 0 30px 60px -30px color-mix(in srgb, var(--accent) 60%, transparent); }
.price-card .ribbon { position: absolute; top: -12px; left: 28px; background: var(--grad); color: #fff; font-size: 11.5px; font-weight: 800; padding: 4px 10px; border-radius: 99px; letter-spacing: .03em; }
.price { font-size: 42px; font-weight: 850; color: var(--ink); letter-spacing: -.04em; line-height: 1; }
.price small { font-size: 14px; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.price-card ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 9px; font-size: 14px; flex: 1; }
.price-card li { display: flex; gap: 9px; align-items: flex-start; }
.price-card li .i { color: var(--accent); width: 16px; height: 16px; margin-top: 2px; }
.price-card li.off { color: var(--faint); text-decoration: line-through; }
.price-card li.off .i { color: var(--faint); }
.faq { max-width: 760px; margin: 0 auto; display: grid; gap: 10px; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 4px 20px; }
.faq summary { cursor: pointer; font-weight: 700; color: var(--ink); padding: 14px 0; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::after { content: "+"; font-size: 20px; color: var(--accent); line-height: 1; }
.faq details[open] summary::after { content: "–"; }
.faq details > div { padding-bottom: 16px; color: var(--muted); }
.cta-band { border-radius: 28px; padding: 56px; background: var(--grad); color: #fff; display: flex; align-items: center; justify-content: space-between; gap: 24px; position: relative; overflow: hidden; }
.cta-band::after { content: ""; position: absolute; right: -60px; top: -60px; width: 260px; height: 260px; border-radius: 50%; border: 40px solid rgba(255,255,255,.08); }
.cta-band h2 { color: #fff; font-size: clamp(26px, 3vw, 36px); margin: 0 0 8px; }
.cta-band p { color: rgba(255,255,255,.85); margin: 0; }
.cta-band .btn { --b-bg: #fff; --b-fg: #312e81; --b-bd: transparent; position: relative; z-index: 1; }
.logos { display: flex; gap: 40px; justify-content: center; flex-wrap: wrap; opacity: .6; font-weight: 800; color: var(--muted); font-size: 18px; letter-spacing: -.02em; }
.site-footer { border-top: 1px solid var(--line); padding: 54px 0 34px; background: var(--surface); margin-top: 40px; }
.foot-grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 30px; }
.foot-grid h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 14px; }
.foot-grid a { display: block; color: var(--text); font-size: 14px; padding: 4px 0; }
.foot-bottom { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 40px; padding-top: 22px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.prose { max-width: 760px; font-size: 16.5px; line-height: 1.75; }
.prose h2 { font-size: 26px; margin-top: 1.6em; }
.prose h3 { font-size: 20px; margin-top: 1.4em; }
.prose img { border-radius: 16px; }
.prose a { text-decoration: underline; }
.prose pre { background: var(--ink); color: var(--bg); padding: 16px; border-radius: 14px; overflow-x: auto; font-size: 13.5px; }
.prose blockquote { margin: 1.4em 0; padding: 4px 20px; border-left: 3px solid var(--accent); color: var(--muted); }
.post-card { display: grid; gap: 12px; color: inherit; text-decoration: none !important; }
.post-card .cover { aspect-ratio: 16 / 9; border-radius: 18px; background: var(--grad); overflow: hidden; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 22px; padding: 20px; text-align: center; }
.post-card .cover img { width: 100%; height: 100%; object-fit: cover; }
.post-card h3 { margin: 0; }
.post-card:hover h3 { color: var(--accent-text); }

/* Auth */
.auth { min-height: 100vh; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.auth-side { background: var(--grad); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-side::after { content: ""; position: absolute; width: 520px; height: 520px; border-radius: 50%; border: 70px solid rgba(255, 255, 255, .07); right: -180px; bottom: -180px; }
.auth-side .brand { color: #fff; }
.auth-side .brand-mark { background: rgba(255,255,255,.18); }
.auth-side h2 { color: #fff; font-size: 34px; max-width: 420px; }
.auth-side p { color: rgba(255,255,255,.82); max-width: 420px; }
.auth-main { display: grid; place-items: center; padding: 40px 24px; }
.auth-box { width: 100%; max-width: 410px; }
.auth-box h1 { font-size: 28px; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--faint); font-size: 12.5px; margin: 20px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.social-btns { display: grid; gap: 10px; }

/* Public link pages: splash, password, frame, campaign */
.solo { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.solo-card { width: 100%; max-width: 460px; background: var(--surface); border: 1px solid var(--line); border-radius: 26px; box-shadow: var(--shadow-lg); padding: 32px; text-align: center; }
.frame-bar { position: fixed; inset: 0 0 auto; height: 52px; display: flex; align-items: center; gap: 14px; padding: 0 16px; background: var(--surface); border-bottom: 1px solid var(--line); z-index: 5; }
.frame-page iframe { position: fixed; top: 52px; left: 0; width: 100%; height: calc(100% - 52px); border: 0; }
.powered { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); font-weight: 600; text-decoration: none !important; }
.powered .brand-mark { width: 18px; height: 18px; border-radius: 5px; }
.powered .brand-mark svg { width: 11px; height: 11px; }

/* Responsive */
@media (max-width: 1080px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-main, .docs-grid { grid-template-columns: minmax(0, 1fr); }
  .sticky-side { position: static; }
  .features { grid-template-columns: repeat(2, 1fr); }
  .hero-grid, .split { grid-template-columns: minmax(0, 1fr); }
  .split.flip > :first-child { order: 0; }
  .foot-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 272px; z-index: 70; transform: translateX(-100%); transition: transform .22s ease; box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: none; }
  .menu-toggle { display: inline-flex; }
  .content { padding: 20px 16px; }
  .topbar { padding: 10px 16px; }
  .topbar .search { display: none; }
  .grid-2, .grid-3, .row-2, .row-3 { grid-template-columns: minmax(0, 1fr); }
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth-side { display: none; }
  .site-nav .links { display: none; }
  .site-nav.open .links { display: flex; position: absolute; top: 70px; left: 0; right: 0; flex-direction: column; background: var(--surface); padding: 12px 16px; border-bottom: 1px solid var(--line); }
  .cta-band { flex-direction: column; align-items: flex-start; padding: 36px 26px; }
  .link-row { grid-template-columns: 36px minmax(0, 1fr); }
  .link-row > :last-child { grid-column: 1 / -1; justify-content: flex-start; }
  .repeater-row, .repeater-row.three { grid-template-columns: minmax(0, 1fr); }
  .wrap { padding: 0 16px; }
  .section { padding: 56px 0; }
  .hero { padding: 48px 0 40px; }
}
@media (max-width: 600px) {
  .grid-4, .features { grid-template-columns: minmax(0, 1fr); }
  .foot-grid { grid-template-columns: minmax(0, 1fr); }
  .shorten-bar { flex-direction: column; }
  .site-nav .right .hide-sm { display: none; }
  .page-head { align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* Utilities added with the page templates */
.auth-mobile-brand { display: none; }
@media (max-width: 860px) { .auth-mobile-brand { display: block; } .hide-sm { display: none !important; } }
.showcase .qr-float svg { display: block; width: 100%; height: auto; }
.flag-img { width: 20px; height: 15px; border-radius: 3px; object-fit: cover; box-shadow: 0 0 0 1px var(--line); flex-shrink: 0; vertical-align: -2px; }
.stack, .stack-sm { grid-template-columns: minmax(0, 1fr); }
.page-head > * { min-width: 0; max-width: 100%; }
.page-head h1 { overflow-wrap: anywhere; }
.blocks, .repeater, .bars, .field { grid-template-columns: minmax(0, 1fr); }
label.label { display: block; }
