/* RimeGuard app: same dark editorial system as rimeguard.com */
:root {
  --bg: #121316; --bg-deep: #0D0E10; --tile: #1A1C20; --tile-2: #202328; --tile-3: #262A30;
  --line: rgba(255, 255, 255, 0.07); --line-2: rgba(255, 255, 255, 0.13);
  --text: #ECEEF1; --text-2: #C3C8D0; --muted: #8E95A0; --title: #6C727C;
  --accent: #A2CDEF; --accent-2: #71AEDE; --accent-ink: #0B1620;
  --amber: #F2B45A; --red: #F08A7E; --green: #8FD6B4;
  --display: 'Inter Tight', 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --radius: 8px; --gap: 8px; --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: dark;
}
* { box-sizing: border-box; }
/* "hidden" always wins, even over display rules below (the report filter relies on it) */
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--sans); font-size: 15px; line-height: 1.55; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: #C9E2F6; }
h1, h2, h3 { font-family: var(--display); font-weight: 500; letter-spacing: -0.02em; line-height: 1.15; margin: 0; }
p { margin: 0 0 12px; }
code, pre { font-family: var(--mono); }
code { font-size: .92em; background: var(--tile-2); border-radius: 4px; padding: 1px 5px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.skip { position: absolute; left: -9999px; top: 8px; z-index: 50; background: var(--accent); color: var(--accent-ink); padding: 10px 14px; border-radius: 6px; font-weight: 600; text-decoration: none; }
.skip:focus { left: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* logo */
.rg-logo { height: 26px; width: auto; display: block; }
.lg-shield { stroke: var(--accent); } .lg-pulse { stroke: #FFFFFF; } .lg-flake { stroke: var(--accent-2); }
.lg-rime { fill: #FFFFFF; } .lg-guard { fill: var(--accent); }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 16px;
  border-radius: 6px; border: 1px solid transparent; font: 500 14px/1 var(--sans); text-decoration: none; cursor: pointer;
  transition: background-color .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease); white-space: nowrap; }
.btn-accent { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn-accent:hover { background: #B8DAF4; color: var(--accent-ink); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line-2); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-danger { background: transparent; color: var(--red); border-color: rgba(240, 138, 126, .45); }
.btn-danger:hover { background: rgba(240, 138, 126, .1); color: var(--red); }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: 13px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn svg { width: 16px; height: 16px; }
form.inline { display: inline; margin: 0; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* ---------- portal shell ---------- */
.shell { display: flex; min-height: 100vh; position: relative; }
/* The sidebar's edge is drawn by the shell, so it runs the full height of long pages. */
.shell::before { content: ""; position: absolute; top: 0; bottom: 0; left: 248px; width: 1px; background: var(--line); pointer-events: none; }
.side { flex: 0 0 248px; padding: 26px 16px; display: flex; flex-direction: column; gap: 22px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--bg); }
.side .brand { display: block; padding: 0 6px; }
.acct-card { background: var(--tile); border-radius: var(--radius); padding: 12px 14px; }
.acct-card b { display: block; font-weight: 600; font-size: 14px; overflow-wrap: anywhere; }
.acct-card span { font-size: 12px; color: var(--muted); }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 6px; color: var(--text-2); text-decoration: none; font-size: 15px; }
.nav a:hover { background: var(--tile); color: var(--text); }
.nav a[aria-current="page"] { background: var(--tile-2); color: var(--text); }
.nav svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.nav .count { margin-left: auto; background: var(--amber); color: #1A1305; font-size: 12px; font-weight: 600; border-radius: 999px; padding: 1px 8px; }
.side-foot { margin-top: auto; font-size: 12px; color: var(--muted); line-height: 1.6; }
.side-foot form { margin-top: 10px; }
.linklike { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.main { flex: 1 1 auto; min-width: 0; padding: 36px 40px 72px; }
.main-inner { max-width: 1120px; display: flex; flex-direction: column; gap: 22px; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.page-head h1 { font-size: clamp(30px, 3.4vw, 42px); letter-spacing: -0.03em; }
.page-head .lede { color: var(--muted); max-width: 72ch; margin: 8px 0 0; font-size: 14px; }
.section-title { font-size: 20px; margin-bottom: 10px; }

@media (max-width: 860px) {
  .shell { flex-direction: column; }
  .shell::before { display: none; }
  .side { position: static; height: auto; flex: none; border-bottom: 1px solid var(--line); padding: 16px; gap: 14px; }
  .nav { flex-direction: row; flex-wrap: wrap; }
  .nav a { padding: 8px 10px; font-size: 14px; }
  .side-foot { margin-top: 0; }
  .main { padding: 24px 16px 56px; }
}

/* ---------- flash ---------- */
.flash { border-radius: var(--radius); padding: 12px 16px; background: var(--tile-2); border-left: 2px solid var(--accent); font-size: 14px; }
.flash.warn { border-left-color: var(--amber); }
.flash.bad { border-left-color: var(--red); }
.flash.ok { border-left-color: var(--green); }

/* ---------- tiles ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: var(--gap); }
.tile { background: var(--tile); border-radius: var(--radius); padding: 18px 20px; min-width: 0; }
.tile .n { font-family: var(--display); font-size: 38px; line-height: 1; letter-spacing: -0.03em; }
.tile .l { font-size: 14px; color: var(--text-2); margin-top: 8px; }
.tile .m { font-size: 12px; color: var(--muted); margin-top: 4px; }
.n.broken { color: var(--red); } .n.at_risk { color: var(--amber); } .n.healthy { color: var(--green); } .n.accent { color: var(--accent); }
.tile.accent { background: var(--accent); color: var(--accent-ink); }
.tile.accent .l, .tile.accent .m { color: #1D3550; }

/* ---------- pills ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; line-height: 1.5; padding: 1px 9px; border-radius: 999px;
  background: var(--tile-3); color: var(--text-2); white-space: nowrap; }
.pill.broken { background: rgba(240, 138, 126, .14); color: var(--red); }
.pill.at_risk { background: rgba(242, 180, 90, .14); color: var(--amber); }
.pill.healthy { background: rgba(143, 214, 180, .14); color: var(--green); }
.pill.info { background: rgba(162, 205, 239, .14); color: var(--accent); }

/* ---------- report ---------- */
.tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.tabs button { background: var(--tile); border: 1px solid transparent; color: var(--text-2); border-radius: 999px; padding: 6px 14px; font: 500 13px var(--sans); cursor: pointer; }
.tabs button[aria-pressed="true"] { background: var(--tile-2); border-color: var(--line-2); color: var(--text); }
.wf { background: var(--tile); border-radius: 10px; padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; scroll-margin-top: 20px; }
.wf-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.wf-head h2 { font-size: 19px; margin-right: auto; overflow-wrap: anywhere; }
.wf-meta { font-size: 13px; color: var(--muted); }
.finding { border-top: 1px solid var(--line); padding-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.finding p { margin: 0; color: var(--text); }
.finding .meta { font-size: 13px; color: var(--muted); }
.finding .fixline { font-size: 14px; color: var(--text-2); }
.finding .fixline b { color: var(--text); font-weight: 600; }
.diff { margin: 4px 0 0; background: var(--bg-deep); border: 1px solid var(--line); border-radius: 6px; font: 13px/1.6 var(--mono); overflow-x: auto; }
.diff div { padding: 6px 12px; white-space: pre; }
.diff .del { background: rgba(240, 138, 126, .1); color: #F5B1A8; }
.diff .add { background: rgba(162, 205, 239, .1); color: #CBE4F7; }
.healthy-list { background: var(--tile); border-radius: 10px; padding: 14px 20px; }
.healthy-list summary { cursor: pointer; color: var(--text-2); }
.healthy-list ul { margin: 10px 0 0; padding-left: 18px; color: var(--muted); columns: 2; column-gap: 32px; }
.healthy-list li { break-inside: avoid; margin-bottom: 4px; scroll-margin-top: 20px; }
.healthy-list li:target { color: var(--text); }
.healthy-list .note { display: block; font-size: 12px; color: var(--muted); }
.healthy-list .note a { color: var(--accent); }
.limits ul { margin: 6px 0 0; padding-left: 18px; color: var(--text-2); font-size: 14px; display: grid; gap: 6px; }
.limits b { color: var(--text); font-weight: 600; }
@media (max-width: 700px) { .healthy-list ul { columns: 1; } }
.cta-band { background: var(--tile); border-radius: 10px; padding: 20px 22px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; }
.cta-band p { margin: 0; color: var(--text-2); max-width: 64ch; }
.cta-band b { color: var(--text); }

/* what HubSpot's own issue review can't show */
.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pill.blind { background: rgba(162, 205, 239, .1); color: var(--accent); box-shadow: inset 0 0 0 1px rgba(162, 205, 239, .35); }
.finding .blind-why { color: var(--text-2); }
.finding .blind-why b { color: var(--accent); font-weight: 600; }
.blind-band { background: var(--tile); border-radius: 12px; padding: 20px 24px; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 22px; align-items: center; border-left: 3px solid var(--accent); }
.blind-n { font-family: var(--display); font-size: clamp(48px, 6vw, 72px); line-height: .9; letter-spacing: -0.05em; color: var(--accent); }
.blind-band h2 { font-size: clamp(19px, 2vw, 24px); margin-bottom: 6px; }
.blind-band p { margin: 0; color: var(--text-2); font-size: 14px; max-width: 90ch; }
@media (max-width: 600px) { .blind-band { grid-template-columns: 1fr; } }

/* what changed, and the track record */
.changed .change-list, .changes-window .change-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px; }
.change-list li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; font-size: 14px; color: var(--text-2); }
.change-list li span { overflow-wrap: anywhere; }
.changes-window { background: var(--tile); border-radius: 10px; padding: 18px 20px; }
.changes-window h2 { font-size: 17px; margin-bottom: 4px; }
.finding .cause, .alert-card .cause { color: var(--text-2); }
.finding .cause b, .alert-card .cause b { color: var(--amber); font-weight: 600; }
.record { background: var(--tile); border-radius: 10px; padding: 16px 20px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 14px 28px; }
.record-stats { display: flex; flex-wrap: wrap; gap: 10px 26px; }
.record-stats div { display: grid; align-content: start; }
.record-stats b { font-family: var(--display); font-size: 30px; font-weight: 500; line-height: 1; letter-spacing: -0.03em; }
.record-stats b.healthy { color: var(--green); }
.record-stats span { font-size: 13px; color: var(--muted); margin-top: 4px; }
.record-trend { display: grid; justify-items: end; gap: 2px; }
.record-trend span { font-size: 12px; color: var(--muted); }
.spark { width: 228px; height: 44px; }
.spark path { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.spark circle { fill: var(--accent); }
@media (max-width: 900px) { .record { grid-template-columns: minmax(0, 1fr); } .record-trend { justify-items: start; } }
@media (max-width: 600px) { .record-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 16px; } }

/* what breaks if… */
.impact-search { display: flex; gap: 8px; flex-wrap: wrap; }
.impact-search input { flex: 1 1 320px; min-width: 0; font-size: 15px; padding: 12px 14px; }
.impact { background: var(--tile); border-radius: 10px; padding: 18px 20px; display: grid; gap: 10px; }
.impact .table-wrap { background: var(--bg-deep); }
.impact-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; }
.impact-head h2 { font-size: 20px; overflow-wrap: anywhere; }
.impact-head h2 code { font-size: .9em; }
.impact-sum { margin: 0; color: var(--text-2); font-size: 14px; }
.impact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: var(--gap); }
@media (max-width: 600px) {
  .impact thead { display: none; }
  .impact tr { display: grid; gap: 6px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
  .impact tr:last-child { border-bottom: 0; }
  .impact td { padding: 0; border: 0; }
}
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 5px 10px; border-radius: 999px; background: var(--tile-2); color: var(--text); font: 13px var(--mono); text-decoration: none; overflow-wrap: anywhere; }
.chip span { font-family: var(--sans); font-size: 12px; color: var(--muted); }
.chip:hover { background: var(--tile-3); color: var(--text); }
.chains ul { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px; }
.chains li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; font-size: 14px; }
.chains .arrow { color: var(--muted); }

/* progress */
.progress-card { background: var(--tile); border-radius: 12px; padding: 30px; max-width: 640px; }
.steps { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 10px; }
.steps li { display: flex; gap: 10px; align-items: center; color: var(--text-2); }
.steps li::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; }
@media (prefers-reduced-motion: no-preference) {
  .steps li::before { animation: blink 1.4s steps(1) infinite; }
  .steps li:nth-child(2)::before { animation-delay: .45s; } .steps li:nth-child(3)::before { animation-delay: .9s; }
}
@keyframes blink { 50% { opacity: .25; } }

/* ---------- forecast ---------- */
.storm { background: var(--accent); color: var(--accent-ink); border-radius: 12px; padding: 24px 26px; display: grid; grid-template-columns: auto 1fr; gap: 6px 28px; align-items: center; }
.storm .days { font-family: var(--display); font-size: clamp(54px, 7vw, 84px); line-height: .9; letter-spacing: -0.05em; grid-row: span 2; }
.storm .days small { display: block; font: 600 13px var(--sans); letter-spacing: 0; margin-top: 6px; }
.storm h2 { font-size: clamp(22px, 2.4vw, 28px); color: var(--accent-ink); }
.storm p { margin: 0; color: #1D3550; }
@media (max-width: 600px) { .storm { grid-template-columns: 1fr; } .storm .days { grid-row: auto; } }
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--gap); }
.tl { background: var(--tile); border-radius: 10px; padding: 18px 20px; display: grid; grid-template-columns: 132px minmax(0, 1fr); gap: 18px; }
.tl.general { background: transparent; border: 1px solid var(--line-2); }
.tl.past { border-left: 3px solid var(--red); }
.tl-date { font-family: var(--display); overflow-wrap: normal; }
.tl-date b { display: block; font-size: 24px; font-weight: 500; letter-spacing: -0.03em; line-height: 1.05; white-space: nowrap; }
.tl-date span { font-size: 13px; color: var(--muted); }
.tl h2 { font-size: 18px; margin-bottom: 6px; }
.tl p { margin: 0 0 8px; color: var(--text-2); font-size: 14px; }
.tl ul { margin: 0 0 8px; padding-left: 18px; font-size: 14px; }
.tl .src { font-size: 12px; color: var(--muted); }
@media (max-width: 600px) { .tl { grid-template-columns: 1fr; gap: 6px; } }
.cal-box { background: var(--tile); border-radius: 10px; padding: 18px 20px; display: grid; gap: 10px; }
.copyfield { display: flex; gap: 6px; flex-wrap: wrap; }
.copyfield input { flex: 1 1 260px; min-width: 0; }

/* ---------- forms ---------- */
label { font-size: 14px; color: var(--text-2); }
input[type="text"], input[type="email"], input[type="search"], input[type="url"], input[type="password"], input[type="number"], select, textarea {
  background: var(--bg-deep); color: var(--text); border: 1px solid var(--line-2); border-radius: 6px; padding: 10px 12px; font: 14px var(--sans); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
textarea { width: 100%; min-height: 90px; resize: vertical; }
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0 18px; align-items: end; }
.form-grid .field { margin-bottom: 14px; }
.form-grid .actions { grid-column: 1 / -1; }
details > summary { cursor: pointer; }
details > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.panel { background: var(--tile); border-radius: 10px; padding: 20px 22px; }
.panel h2 { font-size: 20px; margin-bottom: 6px; }
.panel > p { color: var(--muted); font-size: 14px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: var(--gap); }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; font-size: 14px; margin: 0; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; overflow-wrap: break-word; min-width: 0; }
.nowrap { white-space: nowrap; }

/* switches (real checkboxes) */
.switch { position: relative; display: inline-flex; width: 46px; height: 26px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--tile-3); transition: background-color .2s var(--ease); pointer-events: none; }
.switch span::after { content: ""; position: absolute; top: 4px; left: 4px; width: 18px; height: 18px; border-radius: 50%; background: var(--muted); transition: transform .2s var(--ease), background-color .2s var(--ease); }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(20px); background: var(--accent-ink); }
.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.watch-list { background: var(--tile); border-radius: 10px; overflow: hidden; }
.watch-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.watch-row:last-child { border-bottom: 0; }
.watch-row .who { flex: 1 1 260px; min-width: 0; }
.watch-row .who b { display: block; font-weight: 600; overflow-wrap: anywhere; }
.watch-row .who span { font-size: 13px; color: var(--muted); }
.watch-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 20px; border-bottom: 1px solid var(--line); font-size: 13px; color: var(--muted); }

/* ---------- alerts ---------- */
.alert-card { background: var(--tile); border-radius: 10px; padding: 18px 20px; border-left: 3px solid var(--amber); display: grid; gap: 8px; }
.alert-card.broken { border-left-color: var(--red); }
.alert-card h2 { font-size: 18px; }
.alert-card .when { font-size: 13px; color: var(--muted); }
.empty { background: var(--tile); border-radius: 10px; padding: 28px; color: var(--muted); text-align: center; }

/* ---------- tables (admin, history) ---------- */
.table-wrap { background: var(--tile); border-radius: 10px; overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th { text-align: left; font-weight: 500; font-size: 12px; color: var(--muted); padding: 12px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
td.num { font-variant-numeric: tabular-nums; }

/* ---------- admin ---------- */
.admin-top { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 22px; padding: 14px 28px; border-bottom: 1px solid var(--line); background: var(--bg-deep); }
.admin-top .tag { font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: var(--amber); color: #1A1305; }
.admin-top nav { display: flex; flex-wrap: wrap; gap: 4px; }
.admin-top nav a { padding: 7px 12px; border-radius: 6px; color: var(--text-2); text-decoration: none; font-size: 14px; }
.admin-top nav a[aria-current="page"] { background: var(--tile-2); color: var(--text); }
.admin-top .right { margin-left: auto; display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--muted); }
.admin-main { max-width: 1280px; margin: 0 auto; padding: 30px 28px 64px; display: flex; flex-direction: column; gap: 22px; }
@media (max-width: 700px) { .admin-main { padding: 22px 16px 48px; } .admin-top { padding: 12px 16px; } }
.radar-item { background: var(--tile); border-radius: 10px; padding: 18px 20px; display: grid; grid-template-columns: 140px minmax(0, 1fr) auto; gap: 18px; align-items: start; }
.radar-item h2 { font-size: 18px; margin-bottom: 4px; }
.cl-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; }
.cl-list li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; }
#changelog .page-head h2 { font-size: 20px; }
.self-hit { margin: 8px 0 0; padding: 8px 12px; border-left: 2px solid var(--amber); background: var(--tile-2); border-radius: 4px; color: var(--text-2); }
.radar-item .hits b { font-family: var(--display); font-size: 32px; font-weight: 500; line-height: 1; }
@media (max-width: 760px) { .radar-item { grid-template-columns: 1fr; gap: 8px; } }

/* ---------- public pages ---------- */
.public { min-height: 100vh; display: flex; flex-direction: column; }
.public-top { padding: 22px 28px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.public-main { flex: 1; display: flex; justify-content: center; padding: 48px 16px 64px; }
.public-card { width: 100%; max-width: 640px; display: flex; flex-direction: column; gap: 18px; }
.public-card h1 { font-size: clamp(30px, 4.4vw, 46px); letter-spacing: -0.03em; }
.public-card .lede { color: var(--text-2); font-size: 16px; }
.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.checklist li { display: flex; gap: 10px; align-items: flex-start; color: var(--text-2); }
.checklist svg { width: 16px; height: 16px; margin-top: 3px; flex: none; fill: none; stroke: var(--green); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.checklist .no svg { stroke: var(--red); }
.steps-num { counter-reset: s; list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.steps-num li { counter-increment: s; display: flex; gap: 12px; color: var(--text-2); }
.steps-num li::before { content: counter(s, decimal-leading-zero); font-family: var(--display); color: var(--accent); font-size: 15px; min-width: 22px; }
.demo-banner { background: var(--amber); color: #1A1305; text-align: center; font-size: 13px; font-weight: 600; padding: 6px 12px; }
.fineprint { font-size: 12px; color: var(--muted); }

/* ---------- brief (one page, prints well) ---------- */
.brief { max-width: 820px; margin: 0 auto; padding: 40px 24px 64px; display: flex; flex-direction: column; gap: 22px; }
.brief-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.brief h1 { font-size: clamp(30px, 4.6vw, 48px); letter-spacing: -0.035em; }
.brief .big { font-family: var(--display); font-size: clamp(20px, 2.4vw, 26px); line-height: 1.3; color: var(--text); }
.brief .big .r { color: var(--red); } .brief .big .a { color: var(--amber); }
.brief ol, .brief ul { margin: 0; padding-left: 20px; color: var(--text-2); display: grid; gap: 6px; }
.brief .box { background: var(--tile); border-radius: 10px; padding: 18px 20px; }
.brief .box h2 { font-size: 18px; margin-bottom: 10px; }
.brief .price { font-family: var(--display); font-size: 30px; letter-spacing: -0.03em; }
.brief-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: var(--gap); }
.brief .box.alert { border-left: 3px solid var(--red); }
.brief .when { color: var(--muted); white-space: nowrap; }
@media print {
  @page { margin: 12mm; }
  :root, html { background: #FFFFFF; color-scheme: light; }
  :root { --bg: #FFFFFF; --tile: #F3F6F8; --tile-2: #E9EEF2; --text: #101828; --text-2: #344054; --muted: #5B6472; --line: #DDE4EA; --line-2: #C9D3DC; }
  body { background: #FFFFFF; color: #101828; font-size: 12pt; }
  .lg-rime { fill: #101828; } .lg-pulse { stroke: #101828; } .lg-shield { stroke: #2E6E9E; } .lg-guard { fill: #2E6E9E; } .lg-flake { stroke: #2E6E9E; }
  .no-print, .demo-banner { display: none !important; }
  .brief { padding: 0; gap: 6px; max-width: none; } a { color: #101828; }
  body { font-size: 9.5pt; line-height: 1.35; }
  .brief p { margin-bottom: 6px; }
  .brief h1 { font-size: 20pt; }
  .brief .big { font-size: 12pt; line-height: 1.3; }
  .brief .box { padding: 8px 12px; break-inside: avoid; }
  .brief .box h2 { font-size: 11pt; margin-bottom: 4px; }
  .brief ol, .brief ul { gap: 2px; }
  .brief .price { font-size: 16pt; margin: 0; }
  .brief-grid { grid-template-columns: 1fr 1fr; }
  .brief .rg-logo { height: 20px; }
  .brief .big .r { color: #B42318; } .brief .big .a { color: #B54708; }
}

/* utilities (no inline styles anywhere: the CSP forbids them) */
.tile-link { text-decoration: none; color: inherit; display: block; }
.tile-link:hover { background: var(--tile-2); color: inherit; }
.inline-label { display: flex; align-items: center; gap: 10px; }
.mt { margin-top: 14px; } .my { margin: 10px 0; } .mb { margin-bottom: 12px; }
/* long API paths and names must wrap on phones */
.wf, .tl, .alert-card, .panel, .brief, .flash, .storm, .acct-card, .radar-item { overflow-wrap: anywhere; }
.cal-box { align-content: start; }
.public-card > .pill, .page-head .pill { align-self: flex-start; }

/* ---------- workflow map ---------- */
.map-stats { display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: 14px; color: var(--text-2); }
.map-stats b { font-family: var(--display); font-size: 22px; font-weight: 500; color: var(--text); margin-right: 4px; }
.map-stats .broken b { color: var(--red); } .map-stats .at_risk b { color: var(--amber); }
.map-wrap { background: var(--bg-deep); border: 1px solid var(--line); border-radius: 10px; overflow-x: auto; padding: 6px; }
.map { display: block; width: 100%; height: auto; min-width: 680px; }
.map .node-box { fill: var(--tile); stroke: var(--line-2); stroke-width: 1; transition: stroke .15s var(--ease); }
.map a:hover .node-box, .map a:focus-visible .node-box { stroke: var(--accent); stroke-width: 1.5; }
.map a:focus-visible { outline: none; }
.map .node-bar { fill: var(--green); }
.map .node.broken .node-bar { fill: var(--red); } .map .node.at_risk .node-bar { fill: var(--amber); }
.map .node-name { fill: var(--text); font: 600 13px var(--sans); }
.map .node-meta { fill: var(--muted); font: 12px var(--sans); }
.map .node-badge rect { fill: rgba(242, 180, 90, .16); } .map .node-badge text { fill: var(--amber); font: 600 11px var(--sans); }
.map .edge { fill: none; stroke: rgba(255, 255, 255, .34); stroke-width: 1.6; }
.map .edge.code { stroke-dasharray: 6 4; }
.map .edge.loop { stroke: var(--amber); }
.map .edge.risk { stroke: var(--amber); stroke-opacity: .55; }
.map .edge.blocked { stroke: var(--red); stroke-width: 2; }
.map .mk path { fill: rgba(255, 255, 255, .5); }
.map .mk-loop path, .map .mk-risk path { fill: var(--amber); } .map .mk-blocked path { fill: var(--red); }
.map .elabel rect { fill: var(--bg-deep); stroke: var(--line-2); }
.map .elabel text { fill: var(--text-2); font: 11px var(--mono); }
.map .elabel.blocked rect { stroke: var(--red); } .map .elabel.blocked text { fill: var(--red); }
.map-key { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; color: var(--muted); }
.map-key li { display: inline-flex; align-items: center; gap: 8px; }
.map-key .k { display: inline-block; width: 26px; height: 0; border-top: 2px solid rgba(255, 255, 255, .45); }
.map-key .k-code { border-top-style: dashed; } .map-key .k-loop { border-top-color: var(--amber); }
.map-key .k-blocked { border-top-color: var(--red); } .map-key .k-risk { border-top-color: rgba(242, 180, 90, .55); }
.map .edge.asset { stroke-dasharray: 2 4; } .map-key .k-asset { border-top-style: dotted; }
.map-print .map-file { display: block; width: 100%; height: auto; background: #FFFFFF; border-radius: 8px; border: 1px solid var(--line-2); }

.trouble { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 10px; }
.trouble li { font-size: 14px; }
.links-list summary { cursor: pointer; font-family: var(--display); font-size: 17px; }
.links-list ul { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; }
.links-list li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; font-size: 14px; }
.chip.plain { font-family: var(--sans); }

/* ---------- one workflow ---------- */
.connects { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px 28px; margin: 6px 0 10px; }
.connects h3 { font-size: 15px; color: var(--muted); font-family: var(--sans); font-weight: 500; margin-bottom: 6px; }
.connects ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.connects li p { margin: 2px 0 0; }
.warn-text { color: var(--amber); }
.dates { list-style: none; margin: 6px 0 10px; padding: 0; display: grid; gap: 10px; }
.page-head .pills { margin-bottom: 8px; }
.wf-link { color: inherit; text-decoration: none; }
.wf-link:hover { color: var(--accent); text-decoration: underline; }
.meta.caveat { color: var(--text-2); }
.meta.caveat b { color: var(--amber); font-weight: 600; }

/* ---------- all accounts (agencies) ---------- */
.portfolio td.num { font-family: var(--display); font-size: 20px; }
.portfolio td.num.broken { color: var(--red); } .portfolio td.num.at_risk { color: var(--amber); }
.portfolio tr.current td:first-child { box-shadow: inset 2px 0 0 var(--accent); }
@media (max-width: 760px) {
  .portfolio thead { display: none; }
  .portfolio tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 14px; padding: 14px; border-bottom: 1px solid var(--line); }
  .portfolio td { padding: 0; border: 0; }
  .portfolio td:first-child, .portfolio td:nth-child(6), .portfolio td:last-child { grid-column: 1 / -1; }
  .portfolio td[data-label]::before { content: attr(data-label); display: block; font: 12px var(--sans); color: var(--muted); }
}
/* Logs on a phone: one block per row, so "What" is never scrolled out of view. */
@media (max-width: 600px) {
  .log-table thead { display: none; }
  .log-table tr { display: grid; gap: 2px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
  .log-table td { padding: 0; border: 0; }
  .log-table td:first-child { color: var(--muted); }
}
.fleet { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 14px; }
.fleet li { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 6px 18px; }
.fleet-when { display: grid; }
@media (max-width: 600px) { .fleet li { grid-template-columns: 1fr; } }
.add-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px 28px; margin: 8px 0 12px; }
.add-grid h3 { font-size: 16px; margin-bottom: 4px; }
.inline-form { display: flex; gap: 8px; flex-wrap: wrap; }
.inline-form input { flex: 1 1 160px; min-width: 0; text-transform: uppercase; }
.acct-card a { display: inline-block; margin-top: 6px; font-size: 12px; }

/* ---------- AI-drafted fixes ---------- */
.pill.ai { background: rgba(162, 205, 239, .14); color: var(--accent); box-shadow: inset 0 0 0 1px rgba(162, 205, 239, .4); }
.ai-box { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding-top: 4px; }
.checks { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px; }
.checks li { padding-left: 24px; position: relative; font-size: 14px; }
.checks li::before { content: ""; position: absolute; left: 0; top: 5px; width: 12px; height: 12px; border-radius: 50%; background: var(--muted); }
.checks li.ok::before { background: var(--green); } .checks li.bad::before { background: var(--red); } .checks li.warn::before { background: var(--amber); }
.draft-diff { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 14px; }
.draft-diff h3 { font-size: 14px; font-family: var(--sans); font-weight: 500; color: var(--muted); margin-bottom: 6px; }
.code-block { background: var(--bg-deep); border-radius: 8px; padding: 8px 0; font: 12.5px/1.6 var(--mono); overflow-x: auto; }
.code-block .row { display: flex; gap: 12px; padding: 0 12px; white-space: pre; }
.code-block .ln { color: var(--title); min-width: 2.5ch; text-align: right; user-select: none; }
.code-block.del .row { background: rgba(240, 138, 126, .07); }
.code-block.add .row { background: rgba(143, 214, 180, .07); }
.diff-view .row { gap: 10px; }
.diff-view .row.del { background: rgba(240, 138, 126, .12); }
.diff-view .row.add { background: rgba(143, 214, 180, .12); }
.diff-view .row.del .sign { color: var(--red); } .diff-view .row.add .sign { color: var(--green); }
.diff-view .sign { width: 1ch; flex: none; user-select: none; }
.diff-view .ln { min-width: 3ch; }
.hunks { margin: 10px 0 0; padding-left: 20px; display: grid; gap: 12px; }
.steps-list > li, .hunks > li { min-width: 0; }
.hunks .code-block.hunk { margin: 8px 0; max-width: 100%; }
.brand-logo-preview { display: inline-block; vertical-align: middle; max-height: 28px; max-width: 140px; margin-left: 8px; background: #FFFFFF; border-radius: 4px; padding: 2px 4px; }
.brief-brand { display: flex; align-items: center; gap: 12px; }
.brief-brand img { max-height: 44px; max-width: 220px; object-fit: contain; }
.pay-box { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; }
.audit-list { display: grid; gap: var(--gap); margin-top: var(--gap); }
.audit-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; }
.audit-head h2 { margin: 0; }
.audit-n { font-family: var(--display); font-size: 30px; letter-spacing: -0.03em; color: var(--text); margin: 4px 0; }
.audit-row.warn .audit-n { color: var(--amber); }
.token-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; }
.token-list li { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 0; border-top: 1px solid var(--line); }
.brief-brand .name { font-family: var(--display); font-size: 20px; font-weight: 600; color: var(--text); }
.steps-list { margin: 6px 0 14px; padding-left: 20px; display: grid; gap: 6px; color: var(--text-2); }

/* Sample account (rimeguard.com/demo): switched-off controls look switched off */
[data-demo-off], .demo-form [disabled], button[disabled] { opacity: .55; cursor: not-allowed; pointer-events: none; }
.sample-banner a { color: inherit; font-weight: 700; }
