:root {
  --ink: #14110f;
  --ink-2: #2a2622;
  --paper: #f4f1ea;
  --card: #ffffff;
  --line: #ddd6c9;
  --muted: #6d665e;
  --lime: #d4ff3f;
  --lime-ink: #1d2400;
  --ok: #15803d;
  --bad: #b91c1c;
  --focus: #5b5bf7;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(20, 17, 15, .08);
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: 'Archivo', system-ui, -apple-system, sans-serif; color: var(--ink); background: var(--paper); line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.bad { color: var(--bad); }
[hidden] { display: none !important; }

/* ------------------------------ buttons ------------------------------ */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 18px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--card); font-weight: 600; font-size: 15px; text-decoration: none; cursor: pointer; white-space: nowrap; transition: background .15s, transform .1s, border-color .15s; }
.btn:hover { border-color: var(--ink); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .55; cursor: progress; }
.btn.sm { height: 36px; padding: 0 14px; font-size: 14px; }
.btn.big { height: 56px; padding: 0 28px; font-size: 17px; }
.btn.full { width: 100%; }
.btn.ink { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn.ink:hover { background: var(--ink-2); }
.btn.lime { background: var(--lime); color: var(--lime-ink); border-color: var(--lime); }
.btn.lime:hover { filter: brightness(1.05); border-color: var(--lime); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: rgba(20, 17, 15, .06); }
.btn.danger { background: var(--bad); border-color: var(--bad); color: #fff; }

.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; font-stretch: 112%; font-size: 21px; letter-spacing: -.03em; color: var(--ink); }
.brand svg { width: 32px; height: 32px; color: var(--lime); border-radius: 9px; box-shadow: inset 0 0 0 1.5px var(--ink); }

/* ------------------------------ forms ------------------------------- */
label { display: block; font-size: 14px; font-weight: 600; margin: 0 0 14px; }
input:not([type=checkbox]):not([type=color]):not([type=range]):not([type=file]), textarea, select {
  display: block; width: 100%; margin-top: 6px; padding: 11px 14px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font-weight: 400; font-size: 15px; transition: border-color .15s, box-shadow .15s;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(20, 17, 15, .1); }
textarea { resize: vertical; min-height: 70px; }
.hint { display: block; font-weight: 400; color: var(--muted); font-size: 13px; margin-top: 6px; }
.hint.ok { color: var(--ok); }
.hint.bad { color: var(--bad); }
.counter { float: right; font-weight: 400; color: var(--muted); font-size: 12px; }
.input-prefix { display: flex; align-items: center; margin-top: 6px; border: 1px solid var(--line); border-radius: 10px; background: #fff; overflow: hidden; }
.input-prefix:focus-within { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(20, 17, 15, .1); }
.input-prefix span { padding-left: 14px; color: var(--muted); font-weight: 500; white-space: nowrap; }
.input-prefix input { border: 0 !important; margin: 0 !important; box-shadow: none !important; padding-left: 2px !important; min-width: 0; }
.form-error { background: #fef2f2; color: var(--bad); padding: 10px 14px; border-radius: 10px; font-size: 14px; margin: 0 0 14px; }

/* ------------------------------ phone ------------------------------- */
.phone { width: 300px; height: 620px; border-radius: 46px; background: var(--ink); padding: 10px; box-shadow: 0 30px 60px -20px rgba(20, 17, 15, .45), inset 0 0 0 2px #3b3632; flex: none; }
.phone-screen { width: 100%; height: 100%; border-radius: 37px; overflow: hidden auto; scrollbar-width: none; background: #fff; isolation: isolate; }
.phone-screen::-webkit-scrollbar { display: none; }
.phone-screen .tp { min-height: 100%; padding: 48px 18px 24px; background-attachment: scroll; }
.phone-screen .tp-avatar { width: 80px; height: 80px; }
.phone-screen .tp-initials { font-size: 28px; }
.phone-screen .tp-name { font-size: 19px; }
.phone-screen .tp-bio { font-size: 14px; }
.phone-screen .tp-btn { min-height: 50px; font-size: 14.5px; padding: 12px 46px; }
.phone-screen .tp-links { gap: 11px; }
.phone-screen .tp-ico { left: 14px; font-size: 19px; }
.phone-screen .tp-foot { margin-top: 28px; }

/* ----------------------------- landing ------------------------------ */
.is-land { background: var(--paper); }
.site-nav, .hero, .spec, .selfhost, .site-foot { max-width: 1160px; margin: 0 auto; padding-left: 32px; padding-right: 32px; }
.site-nav { display: flex; align-items: center; justify-content: space-between; height: 76px; }
.site-nav nav { display: flex; align-items: center; gap: 20px; font-weight: 600; font-size: 15px; }
.site-nav nav > a:not(.btn) { text-decoration: none; }
.site-nav nav > a:not(.btn):hover { text-decoration: underline; text-underline-offset: 4px; }
.hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 56px; align-items: center; padding-top: 48px; padding-bottom: 96px; }
.hero h1 { font-size: clamp(48px, 7.2vw, 96px); font-weight: 800; font-stretch: 112%; line-height: .95; letter-spacing: -.035em; margin: 0 0 28px; max-width: 9ch; }
.lede { font-size: 19px; line-height: 1.55; max-width: 44ch; margin: 0 0 32px; color: var(--ink-2); }
.claim { display: flex; gap: 8px; max-width: 520px; }
.claim label { flex: 1; display: flex; align-items: center; margin: 0; height: 52px; padding: 0 4px 0 16px; border: 1.5px solid var(--ink); border-radius: 10px; background: #fff; font-weight: 500; min-width: 0; }
.claim label:focus-within { box-shadow: 0 0 0 3px rgba(20, 17, 15, .15); }
.claim-host { color: var(--muted); white-space: nowrap; }
.claim input { border: 0 !important; margin: 0 !important; padding: 0 0 0 1px !important; box-shadow: none !important; font-weight: 600 !important; min-width: 0; }
.claim .btn { height: 52px; padding: 0 24px; }
.hero-note { color: var(--muted); font-size: 14px; margin: 14px 0 0; }
.playground { display: flex; align-items: flex-end; gap: 28px; }
.playground-controls { width: 200px; padding-bottom: 8px; }
.pg-label { display: block; font-size: 13px; font-weight: 700; margin: 0 0 8px; }
.playground-controls input { margin-bottom: 18px !important; font-size: 14px !important; padding: 9px 12px !important; }
.chips { display: flex; flex-direction: column; gap: 2px; }
.chip { display: flex; align-items: center; gap: 10px; border: 0; background: none; padding: 7px 8px; border-radius: 8px; font-size: 14px; font-weight: 500; cursor: pointer; text-align: left; }
.chip i { position: relative; width: 22px; height: 22px; border-radius: 5px; flex: none; box-shadow: inset 0 0 0 1px rgba(20, 17, 15, .25); overflow: hidden; }
.chip i b { position: absolute; left: 4px; right: 4px; bottom: 5px; height: 5px; border-radius: 1px; }
.chip[aria-pressed=true] i { box-shadow: 0 0 0 1.5px #fff; }
.chip:hover { background: rgba(20, 17, 15, .06); }
.chip[aria-pressed=true] { background: var(--ink); color: #fff; }
.spec { position: relative; display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 48px; padding-top: 72px; padding-bottom: 72px; }
.spec::before, .selfhost::before { content: ''; position: absolute; top: 0; left: 32px; right: 32px; border-top: 1.5px solid var(--ink); }
.spec h2, .selfhost h2 { font-size: 34px; font-weight: 800; font-stretch: 112%; letter-spacing: -.03em; line-height: 1; margin: 0; }
.spec dl { margin: 0; display: grid; grid-template-columns: 1fr 1fr; column-gap: 48px; }
.spec dl > div { padding: 20px 0 24px; border-top: 1px solid var(--line); }
.spec dt { font-weight: 700; font-size: 17px; margin-bottom: 6px; }
.spec dd { margin: 0; color: var(--ink-2); max-width: 46ch; }
.selfhost { position: relative; display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 48px; padding-top: 56px; padding-bottom: 88px; align-items: start; }
.selfhost p { color: var(--ink-2); margin: 12px 0 0; max-width: 32ch; }
.selfhost pre { margin: 0; background: var(--ink); color: #efeae0; padding: 24px 28px; border-radius: 12px; font: 15px/1.7 'IBM Plex Mono', ui-monospace, monospace; overflow-x: auto; }
.selfhost .c { color: #9a9286; }
.site-foot { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; padding-top: 28px; padding-bottom: 40px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.site-foot .brand { font-size: 17px; }
.site-foot .brand svg { width: 26px; height: 26px; }

/* ------------------------------- auth ------------------------------- */
.auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 32px 16px; background: var(--paper); }
.auth-card { width: 100%; max-width: 420px; background: var(--card); border: 1.5px solid var(--ink); border-radius: 14px; padding: 36px 32px; }
.auth-card .brand { margin-bottom: 26px; }
.auth-card.center { text-align: center; }
.auth-card h1 { font-size: 30px; font-weight: 800; font-stretch: 112%; letter-spacing: -.03em; line-height: 1.05; margin: 0 0 8px; }
.auth-card > p { margin: 0 0 24px; }
.auth-card .btn.full { margin-top: 6px; }
.auth-switch { text-align: center; font-size: 14px; color: var(--muted); margin: 22px 0 0 !important; }

/* ----------------------------- dashboard ---------------------------- */
.is-dash { background: var(--paper); }
.dash-top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 28px; height: 64px; padding: 0 24px; background: rgba(247, 245, 240, .9); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.tabs { display: flex; gap: 4px; align-self: stretch; }
.tabs button { border: 0; border-bottom: 2.5px solid transparent; background: transparent; padding: 0 12px; font-weight: 600; font-size: 15px; cursor: pointer; color: var(--muted); }
.tabs button:hover { color: var(--ink); }
.tabs button[aria-selected=true] { color: var(--ink); border-bottom-color: var(--ink); }
.dash-top-r { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.save-state { font-size: 13px; color: var(--muted); }
.save-state.ok::before { content: '✓ '; color: var(--ok); }
.save-state.bad { color: var(--bad); }
.share-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; max-width: 1120px; margin: 20px auto 0; padding: 12px 12px 12px 20px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; font-size: 14px; width: calc(100% - 48px); }
.share-url a { font-weight: 700; word-break: break-all; }
.share-actions { display: flex; gap: 8px; }
.dash-body { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 40px; max-width: 1120px; margin: 0 auto; padding: 20px 24px 80px; }
.dash-main { min-width: 0; outline: none; }
.dash-preview { position: sticky; top: 80px; align-self: start; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.preview-toggle { display: none; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 22px; margin-bottom: 16px; }
.card-head { margin-bottom: 16px; }
.card-head.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.card h2 { font-size: 17px; margin: 0; letter-spacing: -.01em; }
.card-head p { margin: 2px 0 0; }
.card h3 { font-size: 14px; font-weight: 700; margin: 24px 0 10px; }
.card h3:first-of-type { margin-top: 0; }
.empty { text-align: center; color: var(--muted); padding: 24px; }

.add-card { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.add-form { display: grid; grid-template-columns: 1.4fr 1fr auto; gap: 8px; width: 100%; }
.add-form input { margin: 0 !important; }
.add-form .btn { height: auto; }

.link-list { list-style: none; margin: 0 0 16px; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.link-item { display: flex; gap: 8px; align-items: flex-start; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px 10px 6px; transition: opacity .15s, box-shadow .15s; }
.link-item.is-off .li-title, .link-item.is-off .li-url { opacity: .5; }
.link-item.dragging { opacity: .5; box-shadow: 0 0 0 2px var(--ink); }
.li-handle { border: 0; background: transparent; cursor: grab; padding: 8px 4px; border-radius: 8px; color: #b0a89c; }
.li-handle:hover { color: var(--ink); background: #f3f0ea; }
.li-handle svg { width: 18px; height: 18px; fill: currentColor; display: block; }
.li-body { flex: 1; min-width: 0; }
.li-body input.li-title, .li-body input.li-url { border: 1px solid transparent !important; margin: 0 !important; padding: 4px 8px !important; border-radius: 8px !important; box-shadow: none !important; background: transparent; }
.li-body input.li-title { font-weight: 700 !important; font-size: 16px !important; }
.li-body input.li-url { font-size: 14px !important; color: var(--muted); }
.li-body input.li-title:hover, .li-body input.li-url:hover { background: #f7f5f0; }
.li-body input.li-title:focus, .li-body input.li-url:focus { border-color: var(--line) !important; background: #fff; }
.li-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 4px 8px; font-size: 12.5px; color: var(--muted); }
.li-badges { display: contents; }
.badge { display: inline-block; padding: 1px 8px; border-radius: 999px; background: #f0ece4; font-weight: 600; font-size: 11.5px; }
.badge.hl { background: #fff5c2; color: #7a5b00; }
.badge.sched { background: #e3edff; color: #1e40af; }
.badge.off { background: #f3e8e8; color: #8a2a2a; }
.li-tools { display: flex; align-items: center; gap: 2px; margin-top: 4px; padding-left: 2px; }
.li-tools .spacer { flex: 1; }
.li-tools button { display: inline-flex; align-items: center; gap: 5px; border: 0; background: transparent; padding: 6px 8px; border-radius: 8px; cursor: pointer; color: var(--muted); font-size: 13px; font-weight: 600; line-height: 1; }
.li-tools button:hover { background: #f3f0ea; color: var(--ink); }
.li-tools button[aria-pressed=true], .li-tools button[aria-expanded=true] { background: var(--ink); color: #fff; }
.li-tools button[aria-pressed=true] svg { fill: currentColor; }
.li-tools button.danger:hover { background: #fdecec; color: var(--bad); }
.li-tools svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.li-drawer { margin: 8px 8px 4px; padding: 14px; background: #f7f5f0; border-radius: 10px; }
.li-drawer label { margin-bottom: 10px; }
.li-drawer p { margin: 0 0 10px; }
.icon-detail { margin-top: 4px; }
.icon-detail select { max-width: 260px; }
.thumb-row { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.thumb-row img { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; }
.a11y { background: #fff4d6; color: #5c4200; border-radius: 8px; padding: 10px 14px; font-size: 14px; margin-bottom: 16px; }
.sched-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.switch { position: relative; flex: none; width: 44px; height: 26px; margin: 6px 0 0; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch span { position: absolute; inset: 0; background: #d6d0c6; border-radius: 999px; transition: background .2s; pointer-events: none; }
.switch span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; background: #fff; border-radius: 50%; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform .2s; }
.switch input:checked + span { background: #22a35a; }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }

.social-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.social-row input { margin: 0 !important; }
.social-ico { flex: none; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; border-radius: 10px; background: #f3f0ea; }
.social-ico svg { width: 20px; height: 20px; }
.icon-btn { flex: none; width: 36px; height: 36px; border: 0; background: transparent; border-radius: 8px; cursor: pointer; color: var(--muted); }
.icon-btn:hover { background: #f3f0ea; color: var(--ink); }
.icon-btn.danger:hover { background: #fdecec; color: var(--bad); }
.add-social { display: flex; gap: 8px; margin-top: 12px; }
.add-social select { margin: 0; width: auto; flex: 1; max-width: 240px; }

.profile-row { display: flex; align-items: center; gap: 18px; margin-bottom: 18px; }
.avatar-edit { width: 84px; height: 84px; border-radius: 50%; overflow: hidden; background: var(--ink); color: var(--lime); display: flex; align-items: center; justify-content: center; font-size: 32px; font-weight: 800; flex: none; }
.avatar-edit img { width: 100%; height: 100%; object-fit: cover; }
.avatar-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 12px; }
.theme-swatch { border: 0; background: transparent; padding: 0; cursor: pointer; text-align: center; }
.sw { display: flex; flex-direction: column; justify-content: center; gap: 7px; padding: 0 16px; aspect-ratio: 3 / 4; border-radius: 12px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08); transition: transform .15s, box-shadow .15s; }
.sw i { display: block; height: 14px; }
.theme-swatch:hover .sw { transform: translateY(-2px); }
.theme-swatch[aria-pressed=true] .sw { box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--ink); }
.sw-label { display: block; font-size: 13px; font-weight: 600; margin-top: 8px; }

.seg { display: inline-flex; flex-wrap: wrap; gap: 2px; background: #f0ece4; padding: 3px; border-radius: 10px; margin: 0 8px 12px 0; }
.seg button { border: 0; background: transparent; padding: 7px 13px; border-radius: 8px; cursor: pointer; font-size: 13.5px; font-weight: 600; color: var(--muted); }
.seg button[aria-checked=true] { background: #fff; color: var(--ink); box-shadow: 0 0 0 1px var(--line); }
.color-row { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.color { display: flex; align-items: center; gap: 10px; margin: 0; padding: 6px 14px 6px 6px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; }
.color input { width: 34px; height: 34px; border: 0; padding: 0; background: none; cursor: pointer; border-radius: 8px; }
.color input::-webkit-color-swatch-wrapper { padding: 0; }
.color input::-webkit-color-swatch { border: 1px solid rgba(0, 0, 0, .1); border-radius: 8px; }
.color span { display: flex; flex-direction: column; font-size: 13px; line-height: 1.25; }
.color code { font-size: 12px; color: var(--muted); font-weight: 400; }
.range { display: flex; align-items: center; gap: 12px; }
.range input { flex: 1; max-width: 260px; accent-color: var(--ink); }
.font-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.font-grid button { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; cursor: pointer; text-align: left; }
.font-grid button b { font-size: 24px; line-height: 1.1; }
.font-grid button span { font-size: 12.5px; color: var(--muted); }
.font-grid button[aria-pressed=true] { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; margin-bottom: 20px; }
.kpi { padding: 16px; border-radius: 10px; background: var(--paper); display: flex; flex-direction: column; gap: 2px; }
.kpi span { font-size: 13px; color: var(--muted); font-weight: 600; }
.kpi b { font-size: 28px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.delta { font-size: 12.5px; font-weight: 700; color: var(--muted); }
.delta.up { color: var(--ok); }
.delta.down { color: var(--bad); }
.chart { width: 100%; height: auto; display: block; }
.chart text { font-size: 10.5px; fill: var(--muted); font-family: inherit; }
.chart .grid { stroke: #ece8e0; stroke-width: 1; }
.chart .b-views { fill: #d9d1c2; }
.chart .b-views:hover { fill: #bfb4a1; }
.chart .l-clicks { fill: none; stroke: var(--ink); stroke-width: 2; stroke-linejoin: round; }
.chart .d-clicks { fill: var(--ink); }
.chart-legend { display: flex; gap: 16px; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.lg::before { content: ''; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.lg.views::before { background: #d9d1c2; }
.lg.clicks::before { background: var(--ink); border-radius: 50%; }
.an-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; margin-top: 20px; }
.an-grid h3:first-child { margin-top: 0; }
.bars { list-style: none; padding: 0; margin: 0 0 18px; display: flex; flex-direction: column; gap: 10px; }
.bar-label { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; margin-bottom: 4px; }
.bar-label span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bars.devices .bar-label span { text-transform: capitalize; }
.bar { height: 8px; background: #f0ece4; border-radius: 99px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--ink); border-radius: 99px; min-width: 2px; }

.inline-form { display: flex; gap: 8px; align-items: stretch; }
.inline-form .input-prefix, .inline-form > input { flex: 1; margin: 0 !important; }
.inline-form .btn { height: auto; min-height: 44px; }
.stack .btn { margin-top: 4px; }
.danger-zone { border-color: #f1c9c9; }

.toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; font-size: 14px; font-weight: 500; transition: opacity .2s, transform .2s; z-index: 100; max-width: calc(100% - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.bad { background: var(--bad); }

.modal { border: 0; border-radius: 20px; padding: 28px; width: min(380px, calc(100% - 32px)); text-align: center; box-shadow: 0 30px 80px rgba(0, 0, 0, .3); }
.modal::backdrop { background: rgba(20, 17, 15, .5); }
.modal h2 { margin: 0 0 16px; font-size: 20px; }
.qr-box canvas { width: 100%; max-width: 260px; height: auto; border-radius: 12px; border: 1px solid var(--line); }
.modal p { word-break: break-all; }
.modal-actions { display: flex; justify-content: center; gap: 8px; margin-top: 16px; }

/* ---------------------------- responsive ---------------------------- */
@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; padding-top: 24px; gap: 48px; }
  .playground { justify-content: center; }
  .spec, .selfhost { grid-template-columns: 1fr; gap: 24px; }
  .dash-body { grid-template-columns: minmax(0, 1fr); }
  .dash-preview { display: none; position: static; }
  .dash.show-preview .dash-main { display: none; }
  .dash.show-preview .dash-preview { display: flex; }
  .preview-toggle { display: inline-flex; position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 30; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); }
  .dash-top { flex-wrap: wrap; gap: 10px; padding: 10px 16px; }
  .dash-top { height: auto; padding-top: 10px; }
  .tabs { order: 3; width: 100%; overflow-x: auto; height: 42px; }
  .tabs button { flex: 1; }
  .share-bar { width: calc(100% - 32px); }
  .dash-body { padding: 16px 16px 100px; }
}
@media (max-width: 640px) {
  .site-nav, .hero, .spec, .selfhost, .site-foot { padding-left: 16px; padding-right: 16px; }
  .site-nav { height: 64px; }
  .spec::before, .selfhost::before { left: 16px; right: 16px; }
  .claim { flex-direction: column; }
  .claim label { flex: none; }
  .claim .btn { width: 100%; }
  .playground { flex-direction: column; align-items: center; gap: 20px; }
  .playground .phone { transform: none; width: 280px; height: 560px; }
  .playground-controls { width: 100%; max-width: 320px; }
  .chips { flex-direction: row; flex-wrap: wrap; }
  .spec dl { grid-template-columns: 1fr; }
  .spec, .selfhost { padding-top: 48px; padding-bottom: 48px; }
  .selfhost pre { font-size: 13.5px; padding: 18px; }
  .tabs button { padding: 0 8px; font-size: 14px; }
  .add-form { grid-template-columns: 1fr; }
  .add-form .btn { height: 44px; }
  .kpis { grid-template-columns: 1fr 1fr; gap: 8px; }
  .kpi { padding: 12px; }
  .kpi b { font-size: 21px; }
  .an-grid { grid-template-columns: 1fr; }
  .sched-row { grid-template-columns: 1fr; }
  .li-tools button span { display: none; }
  .card { padding: 18px 16px; }
  .auth-card { padding: 28px 22px; }
  .inline-form { flex-direction: column; }
  .share-bar { padding: 12px 14px; }
  .save-state { display: none; }
}
