:root {
  --bg: #000; --bg-raised: #080808; --surface: #111; --surface-2: #1d1d1d; --surface-hover: #262626;
  --line: #2f3336; --line-strong: #3a3f44; --text: #f7f9f9; --muted: #8b9096; --soft: #aab8c2;
  --active: #00ba7c; --active-strong: #008f65; --info: #1d9bf0; --warning: #ffd400; --danger: #f4212e;
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --radius: .75rem; --ease: cubic-bezier(.2, .8, .2, 1);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 var(--font-sans); }
a { color: var(--info); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.6rem; letter-spacing: -.01em; margin: 0 0 .25rem; line-height: 1.2; }
h2 { font-size: 1.02rem; margin: 0 0 .75rem; }
h3 { font-size: .9rem; margin: 1.25rem 0 .5rem; color: var(--soft); }
p { margin: 0 0 .75rem; }
code, pre, .mono { font-family: var(--font-mono); font-size: .85em; font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); } .small, small { font-size: .82rem; }
.ok-text { color: var(--active); } .warn-text { color: var(--warning); } .danger-text { color: var(--danger); }
.break { overflow-wrap: anywhere; } .nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0; background: var(--surface); padding: .5rem 1rem; z-index: 10; }
.skip:focus { left: 1rem; }
:focus-visible { outline: 2px solid var(--info); outline-offset: 2px; border-radius: 4px; }

.topbar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 1rem; height: 3.75rem; padding: 0 1.25rem; background: rgba(0,0,0,.92); border-bottom: 1px solid var(--line); }
@supports (backdrop-filter: blur(8px)) { .topbar { background: rgba(0,0,0,.72); backdrop-filter: blur(14px) saturate(1.4); } }
.brand { color: var(--text); font-weight: 700; letter-spacing: -.01em; white-space: nowrap; }
.brand-mark { color: var(--active); }
.top-search { flex: 1; max-width: 32rem; }
.top-search input { width: 100%; border-radius: 999px; }
.account { display: flex; align-items: center; gap: .6rem; margin-left: auto; }
.account-name { display: flex; flex-direction: column; line-height: 1.15; }
.account-name small { color: var(--muted); font-size: .72rem; }
.avatar { border-radius: 50%; }
.shell { display: grid; grid-template-columns: 13.5rem 1fr; min-height: calc(100vh - 3.75rem); }
.sidenav { border-right: 1px solid var(--line); padding: 1rem .6rem; display: flex; flex-direction: column; gap: .15rem; position: sticky; top: 3.75rem; height: calc(100vh - 3.75rem); }
.sidenav a { color: var(--soft); padding: .5rem .8rem; border-radius: 999px; font-weight: 500; transition: background .15s var(--ease), color .15s var(--ease); }
.sidenav a:hover { background: var(--surface-hover); color: var(--text); text-decoration: none; }
.sidenav a[aria-current="page"] { background: var(--surface-2); color: var(--text); box-shadow: inset 3px 0 0 var(--active); }
main { padding: 1.5rem 1.75rem 3rem; max-width: 82rem; width: 100%; min-width: 0; }
main:focus { outline: none; }

.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .72rem; color: var(--muted); margin: 0 0 .25rem; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.25rem; margin-bottom: 1rem; min-width: 0; }
.panel.highlight { border-color: var(--active-strong); }
.panel.narrow { max-width: 34rem; margin: 0 auto; }
.two-col { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: .75rem; margin-bottom: 1rem; }
.metric { display: flex; flex-direction: column; gap: .15rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .85rem 1rem; color: var(--text); transition: border-color .15s var(--ease); }
a.metric:hover { border-color: var(--line-strong); text-decoration: none; }
.metric-label { text-transform: uppercase; letter-spacing: .08em; font-size: .7rem; color: var(--muted); }
.metric-value { font-size: 1.7rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.1; }
.metric-note { font-size: .78rem; color: var(--muted); }

.notice { border-radius: .6rem; padding: .65rem .9rem; margin-bottom: 1rem; border: 1px solid var(--line); background: var(--surface); }
.notice.ok { border-color: var(--active-strong); }
.notice.warn { border-color: #8a7400; }
.field-error { color: #ff6b74; font-size: .88rem; margin: .25rem 0 .75rem; }
.empty { color: var(--muted); padding: .5rem 0; }

input, select, textarea { width: 100%; background: var(--bg-raised); color: var(--text); border: 1px solid var(--line-strong); border-radius: .55rem; padding: .5rem .7rem; font: inherit; min-height: 2.4rem; }
input:focus, select:focus, textarea:focus { border-color: var(--info); outline: none; box-shadow: 0 0 0 3px rgba(29,155,240,.25); }
input[type="checkbox"] { width: auto; min-height: 0; accent-color: var(--active); }
input[type="file"] { padding: .35rem; }
label { display: flex; flex-direction: column; gap: .3rem; font-size: .82rem; color: var(--soft); }
label.check { flex-direction: row; align-items: center; gap: .5rem; font-size: .9rem; color: var(--text); margin: .3rem 0; }
fieldset { border: 1px solid var(--line); border-radius: .6rem; padding: .5rem .9rem .7rem; margin: 0; }
legend { color: var(--soft); font-size: .82rem; padding: 0 .3rem; }
.grid-form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; align-items: end; }
.grid-form.compact { margin: .75rem 0; }
.grid-form .span-2 { grid-column: span 2; } .grid-form .span-3 { grid-column: 1 / -1; }
.form-actions { display: flex; gap: .5rem; }
.inline-form { display: flex; gap: .75rem; align-items: flex-end; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: .75rem; }
.filter-bar { display: flex; gap: .5rem; margin-bottom: 1rem; }
.button-row { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
form.inline { display: inline; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: 2.4rem; padding: .45rem 1rem; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap; transition: background .12s var(--ease), transform .08s var(--ease), border-color .12s var(--ease); }
.btn:hover { background: var(--surface-hover); text-decoration: none; }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--text); color: #000; border-color: var(--text); }
.btn.primary:hover { background: #d7dbdc; }
.btn.ghost { background: transparent; }
.btn.ok { border-color: var(--active-strong); color: var(--active); background: transparent; }
.btn.danger { border-color: #7a1a20; color: #ff6b74; background: transparent; }
.btn.small { min-height: 2rem; padding: .25rem .75rem; font-size: .82rem; }
.btn.big { min-height: 3rem; padding: .7rem 1.5rem; font-size: 1.02rem; width: 100%; margin: .5rem 0 .75rem; }
.htmx-request .btn, .btn.htmx-request { opacity: .6; cursor: progress; }

.pill { display: inline-block; font-size: .72rem; font-weight: 600; padding: .1rem .55rem; border-radius: 999px; border: 1px solid var(--line-strong); color: var(--soft); white-space: nowrap; vertical-align: middle; }
.pill.ok { color: var(--active); border-color: var(--active-strong); }
.pill.info { color: var(--info); border-color: #155f91; }
.pill.warn { color: var(--warning); border-color: #8a7400; }
.pill.danger { color: #ff6b74; border-color: #7a1a20; }
.pill.muted { color: var(--muted); }

.data { width: 100%; border-collapse: collapse; font-size: .9rem; }
.data th { text-align: left; font-weight: 600; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: .5rem .6rem; border-bottom: 1px solid var(--line); }
.data td { padding: .55rem .6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.data tbody tr:hover { background: var(--bg-raised); }
.num { text-align: right; }
.table-scroll { overflow-x: auto; }

.task-list, .plain-list, .timeline, .events, .review-list { list-style: none; margin: 0; padding: 0; }
.task-row { display: flex; gap: 1rem; justify-content: space-between; align-items: flex-start; padding: .7rem 0; border-bottom: 1px solid var(--line); }
.task-row:last-child { border-bottom: 0; }
.task-row.closed .task-title { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--line-strong); }
.task-main { min-width: 0; flex: 1; }
.task-title { font-weight: 600; margin: 0 .25rem; }
.task-meta { display: flex; flex-wrap: wrap; gap: .25rem .8rem; font-size: .8rem; margin-top: .25rem; color: var(--soft); }
.task-details { color: var(--soft); font-size: .88rem; margin: .35rem 0 0; white-space: pre-wrap; }
.task-actions { display: flex; gap: .35rem; flex-wrap: wrap; justify-content: flex-end; }
.plain-list li { padding: .5rem 0; border-bottom: 1px solid var(--line); }
.plain-list li:last-child { border-bottom: 0; }
.timeline li { border-left: 2px solid var(--line-strong); padding: .1rem 0 .8rem .9rem; margin-left: .3rem; }
.timeline p { margin: .25rem 0 0; white-space: pre-wrap; }
.events li { padding: .4rem 0; border-bottom: 1px solid var(--line); }
.facts { display: grid; grid-template-columns: 6rem 1fr; gap: .4rem .75rem; margin: 0; }
.facts dt { color: var(--muted); font-size: .82rem; } .facts dd { margin: 0; overflow-wrap: anywhere; }
.review-item { display: flex; flex-direction: column; gap: .5rem; padding: .9rem 0; border-bottom: 1px solid var(--line); }
.pair { font-size: 1rem; display: flex; gap: .5rem; flex-wrap: wrap; align-items: baseline; }
.segmented { display: inline-flex; gap: .2rem; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: .2rem; margin-bottom: 1rem; }
.segmented a { padding: .35rem .9rem; border-radius: 999px; color: var(--soft); font-size: .88rem; }
.segmented a[aria-current="page"] { background: var(--surface-2); color: var(--text); }
.segmented a:hover { text-decoration: none; color: var(--text); }
.copyable { cursor: copy; background: var(--bg-raised); border: 1px solid var(--line); padding: .3rem .5rem; border-radius: .4rem; display: inline-block; }
.copyable[data-copied]::after { content: "  copied"; color: var(--active); font-family: var(--font-sans); }
pre.code { background: var(--bg-raised); border: 1px solid var(--line); border-radius: .5rem; padding: .7rem; overflow-x: auto; white-space: pre-wrap; overflow-wrap: anywhere; }

.center-page { min-height: 100vh; display: grid; place-items: center; padding: 1rem; }
.landing .panel { padding: 2rem; }
.landing h1 { font-size: 2rem; }
.lede { color: var(--soft); font-size: 1.05rem; }
details.mock { margin-top: 1rem; border-top: 1px solid var(--line); padding-top: .75rem; }
details.mock summary { cursor: pointer; color: var(--muted); font-size: .85rem; }

@media (max-width: 900px) {
  .two-col { grid-template-columns: 1fr; }
  .grid-form { grid-template-columns: 1fr 1fr; }
  .grid-form .span-2 { grid-column: 1 / -1; }
}
@media (max-width: 680px) {
  .topbar { padding: 0 1rem; gap: .6rem; }
  .top-search, .account-name { display: none; }
  .shell { grid-template-columns: 1fr; }
  .sidenav { position: static; height: auto; flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: .5rem 1rem; }
  .sidenav a { white-space: nowrap; }
  .sidenav a[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--active); }
  main { padding: 1rem 1rem 2.5rem; }
  .grid-form { grid-template-columns: 1fr; }
  .task-row { flex-direction: column; gap: .5rem; }
  .task-actions { justify-content: flex-start; }
  .data th:nth-child(3), .data td:nth-child(3) { display: none; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } .btn:active { transform: none; } }
@media (prefers-contrast: more) { :root { --line: #5b6268; --line-strong: #7b838a; --muted: #b9c0c6; } }
