/* Color tokens sampled from the live Surplus Intelligence theme. */
@font-face { font-family: Inter; font-style: normal; font-weight: 100 900; font-display: swap; src: url('/inter-latin.woff2') format('woff2'); }
:root {
  color-scheme: light;
  --bg: 255 255 255;
  --surface: 250 250 249;
  --field: 255 255 255;
  --button: 231 229 224;
  --button-hover: 221 219 213;
  --rail-active: 240 240 243;
  --ink: 27 27 30;
  --secondary: 67 66 74;
  --muted: 95 93 102;
  --line: 224 222 216;
  --primary: 0 142 250;
  --success: 12 132 75;
  --danger: 185 28 28;
  --noul: rgb(var(--success));
  --choice: rgb(var(--primary));
  --score: #9556d6;
}
:root[data-theme='dark'] {
  color-scheme: dark;
  --bg: 14 14 14;
  --surface: 15 16 20;
  --field: 26 27 33;
  --button: 37 38 43;
  --button-hover: 48 49 56;
  --rail-active: 24 25 30;
  --ink: 244 244 245;
  --secondary: 180 178 189;
  --muted: 138 136 147;
  --line: 36 37 42;
  --success: 47 208 127;
  --danger: 248 113 113;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; background: rgb(var(--bg)); color: rgb(var(--ink)); font: 14px/1.5 Inter, ui-sans-serif, system-ui, sans-serif; }
a { color: inherit; text-decoration: none; }
a:hover { color: rgb(var(--primary)); }
button, input, textarea, select { font: inherit; }
button, a, input, textarea, select, summary { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid rgb(var(--primary)); outline-offset: 3px; }
.site-header { height: 64px; position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 28px; border-bottom: 1px solid rgb(var(--line)); background: rgb(var(--bg)); }
.brand { display: inline-flex; align-items: center; gap: 12px; font-weight: 600; letter-spacing: -.02em; white-space: nowrap; }
.brand img { object-fit: contain; }
.header-actions { display: flex; align-items: center; gap: 18px; }
.preview-badge { color: rgb(var(--muted)); font-size: 12px; }
button { cursor: pointer; border: 1px solid transparent; border-radius: 8px; color: rgb(var(--secondary)); padding: 8px 12px; background: rgb(var(--button)); transition: background-color .15s; font-size: 13px; font-weight: 500; }
button:hover { background: rgb(var(--button-hover)); }
button:disabled { opacity: .5; cursor: not-allowed; }
.icon-button { padding: 8px; display: grid; place-items: center; background: transparent; }
.sidebar { position: fixed; top: 64px; bottom: 0; left: 0; width: 224px; padding: 16px 10px; border-right: 1px solid rgb(var(--line)); display: flex; flex-direction: column; justify-content: space-between; background: rgb(var(--bg)); }
.site-nav { display: grid; gap: 4px; }
.site-nav a, .sidebar-bottom a { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; font-weight: 500; border-radius: 6px; color: rgb(var(--muted)); }
.site-nav a:hover, .sidebar-bottom a:hover { color: rgb(var(--ink)); background: rgb(var(--rail-active)); }
.site-nav a[aria-current='page'] { background: rgb(var(--rail-active)); color: rgb(var(--ink)); }
.site-nav a span, .sidebar-bottom a span { font-weight: 400; font-size: 12px; }
.nav-label { margin: 28px 12px 4px; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: rgb(var(--muted)); }
.sidebar-bottom p { padding: 0 12px; color: rgb(var(--muted)); font-size: 11px; line-height: 1.7; }
.shell { margin-left: 224px; padding: 40px clamp(20px,4vw,64px) 20px; max-width: 1280px; display: grid; gap: 20px; }
.hero { padding-bottom: 8px; }
.heading-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
h1 { margin: 0; font-size: clamp(26px,3vw,32px); line-height: 1.2; letter-spacing: -.035em; font-weight: 600; }
.model-badge { background: rgb(var(--rail-active)); color: rgb(var(--muted)); border-radius: 5px; padding: 4px 8px; font: 11px/1.5 ui-monospace, monospace; }
.lede { margin: 12px 0 3px; font-size: 16px; color: rgb(var(--secondary)); }
.intro-note { margin: 0; color: rgb(var(--muted)); font-size: 13px; }
.panel { border: 1px solid rgb(var(--line)); background: rgb(var(--surface)); border-radius: 8px; padding: 20px; min-width: 0; }
.row-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
h2 { margin: 0; font-size: 16px; font-weight: 600; letter-spacing: -.02em; }
.presets { display: flex; flex-wrap: wrap; gap: 6px; }
.field-help { display: block; margin: 0 0 10px; color: rgb(var(--muted)); font-size: 12px; }
input, textarea, select { min-width: 0; width: 100%; border: 1px solid rgb(var(--line)); border-radius: 8px; padding: 10px 12px; color: rgb(var(--ink)); background: rgb(var(--field)); font-size: 13px; }
select { cursor: pointer; }
input::placeholder, textarea::placeholder { color: rgb(var(--muted)); opacity: 1; }
textarea { display: block; resize: vertical; line-height: 1.7; min-height: 110px; }
.question { margin: 12px 0; border: 1px solid rgb(var(--line)); background: rgb(var(--bg)); border-radius: 8px; padding: 14px; }
.q-grid { display: grid; grid-template-columns: minmax(0,1fr) 130px auto; gap: 8px; margin-bottom: 8px; }
.qid { font-family: ui-monospace, monospace; }
.danger { color: rgb(var(--muted)); background: transparent; }
.danger:hover { color: rgb(var(--danger)); background: rgb(var(--rail-active)); }
.criteria { display: grid; gap: 6px; margin-top: 10px; }
.criteria:empty { display: none; }
.criteria-row { display: grid; grid-template-columns: 130px minmax(0,1fr) 36px; gap: 6px; }
.criteria > .ghost { justify-self: start; padding: 6px 10px; margin-top: 2px; background: transparent; color: rgb(var(--muted)); }
.criteria > .ghost:hover { background: rgb(var(--rail-active)); color: rgb(var(--ink)); }
.runbar { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; margin-top: 20px; padding-top: 18px; border-top: 1px solid rgb(var(--line)); }
button.primary { background: rgb(var(--primary)); color: white; padding: 10px 18px; font-weight: 600; display: flex; align-items: center; gap: 28px; }
button.primary:hover { background: #007ee0; }
.status { margin: 0; font-size: 13px; color: rgb(var(--muted)); }
.status.error { color: rgb(var(--danger)); }
.muted { color: rgb(var(--muted)); font-size: 13px; margin: 6px 0 12px; }
.answers { display: grid; gap: 12px; }
.answer { border: 1px solid rgb(var(--line)); padding: 16px; border-radius: 8px; background: rgb(var(--bg)); min-width: 0; }
.answer h3 { margin: 0 0 10px; font: 500 13px/1.5 ui-monospace, monospace; overflow-wrap: anywhere; }
.answer strong { color: rgb(var(--ink)); font-weight: 600; }
.prob { display: grid; grid-template-columns: minmax(70px,120px) minmax(0,1fr) 52px; gap: 10px; align-items: center; margin: 8px 0; font-size: 12px; color: rgb(var(--secondary)); }
.prob > span { overflow-wrap: anywhere; }
.prob > span:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.bar { height: 6px; overflow: hidden; background: rgb(var(--button)); border-radius: 3px; }
.bar > span { display: block; height: 100%; background: var(--noul); }
.raw { margin-top: 18px; }
summary { cursor: pointer; color: rgb(var(--secondary)); font-size: 13px; }
pre { white-space: pre-wrap; overflow-wrap: anywhere; font: 12px/1.7 ui-monospace, monospace; background: rgb(var(--rail-active)); padding: 14px; border-radius: 6px; }
.api-details { margin-top: 18px; color: rgb(var(--muted)); font-size: 13px; line-height: 1.7; }
.api-details h2 { font-size: 14px; color: rgb(var(--secondary)); }
.api-details p { margin: 8px 0; }
.api-details ul { margin: 8px 0 0; padding-left: 18px; }
.type-list { margin: 0 0 12px; padding-left: 18px; color: rgb(var(--muted)); font-size: 13px; line-height: 1.8; list-style: disc; }
.type-list strong { color: rgb(var(--secondary)); }
.add-buttons { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 12px; }
.btn-label { color: rgb(var(--muted)); font-size: 13px; }
.api-details strong { color: rgb(var(--secondary)); }
.curl-export { margin-top: 14px; }
.curl-export > summary { color: rgb(var(--primary)); font-weight: 500; }
.curl-export .field-help { margin-top: 12px; }
#curl-code { max-height: 340px; overflow: auto; }
.copy-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
code { font-family: ui-monospace, monospace; }
.page-footer { color: rgb(var(--muted)); font-size: 11px; text-align: center; border-top: 1px solid rgb(var(--line)); padding-top: 20px; margin-top: 8px; }
.skip-link { position: absolute; left: 12px; top: -80px; padding: 10px; background: rgb(var(--bg)); z-index: 20; }
.skip-link:focus { top: 10px; }
@media (min-width: 1504px) { .shell { margin-right: auto; margin-left: max(224px, calc((100vw - 1056px) / 2)); } }
@media (max-width: 850px) {
  .sidebar { display: none; }
  .shell { margin-left: 0; padding: 28px 20px 20px; }
  .site-header { padding: 0 20px; }
}
@media (max-width: 520px) {
  .site-header { padding: 0 16px; }
  .brand { gap: 8px; font-size: 13px; }
  .preview-badge { display: none; }
  .shell { padding: 24px 12px 20px; gap: 16px; }
  .panel { padding: 14px; }
  .question { padding: 10px; }
  .q-grid { grid-template-columns: minmax(0,1fr) 94px; }
  .q-grid .remove { grid-column: 1 / -1; justify-self: end; padding: 4px 8px; font-size: 12px; }
  .criteria-row { grid-template-columns: minmax(0,1fr) 32px; }
  .criteria-row input:first-child { grid-column: 1; }
  .criteria-row input:nth-child(2) { grid-row: 2; grid-column: 1 / -1; }
  .criteria-row button { grid-column: 2; grid-row: 1; }
  .criteria-row { padding-bottom: 6px; }
}
