/* Kody PMS prototype — shared styles.
   World: circuit board. Solder-mask green shell, silkscreen legend, ENIG gold owns live state. */

@font-face { font-family: "Barlow"; font-weight: 400; font-display: swap; src: url("fonts/barlow-400.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 500; font-display: swap; src: url("fonts/barlow-500.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 600; font-display: swap; src: url("fonts/barlow-600.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 700; font-display: swap; src: url("fonts/barlow-700.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-weight: 400; font-display: swap; src: url("fonts/jbmono-400.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-weight: 500; font-display: swap; src: url("fonts/jbmono-500.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-weight: 600; font-display: swap; src: url("fonts/jbmono-600.woff2") format("woff2"); }

/* ---------- Tokens ---------- */
:root {
  color-scheme: light;
  --bg: #F4F6F2;
  --surface: #FFFFFF;
  --surface-2: #EEF2EC;
  --surface-3: #E4EAE2;
  --ink: #131B17;
  --ink-2: #47534C;
  --ink-3: #5F6B64;
  --line: #DAE1D8;
  --line-strong: #C3CCC1;

  --rail: #0F3D2E;
  --rail-2: #155139;
  --rail-3: #1B5F44;
  --rail-ink: #ECF3EE;
  --rail-ink-2: #A8C3B4;
  --rail-line: rgba(236, 243, 238, 0.12);

  --primary: #0F3D2E;
  --primary-hover: #155139;
  --on-primary: #FFFFFF;

  --gold: #C8A13A;
  --gold-ink: #7A5C0E;
  --gold-soft: #F7EFD7;
  --green: #2E7D4F;
  --green-ink: #21633D;
  --green-soft: #E2F0E6;
  --amber: #C77A1E;
  --amber-ink: #8A500B;
  --amber-soft: #F9EDDC;
  --red: #C2362B;
  --red-ink: #A32A21;
  --red-soft: #FAE5E2;
  --blue: #2F6FAE;
  --blue-ink: #245C93;
  --blue-soft: #E3EDF7;
  --grey: #8A958F;
  --grey-soft: #ECEFEB;

  --trace-done: #2E7D4F;
  --trace-live: #C8A13A;
  --trace-off: #A9B3AD;
  --dotgrid: rgba(19, 27, 23, 0.09);

  --shadow-1: 0 1px 2px rgba(15, 30, 22, 0.06), 0 1px 1px rgba(15, 30, 22, 0.04);
  --shadow-2: 0 8px 24px -6px rgba(15, 30, 22, 0.18), 0 2px 6px rgba(15, 30, 22, 0.08);
  --scrim: rgba(10, 20, 15, 0.42);

  --font: "Barlow", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --r-sm: 4px;
  --r: 6px;
  --r-lg: 10px;
  --rail-w: 236px;
  --top-h: 56px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0D1311;
  --surface: #131B18;
  --surface-2: #18221E;
  --surface-3: #202C27;
  --ink: #E5ECE7;
  --ink-2: #AEBBB3;
  --ink-3: #8B9A91;
  --line: #25312C;
  --line-strong: #34433C;

  --rail: #0A2A1F;
  --rail-2: #0F3729;
  --rail-3: #144634;
  --rail-ink: #E5EFE8;
  --rail-ink-2: #93B2A1;
  --rail-line: rgba(229, 239, 232, 0.09);

  --primary: #2E7D4F;
  --primary-hover: #36905C;
  --on-primary: #FFFFFF;

  --gold: #D9B44A;
  --gold-ink: #E4C468;
  --gold-soft: rgba(217, 180, 74, 0.14);
  --green: #4CAF78;
  --green-ink: #74CB98;
  --green-soft: rgba(76, 175, 120, 0.14);
  --amber: #E0953A;
  --amber-ink: #EFAE5E;
  --amber-soft: rgba(224, 149, 58, 0.15);
  --red: #E5594D;
  --red-ink: #F38278;
  --red-soft: rgba(229, 89, 77, 0.15);
  --blue: #5B9BD8;
  --blue-ink: #86B6E6;
  --blue-soft: rgba(91, 155, 216, 0.15);
  --grey: #7D8B84;
  --grey-soft: rgba(125, 139, 132, 0.15);

  --trace-done: #4CAF78;
  --trace-live: #D9B44A;
  --trace-off: #4A5952;
  --dotgrid: rgba(229, 236, 231, 0.07);

  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-2: 0 12px 32px -8px rgba(0, 0, 0, 0.6), 0 2px 8px rgba(0, 0, 0, 0.4);
  --scrim: rgba(0, 0, 0, 0.6);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 400 14px/1.45 var(--font);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}
h1, h2, h3, h4 { margin: 0; font-weight: 600; line-height: 1.2; text-wrap: balance; }
h1 { font-size: 24px; letter-spacing: -0.01em; }
h2 { font-size: 18px; }
h3 { font-size: 15px; }
h4 { font-size: 14px; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
a.link, .prose a { color: var(--green-ink); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
a.link:hover { text-decoration-thickness: 2px; }
button, input, select, textarea { font: inherit; color: inherit; }
img, svg { display: block; }
::selection { background: var(--gold); color: #1A1404; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: var(--r-sm); }
* { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 10px; border: 3px solid var(--bg); }
::-webkit-scrollbar-track { background: transparent; }
input, textarea { caret-color: var(--gold); }
.scroll-hint { display: none; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-3); padding: 8px 18px 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.i { width: 16px; height: 16px; flex: none; stroke-width: 1.75; }
.i-sm { width: 14px; height: 14px; }
.i-lg { width: 20px; height: 20px; }

.mono, .ref { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.ref { font-size: 11.5px; font-weight: 500; color: var(--ink-3); letter-spacing: 0.02em; white-space: nowrap; }
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }
.small { font-size: 13px; }
.xs { font-size: 12px; }
.nowrap { white-space: nowrap; }
.num { font-family: var(--mono); font-size: 13px; }

/* ---------- App shell ---------- */
.app { display: grid; grid-template-columns: var(--rail-w) 1fr; min-height: 100vh; }
.rail {
  position: sticky; top: 0; height: 100vh;
  background: var(--rail); color: var(--rail-ink);
  display: flex; flex-direction: column; overflow-y: auto;
  border-right: 1px solid var(--rail-line);
}
.brand { display: flex; align-items: center; gap: 10px; height: var(--top-h); padding: 0 18px; border-bottom: 1px solid var(--rail-line); flex: none; }
.brand-mark { width: 28px; height: 28px; flex: none; }
.brand-name { font-weight: 700; font-size: 16px; letter-spacing: 0.01em; }
.brand-name small { display: block; font: 500 10.5px/1.2 var(--mono); color: var(--rail-ink-2); letter-spacing: 0.06em; }
.nav { padding: 12px 10px; display: grid; gap: 2px; }
.nav-group { font: 500 11px/1 var(--mono); letter-spacing: 0.08em; color: var(--rail-ink-2); padding: 16px 10px 8px; text-transform: uppercase; }
.nav a {
  position: relative; display: flex; align-items: center; gap: 11px;
  height: 36px; padding: 0 10px 0 14px; border-radius: var(--r);
  color: var(--rail-ink-2); font-weight: 500; font-size: 14px;
  transition: background 160ms var(--ease), color 160ms var(--ease);
}
.nav a:hover { background: var(--rail-2); color: var(--rail-ink); }
.nav a[aria-current="page"] { background: var(--rail-3); color: var(--rail-ink); }
/* The current item gets a gold pad, like a soldered contact */
.nav a[aria-current="page"]::before {
  content: ""; position: absolute; left: 3px; top: 50%; width: 7px; height: 7px; margin-top: -3.5px;
  border-radius: 2px; background: var(--gold); box-shadow: 0 0 0 2px color-mix(in srgb, var(--gold) 30%, transparent);
}
.nav a .count { margin-left: auto; font: 500 11px/18px var(--mono); padding: 0 6px; border-radius: 9px; background: rgba(236,243,238,0.12); color: var(--rail-ink); }
.nav a .count.live { background: var(--gold); color: #1A1404; }
.rail-foot { margin-top: auto; padding: 12px 14px 16px; border-top: 1px solid var(--rail-line); display: grid; gap: 10px; }
.rail-foot .who { display: flex; gap: 10px; align-items: center; }
.rail-foot .who b { display: block; font-weight: 600; font-size: 13.5px; }
.rail-foot .who span { font-size: 12px; color: var(--rail-ink-2); }
.role-switch { display: grid; gap: 4px; font-size: 11.5px; color: var(--rail-ink-2); }
.role-switch select {
  height: 30px; border-radius: var(--r); border: 1px solid var(--rail-line); background: var(--rail-2); color: var(--rail-ink);
  padding: 0 8px; font-size: 13px;
}

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  height: var(--top-h); display: flex; align-items: center; gap: 12px;
  padding: 0 24px; background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.menu-btn { display: none; }
.search {
  flex: 1; min-width: 0; max-width: 460px; display: flex; align-items: center; gap: 8px;
  height: 36px; padding: 0 10px; border: 1px solid var(--line); border-radius: var(--r);
  background: var(--surface); color: var(--ink-3); cursor: text;
}
.search input { flex: 1; border: 0; background: none; outline: none; color: var(--ink); min-width: 0; }
.search input::placeholder { color: var(--ink-3); }
.kbd { font: 500 11px/1 var(--mono); padding: 3px 5px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; color: var(--ink-3); background: var(--surface-2); }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }

.timer-chip {
  display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 6px 0 10px;
  border: 1px solid var(--line); border-radius: 17px; background: var(--surface); font-size: 13px;
}
.timer-chip .t-task { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.timer-chip .t-time { font: 600 13px/1 var(--mono); }
.timer-chip.running { border-color: color-mix(in srgb, var(--gold) 60%, var(--line)); background: var(--gold-soft); }
.timer-chip.running .t-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 30%, transparent); }
.timer-chip .t-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--grey); }

.icon-btn {
  position: relative; display: inline-grid; place-items: center; width: 36px; height: 36px;
  border: 0; border-radius: var(--r); background: transparent; color: var(--ink-2); cursor: pointer;
  transition: background 140ms var(--ease), color 140ms var(--ease);
}
.icon-btn:hover { background: var(--surface-3); color: var(--ink); }
.icon-btn .badge-dot { position: absolute; top: 7px; right: 7px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--gold); color: #1A1404; font: 600 10px/16px var(--mono); text-align: center; border: 2px solid var(--bg); box-sizing: content-box; transform: translate(40%, -40%); }

.content { padding: 24px 28px 64px; display: grid; gap: 24px; align-content: start; width: 100%; max-width: 1480px; }
.content > *, [role="tabpanel"], .grid-2 > * { min-width: 0; }
.page-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.page-head .titles { display: grid; gap: 6px; min-width: 0; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.crumbs { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-3); flex-wrap: wrap; }
.crumbs a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.crumbs .i { width: 13px; height: 13px; }

/* ---------- Buttons & inputs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 36px; padding: 0 14px; border-radius: var(--r); border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--ink); font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap;
  transition: background 140ms var(--ease), border-color 140ms var(--ease), transform 80ms var(--ease);
}
.btn:hover { background: var(--surface-2); border-color: var(--ink-3); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.btn.primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn.gold { background: var(--gold); border-color: var(--gold); color: #1A1404; }
.btn.gold:hover { filter: brightness(1.05); }
.btn.danger { color: var(--red-ink); border-color: color-mix(in srgb, var(--red) 45%, var(--line)); }
.btn.danger:hover { background: var(--red-soft); }
.btn.danger.solid { background: var(--red); border-color: var(--red); color: #fff; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--surface-3); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; }
.btn.xs { height: 26px; padding: 0 8px; font-size: 12.5px; gap: 5px; }
.btn[disabled], .btn.is-disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; }
.btn.loading { color: transparent !important; position: relative; pointer-events: none; }
.btn.loading::after { content: ""; position: absolute; width: 14px; height: 14px; border-radius: 50%; border: 2px solid; border-color: var(--ink-2) transparent var(--ink-2) transparent; animation: spin 700ms linear infinite; }
.btn.primary.loading::after, .btn.danger.solid.loading::after { border-color: var(--on-primary) transparent var(--on-primary) transparent; }
@keyframes spin { to { transform: rotate(360deg); } }

.field { display: grid; gap: 6px; }
.field > label, .label { font-weight: 600; font-size: 13px; color: var(--ink); }
.field .hint { font-size: 12.5px; color: var(--ink-3); }
.field .err { font-size: 12.5px; color: var(--red-ink); display: flex; gap: 5px; align-items: center; }
.input, .select, .textarea {
  width: 100%; height: 38px; padding: 0 11px; border-radius: var(--r);
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
  transition: border-color 140ms var(--ease), box-shadow 140ms var(--ease);
}
.textarea { height: auto; min-height: 96px; padding: 9px 11px; line-height: 1.5; resize: vertical; }
.input::placeholder, .textarea::placeholder { color: var(--ink-3); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--ink-3); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 25%, transparent); }
.input.invalid, .textarea.invalid { border-color: var(--red); }
.select { appearance: none; padding-right: 32px; background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%), linear-gradient(135deg, var(--ink-3) 50%, transparent 50%); background-position: calc(100% - 16px) 16px, calc(100% - 11px) 16px; background-size: 5px 5px; background-repeat: no-repeat; }
.input.sm, .select.sm { height: 32px; font-size: 13px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; }
.form-grid .span-2 { grid-column: 1 / -1; }

.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; }
.check input { width: 16px; height: 16px; accent-color: var(--primary); }

.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { width: 34px; height: 20px; border-radius: 10px; background: var(--line-strong); position: relative; transition: background 160ms var(--ease); flex: none; }
.switch .track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-1); transition: transform 180ms var(--ease); }
.switch input:checked + .track { background: var(--primary); }
.switch input:checked + .track::after { transform: translateX(14px); }
.switch input:focus-visible + .track { outline: 2px solid var(--gold); outline-offset: 2px; }

.seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r); }
.seg button, .seg a { white-space: nowrap; height: 28px; padding: 0 11px; border: 0; border-radius: 4px; background: transparent; color: var(--ink-2); font-weight: 500; font-size: 13px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.seg [aria-pressed="true"], .seg [aria-current="page"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs a, .tabs button { position: relative; display: inline-flex; align-items: center; gap: 7px; height: 40px; padding: 0 12px; border: 0; background: none; color: var(--ink-2); font-weight: 500; cursor: pointer; white-space: nowrap; }
.tabs a:hover, .tabs button:hover { color: var(--ink); }
.tabs [aria-selected="true"] { color: var(--ink); font-weight: 600; }
.tabs [aria-selected="true"]::after { content: ""; position: absolute; left: 8px; right: 8px; bottom: -1px; height: 2px; background: var(--gold); border-radius: 2px; }
.tabs .count { font: 500 11px/17px var(--mono); padding: 0 6px; border-radius: 9px; background: var(--surface-3); color: var(--ink-2); }
[role="tabpanel"][hidden] { display: none; }

/* ---------- Status chips (shape + label, never colour alone) ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px 0 7px;
  border-radius: 11px; font-size: 12px; font-weight: 600; white-space: nowrap;
  background: var(--grey-soft); color: var(--ink-2);
}
.chip .i { width: 12px; height: 12px; stroke-width: 2.25; }
.chip.done { background: var(--green-soft); color: var(--green-ink); }
.chip.live { background: var(--gold-soft); color: var(--gold-ink); }
.chip.risk { background: var(--amber-soft); color: var(--amber-ink); }
.chip.late, .chip.fail { background: var(--red-soft); color: var(--red-ink); }
.chip.info { background: var(--surface-3); color: var(--ink-2); }
.chip.locked { background: var(--grey-soft); color: var(--ink-3); }
.chip.outline { background: transparent; border: 1px solid var(--line-strong); color: var(--ink-2); }
.chip.qc { background: transparent; border: 1px solid color-mix(in srgb, var(--blue) 50%, var(--line)); color: var(--blue-ink); }

.tag { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 4px; background: var(--surface-2); border: 1px solid var(--line); font-size: 12px; color: var(--ink-2); white-space: nowrap; }

.avatar {
  --av: #46705B; width: 28px; height: 28px; border-radius: 50%; flex: none;
  display: inline-grid; place-items: center; font-weight: 600; font-size: 11.5px; color: #fff; letter-spacing: 0.02em;
  background: var(--av);
}
.avatar.sm { width: 22px; height: 22px; font-size: 9.5px; }
.avatar.lg { width: 40px; height: 40px; font-size: 14px; }
.avatar-stack { display: flex; }
.avatar-stack .avatar { border: 2px solid var(--surface); margin-left: -7px; }
.avatar-stack .avatar:first-child { margin-left: 0; }
.av-1 { --av: #2E6B52; } .av-2 { --av: #7A5C0E; } .av-3 { --av: #2F5F8F; } .av-4 { --av: #8E3B32; }
.av-5 { --av: #5B4E8C; } .av-6 { --av: #386A6E; } .av-7 { --av: #8A5A2B; } .av-8 { --av: #4D5B54; }

/* ---------- Panels ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-1); min-width: 0; }
.panel-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); min-height: 52px; }
.panel-head h2, .panel-head h3 { font-size: 15px; display: flex; align-items: center; gap: 8px; }
.panel-head .spacer { flex: 1; }
.panel-body { padding: 16px 18px; }
.panel-foot { padding: 10px 18px; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.panel.flush .panel-body { padding: 0; }

.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; align-items: start; }
.grid-2.even { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stack { display: grid; gap: 24px; align-content: start; min-width: 0; }
.stack-sm { display: grid; gap: 12px; align-content: start; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.spacer { flex: 1; }
.divider { height: 1px; background: var(--line); border: 0; margin: 0; }

/* Key facts strip: label/value pairs separated by hairlines, not stat cards */
.facts { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.facts > div { padding: 12px 16px; display: grid; gap: 3px; border-left: 1px solid var(--line); min-width: 0; }
.facts > div:first-child { border-left: 0; }
.facts dt { font-size: 12px; color: var(--ink-3); font-weight: 500; }
.facts dd { margin: 0; font-weight: 600; font-size: 15px; display: flex; align-items: center; gap: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.facts dd .mono { font-size: 14px; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; position: relative; }
table.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { text-align: left; font-weight: 600; font-size: 12px; color: var(--ink-3); padding: 9px 14px; background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap; position: sticky; top: 0; }
.table th button { all: unset; cursor: pointer; display: inline-flex; gap: 4px; align-items: center; }
.table th button:hover { color: var(--ink); }
.table th button:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.table td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr { transition: background 120ms var(--ease); }
.table tbody tr:hover { background: color-mix(in srgb, var(--surface-2) 70%, transparent); }
.table tbody tr:last-child td { border-bottom: 0; }
.table .t-right { text-align: right; }
.table .cell-main { display: grid; gap: 2px; min-width: 0; }
.table .cell-main a { font-weight: 600; }
.table .cell-main a:hover { text-decoration: underline; text-underline-offset: 3px; }
.table tr.inactive td { color: var(--ink-3); }

.bar { position: relative; height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; min-width: 60px; }
.bar > span { position: absolute; inset: 0 auto 0 0; border-radius: 3px; background: var(--green); }
.bar.live > span { background: var(--green); }
.bar.risk > span { background: var(--amber); }
.bar.late > span { background: var(--red); }
.pct { display: flex; align-items: center; gap: 8px; }
.pct .num { width: 36px; text-align: right; color: var(--ink-2); font-size: 12px; }

/* ---------- Work tree (My Work: Project > Epic > Story > Task) ---------- */
.tree { display: grid; }
.tree-project { border-top: 1px solid var(--line); }
.tree-project:first-child { border-top: 0; }
.tree-project > header { display: flex; align-items: center; gap: 10px; padding: 12px 18px; background: var(--surface-2); }
.tree-project > header a.title { font-weight: 600; font-size: 14.5px; }
.tree-project > header a.title:hover { text-decoration: underline; text-underline-offset: 3px; }
.tree-epic { padding: 8px 18px 4px 18px; display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); }
.tree-epic .i { color: var(--ink-3); }
.story-row { margin: 4px 18px 10px 26px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); position: relative; }
.story-row::before { content: ""; position: absolute; left: -12px; top: -10px; bottom: 50%; width: 10px; border-left: 1px solid var(--line-strong); border-bottom: 1px solid var(--line-strong); border-bottom-left-radius: 6px; }
.story-row.is-unseen { border-color: color-mix(in srgb, var(--gold) 70%, var(--line)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 18%, transparent); }
.story-row > .s-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px; flex-wrap: wrap; }
.story-row > .s-head a.s-title { font-weight: 600; }
.story-row > .s-head a.s-title:hover { text-decoration: underline; text-underline-offset: 3px; }
.story-row .s-meta { display: flex; align-items: center; gap: 12px; margin-left: auto; color: var(--ink-3); font-size: 12.5px; }
.story-row.is-locked { background: var(--surface-2); border-style: dashed; }
.story-row.is-locked .s-title { color: var(--ink-2); }
.unseen-note { display: flex; align-items: center; gap: 8px; padding: 7px 12px; border-top: 1px solid color-mix(in srgb, var(--gold) 40%, var(--line)); background: var(--gold-soft); color: var(--gold-ink); font-size: 12.5px; font-weight: 500; border-radius: 0 0 var(--r) var(--r); }
.unseen-note button { margin-left: auto; }
.task-list { border-top: 1px solid var(--line); }
.task { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto auto auto; align-items: center; gap: 10px; padding: 8px 12px; font-size: 13.5px; }
.task + .task { border-top: 1px solid var(--line); }
.task .t-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task.done .t-title { color: var(--ink-3); text-decoration: line-through; text-decoration-color: var(--line-strong); }
.task .hrs { font: 500 12px var(--mono); color: var(--ink-2); white-space: nowrap; }
.task .hrs.over { color: var(--red-ink); }
.task-check { width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--line-strong); display: grid; place-items: center; background: var(--surface); }
.task.done .task-check { background: var(--green); border-color: var(--green); color: #fff; }
.task.doing .task-check { border-color: var(--gold); box-shadow: inset 0 0 0 3px var(--surface), inset 0 0 0 9px var(--gold); }
.task.blocked .task-check { border-color: var(--red); color: var(--red); }
.play-btn { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--line-strong); background: var(--surface); display: grid; place-items: center; cursor: pointer; color: var(--ink-2); transition: all 140ms var(--ease); }
.play-btn:hover { border-color: var(--gold); color: var(--gold-ink); background: var(--gold-soft); }
.play-btn.on { background: var(--gold); border-color: var(--gold); color: #1A1404; }
.play-btn[disabled] { opacity: 0.4; cursor: not-allowed; }

/* ---------- Step trace (signature) ---------- */
.board {
  position: relative; border-radius: var(--r-lg);
  background-color: var(--surface);
  background-image: radial-gradient(var(--dotgrid) 1px, transparent 1.2px);
  background-size: 12px 12px; background-position: 6px 6px;
}
.trace { position: relative; display: flex; align-items: center; gap: 76px; padding: 22px 52px 22px 22px; overflow-x: auto; }
.trace svg.wires { position: absolute; inset: 0; pointer-events: none; overflow: visible; }
.step { position: relative; display: grid; gap: 10px; flex: none; z-index: 1; }
.step-label { font: 500 11px/1 var(--mono); letter-spacing: 0.06em; color: var(--ink-3); text-transform: uppercase; display: flex; gap: 6px; align-items: center; }
.step.live .step-label { color: var(--gold-ink); }
.pad {
  position: relative; display: grid; gap: 4px; width: 178px; padding: 10px 12px 10px 14px;
  border: 1.5px solid var(--line-strong); border-radius: var(--r); background: var(--surface);
  transition: border-color 160ms var(--ease), box-shadow 160ms var(--ease), transform 160ms var(--ease);
}
a.pad:hover { border-color: var(--ink-3); transform: translateY(-1px); box-shadow: var(--shadow-1); }
.pad .p-top { display: flex; align-items: center; gap: 6px; }
.pad .p-title { font-weight: 600; font-size: 13.5px; line-height: 1.3; }
.pad .p-meta { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink-3); }
/* solder contact on each side of a pad */
.pad::before, .pad::after { content: ""; position: absolute; top: 50%; width: 7px; height: 12px; margin-top: -6px; border-radius: 2px; background: var(--line-strong); }
.pad::before { left: -5px; }
.pad::after { right: -5px; }
.pad.done { border-color: color-mix(in srgb, var(--green) 55%, var(--line)); }
.pad.done::before, .pad.done::after { background: var(--trace-done); }
.pad.live { border-color: var(--gold); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 22%, transparent); }
.pad.live::before, .pad.live::after { background: var(--gold); }
.pad.fail { border-color: var(--red); box-shadow: 0 0 0 3px color-mix(in srgb, var(--red) 15%, transparent); }
.pad.fail::before, .pad.fail::after { background: var(--red); }
.pad.locked { border-style: dashed; background: var(--surface-2); }
.pad.locked .p-title { color: var(--ink-2); }
.tp { position: absolute; z-index: 2; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--surface); border: 2px solid var(--blue); color: var(--blue-ink); font: 600 8.5px/1 var(--mono); letter-spacing: 0.02em; }
.tp.pass { border-color: var(--green); color: var(--green-ink); }
.tp.fail { border-color: var(--red); color: var(--red-ink); }
.tp.wait { border-color: var(--trace-off); color: var(--ink-3); border-style: dashed; }
.wire { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.wire.done { stroke: var(--trace-done); stroke-width: 3; }
.wire.live { stroke: var(--trace-live); stroke-width: 3; }
.wire.live.flow { stroke-dasharray: 2 10; stroke-width: 3; animation: flow 1.1s linear infinite; }
.wire.off { stroke: var(--trace-off); stroke-width: 1.25; stroke-dasharray: 4 5; }
.wire.fail { stroke: var(--red); stroke-width: 3; }
.via { stroke-width: 2; }
.via.done { fill: var(--surface); stroke: var(--trace-done); }
.via.live { fill: var(--surface); stroke: var(--trace-live); }
.via.off { fill: var(--surface); stroke: var(--trace-off); }
@keyframes flow { to { stroke-dashoffset: -12; } }

/* Compact trace for dashboard rows */
.mini-trace { display: flex; align-items: center; gap: 0; min-width: 0; }
.mini-trace .m-step { display: grid; gap: 3px; justify-items: center; }
.mini-trace .m-pad { height: 22px; min-width: 30px; padding: 0 6px; border-radius: 4px; border: 1.5px solid var(--line-strong); display: grid; place-items: center; font: 600 10.5px/1 var(--mono); color: var(--ink-3); background: var(--surface); }
.mini-trace .m-pad.done { border-color: var(--trace-done); color: var(--green-ink); background: var(--green-soft); }
.mini-trace .m-pad.live { border-color: var(--gold); color: var(--gold-ink); background: var(--gold-soft); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 20%, transparent); }
.mini-trace .m-pad.fail { border-color: var(--red); color: var(--red-ink); background: var(--red-soft); }
.mini-trace .m-pad.locked { border-style: dashed; background: transparent; }
.mini-trace .m-wire { width: 22px; height: 3px; background: var(--trace-done); border-radius: 2px; flex: none; }
.mini-trace .m-wire.live { background: var(--gold); }
.mini-trace .m-wire.off { height: 0; border-top: 1.5px dashed var(--trace-off); background: none; }
.mini-trace .m-tp { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--blue); background: var(--surface); flex: none; margin: 0 -1px; }
.mini-trace .m-tp.fail { border-color: var(--red); }
.mini-trace .m-tp.pass { border-color: var(--green); }

.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--ink-3); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i.l { display: inline-block; width: 20px; height: 3px; background: var(--trace-done); border-radius: 2px; }
.legend i.l.live { background: var(--gold); }
.legend i.l.off { height: 0; background: none; border-top: 1.5px dashed var(--trace-off); border-radius: 0; }
.legend i.l.fail { background: var(--red); }
.legend i.tpl { width: 11px; height: 11px; border-radius: 50%; border: 2px solid var(--blue); display: inline-block; }

/* ---------- Lists, feed, comments ---------- */
.list { display: grid; }
.list > .li { display: flex; align-items: center; gap: 12px; padding: 11px 18px; border-top: 1px solid var(--line); min-width: 0; }
.list > .li:first-child { border-top: 0; }
.list > a.li:hover { background: var(--surface-2); }
.li .li-main { display: grid; gap: 2px; min-width: 0; flex: 1; }
.li .li-main b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li .li-main span { font-size: 12.5px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li.unread { background: color-mix(in srgb, var(--gold-soft) 55%, transparent); }
.li .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); flex: none; }

.feed { display: grid; gap: 0; position: relative; }
.feed-item { display: grid; grid-template-columns: 28px 1fr; gap: 12px; padding: 10px 0; position: relative; }
.feed-item::before { content: ""; position: absolute; left: 13.5px; top: 38px; bottom: -10px; width: 1px; background: var(--line); }
.feed-item:last-child::before { display: none; }
.feed-item .f-icon { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2); }
.feed-item .f-icon.done { background: var(--green-soft); color: var(--green-ink); border-color: transparent; }
.feed-item .f-icon.live { background: var(--gold-soft); color: var(--gold-ink); border-color: transparent; }
.feed-item .f-icon.fail { background: var(--red-soft); color: var(--red-ink); border-color: transparent; }
.feed-item .f-icon.info { background: var(--surface-2); color: var(--ink-2); }
.feed-item .f-body { font-size: 13.5px; padding-top: 4px; min-width: 0; }
.feed-item .f-body b { font-weight: 600; }
.feed-item .f-time { font-size: 12px; color: var(--ink-3); margin-top: 2px; }

.comment { display: grid; grid-template-columns: 32px 1fr; gap: 12px; }
.comment + .comment { margin-top: 18px; }
.comment .c-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.comment .c-head b { font-weight: 600; }
.comment .c-body { margin-top: 4px; line-height: 1.55; max-width: 72ch; }
.comment .c-actions { display: flex; gap: 12px; margin-top: 6px; font-size: 12.5px; color: var(--ink-3); }
.comment .c-actions button { all: unset; cursor: pointer; }
.comment .c-actions button:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.mention { color: var(--green-ink); background: var(--green-soft); padding: 0 3px; border-radius: 3px; font-weight: 500; }
.composer { border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--surface); }
.composer:focus-within { border-color: var(--gold); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 22%, transparent); }
.composer textarea { width: 100%; border: 0; background: none; padding: 10px 12px; min-height: 72px; resize: vertical; outline: none; line-height: 1.5; }
.composer .c-bar { display: flex; align-items: center; gap: 4px; padding: 6px 6px 6px 8px; border-top: 1px solid var(--line); }

.attach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.file { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); min-width: 0; }
.file:hover { border-color: var(--line-strong); background: var(--surface-2); }
.file .f-ico { width: 34px; height: 34px; border-radius: 4px; display: grid; place-items: center; background: var(--surface-2); color: var(--ink-2); flex: none; border: 1px solid var(--line); overflow: hidden; }
.file .f-ico.img { background: var(--green-soft); color: var(--green-ink); border-color: transparent; }
.file .f-meta { display: grid; min-width: 0; }
.file .f-meta b { font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file .f-meta span { font-size: 11.5px; color: var(--ink-3); font-family: var(--mono); }
.dropzone { display: grid; place-items: center; gap: 6px; padding: 22px; border: 1.5px dashed var(--line-strong); border-radius: var(--r); color: var(--ink-3); text-align: center; font-size: 13px; cursor: pointer; transition: all 140ms var(--ease); }
.dropzone:hover, .dropzone.over { border-color: var(--gold); background: var(--gold-soft); color: var(--gold-ink); }

/* ---------- Prose (descriptions) ---------- */
.prose { line-height: 1.6; max-width: 74ch; color: var(--ink); }
.prose p + p, .prose p + ul, .prose ul + p { margin-top: 10px; }
.prose ul, .prose ol { margin: 8px 0 0; padding-left: 20px; }
.prose li + li { margin-top: 4px; }
.prose h3 { margin: 18px 0 6px; }
.prose code { font-family: var(--mono); font-size: 12.5px; background: var(--surface-2); padding: 1px 5px; border-radius: 3px; border: 1px solid var(--line); }
.clamp { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.read-more { all: unset; cursor: pointer; color: var(--green-ink); font-weight: 600; font-size: 13px; margin-top: 8px; display: inline-flex; gap: 4px; align-items: center; }
.read-more:hover { text-decoration: underline; text-underline-offset: 3px; }

.ac-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ac-list li { display: grid; grid-template-columns: 18px 1fr; gap: 10px; align-items: start; line-height: 1.5; }
.ac-list .i { margin-top: 2px; color: var(--green); }

/* ---------- Callouts, empty, toast ---------- */
.callout { display: flex; gap: 12px; padding: 12px 14px; border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--line); font-size: 13.5px; align-items: flex-start; }
.callout .i { margin-top: 1px; }
.callout.live { background: var(--gold-soft); border-color: color-mix(in srgb, var(--gold) 45%, var(--line)); color: var(--gold-ink); }
.callout.fail { background: var(--red-soft); border-color: color-mix(in srgb, var(--red) 35%, var(--line)); color: var(--red-ink); }
.callout.info { background: var(--surface-2); border-color: var(--line); color: var(--ink); }
/* Test-point blue is reserved for QC */
.callout.qc { background: var(--blue-soft); border-color: color-mix(in srgb, var(--blue) 30%, var(--line)); color: var(--blue-ink); }
.callout.done { background: var(--green-soft); border-color: color-mix(in srgb, var(--green) 30%, var(--line)); color: var(--green-ink); }
.callout b { font-weight: 600; }
.callout .c-text { display: grid; gap: 2px; flex: 1; }
.callout .c-text span { color: var(--ink-2); }

.empty { display: grid; justify-items: center; gap: 10px; padding: 36px 24px; text-align: center; color: var(--ink-2); }
.empty .e-art { width: 64px; height: 40px; color: var(--ink-3); }
.empty b { color: var(--ink); font-weight: 600; font-size: 15px; }
.empty p { max-width: 42ch; font-size: 13.5px; }

.toast-host { position: fixed; left: calc(var(--rail-w) + 24px); bottom: 20px; z-index: 100; display: grid; gap: 8px; }
@media (max-width: 760px) { .toast-host { left: 12px; right: 12px; } .toast { min-width: 0; max-width: none; } }
.toast { display: flex; align-items: center; gap: 10px; min-width: 280px; max-width: 420px; padding: 11px 14px; border-radius: var(--r); background: var(--ink); color: var(--bg); box-shadow: var(--shadow-2); font-size: 13.5px; animation: toast-in 260ms var(--ease); }
.toast .i { color: var(--gold); }
.toast button { margin-left: auto; all: unset; cursor: pointer; font-weight: 600; color: var(--gold); padding-left: 10px; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

.skeleton { background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; border-radius: 4px; height: 12px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* Drawer (task detail, filters) */
.drawer-scrim { position: fixed; inset: 0; background: var(--scrim); z-index: 60; opacity: 0; pointer-events: none; transition: opacity 200ms var(--ease); }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(520px, 100vw); background: var(--surface); z-index: 61; box-shadow: var(--shadow-2); transform: translateX(100%); transition: transform 260ms var(--ease); display: flex; flex-direction: column; border-left: 1px solid var(--line); }
.drawer.open { transform: none; }
.drawer.open + .drawer-scrim, .drawer-scrim.open { opacity: 1; pointer-events: auto; }
.drawer-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.drawer-body { flex: 1; overflow-y: auto; padding: 18px; display: grid; gap: 18px; align-content: start; }
.drawer-foot { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; }

dialog.dlg { border: 1px solid var(--line); border-radius: var(--r-lg); padding: 0; background: var(--surface); color: var(--ink); box-shadow: var(--shadow-2); width: min(560px, calc(100vw - 32px)); }
dialog.dlg::backdrop { background: var(--scrim); }
.dlg-head { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.dlg-body { padding: 18px 20px; display: grid; gap: 14px; }
.dlg-foot { padding: 12px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; }

/* Command palette */
.cmdk-list { max-height: 340px; overflow-y: auto; padding: 6px; display: grid; gap: 2px; }
.cmdk-list a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: var(--r); }
.cmdk-list a:hover, .cmdk-list a.sel { background: var(--surface-3); }
.cmdk-list .grp { font: 500 11px/1 var(--mono); letter-spacing: 0.06em; color: var(--ink-3); text-transform: uppercase; padding: 10px 10px 6px; }

/* Notification popover */
.pop { position: absolute; top: calc(100% + 8px); right: 0; width: 380px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-2); z-index: 40; display: none; }
.pop.open { display: block; animation: toast-in 200ms var(--ease); }
.pop-wrap { position: relative; }

/* Page-level helpers */
.sticky-actions { position: sticky; bottom: 0; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-top: 1px solid var(--line); padding: 12px 28px; display: flex; gap: 8px; justify-content: flex-end; margin: 0 -28px -64px; }
.kv { display: grid; grid-template-columns: 120px 1fr; gap: 10px 14px; font-size: 13.5px; align-items: center; }
.kv dt { color: var(--ink-3); font-weight: 500; }
.kv dd { margin: 0; display: flex; align-items: center; gap: 8px; min-width: 0; flex-wrap: wrap; }

.section-title { display: flex; align-items: center; gap: 10px; }
.section-title h2 { font-size: 16px; }
.section-title .spacer { flex: 1; }

/* ---------- Responsive ---------- */
@media (max-width: 1200px) {
  .grid-2 { grid-template-columns: minmax(0, 1fr) 320px; }
}
@media (max-width: 1080px) {
  :root { --rail-w: 68px; }
  .brand-name, .nav a span.lbl, .nav a .count, .nav-group, .rail-foot .who > div, .role-switch { display: none; }
  .brand { justify-content: center; padding: 0; }
  .nav a { justify-content: center; padding: 0; }
  .nav a .i { width: 18px; height: 18px; }
  .rail-foot { justify-items: center; }
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .facts { grid-auto-flow: row; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .facts > div { border-left: 0; border-top: 1px solid var(--line); }
  .facts > div:nth-child(-n+3) { border-top: 0; }
  .facts > div:not(:nth-child(3n+1)) { border-left: 1px solid var(--line); }
}
@media (max-width: 760px) {
  :root { --rail-w: 264px; }
  .app { grid-template-columns: 1fr; }
  .rail { position: fixed; left: 0; top: 0; bottom: 0; width: var(--rail-w); z-index: 70; transform: translateX(-100%); transition: transform 240ms var(--ease); }
  .rail.open { transform: none; box-shadow: var(--shadow-2); }
  .brand-name, .nav a span.lbl, .nav a .count, .nav-group, .rail-foot .who > div, .role-switch { display: revert; }
  .nav a .count { display: inline-block; }
  .brand { justify-content: flex-start; padding: 0 18px; }
  .nav a { justify-content: flex-start; padding: 0 10px 0 14px; }
  .rail-foot { justify-items: stretch; }
  .menu-btn { display: inline-grid; }
  .topbar { padding: 0 12px; gap: 8px; }
  .search { max-width: none; }
  .search .kbd, .timer-chip .t-task, .timer-chip .btn { display: none; }
  .timer-chip:not(.running) { display: none; }
  .timer-chip { padding: 0 10px; }
  .topbar-actions { gap: 2px; }
  .content { padding: 18px 16px 48px; gap: 18px; }
  .sticky-actions { margin: 0 -16px -48px; padding: 12px 16px; }
  h1 { font-size: 21px; }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .facts > div:nth-child(-n+3) { border-top: 1px solid var(--line); }
  .facts > div:nth-child(-n+2) { border-top: 0; }
  .facts > div:not(:nth-child(3n+1)) { border-left: 0; }
  .facts > div:nth-child(even) { border-left: 1px solid var(--line); }
  .form-grid { grid-template-columns: 1fr; }
  .grid-2.even { grid-template-columns: 1fr; }
  .page-head .actions { margin-left: 0; width: 100%; }
  .story-row { margin-left: 18px; margin-right: 12px; }
  .story-row .s-meta { margin-left: 0; width: 100%; }
  .task { grid-template-columns: 20px minmax(0, 1fr) auto auto; }
  .table-wrap > table.table:not(.stackable) { min-width: 640px; }
  table.stackable thead { display: none; }
  table.stackable, table.stackable tbody { display: block; }
  table.stackable tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
  table.stackable tr:last-child { border-bottom: 0; }
  table.stackable td { display: block; padding: 0; border: 0; }
  table.stackable td:first-child { grid-column: 1 / -1; }
  table.stackable td.hide-sm { display: none; }
  .scroll-hint { display: flex !important; }
  .board .trace { mask-image: linear-gradient(90deg, #000 82%, transparent); -webkit-mask-image: linear-gradient(90deg, #000 82%, transparent); }
  .panel-head { flex-wrap: wrap; }
  .task .hide-sm { display: none; }
  .pop { position: fixed; top: 60px; left: 8px; right: 8px; width: auto; }
  .kv { grid-template-columns: 100px 1fr; }
  .hide-sm { display: none !important; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

.skip { position: absolute; left: 12px; top: -48px; z-index: 200; padding: 8px 12px; background: var(--gold); color: #1A1404; border-radius: var(--r); font-weight: 600; }
.skip:focus { top: 12px; }

.top-avatar { display: inline-grid; margin-left: 4px; }
@media (max-width: 760px) { .top-avatar { display: none; } }

/* Label + hint on the left, a switch on the right (forms and drawers) */
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.switch-row .sr-text { display: grid; gap: 2px; }
.switch-row .sr-text b { font-weight: 600; font-size: 13.5px; }
.switch-row .sr-text span { font-size: 12.5px; color: var(--ink-3); }

/* The hidden attribute always hides, even on elements whose class sets display (update09). */
[hidden] { display: none !important; }
