/* Tokens follow the Autoschool CRM design system (shadcn/ui, base-nova): neutral surfaces, a near-black
   primary for actions, the status palette from its compatibility layer and its validated chart series. */
:root {
  --bg: oklch(1 0 0);
  --surface: oklch(1 0 0);
  --surface-2: oklch(0.97 0 0);
  --surface-3: oklch(0.94 0 0);
  --sidebar: oklch(0.985 0 0);
  --border: oklch(0.922 0 0);
  --grid: oklch(0.95 0 0);
  --ink: oklch(0.145 0 0);
  --ink-2: oklch(0.42 0 0);
  --ink-3: oklch(0.556 0 0);
  --primary: oklch(0.205 0 0);
  --primary-ink: oklch(0.985 0 0);
  --ring: oklch(0.708 0 0);
  --ring-soft: oklch(0.708 0 0 / 50%);
  --destructive: oklch(0.577 0.245 27.325);
  --destructive-soft: oklch(0.577 0.245 27.325 / 10%);
  --link: #1f4ba0;
  --accent: #2a78d6;
  --accent-strong: #1f5fae;
  --accent-soft: #e5ebf7;
  --accent-track: #dbe5f5;
  --good: #1c6a55;
  --good-soft: #e6f1ed;
  --warn: #9a6110;
  --warn-soft: #f7eddc;
  --bad: #a0342a;
  --bad-soft: #f7e7e4;
  --chart-bad: #e34948;
  --violet: #6d28d9;
  --violet-soft: #f1ebfd;
  --shadow: none;
  --shadow-xs: 0 1px 2px oklch(0 0 0 / 6%);
  --shadow-lg: 0 16px 40px oklch(0 0 0 / 14%);
  --radius: 14px;
  --radius-md: 8px;
  --font: Geist, "Noto Sans Armenian", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "Geist Mono", ui-monospace, Menlo, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: oklch(0.145 0 0);
    --surface: oklch(0.205 0 0);
    --surface-2: oklch(0.269 0 0);
    --surface-3: oklch(0.3 0 0);
    --sidebar: oklch(0.205 0 0);
    --border: oklch(1 0 0 / 10%);
    --grid: oklch(1 0 0 / 7%);
    --ink: oklch(0.985 0 0);
    --ink-2: oklch(0.8 0 0);
    --ink-3: oklch(0.708 0 0);
    --primary: oklch(0.922 0 0);
    --primary-ink: oklch(0.205 0 0);
    --ring: oklch(0.556 0 0);
    --ring-soft: oklch(0.556 0 0 / 50%);
    --destructive: oklch(0.704 0.191 22.216);
    --destructive-soft: oklch(0.704 0.191 22.216 / 15%);
    --link: #86a9f2;
    --accent: #3987e5;
    --accent-strong: #86a9f2;
    --accent-soft: #171f31;
    --accent-track: #1d2840;
    --good: #55bfa1;
    --good-soft: #14251f;
    --warn: #e2a84e;
    --warn-soft: #2a2213;
    --bad: #e88373;
    --bad-soft: #2a1917;
    --chart-bad: #e66767;
    --violet: #b69cff;
    --violet-soft: rgba(182, 156, 255, .14);
    --shadow: none;
    --shadow-xs: 0 1px 2px oklch(0 0 0 / 30%);
    --shadow-lg: 0 16px 40px oklch(0 0 0 / 50%);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
    --bg: oklch(0.145 0 0);
    --surface: oklch(0.205 0 0);
    --surface-2: oklch(0.269 0 0);
    --surface-3: oklch(0.3 0 0);
    --sidebar: oklch(0.205 0 0);
    --border: oklch(1 0 0 / 10%);
    --grid: oklch(1 0 0 / 7%);
    --ink: oklch(0.985 0 0);
    --ink-2: oklch(0.8 0 0);
    --ink-3: oklch(0.708 0 0);
    --primary: oklch(0.922 0 0);
    --primary-ink: oklch(0.205 0 0);
    --ring: oklch(0.556 0 0);
    --ring-soft: oklch(0.556 0 0 / 50%);
    --destructive: oklch(0.704 0.191 22.216);
    --destructive-soft: oklch(0.704 0.191 22.216 / 15%);
    --link: #86a9f2;
    --accent: #3987e5;
    --accent-strong: #86a9f2;
    --accent-soft: #171f31;
    --accent-track: #1d2840;
    --good: #55bfa1;
    --good-soft: #14251f;
    --warn: #e2a84e;
    --warn-soft: #2a2213;
    --bad: #e88373;
    --bad-soft: #2a1917;
    --chart-bad: #e66767;
    --violet: #b69cff;
    --violet-soft: rgba(182, 156, 255, .14);
    --shadow: none;
    --shadow-xs: 0 1px 2px oklch(0 0 0 / 30%);
    --shadow-lg: 0 16px 40px oklch(0 0 0 / 50%);
    color-scheme: dark;
  }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.45 var(--font);
  font-variant-numeric: tabular-nums;
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.icon { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }
.nowrap { white-space: nowrap; }

/* ─── Brand and sync ──────────────────────────────────── */
.brand { display: flex; align-items: baseline; gap: 8px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand-word { font-weight: 800; font-size: 20px; letter-spacing: -.02em; }
.brand-dot { color: var(--accent); }
.brand-sub { color: var(--ink-3); font-size: 13px; }
.tabs { display: flex; gap: 2px; background: var(--surface-2); padding: 3px; border-radius: 10px; }
.tabs a {
  padding: 6px 14px; border-radius: 8px; color: var(--ink-2); font-weight: 550; font-size: 13.5px;
}
.tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs a.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.sync { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.sync-status { color: var(--ink-3); font-size: 12.5px; }
.sync-status.error { color: var(--bad); }
.btn {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface); color: var(--ink);
  padding: 6px 12px; border-radius: 9px; font-weight: 550; font-size: 13px;
}
.btn:hover { background: var(--surface-2); }
.btn:disabled { opacity: .6; cursor: progress; }
.btn.spinning .icon { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.icon-btn {
  display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 8px;
  border: 0; background: transparent; cursor: pointer; color: var(--ink-2);
}
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }

/* ─── Layout ──────────────────────────────────────────── */
.main { max-width: 1320px; margin: 0 auto; padding: 20px 24px 64px; }
.view-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 4px 0 16px; }
.view-title { font-size: 22px; font-weight: 750; letter-spacing: -.01em; margin: 0; }
.view-sub { color: var(--ink-2); margin-top: 2px; font-size: 13px; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stack { display: grid; gap: 16px; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px 20px; min-width: 0;
}
.card-title { font-size: 14px; font-weight: 700; margin: 0 0 2px; }
.card-sub { color: var(--ink-3); font-size: 12.5px; margin: 0 0 14px; }
.card.flush { padding: 0; overflow: hidden; }
.card.flush .card-head { padding: 16px 20px 0; }

/* ─── Segmented control / filters ─────────────────────── */
.segmented { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); padding: 3px; border-radius: 10px; }
.segmented button {
  border: 0; background: transparent; padding: 5px 12px; border-radius: 7px; cursor: pointer;
  color: var(--ink-2); font-weight: 550; font-size: 13px;
}
.segmented button.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.filters > input, .filters select {
  height: 34px; border: 1px solid var(--border); background: var(--surface); color: var(--ink);
  border-radius: 9px; padding: 0 10px; font: inherit; font-size: 13px; min-width: 0;
}
.filters > input { flex: 1 1 240px; }
.filters > input:focus, .filters select:focus { outline: 2px solid var(--accent); outline-offset: -1px; }

/* ─── KPI tiles ───────────────────────────────────────── */
.kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
@media (max-width: 1180px) { .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.kpi-label { color: var(--ink-2); font-size: 12.5px; display: flex; align-items: center; gap: 6px; }
.kpi-value { font-size: 26px; font-weight: 700; letter-spacing: -.02em; margin-top: 4px; line-height: 1.15; }
.kpi-note { color: var(--ink-3); font-size: 12px; margin-top: 2px; }
.kpi.hero .kpi-value { font-size: 34px; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 3px var(--good-soft); }

/* ─── Chart ───────────────────────────────────────────── */
.chart { position: relative; width: 100%; height: 240px; }
.chart svg { display: block; width: 100%; height: 100%; overflow: visible; }
.chart .gridline { stroke: var(--grid); stroke-width: 1; }
.chart .axis-label { fill: var(--ink-3); font-size: 11px; }
.chart .bar { fill: var(--accent); }
.chart .bar.dim { opacity: .35; }
.chart .bar.hover { fill: var(--accent-strong); }
.chart .hit { fill: transparent; cursor: crosshair; }
.chart .hit:focus { outline: none; }
.chart .hit:focus-visible { stroke: var(--accent); stroke-width: 1.5; }
.tooltip {
  position: fixed; z-index: 60; pointer-events: none;
  background: var(--surface); color: var(--ink); border: 1px solid var(--border);
  box-shadow: var(--shadow-lg); border-radius: 10px; padding: 10px 12px; font-size: 12.5px; min-width: 170px;
}
.tooltip .tt-title { font-weight: 700; margin-bottom: 6px; }
.tooltip .tt-row { display: flex; justify-content: space-between; gap: 16px; color: var(--ink-2); }
.tooltip .tt-row b { color: var(--ink); font-weight: 650; }

/* ─── Bar lists ───────────────────────────────────────── */
.bars { display: grid; gap: 9px; }
.bar-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; }
.bar-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.bar-label .faint { font-size: 12px; margin-left: 6px; }
.bar-value { font-size: 13px; font-weight: 600; text-align: right; white-space: nowrap; }
.bar-value .faint { font-weight: 400; margin-left: 6px; }
.bar-track { grid-column: 1 / -1; height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.bar-fill { height: 100%; border-radius: 3px; background: var(--accent); width: 0; }
.bar-row.clickable { cursor: pointer; }
.bar-row.clickable:hover .bar-label { color: var(--accent); }
.empty { color: var(--ink-3); font-size: 13px; padding: 8px 0; }

/* ─── Tables ──────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th {
  text-align: left; font-weight: 600; color: var(--ink-2); font-size: 12px;
  padding: 10px 12px; border-bottom: 1px solid var(--border); background: var(--surface-2); white-space: nowrap;
}
table.data th.num, table.data td.num { text-align: right; }
table.data th.sortable { cursor: pointer; user-select: none; }
table.data th.sortable:hover { color: var(--ink); }
table.data th .arrow { color: var(--accent); margin-left: 3px; }
table.data td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data tbody tr.row-link { cursor: pointer; }
table.data tbody tr.row-link:hover td { background: var(--surface-2); }
table.data tbody tr.row-link:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.cell-main { font-weight: 600; }
.cell-sub { color: var(--ink-3); font-size: 12px; margin-top: 1px; }
.pager { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border-top: 1px solid var(--border); color: var(--ink-2); font-size: 12.5px; gap: 8px; flex-wrap: wrap; }
.pager .btns { display: flex; gap: 6px; }

/* ─── Chips & badges ──────────────────────────────────── */
.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chip {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600; background: var(--surface-3); color: var(--ink-2); white-space: nowrap;
}
.chip.blue { background: var(--accent-soft); color: var(--accent); }
.chip.green { background: var(--good-soft); color: var(--good); }
.chip.amber { background: var(--warn-soft); color: var(--warn); }
.chip.red { background: var(--bad-soft); color: var(--bad); }
.chip.violet { background: var(--violet-soft); color: var(--violet); }
.dev { display: flex; align-items: center; gap: 8px; }
.dev .icon { color: var(--ink-3); width: 18px; height: 18px; }
.user-link { font-weight: 600; }

/* ─── Drawer ──────────────────────────────────────────── */
.drawer-backdrop { position: fixed; inset: 0; background: rgba(15, 23, 42, .35); z-index: 40; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 50; width: min(760px, 100vw);
  background: var(--bg); border-left: 1px solid var(--border); box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column;
}
.drawer-head { display: flex; align-items: flex-start; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); background: var(--surface); }
.drawer-title { flex: 1; min-width: 0; }
.drawer-title h2 { margin: 0; font-size: 18px; font-weight: 750; overflow-wrap: anywhere; }
.drawer-title .sub { color: var(--ink-2); font-size: 13px; margin-top: 2px; }
.drawer-body { overflow-y: auto; padding: 16px 20px 40px; flex: 1; min-height: 0; }
.drawer-body > * + * { margin-top: 14px; }
.drawer-body > .section-title { margin-top: 22px; margin-bottom: 0; }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px 16px; }
.fact-label { color: var(--ink-3); font-size: 12px; }
.fact-value { font-weight: 600; overflow-wrap: anywhere; }
.account-card { border-left: 3px solid var(--accent); }
.account-card .who { font-size: 16px; font-weight: 700; }
.section-title { font-size: 12px; font-weight: 700; color: var(--ink-2); text-transform: uppercase; letter-spacing: .05em; }
.list-plain { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.list-plain li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ─── Timeline ────────────────────────────────────────── */
.visit { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.visit-head {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 10px 14px;
  background: var(--surface-2); border-bottom: 1px solid var(--border); font-size: 13px; cursor: pointer; list-style: none;
}
.visit-head::-webkit-details-marker { display: none; }
.visit-head .when { font-weight: 700; }
.visit-head .meta { color: var(--ink-2); }
.visit-head .caret { margin-left: auto; color: var(--ink-3); transition: transform .15s; }
details[open] > .visit-head .caret { transform: rotate(90deg); }
details:not([open]) > .visit-head { border-bottom: 0; }
.events { list-style: none; margin: 0; padding: 6px 0; }
.event { display: grid; grid-template-columns: 66px 14px minmax(0, 1fr); gap: 8px; padding: 5px 14px; font-size: 13px; align-items: baseline; }
.event .time { color: var(--ink-3); font-family: var(--mono); font-size: 12px; }
.event .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); align-self: center; justify-self: center; }
.event.page .dot { background: transparent; border: 2px solid var(--ink-3); width: 9px; height: 9px; }
.event.action .dot { background: var(--accent); }
.event.win .dot { background: var(--good); }
.event.warn .dot { background: var(--warn); }
.event .what { min-width: 0; overflow-wrap: anywhere; }
.event .path { color: var(--ink-3); font-family: var(--mono); font-size: 12px; margin-left: 6px; }
.event.action .what { font-weight: 600; }
.event .extra { color: var(--ink-2); font-weight: 400; margin-left: 6px; }
.ua { font-family: var(--mono); font-size: 12px; color: var(--ink-2); overflow-wrap: anywhere; background: var(--surface-2); padding: 10px 12px; border-radius: 10px; }
.note { color: var(--ink-3); font-size: 12.5px; line-height: 1.5; }
.note b { color: var(--ink-2); font-weight: 600; }
.banner { background: var(--warn-soft); color: var(--warn); border-radius: 10px; padding: 10px 14px; font-size: 13px; margin-bottom: 14px; }
.loading { color: var(--ink-3); padding: 40px 0; text-align: center; }

@media (max-width: 1080px) {
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .tabs { order: 3; width: 100%; overflow-x: auto; }
  .tabs a { padding: 6px 10px; white-space: nowrap; }
  .main { padding: 16px 16px 48px; }
  .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi-value { font-size: 22px; }
  .kpi.hero .kpi-value { font-size: 26px; }
  .chart { height: 200px; }
  .drawer-head, .drawer-body { padding-left: 16px; padding-right: 16px; }
  .event { grid-template-columns: 58px 12px minmax(0, 1fr); padding: 5px 10px; }
}
.mb-16 { margin-bottom: 16px; }
.mb-10 { margin-bottom: 10px; }
.mt-12 { margin-top: 12px; }
.mt-10 { margin-top: 10px; }
.path-tag { margin-left: 6px; }

/* ─── v2: comparisons, legends, live, forms ───────────── */
:root { --series-2: #eb6834; --ghost: oklch(0.88 0 0); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --series-2: #d95926; --ghost: oklch(0.35 0 0); } }
:root[data-theme="dark"] { --series-2: #d95926; --ghost: oklch(0.35 0 0); }
.tabs { flex-wrap: nowrap; }
.tabs a { display: inline-flex; align-items: center; gap: 6px; }
.tabs a .icon { width: 15px; height: 15px; }
.tab-dot { width: 7px; height: 7px; box-shadow: 0 0 0 2px var(--good-soft); }
.delta { display: inline-flex; align-items: center; gap: 2px; font-size: 12px; font-weight: 650; padding: 1px 6px; border-radius: 999px; white-space: nowrap; }
.delta.up { color: var(--good); background: var(--good-soft); }
.delta.down { color: var(--bad); background: var(--bad-soft); }
.delta.flat { color: var(--ink-3); background: var(--surface-3); }
.kpi-delta { margin-top: 6px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; font-size: 12px; color: var(--ink-3); }
.bar-value .delta { margin-left: 6px; font-size: 11px; padding: 0 5px; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12.5px; color: var(--ink-2); margin: -6px 0 10px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; background: var(--accent); }
.legend i.s2 { background: var(--series-2); }
.legend i.ghost { background: var(--ghost); }
.legend i.good { background: var(--good); }
.chart .bar.s2 { fill: var(--series-2); }
.chart .bar.ghost { fill: var(--ghost); }
.chart .bar.good { fill: var(--good); }
.chart .bar.s2.hover { opacity: .8; }
.chart .threshold { stroke: var(--ink-3); stroke-width: 1; }
.card-head-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.card-head-row .btn { flex: none; }
.flag { font-size: 15px; line-height: 1; }
.where .cell-sub { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Live */
.live-status { display: flex; align-items: center; gap: 10px; color: var(--ink-3); font-size: 12.5px; }
.people { display: grid; gap: 8px; }
.person { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); cursor: pointer; }
.person:hover { border-color: var(--accent); }
.person .state { width: 9px; height: 9px; border-radius: 50%; background: var(--ink-3); margin-top: 5px; }
.person.active .state { background: var(--good); box-shadow: 0 0 0 3px var(--good-soft); }
.person .who { font-weight: 650; }
.person .now { margin-top: 2px; }
.person .meta { color: var(--ink-3); font-size: 12px; margin-top: 3px; }
.person .ago { color: var(--ink-3); font-size: 12px; white-space: nowrap; }
.feed { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; max-height: 640px; overflow-y: auto; }
.feed li { display: grid; grid-template-columns: 60px minmax(0, 1fr); gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.feed li:last-child { border-bottom: 0; }
.feed .t { color: var(--ink-3); font-family: var(--mono); font-size: 12px; }
.feed .who { color: var(--ink-3); font-size: 12px; }
.feed a { color: inherit; }
.feed .act { font-weight: 650; }

/* Forms / settings */
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
.btn-danger { color: var(--bad); }
.form-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
.form-row input[type=text], .form-row input[type=password], .form-row select, .login-card input {
  height: 36px; border: 1px solid var(--border); background: var(--surface); color: var(--ink); border-radius: 9px; padding: 0 10px; font: inherit; font-size: 13.5px; min-width: 0;
}
.form-row input[type=text], .form-row input[type=password] { flex: 1 1 260px; }
.form-row input:focus, .form-row select:focus, .login-card input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 13.5px; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); }
.steps { margin: 8px 0 0; padding-left: 20px; color: var(--ink-2); line-height: 1.7; }
.status-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.form-error { color: var(--bad); font-size: 13px; min-height: 18px; }
.form-ok { color: var(--good); font-size: 13px; }
.divider { border: 0; border-top: 1px solid var(--border); margin: 16px 0; }
.url-list { display: grid; gap: 6px; margin-top: 10px; }
.url-list code { font-family: var(--mono); font-size: 13px; background: var(--surface-2); padding: 6px 10px; border-radius: 8px; overflow-wrap: anywhere; }
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-card { width: min(360px, 100%); display: grid; gap: 10px; }
.login-card .brand { margin-bottom: 8px; }
.qtext { max-width: 520px; }
.acc-bar { display: flex; align-items: center; gap: 8px; justify-content: flex-end; }
.acc-bar .bar-track { width: 60px; height: 6px; grid-column: auto; }
.acc-bar .bar-fill.bad { background: var(--bad); }
.mt-6 { margin-top: 6px; }
.mt-16 { margin-top: 16px; }
.stack-tight { display: grid; gap: 10px; margin-top: 12px; }
.kpis-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.chart-sm { height: 180px; }
@media (max-width: 1180px) { .kpis-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) {
  .kpis-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .segmented { max-width: 100%; overflow-x: auto; }
  .segmented button { white-space: nowrap; }
  .view-head > .btn { width: auto; }
}

/* ─── v4: fixed left sidebar ──────────────────────────── */
:root { --sidebar-w: 240px; }
.sidebar {
  position: fixed; top: 0; bottom: 0; left: 0; z-index: 30; width: var(--sidebar-w);
  display: flex; flex-direction: column;
  background: var(--surface); border-right: 1px solid var(--border);
}
.sidebar > .brand { padding: 18px 22px 14px; }
.sidenav { flex: 1; min-height: 0; overflow-y: auto; padding: 6px 12px 16px; }
.nav-group + .nav-group { margin-top: 16px; }
.nav-title { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); font-weight: 700; padding: 0 10px 6px; }
.sidenav a { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 10px; border-radius: 8px; color: var(--ink-2); font-weight: 550; font-size: 13.5px; }
.sidenav a:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.sidenav a.active { background: var(--accent-soft); color: var(--accent); }
.sidebar .sync { margin: 0; flex-direction: column; align-items: stretch; gap: 6px; padding: 12px 16px 16px; border-top: 1px solid var(--border); }
.sidebar .sync .btn { justify-content: center; }
.sidebar .sync-status { text-align: center; }
.sidebar .sync-status:empty { display: none; }
.down-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--bad); box-shadow: 0 0 0 3px var(--bad-soft); }
.main { max-width: 1440px; margin: 0 0 0 var(--sidebar-w); }
@media (min-width: 1681px) { .main { margin-left: calc(var(--sidebar-w) + (100vw - var(--sidebar-w) - 1440px) / 2); } }
.mobilebar { display: none; }
.nav-backdrop { position: fixed; inset: 0; background: rgba(15, 23, 42, .35); z-index: 25; }
@media (max-width: 1000px) {
  .mobilebar {
    position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 8px; padding: 8px 12px;
    background: color-mix(in srgb, var(--surface) 88%, transparent);
    backdrop-filter: saturate(1.4) blur(10px);
    border-bottom: 1px solid var(--border);
  }
  .sidebar { transform: translateX(-100%); transition: transform .2s ease; box-shadow: none; }
  .sidebar.open { transform: none; box-shadow: var(--shadow-lg); }
  .main { margin-left: 0; }
}
@media (min-width: 1001px) { .nav-backdrop { display: none !important; } }

/* ─── v3: marks, heatmaps, health ─────────────────────── */
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; background: var(--violet-soft); color: var(--violet); }
.tag button { border: 0; background: none; color: inherit; cursor: pointer; padding: 0; font-size: 13px; line-height: 1; }
.tags-row { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.note-mark { color: var(--ink-3); font-size: 12px; }
.marks textarea { width: 100%; min-height: 70px; border: 1px solid var(--border); background: var(--surface); color: var(--ink); border-radius: 9px; padding: 8px 10px; font: inherit; font-size: 13.5px; resize: vertical; }
.marks textarea:focus, .marks input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.marks input[type=text] { height: 30px; border: 1px solid var(--border); background: var(--surface); color: var(--ink); border-radius: 8px; padding: 0 8px; font: inherit; font-size: 13px; min-width: 140px; }
.heat { border-collapse: separate; border-spacing: 2px; font-size: 12.5px; width: 100%; }
.heat th { color: var(--ink-3); font-weight: 600; font-size: 11.5px; padding: 4px 6px; text-align: center; white-space: nowrap; }
.heat th.left, .heat td.left { text-align: left; }
.heat td { padding: 7px 6px; text-align: center; border-radius: 6px; background: var(--surface-2); font-variant-numeric: tabular-nums; }
.heat td.left { background: none; white-space: nowrap; }
.heat td.partial { outline: 1px dashed var(--ink-3); outline-offset: -2px; }
.heat td.empty-cell { background: none; }
.status-banner { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-radius: var(--radius); margin-bottom: 16px; font-weight: 600; }
.status-banner.ok { background: var(--good-soft); color: var(--good); }
.status-banner.bad { background: var(--bad-soft); color: var(--bad); }
.status-banner.unknown { background: var(--surface-3); color: var(--ink-2); }
.status-banner .sub { font-weight: 400; color: var(--ink-2); }
.chart .bar.bad { fill: var(--bad); }
.legend i.bad { background: var(--bad); }
.tip { background: var(--accent-soft); color: var(--ink); border-radius: 10px; padding: 10px 14px; font-size: 13px; margin-top: 10px; }
.tip b { color: var(--accent); }
.url-preview { font-family: var(--mono); font-size: 12.5px; background: var(--surface-2); padding: 10px 12px; border-radius: 9px; overflow-wrap: anywhere; margin-top: 10px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; margin-top: 10px; }
.form-grid label { display: grid; gap: 4px; font-size: 12px; color: var(--ink-3); }
.form-grid input, .form-grid select { height: 34px; border: 1px solid var(--border); background: var(--surface); color: var(--ink); border-radius: 9px; padding: 0 10px; font: inherit; font-size: 13.5px; min-width: 0; }
.form-grid input:focus, .form-grid select:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.key-area { width: 100%; min-height: 110px; font-family: var(--mono); font-size: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--ink); border-radius: 9px; padding: 8px 10px; margin-top: 10px; }
.num-sub { display: block; color: var(--ink-3); font-size: 11.5px; font-weight: 400; }
.site-list { display: grid; gap: 6px; margin-top: 10px; }
.site-list button { justify-self: start; }
.qtext { min-width: 240px; }

/* ─── v4: map ─────────────────────────────────────────── */
.map-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.map-box { height: 600px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); background: var(--surface-2); }
.mini-map { height: 190px; border-radius: 12px; overflow: hidden; border: 1px solid var(--border); background: var(--surface-2); margin-top: 10px; }
.map-side { max-height: 600px; overflow-y: auto; }
.map-side .people-list { display: grid; gap: 6px; margin-top: 10px; }
.map-person { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 8px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; background: var(--surface); }
.map-person:hover, .map-person:focus-visible { border-color: var(--accent); outline: none; }
.map-person .icon { color: var(--ink-3); width: 18px; height: 18px; margin-top: 1px; }
.map-person .who { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.map-person .meta { color: var(--ink-3); font-size: 12px; }
.map-tools { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.legend i.acc { background: var(--good); }
.leaflet-container { font: inherit; background: var(--surface-2); }
.leaflet-tooltip.map-tip { background: var(--surface); color: var(--ink); border: 1px solid var(--border); box-shadow: var(--shadow-lg); border-radius: 8px; padding: 6px 10px; font-size: 12.5px; }
.leaflet-tooltip.map-tip::before { display: none; }
.leaflet-bar a, .leaflet-bar a:hover { background: var(--surface); color: var(--ink); border-bottom-color: var(--border); }
.leaflet-control-attribution { background: color-mix(in srgb, var(--surface) 80%, transparent) !important; color: var(--ink-3) !important; font-size: 10.5px; }
.leaflet-control-attribution a { color: var(--ink-2) !important; }
.map-marker { stroke: var(--surface); }
@media (max-width: 1100px) { .map-layout { grid-template-columns: minmax(0, 1fr); } .map-box { height: 460px; } .map-side { max-height: none; } }
@media (max-width: 760px) { .map-box { height: 380px; } }
.legend-inline { margin: 0 0 0 4px; }
/* OSM has no dark style: invert the base map, keep the markers as they are. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(.85) contrast(.9) saturate(.6); }
}
:root[data-theme="dark"] .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(.85) contrast(.9) saturate(.6); }
/* Leaflet's panes carry z-indexes up to 1000; keep them inside their box, under the drawer and the sidebar. */
.map-box, .mini-map { position: relative; z-index: 0; isolation: isolate; }
/* Who is on the site now: a pin per place, green and pulsing while someone there is active. */
.online-pin { display: grid; place-items: center; border-radius: 50%; background: var(--surface); color: var(--ink); border: 2px solid var(--ink-2); box-shadow: var(--shadow); font-size: 12px; font-weight: 700; cursor: pointer; }
.online-pin.on { background: var(--good); color: var(--surface); border-color: var(--surface); }
.online-pin.on::before { content: ''; position: absolute; inset: -2px; border-radius: 50%; border: 2px solid var(--good); animation: online-pulse 1.8s ease-out infinite; pointer-events: none; }
.online-pin.selected { outline: 3px solid var(--ink); outline-offset: 1px; }
.online-pin:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
@keyframes online-pulse { from { transform: scale(1); opacity: .8; } to { transform: scale(2.1); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .online-pin.on::before { animation: none; transform: scale(1.35); opacity: .45; } }
.legend i.pin { background: var(--surface); border: 2px solid var(--ink-2); border-radius: 50%; width: 11px; height: 11px; }
.legend i.pin.on { background: var(--good); border-color: var(--good); }
.segmented .live-dot { display: inline-block; margin-right: 7px; vertical-align: 1px; }
.map-side-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.map-side .people { margin-top: 0; }

/* ─── v6: IP intelligence ─────────────────────────────── */
.kpi-sub { font-size: 13px; color: var(--ink-2); margin-top: 2px; }
.kpi-sub b { color: var(--ink); font-weight: 700; }
.reasons { margin: 0; padding-left: 16px; display: grid; gap: 3px; font-size: 12.5px; color: var(--ink-2); }
.card-title .chip { margin-left: 6px; vertical-align: 1px; }
/* Categorical colours for multi-series lines (validated for colour blindness, light and dark). */
:root { --cat-1: var(--accent); --cat-2: #eb6834; --cat-3: #1baf7a; --cat-4: #eda100; --cat-5: #e87ba4; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --cat-2: #d95926; --cat-3: #199e70; --cat-4: #c98500; --cat-5: #d55181; } }
:root[data-theme="dark"] { --cat-2: #d95926; --cat-3: #199e70; --cat-4: #c98500; --cat-5: #d55181; }
.chart .line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .end-dot, .chart .hover-dot { stroke: var(--surface); stroke-width: 2; }
.chart .key { stroke-width: 2; stroke-linecap: round; }
.chart .end-label { fill: var(--ink-2); font-size: 11.5px; }
.chart .crosshair { stroke: var(--ink-3); stroke-width: 1; }
.chart .c1 { stroke: var(--cat-1); } .chart .c2 { stroke: var(--cat-2); } .chart .c3 { stroke: var(--cat-3); } .chart .c4 { stroke: var(--cat-4); } .chart .c5 { stroke: var(--cat-5); }
.chart circle.c1 { fill: var(--cat-1); } .chart circle.c2 { fill: var(--cat-2); } .chart circle.c3 { fill: var(--cat-3); } .chart circle.c4 { fill: var(--cat-4); } .chart circle.c5 { fill: var(--cat-5); }
.legend i.line-key { height: 2px; width: 14px; border-radius: 1px; }
.legend i.c1, .tt-key.c1 { background: var(--cat-1); } .legend i.c2, .tt-key.c2 { background: var(--cat-2); } .legend i.c3, .tt-key.c3 { background: var(--cat-3); }
.legend i.c4, .tt-key.c4 { background: var(--cat-4); } .legend i.c5, .tt-key.c5 { background: var(--cat-5); }
.tooltip .tt-row span { display: inline-flex; align-items: center; gap: 6px; }
.tt-key { display: inline-block; width: 12px; height: 2px; border-radius: 1px; }
.spark { display: block; }
.spark rect { fill: var(--accent); }
.spark rect.zero { fill: var(--surface-3); }
.spark rect.partial { opacity: .45; }
.check-top { align-items: flex-start; }
.check-top input { margin-top: 2px; flex: none; }
.label-line { margin-top: 12px; font-size: 13px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.rep-line { margin-top: 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; font-size: 13px; }
.rep-line .fact-label { font-size: 12px; }
.btn-sm { padding: 3px 9px; font-size: 12px; }
.rep-bar .form-row { margin-top: 8px; }
.week-heat { table-layout: fixed; border-spacing: 2px; min-width: 300px; }
.week-heat th { padding: 0 0 2px; font-size: 10.5px; font-weight: 500; text-align: left; }
.week-heat th.left { width: 26px; padding-right: 4px; }
.week-heat td { padding: 0; height: 18px; border-radius: 3px; }
.week-heat td:hover { outline: 1.5px solid var(--ink); outline-offset: -1px; }
.heat-scale { display: flex; align-items: center; gap: 3px; margin-top: 6px; font-size: 11.5px; color: var(--ink-3); }
.heat-scale i { width: 14px; height: 10px; border-radius: 2px; display: inline-block; }
.heat-scale span:first-child { margin-right: 3px; }
.heat-scale span:last-child { margin-left: 3px; }

/* ─── v7: Autoschool CRM design system ────────────────── */
/* Actions: neutral outline buttons, near-black primary, soft destructive (shadcn Button). */
.btn {
  height: 32px; padding: 0 12px; gap: 6px; border-radius: var(--radius-md);
  border: 1px solid var(--border); background: var(--bg); color: var(--ink);
  font-weight: 500; font-size: 13px; box-shadow: var(--shadow-xs);
  transition: background-color .15s, border-color .15s, color .15s;
}
.btn:hover { background: var(--surface-2); }
.btn-sm { height: 26px; padding: 0 9px; font-size: 12px; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.btn-primary:hover { background: color-mix(in oklch, var(--primary) 85%, var(--bg)); border-color: transparent; }
.btn-danger { background: var(--destructive-soft); border-color: transparent; color: var(--destructive); box-shadow: none; }
.btn-danger:hover { background: color-mix(in oklch, var(--destructive) 18%, transparent); }
.icon-btn { border-radius: var(--radius-md); }

/* Focus: the system's 3px ring instead of a blue outline. */
.filters > input:focus, .filters select:focus,
.form-row input:focus, .form-row select:focus, .login-card input:focus,
.marks textarea:focus, .marks input:focus,
.form-grid input:focus, .form-grid select:focus, .key-area:focus {
  outline: none; border-color: var(--ring); box-shadow: 0 0 0 3px var(--ring-soft);
}
.btn:focus-visible, .icon-btn:focus-visible, .segmented button:focus-visible, .sidenav a:focus-visible {
  outline: none; box-shadow: 0 0 0 3px var(--ring-soft);
}

/* Inputs (shadcn Input): 32px, radius-md, transparent fill. */
.filters > input, .filters select, .form-grid input, .form-grid select,
.form-row input[type=text], .form-row input[type=password], .form-row select, .login-card input {
  height: 32px; border-radius: var(--radius-md); border-color: var(--border); background: transparent; font-size: 13.5px;
  box-shadow: var(--shadow-xs); transition: border-color .15s, box-shadow .15s;
}
.marks textarea, .key-area { border-radius: var(--radius-md); background: transparent; }
.marks input[type=text] { border-radius: var(--radius-md); background: transparent; }
.check input { accent-color: var(--primary); }

/* Segmented control (shadcn Tabs): muted track, white active pill. */
.segmented { background: var(--surface-2); border: 0; padding: 3px; border-radius: 10px; }
.segmented button { padding: 4px 10px; border-radius: var(--radius-md); font-weight: 500; color: var(--ink-3); }
.segmented button:hover { color: var(--ink); }
.segmented button.active { background: var(--bg); color: var(--ink); box-shadow: var(--shadow-xs); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .segmented button.active { background: var(--surface-3); } }
:root[data-theme="dark"] .segmented button.active { background: var(--surface-3); }

/* Sidebar (shadcn Sidebar): tinted panel, plain group labels, muted active item. */
.sidebar { background: var(--sidebar); border-right-color: var(--border); }
.sidebar > .brand { padding: 18px 20px 12px; }
.brand-word { font-weight: 700; font-size: 18px; letter-spacing: -.02em; }
.brand-dot { color: var(--ink-3); }
.sidenav { padding: 4px 8px 16px; }
.nav-group + .nav-group { margin-top: 14px; }
.nav-title { text-transform: none; letter-spacing: 0; font-size: 12px; font-weight: 500; color: var(--ink-3); padding: 6px 8px 4px; }
.sidenav a { padding: 6px 8px; border-radius: var(--radius-md); color: var(--ink); font-weight: 400; font-size: 14px; }
.sidenav a:hover { background: var(--surface-2); }
.sidenav a.active { background: var(--surface-2); color: var(--ink); font-weight: 500; }
.sidebar .sync { border-top-color: var(--border); padding: 12px; }
.mobilebar { background: color-mix(in srgb, var(--bg) 88%, transparent); }

/* Page and cards (PageTitle, Card, Metric). */
.view-title { font-size: 22px; font-weight: 600; letter-spacing: -.015em; }
.view-sub { color: var(--ink-3); }
.card { border-radius: var(--radius); border-color: var(--border); box-shadow: none; padding: 18px 20px; }
.card-title { font-size: 15px; font-weight: 500; }
.card-sub { color: var(--ink-3); font-size: 13px; }
.section-title { color: var(--ink-3); font-weight: 600; }
.kpi { border-radius: var(--radius); box-shadow: none; padding: 16px; }
.kpi-label { color: var(--ink-3); font-size: 13px; }
.kpi-value { font-weight: 600; letter-spacing: -.02em; }

/* Tables (shadcn Table): no header fill, medium-weight headings, hairline rows. */
table.data th { background: transparent; color: var(--ink); font-weight: 500; font-size: 13px; padding: 10px 12px; }
table.data td { padding: 9px 12px; }
table.data tbody tr:hover td { background: color-mix(in oklch, var(--surface-2) 50%, transparent); }
table.data tbody tr.row-link:hover td { background: var(--surface-2); }
table.data tbody tr.row-link:focus-visible { outline: 2px solid var(--ring); }
table.data th .arrow { color: var(--ink-3); }
.cell-main { font-weight: 500; }
.user-link { font-weight: 500; }

/* Badges (shadcn Badge): rounded-full, 500 weight. */
.chip, .tag { font-weight: 500; font-size: 12px; padding: 2px 8px; }
.chip { background: var(--surface-2); color: var(--ink); }
.chip.dark { background: var(--primary); color: var(--primary-ink); }
.delta { font-weight: 500; }

/* Surfaces that float: tooltip, drawer, banners. */
.tooltip { border-radius: var(--radius-md); box-shadow: var(--shadow-lg); }
.drawer { background: var(--bg); }
.drawer-head { background: var(--bg); }
.drawer-title h2 { font-weight: 600; }
.visit { border-radius: 10px; }
.visit-head { background: var(--surface-2); }
.person, .map-person { border-radius: 10px; }
.person:hover, .map-person:hover, .map-person:focus-visible { border-color: var(--ring); }
.banner, .tip, .ua, .url-preview, .url-list code { border-radius: var(--radius-md); }
.status-banner { border-radius: var(--radius); font-weight: 500; }

/* Charts: "bad outcome" has its own status colour, outside series 1–5. */
.chart .bar.bad, .legend i.bad, .acc-bar .bar-fill.bad { fill: var(--chart-bad); background: var(--chart-bad); }
.bar-track { background: var(--surface-2); }

/* ─── v7: design-system components ────────────────────── */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
@keyframes fade-in { from { opacity: 0; } }
@keyframes zoom-in { from { opacity: 0; transform: scale(.95); } }
@keyframes pulse { 50% { opacity: .5; } }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* Button variants: ghost (Pagination) and destructive (AlertDialog). */
.btn-ghost { border-color: transparent; background: transparent; box-shadow: none; }
.btn-ghost:hover { background: var(--surface-2); }
.btn-ghost:disabled { opacity: .5; cursor: default; }
.btn-ghost:disabled:hover { background: transparent; }
.btn-destructive { background: var(--destructive); border-color: var(--destructive); color: #fff; }
.btn-destructive:hover { background: color-mix(in oklch, var(--destructive) 88%, black); }

/* Tooltip: dark pill, small text. */
.hint {
  position: fixed; z-index: 70; pointer-events: none; max-width: 320px;
  background: var(--ink); color: var(--bg); border-radius: var(--radius-md);
  padding: 6px 12px; font-size: 12px; line-height: 1.4; animation: zoom-in .1s ease-out;
}

/* AlertDialog: dimmed backdrop, centred card, actions bottom-right. */
.dialog-overlay {
  position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 16px;
  background: oklch(0 0 0 / 10%); backdrop-filter: blur(2px); animation: fade-in .1s ease-out;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .dialog-overlay { background: oklch(0 0 0 / 50%); } }
:root[data-theme="dark"] .dialog-overlay { background: oklch(0 0 0 / 50%); }
.dialog {
  width: min(420px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; display: grid; gap: 16px;
  background: var(--surface); color: var(--ink); border-radius: var(--radius); padding: 18px;
  box-shadow: 0 0 0 1px var(--border), var(--shadow-lg); animation: zoom-in .1s ease-out;
}
.dialog-title { margin: 0; font-size: 16px; font-weight: 500; }
.dialog-text { margin: -10px 0 0; font-size: 14px; color: var(--ink-3); white-space: pre-line; overflow-wrap: anywhere; }
.dialog-footer { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }

/* Toaster (sonner): bottom-right stack. */
.toaster { position: fixed; right: 16px; bottom: 16px; z-index: 90; list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; width: min(360px, calc(100vw - 32px)); }
.toast {
  display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; font-size: 13.5px;
  background: var(--surface); color: var(--ink); border: 1px solid var(--border); border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg); animation: toast-in .2s ease-out; transition: opacity .2s, transform .2s;
}
.toast .icon { margin-top: 2px; }
.toast.ok .icon { color: var(--good); }
.toast.error .icon { color: var(--destructive); }
.toast.leaving { opacity: 0; transform: translateY(8px); }

/* Skeleton. */
.skeleton { border-radius: var(--radius-md); background: var(--surface-2); animation: pulse 2s cubic-bezier(.4, 0, .6, 1) infinite; }
.skeleton-page { display: grid; gap: 16px; padding-top: 4px; }
.skeleton-page > .skeleton:nth-child(3) { margin-top: -10px; }
.skeleton-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 760px) { .skeleton-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Spinner, for inline lookups. */
.loading { display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--ink-3); }
.loading::before {
  content: ""; width: 16px; height: 16px; border-radius: 50%; flex: none;
  border: 2px solid var(--surface-3); border-top-color: var(--ink-3); animation: spin .8s linear infinite;
}

/* Pagination. */
.pagination { display: flex; align-items: center; gap: 2px; }
.pagination .btn { padding: 0 8px 0 6px; }
.pagination .btn:last-child { padding: 0 6px 0 8px; }
.page-of { color: var(--ink-3); font-size: 13px; padding: 0 8px; white-space: nowrap; }
.pager .btns { align-items: center; }

/* Empty / TableEmpty. */
div.empty { border: 1px dashed var(--border); border-radius: 10px; padding: 20px 16px; text-align: center; color: var(--ink-3); font-size: 13.5px; }
td.empty { text-align: center; padding: 32px 12px; color: var(--ink-3); font-size: 13.5px; }
table.data tbody tr:hover td.empty { background: transparent; }

/* NativeSelect: own chevron, no OS chrome. */
.filters select, .form-row select, .form-grid select {
  appearance: none; -webkit-appearance: none; padding-right: 30px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23737373' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 9px center; background-size: 16px;
}
.filters select:hover, .form-row select:hover, .form-grid select:hover { background-color: var(--surface-2); }

/* Checkbox: 16px, radius 4, filled primary with a check when on. */
input[type=checkbox] {
  appearance: none; -webkit-appearance: none; margin: 0; width: 16px; height: 16px; flex: none; cursor: pointer;
  border: 1px solid var(--border); border-radius: 4px; background: transparent; box-shadow: var(--shadow-xs);
  display: inline-grid; place-content: center; transition: background-color .15s, border-color .15s;
}
input[type=checkbox]::after {
  content: ""; width: 10px; height: 10px; transform: scale(0); transition: transform .1s;
  background: var(--primary-ink);
  clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
}
input[type=checkbox]:checked { background: var(--primary); border-color: var(--primary); }
input[type=checkbox]:checked::after { transform: scale(1); }
input[type=checkbox]:focus-visible { outline: none; border-color: var(--ring); box-shadow: 0 0 0 3px var(--ring-soft); }
input[type=checkbox]:disabled { cursor: not-allowed; opacity: .5; }

/* Switch: settings toggles (a checkbox inside .check). */
.check > input[type=checkbox] {
  width: 32px; height: 18.4px; border-radius: 999px; border-color: transparent; background: var(--border);
  box-shadow: none; place-content: center start; padding: 0 1px;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .check > input[type=checkbox] { background: oklch(1 0 0 / 15%); } }
:root[data-theme="dark"] .check > input[type=checkbox] { background: oklch(1 0 0 / 15%); }
.check > input[type=checkbox]::after {
  width: 16px; height: 16px; border-radius: 50%; clip-path: none; transform: none;
  background: var(--bg); transition: transform .15s;
}
.check > input[type=checkbox]:checked { background: var(--primary); }
.check > input[type=checkbox]:checked::after { transform: translateX(calc(100% - 2px)); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .check > input[type=checkbox]::after { background: var(--ink); }
  :root:not([data-theme="light"]) .check > input[type=checkbox]:checked::after { background: var(--primary-ink); }
}
:root[data-theme="dark"] .check > input[type=checkbox]::after { background: var(--ink); }
:root[data-theme="dark"] .check > input[type=checkbox]:checked::after { background: var(--primary-ink); }
.check { gap: 10px; }
.check-top > input[type=checkbox] { margin-top: 1px; }

/* Sidebar icons (Lucide, as in the design system). */
.sidenav a { justify-content: flex-start; }
.nav-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-icon { color: var(--ink-3); }
.sidenav a:hover .nav-icon, .sidenav a.active .nav-icon { color: var(--ink); }

/* ─── v8: charts from the shadcn chart set ────────────── */
/* Area: gradient fills by series colour, the earlier period as a dashed line. */
.chart .stop.c1 { stop-color: var(--cat-1); } .chart .stop.c2 { stop-color: var(--cat-2); } .chart .stop.c3 { stop-color: var(--cat-3); }
.chart .stop.c4 { stop-color: var(--cat-4); } .chart .stop.c5 { stop-color: var(--cat-5); }
.chart .area { stroke: none; }
.chart .line.compare { stroke: var(--ink-3); stroke-width: 1.5; stroke-dasharray: 4 4; }
.legend i.dashed { height: 0; width: 16px; border-radius: 0; background: none; border-top: 2px dashed var(--ink-3); }

/* Bars use the design system's series colours. */
.chart .bar { fill: var(--cat-1); }
.chart .bar.s2 { fill: var(--cat-2); }
.chart .bar.hover { fill: color-mix(in oklch, var(--cat-1) 80%, var(--ink)); }
.chart .bar.s2.hover { opacity: 1; fill: color-mix(in oklch, var(--cat-2) 80%, var(--ink)); }
.chart .bar.c3 { fill: var(--cat-3); stroke: none; }
.chart .bar.c3.hover { fill: color-mix(in oklch, var(--cat-3) 80%, var(--ink)); }
.chart .bar.good { fill: var(--cat-3); }
.legend i { background: var(--cat-1); }
.legend i.good { background: var(--cat-3); }
.bar-fill { background: var(--cat-1); }

/* Tooltip indicator (shadcn ChartTooltipContent, indicator="dot"). */
.tooltip { min-width: 180px; }
.tooltip .tt-title { font-weight: 500; }
.tt-dot { width: 10px; height: 10px; border-radius: 2px; flex: none; display: inline-block; background: var(--ink-3); }
.tt-dot.c1 { background: var(--cat-1); } .tt-dot.c2, .tt-dot.s2 { background: var(--cat-2); } .tt-dot.c3, .tt-dot.good { background: var(--cat-3); }
.tt-dot.c4 { background: var(--cat-4); } .tt-dot.c5 { background: var(--cat-5); } .tt-dot.bad { background: var(--chart-bad); }
.tt-dot.dashed { height: 0; border-radius: 0; background: none; border-top: 2px dashed var(--ink-3); }

/* Donut with text (shadcn "Pie Chart - Donut with Text"). */
.donut { display: grid; grid-template-columns: 148px minmax(0, 1fr); gap: 16px; align-items: center; }
@media (max-width: 1280px) { .grid-3 .donut { grid-template-columns: minmax(0, 1fr); justify-items: center; } .grid-3 .donut-legend { width: 100%; } }
@media (max-width: 420px) { .donut { grid-template-columns: minmax(0, 1fr); justify-items: center; } .donut-legend { width: 100%; } }
.donut-svg { width: 148px; height: 148px; display: block; }
.donut .slice { stroke: var(--surface); stroke-width: 2; stroke-linejoin: round; transition: opacity .15s; }
.donut-svg:hover .slice { opacity: .55; }
.donut-svg .slice:hover { opacity: 1; }
.slice.c1 { fill: var(--cat-1); } .slice.c2 { fill: var(--cat-2); } .slice.c3 { fill: var(--cat-3); }
.slice.c4 { fill: var(--cat-4); } .slice.c5 { fill: var(--cat-5); } .slice.ghost { fill: var(--ghost); }
.donut-value { fill: var(--ink); font-size: 22px; font-weight: 600; letter-spacing: -.02em; }
.donut-label { fill: var(--ink-3); font-size: 11px; }
.donut-legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; min-width: 0; }
.donut-legend li { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; gap: 8px; align-items: center; font-size: 13px; }
.donut-legend i { width: 10px; height: 10px; border-radius: 2px; }
.donut-legend i.c1 { background: var(--cat-1); } .donut-legend i.c2 { background: var(--cat-2); } .donut-legend i.c3 { background: var(--cat-3); }
.donut-legend i.c4 { background: var(--cat-4); } .donut-legend i.c5 { background: var(--cat-5); } .donut-legend i.ghost { background: var(--ghost); }
.dl-key { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dl-val { font-weight: 600; white-space: nowrap; text-align: right; }
.dl-val .faint { font-weight: 400; margin-left: 6px; }
.dl-val .delta { margin-left: 6px; font-size: 11px; padding: 0 5px; }

/* Skeleton sizes (no inline styles: the CSP forbids them). */
.sk-title { width: 220px; height: 26px; }
.sk-sub { width: 320px; max-width: 100%; height: 14px; margin-top: 8px; }
.sk-kpi { height: 92px; }
.sk-card { height: 260px; }
.skeleton-page > .skeleton:nth-child(3) { margin-top: 0; }

/* Theme switcher at the foot of the sidebar. */
.theme-switch { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 12px 14px 20px; }
.theme-label { font-size: 12px; font-weight: 500; color: var(--ink-3); }
.theme-seg button { display: inline-grid; place-items: center; width: 30px; height: 26px; padding: 0; }
.theme-seg .icon { width: 15px; height: 15px; }

/* Info popover (the design system's Popover: bg-popover, ring, rounded-lg, text-sm). */
.info-btn {
  display: inline-grid; place-items: center; width: 20px; height: 20px; margin-left: 4px; padding: 0;
  border: 0; border-radius: 50%; background: transparent; color: var(--ink-3); cursor: pointer; vertical-align: -3px;
}
.info-btn .icon { width: 15px; height: 15px; }
.info-btn:hover, .info-btn[aria-expanded="true"] { color: var(--ink); background: var(--surface-2); }
.info-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--ring-soft); }
.kpi-label .info-btn { margin-left: auto; }
.view-title .info-btn { width: 24px; height: 24px; vertical-align: 0; margin-left: 6px; }
.view-title .info-btn .icon { width: 17px; height: 17px; }
.popover {
  position: fixed; z-index: 75; width: min(360px, calc(100vw - 16px)); max-height: min(60vh, 480px); overflow-y: auto;
  background: var(--surface); color: var(--ink); border-radius: 10px; padding: 12px 14px;
  box-shadow: 0 0 0 1px var(--border), var(--shadow-lg); font-size: 13px; line-height: 1.5; font-weight: 400;
  animation: zoom-in .1s ease-out;
}
.popover h4 { margin: 0 0 6px; font-size: 13.5px; font-weight: 600; }
.popover p { margin: 0; color: var(--ink-2); }
.popover p + p { margin-top: 8px; }
.popover b { color: var(--ink); font-weight: 600; }

/* ─── Everything that is happening: team, content, social, ads, analytics ── */
details.more { border-top: 1px solid var(--border); }
details.more > summary { cursor: pointer; padding: 10px 16px; font-size: 13px; color: var(--ink-2); list-style: none; }
details.more > summary::-webkit-details-marker, .more-card > summary::-webkit-details-marker { display: none; }
details.more > summary::before, .more-card > summary .card-title::before { content: '▸ '; color: var(--ink-3); }
details.more[open] > summary::before, .more-card[open] > summary .card-title::before { content: '▾ '; }
.more-card > summary { cursor: pointer; list-style: none; }
.feed-list { display: flex; flex-direction: column; }
.feed-item { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 14px; padding: 14px 0; border-top: 1px solid var(--border); }
.feed-item:first-child { border-top: 0; padding-top: 4px; }
.feed-top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.feed-text { margin-top: 6px; font-size: 13px; color: var(--ink-2); white-space: pre-line; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.feed-links { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12.5px; }
.feed-links a { text-decoration: none; }
.media-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; align-items: center; }
.media-thumb { display: block; width: 96px; height: 120px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); background: var(--surface-2); }
video.media-thumb { width: 120px; height: 213px; object-fit: contain; background: #000; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; padding: 4px 0 16px; }
.media-cell { margin: 0; min-width: 0; }
.media-cell .media-thumb { width: 100%; height: 170px; }
.media-cell video.media-thumb { height: 250px; }
.media-cell figcaption { margin-top: 4px; overflow-wrap: anywhere; }
.md { font-size: 13.5px; line-height: 1.55; overflow-wrap: anywhere; }
.md-h { font-weight: 700; margin: 14px 0 6px; }
.md-h1 { font-size: 17px; }
.md-h2 { font-size: 15.5px; }
.md-h3, .md-h4 { font-size: 14px; }
.md-p { margin: 6px 0; }
.md-list { margin: 6px 0; padding-left: 20px; }
.md-list li { margin: 3px 0; }
.md code { font-family: var(--mono); font-size: 12.5px; background: var(--surface-2); padding: 1px 4px; border-radius: 4px; }
.report-body { padding: 4px 16px 16px; }
.row-total td, .row-group td { background: var(--surface-2); }
.ad-body { white-space: pre-line; max-width: 420px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
@media (max-width: 640px) {
  .feed-item { grid-template-columns: minmax(0, 1fr); gap: 6px; }
}

/* ─── Social calendar ── */
.cal-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.cal-title-main { min-width: 170px; }
.cal-nav { display: inline-flex; gap: 4px; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; color: var(--ink-2); }
.cal-legend span { display: inline-flex; align-items: center; gap: 5px; }
.cal-legend i, .cal-dots i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); }
.cal-head, .cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-head { margin-bottom: 4px; font-size: 11.5px; color: var(--ink-3); text-align: center; }
.cal-cell {
  display: flex; flex-direction: column; align-items: stretch; gap: 3px; min-width: 0; min-height: 112px; padding: 5px;
  border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--ink); font: inherit; text-align: left; cursor: pointer;
}
.cal-cell:hover { border-color: var(--ink-3); }
.cal-cell.out { opacity: .45; }
.cal-cell.selected { outline: 2px solid var(--accent); outline-offset: -1px; }
.cal-date { align-self: flex-start; display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.cal-cell.today .cal-date { background: var(--accent); color: #fff; }
.cal-items { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cal-item { display: block; padding: 1px 5px; border-left: 3px solid var(--ink-3); border-radius: 5px; background: var(--surface-2); font-size: 11.5px; line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-time { color: var(--ink-3); font-variant-numeric: tabular-nums; }
.cal-more { padding-left: 6px; font-size: 11px; color: var(--ink-3); }
.cal-dots { display: none; flex-wrap: wrap; gap: 3px; }
.cal-dots i { width: 6px; height: 6px; }
.cal-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.cal-wcol { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.cal-whead { padding: 4px 2px 6px; border: 0; border-bottom: 2px solid var(--border); background: none; color: var(--ink-2); font: inherit; font-size: 12.5px; text-align: left; cursor: pointer; }
.cal-wcol.today .cal-whead b { color: var(--accent); }
.cal-wcol.selected .cal-whead { border-bottom-color: var(--accent); color: var(--ink); }
.cal-card {
  display: flex; flex-direction: column; gap: 4px; min-width: 0; padding: 6px;
  border: 1px solid var(--border); border-left: 3px solid var(--ink-3); border-radius: 8px; background: var(--surface); color: var(--ink); font: inherit; text-align: left; cursor: pointer;
}
.cal-card:hover { border-color: var(--ink-3); }
.cal-thumb { display: flex; align-items: center; justify-content: center; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 6px; background: var(--surface-2); color: var(--ink-3); font-size: 22px; }
.cal-meta { font-size: 11.5px; color: var(--ink-3); }
.cal-title { font-size: 12px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.cal-empty { padding: 6px 2px; font-size: 12px; color: var(--ink-3); }
.cal-item.st-published, .cal-card.st-published { border-left-color: var(--good); }
.cal-item.st-scheduled, .cal-card.st-scheduled { border-left-color: var(--accent); }
.cal-item.st-prepared, .cal-card.st-prepared { border-left-color: var(--warn); }
.cal-legend i.st-published, .cal-dots i.st-published { background: var(--good); }
.cal-legend i.st-scheduled, .cal-dots i.st-scheduled { background: var(--accent); }
.cal-legend i.st-prepared, .cal-dots i.st-prepared { background: var(--warn); }
@media (max-width: 760px) {
  .cal-cell { min-height: 52px; padding: 4px; }
  .cal-items { display: none; }
  .cal-dots { display: flex; }
  .cal-week { grid-template-columns: minmax(0, 1fr); }
  .cal-wcol { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cal-whead, .cal-empty { grid-column: 1 / -1; }
}
.cal-mark { margin-right: 3px; font-weight: 400; color: var(--ink-2); }
.feed-day .feed-item { grid-template-columns: 64px minmax(0, 1fr); }
.feed-time { font-size: 15px; font-variant-numeric: tabular-nums; }

/* ─── Phone: tables become cards, controls wrap, numbers fit ── */
.td-v { display: contents; }
.kpi { container-type: inline-size; }
.kpi-value { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 6px; font-size: clamp(18px, 19cqi, 26px); }
.kpi.hero .kpi-value { font-size: clamp(22px, 24cqi, 34px); }
@media (max-width: 760px) {
  .segmented { display: flex; flex-wrap: wrap; overflow-x: visible; }
  .segmented button { flex: 1 1 auto; }
}
@media (max-width: 640px) {
  .table-wrap:has(> table.data) { overflow-x: visible; }
  table.data, table.data > tbody, table.data > tbody > tr, table.data > tbody > tr > td { display: block; width: 100%; }
  table.data > thead { display: none; }
  table.data > tbody > tr { padding: 10px 14px; border-bottom: 1px solid var(--border); }
  table.data > tbody > tr:last-child { border-bottom: 0; }
  table.data > tbody > tr > td { display: grid; grid-template-columns: minmax(84px, 38%) minmax(0, 1fr); column-gap: 12px; align-items: baseline; padding: 3px 0; border: 0; text-align: left; white-space: normal; }
  table.data > tbody > tr > td::before { content: attr(data-label); color: var(--ink-3); font-size: 12px; overflow-wrap: anywhere; }
  table.data > tbody > tr > td > .td-v { display: block; min-width: 0; overflow-wrap: anywhere; }
  table.data > tbody > tr > td .mono { overflow-wrap: anywhere; word-break: break-all; }
  table.data > tbody > tr > td .chips { flex-wrap: wrap; }
  table.data > tbody > tr > td .chip { white-space: normal; }
  table.data > tbody > tr > td:first-child, table.data > tbody > tr > td:not([data-label]), table.data > tbody > tr > td.empty { display: block; }
  table.data > tbody > tr > td:first-child::before, table.data > tbody > tr > td:not([data-label])::before, table.data > tbody > tr > td.empty::before { content: none; }
  table.data > tbody > tr > td:first-child { padding-bottom: 6px; font-size: 14px; }
  table.data > tbody > tr > td.num, table.data > tbody > tr > td.nowrap, table.data > tbody > tr > td .nowrap { white-space: normal; }
  table.data > tbody > tr > td::before { text-align: left; }
  table.data > tbody > tr > td.num > .td-v { text-align: right; }
  table.data > tbody > tr > td:has(> .td-v:empty) { display: none; }
  table.data > tbody > tr:hover > td { background: transparent; }
  table.data > tbody > tr.row-link:active { background: var(--surface-2); }
}

/* ─── What waits for the owner ── */
.nav-count { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--warn-soft); color: var(--warn); font-size: 11.5px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; }
.nav-count[hidden] { display: none; }
.attention { margin-bottom: 16px; border-color: color-mix(in oklch, var(--warn) 45%, var(--border)); }
.attention.calm { border-color: var(--border); }
.attention-list { margin: 0; padding-left: 18px; display: grid; gap: 6px; font-size: 13.5px; }
.attention-list .chip { margin-left: 4px; }
.attention-strip { display: flex; align-items: center; gap: 10px; margin: 0 0 16px; padding: 10px 14px; border: 1px solid color-mix(in oklch, var(--warn) 45%, var(--border)); border-radius: var(--radius); background: var(--warn-soft); color: var(--ink); text-decoration: none; font-size: 13.5px; }
.attention-strip:hover { border-color: var(--warn); }
.attention-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--warn); }
.attention-go { margin-left: auto; flex: none; color: var(--ink-2); font-weight: 600; }
@media (max-width: 640px) { .attention-strip { flex-wrap: wrap; } .attention-go { margin-left: 18px; } }
.hub-mini { padding: 0 16px 12px; }
.hub-mini .kpi { box-shadow: none; }
.good-text { color: var(--good); }
.kpis.hub-mini { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); }

/* ─── Ads breakdowns and page audience ── */
.hour-strip { display: grid; grid-template-columns: repeat(24, minmax(0, 1fr)); gap: 3px; align-items: end; height: 120px; }
.hour-cell { display: flex; flex-direction: column; align-items: stretch; justify-content: flex-end; height: 100%; min-width: 0; }
.hour-bar { display: block; border-radius: 4px 4px 0 0; background: var(--accent); min-height: 3px; }
.hour-label { margin-top: 4px; font-size: 10.5px; color: var(--ink-3); text-align: center; }
.aud-net + .aud-net { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }
.aud-title { font-weight: 600; margin-bottom: 8px; }
.aud-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.aud-h { font-size: 12px; color: var(--ink-3); margin-bottom: 4px; }
.aud-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 3px; font-size: 13px; }
.aud-list li { display: flex; justify-content: space-between; gap: 8px; }
.aud-posts { margin: 0; padding-left: 18px; display: grid; gap: 4px; font-size: 13px; }
@media (max-width: 640px) { .aud-grid { grid-template-columns: minmax(0, 1fr); } .hour-label { font-size: 9px; } }
.feed-comments { margin: 6px 0 0; padding-left: 18px; display: grid; gap: 2px; font-size: 12.5px; color: var(--ink-2); }
tr.row-thin td { color: var(--ink-3); }
.group-form { display: grid; grid-template-columns: 160px minmax(0, 1.3fr) minmax(0, 1fr) auto; gap: 8px; padding: 0 16px 14px; align-items: center; }
.group-form input { height: 34px; border: 1px solid var(--border); background: var(--surface); color: var(--ink); border-radius: 9px; padding: 0 10px; font: inherit; font-size: 13px; min-width: 0; }
.group-form .form-error { grid-column: 1 / -1; }
@media (max-width: 760px) { .group-form { grid-template-columns: minmax(0, 1fr); } }

/* ─── Guests: filter bar, date range, funnel, findings ─────────────────────── */
.link-btn { background: none; border: 0; padding: 0; color: var(--link); font: inherit; font-size: 12.5px; cursor: pointer; }
.link-btn:hover { text-decoration: underline; }
.gx-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.gx-anchor { position: relative; }
.gx-fb {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; border-radius: var(--radius-md);
  border: 1px solid var(--border); background: var(--bg); color: var(--ink); font: inherit; font-size: 13px; cursor: pointer; white-space: nowrap; box-shadow: var(--shadow-xs);
}
.gx-fb:hover { background: var(--surface-2); }
.gx-fb .gx-k { color: var(--ink-3); }
.gx-fb.set { border-color: color-mix(in oklch, var(--accent) 45%, var(--border)); background: var(--accent-soft); }
.gx-fb.set .gx-k { color: var(--accent); }
.gx-fb .icon { width: 15px; height: 15px; }
.gx-caret { color: var(--ink-3); }
.gx-pop { position: absolute; z-index: 30; top: calc(100% + 6px); left: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); }

/* Date range: presets on the left, two months on the right. */
.gx-cal-pop { display: grid; grid-template-columns: 180px auto; width: max-content; max-width: calc(100vw - 32px); overflow: hidden; }
.gx-presets { display: flex; flex-direction: column; padding: 8px 0; border-right: 1px solid var(--border); }
.gx-presets button { background: none; border: 0; text-align: left; padding: 8px 16px; font: inherit; font-size: 13px; color: var(--ink); cursor: pointer; }
.gx-presets button:hover { background: var(--surface-2); }
.gx-presets button.active { font-weight: 650; background: var(--surface-2); }
.gx-cal { padding: 14px 16px; }
.gx-cal-top { display: flex; align-items: center; gap: 8px; padding-bottom: 12px; margin-bottom: 12px; border-bottom: 1px solid var(--border); }
.gx-range { border: 1px solid var(--border); border-radius: var(--radius-md); padding: 6px 12px; font-size: 13px; white-space: nowrap; }
.gx-sp { flex: 1; }
.gx-months { display: grid; grid-template-columns: repeat(2, 252px); gap: 24px; }
.gx-mhead { display: flex; align-items: center; gap: 6px; height: 30px; margin-bottom: 6px; }
.gx-mhead b { font-size: 13.5px; flex: 1; }
.gx-month.right .gx-mhead b { text-align: right; }
.gx-mside { color: var(--ink-3); font-size: 12px; }
.gx-mnav { width: 28px; height: 28px; }
.gx-grid { display: grid; grid-template-columns: repeat(7, 36px); row-gap: 2px; }
.gx-wd { text-align: center; font-size: 11px; color: var(--ink-3); padding-bottom: 4px; }
.gx-day { height: 32px; border: 0; background: none; font: inherit; font-size: 12.5px; color: var(--ink); cursor: pointer; border-radius: 0; }
.gx-day:hover:not(:disabled) { background: var(--surface-2); border-radius: 6px; }
.gx-day.in { background: var(--accent-soft); }
.gx-day.edge { background: var(--accent); color: #fff; font-weight: 700; border-radius: 6px; }
.gx-day.today { text-decoration: underline; text-underline-offset: 3px; }
.gx-day:disabled { color: var(--ink-3); opacity: .45; cursor: default; }
.gx-cmp { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border); font-size: 12.5px; color: var(--ink-2); }
.gx-cmp label { display: inline-flex; gap: 5px; align-items: center; cursor: pointer; }
.gx-cal .note { margin: 6px 0 0; }

/* Multi-select with "All". */
.gx-ms-pop { width: 300px; max-width: calc(100vw - 32px); padding: 6px; }
.gx-ms-search { width: 100%; box-sizing: border-box; height: 32px; border: 1px solid var(--border); border-radius: var(--radius-md); padding: 0 10px; margin-bottom: 4px; background: var(--bg); color: var(--ink); font: inherit; font-size: 13px; }
.gx-opts { max-height: 280px; overflow: auto; }
.gx-opt { display: grid; grid-template-columns: 16px 1fr auto; gap: 8px; align-items: center; padding: 6px 8px; border-radius: 6px; font-size: 13px; cursor: pointer; }
.gx-opt:hover { background: var(--surface-2); }
.gx-opt span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gx-opt.gx-all { font-weight: 600; border-bottom: 1px solid var(--border); border-radius: 0; margin-bottom: 2px; }
.gx-opt[hidden] { display: none; }
.gx-ms-foot { display: flex; justify-content: flex-end; gap: 6px; padding: 6px 2px 2px; border-top: 1px solid var(--border); margin-top: 4px; }

/* Step breakdown. */
.gx-h3 { font-size: 13px; margin: 0 0 8px; }
.gx-exs { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; max-height: 520px; overflow: auto; }
.gx-ex { border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; }
.gx-ex-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; font-size: 12.5px; }
.gx-ex-head a { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; }
.gx-ex-head .icon { width: 14px; height: 14px; }
.gx-path { font-size: 12px; color: var(--ink-2); margin-top: 4px; line-height: 1.45; overflow-wrap: anywhere; }

/* Findings. */
.gx-vs { display: grid; grid-template-columns: auto minmax(0, 1fr) 36px; align-items: center; gap: 4px 8px; font-size: 12px; color: var(--ink-3); }
.gx-vs b { color: var(--ink); text-align: right; font-weight: 600; }
.gx-vs-track { height: 8px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.gx-vs-fill { height: 100%; border-radius: 4px; background: var(--ink-3); }

/* Registered vs left. */
.gx-key { display: inline-block; width: 10px; height: 6px; border-radius: 2px; margin-right: 6px; vertical-align: 1px; }
.gx-key.reg, .gx-b.reg { background: var(--cat-3); }
.gx-key.left, .gx-b.left { background: var(--cat-2); }
.gx-cmp { display: grid; gap: 8px; margin-bottom: 10px; }
.gx-cmp-row { display: grid; grid-template-columns: minmax(0, 220px) minmax(0, 1fr) 84px 52px; gap: 12px; align-items: center; }
.gx-cmp-row.weak { opacity: .45; }
.gx-cmp-label span { display: block; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gx-cmp-label small { color: var(--ink-3); font-size: 11.5px; }
.gx-cmp-bars { display: grid; gap: 3px; }
.gx-b { height: 6px; border-radius: 3px; min-width: 1px; }
.gx-cmp-vals { display: grid; font-size: 11.5px; text-align: right; line-height: 1.25; }
.gx-cmp-vals .reg { color: var(--good); }
.gx-cmp-vals .left { color: var(--ink-3); }
.gx-lift { font-weight: 700; font-size: 13px; text-align: right; }
.gx-lift.up { color: var(--good); }
.gx-lift.down { color: var(--bad); }

/* By day. */
.chart .gx-marker { stroke: var(--ink-3); stroke-dasharray: 3 4; stroke-width: 1; }
.gx-markers { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--ink-2); }

@media (max-width: 900px) {
  .gx-months { grid-template-columns: 252px; }
  .gx-month.right { display: none; }
  .gx-month.left .gx-mhead .gx-mside { display: none; }
}
@media (max-width: 640px) {
  .gx-cal-pop { grid-template-columns: 1fr; position: fixed; left: 16px; right: 16px; top: 64px; max-height: calc(100vh - 80px); overflow: auto; }
  .gx-presets { flex-direction: row; flex-wrap: wrap; border-right: 0; border-bottom: 1px solid var(--border); padding: 8px; gap: 4px; }
  .gx-presets button { padding: 6px 10px; border-radius: 999px; border: 1px solid var(--border); }
  .gx-cal-top { flex-wrap: wrap; }
  .gx-months { grid-template-columns: 1fr; }
  .gx-grid { grid-template-columns: repeat(7, 1fr); }
  .gx-ms-pop { position: fixed; left: 16px; right: 16px; top: 64px; width: auto; }
  .gx-cmp-row { grid-template-columns: minmax(0, 1fr) 56px 44px; }
  .gx-cmp-bars { grid-column: 1 / -1; grid-row: 2; }
}
.filters .gx-bar { margin: 0; flex: 1 1 auto; }
.view-head .rp { align-self: flex-end; }
.view-head .gx-pop { left: auto; right: 0; }

/* Fixed page header and section tabs (app.js buildTabs): the head, its period/filter bar and the
   tabs stay on screen; app.js sets each row's top. Padding instead of margins, so nothing shows
   through the gaps between the rows. */
.sticky-row { position: sticky; z-index: 6; background: var(--bg); }
.view-head.sticky-row { margin: 0; padding: 12px 0; }
.gx-bar.sticky-row { margin: 0; padding-bottom: 12px; }
.view > .segmented.sticky-row { margin-bottom: 16px; box-shadow: 0 0 0 4px var(--bg), 0 16px 0 0 var(--bg); }
.page-tabs { margin: 0 0 16px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.page-tabs .segmented { display: flex; width: max-content; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.page-tabs .segmented::-webkit-scrollbar { display: none; }
.page-tabs .segmented button { white-space: nowrap; flex: none; }
/* On a phone the tabs stay one row that scrolls sideways, and the fixed head keeps its subtitle to one line. */
@media (max-width: 760px) {
  .page-tabs .segmented { flex-wrap: nowrap; overflow-x: auto; }
  .view-head.sticky-row .view-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .view-head.sticky-row > div:first-child { min-width: 0; max-width: 100%; }
}

/* Stacked columns by category (columnChart stacked): each segment in its series colour, a hairline of
   the surface between segments, an unfinished day (today) pale; the selected period shaded behind;
   a dashed reference level ("обычно"); a value on the column the reader is pointed at. */
.chart .bar.seg { stroke: var(--surface); stroke-width: 1px; }
.chart .bar.seg.c1, .chart .bar.seg.c1.hover { fill: var(--cat-1); }
.chart .bar.seg.c2, .chart .bar.seg.c2.hover { fill: var(--cat-2); }
.chart .bar.seg.c3, .chart .bar.seg.c3.hover { fill: var(--cat-3); }
.chart .bar.seg.c4, .chart .bar.seg.c4.hover { fill: var(--cat-4); }
.chart .bar.seg.hover { filter: brightness(.88); }
.chart .bar.pale { opacity: .45; }
.chart .band { fill: var(--surface-2); }
.chart .ref { stroke: var(--ink-2); stroke-width: 1.5; stroke-dasharray: 4 4; }
.chart .ref-label { fill: var(--ink-2); font-size: 11px; paint-order: stroke; stroke: var(--surface); stroke-width: 3px; }
.chart .top-label { fill: var(--ink); font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }

/* Hero figure: the one number a card leads with, and what it is compared with. */
.hero-value { font-size: 48px; font-weight: 600; letter-spacing: -.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.hero-context { color: var(--ink-2); padding-bottom: 4px; }
.hero-context b { color: var(--ink); font-weight: 600; }

/* Dumbbell (dumbbellChart): the usual value as a ring, the current one as a dot, the line between is
   the change; a row worse than usual in the warning colour, with ⚠ in its label. */

/* ─── Главная: dashboard grid ─────────────────────────── */
.home-grid { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 16px; align-items: start; }
.home-main { display: grid; gap: 16px; min-width: 0; }
.home-stat-label { color: var(--ink-3); font-size: 13px; }
.home-stat-value { font-size: 30px; font-weight: 600; letter-spacing: -.02em; line-height: 1.15; margin-top: 4px; font-variant-numeric: tabular-nums; }
.home-live { color: inherit; text-decoration: none; display: block; }
.home-live:hover { border-color: var(--ring); }
.home-live .card-title { display: flex; align-items: center; gap: 8px; }
.home-live-row { display: flex; align-items: flex-end; gap: 16px; margin-top: 6px; }
.home-live-row .hero-context { color: var(--ink-2); padding-bottom: 4px; font-size: 13px; }
.home-rail { display: grid; gap: 16px; align-content: start; }
.home-rail-head { display: flex; justify-content: space-between; align-items: baseline; }
.home-rail-head .note { margin: 0; }
.home-signups { list-style: none; margin: 0 -10px; padding: 0; display: grid; gap: 2px; }
.home-signups a { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 10px; border-radius: var(--radius-md); color: inherit; text-decoration: none; }
.home-signups a:hover { background: var(--surface-2); }
.avatar { width: 36px; height: 36px; border-radius: 10px; position: relative; overflow: hidden; flex: none; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-strong); font-weight: 600; font-size: 13px; }
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.avatar.lg { width: 52px; height: 52px; border-radius: 14px; font-size: 17px; }
.acc-person { display: flex; align-items: flex-start; gap: 10px; }
.acc-person .avatar { width: 32px; height: 32px; border-radius: 9px; font-size: 12px; margin-top: 1px; }
.user-head { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; }
.home-signup-main { min-width: 0; display: grid; }
.home-signup-main .cell-main { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.home-signup-side { display: grid; justify-items: end; gap: 3px; text-align: right; }
.home-signup-side .cell-sub { max-width: 110px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin: 0; }
.home-signup-side .chip { font-size: 11px; }
@media (max-width: 1180px) {
  .home-grid { grid-template-columns: minmax(0, 1fr); }
  .home-rail { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); align-items: start; }
}
@media (max-width: 760px) {
  .home-stat-value { font-size: 24px; }
}
.home-row > .card { display: flex; flex-direction: column; }
.home-row > .card > .note:last-child { margin-top: auto; padding-top: 10px; }
@media (max-width: 1400px) and (min-width: 1181px) { .home-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } .home-row > .card:last-child { grid-column: 1 / -1; } }

/* Главная: Site checks, hourly chart, exams */
.home-checks { list-style: none; margin: 4px -8px 0; padding: 0; display: grid; gap: 2px; }
.home-checks a { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px; border-radius: var(--radius-md); color: inherit; text-decoration: none; font-size: 13.5px; }
.home-checks a:hover { background: var(--surface-2); }
.home-checks i, .home-seg-legend i { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); }
.home-checks i.green { background: var(--good); }
.home-seg i.pass, .home-seg-legend i.pass { background: var(--cat-1); }
.home-seg i.fail, .home-seg-legend i.fail { background: var(--ink-3); }
.home-checks i.amber, .home-seg i.warn, .home-seg-legend i.warn { background: var(--warn); }
.home-checks i.red { background: var(--chart-bad); }
.home-seg i.idle, .home-seg-legend i.idle { background: var(--border); }
.home-checks i.red { box-shadow: 0 0 0 3px var(--bad-soft); }
.home-live-label { color: var(--ink-3); font-size: 12px; margin-top: 16px; }
.chart.chart-hours { height: 130px; margin-top: 4px; }
.home-live .note { margin-top: auto; padding-top: 8px; }
.home-seg { display: flex; gap: 3px; height: 12px; margin: 16px 0 12px; }
.home-seg i { display: block; height: 100%; border-radius: 4px; min-width: 4px; }
.home-seg-legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; font-size: 13px; }
.home-seg-legend li { display: grid; grid-template-columns: 8px minmax(0, 1fr) auto 38px; gap: 10px; align-items: center; }
.home-seg-legend b { font-weight: 600; font-variant-numeric: tabular-nums; }
.home-seg-legend .faint { text-align: right; font-size: 12px; }
.home-exam-foot { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.home-exam-foot div { display: grid; gap: 2px; }
.home-exam-foot .faint { font-size: 11.5px; }
.home-exam-foot b { font-weight: 600; font-variant-numeric: tabular-nums; }

/* Главная: guest path as a chain of steps */
.gc { list-style: none; margin: 14px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.gc li { position: relative; display: flex; }
.gc li + li::before { content: "→"; position: absolute; left: -10px; top: 14px; width: 10px; text-align: center; color: var(--ink-3); font-size: 12px; }
.gc-step { flex: 1; display: flex; flex-direction: column; gap: 6px; padding: 12px 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-md); color: inherit; text-decoration: none; min-width: 0; }
.gc-step:hover { background: var(--surface-2); }
.gc-step:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.gc-step.warn { border-color: color-mix(in srgb, var(--warn) 55%, var(--border)); background: var(--warn-soft); }
.gc-label { font-size: 13px; color: var(--ink); font-weight: 500; line-height: 1.3; min-height: 4.4em; display: flex; flex-direction: column; gap: 3px; }
.gc-hint { font-size: 11.5px; color: var(--ink-3); font-weight: 400; }
.gc-step.warn .gc-label { color: var(--warn); font-weight: 600; }
.gc-value { font-size: 28px; font-weight: 600; letter-spacing: -.02em; line-height: 1; font-variant-numeric: tabular-nums; }
.gc-delta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12px; min-height: 20px; }
.gc-of { margin-top: auto; padding-top: 10px; border-top: 1px solid var(--border); display: grid; gap: 6px; font-size: 12px; color: var(--ink-3); }
.gc-of b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.gc-track { height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.gc-fill { display: block; height: 100%; border-radius: 3px; background: var(--cat-1); min-width: 2px; }
.gc-step.warn .gc-fill { background: var(--warn); }
@media (max-width: 560px) { .gc { grid-template-columns: repeat(2, minmax(0, 1fr)); } .gc li + li::before { display: none; } }
.legend i.pale { opacity: .45; }

/* ─── Источники и UTM ─────────────────────────────────── */
.src-tile { display: flex; flex-direction: column; }
.src-tile-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.src-tile-head .cell-main { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.src-tile-value { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px; margin: 10px 0 12px; }
.src-tile-value .delta { align-self: center; }
.src-metrics { list-style: none; margin: 0; padding: 12px 0 0; border-top: 1px solid var(--border); display: grid; gap: 8px; font-size: 13px; }
.src-metrics li { display: grid; grid-template-columns: minmax(0, 1fr) auto 64px; gap: 8px; align-items: center; }
.src-metrics li > span:first-child { color: var(--ink-2); }
.src-metrics b { font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.src-metrics .delta { justify-self: end; }
.src-tile .note { margin-top: auto; padding-top: 12px; }
.rail-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.rail-form .span-2 { grid-column: 1 / -1; }
.rail-form label[hidden] { display: none; }
.link-list { list-style: none; margin: 0 -8px; padding: 0; display: grid; gap: 2px; }
.link-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 8px; border-radius: var(--radius-md); }
.link-list li:hover { background: var(--surface-2); }
.link-main { display: grid; min-width: 0; }
.link-main .cell-main, .link-main .cell-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.link-stats { display: flex; gap: 5px; align-items: baseline; font-variant-numeric: tabular-nums; font-size: 13px; }
.link-actions { display: flex; gap: 0; opacity: .55; }
.link-list li:hover .link-actions, .link-actions:focus-within { opacity: 1; }
.link-actions .icon-btn { width: 28px; height: 28px; }
.icon-btn.copied { color: var(--good); }

/* ─── Аккаунты ────────────────────────────────────────── */
.home-seg i.c1 { background: var(--cat-1); } .home-seg i.c2 { background: var(--cat-2); } .home-seg i.c3 { background: var(--cat-3); }
.acc-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 0; margin-bottom: 16px; }
.acc-stat { padding: 18px 20px; min-width: 0; }
.acc-stat + .acc-stat { border-left: 1px solid var(--border); }
.acc-stat-sub { font-size: 12px; margin-top: 6px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.acc-ladder { list-style: none; margin: 4px -10px 0; padding: 0; display: grid; gap: 2px; }
.acc-ladder button { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; padding: 9px 10px; border: 0; background: transparent; border-radius: var(--radius-md); cursor: pointer; color: inherit; font: inherit; text-align: left; }
.acc-ladder button:hover { background: var(--surface-2); }
.acc-ladder button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.acc-ladder-label { font-size: 13.5px; }
.acc-ladder-n { font-size: 13px; font-variant-numeric: tabular-nums; }
.acc-ladder .bar-track { grid-column: 1 / -1; }
.card.flush.acc-list { overflow: visible; }
.acc-toolbar { display: grid; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.acc-toolbar .gx-bar { margin: 0; }
.acc-search { height: 34px; max-width: 420px; width: 100%; min-width: 180px; border: 1px solid var(--border); background: var(--surface); color: var(--ink); border-radius: 9px; padding: 0 10px; font: inherit; font-size: 13px; }
.acc-search:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
@media (max-width: 900px) {
  .acc-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .acc-stat:nth-child(3) { border-left: 0; }
  .acc-stat:nth-child(n + 3) { border-top: 1px solid var(--border); }
}
.acc-ladder .bar-track, .acc-ladder .bar-fill { display: block; }

/* ─── A/B-тесты ───────────────────────────────────────── */
.exp-summary { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: baseline; margin: -4px 0 16px; font-size: 13.5px; color: var(--ink-2); }
.exp-summary b { color: var(--ink); font-size: 18px; font-weight: 600; margin-right: 3px; font-variant-numeric: tabular-nums; }
.exp-card { display: grid; gap: 18px; }
.exp-head { display: grid; gap: 8px; }
.exp-title { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.exp-title .card-title { margin: 0; font-size: 15px; }
.exp-title .faint { font-size: 12.5px; }
.exp-verdict { display: flex; gap: 10px; align-items: flex-start; margin: 0; padding: 10px 12px; border-radius: var(--radius-md); background: var(--surface-2); font-size: 13.5px; color: var(--ink-2); }
.exp-verdict b { color: var(--ink); }
.exp-verdict.good { background: var(--good-soft); color: var(--good); }
.exp-verdict.bad { background: var(--bad-soft); color: var(--bad); }
.exp-verdict.good b, .exp-verdict.bad b { color: inherit; }
.exp-mark { font-weight: 700; width: 14px; text-align: center; flex: none; }
/* Two variants: numbers | screenshot | screenshot | numbers. */
.exp-pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 220px) minmax(0, 220px) minmax(0, 1fr); gap: 20px; align-items: start; }
.exp-many { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; }
.exp-col { display: grid; gap: 12px; align-content: start; }
.exp-shot { margin: 0; display: grid; gap: 6px; }
.exp-shot-label { font-family: var(--mono); font-size: 12px; color: var(--ink-3); text-align: center; }
.exp-shot a { display: block; border-radius: 14px; overflow: hidden; border: 1px solid var(--border); background: var(--surface-2); line-height: 0; }
.exp-shot a:hover { border-color: var(--ring); }
.exp-shot img { width: 100%; height: auto; aspect-ratio: 390 / 844; object-fit: cover; object-position: top; }
.exp-shot-empty { aspect-ratio: 390 / 844; border: 1px dashed var(--border); border-radius: 14px; display: grid; place-items: center; padding: 16px; text-align: center; font-size: 12.5px; color: var(--ink-3); background: var(--surface-2); }
.exp-stats { display: grid; gap: 4px; align-content: start; padding-top: 22px; }
.exp-stats.end { text-align: right; justify-items: end; }
.exp-stats-name { font-size: 14px; font-weight: 600; margin-bottom: 8px; display: flex; gap: 6px; align-items: center; }
.exp-goal { display: flex; gap: 8px; align-items: center; }
.exp-stats.end .exp-goal { flex-direction: row-reverse; }
.exp-goal .home-stat-value { font-size: 34px; }
.exp-of { font-size: 12px; }
.exp-other { list-style: none; margin: 14px 0 0; padding: 12px 0 0; border-top: 1px solid var(--border); display: grid; gap: 7px; font-size: 12.5px; width: 100%; max-width: 260px; }
.exp-other li { display: flex; gap: 8px; align-items: center; justify-content: space-between; }
.exp-stats.end .exp-other li { flex-direction: row-reverse; }
.exp-other li > span:first-child { color: var(--ink-3); }
.exp-other b { font-weight: 600; font-variant-numeric: tabular-nums; margin-left: auto; }
.exp-stats.end .exp-other b { margin-left: 0; margin-right: auto; }
.exp-foot { display: grid; gap: 10px; padding-top: 14px; border-top: 1px solid var(--border); }
.exp-progress { display: grid; gap: 6px; }
.exp-progress-label { font-size: 12.5px; color: var(--ink-2); }
.exp-warn { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.exp-shot-status { margin-left: auto; font-size: 12px; }
.exp-pings summary { cursor: pointer; font-size: 13.5px; }
.exp-pings ul { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 6px; font-size: 13px; }
.exp-pings li { display: flex; gap: 10px; flex-wrap: wrap; }
.exp-toast { position: fixed; left: 50%; top: 16px; transform: translateX(-50%); z-index: 100; max-width: min(560px, calc(100vw - 32px)); background: var(--surface); color: var(--ink); border: 1px solid var(--border); box-shadow: var(--shadow-lg); border-radius: var(--radius-md); padding: 10px 14px; font-size: 13px; }
@media (max-width: 900px) {
  .exp-pair { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .exp-pair > .exp-stats:first-child { grid-row: 2; grid-column: 1; }
  .exp-pair > .exp-stats:last-child { grid-row: 2; grid-column: 2; }
  .exp-stats.end { text-align: left; justify-items: start; }
  .exp-stats.end .exp-goal, .exp-stats.end .exp-other li { flex-direction: row; }
  .exp-stats.end .exp-other b { margin-left: auto; margin-right: 0; }
  .exp-stats { padding-top: 0; }
}
.exp-overlap { font-size: 12px; }

/* ─── Paths: page directory + flow explorer ───────────── */
.pth-grid { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 16px; align-items: start; }
.pth-main { display: grid; gap: 16px; min-width: 0; }
.pth-index { position: sticky; top: 16px; padding: 0; display: flex; flex-direction: column; max-height: calc(100vh - 32px); overflow: hidden; }
.pth-site { padding: 16px 16px 12px; border-bottom: 1px solid var(--border); }
.pth-site-n { font-size: 13px; color: var(--ink-2); }
.pth-site-n b { font-size: 24px; font-weight: 600; letter-spacing: -.02em; color: var(--ink); margin-right: 4px; }
.pth-site-sub { font-size: 12px; color: var(--ink-3); margin-top: 4px; }
.pth-site-sub b { color: var(--ink); font-weight: 600; }
.pth-search { margin: 12px 12px 6px; padding: 7px 10px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); color: var(--ink); font: inherit; font-size: 13px; }
.pth-search:focus-visible { outline: 2px solid var(--accent); outline-offset: -1px; }
.pth-groups { overflow-y: auto; padding: 0 6px 10px; }
.pth-group-head { display: flex; justify-content: space-between; padding: 12px 8px 4px; font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); }
.pth-group ul { list-style: none; margin: 0; padding: 0; }
.pth-page button { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 8px; padding: 6px 8px; border: 0; border-radius: var(--radius-md); background: transparent; text-align: left; cursor: pointer; font: inherit; color: inherit; }
.pth-page button:hover { background: var(--surface-2); }
.pth-page button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.pth-page.active button { background: var(--accent-soft); }
.pth-page.active .pth-page-name { color: var(--accent-strong); font-weight: 600; }
.pth-page-name { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pth-page-n { font-size: 12.5px; font-weight: 600; text-align: right; }
.pth-page-exit { grid-column: 1 / -1; font-size: 11.5px; color: var(--ink-3); }
.pth-page-exit.warn { color: var(--warn); }

.pth-explorer { padding: 0; overflow: hidden; }
.pth-trail-row { display: flex; align-items: center; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.pth-trail { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; font-size: 13px; }
.pth-trail li + li::before { content: "→"; color: var(--ink-3); margin-right: 6px; }
.pth-trail .link-btn { font-size: 13px; }
.pth-trail b { font-weight: 600; }
.pth-trail-hint { font-size: 12px; }

.pth-flow { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(190px, 230px) minmax(0, 1fr); column-gap: 64px; align-items: center; padding: 18px 16px 20px; }
.pth-ribbons { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.pth-ribbons path { fill: none; stroke: var(--accent); stroke-opacity: .2; transition: stroke-opacity .12s; }
.pth-ribbons path.quiet { stroke: var(--ink-3); stroke-opacity: .16; }
.pth-ribbons path.exit { stroke: var(--warn); stroke-opacity: .26; }
.pth-ribbons path.hot { stroke-opacity: .5; }
.pth-col { position: relative; display: grid; gap: 4px; min-width: 0; }
.pth-col-head { font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); margin-bottom: 4px; }
.pth-col.to .pth-col-head { text-align: right; }
.pth-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 7px 10px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); font: inherit; color: inherit; text-align: left; min-width: 0; }
button.pth-row { cursor: pointer; }
button.pth-row:hover { border-color: var(--accent); }
button.pth-row:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.pth-row-name { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.pth-row-n { font-size: 12px; color: var(--ink-3); white-space: nowrap; }
.pth-row-n b { color: var(--ink); font-weight: 600; margin-right: 3px; }
.pth-row.entry, .pth-row.other { background: var(--surface-2); border-style: dashed; }
.pth-row.entry .pth-row-name, .pth-row.other .pth-row-name { color: var(--ink-2); }
.pth-row.exit { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 45%, var(--border)); }
.pth-row.exit .pth-row-name { color: var(--warn); font-weight: 600; }
.pth-node { position: relative; padding: 18px 16px; border-radius: var(--radius); background: var(--primary); color: var(--primary-ink); text-align: center; }
.pth-node-group { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; opacity: .65; }
.pth-node-name { font-size: 16px; font-weight: 600; line-height: 1.25; margin-top: 4px; }
.pth-node-value { font-size: 34px; font-weight: 600; letter-spacing: -.02em; margin-top: 12px; line-height: 1; }
.pth-node-value span { display: block; font-size: 12px; font-weight: 400; letter-spacing: 0; opacity: .65; margin-top: 4px; }
.pth-node-stats { margin: 14px 0 0; padding-top: 12px; border-top: 1px solid color-mix(in srgb, var(--primary-ink) 18%, transparent); display: grid; gap: 6px; text-align: left; }
.pth-node-stats div { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; }
.pth-node-stats dt { opacity: .7; }
.pth-node-stats dd { margin: 0; font-weight: 600; }
.pth-node-stats dd.warn { color: color-mix(in srgb, var(--warn) 70%, var(--primary-ink)); }

.pth-routes { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 24px; }
.pth-route { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border); }
.pth-route .bar-track { grid-column: 1 / -1; height: 4px; }
.pth-chain { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; min-width: 0; }
.pth-chip { padding: 2px 8px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface-2); font: inherit; font-size: 12.5px; color: var(--ink); cursor: pointer; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pth-chip:hover { border-color: var(--accent); color: var(--accent-strong); }
.pth-chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.pth-arrow { color: var(--ink-3); font-size: 12px; }
.pth-leave { font-size: 12.5px; color: var(--warn); }
.pth-route-n { display: flex; gap: 6px; align-items: baseline; font-size: 13px; white-space: nowrap; }
.pth-route-n b { font-weight: 600; }
.pth-route-n .faint { font-size: 12px; }

.pth-clicks > summary { list-style: none; cursor: pointer; }
.pth-clicks > summary::-webkit-details-marker { display: none; }
.pth-clicks > summary .card-title::after { content: " ▸"; color: var(--ink-3); }
.pth-clicks[open] > summary .card-title::after { content: " ▾"; }
.pth-clicks .empty { padding: 12px 16px; }

@media (max-width: 1100px) {
  .pth-flow { column-gap: 40px; grid-template-columns: minmax(0, 1fr) minmax(170px, 200px) minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .pth-grid { grid-template-columns: minmax(0, 1fr); }
  .pth-index { position: static; max-height: 340px; }
  .pth-flow { grid-template-columns: minmax(0, 1fr); row-gap: 16px; }
  .pth-col.to .pth-col-head { text-align: left; }
  .pth-routes { grid-template-columns: minmax(0, 1fr); }
}

/* ─── Activity by time ─────────────────────────────────── */
.tm-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-bottom: 16px; }
.tm-controls .segmented button:disabled { opacity: .45; cursor: default; }
.tm-hero .card-sub b { color: var(--ink); font-weight: 600; }
.tm-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 4px 0 18px; border: 1px solid var(--border); border-radius: var(--radius-md); }
.tm-fact { padding: 12px 14px; min-width: 0; }
.tm-fact + .tm-fact { border-left: 1px solid var(--border); }
.tm-fact-k { font-size: 12px; color: var(--ink-3); }
.tm-fact-v { font-size: 17px; font-weight: 600; margin-top: 4px; letter-spacing: -.01em; }
.tm-fact-v::first-letter { text-transform: uppercase; }
.tm-fact-sub { font-size: 12px; color: var(--ink-3); margin-top: 3px; }

.tm-week { width: 100%; min-width: 640px; table-layout: fixed; border-collapse: separate; border-spacing: 3px; }
.tm-week th { font-size: 11px; font-weight: 500; color: var(--ink-3); text-align: left; padding: 0 0 2px; white-space: nowrap; }
.tm-week th:first-child { width: 34px; }
.tm-week tbody th { font-size: 12.5px; color: var(--ink-2); }
.tm-week tbody th.we { color: var(--ink); font-weight: 600; }
.tm-week tbody td { height: 30px; border-radius: 5px; background: var(--surface-2); padding: 0; }
.tm-week tbody td[data-tt]:hover { outline: 1.5px solid var(--ink); outline-offset: -1px; }
.tm-week .tm-edge-h { width: 132px; padding-left: 12px; }
.tm-week td.tm-edge { background: none; padding-left: 12px; }
.tm-hbar { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600; }
.tm-hbar-track { flex: 1; height: 8px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.tm-hbar-track .bar-fill { height: 100%; }
.tm-week tfoot th { font-size: 11px; vertical-align: bottom; }
.tm-week tfoot td { padding: 6px 0 0; background: none; }
.tm-vbar { height: 44px; display: flex; align-items: flex-end; border-radius: 4px; }
.tm-vbar div { width: 100%; min-height: 1px; border-radius: 3px 3px 0 0; background: var(--cat-1, var(--accent)); opacity: .75; }
.tm-col:hover .tm-vbar div { opacity: 1; }
.tm-total { font-size: 13px; font-weight: 600; vertical-align: bottom; }

.tm-week td.none, .tm-bands td.none { background: none; }
.tm-pair { display: grid; grid-template-columns: minmax(0, 1.9fr) minmax(0, 1fr); gap: 16px; margin-top: 16px; align-items: start; }
.tm-bands { width: 100%; table-layout: fixed; border-collapse: separate; border-spacing: 2px; }
.tm-bands.tm-dom { min-width: 620px; }
.tm-bands.tm-mon { min-width: 340px; }
.tm-bands th { font-size: 10.5px; font-weight: 500; color: var(--ink-3); text-align: center; padding: 0 0 2px; white-space: nowrap; }
.tm-bands th:first-child { width: 44px; text-align: left; }
.tm-bands tbody th { font-size: 11px; color: var(--ink-2); text-align: left; }
.tm-bands tbody td { height: 24px; padding: 0; border-radius: 4px; background: var(--surface-2); }
.tm-bands tbody td[data-tt]:hover { outline: 1.5px solid var(--ink); outline-offset: -1px; }
.tm-bands tfoot th { font-size: 11px; text-align: left; vertical-align: bottom; }
.tm-bands tfoot td { padding: 6px 0 0; background: none; }
.tm-bands .tm-vbar { height: 34px; }
.tm-note { margin: 12px 0 0; }

@media (max-width: 1200px) {
  .tm-pair { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 800px) {
  .tm-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tm-fact:nth-child(3) { border-left: 0; }
  .tm-fact:nth-child(n + 3) { border-top: 1px solid var(--border); }
}

/* ─── Guests: wireflow canvas ───────────────────────────── */
.wf-card { margin-bottom: 16px; }
.wf-min { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink-2); white-space: nowrap; }
.wf-min input { width: 120px; accent-color: var(--accent); }
.wf {
  position: relative; overflow: hidden; margin-top: 12px; height: max(480px, calc(100vh - 260px));
  border: 1px solid var(--border); border-radius: var(--radius-md); cursor: grab; touch-action: none; user-select: none;
  background-color: var(--surface-2);
  background-image: radial-gradient(circle, var(--grid) 1.2px, transparent 1.3px); background-size: 22px 22px;
}
.wf:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
.wf.panning { cursor: grabbing; }
.wf-board { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.wf-edges { position: absolute; left: 0; top: 0; overflow: visible; }
.wf-edge .wf-line { fill: none; stroke: var(--accent); stroke-opacity: .35; stroke-linecap: round; transition: stroke-opacity .15s; }
.wf-edge .wf-hit { fill: none; stroke: transparent; stroke-width: 16; pointer-events: stroke; }
.wf-edge.back .wf-line { stroke: var(--violet); stroke-dasharray: 7 6; stroke-opacity: .4; }
.wf-edge.left .wf-line { stroke: var(--bad); stroke-opacity: .45; }
.wf-edge.account .wf-line { stroke: var(--good); stroke-opacity: .65; }
.wf-edge text { font-size: 11px; font-weight: 600; text-anchor: middle; dominant-baseline: central; fill: var(--ink-2); font-variant-numeric: tabular-nums; pointer-events: none; }
.wf-pill { fill: var(--surface); stroke: var(--accent); stroke-opacity: .5; stroke-width: 1; pointer-events: none; }
.wf-edge.back .wf-pill { stroke: var(--violet); }
.wf-edge.left .wf-pill { stroke: var(--bad); stroke-opacity: .35; }
.wf-edge.account .wf-pill { stroke: var(--good); }
.wf-edge[class*="arm-"] .wf-pill { stroke: var(--arm); stroke-opacity: .8; }
.wf.split .wf-edge:not([class*="arm-"]) .wf-pill { stroke: var(--ink-3); stroke-opacity: .4; }
.wf-edge:hover .wf-line { stroke-opacity: .8; }
.wf-head path { fill: var(--accent); fill-opacity: .7; }
.wf-head.back path { fill: var(--violet); }
.wf-head.left path { fill: var(--bad); fill-opacity: .7; }
.wf-head.account path { fill: var(--good); }
.wf-node {
  position: absolute; left: 0; top: 0; display: flex; flex-direction: column; box-sizing: border-box; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-xs);
  cursor: grab; transition: opacity .15s, border-color .15s;
}
.wf-node:hover, .wf-node:focus-visible { border-color: var(--ring); outline: none; }
.wf.dragging-node, .wf.dragging-node .wf-node { cursor: grabbing; }
.wf-node.start { border-color: var(--primary); }
.wf-node.good { background: var(--good-soft); border-color: color-mix(in srgb, var(--good) 45%, var(--border)); }
.wf-node.bad { background: var(--bad-soft); border-color: color-mix(in srgb, var(--bad) 35%, var(--border)); }
.wf-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; justify-content: flex-end; }
.wf-shots-status { font-size: 12px; }
.wf-n-body { padding: 10px 12px; min-width: 0; }
.wf-n-pic { flex: none; height: 140px; background: var(--surface-3); border-bottom: 1px solid var(--border); overflow: hidden; }
.mode-top .wf-node.shot .wf-n-pic { height: 200px; }
/* Весь экран: the phone screen on the left at its own ratio, the text beside it. */
.mode-full .wf-node { flex-direction: row; }
.mode-full .wf-n-pic { width: 130px; height: 100%; border-bottom: 0; border-right: 1px solid var(--border); }
.mode-full .wf-n-body { flex: 1; display: flex; flex-direction: column; justify-content: center; }
.mode-full .wf-n-stats { flex-direction: column; gap: 2px; margin-top: 4px; }
.wf-node.sel { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.wf-mode { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-2); }
.wf-mode select { height: 26px; padding: 0 6px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); color: var(--ink); font: inherit; }
.wf-panel { position: absolute; top: 60px; right: 10px; bottom: 10px; width: min(400px, calc(100% - 20px)); overflow-y: auto; padding: 14px; box-sizing: border-box; cursor: default; user-select: text;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-lg); }
.wf-p-h { margin: 16px 0 8px; font-size: 13px; font-weight: 600; }
.wf-p-h-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.wf-p-h-row .wf-p-h { margin-bottom: 8px; }
.wf-panel .gx-traits, .wf-panel .gx-exs { margin: 0; padding: 0; }
.wf-panel .gx-trait.faint { opacity: .65; }
.wf-p-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.wf-p-head .wf-n-label, .wf-p-head .wf-n-hint { white-space: normal; }
.wf-p-head .wf-n-label { font-size: 15px; }
.wf-p-rows { margin: 12px 0; display: grid; gap: 6px; }
.wf-p-row { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; color: var(--ink-2); }
.wf-p-row b { color: var(--ink); font-variant-numeric: tabular-nums; }
.wf-p-pic .wf-n-pic { height: auto; border: 1px solid var(--border); border-radius: var(--radius-md); }
.wf-p-pic .wf-n-pic.sign, .wf-p-pic .wf-n-pic.empty { height: 140px; }
.wf-p-pic .wf-n-pic img { height: auto; }
.wf-n-pic img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top; pointer-events: none; }
.wf-n-pic.sign, .wf-n-pic.empty { display: grid; place-items: center; color: var(--ink-3); font-size: 12px; }
.wf-n-pic.sign .icon { width: 44px; height: 44px; stroke-width: 1.5; }
.wf-node.good .wf-n-pic.sign { color: var(--good); background: transparent; }
.wf-node.bad .wf-n-pic.sign { color: var(--bad); background: transparent; }
.wf-n-label { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wf-n-hint { font-size: 11px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wf-n-count { font-size: 22px; font-weight: 600; line-height: 1.25; margin-top: 2px; font-variant-numeric: tabular-nums; }
.wf-node.good .wf-n-count { color: var(--good); }
.wf-node.bad .wf-n-count { color: var(--bad); }
.wf-n-stats { display: flex; justify-content: space-between; gap: 8px; font-size: 11px; color: var(--ink-3); }
.wf-n-stats b { color: var(--ink-2); font-variant-numeric: tabular-nums; }
.wf.wf-focus .wf-node:not(.on) { opacity: .45; }
.wf.wf-focus .wf-edge:not(.on) { opacity: .12; }
.wf.wf-focus .wf-edge.on .wf-line { stroke-opacity: .8; }
.wf-ctl { position: absolute; top: 10px; right: 10px; z-index: 2; display: flex; gap: 4px; padding: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-xs); cursor: default; }
.wf-ctl .wf-k { min-width: 52px; font-variant-numeric: tabular-nums; }
/* A/B on the map: arm colours (control first), the test badges over a screen, the arm cards. */
/* Arms: blue and yellow, then two spares; the yellow is darker on light surfaces to stay readable. */
.wf-card { --arm-0: var(--accent); --arm-1: #c99400; --arm-2: var(--violet); --arm-3: #0e9aa7; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .wf-card { --arm-1: #f5c518; }
}
:root[data-theme="dark"] .wf-card { --arm-1: #f5c518; }
.arm-0 { --arm: var(--arm-0); } .arm-1 { --arm: var(--arm-1); } .arm-2 { --arm: var(--arm-2); } .arm-3 { --arm: var(--arm-3); }
.wf-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--arm); margin-right: 4px; vertical-align: 0; }
.wf-edge[class*="arm-"] .wf-line { stroke: var(--arm); stroke-opacity: .6; }
.wf-edge[class*="arm-"] text { fill: var(--arm); }
.wf-head[class*="arm-"] path { fill: var(--arm); fill-opacity: .85; }
/* Where a way ends wins over the arm: green into the account, red out of the site, in every view. */
.wf-edge.account[class*="arm-"] .wf-line { stroke: var(--good); stroke-opacity: .65; }
.wf-edge.left[class*="arm-"] .wf-line { stroke: var(--bad); stroke-opacity: .45; }
.wf.split .wf-edge:not([class*="arm-"]) .wf-line { stroke: var(--ink-3); stroke-opacity: .3; }
.wf-node.variant { border-color: var(--arm); box-shadow: 0 0 0 1px var(--arm); }
.wf-arm { display: inline-flex; align-items: center; font-size: 11px; font-weight: 600; color: var(--arm); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.wf-n-arms { justify-content: flex-start; flex-wrap: wrap; gap: 2px 8px; }
.wf-n-arms span { display: inline-flex; align-items: center; color: var(--ink-2); font-weight: 600; font-variant-numeric: tabular-nums; }
.wf-n-arms i.up { color: var(--good); font-style: normal; margin-left: 2px; }
.wf-n-arms i.down { color: var(--bad); font-style: normal; margin-left: 2px; }
.wf-n-arms span.faint { opacity: .6; }
.wf-tests { position: absolute; left: 0; top: 0; display: flex; flex-wrap: wrap-reverse; gap: 4px; padding-bottom: 6px; box-sizing: border-box; pointer-events: none; }
.wf-test { pointer-events: auto; display: inline-flex; flex-direction: column; gap: 3px; max-width: 100%; padding: 4px 8px 5px; font: inherit; font-size: 11px; font-weight: 600; text-align: left; color: var(--ink); background: var(--surface); border: 1px solid var(--border); border-radius: 999px; cursor: pointer; }
.wf-test:hover, .wf-test:focus-visible { border-color: var(--ring); outline: none; }
.wf-test.on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.wf-test.done { color: var(--ink-3); }
.wf-test-name::before { content: "🧪 "; }
.wf-test-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wf-stripes { display: flex; height: 4px; min-width: 60px; border-radius: 2px; overflow: hidden; background: var(--surface-3); }
.wf-stripes i { display: block; height: 100%; background: var(--arm); }
.wf-test.done .wf-stripes { opacity: .5; }
.wf-node.off, .wf-tests.off { display: none; }
/* Sources before arriving and where new users went after signing up: small cards that follow their screen. */
.wf-node.extra { cursor: default; border-style: dashed; background: var(--surface); }
.wf-node.extra.after { border-color: color-mix(in srgb, var(--good) 45%, var(--border)); }
.wf-node.extra .wf-n-body { padding: 8px 12px; display: flex; flex-direction: column; justify-content: center; height: 100%; box-sizing: border-box; }
.wf-n-extra { display: flex; align-items: baseline; gap: 8px; font-variant-numeric: tabular-nums; }
.wf-n-extra b { font-size: 18px; font-weight: 600; }
.wf-n-extra span { font-size: 12px; color: var(--ink-3); }
.wf-node.passthru { border-style: dashed; box-shadow: none; }
.wf-n-pic.passthru { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 8px; text-align: center; color: var(--arm); background: transparent; line-height: 1.3; }
.wf-n-pic.passthru .icon { width: 36px; height: 36px; }
.wf-guides { position: absolute; left: 0; top: 0; pointer-events: none; }
.wf-guides i { position: absolute; left: 0; top: 0; background: var(--accent); }
.wf-guides i.v { width: 1.5px; }
.wf-guides i.h { height: 1.5px; }
.wf-verdicts { display: inline-flex; flex-direction: column; gap: 2px; font-size: 12px; }
.wf-verdict { display: inline-flex; align-items: center; gap: 4px; color: var(--ink-2); }
.wf-verdict b { display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; font-size: 11px; background: var(--surface-3); color: var(--ink-2); }
.wf-verdict.win b { background: var(--good-soft); color: var(--good); }
.wf-verdict.lose b { background: var(--bad-soft); color: var(--bad); }
.wf-verdict.win, .wf-verdict.lose { color: var(--ink); font-weight: 600; }
.wf-legend { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; font-size: 12px; color: var(--ink-2); }
.wf-legend span { display: inline-flex; align-items: center; gap: 2px; }

/* Full screen: only the canvas, edge to edge; the tools float over its top-left corner, the zoom
   controls over the top-right. */
.wf-card:fullscreen { display: flex; flex-direction: column; position: relative; margin: 0; padding: 0; border: 0; border-radius: 0; background: var(--surface-2); }
.wf-card:fullscreen .wf { flex: 1; height: auto; margin: 0; border: 0; border-radius: 0; }
.wf-card:fullscreen .wf-title { display: none; }
.wf-card:fullscreen .wf-top { position: absolute; top: 10px; left: 10px; z-index: 2; margin: 0; max-width: max(300px, calc(100% - 540px)); }
.wf-card:fullscreen .wf-tools { justify-content: flex-start; padding: 4px 10px 4px 4px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-xs); }
.wf-card::backdrop { background: var(--bg); }
@media (max-width: 640px) {
  .wf { height: 70vh; }
  .wf-ctl [data-wf="reset"] { display: none; }
}

/* ─── Guests: summary, inspector, bottom row ───────────── */
.gx-sum { display: grid; grid-template-columns: minmax(240px, 0.8fr) minmax(0, 2fr); padding: 0; margin-bottom: 16px; }
.gx-sum-hero { padding: 18px 20px; border-right: 1px solid var(--border); display: grid; align-content: start; gap: 4px; }
.gx-sum-k { font-size: 12px; color: var(--ink-3); font-weight: 500; }
.gx-sum-v { font-size: 40px; font-weight: 600; letter-spacing: -.03em; line-height: 1.05; }
.gx-sum-sub { font-size: 12.5px; color: var(--ink-2); }
.gx-sum-sub b { color: var(--ink); font-weight: 600; }
.gx-sum-losses { padding: 18px 20px; min-width: 0; }
.gx-sum-losses ol { list-style: none; margin: 8px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.gx-sum-losses button { width: 100%; height: 100%; display: grid; gap: 3px; padding: 12px 14px; text-align: left; font: inherit; color: inherit; cursor: pointer; background: var(--warn-soft); border: 1px solid color-mix(in srgb, var(--warn) 30%, var(--border)); border-radius: var(--radius-md); }
.gx-sum-losses button:hover { border-color: var(--warn); }
.gx-sum-losses button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.gx-loss-name { font-size: 13px; font-weight: 600; color: var(--warn); }
.gx-loss-n { font-size: 13px; color: var(--ink-2); }
.gx-loss-n b { font-size: 22px; font-weight: 600; color: var(--ink); letter-spacing: -.02em; margin-right: 4px; }
.gx-loss-sub { font-size: 11.5px; color: var(--ink-3); }

.gx-traits { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.gx-trait { display: grid; gap: 5px; }
.gx-trait-name { font-size: 13px; font-weight: 600; }
.gx-trait-name small { font-weight: 400; color: var(--ink-3); margin-left: 4px; }
.gx-trait .gx-vs-fill.me { background: var(--warn); }

.gx-bottom { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.gx-bottom .chart { height: 280px; }

@media (max-width: 1200px) {
  .gx-bottom { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 800px) {
  .gx-sum { grid-template-columns: minmax(0, 1fr); }
  .gx-sum-hero { border-right: 0; border-bottom: 1px solid var(--border); }
  .gx-sum-losses ol { grid-template-columns: minmax(0, 1fr); }
}


/* ─── Home: metric tabs over one large chart ───────────── */
.hm-hero { padding: 0; overflow: hidden; }
.hm-tabs { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border-bottom: 1px solid var(--border); }
.hm-tab { position: relative; display: grid; gap: 4px; align-content: start; padding: 16px 18px 12px; border: 0; background: transparent; text-align: left; font: inherit; color: inherit; cursor: pointer; min-width: 0; }
.hm-tab + .hm-tab { border-left: 1px solid var(--border); }
.hm-tab:hover { background: var(--surface-2); }
.hm-tab:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.hm-tab::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: transparent; }
.hm-tab.active::after { background: var(--accent); }
.hm-tab-label { font-size: 12.5px; color: var(--ink-3); font-weight: 500; }
.hm-tab.active .hm-tab-label { color: var(--ink); }
.hm-tab-value { font-size: 28px; font-weight: 600; letter-spacing: -.02em; line-height: 1.1; }
.hm-tab-delta { min-height: 20px; font-size: 12px; }
.hm-spark { width: 100%; height: 28px; margin-top: 4px; overflow: visible; }
.hm-spark polyline { fill: none; stroke: var(--ink-3); stroke-width: 1.5; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.hm-tab.active .hm-spark polyline { stroke: var(--accent); }
.growth-cell { min-width: 120px; }
.reels-table th.grp { text-align: center; border-bottom: 1px solid var(--border); }
.growth-spark { width: 120px; margin-top: 0; }
.growth-spark polyline { stroke: var(--accent); }
.hm-body { padding: 16px 20px 14px; }
.hm-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px 16px; margin-bottom: 8px; }
.hm-sum { font-size: 13px; color: var(--ink-2); min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hm-head .legend { flex-wrap: nowrap; white-space: nowrap; }
@media (max-width: 760px) { .hm-head { flex-wrap: wrap; } .hm-head .legend { flex-wrap: wrap; } }
.hm-sum b { color: var(--ink); }
.hm-head .legend { margin: 0; }
.chart.chart-hero { height: 380px; }
.chart .line.dash { stroke-width: 1.5; stroke-dasharray: 5 5; stroke-opacity: .55; }
.chart circle.end-dot.dash { display: none; }
.chart circle.hover-dot.dash { opacity: .6; }
.hm-tab-sub { font-size: 12px; color: var(--ink-3); line-height: 1.35; min-height: 2.7em; }
.hm-tab-sub b { color: var(--ink-2); font-weight: 600; }
.legend i.line-key.prev { background: repeating-linear-gradient(90deg, var(--ink-3) 0 4px, transparent 4px 7px); }
.tt-key.prev, .tt-dot.prev { background: var(--ink-3); }
@media (max-width: 1100px) {
  .hm-tabs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hm-tab:nth-child(4) { border-left: 0; }
  .hm-tab:nth-child(n + 4) { border-top: 1px solid var(--border); }
}
@media (max-width: 640px) {
  .hm-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hm-tab:nth-child(n) { border-left: 0; border-top: 0; }
  .hm-tab:nth-child(even) { border-left: 1px solid var(--border); }
  .hm-tab:nth-child(n + 3) { border-top: 1px solid var(--border); }
  .chart.chart-hero { height: 280px; }
}

/* ─── Account card (drawer) ─── */
.user-head .btn { margin-left: auto; align-self: center; }
.uc-who { min-width: 0; flex: 1; }
.uc-name { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.uc-provs { display: inline-flex; gap: 4px; }
.uc-prov { width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; background: var(--surface-2); color: var(--ink-2); }
.uc-prov svg { width: 15px; height: 15px; }
.uc-prov .icon { width: 14px; height: 14px; }
.uc-contacts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.uc-contact { display: inline-flex; align-items: center; gap: 6px; padding: 2px 2px 2px 10px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--bg); font-size: 13px; max-width: 100%; min-width: 0; }
.uc-contact > .mono, .uc-contact > a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.uc-contact-label { color: var(--ink-3); font-size: 12px; }
.uc-contact .chip { font-size: 11px; }
.uc-copy { width: 26px; height: 26px; flex: none; }
.uc-copy .icon { width: 14px; height: 14px; }
.uc-stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); overflow: hidden; box-shadow: var(--shadow); }
.uc-stat { padding: 12px 14px; min-width: 0; }
.uc-stat + .uc-stat { border-left: 1px solid var(--border); }
.uc-stat-label { color: var(--ink-3); font-size: 12px; }
.uc-stat-value { font-size: 22px; font-weight: 700; line-height: 1.25; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.uc-stat-sub { color: var(--ink-2); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.uc-alert { background: var(--warn-soft); color: var(--ink); border-radius: var(--radius-md); padding: 10px 14px; font-size: 13px; }
.uc-alert-title { color: var(--warn); font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 4px; }
.uc-alert ul { margin: 0; padding-left: 16px; display: grid; gap: 4px; }
.uc-why summary { cursor: pointer; color: var(--ink-2); font-size: 12px; display: inline; }
.uc-why[open] summary { margin-bottom: 4px; }
.uc-why p { margin: 4px 0 0; font-size: 12px; }
.drawer-body > .uc-tabs { margin-top: 18px; display: flex; width: fit-content; max-width: 100%; overflow-x: auto; }
.uc-tabs button { white-space: nowrap; }
.uc-panel > * + * { margin-top: 14px; }
.uc-exam-chart { height: 220px; margin-top: 8px; }
.uc-tl { list-style: none; margin: 14px 0 0; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); }
.uc-tl li { position: relative; padding: 22px 8px 0 0; min-width: 0; }
.uc-tl li::before { content: ""; position: absolute; top: 6px; left: 0; right: 0; height: 2px; background: var(--border); }
.uc-tl li.done::before { background: var(--accent); }
.uc-tl li:last-child::before { right: auto; width: 12px; }
.uc-tl-dot { position: absolute; top: 1px; left: 0; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 2px solid var(--border); }
.uc-tl li.done .uc-tl-dot { background: var(--accent); border-color: var(--accent); }
.uc-tl-gap { position: absolute; top: -12px; left: 0; font-size: 11px; color: var(--ink-3); white-space: nowrap; }
.uc-tl-label { font-size: 12px; color: var(--ink-3); }
.uc-tl-date { font-weight: 650; }
.uc-tl-sub { font-size: 12px; color: var(--ink-2); overflow-wrap: anywhere; }
@media (max-width: 620px) {
  .uc-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .uc-stat + .uc-stat { border-left: 0; }
  .uc-stat { border-top: 1px solid var(--border); }
  .uc-tl { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 18px; }
}

/* Ready-made account labels */
.tag.good { background: var(--good-soft); color: var(--good); }
.tag.bad { background: var(--bad-soft); color: var(--bad); }
.tag-presets { display: grid; gap: 8px; margin-top: 12px; }
.tp-group { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.tp-label { width: 64px; flex: none; color: var(--ink-3); font-size: 12px; }
.tp { border: 1px dashed var(--border); background: transparent; color: var(--ink-2); border-radius: 999px; padding: 3px 10px; font-size: 12.5px; font-weight: 550; cursor: pointer; }
.tp.good:hover { border-color: var(--good); color: var(--good); }
.tp.bad:hover { border-color: var(--bad); color: var(--bad); }
.tp.on { border-style: solid; }
.tp.good.on { background: var(--good-soft); border-color: var(--good); color: var(--good); }
.tp.bad.on { background: var(--bad-soft); border-color: var(--bad); color: var(--bad); }
.tags-own { margin-top: 8px; align-items: center; gap: 6px; }

/* Account card: «Связи» */
.conn-ids { list-style: none; margin: 10px 0 0; padding: 0; display: grid; }
.conn-ids li { display: grid; grid-template-columns: 120px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 3px 0; border-top: 1px solid var(--border); }
.conn-ids li:first-child { border-top: 0; }
.conn-label { color: var(--ink-3); font-size: 12px; }
.conn-value { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conn-sub { margin-top: 14px; color: var(--ink-2); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.conn-accounts { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 10px; }
.conn-accounts > li { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-md); }
.conn-who { display: flex; align-items: center; gap: 10px; min-width: 0; color: inherit; text-decoration: none; }
.conn-who:hover b { text-decoration: underline; }
.conn-who .avatar { width: 30px; height: 30px; border-radius: 8px; font-size: 12px; }
.conn-why { grid-column: 1 / -1; margin: 0 0 0 40px; padding-left: 16px; font-size: 12.5px; color: var(--ink-2); display: grid; gap: 2px; }
@media (max-width: 620px) { .conn-ids li { grid-template-columns: 90px minmax(0, 1fr) auto; } }

/* Toggle legends: each item switches its line on and off */
.hm-legend, .legend:has(> .legend-toggle) { gap: 4px; }
.legend-toggle { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; color: var(--ink-2); font: inherit; padding: 3px 7px; border-radius: var(--radius-md); cursor: pointer; }
.legend-toggle:hover { background: var(--surface-2); color: var(--ink); }
.legend-toggle.off { color: var(--ink-3); text-decoration: line-through; }
.legend-toggle.off i { opacity: .3; }
.legend-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.hm-tabs.n4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1100px) {
  .hm-tabs.n4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hm-tabs.n4 .hm-tab:nth-child(n) { border-left: 0; border-top: 0; }
  .hm-tabs.n4 .hm-tab:nth-child(even) { border-left: 1px solid var(--border); }
  .hm-tabs.n4 .hm-tab:nth-child(n + 3) { border-top: 1px solid var(--border); }
}

/* ─── Отзывы и жалобы ─── */
.fb-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 16px; }
.fb-stats .bad-mark { color: var(--bad); }
.fb-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.fb-main { display: grid; gap: 12px; min-width: 0; }
.fb-rail { display: grid; gap: 16px; align-content: start; position: sticky; top: 72px; }
.fb-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.fb-filter { max-width: 100%; overflow-x: auto; }
.fb-filter button { white-space: nowrap; }
.fb-search { flex: 1; min-width: 180px; height: 34px; border: 1px solid var(--border); background: var(--surface); color: var(--ink); border-radius: var(--radius-md); padding: 0 10px; font: inherit; }
.fb-q { display: grid; gap: 10px; }
.fb-q.suspect { border-left: 3px solid var(--bad); }
.fb-q-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.fb-q-id { font-size: 12px; font-weight: 650; color: var(--ink-2); text-transform: uppercase; letter-spacing: .04em; }
.fb-open { margin-left: auto; font-size: 12.5px; }
.fb-q-text { margin: 0; font-size: 15px; font-weight: 600; line-height: 1.45; }
.fb-opts { margin: 0; padding-left: 22px; display: grid; gap: 3px; font-size: 13.5px; color: var(--ink-2); }
.fb-opts li.right { color: var(--good); }
.fb-acc { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--ink-2); }
.fb-acc-bar { width: 90px; height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; flex: none; }
.fb-acc-bar i { display: block; height: 100%; background: var(--good); }
.fb-acc-bar i.low { background: var(--bad); }
.fb-expl summary { cursor: pointer; font-size: 12.5px; color: var(--ink-2); }
.fb-expl p { margin: 6px 0 0; font-size: 13px; color: var(--ink-2); line-height: 1.5; }
.fb-reasons { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding-top: 10px; border-top: 1px solid var(--border); }
.fb-reasons .faint { margin-left: auto; font-size: 12px; }
.fb-reps { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.fb-rep-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; font-size: 13px; }
.fb-rep-head > .faint { margin-left: auto; font-size: 12px; }
.fb-who { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; color: inherit; }
.fb-who .avatar { width: 24px; height: 24px; border-radius: 7px; font-size: 10px; }
.fb-guest { background: var(--surface-2); color: var(--ink-3); }
.fb-note { margin: 6px 0 0 31px; padding: 6px 10px; border-left: 2px solid var(--border); background: var(--surface-2); border-radius: 0 var(--radius-md) var(--radius-md) 0; font-size: 13.5px; line-height: 1.45; overflow-wrap: anywhere; }
.fb-more { justify-self: center; }
.fb-stars { color: #e3a008; letter-spacing: 1px; }
.fb-stars span { color: var(--border); }
.fb-reviews { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 12px; }
.fb-reviews li + li { border-top: 1px solid var(--border); padding-top: 12px; }
.fb-reviews p { margin: 6px 0; font-size: 13.5px; line-height: 1.45; overflow-wrap: anywhere; }
.fb-rev-head { display: flex; justify-content: space-between; align-items: center; font-size: 12px; }
.fb-rev-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12.5px; }
.fb-rev { cursor: pointer; display: grid; gap: 6px; }
.fb-rev:hover .fb-rev-head { color: var(--ink); }
.fb-reviews .fb-rev p { margin: 0; }
.fb-reviews.grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.fb-reviews.grid li + li { border-top: 0; padding-top: 0; }
.fb-reviews.grid .fb-rev { border: 1px solid var(--border); border-radius: var(--radius-md); padding: 10px; align-content: start; }
.fb-reviews.grid .fb-rev:hover { border-color: var(--ink-3); }
.fb-decide { display: flex; width: 100%; }
.fb-decide button { flex: 1 1 auto; font-size: 11.5px; padding: 3px 6px; white-space: nowrap; }
.fb-decide button.active.publish { background: var(--good); color: #fff; }
.fb-decide button.active.hide { background: var(--ink-3); color: #fff; }
.fb-revs { margin-top: 14px; }
@media (max-width: 1100px) {
  .fb-grid { grid-template-columns: minmax(0, 1fr); }
  .fb-rail { position: static; }
}
@media (max-width: 620px) { .fb-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Feedback kanban */
.fb-tools { margin-bottom: 14px; }
.kb-board { display: grid; grid-template-columns: repeat(5, minmax(230px, 1fr)); gap: 12px; align-items: start; overflow-x: auto; padding-bottom: 8px; }
.kb-col { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px; min-height: 160px; display: grid; gap: 10px; align-content: start; transition: background .12s, border-color .12s; }
.kb-col.over { border-color: var(--accent); background: var(--accent-soft); }
.kb-col-head { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 2px 8px; padding: 2px 4px; }
.kb-col-head b { font-size: 13px; }
.kb-hint { grid-column: 1 / -1; font-size: 11.5px; color: var(--ink-3); }
.kb-count { font-size: 12px; color: var(--ink-2); background: var(--surface); border-radius: 999px; padding: 0 8px; }
.kb-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); }
.kb-dot.checking { background: var(--accent); }
.kb-dot.real { background: var(--bad); }
.kb-dot.fake { background: var(--border); }
.kb-dot.done { background: var(--good); }
.kb-dot.publish { background: var(--good); }
.kb-dot.hide { background: var(--ink-3); }
/* Each column scrolls on its own, so the board stays one screen tall and the reviews below are in reach. */
.kb-list { display: grid; gap: 8px; align-content: start; max-height: min(62vh, 600px); overflow-y: auto; overscroll-behavior: contain; margin-right: -6px; padding-right: 6px; scrollbar-width: thin; }
.kb-empty { border: 1px dashed var(--border); border-radius: var(--radius-md); padding: 16px 8px; text-align: center; font-size: 12px; color: var(--ink-3); }
.kb-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 10px; display: grid; gap: 7px; cursor: pointer; box-shadow: var(--shadow-xs, none); min-width: 0; }
.kb-card:hover { border-color: var(--ink-3); }
.kb-card.dragging { opacity: .45; }
.kb-top { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.kb-age { margin-left: auto; font-size: 11.5px; }
.kb-ref { font-size: 11px; font-weight: 650; color: var(--ink-2); text-transform: uppercase; letter-spacing: .03em; }
.kb-ref .faint { text-transform: none; letter-spacing: 0; font-weight: 500; }
.kb-text { margin: 0; font-size: 13px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.kb-note { margin: 0; font-size: 12.5px; }
.kb-foot { font-size: 12.5px; }
.kb-tnote { font-size: 12px; color: var(--ink-2); background: var(--warn-soft); border-radius: var(--radius-md); padding: 5px 8px; overflow-wrap: anywhere; }
.kb-moves { display: flex; flex-wrap: wrap; width: 100%; }
.kb-moves button { flex: 1 1 auto; font-size: 11.5px; padding: 3px 6px; white-space: nowrap; }
.kb-tnote-input { width: 100%; min-height: 56px; resize: vertical; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--bg); color: var(--ink); font: inherit; font-size: 12.5px; padding: 6px 8px; }

.kb-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.kb-card:active { cursor: grabbing; }
/* Feedback item in the drawer */
.fbd-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 6px; }
.fbd-triage { display: grid; gap: 10px; }
.fbd-triage .card-title { display: flex; align-items: center; gap: 8px; margin: 0; }
.fbd-quote { margin: 8px 0 0; font-size: 14.5px; }
.fbd-qhead { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.fbd-qhead .card-title { margin: 0; }
.fbd-who { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; }
.fbd-who .fb-who { font-size: 15px; }
.fbd-who .avatar.lg { width: 40px; height: 40px; font-size: 15px; }

/* Accounts page: status strip, column picker, progress bar, exam trend. */
.head-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.status-strip { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.status-pill { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 10px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer; text-align: left; color: var(--ink); font: inherit; }
.status-pill:hover { background: var(--surface-2); }
.status-pill.active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.status-pill:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.status-n { font-size: 22px; font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums; }
.status-share { color: var(--ink-3); font-size: 12px; }
@media (max-width: 760px) { .status-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.col-picker { position: relative; }
.col-picker > summary { list-style: none; }
.col-picker > summary::-webkit-details-marker { display: none; }
.col-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; display: grid; gap: 8px; min-width: 210px; padding: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.progress-cell { min-width: 170px; }
.mini-track { height: 4px; margin: 4px 0 2px; background: var(--surface-3); border-radius: 2px; overflow: hidden; }
.mini-fill { height: 100%; background: var(--accent); }
.trend-up { color: var(--good); font-weight: 600; }
.trend-down { color: var(--bad); font-weight: 600; }

/* Overview: what changed yesterday */
#ov-changes:not(:empty) { margin-bottom: 16px; }
.changes { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 6px; font-size: 13.5px; }
.changes li { display: flex; gap: 8px; align-items: baseline; }
.changes a { color: var(--ink); text-decoration: none; }
.changes a:hover { text-decoration: underline; }
.change-mark { flex: none; width: 1em; font-size: 11px; }
.changes li.good .change-mark { color: var(--good); }
.changes li.bad .change-mark { color: var(--bad); }

/* Ads: the test's verdict, from money to people who came back */
.verdict-steps { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin: 4px 0 12px; }
.verdict-step { background: var(--surface); padding: 10px 12px; min-width: 0; }
.verdict-label { font-size: 12px; color: var(--ink-2); }
.verdict-value { font-size: 20px; font-weight: 600; margin: 2px 0; font-variant-numeric: tabular-nums; }
.verdict-value .faint { font-size: 13px; font-weight: 400; }
.verdict-sub { font-size: 12px; color: var(--ink-2); line-height: 1.35; }
.verdict-lines li { margin: 5px 0; font-size: 13.5px; }
@media (max-width: 1100px) { .verdict-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 560px) { .verdict-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Events on charts: deploys, posts, ads (lib/events.mjs) */
.ev-deploy { --ev: var(--ink-2); }
.ev-social { --ev: var(--cat-5); }
.ev-ads { --ev: var(--cat-4); }
.chart .ev-line { stroke: var(--ink-3); stroke-width: 1; stroke-dasharray: 2 3; opacity: .3; }
.chart .ev-dot { fill: var(--ev); stroke: var(--surface); stroke-width: 1; }
.legend i.ev-key, .changes i.ev-key { width: 8px; height: 8px; border-radius: 50%; background: var(--ev); flex: none; display: inline-block; }
.tooltip .tt-dot.ev-deploy, .tooltip .tt-dot.ev-social, .tooltip .tt-dot.ev-ads { background: var(--ev); border-radius: 50%; width: 8px; height: 8px; margin-top: 4px; }
.tt-events { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border); display: grid; gap: 4px; max-width: 320px; }
.tt-ev { display: flex; gap: 6px; align-items: flex-start; color: var(--ink-2); white-space: normal; line-height: 1.35; }
.changes-events { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border); }
.changes-events-title { font-size: 12px; color: var(--ink-2); margin-bottom: 6px; }
.changes-events .changes li { align-items: center; color: var(--ink-2); }

/* Retention: the app on the home screen */
.app-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); box-shadow: none; }
.app-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 20px; margin-top: 14px; }
.app-h { margin: 0 0 8px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.app-cmp { margin-bottom: 12px; }
.app-cmp-title { font-size: 12.5px; color: var(--ink-2); margin-bottom: 4px; }
.app-cmp-row { display: grid; grid-template-columns: 110px minmax(60px, 1fr) 44px auto; align-items: center; gap: 8px; font-size: 13px; padding: 2px 0; }
.app-cmp-row .bar-fill.muted { background: var(--ink-3); }
.app-cmp-row b { text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 900px) { .app-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 620px) { .app-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } .app-stats .uc-stat:nth-child(3) { border-left: 0; } }


/* Retention: tabs over a plain answer and the charts that explain it */
.ret-hero .hm-tab { padding-bottom: 14px; }
.ret-lead { margin: 0; font-size: 15px; line-height: 1.55; color: var(--ink-2); max-width: 980px; }
.ret-lead b { color: var(--ink); }
.ret-top { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); }
@media (max-width: 900px) { .ret-top { grid-template-columns: minmax(0, 1fr); } }

/* Dot matrix: 100 dots, one per «out of 100» */
.dm-grid { display: grid; grid-template-columns: repeat(20, minmax(0, 1fr)); gap: 5px; max-width: 420px; margin: 14px 0 14px; }
.dm-grid i { display: block; aspect-ratio: 1; border-radius: 50%; }
.dm-grid .d0, .dm-legend .d0 { background: var(--surface-3); box-shadow: inset 0 0 0 1px var(--border); }
.dm-grid .d1, .dm-legend .d1 { background: color-mix(in srgb, var(--accent) 45%, transparent); }
.dm-grid .d2, .dm-legend .d2 { background: var(--accent); }
.dm-grid .d3, .dm-legend .d3 { background: var(--good); }
.dm-legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 13px; }
.dm-legend li { display: grid; grid-template-columns: 10px minmax(0, 1fr) 28px 52px; gap: 10px; align-items: center; }
.dm-legend li > i { width: 10px; height: 10px; border-radius: 50%; }
.dm-legend b { text-align: right; font-variant-numeric: tabular-nums; }
.dm-legend .faint { text-align: right; font-size: 12px; }

/* Bullet bars: a rate against the average tick */
.bl-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 9px; }
.bl-row { display: grid; grid-template-columns: minmax(120px, 1.1fr) minmax(80px, 1.4fr) 40px 62px; gap: 10px; align-items: center; font-size: 13px; }
.bl-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bl-label .faint { font-size: 11.5px; }
.bl-track { position: relative; height: 10px; background: var(--surface-2); border-radius: 3px; }
.bl-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 3px; background: var(--accent); }
.bl-fill.down { background: var(--ink-3); }
.bl-avg { position: absolute; left: 0; top: -4px; bottom: -4px; border-right: 2px solid var(--ink); pointer-events: none; }
.bl-row > b { text-align: right; font-variant-numeric: tabular-nums; }
.bl-diff { font-size: 12px; text-align: right; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.bl-diff.good { color: var(--good); }
.bl-diff.bad { color: var(--bad); }
.faint-row { opacity: .6; }
.bl-few { margin-top: 10px; font-size: 12.5px; color: var(--ink-3); }
.bl-few summary { cursor: pointer; }
.bl-key { display: flex; align-items: center; gap: 6px; margin-top: 12px; font-size: 12px; color: var(--ink-3); }
.bl-avg-key { width: 2px; height: 12px; background: var(--ink); }
@media (max-width: 560px) { .bl-row { grid-template-columns: minmax(0, 1fr) 40px 56px; } .bl-track { grid-column: 1 / -1; grid-row: 2; } }

/* Tests by mode: finished / dropped */
.ret-modes { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 14px; }
.ret-mode-head { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; }
.ret-mode-head .faint { font-size: 12px; }
.ret-modes .home-seg { margin: 6px 0 6px; }
.ret-mode-nums { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12.5px; color: var(--ink-2); }
.ret-mode-nums i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 5px; }
.ret-mode-nums i.pass { background: var(--cat-1); } .ret-mode-nums i.fail { background: var(--ink-3); } .ret-mode-nums i.idle { background: var(--border); }

/* Who to write to */
.ret-people { list-style: none; margin: 8px 0 0; padding: 0; max-height: 520px; overflow-y: auto; }
.ret-person { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 9px 4px; border-top: 1px solid var(--border); cursor: pointer; }
.ret-person:hover { background: var(--surface-2); }
.ret-person-main { min-width: 0; }
.ret-person-main .cell-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ret-person-side { display: grid; justify-items: end; font-size: 13px; white-space: nowrap; }
.ret-person-side .faint { font-size: 12px; }

.ret-more > summary { list-style: none; cursor: pointer; }
.ret-more > summary::-webkit-details-marker { display: none; }
.ret-more > summary .card-title::after { content: " ▸"; color: var(--ink-3); }
.ret-more[open] > summary .card-title::after { content: " ▾"; }

/* «Сервер» page */
.server-bad { color: var(--bad); font-weight: 600; }
.server-sample { white-space: pre-wrap; word-break: break-word; max-height: 260px; overflow: auto; margin: 8px 0 0; padding: 8px 10px; font-size: 12px; background: var(--bad-soft); border-radius: 8px; }
.study-bar { height: 8px; min-width: 2px; border-radius: 4px; background: var(--accent, var(--good)); }

/* ─── Сообщения ─────────────────────────────────────────────────────────── */
.msg-head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
/* A message's header: back, title, actions; stays on top while the form scrolls (above the phone bar's width). */
.msg-header {
  display: flex; align-items: center; gap: 12px; margin: -20px -24px 16px; padding: 14px 24px;
  background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--border);
}
@media (min-width: 1001px) { .msg-header { position: sticky; top: 0; z-index: 15; } }
@media (max-width: 1000px) { .msg-header { margin: 0 0 16px; padding: 0 0 12px; background: none; backdrop-filter: none; } }
.msg-header-back { flex: none; color: var(--ink); }
.msg-header-text { flex: 1; min-width: 0; }
.msg-header-text .view-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-header-text .view-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-header-actions { flex: none; display: flex; gap: 8px; }
@media (max-width: 600px) { .msg-header { flex-wrap: wrap; } .msg-header-actions { width: 100%; } .msg-header-actions .btn { flex: 1; justify-content: center; } }
.banner.msg-info { background: var(--accent-soft); color: var(--accent); }
.msg-table td { vertical-align: middle; }
.msg-title-cell { max-width: 360px; overflow-wrap: anywhere; }
.msg-empty { padding: 20px; }
.msg-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 380px); gap: 16px; align-items: start; }
.msg-main { display: grid; gap: 16px; min-width: 0; }
.msg-side { position: sticky; top: 92px; min-width: 0; }
@media (max-width: 960px) { .msg-grid { grid-template-columns: minmax(0, 1fr); } .msg-side { position: static; } }
.msg-tabs button { white-space: nowrap; }
.msg-req { color: var(--bad); }
.msg-has { color: var(--good); font-size: 9px; vertical-align: 2px; }
.msg-fields { display: grid; gap: 12px; }
.msg-fields label { display: grid; gap: 4px; font-size: 12px; color: var(--ink-3); }
.msg-fields input, .msg-fields textarea, .msg-q-prompt, .msg-opt input, .msg-q-head select {
  border: 1px solid var(--border); background: var(--surface); color: var(--ink); border-radius: 9px; padding: 7px 10px; font: inherit; font-size: 14px; min-width: 0;
}
.msg-fields textarea { resize: vertical; line-height: 1.5; min-height: 120px; }
.msg-fields input:focus, .msg-fields textarea:focus, .msg-q-prompt:focus, .msg-opt input:focus, .msg-q-head select:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.msg-hint { font-size: 12px; color: var(--ink-3); line-height: 1.5; }
.msg-hint code, .card-sub code { font-family: var(--mono); font-size: 11.5px; background: var(--surface-2); border-radius: 4px; padding: 0 4px; }
.msg-check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-2); cursor: pointer; }
.msg-qs { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 12px; }
.msg-q { border: 1px solid var(--border); border-radius: 10px; padding: 12px; display: grid; gap: 8px; }
.msg-q-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.msg-q-head select { padding: 5px 8px; font-size: 13px; }
.msg-q-move { margin-left: auto; display: inline-flex; gap: 4px; }
.msg-q-prompt { width: 100%; }
.msg-opts { display: grid; gap: 6px; padding-left: 4px; }
.msg-opt { display: flex; align-items: center; gap: 8px; }
.msg-opt input { flex: 1; padding: 5px 9px; font-size: 13.5px; }
.msg-opts > .btn { justify-self: start; }
textarea.msg-q-prompt { resize: vertical; line-height: 1.45; }
.msg-cond { border-top: 1px dashed var(--border); padding-top: 8px; display: grid; gap: 8px; }
.msg-cond-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; }
.msg-cond-head .btn { margin-left: auto; }
.msg-cond-q { display: grid; gap: 4px; font-size: 13px; }
.msg-cond-opts { display: flex; flex-wrap: wrap; gap: 4px 14px; padding-left: 8px; }
.msg-cond-sum { font-size: 13px; color: var(--ink-2); margin: 0; }
.msg-pv-qs b { white-space: pre-line; }
.msg-r-q { white-space: pre-line; }
.msg-errors ul { margin: 0; padding-left: 18px; display: grid; gap: 4px; font-size: 13px; }
.msg-errors li.bad { color: var(--bad); }
.msg-errors li.warn { color: var(--warn); }
.msg-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.msg-count { font-size: 14px; min-height: 22px; }
.msg-count.msg-count-need { color: var(--bad); }
.msg-aud-btn { max-width: 280px; }
.msg-aud-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dialog.msg-dialog.msg-dialog-huge { width: min(1500px, calc(100vw - 48px)); height: calc(100vh - 48px); grid-template-rows: auto minmax(0, 1fr) auto; padding: 22px 24px; }
.msg-dialog-huge .dialog-title { font-size: 18px; font-weight: 650; }
.msg-dialog-huge .msg-dialog-body { min-height: 0; }
.msg-aud { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 24px; min-height: 0; height: 100%; }
.msg-aud-side { overflow-y: auto; min-height: 0; padding-right: 6px; }
.msg-aud-main { display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto; gap: 12px; min-height: 0; }
.msg-aud-head { display: grid; gap: 8px; }
.msg-aud-big { font-size: 15px; color: var(--ink-2); }
.msg-aud-big b { font-size: 28px; font-weight: 750; color: var(--ink); margin-right: 4px; letter-spacing: -.01em; }
.msg-aud-big.msg-count-need { color: var(--bad); }
.msg-aud-note2 { display: block; font-size: 12.5px; color: var(--ink-3); }
.msg-aud-chosen { display: flex; flex-wrap: wrap; gap: 6px; font-size: 13px; }
.msg-aud-chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 4px 3px 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); font-size: 12.5px; }
.msg-aud-chip.blue { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.msg-aud-chip.red { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.msg-aud-chip button { width: 20px; height: 20px; border: 0; border-radius: 50%; background: transparent; color: inherit; cursor: pointer; font-size: 14px; line-height: 1; }
.msg-aud-chip button:hover { background: var(--surface-3); }
.msg-aud-h { margin: 0 0 2px; font-size: 14px; font-weight: 700; }
.msg-aud-groups { display: grid; gap: 6px; }
.msg-aud-group { border: 1px solid var(--border); border-radius: 10px; padding: 9px 12px; font-size: 14px; }
.msg-aud-group:hover { background: var(--surface-2); }
.msg-aud-group > label { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.msg-aud-group.on { border-color: var(--primary); background: var(--surface-2); }
.msg-aud-extra { display: grid; gap: 4px; margin-top: 8px; font-size: 12px; color: var(--ink-3); }
.msg-aud-extra.two { grid-template-columns: 1fr 1fr; gap: 8px; }
.msg-aud-extra label { display: grid; gap: 4px; }
.msg-aud-extra input, .msg-aud-tools input { border: 1px solid var(--border); background: var(--surface); color: var(--ink); border-radius: 8px; padding: 6px 9px; font: inherit; font-size: 13px; min-width: 0; }
.msg-aud-note { margin-top: 12px; }
.msg-aud-section + .msg-aud-section { margin-top: 12px; }
.msg-aud-section { display: grid; gap: 6px; }
.msg-aud-section-h { font-size: 11.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); }
.msg-aud-extra.row, .msg-aud-extra .row { display: flex; align-items: center; gap: 6px; }
.msg-aud-extra input[type=number] { width: 72px; }
.msg-aud-extra select { border: 1px solid var(--border); background: var(--surface); color: var(--ink); border-radius: 8px; padding: 5px 8px; font: inherit; font-size: 13px; min-width: 0; width: 100%; }
.msg-aud-modes button { min-width: 34px; padding: 3px 8px; font-size: 12.5px; }
.msg-aud-hint { margin: 6px 0 0; font-size: 11.5px; color: var(--ink-3); line-height: 1.4; }
.msg-aud-tools input { height: 38px; font-size: 14px; padding: 0 12px; }
.msg-aud-tools { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 8px; }
.msg-aud-add { position: relative; display: grid; }
.msg-aud-found { position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 5; display: grid; gap: 4px; padding: 6px; max-height: 260px; overflow-y: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-lg); }
.msg-person:disabled { opacity: .55; cursor: default; }
.msg-aud-table { overflow-y: auto; min-height: 0; border: 1px solid var(--border); border-radius: 10px; }
.msg-aud-table .empty { padding: 16px; }
.msg-aud-rows { table-layout: fixed; }
.msg-aud-rows th { position: sticky; top: 0; z-index: 2; background: var(--surface); box-shadow: inset 0 -1px 0 var(--border); }
.msg-aud-rows th:first-child { width: 45%; }
.msg-aud-rows th:last-child { width: 110px; }
.msg-aud-why .chip { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg-aud-rows td { vertical-align: middle; padding: 8px 14px; height: 56px; }
.msg-aud-rows tbody tr:hover td { background: var(--surface-2); }
.msg-aud-who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.msg-aud-who > div { min-width: 0; }
.msg-aud-name { font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-aud-mail { font-size: 12px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-aud-why { display: flex; gap: 4px; flex-wrap: wrap; }
.msg-aud-why .chip { max-width: 100%; }
.msg-aud-out-btn { opacity: .75; }
.msg-aud-rows tbody tr:hover .msg-aud-out-btn { opacity: 1; }
.msg-aud-more { margin: 8px 12px; }
.msg-aud-out summary { cursor: pointer; font-size: 13px; color: var(--ink-2); }
.msg-aud-out ul { list-style: none; padding: 0; margin: 6px 0 0; display: grid; gap: 4px; max-height: 140px; overflow-y: auto; }
.msg-aud-out li { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.msg-aud-out li .btn { margin-left: auto; }
@media (max-width: 960px) {
  .dialog.msg-dialog.msg-dialog-huge { width: calc(100vw - 24px); height: calc(100vh - 24px); padding: 18px 16px; }
  .msg-aud { grid-template-columns: minmax(0, 1fr); overflow-y: auto; }
  .msg-aud-main { grid-template-rows: auto auto auto auto; }
  .msg-aud-table { max-height: 50vh; }
  .msg-aud-tools { grid-template-columns: minmax(0, 1fr); }
}
.msg-people { grid-column: 1 / -1; display: grid; gap: 4px; }
.msg-person { display: flex; align-items: center; gap: 8px; text-align: left; border: 1px solid var(--border); background: var(--surface); color: var(--ink); border-radius: 9px; padding: 6px 10px; font: inherit; font-size: 13px; cursor: pointer; }
.msg-person:hover { background: var(--surface-2); }

/* The portal's look, roughly: kind, title, picture, text, button. */
.msg-pv { border: 1px solid var(--border); border-radius: 12px; padding: 16px; display: grid; gap: 10px; font-size: 14px; line-height: 1.55; overflow-wrap: anywhere; }
.msg-pv-kind { font-size: 12px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; }
.msg-pv-title { margin: 0; font-size: 18px; font-weight: 750; line-height: 1.3; }
.msg-pv-img { width: 100%; border-radius: 10px; display: block; }
.msg-pv-body p { margin: 0 0 8px; }
.msg-pv-body ul, .msg-pv-body ol { margin: 0 0 8px; padding-left: 20px; }
.msg-pv-body a { color: var(--link); }
.msg-dropped { text-decoration: underline wavy var(--bad); text-underline-offset: 3px; }
.msg-pv-btn { justify-self: start; background: var(--primary); color: var(--primary-ink); border-radius: 10px; padding: 8px 16px; font-weight: 600; font-size: 14px; }
.msg-pv-btn.off { opacity: .45; text-decoration: line-through; }
.msg-pv-note { margin: 0; font-size: 12px; color: var(--warn); }
.msg-pv-qs { margin: 0; padding-left: 20px; display: grid; gap: 10px; }
.msg-pv-qs ul { list-style: none; padding: 0; margin: 6px 0 0; display: grid; gap: 4px; }
.msg-pv-qs li li { display: flex; align-items: center; gap: 8px; }
.msg-pv-box { width: 14px; height: 14px; border: 1.5px solid var(--ink-3); border-radius: 50%; flex: none; display: inline-block; }
.msg-pv-box.sq { border-radius: 4px; }
.msg-pv-rating { margin-top: 6px; letter-spacing: .6em; color: var(--ink-3); }
.msg-pv-text { margin-top: 6px; height: 48px; border: 1px solid var(--border); border-radius: 8px; }
.msg-pv-anon { display: flex; align-items: center; gap: 8px; color: var(--ink-2); font-size: 13px; }

/* Results. */
.msg-funnel { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.msg-r + .msg-r { border-top: 1px solid var(--border); margin-top: 14px; padding-top: 14px; }
.msg-r-q { margin: 0; font-size: 14px; font-weight: 650; }
.msg-rating { display: flex; gap: 14px; align-items: flex-end; height: 120px; }
.msg-rating-col { display: grid; justify-items: center; gap: 2px; height: 100%; grid-template-rows: 1fr auto auto; font-size: 12px; }
.msg-rating-bar { width: 28px; height: 100%; display: flex; align-items: flex-end; background: var(--surface-2); border-radius: 6px; overflow: hidden; }
.msg-rating-bar i { display: block; width: 100%; background: var(--accent); }
.msg-texts { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.msg-texts li { border-left: 3px solid var(--border); padding: 2px 0 2px 10px; font-size: 13.5px; }
.msg-texts p { margin: 0 0 2px; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg-answers { margin: 0; padding-left: 20px; display: grid; gap: 10px; font-size: 13.5px; }
.msg-answers div { color: var(--ink-2); white-space: pre-wrap; overflow-wrap: anywhere; }

/* The reply dialog. */
.dialog.msg-dialog { width: min(640px, 100%); }
.msg-dialog-body { display: grid; gap: 12px; margin-top: -6px; }
.msg-reply-to { display: grid; gap: 8px; }
.msg-reply-reps li.off { opacity: .55; }
.msg-reply-status { display: grid; gap: 6px; }

/* Social page: the line under the Reels stats table */
.reels-foot { padding: 10px 16px 14px; }

/* Tasks page (#todo): four status columns, the add form and the open task */
.todo-board { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; align-items: start; }
@media (max-width: 1000px) { .todo-board { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .todo-board { grid-template-columns: minmax(0, 1fr); } }
.todo-col { background: var(--surface-2); border-radius: 12px; padding: 10px; min-width: 0; }
.todo-col-head { padding: 2px 4px 4px; }
.todo-card { display: block; width: 100%; text-align: left; margin-top: 8px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--ink); font: inherit; cursor: pointer; }
.todo-card:hover { border-color: var(--accent); }
.todo-card.open { outline: 2px solid var(--accent); outline-offset: -1px; }
.todo-card-title { display: block; font-size: 14px; line-height: 1.4; overflow-wrap: anywhere; }
.todo-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 6px; font-size: 12px; color: var(--ink-3); }
.todo-overdue { color: var(--bad); font-weight: 600; }
.todo-empty { padding: 10px 4px; font-size: 13px; }
.todo-form { display: grid; gap: 10px; }
.todo-form-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 760px) { .todo-form-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.todo-form label { display: grid; gap: 4px; font-size: 12px; color: var(--ink-3); min-width: 0; }
.todo-form input, .todo-form textarea, .todo-form select { border: 1px solid var(--border); background: var(--surface); color: var(--ink); border-radius: 9px; padding: 7px 10px; font: inherit; font-size: 14px; min-width: 0; }
.todo-form textarea { resize: vertical; line-height: 1.5; }
.todo-who { max-width: 220px; }
.todo-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.todo-body { white-space: pre-wrap; font-size: 14px; line-height: 1.55; overflow-wrap: anywhere; }
.todo-h3 { font-size: 14px; margin: 18px 0 6px; }
.todo-comment { border-top: 1px solid var(--border); padding: 8px 0; }
.mt-8 { margin-top: 8px; }

/* Ads page: the Google Ads card */
.gads-kpis { padding: 0 16px; }
.gads-foot { padding: 12px 16px 16px; font-size: 13px; line-height: 1.6; }

/* ─── Сообщения: the editor laid out like Google Forms ─── */
.mf-tabs { display: flex; justify-content: center; gap: 4px; margin: 2px 0 18px; border-bottom: 1px solid var(--border); }
.mf-tabs > button { position: relative; background: none; border: 0; border-bottom: 3px solid transparent; margin-bottom: -1px; padding: 10px 18px; font: inherit; font-size: 14px; font-weight: 600; color: var(--ink-3); cursor: pointer; }
.mf-tabs > button:hover { color: var(--ink); }
.mf-tabs > button.active { color: var(--accent); border-bottom-color: var(--accent); }
.mf-tabs > button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 6px; }
.mf-dot { position: absolute; top: 9px; right: 6px; width: 7px; height: 7px; border-radius: 50%; background: var(--bad); }
.mf-wrap { max-width: 770px; margin: 0 auto 48px; display: grid; gap: 12px; min-width: 0; }
.mf-sp { flex: 1; }
.mf-head { border-top: 10px solid var(--accent); padding: 18px 24px 20px; display: grid; gap: 12px; overflow: hidden; }
.mf-pic { position: relative; margin: -18px -24px 2px; background: var(--surface-2); }
.mf-pic img { display: block; width: 100%; height: auto; max-height: 340px; object-fit: contain; }
.mf-pic-tools { position: absolute; right: 10px; bottom: 10px; display: flex; gap: 6px; align-items: center; }
.mf-pic-tools .btn, .mf-pic-tools .chip { background: var(--surface); box-shadow: var(--shadow); }
.mf-pic-add { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: -18px -24px 0; padding: 12px 24px; border-bottom: 1px dashed var(--border); color: var(--ink-2); font-size: 13.5px; cursor: pointer; }
.mf-pic-add:hover { color: var(--accent); background: var(--accent-soft); }
.mf-pic-add .faint { font-size: 12px; }
.mf-head-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mf-title, .mf-body, .mf-input { width: 100%; min-width: 0; font: inherit; color: var(--ink); background: transparent; border: 0; border-bottom: 1px solid var(--border); padding: 6px 0 7px; }
.mf-title { font-size: 26px; font-weight: 650; line-height: 1.25; letter-spacing: -0.01em; }
.mf-body { font-size: 14.5px; line-height: 1.55; resize: vertical; min-height: 64px; }
.mf-input { font-size: 14px; }
.mf-title:focus, .mf-body:focus, .mf-input:focus { outline: none; border-bottom: 2px solid var(--accent); padding-bottom: 6px; }
.mf-hint summary { cursor: pointer; font-size: 12.5px; color: var(--ink-3); width: fit-content; }
.mf-hint summary:hover { color: var(--ink); }
.mf-hint .msg-hint { display: block; margin-top: 6px; }
.mf-card { padding: 18px 24px; display: grid; gap: 10px; }
.mf-card-title { font-size: 15px; font-weight: 650; margin: 0; }
.mf-errors { border-left: 4px solid var(--warn); border-radius: var(--radius); padding: 10px 14px; background: var(--surface); box-shadow: var(--shadow); }
.mf-errors p { margin: 4px 0 0; }
.mf-qs { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.mf-q { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 24px; display: grid; gap: 10px; min-width: 0; }
.mf-q:not(.active) { cursor: pointer; transition: border-color .12s; }
.mf-q:not(.active):hover { border-color: color-mix(in oklab, var(--accent) 45%, var(--border)); }
.mf-q:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.mf-q.active { border-left: 6px solid var(--accent); padding-left: 19px; box-shadow: 0 2px 10px rgb(0 0 0 / 0.08), var(--shadow); }
.mf-q.locked { border-left: 1px solid var(--border); padding-left: 24px; box-shadow: var(--shadow); }
.mf-q.has-err { border-color: var(--bad); }
.mf-q.active.has-err { border-left-color: var(--bad); }
.mf-q-sum { display: flex; gap: 6px; align-items: baseline; font-size: 15px; font-weight: 600; line-height: 1.4; }
.mf-q-n { color: var(--ink-3); font-weight: 600; }
.mf-q-text { white-space: pre-line; min-width: 0; overflow-wrap: anywhere; }
.mf-cond-chip { justify-self: start; display: inline-flex; align-items: center; gap: 5px; }
.mf-cond-chip .icon { width: 13px; height: 13px; }
.mf-q-opts { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 14px; color: var(--ink-2); }
.mf-q-opts li { display: flex; align-items: center; gap: 10px; min-width: 0; }
.mf-q-scale { display: flex; gap: 8px; }
.mf-q-scale span { width: 32px; height: 32px; border: 1px solid var(--border); border-radius: 50%; display: grid; place-items: center; font-size: 13px; color: var(--ink-3); }
.mf-q-line { color: var(--ink-3); font-size: 13.5px; border-bottom: 1px dotted var(--border); max-width: 55%; padding: 4px 0 6px; }
.mf-q-top { display: grid; grid-template-columns: minmax(0, 1fr) 210px; gap: 14px; align-items: start; }
.mf-prompt { width: 100%; min-width: 0; font: inherit; font-size: 15px; line-height: 1.45; color: var(--ink); background: var(--surface-2); border: 0; border-bottom: 1px solid var(--ink-3); border-radius: 6px 6px 0 0; padding: 12px 14px; resize: none; overflow: hidden; min-height: 50px; }
.mf-prompt:focus { outline: none; border-bottom: 2px solid var(--accent); padding-bottom: 11px; }
.mf-type { font: inherit; font-size: 14px; color: var(--ink); background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 11px 12px; min-width: 0; }
.mf-type:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.mf-opts { display: grid; gap: 2px; }
.mf-opt { display: flex; align-items: center; gap: 10px; min-height: 40px; min-width: 0; }
.mf-opt input { flex: 1; min-width: 0; font: inherit; font-size: 14px; color: var(--ink); background: transparent; border: 0; border-bottom: 1px solid transparent; padding: 7px 0; }
.mf-opt input:hover { border-bottom-color: var(--border); }
.mf-opt input:focus { outline: none; border-bottom: 2px solid var(--accent); padding-bottom: 6px; }
.mf-opt .icon-btn { width: 32px; height: 32px; color: var(--ink-3); flex: none; }
.mf-opt-add { flex-wrap: wrap; gap: 6px 10px; font-size: 14px; }
.mf-link { background: none; border: 0; padding: 7px 0; font: inherit; color: var(--ink-3); cursor: pointer; border-bottom: 1px solid transparent; }
.mf-link:hover { color: var(--ink); border-bottom-color: var(--border); }
.mf-link.accent { color: var(--accent); }
.mf-link:disabled { opacity: .5; cursor: not-allowed; border-bottom-color: transparent; }
.mf-q-foot { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; border-top: 1px solid var(--border); padding-top: 10px; margin-top: 2px; }
.mf-q-foot > .btn { display: inline-flex; align-items: center; gap: 6px; }
.mf-q-foot > .btn .icon { width: 15px; height: 15px; }
.mf-q-foot > .btn.active { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.mf-vr { width: 1px; height: 26px; background: var(--border); margin: 0 10px; }
.mf-switch { position: relative; display: inline-flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--ink-2); cursor: pointer; }
.mf-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.mf-switch i { flex: none; position: relative; width: 36px; height: 20px; border-radius: 10px; background: var(--border); transition: background .15s; }
.mf-switch i::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgb(0 0 0 / 0.3); transition: transform .15s; }
.mf-switch input:checked + i { background: var(--accent); }
.mf-switch input:checked + i::after { transform: translateX(16px); }
.mf-switch input:focus-visible + i { outline: 2px solid var(--accent); outline-offset: 2px; }
.mf-switch input:disabled + i { opacity: .5; }
.mf-qerr { font-size: 13px; color: var(--bad); display: grid; gap: 2px; }
.mf-qerr .warn { color: var(--warn); }
.mf-tools { position: absolute; top: 0; right: -60px; display: grid; gap: 4px; padding: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow); }
.mf-tools .icon-btn { width: 38px; height: 38px; }
.mf-add { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 14px; border: 1px dashed var(--border); border-radius: var(--radius); background: transparent; color: var(--ink-3); font: inherit; font-size: 14px; cursor: pointer; }
.mf-add:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.msg-cond-head { display: flex; align-items: center; gap: 8px; }
.msg-cond-head .icon { width: 15px; height: 15px; color: var(--accent); }
.mf-pv-langs { display: flex; width: fit-content; margin: 0 auto; }
.mf-phone { width: min(400px, 100%); margin: 14px auto 0; padding: 16px; border: 1px solid var(--border); border-radius: 24px; background: var(--surface); }
@media (max-width: 1240px) {
  .mf-tools { position: static; display: flex; justify-self: start; box-shadow: none; border: 0; padding: 0; }
}
@media (max-width: 640px) {
  .mf-q-top { grid-template-columns: minmax(0, 1fr); }
  .mf-head, .mf-card, .mf-q { padding-left: 16px; padding-right: 16px; }
  .mf-q.active { padding-left: 11px; }
  .mf-pic, .mf-pic-add { margin-left: -16px; margin-right: -16px; }
  .mf-pic-add { padding-left: 16px; padding-right: 16px; }
  .mf-title { font-size: 22px; }
  .mf-vr { display: none; }
}

/* Топ студентов */
.top-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.top-bar .acc-search { flex: 1 1 220px; max-width: 340px; }
.top-struck { text-decoration: line-through; color: var(--ink-3); }
.top-read { display: block; font-size: 12px; margin-top: 3px; }
.top-rejected { font-size: 12px; margin-top: 4px; }
.top-acts { white-space: nowrap; text-align: right; }
.top-acts .btn + .btn { margin-left: 4px; }
.top-words { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 16px; align-items: start; }
.top-words .form-row { flex-wrap: wrap; }
.top-words #tw-word { flex: 1 1 140px; }
.top-hints { margin: 12px 0 0; padding-left: 18px; font-size: 12.5px; color: var(--ink-2); display: grid; gap: 6px; }
@media (max-width: 900px) {
  .top-words { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .top-acts { white-space: normal; text-align: left; }
  .top-acts .btn { margin: 2px 4px 2px 0; }
}
