/* The public app, following docs/ux-preview/design-principles.md.
 *
 * One frame for every page: a left sidebar, a top bar with search and the account, content in the
 * middle. Petrol-navy ink on white surfaces, an ice-blue page, Mindstone blue only for modelled figures,
 * red and green only for a sign. IBM Plex Sans only; titles at 600+ with tight tracking. Shared by the app shell and
 * the server-rendered company page. */

:root { --side: 232px; --top: 60px; --gutter: 32px; --wrap: 1200px; }
body { display: block; height: auto; min-height: 100%; background: var(--bg); color: var(--ink2); font-size: var(--fs-ui); letter-spacing: -0.0015em; }
h1, h2, h3 { font-family: var(--sans); color: var(--ink); letter-spacing: -0.0075em; }
p { margin: 0 0 10px; }
a { color: var(--ink); text-decoration-color: var(--line); }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 12px; top: -48px; z-index: 100; background: var(--ink); color: var(--bg); padding: 8px 12px; border-radius: var(--r); }
.skip-link:focus { top: 8px; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); font-size: 12px; }
.num, .tnum { font-variant-numeric: tabular-nums lining-nums; }
.icon { width: 16px; height: 16px; flex: 0 0 auto; display: inline-block; vertical-align: -3px; }

/* --------------------------------------------------------------------- buttons */
button, .btn {
  border-radius: var(--r-pill); min-height: 36px; padding: 0 16px; font-weight: 600; font-size: var(--fs-ui);
  background: var(--ink); border: 1px solid var(--ink); color: var(--paper); box-shadow: none;
}
button:hover:not(:disabled), .btn:hover:not(:disabled) { background: var(--ink2); border-color: var(--ink2); color: var(--paper); box-shadow: none; }
.btn.ghost, button.ghost { background: var(--paper); color: var(--ink); border-color: var(--line); }
.btn.ghost:hover:not(:disabled), button.ghost:hover:not(:disabled) { background: var(--paper-2); color: var(--ink); border-color: var(--ink2); }
.btn.sm, button.sm { min-height: 30px; padding: 0 12px; font-size: var(--fs-cap); }
.btn.link, button.link { background: none; border: 0; padding: 0; min-height: 0; color: var(--ink); font-weight: 600; text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; border-radius: 0; }
.btn.link:hover, button.link:hover:not(:disabled) { background: none; color: var(--ink); text-decoration-color: var(--ink); }
input, select, textarea { border-radius: var(--r-ctl); border-color: var(--line); background: var(--paper); min-height: 36px; }
input:focus, select:focus, textarea:focus { border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 18%, transparent); }

/* --------------------------------------------------------------- preview strip */
#preview-strip { background: var(--navy); color: #dfe6f0; font-size: var(--fs-cap); }
#preview-strip[hidden] { display: none; }
.preview-inner { padding: 6px 16px; display: flex; gap: 6px 18px; align-items: center; flex-wrap: wrap; }
.preview-inner b { color: #fff; font-weight: 600; }
.preview-label { flex: 1 1 300px; display: flex; gap: 8px; align-items: center; }
.preview-inner label { display: flex; align-items: center; gap: 8px; color: #dfe6f0; font-size: var(--fs-cap); font-weight: 500; }
.preview-inner select { min-height: 26px; padding: 0 6px; font-size: var(--fs-cap); border-radius: 4px; background: #0b3d5c; color: #fff; border-color: #2c4670; }
.preview-inner input[type=checkbox] { min-height: 0; }
:root[data-theme="dark"] #preview-strip { background: #010d16; }

/* ----------------------------------------------------------------------- frame */
.frame { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: 100vh; }
.frame-main { min-width: 0; display: flex; flex-direction: column; }
main#view, main.page { flex: 1; width: 100%; max-width: calc(var(--wrap) + 2 * var(--gutter)); margin: 0 auto; padding: 28px var(--gutter) 56px; }

/* --------------------------------------------------------------------- sidebar */
.sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--paper); border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 14px 12px; gap: 2px; }
.side-brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 16px; text-decoration: none; color: var(--ink); }
.side-brand img { width: 28px; height: 28px; display: block; }
.side-brand b { font-size: 15px; font-weight: 700; letter-spacing: -0.005em; display: block; }
.side-brand small { display: block; font-size: 11px; color: var(--muted); font-weight: 500; letter-spacing: 0; }
.side-group { font-size: 12px; font-weight: 400; color: var(--faint); padding: 16px 10px 4px; }
.side-link { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: var(--r); color: var(--ink2); text-decoration: none; font-weight: 500; position: relative; border: 0; background: none; width: 100%; min-height: 0; font-size: var(--fs-ui); text-align: left; }
button.side-link { color: var(--ink2); }
.side-link .icon { color: var(--muted); }
.side-link:hover, button.side-link:hover:not(:disabled) { background: var(--paper-2); color: var(--ink); }
.side-link.on { background: var(--accent-soft); color: var(--ink); font-weight: 600; }
.side-link.on .icon { color: var(--ink); }
.side-link .lock { margin-left: auto; display: inline-flex; }
.side-link .lock .icon { width: 13px; height: 13px; color: var(--faint); }
.side-link.locked { color: var(--muted); }
.side-foot { margin-top: auto; padding-top: 12px; }
.plan-card { border: 1px solid var(--line); border-radius: var(--r-card); padding: 12px; background: var(--paper-2); display: grid; gap: 6px; }
.plan-card .plan-name { font-weight: 600; color: var(--ink); display: flex; justify-content: space-between; }
.plan-card p { margin: 0; font-size: var(--fs-cap); color: var(--muted); }
.plan-card .btn { justify-content: center; }
.scrim { position: fixed; inset: 0; background: var(--overlay); z-index: 84; }
.scrim[hidden] { display: none; }

/* ---------------------------------------------------------------------- topbar */
.topbar { position: sticky; top: 0; z-index: 50; height: var(--top); display: flex; align-items: center; gap: 12px; padding: 0 var(--gutter); background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.global-search { position: relative; flex: 0 1 460px; }
.global-search input { width: 100%; padding: 0 44px 0 36px; background: var(--paper); border-radius: var(--r-pill); }
.global-search > .icon { position: absolute; left: 12px; top: 10px; color: var(--muted); }
.global-search kbd { position: absolute; right: 10px; top: 8px; font: 500 11px/1 var(--sans); padding: 4px 6px; border: 1px solid var(--line); border-radius: 4px; color: var(--muted); background: var(--paper-2); }
.topbar .spacer { flex: 1; }
.icon-btn { display: inline-flex; align-items: center; flex: 0 0 auto; cursor: pointer; width: 36px; height: 36px; padding: 0; justify-content: center; background: var(--paper); color: var(--ink2); border: 1px solid var(--line); border-radius: 50%; position: relative; }
.icon-btn:hover:not(:disabled) { background: var(--paper-2); color: var(--ink); border-color: var(--ink2); }
.icon-btn .dot { position: absolute; top: -3px; right: -3px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 4px; background: var(--neg); color: #fff; font-size: 10px; font-weight: 700; display: flex; align-items: center; justify-content: center; border: 2px solid var(--bg); }
.topbar .menu-btn { display: none; }
.account-btn { cursor: pointer; display: flex; align-items: center; gap: 8px; background: none; border: 0; padding: 0 6px 0 3px; min-height: 36px; color: var(--ink); border-radius: var(--r-pill); }
.account-btn:hover:not(:disabled) { background: var(--paper-2); color: var(--ink); }
:root[data-theme="dark"] .account-btn { color: var(--ink); }
.avatar { width: 30px; height: 30px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--ink); color: var(--paper); font-size: 12px; font-weight: 700; flex: 0 0 auto; }
.header-menu { position: relative; }
.pop { position: absolute; right: 0; top: calc(100% + 8px); width: 300px; max-width: calc(100vw - 24px); background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-card); box-shadow: var(--shadow-pop); padding: 6px; z-index: 70; max-height: 72vh; overflow: auto; }
.pop[hidden] { display: none; }
.pop-head { display: flex; justify-content: space-between; align-items: center; padding: 8px 10px; font-weight: 600; color: var(--ink); }
.pop-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--r); color: var(--ink2); text-decoration: none; font-weight: 500; }
.pop-row:hover { background: var(--paper-2); color: var(--ink); }
.pop-row .icon { color: var(--muted); }
.pop hr { border: 0; border-top: 1px solid var(--line2); margin: 6px 0; }
.pop .who { padding: 10px; display: grid; gap: 2px; }
.pop .who b { color: var(--ink); }
.pop .who span { font-size: var(--fs-cap); color: var(--muted); }
.pop-group { padding: 6px 10px 2px; font-size: 11px; color: var(--faint); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.row-lock { margin-left: auto; color: var(--faint); }
.theme-seg { display: flex; gap: 4px; padding: 6px 10px 8px; }
.theme-seg button { flex: 1; min-height: 30px; padding: 0 6px; background: var(--paper-2); color: var(--ink2); border: 1px solid var(--line); font-size: var(--fs-cap); justify-content: center; border-radius: var(--r); }
.theme-seg button:hover:not(:disabled) { background: var(--accent-soft); color: var(--ink); border-color: var(--line); }
.theme-seg button[aria-checked="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.notif-list { list-style: none; margin: 0; padding: 0; }
.notif { display: grid; grid-template-columns: 22px 1fr; gap: 8px; padding: 10px; border-radius: var(--r); }
.notif:hover { background: var(--paper-2); }
.notif b { display: block; color: var(--ink); font-weight: 600; }
.notif .desc { display: block; font-size: var(--fs-cap); color: var(--muted); }
.notif-state { color: var(--model-ink); }
.notif.added .notif-state { color: var(--ok); }
.notif.unavailable .notif-state { color: var(--neg); }

/* ---------------------------------------------------------------------- footer */
footer.app-footer { border-top: 1px solid var(--line); padding: 18px var(--gutter) 28px; font-size: var(--fs-cap); color: var(--muted); }
.foot-inner { max-width: var(--wrap); margin: 0 auto; display: flex; flex-wrap: wrap; gap: 8px 22px; align-items: baseline; }
.foot-inner .disclosure { flex: 1 1 100%; color: var(--ink2); margin: 0 0 4px; }
.foot-inner a { color: var(--muted); text-decoration: none; }
.foot-inner a:hover { color: var(--ink); text-decoration: underline; }

/* ----------------------------------------------------------------- page header */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
/* IBM Carbon type, as on the landing page: page titles in Plex Light at display size, normal tracking. */
.page-title { font-size: 36px; font-weight: 300; line-height: 1.22; margin: 0; letter-spacing: 0; }
.page-sub { color: var(--muted); margin: 6px 0 0; font-size: var(--fs-text); max-width: 72ch; }
.crumbs { display: flex; gap: 6px; font-size: var(--fs-cap); color: var(--muted); margin-bottom: 8px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--ink); }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.sec-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: 0 0 12px; flex-wrap: wrap; }
.sec-head h2 { font-size: 20px; font-weight: 400; margin: 0; letter-spacing: 0; }
.sec-head .aside { font-size: var(--fs-cap); color: var(--muted); }
section.blk { margin-bottom: 32px; }

/* ---------------------------------------------------------------------- cards */
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-card); box-shadow: var(--shadow); padding: 18px 20px; margin: 0; }
.card.flush { padding: 0; overflow: hidden; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line2); flex-wrap: wrap; }
.card-head h2, .card-head h3 { font-size: var(--fs-text); font-weight: 600; margin: 0; }
.card-head .aside { font-size: var(--fs-cap); color: var(--muted); }
.card-body { padding: 16px 18px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.stack { display: grid; gap: 16px; }

/* ---------------------------------------------------------------- chips, notes */
.chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 500; padding: 2px 9px; border-radius: var(--r-pill); background: var(--paper-2); color: var(--ink2); border: 1px solid var(--line2); white-space: nowrap; }
.chip .icon { width: 12px; height: 12px; }
.chip.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.chip.warn { background: var(--warn-soft); color: var(--warn-ink); border-color: transparent; }
.chip.model { background: var(--model-soft); color: var(--model-ink); border-color: transparent; }
.chip.lock { color: var(--muted); }
.badge.sample { display: inline-flex; gap: 5px; align-items: center; font-size: 12px; font-weight: 600; color: var(--gen-ink); background: var(--gen-soft); padding: 2px 9px; border-radius: var(--r-pill); }
.badge.sample .icon { width: 12px; height: 12px; }
.note { border-radius: var(--r); background: var(--paper-2); }
.note.warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 45%, var(--line)); color: var(--warn-ink); }
.later-note { display: flex; gap: 8px; align-items: flex-start; color: var(--muted); }

/* ----------------------------------------------- locks: in place, never a page */
.locked-wrap { position: relative; min-height: 220px; }
.locked-wrap .blurred { filter: blur(5px); opacity: .55; pointer-events: none; user-select: none; }
.lock-card { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 16px; }
.lock-card > div { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-card); box-shadow: var(--shadow-pop); padding: 18px 20px; max-width: 400px; text-align: center; display: grid; gap: 8px; justify-items: center; }
.lock-card .lock-ic { width: 36px; height: 36px; border-radius: 50%; background: var(--accent-soft); display: flex; align-items: center; justify-content: center; color: var(--ink); }
.lock-card h3 { font-size: var(--fs-text); font-weight: 600; margin: 0; }
.lock-card p { margin: 0; color: var(--muted); font-size: var(--fs-ui); }
.lock-card .acts { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 4px; }
.gate { display: flex; gap: 14px; align-items: flex-start; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-card); box-shadow: var(--shadow); padding: 18px 20px; margin-bottom: 20px; }
.gate.warn { background: var(--warn-soft); border-color: transparent; }
.gate h2 { font-size: var(--fs-h2); margin: 0 0 6px; }
.gate p { max-width: 64ch; }
.gate-icon { width: 36px; height: 36px; color: var(--ink); display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.gate.warn .gate-icon { background: var(--paper); color: var(--warn-ink); }
.gate-kicker { font-size: var(--fs-cap); color: var(--muted); font-weight: 600; margin-bottom: 2px; }
.gate-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }

/* ----------------------------------------------------------------- terms, tips */
.term { border-bottom: 1px dashed var(--faint); cursor: help; }
.term:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 2px; }
.tooltip { position: absolute; z-index: 90; max-width: 300px; background: var(--ink); color: var(--paper); padding: 8px 10px; font-size: 12px; line-height: 1.45; border-radius: var(--r); box-shadow: var(--shadow-pop); pointer-events: none; }
.tooltip[hidden] { display: none; }
:root[data-theme="dark"] .tooltip { background: #e8eef5; color: var(--navy); }

/* ------------------------------------------------------------------- skeletons */
.skeleton-block { display: grid; gap: 10px; }
.skeleton { display: block; height: 12px; border-radius: 4px; background: linear-gradient(90deg, var(--line2), var(--line-faint), var(--line2)); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------------------------------------------------------------------- tables */
.table-wrap { position: relative; overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.data { width: 100%; border-collapse: separate; border-spacing: 0; font-size: var(--fs-ui); }
table.data caption { text-align: left; padding: 0 0 8px; color: var(--muted); font-size: var(--fs-cap); }
table.data th, table.data td { padding: 9px 12px; border-bottom: 1px solid var(--line2); text-align: left; }
table.data thead th { font-size: var(--fs-cap); font-weight: 500; color: var(--muted); white-space: nowrap; background: var(--paper-2); border-bottom: 1px solid var(--line); }
table.data tbody tr:last-child > * { border-bottom: 0; }
table.data .num { text-align: right; font-variant-numeric: tabular-nums lining-nums; white-space: nowrap; }
table.data tbody tr:hover > * { background: var(--paper-2); }
table.data td.neg { color: var(--neg); }
table.data td.absent { color: var(--faint); }
table.data tr.section-row > th { background: var(--paper); color: var(--ink2); font-size: var(--fs-cap); font-weight: 600; padding-top: 14px; }
table.data tr.total-row > * { font-weight: 600; color: var(--ink); background: var(--paper-2); }
table.data th[scope="row"] { font-weight: 500; color: var(--ink2); }
.unit-line { font-size: var(--fs-cap); color: var(--muted); }

/* ---------------------------------------------------------------------- forms */
.form { display: grid; gap: 14px; max-width: 520px; }
.form.wide { max-width: 760px; }
.field { display: grid; gap: 6px; }
.field label, .field .label { font-size: var(--fs-ui); font-weight: 500; color: var(--ink); }
.field .hint { font-size: var(--fs-cap); color: var(--muted); }
.field input, .field select, .field textarea { width: 100%; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.check { display: flex; gap: 8px; align-items: flex-start; font-size: var(--fs-ui); color: var(--ink2); font-weight: 400; }
.check input { min-height: 0; margin-top: 3px; }
.form-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.placeholder-box { border: 1px dashed var(--line); background: var(--paper-2); border-radius: var(--r-card); padding: 16px; color: var(--muted); }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; color: var(--ink); font-weight: 500; }
.meter { height: 6px; background: var(--line2); border-radius: 3px; overflow: hidden; margin: 8px 0 6px; }
.meter > span { display: block; height: 100%; background: var(--ink2); border-radius: 3px; }
.meter.full > span { background: var(--warn); }
.empty-state { text-align: center; padding: 36px 20px; color: var(--muted); }
.empty-state .empty-title { font-size: var(--fs-h2); font-weight: 600; color: var(--ink); margin-bottom: 6px; }
.empty-state .gate-actions { justify-content: center; }
.steps { display: flex; list-style: none; padding: 0; margin: 0 0 20px; gap: 6px; flex-wrap: wrap; counter-reset: step; }
.steps li { counter-increment: step; display: flex; align-items: center; gap: 8px; font-size: var(--fs-cap); color: var(--muted); padding: 6px 12px 6px 6px; border-radius: var(--r-pill); background: var(--paper); border: 1px solid var(--line); }
.steps li::before { content: counter(step); width: 20px; height: 20px; border-radius: 50%; background: var(--paper-2); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; color: var(--ink2); }
.steps li.done::before { background: var(--ok-soft); color: var(--ok); }
.steps li.current { color: var(--ink); font-weight: 600; border-color: var(--ink2); }
.steps li.current::before { background: var(--ink); color: var(--paper); }

/* ---------------------------------------------------------------------- toasts */
#toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 95; }
.toast { display: flex; gap: 8px; align-items: center; background: var(--ink); color: var(--paper); padding: 10px 14px; border-radius: var(--r-pill); box-shadow: var(--shadow-pop); }

/* --------------------------------------------------------------------- MiRA */
.mira-drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(420px, 100vw); z-index: 80; background: var(--paper); border-left: 1px solid var(--line); box-shadow: var(--shadow-pop); display: flex; flex-direction: column; }
.mira-drawer[hidden] { display: none; }
.drawer-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line2); }
.drawer-head h2 { font-size: var(--fs-h2); margin: 0; display: flex; gap: 8px; align-items: center; }
.drawer-body { padding: 16px 18px; overflow: auto; flex: 1; }
.drawer-body .gate { flex-direction: column; box-shadow: none; }
.drawer-h { font-size: 11px; font-weight: 600; color: var(--faint); text-transform: uppercase; letter-spacing: .06em; margin: 16px 0 8px; }
.suggestions { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 6px; }
.suggestions button { width: 100%; justify-content: flex-start; text-align: left; white-space: normal; line-height: 1.4; background: var(--paper-2); color: var(--ink2); border: 1px solid var(--line2); border-radius: var(--r); padding: 8px 10px; font-weight: 500; min-height: 0; }
.suggestions button:hover:not(:disabled) { background: var(--accent-soft); color: var(--ink); border-color: var(--line); }
.mira-thread { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 8px; }
.mira-thread .q { justify-self: end; background: var(--ink); color: var(--paper); padding: 8px 12px; border-radius: 4px 4px 4px 4px; max-width: 88%; }
.mira-thread .a { background: var(--paper-2); padding: 8px 12px; border-radius: 4px 4px 4px 4px; max-width: 92%; }
.mira-form { display: grid; gap: 8px; }
.mira-form textarea { width: 100%; resize: vertical; padding: 10px; }
.mira-form button { justify-self: end; }

/* ----------------------------------------------------------- directory (home) */
.facts-line { display: flex; flex-wrap: wrap; gap: 4px 16px; color: var(--muted); font-size: var(--fs-cap); margin-top: 8px; }
.facts-line b { color: var(--ink2); font-weight: 600; }
.seg { display: inline-flex; background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--r-pill); padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { background: none; border: 0; color: var(--ink2); min-height: 30px; padding: 0 12px; font-weight: 500; border-radius: var(--r-pill); }
.seg button:hover:not(:disabled) { background: var(--paper); color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--paper); color: var(--ink); font-weight: 600; box-shadow: var(--shadow); }
.seg .n { color: var(--faint); font-weight: 500; margin-left: 4px; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 12px 14px; border-bottom: 1px solid var(--line2); }
.toolbar select { min-height: 32px; border-radius: var(--r-pill); padding: 0 12px; max-width: 220px; }
.toolbar .spacer { flex: 1; }
.local-search { position: relative; flex: 0 1 280px; }
.local-search input { width: 100%; padding-left: 34px; border-radius: var(--r-pill); min-height: 32px; }
.local-search .icon { position: absolute; left: 12px; top: 8px; color: var(--muted); }
table.dir { table-layout: fixed; }
table.dir td { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; }
table.dir tbody tr { cursor: pointer; }
.inc-cell { display: grid; gap: 4px; justify-items: end; }
.inc-track { position: relative; display: block; width: 100%; max-width: 110px; height: 4px; background: var(--line2); overflow: hidden; }
.inc-track b { position: absolute; left: 0; top: 0; bottom: 0; background: var(--model); }
table.dir .co { display: flex; align-items: center; gap: 10px; min-width: 0; }
.logo-sm { width: 22px; height: 22px; object-fit: contain; background: #fff; border: 1px solid var(--line, rgba(0,0,0,.12)); border-radius: 4px; padding: 1px; vertical-align: middle; margin-right: 8px; }
.co-mark.has-logo { background: #fff; overflow: hidden; }
.co-mark.has-logo img { width: 100%; height: 100%; object-fit: contain; padding: 2px; }
/* Initials sit in the same white square as a logo, so a list of both reads as one set. */
.co-mark { width: 30px; height: 30px; border-radius: var(--r); background: var(--paper); border: 1px solid var(--line); color: var(--ink2); display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 500; flex: 0 0 auto; }
table.dir .co-text { min-width: 0; }
table.dir .co-text a { display: block; color: var(--ink); font-weight: 600; text-decoration: none; overflow: hidden; text-overflow: ellipsis; }
table.dir .co-text small { display: block; color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; }
table.dir th button.sort { background: none; border: 0; padding: 0; min-height: 0; color: inherit; font: inherit; text-transform: inherit; letter-spacing: inherit; display: inline-flex; gap: 4px; align-items: center; border-radius: 0; }
table.dir th button.sort:hover:not(:disabled) { background: none; color: var(--ink); }
table.dir th button.sort .icon { width: 12px; height: 12px; color: var(--faint); }
table.dir th button.sort:hover .icon, table.dir th button.sort.on .icon { color: var(--ink); }
table.dir th button.sort.on { color: var(--ink); }
table.dir col.c-band { width: 160px; } table.dir col.c-state { width: 150px; } table.dir col.c-years { width: 120px; } table.dir col.c-income { width: 160px; }
.sort-menu { position: relative; display: inline-flex; align-items: center; }
.sort-menu .icon { position: absolute; left: 10px; width: 14px; height: 14px; color: var(--muted); pointer-events: none; }
.toolbar .sort-menu select { padding-left: 30px; }
/* Recently opened: each company's reading, the curve's shape and its main driver. */
.rc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.rc { display: grid; gap: 10px; align-content: start; padding: 16px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-card); color: var(--ink2); text-decoration: none; transition: border-color .12s; min-width: 0; }
.rc:hover { border-color: var(--ink); text-decoration: none; }
.rc-head { display: flex; gap: 10px; align-items: center; min-width: 0; }
.rc-name { min-width: 0; }
.rc-name b, .rc-name small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rc-name b { color: var(--ink); font-weight: 600; }
.rc-name small { color: var(--muted); font-size: var(--fs-cap); }
.rc-fig { display: flex; align-items: baseline; gap: 8px; }
.rc-fig b { font-size: 36px; font-weight: 300; line-height: 1; color: var(--ink); font-variant-numeric: lining-nums tabular-nums; }
.rc-fig small { color: var(--muted); font-size: var(--fs-cap); }
.rc-path { width: 100%; height: 32px; display: block; }
.rc-path polyline { fill: none; stroke: var(--model); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.rc-foot { display: grid; gap: 2px; color: var(--muted); font-size: var(--fs-cap); }
.rc-foot span { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
section.recent { margin-bottom: 24px; }
.listed { display: inline-block; font-size: 11px; font-weight: 600; color: var(--model-ink); background: var(--model-soft); padding: 0 6px; border-radius: 4px; margin-left: 6px; vertical-align: 1px; }
.dir-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 14px; border-top: 1px solid var(--line2); color: var(--muted); font-size: var(--fs-cap); flex-wrap: wrap; }
.typeahead { position: absolute; left: 0; right: 0; top: calc(100% + 6px); background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-card); box-shadow: var(--shadow-pop); z-index: 60; list-style: none; margin: 0; padding: 6px; max-height: 380px; overflow: auto; }
.typeahead[hidden] { display: none; }
.typeahead li { padding: 8px 10px; border-radius: var(--r); cursor: pointer; display: flex; justify-content: space-between; gap: 12px; }
.typeahead li[aria-selected="true"], .typeahead li:hover { background: var(--paper-2); }
.ta-name { color: var(--ink); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ta-meta { color: var(--muted); font-size: 12px; white-space: nowrap; }
.typeahead mark { background: var(--model-soft); color: inherit; border-radius: 2px; }
.no-results { padding: 28px 20px; text-align: center; }
.no-results h3 { margin: 0 0 6px; }
.visitor-band { display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; background: var(--ink); color: #dfe6f0; border-radius: var(--r-card); padding: 16px 20px; margin-bottom: 20px; }
.visitor-band b { color: #fff; font-size: var(--fs-text); }
.visitor-band p { margin: 2px 0 0; }
.visitor-band .btn { background: #fff; color: var(--ink); border-color: #fff; }
:root[data-theme="dark"] .visitor-band { background: var(--paper-2); color: var(--ink2); }
:root[data-theme="dark"] .visitor-band b { color: var(--ink); }

/* -------------------------------------------------------------------- pricing */
.plans { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 28px; }
.plan { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-card); padding: 18px; display: flex; flex-direction: column; gap: 10px; box-shadow: var(--shadow); }
.plan.current { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink), var(--shadow); }
.plan h2 { font-size: var(--fs-text); margin: 0; display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.price { font-size: 32px; font-weight: 300; color: var(--ink); letter-spacing: 0; line-height: 1.1; }
.price small { display: block; font-size: 12px; color: var(--muted); font-weight: 400; letter-spacing: 0; margin-top: 4px; }
.plan ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; font-size: var(--fs-ui); }
.plan li { display: flex; gap: 6px; align-items: flex-start; }
.plan li .icon { color: var(--ok); width: 14px; height: 14px; margin-top: 2px; }
.plan .btn, .plan button { margin-top: auto; justify-content: center; }
/* The plans, one design wherever they appear: the landing page (public_site.pricing_block) and the app's
   pricing page (pages/billing.js). Monthly or yearly is a pair of radio inputs read by :has(), so it works
   with no script. The recommended plan is the navy card; enterprise is a band under the three. */
.px { display: grid; gap: 22px; }
.px-cycle { justify-self: center; display: inline-flex; padding: 4px; gap: 2px; border-radius: 4px; background: var(--paper-2); border: 1px solid var(--line2); }
.px-cycle label { display: inline-flex; align-items: center; gap: 8px; padding: 8px 18px; border-radius: 4px; cursor: pointer; font-weight: 600; font-size: 14px; color: var(--muted); transition: background .2s, color .2s, box-shadow .2s; }
.px-cycle input:checked + label { background: var(--paper); color: var(--ink); box-shadow: 0 1px 2px rgba(3, 31, 48, .12), 0 4px 12px -4px rgba(3, 31, 48, .18); }
.px-cycle input:focus-visible + label { outline: 2px solid var(--focus); outline-offset: 2px; }
.px-save { font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 4px; background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); }
.px:has(.px-y:checked) .px-m-only, .px:not(:has(.px-y:checked)) .px-y-only { display: none !important; }

.px-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: stretch; }
.px-card { position: relative; display: flex; flex-direction: column; padding: 28px; border-radius: 4px; background: var(--paper); border: 1px solid var(--line);
  box-shadow: 0 1px 2px rgba(3, 31, 48, .05); transition: transform .25s cubic-bezier(.2, .8, .2, 1), box-shadow .25s, border-color .25s; }
.px-card:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--model) 40%, var(--line)); box-shadow: 0 24px 48px -28px rgba(3, 31, 48, .35); }
.px-head { display: flex; align-items: center; gap: 10px; min-height: 26px; }
.px-name { margin: 0; font-size: 20px; font-weight: 400; letter-spacing: 0; color: var(--ink); }
.px-badge { margin-left: auto; font-size: 11.5px; font-weight: 600; padding: 3px 10px; border-radius: 4px; color: #fff; background: linear-gradient(90deg, var(--cyan), var(--violet)); }
.px-tag { margin-left: auto; font-size: 11.5px; font-weight: 600; padding: 3px 10px; border-radius: 4px; background: var(--paper-2); color: var(--ink2); border: 1px solid var(--line); }
.px-soon { background: color-mix(in srgb, var(--violet) 12%, var(--paper)); color: color-mix(in srgb, var(--violet) 80%, var(--ink)); border-color: color-mix(in srgb, var(--violet) 30%, transparent); }
.px-for { margin: 4px 0 0; font-size: 14px; color: var(--muted); }
.px-price { display: flex; align-items: baseline; gap: 6px; margin-top: 22px; }
.px-amt { font-size: 48px; line-height: 1.1; font-weight: 300; letter-spacing: 0; color: var(--ink); font-variant-numeric: tabular-nums; }
.px-per { font-size: 14px; color: var(--muted); }
.px-bill { margin: 8px 0 0; min-height: 20px; font-size: 13px; color: var(--muted); }
.px-cta { margin-top: 22px; width: 100%; justify-content: center; min-height: 44px; font-size: 15px; }
.px-inc { margin: 26px 0 12px; padding-top: 20px; border-top: 1px solid var(--line2); font-size: 13px; font-weight: 600; color: var(--ink); }
.px-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 11px; }
.px-list li { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 10px; font-size: 14.5px; line-height: 1.4; color: var(--ink2); }
.px-list .icon { width: 16px; height: 16px; margin-top: 2px; color: var(--model-ink); }

/* the recommended plan: navy, lit from above, with the brand's two colours as its edge */
.px-card.px-feat { color: #c6d7e4; border: 1px solid transparent; z-index: 1;
  background: radial-gradient(420px 220px at 50% -40px, rgba(69, 183, 250, .28), transparent 70%) padding-box,
              linear-gradient(180deg, #06324d, #031f30) padding-box,
              linear-gradient(140deg, var(--cyan), var(--violet) 60%, rgba(129, 98, 251, .2)) border-box;
  box-shadow: 0 30px 60px -30px rgba(3, 31, 48, .65), 0 0 0 6px color-mix(in srgb, var(--cyan) 8%, transparent); }
.px-card.px-feat:hover { box-shadow: 0 40px 70px -30px rgba(3, 31, 48, .7), 0 0 0 6px color-mix(in srgb, var(--cyan) 12%, transparent); }
.px-feat .px-name, .px-feat .px-amt, .px-feat .px-inc { color: #fff; }
.px-feat .px-for, .px-feat .px-per, .px-feat .px-bill { color: #a9c0d2; }
.px-feat .px-inc { border-top-color: rgba(214, 238, 253, .14); }
.px-feat .px-list li { color: #d6e4ee; }
.px-feat .px-list .icon { color: #7cc8f7; }
.px-feat .px-cta { background: #fff; color: #031f30; border-color: #fff; }
.px-feat .px-cta:hover:not(:disabled) { background: #d6eefd; border-color: #d6eefd; color: #031f30; }
.px-card.px-current { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }

/* enterprise: one band, two plans */
.px-ent { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 0; border-radius: 4px; overflow: hidden; border: 1px solid var(--line); background: var(--paper); }
.px-ent-copy { display: grid; align-content: start; gap: 8px; padding: 28px; background: linear-gradient(160deg, var(--paper-2), var(--paper)); border-right: 1px solid var(--line2); }
.px-ent-k { font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--model-ink); }
.px-ent-copy h3 { margin: 0; font-size: 22px; letter-spacing: -0.02em; color: var(--ink); }
.px-ent-copy p { margin: 0; color: var(--muted); font-size: 14.5px; line-height: 1.5; }
.px-ent-copy .btn { justify-self: start; margin-top: 10px; }
.px-ent-plans { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.px-ent-plan { padding: 28px; display: grid; align-content: start; gap: 4px; }
.px-ent-plan + .px-ent-plan { border-left: 1px solid var(--line2); }
.px-ent-plan .px-price { margin-top: 10px; }
.px-ent-plan .px-amt { font-size: 30px; }
.px-ent-plan .px-list { margin-top: 16px; gap: 9px; }
.px-ent-plan .px-list li { font-size: 13.5px; }
.px-fine { margin: 0; text-align: center; font-size: 13px; color: var(--muted); }
.px-gap { height: 28px; }

:root[data-theme="dark"] .px-cycle input:checked + label { background: #12405c; }
@media (max-width: 980px) {
  .px-grid { grid-template-columns: minmax(0, 1fr); max-width: 520px; margin: 0 auto; width: 100%; }
  .px-ent { grid-template-columns: minmax(0, 1fr); max-width: 520px; margin: 0 auto; width: 100%; }
  .px-ent-copy { border-right: 0; border-bottom: 1px solid var(--line2); }
}
@media (max-width: 560px) {
  .px-card, .px-ent-copy, .px-ent-plan { padding: 22px; }
  .px-ent-plans { grid-template-columns: minmax(0, 1fr); }
  .px-ent-plan + .px-ent-plan { border-left: 0; border-top: 1px solid var(--line2); }
  .px-amt { font-size: 38px; }
}

table.compare th, table.compare td { text-align: center; }
table.compare th:first-child, table.compare td:first-child { text-align: left; }
table.compare .no { color: var(--faint); }
.fine { font-size: var(--fs-cap); color: var(--muted); }

/* ------------------------------------------------------------------- prose */
.prose { max-width: 72ch; font-size: var(--fs-text); line-height: 1.65; color: var(--ink2); }
.prose h2 { font-size: var(--fs-h2); margin: 26px 0 8px; }
.prose h3 { font-size: var(--fs-text); margin: 18px 0 6px; }
.prose ul, .prose ol { padding-left: 22px; }
.counsel { background: var(--warn-soft); color: var(--warn-ink); border-radius: var(--r); padding: 10px 14px; margin: 0 0 20px; max-width: 72ch; }

/* ================================================================== company page */
.co-header { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-card); box-shadow: var(--shadow); padding: 20px 22px 0; margin-bottom: 20px; }
.co-top { display: flex; gap: 16px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; }
.co-id { display: flex; gap: 14px; align-items: flex-start; min-width: 0; flex: 1 1 420px; }
.co-avatar.has-logo { background: #fff; border: 1px solid var(--line, rgba(0,0,0,.12)); overflow: hidden; }
.co-avatar.has-logo img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }
.co-avatar { width: 48px; height: 48px; border-radius: 4px; background: var(--ink); color: var(--paper); display: flex; align-items: center; justify-content: center; font-weight: 500; font-size: 18px; flex: 0 0 auto; letter-spacing: 0; }
.co-id h1 { font-size: 32px; font-weight: 300; letter-spacing: 0; line-height: 1.22; margin: 0 0 8px; overflow-wrap: anywhere; }
.co-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0; padding: 0; list-style: none; }
.co-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.co-prov { display: flex; flex-wrap: wrap; gap: 4px 18px; align-items: center; color: var(--muted); font-size: var(--fs-cap); margin: 14px 0 0; padding: 10px 0; border-top: 1px solid var(--line2); }
.co-prov b { color: var(--ink2); font-weight: 600; }
.co-prov .status { display: inline-flex; align-items: center; gap: 6px; color: var(--ok); font-weight: 600; }
.co-prov .status::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }
.co-prov .links { margin-left: auto; display: flex; gap: 14px; }
.soon { background: none; border: 0; padding: 0; min-height: 0; color: var(--ink2); font-weight: 500; font-size: var(--fs-cap); text-decoration: underline; text-decoration-style: dotted; text-underline-offset: 3px; border-radius: 0; }
.soon:hover:not(:disabled) { background: none; color: var(--ink); }
:root[data-theme="dark"] .soon { color: var(--ink2); }
.co-tabs { display: flex; gap: 22px; overflow-x: auto; margin: 0 -22px; padding: 0 22px; border-top: 1px solid var(--line2); scrollbar-width: none; }
.co-tabs a { padding: 12px 0; color: var(--muted); text-decoration: none; font-weight: 500; white-space: nowrap; position: relative; display: inline-flex; gap: 5px; align-items: center; }
.co-tabs a:hover { color: var(--ink); }
.co-tabs a.on { color: var(--ink); font-weight: 600; }
.co-tabs a.on::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--ink); border-radius: 2px; }
.co-tabs .icon { width: 12px; height: 12px; color: var(--faint); }
.co-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
.co-main { display: grid; gap: 20px; min-width: 0; }
.co-main > section { scroll-margin-top: calc(var(--top) + 16px); }
.co-side { display: grid; gap: 16px; position: sticky; top: calc(var(--top) + 16px); }

.risk { display: grid; grid-template-columns: 260px minmax(0, 1fr); }
.risk-figure { padding: 20px 22px; border-right: 1px solid var(--line2); display: grid; gap: 6px; align-content: start; }
.risk-figure .label { font-size: var(--fs-cap); color: var(--muted); font-weight: 500; }
.risk-figure .value { font-size: 56px; font-weight: 300; letter-spacing: 0; line-height: 1; color: var(--model-ink); font-variant-numeric: tabular-nums; }
.risk-figure .sub { color: var(--ink2); font-size: var(--fs-ui); line-height: 1.5; margin: 6px 0 0; }
.risk-figure .not-rating { font-size: var(--fs-cap); color: var(--muted); margin: 4px 0 0; }
.chart-box { padding: 16px 18px 12px; min-width: 0; }
.chart-box svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart-box .axis text { font: 11px var(--sans); fill: var(--muted); }
.chart-box .lbl { font: 11px var(--sans); fill: var(--faint); }
.chart-box .val { font: 600 12px var(--sans); fill: var(--ink); }
.chart-box .grid line { stroke: var(--line2); }
.chart-box .line { stroke: var(--model-ink); stroke-width: 2.25; fill: none; stroke-linecap: round; }
.chart-box .line.indicative { stroke-dasharray: 5 5; }
.chart-box .area { fill: url(#risk-gradient); }
.chart-box .pt { fill: var(--model-ink); stroke: var(--paper); stroke-width: 2.5; }
.chart-box .pt.indicative { fill: var(--paper); stroke: var(--model-ink); stroke-width: 2; }
.chart-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: var(--fs-cap); color: var(--muted); margin: 8px 0 0; }
.chart-legend span { display: inline-flex; gap: 6px; align-items: center; }
.sw-line { width: 16px; height: 0; border-top: 2px solid var(--model-ink); display: inline-block; }
.sw-line.dash { border-top-style: dashed; }
.limits { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--line2); }
.limit { padding: 12px 18px; }
.limit + .limit { border-left: 1px solid var(--line2); }
.limit .k { font-size: var(--fs-cap); color: var(--muted); }
.limit .v { font-weight: 600; color: var(--ink); margin-top: 2px; }
details.alt { border-top: 1px solid var(--line2); }
details.alt summary { cursor: pointer; padding: 12px 18px; font-weight: 500; color: var(--ink2); }
details.alt .table-wrap { padding: 0 6px 6px; }

/* the reading: what the figures add up to, under the figure and the curve */
.signals { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--line2); }
.sig { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 8px; padding: 14px 16px; align-items: start; }
.sig + .sig { border-left: 1px solid var(--line2); }
.sig b { display: block; color: var(--ink); font-weight: 600; font-size: 13px; line-height: 1.35; }
.sig small { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; line-height: 1.45; font-variant-numeric: tabular-nums; }
.sig-mark { display: grid; place-items: center; width: 18px; height: 18px; margin-top: 1px; border-radius: 2px; }
.sig-mark .icon { width: 12px; height: 12px; }
.sig.up .sig-mark { background: var(--neg-soft); color: var(--neg); }
.sig.down .sig-mark { background: var(--ok-soft); color: var(--ok); }
.sig.flat .sig-mark { background: var(--paper-2); }
.flat-mark { width: 8px; height: 2px; background: var(--muted); }

/* drivers: the model's three largest, then pushing up and holding down, side by side */
.top-drivers { display: flex; align-items: center; gap: 8px 16px; flex-wrap: wrap; padding: 10px 18px; border-bottom: 1px solid var(--line2); font-size: 12px; color: var(--muted); }
.top-drivers ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; }
.top-drivers li { display: inline-flex; align-items: baseline; gap: 6px; color: var(--ink2); font-size: 12.5px; }
.top-drivers .n { font: 600 11px var(--mono); color: var(--neg); }
.top-drivers li b { font-variant-numeric: tabular-nums; color: var(--ink); }
.cs-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cs-col + .cs-col { border-left: 1px solid var(--line2); }
.cs-col h3 { display: flex; align-items: center; gap: 8px; margin: 0; padding: 12px 18px; font-size: 13px; border-bottom: 1px solid var(--line2); background: var(--paper-2); }
.cs-col h3 small { margin-left: auto; font-weight: 400; color: var(--muted); font-size: 12px; }
.cs-col h3 .icon { width: 13px; height: 13px; }
.cs-col.concerns h3 .icon { color: var(--neg); }
.cs-col.strengths h3 .icon { color: var(--model-ink); }
.cs-list { list-style: none; margin: 0; padding: 0; }
.cs-list li { display: grid; grid-template-columns: minmax(0, 1fr) 128px; gap: 14px; align-items: center; padding: 11px 18px; border-bottom: 1px solid var(--line-faint); }
.cs-list li:last-child { border-bottom: 0; }
.cs-name > b { display: block; color: var(--ink); font-weight: 600; font-size: 13px; }
.cs-list .facts { display: flex; flex-wrap: wrap; gap: 2px 12px; font-size: 12px; color: var(--muted); margin-top: 3px; font-variant-numeric: tabular-nums; }
.cs-list .facts b { color: var(--ink2); font-weight: 600; }
.cs-side.bad { color: var(--neg); font-weight: 500; } .cs-side.good { color: var(--model-ink); font-weight: 500; }
.cs-share { display: grid; gap: 4px; font-size: 12px; color: var(--ink2); font-variant-numeric: tabular-nums; }
.cs-share small { color: var(--muted); }
.cs-bar { display: block; height: 6px; background: var(--line-faint); border-radius: 1px; overflow: hidden; }
.cs-bar i { display: block; height: 100%; }
.concerns .cs-bar i { background: color-mix(in srgb, var(--neg) 75%, var(--paper)); }
.strengths .cs-bar i { background: var(--ok); }
.cs-list .none { display: block; color: var(--muted); }

/* statements: lines with no figure in any year are folded away */
.stmt .empty-row { display: none; }
.card:has(.show-empty:checked) .stmt .empty-row { display: table-row; }
.empty-toggle { display: flex; align-items: center; gap: 6px; padding: 8px 18px; font-size: var(--fs-cap); color: var(--muted); border-bottom: 1px solid var(--line2); cursor: pointer; }
.empty-toggle input { min-height: 0; }
.soon-links { display: flex; gap: 14px; flex-wrap: wrap; color: var(--muted); }

.kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kpi { padding: 14px 18px; display: flex; justify-content: space-between; align-items: baseline; gap: 10px; border-bottom: 1px solid var(--line2); }
.kpi:nth-child(3n+2), .kpi:nth-child(3n+3) { border-left: 1px solid var(--line2); }
.kpi-name { color: var(--ink2); min-width: 0; }
.kpi-right { text-align: right; flex: 0 0 auto; }
.kpi-value { font-weight: 600; color: var(--ink); font-size: 15px; font-variant-numeric: tabular-nums; }
.kpi-change { display: block; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.kpi-change.good { color: var(--ok); }
.kpi-change.bad { color: var(--neg); }
.kpi-change .icon { width: 11px; height: 11px; vertical-align: -1px; }

.share { display: grid; gap: 5px; font-size: 12px; color: var(--muted); text-align: right; }
.share b { color: var(--ink); }
.share-bar { height: 6px; background: var(--line2); border-radius: 3px; overflow: hidden; }
.share-bar > span { display: block; height: 100%; background: var(--model-ink); border-radius: 3px; }


.stmt th:first-child, .stmt td:first-child { position: sticky; left: 0; z-index: 1; background: var(--paper); min-width: 230px; }
.stmt thead th:first-child { background: var(--paper-2); }
.stmt tr.total-row > th:first-child { background: var(--paper-2); }
.stmt tbody tr:hover > th:first-child { background: var(--paper-2); }
.stmt.recent-only .older { display: none; }
.checks { display: flex; gap: 6px 18px; flex-wrap: wrap; font-size: var(--fs-cap); color: var(--ink2); margin: 0; padding: 12px 18px; list-style: none; border-top: 1px solid var(--line2); }
.checks li { display: flex; gap: 6px; align-items: center; }
.checks .ok .icon { color: var(--ok); }
.checks .bad .icon { color: var(--neg); }

.action-list { list-style: none; margin: 0; padding: 6px; }
.action { display: flex; gap: 10px; align-items: center; padding: 9px 10px; border-radius: var(--r); color: var(--ink2); text-decoration: none; width: 100%; background: none; border: 0; min-height: 0; font-weight: 500; text-align: left; font-size: var(--fs-ui); }
button.action { color: var(--ink2); }
:root[data-theme="dark"] button.action { color: var(--ink2); }
.action:hover, button.action:hover:not(:disabled) { background: var(--paper-2); color: var(--ink); }
.action .icon { color: var(--muted); }
.action .tail { margin-left: auto; font-size: 11px; color: var(--faint); display: inline-flex; gap: 4px; align-items: center; white-space: nowrap; }
.action .tail .icon { width: 12px; height: 12px; color: var(--faint); }
.about { display: grid; gap: 10px; font-size: var(--fs-ui); }
.about p { margin: 0; }
.disclaimer { font-size: 12px; color: var(--muted); line-height: 1.55; }

/* ----------------------------------------------------------------- responsive */
@media (max-width: 1180px) {
  .co-grid { grid-template-columns: minmax(0, 1fr); }
  .co-side { position: static; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
  .plans { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 960px) {
  :root { --gutter: 20px; }
  .frame { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; z-index: 85; left: 0; top: 0; bottom: 0; width: 264px; transform: translateX(-105%); transition: transform .18s ease-out; box-shadow: var(--shadow-pop); }
  .sidebar.open { transform: none; }
  .topbar .menu-btn { display: inline-flex; }
  .risk { grid-template-columns: minmax(0, 1fr); }
  .risk-figure { border-right: 0; border-bottom: 1px solid var(--line2); }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi:nth-child(3n+2), .kpi:nth-child(3n+3) { border-left: 0; }
  .kpi:nth-child(2n) { border-left: 1px solid var(--line2); }
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .signals { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sig:nth-child(3) { border-left: 0; }
  .sig:nth-child(n+3) { border-top: 1px solid var(--line2); }
}
@media (max-width: 640px) {
  :root { --gutter: 16px; --fs-title: 24px; }
  .page-title { font-size: 28px; }
  /* Recently opened becomes one swipeable row, so the list still starts on the first screen. */
  .rc-grid { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 78%; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 4px; }
  .rc { scroll-snap-align: start; }
  .rc-fig b { font-size: 30px; }
  .global-search kbd, .account-name { display: none; }
  .grid-2, .grid-3, .cs-cols, .field-row, .limits { grid-template-columns: 1fr; }
  .limit + .limit { border-left: 0; border-top: 1px solid var(--line2); }
  .kpis { grid-template-columns: 1fr; }
  .kpi:nth-child(2n) { border-left: 0; }
  .plans { grid-template-columns: 1fr; }
  .signals { grid-template-columns: 1fr; }
  .sig + .sig { border-left: 0; border-top: 1px solid var(--line2); }
  .cs-col + .cs-col { border-left: 0; border-top: 1px solid var(--line2); }
  .cs-list li { grid-template-columns: minmax(0, 1fr) 96px; }
  .co-header { padding: 16px 16px 0; }
  .co-tabs { margin: 0 -16px; padding: 0 16px; }
  .co-id h1 { font-size: 26px; }
  .co-avatar { width: 40px; height: 40px; font-size: 15px; }
  .co-prov .links { margin-left: 0; }
  .risk-figure .value { font-size: 40px; }
  table.dir { table-layout: auto; }
  table.dir col { width: auto !important; }
  table.dir .h-band, table.dir td.band, table.dir .h-state, table.dir .h-years, table.dir td.state, table.dir td.years { display: none; }
  table.dir td { white-space: normal; }
  table.dir .co-text a { white-space: normal; }
  .seg { border-radius: var(--r-card); }
  .topbar .upgrade { display: none; }
  .gate { flex-direction: column; }
  .toolbar select { max-width: 100%; flex: 1 1 140px; }
}
@media (prefers-reduced-motion: reduce) { .skeleton { animation: none; } .sidebar { transition: none; } }
@media print { .sidebar, .topbar, #preview-strip, .co-side, footer.app-footer { display: none !important; } .frame { display: block; } }
.page-title::after { content: none; display: none; }
.toolbar .seg { flex: 1 1 100%; }
.toolbar .spacer { display: none; }

/* ------------------------------------------------- script-free company page frame */
details.header-menu > summary { list-style: none; cursor: pointer; }
details.header-menu > summary::-webkit-details-marker { display: none; }
details.header-menu:not([open]) > .pop { display: none; }
.nav-toggle-box { position: absolute; opacity: 0; pointer-events: none; }
.scrim-label { display: none; }
.preview-links { display: flex; gap: 4px 10px; align-items: center; flex-wrap: wrap; }
.preview-links a { color: #dfe6f0; text-decoration: none; padding: 2px 8px; border-radius: var(--r-pill); }
.preview-links a:hover { background: #0b3d5c; }
.preview-links a[aria-current] { background: var(--paper); color: var(--ink); font-weight: 600; }
.years-toggle { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-cap); color: var(--ink2); font-weight: 500; cursor: pointer; }
.years-toggle input { min-height: 0; }
.co-main:has(.all-years:checked) .stmt.recent-only .older { display: table-cell; }
span.soon { cursor: help; }
span.action[aria-disabled="true"] { color: var(--faint); cursor: default; }
span.action[aria-disabled="true"]:hover { background: none; color: var(--faint); }
@media (max-width: 960px) {
  .frame:has(~ * #nav-toggle:checked) .sidebar, #nav-toggle:checked ~ .frame .sidebar { transform: none; }
  #nav-toggle:checked ~ .frame .scrim-label { display: block; position: fixed; inset: 0; background: var(--overlay); z-index: 84; }
}

/* ------------------------------------------------------------------ auth */
.auth { max-width: 420px; margin: 24px auto; }
.auth-card { display: grid; gap: 12px; padding: 28px; }
.auth-card .page-title { font-size: 22px; }
.auth-card .form { max-width: none; }
.auth-foot, .auth-switch { text-align: center; margin-top: 12px; }
button.wide, .btn.wide { width: 100%; justify-content: center; }
.or { display: flex; align-items: center; gap: 10px; color: var(--faint); font-size: var(--fs-cap); }
.or::before, .or::after { content: ''; flex: 1; border-top: 1px solid var(--line2); }

/* ------------------------------------------------------------------ legal */
.legal-layout { display: grid; grid-template-columns: 200px minmax(0, 1fr); min-width: 0; gap: 28px; align-items: start; }
.legal-nav { display: grid; gap: 2px; position: sticky; top: calc(var(--top) + 16px); }
.legal-nav a { padding: 6px 10px; border-radius: var(--r); color: var(--ink2); text-decoration: none; }
.legal-nav a:hover { background: var(--paper-2); }
.legal-nav a.on { background: var(--accent-soft); color: var(--ink); font-weight: 600; }
@media (max-width: 760px) { .legal-layout { grid-template-columns: minmax(0, 1fr); } .legal-nav { position: static; display: flex; flex-wrap: wrap; } }
.status-line { display: flex; gap: 8px; align-items: center; font-size: var(--fs-text); }
.status-line.ok .icon { color: var(--ok); }
.status-line.bad .icon { color: var(--neg); }
.band-inline { display: none; }
@media (max-width: 640px) { .band-inline { display: inline; } }

/* Visitors inside /app (sign-in, pricing, legal): the public site's frame, no platform chrome. */
body.public-mode { background: var(--paper); }
body.public-mode .frame { display: block; }
body.public-mode .sidebar, body.public-mode .scrim, body.public-mode .mira-drawer { display: none !important; }
body.public-mode .topbar { position: sticky; top: 0; height: auto; padding: 0; display: block; background: color-mix(in srgb, var(--paper) 92%, transparent); border-bottom: 1px solid var(--line2); }
body.public-mode footer.app-footer { background: var(--bg); border-top: 1px solid var(--line2); padding: 40px 0 28px; font-size: var(--fs-ui); }
body.public-mode main#view { max-width: 1160px; padding: 32px 24px 64px; }

/* Coverage note (India only) on pricing and other pages that set expectations. */
.scope-note { display: flex; align-items: flex-start; gap: 8px; margin: -4px 0 18px; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--paper); color: var(--ink2); font-size: var(--fs-cap); }
.scope-note svg { width: 16px; height: 16px; flex: 0 0 auto; margin-top: 1px; color: var(--muted); }

/* Pricing: the full report's contents, folded. */
.report-contents summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.report-contents summary::-webkit-details-marker { display: none; }
.report-contents summary h3 { margin: 0; }
.report-contents summary::after { content: 'Show'; color: var(--ink2); font-size: var(--fs-cap); font-weight: 600; text-decoration: underline; }
.report-contents[open] summary::after { content: 'Hide'; }
.toc-app { margin: 14px 0 8px; padding-left: 22px; display: grid; gap: 8px; }
.toc-app li b { color: var(--ink); display: block; }
.toc-app li span { color: var(--ink2); font-size: var(--fs-cap); }

/* export to Excel: the file, its sheets, one button */
.xl { display: grid; gap: 14px; }
.xl-file { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--paper-2); }
.xl-file > .icon { width: 32px; height: 32px; color: #1d6f42; flex: none; }
.xl-file b { display: block; color: var(--ink); font-size: 14px; word-break: break-all; }
.xl-file small { color: var(--muted); font-size: 12px; }
.xl-file button { margin-left: auto; display: inline-flex; gap: 6px; align-items: center; }
.xl-sheets { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); border: 1px solid var(--line2); border-radius: var(--r-card); }
.xl-sheets li { display: grid; gap: 2px; padding: 10px 14px; border-right: 1px solid var(--line2); }
.xl-sheets li:last-child { border-right: 0; }
.xl-sheets span { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }


/* Reports: each recent company's reading beside its report, PDF and Excel actions. */
.rp-list td { vertical-align: middle; }
.rp-list td small { display: block; color: var(--muted); font-size: var(--fs-cap); font-weight: 400; }
.rp-list .rp-1 b { font-size: 20px; font-weight: 300; color: var(--model-ink); }
.rp-list .rp-path { width: 120px; }
.rp-svg { width: 110px; height: 28px; display: block; }
.rp-svg polyline { fill: none; stroke: var(--model); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.rp-list .rp-drv { color: var(--ink2); font-size: var(--fs-cap); max-width: 220px; white-space: normal; }
.rp-acts { display: inline-flex; gap: 6px; align-items: center; }
.btn.icon-only { padding: 0 8px; }
.btn.icon-only .icon { width: 18px; height: 18px; }
.act-pdf .icon { color: #b42318; }
.act-excel .icon { color: #1d6f42; }
:root[data-theme="dark"] .act-pdf .icon { color: #f97066; }
:root[data-theme="dark"] .act-excel .icon { color: #47cd89; }
@media (max-width: 760px) { .rp-list .rp-path, .rp-list .rp-path-h, .rp-list .rp-drv, .rp-list .rp-drv-h { display: none; } }
@media (max-width: 640px) { .rp-list th:nth-child(3), .rp-list .rp-5, .rp-list .act-pdf, .rp-list .act-excel { display: none; } .rp-list td, .rp-list th { padding-left: 10px; padding-right: 10px; } }
.usage-top { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); border: 1px solid var(--line); border-radius: var(--r-card); background: var(--paper); margin-bottom: 16px; }
.usage-top > div { padding: 18px 20px; display: grid; gap: 4px; }
.usage-top > div + div { border-left: 1px solid var(--line2); }
.usage-top b { font-size: 40px; font-weight: 300; line-height: 1.1; color: var(--ink); font-variant-numeric: tabular-nums; }
.usage-top .out b { color: var(--neg); }
.usage-top span { color: var(--muted); font-size: var(--fs-cap); }
@media (max-width: 640px) { .usage-tbl td.reset { display: none; } .usage-top { grid-template-columns: repeat(3, minmax(0, 1fr)); } .usage-top > div { padding: 14px 12px; } .usage-top b { font-size: 28px; } }

/* workbench: search */
.typeahead .ta-group, .typeahead .ta-message { color: var(--muted); font-size: var(--fs-cap); cursor: default; }
.typeahead .ta-group:hover, .typeahead .ta-message:hover, .typeahead .ta-loading:hover { background: transparent; }
/* Two lines per result: the name never gives its width to the meta line. */
.typeahead li > a { display: grid; gap: 2px; width: 100%; min-width: 0; color: inherit; text-decoration: none; }
.typeahead li > a .ta-meta { overflow: hidden; text-overflow: ellipsis; }
.typeahead .ta-loading { cursor: default; }
.typeahead .ta-loading .skeleton { width: 70%; }

.note.later { display: flex; gap: 8px; align-items: flex-start; }
.note.later .icon { margin-top: 2px; }
.note.later b { color: var(--ink); font-weight: 600; }

.unscored { color: var(--muted); white-space: nowrap; font-size: inherit; }
.unscored-note { display: grid; gap: 2px; }
.unscored-note a:not(.btn) { color: inherit; }

.band-0 { --band: var(--risk-0); } .band-1 { --band: var(--risk-1); } .band-2 { --band: var(--risk-2); } .band-3 { --band: var(--risk-3); } .band-4 { --band: var(--risk-4); } .band-5 { --band: var(--risk-5); } .band-6 { --band: var(--risk-6); } .band-7 { --band: var(--risk-7); } .band-8 { --band: var(--risk-8); } .band-9 { --band: var(--risk-9); }
.band { display: inline-flex; align-items: center; gap: 6px; padding: 2px 0; color: var(--ink); font-size: var(--fs-cap); font-weight: 600; line-height: 1.4; vertical-align: middle; white-space: nowrap; }
.band i { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--band); }
.band-scale-wrap { margin: 10px 0 4px; }
.band-scale { display: flex; gap: 5px; }
.band-scale i { flex: 1; height: 12px; background: var(--band); border-radius: 2px; }
.band-scale .selected { box-shadow: inset 0 0 0 2px var(--ink), 0 0 0 1px var(--paper); transform: scaleY(1.2); }
.band-cutoffs { display: flex; gap: 5px; margin-top: 3px; color: var(--muted); font-size: 10px; line-height: 1; }
.band-cutoffs span { flex: 1; text-align: right; }
.profile-metric:first-child { box-shadow: inset 0 3px 0 var(--model); }
.band-legend { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; font-size: var(--fs-cap); }
.band-legend div { min-width: 0; display: grid; align-content: start; gap: 3px; }
.band-legend dt { display: flex; align-items: center; gap: 5px; font-weight: 600; white-space: nowrap; }
.band-legend dt i { display: inline-block; flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--band); }
.band-legend dd { margin: 0; color: var(--muted); }
.band-legend + p { margin-top: 8px; }
#snapshot-curve { border-top: 3px solid var(--model); }
.sig.up { box-shadow: inset 0 3px 0 var(--neg-soft); } .sig.down { box-shadow: inset 0 3px 0 var(--ok-soft); }
.menu { position: relative; } .menu summary { list-style: none; } .menu summary::-webkit-details-marker { display: none; }
.export-menu { position: absolute; top: 100%; right: 0; z-index: 45; min-width: 220px; background: var(--paper); border: 1px solid var(--line); box-shadow: var(--shadow-pop); }
.export-row { display: flex; align-items: center; gap: 8px; padding: 12px; color: var(--ink); text-decoration: none; } .export-row:hover { background: var(--paper-2); } .export-row .tail { margin-left: auto; color: var(--muted); } .export-row[data-feature="excel_export"] > .icon:first-child { color: var(--tint-excel); } .export-row.pdf > .icon:first-child { color: var(--neg); }
.action-list [data-feature="compare"] > .icon { color: var(--tint-company); } .action-list [data-feature="scenario"] > .icon, .action-list [data-feature="mira"] > .icon { color: var(--tint-compare); } .action-list [data-feature="news"] > .icon { color: var(--tint-sector); } .action-list [data-feature="correction"] > .icon { color: var(--tint-report); }

.chg.pos { color: var(--ok); } .chg.neg { color: var(--neg); } .chg .icon { width: 12px; height: 12px; vertical-align: middle; }
