/* SpicyPortal v3: a night-navy ground, a rounded display face, pills led by one of five dots,
   ruled facts rows, chapter bands of loose particles on a coloured rule, and the assistant's
   conversation as a thread. Every class the portal scripts use is styled. */

@font-face { font-family: "Christabel Sans"; src: url("/apps/portal-face/fonts/christabel-sans-500.woff") format("woff"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Christabel Sans"; src: url("/apps/portal-face/fonts/christabel-sans-600.woff") format("woff"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Christabel Sans"; src: url("/apps/portal-face/fonts/christabel-sans-700.woff") format("woff"); font-weight: 700; font-display: swap; }

:root {
  color-scheme: light;
  --display: "Christabel Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --sans: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;
  --page: #f5f5f9; --ink: #13151f; --muted: #555a6c; --line: #d5d7e2; --surface: #e8e9f1;
  --rose: #a82c68; --amber: #9a5a0c; --violet: #7b33a3; --teal: #0a7a58; --coral: #b5452b;
  --mine: #6e3192; --mine-ink: #ffffff; --focus: #7b33a3; --danger: #b3261e; --veil: rgb(19 21 31 / .32);
  --console: #0b0e18; --console-ink: #dfe3f0;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --pad: clamp(20px, 4vw, 60px);
}
/* Night, followed from the device. */
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --page: #070a13; --ink: #eef0f8; --muted: #a8aec4; --line: #232941; --surface: #131729;
    --rose: #f08ab4; --amber: #f2b765; --violet: #c9a8ee; --teal: #5fd0a4; --coral: #f6997f;
    --mine: #4a2863; --mine-ink: #eef0f8; --focus: #c9a8ee; --danger: #f2877e; --veil: rgb(0 0 0 / .55);
    --console: #0b0f1d;
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scrollbar-color: var(--line) transparent; }
body { min-height: 100vh; background: var(--page); color: var(--ink); font: 17px/1.55 var(--sans); -webkit-font-smoothing: antialiased; overflow-x: clip; }
::selection { background: var(--rose); color: var(--page); }
a { color: inherit; text-underline-offset: 5px; text-decoration-thickness: 1px; text-decoration-color: color-mix(in srgb, currentColor 42%, transparent); }
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; }
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line); background-clip: padding-box; border: 2px solid transparent; border-radius: 9px; }
h1, h2, h3, .brand, .chapter-name, .panel-title, .modal-title, .setting-name, .pane-heading, .cb-name { font-family: var(--display); }
h1 b, h2 b, .cb-name b { font-weight: inherit; color: var(--rose); }
[hidden] { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---------- top bar: the wordmark with her five dots, the sections, who is here */
.top { display: flex; align-items: center; gap: 28px; padding: 18px var(--pad); }
.brand { display: inline-flex; align-items: center; font-weight: 700; font-size: 25px; line-height: 1; letter-spacing: -.8px; text-decoration: none; white-space: nowrap; color: var(--ink); }
.brand svg { margin-left: 9px; }
.brand .d1 { fill: var(--rose); } .brand .d2 { fill: var(--amber); } .brand .d3 { fill: var(--violet); } .brand .d4 { fill: var(--teal); } .brand .d5 { fill: var(--coral); }
.view-nav { display: flex; align-items: center; gap: 4px 26px; margin-left: auto; overflow-x: auto; scrollbar-width: none; }
.view-link { flex: none; display: inline-flex; align-items: center; min-height: 44px; font-size: 16px; color: var(--muted); text-decoration: none; white-space: nowrap; transition: color .3s var(--ease); }
.view-link:hover, .view-link[aria-current="page"] { color: var(--ink); }
.view-link[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--rose); text-decoration-thickness: 2px; text-underline-offset: 8px; }
.session { display: flex; align-items: center; gap: 16px; font-size: 15px; color: var(--muted); white-space: nowrap; }
.session b { font-weight: 500; color: var(--ink); }
.link-btn { min-height: 44px; padding: 0; border: 0; background: none; font: inherit; color: var(--ink); cursor: pointer; text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 1px; text-decoration-color: color-mix(in srgb, currentColor 42%, transparent); transition: text-decoration-color .3s var(--ease); }
.link-btn:hover { text-decoration-color: currentColor; }
.link-btn.danger { color: var(--danger); }
@media (max-width: 900px) {
  .top { flex-wrap: wrap; gap: 6px 18px; padding-top: 14px; padding-bottom: 6px; }
  .view-nav { order: 3; width: 100%; margin-left: 0; gap: 22px; }
  .session { margin-left: auto; }
  /* The section nav and the server tabs scroll sideways here with no scrollbar: a soft shadow on
     whichever edge still has more shows it (the page-coloured covers scroll with the content). */
  .view-nav, .tabs-nav { background:
    linear-gradient(to right, var(--page) 40%, transparent) left / 36px 100% no-repeat local,
    linear-gradient(to left, var(--page) 40%, transparent) right / 36px 100% no-repeat local,
    linear-gradient(to right, color-mix(in srgb, var(--ink) 22%, transparent), transparent) left / 18px 100% no-repeat scroll,
    linear-gradient(to left, color-mix(in srgb, var(--ink) 22%, transparent), transparent) right / 18px 100% no-repeat scroll; }
}

/* ---------- chapter bands: her dots settling onto a rule; one colour leads each chapter */
.chapter { position: relative; }
.tone { display: block; width: 100%; height: clamp(54px, 6.4vw, 104px); border-bottom: 3px solid var(--lead, var(--rose)); box-sizing: content-box; }
.tone[data-ink="coral"] { --lead: var(--coral); } .tone[data-ink="violet"] { --lead: var(--violet); }
.tone[data-ink="teal"] { --lead: var(--teal); } .tone[data-ink="amber"] { --lead: var(--amber); }
.chapter .bar { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 8px 20px; padding: 16px var(--pad) 0; }
.chapter-name { font-size: clamp(22px, 2.3vw, 32px); font-weight: 500; letter-spacing: -.022em; line-height: 1.1; }
.chapter-note { display: flex; align-items: center; gap: 14px; font-size: 16px; color: var(--muted); }
.page { padding: 0 var(--pad) 5rem; }
.view { animation: view-in .5s var(--ease) both; }
@keyframes view-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* The server's state in the band: a dot that means something, and the word. */
.status-badge { display: inline-flex; align-items: center; gap: 10px; min-height: 36px; padding: 4px 16px 4px 12px; border: 1px solid var(--line); border-radius: 999px; font-size: 15px; color: var(--ink); }
.status-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); }
.status-badge.online { border-color: var(--teal); }
.status-badge.online .status-dot { background: var(--teal); box-shadow: 0 0 0 4px color-mix(in srgb, var(--teal) 22%, transparent); }
.status-badge.updating { border-color: var(--amber); }
.status-badge.updating .status-dot { background: var(--amber); animation: pulse 1.2s infinite; }
.status-badge.offline { color: var(--muted); }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }

/* ---------- pills: each led by one of her dots, which blooms to fill it on hover */
.btn { --dot: var(--amber); position: relative; isolation: isolate; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  min-height: 48px; padding: 10px 24px 10px 18px; background: transparent; color: var(--ink); border: 1px solid var(--line); border-radius: 999px;
  font: 500 16px/1.4 var(--sans); white-space: nowrap; text-decoration: none; cursor: pointer; transition: color .4s var(--ease), border-color .4s var(--ease); }
.btn::before { content: ""; flex: none; z-index: -1; width: 10px; height: 10px; border-radius: 50%; background: var(--dot); transition: transform .6s var(--ease); }
.btn:hover:not(:disabled), .btn:focus-visible { color: var(--page); border-color: var(--dot); }
.btn:hover:not(:disabled)::before, .btn:focus-visible::before { transform: scale(70); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .38; cursor: default; }
.btn-primary { --dot: var(--rose); border-color: var(--ink); }
.btn-danger { --dot: var(--danger); border-color: var(--danger); color: var(--danger); }
#btn-start { --dot: var(--teal); } #btn-restart { --dot: var(--coral); } #btn-update { --dot: var(--violet); } #btn-backup-open { --dot: var(--rose); }
.btn-small, .btn-row { min-height: 40px; padding: 6px 18px 6px 14px; font-size: 15px; gap: 10px; }
.btn-small::before, .btn-row::before { width: 8px; height: 8px; }
.push-right { margin-left: auto; }

/* ---------- fields: transparent, a line, a doubled ink border on focus */
.form-input, .cb-compose textarea { display: block; width: 100%; min-height: 48px; padding: 11px 14px; margin-bottom: 1.1rem; background: transparent; color: var(--ink);
  border: 1px solid var(--line); border-radius: 0; font: 17px/1.45 var(--sans); transition: border-color .3s var(--ease); }
.form-input:hover, .form-input:focus, .cb-compose textarea:hover, .cb-compose textarea:focus { border-color: var(--ink); }
.form-input:focus-visible, .cb-compose textarea:focus-visible { outline: 0; box-shadow: inset 0 0 0 1px var(--ink); }
.form-input::placeholder, textarea::placeholder { color: var(--muted); opacity: .8; }
select.form-input { appearance: none; padding-right: 38px; background: linear-gradient(45deg, transparent 50%, var(--muted) 50%) right 18px top 52% / 6px 6px no-repeat,
  linear-gradient(-45deg, transparent 50%, var(--muted) 50%) right 13px top 52% / 6px 6px no-repeat; }
.field-label { display: block; font-size: 15px; font-weight: 600; margin-bottom: .4rem; }
.check { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; font-size: 15px; color: var(--muted); cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--rose); }
.filter-input { width: 10rem; min-height: 40px; margin-bottom: 0; padding: 6px 12px; font-size: 15px; }

/* ---------- Server: a statement beside ruled facts, her pills, then the console and its tabs */
.server-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: clamp(28px, 5vw, 90px); align-items: end; padding: clamp(30px, 4vw, 58px) 0 clamp(22px, 2.6vw, 36px); }
.server-head h1 { font-size: clamp(54px, 7.4vw, 112px); font-weight: 600; letter-spacing: -.045em; line-height: .92; }
.server-head .lede { margin-top: 18px; font-size: 18px; color: var(--muted); max-width: 32ch; }
.metrics-grid { display: block; }
.metric-card { display: grid; grid-template-columns: 9.5rem minmax(0, 1fr); gap: 18px; align-items: baseline; padding: 13px 0; border-top: 1px solid var(--line); }
.metric-card:last-child { border-bottom: 1px solid var(--line); }
.metric-label { font-weight: 600; font-size: 16px; }
.metric-val { font-size: 17px; color: var(--muted); font-variant-numeric: tabular-nums; }
.control-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; padding: 4px 0 30px; }
@media (max-width: 860px) { .server-head { grid-template-columns: 1fr; align-items: start; } .metric-card { grid-template-columns: 7.6rem minmax(0, 1fr); } }

.main-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: clamp(22px, 3vw, 48px); }
@media (max-width: 1100px) { .main-grid { grid-template-columns: 1fr; } }
.panel { display: flex; flex-direction: column; min-width: 0; border-top: 1px solid var(--ink); }
.panel-header { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; padding: 14px 0; }
.panel-title { font-size: clamp(22px, 2vw, 28px); font-weight: 500; letter-spacing: -.022em; line-height: 1.1; }
.panel-controls { display: flex; align-items: center; gap: 10px; }
.console-terminal { height: 520px; overflow-y: auto; padding: 16px 18px; background: var(--console); color: var(--console-ink); font: 13px/1.6 var(--mono); word-break: break-all; border-radius: 14px; }
.log-line { margin-bottom: 2px; white-space: pre-wrap; }
.log-line.save { color: #7fe0b6; font-weight: 600; }
.log-line.error { color: #ff9fbf; font-weight: 600; }
.log-line.steam { color: #c9a8ee; }
.log-line.eos { color: #8d93ab; }
.log-line.sent { color: #f2b765; }
.log-line.sent::before { content: "> "; }

.tabs-nav { display: flex; gap: 22px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tab-btn { flex: none; min-height: 48px; padding: 0; background: none; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; color: var(--muted); font: 500 16px/1 var(--sans); cursor: pointer; white-space: nowrap; transition: color .3s var(--ease), border-color .3s var(--ease); }
.tab-btn:hover { color: var(--ink); }
.tab-btn.active { color: var(--ink); border-bottom-color: var(--rose); }
.tab-content { padding: 18px 0; }
.tab-pane { display: none; }
.tab-pane.active { display: block; animation: view-in .35s var(--ease) both; }
.pane-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 14px; }
.pane-note { font-size: 15px; color: var(--muted); max-width: 36ch; }
.pane-note.wide { max-width: 60ch; margin-top: 6px; }
.pane-heading { font-size: 21px; font-weight: 500; letter-spacing: -.02em; margin: 30px 0 6px; }
.telemetry-pre { padding: 14px 16px; background: var(--surface); border-radius: 14px; font: 13px/1.55 var(--mono); white-space: pre-wrap; }

/* Ruled tables and facts: the page's ruled lists, label in weight, the rest muted. */
.ruled-table { width: 100%; border-collapse: collapse; font-size: 16px; }
.ruled-table th { text-align: left; padding: 10px 12px 10px 0; border-bottom: 1px solid var(--ink); font-weight: 600; font-size: 14px; }
.ruled-table td { padding: 12px 12px 12px 0; border-bottom: 1px solid var(--line); color: var(--ink); font-variant-numeric: tabular-nums; vertical-align: top; }
.ruled-table tr:last-child td { border-bottom: 0; }
.ruled-table td.row-action { text-align: right; vertical-align: middle; padding-right: 0; width: 1%; }
.ruled-table tr.row-failed td, td.row-failed, .state-bad { color: var(--danger); }
.row-empty { color: var(--muted); }
.snapshot-name { display: block; font-weight: 600; word-break: break-all; }
.snapshot-meta { display: block; font-size: 14px; color: var(--muted); margin-top: 2px; }
.activity-when { white-space: nowrap; color: var(--muted); }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 0 22px; font-size: 16px; }
.kv dt, .kv dd { padding: 12px 0; border-top: 1px solid var(--line); }
.kv dt { font-weight: 600; } .kv dd { color: var(--muted); }

/* Automation: a name, its switch, and a plain sentence. */
.automation .setting { padding: 4px 0 18px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.setting-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; min-height: 48px; cursor: pointer; }
div.setting-head { cursor: default; }
.setting-name { font-size: 21px; font-weight: 500; letter-spacing: -.02em; }
.setting-row { display: flex; align-items: center; gap: 12px; margin: 6px 0; }
.setting-row label { min-width: 8rem; font-size: 15px; color: var(--muted); }
.setting-input { width: auto; min-width: 9rem; margin-bottom: 0; }
.setting-input:disabled { opacity: .4; }
.setting-note { font-size: 15px; color: var(--muted); margin-top: 8px; max-width: 48ch; }
.setting-state { font-size: 15px; margin-top: 6px; font-variant-numeric: tabular-nums; }
.setting-state:empty { display: none; }
.setting-actions { display: flex; justify-content: flex-end; align-items: center; gap: 16px; flex-wrap: wrap; }
.setting-actions .setting-state { margin: 0; color: var(--muted); }
.dryrun-note { padding: 10px 14px; margin: 0 0 16px; border-left: 3px solid var(--amber); background: var(--surface); font-size: 15px; }
.switch { appearance: none; -webkit-appearance: none; flex: none; position: relative; width: 48px; height: 28px; border: 1px solid var(--line); border-radius: 999px; background: transparent; cursor: pointer; transition: background-color .35s var(--ease), border-color .35s var(--ease); }
.switch::after { content: ""; position: absolute; top: 4px; left: 4px; width: 18px; height: 18px; border-radius: 50%; background: var(--muted); transition: transform .35s var(--ease), background-color .35s var(--ease); }
.switch:checked { border-color: var(--teal); background: color-mix(in srgb, var(--teal) 18%, transparent); }
.switch:checked::after { transform: translateX(20px); background: var(--teal); }
.switch:disabled { opacity: .4; cursor: default; }

/* ---------- People, Groups, Your account */
.desk-section { padding-top: clamp(28px, 3.6vw, 52px); margin-bottom: 3rem; }
.desk-section.narrow { max-width: 760px; }
.desk-head { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 16px 32px; margin-bottom: 20px; }
.desk-section .panel-title { font-size: clamp(34px, 4vw, 56px); font-weight: 600; letter-spacing: -.04em; line-height: 1; }
.inline-form { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 12px; }
.inline-form .form-input { width: 15rem; max-width: 100%; margin-bottom: 0; }
.people-table .you { color: var(--muted); }
.people-table select.form-input { width: auto; min-width: 9rem; min-height: 40px; margin-bottom: 0; padding: 6px 34px 6px 12px; font-size: 15px; }
.people-table td.row-action { width: auto; }
.person-state { display: inline-flex; align-items: center; gap: 8px; }
.person-state .status-dot { flex: none; width: 9px; height: 9px; }
.person-state.is-active .status-dot { background: var(--teal); }
.person-state.is-pendingSetup .status-dot { background: var(--amber); }
.person-state.is-disabled { color: var(--muted); }
.person-state.is-disabled .status-dot { background: transparent; border: 1px solid var(--muted); }
.row-links { display: flex; justify-content: flex-end; gap: 0 20px; }
.row-links .link-btn { min-height: 36px; font-size: 15px; white-space: nowrap; }
@media (max-width: 820px) {
  .people-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .people-table tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
  .people-table td, .people-table tr:last-child td { border-bottom: 0; padding: 0; }
  .people-table td:nth-child(3), .people-table td.row-action { grid-column: 1 / -1; width: auto; text-align: left; }
  .row-links { justify-content: flex-start; flex-wrap: wrap; }
}
.matrix-scroll { overflow-x: auto; }
.matrix { min-width: 520px; }
.matrix thead th.matrix-group { text-align: center; white-space: nowrap; padding: 10px 14px; }
.matrix tbody th { text-align: left; padding: 12px 12px 12px 0; border-bottom: 1px solid var(--line); font-weight: 400; }
.matrix .perm-name { display: block; font-weight: 600; }
.matrix td.matrix-cell { width: 1%; text-align: center; vertical-align: middle; padding: 12px 14px; }
.matrix .switch { display: inline-block; vertical-align: middle; }
.matrix tfoot td { border-bottom: 0; }
.account-facts { margin-top: 10px; }
.account-form { margin-top: 14px; }
.code-field { width: 10rem !important; font: 22px/1 var(--mono); letter-spacing: .25em; text-align: center; }
.codes-list { list-style: none; max-width: 24rem; margin: 16px 0; border-top: 1px solid var(--ink); }
.codes-list li { padding: 10px 2px; border-bottom: 1px solid var(--line); font: 17px/1.3 var(--mono); letter-spacing: .06em; }
.link-field { font-family: var(--mono); font-size: 14px; }

/* Knowledge base: a numbered index beside one article at reading width. */
.kb { display: grid; grid-template-columns: minmax(220px, 300px) minmax(0, 1fr); gap: clamp(28px, 6vw, 96px); align-items: start; padding-top: clamp(28px, 3.6vw, 52px); }
.kb-index { position: sticky; top: 1rem; }
.kb-list { list-style: none; counter-reset: article; margin: 14px 0 16px; border-top: 1px solid var(--line); }
.kb-list li { counter-increment: article; border-bottom: 1px solid var(--line); }
.kb-list a { display: grid; grid-template-columns: 1.8rem 1fr; align-items: baseline; padding: 12px 0; font-size: 16px; line-height: 1.35; color: var(--muted); text-decoration: none; transition: color .3s var(--ease); }
.kb-list a::before { content: counter(article); font-size: 13px; font-variant-numeric: tabular-nums; color: var(--muted); }
.kb-list a:hover, .kb-list a[aria-current="page"] { color: var(--ink); }
.kb-list a[aria-current="page"] { font-weight: 600; }
.kb-list a[aria-current="page"]::before { color: var(--amber); font-weight: 700; }
.kb-article { min-width: 0; max-width: 66ch; }
.kb-article h1 { font-size: clamp(38px, 4.4vw, 66px); font-weight: 600; letter-spacing: -.045em; line-height: 1; margin-bottom: 16px; }
.kb-meta { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 4px 16px; min-height: 44px; font-size: 15px; color: var(--muted); border-bottom: 1px solid var(--line); margin-bottom: 26px; }
.kb-body h1, .kb-body h2 { font-family: var(--display); font-size: 26px; font-weight: 500; letter-spacing: -.025em; line-height: 1.2; margin: 34px 0 10px; }
.kb-body h3 { font-family: var(--display); font-size: 20px; font-weight: 500; margin: 26px 0 6px; }
.kb-body p { margin-bottom: 16px; }
.kb-body ul, .kb-body ol { list-style: none; margin-bottom: 18px; }
.kb-body li { position: relative; padding: 4px 0 4px 30px; }
.kb-body ul li::before { content: ""; position: absolute; left: 8px; top: .95em; width: 8px; height: 8px; border-radius: 50%; background: var(--amber); }
.kb-body ol { counter-reset: step; }
.kb-body ol li { counter-increment: step; }
.kb-body ol li::before { content: counter(step); position: absolute; left: 6px; font-weight: 600; color: var(--muted); }
.kb-body b { font-weight: 600; }
.kb-body code { font: .86em var(--mono); background: var(--surface); padding: .12em .38em; border-radius: 5px; }
.kb-body pre { background: var(--surface); padding: 14px 16px; margin-bottom: 18px; overflow-x: auto; border-radius: 14px; }
.kb-body pre code { background: none; padding: 0; font-size: 14px; }
.kb-body blockquote { border-left: 3px solid var(--amber); padding: 6px 16px; margin-bottom: 18px; color: var(--muted); }
.kb-body hr { border: 0; border-top: 1px solid var(--line); margin: 30px 0; }
.kb-empty { color: var(--muted); max-width: 40ch; }
.kb-editor textarea { display: block; width: 100%; min-height: 58vh; padding: 16px; margin-bottom: 16px; border: 1px solid var(--line); background: transparent; color: var(--ink); font: 15px/1.55 var(--mono); resize: vertical; }
.kb-editor textarea:focus { outline: 0; border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
@media (max-width: 860px) { .kb { grid-template-columns: 1fr; } .kb-index { position: static; } }

/* ---------- dialogs: a sheet on her ground with her colour leading */
.modal-backdrop { display: none; position: fixed; inset: 0; z-index: 100; align-items: center; justify-content: center; padding: 16px; background: var(--veil); backdrop-filter: blur(6px); }
.modal-backdrop.open { display: flex; animation: view-in .3s var(--ease) both; }
.modal-box { width: 100%; max-width: 480px; padding: 28px; background: var(--page); color: var(--ink); border: 1px solid var(--line); border-top: 3px solid var(--rose); border-radius: 22px; }
.modal-box.modal-wide { max-width: 640px; }
.modal-title { font-size: 28px; font-weight: 600; letter-spacing: -.03em; line-height: 1.1; margin-bottom: 12px; }
.modal-desc { font-size: 16px; color: var(--muted); margin-bottom: 22px; }
.modal-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 10px; }
#modal-stop .modal-box, #modal-restore .modal-box, #modal-confirm .modal-box { border-top-color: var(--danger); }

/* ---------- the assistant: a panel that slides in from the right on any page. Its face leads,
   then the conversation as a thread. On wide screens the page makes room for it. */
.cb-launch { position: fixed; right: clamp(16px, 3vw, 32px); bottom: clamp(16px, 3vw, 32px); z-index: 70; --dot: var(--rose); background: var(--page); border-color: var(--ink); box-shadow: 0 10px 30px -12px rgb(0 0 0 / .5); }
.cb-launch[aria-expanded=true] { opacity: 0; visibility: hidden; pointer-events: none; transform: translateY(8px); }
/* On phones the pill would sit over a form's last row (console presets, wizard actions); step aside while one is being used. */
@media (max-width: 720px) { body:has(.view form:focus-within) .cb-launch { opacity: 0; visibility: hidden; pointer-events: none; } }
/* A small chat bubble that grows out of its button and sizes to what it holds (owner, 2026-10-17:
   the side screen, then a 420x640 window, were both too big). */
.cb-dock { position: fixed; right: clamp(16px, 3vw, 32px); bottom: clamp(16px, 3vw, 32px); z-index: 80; display: flex; flex-direction: column;
  width: min(360px, calc(100vw - 24px)); max-height: min(520px, calc(100dvh - 96px)); background: var(--page); border: 1px solid var(--line); border-radius: 20px; overflow: hidden;
  box-shadow: 0 20px 48px -20px rgb(0 0 0 / .6), 0 0 0 1px color-mix(in srgb, var(--ink) 6%, transparent);
  transform: translateY(12px) scale(.96); transform-origin: bottom right; opacity: 0; visibility: hidden; transition: transform .3s var(--ease), opacity .22s var(--ease), visibility 0s linear .3s; }
.cb-dock.open { transform: none; opacity: 1; visibility: visible; transition: transform .3s var(--ease), opacity .22s var(--ease); }
/* Once there is a conversation the bubble holds its height, so new lines do not make it jump. */
.cb-dock.talking { height: min(520px, calc(100dvh - 96px)); }
@media (max-width: 720px) { .cb-dock { right: 8px; left: 8px; bottom: 8px; width: auto; max-height: 82dvh; } .cb-dock.talking { height: 82dvh; } }
/* No title bar: the avatar row names it, and Close sits at the end of that row. */
.cb-dock-head { position: absolute; top: 0; right: 0; z-index: 1; }
.cb-dock-head .tone, .cb-dock-head .chapter-name { display: none; }
.cb-dock-head .bar { padding: 26px 18px 0 0; }
.cb-dock-head .link-btn { font-size: 14px; color: var(--muted); }
.cb-dock-body { flex: 1; display: flex; flex-direction: column; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 0 18px; scroll-padding-bottom: 160px; }
/* The portrait is an avatar beside the name, not the subject of the window. */
.cb-face { display: flex; align-items: center; gap: 12px; padding: 14px 64px 12px 0; border-bottom: 1px solid var(--line); }
.cb-portrait { position: relative; flex: none; width: 48px; aspect-ratio: 10 / 11; }
.cb-portrait iframe { display: block; width: 100%; height: 100%; border: 0; background: transparent; color-scheme: light; opacity: 0; transition: opacity 1s var(--ease); }
.cb-portrait iframe.ready { opacity: 1; }
.cb-name { font-size: 18px; font-weight: 600; letter-spacing: -.02em; line-height: 1.1; }
.cb-state { margin-top: 2px; min-height: 1.4em; font-size: 13px; color: var(--muted); }
.cb-state .dots { display: inline-flex; gap: 5px; height: 1em; align-items: center; margin-left: 6px; vertical-align: middle; }
.cb-state .dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--rose); animation: drift 1.2s ease-in-out infinite; }
.cb-state .dots i:nth-child(2) { background: var(--violet); animation-delay: .16s; }
.cb-state .dots i:nth-child(3) { background: var(--coral); animation-delay: .32s; }
@keyframes drift { 0%, 100% { transform: translateY(0); opacity: .45; } 50% { transform: translateY(-4px); opacity: 1; } }
.cb-dock.talking .cb-talk > h1, .cb-dock.talking .cb-talk > .lede { display: none; }

.cb-talk { flex: 1; display: flex; flex-direction: column; }
.cb-talk h1 { margin-top: 14px; font-size: 20px; font-weight: 600; letter-spacing: -.02em; line-height: 1.15; }
.cb-talk .lede { display: none; }
.cb-asks { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.cb-asks .btn { --dot: var(--violet); min-height: 32px; padding: 4px 12px 4px 10px; font-size: 13.5px; gap: 8px; }
.cb-asks .btn::before { width: 7px; height: 7px; }
.cb-asks .btn:nth-child(2) { --dot: var(--teal); }
.cb-asks .btn:nth-child(3) { --dot: var(--coral); }
.cb-off { margin-top: 12px; padding: 10px 0; font-size: 14px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); color: var(--muted); }

.thread { flex: 1; list-style: none; display: flex; flex-direction: column; padding: 14px 0 10px; }
.thread:empty { display: none; }
.thread li { position: relative; display: flex; flex-direction: column; max-width: 86%; margin-top: 3px; }
.thread li.assistant { align-self: flex-start; align-items: flex-start; }
.thread li.user { align-self: flex-end; align-items: flex-end; }
.thread li.assistant + li.user, .thread li.user + li.assistant, .thread li.event + li, .thread li + li.event { margin-top: 14px; }
.thread .who { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.thread .said { display: block; max-width: 100%; padding: 10px 16px; border-radius: 22px; line-height: 1.42; white-space: pre-wrap; overflow-wrap: anywhere; }
.thread .assistant .said { background: var(--surface); border-bottom-left-radius: 7px; }
.thread .user .said { background: var(--mine); color: var(--mine-ink); border-bottom-right-radius: 7px; }
.thread li.assistant:has(+ li.assistant) .said { border-bottom-left-radius: 22px; }
.thread li.event { align-self: center; max-width: none; font-size: 13px; color: var(--muted); }
.thread li.new { animation: line-in .45s var(--ease) both; }
@keyframes line-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.thread li.failed .said { background: none; border: 1px solid var(--danger); color: var(--danger); }

/* What it read, and what it asks you to approve: ruled event rows inside the thread. */
.thread li.event.reads { display: block; align-self: flex-start; margin: 6px 8px 0; font-size: 13px; }
.thread li.event.reads b { font-weight: 500; color: var(--ink); }
.thread li.event.ask { align-self: stretch; max-width: none; align-items: stretch; margin: 18px 0 8px; padding: 14px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: 15px; color: var(--ink); }
.ask-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; }
.ask-head::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--violet); transform: translateY(-1px); }
.thread li.event.ask[data-risk=high] .ask-head::before { background: var(--danger); }
.ask-title { font-weight: 600; font-size: 16px; }
.ask-kind { margin-left: auto; font-size: 13px; color: var(--muted); white-space: nowrap; }
.thread li.event.ask[data-risk=high] .ask-kind { color: var(--danger); }
.ask-detail { padding-left: 18px; margin-top: 4px; color: var(--muted); }
.ask-req { display: block; margin: 10px 0 0 18px; padding: 8px 12px; background: var(--surface); border-radius: 10px; font: 13px/1.5 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; color: var(--muted); }
.ask-code { margin: 12px 0 0 18px; }
.ask-code .form-input { width: 10rem; margin: 0; font: 20px/1 var(--mono); letter-spacing: .25em; text-align: center; }
.ask-hint { margin-top: 6px; font-size: 13px; color: var(--muted); max-width: 44ch; }
.ask-acts { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin: 12px 0 0 18px; }
.ask-acts .btn-primary { --dot: var(--teal); }
.ask-expiry { margin-left: auto; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ask-result { margin: 8px 0 0 18px; font-size: 14px; }
.ask-result:empty { display: none; }
.ask-link { margin: 12px 0 0 18px; }
.ask-link .form-input { margin-bottom: 8px; font: 13.5px var(--mono); }
.thread li.event.ask.is-done { color: var(--muted); }
.thread li.event.ask.is-done .ask-head::before { background: var(--teal); }
.thread li.event.ask.is-done.is-declined .ask-head::before { background: var(--muted); }
.thread li.event.ask.is-done .ask-req, .thread li.event.ask.is-done .ask-detail { display: none; }

.cb-compose { position: sticky; bottom: 0; padding: 12px 0 14px; margin-top: auto; background: var(--page); }
.cb-compose::before { content: ""; position: absolute; left: 0; right: 0; bottom: 100%; height: 16px; background: linear-gradient(to top, var(--page), transparent); pointer-events: none; }
.cb-compose textarea { margin: 0; min-height: 42px; max-height: 120px; padding: 9px 12px; font-size: 15px; resize: none; }
.cb-tools { display: flex; align-items: center; gap: 10px; margin-top: 8px; font-size: 13px; white-space: nowrap; }
.cb-tools .btn { min-height: 34px; padding: 4px 14px 4px 11px; font-size: 14px; }
.cb-tools #cb-send { margin-left: auto; }
.cb-mic { --dot: var(--coral); }
.cb-mic[aria-pressed=true] { border-color: var(--coral); }
.cb-mic[aria-pressed=true]::before { animation: pulse 1.2s infinite; }
.cb-foot { display: none; margin-top: 6px; font-size: 12.5px; color: var(--muted); }
.cb-compose:has(.cb-mic[aria-pressed=true]) .cb-foot { display: block; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ============================================================================================
   v4: the hosting panel. Status dots as a state machine, the server list and host strip, the
   create wizard, figures and charts on the console plate, audit filters, grants, passkeys. */

/* ---------- status dots: ten states, one overlay ring, five flashes. Tokens per theme from :root. */
.status-dot { position: relative; width: 10px; height: 10px; border-radius: 50%; background: var(--muted); flex: none; transition: background-color .4s var(--ease), box-shadow .4s var(--ease); }
.status-dot.is-online { background: var(--teal); box-shadow: 0 0 0 4px color-mix(in srgb, var(--teal) 22%, transparent); }
.status-dot.is-degraded { background: var(--coral); box-shadow: 0 0 0 4px color-mix(in srgb, var(--coral) 22%, transparent); }
.status-dot.is-offline { background: var(--muted); }
.status-dot.is-unknown { background: transparent; border: 1px dashed var(--line); }
.status-dot.is-crashed { background: var(--danger); }
.status-dot.is-halted { background: transparent; border: 2px solid var(--danger); }
.status-dot.is-starting { background: var(--amber); animation: pulse 2s infinite; }
.status-dot.is-stopping { background: var(--amber); opacity: .6; animation: pulse 2s infinite; }
.status-dot.is-restarting { background: var(--amber); animation: pulse-double 1.6s infinite; }
.status-dot.is-updating, .status-dot.is-installing { background: var(--amber); animation: pulse 1s infinite; }
.status-dot.has-snapshot::after { content: ""; position: absolute; inset: -5px; border: 2px solid var(--violet); border-radius: 50%; animation: ring-turn 2.4s linear infinite; }
@keyframes pulse-double { 0%, 100% { opacity: 1; } 20% { opacity: .3; } 40% { opacity: 1; } 60% { opacity: .3; } 80% { opacity: 1; } }
@keyframes ring-turn { to { transform: rotate(360deg); } }
.status-dot.flash-player-joined::before, .status-dot.flash-action-ok::before, .status-dot.flash-action-failed::before { content: ""; position: absolute; inset: 0; border-radius: 50%; animation: bloom 1.5s var(--ease) both; }
.status-dot.flash-player-joined::before { background: var(--teal); }
.status-dot.flash-action-ok::before { background: var(--ink); }
.status-dot.flash-action-failed::before { background: var(--danger); animation: blink 1.5s steps(2) both; }
.status-dot.flash-snapshot-ok::after { border-color: var(--teal); animation: ring-collapse 1.5s var(--ease) both; }
.status-dot.flash-snapshot-failed::after { border-color: var(--danger); animation: none; }
@keyframes bloom { from { transform: scale(1); opacity: .9; } to { transform: scale(3.2); opacity: 0; } }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }
@keyframes ring-collapse { from { transform: scale(1.4); opacity: 1; } to { transform: scale(.4); opacity: 0; } }
.status-badge.is-online { border-color: var(--teal); } .status-badge.is-degraded { border-color: var(--coral); }
.status-badge.is-crashed, .status-badge.is-halted { border-color: var(--danger); color: var(--danger); }
.status-badge.is-starting, .status-badge.is-stopping, .status-badge.is-restarting, .status-badge.is-updating, .status-badge.is-installing { border-color: var(--amber); }
.status-badge.is-offline, .status-badge.is-unknown { color: var(--muted); }
@media (prefers-reduced-motion: reduce) { .status-dot, .status-dot::before, .status-dot::after { animation: none !important; } .status-dot[data-flash-hold] { box-shadow: 0 0 0 4px color-mix(in srgb, var(--teal) 40%, transparent); }
  .status-dot[data-flash-hold="action-failed"], .status-dot[data-flash-hold="snapshot-failed"] { box-shadow: 0 0 0 4px color-mix(in srgb, var(--danger) 40%, transparent); } }

/* ---------- top bar: crumbs and the chapter pill */
.chapter-name .crumb { color: var(--muted); text-decoration: none; }
.chapter-name .crumb:hover { color: var(--ink); text-decoration: underline; }
.view-link-hidden { display: none !important; }
.muted { color: var(--muted); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 1px 9px; border: 1px solid var(--line); border-radius: 999px; font-size: 12.5px; color: var(--muted); white-space: nowrap; vertical-align: middle; }
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--violet); }
.chip-assistant::before { background: var(--rose); }
.chip-schedule::before { background: var(--amber); } .chip-watchdog::before { background: var(--coral); } .chip-ui::before { background: var(--teal); }

/* ---------- Servers: the host strip, the ruled list, cards under 720px, template cards */
.host-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 24px; margin: clamp(22px, 3vw, 40px) 0 26px; }
.host-strip div { padding: 12px 0; border-top: 1px solid var(--line); }
.host-strip dt { font-size: 13.5px; color: var(--muted); }
.host-strip dd { font-size: 22px; font-weight: 600; letter-spacing: -.02em; line-height: 1.2; }
.host-strip dd.is-danger { color: var(--danger); }
@media (max-width: 720px) { .host-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.servers-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px 24px; margin-bottom: 14px; }
.servers-sort { display: flex; align-items: center; gap: 16px; font-size: 14.5px; }
.servers-sort .sort-label { color: var(--muted); }
.servers-sort .link-btn { min-height: 36px; font-size: 14.5px; color: var(--muted); text-decoration: none; }
.servers-sort .link-btn[aria-pressed=true] { color: var(--ink); text-decoration: underline; text-decoration-color: var(--rose); text-decoration-thickness: 2px; text-underline-offset: 8px; }
.servers-table td { vertical-align: middle; }
.servers-table .server-name { display: block; font-weight: 600; }
.servers-table .server-name a { text-decoration: none; }
.servers-table .server-name a:hover { text-decoration: underline; }
.servers-table .server-game { display: block; font-size: 13.5px; color: var(--muted); }
.servers-table td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.servers-table td.is-danger { color: var(--danger); }
.servers-table code { font: 13.5px var(--mono); }
.servers-table .row-links { gap: 0 14px; }
.servers-table .row-links .btn-row { min-height: 34px; padding: 4px 14px 4px 11px; font-size: 14px; }
.servers-table .status-badge { min-height: 32px; padding: 3px 12px 3px 9px; font-size: 14px; gap: 8px; }
@media (max-width: 720px) {
  .servers-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .servers-table tr { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "state name actions" "facts facts facts"; gap: 6px 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
  .servers-table td, .servers-table tr:last-child td { border-bottom: 0; padding: 0; }
  .servers-table td.c-state { grid-area: state; } .servers-table td.c-name { grid-area: name; } .servers-table td.c-actions { grid-area: actions; width: auto; }
  .servers-table td.c-address, .servers-table td.c-cpu, .servers-table td.c-desired, .servers-table td.c-snapshot { display: none; }
  .servers-table td.c-players, .servers-table td.c-memory, .servers-table td.c-uptime { grid-row: 2; font-size: 14px; color: var(--muted); white-space: nowrap; }
  .servers-table td.c-players { grid-column: 1 / 3; } .servers-table td.c-memory { grid-column: 1 / -1; grid-row: 3; } .servers-table td.c-uptime { grid-column: 3; text-align: right; }
  .servers-table td.c-players::before { content: "Players "; } .servers-table td.c-memory::before { content: "Memory "; } .servers-table td.c-uptime::before { content: "Up "; }
  .servers-table td.c-memory.is-danger, .servers-table td.c-players.is-danger { color: var(--danger); }
  .servers-table td.c-facts { grid-area: facts; font-size: 14px; color: var(--muted); }
}
.templates { margin-top: clamp(36px, 5vw, 64px); }
.template-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; margin-top: 18px; }
.template-card { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px 18px; border: 1px solid var(--line); border-radius: 16px; background: transparent; color: var(--ink); text-align: left; text-decoration: none; cursor: pointer; transition: border-color .3s var(--ease), background-color .3s var(--ease); }
.template-card:hover { border-color: var(--ink); background: var(--surface); }
.template-card strong { font-family: var(--display); font-size: 20px; font-weight: 500; letter-spacing: -.02em; }
.template-card small { font-size: 13.5px; color: var(--muted); }
.template-card .tag { align-self: flex-start; margin-top: 4px; }
.template-card.is-unverified .tag::before { background: var(--amber); }
.template-card.is-import { border-style: dashed; }

/* ---------- the wizard */
.wizard { max-width: 760px; padding-top: clamp(22px, 3vw, 40px); }
.wizard-steps { display: flex; gap: 22px; list-style: none; counter-reset: step; margin-bottom: 28px; border-bottom: 1px solid var(--line); }
.wizard-steps li { counter-increment: step; display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: 15px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.wizard-steps li::before { content: counter(step); display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--line); font-size: 13px; }
.wizard-steps li[aria-current=step] { color: var(--ink); border-bottom-color: var(--rose); }
.wizard-steps li[aria-current=step]::before { background: var(--rose); border-color: var(--rose); color: var(--page); }
.wizard-steps li.is-done::before { background: var(--teal); border-color: var(--teal); color: var(--page); content: "✓"; }
@media (max-width: 480px) { .wizard-steps { flex-wrap: wrap; gap: 0 22px; } }
.wizard-pane h2 { font-size: clamp(30px, 3.4vw, 44px); font-weight: 600; letter-spacing: -.035em; line-height: 1.05; margin-bottom: 8px; }
.wizard-pane .lede { color: var(--muted); margin-bottom: 22px; max-width: 52ch; }
.field-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0 22px; }
.field-grid .form-input { margin-bottom: 14px; }
.field-hint { font-size: 13.5px; color: var(--muted); margin: -8px 0 14px; }
.wizard-actions { display: flex; justify-content: space-between; gap: 12px; margin-top: 10px; padding-top: 18px; border-top: 1px solid var(--line); }
.review .facts { margin-top: 0; }
.review code { display: block; padding: 10px 12px; margin: 6px 0 14px; background: var(--surface); border-radius: 10px; font: 13px/1.5 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; }
.checks { list-style: none; margin: 14px 0; }
.checks li { display: flex; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 15px; }
.checks li::before { content: ""; flex: none; width: 9px; height: 9px; margin-top: 7px; border-radius: 50%; background: var(--teal); }
.checks li.is-failed::before { background: var(--danger); }
.checks li.is-warning::before { background: var(--amber); }
.checks li small { display: block; color: var(--muted); }
.warn-note { padding: 10px 14px; margin: 0 0 16px; border-left: 3px solid var(--amber); font-size: 15px; }

/* ---------- the dashboard header, facts and figures */
.server-head { padding: clamp(18px, 2.4vw, 30px) 0 20px; }
.server-facts { margin-top: 0; }
.server-facts div { grid-template-columns: 7rem minmax(0, 1fr); }
.server-facts code { font: 15px var(--mono); }
.range-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 18px 0 14px; }
.range-row .btn[aria-pressed=true] { border-color: var(--ink); background: var(--surface); }
.range-note { margin-left: auto; font-size: 13.5px; color: var(--muted); }
.figure-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 0 18px; margin: 0 0 22px; }
.figure-row > div { padding: 12px 0 14px; border-top: 1px solid var(--line); }
.figure-row > div:last-child { border-bottom: 0; }
.figure-row dt { font-size: 13.5px; color: var(--muted); }
.figure-row dd { font-size: 24px; font-weight: 600; letter-spacing: -.025em; line-height: 1.15; }
.figure-row dd small { display: block; font-size: 13px; font-weight: 400; color: var(--muted); letter-spacing: 0; }
.figure-row dd.is-danger { color: var(--danger); }
.figure-row a { color: inherit; text-decoration: none; }
.figure-row a:hover dd { text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 4px; }

/* Charts sit on the console plate, dark in both themes, with tokens the dataviz validator passed. */
.charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }
.viz-root { --surface-1: #0b0f1d; --text-primary: #eef0f8; --text-secondary: #a8aec4; --muted-ink: #7f869d; --grid: #1a2135; --axis: #2a3350;
  --series-rose: #d85a88; --series-amber: #bf8128; --series-violet: #9b7bd0; --series-teal: #2fa87a; --series-coral: #e97c5c; --series-danger: #e66767; --dim: #3b4460;
  color-scheme: dark; position: relative; padding: 14px 16px 10px; background: var(--surface-1); color: var(--text-primary); border-radius: 14px; min-width: 0; }
.viz-root.is-wide { grid-column: 1 / -1; }
.viz-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.viz-title { font: 500 15px/1.3 var(--sans); }
.viz-sub { font-size: 12.5px; color: var(--text-secondary); }
.viz-legend { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 4px 0 2px; font-size: 12.5px; color: var(--text-secondary); }
.viz-legend i { display: inline-block; width: 14px; height: 2px; vertical-align: middle; margin-right: 6px; border-radius: 1px; }
.viz-legend i.is-rect { height: 8px; border-radius: 2px; }
.viz-plot { position: relative; width: 100%; }
.viz-plot svg { display: block; width: 100%; height: auto; overflow: visible; }
.viz-plot .grid line { stroke: var(--grid); stroke-width: 1; }
.viz-plot .axis line, .viz-plot .axis path { stroke: var(--axis); stroke-width: 1; }
.viz-plot .tick text, .viz-plot .label { fill: var(--muted-ink); font: 11px var(--sans); }
.viz-plot .mark-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.viz-plot .mark-area { opacity: .1; }
.viz-plot .mark-bar { rx: 0; }
.viz-plot .mark-dot { stroke: var(--surface-1); stroke-width: 2; }
.viz-plot .crosshair { stroke: var(--text-secondary); stroke-width: 1; pointer-events: none; }
.viz-plot .hit { fill: transparent; }
.viz-plot .ref-line { stroke: var(--text-secondary); stroke-width: 1; stroke-dasharray: 4 4; }
.viz-plot .mark-bar:hover, .viz-plot .mark-dot:hover { filter: brightness(1.25); }
.viz-tip { position: absolute; z-index: 5; pointer-events: none; min-width: 120px; padding: 8px 10px; background: #121829; border: 1px solid var(--axis); border-radius: 10px; font-size: 12.5px; color: var(--text-primary); box-shadow: 0 10px 24px -12px rgb(0 0 0 / .8); }
.viz-tip[hidden] { display: none; }
.viz-tip b { display: block; font-size: 14px; }
.viz-tip .tip-row { display: flex; align-items: center; gap: 8px; margin-top: 3px; }
.viz-tip .tip-row i { width: 12px; height: 2px; }
.viz-tip .tip-row span:last-child { margin-left: auto; font-weight: 600; }
.viz-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 6px; font-size: 12.5px; color: var(--text-secondary); }
.viz-foot .link-btn { min-height: 28px; font-size: 12.5px; color: var(--text-secondary); }
.viz-table { width: 100%; margin-top: 8px; border-collapse: collapse; font-size: 12.5px; }
.viz-table th, .viz-table td { padding: 4px 8px 4px 0; border-top: 1px solid var(--grid); text-align: left; font-variant-numeric: tabular-nums; }
.viz-table[hidden] { display: none; }
.viz-strip { display: flex; height: 14px; border-radius: 7px; overflow: hidden; background: var(--dim); }
.viz-strip i { display: block; height: 100%; }
.viz-strip i.is-online { background: var(--series-teal); } .viz-strip i.is-degraded { background: var(--series-coral); }
.viz-strip i.is-crashed, .viz-strip i.is-halted { background: var(--series-danger); } .viz-strip i.is-offline { background: var(--dim); }
.viz-strip i.is-restarting, .viz-strip i.is-updating, .viz-strip i.is-starting, .viz-strip i.is-stopping { background: var(--series-amber); }
.viz-dots { display: flex; flex-wrap: wrap; gap: 8px; padding: 8px 0; }
.viz-dots i { width: 12px; height: 12px; border-radius: 50%; background: var(--series-teal); }
.viz-dots i.is-failed { background: var(--series-danger); } .viz-dots i.is-running { background: transparent; border: 2px solid var(--series-teal); }
.viz-empty { padding: 24px 0; color: var(--text-secondary); font-size: 14px; }
.events { margin-top: 26px; }
.event-list { list-style: none; margin-top: 10px; }
.event-list li { display: grid; grid-template-columns: 7.5rem 7rem minmax(0, 1fr); gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 15px; }
.event-list .when { color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.event-list .kind { color: var(--muted); }
.event-list li.is-failed .what { color: var(--danger); }
@media (max-width: 640px) { .event-list li { grid-template-columns: 1fr; gap: 2px; } }

/* ---------- console command bar and the player log line */
.log-line.player { color: #8fd6c0; }
.cmd-form { margin-top: 10px; }
.cmd-presets { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.cmd-presets:empty { display: none; }
.cmd-presets .btn { min-height: 34px; padding: 4px 14px 4px 11px; font-size: 14px; --dot: var(--violet); }
.cmd-line { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: stretch; border: 1px solid var(--line); border-radius: 12px; background: var(--console); color: var(--console-ink); }
.cmd-line:focus-within { border-color: var(--ink); }
.cmd-line .prompt { display: flex; align-items: center; padding: 0 4px 0 14px; font: 15px var(--mono); color: var(--muted); user-select: none; }
.cmd-input { min-width: 0; min-height: 46px; padding: 8px 10px; border: 0; background: transparent; color: inherit; font: 15px var(--mono); }
.cmd-input:focus { outline: none; }
.cmd-line .btn { border: 0; border-left: 1px solid var(--line); border-radius: 0 12px 12px 0; min-height: 46px; color: var(--console-ink); }
.cmd-hint { margin-top: 6px; font-size: 13px; color: var(--muted); }

/* ---------- settings, files, access, delete */
.settings-form .field-grid { margin-top: 6px; }
.danger-zone { margin-top: 36px; padding-top: 18px; border-top: 1px solid var(--line); }
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; font-size: 14.5px; color: var(--muted); }
.crumbs a, .crumbs button { color: var(--muted); text-decoration: none; background: none; border: 0; font: inherit; cursor: pointer; padding: 0; }
.crumbs a:hover, .crumbs button:hover { color: var(--ink); text-decoration: underline; }
.crumbs .sep { color: var(--line); }
.files-table td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.files-table .is-dir { font-weight: 600; }
.files-table .is-dir::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 10px; border-radius: 2px; background: var(--amber); }
.files-table .is-locked { color: var(--muted); }
.file-editor { margin-top: 20px; }
.file-editor textarea { display: block; width: 100%; min-height: 50vh; padding: 14px; border: 1px solid var(--line); background: var(--console); color: var(--console-ink); font: 13.5px/1.55 var(--mono); resize: vertical; border-radius: 12px; }
.file-editor textarea:focus { outline: 0; border-color: var(--ink); }
.access-table .flags { display: flex; flex-wrap: wrap; gap: 6px; }
.grants-flags { border: 0; padding: 0; margin: 10px 0 4px; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px; }
.grants-flags label { display: flex; align-items: center; gap: 10px; min-height: 36px; font-size: 15px; cursor: pointer; }
.grants-flags input { width: 18px; height: 18px; accent-color: var(--rose); }
.grants-flags small { display: block; font-size: 13px; color: var(--muted); }
.people-table .grants-cell { font-size: 14px; color: var(--muted); }
.people-table .grants-cell b { font-weight: 500; color: var(--ink); }
.modal-box .check { margin: 8px 0 14px; }

/* ---------- audit filters, pager, passkeys */
.audit-filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 18px; margin: clamp(20px, 3vw, 32px) 0 18px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.audit-filters .filter { min-width: 150px; }
.audit-filters .filter-wide { flex: 1 1 220px; }
.audit-filters .filter-custom { display: flex; gap: 10px; align-items: flex-end; }
.audit-filters .form-input { margin-bottom: 0; min-height: 44px; font-size: 15px; }
.audit-filters .filter-actions { display: flex; gap: 10px; align-items: center; }
.audit-table td { vertical-align: top; }
.audit-table td.when { white-space: nowrap; color: var(--muted); font-variant-numeric: tabular-nums; }
.audit-table td.detail { max-width: 36ch; color: var(--muted); overflow-wrap: anywhere; }
.audit-table tr.row-failed td { color: var(--danger); }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; }
@media (max-width: 820px) {
  .audit-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .audit-table tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
  .audit-table td, .audit-table tr:last-child td { border-bottom: 0; padding: 0; }
  .audit-table td.when { grid-column: 2; grid-row: 1; }
  .audit-table td.detail { grid-column: 1 / -1; }
}
.passkey-list { list-style: none; margin: 10px 0 14px; border-top: 1px solid var(--line); }
.passkey-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.passkey-list small { display: block; color: var(--muted); font-size: 13.5px; }
.passkey-list .link-btn { font-size: 14.5px; }
.passkey-empty { color: var(--muted); font-size: 15px; padding: 10px 0; }

/* The Mac's light theme keeps the console plate dark, so chart tokens never change by theme. */

/* ---- folded from account.css ---- */
/* account.js: step-up modal spacing. portal.css has no .actions rule, so the passkey pill
   would sit flush against the code field's label. Folded into portal.css later. */
#modal-stepup .actions { margin: 0 0 18px; }
#modal-stepup .actions:has(> [hidden]) { display: none; }
#stepup-error { margin: -10px 0 16px; }

/* ---- folded from assistant.css ---- */
/* assistant.js, v4: the proposal card's server pill and its "on <server>" line. Folded into portal.css. */
.ask-head .ask-pill { flex: none; min-height: 24px; padding: 2px 10px 2px 8px; gap: 6px; font-size: 12.5px; line-height: 1; transform: translateY(2px); }
.ask-head .ask-pill .status-dot { width: 8px; height: 8px; }
.ask-detail .ask-on { font-weight: 600; color: var(--ink); }
.thread li.event.ask.is-done .ask-head .ask-pill { opacity: .6; }

/* ---- folded from audit.css ---- */
/* audit.js, the portal-wide Activity page. To be folded into portal.css. */
#audit-table-body[aria-busy="true"] { opacity: .45; transition: opacity .25s var(--ease); }
.audit-table td.via { white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { #audit-table-body[aria-busy="true"] { transition: none; } }

/* ---- folded from charts.css ---- */
/* charts.js, the Overview tab. Everything .viz-* that is not here lives in portal.css. */
.figure-row > div > a { display: block; }
.figure-row > div > a:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; border-radius: 6px; }
.figure-row.is-stale, .charts.is-stale, .event-list.is-stale { opacity: .55; transition: opacity .25s var(--ease); }
.range-note.is-error { color: var(--danger); }
.viz-title { margin: 0; }
.viz-root:focus { outline: none; }
.viz-plot[tabindex]:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; border-radius: 6px; }
.viz-plot .mark-bar.is-hot { filter: brightness(1.25); }
.viz-plot .mark-dot { stroke: var(--surface-1); stroke-width: 2; }
.viz-strip-wrap { position: relative; padding: 8px 0 6px; }
.viz-strip-wrap .crash-tick { position: absolute; top: 4px; bottom: 2px; width: 2px; margin-left: -1px; background: var(--series-danger); pointer-events: none; }
.viz-strip i { min-width: 1px; }
.viz-dots .viz-dot { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; padding: 0; border: 0; border-radius: 50%; background: none; cursor: pointer; }
.viz-dots .viz-dot:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.viz-tip .tip-row i { flex: none; border-radius: 1px; }
.viz-foot .caption { color: var(--text-secondary); }
.event-list li.row-empty { display: block; color: var(--muted); }

/* ---- folded from console.css ---- */
/* Console command bar (portal/console.js). Folded into portal.css after .cmd-hint. */
.cmd-hint.row-failed { color: var(--danger); }
.cmd-input:disabled { opacity: .4; cursor: default; }

/* ---- folded from create.css ---- */
/* create.css: the create and import wizard. Folded into portal.css; everything is token-based. */

/* The chosen template card. */
.template-card[aria-pressed="true"] { border-color: var(--rose); box-shadow: inset 0 0 0 1px var(--rose); }
.template-card:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* Verified reads teal, unverified amber, outside a card as well as inside one. */
.chip.chip-ok::before { background: var(--teal); }
.chip.is-unverified::before { background: var(--amber); }

/* The ruled facts list: portal.css has .server-facts overrides but no .facts base rule, so the wizard carries its own. */
.wizard .facts { margin: 0 0 18px; max-width: none; }
.wizard .facts div { display: grid; grid-template-columns: 9rem minmax(0, 1fr); gap: 16px; padding: 11px 0; border-top: 1px solid var(--line); font-size: 16px; }
.wizard .facts dt { color: var(--muted); }
.wizard .facts dd { margin: 0; overflow-wrap: anywhere; }

/* Per-field errors and the shared error line. portal.css colours row-failed only on table cells. */
.field-error { font-size: 14px; color: var(--danger); margin: -8px 0 14px; }
.field-error:empty { display: none; }
.form-input[aria-invalid="true"] { border-color: var(--danger); }
.setting-state.row-failed { color: var(--danger); }

/* Headings take focus on a step change for screen readers; no ring for that. */
.wizard-pane h2:focus { outline: none; }

/* The job log and the buttons after create or import. */
.wizard .result-meta { font-size: 13.5px; color: var(--muted); margin: 6px 0 0; }
.wizard .telemetry-pre { max-height: 50vh; overflow: auto; margin: 12px 0 18px; }
.wizard .result-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 18px; }
.wizard .field-label .chip { margin-left: 6px; font-weight: 400; }

/* ---- folded from files.css ---- */
/* Files tab (portal/files.js). To be folded into portal.css after the .files-table rules. */
.files-form { margin: -2px 0 18px; }
.files-form .form-input { width: 18rem; }
.files-table .name-btn { min-height: 36px; padding: 0; border: 0; background: none; font: inherit; color: var(--ink); cursor: pointer; text-align: left; }
.files-table .name-btn:hover, .files-table .name-btn:focus-visible { text-decoration: underline; text-underline-offset: 5px; }
.crumbs [aria-current] { color: var(--ink); }

/* ---- fixes from the first full browser pass ---- */
/* Ruled facts rows, label beside value; the server header and the wizard review use them.
   On phones the label sits above the value so an address keeps its port on one line. */
.facts { margin-top: clamp(16px, 2vw, 28px); font-size: 16px; }
.facts div { display: grid; grid-template-columns: 7.2rem minmax(0, 1fr); gap: 14px; padding: 11px 0; border-top: 1px solid var(--line); }
.facts div:last-child { border-bottom: 1px solid var(--line); }
.facts dt { font-weight: 600; }
.facts dd { color: var(--muted); overflow-wrap: anywhere; }
.facts dd code { color: var(--ink); }
@media (max-width: 480px) { .facts div { grid-template-columns: 1fr; gap: 2px 0; } }
.server-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px clamp(24px, 4vw, 64px); align-items: start; }
.server-head .control-bar { justify-content: flex-end; padding-top: 10px; max-width: 420px; }
@media (max-width: 900px) { .server-head { grid-template-columns: 1fr; } .server-head .control-bar { justify-content: flex-start; max-width: none; } }
/* Two charts per row; the uptime strip spans both; one per row on narrow screens. */
.charts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 760px) { .charts { grid-template-columns: 1fr; } }

/* ---- Security Suite (#security) ---- */
.security-strip { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.security-strip dd small { display: block; font-size: 13px; font-weight: 400; color: var(--muted); letter-spacing: 0; margin-top: 2px; }
@media (max-width: 1120px) { .security-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 680px) { .security-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.sec-subnav-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--ink); margin-bottom: 18px; }
.sec-subnav { display: flex; flex-wrap: wrap; gap: 6px 22px; }
.sec-subnav-btn { background: none; border: none; border-bottom: 2px solid transparent; padding: 8px 0 10px; font: inherit; color: var(--muted); cursor: pointer; display: inline-flex; align-items: baseline; gap: 8px; transition: color 0.15s ease, border-color 0.15s ease; }
.sec-subnav-btn span { font-size: 15px; font-weight: 600; color: var(--ink); }
.sec-subnav-btn small { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.sec-subnav-btn:hover span { color: var(--accent, var(--ink)); }
.sec-subnav-btn.is-active { border-bottom-color: var(--ink); color: var(--ink); }

.sec-charts-grid { display: grid; grid-template-columns: 1.3fr 1.15fr 0.95fr; gap: 18px; margin-bottom: 22px; }
@media (max-width: 1180px) { .sec-charts-grid { grid-template-columns: 1fr; } }
.sec-chart-box { display: flex; flex-direction: column; justify-content: space-between; gap: 10px; }
.sec-chart-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.sec-chart-kicker { display: block; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.sec-chart-big { display: block; font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; margin-top: 2px; }
.sec-chart-sub { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.sec-chart-legend { display: flex; gap: 12px; font-size: 12px; color: var(--muted); }
.sec-chart-legend span { display: inline-flex; align-items: center; gap: 5px; }
.sec-dot-ok { width: 8px; height: 8px; border-radius: 50%; background: var(--ok, #1b7f4b); display: inline-block; }
.sec-dot-Hot { width: 8px; height: 8px; border-radius: 50%; background: var(--bad, #c93b2b); display: inline-block; }

.sec-svg-chart { width: 100%; height: auto; display: block; overflow: visible; }
.sec-svg-grid { stroke: var(--line); stroke-dasharray: 2 3; stroke-width: 1; }
.sec-svg-axis { stroke: var(--ink); stroke-width: 1; }
.sec-svg-label { font-size: 10.5px; fill: var(--muted); font-family: var(--mono, ui-monospace, monospace); }
.sec-svg-area-ok { fill: rgba(27, 127, 75, 0.12); }
.sec-svg-line-ok { fill: none; stroke: var(--ok, #1b7f4b); stroke-width: 2; }
.sec-svg-line-hot { fill: none; stroke: var(--bad, #c93b2b); stroke-width: 2; stroke-dasharray: 3 2; }
.sec-svg-pt-ok { fill: var(--ok, #1b7f4b); }

.sec-bars-list { display: flex; flex-direction: column; gap: 7px; }
.sec-bar-row { display: grid; grid-template-columns: 140px 1fr 78px; align-items: center; gap: 10px; font-size: 12.5px; }
.sec-bar-tactic { font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.sec-bar-track { height: 6px; background: var(--line); overflow: hidden; border-radius: 2px; }
.sec-bar-fill { height: 100%; background: var(--ok, #1b7f4b); }
.sec-bar-fill.is-warn { background: var(--warn, #b76e11); }
.sec-bar-val { text-align: right; font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.sec-bar-val code { font-size: 11px; color: var(--muted); margin-right: 4px; }

.sec-stack-bar { display: flex; width: 100%; height: 14px; border-radius: 3px; overflow: hidden; background: var(--line); margin: 4px 0 8px; }
.sec-stack-s1 { background: var(--ok, #1b7f4b); height: 100%; }
.sec-stack-s2 { background: #3b82f6; height: 100%; }
.sec-stack-s3 { background: #14b8a6; height: 100%; }
.sec-stack-legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 11.5px; color: var(--muted); }
.sec-stack-legend span { display: inline-flex; align-items: center; gap: 5px; }
.sec-dot-mid { width: 8px; height: 8px; border-radius: 50%; background: #3b82f6; display: inline-block; }
.sec-dot-soft { width: 8px; height: 8px; border-radius: 50%; background: #14b8a6; display: inline-block; }
.sec-mini-kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 18px; margin: 4px 0 0; padding-top: 10px; border-top: 1px solid var(--line); }
.sec-mini-kpis dt { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.sec-mini-kpis dd { margin: 2px 0 0; font-size: 17px; font-weight: 600; }

.sec-selftest-box { padding: 14px 0 18px; margin-bottom: 18px; border-bottom: 1px solid var(--ink); }
.sec-selftest-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.sec-selftest-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
@media (max-width: 1180px) { .sec-selftest-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 680px) { .sec-selftest-grid { grid-template-columns: 1fr; } }
.sec-selftest-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; font-size: 12px; }
.sec-selftest-item strong { display: block; font-size: 13.5px; }

.sec-findings-section { padding-top: 4px; margin-bottom: 1.25rem; }
.sec-findings-list { display: flex; flex-direction: column; gap: 0; border-top: 1px solid var(--line); margin-top: 10px; }
.sec-finding-card { padding: 14px 0 16px; border-bottom: 1px solid var(--line); }
.sec-finding-card[data-severity="critical"] { border-left: 3px solid var(--bad, #c93b2b); padding-left: 14px; }
.sec-finding-card[data-severity="high"] { border-left: 3px solid var(--warn, #b76e11); padding-left: 14px; }
.sec-finding-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.sec-finding-title-wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.sec-finding-cat { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.sec-finding-title { font-size: 16px; font-weight: 600; margin: 0; }
.sec-finding-meta { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.sec-finding-summary { margin: 0 0 10px; font-size: 14px; color: var(--ink); }
.sec-finding-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

.sec-allclear-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; padding: 14px 0; border-bottom: 1px solid var(--line); }
@media (max-width: 960px) { .sec-allclear-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .sec-allclear-grid { grid-template-columns: 1fr; } }
.sec-allclear-item strong { display: block; font-size: 15px; margin-top: 3px; font-variant-numeric: tabular-nums; }
.sec-finding-kicker { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }

.security-spread { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 56px); padding: 20px 0; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--line); margin-bottom: 1rem; }
@media (max-width: 920px) { .security-spread { grid-template-columns: 1fr; } }
.sec-eyebrow { font-size: 12.5px; color: var(--muted); margin-bottom: 2px; font-variant-numeric: tabular-nums; text-transform: uppercase; letter-spacing: 0.04em; }
.sec-proposal-list { list-style: none; margin: 10px 0 0; padding: 0; }
.sec-proposal-item { padding: 10px 0; border-top: 1px solid var(--line); }

.sec-air-dl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 18px; margin: 10px 0 14px; padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
@media (max-width: 680px) { .sec-air-dl { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.sec-air-dl dt { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); margin-bottom: 2px; }
.sec-air-dl dd { margin: 0; font-size: 14px; font-weight: 600; }
.sec-recovery-bar { display: flex; flex-wrap: wrap; gap: 8px; }

.sec-quarantine-form { padding-top: 4px; }
.sec-portlock-dl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 24px; margin: 10px 0 6px; padding: 14px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
@media (max-width: 820px) { .sec-portlock-dl { grid-template-columns: 1fr; } }
.sec-portlock-dl dt { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); margin-bottom: 4px; }
.sec-portlock-dl dd { margin: 0; font-size: 14px; font-weight: 600; }
.sec-host-drawer { padding: 16px 0 20px; margin-bottom: 16px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

.security-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 56px); padding-top: 18px; margin-bottom: 1.75rem; }
@media (max-width: 920px) { .security-split { grid-template-columns: 1fr; } }

.table-wrapper { overflow-x: auto; max-inline-size: 100%; container-type: inline-size; }
.table-wrapper:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; }
.table-wrapper thead { position: sticky; inset-block-start: 0; z-index: 1; background: var(--page); }
/* ---- End Security Suite ---- */

/* ---- Standalone Troubleshooting Tab (#troubleshooting) ---- */
.ts-verdict-banner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 0 20px; border-bottom: 1px solid var(--ink); margin-bottom: 20px; }
.ts-verdict-banner.is-crit { border-left: 3px solid var(--bad, #c93b2b); padding-left: 14px; }
.ts-verdict-banner.is-warn { border-left: 3px solid var(--warn, #b76e11); padding-left: 14px; }
.ts-outcome-tag { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink); }
.ts-outcome-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok, #1b7f4b); display: inline-block; }
.ts-outcome-tag.is-warn .ts-outcome-dot { background: var(--warn, #b76e11); }
.ts-outcome-tag.is-crit .ts-outcome-dot { background: var(--bad, #c93b2b); }
.ts-toast { padding: 10px 14px; margin: 0 0 18px; border-left: 3px solid var(--ink); background: rgba(0,0,0,0.03); font-size: 14px; }
.ts-toast.is-crit { border-left-color: var(--bad, #c93b2b); color: var(--bad, #c93b2b); }
.ts-toast.is-ok { border-left-color: var(--ok, #1b7f4b); }
.ts-metrics-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px; padding: 6px 0 22px; border-bottom: 1px solid var(--line); margin-bottom: 24px; }
@media (max-width: 960px) { .ts-metrics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .ts-metrics-grid { grid-template-columns: 1fr; } }
.ts-metric-col { display: flex; flex-direction: column; gap: 6px; }
.ts-metric-val { font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; }
.ts-metric-val.is-crit { color: var(--bad, #c93b2b); }
.ts-metric-val.is-warn { color: var(--warn, #b76e11); }
.ts-meter-track { width: 100%; height: 5px; background: var(--line); overflow: hidden; }
.ts-meter-fill { height: 100%; background: var(--ok, #1b7f4b); transition: width 0.25s ease; }
.ts-meter-fill.is-warn { background: var(--warn, #b76e11); }
.ts-meter-fill.is-crit { background: var(--bad, #c93b2b); }
.ts-metric-sub { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ts-charts-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(24px, 4vw, 48px); padding-bottom: 24px; border-bottom: 1px solid var(--line); margin-bottom: 24px; }
@media (max-width: 960px) { .ts-charts-grid { grid-template-columns: 1fr; } }
.viz-root { display: flex; flex-direction: column; gap: 8px; }
.viz-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.viz-title { font-size: 15.5px; font-weight: 600; margin: 0; }
.viz-sub { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.viz-legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--muted); }
.viz-legend span { display: inline-flex; align-items: center; gap: 6px; }
.viz-legend i { width: 10px; height: 10px; display: inline-block; }
.viz-plot svg { width: 100%; height: auto; display: block; border: 1px solid var(--line); padding: 6px; background: rgba(0,0,0,0.015); }
.viz-plot .grid line { stroke: var(--line); stroke-dasharray: 2 3; }
.viz-plot .tick text, .viz-plot .label { font-size: 11px; fill: var(--muted); font-family: var(--mono, monospace); }
.viz-foot { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }
.ts-findings { list-style: none; margin: 12px 0 0; padding: 0; border-top: 1px solid var(--line); }
.ts-finding { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.ts-finding.is-crit { border-left: 3px solid var(--bad, #c93b2b); padding-left: 14px; }
.ts-finding.is-warn { border-left: 3px solid var(--warn, #b76e11); padding-left: 14px; }
.ts-finding-main { flex: 1 1 420px; }
.ts-finding-eyebrow { margin-bottom: 4px; }
.ts-finding-title { display: block; font-size: 16px; margin-bottom: 4px; }
.ts-finding-detail { margin: 0; font-size: 14px; color: var(--muted); line-height: 1.45; }
.ts-proc-cell { display: flex; flex-direction: column; gap: 4px; }
.ts-proc-bar-track { width: 100%; max-width: 180px; height: 4px; background: var(--line); display: block; }
.ts-proc-bar-fill { display: block; height: 100%; background: var(--ink); }

/* ---- SpicyPortal Operator Desk Evolution & Semantic Diagnostics ---- */
:root {
  --state-ok: #0a7a58;
  --state-warn: #b45309;
  --state-crit: #b91c1c;
}
@media (prefers-color-scheme: dark) {
  :root {
    --state-ok: #2ee59d;
    --state-warn: #f5a623;
    --state-crit: #ff6b6b;
  }
}

/* Global KV overflow guard — prevents long Windows paths or URIs from bleeding across columns */
.kv {
  grid-template-columns: minmax(120px, max-content) minmax(0, 1fr);
}
.kv dd, .kv code {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* Sticky Operator Command Bar (.top) — calibrated so all 9 nav links fit cleanly at 1440px */
.top {
  position: sticky;
  top: 0;
  z-index: 60;
  min-height: 58px;
  padding: 0 var(--pad);
  gap: 18px;
  background: color-mix(in srgb, var(--page) 92%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand {
  font-size: 19px;
  letter-spacing: -0.03em;
  padding: 14px 16px 14px 0;
  border-right: 1px solid var(--line);
}
.view-nav {
  margin-left: 0;
  gap: 15px;
  align-self: stretch;
  flex-wrap: nowrap;
}
.view-link {
  min-height: 58px;
  padding: 0 2px;
  border-radius: 0;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  font-size: 13.8px;
  font-weight: 500;
  white-space: nowrap;
  color: var(--muted);
  text-decoration: none !important;
  transition: color .2s var(--ease), border-color .2s var(--ease);
}
.view-link:hover {
  color: var(--ink);
}
.view-link[aria-current="page"] {
  color: var(--ink);
  font-weight: 600;
  border-bottom-color: var(--rose);
}
.session {
  margin-left: auto;
  padding-left: 16px;
  border-left: 1px solid var(--line);
  font-size: 13px;
  gap: 12px;
  white-space: nowrap;
}

/* Sleek Portal View Masthead (.chapter) */
.tone {
  height: 18px;
  border-bottom-width: 2px;
}
.chapter .bar {
  padding: 12px var(--pad);
  border-bottom: 1px solid var(--line);
  align-items: baseline;
}
.chapter-name {
  font-size: clamp(21px, 1.9vw, 25px);
  font-weight: 600;
  letter-spacing: -0.025em;
}
.chapter-note {
  font-size: 13.5px;
  font-variant-numeric: tabular-nums;
}

.page {
  padding-top: 16px;
  max-width: 1540px;
  margin: 0 auto;
}

/* Crisp Single-Row Server Command Header (.server-head) */
.server-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px 28px;
  padding: 12px 0 16px;
  border-bottom: 1px solid var(--ink);
}
.server-facts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 24px;
  margin: 0;
  flex: 1 1 auto;
}
.server-facts > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 24px 0 0;
  border-top: 0;
  border-bottom: 0;
  border-right: 1px solid var(--line);
}
.server-facts > div:last-child {
  border-right: 0;
  padding-right: 0;
}
.server-facts dt {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.server-facts dd {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.server-facts code {
  font: 600 14px var(--mono);
  color: var(--ink);
}
.server-head .control-bar {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 0;
  max-width: none;
  margin-left: auto;
}
.server-head .control-bar .btn {
  min-height: 36px;
  padding: 6px 15px 6px 12px;
  font-size: 13.5px;
  gap: 8px;
}

/* Commercial Hosting Bar & AI Crash Doctor Drawer */
.server-commercial-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 11px 16px;
  margin: 12px 0 16px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--state-ok);
  border-radius: 6px;
  background: color-mix(in srgb, var(--surface) 68%, transparent);
}
.comm-plan-cluster {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.comm-meta {
  font-size: 13px;
  color: var(--muted);
}
.crash-doctor-drawer {
  padding: 16px 18px;
  margin: 0 0 18px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--state-warn);
  border-radius: 6px;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
}
.crash-doctor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.crash-doctor-evidence {
  margin: 8px 0 0;
  padding: 7px 10px;
  border-radius: 4px;
  background: var(--page);
  border: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  overflow-x: auto;
  white-space: pre-wrap;
}

.desk-section {
  padding-top: 22px;
  margin-bottom: 2rem;
  border-top: 1px solid var(--ink);
}
.desk-section .panel-title, .portal-col .panel-title {
  font-size: clamp(19px, 1.8vw, 23px);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.2;
}
.portal-eyebrow {
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 4px;
}

/* Ruled Operator Telemetry Strip (.host-strip, .figure-row, .security-strip, .mods-kpi-strip) */
.host-strip, .figure-row {
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--line);
  border-left: 0;
  border-right: 0;
  border-radius: 0;
  background: transparent;
  gap: 0;
  margin: 0 0 18px;
}
.figure-row {
  grid-template-columns: repeat(7, minmax(0, 1fr));
}
.mods-kpi-strip {
  grid-template-columns: 1.05fr 0.85fr 1.38fr 0.92fr 0.8fr !important;
}
#mods-kpi-target {
  font: 600 13.5px/1.35 var(--mono) !important;
  letter-spacing: -0.015em;
}
.security-strip {
  grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
}
@media (max-width: 1180px) {
  .figure-row { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .mods-kpi-strip { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
  .security-strip { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
}
.host-strip > div, .figure-row > div {
  padding: 12px 16px 12px 0;
  border-top: 0;
  border-right: 1px solid var(--line);
  min-width: 0;
}
.host-strip > div:not(:first-child), .figure-row > div:not(:first-child) {
  padding-left: 16px;
}
.host-strip > div:last-child, .figure-row > div:last-child {
  border-right: 0;
  padding-right: 0;
}
.host-strip dt, .figure-row dt {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 4px;
}
.host-strip dd, .figure-row dd {
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.025em;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.figure-row dd.is-ok { color: var(--state-ok); }
.figure-row dd.is-warn { color: var(--state-warn); }
.figure-row dd.is-danger { color: var(--state-crit); }

/* Mods & Friend Dispatch Workbench Styles (#view-mods) */
.mods-game-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.mods-game-pill {
  appearance: none;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 60%, transparent);
  color: var(--muted);
  padding: 6px 13px;
  border-radius: 999px;
  font: 600 13px/1.2 var(--sans);
  cursor: pointer;
  transition: color .15s var(--ease), border-color .15s var(--ease), background-color .15s var(--ease);
}
.mods-game-pill:hover {
  color: var(--ink);
  border-color: var(--ink);
}
.mods-game-pill.is-active, .mods-game-pill[aria-pressed="true"] {
  color: var(--ink);
  border-color: var(--rose);
  background: color-mix(in srgb, var(--rose) 14%, var(--surface));
}
.mods-dispatch-list {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--line);
  margin-top: 8px;
}
.mods-dispatch-item {
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  min-width: 0;
}
.mods-dispatch-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: nowrap;
  margin-bottom: 4px;
}
.mods-dispatch-head .actions, .mods-dispatch-head .button-row {
  flex-shrink: 0;
  gap: 6px;
}
.mods-dispatch-head .btn {
  min-height: 30px;
  padding: 3px 10px;
  font-size: 12px;
}
.mods-dispatch-label {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
}
.mods-dispatch-note {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-top: 1px;
}
.mods-code-box {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: color-mix(in srgb, var(--surface) 65%, transparent);
  font: 500 12px/1.4 var(--mono);
  color: var(--ink);
  overflow-wrap: anywhere;
  word-break: break-all;
}
.mods-target-sub {
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.mods-target-sub code {
  font: 500 12px var(--mono);
  color: var(--ink);
}
.mods-stage-bar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin-bottom: 12px;
}
.mods-pack-group {
  display: flex;
  flex-direction: column;
}
.mods-pack-field {
  width: 220px !important;
  min-height: 36px !important;
  margin-bottom: 0 !important;
  padding: 6px 12px !important;
  font-size: 13.5px !important;
}
.mods-stage-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.mods-dropzone {
  display: block;
  padding: 16px 18px;
  border: 1px dashed var(--line);
  border-left: 4px solid var(--state-ok);
  border-radius: 6px;
  background: color-mix(in srgb, var(--surface) 42%, transparent);
  cursor: pointer;
  transition: border-color .15s var(--ease), background-color .15s var(--ease);
}
.mods-dropzone:hover, .mods-dropzone.is-dragover {
  border-color: var(--state-ok);
  background: color-mix(in srgb, var(--state-ok) 8%, var(--surface));
}
.mods-dropzone-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}
.mods-dropzone-sub {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 3px;
}
.mods-code-cell {
  font: 12.5px var(--mono);
  overflow-wrap: anywhere;
  word-break: break-all;
}

/* Architectural Console Telemetry Plates (.viz-root & .ts-telemetry-grid) */
.viz-root {
  border-radius: 6px;
  border: 1px solid #1e263d;
  border-top: 2px solid var(--axis);
  padding: 15px 18px 12px;
}
.ts-telemetry-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 22px;
}
@media (max-width: 980px) {
  .ts-telemetry-grid { grid-template-columns: 1fr; }
}
.ts-graph-card {
  border: 1px solid var(--line);
  border-top: 2px solid var(--ink);
  border-radius: 6px;
  padding: 14px 18px 16px;
  background: color-mix(in srgb, var(--surface) 50%, transparent);
}
.ts-graph-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.ts-graph-title {
  font-size: 16px;
  font-weight: 600;
  margin: 0;
}
.ts-graph-badge {
  font-size: 12px;
  font-family: var(--mono);
  color: var(--muted);
}
.ts-svg-wrap {
  width: 100%;
  overflow: hidden;
}
.ts-svg-wrap svg {
  width: 100%;
  height: auto;
  display: block;
}

/* Multi-Card Catalog & Check Grid (.ts-checks-grid, .ts-check-card) */
.ts-checks-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 12px;
}
@media (max-width: 1080px) {
  .ts-checks-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
  .ts-checks-grid { grid-template-columns: 1fr; }
}
.ts-check-card {
  border: 1px solid var(--line);
  border-left: 4px solid var(--line);
  border-radius: 6px;
  padding: 14px 16px;
  background: color-mix(in srgb, var(--surface) 45%, transparent);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.ts-check-card.is-ok { border-left-color: var(--state-ok); }
.ts-check-card.is-warn { border-left-color: var(--state-warn); }
.ts-check-card.is-crit { border-left-color: var(--state-crit); }
.ts-check-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.ts-check-title {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 6px;
}
.ts-check-detail {
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--muted);
  margin: 0;
}

/* Architectural Two-Column Spreads (.portal-spread) */
.portal-spread {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: clamp(28px, 4vw, 56px);
  padding: 16px 0 22px;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--line);
  margin-bottom: 22px;
  align-items: start;
}
.portal-spread.ts-spread {
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.9fr);
}
.portal-spread.ts-bottom-spread {
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  border-top: 0;
  padding-top: 4px;
}
.portal-col {
  min-width: 0;
  overflow: hidden;
}
@media (min-width: 981px) {
  .portal-spread > .portal-col:nth-child(2) {
    padding-left: clamp(24px, 3.2vw, 44px);
    border-left: 1px solid var(--line);
  }
}
@media (max-width: 980px) {
  .portal-spread, .portal-spread.ts-spread, .portal-spread.ts-bottom-spread {
    grid-template-columns: 1fr;
  }
}
.col-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 12px 20px;
  margin-bottom: 12px;
}

/* Semantic Verdict Banner & Outcome Tags */
.ts-verdict-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px 28px;
  padding: 12px 0 14px 18px;
  margin-bottom: 16px;
  border-left: 4px solid var(--state-ok);
  border-bottom: 1px solid var(--line);
}
.ts-verdict-banner.is-warn { border-left-color: var(--state-warn); }
.ts-verdict-banner.is-crit { border-left-color: var(--state-crit); }
.ts-verdict-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
}
.ts-verdict-headline {
  font-size: clamp(19px, 1.8vw, 23px);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.ts-verdict-sub {
  font-size: 14px;
  color: var(--muted);
  margin-top: 4px;
}
.ts-outcome-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--state-ok);
}
.ts-outcome-tag.is-warn { color: var(--state-warn); }
.ts-outcome-tag.is-crit { color: var(--state-crit); }
.ts-outcome-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 22%, transparent);
}
.ts-metric-val.is-ok { color: var(--state-ok); }
.ts-metric-val.is-warn { color: var(--state-warn); }
.ts-metric-val.is-crit { color: var(--state-crit); }
.ts-metric-sub {
  display: block;
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 5px;
}
.ts-meter-track {
  display: block;
  height: 4px;
  width: 100%;
  background: var(--line);
  margin-top: 10px;
  overflow: hidden;
}
.ts-meter-fill { display: block; height: 100%; background: var(--line); }
.ts-meter-fill.is-ok { background: var(--state-ok); }
.ts-meter-fill.is-warn { background: var(--state-warn); }
.ts-meter-fill.is-crit { background: var(--state-crit); }

/* Color-Coded Ruled Findings Ledger & Playbook */
.ts-findings { list-style: none; border-top: 1px solid var(--line); }
.ts-finding {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 15px 0 15px 16px;
  border-bottom: 1px solid var(--line);
  border-left: 4px solid var(--state-ok);
}
.ts-finding.is-warn { border-left-color: var(--state-warn); }
.ts-finding.is-crit { border-left-color: var(--state-crit); }
.ts-finding-main { min-width: 0; flex: 1; }
.ts-finding-eyebrow { margin-bottom: 4px; }
.ts-finding-title { display: block; font-size: 15.5px; font-weight: 600; color: var(--ink); margin-bottom: 3px; }
.ts-finding.is-warn .ts-finding-title { color: var(--state-warn); }
.ts-finding.is-crit .ts-finding-title { color: var(--state-crit); }
.ts-finding-detail { font-size: 13.5px; line-height: 1.48; color: var(--muted); }
.ts-playbook { border-top: 1px solid var(--line); }
.ts-playbook-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}
.ts-playbook-item strong { display: block; font-size: 14.5px; font-weight: 600; margin-bottom: 2px; }
.ts-playbook-item p { font-size: 13px; line-height: 1.4; color: var(--muted); max-width: 44ch; }

/* People & Role Architecture Workbench (#view-people) */
.people-kpi-strip {
  grid-template-columns: 0.85fr 1.25fr 1.05fr 0.95fr 1.1fr !important;
}
@media (max-width: 1180px) {
  .people-kpi-strip { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
}
.role-preset-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--line);
  margin-top: 12px;
}
@media (max-width: 1280px) {
  .role-preset-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .role-preset-grid { grid-template-columns: 1fr; }
}
.role-preset-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px 14px 0;
  border-right: 1px solid var(--line);
  min-width: 0;
}
.role-preset-card:not(:first-child) {
  padding-left: 16px;
}
.role-preset-card:last-child {
  border-right: 0;
  padding-right: 0;
}
.role-preset-top {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.role-preset-slug {
  display: inline-block;
  font: 600 11.5px/1.2 var(--mono);
  color: var(--rose);
  letter-spacing: 0.02em;
}
.role-preset-title {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink);
  margin: 2px 0 0;
  line-height: 1.25;
}
.role-preset-count {
  font: 500 11.5px/1.3 var(--mono);
  color: var(--muted);
}
.role-preset-desc {
  font-size: 12.8px;
  line-height: 1.45;
  color: var(--muted);
  margin: 0;
  flex: 1;
}
.role-preset-foot {
  padding-top: 6px;
}
.preset-badge {
  display: inline-flex;
  align-items: center;
  font: 600 11.5px/1.3 var(--mono);
  padding: 4px 8px;
  border: 1px solid var(--line);
  color: var(--muted);
}
.preset-badge.is-synced {
  color: var(--state-ok);
  border-color: color-mix(in srgb, var(--state-ok) 40%, var(--line));
}
.preset-badge.is-locked {
  color: var(--ink);
}
.groups-matrix th[scope="row"] {
  min-width: 320px;
  max-width: 520px;
}
.perm-row-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.perm-code {
  font: 500 11.5px/1.2 var(--mono);
  color: var(--muted);
  background: transparent;
  padding: 0;
}
.matrix-group-name {
  display: block;
  font: 600 13px/1.25 var(--mono);
  color: var(--ink);
}
.matrix-cat-row th {
  background: color-mix(in srgb, var(--surface) 78%, var(--page));
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--line);
  padding: 9px 12px !important;
}
.matrix-cat-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.matrix-cat-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink);
}
.matrix-cat-badge {
  font: 600 11.5px/1.2 var(--mono);
  color: var(--rose);
}

/* ---------- studio analytics (#analytics, analytics.js): figures, editorial telemetry plates, the product ledger.
   The five busiest products keep one ink: the plate draws it, the ledger marks the row and its step bars. */
.an-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 22px; margin-bottom: 14px; }
.an-range { flex-wrap: wrap; gap: 4px 14px; }
.an-jump { flex-wrap: wrap; gap: 4px 14px; }
.an-actions { gap: 16px; }
.an-ActionLink { padding-left: 14px; border-left: 1px solid var(--line); min-height: 36px; font-size: 14.5px; color: var(--ink); }
.an-figure-strip { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.range-note.is-warn { color: var(--danger); }
.an-caveat { margin: -6px 0 18px; font-size: 13.5px; color: var(--muted); }
/* Suspect opens: said once, in the reader's words, under the figures it changed. */
.an-flag { max-width: 92ch; margin: -8px 0 20px; padding-left: 12px; border-left: 3px solid var(--amber); font-size: 13.5px; line-height: 1.5; color: var(--ink); }
.an-flag[hidden] { display: none; }
.is-stale { opacity: .55; transition: opacity .3s var(--ease); }

/* Live telemetry & daily pulse band (#an-live-pulse) */
.an-pulse { margin-top: 18px; margin-bottom: 24px; }
.an-pulse-body[hidden] { display: none; }
.an-pulse-split {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 24px;
  align-items: start;
  padding-top: 10px;
  border-top: 2px solid var(--ink);
}
.an-pulse-col { min-width: 0; }
.an-pulse-col + .an-pulse-col { border-left: 1px solid var(--line); padding-left: 22px; }
.an-pulse-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 12px; margin-bottom: 8px; }
.an-pulse-filters { flex-wrap: wrap; gap: 2px 10px; font-size: 12.5px; }
.an-pulse-filters .link-btn { min-height: 28px; font-size: 12.5px; }
.an-pulse-sub { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.an-pulse-table th, .an-pulse-table td { padding-top: 7px; padding-bottom: 7px; font-size: 13.5px; }
.an-pulse-btn {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  padding: 0;
  border: 0;
  background: none;
  font: 600 13.8px/1.3 var(--sans);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}
.an-pulse-btn:hover { text-decoration: underline; text-underline-offset: 4px; }
.an-pulse-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; transform: translateY(-1px); }
.an-delta-up { color: var(--teal); font-weight: 600; }
.an-delta-down { color: var(--muted); }
.an-plat-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 5px;
  border: 1px solid var(--line);
  border-radius: 2px;
  font: 600 10px/1.2 var(--mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  vertical-align: middle;
}
.an-plat-tag.is-ios { color: var(--teal); border-color: color-mix(in srgb, var(--teal) 38%, var(--line)); }
.an-plat-tag.is-web { color: var(--violet); border-color: color-mix(in srgb, var(--violet) 38%, var(--line)); }
.an-plat-tag.is-store { color: var(--violet); border-color: color-mix(in srgb, var(--violet) 42%, var(--line)); }
.an-plat-tag.is-sale { color: var(--teal); border-color: color-mix(in srgb, var(--teal) 45%, var(--line)); }
.an-plat-tag.is-refund { color: var(--coral); border-color: color-mix(in srgb, var(--coral) 45%, var(--line)); }

.an-batch-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.an-batch-list li {
  display: grid;
  grid-template-columns: 9.4rem minmax(110px, 0.9fr) minmax(0, 1.6fr);
  gap: 10px;
  align-items: baseline;
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.an-batch-when { font: 500 11.5px/1.3 var(--mono); color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.an-batch-when small { display: block; font: 400 11px/1.25 var(--sans); color: var(--muted); margin-top: 1px; }
.an-batch-app { font-weight: 600; color: var(--ink); min-width: 0; }
.an-batch-events { color: var(--muted); font-variant-numeric: tabular-nums; line-height: 1.35; }
.an-batch-foot { margin-top: 8px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; font-size: 12.5px; color: var(--muted); }

/* Search & filter controls in product and transaction ledgers */
.an-search-input {
  width: 190px;
  min-height: 32px;
  padding: 4px 10px;
  font-size: 13.5px;
  background: var(--page);
  border: 1px solid var(--line);
  border-radius: 2px;
}
.an-search-input:focus { border-color: var(--ink); outline: none; }
.an-tx-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 8px 16px; margin-bottom: 8px; }
.an-tx-filters { flex-wrap: wrap; gap: 4px 12px; font-size: 13px; }
.an-tx-filters .link-btn { min-height: 28px; font-size: 13px; }

/* Editorial broadsheet telemetry plates inside #view-analytics (no dark-panel box on light paper) */
.an-charts-grid { display: grid; grid-template-columns: 1.08fr 0.92fr; gap: 20px; margin-top: 26px; margin-bottom: 14px; }
#view-analytics .viz-root.is-wide { grid-column: 1 / -1; }
#view-analytics .viz-root {
  --surface-1: transparent;
  --text-primary: var(--ink);
  --text-secondary: var(--muted);
  --muted-ink: var(--muted);
  --grid: var(--line);
  --axis: var(--ink);
  --series-rose: var(--rose);
  --series-amber: var(--amber);
  --series-violet: var(--violet);
  --series-teal: var(--teal);
  --series-coral: var(--coral);
  --dim: color-mix(in srgb, var(--muted) 42%, transparent);
  --an-unreported: color-mix(in srgb, var(--muted) 12%, transparent);
  color-scheme: inherit;
  background: color-mix(in srgb, var(--surface) 38%, transparent);
  color: var(--ink);
  border: 1px solid var(--line);
  border-top: 2px solid var(--ink);
  border-radius: 0;
  padding: 16px 20px 14px;
  gap: 10px;
}
#view-analytics .viz-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 16px; margin-bottom: 2px; }
.an-viz-title-group { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; }
#view-analytics .viz-title { font: 600 17px/1.25 var(--display); letter-spacing: -0.02em; color: var(--ink); margin: 0; }
#view-analytics .viz-sub { font-size: 13px; color: var(--muted); }
.an-chart-modes { gap: 12px; font-size: 13px; }
.an-chart-modes .link-btn, .an-funnel-tabs .link-btn { min-height: 28px; font-size: 13px; }
.an-funnel-tabs { flex-wrap: wrap; gap: 4px 14px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
#view-analytics .viz-legend { gap: 6px 16px; font-size: 12.5px; color: var(--muted); margin: 0; }
#view-analytics .viz-legend i.is-rect { width: 10px; height: 10px; border-radius: 2px; }
#view-analytics .viz-plot svg { border: 0; padding: 0; background: transparent; overflow: visible; }
#view-analytics .viz-plot .grid line { stroke: var(--line); stroke-dasharray: 2 3; }
#view-analytics .viz-plot .axis { stroke: var(--ink); stroke-width: 1; }
#view-analytics .viz-plot .tick text, #view-analytics .viz-plot .label { fill: var(--muted); font: 500 11px var(--mono); }
/* A halo in the page colour lets a leader line pass behind a label without crossing its letters. */
#view-analytics .viz-plot .an-bar-Tag { fill: var(--ink); font: 600 10.5px var(--mono); paint-order: stroke; stroke: var(--page); stroke-width: 4px; stroke-linejoin: round; }
#view-analytics .viz-plot .an-unreported { fill: var(--an-unreported); }
#view-analytics .viz-plot .an-focus { fill: color-mix(in srgb, var(--ink) 6%, transparent); pointer-events: none; }
#view-analytics .viz-tip { background: var(--page); color: var(--ink); border: 1px solid var(--ink); border-radius: 4px; box-shadow: 0 8px 20px -10px rgb(0 0 0 / .28); }
#view-analytics .viz-foot { padding-top: 6px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); }
#view-analytics .viz-foot .link-btn { color: var(--ink); font-size: 12.5px; }

/* 6-Stage Storefront Acquisition & Revenue Strip + 2-Column Split inside #an-chart-store */
.an-store-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 10px 0;
  margin: 0;
}
.an-store-strip > div { padding: 0 12px 0 0; border-right: 1px solid var(--line); min-width: 0; }
.an-store-strip > div:not(:first-child) { padding-left: 12px; }
.an-store-strip > div:last-child { border-right: 0; padding-right: 0; }
.an-store-strip dt { font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.an-store-strip dd { font: 600 16px/1.25 var(--sans); color: var(--ink); font-variant-numeric: tabular-nums; margin-top: 2px; }
.an-store-strip small { display: block; font-size: 11.5px; line-height: 1.35; color: var(--muted); font-variant-numeric: tabular-nums; margin-top: 2px; }
.an-conn-strip { grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 6px 0 14px; }
.an-conn-strip:empty { display: none; }
.an-conn-strip dd.is-ok { color: var(--teal); }
.an-conn-strip dd.is-warn { color: var(--amber); }
.an-conn-strip dd.is-bad { color: var(--coral); }

.an-store-split {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
  padding-top: 6px;
}
.an-store-col-chart { min-width: 0; }
.an-store-col-breakdown { min-width: 0; border-left: 1px solid var(--line); padding-left: 20px; }
.an-breakdown-title { font: 600 13px/1.3 var(--sans); color: var(--ink); margin: 0 0 8px; letter-spacing: 0.01em; }
.an-breakdown-title.an-breakdown-next { margin-top: 16px; }
.an-viz-table-wrap { max-width: 100%; overflow-x: auto; }
.an-empty-line { margin: 4px 0 0; font-size: 12.8px; color: var(--muted); }

/* Entry Gate summary bar + progression bars inside #an-chart-funnel */
.an-entry-gate {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 12px;
  padding: 8px 12px;
  background: color-mix(in srgb, var(--surface) 75%, transparent);
  border-left: 3px solid var(--ink);
  font-size: 13px;
}
.an-gate-kicker { font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.an-gate-val { font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.an-gate-sub { margin-left: auto; font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }

.an-funnel-rows { list-style: none; margin: 6px 0 4px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.an-funnel-rows.an-funnel-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 28px;
}
.an-funnel-rows li { display: grid; grid-template-columns: minmax(140px, 1.25fr) auto minmax(54px, 0.75fr) auto; align-items: center; gap: 10px; font-size: 12.8px; color: var(--ink); }
.an-sku-rows li { grid-template-columns: minmax(155px, 1.4fr) auto minmax(44px, 0.55fr) auto; }
.an-funnel-rows li.is-zero { color: var(--muted); }
.an-funnel-rows .fn-label { font-weight: 500; line-height: 1.3; }
.an-funnel-rows .fn-count { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.an-funnel-rows .fn-track { display: block; height: 7px; border-radius: 1px; background: var(--line); overflow: hidden; }
.an-funnel-rows .fn-track i { display: block; height: 100%; border-radius: 1px; transition: width .45s var(--ease); }
.an-funnel-rows .fn-rate { text-align: right; font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.an-rev-breakdown { padding: 4px 0; gap: 9px; }

.an-ledger { margin-top: 28px; }
.an-ledger .pane-head { align-items: flex-end; gap: 12px 20px; flex-wrap: wrap; }
.an-head-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.an-table th.num, .an-table td.num { text-align: right; padding-right: 22px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.an-table td.num small, .an-table td small.an-sub { display: block; font-size: 12.5px; color: var(--muted); font-weight: 400; }
.an-table td { vertical-align: middle; }
.an-table td.an-store-col { font-variant-numeric: tabular-nums; }
.an-store-main { display: block; font-weight: 600; color: var(--ink); }
.an-table .an-goal, .an-table .an-seen { color: var(--muted); }
.an-total-row td { border-top: 1.5px solid var(--ink); background: color-mix(in srgb, var(--surface) 45%, transparent); font-weight: 600; }
.an-webhook-tag { display: inline-block; margin-left: 8px; padding: 1px 6px; border: 1px solid var(--line); border-radius: 3px; font: 600 10.5px/1.2 var(--mono); color: var(--teal); letter-spacing: .03em; vertical-align: baseline; }
.an-webhook-tag.is-asc { color: var(--violet); margin-left: 6px; }
.an-asc-state { display: block; font-size: 12px; line-height: 1.35; margin-top: 2px; color: var(--muted); }
.an-asc-state.is-ok { color: var(--teal); font-weight: 500; }
.an-asc-state.is-warn { color: var(--amber); font-weight: 500; }
.an-asc-state.is-bad { color: var(--coral); font-weight: 500; }
.an-price-col { min-width: 144px; max-width: 240px; font-variant-numeric: tabular-nums; }
.an-price-col small.an-sub { white-space: normal; line-height: 1.35; }
.an-price-main { display: block; font-weight: 600; color: var(--ink); white-space: nowrap; }
.an-price-main.is-sale { color: var(--teal); }
.an-price-main.is-preorder { color: var(--amber); }
.an-price-main.is-muted { color: var(--muted); font-weight: 500; }
.an-store-table th, .an-store-table td { padding-right: 12px; }
.an-store-table th.num, .an-store-table td.num { padding-right: 14px; }
.an-store-table th:last-child, .an-store-table td:last-child { padding-right: 0; }
.an-store-table th:nth-child(4) { min-width: 108px; }
.an-pricing-block { margin-top: 16px; max-width: 820px; border-top: 1px solid var(--line); padding-top: 12px; }
.an-pricing-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; margin-bottom: 8px; }
.an-pricing-title-group { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; }
.an-pricing-title { font: 600 13.5px/1.3 var(--sans); color: var(--ink); letter-spacing: 0.01em; }
.an-pricing-release { font: 500 12px/1.3 var(--mono); color: var(--muted); }
.an-pricing-summary { font: 600 13px/1.35 var(--sans); color: var(--ink); font-variant-numeric: tabular-nums; }
.an-pricing-summary.is-sale { color: var(--teal); }
.an-pricing-summary.is-preorder { color: var(--amber); }
.an-pricing-summary.is-muted { color: var(--muted); font-weight: 500; }
.an-pricing-list { list-style: none; margin: 0; padding: 0; }
.an-pricing-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: 4px 16px; padding: 6px 0; border-top: 1px solid var(--line); font-size: 13.5px; }
.an-pricing-item { color: var(--ink); font-weight: 500; min-width: 0; }
.an-pricing-item-meta { display: block; font: 400 11.5px/1.35 var(--mono); color: var(--muted); overflow-wrap: anywhere; }
.an-pricing-amt { text-align: right; font: 600 13px/1.3 var(--mono); color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
@container (max-width: 520px) {
  .an-pricing-head { flex-direction: column; align-items: flex-start; gap: 4px; }
  .an-pricing-list li { grid-template-columns: 1fr; gap: 2px; }
  .an-pricing-amt { text-align: left; }
}
.an-tx-drawer { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.an-tx-note { margin: 4px 0 10px; max-width: 72ch; font-size: 13.5px; color: var(--muted); }
.an-tx-note:empty { display: none; }
.an-tx-table td:first-child { white-space: nowrap; }
.an-subhead { margin: 0 0 8px; font: 600 14px/1.3 var(--sans); color: var(--ink); letter-spacing: .01em; }
.an-tx-table td, .an-tx-table th { font-size: 13.5px; padding-top: 8px; padding-bottom: 8px; }
.an-spark-cell { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.an-spark { display: inline-block; width: 56px; height: 16px; flex: none; vertical-align: middle; }
.an-toggle { display: grid; width: 100%; grid-template-columns: 10px minmax(0, 1fr) 12px; column-gap: 12px; align-items: baseline; min-height: 44px; padding: 4px 0; border: 0; background: none; font: inherit; color: var(--ink); text-align: left; cursor: pointer; }
.an-toggle::before { content: ""; grid-row: 1; width: 10px; height: 10px; border-radius: 50%; background: var(--hue, var(--muted)); transform: translateY(1px); }
.an-toggle::after { content: ""; grid-row: 1; grid-column: 3; width: 7px; height: 7px; border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: translateY(-3px) rotate(45deg); transition: transform .35s var(--ease); }
.an-toggle[aria-expanded="true"]::after { transform: translateY(1px) rotate(225deg); }
.an-name { grid-column: 2; font-weight: 600; text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 5px; transition: text-decoration-color .3s var(--ease); }
.an-toggle:hover .an-name { text-decoration-color: currentColor; }
.an-kind { grid-column: 2; font-size: 13px; color: var(--muted); line-height: 1.35; }
.an-plat-line { grid-column: 2; font: 500 11.5px/1.3 var(--mono); color: var(--muted); margin-top: 1px; }
.an-row.is-quiet-row td { opacity: 0.76; }
.an-row:has(+ .an-detail:not([hidden])) td { border-bottom-color: transparent; }
.an-detail td { padding: 0 0 22px 22px; }
.an-steps-notice { margin: 4px 0 8px; padding: 6px 10px; border-left: 2px solid var(--amber); background: color-mix(in srgb, var(--surface) 60%, transparent); font-size: 13px; color: var(--ink); max-width: 820px; }
.an-steps { list-style: none; max-width: 820px; }
.an-steps li { display: grid; grid-template-columns: minmax(170px, 16rem) 6.5rem minmax(80px, 1fr) 8.5rem; align-items: center; gap: 16px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 15px; }
.an-steps li.is-zero { color: var(--muted); }
.an-steps li.is-goal .an-label { font-weight: 600; }
.an-steps li.is-entry-gate .an-bar i { opacity: .38; }
.an-goal-chip { margin-left: 10px; }
.an-goal-chip::before { background: var(--hue, var(--violet)); }
.an-count { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.an-bar { display: block; height: 6px; border-radius: 2px; background: var(--surface); overflow: hidden; }
.an-bar i { display: block; height: 100%; background: var(--hue, var(--violet)); transform: scaleX(0); transform-origin: left; transition: transform .7s var(--ease); }
.an-rate { font-size: 13.5px; color: var(--muted); font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.an-meta { display: flex; flex-wrap: wrap; gap: 6px 24px; margin-top: 12px; font-size: 14px; color: var(--muted); }
.an-quiet { margin-top: 12px; padding-top: 0; border-top: 0; font-size: 13.5px; color: var(--muted); }
@media (max-width: 1080px) {
  .an-figure-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .an-figure-strip > div:nth-child(3n) { border-right: 0; padding-right: 0; }
  .an-figure-strip > div:nth-child(3n+1) { padding-left: 0; }
  .an-figure-strip > div:nth-child(n+4) { border-top: 1px solid var(--line); }
  .an-pulse-split { grid-template-columns: 1fr; gap: 16px; }
  .an-pulse-col + .an-pulse-col { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); padding-top: 14px; }
  .an-charts-grid { grid-template-columns: 1fr; }
  .an-store-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 0; }
  .an-store-strip > div:nth-child(3n) { border-right: 0; padding-right: 0; }
  .an-store-strip > div:nth-child(3n+1) { padding-left: 0; }
  .an-conn-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 0; }
  .an-conn-strip > div:nth-child(odd) { padding-left: 0; padding-right: 12px; border-right: 1px solid var(--line); }
  .an-conn-strip > div:nth-child(even) { border-right: 0; padding-left: 12px; padding-right: 0; }
  .an-conn-strip > div:nth-child(n+3) { border-top: 1px solid var(--line); padding-top: 8px; }
  .an-store-split { grid-template-columns: 1fr; }
  .an-store-col-breakdown { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); padding-top: 14px; }
  .an-funnel-rows.an-funnel-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  #an-figures { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #an-figures > div:nth-child(2n) { border-right: 0; padding-right: 0; }
  #an-figures > div:nth-child(2n+1) { padding-left: 0; }
  #an-figures > div:nth-child(n+3) { border-top: 1px solid var(--line); }
  .an-store-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 0; }
  .an-conn-strip { grid-template-columns: 1fr; gap: 8px 0; }
  .an-conn-strip > div:nth-child(odd),
  .an-conn-strip > div:nth-child(even) { border-right: 0; padding-left: 0; padding-right: 0; }
  .an-conn-strip > div:nth-child(n+2) { border-top: 1px solid var(--line); padding-top: 8px; }
  /* On a phone a bar row is two lines: name and count, then the bar with its rate under it. */
  .an-funnel-rows li, .an-sku-rows li { grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; }
  .an-funnel-rows .fn-track { grid-column: 1 / -1; }
  .an-funnel-rows .fn-rate { grid-column: 1 / -1; text-align: left; white-space: normal; }
  .an-batch-list li { grid-template-columns: 9.2rem minmax(0, 1fr); gap: 4px 10px; }
  .an-batch-events { grid-column: 1 / -1; }
  .an-search-input { width: 100%; }
}
@media (max-width: 760px) {
  .an-product-table th:nth-child(2),
  .an-product-table th:nth-child(3),
  .an-product-table th:nth-child(5),
  .an-product-table th:nth-child(7),
  .an-row td:nth-child(2), .an-row td:nth-child(3), .an-row td:nth-child(5), .an-row td:nth-child(7) { display: none; }
  .an-product-table th:first-child,
  .an-row td:first-child { width: 52%; min-width: 200px; }
  .an-product-table th:nth-child(4),
  .an-row td:nth-child(4) { min-width: 120px; }
  .an-table th.num, .an-table td.num { padding-right: 12px; }
  .an-detail td { padding-left: 0; }
  .an-detail td > * { max-width: 100cqi; }
  .an-steps li { grid-template-columns: 1fr auto; gap: 4px 12px; }
  .an-steps .an-bar { grid-column: 1 / -1; }
  .an-steps .an-rate { grid-column: 1 / -1; text-align: left; }
}
@media (prefers-reduced-motion: reduce) {
  .an-bar i, .an-funnel-rows .fn-track i, .an-toggle::after, .is-stale { transition: none; }
}
