/* Ops kanban board. No external fonts/icons; dark default, light via
   prefers-color-scheme. Scoped to body.wide (board + drawer pages). */
body.wide {
  --k-bg: #0d1217;
  --k-col: #131a21;
  --k-card: #1a232d;
  --k-card-h: #1f2a36;
  --k-line: #27333f;
  --k-line-2: #33414f;
  --k-text: #e6edf3;
  --k-muted: #93a4b3;
  --k-faint: #6b7d8c;
  --k-accent: #3ecf8e;
  --k-accent-ink: #062016;
  --k-need: #f5a524;
  --k-need-bg: rgba(245, 165, 36, 0.12);
  --k-need-line: rgba(245, 165, 36, 0.45);
  --k-crit: #ff5d6c;
  --k-high: #ff8a4c;
  --k-warn: #e8c547;
  --k-low: #6cb6ff;
  --k-none: #8b98a5;
  --k-deny: rgba(255, 93, 108, 0.14);
  --k-ok-bg: rgba(62, 207, 142, 0.12);
  --k-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  --k-shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.5);
  --k-r: 8px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, sans-serif;
  background: var(--k-bg);
  color: var(--k-text);
  font-size: 14px;
}
@media (prefers-color-scheme: light) {
  body.wide {
    --k-bg: #f4f6f8;
    --k-col: #e9edf1;
    --k-card: #ffffff;
    --k-card-h: #fbfcfd;
    --k-line: #d5dde4;
    --k-line-2: #c3ced8;
    --k-text: #16202a;
    --k-muted: #52636f;
    --k-faint: #72828f;
    --k-accent: #13895a;
    --k-accent-ink: #ffffff;
    --k-need: #a8600a;
    --k-need-bg: #fff4e0;
    --k-need-line: #f0c27a;
    --k-crit: #c8102e;
    --k-high: #c2410c;
    --k-warn: #946800;
    --k-low: #1c64c8;
    --k-none: #5f6b76;
    --k-deny: #fde3e6;
    --k-ok-bg: #e2f6ec;
    --k-shadow: 0 1px 2px rgba(16, 24, 32, 0.08);
    --k-shadow-lg: 0 12px 40px rgba(16, 24, 32, 0.18);
  }
  body.wide .site-header { background: rgba(255, 255, 255, 0.9); border-color: var(--k-line); }
  body.wide .logo { color: var(--k-text); }
  body.wide nav a { color: var(--k-muted); }
  body.wide .site-footer { border-color: var(--k-line); color: var(--k-muted); }
  body.wide .alert.warn { background: #fff4e0; border-color: #f0c27a; color: #7a4600; }
  body.wide .alert.ok { background: #e2f6ec; border-color: #9fd8bb; color: #0d6b44; }
  body.wide .example-tag { background: #e3e8ed; color: var(--k-muted); }
}
body.wide main { width: 100%; max-width: none; padding: 0.75rem 1rem 1.5rem; }
body.wide .site-header { padding: 0.6rem 1rem; }
body.wide .site-footer { padding: 0.6rem; font-size: 0.75rem; }
body.wide a { color: var(--k-accent); }
body.wide .alert { margin: 0.5rem 0; padding: 0.55rem 0.8rem; border-radius: var(--k-r); font-size: 0.85rem; }
.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; }
.js .nojs-only { display: none !important; }
.muted { color: var(--k-muted); }
.small { font-size: 0.78rem; }
.nowrap { white-space: nowrap; }
code, .mono { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: 0.8em; }
.mono { white-space: pre-wrap; word-break: break-word; font-size: 0.78rem; }

/* ---------- head */
.board-head { display: flex; align-items: baseline; gap: 1rem; flex-wrap: wrap; margin: 0 0 0.5rem; }
.board-head h1 { font-size: 1.15rem; margin: 0; letter-spacing: -0.01em; }
.board-status { margin: 0; font-size: 0.78rem; }
.board-status .ro { color: var(--k-need); }

/* ---------- filters */
.filters {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem;
  padding: 0.45rem; margin: 0 0 0.6rem;
  background: var(--k-col); border: 1px solid var(--k-line); border-radius: 10px;
}
.filters input, .filters select {
  width: auto; margin: 0; font-size: 0.82rem; padding: 0.32rem 0.5rem; height: 30px;
  background: var(--k-card); color: var(--k-text); border: 1px solid var(--k-line); border-radius: 6px;
}
.filters select { max-width: 13rem; padding-right: 1.4rem; }
.filters input:focus, .filters select:focus, .filters summary:focus-visible { outline: 2px solid var(--k-accent); outline-offset: 1px; }
.f-search { position: relative; display: flex; align-items: center; margin: 0; flex: 1 1 16rem; max-width: 24rem; color: var(--k-faint); }
.f-search svg { position: absolute; left: 0.5rem; pointer-events: none; }
.f-search input { width: 100%; padding-left: 1.7rem; }
.f-field { margin: 0; }
.f-toggle {
  display: inline-flex; align-items: center; gap: 0.4rem; margin: 0; cursor: pointer; user-select: none;
  padding: 0 0.55rem; height: 30px; border-radius: 6px; border: 1px solid var(--k-line); background: var(--k-card);
  color: var(--k-text); font-size: 0.82rem; font-weight: 600;
}
.f-toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.tgl { width: 26px; height: 15px; border-radius: 99px; background: var(--k-line-2); position: relative; transition: background 0.15s; flex: none; }
.tgl::after { content: ""; position: absolute; top: 2px; left: 2px; width: 11px; height: 11px; border-radius: 50%; background: #fff; transition: transform 0.15s; }
.f-toggle input:checked + .tgl { background: var(--k-need); }
.f-toggle input:checked + .tgl::after { transform: translateX(11px); }
.f-toggle input:focus-visible + .tgl { outline: 2px solid var(--k-accent); outline-offset: 2px; }
.f-toggle:has(input:checked) { border-color: var(--k-need-line); background: var(--k-need-bg); }
.pill { font-size: 0.72rem; font-weight: 700; padding: 0 0.4rem; border-radius: 99px; background: var(--k-need-bg); color: var(--k-need); border: 1px solid var(--k-need-line); line-height: 1.35; }
.f-cols { position: relative; }
.f-cols summary {
  list-style: none; cursor: pointer; height: 30px; display: inline-flex; align-items: center; gap: 0.3rem;
  padding: 0 0.55rem; border: 1px solid var(--k-line); border-radius: 6px; background: var(--k-card); font-size: 0.82rem;
}
.f-cols summary::-webkit-details-marker { display: none; }
.f-cols summary::after { content: "▾"; color: var(--k-faint); font-size: 0.7rem; }
.f-cols-menu {
  position: absolute; z-index: 30; top: calc(100% + 4px); left: 0; min-width: 12rem; padding: 0.35rem;
  background: var(--k-card); border: 1px solid var(--k-line-2); border-radius: 8px; box-shadow: var(--k-shadow-lg);
}
.colchk { display: flex; align-items: center; gap: 0.45rem; margin: 0; padding: 0.3rem 0.4rem; border-radius: 5px; color: var(--k-text); font-size: 0.84rem; cursor: pointer; }
.colchk:hover { background: var(--k-card-h); }
.colchk input { width: auto; margin: 0; accent-color: var(--k-accent); }
.f-reset { font-size: 0.8rem; margin-left: 0.2rem; }

/* ---------- board */
.board {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(192px, 1fr);
  gap: 8px; align-items: start; overflow-x: auto; padding-bottom: 0.5rem;
  min-height: calc(100vh - 190px);
}
.kcol {
  background: var(--k-col); border: 1px solid var(--k-line); border-radius: 10px;
  display: flex; flex-direction: column; min-height: 100%; max-height: calc(100vh - 175px); min-width: 0;
}
.kcol[hidden] { display: none; }
.kcol-h {
  display: flex; align-items: center; flex-wrap: wrap; gap: 0.25rem 0.4rem; padding: 0.5rem 0.6rem 0.45rem;
  border-bottom: 1px solid var(--k-line); position: sticky; top: 0;
}
.kcol-h h2 { font-size: 0.78rem; margin: 0; text-transform: uppercase; letter-spacing: 0.05em; color: var(--k-muted); font-weight: 700; display: flex; align-items: center; gap: 0.3rem; }
.col-lock { color: var(--k-faint); display: inline-flex; }
.kcol-h .count { font-size: 0.75rem; font-weight: 700; color: var(--k-text); background: var(--k-card); border: 1px solid var(--k-line); padding: 0 0.4rem; border-radius: 99px; font-variant-numeric: tabular-nums; }
.col-sub { flex-basis: 100%; font-size: 0.72rem; color: var(--k-faint); min-height: 1em; }
.col-sub.need { color: var(--k-need); font-weight: 600; }
.kcol-body { padding: 6px; display: flex; flex-direction: column; gap: 6px; overflow-y: auto; flex: 1; min-height: 80px; border-radius: 0 0 10px 10px; }
.kcol-empty { display: none; margin: 0.6rem 0; text-align: center; color: var(--k-faint); font-size: 0.78rem; }
.kcol-body:not(:has(.kcard:not([hidden]))) .kcol-empty { display: block; }

/* stripe colors per column */
.kcol { border-top: 3px solid var(--k-line-2); }
.col-needs_human { border-top-color: var(--k-need); }
.col-pr_opened { border-top-color: var(--k-accent); }
.col-fixing, .col-testing { border-top-color: var(--k-low); }
.col-done { border-top-color: var(--k-faint); }

/* ---------- card */
.kcard {
  position: relative; background: var(--k-card); border: 1px solid var(--k-line); border-radius: var(--k-r);
  padding: 0.45rem 0.55rem 0.5rem 0.65rem; box-shadow: var(--k-shadow); cursor: pointer;
  transition: border-color 0.12s, background 0.12s, transform 0.12s, opacity 0.12s;
}
.kcard::before { content: ""; position: absolute; left: 0; top: 6px; bottom: 6px; width: 3px; border-radius: 0 3px 3px 0; background: var(--k-none); }
.kcard.sev-crit::before { background: var(--k-crit); }
.kcard.sev-high::before { background: var(--k-high); }
.kcard.sev-warn::before { background: var(--k-warn); }
.kcard.sev-low::before { background: var(--k-low); }
.kcard:hover { border-color: var(--k-line-2); background: var(--k-card-h); }
.kcard[hidden] { display: none; }
.kcard.needs { border-color: var(--k-need-line); }
.kcard.is-drag { opacity: 0.45; transform: scale(0.98); }
.kcard.pending { opacity: 0.7; }
.kcard.pending::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: repeating-linear-gradient(-45deg, transparent 0 6px, rgba(127,127,127,0.08) 6px 12px); pointer-events: none; }
.kcard.flash { animation: kflash 0.9s ease-out; }
.kcard.shake { animation: kshake 0.35s; }
.kcard.selected { outline: 2px solid var(--k-accent); outline-offset: 1px; }
@keyframes kflash { from { box-shadow: 0 0 0 3px var(--k-accent); } to { box-shadow: var(--k-shadow); } }
@keyframes kshake { 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }
.kc-top { display: flex; align-items: center; gap: 0.3rem; flex-wrap: wrap; min-width: 0; }
.kc-id { font-weight: 700; font-size: 0.82rem; color: var(--k-text) !important; font-variant-numeric: tabular-nums; }
.kc-id:hover { text-decoration: underline; }
.kc-age { margin-left: auto; font-size: 0.72rem; color: var(--k-faint); font-variant-numeric: tabular-nums; }
.kc-sum { margin: 0.25rem 0 0.3rem; font-size: 0.83rem; line-height: 1.35; color: var(--k-text); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.kc-meta { display: flex; flex-wrap: wrap; gap: 0.15rem 0.5rem; font-size: 0.72rem; color: var(--k-muted); }
.kc-unit { flex-basis: 100%; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 0.7rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.kc-meta > span:not(.kc-unit) + span::before { content: "·"; margin-right: 0.5rem; color: var(--k-faint); }
.kc-need {
  display: flex; align-items: flex-start; gap: 0.3rem; margin-top: 0.4rem; padding: 0.25rem 0.4rem;
  border-radius: 5px; background: var(--k-need-bg); color: var(--k-need); font-size: 0.74rem; font-weight: 600; line-height: 1.3;
}
.kc-need svg { flex: none; margin-top: 1px; }
.kc-actions { display: flex; flex-wrap: wrap; gap: 0.25rem; margin-top: 0.4rem; align-items: center; }
.kc-actions form { margin: 0; display: contents; }
.kc-more { display: inline-block; position: relative; }
.kc-more[open] { flex-basis: 100%; }
.kc-more > summary { display: inline-block; list-style: none; cursor: pointer; font-size: 0.75rem; padding: 0.1rem 0.45rem; border: 1px solid var(--k-line-2); border-radius: 0.3rem; color: var(--k-text); background: var(--k-card); user-select: none; }
.kc-more > summary:hover { border-color: var(--k-accent); }
.kc-more > summary::-webkit-details-marker { display: none; }
.kc-more > summary::after { content: " ▾"; }
.kc-more[open] > summary::after { content: " ▴"; }
.kc-more-body { display: flex; gap: 0.25rem; align-items: center; margin-top: 0.25rem; }
.kc-more-body .adopt-num { width: 5.5rem; }
.move-form { display: flex !important; gap: 0.25rem; }
.move-select {
  width: auto !important; height: 24px; margin: 0 !important; padding: 0 1.2rem 0 0.35rem !important; font-size: 0.72rem !important;
  background: transparent !important; color: var(--k-muted) !important; border: 1px dashed var(--k-line-2) !important; border-radius: 5px !important; cursor: pointer;
}
.move-select:hover, .move-select:focus { color: var(--k-text) !important; border-style: solid !important; }

/* ---------- chips & buttons */
.chip {
  display: inline-flex; align-items: center; font-size: 0.66rem; font-weight: 700; letter-spacing: 0.02em; text-transform: uppercase;
  padding: 0.05rem 0.35rem; border-radius: 4px; border: 1px solid var(--k-line); color: var(--k-muted); line-height: 1.45; white-space: nowrap;
}
.chip.sev.sev-crit { color: var(--k-crit); border-color: currentColor; }
.chip.sev.sev-high { color: var(--k-high); border-color: currentColor; }
.chip.sev.sev-warn { color: var(--k-warn); border-color: currentColor; }
.chip.sev.sev-low { color: var(--k-low); border-color: currentColor; }
.chip.cls { text-transform: none; font-weight: 600; }
.chip.tag-resolved, .chip.tag-closed { text-transform: none; letter-spacing: 0; font-weight: 600; border-radius: 99px; padding: 0 0.4rem; }
.chip.tag-resolved { color: var(--k-accent); background: var(--k-ok-bg); border-color: transparent; }
.chip.tag-closed { color: var(--k-muted); background: var(--k-col); }
.chip.lab-passed { color: var(--k-accent); border-color: currentColor; }
.chip.lab-failed { color: var(--k-crit); border-color: currentColor; }
.chip.lab-skipped, .chip.lab-deferred_until_push { color: var(--k-need); border-color: currentColor; }
.chip.st { color: var(--k-text); background: var(--k-col); }
.chip.st-needs_human { color: var(--k-need); border-color: var(--k-need-line); }
.kbtn {
  display: inline-flex; align-items: center; gap: 0.25rem; height: 24px; padding: 0 0.5rem; margin: 0;
  font: inherit; font-size: 0.72rem; font-weight: 600; white-space: nowrap; cursor: pointer; text-decoration: none !important;
  color: var(--k-text) !important; background: var(--k-col); border: 1px solid var(--k-line-2); border-radius: 5px;
}
.kbtn:hover { border-color: var(--k-accent); }
.kbtn:focus-visible { outline: 2px solid var(--k-accent); outline-offset: 1px; }
.kbtn.primary { background: var(--k-accent); border-color: var(--k-accent); color: var(--k-accent-ink) !important; }
.kbtn.primary:hover { filter: brightness(1.08); }
.kbtn[disabled] { opacity: 0.5; cursor: progress; }
.kbtn-lg { height: 30px; font-size: 0.8rem; padding: 0 0.7rem; }

/* ---------- drag & drop */
.done-zones { display: none; gap: 6px; padding: 6px 6px 0; }
.is-dragging .done-zones { display: flex; }
.dropzone.sub {
  flex: 1; text-align: center; padding: 0.7rem 0.3rem; font-size: 0.75rem; font-weight: 700; color: var(--k-muted);
  border: 1.5px dashed var(--k-line-2); border-radius: 7px;
}
.is-dragging .kcol.can-drop .kcol-body, .is-dragging .dropzone.sub.can-drop { outline: 1.5px dashed var(--k-accent); outline-offset: -3px; }
.is-dragging .kcol.no-drop { opacity: 0.55; }
.is-dragging .kcol.no-drop .kcol-body { background: var(--k-deny); }
.is-dragging .dropzone.sub.no-drop { opacity: 0.5; }
.kcol-body.over, .dropzone.sub.over { background: var(--k-ok-bg) !important; outline: 2px solid var(--k-accent) !important; }
.is-dragging .kcol.home { opacity: 1; }
.is-dragging .kcol.home .kcol-body { background: transparent; }

/* ---------- drawer */
.drawer-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.35); z-index: 40; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(620px, 100vw); z-index: 50; overflow-y: auto;
  background: var(--k-card); border-left: 1px solid var(--k-line-2); box-shadow: var(--k-shadow-lg);
}
.drawer:focus { outline: none; }
.drawer.static { position: static; width: auto; max-width: 820px; box-shadow: none; border: 1px solid var(--k-line); border-radius: 10px; }
.dr-h { display: flex; gap: 0.75rem; align-items: flex-start; justify-content: space-between; padding: 0.9rem 1.1rem 0.7rem; border-bottom: 1px solid var(--k-line); position: sticky; top: 0; background: var(--k-card); z-index: 1; }
.dr-kicker { display: flex; gap: 0.3rem; margin: 0 0 0.35rem; flex-wrap: wrap; }
.dr-h h2 { margin: 0; font-size: 1.02rem; line-height: 1.35; overflow-wrap: anywhere; }
.dr-h h2 span { font-weight: 500; color: var(--k-text); }
.dr-close { flex: none; display: inline-flex; padding: 0.35rem; border-radius: 6px; color: var(--k-muted) !important; border: 1px solid var(--k-line); }
.dr-close:hover { color: var(--k-text) !important; border-color: var(--k-line-2); }
.dr-body { padding: 0.8rem 1.1rem 1.2rem; }
.dr-body section { margin: 0 0 1rem; }
.dr-body h3 { font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--k-muted); margin: 0 0 0.4rem; display: flex; gap: 0.4rem; align-items: center; }
.dr-body h3 .muted { text-transform: none; letter-spacing: 0; font-weight: 500; color: var(--k-faint); }
.dr-body p { margin: 0 0 0.4rem; overflow-wrap: anywhere; }
.dr-need { background: var(--k-need-bg); border: 1px solid var(--k-need-line); border-radius: 8px; padding: 0.6rem 0.75rem; }
.dr-need h3 { color: var(--k-need); }
.dr-need ul { margin: 0; padding-left: 1.1rem; }
.dr-need li { margin: 0.15rem 0; }
.dr-need li p { font-size: 0.8rem; margin: 0.15rem 0 0; }
.dr-need.none { background: transparent; border-style: dashed; border-color: var(--k-line); }
.dr-need.none p { margin: 0; }
.dr-actions { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: -0.3rem 0 1rem; align-items: center; }
.dr-actions form { margin: 0; }
.dr-actions .move-select { height: 30px; font-size: 0.8rem !important; }
.dr-kv { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem 1rem; margin: 0 0 1rem; padding: 0.65rem 0.75rem; border: 1px solid var(--k-line); border-radius: 8px; background: var(--k-col); }
.dr-kv div { min-width: 0; }
.dr-kv dt { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--k-faint); }
.dr-kv dd { margin: 0; font-size: 0.84rem; overflow-wrap: anywhere; }
.dr-table { width: 100%; border-collapse: collapse; font-size: 0.8rem; }
.dr-table th, .dr-table td { text-align: left; padding: 0.3rem 0.4rem; border-bottom: 1px solid var(--k-line); vertical-align: top; }
.dr-table th { font-size: 0.68rem; text-transform: uppercase; color: var(--k-faint); letter-spacing: 0.04em; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 0.9rem; border-left: 2px solid var(--k-line); }
.timeline li { position: relative; padding: 0 0 0.6rem 0.2rem; }
.timeline li::before { content: ""; position: absolute; left: -1.28rem; top: 0.35rem; width: 8px; height: 8px; border-radius: 50%; background: var(--k-line-2); border: 2px solid var(--k-card); }
.timeline li:first-child::before { background: var(--k-accent); }
.tl-h { display: flex; gap: 0.5rem; align-items: baseline; justify-content: space-between; }
.tl-h time { font-size: 0.72rem; color: var(--k-faint); font-variant-numeric: tabular-nums; white-space: nowrap; }
.timeline p { font-size: 0.82rem; margin: 0.1rem 0 0; }
code.kind { font-size: 0.72rem; padding: 0.02rem 0.3rem; border-radius: 4px; background: var(--k-col); border: 1px solid var(--k-line); color: var(--k-muted); }
code.k-admin_update { color: var(--k-low); }
code.k-fix_result, code.k-triage_result { color: var(--k-accent); }
.dr-logs summary { cursor: pointer; font-size: 0.8rem; color: var(--k-muted); }
.dr-logs pre { white-space: pre-wrap; word-break: break-word; font-size: 0.74rem; background: var(--k-col); border: 1px solid var(--k-line); border-radius: 6px; padding: 0.5rem; max-height: 16rem; overflow: auto; }
.dr-foot { font-size: 0.75rem; border-top: 1px solid var(--k-line); padding-top: 0.6rem; }

/* ---------- toasts */
.toasts { position: fixed; bottom: 1rem; left: 50%; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: 0.35rem; align-items: center; pointer-events: none; }
.toast { pointer-events: auto; font-size: 0.83rem; padding: 0.5rem 0.8rem; border-radius: 8px; background: var(--k-text); color: var(--k-bg); box-shadow: var(--k-shadow-lg); max-width: min(560px, 92vw); }
.toast.warn { background: var(--k-need); color: #1a1000; }
.toast.err { background: var(--k-crit); color: #fff; }
.toast.ok { background: var(--k-accent); color: var(--k-accent-ink); }

@media (max-width: 720px) {
  .board { grid-auto-columns: 82vw; scroll-snap-type: x mandatory; }
  .kcol { scroll-snap-align: start; }
  .dr-kv { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .kcard, .tgl, .tgl::after { transition: none; }
  .kcard.flash, .kcard.shake { animation: none; }
}

/* ---------- live indicator */
.live { margin-left: auto; display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.72rem; font-weight: 600; color: var(--k-muted); padding: 0.1rem 0.5rem; border: 1px solid var(--k-line); border-radius: 99px; background: var(--k-col); align-self: center; }
.live .dot, .wp-pill .dot, .kc-run .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--k-faint); display: inline-block; flex: none; }
.live[data-state="live"] { color: var(--k-accent); }
.live[data-state="live"] .dot { background: var(--k-accent); box-shadow: 0 0 0 0 rgba(62, 207, 142, 0.6); animation: k-pulse 2.4s infinite; }
.live[data-state="polling"] { color: var(--k-low); }
.live[data-state="polling"] .dot { background: var(--k-low); }
.live[data-state="reconnecting"], .live[data-state="connecting"] { color: var(--k-need); }
.live[data-state="reconnecting"] .dot, .live[data-state="connecting"] .dot { background: var(--k-need); animation: k-blink 1s infinite; }
@keyframes k-pulse { 0% { box-shadow: 0 0 0 0 rgba(62, 207, 142, 0.55); } 70% { box-shadow: 0 0 0 6px rgba(62, 207, 142, 0); } 100% { box-shadow: 0 0 0 0 rgba(62, 207, 142, 0); } }
@keyframes k-blink { 50% { opacity: 0.3; } }
@media (prefers-reduced-motion: reduce) { .live .dot, .kc-run .dot, .wp-pill .dot { animation: none !important; } }

/* ---------- worker panel */
.wpanel { background: var(--k-col); border: 1px solid var(--k-line); border-radius: 10px; padding: 0.5rem 0.7rem; margin: 0 0 0.6rem; display: grid; gap: 0.35rem; }
.wp-head { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; min-height: 26px; }
.wp-pill { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.02em; text-transform: uppercase; padding: 0.12rem 0.55rem; border-radius: 99px; border: 1px solid var(--k-line-2); color: var(--k-muted); background: var(--k-card); }
.st-running .wp-pill { color: var(--k-accent); border-color: rgba(62, 207, 142, 0.5); background: var(--k-ok-bg); }
.st-running .wp-pill .dot { background: var(--k-accent); animation: k-pulse 2.4s infinite; }
.st-idle .wp-pill .dot { background: var(--k-muted); }
.st-paused .wp-pill { color: var(--k-need); border-color: var(--k-need-line); background: var(--k-need-bg); }
.st-paused .wp-pill .dot { background: var(--k-need); border-radius: 1px; }
.st-stale .wp-pill { color: #fff; background: var(--k-crit); border-color: var(--k-crit); }
.st-stale .wp-pill .dot { background: #fff; animation: k-blink 1s infinite; }
.st-stale { border-color: rgba(255, 93, 108, 0.55); }
.st-unknown .wp-pill, .st-off .wp-pill { color: var(--k-faint); }
.wp-job { font-size: 0.82rem; display: inline-flex; align-items: center; gap: 0.3rem; flex-wrap: wrap; }
.wp-job .mono { font-size: 0.78rem; white-space: nowrap; }
.wp-job a { font-weight: 700; }
.wp-stage { color: var(--k-text); }
.wp-actions { margin-left: auto; display: inline-flex; gap: 0.35rem; align-items: center; flex-wrap: wrap; }
.wp-actions form, .qact form, .qmoves form { margin: 0; display: inline-flex; }
.wp-facts { display: flex; flex-wrap: wrap; gap: 0.2rem 1.4rem; margin: 0; font-size: 0.78rem; }
.wp-facts > div { display: flex; gap: 0.4rem; align-items: baseline; min-width: 0; }
.wp-facts dt { color: var(--k-faint); font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; white-space: nowrap; }
.wp-facts dd { margin: 0; display: inline-flex; align-items: center; gap: 0.3rem; flex-wrap: wrap; }
.wp-full .wp-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 0.45rem 1.2rem; font-size: 0.8rem; }
.wp-full .wp-facts > div { flex-direction: column; gap: 0.1rem; }
.wp-full { padding: 0.8rem 0.9rem; gap: 0.6rem; }
.okv, .badv, .warnv { display: inline-flex; align-items: center; gap: 0.2rem; font-weight: 600; }
.okv { color: var(--k-accent); }
.badv { color: var(--k-crit); }
.warnv { color: var(--k-need); }
.chip.st.ok { color: var(--k-accent); border-color: rgba(62, 207, 142, 0.45); background: var(--k-ok-bg); }
.chip.st.bad { color: var(--k-need); border-color: var(--k-need-line); background: var(--k-need-bg); }
.chip.st.muted { color: var(--k-muted); }
.wp-issues { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.2rem; font-size: 0.77rem; }
.wp-issues .iss { display: flex; gap: 0.4rem; align-items: baseline; padding: 0.2rem 0.45rem; border-radius: 6px; background: var(--k-need-bg); border: 1px solid var(--k-need-line); }
.wp-issues .iss svg { color: var(--k-need); flex: none; align-self: center; }
.wp-issues .iss b { white-space: nowrap; }
.wp-issues .iss-msg { flex: 1; min-width: 0; overflow-wrap: anywhere; color: var(--k-text); }
.wp-issues .iss .muted { white-space: nowrap; }
.wp-issues .iss-job_cancelled, .wp-issues .iss-requeued_after_crash, .wp-issues .iss-stale_lock { background: var(--k-card); border-color: var(--k-line); }
.wp-issues .iss-job_cancelled svg, .wp-issues .iss-stale_lock svg { color: var(--k-muted); }
.kbtn.danger { color: var(--k-crit) !important; border-color: rgba(255, 93, 108, 0.5); }
.kbtn.danger:hover { background: var(--k-deny); border-color: var(--k-crit); }
.kbtn svg { flex: none; }

/* running strip on the card the worker is on */
.kc-run { display: flex; align-items: center; gap: 0.35rem; margin-top: 0.35rem; padding: 0.15rem 0.4rem; border-radius: 5px; font-size: 0.72rem; font-weight: 600; color: var(--k-accent); background: var(--k-ok-bg); border: 1px solid rgba(62, 207, 142, 0.35); }
.kc-run .dot { background: var(--k-accent); animation: k-pulse 2.4s infinite; }
.kc-run .mono { margin-left: auto; white-space: nowrap; font-size: 0.7rem; }

/* ---------- queue page */
.queue-page .board-head { align-items: center; }
.qgrid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 0.7rem; align-items: start; }
.qcol { display: grid; gap: 0.7rem; min-width: 0; }
@media (max-width: 1100px) { .qgrid { grid-template-columns: 1fr; } }
.qsec { background: var(--k-col); border: 1px solid var(--k-line); border-radius: 10px; padding: 0.55rem 0.7rem 0.6rem; min-width: 0; }
.qsec header { display: flex; align-items: baseline; gap: 0.7rem; flex-wrap: wrap; margin-bottom: 0.35rem; }
.qsec h2 { font-size: 0.86rem; margin: 0; display: inline-flex; gap: 0.4rem; align-items: center; }
.qsec h2 .count { font-size: 0.7rem; color: var(--k-muted); background: var(--k-card); border: 1px solid var(--k-line); border-radius: 99px; padding: 0 0.4rem; font-weight: 700; }
.qsec header p { margin: 0; }
.qtable-wrap { overflow-x: auto; }
.qtable { width: 100%; border-collapse: collapse; font-size: 0.8rem; }
.qtable th { text-align: left; font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--k-faint); font-weight: 700; padding: 0.25rem 0.4rem; border-bottom: 1px solid var(--k-line); white-space: nowrap; }
.qtable td { padding: 0.3rem 0.4rem; border-bottom: 1px solid var(--k-line); vertical-align: middle; }
.qtable tr:last-child td { border-bottom: 0; }
.qtable tr.next td { background: var(--k-ok-bg); }
.qtable tr.next td:first-child { box-shadow: inset 3px 0 0 var(--k-accent); }
.qtable td a { font-weight: 700; }
.qtable td.mono { white-space: nowrap; }
.qact { white-space: nowrap; text-align: right; }
.qact > * + * { margin-left: 0.25rem; }
.qmoves { display: inline-flex; gap: 2px; margin-right: 0.3rem; }
.qmoves .kbtn { padding: 0 0.35rem; }
.qreason { overflow-wrap: anywhere; max-width: 32rem; }
.qreason .rc-detail { color: var(--k-muted); }
.wp-issues .iss-more { margin-left: 0.4rem; font-weight: 600; white-space: nowrap; }
.qempty { margin: 0.3rem 0.1rem; font-size: 0.8rem; }
.chip.kind { text-transform: lowercase; letter-spacing: 0; font-size: 0.7rem; }
.chip.kind.k-fix { color: var(--k-high); border-color: currentColor; }
.chip.kind.k-triage { color: var(--k-low); border-color: currentColor; }
.chip.kind.k-push { color: var(--k-accent); border-color: currentColor; }
.chip.rc { text-transform: none; letter-spacing: 0; color: var(--k-need); border-color: var(--k-need-line); }
.chip.rc-cancelled { color: var(--k-muted); border-color: var(--k-line); }
.chip.rc-crashed_worker, .chip.rc-results_unwritable, .chip.rc-disk_full { color: var(--k-crit); border-color: currentColor; }
.prio-form { display: inline-flex; gap: 0.25rem; align-items: center; margin: 0; }
select.prio { font: inherit; font-size: 0.74rem; font-weight: 600; height: 24px; padding: 0 0.3rem; border-radius: 5px; background: var(--k-card); color: var(--k-text); border: 1px solid var(--k-line-2); }
select.prio.p-high, .chip.prio.p-high { color: var(--k-crit); border-color: rgba(255, 93, 108, 0.6); }
select.prio.p-low, .chip.prio.p-low { color: var(--k-muted); }

/* ---------------------------------------------------------- automated lab */
.chip.kind.k-lab { color: var(--k-warn); border-color: currentColor; }
.chip.lab-error, .chip.lab-cancelled, .chip.lab-queued { color: var(--k-need); border-color: currentColor; }
.kc-lab {
  display: flex; align-items: center; gap: 0.45rem; margin-top: 0.4rem; padding: 0.22rem 0.45rem;
  border-radius: 6px; border: 1px solid var(--k-line); font-size: 0.72rem; font-weight: 600;
}
.kc-lab.v-pass { color: var(--k-accent); border-color: color-mix(in srgb, var(--k-accent) 45%, transparent); }
.kc-lab.v-fail, .kc-lab.v-error { color: var(--k-crit); border-color: color-mix(in srgb, var(--k-crit) 45%, transparent); }
.kc-lab.v-cancelled { color: var(--k-need); }
.kc-lab-v { margin-right: auto; }
.kc-lab-n { font-variant-numeric: tabular-nums; }
.kc-lab-n.ok { color: var(--k-accent); }
.kc-lab-n.bad { color: var(--k-crit); }
.kc-lab-note { display: block; margin-top: 0.2rem; font-size: 0.7rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kc-run[data-lab] .mono { color: var(--k-warn); }
.lab-rep h3 { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; }
.lab-rep h3 .muted { font-weight: 500; font-size: 0.72rem; text-transform: none; letter-spacing: 0; }
.lab-reason { margin: 0.2rem 0 0.5rem; }
.lab-checks { list-style: none; margin: 0 0 0.6rem; padding: 0; border: 1px solid var(--k-line); border-radius: 6px; overflow: hidden; }
.lab-checks li {
  display: grid; grid-template-columns: 1.4rem minmax(0, 1fr); column-gap: 0.35rem; row-gap: 0.1rem;
  padding: 0.35rem 0.5rem; border-top: 1px solid var(--k-line); font-size: 0.8rem;
}
.lab-checks li:first-child { border-top: 0; }
.lab-checks li.bad { background: var(--k-deny); }
.lab-checks .ck { font-weight: 800; text-align: center; }
.lab-checks li.ok .ck { color: var(--k-accent); }
.lab-checks li.bad .ck { color: var(--k-crit); }
.lab-checks .lbl { overflow-wrap: anywhere; }
.lab-checks .det { grid-column: 2; color: var(--k-muted); font-size: 0.74rem; overflow-wrap: anywhere; }
.lab-checks .chip.gen { font-size: 0.6rem; padding: 0 0.3rem; color: var(--k-faint); }
.lab-kv { margin-top: 0.2rem; }

/* Lab progress on the Testing card */
.kc-run[data-lab] { flex-wrap: wrap; color: var(--k-warn); background: color-mix(in srgb, var(--k-warn) 10%, transparent); border-color: color-mix(in srgb, var(--k-warn) 40%, transparent); }
.kc-run[data-lab] .dot { background: var(--k-warn); }
.kc-run .kr-t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lab-steps { flex: 1 0 100%; display: grid; grid-template-columns: repeat(6, 1fr); gap: 2px; list-style: none; margin: 0.25rem 0 0.1rem; padding: 0; }
.lab-steps li { position: relative; height: 4px; border-radius: 2px; background: var(--k-line); }
.lab-steps li.done { background: color-mix(in srgb, var(--k-warn) 55%, transparent); }
.lab-steps li.cur { background: var(--k-warn); }
.lab-steps li span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.lab-steps li.cur span { position: static; display: block; width: auto; height: auto; clip: auto; margin-top: 6px; font-size: 0.62rem; font-weight: 600; color: var(--k-warn); white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { .lab-steps li { transition: none; } }
.kc-warn { margin-top: 0.35rem; padding: 0.15rem 0.4rem; border-radius: 5px; font-size: 0.72rem; font-weight: 700; color: var(--k-crit); border: 1px solid rgba(255, 93, 108, 0.5); }
.kc-labq { margin-top: 0.35rem; padding: 0.15rem 0.4rem; border-radius: 5px; font-size: 0.72rem; font-weight: 600; color: var(--k-muted, #94a3b8); border: 1px dashed var(--k-line); }

/* PR loop line on a card (auto-opened upstream PR) */
.kc-pr { margin-top: 0.35rem; font-size: 0.74rem; display: flex; flex-wrap: wrap; gap: 0.3rem; align-items: center; }
.kc-pr a { font-weight: 600; }
.kc-pr .pr-st, .dr-kv .pr-st { font-size: 0.68rem; }
.kc-pr.pr-approved .pr-st { color: #16a34a; border-color: #16a34a; }
.kc-pr.pr-changes_requested .pr-st { color: #d97706; border-color: #d97706; }
.kc-pr.pr-merged .pr-st { color: #7c3aed; border-color: #7c3aed; }
.kc-pr.pr-closed .pr-st { color: #dc2626; border-color: #dc2626; }

/* ---- source badges (manual reports / admin requests) ---- */
.src-badge { font-weight: 600; }
.src-manual { color: var(--k-need); border-color: var(--k-need-line); background: var(--k-need-bg); }
.src-admin { color: var(--k-low); border-color: rgba(108, 182, 255, 0.45); background: rgba(108, 182, 255, 0.1); }
p.dr-src { padding: 0.5rem 0.7rem; border-radius: var(--k-r); border: 1px solid var(--k-need-line); background: var(--k-need-bg); font-size: 0.85rem; }

/* ---- shared form fields (public page + admin composer) ---- */
.pub-field { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.8rem; color: var(--k-muted); }
.pub-field input, .pub-field select, .pub-field textarea {
  font: inherit; font-size: 0.9rem; color: var(--k-text); background: var(--k-col);
  border: 1px solid var(--k-line-2); border-radius: 6px; padding: 0.45rem 0.6rem;
}
.pub-field textarea { resize: vertical; min-height: 8rem; line-height: 1.45; }
.pub-field input:focus, .pub-field select:focus, .pub-field textarea:focus { outline: 2px solid var(--k-accent); outline-offset: 0; border-color: var(--k-accent); }
.pub-row { display: flex; gap: 0.75rem; flex-wrap: wrap; align-items: flex-end; }
.pub-grow { flex: 1 1 16rem; }
.pub-small { font-size: 0.78rem; color: var(--k-muted); margin: 0.4rem 0; }
.pub-form, .cmp-form { display: flex; flex-direction: column; gap: 0.75rem; }
.pub-hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.pub-flash { padding: 0.5rem 0.7rem; border-radius: var(--k-r); font-size: 0.85rem; margin: 0 0 0.6rem; }
.pub-flash.ok { background: var(--k-ok-bg); border: 1px solid rgba(62, 207, 142, 0.45); }
.pub-flash.err { background: var(--k-deny); border: 1px solid rgba(255, 93, 108, 0.45); }

/* ---- public page ---- */
body.pub main { max-width: 960px; margin: 0 auto; padding: 1.5rem 1rem 2.5rem; }
.pub-wrap { display: flex; flex-direction: column; gap: 1.25rem; }
.pub-hero h1 { font-size: 1.5rem; margin: 0 0 0.4rem; }
.pub-lead { color: var(--k-muted); margin: 0; max-width: 70ch; }
.pub-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0.6rem; }
.pub-stat { background: var(--k-card); border: 1px solid var(--k-line); border-radius: var(--k-r); padding: 0.8rem 0.9rem; display: flex; flex-direction: column; box-shadow: var(--k-shadow); }
.pub-num { font-size: 1.6rem; font-weight: 700; color: var(--k-text); font-variant-numeric: tabular-nums; }
.pub-lbl { font-size: 0.8rem; color: var(--k-muted); }
.pub-hint { font-size: 0.7rem; color: var(--k-faint); }
.pub-card, .cmp-card { background: var(--k-card); border: 1px solid var(--k-line); border-radius: var(--k-r); padding: 1rem 1.1rem; box-shadow: var(--k-shadow); }
.pub-card h2, .cmp-card h2 { font-size: 1.05rem; margin: 0 0 0.75rem; }
.pub-foot { text-align: center; }

/* ---- admin composer ---- */
.cmp-wrap { max-width: 1100px; margin: 0 auto; display: flex; flex-direction: column; gap: 1rem; }
.cmp-body textarea { min-height: 22rem; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.85rem; }
.cmp-split { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
@media (max-width: 860px) { .cmp-split { grid-template-columns: 1fr; } }
.cmp-preview { border: 1px dashed var(--k-line-2); border-radius: 6px; padding: 0.5rem 0.8rem; min-height: 22rem; overflow: auto; font-size: 0.9rem; }
.cmp-preview pre { background: var(--k-col); padding: 0.5rem; border-radius: 6px; overflow: auto; }
.cmp-preview code { background: var(--k-col); padding: 0 0.2rem; border-radius: 3px; }
.cmp-meta { font-size: 0.75rem; color: var(--k-faint); }
.act-error { display: flex; gap: 0.5rem; align-items: flex-start; justify-content: space-between; margin: 0.4rem 0; padding: 0.45rem 0.6rem; border-radius: 8px; background: var(--k-crit); color: #fff; font-size: 0.83rem; }
.act-error-x { background: none; border: 0; color: inherit; font-size: 1rem; line-height: 1; cursor: pointer; padding: 0 0.2rem; }
.dr-more { margin: 0 0 0.75rem; }
.dr-more > summary { font-size: 0.8rem; padding: 0.25rem 0.6rem; }
.dr-more-why { margin: 0.25rem 0 0; }
.kc-gate { margin: 0.2rem 0 0; font-size: 0.72rem; color: var(--k-muted); font-family: ui-monospace, monospace; overflow-wrap: anywhere; }
