/* Roadway OS — application styles
   Single accent (#1e22aa) on near-black text and cool-gray surfaces.
   Inter (variable) self-hosted; system stack fallback. No external assets. */

@font-face {
  font-family: "Inter";
  src: url("../fonts/InterVariable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --brand: #1e22aa;
  --brand-600: #181c8f;
  --brand-100: #e9eafb;
  --brand-50: #f4f5fe;
  --ink: #12142b;
  --ink-2: #3b3f57;
  --ink-3: #6b7088;
  --ink-4: #9a9eb5;
  --line: #e4e6ef;
  --line-2: #eef0f6;
  --bg: #f5f6fa;
  --panel: #ffffff;
  --ok: #157a4f;  --ok-bg: #e7f6ee;
  --warn: #9a5b00; --warn-bg: #fff4e0;
  --bad: #b3261e; --bad-bg: #fdecea;
  --info: #1e22aa; --info-bg: #e9eafb;
  --radius: 10px;
  --radius-s: 7px;
  --shadow: 0 1px 2px rgba(18,20,43,.04), 0 1px 3px rgba(18,20,43,.06);
  --side-w: 244px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { font-size: 14px; -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg); line-height: 1.5; font-feature-settings: "cv11", "ss01"; -webkit-font-smoothing: antialiased; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
code, .mono { font-family: var(--mono); font-size: .92em; }
code { background: var(--line-2); padding: 1px 5px; border-radius: 4px; color: var(--ink-2); }
h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -.01em; }
p { margin: 0 0 .75rem; }
p:last-child { margin-bottom: 0; }
strong, .strong { font-weight: 600; }
.muted { color: var(--ink-3); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.wrap { word-break: break-word; overflow-wrap: anywhere; }
.right { text-align: right; }
.dim { opacity: .6; }
.hint { font-size: 11.5px; color: var(--ink-4); margin-top: 3px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 8px; top: 8px; background: #fff; padding: 6px 10px; z-index: 100; }
.ico { flex: 0 0 auto; vertical-align: -3px; }
.sep { height: 1px; background: var(--line); margin: 16px 0; }
.bad-link { color: var(--bad); font-weight: 600; }

/* ── Shell ─────────────────────────────────────────────── */
.shell { display: flex; min-height: 100vh; }
.side { width: var(--side-w); flex: 0 0 var(--side-w); background: var(--panel); border-right: 1px solid var(--line); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.side-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 18px 12px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 700; font-size: 15px; letter-spacing: -.01em; min-height: 30px; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 14px; height: 14px; border-radius: 4px; background: var(--brand); box-shadow: inset 0 0 0 3px rgba(255,255,255,.35); }
.side .side-close { display: none; }
.nav { padding: 6px 10px; flex: 1; overflow-y: auto; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--ink-2); font-weight: 500; margin-bottom: 2px; }
.nav-item:hover { background: var(--bg); text-decoration: none; color: var(--ink); }
.nav-item.active { background: var(--brand-100); color: var(--brand); font-weight: 600; }
.nav-item .ico { color: var(--ink-4); }
.nav-item.active .ico { color: var(--brand); }
.nav-badge { margin-left: auto; background: var(--brand); color: #fff; border-radius: 999px; font-size: 11px; padding: 1px 7px; font-weight: 600; }
.nav-badge.warn { background: var(--warn); }
.side-foot { border-top: 1px solid var(--line); padding: 12px 12px; display: flex; align-items: center; gap: 8px; }
.me { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; color: var(--ink); }
.me:hover { text-decoration: none; }
.me-text { display: flex; flex-direction: column; min-width: 0; }
.me-name { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-role { font-size: 11.5px; color: var(--ink-3); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--brand-100); color: var(--brand); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12px; flex: 0 0 auto; }
.avatar.small { width: 24px; height: 24px; font-size: 10px; vertical-align: middle; margin-right: 4px; }
.side-backdrop { display: none; }

.main-wrap { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 14px; padding: 14px 28px; background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; min-height: 60px; }
.topbar .side-open { display: none; }
.page-title { font-size: 18px; }
.crumbs { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-3); }
.crumbs + .page-title { display: none; }
.crumbs a { color: var(--ink-3); }
.crumbs span:last-child { color: var(--ink); font-weight: 600; }
.crumb-sep { color: var(--ink-4); }
.topbar-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.main { padding: 24px 28px 48px; max-width: 1240px; width: 100%; }
body.wide .main { max-width: none; }
.lead { color: var(--ink-2); max-width: 900px; margin-bottom: 18px; }

/* ── Layout helpers ────────────────────────────────────── */
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack.tight { gap: 8px; }
.row { display: flex; align-items: center; gap: 10px; }
.row.gap { gap: 12px; }
.row.end { align-items: flex-end; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.grid-2-1 { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 16px; align-items: start; }
.inline { display: inline; }
form.inline { display: inline-block; }

/* ── Cards ─────────────────────────────────────────────── */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card + .card { margin-top: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--line-2); }
.card-head h2 { font-size: 14px; font-weight: 650; }
.card-actions { display: flex; gap: 8px; align-items: center; }
.card-body { padding: 18px; }
.card-body > .table-wrap:first-child { margin: -18px; margin-bottom: 0; }
.card-body > .table-wrap:first-child + .pager { margin-top: 18px; }
.sub { font-size: 13px; font-weight: 650; margin: 6px 0 2px; color: var(--ink-2); text-transform: uppercase; letter-spacing: .04em; }

/* ── KPIs ──────────────────────────────────────────────── */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 16px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.kpi.attention { border-color: #f0c98a; background: linear-gradient(180deg, #fffaf0, #fff); }
.kpi-label { font-size: 12px; color: var(--ink-3); font-weight: 500; }
.kpi-value { font-size: 26px; font-weight: 700; letter-spacing: -.02em; margin-top: 4px; }
.kpi-sub { font-size: 12px; color: var(--ink-3); margin-top: 2px; }

/* ── Health & lists ────────────────────────────────────── */
.health { list-style: none; margin: 0; padding: 0; }
.health li { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line-2); }
.health li:last-child { border-bottom: 0; }
.health li .ico { margin-top: 2px; }
.health li.ok .ico { color: var(--ok); }
.health li.bad .ico { color: var(--bad); }
.health-label { font-weight: 600; font-size: 13px; }
.health-text { color: var(--ink-3); font-size: 12.5px; }
.steps { margin: 0; padding-left: 20px; }
.steps li { margin-bottom: 8px; color: var(--ink-2); }
.kv { display: grid; grid-template-columns: minmax(110px, 36%) 1fr; gap: 6px 14px; margin: 0; }
.kv dt { color: var(--ink-3); font-size: 12.5px; padding-top: 2px; }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: flex; gap: 10px; align-items: baseline; padding: 6px 0; border-bottom: 1px solid var(--line-2); font-size: 13px; }
.timeline li:last-child { border-bottom: 0; }
.tl-time { color: var(--ink-3); font-size: 12px; white-space: nowrap; min-width: 130px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 999px; padding: 5px 10px 5px 12px; background: var(--panel); color: var(--ink); font-size: 12.5px; }
.chip:hover { border-color: var(--brand); text-decoration: none; }
.chip.static { padding-right: 6px; }
.chip code { background: none; padding: 0; }
.chip-count { background: var(--line-2); border-radius: 999px; padding: 0 8px; font-weight: 600; font-size: 11.5px; }
.chip-x { border: 0; background: none; color: var(--ink-4); cursor: pointer; font-size: 15px; line-height: 1; padding: 0 4px; }
.chip-x:hover { color: var(--bad); }

/* ── Tables ────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; font-weight: 600; color: var(--ink-3); font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; padding: 10px 14px; border-bottom: 1px solid var(--line); background: #fafbfd; white-space: nowrap; }
.table td { padding: 10px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tbody tr:hover { background: #fafbfe; }
.table tbody tr:last-child td { border-bottom: 0; }
.table.compact th, .table.compact td { padding: 7px 10px; }
.table td.sample code { max-width: 220px; display: inline-block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; }
.kv-table td:first-child { width: 34%; color: var(--ink-2); }
.table .role-select { min-width: 170px; }

/* ── Pills / notices / flash ───────────────────────────── */
.pill { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; line-height: 1.5; white-space: nowrap; background: var(--line-2); color: var(--ink-2); text-transform: capitalize; }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.bad { background: var(--bad-bg); color: var(--bad); }
.pill.info { background: var(--info-bg); color: var(--info); }
.pill.muted { background: var(--line-2); color: var(--ink-3); }
.pill.neutral { text-transform: none; }
.notice { display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; border-radius: var(--radius-s); border: 1px solid; margin-bottom: 16px; font-size: 13.5px; }
.notice .ico { margin-top: 2px; }
.notice.info { background: var(--info-bg); border-color: #cfd2f5; color: var(--ink); }
.notice.info .ico { color: var(--info); }
.notice.warn { background: var(--warn-bg); border-color: #f2d9a6; }
.notice.warn .ico { color: var(--warn); }
.notice.bad { background: var(--bad-bg); border-color: #f3c3bf; }
.notice.bad .ico { color: var(--bad); }
.notice.ok { background: var(--ok-bg); border-color: #b9e3c9; }
.notice.ok .ico { color: var(--ok); }
.flash { display: flex; gap: 10px; align-items: center; padding: 11px 14px; border-radius: var(--radius-s); margin-bottom: 14px; font-size: 13.5px; border: 1px solid; }
.flash.success { background: var(--ok-bg); border-color: #b9e3c9; color: var(--ok); }
.flash.error { background: var(--bad-bg); border-color: #f3c3bf; color: var(--bad); }
.flash.info { background: var(--info-bg); border-color: #cfd2f5; color: var(--info); }
.flash a { color: inherit; text-decoration: underline; }
.flash-x { margin-left: auto; border: 0; background: none; color: inherit; cursor: pointer; opacity: .7; padding: 2px; }
.flash-x:hover { opacity: 1; }

/* ── Forms ─────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > label { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.field-hint { font-size: 12px; color: var(--ink-3); }
.field-error { font-size: 12px; color: var(--bad); font-weight: 500; }
.field.has-error .input { border-color: var(--bad); }
.input { width: 100%; height: 38px; padding: 0 11px; border: 1px solid #d5d8e4; border-radius: var(--radius-s); background: #fff; color: var(--ink); font: inherit; font-size: 13.5px; transition: border-color .12s, box-shadow .12s; }
textarea.input { height: auto; padding: 9px 11px; resize: vertical; min-height: 70px; }
select.input { padding-right: 30px; appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7088' stroke-width='2.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 10px center; }
select.input[multiple] { height: auto; padding: 6px; background-image: none; }
.input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(30,34,170,.14); }
.input[readonly], .input:disabled { background: #f7f8fb; color: var(--ink-3); }
.input.small { height: 30px; font-size: 12.5px; padding: 0 8px; }
.input.short { width: 120px; }
.input.auto { width: auto; min-width: 160px; }
.input.mono { font-family: var(--mono); font-size: 13px; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; cursor: pointer; color: var(--ink-2); }
.check input { width: 16px; height: 16px; accent-color: var(--brand); margin: 0; }
.check.dim { opacity: .55; }
.perm-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; padding: 0 16px; border-radius: var(--radius-s); border: 1px solid #d5d8e4; background: #fff; color: var(--ink); font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; white-space: nowrap; transition: background .12s, border-color .12s, color .12s; text-decoration: none; }
.btn:hover { background: #f7f8fb; text-decoration: none; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-600); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--bad); }
.btn.danger:not(.ghost) { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.danger.ghost:hover { background: var(--bad-bg); border-color: #f3c3bf; }
.btn.small { height: 30px; padding: 0 10px; font-size: 12.5px; }
.btn.block { width: 100%; }
.btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.icon-btn { border: 0; background: none; color: var(--ink-3); cursor: pointer; padding: 6px; border-radius: 6px; display: inline-flex; }
.icon-btn:hover { background: var(--bg); color: var(--ink); }
.link { color: var(--brand); font-size: 13px; }

/* ── Toolbar / segments / search ───────────────────────── */
.toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.search { position: relative; flex: 1; min-width: 200px; max-width: 360px; }
.search .ico { position: absolute; left: 10px; top: 11px; color: var(--ink-4); }
.search .input { padding-left: 32px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius-s); overflow: hidden; background: var(--panel); }
.seg-item { padding: 0 12px; height: 36px; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-2); border-right: 1px solid var(--line); font-weight: 500; }
.seg-item:last-child { border-right: 0; }
.seg-item:hover { background: var(--bg); text-decoration: none; }
.seg-item.active { background: var(--brand-100); color: var(--brand); font-weight: 600; }
.seg-item.attention:not(.active) { color: var(--bad); }
.seg-count { background: rgba(0,0,0,.06); border-radius: 999px; padding: 0 7px; font-size: 11px; font-weight: 600; }
.seg-item.active .seg-count { background: rgba(30,34,170,.12); }
.pager { display: flex; align-items: center; justify-content: space-between; padding-top: 14px; font-size: 13px; color: var(--ink-3); }
.pager-links { display: flex; gap: 8px; }
.drawer { margin-bottom: 16px; }
.drawer[hidden] { display: none; }
.details { margin-top: 12px; }
.details summary { cursor: pointer; font-weight: 600; font-size: 13px; color: var(--ink-2); }
.settings-nav { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }
.settings-nav a { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); font-size: 13px; color: var(--ink-2); font-weight: 500; }
.settings-nav.tabs a.on { background: var(--brand); color: #fff; }
.settings-nav a:hover { border-color: var(--brand); color: var(--brand); text-decoration: none; }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--c, #ccc); margin-right: 8px; vertical-align: -1px; }

/* ── Code blocks ───────────────────────────────────────── */
.code { font-family: var(--mono); font-size: 12.5px; background: #12142b; color: #e6e8f5; border-radius: var(--radius-s); padding: 12px 14px; overflow-x: auto; margin: 8px 0; line-height: 1.55; }
.code.wrap { white-space: pre-wrap; word-break: break-all; }
.code.copy { position: relative; padding-right: 70px; cursor: copy; }
.code.copy::after { content: "copy"; position: absolute; right: 10px; top: 9px; font-size: 11px; color: #9a9eb5; border: 1px solid #3b3f57; border-radius: 4px; padding: 1px 7px; font-family: var(--font); }
.code.copy.copied::after { content: "copied"; color: #7fd6a4; border-color: #7fd6a4; }
.code.inline-code { display: inline-block; margin: 0; padding: 6px 70px 6px 10px; }
.diff { display: inline-flex; gap: 4px; align-items: baseline; margin-right: 8px; font-size: 12px; }
.diff-k { color: var(--ink-3); }
.diff del { color: var(--bad); background: var(--bad-bg); padding: 0 4px; border-radius: 3px; text-decoration: line-through; }
.diff ins { color: var(--ok); background: var(--ok-bg); padding: 0 4px; border-radius: 3px; text-decoration: none; }
.mail-preview { border: 1px solid var(--line); border-radius: var(--radius-s); overflow: hidden; background: #f3f4f8; }
.mail-frame { width: 100%; height: 620px; border: 0; background: #f3f4f8; }
.empty { text-align: center; padding: 36px 20px; color: var(--ink-3); }
.empty-title { font-weight: 600; color: var(--ink); font-size: 15px; margin-bottom: 4px; }

/* ── Templates & rules ─────────────────────────────────── */
.code-input { font-size: 12.5px; line-height: 1.5; tab-size: 2; white-space: pre; overflow: auto; background: #fbfbfe; }
.tags { margin-bottom: 10px; display: flex; flex-wrap: wrap; gap: 6px; }
.tags-title { flex-basis: 100%; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); font-weight: 600; margin: 4px 0 2px; }
.tag-chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 6px; padding: 3px 8px; background: #fff; cursor: copy; font-size: 12px; }
.tag-chip:hover { border-color: var(--brand); background: var(--brand-50); }
.tag-chip.copied { border-color: var(--ok); background: var(--ok-bg); }
.tag-chip code { background: none; padding: 0; }
.snippet { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; cursor: copy; background: #fff; }
.snippet:hover { border-color: var(--brand); background: var(--brand-50); }
.snippet.copied { border-color: var(--ok); background: var(--ok-bg); }
.snippet code { background: none; padding: 0; color: var(--brand); font-weight: 600; }
.snippet-ex { font-size: 11.5px; color: var(--ink-2); margin-top: 4px; white-space: pre-wrap; word-break: break-word; }
.tag-role { font-size: 10.5px; color: var(--brand); background: var(--brand-100); border-radius: 999px; padding: 0 6px; }
.conds { display: flex; flex-direction: column; gap: 8px; }
[hidden] { display: none !important; }
.check input[type=radio] { width: 16px; height: 16px; accent-color: var(--brand); margin: 0; }
.cond-row { display: grid; grid-template-columns: 1.2fr 1fr 1.4fr; gap: 8px; }
.check.small { font-size: 12px; }
@media (max-width: 900px) { .cond-row { grid-template-columns: 1fr; } }

/* ── Reports ───────────────────────────────────────────── */
.brand-img { border-radius: 7px; display: inline-block; vertical-align: middle; object-fit: contain; flex: 0 0 auto; }
.pub-brand .brand-img { border-radius: 9px; }
.pub-brand { gap: 12px; }
.pub-brand .brand-name { font-size: 17px; }
.hidden { display: none !important; }
.report-bar { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; margin-bottom: 16px; position: relative; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
.add-filter { border-style: dashed; color: var(--brand); border-color: var(--brand); text-transform: uppercase; letter-spacing: .04em; font-size: 12px; }
.filter-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--brand-50); border: 1px solid #cfd2f5; color: var(--brand); border-radius: 8px; padding: 6px 8px 6px 12px; font-size: 13px; font-weight: 500; max-width: 420px; }
.filter-chip-label { color: var(--brand); opacity: .75; }
.filter-chip-x { color: var(--brand); font-size: 16px; line-height: 1; padding: 0 4px; text-decoration: none; }
.filter-chip-x:hover { color: var(--bad); text-decoration: none; }
.clear-all { text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); }
.filter-wrap { position: relative; }
.filter-panel { position: absolute; z-index: 20; left: 0; top: 100%; margin-top: 6px; width: 380px; max-width: calc(100vw - 48px); background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 40px rgba(18,20,43,.14); }
.filter-panel[hidden] { display: none; }
.fp-step { padding: 14px; }
.fp-title { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); font-weight: 700; margin-bottom: 10px; }
.fp-search { margin-bottom: 8px; }
.fp-list { list-style: none; margin: 0; padding: 0; max-height: 380px; overflow-y: auto; }
.fp-group { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-4); padding: 10px 8px 4px; font-weight: 600; }
.fp-dim { width: 100%; text-align: left; border: 0; background: none; padding: 9px 8px; font: inherit; font-size: 14px; color: var(--ink); border-radius: 6px; cursor: pointer; }
.fp-dim:hover { background: var(--bg); color: var(--brand); }
.fp-options { max-height: 340px; overflow-y: auto; margin: 4px 0 10px; }
.fp-opt { display: flex; align-items: center; gap: 10px; padding: 8px 6px; border-radius: 6px; cursor: pointer; font-size: 14px; }
.fp-opt:hover { background: var(--bg); }
.fp-opt input { width: 17px; height: 17px; accent-color: var(--brand); margin: 0; flex: 0 0 auto; }
.fp-opt-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fp-opt-n { color: var(--ink-4); font-size: 12px; }
.fp-loading { color: var(--ink-3); padding: 12px 6px; font-size: 13px; }
.fp-actions { display: flex; gap: 8px; border-top: 1px solid var(--line-2); padding-top: 12px; }
.fp-actions .btn.primary { flex: 1; }
.kpis.kpis-6 { grid-template-columns: repeat(6, 1fr); }
.chart { display: block; }
.impact { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.impact-col { background: var(--bg); border-radius: var(--radius-s); padding: 16px 18px; }
.impact-title { font-size: 12.5px; color: var(--ink-3); font-weight: 600; }
.impact-big { font-size: 30px; font-weight: 700; letter-spacing: -.02em; margin: 4px 0 2px; }
.grid2.top { align-items: start; }
.grid2.top .card + .card { margin-top: 0; }
.table.num td { font-variant-numeric: tabular-nums; }
.bar { height: 8px; background: var(--line-2); border-radius: 999px; overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--brand); border-radius: 999px; }
@media (max-width: 1300px) { .kpis.kpis-6 { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 900px) { .kpis.kpis-6 { grid-template-columns: repeat(2, 1fr); } .impact { grid-template-columns: 1fr; } }

/* ── Ad Spend ──────────────────────────────────────────── */
.adgrid td, .adgrid th { vertical-align: middle; }
.adgrid.dense td, .adgrid.dense th { padding: 3px 8px; font-size: 12.5px; line-height: 1.25; }
.adgrid.dense th { font-size: 11px; padding: 6px 8px; }
.adgrid.dense tbody tr { height: 30px; }
.adgrid.dense tbody tr.alt td { background: #f7f8fb; }
.adgrid.dense tbody tr:hover td { background: #eef0fa; }
.adgrid.dense td.li { max-width: 380px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border-left: 3px solid var(--c, transparent); }
.adgrid.dense td.li a { font-weight: 600; }
.adgrid.dense .pill { padding: 1px 7px; font-size: 11px; }
.adgrid.dense .badge { font-size: 10.5px; padding: 0 6px; }
.adgrid.dense .who { display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: .03em; background: var(--line-2); color: var(--ink-3); border-radius: 4px; padding: 1px 4px; margin-left: 3px; }
.adgrid .group-row td { background: var(--tint, var(--bg)); padding: 7px 10px 5px; border-top: 2px solid var(--line); border-left: 3px solid var(--c, var(--line)); font-size: 13px; }
.adgrid .total-row td { background: var(--bg); font-weight: 600; border-top: 2px solid var(--line); }
.adgrid .w-check { width: 28px; }
.input.cell { width: 118px; text-align: right; padding: 3px 7px 3px 16px; height: 26px; font-size: 12.5px; }
.money-input { position: relative; display: inline-block; }
.money-input > .cur { position: absolute; left: 7px; top: 50%; transform: translateY(-50%); color: var(--ink-4); font-size: 12px; pointer-events: none; }
.money-input > .input { padding-left: 18px; }
.money-input > .input.cell { padding-left: 16px; }
.adgrid.dense td.mono, .adgrid .mono { font-variant-numeric: tabular-nums; }
/* annual grid */
.yeargrid td, .yeargrid th { padding: 3px 6px; font-size: 12px; white-space: nowrap; }
.yeargrid td.li { max-width: 260px; overflow: hidden; text-overflow: ellipsis; border-left: 3px solid var(--c, transparent); font-weight: 600; }
.yeargrid td.heat { text-align: right; font-variant-numeric: tabular-nums; background: rgba(30,34,170, var(--h, 0)); color: var(--ink); }
.yeargrid td.heat.hot { color: #fff; }
.yeargrid td.future { color: var(--ink-4); font-style: italic; }
.yeargrid .group-row td { background: var(--tint, var(--bg)); border-top: 2px solid var(--line); font-size: 12.5px; }
.yeargrid .sub td { background: var(--bg); font-weight: 600; }
.yeargrid tbody tr:hover td.heat { outline: 1px solid var(--brand); outline-offset: -1px; }
.quarters { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.quarter { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.quarter h4 { margin: 0 0 6px; font-size: 13px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; }
.quarter .q-big { font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.quarter .q-row { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--ink-2); padding: 2px 0; }
@media (max-width: 1100px) { .quarters { grid-template-columns: repeat(2, 1fr); } }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--c, #c9cbe0); margin-right: 8px; vertical-align: -1px; }
.badge { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; color: var(--ink-3); background: var(--bg); border-radius: 999px; padding: 1px 7px; margin-left: 4px; vertical-align: 1px; }
.ok-text { color: var(--ok); }
.kpi.attention .kpi-value { color: var(--bad); }
.comments { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.comments li { border-left: 3px solid var(--line); padding: 2px 0 2px 12px; }
.comments .c-head { font-size: 13px; margin-bottom: 3px; }
.comments .c-body { font-size: 14px; white-space: normal; word-break: break-word; }
.check.small span { font-size: 13px; }
.grid3.top { align-items: start; }
.grid3.top .card + .card { margin-top: 0; }
.pill.info { background: var(--brand-50); color: var(--brand); }

/* ── Email report ───────────────────────────────────────── */
.kpis.kpis-4 { grid-template-columns: repeat(4, 1fr); }
.funnel { display: flex; flex-direction: column; gap: 10px; }
.f-lab { font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.f-bar { height: 14px; background: var(--line-2); border-radius: 7px; overflow: hidden; }
.f-bar span { display: block; height: 100%; background: var(--brand); border-radius: 7px; }
.heat { border-collapse: collapse; width: 100%; margin: 4px 0 14px; table-layout: fixed; }
.heat th { font-size: 10px; color: var(--ink-4); font-weight: 500; padding: 0 0 3px; text-align: center; }
.heat tbody th { text-align: right; padding-right: 6px; width: 34px; }
.heat td { height: 16px; border: 1px solid #fff; border-radius: 2px; background: var(--bg); }
.heat-title { font-size: 13px; font-weight: 600; margin-top: 4px; }
@media (max-width: 1100px) { .kpis.kpis-4 { grid-template-columns: repeat(2, 1fr); } }

/* ── Public pages ──────────────────────────────────────── */
body.public { background: var(--bg); }
.pub-wrap { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px 16px; }
.pub-card { width: 100%; max-width: 420px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 6px 24px rgba(18,20,43,.06); padding: 34px 32px 30px; }
.pub-card.wide { max-width: 640px; }
.pub-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 15px; margin-bottom: 22px; }
.pub-title { font-size: 22px; margin-bottom: 6px; }
.pub-sub { color: var(--ink-3); margin-bottom: 20px; }
.pub-text { color: var(--ink-2); }
.pub-foot { margin: 18px 0 0; color: var(--ink-3); font-size: 13px; }
.pub-legal { color: var(--ink-4); font-size: 11.5px; margin-top: 10px; }
.err-code { font-size: 48px; font-weight: 800; color: var(--brand); letter-spacing: -.03em; line-height: 1; margin-bottom: 8px; }

/* ── Responsive ────────────────────────────────────────── */
@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .grid-2-1 { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .side { position: fixed; left: 0; top: 0; z-index: 30; transform: translateX(-100%); transition: transform .18s ease; box-shadow: 0 0 40px rgba(0,0,0,.15); }
  body.side-open .side { transform: none; }
  body.side-open .side-backdrop { display: block; position: fixed; inset: 0; background: rgba(18,20,43,.35); z-index: 20; }
  .side .side-close, .topbar .side-open { display: inline-flex; }
  .topbar { padding: 12px 16px; }
  .main { padding: 16px 16px 40px; }
  .grid2, .grid3, .perm-grid { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 1fr; gap: 2px; }
  .kv dt { margin-top: 8px; }
  .toolbar .search { max-width: none; }
  .crumbs + .page-title { display: block; }
  .crumbs { display: none; }
}
@media (max-width: 560px) {
  .kpis { grid-template-columns: 1fr; }
  .pub-card { padding: 26px 20px; }
}
@media print {
  .side, .topbar-actions, .btn, .flash-x { display: none !important; }
  .main-wrap { margin: 0; }
}
