:root {
  /* Layout: one 720px column. Header, section switch, then the active view. Confirmations read like a bakery take-a-number stub. */
  --paper: #F2F3EF;
  --card: #FFFFFF;
  --ink: #241B27;
  --muted: #675F6B;
  --line: #D9D5DB;
  --accent: #B82852;
  --accent-ink: #FFFFFF;
  --accent-soft: #F8E3EA;
  --st-new: #2F5FB3; --st-new-bg: #E3EBF8;
  --st-prog: #8A5700; --st-prog-bg: #FBEFD6;
  --st-done: #2B7347; --st-done-bg: #DFF1E5;
  --danger: #B3261E;
  --font-display: "Bricolage Grotesque", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --font-body: "Figtree", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --radius: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #151217; --card: #1F1A22; --ink: #F0EBF2; --muted: #A69DAB; --line: #3A333F;
    --accent: #F2638C; --accent-ink: #1A0E14; --accent-soft: #3A1D28;
    --st-new: #8DB0F0; --st-new-bg: #1C2A44;
    --st-prog: #F0C266; --st-prog-bg: #3A2D12;
    --st-done: #84D3A0; --st-done-bg: #173323;
    --danger: #FF8A80;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--paper);
  color: var(--ink);
  font: 400 16px/1.5 var(--font-body);
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
a { color: var(--accent); text-underline-offset: 3px; }
.wrap { max-width: 720px; margin: 0 auto; padding: 28px 16px 64px; display: grid; gap: 22px; }

header.site { display: grid; gap: 8px; }
.brand { display: flex; align-items: center; gap: 10px; }
.mark {
  width: 34px; height: 34px; border-radius: 10px; background: var(--accent); color: var(--accent-ink);
  display: grid; place-items: center; font: 800 18px/1 var(--font-display);
}
.kicker { font: 600 13px/1 var(--font-body); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
h1 { font: 800 clamp(30px, 7vw, 44px)/1.04 var(--font-display); letter-spacing: -0.02em; margin: 0; text-wrap: balance; }
h2 { font: 700 22px/1.2 var(--font-display); margin: 0; text-wrap: balance; }
h3 { font: 700 17px/1.25 var(--font-display); margin: 0; }
.lede { color: var(--muted); margin: 0; max-width: 60ch; }
.muted { color: var(--muted); margin: 0; }

.tabs {
  display: flex; gap: 4px; padding: 4px; background: var(--card); border: 1px solid var(--line);
  border-radius: 999px; width: max-content; max-width: 100%; overflow-x: auto;
}
.tab {
  appearance: none; border: 0; background: transparent; color: var(--muted);
  font: 600 15px/1 var(--font-body); padding: 11px 16px; border-radius: 999px; cursor: pointer;
  white-space: nowrap; display: inline-flex; align-items: center; gap: 8px;
}
.tab:hover { color: var(--ink); }
.tab[aria-current="page"] { background: var(--ink); color: var(--paper); }
@media (max-width: 480px) {
  .tabs { width: 100%; }
  .tab { flex: 1 1 auto; justify-content: center; padding: 10px 8px; font-size: 14px; gap: 6px; }
}
.count {
  font: 700 12px/1 var(--font-body); font-variant-numeric: tabular-nums;
  background: var(--accent); color: var(--accent-ink); border-radius: 999px; padding: 4px 7px;
}

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; display: grid; gap: 20px; }
.card.narrow { max-width: 460px; }
@media (max-width: 420px) { .card { padding: 18px; } }

form { display: grid; gap: 18px; }
.field { display: grid; gap: 6px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 560px) { .row { grid-template-columns: 1fr; } }
label { font-weight: 600; font-size: 15px; }
.opt { font-weight: 400; color: var(--muted); }
input, select, textarea {
  font: inherit; color: var(--ink); background: var(--paper); border: 1px solid var(--line);
  border-radius: 10px; padding: 11px 12px; width: 100%; min-width: 0;
}
textarea { min-height: 140px; resize: vertical; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .8; }
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent);
}
button:focus-visible, summary:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[aria-invalid="true"] { border-color: var(--danger); }
.err { color: var(--danger); font-size: 14px; margin: 0; }
fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: 18px; min-width: 0; }
legend { font: 700 17px/1.2 var(--font-display); padding: 0; margin-bottom: 14px; }
.divider { border: 0; border-top: 1px solid var(--line); margin: 2px 0; width: 100%; }
.mono-input { font-family: var(--font-mono); text-transform: uppercase; letter-spacing: .04em; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.btn {
  appearance: none; border: 1px solid transparent; background: var(--accent); color: var(--accent-ink);
  font: 700 16px/1 var(--font-body); padding: 14px 22px; border-radius: 999px; cursor: pointer;
  text-decoration: none; display: inline-flex; align-items: center; justify-content: center;
}
.btn:hover { filter: brightness(1.06); }
.btn:disabled { opacity: .6; cursor: progress; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.danger { background: transparent; color: var(--danger); border-color: color-mix(in srgb, var(--danger) 45%, transparent); }
.btn.small { font-size: 15px; padding: 11px 18px; }
.status { margin: 0; font-size: 15px; }
.status.bad { color: var(--danger); }
.status.good { color: var(--st-done); }

.notice {
  border: 1px solid var(--line); border-left: 4px solid var(--st-prog); background: var(--st-prog-bg);
  padding: 12px 14px; border-radius: 10px; font-size: 15px; margin: 0;
}

#result { display: grid; gap: 16px; outline: none; }
.stub { background: var(--accent); color: var(--accent-ink); border-radius: 14px; max-width: 380px; overflow: hidden; }
.stub-top { padding: 18px 22px 16px; display: grid; gap: 4px; }
.stub-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; opacity: .85; }
.stub-num { font: 700 clamp(28px, 8vw, 38px)/1.1 var(--font-mono); letter-spacing: .04em; font-variant-numeric: tabular-nums; }
.stub-bottom {
  position: relative; padding: 14px 22px 16px; font-size: 14px;
  border-top: 2px dashed color-mix(in srgb, var(--accent-ink) 40%, transparent);
}
.stub-bottom::before, .stub-bottom::after {
  content: ""; position: absolute; top: -12px; width: 22px; height: 22px; border-radius: 50%; background: var(--card);
}
.stub-bottom::before { left: -11px; }
.stub-bottom::after { right: -11px; }

.section-head { display: grid; gap: 4px; }
.list { display: grid; gap: 10px; }
.empty { color: var(--muted); margin: 0; padding: 8px 0; }
.empty-box { display: grid; gap: 14px; justify-items: start; padding: 20px; border: 1px dashed var(--line); border-radius: 12px; }

.tk {
  --stripe: var(--st-new);
  background: var(--card); border: 1px solid var(--line); border-left: 5px solid var(--stripe); border-radius: 12px;
}
.tk[data-status="progress"] { --stripe: var(--st-prog); }
.tk[data-status="resolved"] { --stripe: var(--st-done); }
.tk[data-status="unknown"] { --stripe: var(--line); }
.tk > summary, .tk-head { list-style: none; padding: 14px 16px; display: grid; gap: 5px; }
.tk > summary { cursor: pointer; }
.tk > summary::-webkit-details-marker { display: none; }
.tk > summary:hover .tk-subj { text-decoration: underline; text-underline-offset: 3px; }
.tk-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.tid { font: 700 14px/1 var(--font-mono); letter-spacing: .03em; font-variant-numeric: tabular-nums; }
.pill { font: 700 12px/1 var(--font-body); padding: 5px 9px; border-radius: 999px; }
.pill.new { color: var(--st-new); background: var(--st-new-bg); }
.pill.progress { color: var(--st-prog); background: var(--st-prog-bg); }
.pill.resolved { color: var(--st-done); background: var(--st-done-bg); }
.due { font: 700 12px/1 var(--font-body); color: var(--danger); border: 1px solid currentColor; padding: 4px 8px; border-radius: 999px; }
.chev { margin-left: auto; color: var(--muted); font-size: 14px; }
.tk[open] .chev { transform: rotate(180deg); }
.tk-subj { font-weight: 600; font-size: 17px; overflow-wrap: anywhere; }
.tk-meta { color: var(--muted); font-size: 14px; }
.tk-body { padding: 14px 16px 18px; display: grid; gap: 16px; border-top: 1px solid var(--line); }
.details-text { white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; max-width: 65ch; }
dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; font-size: 15px; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; overflow-wrap: anywhere; }
.staff-form { display: grid; gap: 14px; padding: 16px; background: var(--paper); border-radius: 10px; }
.staff-form select, .staff-form textarea { background: var(--card); }
.staff-form textarea { min-height: 90px; }
.save-msg { font-size: 14px; color: var(--muted); }
.reply { margin: 0 16px 16px; background: var(--accent-soft); border-radius: 10px; padding: 12px 14px; display: grid; gap: 4px; }
.reply-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.reply-text { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }

.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 4px; }
.chip {
  appearance: none; border: 1px solid var(--line); background: var(--card); color: var(--ink);
  font: 600 14px/1 var(--font-body); padding: 9px 12px; border-radius: 999px; cursor: pointer;
  display: inline-flex; gap: 8px; align-items: center;
}
.chip .n { font-variant-numeric: tabular-nums; color: var(--muted); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.chip[aria-pressed="true"] .n { color: inherit; opacity: .75; }
.staff-wrap { display: grid; gap: 12px; }
.inbox-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
