/* ==========================================================================
   Decifile user panel — shared stylesheet (every app page uses this)
   1 tokens · 2 base · 3 shell (banner, sidebar, topbar) · 4 buttons/forms
   5 cards, KPIs, badges · 6 tables, tabs, lists · 7 overlays · 8 page parts
   9 auth + onboarding · 10 report preview/print · 11 responsive
   ========================================================================== */

/* 1. TOKENS ---------------------------------------------------------------- */
:root {
  --indigo-700: #2F25B3; --indigo-600: #3B2FD9; --indigo-400: #7C74FF; --indigo-100: #E6E4FD; --indigo-50: #F0EFFE;
  --teal-600: #0FA88C; --teal-500: #14C8A8; --teal-100: #D9F7F1; --teal-50: #EAFBF8;
  --ink: #0F1226; --ink-2: #3A3F5C; --muted: #6B7194; --faint: #9AA0BF;
  --surface: #fff; --line: #E6E8F2; --line-2: #D9DCEC; --bg: #F7F8FC; --white: #fff;
  --amber: #F5A524; --amber-50: #FEF3DC; --amber-ink: #8A5A00;
  --red: #E5484D; --red-50: #FDEBEC; --red-ink: #B3262B; --green-ink: #0A7F69;
  --font-display: "Plus Jakarta Sans", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --r-sm: 6px; --r-md: 8px; --r-lg: 12px;
  --shadow-pop: 0 14px 40px -12px rgba(15, 18, 38, .28), 0 2px 6px rgba(15, 18, 38, .06);
  --sidebar-w: 256px; --topbar-h: 60px;
}

/* 2. BASE ------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 400 14px/1.55 var(--font-body); color: var(--ink-2); background: var(--white); -webkit-font-smoothing: antialiased; }
img, svg { max-width: 100%; }
a { color: var(--indigo-600); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { font-family: var(--font-display); color: var(--ink); margin: 0; letter-spacing: -0.02em; line-height: 1.2; }
h1 { font-size: 1.75rem; font-weight: 800; letter-spacing: -0.03em; }
h2 { font-size: 1.125rem; font-weight: 700; }
h3 { font-size: 1rem; font-weight: 700; }
h4 { font-size: .875rem; font-weight: 700; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
button { font-family: inherit; }
:focus-visible { outline: 3px solid var(--indigo-400); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); } .ink { color: var(--ink); } .nowrap { white-space: nowrap; } .right { text-align: right; }
.skip-link { position: absolute; left: 12px; top: -60px; background: var(--ink); color: #fff; padding: 8px 12px; border-radius: 8px; z-index: 300; }
.skip-link:focus { top: 8px; text-decoration: none; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* 3. SHELL ----------------------------------------------------------------- */
.banner { display: flex; align-items: center; gap: 14px; padding: 10px 24px; font-size: .875rem; background: var(--amber-50); color: var(--amber-ink); border-bottom: 1px solid #F3D99B; }
.banner.danger { background: var(--red-50); color: var(--red-ink); border-color: #F6C9CB; }
.banner b { font-weight: 700; }
.banner .spacer { flex: 1; }
.banner a { font-weight: 700; color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.banner button { background: none; border: 0; color: inherit; font-size: 1.25rem; line-height: 1; cursor: pointer; padding: 0 4px; opacity: .7; }
.app { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; align-self: start; height: 100vh; overflow-y: auto; background: var(--surface); border-right: 1px solid var(--line); padding: 14px 12px 12px; display: flex; flex-direction: column; z-index: 40; }
.sidebar .logo { display: flex; align-items: center; padding: 6px 8px 14px; }
.sidebar .logo img { height: 26px; width: auto; }
.ws { position: relative; }
.ws-btn { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); cursor: pointer; text-align: left; }
.ws-btn:hover { background: var(--bg); }
.avatar { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; font: 800 .6875rem var(--font-display); color: #fff; background: var(--indigo-600); flex: none; }
.avatar.round { border-radius: 50%; }
.ws-btn .ws-name { flex: 1; min-width: 0; line-height: 1.25; }
.ws-btn .ws-name b { display: block; color: var(--ink); font-size: .8125rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ws-btn .ws-name span { font-size: .75rem; color: var(--muted); }
.caret { width: 12px; height: 12px; color: var(--muted); flex: none; }
.nav-section { margin-top: 20px; }
.nav-title { padding: 0 10px 6px; font-size: .75rem; font-weight: 600; color: var(--faint); }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: var(--r-md); color: var(--ink-2); font-weight: 500; font-size: .875rem; text-decoration: none; }
.nav-item:hover { background: var(--bg); text-decoration: none; color: var(--ink); }
.nav-item.active { background: var(--indigo-50); color: var(--indigo-600); font-weight: 700; }
.nav-item svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.nav-item .count { margin-left: auto; background: var(--red); color: #fff; font-size: .6875rem; font-weight: 700; border-radius: 999px; padding: 1px 7px; }
.nav-item .dot-warn { margin-left: auto; width: 8px; height: 8px; border-radius: 50%; background: var(--amber); }
.sidebar .grow { flex: 1; }
.plan-card { margin-top: 20px; border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px; background: var(--bg); }
.plan-card b { color: var(--ink); font-family: var(--font-display); }
.plan-card .bar { height: 6px; background: var(--line); border-radius: 999px; margin: 10px 0 8px; overflow: hidden; }
.plan-card .bar i { display: block; height: 100%; background: var(--indigo-600); border-radius: 999px; }
.plan-card small { color: var(--muted); }
.app-main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 30; height: var(--topbar-h); display: flex; align-items: center; gap: 12px; padding: 0 28px; background: rgba(255, 255, 255, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.menu-btn { display: none; }
.search { position: relative; flex: 0 1 460px; }
.search input { width: 100%; height: 38px; padding: 0 14px 0 38px; border: 1px solid var(--line); background: var(--bg); border-radius: var(--r-md); font: 400 .875rem var(--font-body); color: var(--ink); }
.search input:focus { outline: 0; border-color: var(--indigo-600); background: var(--surface); box-shadow: 0 0 0 4px var(--indigo-100); }
.search svg { position: absolute; left: 12px; top: 10px; width: 18px; height: 18px; stroke: var(--muted); fill: none; stroke-width: 2; stroke-linecap: round; }
.search kbd { position: absolute; right: 10px; top: 8px; font: 600 .6875rem var(--font-body); color: var(--muted); border: 1px solid var(--line-2); border-radius: 5px; padding: 2px 6px; background: var(--surface); }
.search-results { position: absolute; left: 0; right: 0; top: 44px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-pop); padding: 6px; display: none; max-height: 360px; overflow: auto; }
.search-results.open { display: block; }
.search-results a { display: flex; justify-content: space-between; gap: 12px; padding: 9px 10px; border-radius: var(--r-md); color: var(--ink); font-weight: 500; }
.search-results a:hover, .search-results a.sel { background: var(--bg); text-decoration: none; }
.search-results small { color: var(--muted); }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.icon-btn { position: relative; width: 36px; height: 36px; display: grid; place-items: center; border: 0; background: none; border-radius: var(--r-md); color: var(--ink-2); cursor: pointer; }
.icon-btn:hover { background: var(--bg); text-decoration: none; }
.icon-btn svg { width: 19px; height: 19px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn .pip { position: absolute; top: 7px; right: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--red); border: 2px solid #fff; }
.fab { width: 34px; height: 34px; border-radius: 50%; background: var(--indigo-600); color: #fff; border: 0; display: grid; place-items: center; cursor: pointer; margin-left: 4px; }
.fab:hover { background: var(--indigo-700); }
.fab svg { width: 18px; height: 18px; stroke: #fff; fill: none; stroke-width: 2.4; stroke-linecap: round; }
.content { padding: 32px 28px 72px; width: 100%; max-width: 1240px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head p { margin-top: 6px; color: var(--muted); max-width: 62ch; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.crumbs { font-size: .8125rem; color: var(--muted); margin-bottom: 10px; }
.crumbs a { color: var(--muted); } .crumbs span { margin: 0 6px; }

/* 4. BUTTONS + FORMS ------------------------------------------------------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: var(--r-md); border: 1px solid transparent; font: 600 .875rem var(--font-body); cursor: pointer; text-decoration: none; white-space: nowrap; transition: background .12s, border-color .12s; }
.btn:hover { text-decoration: none; }
.btn svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn-primary { background: var(--indigo-600); color: #fff; } .btn-primary:hover { background: var(--indigo-700); }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--line-2); } .btn-secondary:hover { background: var(--bg); }
.btn-ghost { background: none; color: var(--ink-2); } .btn-ghost:hover { background: var(--bg); }
.btn-danger { background: var(--surface); color: var(--red-ink); border-color: #F1B4B7; } .btn-danger:hover { background: var(--red-50); }
.btn-danger-solid { background: var(--red); color: #fff; } .btn-danger-solid:hover { background: #cc3a3f; }
.btn-lg { height: 44px; padding: 0 20px; font-size: .9375rem; }
.btn-sm { height: 30px; padding: 0 10px; font-size: .8125rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.field { margin-bottom: 16px; }
.field label, .label { display: block; font-weight: 600; font-size: .8125rem; color: var(--ink); margin-bottom: 6px; }
.input, .select, .textarea { width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: var(--r-md); font: 400 .9375rem var(--font-body); color: var(--ink); background: var(--surface); }
.textarea { height: auto; min-height: 100px; padding: 10px 12px; }
.input:focus, .select:focus, .textarea:focus { outline: 0; border-color: var(--indigo-600); box-shadow: 0 0 0 4px var(--indigo-100); }
.input[aria-invalid="true"] { border-color: var(--red); }
.hint { font-size: .8125rem; color: var(--muted); margin-top: 6px; }
.error-text { font-size: .8125rem; color: var(--red-ink); margin-top: 6px; display: none; } .error-text.show { display: block; }
.checkbox { display: flex; gap: 10px; align-items: flex-start; font-size: .875rem; color: var(--ink-2); cursor: pointer; }
.checkbox input { width: 16px; height: 16px; margin-top: 3px; accent-color: var(--indigo-600); }
.toggle { position: relative; width: 38px; height: 22px; flex: none; }
.toggle input { position: absolute; inset: 0; opacity: 0; cursor: pointer; margin: 0; z-index: 1; }
.toggle i { position: absolute; inset: 0; border-radius: 999px; background: var(--line-2); transition: background .15s; }
.toggle i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--surface); box-shadow: 0 1px 2px rgba(0, 0, 0, .25); transition: transform .15s; }
.toggle input:checked + i { background: var(--indigo-600); } .toggle input:checked + i::after { transform: translateX(16px); }
.toggle input:focus-visible + i { outline: 3px solid var(--indigo-400); outline-offset: 2px; }
.toggle input:disabled { cursor: not-allowed; } .toggle input:disabled + i { opacity: .5; }

/* 5. CARDS, KPIS, BADGES --------------------------------------------------- */
.card { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.card-body { padding: 20px; }
.card-foot { padding: 12px 20px; border-top: 1px solid var(--line); font-size: .8125rem; color: var(--muted); }
.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.side { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.stack > * + * { margin-top: 16px; }
.section-gap { margin-top: 28px; }
.kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.kpi { border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px 18px 14px; background: var(--surface); }
.kpi .k-label { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: .8125rem; font-weight: 500; }
.kpi .k-value { font: 800 1.625rem var(--font-display); color: var(--ink); letter-spacing: -0.03em; margin-top: 6px; }
.kpi .k-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; margin-top: 4px; }
.kpi .k-prev { font-size: .75rem; color: var(--muted); }
.kpi .k-spark { width: 96px; height: 34px; flex: none; }
.kpi .k-spark svg { width: 100%; height: 100%; display: block; }
.delta { display: inline-flex; align-items: center; gap: 4px; font-size: .75rem; font-weight: 700; padding: 1px 7px; border-radius: 999px; }
.delta.good { background: var(--teal-100); color: var(--green-ink); } .delta.bad { background: var(--red-50); color: var(--red-ink); } .delta.flat { background: var(--bg); color: var(--muted); }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px; font-size: .75rem; font-weight: 700; background: var(--bg); color: var(--ink-2); white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85; }
.badge.plain::before { display: none; }
.badge.good { background: var(--teal-100); color: var(--green-ink); } .badge.watch { background: var(--amber-50); color: var(--amber-ink); }
.badge.problem { background: var(--red-50); color: var(--red-ink); } .badge.info { background: var(--indigo-50); color: var(--indigo-700); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.chip { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--surface); font: 600 .8125rem var(--font-body); color: var(--ink); cursor: pointer; }
.chip:hover { background: var(--bg); }
.chip .v { color: var(--indigo-600); }
.chip[aria-pressed="true"], .chip.on { background: var(--indigo-50); border-color: var(--indigo-400); color: var(--indigo-700); }
.chip svg { width: 11px; height: 11px; stroke: var(--muted); fill: none; stroke-width: 2; }

/* The decode block: the signature three-part summary */
.decode { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); overflow: hidden; }
.decode-col { padding: 20px 22px; border-right: 1px solid var(--line); }
.decode-col:last-child { border-right: 0; }
.decode-col h3 { display: flex; align-items: center; gap: 10px; font-size: .9375rem; margin-bottom: 8px; }
.decode-col h3 i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.decode-col p { font-size: .9375rem; line-height: 1.6; color: var(--ink-2); }
.decode-col .num { color: var(--ink); font-weight: 700; }
.decode-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 22px; background: var(--bg); border: 1px solid var(--line); border-bottom: 0; border-radius: var(--r-lg) var(--r-lg) 0 0; font-size: .8125rem; color: var(--muted); }
.decode-bar + .decode { border-radius: 0 0 var(--r-lg) var(--r-lg); }
.i-indigo { background: var(--indigo-600); } .i-amber { background: var(--amber); } .i-teal { background: var(--teal-500); } .i-red { background: var(--red); }

/* 6. TABLES, TABS, LISTS --------------------------------------------------- */
.table-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: .875rem; }
.tbl th { text-align: left; font-weight: 600; font-size: .75rem; color: var(--muted); padding: 10px 16px; background: var(--bg); border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl th.num, .tbl td.num { text-align: right; }
.tbl td { padding: 14px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover { background: #FBFBFE; }
.tbl .cell-main { display: flex; align-items: center; gap: 10px; }
.tbl .cell-main b { color: var(--ink); font-weight: 600; display: block; }
.tbl .cell-main small { color: var(--muted); font-size: .75rem; }
.tbl a.row-link { color: var(--ink); font-weight: 600; }
.sort { cursor: pointer; user-select: none; } .sort:hover { color: var(--ink); }
.sort[aria-sort="ascending"]::after { content: " \2191"; } .sort[aria-sort="descending"]::after { content: " \2193"; }
.tabs { display: flex; gap: 24px; border-bottom: 1px solid var(--line); margin-bottom: 24px; overflow-x: auto; }
.tab { padding: 10px 0; border: 0; background: none; font: 600 .875rem var(--font-body); color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tab:hover { color: var(--ink); } .tab[aria-selected="true"] { color: var(--indigo-600); border-bottom-color: var(--indigo-600); }
.tab-panel[hidden] { display: none; }
.seg { display: inline-flex; padding: 3px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-md); }
.seg button { border: 0; background: none; padding: 5px 12px; border-radius: 6px; font: 600 .8125rem var(--font-body); color: var(--muted); cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(15, 18, 38, .12); }
.list > li { display: flex; gap: 14px; align-items: flex-start; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.list > li:last-child { border-bottom: 0; }
.list .grow { flex: 1; min-width: 0; }
.list b { color: var(--ink); font-weight: 600; }
.list small { color: var(--muted); display: block; font-size: .8125rem; margin-top: 2px; }
.sev { width: 8px; align-self: stretch; border-radius: 4px; flex: none; }
.sev.critical { background: var(--red); } .sev.warning { background: var(--amber); } .sev.info { background: var(--indigo-600); }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.checklist li { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--line); }
.checklist li:last-child { border-bottom: 0; }
.checklist input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--indigo-600); }
.checklist li.done span { text-decoration: line-through; color: var(--faint); }

/* 7. OVERLAYS -------------------------------------------------------------- */
.menu { position: absolute; z-index: 60; min-width: 220px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-pop); padding: 6px; display: none; }
.menu.open { display: block; }
.menu a, .menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; background: none; border-radius: var(--r-md); font: 500 .875rem var(--font-body); color: var(--ink); text-align: left; cursor: pointer; text-decoration: none; }
.menu a:hover, .menu button:hover { background: var(--bg); text-decoration: none; }
.menu .menu-label { padding: 8px 10px 4px; font-size: .75rem; font-weight: 600; color: var(--faint); }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }
.menu .check { margin-left: auto; color: var(--indigo-600); font-weight: 800; }
.menu.wide { min-width: 340px; }
.pop-anchor { position: relative; display: inline-block; }
.notif-item { display: block !important; }
.notif-item small { display: block; color: var(--muted); font-size: .75rem; }
.backdrop { position: fixed; inset: 0; background: rgba(15, 18, 38, .45); display: none; align-items: center; justify-content: center; padding: 20px; z-index: 100; }
.backdrop.open { display: flex; }
.modal { width: 100%; max-width: 480px; background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-pop); max-height: 90vh; overflow: auto; }
.modal-head { padding: 22px 24px 0; } .modal-body { padding: 12px 24px 4px; } .modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 20px 24px 24px; }
.toasts { position: fixed; right: 20px; bottom: 20px; display: grid; gap: 10px; z-index: 200; }
.toast { background: var(--ink); color: #fff; padding: 12px 16px; border-radius: var(--r-lg); box-shadow: var(--shadow-pop); font-weight: 500; max-width: 360px; animation: toast-in .2s ease-out; }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
.chart-tip { position: absolute; z-index: 5; pointer-events: none; background: var(--ink); color: #fff; border-radius: 10px; padding: 8px 10px; font-size: .75rem; min-width: 150px; box-shadow: var(--shadow-pop); }
.chart-tip b { display: block; margin-bottom: 4px; }
.chart-tip .tip-row { display: flex; align-items: center; gap: 6px; line-height: 1.7; }
.chart-tip .tip-row i, .chart-legend i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
.chart-tip em { margin-left: auto; font-style: normal; font-weight: 700; padding-left: 12px; }
.chart-legend { display: flex; gap: 16px; font-size: .75rem; color: var(--muted); padding: 6px 0 0 52px; }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }

/* 8. PAGE PARTS ------------------------------------------------------------ */
.empty { text-align: center; padding: 48px 24px; }
.empty img { width: 320px; max-width: 100%; height: auto; margin: 0 auto 8px; }
.empty h3 { margin-bottom: 6px; } .empty p { color: var(--muted); max-width: 44ch; margin: 0 auto 18px; }
.gauge-wrap { text-align: center; }
.gauge-svg { width: 100%; max-width: 280px; display: block; margin: 0 auto; }
.gauge-score { font: 800 2.5rem var(--font-display); color: var(--ink); letter-spacing: -0.04em; margin-top: -42px; position: relative; }
.gauge-score small { font: 600 1rem var(--font-body); color: var(--muted); letter-spacing: 0; }
.check-row { display: flex; align-items: flex-start; gap: 14px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.check-row:last-child { border-bottom: 0; }
.state { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; flex: none; margin-top: 1px; }
.state svg { width: 14px; height: 14px; stroke-width: 3; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.state.ok { background: var(--teal-100); } .state.ok svg { stroke: var(--green-ink); }
.state.warn { background: var(--amber-50); } .state.warn svg { stroke: var(--amber-ink); }
.state.fail { background: var(--red-50); } .state.fail svg { stroke: var(--red-ink); }
details.guide { margin-top: 10px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--bg); }
details.guide summary { padding: 9px 12px; cursor: pointer; font-weight: 600; color: var(--indigo-600); list-style: none; }
details.guide summary::-webkit-details-marker { display: none; }
details.guide ol { margin: 0; padding: 0 16px 14px 34px; } details.guide li { margin-top: 6px; }
.rule-row { display: flex; align-items: center; gap: 16px; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.rule-row:last-child { border-bottom: 0; }
.rule-row .grow { flex: 1; } .rule-row b { color: var(--ink); display: block; font-weight: 600; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.setting-row:last-child { border-bottom: 0; }
.setting-row b { display: block; color: var(--ink); font-weight: 600; } .setting-row small { color: var(--muted); font-size: .8125rem; }
.hub-title { margin: 32px 0 4px; } .hub-sub { color: var(--muted); margin-bottom: 14px; }
.hub-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.hub-card { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); font-weight: 600; color: var(--ink); text-decoration: none; cursor: pointer; text-align: left; font-size: .9375rem; }
.hub-card:hover { background: var(--bg); text-decoration: none; }
.hub-card .hi { width: 32px; height: 32px; border-radius: 8px; background: var(--bg); display: grid; place-items: center; flex: none; }
.hub-card .hi svg { width: 18px; height: 18px; stroke: var(--ink-2); fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.plan-opt { border: 1px solid var(--line); border-radius: var(--r-lg); padding: 22px; background: var(--surface); display: flex; flex-direction: column; }
.plan-opt.current { border: 2px solid var(--indigo-600); }
.plan-opt .price { font: 800 1.875rem var(--font-display); color: var(--ink); letter-spacing: -0.03em; margin: 8px 0 12px; } .plan-opt .price small { font: 500 .8125rem var(--font-body); color: var(--muted); letter-spacing: 0; }
.plan-opt ul { flex: 1; margin-bottom: 16px; } .plan-opt li { padding: 4px 0 4px 22px; position: relative; }
.plan-opt li::before { content: "\2713"; position: absolute; left: 0; color: var(--teal-600); font-weight: 800; }
.acc-card { display: flex; align-items: center; gap: 14px; }
.lock { display: inline-flex; align-items: center; gap: 6px; font-size: .75rem; font-weight: 700; color: var(--indigo-700); background: var(--indigo-50); padding: 2px 8px; border-radius: 999px; }
.info-i { display: inline-grid; place-items: center; width: 15px; height: 15px; border-radius: 50%; border: 1.5px solid var(--faint); color: var(--faint); font-size: .625rem; font-weight: 800; cursor: help; }
.sync-row { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .8125rem; }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--teal-500); box-shadow: 0 0 0 0 rgba(20, 200, 168, .5); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(20, 200, 168, 0); } 100% { box-shadow: 0 0 0 0 rgba(20, 200, 168, 0); } }

/* 9. AUTH + ONBOARDING ----------------------------------------------------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.auth-main { display: flex; flex-direction: column; padding: 28px 48px; background: var(--surface); }
.auth-top { display: flex; align-items: center; justify-content: space-between; }
.auth-top img { height: 28px; width: auto; }
.auth-card { margin: auto; width: 100%; max-width: 400px; padding: 40px 0; }
.auth-card h1 { font-size: 1.75rem; margin-bottom: 8px; } .auth-card > p { color: var(--muted); margin-bottom: 28px; }
.divider { display: flex; align-items: center; gap: 14px; color: var(--muted); font-size: .8125rem; margin: 22px 0; }
.divider::before, .divider::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.btn-social { width: 100%; height: 44px; background: var(--surface); border: 1px solid var(--line-2); color: var(--ink); margin-bottom: 10px; }
.btn-social:hover { background: var(--bg); }
.btn-social svg { width: 18px; height: 18px; stroke: none; fill: currentColor; }
.auth-foot { text-align: center; color: var(--muted); font-size: .875rem; margin-top: 24px; }
.auth-legal { font-size: .75rem; color: var(--faint); text-align: center; }
.auth-art { position: relative; overflow: hidden; background: linear-gradient(160deg, #F4F3FF 0%, #EAFBF8 100%); display: flex; align-items: flex-end; }
.auth-art img.ribbon { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.auth-quote { position: relative; margin: 0 48px 56px; background: rgba(255, 255, 255, .92); border: 1px solid var(--line); border-radius: 16px; padding: 22px; max-width: 420px; box-shadow: var(--shadow-pop); }
.auth-quote h3 { margin-bottom: 10px; font-size: .9375rem; }
.auth-quote .line { display: grid; grid-template-columns: 10px 1fr; gap: 10px; margin-top: 10px; font-size: .875rem; }
.auth-quote .line i { width: 8px; height: 8px; border-radius: 50%; margin-top: 7px; }
.pw-wrap { position: relative; } .pw-wrap .input { padding-right: 64px; }
.pw-wrap button { position: absolute; right: 8px; top: 7px; border: 0; background: none; color: var(--indigo-600); font: 600 .8125rem var(--font-body); cursor: pointer; padding: 4px 6px; }
.stepper { display: flex; gap: 8px; margin-bottom: 28px; }
.stepper li { flex: 1; height: 4px; border-radius: 4px; background: var(--line); }
.stepper li.on { background: var(--indigo-600); }
.onb { min-height: 100vh; background: var(--bg); display: flex; flex-direction: column; }
.onb-top { display: flex; justify-content: space-between; align-items: center; padding: 20px 32px; }
.onb-top img { height: 28px; width: auto; }
.onb-card { margin: 8px auto 64px; width: calc(100% - 40px); max-width: 640px; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 36px; box-shadow: 0 20px 50px -30px rgba(47, 37, 179, .35); }
.onb-card h1 { font-size: 1.625rem; margin-bottom: 8px; } .onb-card > p, .onb-card .step-intro { color: var(--muted); margin-bottom: 24px; }
.onb-card .illus { margin: 4px auto 24px; max-width: 420px; }
.pick-list { display: grid; gap: 10px; margin-bottom: 20px; }
.pick { display: flex; align-items: center; gap: 14px; border: 1px solid var(--line-2); border-radius: var(--r-lg); padding: 14px 16px; cursor: pointer; background: var(--surface); }
.pick:hover { background: var(--bg); } .pick:has(input:checked) { border-color: var(--indigo-600); background: var(--indigo-50); }
.pick input { accent-color: var(--indigo-600); width: 16px; height: 16px; }
.pick .grow { flex: 1; } .pick b { color: var(--ink); display: block; }
.perm { display: grid; gap: 10px; margin-bottom: 24px; }
.perm li { display: flex; gap: 10px; align-items: flex-start; }
.perm li svg { width: 18px; height: 18px; flex: none; margin-top: 1px; stroke: var(--teal-600); fill: none; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.perm li.no svg { stroke: var(--red); }
.progress { height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; margin: 16px 0 8px; }
.progress i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--indigo-600), var(--teal-500)); border-radius: 999px; transition: width .5s; }
.sync-steps li { display: flex; gap: 10px; align-items: center; padding: 6px 0; color: var(--muted); }
.sync-steps li.done { color: var(--ink); } .sync-steps li .tick { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line-2); flex: none; display: grid; place-items: center; }
.sync-steps li.done .tick { background: var(--teal-500); border-color: var(--teal-500); } .sync-steps li.done .tick::after { content: ""; width: 5px; height: 9px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg) translate(-1px, -1px); }

/* 10. REPORT PREVIEW + PRINT ----------------------------------------------- */
.paper-wrap { background: var(--bg); padding: 32px; border-radius: var(--r-lg); border: 1px solid var(--line); overflow-x: auto; }
.paper { width: 794px; max-width: 100%; margin: 0 auto; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 20px 50px -28px rgba(15, 18, 38, .35); padding: 48px; min-height: 1000px; }
.paper header { display: flex; justify-content: space-between; align-items: flex-start; padding-bottom: 20px; border-bottom: 2px solid var(--ink); }
.paper header img { height: 28px; width: auto; }
.paper h1 { font-size: 1.5rem; margin: 24px 0 4px; } .paper .sub { color: var(--muted); }
.paper .p-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 24px 0; }
.paper .p-kpi { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.paper .p-kpi small { color: var(--muted); display: block; } .paper .p-kpi b { font: 800 1.25rem var(--font-display); color: var(--ink); }
.paper h2 { margin: 28px 0 10px; font-size: 1rem; }
.paper .p-decode { display: grid; gap: 12px; }
.paper .p-decode div { display: grid; grid-template-columns: 14px 1fr; gap: 10px; }
.paper .p-decode i { width: 10px; height: 10px; border-radius: 50%; margin-top: 6px; }
.paper footer { margin-top: 36px; padding-top: 12px; border-top: 1px solid var(--line); font-size: .75rem; color: var(--muted); display: flex; justify-content: space-between; }
@media print {
  .banner, .sidebar, .topbar, .no-print, .toasts { display: none !important; }
  .app { display: block; } .content { padding: 0; max-width: none; }
  .paper-wrap { padding: 0; border: 0; background: var(--surface); } .paper { border: 0; box-shadow: none; width: 100%; padding: 0; }
  @page { size: A4; margin: 16mm; }
}

/* 11. RESPONSIVE ----------------------------------------------------------- */
@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.side { grid-template-columns: 1fr; }
  .hub-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 960px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; width: 280px; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow-pop); }
  body.nav-open .sidebar { transform: none; }
  body.nav-open::after { content: ""; position: fixed; inset: 0; background: rgba(15, 18, 38, .4); z-index: 35; }
  .menu-btn { display: grid; }
  .topbar { padding: 0 16px; } .content { padding: 24px 16px 64px; }
  .search kbd { display: none; }
  .decode { grid-template-columns: 1fr; } .decode-col { border-right: 0; border-bottom: 1px solid var(--line); } .decode-col:last-child { border-bottom: 0; }
  .auth { grid-template-columns: 1fr; } .auth-art { display: none; } .auth-main { padding: 20px; }
  .grid.cols-3 { grid-template-columns: 1fr; } .grid.cols-2 { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .kpis { grid-template-columns: 1fr; } .hub-grid { grid-template-columns: 1fr; }
  .search { flex: 1; } .top-actions .hide-sm { display: none; }
  .onb-card { padding: 24px 20px; } .paper { padding: 24px; } .paper .p-kpis { grid-template-columns: repeat(2, 1fr); }
  .card-head { flex-wrap: wrap; }
}

/* Menu positioning (appended): menus open below their trigger */
.pop-anchor > .menu, .ws > .menu { top: calc(100% + 6px); left: 0; }
.pop-anchor > .menu.right { left: auto; right: 0; }
.pop-anchor > .menu svg { flex: none; }

/* small fixes */
.tbl .cell-main a.row-link { display: block; }
.gauge-wrap .gauge-score { margin-top: 10px; }
.stepper { list-style: none; padding: 0; margin-left: 0; }
.stepper li::marker { content: ""; }
.onb-card h1:focus, .auth-card h1:focus { outline: none; }
.onb-card .illus { display: block; width: 100%; max-width: 520px; height: auto; margin: 4px auto 20px; }

/* ==========================================================================
   12. DENSITY + WIDTH (compact, Stripe-like). Everything fills the screen.
   ========================================================================== */
html { font-size: 13.5px; }
body { font-size: 1rem; }
:root { --sidebar-w: 232px; --topbar-h: 52px; }
.content { max-width: none; padding: 24px 32px 56px; }
.topbar { padding: 0 24px; }
.search input { height: 34px; font-size: .9rem; } .search svg { top: 8px; width: 17px; height: 17px; } .search kbd { top: 6px; }
.icon-btn { width: 32px; height: 32px; } .icon-btn svg { width: 18px; height: 18px; }
.fab { width: 30px; height: 30px; }
.sidebar { padding: 12px 10px; }
.sidebar .logo img { height: 24px; }
.nav-item { padding: 6px 10px; gap: 10px; font-size: .9rem; } .nav-item svg { width: 17px; height: 17px; }
.avatar { width: 26px; height: 26px; font-size: .625rem; }
.page-head { margin-bottom: 18px; } .page-head h1 { font-size: 1.6rem; } .page-head p { margin-top: 4px; }
.btn { height: 32px; padding: 0 12px; font-size: .9rem; } .btn-lg { height: 40px; } .btn-sm { height: 28px; padding: 0 9px; font-size: .85rem; }
.input, .select, .textarea { height: 36px; font-size: .95rem; }
.chip { height: 28px; padding: 0 11px; font-size: .85rem; }
.card-head { padding: 12px 16px; } .card-head h2 { font-size: 1.05rem; } .card-body { padding: 16px; } .card-foot { padding: 10px 16px; }
.grid { gap: 14px; } .kpis { gap: 14px; }
.kpi { padding: 12px 14px 10px; } .kpi .k-value { font-size: 1.5rem; margin-top: 4px; } .kpi .k-spark { width: 84px; height: 28px; }
.decode-col { padding: 16px 18px; } .decode-col p { font-size: .95rem; line-height: 1.55; } .decode-bar { padding: 10px 18px; }
.tbl th { padding: 8px 14px; } .tbl td { padding: 10px 14px; font-size: .95rem; white-space: nowrap; }
.tbl .cell-main small { display: block; }
.list > li { padding: 12px 16px; } .check-row { padding: 12px 16px; } .rule-row { padding: 12px 16px; } .setting-row { padding: 12px 16px; }
.hub-card { padding: 12px 14px; } .plan-opt { padding: 18px; }
.tabs { margin-bottom: 18px; }
.table-wrap { overflow-x: auto; }

/* Row actions: icon buttons */
.row-actions { display: flex; align-items: center; justify-content: flex-end; gap: 2px; }
.icon-btn.sm { width: 28px; height: 28px; border: 1px solid transparent; }
.icon-btn.sm svg { width: 16px; height: 16px; }
.icon-btn.sm:hover { background: var(--indigo-50); color: var(--indigo-600); border-color: var(--indigo-100); }
.icon-btn.sm.danger:hover { background: var(--red-50); color: var(--red-ink); border-color: #F6C9CB; }
.icon-btn[title]:hover::after { content: attr(title); position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; font: 600 .75rem var(--font-body); padding: 4px 8px; border-radius: 6px; white-space: nowrap; pointer-events: none; z-index: 60; }
.btn svg.lead, .btn .ic { margin-left: -2px; }

/* Pagination */
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem; }
.pager .pg-size { display: flex; align-items: center; gap: 8px; }
.pager select { height: 28px; border: 1px solid var(--line-2); border-radius: var(--r-sm); background: var(--surface); font: 500 .9rem var(--font-body); color: var(--ink); padding: 0 6px; }
.pager .pg-nav { display: flex; align-items: center; gap: 4px; }
.pager .pg-btn { min-width: 28px; height: 28px; padding: 0 8px; border: 1px solid var(--line-2); background: var(--surface); border-radius: var(--r-sm); font: 600 .85rem var(--font-body); color: var(--ink); cursor: pointer; display: inline-grid; place-items: center; }
.pager .pg-btn:hover:not([disabled]) { background: var(--bg); }
.pager .pg-btn[aria-current="page"] { background: var(--indigo-600); border-color: var(--indigo-600); color: #fff; }
.pager .pg-btn[disabled] { opacity: .45; cursor: not-allowed; }
.pager .pg-gap { padding: 0 4px; }
@media (max-width: 640px) { .content { padding: 18px 16px 48px; } }

.tbl th, .tbl td { padding-left: 12px; padding-right: 12px; }
.tbl td:last-child, .tbl th:last-child { padding-right: 16px; } .tbl td:first-child, .tbl th:first-child { padding-left: 16px; }
.kpis.k4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } .kpis.k4.more { margin-top: 14px; }

/* ==========================================================================
   13. TRIAGE, STATES, GOALS, POLISH
   ========================================================================== */
body { font-variant-numeric: tabular-nums; }
.tbl td.num, .kpi .k-value, .gauge-score { font-variant-numeric: tabular-nums lining-nums; }
.delta.neutral { color: var(--muted); background: var(--bg); }
.spark-dot { position: absolute; width: 7px; height: 7px; border-radius: 50%; border: 2px solid #fff; box-sizing: content-box; transform: translate(-50%, -50%); box-shadow: 0 0 0 1px rgba(15,18,38,.08); pointer-events: none; }
.chart-legend i.dia { width: 8px; height: 8px; border-radius: 1px; transform: rotate(45deg); }

/* Status line */
.statusline { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); margin-bottom: 14px; }
.statusline .si { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.statusline .si svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.statusline.ok .si { background: var(--teal-100); color: var(--green-ink); }
.statusline.warn .si { background: var(--amber-50); color: var(--amber-ink); }
.statusline.stale .si { background: var(--red-50); color: var(--red-ink); }
.statusline b { color: var(--ink); display: block; font-size: 1.05rem; font-family: var(--font-display); letter-spacing: -0.01em; }
.statusline .grow { flex: 1; min-width: 0; } .statusline .grow span { color: var(--muted); }
.statusline .sync-row { margin-left: auto; white-space: nowrap; }

/* Insights (triage) */
.insights > li { display: grid; grid-template-columns: 6px minmax(0, 1fr) auto; gap: 14px; align-items: start; }
.insights .sev { align-self: stretch; }
.insights .i-title { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.insights .i-title a { color: var(--ink); font-weight: 700; }
.insights p { color: var(--ink-2); margin-top: 4px; max-width: 78ch; }
.insights .i-meta { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin-top: 8px; color: var(--muted); font-size: .9rem; }
.risk { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px; background: var(--red-50); color: var(--red-ink); font-weight: 700; font-size: .85rem; }
.risk.opp { background: var(--teal-100); color: var(--green-ink); } .risk.low { background: var(--bg); color: var(--muted); }
.insights details.how { margin-top: 8px; }
.insights details.how summary { cursor: pointer; color: var(--indigo-600); font-weight: 600; font-size: .9rem; list-style: none; display: inline-flex; align-items: center; gap: 4px; }
.insights details.how summary::-webkit-details-marker { display: none; }
.insights details.how summary::before { content: "+"; display: inline-grid; place-items: center; width: 14px; font-weight: 800; }
.insights details.how[open] summary::before { content: "\2212"; }
.insights details.how ul { margin: 8px 0 0; padding: 10px 14px; background: var(--bg); border-radius: var(--r-md); display: grid; gap: 4px; color: var(--ink-2); }
.insights details.how li { padding-left: 14px; position: relative; } .insights details.how li::before { content: ""; position: absolute; left: 0; top: .6em; width: 5px; height: 5px; border-radius: 50%; background: var(--faint); }
.insights .i-actions { display: flex; align-items: center; gap: 6px; }
.insights li.is-hidden { opacity: .6; }
.toast-action { margin-left: 14px; background: none; border: 0; color: #B9B4FF; font: 700 .9rem var(--font-body); cursor: pointer; text-decoration: underline; }

/* Goals */
.goal-row { padding: 10px 16px; border-bottom: 1px solid var(--line); } .goal-row:last-child { border-bottom: 0; }
.goal-row .g-top { display: flex; justify-content: space-between; gap: 10px; }
.goal-row b { color: var(--ink); }
.goal-bar { position: relative; height: 6px; background: var(--line); border-radius: 999px; margin: 8px 0 6px; }
.goal-bar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 999px; background: var(--teal-500); }
.goal-bar i.amber { background: var(--amber); } .goal-bar i.red { background: var(--red); }
.goal-bar::after { content: ""; position: absolute; left: 66.67%; top: -3px; bottom: -3px; width: 2px; background: var(--ink); border-radius: 2px; }
.goal-row small { color: var(--muted); }
.k-sub { margin-top: 6px; font-size: .85rem; color: var(--muted); } .k-sub.good { color: var(--green-ink); } .k-sub.bad { color: var(--red-ink); }

/* Accounts table: pin + health dots */
.pin { border: 0; background: none; cursor: pointer; padding: 4px; border-radius: 6px; color: var(--faint); display: inline-grid; place-items: center; }
.pin:hover { background: var(--bg); color: var(--amber); } .pin[aria-pressed="true"] { color: var(--amber); }
.pin svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linejoin: round; } .pin[aria-pressed="true"] svg { fill: currentColor; }
.hdot { margin-left: auto; width: 8px; height: 8px; border-radius: 50%; flex: none; } .hdot.red { background: var(--red); } .hdot.green { background: var(--teal-500); } .hdot + .check { margin-left: 8px; }

/* Skeleton + states */
.skel { position: relative; overflow: hidden; background: var(--line); border-radius: var(--r-md); min-height: 14px; }
.skel::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255,255,255,.65), transparent); transform: translateX(-100%); animation: shimmer 1.4s infinite; }
@keyframes shimmer { to { transform: translateX(100%); } }
.skel-card { border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px; background: var(--surface); }
.callout { display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; border-radius: var(--r-lg); border: 1px solid var(--indigo-100); background: var(--indigo-50); color: var(--indigo-700); margin-bottom: 14px; }
.callout b { color: var(--ink); } .callout .grow { flex: 1; } .callout.danger { background: var(--red-50); border-color: #F6C9CB; color: var(--red-ink); }
.callout .progress { margin: 8px 0 0; max-width: 360px; }
.stale { opacity: .6; filter: grayscale(.4); }
.freshness { margin-top: 28px; padding-top: 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem; display: flex; flex-wrap: wrap; gap: 6px 16px; }
.preview-states { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; margin-top: 8px; color: var(--faint); font-size: .85rem; }
.preview-states a { color: var(--muted); text-decoration: underline; }
.demo-pill { position: fixed; left: 16px; bottom: 16px; z-index: 120; display: flex; align-items: center; gap: 12px; padding: 8px 8px 8px 14px; background: var(--ink); color: #fff; border-radius: 999px; font-size: .9rem; box-shadow: var(--shadow-pop); }
.demo-pill a { color: #fff; background: rgba(255,255,255,.16); padding: 4px 10px; border-radius: 999px; font-weight: 600; }
kbd { font: 600 .8rem var(--font-body); border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 5px; padding: 1px 6px; background: var(--surface); color: var(--ink); }
.kbd-table td { padding: 8px 0; border-bottom: 1px solid var(--line); } .kbd-table td.num { white-space: nowrap; }
.menu.pop { padding: 8px; min-width: 220px; } .menu.pop .checkbox { padding: 6px 8px; border-radius: 6px; } .menu.pop .checkbox:hover { background: var(--bg); }
.view-chip { display: inline-flex; align-items: center; gap: 8px; }

/* Column chooser: hide columns by class on the table */
.hide-status [data-col="status"], .hide-spend [data-col="spend"], .hide-results [data-col="results"], .hide-cpr [data-col="cpr"], .hide-ctr [data-col="ctr"], .hide-freq [data-col="freq"], .hide-health [data-col="health"] { display: none; }

/* Phones: tables become stacked cards */
@media (max-width: 720px) {
  .tbl.stack thead { display: none; }
  .tbl.stack, .tbl.stack tbody, .tbl.stack tr, .tbl.stack td { display: block; width: 100%; }
  .tbl.stack tr { padding: 12px 14px; border-bottom: 1px solid var(--line); }
  .tbl.stack td { border: 0; padding: 4px 0; display: flex; justify-content: space-between; align-items: center; gap: 12px; text-align: right; white-space: normal; }
  .tbl.stack td::before { content: attr(data-label); color: var(--muted); font-size: .85rem; font-weight: 500; text-align: left; }
  .tbl.stack td:first-child { display: block; text-align: left; padding-bottom: 8px; } .tbl.stack td:first-child::before { display: none; }
  .tbl.stack td:last-child::before { display: none; } .tbl.stack td:last-child { justify-content: flex-end; }
  .tbl.stack td.num { text-align: right; }
  .insights > li { grid-template-columns: 6px minmax(0, 1fr); } .insights .i-actions { grid-column: 2; flex-wrap: wrap; }
  .statusline { flex-wrap: wrap; } .statusline .sync-row { margin-left: 40px; }
  .page-head .actions { width: 100%; } .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .decode { grid-template-columns: 1fr; } .decode-col { border-right: 0; border-bottom: 1px solid var(--line); } .decode-col:last-child { border-bottom: 0; }
  .grid.cols-2, .grid.cols-3, .grid.side { grid-template-columns: 1fr; }
}
.col-stack > * + * { margin-top: 16px; }
.menu-sep { height: 1px; background: var(--line); margin: 4px 0; }
.views-menu { min-width: 220px; }
[hidden] { display: none !important; }
.insights .sev { width: 4px; }
@media (max-width: 1100px) { .kpis.k4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .kpis.k4 .k-spark { display: none; } }
.grid > *, .card { min-width: 0; }
.table-wrap { overflow-x: auto; }

/* ==== v2 fixed shell: only the content area scrolls ==== */
body.has-shell { height: 100vh; height: 100dvh; overflow: hidden; display: flex; flex-direction: column; }
body.has-shell > #banner { flex: none; position: relative; z-index: 60; }
body.has-shell .app { flex: 1; min-height: 0; grid-template-rows: minmax(0, 1fr); }
body.has-shell .sidebar { position: relative; height: 100%; }
body.has-shell .app-main { overflow-y: auto; min-height: 0; scroll-behavior: auto; }
body.has-shell .content { padding-bottom: 32px; }
@media (max-width: 960px) { body.has-shell .sidebar { position: fixed; top: 0; height: 100%; z-index: 90; } }
@media print { body.has-shell { height: auto; overflow: visible; display: block; } body.has-shell .app-main { overflow: visible; } }
.modal { overscroll-behavior: contain; }
.legal-foot { padding: 14px 0 4px; margin-top: 24px; border-top: 1px solid var(--line); color: var(--muted); font-size: .8125rem; }
.sidebar .legal-mini { margin-top: 10px; padding: 0 8px; color: var(--faint); font-size: .72rem; line-height: 1.4; }
/* custom select arrow, inset from the border */
select, .select { -webkit-appearance: none; appearance: none; padding-right: 34px !important; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none' stroke='%236B7194' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; background-size: 11px 7px; }
.pager select { padding-right: 28px !important; background-position: right 9px center; }

/* ==== v2 pages: breakdowns, ads, pacing, utm ==== */
.share-cell { display: grid; grid-template-columns: auto 70px 34px; gap: 8px; align-items: center; justify-content: end; }
.share-bar { display: block; height: 6px; background: var(--line); border-radius: 999px; overflow: hidden; } .share-bar b { display: block; height: 100%; background: var(--indigo-400); border-radius: 999px; }
.share-cell small { color: var(--muted); }
.ad-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 14px; }
.ad-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; display: flex; flex-direction: column; }
.thumb { position: relative; height: 120px; display: grid; place-items: center; }
.thumb svg { width: 34px; height: 34px; fill: none; stroke: var(--indigo-600); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; opacity: .75; }
.thumb .fmt { position: absolute; left: 10px; top: 10px; background: rgba(255,255,255,.85); border-radius: 999px; padding: 1px 9px; font-size: .75rem; font-weight: 600; color: var(--ink); }
.ad-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.ad-top { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.ad-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; margin: 10px 0 0; }
.ad-stats dt { font-size: .75rem; color: var(--muted); } .ad-stats dd { margin: 0; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.ad-note { margin-top: 8px; font-size: .85rem; color: var(--ink-2); padding-top: 8px; border-top: 1px solid var(--line); }
.pace-bar { height: 10px; margin: 6px 0 8px; } .pace-bar::after { display: none; }
.pace-bar em { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--ink); border-radius: 2px; }
.pace-legend { display: flex; flex-wrap: wrap; gap: 4px 20px; color: var(--muted); font-size: .85rem; }
.chk { display: grid; gap: 8px; } .chk li { display: flex; gap: 10px; align-items: flex-start; }
.chk .ci { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; flex: none; margin-top: 1px; }
.chk .ci svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.chk .ok .ci { background: var(--teal-100); color: var(--green-ink); } .chk .fail .ci { background: var(--red-50); color: var(--red-ink); } .chk .warn .ci { background: var(--amber-50); color: var(--amber-ink); } .chk .info .ci { background: var(--indigo-50); color: var(--indigo-600); }
.code-out { margin: 4px 0 0; padding: 10px 12px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-md); font: 500 .85rem ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; word-break: break-all; color: var(--ink); }
code { font: 500 .85em ui-monospace, Menlo, monospace; background: var(--bg); padding: 1px 6px; border-radius: 6px; }
.tagpill { display: inline-block; padding: 0 8px; border-radius: 999px; background: var(--indigo-50); color: var(--indigo-600); font-size: .75rem; font-weight: 600; margin-right: 4px; }
.lq-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; } .lq-grid .input { text-align: right; }
@media (max-width: 720px) { .share-cell { grid-template-columns: auto 60px 30px; } #pace-kpis { grid-template-columns: 1fr !important; } }

/* ==== v2 dark mode ==== */
html[data-theme="dark"] {
  --surface: #14172F; --white: #0C0E22; --bg: #0F1228; --ink: #ECEEF9; --ink-2: #B7BCD9; --muted: #8C92B6; --faint: #6B7198; --line: #262A4B; --line-2: #343A63;
  --indigo-50: #1C1F4D; --indigo-100: #272B6B; --indigo-600: #8F88FF; --indigo-700: #A9A4FF; --indigo-400: #7C74FF; --teal-100: #0F3B37; --teal-50: #0C2E2C; --amber-50: #3A2B0B; --amber-ink: #F5C46B; --red-50: #3C1519; --red-ink: #FF8B90; --green-ink: #4FE0C2;
  color-scheme: dark;
}
html[data-theme="dark"] .sidebar .logo img, html[data-theme="dark"] .auth-top img { content: url(../images/logo-full-white.png); }
html[data-theme="dark"] .banner { border-color: #4a3a12; } html[data-theme="dark"] .banner.danger { border-color: #5a2328; }
html[data-theme="dark"] .empty img, html[data-theme="dark"] .auth-art img, html[data-theme="dark"] .onb img { mix-blend-mode: normal; filter: brightness(.82) saturate(.9); border-radius: 12px; }
html[data-theme="dark"] .topbar { background: rgba(12, 14, 34, .9); }
html[data-theme="dark"] .btn-primary { color: #fff; background: #4B3FEA; } html[data-theme="dark"] .btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--line-2); }
html[data-theme="dark"] .goal-bar::after, html[data-theme="dark"] .pace-bar em { background: var(--ink); }
html[data-theme="dark"] .thumb { filter: brightness(.55) saturate(1.1); }
html[data-theme="dark"] .thumb .fmt { color: #0F1226; }
html[data-theme="dark"] .skel::after { background: linear-gradient(90deg, transparent, rgba(255,255,255,.08), transparent); }
html[data-theme="dark"] .seg button[aria-pressed="true"] { background: var(--indigo-100); color: var(--ink); }
html[data-theme="dark"] .toast { background: #ECEEF9; color: #0F1226; }
html[data-theme="dark"] .paper { background: #fff; color: #3A3F5C; --ink: #0F1226; --ink-2: #3A3F5C; --muted: #6B7194; --line: #E6E8F2; --surface: #fff; --indigo-50: #F0EFFE; --teal-100: #D9F7F1; --amber-50: #FEF3DC; --red-50: #FDEBEC; --amber-ink: #8A5A00; --red-ink: #B3262B; --green-ink: #0A7F69; --bg: #F7F8FC; }
.card-head .cell-main { display: flex; align-items: center; gap: 10px; }
.topbar { flex: none; } .app-main > .content { flex: none; }

/* ==== v4 shell: account switcher in top bar, tooltips, logo rule, no page-switch flash ==== */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .12s; }
#sidebar { view-transition-name: app-sidebar; } #topbar { view-transition-name: app-topbar; }
html:has(body.has-shell) { overflow: hidden; }
.sidebar .logo { border-bottom: 1px solid var(--line); margin: 0 0 10px; padding: 6px 8px 14px; opacity: 1; }
.topbar { justify-content: space-between; }
.top-actions { margin-left: auto; gap: 4px; }
.top-sep { width: 1px; height: 22px; background: var(--line); margin: 0 6px; }
.acc-btn { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 10px 0 5px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--surface); color: var(--ink); font: 600 .875rem var(--font-body); cursor: pointer; max-width: 240px; position: relative; }
.acc-btn:hover { background: var(--bg); } .acc-btn .avatar { width: 24px; height: 24px; border-radius: 50%; }
.acc-btn .acc-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .acc-btn .caret { width: 12px; height: 12px; flex: none; color: var(--muted); }
.acc-switch > .menu { top: calc(100% + 8px); left: auto; right: 0; min-width: 280px; }
.menu-user { display: flex; gap: 12px; align-items: center; padding: 12px 14px 10px; text-align: left; }
.menu-user .avatar { width: 38px; height: 38px; font-size: .8rem; flex: none; }
.menu-user b { display: block; color: var(--ink); } .menu-user small { color: var(--muted); font-size: .8125rem; }
.user-menu a { display: flex; align-items: center; gap: 10px; } .user-menu a svg { width: 17px; height: 17px; fill: none; stroke: var(--muted); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.pop-anchor > .menu.right, .acc-switch > .menu.right { right: 0; left: auto; }
.avatar-btn { padding: 0; }
/* instant, readable tooltips */
[data-tip] { position: relative; }
[data-tip]::after { content: attr(data-tip); position: absolute; top: calc(100% + 8px); left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; font: 600 .75rem/1 var(--font-body); padding: 7px 10px; border-radius: 7px; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .12s ease .15s; z-index: 400; box-shadow: 0 6px 16px -6px rgba(15, 18, 38, .5); }
[data-tip]:hover::after, [data-tip]:focus-visible::after { opacity: 1; }
[data-tip][aria-expanded="true"]::after { display: none; }
.top-actions .pop-anchor:last-child [data-tip]::after, .top-actions .pop-anchor:nth-last-child(2) [data-tip]::after { left: auto; right: 0; transform: none; }
.menu-btn[data-tip]::after { left: 0; transform: none; }
html[data-theme="dark"] [data-tip]::after { background: #ECEEF9; color: #0F1226; }
@media (max-width: 960px) { .acc-btn .acc-name { display: none; } .acc-btn { padding: 0 8px 0 5px; } .top-sep { display: none; } [data-tip]::after { display: none; } }
@media (max-width: 640px) { .topbar { padding: 0 12px; gap: 4px; } .top-actions .icon-btn[aria-label="Help and support"] { display: none; } }

/* ==== profile + help ==== */
.profile-head { display: flex; gap: 14px; align-items: center; margin-bottom: 18px; }
.avatar.lg { width: 56px; height: 56px; font-size: 1.1rem; }
.help-hero .card-body { padding: 24px; } .help-hero h2 { margin-bottom: 12px; font-size: 1.25rem; }
.faq-list details { border-bottom: 1px solid var(--line); } .faq-list details:last-child { border-bottom: 0; }
.faq-list summary { cursor: pointer; padding: 14px 18px; font-weight: 600; color: var(--ink); list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq-list summary::-webkit-details-marker { display: none; } .faq-list summary::after { content: "+"; color: var(--muted); font-weight: 700; font-size: 1.2rem; line-height: 1; } .faq-list details[open] summary::after { content: "\2212"; }
.faq-list details p { padding: 0 18px 16px; max-width: 80ch; color: var(--ink-2); } .faq-list details[hidden] { display: none; }
.help-link { transition: border-color .15s; } .help-link:hover { border-color: var(--indigo-400); text-decoration: none; } .help-link p { margin-top: 4px; }
.tk-list { padding: 0; } .tk-item { padding: 0; display: block !important; } .tk-item button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 16px; border: 0; background: none; text-align: left; cursor: pointer; font: inherit; color: inherit; }
.tk-item button:hover, .tk-item.sel button { background: var(--bg); } .tk-item small { display: block; color: var(--muted); }
.thread { padding: 14px 16px; display: grid; gap: 12px; max-height: 420px; overflow-y: auto; }
.msg { max-width: 88%; } .msg.you { justify-self: end; } .msg-meta { font-size: .78rem; color: var(--muted); margin-bottom: 3px; } .msg.you .msg-meta { text-align: right; }
.msg-body { padding: 10px 13px; border-radius: 12px; background: var(--bg); color: var(--ink); } .msg.you .msg-body { background: var(--indigo-50); }
.msg-file { margin-top: 6px; font-size: .82rem; color: var(--muted); display: flex; gap: 6px; align-items: center; } .msg-file svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; }
.reply textarea { width: 100%; }

/* ==== campaign tree ==== */
.tree .tr-set td { background: var(--bg); font-weight: 600; } .tree .tr-ad td:first-child { padding-left: 46px; }
.tree .tr-ad[hidden] { display: none; }
.tree-btn { width: 24px; height: 24px; border: 0; background: none; border-radius: 6px; cursor: pointer; vertical-align: middle; margin-right: 4px; color: var(--muted); display: inline-grid; place-items: center; }
.tree-btn:hover { background: var(--line); } .tree-btn svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.4; transition: transform .15s; } .tree-btn[aria-expanded="true"] svg { transform: rotate(90deg); }
.lvl { display: inline-block; font: 700 .6875rem var(--font-body); text-transform: uppercase; letter-spacing: .04em; padding: 1px 7px; border-radius: 6px; margin-right: 6px; }
.lvl-set { background: var(--indigo-50); color: var(--indigo-600); } .lvl-ad { background: var(--line); color: var(--muted); }
@media (max-width: 720px) { .tree .tr-ad td:first-child { padding-left: 14px; } .tree .tr-ad { background: var(--bg); } }

/* ==== billing ==== */
.cur-plan { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; align-items: flex-start; }
.cur-meta { display: flex; gap: 32px; flex-wrap: wrap; align-items: flex-start; } .cur-meta p { margin: 0; }
.plan-grid .plan-opt { display: flex; flex-direction: column; gap: 8px; padding: 18px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.plan-opt.current { border-color: var(--indigo-600); box-shadow: 0 0 0 3px var(--indigo-100); }
.plan-opt .price { font: 800 1.9rem var(--font-display); color: var(--ink); margin-top: 4px; } .plan-opt .price small { font: 400 .8rem var(--font-body); color: var(--muted); }
.check-sm { display: grid; gap: 6px; margin: 8px 0 12px; flex: 1; } .check-sm li { position: relative; padding-left: 22px; font-size: .9rem; } .check-sm li::before { content: ""; position: absolute; left: 3px; top: .45em; width: 10px; height: 6px; border-left: 2px solid var(--teal-600); border-bottom: 2px solid var(--teal-600); transform: rotate(-45deg); }
.pay-note { display: flex; gap: 8px; align-items: center; font-size: .85rem; } .pay-note svg { width: 16px; height: 16px; flex: none; fill: none; stroke: var(--green-ink); stroke-width: 2; }
.pm-row { display: flex; gap: 12px; align-items: center; } .pm-ico { width: 40px; height: 40px; border-radius: 10px; background: var(--indigo-50); display: grid; place-items: center; flex: none; } .pm-ico svg { width: 20px; height: 20px; fill: none; stroke: var(--indigo-600); stroke-width: 1.8; }
.rz-head { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); margin-bottom: 6px; } .rz-head b { color: var(--ink); }
.rz-amt { font: 800 2rem var(--font-display); color: var(--ink); margin-bottom: 10px; } .rz-amt small { font: 400 .85rem var(--font-body); color: var(--muted); margin-left: 6px; }
.rz-methods { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; } .rz-m { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: var(--r-md); cursor: pointer; } .rz-m:has(input:checked) { border-color: var(--indigo-600); background: var(--indigo-50); } .rz-m small { display: block; color: var(--muted); }
.table-wrap { position: relative; }
@media (max-width: 640px) {
  .statusline { flex-wrap: wrap; align-items: flex-start; }
  .statusline .grow { flex: 1 1 calc(100% - 56px); min-width: 0; }
  .statusline .grow b, .statusline .grow span { display: block; }
  .statusline .sync-row { flex-basis: 100%; padding-left: 52px; }
}

/* ==== v6 fixes ==== */
.menu svg { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sidebar .logo { padding-bottom: 8px; } .sidebar .logo + .nav-section, .sidebar .logo ~ .nav-section:first-of-type { margin-top: 8px; }
.btn, .icon-btn, .menu-btn, .btn-sm, .btn-lg, .acc-btn, .seg button, .tree-btn, .pin { border-radius: 0 !important; }
.thumb { border: 0; padding: 0; width: 100%; cursor: zoom-in; }
.thumb:hover { filter: brightness(.97); }
.mini-thumb { width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 4px; display: inline-grid; place-items: center; vertical-align: middle; margin: 0 6px 0 0; padding: 0; cursor: zoom-in; }
.mini-thumb svg { width: 18px; height: 18px; fill: none; stroke: var(--indigo-600); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.mini-thumb:hover { border-color: var(--indigo-600); }
.tree .tr-ad td:first-child { white-space: nowrap; }
.lightbox { position: fixed; inset: 0; z-index: 200; background: rgba(15,18,38,.72); display: grid; place-items: center; padding: 16px; overflow-y: auto; }
.lb-card { position: relative; width: min(520px, 100%); background: var(--surface); border-radius: 8px; overflow: hidden; box-shadow: 0 24px 60px rgba(0,0,0,.4); }
.lb-close { position: absolute; top: 10px; right: 10px; z-index: 2; width: 36px; height: 36px; border: 0; background: rgba(15,18,38,.75); color: #fff; font-size: 1.5rem; line-height: 1; cursor: pointer; border-radius: 0; }
.lb-art { position: relative; display: grid; place-items: center; aspect-ratio: 1/1; }
.lb-art.tall { aspect-ratio: 9/14; max-height: 62vh; } .lb-art.wide { aspect-ratio: 16/10; }
.lb-art svg { width: 72px; height: 72px; fill: none; stroke: var(--indigo-600); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; opacity: .8; }
.lb-art .fmt { position: absolute; left: 12px; top: 12px; background: rgba(255,255,255,.9); padding: 2px 10px; font-size: .75rem; font-weight: 600; color: var(--indigo-600); }
.lb-play { position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); background: rgba(15,18,38,.75); color: #fff; padding: 4px 14px; font-size: .8rem; }
.lb-info { padding: 14px 16px 16px; display: grid; gap: 6px; }
/* phone: compact banner, no clipping */
@media (max-width: 640px) {
  .banner { padding: 6px 12px; gap: 8px; font-size: .8125rem; flex-wrap: nowrap; }
  .banner b { display: none; }
  .banner > span:not(.spacer) { flex: 1; min-width: 0; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
  .banner .spacer { display: none; } .banner a { white-space: nowrap; flex: none; }
  .pop-anchor > .menu.right, .top-actions .menu.right { right: 0; left: auto; max-width: calc(100vw - 16px); }
  .acc-switch > .menu { right: -60px; min-width: 260px; max-width: calc(100vw - 16px); }
}
.lb-art { width: 100%; aspect-ratio: auto; height: min(360px, 50vh); } .lb-art.tall { height: min(520px, 62vh); aspect-ratio: auto; max-height: none; } .lb-art.wide { height: min(320px, 44vh); aspect-ratio: auto; }
.lb-card { width: min(440px, 100%); }
.chip, .seg, .seg button, .tabs button, .pill-btn { border-radius: 0 !important; }
.thumb img, .mini-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.thumb { overflow: hidden; } .mini-thumb { position: relative; overflow: hidden; }
.thumb svg.pl, .mini-thumb svg.pl { position: absolute; left: 50%; top: 50%; width: 38px; height: 38px; transform: translate(-50%,-50%); stroke: none; opacity: 1; }
.mini-thumb svg.pl { width: 20px; height: 20px; }
.thumb { height: 170px; } .thumb .fmt { z-index: 1; }
.lb-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.lb-art svg.pl { position: absolute; width: 72px; height: 72px; stroke: none; opacity: 1; left: 50%; top: 50%; transform: translate(-50%,-50%); z-index: 1; }
.lb-art .fmt { z-index: 2; }
.lb-art, .lb-art.tall, .lb-art.wide { height: min(560px, 62vh); }
.lb-card { width: min(420px, 100%); }
/* competitors */
.cp-list { display: grid; gap: 4px; margin: 0 0 12px; padding: 0; list-style: none; }
.cp-item { display: flex; align-items: center; gap: 4px; border: 1px solid var(--line); }
.cp-item.on { border-color: var(--indigo-600); background: var(--indigo-50); }
.cp-pick { flex: 1; text-align: left; border: 0; background: none; padding: 8px 10px; cursor: pointer; display: grid; font: inherit; }
.cp-ads { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; padding: 14px; }
.cp-ad { display: flex; gap: 12px; border: 1px solid var(--line); padding: 10px; background: var(--surface); }
.cp-thumb { width: 96px !important; height: 120px !important; flex: none; }
.cp-body { flex: 1; min-width: 0; display: grid; gap: 6px; align-content: start; }
.cp-text { margin: 0; font-size: .875rem; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.cp-tags { display: flex; gap: 4px; flex-wrap: wrap; }
.cp-analysis { display: grid; grid-template-columns: repeat(3, 1fr); }
.cp-analysis .sum-col { padding: 16px; border-right: 1px solid var(--line); } .cp-analysis .sum-col:last-child { border-right: 0; }
.cp-analysis h3 { font-size: .9rem; margin: 0 0 8px; display: flex; align-items: center; gap: 8px; }
.plain-list { margin: 0; padding-left: 18px; display: grid; gap: 6px; font-size: .9rem; }
.note-card { display: flex; gap: 10px; padding: 12px 14px; background: var(--indigo-50); border: 1px solid var(--indigo-100); margin-bottom: 14px; font-size: .875rem; }
@media (max-width: 900px) { .cp-analysis { grid-template-columns: 1fr; } .cp-analysis .sum-col { border-right: 0; border-bottom: 1px solid var(--line); } .cp-ads { grid-template-columns: 1fr; } }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; }
.dot-indigo { background: var(--indigo-600); } .dot-amber { background: #F59E0B; } .dot-teal { background: #14B8A6; }
@media (max-width: 900px) { #cp-grid { grid-template-columns: 1fr !important; } }
.btn-social { display: inline-flex; align-items: center; justify-content: center; gap: 10px; font-weight: 600; }
