:root {
  /* Neon Glass tokens. Older class names (--orange, --green, --blue…) are kept and remapped,
     so every existing card picks up the new palette. */
  --bg: #070D1C;
  --bg-2: #0B1223;
  --panel: #101A30;
  --panel-2: #14213A;
  --border: rgba(130, 165, 220, 0.10);
  --border-2: rgba(130, 165, 220, 0.18);
  --text: #F1F5FF;
  --muted: #91A4C4;
  --dim: #647795;
  --cyan: #3BA3FF;
  --mint: #42E6AE;
  --teal-b: #12D6BE;
  --violet: #8B6CFF;
  --orange: #FF985C;
  --orange-bg: rgba(255, 152, 92, 0.12);
  --green: #42E6AE;
  --green-bar: #2FC898;
  --blue: #3BA3FF;
  --purple: #5B45E6;
  --purple-bg: rgba(139, 108, 255, 0.20);
  --teal: rgba(59, 163, 255, 0.13);
  --yellow: #FFC861;
  --red: #FF647C;
  --radius: 16px;
  --radius-sm: 10px;
  --ease: 180ms cubic-bezier(.2, .7, .2, 1);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 13px; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
a { color: var(--blue); text-decoration: none; }
[hidden] { display: none !important; }

.page { max-width: 1160px; padding: 16px 20px 60px; margin: 0 auto; }

/* ---------- header / toolbar */
.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.logo { display: flex; align-items: center; gap: 8px; font-weight: 700; letter-spacing: 0.12em; font-size: 12px; }
.logo svg { width: 18px; height: 18px; }
.who { color: var(--muted); font-size: 11px; display: flex; gap: 12px; align-items: center; }
.linkish { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 0; font-size: 11px; }
.linkish:hover { color: var(--text); }

.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar .spacer { flex: 1; }
.btn, .seg button, .dropdown > button {
  height: 34px; padding: 0 12px; background: var(--panel); border: 1px solid var(--border-2); color: var(--text);
  cursor: pointer; font-size: 11px; letter-spacing: 0.04em; display: inline-flex; align-items: center; gap: 8px; border-radius: 2px;
}
.btn:hover, .dropdown > button:hover { border-color: #4a4a4a; }
.btn.primary { background: var(--orange); color: #1a1a1a; border-color: var(--orange); font-weight: 700; }
.btn.danger { color: var(--red); border-color: #5a2a2a; }
.btn.small { height: 26px; padding: 0 8px; font-size: 10px; }
.btn-icon { width: 34px; justify-content: center; padding: 0; }
.seg { display: inline-flex; border: 1px solid var(--border-2); border-radius: 2px; background: var(--panel); padding: 3px; }
.seg button { border: 0; height: 26px; background: transparent; color: var(--muted); font-weight: 700; text-transform: uppercase; font-size: 10px; letter-spacing: 0.08em; }
.seg button.on { background: #252525; color: var(--orange); }
.online { color: var(--muted); font-size: 10px; letter-spacing: 0.08em; display: flex; gap: 6px; align-items: center; }
.online .dot { width: 7px; height: 7px; background: #555; display: inline-block; }
.online.live .dot { background: var(--green); box-shadow: 0 0 6px var(--green); }

.dropdown { position: relative; }
.dropdown .menu {
  position: absolute; top: 38px; left: 0; min-width: 200px; background: var(--panel-2); border: 1px solid var(--border-2);
  z-index: 30; padding: 4px; max-height: 360px; overflow: auto; box-shadow: 0 8px 30px rgba(0,0,0,.5);
}
.dropdown .menu button { display: flex; gap: 8px; align-items: center; width: 100%; background: none; border: 0; text-align: left; padding: 8px 10px; cursor: pointer; font-size: 12px; }
.dropdown .menu button:hover, .dropdown .menu button.on { background: #262626; }
.dropdown .menu .custom { padding: 8px 10px; display: grid; gap: 6px; border-top: 1px solid var(--border); margin-top: 4px; }
.caret { color: var(--muted); font-size: 9px; }

.app-icon { width: 18px; height: 18px; border-radius: 4px; background: var(--purple); display: inline-flex; align-items: center; justify-content: center; font-size: 10px; overflow: hidden; flex: none; }
.app-icon img { width: 100%; height: 100%; object-fit: cover; }
.grid-icon { width: 18px; height: 18px; display: inline-grid; grid-template-columns: 1fr 1fr; gap: 2px; padding: 2px; background: #2b2b2b; border-radius: 3px; }
.grid-icon i { background: var(--orange); opacity: .8; }

/* ---------- panels */
.panel { background: var(--panel); border: 1px solid var(--border-2); margin-bottom: 16px; }
.panel-pad { padding: 18px; }
.panel-title { font-size: 11px; letter-spacing: 0.1em; color: var(--muted); text-transform: uppercase; margin: 0 0 14px; font-weight: 500; }
.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.cards .panel { margin: 0; display: flex; flex-direction: column; }
.cards .panel .grow { flex: 1; }
.expand-row { display: flex; justify-content: center; padding-top: 14px; }

/* ---------- KPIs */
.kpis { display: grid; grid-template-columns: repeat(6, 1fr); }
.kpi { padding: 16px 12px 16px 12px; border-bottom: 1px solid var(--border-2); position: relative; min-height: 78px; }
.kpis .kpi:nth-child(n+7) { border-bottom: 0; }
.kpi .label { font-size: 10px; letter-spacing: 0.08em; color: var(--muted); text-transform: uppercase; margin-bottom: 8px; }
.kpi .value { font-size: 15px; font-weight: 700; }
.kpi .delta { font-size: 10px; margin-top: 6px; color: var(--muted); }
.delta.up { color: var(--green); }
.delta.down { color: var(--red); }
.kpi .ring { position: absolute; right: 14px; top: 24px; }
.c-green { color: var(--green); }
.c-orange { color: var(--orange); }
.c-muted { color: var(--muted); }
.c-dim { color: var(--dim); }
.c-red { color: var(--red); }
.c-yellow { color: var(--yellow); }
.c-blue { color: var(--blue); }

body.blur .money { filter: blur(6px); }

/* ---------- simple view */
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 16px; }
.tiles .panel { margin: 0; }
.tile { position: relative; display: flex; flex-direction: column; min-height: 168px; }
.tile-label { font-size: 11px; letter-spacing: .1em; color: var(--muted); text-transform: uppercase; }
.tile-value { font-size: 40px; font-weight: 700; margin: 10px 0 2px; line-height: 1.1; }
.tile .delta { margin-top: 2px; font-size: 11px; }
.tile-sub { color: var(--muted); font-size: 11px; margin-top: 6px; line-height: 1.5; }
.tile .spark { width: 100%; height: 28px; margin-top: auto; padding-top: 12px; display: block; }

/* ---------- who's online */
.online.clickable { cursor: pointer; background: none; border: 0; font: inherit; font-size: 10px; letter-spacing: 0.08em; padding: 4px 0; color: var(--muted); }
.online.clickable:hover { color: var(--text); }
.link { cursor: pointer; text-decoration: underline dotted; text-underline-offset: 3px; }
.who-list { display: grid; gap: 10px; }
.who { border: 1px solid var(--border-2); padding: 12px 14px; display: grid; gap: 6px; }
.who:hover { border-color: var(--orange); }
.who-head { display: flex; justify-content: space-between; gap: 8px 12px; flex-wrap: wrap; align-items: center; }
.who-tags { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 11px; }
.who-now { font-size: 13px; overflow-wrap: anywhere; }
.who-meta { font-size: 11px; }
.who-trail { font-size: 11px; border-left: 2px solid var(--border-2); padding-left: 10px; display: grid; gap: 2px; overflow-wrap: anywhere; }
.who-open { font-size: 10px; letter-spacing: .06em; text-align: right; }

/* ---------- chart */
.chart-wrap { position: relative; height: 380px; padding: 12px 8px 4px; }
.chart-wrap svg { width: 100%; height: 100%; display: block; overflow: visible; }
.axis-label { font-size: 10px; fill: var(--muted); font-family: var(--font); }
.grid-line { stroke: #333; stroke-dasharray: 2 4; }

/* ---------- tables */
table.data { width: 100%; border-collapse: collapse; font-size: 12px; }
table.data th { font-size: 9px; letter-spacing: 0.08em; color: var(--muted); text-transform: uppercase; font-weight: 500; text-align: right; padding: 10px 8px; border-bottom: 1px solid var(--border-2); white-space: nowrap; cursor: default; }
table.data th.sortable { cursor: pointer; }
table.data th:first-child, table.data td:first-child { text-align: left; }
table.data td { padding: 9px 8px; text-align: right; border-bottom: 1px solid #202020; white-space: nowrap; }
table.data tr.clickable { cursor: pointer; }
table.data tr.clickable:hover td { background: #1b1b1b; }
.app-cell { display: flex; gap: 8px; align-items: center; }

/* ---------- funnel */
.frow { margin-bottom: 12px; cursor: default; }
.frow .top { display: flex; justify-content: space-between; margin-bottom: 5px; font-size: 12px; }
.frow .num b { font-weight: 700; margin-right: 6px; }
.frow .num span { color: var(--muted); }
.bar { height: 5px; background: #242424; position: relative; }
.bar i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--orange); }
.split { display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; padding: 4px 0 0 20px; }
.split .num { color: var(--dim); }
.divider { height: 1px; background: var(--border-2); margin: 14px 0; }

/* ---------- tabs */
.tabs { display: flex; gap: 4px; margin-bottom: 16px; flex-wrap: wrap; }
.tabs button { background: none; border: 1px solid transparent; color: var(--muted); padding: 5px 7px; font-size: 10px; letter-spacing: 0.08em; cursor: pointer; font-weight: 700; text-transform: uppercase; }
.tabs button.on { border-color: var(--orange); color: var(--orange); }

/* ---------- bar lists */
.blist { display: grid; gap: 4px; align-content: start; }
.brow { position: relative; display: flex; justify-content: space-between; align-items: center; padding: 6px 8px; font-size: 12px; min-height: 26px; }
.brow .fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--teal); z-index: 0; }
.brow.purple .fill { background: var(--purple-bg); }
.brow > * { position: relative; z-index: 1; }
.brow .right { color: var(--muted); font-size: 11px; display: flex; gap: 32px; }
.brow .right .money-col { width: 70px; text-align: right; }
.brow .right .n-col { width: 60px; text-align: right; }
.blist-head { display: flex; justify-content: flex-end; gap: 32px; font-size: 10px; color: var(--muted); letter-spacing: 0.08em; padding: 0 8px 6px; }
.blist-head span { text-align: right; }

/* ---------- trials */
.big { font-size: 30px; font-weight: 700; }
.big small { font-size: 10px; color: var(--muted); letter-spacing: 0.1em; margin-left: 10px; font-weight: 500; }
.stack { display: flex; height: 12px; background: #242424; margin: 10px 0 24px; }
.stack i { display: block; height: 100%; }
.trio { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--border-2); border-bottom: 1px solid var(--border-2); }
.trio > div { padding: 12px 14px; }
.trio > div + div { border-left: 1px solid var(--border-2); }
.trio .n { font-size: 20px; font-weight: 700; margin: 8px 0 6px; }
.trio .l { font-size: 11px; }
.trio .p { font-size: 10px; color: var(--dim); }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 24px; }
.kv { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); padding: 3px 0; }
.kv b { color: var(--text); }

/* ---------- live feed */
/* Live feed: a grid of rows on desktop, two-line cards on phones — never sideways scrolling. */
.feed { font-size: 12px; }
.feed-row { display: grid; grid-template-columns: 16px 70px minmax(150px, 1.1fr) 136px 56px minmax(120px, 0.9fr) minmax(0, 2fr); gap: 12px; align-items: center; padding: 9px 4px; border-bottom: 1px solid #202020; min-width: 0; }
.feed.multi .feed-row { grid-template-columns: 16px minmax(120px, 0.8fr) 70px minmax(150px, 1.1fr) 136px 56px minmax(120px, 0.9fr) minmax(0, 2fr); }
.feed-row > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed-head { font-size: 9px; letter-spacing: .08em; color: var(--muted); text-transform: uppercase; border-bottom-color: var(--border-2); }
.feed .f-app { display: none; align-items: center; gap: 6px; }
.feed .f-plat { display: flex; align-items: center; }
.feed-group { cursor: pointer; background: #161616; }
.feed-group:hover { background: #1b1b1b; }
.feed-group .f-name { color: var(--orange); }
.feed-group .chev { display: inline-block; width: 10px; color: var(--muted); }
.feed-sub { background: #121212; border-left: 2px solid #3a2a1c; }
.mute-dd .menu.mute-menu { left: auto; right: 0; top: 30px; min-width: 240px; }
.mute-dd > .btn.on { color: var(--orange); }
.mute-menu .mute-help { font-size: 10px; padding: 6px 10px 8px; line-height: 1.4; }
.mute-menu button .tick { width: 12px; color: var(--orange); }
.mute-menu button .mute-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plat { display: inline-flex; width: 14px; height: 14px; color: #c9c9c9; }
.plat svg { width: 100%; height: 100%; }
.feed.multi .f-app { display: flex; }
img.flag { width: 16px; height: 12px; vertical-align: -1px; margin-right: 4px; border-radius: 2px; object-fit: cover; box-shadow: 0 0 0 1px rgba(255,255,255,.08); }
.device-link { color: var(--blue); cursor: pointer; }
.device-link:hover { text-decoration: underline; }
.envtag { font-size: 9px; padding: 1px 4px; border: 1px solid var(--border-2); color: var(--yellow); margin-left: 6px; }
.badge { font-size: 9px; padding: 2px 5px; border: 1px solid var(--border-2); margin-left: 4px; text-transform: uppercase; letter-spacing: .06em; }
.badge.paid { color: var(--green); border-color: #2f5236; }
.badge.trial { color: var(--yellow); border-color: #5a4a2a; }
.badge.cancel { color: var(--red); border-color: #5a2a2a; }
.badge.onb { color: var(--blue); border-color: #2a3d5a; }
.flag { font-size: 9px; color: var(--muted); margin-right: 4px; font-weight: 700; }

/* ---------- tooltip / modal */
.tooltip {
  position: fixed; z-index: 100; pointer-events: none; background: #1c1c1c; border: 1px solid var(--border-2);
  padding: 10px 12px; font-size: 11px; min-width: 190px; box-shadow: 0 6px 24px rgba(0,0,0,.6);
}
.tooltip .t-title { color: var(--text); margin-bottom: 6px; font-weight: 700; }
.tooltip .kv { padding: 2px 0; gap: 18px; }

.modal { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-start; justify-content: center; padding: 50px 16px; overflow: auto; }
.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.7); }
.modal-panel { position: relative; background: var(--panel); border: 1px solid var(--border-2); width: min(880px, 100%); padding: 24px; }
.modal-close { position: absolute; right: 12px; top: 12px; background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 14px; }

/* ---------- forms / settings */
.form { display: grid; gap: 14px; max-width: 560px; }
.field label { display: block; font-size: 10px; letter-spacing: .08em; color: var(--muted); text-transform: uppercase; margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; background: #0f0f0f; border: 1px solid var(--border-2); padding: 9px 10px; border-radius: 2px; outline: none;
}
.field input:focus, .field select:focus { border-color: var(--orange); }
.field .hint { font-size: 10px; color: var(--dim); margin-top: 5px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.secret-box { background: #0f0f0f; border: 1px dashed var(--orange); padding: 12px; font-size: 12px; word-break: break-all; }
pre.code { background: #0f0f0f; border: 1px solid var(--border-2); padding: 12px; overflow: auto; font-size: 11px; line-height: 1.5; margin: 0; white-space: pre; }
.notice { font-size: 11px; color: var(--muted); line-height: 1.6; }
.error { color: var(--red); font-size: 12px; }
.ok-text { color: var(--green); }

/* ---------- login */
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.login form { width: 300px; display: grid; gap: 12px; }

/* ---------- cohorts */
.cohort-table td.cell { text-align: center; font-size: 11px; min-width: 52px; }
.cohort-table td.cell.partial { font-style: italic; opacity: .75; }
.cohort-table th { text-align: center; }

.empty { color: var(--dim); padding: 20px 0; text-align: center; font-size: 12px; }
.loading { opacity: .55; transition: opacity .2s; }

table.data.compact td, table.data.compact th { padding: 7px 6px; }

/* The feed switches to two-line rows when its panel is narrow: on a phone, or beside the chart. */
#feed { container: feed / inline-size; }
@container feed (max-width: 640px) {
  .feed-head { display: none; }
  .feed-row, .feed.multi .feed-row {
    grid-template-columns: auto auto 1fr auto auto;
    grid-template-areas: "plat time name ver dev" ". geo props props props";
    gap: 3px 10px; padding: 10px 2px;
  }
  .feed .f-plat { grid-area: plat; }
  .feed .f-time { grid-area: time; }
  .feed .f-name { grid-area: name; font-weight: 500; }
  .feed .f-dev { grid-area: dev; text-align: right; }
  .feed .f-ver { grid-area: ver; font-size: 11px; text-align: right; }
  .feed .f-geo { grid-area: geo; font-size: 11px; color: var(--muted); max-width: 130px; } /* a long town name must not squeeze the event name */
  .feed .f-props { grid-area: props; font-size: 11px; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; word-break: break-word; }
  .feed.multi .f-app { display: none; }
}

@media (max-width: 900px) {
  .tiles { grid-template-columns: 1fr 1fr; }
  .kpis { grid-template-columns: repeat(3, 1fr); }
  .kpis .kpi:nth-child(n+7) { border-bottom: 1px solid var(--border-2); }
  .cards { grid-template-columns: 1fr; }
  .scroll-x { overflow-x: auto; }
}
@media (max-width: 640px) {
  .tiles { grid-template-columns: 1fr; gap: 10px; }
  .tile { min-height: 0; }
  .tile-value { font-size: 32px; }
  .page { padding: 10px 12px 40px; }
  .topbar { margin-bottom: 12px; }
  .toolbar { gap: 6px; }
  .toolbar .spacer { display: none; }
  .btn, .dropdown > button { height: 32px; padding: 0 9px; }
  .seg button { padding: 0 7px; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .kpi { min-height: 70px; padding: 12px 10px; }
  .kpi .ring { right: 8px; top: 18px; transform: scale(.85); }
  .kpi .value { font-size: 14px; }
  .chart-wrap { height: 250px; padding: 8px 0 0; }
  .panel-pad { padding: 14px 12px; }
  .hide-sm { display: none; }
  .wrap-sm { white-space: normal; }
  .countdown { font-size: 12px !important; }
  table.data td:has(.wrap-sm) { white-space: normal; }
  table.data { font-size: 11px; }
  table.data td, table.data th { padding: 7px 5px; }
  .brow .right { gap: 14px; }
  .brow .right .n-col { width: 44px; }
  .brow .right .money-col { width: 60px; }
  .blist-head { gap: 14px; }
  .trio .n { font-size: 17px; }
  .pair { grid-template-columns: 1fr; gap: 12px; }
  .modal { padding: 12px 8px; }
  .modal-panel { padding: 16px 12px; }
  .dropdown .menu { max-width: calc(100vw - 24px); }
}

/* =========================================================================================
   Neon Glass layer: layout, surfaces and components. Sits after the original rules so the
   older cards (Advanced, Cohorts, Compare, settings) inherit the new look without rewrites.
   ========================================================================================= */

html, body { font-family: var(--font); font-size: 14px; -webkit-font-smoothing: antialiased; }
body {
  background:
    radial-gradient(1100px 620px at 8% -12%, rgba(59, 163, 255, .085), transparent 60%),
    radial-gradient(900px 560px at 105% -5%, rgba(139, 108, 255, .10), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; border-radius: 6px; }
.mono, .feed .f-time, .feed .f-dev, .feed .f-ver, .feed .f-props, .device-link, .countdown, pre.code, .secret-box { font-family: var(--mono); }

/* ---------- shell */
.shell { display: grid; grid-template-columns: 212px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; padding: 22px 14px 18px; display: flex; flex-direction: column; gap: 26px;
  background: linear-gradient(180deg, rgba(11, 18, 35, .94), rgba(7, 13, 28, .94)); border-right: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 11px; padding: 0 6px; }
.brand-name { font-size: 21px; font-weight: 500; letter-spacing: -.02em; line-height: 1.1; }
.brand-name b { font-weight: 800; }
.brand-mark { flex: none; }
.brand-sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.brand.small { gap: 8px; }
.brand.small .brand-name { font-size: 17px; }
.nav { display: grid; gap: 4px; }
.nav-item {
  display: flex; align-items: center; gap: 12px; width: 100%; height: 42px; padding: 0 14px; border: 0; border-radius: 12px;
  background: none; color: var(--muted); font-size: 14px; font-weight: 500; text-align: left; cursor: pointer;
  transition: background var(--ease), color var(--ease), box-shadow var(--ease);
}
.nav-item:hover { color: var(--text); background: rgba(130, 165, 220, .08); }
.nav-item.on {
  color: #031219; font-weight: 600; background: linear-gradient(95deg, var(--cyan), var(--teal-b));
  box-shadow: 0 0 0 1px rgba(66, 230, 174, .35), 0 6px 22px rgba(59, 163, 255, .28);
}
.nav-item.small { height: 34px; font-size: 13px; }
.side-foot { margin-top: auto; display: grid; gap: 2px; }
.conn { display: flex; align-items: center; gap: 8px; padding: 12px 14px 0; font-size: 12.5px; color: var(--mint); }
.conn .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 10px var(--mint); }
.main { min-width: 0; padding: 20px 26px 56px; }
.mobile-bar, .scrim { display: none; }

/* ---------- toolbar & controls */
.toolbar { gap: 10px; margin-bottom: 20px; }
.btn, .seg button, .dropdown > button {
  height: 38px; padding: 0 14px; border-radius: var(--radius-sm); border: 1px solid var(--border-2);
  background: rgba(16, 26, 48, .78); color: var(--text); font-size: 13px; letter-spacing: 0; font-weight: 500;
  transition: border-color var(--ease), background var(--ease), color var(--ease);
}
.btn:hover, .dropdown > button:hover { border-color: rgba(59, 163, 255, .45); background: rgba(20, 33, 58, .9); }
.btn.primary { background: linear-gradient(95deg, var(--cyan), var(--teal-b)); color: #031219; border: 0; font-weight: 600; }
.btn.danger { color: var(--red); border-color: rgba(255, 100, 124, .4); }
.btn.small { height: 30px; padding: 0 10px; font-size: 12px; border-radius: 8px; }
.btn-icon { width: 38px; padding: 0; justify-content: center; color: var(--muted); }
.btn-icon:hover { color: var(--cyan); }
.dropdown > button .caret { color: var(--dim); }
.dropdown > button .ico:first-child { color: var(--cyan); }
.seg { padding: 3px; gap: 2px; border-radius: 12px; border: 1px solid var(--border-2); background: rgba(11, 18, 35, .85); }
.seg button { height: 32px; padding: 0 12px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-size: 12.5px; font-weight: 500; text-transform: none; letter-spacing: 0; gap: 6px; }
.seg button:hover { color: var(--text); }
.seg button.on { color: var(--cyan); background: rgba(59, 163, 255, .14); box-shadow: inset 0 0 0 1px rgba(59, 163, 255, .35); font-weight: 600; }
.dropdown .menu { top: 44px; border-radius: 12px; background: #111C33; border-color: var(--border-2); padding: 6px; box-shadow: 0 18px 40px rgba(0, 0, 0, .5); }
.dropdown .menu button { border-radius: 8px; font-size: 13px; }
.dropdown .menu button:hover, .dropdown .menu button.on { background: rgba(59, 163, 255, .10); }
.online.clickable {
  height: 38px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--border-2); background: rgba(11, 18, 35, .85);
  font-size: 12.5px; letter-spacing: 0; color: var(--muted); gap: 8px;
}
.online .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--dim); }
.online.live { color: var(--mint); border-color: rgba(66, 230, 174, .35); }
.online.live .dot { background: var(--mint); box-shadow: 0 0 10px var(--mint); }
.app-icon { border-radius: 6px; background: var(--purple); }
.grid-icon { background: rgba(59, 163, 255, .12); border-radius: 5px; }
.grid-icon i { background: var(--cyan); border-radius: 1px; }

/* ---------- surfaces */
.panel {
  border-radius: var(--radius); border: 1px solid var(--border-2);
  background: linear-gradient(180deg, rgba(20, 33, 58, .82), rgba(15, 25, 46, .82));
  box-shadow: 0 12px 34px rgba(0, 0, 0, .28), inset 0 1px 0 rgba(255, 255, 255, .035);
}
.panel-pad { padding: 18px 20px; }
.panel-title { font-size: 12px; letter-spacing: .08em; color: var(--muted); font-weight: 600; }
.cards, .tiles { gap: 16px; }
.empty { color: var(--dim); font-size: 13px; }
.notice { color: var(--dim); }
.loading { opacity: .6; }

/* ---------- KPI cards */
.kpi-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; margin-bottom: 18px; }
.kpi-card {
  --acc: var(--cyan);
  position: relative; display: flex; flex-direction: column; min-height: 176px; padding: 18px 18px 14px; border-radius: var(--radius); overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--acc) 24%, rgba(130, 165, 220, .12));
  background:
    radial-gradient(130% 110% at 0% 0%, color-mix(in srgb, var(--acc) 15%, transparent), transparent 58%),
    linear-gradient(180deg, #13203A, #0E182D);
  box-shadow: 0 12px 30px rgba(0, 0, 0, .25);
}
.acc-cyan { --acc: #3BA3FF; } .acc-blue { --acc: #4F8BFF; } .acc-purple { --acc: #8B6CFF; } .acc-mint { --acc: #42E6AE; } .acc-pink { --acc: #F05AB4; }
.kpi-head { display: flex; align-items: center; gap: 12px; }
.kpi-icon {
  width: 42px; height: 42px; flex: none; border-radius: 50%; display: grid; place-items: center; color: var(--acc);
  background: radial-gradient(circle at 30% 25%, color-mix(in srgb, var(--acc) 34%, transparent), color-mix(in srgb, var(--acc) 10%, transparent));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--acc) 38%, transparent), 0 0 18px color-mix(in srgb, var(--acc) 18%, transparent);
}
.kpi-label { font-size: 11.5px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }
.kpi-value { margin-top: 14px; font-size: 30px; font-weight: 700; letter-spacing: -.025em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.kpi-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 6px; min-height: 18px; font-size: 12.5px; }
.kpi-meta .delta { margin: 0; font-size: 12.5px; font-weight: 600; }
.kpi-sub { margin-top: 4px; font-size: 12px; line-height: 1.5; color: var(--muted); }
.kpi-sub b { color: var(--text); font-weight: 600; }
.kpi-spark { height: 38px; margin-top: auto; padding-top: 10px; }
.kpi-spark svg { display: block; width: 100%; height: 100%; }
.pill-online {
  display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px; border-radius: 999px; cursor: pointer;
  border: 1px solid rgba(66, 230, 174, .35); background: rgba(66, 230, 174, .08); color: var(--mint); font-size: 11.5px; font-weight: 600;
}
.pill-online .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 6px var(--mint); }
.delta { color: var(--muted); }
.delta.up { color: var(--mint); }
.delta.down { color: var(--red); }

/* ---------- overview: chart + live feed */
.ov-main { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 16px; margin-bottom: 16px; }
.ov-main > .panel, .feed-col > .panel { margin: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; padding: 18px 20px 0; }
.card-title { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 16px; font-weight: 600; letter-spacing: -.01em; }
.card-title .ico { color: var(--cyan); }
.card-count { font-size: 12.5px; font-weight: 500; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 12px; height: 3px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }
.chart-card .chart-wrap { height: 360px; padding: 6px 10px 6px; }
.axis-label { font-family: var(--font); font-size: 11px; fill: var(--dim); }
.grid-line { stroke: rgba(130, 165, 220, .12); stroke-dasharray: none; }
.feed-col { position: relative; min-width: 0; }
.feed-col > .panel { position: absolute; inset: 0; display: flex; flex-direction: column; }
.feed-col .feed, .feed-col .scroll-x { flex: 1; min-height: 0; overflow: auto; margin-right: -8px; padding-right: 8px; }

/* ---------- live feed */
.tabs button { border-radius: 8px; border: 1px solid transparent; font-size: 12px; letter-spacing: .02em; text-transform: none; padding: 6px 10px; color: var(--muted); }
.tabs button.on { border-color: rgba(59, 163, 255, .4); color: var(--cyan); background: rgba(59, 163, 255, .08); }
.feed { font-size: 12.5px; }
.feed-row { border-bottom: 1px solid rgba(130, 165, 220, .08); padding: 9px 6px; transition: background var(--ease); }
.feed-row:not(.feed-head):hover { background: rgba(59, 163, 255, .04); }
.feed-head { font-size: 10.5px; font-weight: 600; color: var(--dim); border-bottom-color: var(--border-2); }
.feed .f-name { font-weight: 500; color: var(--text); }
.feed-group { background: rgba(255, 152, 92, .05); border-radius: 8px; }
.feed-group:hover { background: rgba(255, 152, 92, .09); }
.feed-sub { background: rgba(7, 13, 28, .45); border-left: 2px solid rgba(255, 152, 92, .45); }
.plat { color: #C9D6EE; }
.device-link { color: var(--cyan); }
.envtag { border-radius: 6px; border-color: rgba(255, 200, 97, .35); }
img.flag { border-radius: 3px; }

/* ---------- tables & pills */
table.data { font-size: 13px; }
table.data th { font-size: 10.5px; font-weight: 600; letter-spacing: .07em; color: var(--dim); border-bottom-color: var(--border-2); padding: 12px 10px; }
table.data td { border-bottom: 1px solid rgba(130, 165, 220, .08); padding: 12px 10px; }
table.data tr.clickable:hover td { background: rgba(59, 163, 255, .045); }
.badge { border-radius: 999px; padding: 3px 9px; font-size: 10px; font-weight: 700; letter-spacing: .06em; border: 1px solid; }
.badge.paid { color: var(--mint); border-color: rgba(66, 230, 174, .45); background: rgba(66, 230, 174, .10); }
.badge.trial { color: var(--yellow); border-color: rgba(255, 200, 97, .45); background: rgba(255, 200, 97, .08); }
.badge.cancel { color: var(--red); border-color: rgba(255, 100, 124, .45); background: rgba(255, 100, 124, .08); }
.badge.onb { color: var(--cyan); border-color: rgba(59, 163, 255, .45); background: rgba(59, 163, 255, .08); }

/* ---------- KPIs strip (Advanced), bars, tooltips, modal */
.kpi { border-bottom-color: rgba(130, 165, 220, .1); }
.kpi .value { font-size: 18px; letter-spacing: -.01em; }
.bar { background: rgba(130, 165, 220, .1); border-radius: 3px; overflow: hidden; }
.brow { border-radius: 6px; overflow: hidden; }
.tooltip { border-radius: 12px; background: #0F1930; border-color: var(--border-2); box-shadow: 0 16px 40px rgba(0, 0, 0, .55); font-size: 12px; }
.modal-backdrop { background: rgba(3, 7, 16, .72); backdrop-filter: blur(4px); }
.modal-panel { border-radius: 20px; background: linear-gradient(180deg, #13203A, #0E182D); border-color: var(--border-2); box-shadow: 0 30px 80px rgba(0, 0, 0, .6); }
.field input, .field select, .field textarea { background: rgba(7, 13, 28, .7); border-radius: 10px; border-color: var(--border-2); }
.field input:focus, .field select:focus { border-color: var(--cyan); }
.secret-box { border-color: var(--cyan); border-radius: 10px; background: rgba(7, 13, 28, .7); }
pre.code { border-radius: 10px; background: rgba(7, 13, 28, .7); }
.who { border-radius: 12px; }
.who:hover { border-color: var(--cyan); }
.login .brand { justify-content: center; margin-bottom: 8px; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- responsive */
@media (max-width: 1320px) {
  .kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1180px) {
  .ov-main { grid-template-columns: 1fr; }
  .feed-col > .panel { position: static; max-height: 620px; }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; z-index: 70; left: 0; top: 0; bottom: 0; width: 248px; height: auto;
    transform: translateX(-104%); transition: transform var(--ease); box-shadow: 20px 0 50px rgba(0, 0, 0, .5);
  }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; z-index: 60; background: rgba(3, 7, 16, .6); }
  .mobile-bar { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
  .mobile-bar .online { margin-left: auto; height: 34px; }
  .toolbar .spacer, .toolbar .online { display: none; }
  .main { padding: 14px 16px 48px; }
}
@media (max-width: 640px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi-card { min-height: 0; padding: 14px 14px 12px; }
  .kpi-card:last-child { grid-column: 1 / -1; }
  .kpi-icon { width: 34px; height: 34px; }
  .kpi-icon .ico { width: 17px; height: 17px; }
  .kpi-label { font-size: 10.5px; letter-spacing: .06em; }
  .kpi-value { font-size: 24px; margin-top: 10px; }
  .kpi-spark { height: 30px; }
  .toolbar { gap: 8px; }
  .toolbar .seg { max-width: 100%; overflow-x: auto; }
  .btn, .dropdown > button { height: 36px; padding: 0 11px; }
  .seg button { height: 30px; padding: 0 10px; }
  .chart-card .chart-wrap { height: 240px; padding: 4px 0 0; }
  .card-head { padding: 14px 14px 0; }
  .legend { gap: 10px; font-size: 11px; }
  .main { padding: 12px 12px 40px; }
}

/* ---------- section pages */
.page-stack > * { margin: 0; }
.page-stack > * + * { margin-top: 16px; }
.page-head { margin: 4px 0 18px; }
.page-head h1 { display: flex; align-items: center; gap: 12px; margin: 0; font-size: 24px; font-weight: 700; letter-spacing: -.02em; }
.page-head h1 .ico { color: var(--cyan); }
.page-head p { margin: 6px 0 0; color: var(--muted); font-size: 13.5px; }
.page-stack > .page-head + * { margin-top: 0; }
.release-tag { display: inline-block; padding: 2px 8px; border-radius: 6px; font-family: var(--mono); font-size: 11.5px; color: var(--cyan); border: 1px solid rgba(59, 163, 255, .4); background: rgba(59, 163, 255, .08); }
.users-list { padding-top: 6px; }
.feed-tall > .panel { display: flex; flex-direction: column; max-height: calc(100vh - 210px); min-height: 360px; }
.feed-tall .feed, .feed-tall .scroll-x { flex: 1; min-height: 0; overflow: auto; }

/* ---------- overview: trials block and recently active */
.ov-block { margin-bottom: 16px; }
.ov-block > .panel { margin: 0; }
.recent-panel { margin-bottom: 16px; }
.recent-panel .panel-pad { padding-top: 14px; }
.recent-hint { font-size: 12px; }
.recent-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.recent-card { background: rgba(7, 13, 28, .35); border-color: var(--border-2); padding: 14px 16px; cursor: pointer; transition: border-color var(--ease), background var(--ease); }
.recent-card:hover { background: rgba(59, 163, 255, .04); }
.recent-card .who-place { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-card .who-now { font-size: 12.5px; }
.c-text { color: var(--text); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: 11px; padding: 2px 8px; border-radius: 999px; color: #CBB8FF; background: rgba(139, 108, 255, .12); border: 1px solid rgba(139, 108, 255, .28); }
@media (max-width: 1180px) { .recent-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .recent-grid { grid-template-columns: 1fr; } .recent-hint { display: none; } }
.recent-card { align-content: start; }
.recent-card .who-place { display: flex; align-items: center; gap: 6px; }
.clamp2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- pop-ups: a close button that is always reachable, and timelines that fit a phone */
.modal-close {
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; z-index: 5;
  background: rgba(16, 26, 48, .95); border: 1px solid var(--border-2); color: var(--text); font-size: 15px;
}
.modal-close:hover { border-color: var(--cyan); color: var(--cyan); }
.modal-panel { overflow-wrap: anywhere; }
.timeline-title { padding-right: 44px; }
@media (max-width: 640px) {
  .modal { padding: 0; }
  .modal-panel { min-height: 100%; border-radius: 0; border: 0; padding: 60px 14px 32px; }
  /* Fixed to the screen, so it stays put however far down the timeline you scroll. */
  .modal-close { position: fixed; top: max(10px, env(safe-area-inset-top)); right: 12px; width: 40px; height: 40px; font-size: 16px; box-shadow: 0 6px 18px rgba(0, 0, 0, .5); }
  .modal-panel .pair { gap: 0; }
  .modal-panel .kv { gap: 12px; }
  .modal-panel .kv b { min-width: 0; }
  /* Timeline rows: time and event on one line, details wrapped underneath. */
  table.timeline, table.timeline tbody { display: block; }
  table.timeline tr { display: grid; grid-template-columns: 62px minmax(0, 1fr); column-gap: 8px; padding: 7px 0; border-bottom: 1px solid rgba(130, 165, 220, .08); }
  table.timeline td { display: block; padding: 0 !important; border: 0 !important; text-align: left !important; white-space: normal !important; width: auto !important; min-width: 0; overflow-wrap: anywhere; }
  table.timeline td:nth-child(3) { grid-column: 2; font-size: 11px; margin-top: 2px; }
  table.timeline td:nth-child(3):empty { display: none; }
  table.timeline td[colspan] { grid-column: 1 / -1; padding-top: 10px !important; }
  table.timeline tr:has(td[colspan]) { border-bottom: 0; padding-bottom: 0; }
}
@media (max-width: 640px) {
  .modal-panel .kv span { white-space: nowrap; }
  table.timeline td:nth-child(3) { display: -webkit-box !important; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
  table.timeline tr.open td:nth-child(3) { display: block !important; -webkit-line-clamp: unset; }
  table.timeline tr { cursor: pointer; }
}

/* ---------- live now */
.live-panel { display: flex; flex-direction: column; }
.live-list { flex: 1; min-height: 0; overflow: auto; display: grid; gap: 10px; align-content: start; padding: 14px 20px 18px; }
.live-card { background: rgba(66, 230, 174, .035); border-color: rgba(66, 230, 174, .25); padding: 12px 14px; cursor: pointer; align-content: start; transition: border-color var(--ease), background var(--ease); }
.live-card:hover { border-color: var(--mint); background: rgba(66, 230, 174, .06); }
.live-card .who-place { display: flex; align-items: center; gap: 6px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--dim); flex: none; }
.live-dot.on { background: var(--mint); box-shadow: 0 0 0 0 rgba(66, 230, 174, .6); animation: livePulse 1.8s ease-out infinite; }
@keyframes livePulse { 0% { box-shadow: 0 0 0 0 rgba(66, 230, 174, .55); } 100% { box-shadow: 0 0 0 9px rgba(66, 230, 174, 0); } }
.live-empty { padding: 26px 6px; text-align: center; display: grid; gap: 6px; font-size: 13px; }
.live-empty-title { font-size: 15px; font-weight: 600; color: var(--text); }
.c-mint { color: var(--mint); font-weight: 600; }
@media (max-width: 1180px) { #live-now > .panel { max-height: 560px; } }
@media (max-width: 640px) { .live-list { padding: 12px 12px 14px; } }

/* ---------- Keywords | Tally switcher (same control as on the Keywords site) */
.suite { display: flex; gap: 2px; padding: 3px; border-radius: 999px; background: #0B1223; border: 1px solid rgba(130, 165, 220, .10); margin-top: -8px; }
.suite a { flex: 1; text-align: center; padding: 6px 8px; border-radius: 999px; font-size: 12.5px; font-weight: 600; color: var(--muted); text-decoration: none; cursor: pointer; transition: color var(--ease), background var(--ease); }
.suite a[href]:hover { color: var(--text); background: rgba(130, 165, 220, .08); }
.suite a.on { color: #031219; background: linear-gradient(95deg, var(--cyan), var(--teal-b)); cursor: default; }

/* ---------- what to do next */
.next-steps { margin-bottom: 16px; }
.next-steps .panel-pad { padding-top: 6px; display: grid; gap: 8px; }
.step { border: 1px solid var(--border-2); border-radius: 12px; background: rgba(7, 13, 28, .35); }
.step[open] { border-color: rgba(59, 163, 255, .3); }
.step summary { display: flex; align-items: center; gap: 12px; padding: 12px 14px; cursor: pointer; list-style: none; }
.step summary::-webkit-details-marker { display: none; }
.step-n { flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; color: #031219; background: linear-gradient(95deg, var(--cyan), var(--teal-b)); }
.step-main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.step-why { font-size: 12.5px; }
.step-tags { flex: none; display: flex; align-items: center; gap: 6px; }
.step-impact { font-size: 12px; font-weight: 700; min-width: 28px; text-align: center; padding: 2px 6px; border-radius: 8px; color: var(--mint); background: rgba(66, 230, 174, .1); }
.chip-warn { color: var(--yellow); background: rgba(255, 200, 80, .1); border-color: rgba(255, 200, 80, .3); }
.step-evidence { margin: 0; padding: 0 14px 4px 50px; font-size: 12.5px; color: var(--muted); }
.step-link { display: inline-block; margin: 4px 14px 12px 50px; font-size: 12.5px; color: var(--cyan); text-decoration: none; }

/* ---------- plan */
.plan-top { margin-bottom: 16px; }
.plan-start ol { margin: 8px 0 0; padding-left: 20px; display: grid; gap: 4px; }
.plan-meta { margin-top: 12px; font-size: 12.5px; }
.step-sub { margin: 6px 14px 2px 50px; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--dim, var(--muted)); }
.suite a { padding: 6px 4px; }
.suite a:not([href]):not(.on) { pointer-events: none; }

.plan-ai { margin-bottom: 16px; border-color: rgba(139, 108, 255, .35); }
.plan-ai-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 16px; }
.plan-ai p { margin: 8px 0 12px; }
.plan-ai-list { margin: 0; padding-left: 20px; display: grid; gap: 10px; }
.plan-first { font-size: 12.5px; color: var(--mint); margin-top: 2px; }

/* ---------- plan: listing editor */
.listing-form { display: grid; gap: 12px; }
.listing-form input { width: 100%; }
.counter { float: right; font-size: 11px; color: var(--muted); font-weight: 400; }
.counter.over { color: var(--red); }
.log { margin-top: 12px; font-size: 12.5px; color: var(--muted); display: grid; gap: 2px; }

/* ---------- next steps: roomy rows, phone friendly */
.step summary { align-items: flex-start; gap: 12px; padding: 14px 16px; }
.step-n { margin-top: 1px; }
.step-main { gap: 4px; line-height: 1.4; }
.step-main b { font-size: 14px; line-height: 1.3; }
.step-why { font-size: 13px; line-height: 1.45; }
.step-meta { margin: 0 16px 6px 52px; font-size: 11.5px; color: var(--dim, var(--muted)); }
.step-evidence { padding: 0 16px 6px 68px; line-height: 1.5; }
.step-sub { margin-left: 52px; }
.step-link { margin: 4px 16px 14px 52px; }
@media (max-width: 640px) {
  .next-steps .panel-pad { padding: 4px 10px 12px; }
  .step summary { padding: 12px; gap: 10px; }
  .step-n { width: 22px; height: 22px; font-size: 11px; }
  .step-meta, .step-sub, .step-link { margin-left: 44px; margin-right: 12px; }
  .step-evidence { padding: 0 12px 6px 60px; }
  .next-steps .recent-hint { display: none; }
}

/* Plan stands on its own: no date range, view, revenue or environment controls. */
.toolbar.on-plan .dropdown:nth-of-type(2), .toolbar.on-plan .seg { display: none; }
body:has(.toolbar.on-plan) #nav { display: none; }

/* ---------- settings: storefront picker */
.cc-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-toggle { padding: 4px 8px; border-radius: 8px; font-size: 11px; font-weight: 600; cursor: pointer; color: var(--muted); background: transparent; border: 1px solid var(--border-2); }
.chip-toggle.on { color: #031219; background: linear-gradient(95deg, var(--cyan), var(--teal-b)); border-color: transparent; }

/* ---------- plan: ask your data */
.chip-btn { cursor: pointer; background: transparent; color: var(--muted); }
.chip-btn:hover { color: var(--text); border-color: rgba(59, 163, 255, .4); }
.ask-answer { margin-top: 14px; padding: 14px 16px; border-radius: 12px; background: rgba(7, 13, 28, .35); border: 1px solid var(--border-2); line-height: 1.55; }

/* ---------- plan: reviews */
.review { padding: 14px 16px; margin-bottom: 10px; border-radius: 12px; background: rgba(7, 13, 28, .35); border: 1px solid var(--border-2); }
.review.answered { opacity: .8; }
.review-reply { padding: 10px 12px; border-radius: 10px; background: rgba(66, 230, 174, .06); border: 1px solid rgba(66, 230, 174, .2); font-size: 13px; line-height: 1.5; }
.review-draft textarea { width: 100%; resize: vertical; }

/* ---------- plan & usage */
.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.plan-card { padding: 14px 16px; border-radius: 12px; background: rgba(7, 13, 28, .35); border: 1px solid var(--border-2); display: grid; gap: 8px; align-content: start; }
.plan-card.current { border-color: rgba(59, 163, 255, .5); }
.plan-name { font-weight: 700; }
.plan-price { font-size: 22px; font-weight: 700; } .plan-price small { font-size: 12px; font-weight: 400; color: var(--muted); }
.plan-card ul { margin: 0; padding-left: 18px; font-size: 12.5px; color: var(--muted); display: grid; gap: 3px; }
.banner { margin: 0 0 12px; padding: 10px 14px; border-radius: 10px; background: rgba(255, 90, 90, .12); border: 1px solid rgba(255, 90, 90, .35); font-size: 13px; }
.banner a { color: var(--cyan); }
.banner.hint { display: flex; gap: 14px; align-items: center; justify-content: space-between; flex-wrap: wrap; background: var(--cyan-bg, rgba(59, 163, 255, .10)); border-color: rgba(59, 163, 255, .35); padding: 12px 14px; }
.banner.hint .c-muted { font-size: 12.5px; margin-top: 2px; max-width: 62ch; }

/* ---- First-run setup (#/start) ---- */
.onb-root .grow, .onb-result .grow, .onb-ai .grow { flex: 1; min-width: 0; }
.icon-btn { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 4px; border-radius: 8px; }
.icon-btn:hover { color: var(--text); background: rgba(130, 165, 220, .1); }
.meter { display: inline-block; width: 56px; height: 6px; border-radius: 3px; background: rgba(130, 165, 220, .15); vertical-align: middle; overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--mint); }
.meter.hard i { background: var(--orange); }
.onb-root { display: flex; min-height: 100vh; }
.onb-rail { width: 260px; flex: none; padding: 24px 20px; border-right: 1px solid var(--border); display: flex; flex-direction: column; gap: 18px; position: sticky; top: 0; height: 100vh; }
.onb-rail nav { display: flex; flex-direction: column; gap: 2px; }
.onb-rail-item { display: flex; align-items: center; gap: 10px; background: none; border: 0; color: var(--muted); text-align: left; padding: 8px 6px; border-radius: 10px; cursor: pointer; font: inherit; font-size: 13.5px; }
.onb-rail-item:hover { background: rgba(130, 165, 220, .08); }
.onb-rail-item.on { color: var(--text); background: rgba(59, 163, 255, .1); }
.onb-dot { width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--border); display: grid; place-items: center; font-size: 11px; flex: none; }
.onb-rail-item.done .onb-dot { background: var(--mint); color: #031219; border-color: var(--mint); }
.onb-rail-item.on .onb-dot { border-color: var(--cyan); color: var(--cyan); }
.onb-main { flex: 1; min-width: 0; display: flex; justify-content: center; padding: 40px 24px 80px; }
.onb-step { width: 100%; max-width: 680px; }
.onb-step h1 { font-size: 26px; margin: 0 0 6px; letter-spacing: -.01em; }
.onb-step input:not([type=checkbox]), .onb-step select { width: 100%; box-sizing: border-box; }
.onb-results { margin: 12px 0; display: flex; flex-direction: column; gap: 8px; }
.onb-result { display: flex; align-items: center; gap: 12px; padding: 10px; border: 1px solid var(--border); border-radius: 12px; background: var(--panel); }
.onb-result img, .onb-ph { width: 44px; height: 44px; border-radius: 10px; background: rgba(130, 165, 220, .12); flex: none; }
.onb-wait { display: flex; align-items: center; gap: 12px; padding: 14px; border: 1px dashed rgba(59, 163, 255, .4); border-radius: 12px; margin: 14px 0; }
.onb-wait .btn { margin-left: auto; }
.onb-pulse { width: 12px; height: 12px; border-radius: 50%; background: var(--cyan); flex: none; animation: onb-pulse 1.4s ease-in-out infinite; }
@keyframes onb-pulse { 0% { box-shadow: 0 0 0 0 rgba(59, 163, 255, .6); } 100% { box-shadow: 0 0 0 14px rgba(59, 163, 255, 0); } }
.onb-celebrate { padding: 18px; border-radius: 14px; border: 1px solid rgba(66, 230, 174, .4); background: rgba(66, 230, 174, .07); margin: 14px 0; animation: onb-pop .4s var(--ease); }
.onb-celebrate h2 { margin: 0 0 4px; font-size: 18px; }
.onb-celebrate.big { text-align: center; padding: 36px 20px; }
.onb-celebrate.big .onb-list { text-align: left; max-width: 480px; margin: 14px auto; }
.onb-confetti { font-size: 28px; letter-spacing: 8px; }
@keyframes onb-pop { from { transform: scale(.96); opacity: 0; } to { transform: none; opacity: 1; } }
.onb-ai { display: flex; align-items: center; gap: 12px; justify-content: space-between; padding: 12px 14px; border-radius: 12px; background: var(--purple-bg); margin: 12px 0; }
.onb-list { padding-left: 20px; display: flex; flex-direction: column; gap: 10px; }
.onb-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.onb-chip { padding: 6px 12px; border: 1px solid var(--border); border-radius: 999px; cursor: pointer; font-size: 13px; user-select: none; }
.onb-chip input { display: none; }
.onb-chip.on { border-color: var(--cyan); background: rgba(59, 163, 255, .12); }
.onb-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.onb-card { border: 1px solid var(--border); border-radius: 14px; padding: 14px; background: var(--panel); }
.onb-card h3 { margin: 0 0 6px; font-size: 15px; }
.setup-card { border-color: rgba(59, 163, 255, .3); }
.chip-done { color: var(--mint); }
@media (max-width: 800px) {
  .onb-root { flex-direction: column; }
  .onb-rail { position: static; width: auto; height: auto; border-right: 0; border-bottom: 1px solid var(--border); padding: 14px 16px; gap: 10px; }
  .onb-rail nav { flex-direction: row; overflow-x: auto; }
  .onb-rail-item span:last-child { display: none; }
  .onb-rail-item.on span:last-child { display: inline; }
  .onb-main { padding: 22px 16px 60px; }
  .onb-cards { grid-template-columns: 1fr; }
  .onb-ai, .onb-wait { flex-wrap: wrap; }
}
.onb-demo { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-radius: 12px; background: var(--purple-bg); margin: 14px 0; }
.demo-banner { background: var(--purple-bg); }
@media (max-width: 800px) { .onb-demo { flex-wrap: wrap; } }
.terms { display: flex; gap: 8px; align-items: flex-start; font-size: 12px; color: var(--muted); line-height: 1.5; }
.terms input { margin-top: 3px; }
.terms a { color: var(--cyan); }
.badge.tiny { font-size: 9px; padding: 1px 6px; margin: 0 0 0 6px; vertical-align: 1px; }
.recent-sub { padding: 0 20px; margin-top: -6px; }
.recent-panel .card-head .tabs { flex: none; }
@media (max-width: 640px) { .recent-panel .card-head { flex-wrap: wrap; gap: 8px; } }

.feed .f-dev { display: flex; align-items: center; gap: 0; overflow: visible; }
.feed .f-dev .device-link { overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 760px) { .feed .f-dev { justify-content: flex-end; } }
