/* Spotlight Links admin, dark theme matching Spotlight Adz OS */
:root {
  --bg: #04030c; --surface: #0c0b1a; --surface-2: #141327; --surface-3: #1b1a30;
  --border: #ffffff14; --border-strong: #ffffff26;
  --text: #fbf8f5; --muted: #9c9cb1; --subtle: #6c6c82;
  --ink: #fbf8f5; --accent: #ff6f69;
  --ok: #34d399; --ok-bg: #34d3991f; --warn: #fbbf24; --warn-bg: #fbbf241a; --danger: #ff5866; --danger-bg: #ff58661a;
  --radius: 14px; --top: 60px;
  --font: 'Inter Tight', system-ui, -apple-system, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--bg); color: var(--text); font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
code { font-family: ui-monospace, Menlo, monospace; font-size: .92em; background: var(--surface-2); border: 1px solid var(--border); padding: 1px 6px; border-radius: 6px; }
::selection { background: #ff2d7a55; }

/* ── buttons ─────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; padding: 0 16px; border-radius: 12px;
  border: 1px solid var(--border-strong); background: #ffffff0a; font-weight: 500; cursor: pointer; white-space: nowrap; text-decoration: none; transition: background .15s, border-color .15s, filter .15s, transform .15s; }
.btn:hover { background: #ffffff14; }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn.primary { background: var(--text); color: #0c0b1a; border-color: var(--text); }
.btn.accent { background: var(--gradient-energy); color: #fff; border-color: transparent; box-shadow: 0 8px 26px -12px #b14bffcc; }
.btn.accent:hover:not(:disabled) { filter: brightness(1.08); }
.btn.accent:disabled { background: var(--surface-3); box-shadow: none; color: var(--muted); opacity: 1; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: #ffffff0f; }
.btn.danger { color: var(--danger); border-color: #ff586640; background: transparent; }
.btn.danger:hover { background: var(--danger-bg); }
.btn.danger-solid { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.btn.block { width: 100%; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.icon-btn { width: 36px; height: 36px; padding: 0; display: inline-grid; place-items: center; border-radius: 10px; border: 0; background: transparent; cursor: pointer; color: var(--muted); flex: none; }
.icon-btn:hover { background: #ffffff0f; color: var(--text); }
.icon-btn:disabled { opacity: .3; cursor: default; background: none; }
.icon-btn svg, .btn svg { width: 16px; height: 16px; }

/* ── fields ──────────────────────────────────────────── */
label.field, div.field { display: block; margin-bottom: 16px; }
.field > span { display: block; font-weight: 500; font-size: 13px; margin-bottom: 7px; color: #e5e2ea; }
.field small, .hint { display: block; color: var(--muted); font-size: 12.5px; margin-top: 6px; }
input[type=text], input[type=url], input[type=email], input[type=password], input[type=search], select, textarea {
  width: 100%; height: 42px; padding: 0 13px; border: 1px solid #ffffff1a; border-radius: 12px; background: #ffffff08; color: var(--text); transition: border-color .15s, box-shadow .15s, background .15s; }
input::placeholder, textarea::placeholder { color: #ffffff47; }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239c9cb1' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 16px; padding-right: 36px; }
select option { background: #141327; }
textarea { height: auto; min-height: 88px; padding: 11px 13px; resize: vertical; line-height: 1.5; }
input:hover, select:hover, textarea:hover { border-color: #ffffff2e; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); background: #ffffff0d; box-shadow: 0 0 0 3px #ff6f6926; }
input[aria-invalid=true] { border-color: var(--danger); }
.prefix { display: flex; align-items: stretch; border: 1px solid #ffffff1a; border-radius: 12px; overflow: hidden; background: #ffffff08; }
.prefix:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px #ff6f6926; }
.prefix span { display: flex; align-items: center; padding: 0 2px 0 13px; color: var(--muted); white-space: nowrap; font-size: 13px; }
.prefix input { border: 0 !important; box-shadow: none !important; padding-left: 1px; background: transparent !important; min-width: 0; }
.row { display: flex; gap: 12px; } .row > * { flex: 1; min-width: 0; }
.color { display: flex; gap: 8px; align-items: center; }
.color input[type=color] { width: 42px; height: 42px; padding: 4px; border: 1px solid #ffffff1a; border-radius: 12px; background: #ffffff08; flex: none; cursor: pointer; }
.color input[type=color]::-webkit-color-swatch-wrapper { padding: 0; } .color input[type=color]::-webkit-color-swatch { border: 0; border-radius: 8px; }
.color input[type=text] { font-family: ui-monospace, Menlo, monospace; font-size: 13px; text-transform: uppercase; }
input[type=range] { width: 100%; accent-color: #ff2d7a; height: 28px; }
.switch { position: relative; display: inline-flex; align-items: center; gap: 9px; cursor: pointer; font-weight: 500; user-select: none; min-height: 32px; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch i { width: 40px; height: 24px; border-radius: 999px; background: #ffffff1f; position: relative; transition: background .2s; flex: none; }
.switch i::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 3px #0006; }
.switch input:checked + i { background: var(--gradient-energy); }
.switch input:checked + i::after { transform: translateX(16px); }
.switch input:focus-visible + i { outline: 2px solid var(--accent); outline-offset: 2px; }
.seg { display: inline-flex; background: #ffffff08; border: 1px solid var(--border); border-radius: 12px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; padding: 7px 13px; border-radius: 9px; font-weight: 500; font-size: 13px; cursor: pointer; color: var(--muted); min-height: 34px; }
.seg button:hover { color: var(--text); }
.seg button[aria-pressed=true] { background: var(--surface-3); color: var(--text); box-shadow: 0 0 0 1px var(--border-strong) inset; }
.eyebrow { font: 500 10px/1.2 var(--font); letter-spacing: .26em; text-transform: uppercase; color: var(--muted); }

/* ── top bar ─────────────────────────────────────────── */
.topbar { height: var(--top); display: flex; align-items: center; gap: 10px; padding: 0 16px; background: #04030ce6; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 40; backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); }
.brand { display: flex; align-items: center; gap: 10px; font: 600 15px/1 var(--font-display); letter-spacing: -.01em; text-decoration: none; white-space: nowrap; }
.brand img { width: 28px; height: 28px; }
.brand em { font-style: normal; font-weight: 500; color: var(--muted); }
.topbar .spacer { flex: 1; }
.topbar .who { color: var(--muted); font-size: 13px; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600; padding: 4px 9px; border-radius: 999px; }
.badge.demo { background: var(--warn-bg); color: var(--warn); }

/* ── app grid ────────────────────────────────────────── */
.app { display: grid; grid-template-columns: 280px minmax(0, 1fr) 400px; height: calc(100vh - var(--top)); height: calc(100dvh - var(--top)); }
.app:not(.has-page) { grid-template-columns: 280px minmax(0, 1fr); }
.sidebar { border-right: 1px solid var(--border); background: #07061299; display: flex; flex-direction: column; min-height: 0; }
.sidebar-head { padding: 16px 14px 8px; display: flex; flex-direction: column; gap: 10px; }
.nav-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border-radius: 12px; border: 0; background: transparent; color: var(--muted); font-weight: 500; cursor: pointer; text-align: left; }
.nav-item svg { width: 18px; height: 18px; }
.nav-item:hover { background: #ffffff0a; color: var(--text); }
.nav-item[aria-current=true] { background: #ffffff0f; color: var(--text); box-shadow: inset 2px 0 0 #ff2d7a; }
.search { position: relative; }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--muted); pointer-events: none; }
.search input { padding-left: 36px; }
.list-meta { display: flex; justify-content: space-between; align-items: baseline; padding: 8px 4px 0; }
.list-meta .hint { margin: 0; }
.page-list { list-style: none; margin: 0; padding: 4px 8px 16px; overflow-y: auto; flex: 1; }
.page-list button { width: 100%; display: flex; align-items: center; gap: 11px; padding: 9px 10px; border: 0; background: transparent; border-radius: 12px; text-align: left; cursor: pointer; }
.page-list button:hover { background: #ffffff0a; }
.page-list button[aria-current=true] { background: #ffffff12; box-shadow: inset 2px 0 0 #ff2d7a; }
.thumb { width: 38px; height: 38px; border-radius: 11px; flex: none; object-fit: cover; display: grid; place-items: center; font-weight: 700; font-size: 15px; overflow: hidden; }
.thumb.sm { width: 28px; height: 28px; border-radius: 8px; font-size: 12px; }
.page-list .meta { min-width: 0; flex: 1; }
.page-list .name { display: block; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.page-list .slug { display: block; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: #ffffff33; display: inline-block; }
.dot.on { background: var(--ok); box-shadow: 0 0 8px #34d39988; }
.list-empty { padding: 24px 12px; color: var(--muted); text-align: center; font-size: 13px; }

/* ── editor ──────────────────────────────────────────── */
.editor { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.ed-head { padding: 14px 24px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 12px; flex-wrap: wrap; background: #07061280; }
.ed-head h2 { margin: 0; font: 600 20px/1.2 var(--font-display); letter-spacing: -.015em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ed-head .url { display: flex; align-items: center; gap: 2px; color: var(--muted); font-size: 13px; min-width: 0; }
.ed-head .url a { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-decoration: none; }
.ed-head .url a:hover { text-decoration: underline; color: var(--text); }
.ed-head .url .icon-btn { width: 30px; height: 30px; }
.ed-head .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ed-head .actions { display: flex; gap: 12px; align-items: center; }
.save-state { font-size: 12px; color: var(--muted); white-space: nowrap; }
.save-state.dirty { color: var(--warn); }
.save-state.dirty::before { content: '●'; margin-right: 5px; font-size: 9px; vertical-align: 1px; }
.guard { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 24px; background: linear-gradient(90deg, #fbbf241f, #ff2d7a14); border-bottom: 1px solid #fbbf2440; }
.guard > div { display: flex; gap: 8px; flex-wrap: wrap; }
.tabs { display: flex; gap: 4px; padding: 0 20px; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; background: #07061280; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { border: 0; background: transparent; padding: 14px 12px 12px; font-weight: 500; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs button:hover { color: var(--text); }
.tabs button[aria-selected=true] { color: var(--text); border-bottom-color: #ff2d7a; }
.panel { flex: 1; overflow-y: auto; padding: 24px; }
.panel-inner { max-width: 720px; margin: 0 auto; }
.panel-inner.wide { max-width: 1180px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 20px; margin-bottom: 16px; box-shadow: var(--shadow-card); }
.card h3 { margin: 0 0 4px; font: 600 15px/1.3 var(--font-display); letter-spacing: -.005em; }
.card > .hint:first-of-type { margin: 0 0 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.card-head h3, .card-head .hint { margin: 0; }
.danger-zone { border-color: #ff586633; }
.notice { padding: 12px 14px; border-radius: 12px; font-size: 13px; margin-bottom: 14px; }
.notice.warn { background: var(--warn-bg); color: #fde68a; border: 1px solid #fbbf2433; }
.notice.info { background: #3b82f61a; color: #bfdbfe; border: 1px solid #3b82f633; }

/* links editor */
.link-item { border: 1px solid var(--border); border-radius: 16px; background: var(--surface-2); display: flex; gap: 6px; padding: 12px 12px 12px 4px; margin-bottom: 10px; align-items: flex-start; transition: border-color .15s; }
.link-item:focus-within { border-color: var(--border-strong); }
.link-item.off { opacity: .55; }
.link-item.dragging { opacity: .35; }
.link-item.drop-before { box-shadow: 0 -3px 0 #ff2d7a; }
.link-item .handle { cursor: grab; color: var(--subtle); padding: 10px 4px; border: 0; background: none; }
.link-item .handle:active { cursor: grabbing; }
.link-item .body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.link-item .body .title-in { font-weight: 500; }
.link-item .tools { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.link-item .tools .row-b { display: flex; gap: 0; }
.link-item .tag { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .14em; color: var(--muted); }
.icon-btn.on { color: #fbbf24; }
.add-row { display: flex; gap: 8px; flex-wrap: wrap; }
.social-item { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.social-item .sic { width: 42px; height: 42px; border-radius: 12px; background: #ffffff0a; border: 1px solid var(--border); display: grid; place-items: center; flex: none; color: var(--text); }
.social-item .sic svg { width: 18px; height: 18px; }

/* profile */
.avatar-row { display: flex; gap: 16px; align-items: center; margin-bottom: 18px; flex-wrap: wrap; }
.avatar-row .thumb { width: 76px; height: 76px; border-radius: 50%; font-size: 28px; background: var(--surface-2); border: 1px solid var(--border); }
.avatar-row .btns { display: flex; gap: 8px; flex-wrap: wrap; }

/* design presets */
.presets { display: grid; grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); gap: 12px; }
.preset { border: 2px solid transparent; border-radius: 16px; padding: 3px; cursor: pointer; background: none; text-align: center; font-weight: 500; font-size: 12.5px; color: var(--muted); transition: border-color .15s, color .15s; }
.preset:hover { color: var(--text); }
.preset .sw { height: 96px; border-radius: 12px; display: flex; flex-direction: column; justify-content: center; gap: 7px; padding: 0 16px; border: 1px solid #ffffff14; }
.preset .sw i { display: block; height: 14px; }
.preset span { display: block; padding: 7px 0 3px; }
.preset[aria-pressed=true], .preset[aria-checked=true] { border-color: #ff2d7a; color: var(--text); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }

/* QR */
.qr-wrap { display: grid; grid-template-columns: 260px 1fr; gap: 24px; align-items: start; }
.qr-preview { background: #fff; border-radius: 18px; padding: 16px; }
.qr-preview svg { width: 100%; height: auto; display: block; }
.qr-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.qr-actions .btn { flex: 1; }

/* ── analytics ───────────────────────────────────────── */
.dash-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.dash-head h1 { font: 600 clamp(22px, 2.6vw, 30px)/1.15 var(--font-display); letter-spacing: -.02em; margin: 8px 0 0; max-width: 640px; text-wrap: balance; }
.dash-head h2 { font: 600 22px/1.2 var(--font-display); letter-spacing: -.015em; margin: 8px 0 0; }
.dash-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 16px 16px 14px; display: flex; flex-direction: column; gap: 4px; box-shadow: var(--shadow-card); min-width: 0; }
.kpi > span:first-child { color: var(--muted); font-size: 12.5px; font-weight: 500; }
.kpi b { font: 600 30px/1.1 var(--font-display); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi b small { font-size: 16px; color: var(--muted); font-weight: 500; }
.kpi-note { margin: 8px 0 16px; }
.delta { font-size: 12px; font-weight: 500; color: var(--muted); }
.delta.up { color: var(--ok); } .delta.down { color: #ff8a92; }
.c-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.c-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 7px; vertical-align: -1px; }
.c-legend b { color: var(--text); font-weight: 600; margin-left: 4px; font-variant-numeric: tabular-nums; }
.c-wrap { position: relative; }
.c-svg { width: 100%; height: auto; display: block; overflow: visible; touch-action: pan-y; }
.c-svg text { user-select: none; }
.c-grid { stroke: #ffffff12; stroke-width: 1; }
.c-tick { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.c-cross { stroke: #ffffff40; stroke-width: 1; stroke-dasharray: 3 3; }
.c-tip { position: absolute; top: 0; transform: translateX(-50%); background: #141327f2; border: 1px solid var(--border-strong); border-radius: 12px; padding: 9px 12px; font-size: 12px; pointer-events: none; min-width: 140px; box-shadow: 0 12px 30px #0008; backdrop-filter: blur(10px); }
.c-tip b { display: block; margin-bottom: 4px; }
.c-tip span { display: flex; align-items: center; gap: 7px; color: var(--muted); }
.c-tip span i { width: 8px; height: 8px; border-radius: 2px; }
.c-tip em { font-style: normal; margin-left: auto; color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; padding-left: 12px; }
.c-table { margin-top: 10px; }
.c-table summary { cursor: pointer; color: var(--muted); font-size: 12.5px; width: fit-content; }
.c-table summary:hover { color: var(--text); }
.c-table .tbl-scroll { max-height: 260px; overflow: auto; margin-top: 8px; }
.tbl-scroll { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; }
.tbl th, .tbl td { text-align: left; padding: 11px 8px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl th { font-size: 11px; color: var(--muted); font-weight: 500; letter-spacing: .08em; text-transform: uppercase; position: sticky; top: 0; background: var(--surface); }
.tbl td.n, .tbl th.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl.ranked tbody tr { cursor: pointer; transition: background .12s; }
.tbl.ranked tbody tr:hover, .tbl.ranked tbody tr:focus-visible { background: #ffffff08; outline: none; }
.pg { display: flex; align-items: center; gap: 10px; min-width: 0; }
.pg b { display: block; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
.pg small { color: var(--muted); font-size: 12px; }
.spark { width: 96px; height: 26px; display: block; }
.spark-empty { color: var(--subtle); }
.barlist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.bl-row { display: flex; justify-content: space-between; gap: 12px; font-size: 13.5px; margin-bottom: 6px; }
.bl-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bl-val { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.bl-val small { color: var(--muted); font-weight: 500; margin-left: 8px; }
.bl-track { height: 8px; border-radius: 4px; background: #ffffff0d; overflow: hidden; }
.bl-track i { display: block; height: 100%; border-radius: 4px; }
.hours { display: flex; align-items: flex-end; gap: 3px; height: 120px; }
.hours div { flex: 1; height: 100%; display: flex; align-items: flex-end; }
.hours i { display: block; width: 100%; border-radius: 4px 4px 1px 1px; }
.hours-x { display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; margin-top: 8px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.grid-2 > .card { margin-bottom: 0; }
.attn { list-style: none; margin: 0; padding: 0; }
.attn button { width: 100%; display: flex; align-items: center; gap: 10px; padding: 10px 8px; border: 0; border-bottom: 1px solid var(--border); background: none; text-align: left; cursor: pointer; border-radius: 0; }
.attn li:last-child button { border-bottom: 0; }
.attn button:hover { background: #ffffff06; }
.attn small { color: var(--muted); }
.grow-1 { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tag-dot { font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 999px; background: #ffffff12; color: var(--muted); white-space: nowrap; }
.tag-dot.warn { background: var(--warn-bg); color: var(--warn); }
.empty-inline { text-align: center; padding: 24px 12px; color: var(--muted); }
.list-back { display: none; }

/* ── preview ─────────────────────────────────────────── */
.preview { border-left: 1px solid var(--border); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 20px;
  background: radial-gradient(ellipse 70% 50% at 50% 40%, #7b3cf21f, transparent 70%), #07061299; min-height: 0; }
.phone { width: 320px; height: min(680px, calc(100vh - var(--top) - 90px)); height: min(680px, calc(100dvh - var(--top) - 90px)); border-radius: 46px; padding: 10px; flex: none;
  background: linear-gradient(160deg, #2a2838, #0c0b14 40%, #1a1826); box-shadow: 0 0 0 1px #ffffff1f inset, 0 30px 90px -30px #ff2d7a59; }
.phone .screen { width: 100%; height: 100%; border-radius: 37px; overflow-y: auto; overflow-x: hidden; background: #111; scrollbar-width: none; }
.phone .screen::-webkit-scrollbar { display: none; }
#pv, #cv { --minh: calc(min(680px, 100vh - var(--top) - 90px) - 20px); }
.preview-cap { margin: 14px 0 0; font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.preview-close { display: none !important; }
#pv-redirect .empty-state { color: var(--text); }
.empty-state { margin: auto; text-align: center; max-width: 360px; padding: 40px 20px; }
.empty-state h2 { font: 600 20px/1.2 var(--font-display); margin: 16px 0 6px; }
.empty-state p { color: var(--muted); margin: 0 0 20px; }

/* ── full-screen create page ─────────────────────────── */
.create { display: grid; grid-template-columns: minmax(0, 1fr) 440px; min-height: calc(100vh - var(--top)); min-height: calc(100dvh - var(--top)); }
.create-form { padding: 32px clamp(20px, 5vw, 64px) 0; max-width: 820px; width: 100%; margin: 0 auto; display: flex; flex-direction: column; }
.create-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 24px; }
.create-head .icon-btn { margin-top: 4px; border: 1px solid var(--border); }
.create-head h1 { font: 600 clamp(26px, 3.4vw, 38px)/1.1 var(--font-display); letter-spacing: -.025em; margin: 8px 0 0; }
.step { border: 0; padding: 0; margin: 0 0 32px; min-width: 0; }
.step legend { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; font: 600 18px/1.3 var(--font-display); padding: 0; margin-bottom: 16px; }
.step legend b { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--gradient-energy); font: 600 13px/1 var(--font); color: #fff; flex: none; transform: translateY(-2px); }
.step legend small { font: 400 13px/1.4 var(--font); color: var(--muted); }
.field.big input, .field.big .prefix { height: 52px; font-size: 16px; border-radius: 14px; }
.field.big .prefix input { height: 50px; }
.field.big .prefix span { font-size: 15px; padding-left: 16px; }
.field.big > span { font-size: 14px; }
#slug-status.good { color: var(--ok); } #slug-status.bad { color: #ff8a92; }
.company-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; margin-top: 12px; max-height: 300px; overflow-y: auto; padding: 2px; }
.company-grid .hint { grid-column: 1 / -1; }
.co { display: flex; align-items: center; gap: 11px; padding: 11px 12px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); text-align: left; cursor: pointer; min-width: 0; transition: border-color .15s, background .15s; }
.co:hover { border-color: var(--border-strong); background: var(--surface-2); }
.co[aria-checked=true] { border-color: #ff2d7a; background: #ff2d7a14; }
.co img, .co .co-ph { width: 36px; height: 36px; border-radius: 10px; object-fit: cover; flex: none; background: #ffffff12; display: grid; place-items: center; font-weight: 700; }
.co span { min-width: 0; } .co b { display: block; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.co small { display: block; color: var(--muted); font-size: 12px; text-transform: capitalize; }
.presets.big { grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); }
.presets.big .sw { height: 110px; }
.create-foot { position: sticky; bottom: 0; margin: auto -8px 0; padding: 24px 8px calc(16px + env(safe-area-inset-bottom)); display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  background: linear-gradient(transparent, var(--bg) 35%); }
.create-foot .hint { margin: 0; }
.create-actions { display: flex; gap: 10px; }
.create-actions .btn { height: 46px; padding: 0 22px; font-size: 15px; }
.create-preview { position: sticky; top: var(--top); height: calc(100vh - var(--top)); height: calc(100dvh - var(--top)); display: flex; flex-direction: column; align-items: center; justify-content: center;
  border-left: 1px solid var(--border); background: radial-gradient(ellipse 70% 50% at 50% 40%, #ff2d7a1a, transparent 70%), #07061299; }
.form-error { color: #ff8a92; background: #ff586614; border: 1px solid #ff586633; padding: 11px 14px; border-radius: 12px; margin: 0 0 18px; }

/* ── toasts ──────────────────────────────────────────── */
.mobile-bar { display: none; }
.toasts { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 100; pointer-events: none; width: max-content; max-width: calc(100vw - 32px); }
.toast { background: #141327; border: 1px solid var(--border-strong); color: var(--text); padding: 12px 18px; border-radius: 14px; font-weight: 500; box-shadow: 0 12px 30px #000a; animation: tin .2s ease; }
.toast::before { content: '✓'; margin-right: 8px; color: var(--ok); }
.toast.err { border-color: #ff586666; } .toast.err::before { content: '!'; color: var(--danger); font-weight: 700; }
@keyframes tin { from { opacity: 0; transform: translateY(8px); } }
@media (prefers-reduced-motion: reduce) { .toast { animation: none; } * { transition: none !important; } }
.mobile-only { display: none !important; }

/* ── wide screens ────────────────────────────────────── */
@media (min-width: 1600px) {
  .app { grid-template-columns: 300px minmax(0, 1fr) 460px; }
  .app:not(.has-page) { grid-template-columns: 300px minmax(0, 1fr); }
  .panel { padding: 32px; }
  .panel-inner { max-width: 800px; }
  .phone { width: 340px; }
  .create { grid-template-columns: minmax(0, 1fr) 520px; }
}
/* ── laptops ─────────────────────────────────────────── */
@media (max-width: 1280px) {
  .app { grid-template-columns: 250px minmax(0, 1fr) 360px; }
  .app:not(.has-page) { grid-template-columns: 250px minmax(0, 1fr); }
  .phone { width: 296px; }
  .create { grid-template-columns: minmax(0, 1fr) 380px; }
}
@media (max-width: 1180px) { .grid-2 { grid-template-columns: 1fr; } }
/* ── tablets: list + editor, preview as a full-screen overlay ── */
@media (max-width: 1080px) {
  .app, .app:not(.has-page) { grid-template-columns: 240px minmax(0, 1fr); }
  .preview { display: none; }
  .app.show-preview .preview { display: flex; position: fixed; inset: var(--top) 0 0; z-index: 35; background: #04030cf7; backdrop-filter: blur(10px); border: 0; }
  .app.show-preview .preview-close { display: inline-flex !important; position: absolute; top: 14px; right: 14px; }
  .mobile-bar:not([hidden]) { display: flex; gap: 10px; position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 36;
    padding: 8px; border-radius: 18px; background: #0c0b1af0; border: 1px solid var(--border-strong); box-shadow: 0 16px 40px #000c; backdrop-filter: blur(20px); }
  .mobile-bar .btn { height: 44px; min-width: 140px; }
  .ed-head .hide-sm { display: none !important; }
  .panel { padding-bottom: 110px; }
  .create { grid-template-columns: 1fr; }
  .create-preview { display: none; }
  .hide-md { display: none; }
  .qr-wrap { grid-template-columns: 220px 1fr; }
  .toasts { bottom: 96px; }
}
/* ── phones: one screen at a time ────────────────────── */
@media (max-width: 720px) {
  :root { --top: 56px; }
  body { font-size: 15px; }
  input[type=text], input[type=url], input[type=email], input[type=password], input[type=search], select { font-size: 16px; height: 46px; }
  textarea { font-size: 16px; }
  .app, .app:not(.has-page) { display: block; height: auto; min-height: calc(100dvh - var(--top)); }
  .sidebar { border-right: 0; min-height: calc(100dvh - var(--top)); background: transparent; }
  .page-list button { padding: 12px 10px; }
  .app.has-page .sidebar { display: none; }
  .app:not(.has-page) .editor { display: none; }
  .app.show-overview:not(.has-page) .sidebar { display: none; }
  .app.show-overview:not(.has-page) .editor { display: flex; }
  .list-back { display: inline-flex; margin-bottom: 12px; }
  .ed-head .mobile-only[data-act=back] { display: inline-grid !important; }
  .ed-head { padding: 10px 12px 10px 6px; position: sticky; top: var(--top); z-index: 20; background: #04030cf2; backdrop-filter: blur(16px); gap: 8px; }
  .ed-head h2 { font-size: 17px; }
  .ed-head .actions { gap: 8px; }
  .ed-head .save-state { display: none; }
  .tabs { position: sticky; top: calc(var(--top) + 64px); z-index: 19; background: #04030cf2; backdrop-filter: blur(16px); padding: 0 8px; }
  .tabs button { padding: 13px 11px 11px; }
  .guard { padding: 12px 14px; } .guard > div { width: 100%; } .guard .btn { flex: 1; }
  .panel { overflow: visible; padding: 14px 12px 120px; }
  .card { padding: 16px; border-radius: 18px; }
  .grid2, .row { grid-template-columns: 1fr; flex-direction: column; gap: 0; }
  .link-item { flex-wrap: wrap; padding: 12px; }
  .link-item .handle { display: none; }
  .link-item .tools { flex-direction: row; width: 100%; justify-content: space-between; align-items: center; }
  .link-item .tools .icon-btn { width: 42px; height: 42px; }
  .qr-wrap { grid-template-columns: 1fr; }
  .qr-preview { max-width: 280px; width: 100%; margin: 0 auto; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { padding: 14px; } .kpi b { font-size: 24px; }
  .dash-actions { width: 100%; flex-direction: column; align-items: stretch; } .dash-actions .seg { display: flex; flex-wrap: nowrap; } .dash-actions .seg button { flex: 1; white-space: nowrap; } .dash-actions .btn { height: 44px; }
  .hide-sm { display: none !important; }
  .pg b { max-width: 170px; } .pg .thumb { display: none; } .pg small { display: block; }
  .tbl th, .tbl td { padding: 10px 6px; } .tbl.ranked th:first-child, .tbl.ranked td:first-child { padding-left: 0; } .tbl.ranked th:last-child, .tbl.ranked td:last-child { padding-right: 0; }
  .topbar { padding: 0 12px; } .topbar .who { display: none; }
  .brand em { display: none; }
  .mobile-bar:not([hidden]) { left: 12px; right: 12px; transform: none; bottom: calc(12px + env(safe-area-inset-bottom)); }
  .mobile-bar .btn { flex: 1; min-width: 0; }
  .phone { width: min(320px, calc(100vw - 48px)); height: min(640px, calc(100dvh - var(--top) - 150px)); }
  .create-form { padding-top: 20px; }
  .company-grid { grid-template-columns: 1fr; max-height: 260px; }
  .presets.big { grid-template-columns: repeat(2, 1fr); }
  .create-foot { flex-direction: column; align-items: stretch; }
  .create-actions .btn { flex: 1; }
  .step legend { font-size: 17px; }
}

/* login (Spotlight Adz OS style) */
.login { --border: #ffffff14; --border-strong: #ffffff26; min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; background: var(--background); color: var(--foreground); font-family: var(--font-body); color-scheme: dark; }
.login-aside { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; padding: 36px 40px; border-right: 1px solid var(--border);
  background: radial-gradient(ellipse 60% 50% at 20% 10%, #7b3cf238, transparent 70%), radial-gradient(ellipse 50% 40% at 90% 100%, #ff3d2e2e, transparent 70%),
  linear-gradient(#ffffff08 1px, transparent 1px) 0 0 / 56px 56px, linear-gradient(90deg, #ffffff08 1px, transparent 1px) 0 0 / 56px 56px, var(--background); }
.login-brand { display: inline-flex; align-items: center; gap: 10px; padding: 8px 16px 8px 10px; border-radius: 999px; border: 1px solid var(--border-strong); background: #ffffff08; text-decoration: none; width: fit-content; }
.login-brand img { width: 24px; height: 24px; }
.login-brand b { display: block; font-size: 13px; font-weight: 600; }
.login-brand small { display: block; font-size: 8px; letter-spacing: .24em; color: var(--muted-foreground); }
.login-copy h2 { font: 600 clamp(36px, 4vw, 52px)/1.04 var(--font-display); letter-spacing: -.03em; margin: 20px 0 14px; max-width: 520px; }
.login-copy p { color: var(--muted-foreground); max-width: 420px; margin: 0; font-size: 15px; }
.login-foot { display: flex; justify-content: space-between; }
.login-foot .live::before { content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #ff2d7a; box-shadow: 0 0 10px #ff2d7a; margin-right: 8px; vertical-align: 1px; }
.login-main { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 40px 20px;
  background: radial-gradient(ellipse 50% 40% at 50% 30%, #ff2d7a1f, transparent 70%), var(--background); }
.login form { position: relative; width: 100%; max-width: 420px; border-radius: 28px; padding: 36px 32px 28px; }
.login-orb { position: absolute; top: -22px; left: 50%; transform: translateX(-50%); filter: drop-shadow(0 0 18px #ff2d7a99); }
.login h1 { font: 600 26px/1.15 var(--font-display); letter-spacing: -.02em; margin: 10px 0 6px; color: var(--foreground); }
.login .sub { color: var(--muted-foreground); margin: 0 0 22px; font-size: 14px; }
.login .field > span { margin-bottom: 8px; }
.login input[type=email], .login input[type=password] { height: 48px; border-radius: 18px; background: #ffffff08; border: 1px solid #ffffff1a; color: #fff; padding: 0 16px; }
.login input::placeholder { color: #ffffff4d; }
.login input:focus { border-color: #ff6f69; box-shadow: 0 0 0 3px #ff6f6929; }
.login .b-btn { width: 100%; height: 48px; margin-top: 6px; font-size: 15px; }
.login .b-btn:disabled { opacity: .6; cursor: wait; }
.login .note { margin: 18px 0 0; padding: 12px 14px; border-radius: 14px; background: #ffffff06; border: 1px solid var(--border); color: var(--muted-foreground); font-size: 12.5px; }
.login .form-error { color: #ff8a92; background: #ff586614; border: 1px solid #ff586633; padding: 10px 12px; border-radius: 12px; margin: 0 0 14px; }
.login .back { color: var(--muted-foreground); font-size: 12px; letter-spacing: .2em; text-transform: uppercase; text-decoration: none; }
.login .back:hover { color: var(--foreground); }
@media (max-width: 860px) { .login { grid-template-columns: 1fr; } .login-aside { display: none; } }

