/* Genos Fleet: a plain, light administrative interface. System fonts, sentence case, one accent
   colour for actions, and the three status colours. No web fonts are loaded. */
:root {
  --bg: #f4f6f8;
  --panel: #ffffff;
  --panel-2: #f8fafc;
  --line: #e2e8f0;
  --line-2: #cbd5e1;
  --fg: #0f172a;
  --text: #1e293b;
  --muted: #475569;
  --dim: #64748b;
  --accent: #1d4ed8;
  --accent-hover: #1e40af;
  --accent-bg: #eff6ff;
  --signal: #b45309;
  --signal-bg: #fef3c7;
  --signal-line: #fcd34d;
  --ok: #15803d;
  --ok-bg: #dcfce7;
  --ok-line: #86efac;
  --bad: #b91c1c;
  --bad-bg: #fee2e2;
  --bad-line: #fca5a5;
  --bad-hover: #991b1b;
  --bad-row: #fff7f7;
  --on-accent: #fff;
  --shadow: rgba(15, 23, 42, .12);
  --radius: 6px;
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  color-scheme: light;
}
/* Dark: set by static/theme.js from the viewer's choice or the system's. Screen only: print stays light. */
@media screen {
  :root[data-theme="dark"] {
    --bg: #0b1120;
    --panel: #111827;
    --panel-2: #172033;
    --line: #243044;
    --line-2: #334155;
    --fg: #f1f5f9;
    --text: #e2e8f0;
    --muted: #a8b4c6;
    --dim: #8b98ab;
    --accent: #60a5fa;
    --accent-hover: #93c5fd;
    --accent-bg: #172554;
    --signal: #fbbf24;
    --signal-bg: #33240a;
    --signal-line: #8a5a12;
    --ok: #4ade80;
    --ok-bg: #0d2a1a;
    --ok-line: #1d6b3a;
    --bad: #f87171;
    --bad-bg: #351314;
    --bad-line: #8f2626;
    --bad-hover: #fca5a5;
    --bad-row: #22121a;
    --on-accent: #0b1120;
    --shadow: rgba(0, 0, 0, .45);
    color-scheme: dark;
  }
  /* The logo is one dark colour: shown light. */
  :root[data-theme="dark"] .brand img, :root[data-theme="dark"] .card.login > img { filter: brightness(0) invert(1); opacity: .92; }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font: 14px/1.5 var(--font-sans); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code, pre, .mono { font-family: var(--font-mono); font-size: 12.5px; }
code { background: var(--panel-2); border: 1px solid var(--line); border-radius: 3px; padding: 0 4px; color: var(--fg); }
pre { margin: 0; overflow: auto; max-height: 70vh; color: var(--text); line-height: 1.5; }
pre code, .code-block code { background: none; border: 0; padding: 0; }
h1, h2, h3 { margin: 0; color: var(--fg); font-weight: 600; }
b, strong { font-weight: 600; color: var(--fg); }
svg.icon { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Small captions. */
.label { font-size: 12px; line-height: 1.4; color: var(--muted); font-weight: 500; }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.small { font-size: 12.5px; }
.wrap { word-break: break-all; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.ok { color: var(--ok); }
.bad { color: var(--bad); }
.signal { color: var(--signal); }

/* --- Shell ------------------------------------------------------------- */
.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.sidebar { border-right: 1px solid var(--line); background: var(--panel); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: .6rem; height: 56px; padding: 0 18px; border-bottom: 1px solid var(--line); color: var(--fg); }
.brand:hover { text-decoration: none; }
.brand img { height: 18px; width: auto; }
.brand span { font-size: 13px; font-weight: 600; color: var(--muted); padding-left: .6rem; border-left: 1px solid var(--line-2); }
.side-nav { padding: 14px 10px; display: flex; flex-direction: column; gap: 1px; flex: 1; }
.side-nav .label { padding: 14px 10px 6px; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--dim); }
.side-nav .label:first-child { padding-top: 2px; }
.nav-item { display: flex; align-items: center; gap: .65rem; padding: 8px 10px; color: var(--text); font-weight: 500; border-radius: var(--radius); }
.nav-item:hover { background: var(--panel-2); text-decoration: none; }
.nav-item[aria-current] { color: var(--accent); background: var(--accent-bg); }
.nav-item .count { margin-left: auto; font-size: 12px; font-weight: 600; color: var(--dim); background: var(--panel-2); border-radius: 10px; padding: 0 7px; line-height: 18px; }
.nav-item .count.hot { color: var(--on-accent); background: var(--bad); }
.nav-item.node { font-size: 13.5px; padding: 6px 10px; font-weight: 400; }
.nav-item.node span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); flex: none; }
.dot.bad { background: var(--bad); }
.sidebar-foot { padding: 14px 18px; border-top: 1px solid var(--line); font-size: 12px; color: var(--dim); }

.main { display: flex; flex-direction: column; min-width: 0; }
.topbar { height: 56px; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0 28px; border-bottom: 1px solid var(--line); background: var(--panel); position: sticky; top: 0; z-index: 5; }
.crumbs { display: flex; align-items: center; gap: .5rem; font-weight: 500; color: var(--muted); }
.crumbs a { color: var(--muted); }
.crumbs .sep { color: var(--line-2); }
.crumbs .here { color: var(--fg); font-weight: 600; }
.topbar-right { display: flex; align-items: center; gap: .75rem; }
.topbar form { margin: 0; }
.content { padding: 28px 28px 48px; width: 100%; max-width: 1400px; margin: 0 auto; flex: 1; }
.footer { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding: 16px 28px; border-top: 1px solid var(--line); background: var(--panel); font-size: 12px; color: var(--dim); }

/* --- Status pills and chips ------------------------------------------ */
.pill { display: inline-flex; align-items: center; gap: .45rem; padding: 5px 11px; border: 1px solid var(--line-2); border-radius: 999px; font-size: 12.5px; font-weight: 500; white-space: nowrap; color: var(--text); background: var(--panel); }
.pill:hover { text-decoration: none; }
.pill.ok { color: var(--ok); border-color: var(--ok-line); background: var(--ok-bg); }
.pill.bad { color: var(--bad); border-color: var(--bad-line); background: var(--bad-bg); }
.pill.ok::before, .pill.bad::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.chip { display: inline-block; padding: 2px 8px; border: 1px solid var(--line-2); border-radius: 4px; font-size: 12px; line-height: 1.5; font-weight: 500; color: var(--text); background: var(--panel-2); white-space: nowrap; }
a.chip:hover { text-decoration: none; border-color: var(--accent); }
.chip.ok { color: var(--ok); border-color: var(--ok-line); background: var(--ok-bg); }
.chip.bad { color: var(--bad); border-color: var(--bad-line); background: var(--bad-bg); }
.chip.signal { color: var(--signal); border-color: var(--signal-line); background: var(--signal-bg); }

/* --- Buttons ---------------------------------------------------------- */
.btn, button { display: inline-flex; align-items: center; gap: .45rem; padding: 7px 14px; border: 1px solid var(--accent); border-radius: var(--radius); background: var(--accent); color: var(--on-accent); font: 500 13.5px/1.4 var(--font-sans); cursor: pointer; white-space: nowrap; }
.btn:hover, button:hover { background: var(--accent-hover); border-color: var(--accent-hover); text-decoration: none; }
.btn.ghost, button.ghost { background: var(--panel); color: var(--text); border-color: var(--line-2); }
.btn.ghost:hover, button.ghost:hover { background: var(--panel-2); border-color: var(--dim); }
.btn.danger, button.danger { background: var(--bad); border-color: var(--bad); color: var(--on-accent); }
button.danger:hover { background: var(--bad-hover); border-color: var(--bad-hover); }
button.link { background: none; border: 0; padding: 0; color: var(--accent); }
button.link:hover { text-decoration: underline; }
button[disabled] { opacity: .55; cursor: not-allowed; }
/* A destructive action in two steps: the first click only opens the confirm box, so a double click
   on a button that used to sit in the same place can't trigger it. */
details.confirm { position: relative; }
details.confirm summary { display: inline-flex; margin: 0; }
details.confirm[open] summary { margin-bottom: 0; }
.confirm-box { position: absolute; right: 0; top: calc(100% + 6px); z-index: 5; width: 320px; padding: 14px; background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--radius); box-shadow: 0 8px 24px var(--shadow); text-align: left; }
.confirm-box p { margin: 0 0 12px; font-size: 13px; color: var(--text); white-space: normal; }

/* --- Page header ------------------------------------------------------ */
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1.5rem; flex-wrap: wrap; margin-bottom: 22px; }
.page-head h1 { font-size: 22px; line-height: 1.25; }
.page-head p { margin: .35rem 0 0; color: var(--muted); font-size: 14px; max-width: 90ch; }
.page-head .eyebrow { margin-bottom: .35rem; }

/* --- Cards ------------------------------------------------------------ */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; min-width: 0; }
a.card:hover { text-decoration: none; border-color: var(--line-2); }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-bottom: 14px; }
.card-head h2 { font-size: 15px; }
.card-head p { margin: .25rem 0 0; color: var(--muted); font-size: 13px; }
.card.flush { padding: 0; }
.card.flush .card-head { padding: 16px 20px 0; }
.card.alert { border-color: var(--bad-line); box-shadow: inset 3px 0 0 var(--bad); }
.stack { display: grid; gap: 16px; }
.grid-4 { display: grid; gap: 16px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-3 { display: grid; gap: 16px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-2-1 { display: grid; gap: 16px; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.grid-2 { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* Stat cards: label, number, footnote, optional visual on the right. */
.stat { display: flex; justify-content: space-between; align-items: center; gap: 1rem; min-height: 104px; }
.stat-body { display: flex; flex-direction: column; gap: .3rem; min-width: 0; }
.stat-value { color: var(--fg); font-size: 26px; font-weight: 600; letter-spacing: -.01em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat-value small { font-size: 15px; color: var(--muted); font-weight: 500; }
.stat-value code { font-size: 18px; }
.stat-foot { font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; }
.stat.alert .stat-value { color: var(--bad); }
.donut { width: 72px; height: 72px; flex: none; }
.donut .track { stroke: var(--line); }
.donut .arc { stroke: var(--ok); }
.donut.bad .arc { stroke: var(--signal); }
.donut text { fill: var(--fg); font: 600 8.5px var(--font-sans); }
.spark { width: 96px; height: 36px; flex: none; }
.spark rect { fill: var(--accent); }
.spark rect.zero { fill: var(--line); }

/* --- Tables ----------------------------------------------------------- */
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; }
th { text-align: left; padding: 9px 14px; border-bottom: 1px solid var(--line); background: var(--panel-2); font-size: 12px; font-weight: 600; color: var(--muted); white-space: nowrap; }
td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; font-size: 13.5px; }
th:first-child, td:first-child { padding-left: 20px; }
th:last-child, td:last-child { padding-right: 20px; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--panel-2); }
tr.row-bad td { background: var(--bad-row); }
tr.row-bad td:first-child { box-shadow: inset 2px 0 0 var(--bad); }
td a.host { font-weight: 600; color: var(--fg); }
td.empty { padding: 28px 20px; text-align: center; color: var(--muted); }
.kv { width: 100%; }
.kv td { padding: 8px 0; border-bottom: 1px solid var(--line); }
.kv td:first-child { padding-left: 0; width: 42%; color: var(--muted); }
.kv td:last-child { padding-right: 0; }
.kv tr:hover td { background: none; }
.kv td.label { font-size: 13px; }

/* Definition lists in detail cards. */
dl { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; margin: 0; }
dt { font-size: 12.5px; line-height: 1.7; color: var(--muted); }
dd { margin: 0; min-width: 0; }

/* --- Charts ----------------------------------------------------------- */
.chart { width: 100%; height: 150px; display: block; }
.bar { fill: var(--accent); }
.bar-empty { fill: var(--line); }
.axis { display: flex; justify-content: space-between; margin-top: .5rem; }

/* --- Filters / segmented controls ------------------------------------ */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 12px 14px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.toolbar label { display: inline-flex; align-items: center; gap: .5rem; color: var(--muted); font-size: 13px; }
.segmented { display: inline-flex; border: 1px solid var(--line-2); border-radius: var(--radius); overflow: hidden; }
.segmented a { padding: 7px 13px; font-size: 13px; font-weight: 500; color: var(--text); border-right: 1px solid var(--line-2); background: var(--panel); }
.segmented a:last-child { border-right: 0; }
.segmented a:hover { background: var(--panel-2); text-decoration: none; }
.segmented a[aria-current] { background: var(--accent); color: var(--on-accent); }
.field { display: inline-flex; align-items: center; gap: .5rem; border: 1px solid var(--line-2); border-radius: var(--radius); padding: 0 10px; color: var(--muted); background: var(--panel); }
.field span { font-size: 12.5px; font-weight: 500; }
.field:focus-within { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-bg); }
select, input { font: 400 13.5px var(--font-sans); color: var(--fg); background: transparent; border: 0; padding: 7px 2px; outline: none; }
.toolbar > label > select, .toolbar > label > input { border: 1px solid var(--line-2); border-radius: var(--radius); padding: 6px 8px; background: var(--panel); }
select { appearance: none; -webkit-appearance: none; cursor: pointer; padding-right: 22px;
  background: no-repeat right 4px center / 14px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); }
input { width: 90px; }
input::placeholder { color: var(--dim); }
.toolbar .spacer { flex: 1; }

/* --- Tabs (node pages) ------------------------------------------------ */
.tabs { display: flex; gap: 24px; border-bottom: 1px solid var(--line); margin-bottom: 20px; }
.tabs a { padding: 8px 0; color: var(--muted); font-weight: 500; font-size: 14px; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a:hover { color: var(--fg); text-decoration: none; }
.tabs a[aria-current] { color: var(--accent); border-bottom-color: var(--accent); }

/* --- Misc ------------------------------------------------------------- */
.alert-list { list-style: none; margin: 0; padding: 0; }
.alert-list li { display: grid; grid-template-columns: 1fr auto; gap: .15rem .75rem; padding: 10px 0; border-bottom: 1px solid var(--line); }
.alert-list li:first-child { padding-top: 0; }
.alert-list li:last-child { border-bottom: 0; padding-bottom: 0; }
.alert-list .what { font-weight: 600; color: var(--fg); }
.alert-list .where { color: var(--muted); font-size: 13px; }
.alert-list .when { grid-row: span 2; align-self: center; }
.pager { display: flex; gap: .5rem; justify-content: flex-end; padding: 12px 20px; border-top: 1px solid var(--line); }
details summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; }
details summary::-webkit-details-marker { display: none; }
details[open] summary { margin-bottom: 14px; }
.code-block { background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.steps { margin: 0; padding: 0; list-style: none; counter-reset: step; display: grid; gap: 14px; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 28px 1fr; gap: 12px; }
.steps li::before { content: counter(step); font-size: 12px; line-height: 1.8; font-weight: 600; color: var(--muted); }
.hooks { display: flex; flex-wrap: wrap; gap: 6px; }
.step-num { display: inline-grid; place-items: center; flex: none; width: 24px; height: 24px; margin-right: 10px; border-radius: 50%; background: var(--accent); color: var(--on-accent); font: 600 12px var(--font-sans); vertical-align: 2px; }
.steps-guide { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; counter-reset: none; }
.steps-guide li { display: flex; align-items: flex-start; gap: 4px; }
.steps-guide li p { margin: 2px 0 0; color: var(--muted); font-size: 13.5px; }
.steps-guide .step-num { margin-top: 1px; }
.install-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: stretch; }
.select-all { user-select: all; margin: 0; white-space: pre-wrap; word-break: break-all; }
.plain-list { margin: 0; padding-left: 1.1rem; display: grid; gap: 6px; }
.card.highlight { border-color: var(--ok-line); }

/* --- Login ------------------------------------------------------------ */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.login { width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 12px; padding: 28px; }
.login img { height: 20px; width: auto; align-self: flex-start; margin-bottom: 6px; }
.login h1 { font-size: 20px; }

/* --- Responsive ------------------------------------------------------- */
@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2-1, .grid-3 { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .side-nav { flex-direction: row; flex-wrap: wrap; padding: 8px 10px; }
  .side-nav .label, .sidebar-foot, .nav-item.node { display: none; }
  .topbar, .content, .footer { padding-left: 16px; padding-right: 16px; }
  .grid-4, .grid-2 { grid-template-columns: 1fr; }
  .page-head h1 { font-size: 20px; }
  .crumbs .here { display: none; }
}
.code-block.copyable { display: flex; align-items: center; gap: 12px; }
.code-block.copyable pre { flex: 1; margin: 0; overflow-x: auto; }
.code-block.copyable .copy { flex: none; }
.intro { max-width: 78ch; line-height: 1.5; margin: 0; }
.disclaimer p { margin: 0 0 10px; line-height: 1.5; max-width: 90ch; }
.disclaimer p:last-child { margin-bottom: 0; }
.component { padding-bottom: 12px; margin-bottom: 12px; border-bottom: 1px solid var(--line); }
.component h3 { margin: 0 0 4px; font-size: 14px; }
.component .kv { margin-top: 8px; }

/* --- Tickets: rows and the ticket explorer ---------------------------- */
.nowrap { white-space: nowrap; }
td code.path { word-break: normal; overflow-wrap: normal; }
.nb { white-space: nowrap; }
td.col-file { min-width: 190px; }
td.col-proc { min-width: 200px; }
.row-actions { display: flex; gap: .4rem; }
.row-actions form { margin: 0; }
td .sub { display: block; margin-top: 2px; }
.head-actions { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.head-actions form { margin: 0; }
.ticket-lede { border-left: 3px solid var(--line-2); }
.ticket-lede.open { border-left-color: var(--bad); }
.ticket-lede .lede { margin: 0 0 .4rem; font-size: 15px; line-height: 1.55; color: var(--fg); }
.ticket-lede .lede code { font-size: 13px; }
.note { margin: 14px 0 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.reading { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.reading li { padding: 9px 12px; border-left: 3px solid var(--line-2); background: var(--panel-2); border-radius: 0 4px 4px 0; font-size: 13.5px; line-height: 1.5; color: var(--text); }
.reading li.bad { border-left-color: var(--bad); }
.reading li.signal { border-left-color: var(--signal); }
.reading li.ok { border-left-color: var(--ok); }
.tree { list-style: none; margin: 0; padding: 0; }
.tree li { position: relative; padding: 6px 0 6px 20px; border-left: 1px solid var(--line-2); margin-left: 6px; }
.tree li::before { content: ""; position: absolute; left: -4px; top: 13px; width: 7px; height: 7px; border-radius: 50%; background: var(--line-2); }
.tree li.blocked::before { background: var(--bad); }
.tree li:last-child { border-left-color: transparent; }
.tree .tree-comm { font-weight: 600; color: var(--fg); margin-right: .5rem; }
.tree li.blocked .tree-comm { color: var(--bad); }
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.timeline li { display: grid; grid-template-columns: 190px 1fr; gap: 14px; align-items: baseline; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.timeline li:last-child { border-bottom: 0; }
.timeline li.ok { color: var(--ok); }
.timeline li.bad { color: var(--bad); }
.timeline li.signal { color: var(--signal); }
@media (max-width: 760px) { .timeline li { grid-template-columns: 1fr; gap: 2px; } }

/* --- Tickets list: one line per ticket, click to expand --------------- */
.chip.family { color: var(--text); border-color: var(--line-2); background: var(--panel); }
/* The list measures itself, not the window: with the sidebar and a zoomed browser the room for a row
   is much less than the viewport, and the buttons (absolute, right) would sit on top of the columns. */
.tk-list { container-type: inline-size; --tk-cols: 132px minmax(190px, 2.2fr) 170px minmax(120px, 1fr) 120px 196px; }
.tk-head, .tk-row { display: grid; grid-template-columns: var(--tk-cols); gap: 14px; align-items: center; padding: 0 20px; }
.tk-head { padding-top: 9px; padding-bottom: 9px; border-bottom: 1px solid var(--line); background: var(--panel-2); font-size: 12px; font-weight: 600; color: var(--muted); }
.tk { position: relative; border-bottom: 1px solid var(--line); }
.tk:last-child { border-bottom: 0; }
.tk.tk-open::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: var(--bad); z-index: 1; }
.tk details summary.tk-row { display: grid; justify-content: initial; padding-top: 11px; padding-bottom: 11px; margin: 0; }
.tk details[open] summary.tk-row { margin: 0; background: var(--panel-2); }
.tk-row:hover { background: var(--panel-2); }
.tk-row > span { min-width: 0; }
.tk-row .sub { display: block; margin-top: 2px; }
.tk-ref { color: var(--fg); font-weight: 500; }
.tk-ref::before { content: "▸"; display: inline-block; width: 1.1em; color: var(--dim); transition: transform .15s; }
.tk details[open] .tk-ref::before { transform: rotate(90deg); }
.tk-file code.path { color: var(--fg); background: none; border: 0; padding: 0; font-size: 13px; overflow-wrap: anywhere; word-break: break-word; }
.tk-actions { position: absolute; top: 9px; right: 20px; display: flex; gap: .4rem; }
.tk-actions form { margin: 0; }
.tk-panel { padding: 4px 20px 18px calc(20px + 1.1em); background: var(--panel-2); border-top: 1px solid var(--line); }
.tk-list .empty { padding: 28px 20px; text-align: center; color: var(--muted); margin: 0; }
.explorer { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 24px; padding-top: 16px; }
@media (max-width: 1280px) { .explorer { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); } }
.ex-part { min-width: 0; }
.ex-part h3 { margin-bottom: 8px; padding-bottom: 6px; border-bottom: 1px solid var(--line-2); font-size: 12.5px; font-weight: 600; color: var(--fg); }
.ex-part dl { margin: 0; display: block; }
.ex-part dt { display: block; margin-top: 10px; font-size: 12px; color: var(--dim); }
.ex-part dd { display: block; margin: 2px 0 0; color: var(--fg); font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
.ex-part dd.mono { font-size: 12px; }
.tk-foot { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); }
.tk-foot p { margin: 0; color: var(--text); }
.tk-foot .bad { color: var(--bad); }
@container (max-width: 1040px) {
  .tk-head { display: none; }
  /* Two lines a ticket: the file with the buttons beside it, then the other four columns. */
  .tk-row, .tk details summary.tk-row { grid-template-columns: 1.1fr 1.2fr 1fr .7fr; row-gap: 8px; padding: 12px 16px; }
  .tk-file { grid-column: 1 / -1; order: -1; padding-right: 190px; }
  .tk-actions { right: 16px; }
  .tk-panel { padding: 4px 16px 14px; }
}
@container (max-width: 560px) {
  .tk-row, .tk details summary.tk-row { grid-template-columns: 1fr 1fr; }
  .tk-file { padding-right: 0; }
  .tk-actions { position: static; padding: 0 16px 12px; }
}

/* Catalog: groups of watched paths under a strictness heading, each one expandable. */
.cat-class { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 20px; background: var(--panel-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); color: var(--muted); }
.cat-group { border-bottom: 1px solid var(--line); }
.cat-group summary { gap: 16px; padding: 11px 20px; margin: 0; }
.cat-group[open] summary { margin: 0; background: var(--panel-2); }
.cat-group summary:hover { background: var(--panel-2); }
.cat-name { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.cat-name strong { color: var(--fg); font-weight: 600; }
.cat-name strong::before { content: "▸"; display: inline-block; width: 1.1em; color: var(--dim); transition: transform .15s; }
.cat-group[open] .cat-name strong::before { transform: rotate(90deg); }
.cat-name .small { padding-left: 1.1em; }
.cat-count { flex: none; color: var(--muted); }
.cat-panel { padding: 4px 20px 16px calc(20px + 1.1em); background: var(--panel-2); }
.cat-paths { list-style: none; margin: 0; padding: 0; columns: 3 280px; column-gap: 24px; }
.cat-paths li { padding: 2px 0; break-inside: avoid; overflow-wrap: anywhere; }
.cat-paths code { font-size: 12px; }
.cat-note { margin: 0; padding: 12px 20px 16px; }
.cat-tech summary h2 { font-size: 15px; }
.cat-tech[open] .label { visibility: hidden; }
@media (max-width: 960px) {
  .cat-class, .cat-group summary, .cat-note { padding-left: 16px; padding-right: 16px; }
  .cat-panel { padding: 4px 16px 14px; }
}

/* A decision with a reason: the note field sits beside the buttons, and inside a confirm box. */
.decide { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin: 0; }
.note-field input { width: 220px; }
.confirm-box .note-field { display: flex; margin: 0 0 12px; }
.confirm-box .note-field input { width: 100%; }

/* --- Install: three live steps ---------------------------------------- */
.wizard { list-style: none; margin: 0; padding: 22px 22px 6px; display: grid; gap: 0; }
.wstep { display: grid; grid-template-columns: 34px minmax(0, 1fr); position: relative; padding-bottom: 22px; }
.wstep:not(:last-child)::before { content: ""; position: absolute; left: 11.5px; top: 28px; bottom: 2px; width: 1px; background: var(--line-2); }
.wstep h2 { font-size: 15px; margin: 2px 0 12px; }
.wstep .step-num { margin: 0; }
.wstep.todo .step-num { background: var(--panel-2); color: var(--muted); box-shadow: inset 0 0 0 1px var(--line-2); }
.wstep.todo h2 { color: var(--muted); }
.wstep.done .step-num { background: var(--ok); font-size: 0; }
.wstep.done .step-num::after { content: "✓"; font-size: 13px; }
.wstep.done:not(:last-child)::before { background: var(--ok-line); }
.wbody > * + * { margin-top: 10px; }
.wbody > p { margin-bottom: 0; }
.wbody .field input { width: 220px; }
.asks { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; }
.asks li { display: grid; grid-template-columns: 190px 70px minmax(0, 1fr); gap: 10px; align-items: baseline; padding: 7px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel-2); }
.asks .ask { font-weight: 500; }
.asks .answer { font-weight: 600; color: var(--accent); }
details.inline summary { display: inline-flex; justify-content: flex-start; color: var(--accent); font-size: 13px; }
details.inline[open] summary { margin-bottom: 8px; }
details.inline > * + * { margin-top: 8px; }
.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.checks li { display: flex; align-items: center; gap: 10px; color: var(--muted); }
.checks li.done, .checks li.waiting { color: var(--fg); }
.checks .mark { flex: none; width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line-2); display: inline-grid; place-items: center; font-size: 11px; line-height: 1; }
.checks li.done .mark { border-color: var(--ok); background: var(--ok); color: var(--on-accent); }
.checks li.done .mark::after { content: "✓"; }
.checks li.waiting .mark { border-color: var(--line-2); border-top-color: var(--accent); animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .checks li.waiting .mark { animation: none; border-color: var(--accent); } }
.hidden { display: none; }
details.card summary h2 { font-size: 15px; }
@media (max-width: 760px) { .asks li { grid-template-columns: 1fr; gap: 2px; } }
#quarantine details.confirm { display: inline-block; }
#quarantine .confirm-box { left: 0; right: auto; }

/* --- A ticket's audit trail --------------------------------------------- */
.trail { list-style: none; margin: 0; padding: 0; }
.trail-lane { margin: 14px 0 6px; }
.trail-lane:first-child { margin-top: 0; }
.trail-lane span { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; color: var(--muted); background: var(--panel-2); border: 1px solid var(--line); }
.trail-lane.host span { color: var(--bad); border-color: var(--bad-line); background: var(--bad-bg); }
.trail-lane.kernel span { color: var(--accent); border-color: var(--accent); background: var(--accent-bg); }
.trail-lane.team span { color: var(--ok); border-color: var(--ok-line); background: var(--ok-bg); }
.trail-step { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 0 4px; position: relative; padding: 7px 0; }
.trail-step::before { content: ""; position: absolute; left: 11.5px; top: 0; bottom: 0; width: 1px; background: var(--line-2); }
.trail-n { position: relative; display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--panel); border: 1px solid var(--line-2); font: 600 11.5px var(--font-sans); color: var(--muted); }
.trail-step.bad .trail-n { background: var(--bad); border-color: var(--bad); color: var(--on-accent); }
.trail-step.ok .trail-n { background: var(--ok); border-color: var(--ok); color: var(--on-accent); }
.trail-step.signal .trail-n { border-color: var(--accent); color: var(--accent); }
.trail-title { font-weight: 600; color: var(--fg); }
.trail-step.bad .trail-title { color: var(--bad); }
.trail-mono { color: var(--muted); margin-top: 2px; }
.trail-body p { margin: 2px 0 0; max-width: 80ch; }
.trail-at { padding-top: 3px; white-space: nowrap; }

@media print {
  .sidebar, .topbar, .footer, .no-print, .tabs { display: none !important; }
  .shell { display: block; }
  .content { padding: 0; }
  body { background: #fff; }
  .card { break-inside: avoid; border-color: #ccc; }
  a { color: inherit; text-decoration: none; }
}

/* Theme toggle (static/theme.js): the moon offers dark, the sun offers light. */
#theme-toggle { padding: 7px 9px; }
#theme-toggle .icon { margin: 0; }
#theme-toggle .icon-sun, :root[data-theme="dark"] #theme-toggle .icon-moon { display: none; }
:root[data-theme="dark"] #theme-toggle .icon-sun { display: inline-block; }

/* A checkbox beside a decision's buttons (the ticket page's "Also let it run as a program"). */
label.check { display: inline-flex; align-items: center; gap: .4rem; font-size: 13px; color: var(--muted); cursor: pointer; }
label.check input { margin: 0; accent-color: var(--accent); }
