/* PinForge — dashboard styles */
@font-face {
  font-family: "Bricolage Grotesque";
  src: url("/static/fonts/bricolage-grotesque-latin-wght-normal.woff2") format("woff2");
  font-weight: 200 800; font-display: swap;
}
@font-face {
  font-family: "Instrument Sans";
  src: url("/static/fonts/instrument-sans-latin-wght-normal.woff2") format("woff2");
  font-weight: 400 700; font-display: swap;
}

:root {
  --fog: #EEF1F4;
  --paper: #FFFFFF;
  --well: #F6F8FA;
  --ink: #172033;
  --pewter: #5B6577;
  --faint: #8A93A3;
  --line: #DCE1E8;
  --line-soft: #E8ECF1;
  --cobalt: #2E4BF0;
  --cobalt-ink: #1F37C4;
  --cobalt-wash: #E8ECFE;
  --brass: #C4962C;
  --brass-wash: #F7EFDC;
  --ok: #1D8A5B; --ok-wash: #E2F3EA;
  --warn: #A9690F; --warn-wash: #FBEFD9;
  --bad: #C93C3C; --bad-wash: #FBE6E4;
  --shadow: 0 1px 2px rgba(23, 32, 51, .06), 0 8px 24px -12px rgba(23, 32, 51, .18);
  --display: "Bricolage Grotesque", "Instrument Sans", ui-sans-serif, system-ui, sans-serif;
  --text: "Instrument Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --r-lg: 16px; --r-md: 10px; --r-sm: 7px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --fog: #0E1320; --paper: #151B29; --well: #1A2132; --ink: #E6EAF2; --pewter: #A3ACBD; --faint: #7C869A;
  --line: #273046; --line-soft: #202839; --cobalt: #7086FF; --cobalt-ink: #93A3FF; --cobalt-wash: #1D2648;
  --brass: #D9AE4B; --brass-wash: #2E2716; --ok: #44C08A; --ok-wash: #14291F; --warn: #E0A54A; --warn-wash: #2D2313;
  --bad: #F07A72; --bad-wash: #34191A; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 28px -14px rgba(0,0,0,.6);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--fog); color: var(--ink); font: 400 14.5px/1.5 var(--text);
  font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased;
}
a { color: var(--cobalt); text-decoration: none; }
a:hover { color: var(--cobalt-ink); text-decoration: underline; text-underline-offset: 2px; }
:focus-visible { outline: 2.5px solid var(--cobalt); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
img.img-broken { visibility: hidden; }
code, .code { font: 500 12.5px/1.6 ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }
.rail {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 22px;
  padding: 22px 14px 16px; background: var(--paper); border-right: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px; color: var(--ink); }
.brand:hover { text-decoration: none; color: var(--ink); }
.brand img { width: 30px; height: 30px; }
.brand-name { font: 700 19px/1 var(--display); letter-spacing: -.02em; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: var(--r-md);
  color: var(--pewter); font-weight: 550;
}
.nav a:hover { background: var(--well); color: var(--ink); text-decoration: none; }
.nav a[aria-current="page"] { background: var(--cobalt-wash); color: var(--cobalt-ink); }
.nav svg { width: 18px; height: 18px; flex: none; }
.nav .count { margin-left: auto; font-size: 12px; font-weight: 600; color: var(--cobalt-ink); }
.rail-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.health-mini {
  display: flex; align-items: center; gap: 9px; padding: 10px; border-radius: var(--r-md);
  background: var(--well); color: var(--ink); font-size: 13px; line-height: 1.3;
}
.health-mini:hover { text-decoration: none; color: var(--ink); }
.health-mini small { display: block; color: var(--pewter); font-size: 12px; }
.me { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 0 4px 0 10px; font-size: 13px; color: var(--pewter); }
.me-actions { display: flex; gap: 2px; }

.main { min-width: 0; padding: 34px clamp(20px, 4vw, 48px) 64px; }
.page { max-width: 1240px; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 26px; flex-wrap: wrap; }
.page-head h1 { margin: 0; font: 650 32px/1.1 var(--display); letter-spacing: -.025em; }
.page-head p { margin: 8px 0 0; color: var(--pewter); max-width: 62ch; }
.crumb { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 10px; font-weight: 550; color: var(--pewter); }
h2.section { margin: 34px 0 12px; font: 650 19px/1.2 var(--display); letter-spacing: -.015em; display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
h2.section a, h2.section span { font: 500 13.5px var(--text); letter-spacing: 0; }

/* ---------- surfaces ---------- */
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg); }
.panel-pad { padding: 20px 22px; }
.muted { color: var(--pewter); }
.faint { color: var(--faint); }
.small { font-size: 13px; }

/* ---------- buttons & inputs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 15px;
  border-radius: var(--r-md); border: 1px solid var(--line); background: var(--paper); color: var(--ink);
  font: 600 14px var(--text); cursor: pointer; white-space: nowrap; transition: background .12s, border-color .12s;
}
.btn:hover { background: var(--well); border-color: #C8CFDA; text-decoration: none; color: var(--ink); }
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--cobalt); border-color: var(--cobalt); color: #fff; }
.btn-primary:hover { background: var(--cobalt-ink); border-color: var(--cobalt-ink); color: #fff; }
.btn-danger { color: var(--bad); }
.btn-danger:hover { background: var(--bad-wash); border-color: var(--bad); color: var(--bad); }
.btn-ghost { border-color: transparent; background: transparent; color: var(--pewter); }
.btn-ghost:hover { background: var(--well); border-color: transparent; color: var(--ink); }
.btn-sm { height: 32px; padding: 0 11px; font-size: 13px; border-radius: var(--r-sm); }
.btn-icon { width: 34px; padding: 0; }
.btn-lg { height: 46px; padding: 0 22px; font-size: 15px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn-group { display: flex; gap: 8px; flex-wrap: wrap; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label, .label { font-weight: 600; font-size: 13.5px; }
.field .help { color: var(--pewter); font-size: 12.5px; }
.input, .textarea, .select {
  width: 100%; border: 1px solid var(--line); background: var(--paper); color: var(--ink);
  border-radius: var(--r-md); font: 400 14.5px var(--text); padding: 9px 12px; transition: border-color .12s, box-shadow .12s;
}
.input:focus, .textarea:focus, .select:focus { outline: none; border-color: var(--cobalt); box-shadow: 0 0 0 3px var(--cobalt-wash); }
.textarea { resize: vertical; line-height: 1.65; }
.input-num { width: 120px; }
.search { position: relative; }
.search svg { position: absolute; left: 11px; top: 50%; translate: 0 -50%; width: 16px; height: 16px; color: var(--faint); }
.search .input { padding-left: 34px; height: 38px; }

.switch { display: inline-flex; align-items: flex-start; gap: 12px; cursor: pointer; }
.switch input { appearance: none; flex: none; width: 38px; height: 22px; margin: 1px 0 0; border-radius: 99px; background: var(--line); position: relative; cursor: pointer; transition: background .15s; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: left .15s; }
.switch input:checked { background: var(--cobalt); }
.switch input:checked::after { left: 19px; }

.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip-btn {
  height: 32px; padding: 0 12px; border-radius: 99px; border: 1px solid var(--line); background: var(--paper);
  color: var(--ink); font: 600 13px var(--text); cursor: pointer;
}
.chip-btn:hover { border-color: var(--cobalt); }
.chip-btn[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }

/* ---------- status ---------- */
.status { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; font-size: 13px; white-space: nowrap; }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.st-queued { color: var(--pewter); }
.st-running, .st-aborting { color: var(--cobalt); }
.st-running::before { animation: pulse 1.6s ease-in-out infinite; }
.st-succeeded { color: var(--ok); }
.st-failed { color: var(--bad); }
.st-aborted { color: var(--warn); }
@keyframes pulse { 50% { opacity: .35; } }
.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--faint); }
.dot.healthy { background: var(--ok); box-shadow: 0 0 0 4px var(--ok-wash); }
.dot.cooling { background: var(--warn); box-shadow: 0 0 0 4px var(--warn-wash); }
.dot.flagged { background: var(--bad); box-shadow: 0 0 0 4px var(--bad-wash); }
.dot.unknown { background: var(--faint); box-shadow: 0 0 0 4px var(--line-soft); }
.tag { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 12px; font-weight: 600; background: var(--well); color: var(--pewter); }
.tag-brass { background: var(--brass-wash); color: var(--brass); }
.tag-bad { background: var(--bad-wash); color: var(--bad); }

.notice { display: flex; gap: 12px; align-items: flex-start; padding: 13px 16px; border-radius: var(--r-md); background: var(--warn-wash); color: var(--ink); border: 1px solid color-mix(in srgb, var(--warn) 30%, transparent); }
.notice.bad { background: var(--bad-wash); border-color: color-mix(in srgb, var(--bad) 30%, transparent); }
.notice.info { background: var(--cobalt-wash); border-color: color-mix(in srgb, var(--cobalt) 25%, transparent); }
.notice svg { width: 18px; height: 18px; flex: none; margin-top: 2px; }

/* ---------- swatch strip: the signature element ---------- */
.swatch { display: flex; height: 10px; border-radius: 3px; overflow: hidden; background: var(--line-soft); min-width: 60px; }
.swatch i { flex: 1 1 0; }
.swatch.tall { height: 14px; border-radius: 4px; }
.swatch.empty { background: repeating-linear-gradient(-45deg, var(--line-soft) 0 5px, transparent 5px 10px); }

/* ---------- overview ---------- */
.instrument { display: grid; grid-template-columns: 1.15fr 1fr 1fr; }
.instrument > section { padding: 22px 24px; min-width: 0; }
.instrument > section + section { border-left: 1px solid var(--line); }
.inst-title { font-weight: 600; color: var(--pewter); font-size: 13.5px; margin: 0 0 12px; }
.health-state { display: flex; align-items: center; gap: 12px; font: 650 22px/1.15 var(--display); letter-spacing: -.015em; }
.health-detail { margin: 8px 0 14px; color: var(--pewter); font-size: 13.5px; }
.meter { margin-top: 12px; }
.meter-top { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 6px; }
.meter-top b { font-weight: 650; }
.bar { height: 8px; border-radius: 99px; background: var(--line-soft); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 99px; background: var(--cobalt); width: 0; transition: width .4s ease; }
.bar.warn i { background: var(--warn); }
.bar.bad i { background: var(--bad); }
.spark { display: flex; align-items: flex-end; gap: 3px; height: 54px; margin-top: 16px; }
.spark i { flex: 1; min-height: 2px; border-radius: 2px 2px 0 0; background: color-mix(in srgb, var(--cobalt) 45%, var(--line)); }
.spark i.now { background: var(--cobalt); }
.spark-axis { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--faint); margin-top: 5px; }
.figures { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 16px; }
.figure b { display: block; font: 650 28px/1.05 var(--display); letter-spacing: -.02em; }
.figure span { color: var(--pewter); font-size: 13px; }

/* ---------- ledger (runs list) ---------- */
.ledger { list-style: none; margin: 0; padding: 0; }
.ledger > li + li { border-top: 1px solid var(--line-soft); }
.run-row {
  display: grid; grid-template-columns: 116px minmax(0, 1fr) 190px 150px 110px; align-items: center; gap: 18px;
  padding: 15px 22px; color: var(--ink);
}
.run-row:hover { background: var(--well); text-decoration: none; color: var(--ink); }
.ledger > li:first-child .run-row { border-radius: var(--r-lg) var(--r-lg) 0 0; }
.ledger > li:last-child .run-row { border-radius: 0 0 var(--r-lg) var(--r-lg); }
.run-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.run-sub { color: var(--pewter); font-size: 12.5px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.run-nums { font-size: 13px; color: var(--pewter); text-align: right; }
.run-nums b { color: var(--ink); font-weight: 650; }
.run-when { font-size: 13px; color: var(--pewter); text-align: right; }
.run-row .bar { height: 5px; margin-top: 7px; }
.empty-state { padding: 48px 24px; text-align: center; }
.empty-state h3 { margin: 0 0 6px; font: 650 18px var(--display); }
.empty-state p { margin: 0 auto 18px; color: var(--pewter); max-width: 46ch; }

.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .search { flex: 1 1 240px; max-width: 340px; }
.toolbar > .input { flex: 1 1 200px; width: auto; height: 38px; }
.toolbar .select { width: auto; max-width: 320px; height: 38px; padding: 0 10px; }
.panel-pad > h2.section:first-child { margin-top: 0; }
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: var(--r-md); background: var(--paper); border: 1px solid var(--line); }
.seg button { height: 30px; padding: 0 12px; border: 0; border-radius: var(--r-sm); background: transparent; color: var(--pewter); font: 600 13px var(--text); cursor: pointer; }
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.pager { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; color: var(--pewter); font-size: 13px; }

/* ---------- new run ---------- */
.compose { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 22px; align-items: start; }
.kw-box { padding: 0; overflow: hidden; }
.kw-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line-soft); }
.kw-box .textarea { border: 0; border-radius: 0; min-height: 440px; padding: 16px 18px; box-shadow: none; background: transparent; }
.kw-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 11px 18px; border-top: 1px solid var(--line-soft); background: var(--well); color: var(--pewter); font-size: 13px; }
.kw-box.drag { outline: 2.5px dashed var(--cobalt); outline-offset: -8px; }
.side-stack { display: flex; flex-direction: column; gap: 18px; position: sticky; top: 24px; }
.side-stack .panel-pad { display: flex; flex-direction: column; gap: 18px; }
.estimate { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 14px 16px; border-radius: var(--r-md); background: var(--well); }
.estimate b { display: block; font: 650 20px/1.1 var(--display); }
.estimate span { color: var(--pewter); font-size: 12.5px; }

/* ---------- run detail ---------- */
.run-hero { padding: 22px 24px; display: grid; gap: 16px; }
.run-hero-top { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.run-facts { display: flex; gap: 26px; flex-wrap: wrap; font-size: 13px; color: var(--pewter); }
.run-facts b { display: block; color: var(--ink); font: 650 20px/1.2 var(--display); }
.progress-line { display: flex; justify-content: space-between; font-size: 13px; color: var(--pewter); margin-bottom: 7px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 26px 0 18px; overflow-x: auto; }
.tabs button { position: relative; height: 42px; padding: 0 14px; border: 0; background: none; color: var(--pewter); font: 600 14px var(--text); cursor: pointer; white-space: nowrap; }
.tabs button:hover { color: var(--ink); }
.tabs button[aria-selected="true"] { color: var(--ink); }
.tabs button[aria-selected="true"]::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2.5px; border-radius: 2px; background: var(--cobalt); }
.tabs .n { color: var(--faint); font-weight: 500; margin-left: 4px; }

.wall { display: flex; gap: 14px; align-items: flex-start; }
.wall-col { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.tile {
  margin: 0; display: block; width: 100%; padding: 0; border: 0; text-align: left;
  background: none; color: var(--ink); cursor: pointer; font: inherit;
}
.tile-img { display: block; width: 100%; border-radius: 12px; overflow: hidden; background: var(--line-soft); }
.tile-img img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .25s ease; }
.tile:hover .tile-img img { transform: scale(1.03); }
.tile-cap { padding: 8px 2px 0; font-size: 13px; font-weight: 600; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tile-meta { padding: 2px 2px 0; font-size: 12px; color: var(--pewter); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-play { position: relative; }
.tile-play::after { content: "▶"; position: absolute; right: 10px; top: 10px; width: 26px; height: 26px; border-radius: 50%; background: rgba(0,0,0,.6); color: #fff; font-size: 10px; display: grid; place-items: center; }

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { text-align: left; font-weight: 600; color: var(--pewter); padding: 11px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--well); }
.table th:first-child { border-top-left-radius: var(--r-lg); }
.table th:last-child { border-top-right-radius: var(--r-lg); }
.table td { padding: 10px 14px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--well); cursor: pointer; }
.table .thumb { width: 44px; height: 58px; border-radius: 7px; object-fit: cover; background: var(--line-soft); display: block; }
.table .t-title { font-weight: 600; max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table .t-kw { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table .t-sub { color: var(--pewter); font-size: 12.5px; max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.num { text-align: right; }

.kw-list .kw-row { display: grid; grid-template-columns: 28px minmax(0, 1fr) 200px 80px 70px; gap: 14px; align-items: center; padding: 11px 20px; }
.kw-list .kw-row + .kw-row { border-top: 1px solid var(--line-soft); }
.kw-row button.kw-name { all: unset; cursor: pointer; font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kw-row button.kw-name:hover { color: var(--cobalt); }
.kw-row button.kw-name:focus-visible { outline: 2.5px solid var(--cobalt); }
.kw-idx { color: var(--faint); font-size: 12px; text-align: right; }
.kw-state { font-size: 12.5px; color: var(--pewter); text-align: right; }

.log { padding: 6px 0; max-height: 560px; overflow: auto; font-size: 13px; }
.log div { display: grid; grid-template-columns: 82px 1fr; gap: 12px; padding: 5px 20px; }
.log time { color: var(--faint); }
.log .warn { color: var(--warn); }
.log .error { color: var(--bad); }

/* ---------- drawer ---------- */
.scrim { position: fixed; inset: 0; background: rgba(14, 19, 32, .42); z-index: 40; animation: fade .15s ease; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(520px, 100vw); z-index: 41; background: var(--paper);
  box-shadow: -20px 0 50px -20px rgba(0,0,0,.35); overflow-y: auto; animation: slide .2s ease;
}
.drawer-img { background: var(--line-soft); max-height: 62vh; min-height: 160px; overflow: hidden; display: flex; justify-content: center; }
.drawer-img img, .drawer-img video { max-width: 100%; max-height: 62vh; display: block; object-fit: contain; }
.drawer-body { padding: 22px 24px 32px; display: flex; flex-direction: column; gap: 16px; }
.drawer-body h3 { margin: 0; font: 650 21px/1.25 var(--display); letter-spacing: -.01em; }
.drawer-close { position: absolute; top: 12px; right: 12px; background: var(--paper); box-shadow: var(--shadow); border-radius: 50%; }
.facts { display: grid; grid-template-columns: 130px 1fr; gap: 9px 14px; margin: 0; font-size: 13.5px; }
.facts dt { color: var(--pewter); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.color-chip { display: inline-flex; align-items: center; gap: 7px; }
.color-chip i { width: 14px; height: 14px; border-radius: 4px; border: 1px solid rgba(0,0,0,.08); }
@keyframes fade { from { opacity: 0; } }
@keyframes slide { from { transform: translateX(30px); opacity: .4; } }

/* ---------- API & settings ---------- */
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.token-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 13px 20px; }
.token-row + .token-row { border-top: 1px solid var(--line-soft); }
.secret { display: flex; gap: 8px; align-items: center; padding: 10px 12px; border-radius: var(--r-md); background: var(--ink); color: #fff; }
.secret code { flex: 1; overflow-wrap: anywhere; }
.codeblock { position: relative; margin: 0; padding: 16px 18px; border-radius: var(--r-md); background: #121A2B; color: #DDE4F2; overflow-x: auto; }
:root[data-theme="dark"] .codeblock { background: #0B1019; }
.codeblock code { white-space: pre; }
.codeblock .btn { position: absolute; top: 8px; right: 8px; background: rgba(255,255,255,.08); border-color: transparent; color: #DDE4F2; }
.codeblock .btn:hover { background: rgba(255,255,255,.16); color: #fff; }
.endpoint { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 10px; padding: 9px 0; border-top: 1px solid var(--line-soft); font-size: 13.5px; }
.endpoint:first-of-type { border-top: 0; }
.verb { font: 700 11.5px/22px ui-monospace, Menlo, monospace; text-align: center; border-radius: 5px; background: var(--cobalt-wash); color: var(--cobalt-ink); height: 22px; }
.verb.get { background: var(--ok-wash); color: var(--ok); }
.verb.del { background: var(--bad-wash); color: var(--bad); }
.settings-group { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 24px; padding: 22px 24px; }
.settings-group + .settings-group { border-top: 1px solid var(--line-soft); }
.settings-group h3 { margin: 0 0 4px; font: 650 16px var(--display); }
.settings-group p { margin: 0; color: var(--pewter); font-size: 13px; }
.settings-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; }
.form-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 24px; border-top: 1px solid var(--line); background: var(--well); border-radius: 0 0 var(--r-lg) var(--r-lg); }

/* ---------- toast ---------- */
.toasts { position: fixed; bottom: 22px; left: 50%; translate: -50% 0; display: flex; flex-direction: column; gap: 8px; z-index: 60; }
.toast { padding: 11px 16px; border-radius: var(--r-md); background: var(--ink); color: var(--paper); font-weight: 550; box-shadow: var(--shadow); animation: rise .2s ease; }
.toast.bad { background: var(--bad); color: #fff; }
@keyframes rise { from { transform: translateY(8px); opacity: 0; } }

.skeleton { background: linear-gradient(90deg, var(--line-soft), var(--well), var(--line-soft)); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; border-radius: 8px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- login ---------- */
.login-body { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); }
.login-art { position: relative; overflow: hidden; background: #172033; }
.login-art .cols { position: absolute; inset: -40px -20px; display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; transform: rotate(-6deg); }
.login-art .col { display: flex; flex-direction: column; gap: 14px; }
.login-art .col i { display: block; border-radius: 14px; }
.login-art .col:nth-child(2) { margin-top: -90px; }
.login-art .col:nth-child(4) { margin-top: -140px; }
.login-art .veil { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(23,32,51,.0) 30%, rgba(23,32,51,.86)); }
.login-art .tagline { position: absolute; left: 44px; right: 44px; bottom: 42px; color: #fff; }
.login-art .tagline p { margin: 0; font: 600 26px/1.25 var(--display); letter-spacing: -.015em; max-width: 22ch; }
.login-art .tagline span { display: block; margin-top: 10px; color: rgba(255,255,255,.72); font-size: 14px; }
.login-pane { display: grid; place-items: center; padding: 40px 24px; background: var(--paper); }
.login-card { width: min(380px, 100%); display: flex; flex-direction: column; gap: 18px; }
.login-card h1 { margin: 14px 0 2px; font: 650 28px/1.15 var(--display); letter-spacing: -.02em; }
.login-card .error { color: var(--bad); font-size: 13.5px; min-height: 20px; margin: -6px 0 0; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .instrument { grid-template-columns: 1fr 1fr; }
  .instrument > section:first-child { grid-column: 1 / -1; border-bottom: 1px solid var(--line); }
  .instrument > section:nth-child(2) { border-left: 0; }
  .run-row { grid-template-columns: 110px minmax(0, 1fr) 140px 100px; }
  .run-row .run-when { display: none; }
  .compose { grid-template-columns: 1fr; }
  .side-stack { position: static; }
  .split { grid-template-columns: 1fr; }
  .settings-group { grid-template-columns: 1fr; gap: 12px; }
}
@media (max-width: 760px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .rail { position: static; height: auto; min-width: 0; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 14px; border-right: 0; border-bottom: 1px solid var(--line); }
  .nav { flex-direction: row; overflow-x: auto; width: 100%; min-width: 0; order: 3; }
  .nav a { padding: 8px 10px; white-space: nowrap; }
  .rail-foot { margin: 0 0 0 auto; flex-direction: row; align-items: center; order: 2; }
  .health-mini { padding: 8px; }
  .health-mini > span:last-child, .me > span:first-child { display: none; }
  .main { padding-top: 22px; }
  .instrument { grid-template-columns: 1fr; }
  .instrument > section + section { border-left: 0; border-top: 1px solid var(--line); }
  .run-row { grid-template-columns: 1fr auto; gap: 6px 12px; padding: 14px 16px; }
  .run-row .swatch { grid-column: 1 / -1; }
  .run-row .run-nums { display: none; }
  .kw-list .kw-row { grid-template-columns: 24px minmax(0, 1fr) 60px; }
  .kw-list .kw-row .swatch, .kw-list .kw-row .kw-state { display: none; }
  .login-body { grid-template-columns: 1fr; }
  .login-art { display: none; }
  .page-head h1 { font-size: 26px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
