/* Comparison sheet. System sans, cool gray, one brick accent, hairlines, no motion. */

:root {
  --bg: #e7e8e6; --field: #f1f2f0; --line: #bfc2be; --line-2: #d4d6d2;
  --text: #17191a; --mute: #5f6462; --accent: #a9391a; --on-accent: #f1f2f0;
  --bad: #a9391a; --warn: #8a5a00;
  --sans: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15171a; --field: #1d2024; --line: #3a3e44; --line-2: #2a2d32;
    --text: #e6e7e5; --mute: #979c9a; --accent: #e4704a; --on-accent: #15171a;
    --bad: #e4704a; --warn: #d9ad55;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
/* Layout rules like display:flex would otherwise beat the hidden attribute. */
[hidden] { display: none !important; }
html { background: var(--bg); }
body { margin: 0; color: var(--text); font: 15px/1.5 var(--sans); }
a { color: var(--accent); }
p { margin: 0 0 10px; }
b, strong { font-weight: 600; }
.small { font-size: 13px; color: var(--mute); }
.small:empty, .warn:empty { display: none; }
.caps { text-transform: uppercase; letter-spacing: .08em; font-size: 11.5px; }
.warn { color: var(--warn); font-size: 13px; margin: 6px 24px; }
.status { font-weight: 600; }

/* ---------- controls ---------- */

button, select, input, textarea { font: inherit; color: inherit; border-radius: 0; }
button { padding: 7px 14px; border: 1px solid var(--line); background: var(--field); cursor: pointer; }
button:disabled { opacity: .45; cursor: default; }
button.go { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; padding: 9px 20px; }
button.text { border: 0; background: none; padding: 0; color: var(--accent); text-decoration: underline; font-size: 13px; }
select, textarea { background: var(--field); border: 1px solid var(--line); padding: 6px 8px; }
select { max-width: 100%; font-size: 13.5px; }
textarea { width: 100%; display: block; resize: vertical; }
input[type=checkbox] { accent-color: var(--accent); margin: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

/* ---------- top bar ---------- */

.bar { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; padding: 12px 24px; border-bottom: 1px solid var(--line); }
.mark { font-size: 17px; letter-spacing: -.01em; }
.tag { color: var(--mute); font-size: 13px; }
.account { margin-left: auto; display: flex; gap: 14px; align-items: baseline; font-size: 13px; }
#username { font-weight: 600; }
#allowance { color: var(--mute); font-family: var(--mono); font-size: 12px; }
#allowance.warn { color: var(--bad); margin: 0; }

/* ---------- signed out ---------- */

.intro { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 40px; padding: 36px 24px; max-width: 1480px; }
.pitch h1 { font-size: 28px; line-height: 1.2; letter-spacing: -.015em; font-weight: 650; margin: 0 0 14px; }
.pitch > p { max-width: 52ch; }
.pitch .go { margin: 4px 0 14px; }
.sample { min-width: 0; }

/* ---------- signed in ---------- */

#app { max-width: 1680px; }
.composer { padding: 18px 24px 8px; }
.composer textarea { font-size: 16px; padding: 10px 12px; }
.composer .row { margin-top: 8px; }
.file { border: 1px solid var(--line); background: var(--field); padding: 5px 12px; font-size: 13px; cursor: pointer; }
#file-list { list-style: none; margin: 8px 0 0; padding: 0; font-size: 13px; }
#file-list:empty { display: none; }
#file-list li { display: flex; gap: 12px; padding: 3px 0; border-top: 1px solid var(--line-2); }
#file-list .fname { font-family: var(--mono); }
#file-list .note { margin-left: auto; color: var(--mute); font-family: var(--mono); }
#file-list li.bad * { color: var(--bad); }

.panel { padding: 10px 24px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-top: 10px; }
#models { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px 12px; margin-top: 8px; }
#models label { font-size: 12px; color: var(--mute); }
#models select { display: block; width: 100%; margin-top: 2px; }
#models select.picked { border-color: var(--accent); color: var(--text); }

.settings { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; padding: 12px 24px 4px; font-size: 13.5px; }
.settings label { display: flex; align-items: center; gap: 8px; }
.settings .check { gap: 6px; }
#synth-model { max-width: 280px; }
#prompt-box { flex-basis: 100%; }
#prompt-box summary { cursor: pointer; color: var(--mute); }
#prompt-box summary span { color: var(--text); }
#prompt-box.modified summary span { color: var(--accent); }
#prompt-box textarea { margin: 8px 0 6px; font: 13px/1.5 var(--mono); }
#mode-note, #synth-note { margin: 4px 24px 0; }

.action { display: flex; align-items: center; gap: 12px; justify-content: flex-end; flex-wrap: wrap; padding: 12px 24px; }
.action #estimate { margin-right: auto; font-family: var(--mono); font-size: 12px; }

/* ---------- answers: one column per model ---------- */

#results-wrap { border-top: 2px solid var(--text); margin-top: 8px; }
.results-bar { padding: 8px 24px; border-bottom: 1px solid var(--line); }
.results-bar #round-cost { margin-left: auto; font-family: var(--mono); font-size: 12px; }

#synthesis-slot:empty { display: none; }
.verdict, #synthesis-slot .card { background: var(--field); border-bottom: 1px solid var(--line); padding: 14px 24px; }
.sample .verdict { border: 1px solid var(--line); border-bottom: 0; padding: 12px 16px; }

/* Columns share a header line and vertical rules, and scroll sideways when there are many. */
#columns, .sheet {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(300px, 1fr);
  overflow-x: auto; align-items: start;
}
/* The example on the sign-in page sits in half the width: a 2 by 2 grid reads better than scrolling. */
.sheet { border: 1px solid var(--line); margin-bottom: 10px; grid-auto-flow: row; grid-template-columns: 1fr 1fr; overflow: visible; align-items: stretch; }
.sheet .col:nth-child(2n) { border-right: 0; }
.sheet .col:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
.col p { padding-bottom: 4px; }
.col, #columns .card { border-right: 1px solid var(--line); min-width: 0; }
.col:last-child, #columns .card:last-child { border-right: 0; }
.col p { padding: 10px 14px 0; font-size: 14px; }

.colhead, .card > .head { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; padding: 8px 14px; border-bottom: 1px solid var(--line); background: var(--field); }
.colhead b, .card .name { font: 600 12.5px var(--mono); overflow-wrap: anywhere; }
.colhead span, .card .status { font: 12px var(--mono); color: var(--mute); margin-left: auto; }
.card .spinner { display: none; }
.card .body { padding: 12px 14px 16px; }
#synthesis-slot .card > .head { background: none; padding: 0 0 6px; border: 0; }
#synthesis-slot .card .body { padding: 0; }
#synthesis-slot .card .name { color: var(--accent); }
.card.failed .name, .card.failed .status { color: var(--bad); }
.card.cancelled .name { color: var(--mute); }

.card details.reasoning { margin: 0 0 10px; color: var(--mute); font-size: 13.5px; }
.card details.reasoning summary { cursor: pointer; font-size: 12px; }
.card .reasoning-body { margin-top: 6px; }

/* rendered markdown */
.card .body { overflow-wrap: anywhere; }
.card .body p, .card .body ul, .card .body ol, .card .body pre, .card .body blockquote, .card .body .table-wrap { margin: 0 0 10px; }
.card .body ul, .card .body ol { padding-left: 20px; }
.card .body li > ul, .card .body li > ol { margin: 2px 0; }
.card .body h3, .card .body h4, .card .body h5, .card .body h6 { font-size: 15px; margin: 14px 0 6px; }
.card .body code { font: .88em var(--mono); background: var(--field); padding: 0 3px; }
.card .body pre { background: var(--field); border: 1px solid var(--line-2); padding: 8px 10px; overflow-x: auto; }
.card .body pre code { padding: 0; background: none; font-size: 12.5px; }
.card .body blockquote { padding: 0 12px; color: var(--mute); }
.card .body hr { border: 0; border-top: 1px solid var(--line-2); margin: 12px 0; }
.card .body > :last-child { margin-bottom: 0; }
.card .body .table-wrap { overflow-x: auto; }
.card .body table { border-collapse: collapse; font-size: 13px; }
.card .body th, .card .body td { border: 1px solid var(--line); padding: 4px 7px; text-align: left; vertical-align: top; }
.card .body th { background: var(--field); }

/* static placeholders */
.skeleton { display: grid; gap: 8px; }
.skeleton span { display: block; height: 10px; background: var(--line-2); }
.skeleton span:nth-child(2) { width: 88%; } .skeleton span:nth-child(3) { width: 62%; }
#models .skeleton { grid-column: 1 / -1; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px 12px; }
#models .skeleton span, #models .skeleton span:nth-child(n) { height: 44px; width: auto; }

/* ---------- footer and document pages ---------- */

.foot { padding: 20px 24px 28px; border-top: 1px solid var(--line); margin-top: 28px; }
.foot a { margin-left: 10px; }
body.doc { max-width: 720px; margin: 0 auto; padding: 0 24px 40px; }
body.doc .top { border-bottom: 1px solid var(--line); padding: 20px 0 12px; margin-bottom: 20px; }
body.doc .top h1 { font-size: 20px; margin: 0; }
body.doc .top p { color: var(--mute); margin: 2px 0 0; }
body.doc h2 { font-size: 16px; margin: 24px 0 8px; }
body.doc footer { border-top: 1px solid var(--line); margin-top: 32px; padding-top: 10px; font-size: 13px; }
.doc .updated { font: 12px var(--mono); color: var(--mute); }

@media (max-width: 900px) {
  .intro { grid-template-columns: minmax(0, 1fr); padding: 24px 16px; gap: 28px; }
  .bar, .composer, .panel, .settings, .action, .results-bar, .foot { padding-left: 16px; padding-right: 16px; }
  .verdict, #synthesis-slot .card { padding-left: 16px; padding-right: 16px; }
  #mode-note, #synth-note, .warn { margin-left: 16px; margin-right: 16px; }
  .account { margin-left: 0; flex-basis: 100%; }
  #columns { grid-auto-flow: row; grid-auto-columns: auto; }
  #columns .card { border-right: 0; border-bottom: 1px solid var(--line); }
  .sheet { grid-template-columns: 1fr; }
  .sheet .col { border-right: 0; border-bottom: 1px solid var(--line); }
  .sheet .col:last-child { border-bottom: 0; }
  #synth-model { max-width: 100%; }
  #models, #models .skeleton { grid-template-columns: 1fr 1fr; }
}
