@font-face { font-family: 'Instrument Sans'; font-weight: 400; font-display: swap; src: url(fonts/instrument-400.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212, U+FEFF, U+FFFD; }
@font-face { font-family: 'Instrument Sans'; font-weight: 400; font-display: swap; src: url(fonts/instrument-400-ext.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+20A0-20AB, U+20AD-20C0, U+A720-A7FF; }
@font-face { font-family: 'Instrument Sans'; font-weight: 600; font-display: swap; src: url(fonts/instrument-600.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212, U+FEFF, U+FFFD; }
@font-face { font-family: 'Instrument Sans'; font-weight: 600; font-display: swap; src: url(fonts/instrument-600-ext.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+20A0-20AB, U+20AD-20C0, U+A720-A7FF; }

:root {
  --bg: #0f1013;
  --panel: #16181c;
  --raised: #1d2025;
  --line: #262a31;
  --text: #eceef2;
  --muted: #a3a8b3;
  --accent: #3a78f2;
  --accent-fill: #0550e0;
  --success: #3fcf8e;
  --danger: #f2555a;
  --warning: #f2b84b;
  --radius: 9px;
  --font: 'Instrument Sans', 'Segoe UI', system-ui, sans-serif;
  --mono: ui-monospace, 'Cascadia Code', Consolas, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); font: 400 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
img { display: block; }
a { color: var(--accent); }
code { font-family: var(--mono); font-size: 0.86em; background: var(--raised); padding: 1px 5px; border-radius: 5px; }
h1 { font-size: 28px; line-height: 1.15; font-weight: 600; margin: 0 0 8px; letter-spacing: -0.01em; }
h2 { font-size: 17px; font-weight: 600; margin: 32px 0 12px; }
p { margin: 0; }
[hidden] { display: none !important; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.skip { position: absolute; left: 16px; top: -48px; background: var(--accent-fill); color: #fff; padding: 8px 12px; border-radius: var(--radius); z-index: 10; }
.skip:focus { top: 12px; }

.bar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 24px; padding: 12px 24px; background: rgb(15 16 19 / 0.94); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 600; }
.brand img { color: var(--text); filter: invert(1) brightness(1.8); }
.brand span { color: var(--muted); font-weight: 400; }
.back { color: var(--muted); text-decoration: none; font-size: 14px; }
.back:hover { color: var(--text); }
.tabs { display: flex; gap: 4px; flex: 1; overflow-x: auto; }
.tabs a { color: var(--muted); text-decoration: none; padding: 6px 12px; border-radius: 7px; white-space: nowrap; }
.tabs a:hover { color: var(--text); background: var(--panel); }
.tabs a[aria-current='page'] { color: var(--text); background: var(--raised); }
.who { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; }
.who img { width: 26px; height: 26px; border-radius: 50%; }

main { max-width: 1180px; margin: 0 auto; padding: 40px 24px 80px; outline: none; }
.lead { max-width: 64ch; margin-bottom: 28px; }
.lead p { color: var(--muted); }

.filters, .inline { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; margin-bottom: 16px; }
.field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); min-width: 150px; }
.field.grow { flex: 1 1 240px; }
input, select, textarea { font: inherit; color: var(--text); background: var(--panel); border: 1px solid var(--line); border-radius: 7px; height: 36px; padding: 0 10px; }
textarea { height: auto; padding: 8px 10px; resize: vertical; }
input:hover, select:hover, textarea:hover { border-color: #343943; }
.toggle { display: flex; align-items: center; gap: 8px; height: 36px; font-size: 14px; cursor: pointer; }
.toggle input { width: 16px; height: 16px; accent-color: var(--accent-fill); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; text-decoration: none; white-space: nowrap; font: 600 14px var(--font); height: 34px; padding: 0 14px; border-radius: 7px; border: 1px solid var(--line); background: var(--raised); color: var(--text); cursor: pointer; }
.btn:hover { border-color: #3a3f49; }
.btn.primary { background: var(--accent-fill); border-color: var(--accent-fill); color: #fff; }
.btn.primary:hover { background: #1460f0; }
.btn.danger { color: var(--danger); }
.btn.small { height: 28px; padding: 0 10px; font-size: 13px; }
.btn[aria-pressed='true'] { color: var(--accent); border-color: rgb(58 120 242 / 0.5); }
.btn:disabled { opacity: 0.5; cursor: default; }

.count { color: var(--muted); font-size: 13px; margin-bottom: 12px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.card { display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.card .spec { height: 116px; position: relative; background: var(--raised); }
.card .body { padding: 14px 14px 12px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card h3 { margin: 0; font-size: 16px; font-weight: 600; line-height: 1.3; }
.card .desc { color: var(--muted); font-size: 13.5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card .meta { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 12.5px; color: var(--muted); margin-top: auto; padding-top: 6px; }
.card .actions { display: flex; gap: 6px; padding: 0 14px 14px; }
.badge { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 5px; font-size: 12px; background: var(--raised); color: var(--muted); }
.badge.official { background: rgb(5 80 224 / 0.18); color: #8db1ff; }
.badge.warn { background: rgb(242 184 75 / 0.14); color: var(--warning); }

.spec-theme { position: absolute; inset: 14px 18px 0; border-radius: 8px 8px 0 0; display: grid; grid-template-columns: 30% 1fr; overflow: hidden; box-shadow: 0 0 0 1px rgb(255 255 255 / 0.06); }
.spec-theme .side { padding: 10px 8px; display: flex; flex-direction: column; gap: 5px; }
.spec-theme .side i { height: 6px; border-radius: 3px; opacity: 0.5; }
.spec-theme .main { padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.spec-theme .main b { height: 18px; border-radius: 4px; }
.spec-theme .main em { width: 46%; height: 16px; border-radius: 4px; }
.spec-theme .dots { display: flex; gap: 4px; }
.spec-theme .dots span { width: 8px; height: 8px; border-radius: 50%; }

.spec-job { position: absolute; inset: 0; display: flex; align-items: end; gap: 4px; padding: 16px 18px; }
.spec-job .spine { position: absolute; left: 0; top: 0; bottom: 0; width: 4px; }
.spec-job .step { flex: 1; border-radius: 3px 3px 0 0; opacity: 0.85; }
.spec-job .tag { position: absolute; right: 14px; top: 12px; font: 600 13px var(--font); }

.spec-route { position: absolute; inset: 0; }
.spec-route svg { width: 100%; height: 100%; }

.spec-stages { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 0 16px; }
.spec-stages span { padding: 6px 10px; border-radius: 7px; background: var(--panel); border: 1px solid var(--line); font-size: 13px; }
.spec-number { position: absolute; left: 18px; bottom: 12px; font-size: 40px; font-weight: 600; letter-spacing: -0.02em; line-height: 1; }
.spec-number small { font-size: 13px; font-weight: 400; color: var(--muted); margin-left: 6px; letter-spacing: 0; }

.pager { display: flex; justify-content: center; gap: 6px; margin-top: 24px; }
.empty { grid-column: 1 / -1; padding: 48px 0; color: var(--muted); text-align: center; }

.rows { list-style: none; padding: 0; margin: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.rows:empty { display: none; }
.rows li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 12px 14px; background: var(--panel); }
.rows li + li { border-top: 1px solid var(--line); }
.rows .main { flex: 1 1 260px; min-width: 0; }
.rows .main strong { display: block; font-weight: 600; overflow-wrap: anywhere; }
.rows .sub { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.rows.compact li { padding: 8px 14px; font-size: 13px; }
.note { color: var(--muted); font-size: 13px; margin-bottom: 12px; }
.note:empty { display: none; }

dialog { padding: 0; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); color: var(--text); width: min(520px, calc(100vw - 32px)); box-shadow: 0 24px 70px rgb(0 0 0 / 0.5); }
dialog::backdrop { background: rgb(0 0 0 / 0.55); }
dialog[open] { animation: rise 160ms cubic-bezier(0.22, 1, 0.36, 1); }
.sheet header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.sheet header h2 { margin: 0; font-size: 16px; }
.sheet-body { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.sheet footer { display: flex; justify-content: flex-end; gap: 8px; padding: 0 16px 16px; }
.x { width: 30px; height: 30px; border-radius: 7px; border: 0; background: transparent; color: var(--muted); font-size: 15px; cursor: pointer; }
.x:hover { background: var(--raised); color: var(--text); }
.secret { font-family: var(--mono); font-size: 13px; background: var(--bg); border: 1px solid var(--line); border-radius: 7px; padding: 10px; overflow-wrap: anywhere; user-select: all; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 16px); opacity: 0; pointer-events: none; background: var(--raised); border: 1px solid var(--line); border-radius: 9px; padding: 10px 14px; font-size: 14px; transition: opacity 160ms, transform 160ms; max-width: calc(100vw - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { color: var(--danger); }

@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

@media (max-width: 720px) {
  .bar { flex-wrap: wrap; gap: 10px 16px; padding: 10px 16px; }
  .tabs { order: 3; flex-basis: 100%; }
  main { padding: 28px 16px 64px; }
  h1 { font-size: 24px; }
  .field { min-width: 0; flex: 1 1 140px; }
}

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