:root {
  color-scheme: light dark;
  --bg: #F6F7F9;
  --surface: #FFFFFF;
  --border: #D9DDE3;
  --fg: #16191D;
  --muted: #5B636E;
  --accent: #2F5BD3;
  --warn: #9A4F00;
  --danger: #B42318;
  font: 14px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif;
  font-variant-numeric: tabular-nums;
  color: var(--fg);
  background: var(--bg);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111418;
    --surface: #171B21;
    --border: #2A313A;
    --fg: #E6E9ED;
    --muted: #9AA4B1;
    --accent: #7EA2FF;
    --warn: #F0A54A;
    --danger: #F97066;
  }
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input { font: inherit; font-variant-numeric: tabular-nums; }
button, input, .card, .note, .badge, dialog { border: 1px solid var(--border); border-radius: 6px; }
button { padding: 7px 12px; color: var(--fg); background: var(--surface); cursor: pointer; }
button:disabled { opacity: .5; cursor: not-allowed; }
input { min-width: 0; padding: 7px 10px; color: var(--fg); background: var(--surface); }
input[type="text"] { width: min(100%, 420px); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
a { color: var(--accent); }
.primary { background: var(--accent); color: var(--surface); border-color: var(--accent); }
.danger { background: var(--danger); color: var(--surface); border-color: var(--danger); }
.warn { color: var(--warn); }
.muted, small { color: var(--muted); }
.mono, code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; overflow-wrap: anywhere; }
.layout { display: grid; grid-template-columns: 224px minmax(0, 1fr); min-height: 100vh; }
.sidebar { background: var(--surface); border-right: 1px solid var(--border); padding: 24px 16px; }
.wordmark { font-size: 20px; font-weight: 650; margin-bottom: 12px; }
.badge { display: inline-block; color: var(--muted); padding: 3px 6px; font-size: 12px; }
nav h2 { font-size: 12px; color: var(--muted); margin: 24px 8px 6px; }
nav a, nav .planned { display: block; padding: 7px 8px; text-decoration: none; border-radius: 6px; }
nav a { color: var(--fg); }
nav a[aria-current="page"] { color: var(--accent); font-weight: 650; outline: 1px solid var(--border); }
.planned { color: var(--muted); }
.task-tag { display: block; font-size: 11px; }
.workspace { min-width: 0; }
.topbar { border-bottom: 1px solid var(--border); background: var(--surface); padding: 16px 24px; display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; }
h1 { font-size: 20px; margin: 0 auto 0 0; }
h2 { font-size: 17px; }
h3 { font-size: 15px; }
main { max-width: 1200px; padding: 24px; }
.card, .note { background: var(--surface); padding: 16px; margin-bottom: 20px; }
.note { color: var(--muted); }
.note p:first-child { margin-top: 0; }
.note p:last-child { margin-bottom: 0; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.stat-title { font-size: 14px; color: var(--muted); margin: 0 0 8px; }
.stat-value { font-size: 17px; margin: 0 0 8px; }
.table-wrap { overflow-x: auto; margin-bottom: 20px; }
table { border-collapse: collapse; width: 100%; background: var(--surface); }
th, td { text-align: left; padding: 10px 12px; border: 1px solid var(--border); vertical-align: top; }
th { font-weight: 600; }
.actions, .lookup { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 16px 0; }
.lookup label { flex-basis: 100%; }
.error { border: 1px solid var(--border); border-radius: 6px; padding: 12px; margin: 12px 0; }
.bar { display: inline-block; width: var(--w); max-width: 180px; height: 8px; margin-left: 12px; background: var(--border); }
dialog { background: var(--surface); color: var(--fg); padding: 24px; width: min(600px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow-y: auto; }
dialog::backdrop { background: rgb(0 0 0 / .5); }
dialog input { display: block; margin-top: 10px; width: 100%; }
pre { white-space: pre-wrap; border: 1px solid var(--border); border-radius: 6px; padding: 12px; }
.signin { max-width: 520px; margin: 15vh auto; padding: 24px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (max-width: 1000px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { border-right: 0; border-bottom: 1px solid var(--border); }
  nav { display: flex; flex-wrap: wrap; gap: 10px; }
  nav h2 { margin-top: 12px; }
  .stats { grid-template-columns: 1fr; }
  main, .topbar { padding: 16px; }
}
.freeze-targets td { vertical-align: middle; }
