/* VOW Dashboard. Calm list + side panel. Hairlines over boxes, one charcoal
   primary per view, ITSO red reserved for "act now". Inter throughout. */
:root {
  --bg: #ffffff;
  --subtle: #fafafa;
  --hover: #f4f4f5;
  --select: #f1f1f3;
  --line: #e8e8ea;
  --line-strong: #d9d9dd;
  --ink: #1a1a1a;
  --ink-2: #44474d;
  --muted: #5f6368;
  --faint: #6b7280;
  --primary: #1a1a1a;
  --primary-ink: #ffffff;
  --red: #ef4136;
  --red-text: #c62f26;
  --red-wash: #fdf1f0;
  --amber: #e8a317;
  --amber-text: #8a5300;
  --amber-wash: #fdf5e4;
  --green: #16a34a;
  --green-text: #15803d;
  --green-wash: #edf7f0;
  --brand-grey: #9d9fa2;
  --display: 'Bebas Neue', 'Inter', system-ui, sans-serif;
  --overlay: rgba(17, 17, 20, 0.38);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 12px 32px rgba(0, 0, 0, 0.10);
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: ui-monospace, 'SFMono-Regular', Menlo, monospace;
  --r-ctl: 6px;
  --r-panel: 10px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141416; --subtle: #19191c; --hover: #202024; --select: #25252a;
    --line: #2a2a2f; --line-strong: #37373d;
    --ink: #ededef; --ink-2: #c8c9cd; --muted: #a0a3a9; --faint: #8d9097;
    --primary: #ededef; --primary-ink: #141416;
    --red-text: #ff8a80; --red-wash: rgba(239, 65, 54, 0.12);
    --amber-text: #f2c063; --green-text: #6fd59a;
    --amber-wash: rgba(232, 163, 23, 0.14); --green-wash: rgba(22, 163, 74, 0.15); --brand-grey: #6e7075;
    --overlay: rgba(0, 0, 0, 0.55); --shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #141416; --subtle: #19191c; --hover: #202024; --select: #25252a;
  --line: #2a2a2f; --line-strong: #37373d;
  --ink: #ededef; --ink-2: #c8c9cd; --muted: #a0a3a9; --faint: #8d9097;
  --primary: #ededef; --primary-ink: #141416;
  --red-text: #ff8a80; --red-wash: rgba(239, 65, 54, 0.12);
  --amber-text: #f2c063; --green-text: #6fd59a;
  --amber-wash: rgba(232, 163, 23, 0.14); --green-wash: rgba(22, 163, 74, 0.15); --brand-grey: #6e7075;
  --overlay: rgba(0, 0, 0, 0.55); --shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/20px var(--font); font-feature-settings: 'cv11', 'ss01'; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; border-radius: 4px; }
.tnum, time, .id { font-variant-numeric: tabular-nums; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

.shell { display: flex; min-height: 100%; }

/* Sidebar: quiet on purpose */
.side { flex: 0 0 224px; background: var(--subtle); border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; padding: 18px 12px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 4px 8px 18px; text-align: center; }
.brand img { width: 128px; height: auto; }
.brand .logo-dark { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .brand .logo-light { display: none; } :root:not([data-theme="light"]) .brand .logo-dark { display: block; } }
:root[data-theme="dark"] .brand .logo-light { display: none; }
:root[data-theme="dark"] .brand .logo-dark { display: block; }
.brand-title { font-family: var(--display); font-size: 26px; line-height: 1; letter-spacing: .04em; color: var(--ink); }
.side-search { display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 10px; margin-bottom: 8px; border: 1px solid var(--line); border-radius: var(--r-ctl); background: var(--bg); color: var(--muted); cursor: pointer; text-align: left; }
.side-search:hover { border-color: var(--line-strong); }
.side-search kbd { margin-left: auto; }
.nav { display: flex; flex-direction: column; gap: 1px; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: var(--r-ctl); border: 0; background: none; color: var(--ink-2); font-weight: 500; cursor: pointer; text-align: left; width: 100%; }
.nav-item:hover { background: var(--hover); }
.nav-item[aria-current="page"] { background: var(--select); color: var(--ink); font-weight: 600; }
.nav-item svg { color: var(--faint); flex: 0 0 auto; }
.nav-item[aria-current="page"] svg { color: var(--ink); }
.nav-count { margin-left: auto; font-size: 12px; font-weight: 600; color: var(--red-text); font-variant-numeric: tabular-nums; }
.nav-count.quiet { color: var(--faint); font-weight: 500; }
.nav-rule { width: calc(100% - 20px); margin: 8px 10px; border: 0; border-top: 1px solid var(--line-strong); }
.side-foot { margin-top: auto; padding: 12px 8px 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; font-size: 12px; color: var(--muted); }
.side-foot strong { display: block; color: var(--ink); font-weight: 600; font-size: 13px; }
.side-foot .link { color: var(--muted); }
.side-foot .link-btn { align-self: flex-start; text-align: left; font-size: 12px; color: var(--muted); }

kbd { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 5px; border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 4px; font: 500 11px/1 var(--font); color: var(--muted); background: var(--bg); }

/* Main column */
.main { flex: 1 1 auto; min-width: 0; display: flex; }
.content { flex: 1 1 auto; min-width: 0; padding: 28px max(16px, env(safe-area-inset-right, 0px)) 64px max(32px, env(safe-area-inset-left, 0px)); }
.content-inner { max-width: 1040px; margin: 0 auto; display: flex; flex-direction: column; gap: 20px; }
.page-head { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: flex-end; justify-content: space-between; }
.page-title { margin: 0; font-size: 26px; line-height: 32px; font-weight: 650; letter-spacing: -0.015em; }
.page-sub { margin: 4px 0 0; color: var(--muted); }
.summary { display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--muted); }
.summary button { background: none; border: 0; padding: 0; color: var(--ink-2); cursor: pointer; text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
.summary button:hover { text-decoration-color: currentColor; }
.summary .hot { color: var(--red-text); font-weight: 600; }
.demo-note { font-size: 12px; color: var(--amber-text); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: var(--r-ctl); border: 1px solid transparent; font-size: 13px; font-weight: 550; cursor: pointer; white-space: nowrap; text-decoration: none; transition: background .12s, border-color .12s, color .12s; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: var(--primary-ink); }
.btn-primary:hover:not(:disabled) { opacity: .88; }
.btn-secondary { background: var(--bg); border-color: var(--line-strong); color: var(--ink); }
.btn-secondary:hover:not(:disabled) { background: var(--hover); }
.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-ghost:hover:not(:disabled) { background: var(--hover); color: var(--ink); }
.btn-danger { background: transparent; color: var(--red-text); }
.btn-danger:hover { background: var(--red-wash); }
.btn-icon { width: 32px; padding: 0; }
.link-btn { background: none; border: 0; padding: 0; color: var(--ink-2); cursor: pointer; text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; font-size: 13px; }
.link-btn:hover { color: var(--ink); text-decoration-color: currentColor; }

/* Inputs */
.input, .select { width: 100%; height: 34px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: var(--r-ctl); background: var(--bg); font-size: 14px; }
textarea.input { height: auto; padding: 8px 10px; line-height: 22px; resize: vertical; }
.input:focus, .select:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px var(--select); }
.input[readonly] { background: var(--subtle); color: var(--muted); }
.input[aria-invalid="true"] { border-color: var(--red); }
.field { display: grid; gap: 6px; }
.field > span { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.field .help { font-size: 12px; color: var(--muted); }
.field .err { font-size: 12px; color: var(--red-text); }
.inline-input { display: flex; gap: 6px; align-items: center; }
.check { display: inline-flex; gap: 8px; align-items: center; cursor: pointer; font-size: 13px; }
.check input { width: 15px; height: 15px; margin: 0; accent-color: var(--ink); }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.search-box { position: relative; flex: 1 1 240px; max-width: 340px; }
.search-box svg { position: absolute; left: 10px; top: 9px; color: var(--faint); pointer-events: none; }
.search-box .input { padding-left: 32px; }
.seg { display: inline-flex; padding: 2px; border-radius: 8px; background: var(--hover); }
.seg button { border: 0; background: none; height: 28px; padding: 0 10px; border-radius: 6px; font-size: 13px; font-weight: 500; color: var(--muted); cursor: pointer; white-space: nowrap; }
.seg button[aria-pressed="true"] { background: var(--bg); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); font-weight: 600; }
.seg .n { margin-left: 5px; color: var(--faint); font-variant-numeric: tabular-nums; }
.select.compact { width: auto; height: 32px; font-size: 13px; padding-right: 26px; }

/* Status: a dot plus words, never color alone */
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; background: var(--faint); }
.dot.red { background: var(--red); } .dot.amber { background: var(--amber); } .dot.green { background: var(--green); } .dot.ink { background: var(--ink); } .dot.hollow { background: transparent; box-shadow: inset 0 0 0 1.5px var(--faint); }
.t-red { color: var(--red-text); } .t-amber { color: var(--amber-text); } .t-green { color: var(--green-text); } .t-muted { color: var(--muted); } .t-faint { color: var(--faint); }
.mark { display: inline-flex; align-items: center; gap: 6px; }

/* Today groups */
.group { display: flex; flex-direction: column; }
.group-head { display: flex; align-items: baseline; gap: 8px; padding: 0 12px 8px; font-size: 13px; font-weight: 600; color: var(--ink-2); border-bottom: 1px solid var(--line); }
.group-head .n { color: var(--faint); font-weight: 500; font-variant-numeric: tabular-nums; }
.group + .group { margin-top: 12px; }
.row { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto 172px; gap: 12px; align-items: center; min-height: 52px; padding: 8px 12px; border-bottom: 1px solid var(--line); cursor: pointer; }
.row:hover { background: var(--hover); }
.row.is-sel { background: var(--select); }
.row-main { min-width: 0; }
.row-title { display: flex; gap: 8px; align-items: baseline; min-width: 0; }
.row-name { font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: none; border: 0; padding: 0; cursor: pointer; text-align: left; }
.row-id { font-size: 12px; color: var(--faint); font-variant-numeric: tabular-nums; }
.row-sentence { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-meta { display: flex; align-items: center; gap: 8px; min-width: 0; margin-top: 3px; }
.row-meta .row-sentence { min-width: 0; flex: 1 1 auto; }
.row.prow { grid-template-columns: minmax(0, 1fr) auto 172px; }
.row.prow.no-act { grid-template-columns: minmax(0, 1fr) auto; }

/* Tags: the feed's phase (outlined) and its status within it (tinted).
   Squared and uppercase, like the ITSO site's section tags. */
.tags { display: inline-flex; gap: 4px; flex: 0 0 auto; align-items: center; flex-wrap: wrap; }
.tag { display: inline-flex; align-items: center; height: 20px; padding: 0 6px; border-radius: 3px; font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; line-height: 1; border: 1px solid transparent; background: var(--hover); color: var(--ink-2); }
.tag.phase { background: transparent; border-color: var(--line-strong); color: var(--ink); }
.tag.phase.active { border-color: color-mix(in srgb, var(--green) 45%, transparent); color: var(--green-text); }
.tag.phase.archived { color: var(--faint); border-style: dashed; }
.tag.todo { background: transparent; border-color: var(--red); color: var(--red-text); }
.tag.wait { background: var(--amber-wash); color: var(--amber-text); }
.tag.late { background: var(--red-wash); color: var(--red-text); }
.tag.soon { background: var(--hover); color: var(--muted); }
.tag.ok { background: var(--green-wash); color: var(--green-text); }
.list td .tags + .cell-sub { margin-top: 4px; }
.rec-stage .tags { margin-right: 2px; }
.row-due { font-size: 13px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.row .btn { opacity: 0; justify-self: end; }
.row:hover .btn, .row.is-sel .btn, .row:focus-within .btn { opacity: 1; }
@media (hover: none) { .row .btn { opacity: 1; } }
.empty { padding: 40px 12px; text-align: center; color: var(--muted); }
.empty strong { display: block; color: var(--ink); font-size: 15px; margin-bottom: 4px; }

/* Brokerages list */
.list-wrap { overflow-x: auto; }
table.list { width: 100%; min-width: 720px; border-collapse: collapse; }
.list th { text-align: left; font-size: 12px; font-weight: 500; color: var(--faint); padding: 0 12px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.list td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.list tbody tr { cursor: pointer; }
.list tbody tr:hover td { background: var(--hover); }
.list tbody tr.is-sel td { background: var(--select); }
.list .grp td { cursor: default; background: var(--bg) !important; padding-top: 20px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.list .grp .n { color: var(--faint); font-weight: 500; margin-left: 6px; }
.cell-sub { font-size: 12px; color: var(--faint); }
.sort { background: none; border: 0; padding: 0; color: inherit; font: inherit; cursor: pointer; }
.banner { display: flex; gap: 12px; justify-content: space-between; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-panel); background: var(--subtle); font-size: 13px; }
.banner ul { margin: 4px 0 0; padding-left: 18px; }

/* Side panel */
.panel { flex: 0 0 min(560px, 46vw); border-left: 1px solid var(--line); background: var(--bg); height: 100vh; position: sticky; top: 0; display: flex; flex-direction: column; min-width: 0; }
.panel.enter { animation: slide-in .2s cubic-bezier(.2, .8, .2, 1); }
@keyframes slide-in { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.panel-bar { display: flex; align-items: center; gap: 4px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.panel-bar .grow { flex: 1 1 auto; }
.panel-body { flex: 1 1 auto; overflow-y: auto; padding: 20px 24px 40px; display: flex; flex-direction: column; gap: 24px; }
.panel-foot { padding: 12px 24px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; align-items: center; flex-wrap: wrap; }
.panel-foot .left { margin-right: auto; }
.rec-title { margin: 0; font-size: 20px; line-height: 28px; font-weight: 650; letter-spacing: -0.01em; }
.rec-meta { margin-top: 2px; color: var(--faint); font-size: 13px; }
.rec-stage { margin-top: 12px; display: flex; gap: 8px; align-items: center; font-weight: 500; }
.rec-actions { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 8px; }
.section { display: flex; flex-direction: column; gap: 10px; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.section-title { margin: 0; font-size: 13px; font-weight: 600; color: var(--ink-2); }
hr.rule { border: 0; border-top: 1px solid var(--line); margin: 0; }

.stepper { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 0; }
.stepper li { display: flex; align-items: flex-start; gap: 6px; font-size: 12px; color: var(--faint); padding-right: 14px; position: relative; }
.stepper li:not(:last-child)::after { content: ''; position: absolute; right: 4px; top: 8px; width: 6px; height: 1px; background: var(--line-strong); }
.stepper .s-ico { width: 16px; height: 16px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; flex: 0 0 auto; box-shadow: inset 0 0 0 1.5px var(--line-strong); margin-top: 1px; }
.stepper .done { color: var(--ink-2); }
.stepper .done .s-ico { background: var(--ink); color: var(--primary-ink); box-shadow: none; }
.stepper .current { color: var(--ink); font-weight: 600; }
.stepper .current .s-ico { box-shadow: inset 0 0 0 2px var(--ink); }
.stepper .late { color: var(--red-text); font-weight: 600; }
.stepper .late .s-ico { background: var(--red); color: #fff; box-shadow: none; }
.stepper .opt { font-style: normal; }
.stepper small { display: block; font-weight: 400; color: var(--faint); font-size: 11px; line-height: 14px; }

dl.props { margin: 0; display: grid; grid-template-columns: 148px minmax(0, 1fr); gap: 0; }
dl.props dt, dl.props dd { padding: 7px 0; border-bottom: 1px solid var(--line); margin: 0; }
dl.props dt { color: var(--muted); font-size: 13px; }
dl.props dd { min-width: 0; word-break: break-word; }
.editable { background: none; border: 0; padding: 2px 6px; margin: -2px -6px; border-radius: 4px; cursor: pointer; text-align: left; font: inherit; color: inherit; }
.editable:hover { background: var(--hover); }
.editable .t-faint { font-style: normal; }

.site { display: grid; grid-template-columns: 16px minmax(0, 1fr) auto; gap: 4px 8px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.site-owner { font-size: 12px; }
.site-owner .link-btn { font-size: 12px; color: var(--ink-2); }
.site-status { justify-self: end; text-align: right; }
.review { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; justify-content: flex-end; font-size: 13px; font-weight: 500; }
.review .btn { height: 28px; padding: 0 10px; font-size: 12px; }
.review-note { font-size: 12px; max-width: 260px; margin-left: auto; }
.review-edit { grid-column: 2 / -1; display: flex; gap: 6px; align-items: center; }
@media (max-width: 560px) { .site { grid-template-columns: 16px minmax(0, 1fr); } .site-status { grid-column: 2; justify-self: start; text-align: left; } .review { justify-content: flex-start; } .review-note { margin-left: 0; } }
.site a { font-weight: 500; text-decoration: none; word-break: break-all; }
.site a:hover { text-decoration: underline; }
.star { color: var(--red); font-size: 12px; line-height: 20px; }
.compliance { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; padding: 10px 12px; border-radius: var(--r-ctl); background: var(--subtle); font-size: 13px; }

.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.timeline li { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.timeline li .dot { margin-top: 6px; }
.tl-text { font-size: 13px; }
.tl-meta { font-size: 12px; color: var(--faint); }
.timeline li .btn { opacity: 0; height: 26px; }
.timeline li:hover .btn, .timeline li:focus-within .btn { opacity: 1; }
.filters { display: flex; gap: 12px; font-size: 13px; }
.filters button { background: none; border: 0; padding: 0; color: var(--faint); cursor: pointer; }
.filters button[aria-pressed="true"] { color: var(--ink); font-weight: 600; }
details.raw summary { cursor: pointer; color: var(--muted); font-size: 13px; }
details.raw table { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 12px; }
details.raw th { text-align: left; font-weight: 500; color: var(--muted); padding: 5px 8px 5px 0; width: 44%; vertical-align: top; border-bottom: 1px solid var(--line); }
details.raw td { padding: 5px 0; font-family: var(--mono); word-break: break-word; border-bottom: 1px solid var(--line); }

/* Composer */
.comp-meta { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 8px 10px; align-items: center; font-size: 13px; }
.comp-meta > span { color: var(--muted); }
.warn { padding: 9px 12px; border-radius: var(--r-ctl); background: var(--red-wash); color: var(--red-text); font-size: 13px; }
.note { padding: 9px 12px; border-radius: var(--r-ctl); background: var(--subtle); color: var(--ink-2); font-size: 13px; }
.note.ok { color: var(--green-text); }
.note.bad { background: var(--red-wash); color: var(--red-text); }
.opts { display: flex; flex-direction: column; gap: 6px; }

/* Form */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.form-grid .full { grid-column: 1 / -1; }
.site-edit { display: flex; flex-direction: column; gap: 8px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.site-edit-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; }

/* Overlays */
.scrim { position: fixed; inset: 0; background: var(--overlay); z-index: 40; display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 16px; }
.dialog { width: min(440px, 100%); background: var(--bg); border-radius: 12px; box-shadow: var(--shadow); padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.dialog h2 { margin: 0; font-size: 16px; font-weight: 650; }
.dialog p { margin: 0; color: var(--ink-2); white-space: pre-line; }
.dialog .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
.palette { width: min(600px, 100%); background: var(--bg); border-radius: 12px; box-shadow: var(--shadow); overflow: hidden; }
.palette input { width: 100%; border: 0; border-bottom: 1px solid var(--line); padding: 16px 18px; font-size: 16px; background: transparent; outline: none; }
.palette-list { max-height: 50vh; overflow-y: auto; padding: 6px; }
.palette-sec { padding: 8px 12px 4px; font-size: 12px; color: var(--faint); }
.palette-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border: 0; background: none; border-radius: 8px; text-align: left; cursor: pointer; }
.palette-item.is-active, .palette-item:hover { background: var(--hover); }
.palette-item .sub { color: var(--faint); font-size: 12px; margin-left: 4px; }
.palette-item kbd { margin-left: auto; }
.menu { position: absolute; right: 12px; top: 46px; min-width: 200px; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); padding: 4px; z-index: 30; display: flex; flex-direction: column; }
.menu button { display: flex; justify-content: space-between; gap: 12px; padding: 8px 10px; border: 0; background: none; border-radius: 6px; text-align: left; cursor: pointer; }
.menu button:hover { background: var(--hover); }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }
.keys { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px 14px; align-items: center; font-size: 13px; }
.toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); display: flex; gap: 14px; align-items: center; background: var(--primary); color: var(--primary-ink); padding: 10px 14px; border-radius: 10px; font-size: 13px; font-weight: 500; box-shadow: var(--shadow); z-index: 60; max-width: calc(100% - 32px); }
.toast button { background: none; border: 0; color: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; padding: 0; }
.toast.error { background: var(--red-text); color: #fff; }
.loading { padding: 80px 16px; text-align: center; color: var(--muted); }

@media (max-width: 1100px) {
  .panel { position: fixed; inset: 0 0 0 auto; width: min(560px, 100%); z-index: 35; box-shadow: var(--shadow); }
}
@media (max-width: 860px) {
  .shell { flex-direction: column; }
  .side { position: static; height: auto; flex: none; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px max(16px, env(safe-area-inset-right, 0px)) 10px max(16px, env(safe-area-inset-left, 0px)); border-right: 0; border-bottom: 1px solid var(--line); }
  .brand { padding: 0; flex-direction: row; align-items: center; }
  .brand img { width: 96px; }
  .brand-title, .side-foot { display: none; }
  .nav { flex-direction: row; order: 3; width: 100%; overflow-x: auto; }
  .nav-item { width: auto; white-space: nowrap; }
  .nav-rule { width: 0; height: 20px; margin: auto 4px; border-top: 0; border-left: 1px solid var(--line-strong); }
  .side-search { width: auto; margin: 0 0 0 auto; }
  .side-search span, .side-search kbd { display: none; }
  .content { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-top: 20px; }
  .panel { width: 100%; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  dl.props { grid-template-columns: 120px minmax(0, 1fr); }
  .row { grid-template-columns: 12px minmax(0, 1fr) auto; }
  .row.prow { grid-template-columns: minmax(0, 1fr) auto; }
  .row-meta { flex-wrap: wrap; }
  .row .btn { display: none; }
}

/* ---- Clickable progress steps */
.step-btn { display: flex; align-items: flex-start; gap: 6px; background: none; border: 0; padding: 2px 4px; margin: -2px -4px; border-radius: 6px; font: inherit; color: inherit; cursor: pointer; text-align: left; }
.step-btn:hover { background: var(--hover); }

/* ---- Renewal cycle bar */
.cycle { margin-top: 18px; padding-bottom: 30px; position: relative; }
.cycle-track { position: relative; height: 6px; border-radius: 999px; background: var(--hover); }
.cycle-fill { position: absolute; inset: 0 auto 0 0; border-radius: 999px; background: var(--line-strong); }
.cycle-mark { position: absolute; top: 50%; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; background: var(--bg); box-shadow: inset 0 0 0 2px var(--faint); }
.cycle-mark.done { background: var(--ink); box-shadow: none; }
.cycle-mark.late { background: var(--red); box-shadow: none; }
.cycle-mark.end { width: 14px; height: 14px; margin: -7px 0 0 -7px; box-shadow: inset 0 0 0 3px var(--ink); }
.cycle-today { position: absolute; top: -6px; width: 2px; height: 18px; margin-left: -1px; background: var(--red); border-radius: 2px; }
.cycle-labels { position: relative; height: 0; }
.cycle-labels span { position: absolute; top: 8px; transform: translateX(-50%); font-size: 11px; line-height: 14px; color: var(--faint); white-space: nowrap; text-align: center; }
.cycle-labels span:first-child { transform: none; text-align: left; }
.cycle-labels span:last-child { transform: translateX(-100%); text-align: right; }
.cycle-labels b { display: block; font-weight: 600; color: var(--ink-2); }
.cycle-note { margin-top: 14px; font-size: 13px; }

/* ---- Renewal runway (Today) */
.runway { display: flex; flex-direction: column; gap: 8px; }
.runway-track { position: relative; overflow-x: clip; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-top: 18px; }
.runway-tick { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--line); }
.runway-tick span { position: absolute; top: -18px; left: 4px; font-size: 11px; color: var(--faint); white-space: nowrap; }
.runway-today { position: absolute; top: -4px; bottom: -4px; width: 2px; margin-left: -1px; background: var(--red); border-radius: 2px; }
.runway-today span { position: absolute; bottom: -18px; left: -14px; font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--red-text); }
.runway-pin { position: absolute; display: inline-flex; align-items: center; gap: 5px; max-width: 26%; height: 18px; padding: 0 6px 0 0; margin-left: -4px; border: 0; background: var(--bg); font-size: 12px; color: var(--ink-2); cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-radius: 4px; }
.runway-pin:hover { color: var(--ink); background: var(--hover); }
.runway-dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; background: var(--ink); }
.runway-pin.red .runway-dot { background: var(--red); }
.runway-pin.amber .runway-dot { background: var(--amber); }
.runway-empty { position: absolute; left: 12px; top: 6px; font-size: 13px; }

/* ---- Billing */
.money-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.money-row > div { padding: 14px 12px; display: flex; flex-direction: column; gap: 2px; }
.money-row > div + div { border-left: 1px solid var(--line); }
.money-row span { font-size: 12px; color: var(--muted); }
.money-row b { font-size: 20px; line-height: 28px; font-weight: 650; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.money-row b.num { font-family: var(--display); font-size: 36px; line-height: 38px; font-weight: 400; letter-spacing: .01em; }
.money-row.kpis { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.money-row span { text-transform: uppercase; letter-spacing: .06em; font-size: 11px; font-weight: 700; }
.money-row.stages { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
.money-row.stages > button { padding: 12px; display: flex; flex-direction: column; gap: 2px; text-align: left; border: 0; background: none; cursor: pointer; }
.money-row.stages > button + button { border-left: 1px solid var(--line); }
.money-row.stages > button:hover:not(:disabled) { background: var(--hover); }
.money-row.stages > button:disabled { cursor: default; }
.money-row.stages b { font-family: var(--display); font-size: 32px; line-height: 34px; font-weight: 400; }

/* ---- Charts: month columns on one baseline */
.charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: 28px 36px; }
.chart.wide { grid-column: 1 / -1; }
.chart-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 12px; margin-bottom: 14px; }
.chart-head .t-faint { font-weight: 500; }
.chart-total { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.legend { display: flex; gap: 16px; font-size: 12px; color: var(--muted); margin: -6px 0 12px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.sw { width: 10px; height: 10px; border-radius: 2px; background: var(--ink); }
.sw.neg { background: var(--brand-grey); }
.bars { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 2px; }
.bar-col { position: relative; display: flex; flex-direction: column; align-items: center; border-radius: 4px; cursor: default; }
.bar-col:hover, .bar-col:focus-visible { background: var(--hover); }
.bar-up { height: 100px; width: 100%; display: flex; align-items: flex-end; justify-content: center; border-bottom: 1px solid var(--line-strong); }
.bar-down { width: 100%; display: flex; align-items: flex-start; justify-content: center; }
.bar { display: block; width: min(26px, 64%); background: var(--ink); border-radius: 4px 4px 0 0; }
.bar.neg { background: var(--brand-grey); border-radius: 0 0 4px 4px; }
.bar-lab { font-size: 11px; color: var(--faint); padding: 4px 0 2px; }
.bar-lab.is-now { color: var(--ink); font-weight: 600; }
.bar-col::after { content: attr(data-tip); position: absolute; bottom: calc(100% + 4px); left: 50%; transform: translateX(-50%); z-index: 3; padding: 5px 8px; border-radius: 4px; background: var(--ink); color: var(--bg); font-size: 12px; line-height: 16px; white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity .1s; }
.bar-col:nth-child(-n+3)::after { left: 0; transform: none; }
.bar-col:nth-child(n+10)::after { left: auto; right: 0; transform: none; }
.bar-col:hover::after, .bar-col:focus-visible::after { opacity: 1; }
.money-row small { font-size: 12px; color: var(--faint); }
.brow .btn { opacity: 1; }
@media (max-width: 860px) { .money-row > div + div, .money-row.stages > button + button { border-left: 0; border-top: 1px solid var(--line); } }

/* ---- Review mode */
.rdots { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.rdot { width: 14px; height: 14px; border-radius: 50%; border: 0; padding: 0; cursor: pointer; background: transparent; box-shadow: inset 0 0 0 1.5px var(--faint); }
.rdot.pass { background: var(--green); box-shadow: none; }
.rdot.fail { background: var(--red); box-shadow: none; }
.rdot.is-cur { outline: 2px solid var(--ink); outline-offset: 2px; }
.rules { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.rule { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 10px; padding: 9px 8px; margin: 0 -8px; border-radius: 8px; cursor: pointer; }
.rule:hover { background: var(--hover); }
.rule input { width: 16px; height: 16px; margin: 2px 0 0; accent-color: var(--red); }
.rule.is-fail { background: var(--red-wash); }
.rule-label { display: block; font-size: 13px; font-weight: 550; }
.rule-hint { display: block; font-size: 12px; color: var(--muted); line-height: 18px; }

/* ---- Sidebar extras */
.sync { font-size: 12px; color: var(--muted); }
.sync .link-btn { font-size: 12px; margin-left: 4px; }
.seg.theme { align-self: flex-start; }
.seg.theme button { height: 24px; padding: 0 8px; font-size: 12px; }

/* ---- Activity day groups */
.timeline li.day-head { display: block; padding: 14px 0 4px; border-bottom: 0; font-size: 12px; font-weight: 600; color: var(--faint); }

/* ---- Email preview */
.mail-preview { border: 1px solid var(--line); border-radius: var(--r-panel); padding: 16px 18px; background: var(--bg); }
.mail-subject { font-weight: 650; margin-bottom: 10px; }
.mail-body { font-size: 14px; line-height: 22px; color: var(--ink-2); }
.mail-sig { margin-top: 14px; padding-top: 10px; border-top: 1px dashed var(--line-strong); font-size: 12px; color: var(--faint); }
.field > span .seg button { height: 24px; font-size: 12px; }
