:root {
  --bg: #f4f6fb; --bg2: #eaf0fb; --card: #ffffff; --ink: #18202f; --muted: #5d6879; --line: #e1e6ef;
  --accent: #3b5bdb; --accent-soft: #e7ecff; --accent-ink: #ffffff;
  --earned: #1f9d55; --earned-soft: #e3f6ea; --refuted: #d64545; --refuted-soft: #fde8e8;
  --credit: #d98a00; --credit-soft: #fff3db; --open: #6b7280; --open-soft: #eef0f3;
  --dirty: #8b5cf6; --dirty-soft: #f1ebff;
  --shadow: 0 1px 2px rgba(20,30,60,.05), 0 6px 24px rgba(20,30,60,.06);
  --radius: 14px;
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
}
/* one theme only: the light one (curator, 26.10 — the dark one loses to it) */
:root { color-scheme: light; }
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: radial-gradient(1200px 600px at 10% -10%, var(--bg2), transparent), var(--bg); color: var(--ink);
       min-height: 100vh; font-size: 15px; line-height: 1.5; }
a { color: var(--accent); }

header.top { display: flex; align-items: center; gap: 16px; padding: 14px 24px; position: sticky; top: 0; z-index: 5;
             background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(10px);
             border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; letter-spacing: -.2px; }
.brand .logo { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; color: #fff;
               background: linear-gradient(135deg, #3b5bdb, #8b5cf6); font-size: 15px; font-weight: 800; }
.brand small { font-weight: 500; color: var(--muted); font-size: 13px; }
nav.links { margin-left: auto; display: flex; gap: 6px; align-items: center; }
nav.links a { text-decoration: none; color: var(--muted); padding: 6px 12px; border-radius: 999px; font-weight: 600; }
nav.links a.on, nav.links a:hover { background: var(--accent-soft); color: var(--accent); }
.spend { font-size: 12px; color: var(--muted); border: 1px solid var(--line); padding: 4px 10px; border-radius: 999px; }

main.grid { display: grid; grid-template-columns: 320px minmax(360px, 1fr) 440px; gap: 18px; padding: 18px 24px 40px;
            max-width: 1600px; margin: 0 auto; }
@media (max-width: 1250px) { main.grid { grid-template-columns: 300px 1fr; } .col-right { grid-column: 1 / -1; } }
@media (max-width: 820px) { main.grid { grid-template-columns: 1fr; padding: 12px 16px 32px; } }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
        padding: 16px; }
.card + .card { margin-top: 14px; }
.card h3 { margin: 0 0 10px; font-size: 13px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); }

select, textarea, input[type=text] { width: 100%; font: inherit; color: var(--ink); background: var(--bg);
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; outline: none; }
select:focus, textarea:focus, input[type=text]:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
button { font: inherit; font-weight: 600; border: 0; border-radius: 10px; padding: 9px 14px; cursor: pointer;
         background: var(--accent); color: var(--accent-ink); transition: transform .05s, filter .15s; }
button:hover { filter: brightness(1.07); }
button:active { transform: translateY(1px); }
button.ghost { background: var(--accent-soft); color: var(--accent); }
button.small { padding: 5px 10px; font-size: 13px; }
button:disabled { opacity: .5; cursor: default; }

.hint .icon { font-size: 28px; }
.hint dt { font-weight: 700; margin-top: 8px; font-size: 13px; }
.hint dd { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.example { margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: var(--accent-soft); font-size: 14px; }
.example button { margin-top: 8px; }

.drop { margin-top: 4px; border: 2px dashed var(--line); border-radius: 12px; padding: 18px; text-align: center;
        color: var(--muted); cursor: pointer; transition: border-color .15s, background .15s; }
.drop.over { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.files { list-style: none; padding: 0; margin: 10px 0 0; }
.files li { display: flex; gap: 8px; align-items: center; font-size: 13px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.kind { font-size: 11px; font-weight: 700; text-transform: uppercase; padding: 2px 7px; border-radius: 999px;
        background: var(--open-soft); color: var(--open); }

.chat { display: flex; flex-direction: column; height: calc(100vh - 330px); min-height: 420px; }
.verdictCard { margin-top: 14px; }
.msgs { flex: 1; overflow-y: auto; padding: 4px 2px 10px; display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 88%; padding: 10px 14px; border-radius: 14px; white-space: pre-wrap; }
.msg.user { align-self: flex-end; background: var(--accent); color: var(--accent-ink); border-bottom-right-radius: 4px; }
.msg.assistant { align-self: flex-start; background: var(--bg); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.msg .who { display: block; font-size: 11px; font-weight: 700; opacity: .7; margin-bottom: 2px; }
.empty { color: var(--muted); text-align: center; margin: 40px auto; max-width: 380px; }
.empty[hidden] { display: none; }
.composer { display: flex; gap: 8px; margin-top: 8px; }
.composer textarea { resize: none; height: 64px; }

.verdict { border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 6px; }
.verdict .chip { align-self: flex-start; font-weight: 800; letter-spacing: .4px; font-size: 13px; padding: 4px 10px;
                 border-radius: 999px; color: #fff; }
.verdict.EARNED { background: var(--earned-soft); } .verdict.EARNED .chip { background: var(--earned); }
.verdict.REFUTED { background: var(--refuted-soft); } .verdict.REFUTED .chip { background: var(--refuted); }
.verdict.CREDIT { background: var(--credit-soft); } .verdict.CREDIT .chip { background: var(--credit); }
.verdict.OPEN, .verdict.IDLE { background: var(--open-soft); } .verdict.OPEN .chip, .verdict.IDLE .chip { background: var(--open); }
.verdict .head { font-weight: 600; }
.verdict .why { color: var(--muted); font-size: 13px; }

.progress { margin-top: 12px; }
.bar { height: 10px; border-radius: 999px; background: var(--open-soft); overflow: hidden; position: relative; }
.bar > i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, var(--accent), #8b5cf6); border-radius: 999px;
           transition: width .3s; }
.bar.indet > i { width: 35% !important; animation: slide 1.2s ease-in-out infinite; }
@keyframes slide { 0% { left: -35%; } 100% { left: 100%; } }
.pmeta { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 6px; }
.log { margin: 8px 0 0; padding: 0; list-style: none; font-size: 12px; color: var(--muted); max-height: 120px; overflow-y: auto; }
.log li::before { content: "› "; color: var(--accent); }

table.vals { width: 100%; border-collapse: collapse; font-size: 13px; }
table.vals th { text-align: left; color: var(--muted); font-weight: 600; font-size: 12px; padding: 6px 4px; border-bottom: 1px solid var(--line); }
table.vals td { padding: 7px 4px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.vals td.q { font-weight: 700; font-family: ui-monospace, monospace; }
table.vals input { width: 100%; padding: 4px 6px; font-size: 13px; border-radius: 6px; }
.src { font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 999px; }
.src.dirty { background: var(--dirty-soft); color: var(--dirty); }
.src.clean { background: var(--earned-soft); color: var(--earned); }
.where { color: var(--muted); font-size: 12px; }
.row-actions { white-space: nowrap; }

.kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; font-size: 13px; }
.kv b { font-family: ui-monospace, monospace; }
details { margin-top: 10px; }
details summary { cursor: pointer; color: var(--accent); font-weight: 600; font-size: 13px; }
pre.json { font-size: 12px; background: var(--bg); padding: 10px; border-radius: 8px; overflow: auto; max-height: 320px; }
.conflict { background: var(--refuted-soft); border-radius: 8px; padding: 6px 10px; margin: 4px 0; font-size: 13px; }
.muted { color: var(--muted); }

/* help page */
.doc { max-width: 860px; margin: 0 auto; padding: 24px; }
.doc h1 { font-size: 30px; letter-spacing: -.5px; margin: 10px 0 6px; }
.doc h2 { margin-top: 30px; font-size: 20px; }
.doc .lead { color: var(--muted); font-size: 17px; }
.doc .steps { counter-reset: s; list-style: none; padding: 0; }
.doc .steps li { counter-increment: s; position: relative; padding: 10px 0 10px 46px; }
.doc .steps li::before { content: counter(s); position: absolute; left: 0; top: 8px; width: 30px; height: 30px;
  border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 800; display: grid; place-items: center; }
.doc table { border-collapse: collapse; width: 100%; font-size: 14px; }
.doc td, .doc th { border-bottom: 1px solid var(--line); padding: 8px 6px; text-align: left; vertical-align: top; }
.brand, .spend, nav.links a { white-space: nowrap; }
@media (max-width: 900px) { .brand small { display: none; } header.top { padding: 10px 16px; gap: 10px; }
  .spend { display: none; } }
.limit { display: flex; flex-direction: column; gap: 2px; padding: 12px; border-radius: 10px; background: var(--accent-soft); margin-bottom: 10px; }
.limit b { font-size: 22px; color: var(--accent); }

.chat { position: relative; }
.chips { list-style: none; padding: 0; margin: 6px 0 0; display: flex; flex-wrap: wrap; gap: 6px; }
.chips li { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; padding: 4px 10px 4px 4px;
            border-radius: 999px; background: var(--accent-soft); color: var(--ink); }
.composer .attach { font-size: 18px; padding: 0 12px; }
.dropveil { display: none; position: absolute; inset: 0; border-radius: var(--radius); border: 2px dashed var(--accent);
            background: color-mix(in srgb, var(--accent-soft) 88%, transparent); color: var(--accent); font-weight: 700;
            place-items: center; text-align: center; padding: 20px; pointer-events: none; }
.chat.over .dropveil { display: grid; }

h3.row { display: flex; justify-content: space-between; align-items: center; }
.runs { list-style: none; margin: 0; padding: 0; max-height: 210px; overflow-y: auto; }
.runs li { display: grid; grid-template-columns: auto 1fr auto; grid-template-rows: auto auto; gap: 0 8px; padding: 7px 8px;
           border-radius: 8px; cursor: pointer; font-size: 13px; }
.runs li:hover, .runs li.on { background: var(--accent-soft); }
.runs .rn { font-weight: 700; color: var(--muted); }
.runs .rq { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.runs .rs { font-size: 11px; font-weight: 800; padding: 1px 8px; border-radius: 999px; color: #fff; align-self: center; }
.runs .rs.EARNED { background: var(--earned); } .runs .rs.REFUTED { background: var(--refuted); }
.runs .rs.CREDIT { background: var(--credit); } .runs .rs.OPEN { background: var(--open); }
.runs .rt { grid-column: 2; font-size: 11px; color: var(--muted); }
.viewing { background: var(--credit-soft); color: var(--ink); border-radius: 8px; padding: 6px 10px; font-size: 13px; margin-bottom: 10px; }

.chips .x { background: transparent; color: var(--muted); padding: 0 4px; font-size: 15px; line-height: 1; }
.chips .x:hover { color: var(--refuted); }
.atts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.att { font-size: 12px; text-decoration: none; padding: 3px 9px; border-radius: 999px; background: rgba(255,255,255,.18);
       color: inherit; border: 1px solid rgba(255,255,255,.35); }
.msg.assistant .att { background: var(--accent-soft); border-color: var(--line); }
.att:hover { filter: brightness(1.1); text-decoration: underline; }
.tol { font-size: 12px; font-weight: 700; color: var(--accent); white-space: nowrap; }

.src.ai { background: var(--dirty-soft); color: var(--dirty); }
.src.you { background: var(--earned-soft); color: var(--earned); }
table.vals input.changed { border-color: var(--credit); box-shadow: 0 0 0 3px var(--credit-soft); }
.verdict .note { font-size: 13px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 6px; margin-top: 4px; }
.req { font-size: 13px; padding: 6px 10px; border-radius: 8px; background: var(--bg); margin: 4px 0; }
.downloads { font-size: 13px; margin-top: 6px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; color: var(--muted); }
.downloads a { text-decoration: none; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); }
.downloads a:hover { border-color: var(--accent); }
.detailsMid { margin-top: 14px; }
