/* Chronicle dashboard, in the Chatixia blueprint style of chronicle.chatixia.net (shared with chatixia.net and Studio).
   Dark is the blueprint itself: navy paper, pale ink. Light is the same drawing as a whiteprint: navy ink on pale paper.
   Gold marks what to press and what to look at; teal is done; blue is links, selection and the data. */

/* IBM Plex, bundled so the dashboard never calls out to a font service (Latin subsets, SIL OFL: PLEX-OFL.txt).
   Japanese falls through to the system's Hiragino. */
@font-face { font-family: "IBM Plex Sans"; font-weight: 400; font-display: swap; src: url(plex-sans-400.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 500; font-display: swap; src: url(plex-sans-500.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 600; font-display: swap; src: url(plex-sans-600.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 700; font-display: swap; src: url(plex-sans-700.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 400; font-display: swap; src: url(plex-mono-400.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 500; font-display: swap; src: url(plex-mono-500.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 600; font-display: swap; src: url(plex-mono-600.woff2) format("woff2"); }

:root {
  color-scheme: light;
  --page: #eef3f9;
  --surface: #ffffff;
  --surface-2: #e9eff7;
  --surface-3: #dde6f2;
  --ink: #071629;
  --ink-2: #283f5c;
  --muted: #455f7e;
  --grid: #d0dceb;
  --baseline: #7f9cc0;
  --border: #b9cbe0;
  --border-strong: #8ea8c8;
  --accent: #164c80;
  --accent-ink: #164c80;
  --accent-wash: rgba(29, 92, 150, 0.08);
  --accent-wash-2: rgba(29, 92, 150, 0.16);
  --good: #0c7c60;
  --good-ink: #0c7c60;
  --warning: #e09a1b;
  --serious: #d9703f;
  --critical: #c83a3a;
  --critical-ink: #b42f2f;
  --critical-wash: rgba(200, 58, 58, 0.08);
  --warning-ink: #8a5a00;
  --serious-ink: #a8481f;
  --seq-0: #e8eff8;
  --seq-1: #c6e1ff;
  --seq-2: #89c3fe;
  --seq-3: #379ffe;
  --seq-4: #0480db;
  --seq-5: #0262ab;
  --seq-6: #01467d;
  --user-bubble: #e8f0fa;
  --code-bg: #edf2f8;
  --shadow: 0 1px 0 rgba(11, 31, 56, 0.04);
  /* categorical slots: the dataviz reference palette's hues at the most saturation sRGB holds, inside each mode's
     lightness band (validated: scripts/validate_palette.js); fixed order, colour follows the entity */
  --series-1: #0577cc; --series-2: #f85b06; --series-3: #03b079; --series-4: #e39a00;
  --series-5: #ff63a4; --series-6: #019c00; --series-7: #5813e7; --series-8: #fb012b;
  /* one-colour charts (bars, lines, sparklines): the first series' blue, not the link colour */
  --chart: #0577cc;
  --chart-strong: #035da1;
  --radius: 6px;
  /* blueprint marks: gold for highlights and registration ticks; the buttons keep the bright gold with navy text */
  --gold: #8a4f06;
  --cta: #ffb45e;
  --cta-hover: #ffc67f;
  --cta-ink: #081a31;
  --paper-grid: rgba(29, 92, 150, 0.09);
  --paper-grid-fine: rgba(29, 92, 150, 0.045);
  /* shell: the rail, sidebar and status bar, a shade off the page */
  --shell-base: #e5ecf5;
  --vibrancy: transparent;
  --vib-ink: var(--ink);
  --vib-muted: var(--muted);
  --glass: var(--surface);
  --glass-strong: var(--surface);
  --glass-rim: var(--border-strong);
  --glass-hi: transparent;
  --glass-shadow: 0 1px 2px rgba(11, 31, 56, 0.06), 0 8px 24px rgba(11, 31, 56, 0.10);
  --hover: rgba(29, 92, 150, 0.06);
  --selected: rgba(29, 92, 150, 0.11);
  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --page: #071729;
    --surface: #0e2c51;
    --surface-2: #10345e;
    --surface-3: #153d6b;
    --ink: #f3f8ff;
    --ink-2: #c0d6ee;
    --muted: #9bb8da;
    --grid: #24507f;
    --baseline: #4a74a6;
    --border: #2a5788;
    --border-strong: #4573a8;
    --accent: #8ccfff;
    --accent-ink: #8ccfff;
    --accent-wash: rgba(124, 199, 255, 0.10);
    --accent-wash-2: rgba(124, 199, 255, 0.20);
    --good: #6fe3c1;
    --good-ink: #6fe3c1;
    --critical-ink: #ff8a8a;
    --critical-wash: rgba(255, 138, 138, 0.10);
    --warning-ink: #ffc56b;
    --serious-ink: #ff9e6e;
    --seq-0: #0f2d52;
    --seq-1: #003e70;
    --seq-2: #035798;
    --seq-3: #0074c8;
    --seq-4: #0192f9;
    --seq-5: #70b6fe;
    --seq-6: #badbfe;
    --user-bubble: #12365f;
    --code-bg: #0a2140;
    --shadow: none;
    --series-1: #0695f9; --series-2: #e24f02; --series-3: #009f6f; --series-4: #c58202;
    --series-5: #f2077e; --series-6: #07aa05; --series-7: #8d7afe; --series-8: #ff3f4d;
    --chart: #0695f9;
    --chart-strong: #70b6fe;
    --gold: #ffb45e;
    --paper-grid: rgba(93, 134, 182, 0.13);
    --paper-grid-fine: rgba(93, 134, 182, 0.065);
    --shell-base: #05121f;
    --glass-shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 10px 30px rgba(0, 0, 0, 0.45);
    --hover: rgba(124, 199, 255, 0.07);
    --selected: rgba(124, 199, 255, 0.13);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #071729;
  --surface: #0e2c51;
  --surface-2: #10345e;
  --surface-3: #153d6b;
  --ink: #f3f8ff;
  --ink-2: #c0d6ee;
  --muted: #9bb8da;
  --grid: #24507f;
  --baseline: #4a74a6;
  --border: #2a5788;
  --border-strong: #4573a8;
  --accent: #8ccfff;
  --accent-ink: #8ccfff;
  --accent-wash: rgba(124, 199, 255, 0.10);
  --accent-wash-2: rgba(124, 199, 255, 0.20);
  --good: #6fe3c1;
  --good-ink: #6fe3c1;
  --critical-ink: #ff8a8a;
  --critical-wash: rgba(255, 138, 138, 0.10);
  --warning-ink: #ffc56b;
  --serious-ink: #ff9e6e;
  --seq-0: #0f2d52;
  --seq-1: #003e70;
  --seq-2: #035798;
  --seq-3: #0074c8;
  --seq-4: #0192f9;
  --seq-5: #70b6fe;
  --seq-6: #badbfe;
  --user-bubble: #12365f;
  --code-bg: #0a2140;
  --shadow: none;
  --series-1: #0695f9; --series-2: #e24f02; --series-3: #009f6f; --series-4: #c58202;
  --series-5: #f2077e; --series-6: #07aa05; --series-7: #8d7afe; --series-8: #ff3f4d;
  --chart: #0695f9;
  --chart-strong: #70b6fe;
  --gold: #ffb45e;
  --paper-grid: rgba(93, 134, 182, 0.13);
  --paper-grid-fine: rgba(93, 134, 182, 0.065);
  --shell-base: #05121f;
  --glass-shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 10px 30px rgba(0, 0, 0, 0.45);
  --hover: rgba(124, 199, 255, 0.07);
  --selected: rgba(124, 199, 255, 0.13);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  overflow: hidden;
  background: var(--shell-base);
  color: var(--ink);
  font: 14px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
button { font: inherit; color: inherit; }
code, pre, kbd { font-family: var(--mono); font-size: 12.5px; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: 28px; line-height: 1.2; letter-spacing: -0.03em; font-weight: 700; text-wrap: balance; }
/* the blueprint's labels: small mono capitals, spaced out, as on a drawing's title block */
.sb-group, .pal-group, .tile .label { font: 500 11px/1.4 var(--mono); text-transform: uppercase; letter-spacing: 0.14em; color: var(--muted); }
:lang(ja) :is(.sb-group, .pal-group, .tile .label) { letter-spacing: 0.04em; }
h2 { font-size: 15px; }
h3 { font-size: 14px; }
.muted { color: var(--muted); }
.ink-2 { color: var(--ink-2); }
.mono { font-family: var(--mono); }
.nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; text-align: right; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* ------------------------------------------------------------------ shell: rail · sidebar · stage · status bar */
.shell {
  --sb: 256px;
  position: fixed; inset: 0;
  display: grid; grid-template-columns: 52px var(--sb) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) 28px;
  background: var(--vibrancy); color: var(--vib-ink);
  transition: grid-template-columns 0.2s ease;
}
.no-sidebar .shell { --sb: 0px; }
.titlestrip { position: absolute; left: 0; top: 0; z-index: 3; height: 52px; width: calc(52px + var(--sb)); display: flex; align-items: center; padding-left: 15px; transition: width 0.2s ease; }
.no-sidebar .titlestrip { width: 52px; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 600; color: var(--vib-ink); font-size: 15px; letter-spacing: -0.01em; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand img { width: 22px; height: 22px; flex: none; }
.no-sidebar .brand span { display: none; }
/* in the app the traffic lights sit where the logo would be; the name moves past them */
.in-app .titlestrip { padding-left: 90px; }
.in-app .brand img { display: none; }
.in-app.no-sidebar .brand { display: none; }

.rail { grid-column: 1; grid-row: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 58px 0 8px; }
.rail a { position: relative; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 6px; color: var(--vib-muted); }
.rail a .icon { width: 19px; height: 19px; stroke-width: 1.7; }
.rail a:hover { background: var(--hover); color: var(--vib-ink); text-decoration: none; }
/* the current section: a gold mark at the rail's edge, like the marker on a drawing's index */
.rail a.on { background: var(--selected); color: var(--ink); }
.rail a.on::before { content: ""; position: absolute; left: -7px; top: 9px; bottom: 9px; width: 2px; border-radius: 1px; background: var(--gold); }
.rail .spacer { flex: 1; }
.rail-tip {
  position: fixed; z-index: 60; transform: translateY(-50%); pointer-events: none; max-width: 280px;
  display: flex; flex-direction: column; gap: 1px; padding: 6px 10px; border-radius: 8px;
  background: var(--surface); color: var(--ink); border: 1px solid var(--border-strong);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.14); font-size: 12.5px; line-height: 1.35;
}
.rail-tip b { font-weight: 600; font-size: 13px; }
.rail-tip span { color: var(--ink-2); }
.rail-tip .rail-tip-extra { color: var(--accent-ink); font-weight: 500; }

.sidebar { grid-column: 2; grid-row: 1; min-width: 0; overflow: hidden; display: flex; flex-direction: column; padding-top: 52px; font-size: 13px; }
.no-sidebar .sidebar { visibility: hidden; }
/* a hidden sidebar peeks out over the page while the pointer is on the rail, and goes again when it leaves */
@media (min-width: 861px) {
  .no-sidebar.peek-sidebar .sidebar { visibility: visible; position: fixed; z-index: 45; left: 52px; top: 0; bottom: 28px; width: 256px;
    background: var(--shell-base); box-shadow: 12px 0 40px rgba(0, 0, 0, 0.18), inset -1px 0 0 var(--border);
    animation: sb-peek 0.14s ease-out; }
}
@keyframes sb-peek { from { opacity: 0; transform: translateX(-10px); } }
@media (prefers-reduced-motion: reduce) { .no-sidebar.peek-sidebar .sidebar { animation: none; } }
.sb-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 6px 14px 6px 12px; }
.sb-head h2 { font-size: 13px; font-weight: 650; letter-spacing: 0; color: var(--vib-ink); }
.sb-head span { font-size: 11.5px; color: var(--vib-muted); font-variant-numeric: tabular-nums; }
.sb-filter { margin: 2px 12px 8px 8px; display: flex; align-items: center; gap: 6px; height: 28px; padding: 0 9px; border-radius: 8px; background: var(--hover); color: var(--vib-muted); }
.sb-filter .icon { width: 14px; height: 14px; }
.sb-filter input { flex: 1; min-width: 0; border: 0; background: transparent; outline: none; font: inherit; color: var(--vib-ink); }
.sb-filter input::placeholder { color: var(--vib-muted); }
.sb-chips { display: flex; gap: 2px; padding: 0 12px 6px 8px; flex-wrap: wrap; }
.sb-chips button { border: 0; padding: 2px 8px; border-radius: 999px; background: transparent; font-size: 11.5px; color: var(--vib-muted); cursor: pointer; }
.sb-chips button:hover { background: var(--hover); color: var(--vib-ink); }
.sb-chips button.on { background: var(--selected); color: var(--vib-ink); }
.sb-scroll { flex: 1; overflow-y: auto; padding: 0 8px 12px; scrollbar-width: thin; }
.sb-group { margin: 14px 6px 5px; }
.sb-item { display: grid; grid-template-columns: 8px minmax(0, 1fr); column-gap: 9px; padding: 6px 8px; border-radius: 5px; color: var(--vib-ink); }
.sb-item:hover { background: var(--hover); text-decoration: none; }
.sb-item.on { background: var(--selected); }
.sb-item .odot { width: 7px; height: 7px; border-radius: 50%; margin-top: 6px; background: var(--s, var(--muted)); }
.sb-item b { font-weight: 500; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-item small { grid-column: 2; font-size: 11px; font-family: var(--mono); color: var(--vib-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.sb-row { display: flex; align-items: center; gap: 9px; padding: 6px 8px; border-radius: 5px; color: var(--vib-ink); font-size: 12.5px; }
.sb-row:hover { background: var(--hover); text-decoration: none; }
.sb-row.on { background: var(--selected); }
.sb-row .icon { width: 15px; height: 15px; color: var(--vib-muted); }
.sb-row.on .icon { color: var(--accent); }
.sb-row span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-row em { font-style: normal; font-size: 11.5px; color: var(--vib-muted); font-variant-numeric: tabular-nums; }
.sb-more { display: block; width: calc(100% - 12px); margin: 6px; border: 0; background: transparent; color: var(--accent-ink); font-size: 12px; padding: 4px; border-radius: 7px; cursor: pointer; }
.sb-more:hover { background: var(--hover); }
.sb-empty { padding: 10px 14px; color: var(--vib-muted); font-size: 12px; }

.statusbar { grid-column: 1 / -1; grid-row: 2; display: flex; align-items: center; gap: 14px; padding: 0 14px; font: 11px var(--mono); color: var(--vib-muted); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; }
.st-left, .st-right { display: flex; align-items: center; gap: 14px; min-width: 0; }
.st-right { margin-left: auto; }
.statusbar button { border: 0; background: transparent; padding: 2px 6px; margin: 0 -6px; border-radius: 6px; cursor: pointer; color: inherit; display: inline-flex; align-items: center; gap: 6px; font-size: inherit; }
.statusbar button:hover { background: var(--hover); color: var(--vib-ink); }
.statusbar .icon { width: 13px; height: 13px; }
.statusbar .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--good); }
.statusbar .busy .dot { background: var(--accent); animation: pulse 1.2s infinite; }
.statusbar .warn .dot { background: var(--warning); }
#status-update { color: var(--accent); font-weight: 600; }
@keyframes pulse { 50% { opacity: 0.3; } }

/* the stage: the drawing sheet. Blueprint paper, a fine 24px grid with a stronger line every 96px, held still while the page scrolls over it. */
.stage { grid-column: 3; grid-row: 1; position: relative; min-width: 0; margin: 8px 8px 0 0; border-radius: 6px; color: var(--ink); overflow: hidden;
  background-color: var(--page);
  background-image:
    linear-gradient(var(--paper-grid) 1px, transparent 1px), linear-gradient(90deg, var(--paper-grid) 1px, transparent 1px),
    linear-gradient(var(--paper-grid-fine) 1px, transparent 1px), linear-gradient(90deg, var(--paper-grid-fine) 1px, transparent 1px);
  background-size: 96px 96px, 96px 96px, 24px 24px, 24px 24px;
  box-shadow: 0 0 0 1px var(--border); }
.in-app .stage { border-radius: 6px; }
main#app { position: absolute; inset: 0; overflow-y: auto; padding: 62px clamp(16px, 2.6vw, 32px) 56px; outline: none; scroll-padding-top: 64px; }
main#app > * { max-width: 1400px; margin-inline: auto; }
main.loading > :not(.skeleton) { opacity: 0.55; transition: opacity 0.15s; }
/* page loading: a bar along the stage's top edge once a page takes a moment, a note once it takes long */
.loadbar { position: absolute; left: 0; right: 0; top: 0; height: 3px; z-index: 4; overflow: hidden; pointer-events: none; opacity: 0; transition: opacity 0.25s; }
.loadbar.on { opacity: 1; }
.loadbar i { position: absolute; top: 0; bottom: 0; left: 0; width: 30%; border-radius: 0 2px 2px 0; background: var(--accent); animation: load-slide 1.3s ease-in-out infinite; }
@keyframes load-slide { from { transform: translateX(-100%); } to { transform: translateX(334%); } }
.glass.loadnote { position: absolute; top: 52px; left: 0; right: 0; z-index: 4; width: fit-content; max-width: calc(100% - 32px); margin-inline: auto;
  display: block; height: auto; padding: 7px 14px; border-radius: 6px; font-size: 12.5px; color: var(--ink); text-align: center; animation: sk-in 0.2s ease-out; }
.glass.loadnote[hidden] { display: none; }
.loadnote .ln-secs { color: var(--muted); font-variant-numeric: tabular-nums; margin-left: 4px; }
.loadnote .ln-why { color: var(--ink-2); margin-top: 2px; }
/* the first page's placeholder: Home's shape, fading in only if the data is not there at once */
.skeleton { animation: sk-in 0.2s 0.15s both; }
.skeleton .tile { min-height: 132px; }
.skeleton .card { display: grid; gap: 12px; margin-top: 16px; }
.sk { display: block; height: 12px; border-radius: 6px; background: var(--surface-3); }
@supports (background: color-mix(in srgb, red, blue)) {
  .sk { background: linear-gradient(100deg, var(--surface-3) 42%, color-mix(in srgb, var(--surface-3) 45%, var(--surface)) 50%, var(--surface-3) 58%) 0 0 / 300% 100% fixed;
    animation: sk-shimmer 1.8s linear infinite; }
}
@keyframes sk-shimmer { from { background-position-x: 100%; } to { background-position-x: 0%; } }
@keyframes sk-in { from { opacity: 0; } }
.sk-head { margin: 4px 0 18px; }
.sk-title { height: 26px; width: 120px; border-radius: 7px; }
.sk-sub { width: min(340px, 70%); margin-top: 12px; }
.sk-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.sk-seg { height: 30px; width: 220px; border-radius: 8px; }
.sk-seg.wide { width: min(560px, 100%); }
.sk-label { width: 55%; }
.sk-value { height: 24px; width: 45%; margin-top: 14px; border-radius: 6px; }
.sk-foot { height: 10px; width: 70%; margin-top: 12px; }
.sk-big { height: 52px; width: 40%; margin-top: 22px; border-radius: 6px; }
.sk-line { width: 80%; margin-top: 14px; }
.card .sk-line { margin-top: 0; }
.sk-line.short { width: 50%; }
@media (prefers-reduced-motion: reduce) { .skeleton, .sk, .glass.loadnote { animation: none; } .loadbar i { animation: none; width: 100%; opacity: 0.45; } }
/* the toolbar's band, as the site's header: the page shows faintly through it, ruled off below */
.edge { position: absolute; left: 0; right: 0; top: 0; height: 52px; z-index: 2; pointer-events: none;
  background: color-mix(in srgb, var(--page) 88%, transparent);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); box-shadow: 0 1px 0 var(--border); }
.toolbar { position: absolute; left: 10px; right: 10px; top: 8px; z-index: 3; display: flex; align-items: center; gap: 8px; height: 36px; }
.glass {
  display: inline-flex; align-items: center; flex: none; height: 34px; padding: 0 2px; border-radius: 6px; border: 0;
  background: var(--glass); box-shadow: inset 0 0 0 1px var(--glass-rim);
  color: var(--ink-2);
}
.glass .icon-btn { width: 30px; height: 30px; border: 0; border-radius: 4px; background: transparent; color: var(--ink-2); display: inline-grid; place-items: center; }
.glass .icon-btn:hover { background: var(--hover); color: var(--ink); }
.crumbs { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; padding: 0 6px; font-size: 13px; white-space: nowrap; overflow: hidden; color: var(--ink); }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--ink); text-decoration: none; }
.crumbs .sep { color: var(--muted); opacity: 0.6; }
.crumbs b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.search-pill { gap: 8px; padding: 0 6px 0 12px; min-width: 210px; cursor: text; color: var(--muted); font-size: 13px; }
.search-pill .sp-label { flex: 1; text-align: left; }
.search-pill .icon { width: 15px; height: 15px; }
kbd { font: 500 10.5px var(--mono); padding: 1px 6px; border-radius: 4px; background: var(--hover); color: var(--muted); box-shadow: inset 0 0 0 0.5px var(--border); }
.text-btn { border: 0; background: transparent; height: 30px; padding: 0 12px; border-radius: 4px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 13px; }
.text-btn .icon { width: 14px; height: 14px; }
/* the one gold button in the toolbar, as the site's Install: bright gold with navy text in both themes */
.glass.tinted { background: var(--cta); color: var(--cta-ink); box-shadow: none; }
.glass.tinted .text-btn:hover { background: var(--cta-hover); }

/* Reduce Transparency (macOS) and Increase Contrast: the toolbar's band turns solid, rules turn stronger */
:root.os-solid .edge { background: var(--page); -webkit-backdrop-filter: none; backdrop-filter: none; }
@media (prefers-contrast: more) {
  :root, :root[data-theme] { --border: var(--border-strong); --glass-rim: var(--baseline); }
  .edge { background: var(--page); -webkit-backdrop-filter: none; backdrop-filter: none; }
}

/* ------------------------------------------------------------------ command palette */
#palette { position: fixed; inset: 0; z-index: 70; background: rgba(4, 14, 28, 0.28); display: flex; justify-content: center; align-items: flex-start; padding: 13vh 16px 0; }
.pal { width: min(640px, 100%); border-radius: 8px; overflow: hidden; color: var(--ink);
  background: var(--glass-strong); box-shadow: 0 24px 70px rgba(0, 0, 0, 0.30), inset 0 0 0 1px var(--glass-rim); }
.pal-in { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.pal-in .icon { width: 18px; height: 18px; color: var(--muted); }
.pal-in input { flex: 1; min-width: 0; border: 0; background: transparent; outline: none; font: 17px var(--sans); color: var(--ink); }
.pal-list { max-height: min(420px, 55vh); overflow-y: auto; padding: 6px; }
.pal-group { padding: 10px 10px 5px; }
.pal-item { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 5px; cursor: pointer; font-size: 13.5px; }
.pal-item .icon { color: var(--muted); }
.pal-item span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pal-item small { color: var(--muted); font-size: 12px; white-space: nowrap; max-width: 40%; overflow: hidden; text-overflow: ellipsis; }
.pal-item.on { background: var(--accent-wash-2); color: var(--ink); box-shadow: inset 2px 0 0 var(--gold); }
.pal-item.on .icon { color: var(--accent); }
.pal-foot { display: flex; gap: 14px; flex-wrap: wrap; padding: 8px 16px; border-top: 1px solid var(--border); font-size: 11.5px; color: var(--muted); }
.pal-empty { padding: 20px 12px; color: var(--muted); text-align: center; }

@media (max-width: 860px) {
  .shell { --sb: 0px; }
  /* the sidebar floats over the page instead of squeezing it */
  .sidebar { visibility: hidden; position: fixed; z-index: 45; left: 52px; top: 0; bottom: 28px; width: min(280px, calc(100vw - 68px));
    background: var(--shell-base);
    box-shadow: 12px 0 40px rgba(0, 0, 0, 0.18), inset -1px 0 0 var(--border); }
  :root.show-sidebar .sidebar { visibility: visible; }
  .titlestrip { width: 52px !important; }
  .brand span { display: none; }
  .search-pill { min-width: 0; }
  .search-pill .sp-label { display: none; }
  #status-sync, #status-version { display: none; }
}
@media (max-width: 560px) { .crumbs a, .crumbs .sep { display: none; } }
/* phones (and the dashboard added to a phone's home screen): the rail becomes a tab bar at the bottom, the page
   takes the whole width, and nothing sits under the notch or the home indicator */
@media (max-width: 600px) {
  .shell { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; }
  .titlestrip, .statusbar { display: none; }
  .rail { grid-column: 1; grid-row: 2; flex-direction: row; justify-content: space-around; gap: 0;
    padding: 4px max(6px, env(safe-area-inset-right)) calc(4px + env(safe-area-inset-bottom)) max(6px, env(safe-area-inset-left));
    box-shadow: inset 0 0.5px 0 var(--border); }
  .rail .spacer { display: none; }
  .rail a { width: 50px; height: 40px; }
  .rail a.on::before { left: 14px; right: 14px; top: -4px; bottom: auto; width: auto; height: 2px; }
  .stage { grid-column: 1; margin: 0; border-radius: 0; box-shadow: none; }
  .toolbar { top: calc(8px + env(safe-area-inset-top)); left: max(10px, env(safe-area-inset-left)); right: max(10px, env(safe-area-inset-right)); gap: 6px; }
  .edge { height: calc(62px + env(safe-area-inset-top)); }
  main#app { padding: calc(60px + env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) 32px max(14px, env(safe-area-inset-left));
    scroll-padding-top: calc(64px + env(safe-area-inset-top)); }
  .sidebar { left: 0; bottom: calc(48px + env(safe-area-inset-bottom)); width: min(300px, 86vw); padding-top: calc(52px + env(safe-area-inset-top));
    background: color-mix(in srgb, var(--surface) 94%, transparent); }
  #fwd-btn { display: none; }
  .search-pill { padding: 0 10px; }
  #sync-btn { font-size: 0; gap: 0; padding: 0 10px; } /* the icon alone; "Sync" stays the button's name */
  h1 { font-size: 23px; }
}
@media (pointer: coarse) { .search-pill kbd { display: none; } }
/* in the app a hidden sidebar leaves a strip of glass, so the traffic lights never sit on the page */
.in-app.no-sidebar .shell { --sb: 30px; }
.in-app.no-sidebar .titlestrip { width: 82px; }

/* ------------------------------------------------------------------ controls */
.btn, .icon-btn, .chip, select, .input {
  border: 1px solid var(--border); background: var(--surface); color: var(--ink);
  border-radius: 5px; font: inherit;
}
.btn { padding: 6px 12px; cursor: pointer; font-weight: 500; }
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--cta); border-color: var(--cta); color: var(--cta-ink); font-weight: 600; }
.btn.primary:hover { background: var(--cta-hover); border-color: var(--cta-hover); }
.btn:disabled { opacity: 0.55; cursor: default; }
.btn.small { padding: 3px 9px; font-size: 12.5px; }
.icon-btn { width: 32px; height: 32px; cursor: pointer; }
.icon-btn:hover { background: var(--surface-2); }
select, .input { padding: 6px 10px; }
select:focus, .input:focus { outline: 2px solid var(--accent-wash-2); border-color: var(--accent); }
.chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px;
  font-size: 12.5px; cursor: pointer; color: var(--ink-2); white-space: nowrap;
}
.chip:hover { background: var(--surface-2); }
.chip.on { background: var(--accent-wash); border-color: var(--accent); color: var(--ink); }
.chip .count { color: var(--muted); font-variant-numeric: tabular-nums; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 5px; overflow: hidden; background: var(--surface); }
.seg button { border: 0; background: transparent; padding: 5px 11px; cursor: pointer; color: var(--ink-2); font-size: 13px; }
.seg button + button { border-left: 1px solid var(--border); }
.seg button.on { background: var(--accent-wash-2); color: var(--ink); font-weight: 500; }
.seg button:disabled { cursor: not-allowed; opacity: .45; }
.analyzer { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.analyzer .seg { align-self: flex-start; }
/* the tabs carry an in-use dot or a Not installed tag: in a narrow pane they tile onto a second row rather than break words,
   and a tab that can't be picked stays legible, since its tag says why */
.analysis-main .seg { flex-wrap: wrap; max-width: 100%; }
.analysis-main .seg button { flex: 1 0 auto; white-space: nowrap; box-shadow: -1px -1px 0 var(--border); }
.analysis-main .seg button + button { border-left: 0; }
.analysis-main .seg button:disabled { opacity: 1; color: var(--muted); }
.seg-tag { margin-left: 6px; padding: 0 6px; border-radius: 999px; font-size: 11px; font-weight: 500; vertical-align: 1px;
  color: var(--muted); background: var(--surface-2); white-space: nowrap; }
.seg-dot { display: inline-block; width: 7px; height: 7px; margin-left: 7px; border-radius: 50%; background: var(--good); vertical-align: 1px; }

/* ------------------------------------------------------------------ layout */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.page-head .sub { color: var(--ink-2); margin-top: 3px; }
.filters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.filters .spacer { flex: 1; }
.grid { display: grid; gap: 16px; }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
@media (max-width: 1100px) { .cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .cols-main { grid-template-columns: 1fr; } }
@media (max-width: 760px) {
  .cols-2, .cols-3 { grid-template-columns: 1fr; }
}
.section-gap { margin-top: 16px; }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px 18px; min-width: 0;
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.card-head .hint { color: var(--muted); font-size: 12.5px; }
.card-head .tools { display: flex; gap: 6px; align-items: center; }
.link-btn { border: 0; background: none; color: var(--accent-ink); cursor: pointer; font-size: 12.5px; padding: 2px 4px; }
.link-btn:hover { text-decoration: underline; }
.empty { color: var(--muted); padding: 18px 4px; text-align: center; }

/* ------------------------------------------------------------------ stat tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.tile {
  display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 13px 15px 10px; box-shadow: var(--shadow); min-width: 0;
}
.tile .label { display: flex; align-items: center; gap: 7px; }
.tile .label .icon { width: 14px; height: 14px; color: var(--muted); }
.tile .value { font-size: 26px; font-weight: 600; letter-spacing: -0.025em; line-height: 1.15; margin-top: 8px; white-space: nowrap; }
.tile .foot { display: flex; align-items: center; gap: 6px; margin-top: 4px; min-height: 18px; min-width: 0; }
.tile .delta { font-size: 12px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .spark { margin-top: auto; padding-top: 4px; }
.spark svg { display: block; overflow: visible; }
.spark-line { fill: none; stroke: var(--chart); stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }
.spark-area { fill: var(--chart); opacity: 0.16; }
.spark-dot { fill: var(--chart); stroke: var(--surface); stroke-width: 2; }
.kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.kpis .hero { grid-column: span 2; grid-row: span 2; }
@media (max-width: 1180px) { .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); } .kpis .hero { grid-column: 1 / -1; grid-row: auto; } }
@media (max-width: 640px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* the headline figure is the sheet's main drawing: a lit stage, framed by gold registration ticks */
.tile.hero { position: relative; padding: 18px 20px 12px; background: radial-gradient(ellipse at 30% 0%, var(--accent-wash-2) 0%, transparent 65%), var(--surface); }
.tile.hero::before, .tile.hero::after { content: ""; position: absolute; width: 14px; height: 14px; border: 0 solid var(--gold); pointer-events: none; }
.tile.hero::before { top: -1px; left: -1px; border-width: 2px 0 0 2px; border-top-left-radius: var(--radius); }
.tile.hero::after { bottom: -1px; right: -1px; border-width: 0 2px 2px 0; border-bottom-right-radius: var(--radius); }
.tile.hero .label { color: var(--gold); }
.tile.hero .value { font-size: 60px; font-weight: 700; letter-spacing: -0.045em; line-height: 1; margin-top: 14px; }
.hero-sub { color: var(--ink-2); font-size: 13px; margin-top: 8px; }
.hero-facts { display: flex; gap: 10px 22px; flex-wrap: wrap; margin: 16px 0 8px; }
.fact b { display: block; font-size: 15.5px; font-weight: 600; color: var(--ink); letter-spacing: -0.01em; white-space: nowrap; }
.fact span { display: block; margin-top: 2px; font: 11px var(--mono); color: var(--muted); }

/* ------------------------------------------------------------------ charts */
.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; overflow: visible; }
.axis text, .chart-label { fill: var(--muted); font-size: 11px; font-family: var(--sans); }
.axis .tick-num { font-variant-numeric: tabular-nums; }
.gridline { stroke: var(--grid); stroke-width: 1; shape-rendering: crispEdges; }
.baseline { stroke: var(--baseline); stroke-width: 1; shape-rendering: crispEdges; }
.bar { fill: var(--chart); }
.bar:hover, .bar.hover { fill: var(--chart-strong); }
.hit { fill: transparent; cursor: default; }
.line { fill: none; stroke: var(--chart); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.area { fill: var(--chart); opacity: 0.18; }
.crosshair { stroke: var(--baseline); stroke-width: 1; }
.dot { fill: var(--chart); stroke: var(--surface); stroke-width: 2; }
.marker-line { stroke: var(--muted); stroke-width: 1; }
.marker-label { fill: var(--ink-2); font-size: 10.5px; }
.cell { stroke: var(--surface); stroke-width: 2; }
.cell:hover { stroke: var(--ink); stroke-width: 1.5; }
.scale-legend { display: flex; align-items: center; gap: 4px; font-size: 11px; color: var(--muted); margin-top: 8px; }
.scale-legend i { width: 11px; height: 11px; border-radius: 2px; display: inline-block; }
.table-view { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.table-view th, .table-view td { padding: 4px 8px; border-bottom: 1px solid var(--grid); text-align: left; }
.table-view td.num, .table-view th.num { text-align: right; }
.table-scroll { max-height: 320px; overflow: auto; }

.hbars { display: grid; gap: 7px; }
.hbar { display: grid; grid-template-columns: minmax(90px, 38%) 1fr auto; align-items: center; gap: 10px; font-size: 13px; }
.hbar .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); }
.hbar .track { height: 10px; display: flex; gap: 2px; }
.hbar .fill { height: 100%; background: var(--chart); border-radius: 0 4px 4px 0; min-width: 2px; }
.hbar .fill.has-part { border-radius: 0; }
.hbar .fill.part { background: var(--critical); border-radius: 0 4px 4px 0; }
.hbar .val { color: var(--ink-2); font-variant-numeric: tabular-nums; font-size: 12.5px; white-space: nowrap; }
.hbar:hover .fill:not(.part) { background: var(--chart-strong); }
.hbar a.name { color: var(--ink); }

#tooltip {
  position: fixed; z-index: 50; pointer-events: none;
  background: var(--surface); color: var(--ink); border: 1px solid var(--border-strong);
  border-radius: 8px; padding: 7px 10px; font-size: 12.5px; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.14);
  max-width: 320px;
}
#tooltip .tt-value { font-weight: 600; font-size: 14px; }
#tooltip .tt-label { color: var(--ink-2); }
#tooltip .tt-row { display: flex; align-items: center; gap: 6px; }
#tooltip .tt-key { width: 12px; height: 2px; background: var(--chart); display: inline-block; }

#toast {
  position: fixed; bottom: 44px; left: 50%; transform: translateX(-50%); z-index: 60;
  background: var(--glass-strong); color: var(--ink); padding: 8px 16px; border-radius: 999px; font-size: 13px;
  box-shadow: var(--glass-shadow), inset 0 0 0 0.5px var(--glass-rim); max-width: 80vw;
}

/* ------------------------------------------------------------------ lists & tables */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th {
  text-align: left; font-weight: 500; color: var(--ink-2); font-size: 12px;
  padding: 7px 10px; border-bottom: 1px solid var(--border-strong); white-space: nowrap; user-select: none;
}
table.data th.sortable { cursor: pointer; }
table.data th.sortable:hover { color: var(--ink); }
table.data th .arrow { color: var(--accent); }
table.data td { padding: 8px 10px; border-bottom: 1px solid var(--grid); vertical-align: top; }
table.data tr.row-link { cursor: pointer; }
table.data tr.row-link:hover td { background: var(--surface-2); }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.title-cell { min-width: 240px; }
.title-cell .t { font-weight: 500; color: var(--ink); }
.title-cell .s { color: var(--muted); font-size: 12px; margin-top: 2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.badge {
  display: inline-flex; align-items: center; gap: 5px; font-size: 12px; padding: 1px 8px;
  border-radius: 999px; border: 1px solid var(--border); color: var(--ink-2); white-space: nowrap; background: var(--surface);
}
.badge .sdot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.badge.good .sdot { background: var(--good); }
.badge.warning .sdot { background: var(--warning); }
.badge.serious .sdot { background: var(--serious); }
.badge.critical .sdot { background: var(--critical); }
.badge.accent .sdot { background: var(--accent); }
.tag { display: inline-block; font-size: 11.5px; color: var(--ink-2); background: var(--surface-2); border-radius: 5px; padding: 0 6px; margin: 2px 4px 0 0; }
.proj { font-size: 12.5px; color: var(--ink-2); }

.session-list { display: grid; gap: 2px; }
.session-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 8px 8px; border-radius: 6px; color: var(--ink); }
.session-item:hover { background: var(--surface-2); text-decoration: none; }
.session-item .t { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.session-item .m { color: var(--muted); font-size: 12px; margin-top: 1px; }
.session-item .r { text-align: right; font-size: 12.5px; color: var(--ink-2); white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------------ knowledge */
.kgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 12px; }
.kcard {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px 12px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 8px; min-width: 0;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.kcard:hover { border-color: var(--border-strong); }
.kcard.pinned { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--shadow); }
.kcard .khead { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.kcard .ktitle { font-weight: 600; font-size: 14.5px; line-height: 1.38; letter-spacing: -0.005em; }
.kcard .kbody { color: var(--ink-2); font-size: 13px; overflow-wrap: anywhere; }
.kcard .kbody.clamp { max-height: 9.6em; overflow: hidden; -webkit-mask-image: linear-gradient(to bottom, #000 72%, transparent); mask-image: linear-gradient(to bottom, #000 72%, transparent); }
.kcard .kfoot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 10px; border-top: 1px solid var(--grid); font-size: 12px; color: var(--muted); }
.kcard .kactions { display: flex; gap: 2px; opacity: 0.25; transition: opacity 0.15s; }
.kcard:hover .kactions, .kcard:focus-within .kactions { opacity: 1; }
.kcard .kactions button { border: 0; background: none; cursor: pointer; color: var(--ink-2); padding: 2px 5px; border-radius: 5px; font-size: 12px; }
.kcard .kactions button:hover { background: var(--surface-2); color: var(--ink); }

/* ------------------------------------------------------------------ markdown */
.md { overflow-wrap: anywhere; }
.md p { margin: 0 0 8px; }
.md p:last-child { margin-bottom: 0; }
.md ul, .md ol { margin: 4px 0 8px; padding-left: 20px; }
.md li { margin: 2px 0; }
.md code { background: var(--code-bg); padding: 1px 5px; border-radius: 4px; }
.md pre { background: var(--code-bg); padding: 10px 12px; border-radius: 8px; overflow-x: auto; margin: 6px 0 10px; }
.md pre code { background: none; padding: 0; }
.md h1, .md h2, .md h3, .md h4 { margin: 12px 0 6px; font-size: 14px; }
.md blockquote { margin: 6px 0; padding-left: 10px; border-left: 3px solid var(--grid); color: var(--ink-2); }
.md table { border-collapse: collapse; font-size: 12.5px; margin: 6px 0; }
.md td, .md th { border: 1px solid var(--grid); padding: 3px 7px; }

/* ------------------------------------------------------------------ session detail */
.session-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 14px; }
.session-head .meta { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--ink-2); font-size: 13px; margin-top: 6px; }
.session-head .meta b { color: var(--ink); font-weight: 500; }
.summary-card .summary { font-size: 14.5px; line-height: 1.6; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; font-size: 13px; margin-top: 12px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.bullets { margin: 6px 0 0; padding-left: 18px; }
.bullets li { margin: 3px 0; }
.checklist { list-style: none; padding: 0; margin: 6px 0 0; }
.checklist li { padding: 3px 0 3px 22px; position: relative; }
.checklist li::before { content: "☐"; position: absolute; left: 0; color: var(--muted); }
.subhead { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; margin: 14px 0 4px; font-weight: 500; }

.transcript-controls { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.transcript { display: flex; flex-direction: column; gap: 10px; }
.msg { border-radius: 6px; padding: 10px 13px; max-width: 100%; min-width: 0; }
.msg .who { flex-wrap: wrap; font-size: 11.5px; color: var(--muted); margin-bottom: 3px; display: flex; gap: 8px; align-items: center; }
.msg .who b { color: var(--ink-2); font-weight: 600; }
.msg.user { background: var(--user-bubble); border: 1px solid var(--accent-wash-2); }
.msg.user .body { white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.assistant { background: var(--surface); border: 1px solid var(--border); }
.msg.system { overflow-wrap: anywhere; background: transparent; border: 1px dashed var(--border-strong); color: var(--ink-2); font-size: 12.5px; padding: 6px 12px; }
.msg.thinking { background: var(--surface-2); color: var(--ink-2); font-size: 12.5px; font-style: italic; }
.msg.highlight { outline: 2px solid var(--accent); }
.tools-block { border: 1px solid var(--border); border-radius: 6px; background: var(--surface); overflow: hidden; }
.tool-row { border-top: 1px solid var(--grid); }
.tool-row:first-child { border-top: 0; }
.tool-row > summary {
  list-style: none; cursor: pointer; display: grid; grid-template-columns: 18px minmax(80px, max-content) 1fr auto;
  gap: 8px; align-items: center; padding: 6px 12px; font-size: 12.5px;
}
.tool-row > summary::-webkit-details-marker { display: none; }
.tool-row > summary:hover { background: var(--surface-2); }
.tool-row .tname { font-weight: 600; color: var(--ink); white-space: nowrap; }
.tool-row .tsum { font-family: var(--mono); font-size: 12px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tool-row .tstat { color: var(--muted); font-size: 11.5px; white-space: nowrap; }
.tool-row .ticon { color: var(--good-ink); text-align: center; }
.tool-row.err .ticon { color: var(--critical-ink); }
.tool-row.err { background: var(--critical-wash); }
.tool-row .tdetail { padding: 4px 12px 12px 38px; display: grid; gap: 8px; }
.tool-row pre {
  margin: 0; background: var(--code-bg); border-radius: 6px; padding: 8px 10px; font-size: 12px;
  white-space: pre-wrap; overflow-wrap: anywhere; max-height: 360px; overflow: auto;
}
.tool-row .plabel { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.load-more { display: flex; justify-content: center; margin-top: 12px; }

.kb-section { margin-top: 16px; }
.kb-section h3 { margin-bottom: 6px; }
.kb-section ul { margin: 0; padding-left: 18px; }
.kb-section li { margin: 5px 0; }
.src-link { font-size: 11px; color: var(--muted); margin-left: 4px; }
.src-link a { color: var(--muted); }

.proj-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 12px; }
.proj-card { color: var(--ink); display: flex; flex-direction: column; transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s; }
.proj-card:hover { text-decoration: none; border-color: var(--border-strong); transform: translateY(-1px); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.07); }
.proj-card .pc-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.proj-card .pname { font-weight: 650; font-size: 15.5px; letter-spacing: -0.01em; }
.proj-card .ppath { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 1px; }
.proj-card .pstats { display: flex; gap: 6px 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-2); }
.proj-card .pstats span { display: inline-flex; align-items: center; gap: 5px; }
.proj-card .pstats .icon { width: 14px; height: 14px; color: var(--muted); }
.proj-card .pstats b { color: var(--ink); font-weight: 600; }
.proj-card .pfoot { display: flex; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 12px; font-size: 12px; color: var(--ink-2); }
.wbars { display: flex; align-items: flex-end; gap: 3px; height: 42px; margin: 14px 0 12px; }
.wbars i { flex: 1; max-width: 24px; background: var(--chart); border-radius: 3px 3px 0 0; }
.wbars i.zero { height: 2px; background: var(--grid); border-radius: 1px; }
.wbars i.hover { background: var(--chart-strong); }
.mini-outcomes { display: grid; gap: 7px; margin-top: 12px; }
.mo-text { display: flex; gap: 4px 12px; flex-wrap: wrap; font-size: 12px; color: var(--ink-2); }
.mo-text span { display: inline-flex; gap: 4px; align-items: center; }
.mo-text .icon { width: 13px; height: 13px; color: var(--s-ink); }
.badge.muted-badge { color: var(--muted); }

mark { background: var(--accent-wash-2); color: inherit; border-radius: 3px; padding: 0 1px; }

.status-list { display: grid; gap: 8px; }
.status-row { display: flex; gap: 10px; align-items: center; }
.status-row .ok { color: var(--good-ink); font-weight: 700; width: 18px; }
.status-row .no { color: var(--critical-ink); font-weight: 700; width: 18px; }
.codeline { font-family: var(--mono); font-size: 12px; background: var(--code-bg); padding: 2px 6px; border-radius: 5px; }

/* ------------------------------------------------------------------ glossary */
.gterm { border-bottom: 1px dotted var(--accent); cursor: help; }
.gterm:hover, .gterm:focus { background: var(--accent-wash); outline: none; }
.letters { display: flex; flex-wrap: wrap; gap: 2px; margin-bottom: 14px; }
.letters a, .letters span { min-width: 26px; text-align: center; padding: 3px 6px; border-radius: 6px; font-weight: 600; font-size: 13px; }
.letters a:hover { background: var(--surface-2); text-decoration: none; }
.letters span { color: var(--grid); }
.gletter { font-size: 20px; margin: 22px 0 10px; color: var(--ink-2); }
.gcard { scroll-margin-top: 80px; }
.gcard .ghead { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.gcard .gterm-title { font-size: 16px; font-weight: 650; }
.gcard .galiases { color: var(--muted); font-size: 12.5px; }
.gcard .gdef { margin: 6px 0 8px; }
.gcard .gusage { margin: 0; padding-left: 18px; color: var(--ink-2); font-size: 13px; }
.gcard .gusage li { margin: 2px 0; }
.gcard .gfoot { margin-top: 8px; font-size: 12px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 12px; }
.gcard.focus { outline: 2px solid var(--accent); }
.ggrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 12px; }
@media (max-width: 760px) { .ggrid { grid-template-columns: 1fr; } }

/* ------------------------------------------------------------------ agents & sources */
.agent-tag { display: inline-block; font-size: 10.5px; font-weight: 600; letter-spacing: 0.03em; text-transform: uppercase;
  padding: 0 6px; border-radius: 4px; margin-left: 6px; vertical-align: 1px; border: 1px solid var(--tag-rim, var(--border-strong));
  color: var(--tag-ink, var(--ink-2)); background: var(--tag-wash, transparent); }
/* one hue per agent, from the chart palette (so it follows the theme); "recovered" stays neutral */
.agent-tag[class*=" a-"] { --tag-ink: color-mix(in srgb, var(--c) 78%, var(--ink)); --tag-rim: color-mix(in srgb, var(--c) 45%, transparent);
  --tag-wash: color-mix(in srgb, var(--c) 10%, transparent); }
.agent-tag.a-codex { --c: var(--series-3); }
.agent-tag.a-copilot { --c: var(--series-7); }
.agent-tag.a-bob { --c: var(--series-1); }
.agent-tag.a-antigravity { --c: var(--series-8); }
.agent-tag.a-claude-ai { --c: var(--series-2); }
.agent-tag.a-chatgpt { --c: var(--series-5); }
/* Sources: one list per kind of source; each row opens to its checks and actions */
.narrow-page.wide { max-width: 980px !important; }
.card.src-list { padding: 0; margin-bottom: 18px; overflow: hidden; }
.src-list-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 14px 18px 12px; border-bottom: 1px solid var(--grid); }
.src-list-head h2 { margin: 0; }
.src-list-head .muted { font-size: 12.5px; margin-top: 3px; }
.src-row + .src-row { border-top: 1px solid var(--grid); }
.src-row > summary, .src-line { display: grid; grid-template-columns: 14px 10px minmax(0, 1fr) auto auto; align-items: center; gap: 12px; padding: 11px 18px; }
.src-row > summary { cursor: pointer; list-style: none; }
.src-row > summary::-webkit-details-marker { display: none; }
.src-row > summary:hover { background: var(--hover); }
.src-row > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.src-row .chev { color: var(--muted); font-size: 15px; line-height: 1; transition: transform 0.15s; justify-self: center; }
.src-row[open] > summary .chev { transform: rotate(90deg); }
.src-row[open] > summary { background: var(--surface-2); }
.src-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c, var(--muted)); }
.agent-cell { display: inline-flex; align-items: center; gap: 7px; }
.agent-cell .src-dot { width: 8px; height: 8px; flex: none; }
.agent-sub { padding-left: 15px; }
table.data.sessions :is(th, td) { padding-left: 8px; padding-right: 8px; } /* eleven columns: fit a 1440 px window */
.src-dot.a-claude { --c: var(--series-4); }
.src-dot.a-codex, .src-dot.a-codex-cloud { --c: var(--series-3); }
.src-dot.a-copilot { --c: var(--series-7); }
.src-dot.a-bob { --c: var(--series-1); }
.src-dot.a-antigravity { --c: var(--series-8); }
.src-dot.a-claude-ai { --c: var(--series-2); }
.src-dot.a-chatgpt { --c: var(--series-5); }
.src-title { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.src-title b { font-weight: 600; font-size: 14px; white-space: nowrap; }
.src-title small { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.src-sum { display: flex; gap: 14px; color: var(--ink-2); font-size: 12.5px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.src-sum b { color: var(--ink); font-weight: 600; }
.src-body { padding: 4px 18px 16px 62px; background: var(--surface-2); }
.src-stats { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 4px 0 12px; font-size: 13px; color: var(--ink-2); }
.src-stats b { color: var(--ink); font-weight: 600; }
.src-body .checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 10px 20px; margin-bottom: 12px; }
.src-body .check { display: grid; grid-template-columns: 18px 1fr; gap: 6px; font-size: 13px; }
.src-body .check .mark { font-weight: 700; text-align: center; }
.src-body .check .mark.ok { color: var(--good-ink); }
.src-body .check .mark.no { color: var(--critical-ink); }
.src-body .check .mark.na { color: var(--muted); }
.src-body .check .d { color: var(--muted); font-size: 12px; }
.src-note { color: var(--ink-2); font-size: 12.5px; margin-bottom: 12px; }
.screen-stats { margin-top: -6px; }
.screen-stats a { color: var(--ink-2); text-decoration: none; }
.screen-stats a:hover b, .screen-stats a:hover { color: var(--accent); }
/* screening of imported chats: the verdict, then why */
.screen-v { font-weight: 600; color: var(--ink-2); }
.screen-v.good { color: var(--good-ink); }
.screen-v.warning { color: var(--warning-ink); }
.screen-line { margin-top: 6px; font-size: 13px; color: var(--ink-2); }
.src-foot { display: flex; gap: 8px; align-items: center; justify-content: space-between; flex-wrap: wrap; border-top: 1px solid var(--grid); padding-top: 12px; font-size: 12.5px; }
.src-actions { display: flex; gap: 8px; align-items: center; flex: none; }
.src-foot .src-actions { flex-wrap: wrap; flex: 0 1 auto; max-width: 100%; } /* a phone: the buttons wrap rather than run off the card */
@media (max-width: 760px) {
  .src-sum { display: none; }
  .src-title { flex-direction: column; align-items: stretch; gap: 1px; }
  .src-body { padding-left: 18px; }
  .src-list-head { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) { .src-row .chev { transition: none; } }
.btn.danger { color: var(--critical-ink); }

/* ------------------------------------------------------------------ cards / list layouts */
.head-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.view-toggle button { display: inline-flex; align-items: center; gap: 6px; }
.view-toggle svg { width: 13px; height: 13px; fill: currentColor; opacity: 0.85; }
.card.flush { padding: 4px 6px; }
a.plain { color: inherit; }
table.list-table tr.row-link:focus-visible { outline: none; }
table.list-table tr.row-link:focus-visible td { background: var(--accent-wash); }
table.list-table tr.open td { background: var(--surface-2); border-bottom-color: transparent; }
table.list-table tr.detail-row td { background: var(--surface-2); padding: 0 14px 14px; }
table.list-table tr.detail-row .kbody { color: var(--ink-2); font-size: 13px; max-width: 900px; }
table.list-table tr.detail-row .gusage { margin: 0; padding-left: 18px; color: var(--ink-2); font-size: 13px; }
table.list-table tr.detail-row .gfoot { margin-top: 8px; font-size: 12px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 12px; }
table.list-table tr.group-row th {
  background: var(--surface-2); color: var(--ink-2); font-size: 12.5px; font-weight: 650;
  padding: 5px 10px; border-bottom: 1px solid var(--grid); scroll-margin-top: 80px;
}
table.list-table tr.pinned td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
table.list-table tr.focus td { background: var(--accent-wash); }
table.list-table .from-cell { max-width: 240px; font-size: 12.5px; }
table.list-table .from-cell a { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
table.list-table .actions-cell { width: 1%; white-space: nowrap; }
table.list-table .kactions { display: flex; gap: 2px; opacity: 0.35; transition: opacity 0.15s; }
table.list-table tr:hover .kactions, table.list-table tr:focus-within .kactions { opacity: 1; }
table.list-table .kactions button { border: 0; background: none; cursor: pointer; color: var(--ink-2); padding: 2px 5px; border-radius: 5px; font-size: 12px; }
table.list-table .kactions button:hover { background: var(--surface-3); color: var(--ink); }
table.list-table .term-cell { min-width: 160px; scroll-margin-top: 80px; }
table.list-table .term-cell .gterm-title { font-weight: 600; }
table.list-table .term-cell .s { color: var(--muted); font-size: 12px; }
table.list-table .def-cell { color: var(--ink-2); min-width: 320px; }
table.list-table tr.grow { scroll-margin-top: 80px; }

.scard-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 12px; }
.scard { display: flex; flex-direction: column; gap: 6px; color: var(--ink); padding: 13px 15px; }
.scard:hover { text-decoration: none; border-color: var(--border-strong); }
.scard .scard-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.scard .t { font-weight: 600; line-height: 1.35; min-width: 0; overflow-wrap: anywhere; }
.scard .m { color: var(--muted); font-size: 12px; }
.scard .s { color: var(--ink-2); font-size: 13px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.scard .scard-stats { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: auto; padding-top: 8px; font-size: 12.5px; color: var(--ink-2); border-top: 1px solid var(--grid); }
.scard .scard-stats b { color: var(--ink); font-weight: 600; }
@media (max-width: 760px) { .scard-grid, .kgrid, .proj-cards { grid-template-columns: 1fr; } }
table.list-table tr.open .title-cell .s { display: none; }
table.list-table tr.detail-row td:only-child, table.list-table tr.detail-row td + td { padding-left: 10px; }
@media (max-width: 760px) {
  /* phones: keep each list's key columns; the rest is one tap away in the detail row or the linked page */
  .knowledge-table :is(th, td):is(:nth-child(3), :nth-child(4), :nth-child(5), :nth-child(6)),
  .glossary-table :is(th, td):is(:nth-child(2), :nth-child(5), :nth-child(6)),
  .projects-table :is(th, td):is(:nth-child(4), :nth-child(6), :nth-child(7)) { display: none; }
  .knowledge-table tr.detail-row td, .glossary-table tr.detail-row td { display: table-cell; }
  table.list-table .title-cell, table.list-table .def-cell { min-width: 0; }
  table.list-table .term-cell { min-width: 110px; }
  .knowledge-table tr.detail-row td:first-child { display: none; }
}
table.list-table :is(.title-cell, .def-cell, .term-cell) { overflow-wrap: anywhere; } /* long paths must not widen the table */

/* ------------------------------------------------------------------ icons */
.icon { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon .solid { fill: currentColor; stroke: none; }
.icon.spin { animation: spin 1.1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.small { font-size: 12px; }

/* card heads */
.card-title { display: flex; align-items: center; gap: 8px; min-width: 0; }
.card-title .icon { width: 16px; height: 16px; color: var(--muted); }
.link-arrow { display: inline-flex; align-items: center; gap: 4px; }
.link-arrow .icon { width: 13px; height: 13px; }

/* status: every status color travels with an icon and a label */
.s-good { --s: var(--good); --s-ink: var(--good-ink); }
.s-warning { --s: var(--warning); --s-ink: var(--warning-ink); }
.s-critical { --s: var(--critical); --s-ink: var(--critical-ink); }
.s-serious { --s: var(--serious); --s-ink: var(--serious-ink); }
.s-accent { --s: var(--accent); --s-ink: var(--accent-ink); }
.s-neutral { --s: var(--muted); --s-ink: var(--ink-2); }
.s-none { --s: var(--surface-3); --s-ink: var(--muted); }
.badge .icon { width: 13px; height: 13px; color: var(--muted); }
.badge.good .icon { color: var(--good-ink); }
.badge.warning .icon { color: var(--warning-ink); }
.badge.critical .icon { color: var(--critical-ink); }
.badge.serious .icon { color: var(--serious-ink); }
.badge.accent .icon { color: var(--accent-ink); }
.status-icon, .kind-icon { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 6px; background: var(--surface-2); color: var(--ink-2); flex: none; }
.status-icon .icon, .kind-icon .icon { width: 16px; height: 16px; }
.status-icon.good { color: var(--good-ink); background: color-mix(in srgb, var(--good) 13%, transparent); }
.status-icon.warning { color: var(--warning-ink); background: color-mix(in srgb, var(--warning) 16%, transparent); }
.status-icon.critical { color: var(--critical-ink); background: color-mix(in srgb, var(--critical) 13%, transparent); }
.status-icon.serious { color: var(--serious-ink); background: color-mix(in srgb, var(--serious) 15%, transparent); }
.status-icon.accent { color: var(--accent-ink); background: var(--accent-wash); }
.kind-icon { color: var(--accent-ink); background: var(--accent-wash); }

/* outcome breakdown: one stacked bar (2px surface gaps) + a legend that links to the sessions */
.outcomes { display: grid; gap: 12px; }
.stackbar { display: flex; gap: 2px; height: 14px; }
.stackbar .seg { min-width: 3px; border-radius: 2px; background: var(--s); transition: filter 0.15s; }
.stackbar .seg:first-child { border-top-left-radius: 4px; border-bottom-left-radius: 4px; }
.stackbar .seg:last-child { border-top-right-radius: 4px; border-bottom-right-radius: 4px; }
.stackbar a.seg:hover, .stackbar .seg.hover { filter: brightness(0.9); }
.stackbar.thin { height: 6px; }
.legend-list { display: grid; gap: 1px; }
.legend-row { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto 40px; align-items: center; gap: 8px; padding: 5px 6px; border-radius: 8px; color: var(--ink); font-size: 13px; }
.legend-row:hover { background: var(--surface-2); text-decoration: none; }
.legend-row .icon { width: 15px; height: 15px; color: var(--s-ink); }
.legend-row .lval { font-variant-numeric: tabular-nums; font-weight: 600; }
.legend-row .lpct { font-variant-numeric: tabular-nums; color: var(--muted); text-align: right; font-size: 12px; }

/* legends, averages, notes */
.mini-legend { display: inline-flex; gap: 12px; align-items: center; font-size: 12px; color: var(--ink-2); }
.mini-legend span { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.mini-legend .sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--chart); }
.mini-legend .sw.critical { background: var(--critical); }
.mini-legend .sw.line { width: 14px; height: 2px; border-radius: 1px; background: var(--ink-2); }
.chart > .mini-legend { display: flex; justify-content: flex-end; margin: -4px 0 6px; }
.avg-line { fill: none; stroke: var(--ink-2); stroke-width: 1.75; stroke-linejoin: round; stroke-linecap: round; opacity: 0.85; pointer-events: none; }
.chart-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px 12px; flex-wrap: wrap; margin-top: 8px; }
.chart-foot .scale-legend { margin-top: 0; }
.chart-note { font-size: 12px; color: var(--ink-2); }
.chart-note b { color: var(--ink); font-weight: 600; }
.cal-wrap { display: flex; gap: 12px 26px; align-items: flex-start; flex-wrap: wrap; }
.cal-stats { display: grid; gap: 12px; padding-top: 16px; min-width: 150px; }

/* chips, kinds, meters */
.chip .icon { width: 14px; height: 14px; color: var(--muted); }
.chip.on .icon { color: var(--accent-ink); }
.kind-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; color: var(--ink-2); background: var(--surface-2); border-radius: 7px; padding: 2px 9px 2px 7px; }
.kind-chip .icon { width: 14px; height: 14px; color: var(--accent-ink); }
.kind-cell { color: var(--ink-2); }
.kind-cell .icon { width: 14px; height: 14px; margin-right: 7px; vertical-align: -2px; color: var(--accent-ink); }
.kmeta { display: inline-flex; align-items: center; gap: 10px; }
.scope-tag { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; color: var(--muted); }
.scope-tag .icon { width: 13px; height: 13px; }
.meter { display: inline-flex; gap: 2px; align-items: flex-end; height: 12px; }
.stage-tag { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; font-weight: 500; line-height: 1.5;
  padding: 0 7px; border-radius: 999px; white-space: nowrap; color: var(--muted); background: var(--surface-2); vertical-align: 1px; }
.stage-tag b { font-weight: 600; }
.stage-tag.s-established { color: var(--accent-ink); background: var(--accent-wash); }
.stage-tag.s-canonical { color: var(--accent-ink); background: var(--accent-wash-2); box-shadow: inset 0 0 0 1px var(--accent); }
.stage-tag.s-wip { color: var(--warning-ink); background: transparent; box-shadow: inset 0 0 0 1px var(--border-strong); }
.meter i { width: 4px; border-radius: 1.5px; background: var(--accent-wash-2); }
.meter i:nth-child(1) { height: 6px; }
.meter i:nth-child(2) { height: 9px; }
.meter i:nth-child(3) { height: 12px; }
.meter i.on { background: var(--accent); }
.ktags { display: flex; flex-wrap: wrap; gap: 4px; }
.ktags .tag { margin: 0; }
.kfoot-meta { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; min-width: 0; }
.meta-item { display: inline-flex; align-items: center; gap: 5px; min-width: 0; max-width: 100%; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
a.meta-item { color: var(--accent-ink); }
.meta-item .icon { width: 13px; height: 13px; }
.more-btn { align-self: flex-start; padding: 0; }
.kactions button { display: inline-grid; place-items: center; }
.kactions .icon { width: 14px; height: 14px; }
.kactions button[aria-pressed="true"] { color: var(--accent); }
.badge.cat .icon { color: var(--muted); }

/* session cards: a status edge, stats with icons */
.scard { --stripe: transparent; box-shadow: inset 3px 0 0 var(--stripe), var(--shadow); transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s; }
.scard:hover { transform: translateY(-1px); box-shadow: inset 3px 0 0 var(--stripe), 0 8px 24px rgba(0, 0, 0, 0.07); }
.scard.o-good { --stripe: var(--good); }
.scard.o-warning { --stripe: var(--warning); }
.scard.o-critical { --stripe: var(--critical); }
.scard.o-serious { --stripe: var(--serious); }
.scard.o-accent { --stripe: var(--accent); }
.scard .scard-stats span { display: inline-flex; align-items: center; gap: 5px; }
.scard .scard-stats .icon { width: 14px; height: 14px; color: var(--muted); }

/* numbers with a magnitude bar (track = a lighter step of the accent) */
.cellbar { width: 56px; height: 3px; margin: 6px 0 0 auto; border-radius: 2px; background: var(--accent-wash-2); overflow: hidden; }
.cellbar i { display: block; height: 100%; background: var(--chart); border-radius: 2px; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.meta-item.session-link { max-width: min(100%, 300px); }
.peak-label, .marker-label { paint-order: stroke; stroke: var(--surface); stroke-width: 3px; stroke-linejoin: round; }
.gcard .ghead { justify-content: space-between; align-items: flex-start; flex-wrap: nowrap; }
.gcard .gname { min-width: 0; }
.gcard .galiases { margin-top: 2px; }
.card-head { flex-wrap: wrap; row-gap: 8px; }
.card-head .tools { flex-wrap: wrap; }
select { max-width: 100%; text-overflow: ellipsis; }
.card, .kcard { overflow-wrap: anywhere; } /* long paths and identifiers wrap instead of widening the page */

/* Map: glossary mindmap. Marks carry the category colour (--c); text stays in ink tokens. */
.mm-page .page-head { align-items: center; }
.mm-page .head-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mm-search { width: 210px; }
.mm-card { display: grid; grid-template-columns: minmax(0, 1fr) 360px; flex: 1; min-height: 440px; overflow: hidden; }
.mm-canvas { position: relative; min-width: 0; overflow: hidden; cursor: grab;
  background-color: var(--surface);
  background-image: radial-gradient(circle, var(--grid) 1.1px, transparent 1.4px); }
.mm-canvas.dragging { cursor: grabbing; }
.mm-svg { display: block; width: 100%; height: 100%; touch-action: none; user-select: none; }

.mm-links path { fill: none; stroke-width: 1.6; stroke: var(--c, var(--baseline)); stroke: color-mix(in srgb, var(--c, var(--baseline)) 55%, var(--surface)); }
.mm-links path.neutral { stroke: var(--baseline); }

.mm-node { cursor: pointer; outline: none; }
.mm-node text { font-size: 13px; fill: var(--ink); dominant-baseline: auto; }
.mm-node .mm-count { font-size: 12px; font-weight: 500; fill: var(--muted); }
.mm-node .mm-hit { fill: transparent; }
.mm-node .mm-box { transition: fill 0.12s, stroke 0.12s; }

.mm-node.root .mm-box { fill: var(--cta); }
.mm-node.root text { font-size: 15px; font-weight: 600; fill: var(--cta-ink); }
.mm-node.root .mm-count { fill: color-mix(in srgb, var(--cta-ink) 70%, transparent); }
.mm-node.project .mm-box { fill: var(--surface); stroke: var(--border-strong); }
.mm-node.project text { font-size: 13.5px; font-weight: 600; }
.mm-node.project.hover .mm-box { fill: var(--surface-2); }
.mm-node.category .mm-box { fill: var(--surface-2); stroke: var(--border-strong);
  fill: color-mix(in srgb, var(--c) 11%, var(--surface)); stroke: color-mix(in srgb, var(--c) 45%, var(--surface)); }
.mm-node.category.hover .mm-box { fill: color-mix(in srgb, var(--c) 19%, var(--surface)); }
.mm-node.category text { font-weight: 500; }
.mm-node .mm-icon { color: var(--c); }
.mm-node.term .mm-box { fill: transparent; }
.mm-node.term.hover .mm-box { fill: var(--surface-2); }
.mm-node.term text { fill: var(--ink-2); }
.mm-node.term text.strong { fill: var(--ink); font-weight: 500; }
.mm-node .mm-dot { fill: var(--c); stroke: var(--surface); stroke-width: 1.5; }
.mm-node.agent .mm-box { fill: var(--surface); stroke: var(--border-strong); stroke-dasharray: 5 3; }
.mm-node.agent text { font-size: 13.5px; font-weight: 600; }
.mm-node.agent.hover .mm-box { fill: var(--surface-2); }
.mm-node.theme .mm-box { fill: var(--surface); stroke: var(--border-strong);
  fill: color-mix(in srgb, var(--c) 5%, var(--surface)); stroke: color-mix(in srgb, var(--c) 32%, var(--surface)); }
.mm-node.theme.hover .mm-box { fill: color-mix(in srgb, var(--c) 12%, var(--surface)); }
.mm-node.theme text { font-weight: 500; }
.mm-node.theme .mm-tdot { fill: var(--c); }
.mm-node.ungrouped text { font-style: italic; fill: var(--ink-2); }
.mm-node.kitem .mm-box, .mm-node.session .mm-box { fill: transparent; }
.mm-node.kitem.hover .mm-box, .mm-node.session.hover .mm-box { fill: var(--surface-2); }
.mm-node.kitem text, .mm-node.session text { font-size: 12.5px; fill: var(--ink-2); }
.mm-node.kitem .mm-icon, .mm-node.session .mm-icon { color: var(--ink-2); }
.mm-node.kitem.sel .mm-box, .mm-node.session.sel .mm-box { fill: var(--accent-wash-2); }
.mm-links path.leaf { stroke: var(--grid); stroke: color-mix(in srgb, var(--baseline) 70%, var(--surface)); stroke-dasharray: 3 3; }
.mm-node.more .mm-box { fill: var(--surface); stroke: var(--border-strong); stroke-dasharray: 3 3; }
.mm-node.more text { font-size: 12.5px; fill: var(--ink-2); }
.mm-node.more.hover .mm-box { fill: var(--surface-2); }

.mm-node .mm-knob circle { fill: var(--surface); stroke: var(--c, var(--border-strong)); stroke-width: 1.5; }
.mm-node .mm-knob path { stroke: var(--ink-2); stroke-width: 1.6; stroke-linecap: round; }
.mm-node.root .mm-knob circle { stroke: var(--accent); }
.mm-node.hover .mm-knob circle { fill: var(--surface-2); }

.mm-node.hit .mm-box { fill: color-mix(in srgb, var(--c, var(--accent)) 16%, var(--surface));
  stroke: color-mix(in srgb, var(--c, var(--accent)) 65%, var(--surface)); stroke-width: 1.5; }
.mm-node.hit text { fill: var(--ink); font-weight: 600; }
.mm-node.sel .mm-box { stroke: var(--accent); stroke-width: 2; }
.mm-node.term.sel .mm-box { fill: var(--accent-wash-2); }
.mm-node:focus-visible .mm-box { stroke: var(--accent); stroke-width: 2; }

@keyframes mm-in { from { opacity: 0; } to { opacity: 1; } }
.mm-node.enter, .mm-links path.enter { animation: mm-in 0.24s ease-out both; }
@media (prefers-reduced-motion: reduce) { .mm-node.enter, .mm-links path.enter { animation: none; } }

/* level picker, floating top-left in the canvas */
.mm-levels { position: absolute; left: 12px; top: 12px; display: flex; align-items: center; flex-wrap: wrap; gap: 6px;
  padding: 6px 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 6px; box-shadow: var(--shadow);
  font-size: 12.5px; color: var(--ink-2); max-width: calc(100% - 24px); }
.mm-levels-label { font-weight: 600; color: var(--ink); margin-right: 2px; }
.mm-level { font: inherit; font-size: 12.5px; color: var(--ink); background: var(--surface-2); border: 1px solid var(--border-strong);
  border-radius: 7px; padding: 3px 6px; cursor: pointer; }
.mm-level.add { background: transparent; border-style: dashed; color: var(--ink-2); }
.mm-sep { color: var(--muted); }
.mm-levels-end { color: var(--muted); font-style: italic; }
/* side-panel extras */
.mm-note { margin-top: 16px; padding: 12px 14px; border-radius: 6px; background: var(--accent-wash); border: 1px solid var(--accent-wash-2); }
.mm-note b { display: block; font-size: 13.5px; }
.mm-note p { margin: 6px 0 10px; font-size: 12.5px; line-height: 1.5; color: var(--ink-2); }
.mm-tchip.preset { padding: 4px 10px; }
.mm-tchip.preset.on { border-color: var(--accent); background: var(--accent-wash); }
.mm-theme-tag { display: inline-block; margin-left: 6px; font-size: 12px; color: var(--ink-2); }
.mm-theme-tag::before { content: "› "; color: var(--muted); }
.mm-themes { display: grid; gap: 4px; margin: 0 -8px; }
.mm-theme { display: grid; gap: 1px; text-align: left; font: inherit; padding: 6px 8px; border: 0; border-radius: 7px; background: transparent; color: var(--ink); }
button.mm-theme { cursor: pointer; }
button.mm-theme:hover { background: var(--surface-2); }
.mm-theme-name { font-size: 13px; font-weight: 500; }
.mm-count-inline { margin-left: 7px; font-size: 12px; font-weight: 400; color: var(--muted); font-variant-numeric: tabular-nums; }
.mm-theme-desc { font-size: 12.5px; color: var(--ink-2); line-height: 1.4; }
.mm-date { flex: none; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 48px; }
.mm-def.muted { color: var(--muted); font-size: 12.5px; }

/* floating legend and tools */
.mm-legend, .mm-tools { position: absolute; background: var(--surface); border: 1px solid var(--border); border-radius: 6px; box-shadow: var(--shadow); }
.mm-legend { left: 12px; bottom: 12px; right: 170px; width: max-content; max-width: calc(100% - 190px); display: flex; flex-wrap: wrap; gap: 4px 12px; padding: 7px 12px; font-size: 12px; color: var(--ink-2); }
.mm-legend span { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.mm-cdot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--c); flex: none; }
.mm-sizes { padding-left: 12px; border-left: 1px solid var(--border); }
.mm-sizes i { display: inline-block; border-radius: 50%; background: var(--ink-2); }
.mm-sizes .d1 { width: 6px; height: 6px; } .mm-sizes .d2 { width: 8px; height: 8px; } .mm-sizes .d3 { width: 10px; height: 10px; }
.mm-tools { right: 12px; bottom: 12px; display: flex; overflow: hidden; }
.mm-tools button { width: 34px; height: 32px; border: 0; background: transparent; color: var(--ink-2); font-size: 17px; line-height: 1; cursor: pointer; display: grid; place-items: center; }
.mm-tools button + button { border-left: 1px solid var(--border); }
.mm-tools button:hover { background: var(--surface-2); color: var(--ink); }
.mm-tools .icon { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* details panel */
.mm-detail { border-left: 1px solid var(--border); padding: 18px 20px 22px; overflow-y: auto; position: relative; font-size: 13.5px; background: var(--surface); }
.mm-detail h3 { margin: 6px 0 0; font-size: 19px; line-height: 1.25; letter-spacing: -0.01em; padding-right: 34px; overflow-wrap: anywhere; }
.mm-detail h4 { margin: 20px 0 8px; font-size: 11.5px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.mm-close { position: absolute; top: 12px; right: 12px; }
.mm-cat { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; color: var(--ink-2); padding: 2px 9px 2px 7px; border-radius: 999px;
  background: var(--surface-2); background: color-mix(in srgb, var(--c, var(--muted)) 12%, var(--surface)); }
.mm-cat .icon { width: 13px; height: 13px; color: var(--c, var(--ink-2)); }
.mm-cat.neutral { background: var(--surface-2); }
.mm-aliases { color: var(--muted); font-size: 12.5px; margin-top: 4px; }
.mm-def { margin: 10px 0 0; font-size: 14px; line-height: 1.55; color: var(--ink); }
.mm-stats { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 12px; font-size: 12.5px; color: var(--muted); }
.mm-stats b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.mm-uses { display: grid; gap: 8px; }
.mm-use { padding: 9px 11px; border-radius: 6px; background: var(--surface-2); font-size: 13px; line-height: 1.45; color: var(--ink-2); }
.mm-use > a, .mm-use > b { display: block; font-weight: 600; color: var(--ink); margin-bottom: 2px; }
.mm-use > a:hover { color: var(--accent-ink); }
.mm-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.mm-def + .mm-chips { margin-top: 14px; }
.mm-tchip { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; font: inherit; font-size: 12.5px; color: var(--ink); background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: 999px; padding: 3px 10px 3px 8px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mm-tchip:hover { background: var(--surface-2); border-color: var(--c, var(--border-strong)); }
.mm-tchip.off { color: var(--muted); cursor: default; border-style: dashed; }
.mm-klist { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.mm-klist li { display: flex; gap: 8px; align-items: baseline; line-height: 1.4; }
.mm-klist .kind-chip { flex: none; }
.mm-more { display: inline-block; margin-top: 10px; font-size: 12.5px; }
.mm-pick-filter { width: 100%; margin: 16px 0 8px; }
.mm-pick { list-style: none; margin: 0 -8px; padding: 0; }
.mm-pick button { display: flex; align-items: center; gap: 9px; width: 100%; padding: 6px 8px; border: 0; border-radius: 7px; background: transparent;
  font: inherit; font-size: 13px; color: var(--ink); text-align: left; cursor: pointer; }
.mm-pick button:hover, .mm-pick button:focus-visible { background: var(--surface-2); outline: none; }
.mm-pick .mm-cdot { background: var(--c, var(--ink-2)); }
.mm-pick-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mm-pick-sub { flex: none; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.mm-pick-none { padding: 8px; color: var(--muted); }
.mm-links-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.mm-tip { margin-top: 22px; font-size: 12.5px; line-height: 1.5; color: var(--muted); }
.mm-detail .hero-facts { margin: 14px 0 0; }

@media (max-width: 1100px) { .mm-card { grid-template-columns: minmax(0, 1fr) 300px; } .mm-legend { display: none; } }
@media (max-width: 900px) {
  .mm-card { grid-template-columns: 1fr; grid-template-rows: minmax(420px, 62vh) auto; height: auto; flex: none; }
  .mm-page { height: auto; }
  .mm-detail { border-left: 0; border-top: 1px solid var(--border); }
}

/* Systems: folders as boxes, systems as cards, a system's parts in role columns. Marks carry --c; text stays in ink tokens. */
.sy-groups rect { fill: color-mix(in srgb, var(--c) 4%, var(--surface)); stroke: color-mix(in srgb, var(--c) 30%, var(--surface)); stroke-width: 1; }
.sy-group.d1 rect, .sy-group.d2 rect, .sy-group.d3 rect { fill: color-mix(in srgb, var(--c) 3%, var(--surface)); stroke-dasharray: 4 3; }
.sy-gtitle { font-size: 13px; font-weight: 600; fill: var(--ink); fill: color-mix(in srgb, var(--c) 45%, var(--ink)); }
.sy-gcount { font-size: 12px; fill: var(--muted); font-variant-numeric: tabular-nums; }
.sy-card, .sy-node { cursor: pointer; outline: none; transition: opacity 0.15s; }
.sy-cbox { fill: var(--surface); stroke: var(--border-strong); stroke-width: 1; transition: fill 0.12s, stroke 0.12s; }
.sy-card.hover .sy-cbox { fill: var(--surface-2); }
.sy-cstripe, .sy-nstripe { fill: var(--c); }
.sy-ctitle { font-size: 13.5px; font-weight: 600; fill: var(--ink); }
.sy-csub { font-size: 12px; fill: var(--muted); }
.sy-cstack { font-size: 11.5px; fill: var(--ink-2); }
.sy-cbar-bg { fill: var(--surface-3); }
.sy-cbar { fill: var(--c); opacity: 0.75; }
.sy-cicon { color: var(--muted); }
.sy-card.near .sy-cbox { stroke: color-mix(in srgb, var(--accent) 55%, var(--surface)); stroke-width: 1.5; }
.sy-card.hit .sy-cbox { fill: color-mix(in srgb, var(--c) 12%, var(--surface)); stroke: var(--c); stroke-width: 1.5; }
.sy-card.sel .sy-cbox, .sy-node.sel .sy-nbox { stroke: var(--accent); stroke-width: 2; }
.sy-card:focus-visible .sy-cbox, .sy-node:focus-visible .sy-nbox { stroke: var(--accent); stroke-width: 2; }
.sy-card.dim, .sy-node.dim { opacity: 0.32; }

.sy-link { fill: none; stroke-width: 1.6; transition: opacity 0.15s; }
.sy-link.files { stroke: var(--accent); stroke: color-mix(in srgb, var(--accent) 55%, var(--surface)); }
.sy-link.mentions { stroke: var(--baseline); stroke-dasharray: 5 4; }
.sy-link.on { stroke: var(--accent); stroke-width: 2.2; opacity: 1; }
.sy-link.mentions.on { stroke: var(--ink-2); }
.sy-link.off, .sy-edge.off { opacity: 0.12; }
.sy-arrow { fill: var(--baseline); }
.sy-arrow-on { fill: var(--accent); }

.sy-rowhead line { stroke: color-mix(in srgb, var(--c) 30%, var(--surface)); stroke-width: 1; }
.sy-colhead { font-size: 11.5px; font-weight: 600; letter-spacing: 0.06em; fill: var(--ink-2); fill: color-mix(in srgb, var(--c) 60%, var(--ink)); }
.sy-nbox { fill: color-mix(in srgb, var(--c) 6%, var(--surface)); stroke: color-mix(in srgb, var(--c) 38%, var(--surface)); stroke-width: 1; transition: fill 0.12s; }
.sy-node.hover .sy-nbox { fill: color-mix(in srgb, var(--c) 13%, var(--surface)); }
.sy-ntitle { font-size: 13px; font-weight: 600; fill: var(--ink); }
.sy-nsub { font-size: 11.5px; fill: var(--ink-2); }
.sy-nstack { font-size: 11px; fill: var(--muted); }
.sy-nact { font-size: 11.5px; fill: var(--muted); font-variant-numeric: tabular-nums; }
.sy-edge path { fill: none; stroke: var(--baseline); stroke-width: 1.5; }
.sy-edge.calls path { stroke: color-mix(in srgb, var(--series-1) 60%, var(--surface)); }
.sy-edge.depends path { stroke: color-mix(in srgb, var(--series-7) 55%, var(--surface)); }
.sy-edge.deploys path { stroke: color-mix(in srgb, var(--series-2) 60%, var(--surface)); }
.sy-edge.provisions path { stroke: color-mix(in srgb, var(--series-4) 65%, var(--surface)); stroke-dasharray: 5 4; }
.sy-edge.on path { stroke: var(--accent); stroke-width: 2.2; }
.sy-elabel { font-size: 11px; fill: var(--ink-2); paint-order: stroke; stroke: var(--surface); stroke-width: 4px; stroke-linejoin: round; }
.sy-edge.on .sy-elabel { fill: var(--ink); font-weight: 500; }
.sy-edges.quiet .sy-edge:not(.on):not(.hover) .sy-elabel { display: none; }

.sy-path { font-size: 12px; color: var(--muted); margin-top: 4px; overflow-wrap: anywhere; }
.sy-chip { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 999px; background: var(--surface-2); font-size: 12px; color: var(--ink-2); }
.sy-chip em { font-style: normal; color: var(--muted); }
.sy-chips { margin-top: 12px; }
.sy-ports { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.sy-ports .muted { flex-basis: 100%; font-size: 12.5px; margin-top: 2px; }
.sy-legend > div { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--ink-2); margin: 6px 0; }
.sy-legend svg { flex: none; overflow: visible; }
.sy-hint { font-size: 12.5px; margin-top: 18px; line-height: 1.5; }
.sy-linkrow { position: relative; }
.sy-lkind { position: absolute; top: 9px; right: 11px; font-size: 10.5px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
.sy-linkrow > a { padding-right: 64px; }
.sy-evlist { gap: 10px; }
.sy-ev { display: flex; gap: 9px; align-items: flex-start; }
.sy-ev > .icon { width: 14px; height: 14px; flex: none; margin-top: 2px; color: var(--muted); }
.sy-ev > div { min-width: 0; flex: 1; color: var(--ink-2); overflow-wrap: anywhere; }
.sy-examples { display: grid; gap: 4px; margin-top: 6px; }
.sy-example { display: flex; gap: 8px; align-items: baseline; min-width: 0; }
.sy-example code { flex: 1; min-width: 0; font-size: 11.5px; background: var(--code-bg); padding: 2px 6px; border-radius: 6px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sy-evline { font-size: 12px; margin-top: 2px; overflow-wrap: anywhere; }
.sy-rolelegend { right: auto; }
.head-actions .btn .icon { width: 15px; height: 15px; margin-right: 6px; vertical-align: -2px; }

/* ------------------------------------------------------------------ session page: header facts, summary, tabs, outline */
.session-page { display: grid; grid-template-columns: minmax(0, 1fr); gap: 36px; }
@media (min-width: 1380px) { .session-page.with-outline { grid-template-columns: minmax(0, 1fr) 232px; } }
.session-page:not(.with-outline) .s-outline { display: none; }
@media (max-width: 1379px) { .s-outline { display: none; } .ol-toggle { display: none; } }
.s-main { min-width: 0; }
.session-page .session-head { margin-bottom: 0; }
.sfacts { display: flex; flex-wrap: wrap; gap: 10px 30px; margin-top: 16px; padding: 13px 0; border-block: 1px solid var(--grid); }
.sfact b { display: block; font-size: 17px; font-weight: 650; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sfact span { font-size: 12px; color: var(--muted); white-space: nowrap; }
.sfact small { font-size: 12px; }
.sfact small.bad { color: var(--critical-ink); }
.s-summary { max-width: 78ch; margin: 16px 0 0; font-size: 14.5px; line-height: 1.6; color: var(--ink-2); }
.s-waiting { color: var(--muted); font-size: 13.5px; }
.s-waiting .icon { width: 14px; height: 14px; vertical-align: -2px; }
.s-kchips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.s-kchip { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 4px 10px 4px 8px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); font-size: 12.5px; color: var(--ink); cursor: pointer; }
.s-kchip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 46ch; }
.s-kchip:hover { border-color: var(--accent); }
.s-kchip .icon { width: 14px; height: 14px; color: var(--accent-ink); }
.s-kchip.k-gotcha .icon { color: var(--series-2); }
.s-kchip.k-fix .icon { color: var(--series-3); }
.s-kchip.k-decision .icon { color: var(--series-7); }
.s-kchip.k-fact .icon { color: var(--series-4); }
.s-kchip.more { color: var(--ink-2); }
.s-tabbar { display: flex; align-items: center; gap: 10px; margin: 24px 0 14px; }
.s-tabbar .ol-toggle { margin-left: auto; }
mark.qhit { background: color-mix(in srgb, var(--warning) 40%, transparent); }
mark.qhit.on { background: var(--warning); color: #1a1a1a; box-shadow: 0 0 0 2px var(--warning); }
.tool-row.qmatch > summary { box-shadow: inset 3px 0 0 var(--warning); }
.tool-row.highlight { outline: 2px solid var(--accent); outline-offset: -2px; }
.kcard.flash { box-shadow: 0 0 0 2px var(--accent), var(--shadow); }

.s-outline { position: sticky; top: 60px; align-self: start; max-height: calc(100vh - 170px); overflow-y: auto; padding-top: 6px; font-size: 12.5px; scrollbar-width: thin; }
.s-outline h4 { margin: 0 0 8px; font-size: 11px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
.ol-prompts { list-style: none; margin: 0 0 22px; padding: 0; border-left: 1.5px solid var(--grid); }
.ol-prompts li { padding: 4px 0 4px 12px; margin-left: -1.5px; border-left: 1.5px solid transparent; color: var(--ink-2); cursor: pointer; line-height: 1.4; }
.ol-prompts li span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ol-prompts li:hover { color: var(--ink); }
.ol-prompts li.on { border-left-color: var(--accent); color: var(--ink); }
.ol-prompts li small { display: block; color: var(--muted); font-variant-numeric: tabular-nums; }
.ol-prompts:empty::after { content: "Loading…"; display: block; padding-left: 12px; color: var(--muted); }
.ol-files div { display: flex; justify-content: space-between; gap: 8px; padding: 2px 0; font-family: var(--mono); font-size: 11.5px; color: var(--ink-2); }
.ol-files span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ol-files em { font-style: normal; color: var(--good-ink); }

/* transcript: prompts as bubbles, replies as plain text, tool calls as one-line rows */
.transcript-controls .spacer { flex: 1; }
.transcript-controls .hint { color: var(--muted); font-size: 12.5px; }
.transcript { gap: 14px; }
.msg.user { background: var(--user-bubble); border: 0; border-radius: 14px 14px 14px 4px; padding: 10px 14px; max-width: min(78ch, 100%); }
.msg.assistant { background: transparent; border: 0; padding: 2px 2px; }
.msg.assistant .md { max-width: 82ch; line-height: 1.6; }
.msg.thinking { border-radius: 6px; }
.tools-block { border-radius: 6px; border-color: var(--border-strong); }
.tool-row > summary { padding: 7px 12px; }
.tool-row .tname { font-size: 12px; color: var(--ink-2); }
.tool-row .tsum { color: var(--ink); }

/* settings pages */
.narrow-page { max-width: 760px !important; }
.set-card { padding: 4px 18px; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 14px 0; border-top: 1px solid var(--grid); }
.set-row:first-child { border-top: 0; }
.set-row b { font-weight: 600; }
.set-row .muted { font-size: 12.5px; margin-top: 2px; }
.switch { position: relative; flex: none; width: 38px; height: 22px; border-radius: 11px; border: 0; background: var(--surface-3); cursor: pointer; transition: background 0.15s; box-shadow: inset 0 0 0 0.5px var(--border-strong); }
.switch::after { content: ""; position: absolute; left: 2px; top: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3); transition: transform 0.15s; }
.switch[aria-checked="true"] { background: var(--good); }
.switch[aria-checked="true"]::after { transform: translateX(16px); }
.search-form { position: relative; max-width: 620px; margin-bottom: 18px; }
.search-form .icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search-form input { width: 100%; padding: 9px 12px 9px 34px; font-size: 14px; }
/* search all sessions: one group per session, each mention a row that opens the transcript there */
.filters .search-form { flex: 1 1 420px; margin-bottom: 0; }
.sr-group { padding: 14px 12px 12px; border-bottom: 1px solid var(--grid); }
.sr-group:last-child { border-bottom: 0; }
.sr-head { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.sr-title { min-width: 0; font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-title:hover { color: var(--accent-ink); }
.sr-count { margin-left: auto; flex: none; padding: 1px 8px; border-radius: 6px; font-size: 12px; color: var(--ink-2); font-variant-numeric: tabular-nums;
  background: color-mix(in srgb, var(--warning) 22%, transparent); }
.sr-meta { margin: 2px 0 8px; font-size: 12px; color: var(--muted); }
.sr-summary { margin-bottom: 6px; font-size: 13px; color: var(--ink-2); }
.sr-hits { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--grid); }
.sr-hit { display: grid; grid-template-columns: 110px minmax(0, 1fr) auto; gap: 10px; align-items: baseline; padding: 4px 8px 4px 10px;
  border-radius: 0 6px 6px 0; font-size: 13px; color: var(--ink-2); }
.sr-hit:hover { background: var(--surface-2); color: var(--ink); }
.sr-who { font-size: 12px; font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-who.you { color: var(--accent-ink); }
.sr-who small { font-weight: 400; color: var(--muted); }
.sr-snip { overflow-wrap: anywhere; }
.sr-time { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.sr-all { margin: 6px 0 0 8px; }
@media (max-width: 640px) {
  .sr-hit { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "who time" "snip snip"; row-gap: 2px; }
  .sr-who { grid-area: who; } .sr-time { grid-area: time; } .sr-snip { grid-area: snip; }
}
@media (prefers-reduced-motion: reduce) { .shell, .titlestrip, .switch, .switch::after { transition: none; } }
/* the map's floating controls sit over the canvas: panels, like the toolbar */
.mm-levels, .mm-legend, .mm-tools { background: var(--glass); border: 0; border-radius: 6px;
  box-shadow: var(--glass-shadow), inset 0 0 0 0.5px var(--glass-rim), inset 0 1px 0 var(--glass-hi); }
.mm-tools { border-radius: 6px; padding: 0 4px; }
.mm-tools button { border-radius: 6px; }
.mm-tools button + button { border-left: 0; }
.mm-tools button:hover { background: var(--hover); }

.sb-body { display: contents; } /* the sidebar's content, swapped in whole once it has loaded */
.mm-page { display: flex; flex-direction: column; height: calc(100vh - 36px - 62px - 16px); } /* stage minus main's top padding */
main#app:has(> .mm-page) { padding-bottom: 16px; }
.mm-page .page-head { flex: none; }
table.data a.proj { overflow-wrap: normal; word-break: normal; white-space: nowrap; }
.load-more.earlier { margin: 0 0 12px; }

/* an update on offer: a dot on Settings, a highlighted Updates card, and a notification card */
.has-update .rail a[data-section="settings"]::after,
.has-update .sb-row[href="#/status"]::after { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px var(--page); }
.has-update .rail a[data-section="settings"]::after { position: absolute; top: 7px; right: 7px; }
.statusbar #status-update { background: color-mix(in srgb, var(--accent) 12%, transparent); padding: 2px 8px; margin: 0; border-radius: 999px; }
.statusbar #status-update:hover { background: color-mix(in srgb, var(--accent) 20%, transparent); color: var(--accent); }
.statusbar #status-update .dot { background: var(--accent); animation: pulse 2s infinite; }
.card.update-ready { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 45%, transparent); }
.card.flash { animation: upd-flash 1.6s ease-out; }
@keyframes upd-flash { 0%, 30% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 35%, transparent); } }
.upd-daily { border-top: 1px solid var(--grid); padding: 10px 0 2px; }
.upd-headline { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.upd-headline .icon { width: 15px; height: 15px; color: var(--accent); }
.upd-changes .subhead { margin-top: 4px; }
.upd-commits, .upd-files { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 5px; font-size: 13px; }
.upd-commits li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: baseline; }
.upd-commits li span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upd-commits code { font-family: var(--mono); font-size: 12px; color: var(--accent-ink); }
.upd-commits .muted { font-size: 12px; }
.upd-changes details { margin-top: 8px; }
.upd-changes summary { cursor: pointer; color: var(--ink-2); font-size: 13px; }
#update-note {
  position: fixed; right: 18px; bottom: 44px; z-index: 61; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px;
  width: min(340px, calc(100vw - 32px)); padding: 14px 12px 14px 14px; border-radius: 6px; background: var(--glass-strong); color: var(--ink); font-size: 13px;
  box-shadow: var(--glass-shadow), 0 8px 28px rgba(0, 0, 0, 0.14), inset 0 0 0 0.5px var(--glass-rim);
  animation: upd-in 0.25s ease-out;
}
#update-note .un-icon { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 6px; background: var(--cta); color: var(--cta-ink); }
#update-note .un-icon .icon { width: 16px; height: 16px; }
#update-note .un-body { display: grid; gap: 3px; }
#update-note .un-body > div { color: var(--ink-2); }
#update-note .un-actions { display: flex; gap: 6px; margin-top: 8px; }
:is(#update-note, #activity) .un-close { align-self: start; border: 0; background: transparent; color: var(--muted); font-size: 17px; line-height: 1; padding: 2px 5px; border-radius: 6px; cursor: pointer; }
:is(#update-note, #activity) .un-close:hover { background: var(--hover); color: var(--ink); }
@keyframes upd-in { from { opacity: 0; transform: translateY(8px); } }
@media (prefers-reduced-motion: reduce) { #update-note, .card.flash, .statusbar #status-update .dot { animation: none; } }
/* after an update: the dashboard restarts, and the page waits for it under this cover */
#restart-wait { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 16px; background: color-mix(in srgb, var(--page) 55%, transparent);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); animation: sk-in 0.2s ease-out; }
#restart-wait .rw-card { display: grid; justify-items: center; gap: 6px; width: min(360px, 100%); padding: 22px 20px; border-radius: 6px; text-align: center;
  background: var(--glass-strong); color: var(--ink); font-size: 13px; box-shadow: var(--glass-shadow), 0 12px 40px rgba(0, 0, 0, 0.18), inset 0 0 0 0.5px var(--glass-rim); }
#restart-wait .rw-card > .icon { width: 22px; height: 22px; color: var(--accent); margin-bottom: 4px; }
#restart-wait .rw-card b { font-size: 15px; }
#restart-wait .btn { margin-top: 6px; }
@media (prefers-reduced-motion: reduce) { #restart-wait { animation: none; } #restart-wait .icon.spin { animation-duration: 3s; } }

/* Sessions list: pick rows, then act on them from a floating bar */
table.data :is(th, td).pick { width: 1%; padding-right: 0; }
table.data td.pick { cursor: default; }
table.data .pick input { width: 15px; height: 15px; margin: 2px 0 0; accent-color: var(--accent); cursor: pointer; }
table.data .pick input:disabled { cursor: not-allowed; opacity: 0.4; }
table.data tr.picked td { background: color-mix(in srgb, var(--accent) 7%, transparent); }
table.data tr.picked:hover td { background: color-mix(in srgb, var(--accent) 11%, transparent); }
.sel-bar {
  position: sticky; bottom: 12px; z-index: 5; display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  width: fit-content; max-width: 100%; margin: 12px auto 0; padding: 8px 8px 8px 16px; border-radius: 999px;
  background: var(--glass-strong);
  box-shadow: var(--glass-shadow), 0 8px 24px rgba(0, 0, 0, 0.12), inset 0 0 0 0.5px var(--glass-rim); font-size: 13px;
}
.sel-bar .sel-count { font-weight: 600; font-variant-numeric: tabular-nums; }
.sel-bar .sel-spacer { width: 8px; }
.sel-bar .btn { border-radius: 999px; }
.text-link { border: 0; background: transparent; padding: 0; color: var(--accent-ink); cursor: pointer; font: inherit; }
.text-link:hover { text-decoration: underline; }

/* Activity: what the status bar's pill opens: running jobs with progress, the queue, recent results */
#activity {
  position: fixed; left: 12px; bottom: 38px; z-index: 62; width: min(400px, calc(100vw - 24px)); max-height: min(70vh, 560px); overflow-y: auto;
  padding: 12px 14px; border-radius: 6px; background: var(--glass-strong); color: var(--ink); font-size: 13px;
  box-shadow: var(--glass-shadow), 0 10px 32px rgba(0, 0, 0, 0.16), inset 0 0 0 0.5px var(--glass-rim);
  animation: upd-in 0.18s ease-out;
}
#activity .act-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; font-size: 14px; }
#activity .act-section { display: grid; gap: 12px; padding: 4px 0 10px; }
#activity .act-section .subhead { margin: 2px 0 -4px; }
#activity .act-idle { padding: 2px 0; }
#activity .act-top { display: flex; justify-content: space-between; gap: 10px; font-variant-numeric: tabular-nums; }
#activity .act-msg { font-size: 12px; margin-top: 4px; overflow-wrap: anywhere; }
#activity .act-bar { position: relative; height: 6px; margin-top: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
#activity .act-bar i { position: absolute; inset: 0 auto 0 0; border-radius: 3px; background: var(--accent); transition: width 0.4s ease; }
#activity .act-bar.indeterminate i { width: 30%; animation: act-slide 1.3s ease-in-out infinite; }
@keyframes act-slide { from { left: -30%; } to { left: 100%; } }
#activity .act-queue { display: flex; gap: 8px; align-items: flex-start; padding: 10px 0; border-top: 1px solid var(--grid); border-bottom: 1px solid var(--grid); color: var(--ink-2); font-size: 12.5px; }
#activity .act-queue .icon { width: 15px; height: 15px; flex: none; margin-top: 1px; color: var(--muted); }
#activity .act-queue.warn .icon { color: var(--warning); }
#activity .act-section + .act-queue { margin-top: 0; }
#activity .act-queue + .act-section { padding-top: 10px; }
#activity .act-done { display: grid; grid-template-columns: 16px 1fr; gap: 6px; }
#activity .act-mark { font-weight: 700; text-align: center; }
#activity .act-mark.ok { color: var(--good-ink); }
#activity .act-mark.no { color: var(--critical-ink); }
#activity .act-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding-top: 10px; border-top: 1px solid var(--grid); font-size: 12px; }
@media (prefers-reduced-motion: reduce) { #activity, #activity .act-bar i { animation: none; transition: none; } #activity .act-bar.indeterminate i { left: 0; width: 100%; opacity: 0.4; } }

/* Export: a small menu of formats under (or, in the selection bar, above) its button */
details.menu { position: relative; }
details.menu > summary { list-style: none; display: inline-flex; align-items: center; gap: 6px; }
details.menu > summary::-webkit-details-marker { display: none; }
details.menu > summary .icon { width: 14px; height: 14px; }
details.menu[open] > summary { background: var(--surface-2); }
details.menu .menu-list {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; display: grid; width: 280px; padding: 5px;
  border-radius: 6px; background: var(--surface); border: 1px solid var(--border-strong); box-shadow: 0 10px 28px rgba(0, 0, 0, 0.14);
}
details.menu.up .menu-list { top: auto; bottom: calc(100% + 8px); }
details.menu .menu-list button { display: grid; gap: 1px; text-align: left; border: 0; background: transparent; color: var(--ink); padding: 7px 10px; border-radius: 8px; cursor: pointer; font: inherit; }
details.menu .menu-list button:hover:not(:disabled) { background: var(--hover); }
details.menu .menu-list button:disabled { opacity: 0.45; cursor: not-allowed; }
details.menu .menu-list b { font-weight: 600; font-size: 13px; }
details.menu .menu-list span { color: var(--muted); font-size: 12px; }

/* MCP page: setup snippets and the tool list */
.mcp-card { margin-bottom: 18px; }
.mcp-card .seg { margin-bottom: 10px; flex-wrap: wrap; }
.mcp-where { font-size: 12.5px; margin-bottom: 8px; }
.mcp-code { margin: 0; padding: 12px 14px; border-radius: 6px; background: var(--code-bg); overflow-x: auto; font-size: 12.5px; line-height: 1.5; white-space: pre; }
.mcp-tools { display: grid; gap: 10px; margin-bottom: 14px; }
.mcp-tool { display: grid; gap: 2px; font-size: 13px; }
.mcp-tool code { font-weight: 600; }
.mcp-tool .muted { font-size: 12.5px; }
.mcp-note { font-size: 12.5px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--grid); }

/* Knowledge hub: one card per way into the knowledge */
.hub-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 900px) { .hub-grid { grid-template-columns: 1fr; } }
.hub-card { display: flex; flex-direction: column; gap: 12px; color: var(--ink); padding: 18px 20px; transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s; }
.hub-card:hover { text-decoration: none; border-color: var(--border-strong); transform: translateY(-1px); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.07); }
.hub-top { display: flex; align-items: flex-start; gap: 12px; }
.hub-icon { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 6px; background: var(--accent-wash); color: var(--accent-ink); }
.hub-icon .icon { width: 18px; height: 18px; }
.hub-title { flex: 1; min-width: 0; }
.hub-title h2 { font-size: 16px; }
.hub-title p { margin: 2px 0 0; color: var(--ink-2); font-size: 12.5px; }
.hub-go { width: 16px; height: 16px; color: var(--muted); margin-top: 2px; transition: transform 0.15s, color 0.15s; }
.hub-card:hover .hub-go { color: var(--accent-ink); transform: translateX(2px); }
.hub-num { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.hub-num b { font-size: 30px; font-weight: 650; letter-spacing: -0.03em; line-height: 1; }
.hub-num span { color: var(--ink-2); font-size: 12.5px; }
.hub-body { display: grid; gap: 10px; margin-top: auto; min-width: 0; }
.hub-empty { color: var(--muted); font-size: 12.5px; padding: 10px 0; }
.hub-mm { width: 100%; height: auto; max-height: 130px; overflow: visible; }
.hub-mm text { fill: var(--ink-2); font-size: 10.5px; font-family: var(--sans); }
.hub-mm-link { fill: none; stroke: var(--baseline); stroke-width: 1.2; }
.hub-mm-root { fill: var(--ink); stroke: var(--surface); stroke-width: 3; }
.hub-mm-node { stroke: var(--surface); stroke-width: 1.5; }
.hub-kinds { height: 8px; }
.hub-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--ink-2); }
.hub-legend span { display: inline-flex; align-items: center; gap: 5px; }
.hub-legend i { width: 8px; height: 8px; border-radius: 2px; }
.hub-legend b { color: var(--ink); font-weight: 600; }
.hub-recent { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; font-size: 12.5px; color: var(--ink-2); }
.hub-recent li { display: flex; gap: 7px; align-items: center; min-width: 0; }
.hub-recent li > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hub-recent .icon { flex: none; width: 13px; height: 13px; color: var(--accent-ink); }
.hub-terms { display: flex; flex-wrap: wrap; gap: 6px; }
.hub-term { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; padding: 3px 9px 3px 7px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hub-term .icon { width: 12px; height: 12px; color: var(--muted); flex: none; }
.hub-headline { margin: 0; font-size: 13px; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* Day bars: one week's active time, Mon..Sun */
.day-bars { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.db-col { display: grid; gap: 4px; justify-items: center; }
.db-track { width: 100%; height: var(--h, 90px); display: flex; align-items: flex-end; justify-content: center; }
.db-track i { display: block; width: min(100%, 34px); background: var(--seq-3); border-radius: 4px 4px 1px 1px; }
.db-track i.peak { background: var(--chart); }
.db-track i.zero { height: 2px; background: var(--grid); border-radius: 1px; }
.db-col.hover .db-track i { filter: brightness(0.9); }
.db-col span { font-size: 11px; color: var(--muted); }

/* Weekly reviews */
.rv-weeks { display: flex; gap: 6px; overflow-x: auto; padding: 2px 2px 8px; margin-bottom: 8px; scrollbar-width: thin; }
.rv-weeks a { flex: none; display: grid; gap: 1px; padding: 6px 12px; border-radius: 6px; border: 1px solid var(--border); background: var(--surface); color: var(--ink-2); text-align: center; }
.rv-weeks a b { font-size: 13px; color: var(--ink); font-weight: 600; }
.rv-weeks a span { font-size: 11px; }
.rv-weeks a:hover { text-decoration: none; border-color: var(--border-strong); }
.rv-weeks a.on { background: var(--accent-wash); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.rv-weeks a.on b { color: var(--accent-ink); }
.rv { display: grid; gap: 14px; }
.rv-hero { padding: 20px 22px; background: linear-gradient(155deg, var(--accent-wash) 0%, transparent 55%), var(--surface); }
.rv-kicker { display: flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600; color: var(--accent-ink); }
.rv-kicker .icon { width: 14px; height: 14px; }
.rv-kicker span { color: var(--muted); font-weight: 400; }
.rv-headline { font-size: 21px; line-height: 1.3; letter-spacing: -0.02em; margin-top: 8px; text-wrap: balance; max-width: 70ch; }
.rv-tldr { margin: 14px 0 0; padding: 0; list-style: none; display: grid; gap: 7px; }
.rv-tldr li { position: relative; padding-left: 20px; font-size: 14px; color: var(--ink); max-width: 90ch; }
.rv-tldr li::before { content: ""; position: absolute; left: 4px; top: 0.55em; width: 7px; height: 7px; border-radius: 2px; background: var(--accent); }
.rv-kpis { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.rv-charts { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr) minmax(0, 1fr); gap: 14px; }
@media (max-width: 1100px) { .rv-charts { grid-template-columns: repeat(2, minmax(0, 1fr)); } .rv-charts > :last-child { grid-column: 1 / -1; } }
@media (max-width: 700px) { .rv-charts { grid-template-columns: 1fr; } }
.rv-charts .mini-outcomes { margin-top: 0; }
.rv-kinds { display: flex; flex-wrap: wrap; gap: 6px; }
.rv-kinds .kind-chip { color: var(--ink-2); }
.rv-kinds .kind-chip:hover { text-decoration: none; background: var(--surface-3); }
.rv-kinds .kind-chip b { color: var(--ink); font-weight: 600; }
.rv-section { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; font-weight: 500; margin: 4px 0 -4px; }
.rv-themes { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(250px, 100%), 1fr)); gap: 12px; }
.rv-theme { display: grid; gap: 6px; align-content: start; cursor: pointer; padding: 14px 16px; }
.rv-theme > b { font-size: 14px; font-weight: 600; }
.rv-theme .rv-tags .tag { margin-top: 0; }
.rv-theme p { margin: 0; font-size: 12.5px; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rv-theme.open p { display: block; }
.rv-lists { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; } /* rows fill: 3+2, 2+2, 3 … never one alone */
.rv-lists > .rv-list { grid-column: span var(--span, 2); }
@media (max-width: 1100px) {
  .rv-lists { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rv-lists > .rv-list { grid-column: auto; }
  .rv-lists > .rv-list:last-child:nth-child(odd) { grid-column: 1 / -1; }
}
@media (max-width: 700px) { .rv-lists { grid-template-columns: 1fr; } }
.rv-list { padding: 14px 16px; border-top: 3px solid var(--tone); }
.rv-list.t-good { --tone: var(--good); } .rv-list.t-accent { --tone: var(--accent); } .rv-list.t-warning { --tone: var(--warning); } .rv-list.t-serious { --tone: var(--serious); }
.rv-list-head { display: flex; align-items: center; gap: 7px; margin-bottom: 8px; }
.rv-list-head .icon { width: 15px; height: 15px; color: var(--tone); }
.rv-list-head h3 { flex: 1; }
.rv-list-head > span { font-size: 12px; color: var(--muted); }
.rv-items { list-style: none; margin: 0; padding: 0; display: grid; }
.rv-items li { position: relative; font-size: 13px; line-height: 1.45; color: var(--ink); padding: 8px 8px 8px 24px; margin: 0 -8px; border-radius: 7px; cursor: pointer; }
.rv-items li + li::after { content: ""; position: absolute; top: 0; left: 24px; right: 8px; border-top: 1px solid var(--grid); }
.rv-items li::before { content: ""; position: absolute; left: 9px; top: calc(8px + 0.72em - 3px); width: 6px; height: 6px; border-radius: 50%; background: var(--tone); }
.rv-items li:hover { background: var(--hover); }
.rv-items li:hover::after, .rv-items li:hover + li::after { border-color: transparent; }
.rv-items li > span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rv-items li.open > span { display: block; }
.rv-full summary { cursor: pointer; font-weight: 500; color: var(--accent-ink); font-size: 13px; }
.rv-full[open] summary { margin-bottom: 10px; }
.rv-full .md { max-width: 80ch; }
@media (prefers-reduced-motion: reduce) { .hub-card, .hub-go { transition: none; } }

/* Knowledge bases and the global playbook */
.kb { display: grid; gap: 14px; }
.kb-lead { margin: 10px 0 0; font-size: 14px; color: var(--ink-2); max-width: 90ch; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.kb-hero .hero-facts { margin: 16px 0 0; }
.kb-tools { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.kb-tools .input { min-width: min(260px, 100%); }
.kb-nav { display: flex; flex-wrap: wrap; gap: 6px; }
.kb-chip { display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: 12.5px; color: var(--ink-2); background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 4px 11px 4px 9px; cursor: pointer; }
.kb-chip:hover { border-color: var(--border-strong); color: var(--ink); }
.kb-chip .icon { width: 14px; height: 14px; color: var(--tone); }
.kb-chip b { font-weight: 600; color: var(--ink); }
.kb-chip.t-good, .rv-list.t-good { --tone: var(--good); } .kb-chip.t-accent { --tone: var(--accent); }
.kb-chip.t-warning { --tone: var(--warning); } .kb-chip.t-serious { --tone: var(--serious); }
.kb-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: start; }
@media (max-width: 900px) { .kb-grid { grid-template-columns: 1fr; } }
.kb-sec { scroll-margin-top: 70px; }
.kb-sec .rv-items li > span b { font-weight: 600; }
.kb-src { display: none; margin-top: 6px; font-size: 12px; color: var(--muted); }
.kb-src a { color: var(--accent-ink); }
.rv-items li.open .kb-src { display: block; }

/* Architecture sketch: rough.js paths, coloured here so they follow the theme */
.btn.kbd-dl { display: inline-flex; align-items: center; gap: 5px; color: var(--ink); text-decoration: none; }
.btn.kbd-dl .icon { width: 14px; height: 14px; }
.kbd-scroll { overflow-x: auto; margin: 0 -4px; padding: 0 4px; }
.chart .kbd-svg { height: auto; margin: 0 auto; }
.kbd-node { --k: var(--muted); cursor: pointer; outline: none; }
.kbd-node.k-component, .kbd-legend .k-component { --k: var(--series-1); }
.kbd-node.k-interface, .kbd-legend .k-interface { --k: var(--series-3); }
.kbd-node.k-store, .kbd-legend .k-store { --k: var(--series-4); }
.kbd-node.k-external, .kbd-legend .k-external { --k: var(--muted); }
.kbd-svg path { fill: none; }
.kbd-node .o { stroke: var(--ink-2); }
.kbd-node .f { stroke: var(--k); opacity: 0.5; }
.kbd-node .o.dash { stroke-dasharray: 6 5; }
.kbd-node:hover .o, .kbd-node.hover .o, .kbd-node.on .o { stroke: var(--k); stroke-width: 2.2px; }
.kbd-node:hover .f, .kbd-node.on .f { opacity: 0.75; }
.kbd-node:focus-visible .o { stroke: var(--accent); stroke-width: 2.6px; }
.kbd-label { fill: var(--ink); font-family: var(--sans); font-weight: 550; pointer-events: none; }
.kbd-edge { cursor: pointer; }
.kbd-edge .o { stroke: var(--muted); }
.kbd-edge .hit { stroke: transparent; stroke-width: 12px; pointer-events: stroke; }
.kbd-edge:hover .o, .kbd-edge.hover .o, .kbd-edge.on .o { stroke: var(--ink-2); stroke-width: 1.8px; }
.kbd-elabel { fill: var(--ink-2); font-family: var(--sans); paint-order: stroke; stroke: var(--surface); stroke-width: 4px; stroke-linejoin: round; pointer-events: none; }
.kbd-svg.picking .kbd-node:not(.on), .kbd-svg.picking .kbd-edge:not(.on), .kbd-svg.picking .kbd-elabel:not(.on) { opacity: 0.2; }
.kbd-svg g, .kbd-svg text { transition: opacity 0.15s; }
.kbd-foot { display: grid; gap: 8px; margin-top: 10px; font-size: 12.5px; }
.kbd-legend { display: flex; flex-wrap: wrap; gap: 4px 16px; color: var(--ink-2); }
.kbd-legend span { display: inline-flex; align-items: center; gap: 6px; }
.kbd-legend i { width: 14px; height: 10px; border-radius: 2px; border: 1.3px solid var(--ink-2); background: color-mix(in srgb, var(--k) 45%, transparent); }
.kbd-legend .k-external i { border-style: dashed; background: none; }
.kbd-legend .k-interface i { border-radius: 4px; }
.kbd-detail { min-height: 2.6em; color: var(--ink-2); }
.kbd-detail b { color: var(--ink); font-weight: 600; }
.kbd-src { margin-top: 3px; color: var(--muted); }
.kbd-src a { color: var(--accent-ink); }
@media (prefers-reduced-motion: reduce) { .kbd-svg g, .kbd-svg text { transition: none; } }
.warn-line { color: var(--warning-ink); }
.warn-line .icon { width: 13px; height: 13px; vertical-align: -2px; }

/* Suggestions: the approval queue, its Home card and the rail badge */
.rail-badge { position: absolute; top: 1px; right: 0; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--cta); color: var(--cta-ink);
  font-size: 10px; font-weight: 650; line-height: 16px; text-align: center; font-variant-numeric: tabular-nums; box-shadow: 0 0 0 1.5px var(--page); pointer-events: none; }
.sg-filters { margin-bottom: 14px; }
/* one row when it fits; on a phone the segments tile, and the shadows draw the lines between rows too */
.sg-status { flex-wrap: wrap; max-width: 100%; }
.sg-status button { flex: 1 0 auto; box-shadow: -1px -1px 0 var(--border); }
.sg-status button + button { border-left: 0; }
.seg .count { margin-left: 5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.sg-why { margin-right: 6px; font-size: 13.5px; }
.sg-scope { margin: -4px 0 14px; font-size: 13px; }
.sg-groups { display: grid; gap: 16px; }
.sg-ghead { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.sg-ghead h2 { font-family: var(--mono); font-size: 13.5px; font-weight: 600; overflow-wrap: anywhere; }
.sg-ghead .muted { font-size: 12.5px; margin-top: 2px; }
.sg-ghead .hint { color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.sg-list { display: grid; gap: 10px; }
.sg-more { margin-top: 8px; }
.sg-card { display: grid; gap: 7px; min-width: 0; padding: 12px 14px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); }
.sg-card.st-dismissed .sg-title, .sg-card.st-stale .sg-title { color: var(--ink-2); }
.sg-card.flash { box-shadow: 0 0 0 2px var(--accent); }
.sg-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.sg-head .tag { margin: 0; }
.sg-title { font-weight: 600; font-size: 14.5px; line-height: 1.38; letter-spacing: -0.005em; }
.sg-evidence { color: var(--ink-2); font-size: 12.5px; }
.sg-examples { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; font-size: 12.5px; }
.sg-examples li { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sg-warn { display: flex; flex-wrap: wrap; gap: 6px; }
.sg-warn .badge { white-space: normal; }
.sg-text { width: 100%; min-height: 3.4em; resize: vertical; field-sizing: content; font: inherit; font-size: 13px; line-height: 1.45; }
.sg-code { margin: 0; padding: 9px 12px; border-radius: 8px; background: var(--code-bg); white-space: pre-wrap; overflow-wrap: anywhere; font-size: 12.5px; line-height: 1.5; }
.sg-cmd { display: flex; align-items: flex-start; gap: 8px; }
.sg-cmd .sg-code { flex: 1; min-width: 0; }
.sg-diffbox { min-width: 0; }
.sg-diff { display: grid; margin: 0; padding: 8px 0; border-radius: 8px; background: var(--code-bg); overflow: auto; max-height: 360px; font-size: 12px; line-height: 1.5; }
.sg-diff span { padding: 0 12px; white-space: pre; }
.sg-diff .dh { color: var(--muted); }
.sg-diff .dhunk { color: var(--accent-ink); }
.sg-diff .dadd { color: var(--good-ink); background: color-mix(in srgb, var(--good) 13%, transparent); }
.sg-diff .ddel { color: var(--critical-ink); background: var(--critical-wash); }
.sg-diff.empty-diff { display: block; padding: 8px 12px; color: var(--muted); font-size: 12.5px; }
.sg-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.sg-actions .muted { font-size: 12.5px; margin-right: auto; }
.sg-actions .sg-move { margin-left: auto; }
.sg-rows { display: grid; gap: 2px; }
.sg-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 8px; border-radius: 6px; }
.sg-row:hover { background: var(--surface-2); }
.sg-row-icon .icon { width: 16px; height: 16px; color: var(--accent-ink); display: block; }
.sg-row.settled .sg-row-icon .icon { color: var(--muted); }
.sg-row-main .t { display: block; font-weight: 500; color: var(--ink); }
.sg-row.settled .sg-row-main .t { color: var(--ink-2); }
.sg-row-main .m { color: var(--muted); font-size: 12px; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sg-row-act { display: flex; gap: 6px; }
@media (max-width: 640px) {
  .sg-row { grid-template-columns: auto minmax(0, 1fr); row-gap: 6px; }
  .sg-row-act { grid-column: 2; }
  .sg-row-main .m { white-space: normal; }
  .sg-ghead { flex-direction: column; gap: 4px; }
}

/* What goes wrong */
.fr-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 4px; }
.fr-sub .tag { margin: 0; }
.fr-trend .spark { width: 110px; }
.fr-tool { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fr-detail { display: grid; gap: 8px; padding-top: 10px; }
.fr-facts { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.fr-line { font-size: 12.5px; }
.fr-line .tag { margin: 2px 4px 0 0; }
.fr-fixes { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 13px; }
.fr-noise { margin: 0 0 8px; font-size: 13px; }
.sg-examples.one-line li { -webkit-line-clamp: 1; }
.sg-card > .link-btn { justify-self: start; padding-left: 0; }

/* Japanese UI (i18n.js sets <html lang>): Plex for Latin text as on the site, Japanese glyphs from the system's
   Japanese fonts, and line breaks that keep phrases whole */
:root:lang(ja) { --sans: "IBM Plex Sans", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", Meiryo, system-ui, sans-serif; }
:lang(ja) body { line-break: strict; word-break: auto-phrase; }
:lang(ja) .subhead { letter-spacing: 0.02em; }
/* the language switch beside the theme toggle: a short outlined label (日本語 / EN) */
.statusbar #lang-btn { margin: 0; padding: 1px 7px; border-radius: 999px; font-weight: 600; box-shadow: inset 0 0 0 1px var(--border-strong); }
.statusbar #lang-btn:hover { box-shadow: inset 0 0 0 1px transparent; }
.analyzer.klang { margin-top: 4px; }
.analyzer.klang .subhead { margin: 0; }

/* Artifacts: what sessions made. Kind colours come from the series palette, so both themes follow */
.ar-row { --k: var(--ink-2); }
.k-page { --k: var(--series-3); } .k-diagram { --k: var(--series-5); } .k-deck { --k: var(--series-2); }
.k-sheet { --k: var(--series-6); } .k-image { --k: var(--series-4); } .k-published { --k: var(--series-1); }
.k-pr { --k: var(--series-7); } .k-commit { --k: var(--muted); }
.ar-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.ar-chips .kb-chip { text-decoration: none; }
.ar-chips .kb-chip .icon { color: var(--k, var(--ink-2)); }
.ar-chips .kb-chip.on { border-color: var(--accent); background: var(--accent-wash); color: var(--ink); }
.ar-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0 0 12px; }
.ar-tools .input { flex: 1 1 260px; max-width: 420px; }
.ar-toggle { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-2); cursor: pointer; }
.ar-card { padding: 6px 8px; }
.ar-card > .card-head { padding: 10px 10px 0; }
.ar-list { display: grid; }
.ar-group { padding: 12px 10px 4px; font-size: 12px; font-weight: 600; color: var(--muted); }
.ar-row { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; }
.ar-row.compact { grid-template-columns: 26px minmax(0, 1fr); align-items: start; gap: 8px; padding: 7px 6px; }
.ar-row.compact .ar-icon { width: 26px; height: 26px; }
.ar-row.compact .ar-acts { display: none; }
.ar-row:hover { background: var(--hover); }
.ar-icon { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; color: var(--k);
  background: color-mix(in srgb, var(--k) 13%, transparent); }
.ar-icon .icon { width: 16px; height: 16px; }
.ar-main { min-width: 0; }
.ar-row.has-thumb { grid-template-columns: 48px minmax(0, 1fr) auto; }
.ar-row.compact.has-thumb { grid-template-columns: 40px minmax(0, 1fr); }
/* thumbnails sit on white in both themes: diagrams are drawn for a light page, often on a transparent one */
.ar-thumb { display: block; width: 48px; height: 48px; padding: 0; border: 1px solid var(--border); border-radius: 8px;
  overflow: hidden; background: #fff; cursor: zoom-in; }
.compact .ar-thumb { width: 40px; height: 40px; }
.ar-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.ar-thumb:focus-visible, .ar-tile-media:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ar-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; padding: 4px 4px 8px; }
.ar-tiles .ar-group { grid-column: 1 / -1; padding: 8px 4px 0; }
.ar-tile { display: grid; grid-template-rows: auto 1fr; min-width: 0; overflow: hidden; border: 1px solid var(--border);
  border-radius: 6px; background: var(--surface); }
.ar-tile-media { display: grid; place-items: center; width: 100%; aspect-ratio: 4 / 3; padding: 0; border: 0;
  border-bottom: 1px solid var(--border); overflow: hidden; background: #fff; cursor: zoom-in; }
.ar-tile-media img { width: 100%; height: 100%; object-fit: contain; }
.ar-tile-media.empty { align-content: center; gap: 6px; background: var(--surface-2); color: var(--muted); font-size: 12px; cursor: default; }
.ar-tile-media.empty .icon { width: 26px; height: 26px; color: var(--k); }
a.ar-tile-media.empty { cursor: pointer; color: var(--accent-ink); text-decoration: none; }
a.ar-tile-media.empty:hover { background: var(--accent-wash); }
.ar-tile-body { min-width: 0; padding: 8px 10px 10px; }
.ar-tile-title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere;
  font-size: 13px; font-weight: 550; color: var(--ink); }
.lightbox { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 24px; background: rgba(0, 0, 0, 0.74); }
.lightbox figure { display: grid; grid-template-rows: minmax(0, 1fr) auto; gap: 10px; max-width: min(1200px, 100%); max-height: 100%; margin: 0; }
.lightbox img { max-width: 100%; max-height: calc(100vh - 130px); margin: 0 auto; object-fit: contain; border-radius: 8px; background: #fff; }
.lightbox figcaption { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; font-size: 13px; color: #fff; }
.lightbox figcaption a { color: #cfe3ff; }
.lightbox figcaption .mono { max-width: 50ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--mono); font-size: 12px; color: rgba(255, 255, 255, 0.7); }
.lightbox .icon-btn { margin-left: auto; color: #fff; background: rgba(255, 255, 255, 0.12); border-color: rgba(255, 255, 255, 0.22); }
.ar-title { display: flex; align-items: center; gap: 8px; min-width: 0; font-weight: 550; }
.ar-title a { color: var(--ink); overflow: hidden; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.ar-row.is-gone .ar-title a { color: var(--ink-2); }
.ar-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; margin-top: 2px; font-size: 12px; color: var(--muted); min-width: 0; }
.ar-sub i { font-style: normal; }
.ar-sub a { color: var(--ink-2); }
.ar-sub .mono { font-family: var(--mono); font-size: 11.5px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ar-status { flex: none; padding: 1px 7px; border-radius: 999px; border: 1px solid var(--border); font-size: 11px; font-weight: 500; color: var(--muted); }
.ar-status.t-good { color: var(--good-ink); border-color: color-mix(in srgb, var(--good) 35%, transparent); background: color-mix(in srgb, var(--good) 8%, transparent); }
.ar-status.t-warning { color: var(--warning-ink); border-color: color-mix(in srgb, var(--warning) 45%, transparent); background: color-mix(in srgb, var(--warning) 10%, transparent); }
.ar-status.t-accent { color: var(--accent-ink); border-color: color-mix(in srgb, var(--accent) 35%, transparent); background: var(--accent-wash); }
.ar-acts { display: flex; align-items: center; gap: 4px; }
.ar-menu > summary { min-width: 30px; justify-content: center; font-weight: 700; letter-spacing: 1px; }
.ar-menu .menu-list { width: 300px; }
.ar-menu .menu-list span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lightbox .link-btn { color: #cfe3ff; padding: 0; font-size: 13px; }
.ar-act .icon { width: 14px; height: 14px; }
.ar-more { display: flex; justify-content: center; padding: 8px; }
.ar-more .btn[hidden] { display: none; }
.ol-made a { display: flex; align-items: center; gap: 6px; padding: 2px 0; font-size: 12px; color: var(--ink-2); }
.ol-made a .icon { flex: none; width: 13px; height: 13px; color: var(--muted); }
@media (max-width: 600px) {
  .ar-row { grid-template-columns: 26px minmax(0, 1fr); }
  .ar-acts { grid-column: 2; }
}

/* Devices › Team store: the Postgres connection form */
.ts-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px 12px; margin: 4px 0 12px; }
.ts-form label { display: grid; gap: 4px; font-size: 12.5px; color: var(--ink-2); min-width: 0; }
.ts-form .input, .ts-form select { width: 100%; min-width: 0; box-sizing: border-box; }
.ts-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.ts-result { margin-top: 8px; min-height: 1em; }
.ts-modes { margin-top: 10px; }

/* People on a hub: what non-admins don't get, the viewer in the toolbar, the sign-in screen, the People card */
:root.not-admin :is(.admin-only, .sg-actions, .sg-row-act, .kactions, .src-list button.btn) { display: none !important; }
.viewer-pill { gap: 6px; padding: 0 3px 0 10px; font-size: 12.5px; color: var(--ink-2); min-width: 0; max-width: 340px; }
.viewer-pill .icon { width: 14px; height: 14px; flex: none; color: var(--muted); }
.viewer-pill .vp-name { font-weight: 550; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.viewer-pill .vp-role { flex: none; font-size: 11.5px; color: var(--muted); }
.viewer-pill .vp-role.ro { color: var(--warning-ink); background: color-mix(in srgb, var(--warning) 16%, transparent); padding: 1px 7px; border-radius: 999px; font-weight: 550; }
.viewer-pill .text-btn { color: var(--ink-2); font-size: 12.5px; padding: 0 10px; }
.viewer-pill .text-btn:hover { background: var(--hover); color: var(--ink); }
@media (max-width: 860px) { .viewer-pill .vp-name, .viewer-pill > .icon { display: none; } .viewer-pill { padding-left: 8px; } }
.signin-screen { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 24px 16px; overflow-y: auto; background: var(--page); color: var(--ink); }
:root.signed-out .shell { visibility: hidden; }
.signin-card { width: min(480px, 100%); box-sizing: border-box; padding: 24px 26px; }
.signin-card h1 { font-size: 22px; margin: 14px 0 8px; }
.signin-card p { line-height: 1.5; }
.signin-brand { display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--ink-2); }
.signin-form { display: flex; gap: 8px; margin: 4px 0 8px; }
.signin-form .input { flex: 1; min-width: 0; font-family: var(--mono); letter-spacing: 0.04em; }
.signin-foot { display: flex; justify-content: flex-end; gap: 6px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--grid); }
.signin-foot .icon { width: 14px; height: 14px; }
.pp-table td { vertical-align: top; }
.pp-table td:first-child { min-width: 170px; }
.pp-table select { max-width: 150px; }
.pp-tok { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 1px 0; }
.pp-tok .icon { width: 13px; height: 13px; color: var(--muted); flex: none; }
.pp-actions { white-space: nowrap; text-align: right; }
.pp-actions .btn + .btn { margin-left: 6px; }
.link-btn.danger { color: var(--critical-ink); }
.people-form { margin-bottom: 6px; }
.pp-scope { border: 1px solid var(--border); border-radius: 6px; padding: 8px 12px 10px; margin: 0 0 12px; min-width: 0; }
.pp-scope legend { font-size: 12.5px; color: var(--ink-2); padding: 0 4px; }
.pp-proj { display: flex; align-items: baseline; gap: 8px; font-size: 13px; padding: 2px 0; min-width: 0; }
.pp-proj > span { overflow-wrap: anywhere; }
.pp-proj small { flex: none; }
.pp-projs { display: grid; gap: 0; padding: 2px 0 0 22px; max-height: 220px; overflow: auto; }
.pp-tools { display: flex; align-items: center; gap: 10px; padding: 6px 0 4px 22px; font-size: 12.5px; }
.pp-tools .pp-search { flex: 1 1 auto; max-width: 340px; min-width: 0; }
.pp-scope-cell { min-width: 140px; }
.pp-scope-cell .link-btn { margin-left: 6px; }
.pp-edit > td { padding-top: 0; }
.pp-edit .pp-scope { margin: 0 0 8px; }
.pp-note { margin-top: 8px; }
.pp-audit { margin-top: 12px; }
.pp-audit summary { cursor: pointer; font-size: 13px; color: var(--ink-2); }
.pp-audit .bullets li { margin: 3px 0; }
.invite-slot:not(:empty) { margin: 12px 0; }
.invite-result { display: grid; gap: 10px; padding: 14px 16px; border-radius: 6px; background: var(--accent-wash); box-shadow: inset 0 0 0 1px var(--accent-wash-2); }
.invite-result p { margin: 0; }
.ir-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ir-row { display: grid; gap: 4px; min-width: 0; }
.ir-label { font-size: 12px; color: var(--muted); }
.ir-value { display: flex; align-items: flex-start; gap: 8px; min-width: 0; }
.ir-value .mcp-code { flex: 1; min-width: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.ir-value .codeline { min-width: 0; overflow-wrap: anywhere; padding: 4px 8px; }
.ir-value .btn { flex: none; }

/* Settings › Devices › Shared projects */
.sp-list { list-style: none; margin: 4px 0 12px; padding: 0; display: grid; gap: 0; }
.sp-row { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; padding: 10px 0; border-top: 1px solid var(--border); min-width: 0; }
.sp-row:first-child { border-top: 0; }
.sp-row > .btn { flex: none; white-space: nowrap; }
.sp-main { display: grid; gap: 3px; min-width: 0; font-size: 13px; }
.sp-name { font-weight: 600; }
.sp-path { font-size: 12px; overflow-wrap: anywhere; }
.sp-line { overflow-wrap: anywhere; }
.sp-form { display: flex; gap: 8px; align-items: flex-start; flex-wrap: wrap; margin: 4px 0 6px; }
.sp-fields { display: grid; gap: 6px; flex: 1 1 280px; min-width: 0; }
.sp-fields select, .sp-fields .input { width: 100%; min-width: 0; box-sizing: border-box; }
.pname .badge, h1 .badge { margin-left: 6px; vertical-align: middle; }
.sp-combo { position: relative; }
.sp-options { position: absolute; z-index: 20; top: calc(100% + 4px); left: 0; right: 0; margin: 0; padding: 4px; list-style: none;
  max-height: 300px; overflow: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 6px;
  box-shadow: 0 8px 24px rgb(0 0 0 / 0.14); }
.sp-option { display: grid; grid-template-columns: auto auto 1fr; align-items: baseline; gap: 2px 6px; padding: 7px 10px; border-radius: 7px;
  cursor: pointer; font-size: 13px; min-width: 0; }
.sp-option .icon { width: 14px; height: 14px; align-self: center; }
.sp-option .sp-opt-path { grid-column: 1 / -1; overflow-wrap: anywhere; }
.sp-option[aria-selected="true"], .sp-option:hover { background: var(--hover); }
.sp-option[aria-disabled="true"] { cursor: default; background: none; display: block; }

/* A hub's dashboard: a teal tint on the chrome, a band across the top and a line in the status bar, so it never passes
   for your own (renderHubFrame) */
:root { --hub: #1baf7a; --hub-ink: #0b7a52; --hub-wash: rgba(27, 175, 122, 0.12); }
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) { --hub: #199e70; --hub-ink: #4fd3a0; --hub-wash: rgba(25, 158, 112, 0.18); }
}
:root[data-theme="dark"] { --hub: #199e70; --hub-ink: #4fd3a0; --hub-wash: rgba(25, 158, 112, 0.18); }
:root.on-hub body { background-image: linear-gradient(color-mix(in srgb, var(--hub) 9%, transparent), color-mix(in srgb, var(--hub) 9%, transparent)); }
.hub-band { position: absolute; left: 0; right: 0; top: 0; z-index: 4; height: 28px; display: flex; align-items: center; gap: 8px;
  padding: 0 14px; font-size: 12px; color: var(--hub-ink); white-space: nowrap; overflow: hidden;
  background: color-mix(in srgb, var(--hub) 13%, var(--page)); border-bottom: 1px solid color-mix(in srgb, var(--hub) 45%, transparent); }
.hub-band[hidden] { display: none; }
.hub-band .icon { width: 14px; height: 14px; flex: none; }
.hub-band .hb-kind { flex: none; font: 600 10.5px var(--mono); letter-spacing: 0.08em; text-transform: uppercase; padding: 1px 7px;
  border-radius: 999px; background: var(--hub-wash); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--hub) 50%, transparent); }
.hub-band .hb-name { flex: 0 0 auto; max-width: 32ch; color: var(--ink); font-weight: 650; overflow: hidden; text-overflow: ellipsis; }
.hub-band .hb-host { flex: none; font: 11.5px var(--mono); color: var(--muted); }
.hub-band .hb-note { flex: 0 1 auto; margin-left: auto; padding-left: 12px; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.hub-framed .toolbar { top: 36px; }
.hub-framed main#app { padding-top: 90px; scroll-padding-top: 92px; }
.hub-framed .loadbar { top: 28px; }
.hub-framed .glass.loadnote { top: 80px; }
.statusbar #status-hub { display: inline-flex; align-items: center; gap: 6px; color: var(--hub-ink); font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.statusbar #status-hub[hidden] { display: none; }
.statusbar #status-hub .dot { background: var(--hub); flex: none; }
@media (max-width: 860px) { .hub-band .hb-host { display: none; } }
@media (max-width: 600px) { /* no status bar on a phone: the band says it alone */
  .hub-band { top: env(safe-area-inset-top); padding: 0 max(12px, env(safe-area-inset-left)); }
  .hub-band .hb-note { display: none; }
  .hub-framed .toolbar { top: calc(36px + env(safe-area-inset-top)); }
  .hub-framed main#app { padding-top: calc(88px + env(safe-area-inset-top)); }
}

/* Team Home */
.kpis.team-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.btn.with-icon { display: inline-flex; align-items: center; gap: 6px; color: var(--ink); text-decoration: none; }
.btn.with-icon .icon { width: 14px; height: 14px; color: var(--ink-2); }
@media (max-width: 640px) { .kpis.team-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.avatar { --av: var(--series-1); display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; flex: none;
  font-size: 11.5px; font-weight: 650; letter-spacing: 0.02em; color: var(--ink);
  background: color-mix(in srgb, var(--av) 22%, var(--surface)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--av) 40%, transparent); }
.who-tag { display: inline-flex; align-items: center; gap: 6px; min-width: 0; max-width: 160px; font-size: 12.5px; }
.who-tag .avatar { width: 20px; height: 20px; font-size: 9px; }
.who-tag > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who-list { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
a.who-tag { color: var(--ink-2); }
a.who-tag:hover { color: var(--ink); text-decoration: none; }
a.who-tag:hover > span:last-child { text-decoration: underline; }
.who-line { margin-top: 4px; }
table.team-projects td { vertical-align: middle; }
.attention-card { border-left: 3px solid var(--warning); }
.attention { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.attention li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 6px 4px; }
.attention li > .icon { width: 30px; height: 18px; color: var(--muted); }
.attention li > span:nth-child(2) { color: var(--ink); }

/* Status › Analysis: full width; what analyzes on the left, the queue on the right */
.analysis-card { grid-column: 1 / -1; }
.analysis-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 0 32px; }
.analysis-side { border-left: 1px solid var(--border); padding-left: 28px; min-width: 0; }
.analysis-grid > div > .subhead:first-child { margin-top: 2px; }
.analysis-side .warn-line { margin: 6px 0; }
.queue-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px 14px; margin: 6px 0 12px; }
@media (max-width: 420px) { .queue-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.analysis-side .tags { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin: 6px 0; }
.analysis-meta { margin: 10px 0 2px; }
.analysis-side .analyzer.klang { margin-top: 6px; }
.analysis-side .analyzer.klang .subhead { margin-top: 16px; }
@media (max-width: 900px) {
  .analysis-grid { grid-template-columns: minmax(0, 1fr); }
  .analysis-side { border-left: 0; padding-left: 0; border-top: 1px solid var(--border); margin-top: 14px; padding-top: 4px; }
}
/* a model provider's settings (providerPane) */
.provider-pane { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
.pv-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pv-head select { min-width: 220px; }
.pv-where { display: flex; align-items: center; gap: 4px; font-size: 12.5px; }
.pv-where .icon { width: 14px; height: 14px; }
.pv-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; }
.pv-form label { display: grid; gap: 4px; font-size: 12.5px; color: var(--ink-2); min-width: 0; }
.pv-form .wide { grid-column: 1 / -1; }
.pv-form .input { width: 100%; min-width: 0; box-sizing: border-box; }
.pv-key { display: flex; gap: 8px; align-items: center; }
.pv-key .input { flex: 1; }
.pv-adv > summary { cursor: pointer; font-size: 12.5px; color: var(--muted); width: max-content; }
.pv-adv[open] > summary { margin-bottom: 8px; }
.pv-result:empty { display: none; }
.ok-line { color: var(--good-ink); }
.pv-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pv-actions .grow { flex: 1; }
.pv-foot { font-size: 12px; }
@media (max-width: 560px) { .pv-form { grid-template-columns: minmax(0, 1fr); } }
.pv-agent { font-weight: 600; color: var(--ink); }
.pv-form select { width: 100%; }

/* Settings › Devices on a computer that sends to a hub: the hub (spokeHubCard), its projects here (spokeProjectsCard) */
.hl-name { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; min-width: 0; }
.hl-name b { font-size: 17px; font-weight: 600; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.hl-card .hero-facts { margin: 12px 0 6px; }
.hl-note { margin: 8px 0 0; font-size: 12.5px; }
.hl-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--grid); }
.hl-actions .grow { flex: 1; }
.hl-actions a.btn { text-decoration: none; color: var(--ink); }
.link-btn.danger { color: var(--critical-ink); }
.link-btn:disabled { opacity: 0.5; cursor: default; text-decoration: none; }
.mp-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mp-src { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; font-size: 12.5px; min-width: 0; }
.mp-src .icon { width: 13px; height: 13px; align-self: center; color: var(--muted); flex: none; }
.mp-src .codeline { overflow-wrap: anywhere; max-width: calc(100% - 20px); }
.mp-over { flex-basis: 100%; padding-left: 19px; }
.mp-row.is-left .sp-name { color: var(--ink-2); }
.mp-foot { margin: 6px 0 0; font-size: 12.5px; }
.mp-join { margin: 0 0 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); }
.mp-join > .muted { font-size: 12.5px; }
.mp-form > p { margin: 0 0 10px; font-size: 12.5px; }
.mp-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; }
.mp-actions { display: flex; gap: 8px; margin-top: 12px; }
.pk-field { display: grid; gap: 4px; min-width: 0; font-size: 12.5px; color: var(--ink-2); }
.pk-field .input { width: 100%; min-width: 0; box-sizing: border-box; }
@media (max-width: 560px) { .mp-fields { grid-template-columns: minmax(0, 1fr); } }

/* Team › Hub settings: a setting, and its own Save */
.hs-row > div:first-child { min-width: 0; flex: 1 1 220px; }
.hs-edit { display: flex; gap: 6px; align-items: center; flex: 0 1 320px; min-width: 0; }
.hs-edit .input { flex: 1; min-width: 0; }
@media (max-width: 640px) { .hs-row { flex-wrap: wrap; } .hs-edit { flex-basis: 100%; } }
.set-row > .seg { flex: none; }
.set-row > .seg button { white-space: nowrap; }
@media (max-width: 640px) { .set-row:has(> .seg) { flex-wrap: wrap; } }
