/* Annotation platform — themed to match the main site (agents-infinite-game-in-quantum):
   warm light palette, teal accent, Inter / IBM Plex Mono / Newsreader. */
:root{
  /* Matches the live landing page: "Renaissance editorial" — warm parchment,
     deep-teal accent, Space Grotesk body, Cormorant Garamond display. */
  --bg:#f2eee3; --bg2:#fbf8f0; --bg3:#e9e2d4;
  --line:#d8cfbf; --line-2:#c9bea9;
  --ink:#201d18; --muted:#6f695f; --faint:#948b7f;
  --accent:#0f827d; --accent-deep:#0a6763; --accent-soft:#dcebe7; --accent-ink:#fffdf7;
  --campus:#7c705f; --sepia:#8b6845; --sepia-soft:#eadfce;
  --rose:#b23b2e; --amber:#a3701a; --green:#0a7d54; --green-soft:#e2eee0;
  --shadow:0 16px 44px -32px rgba(57,43,27,.34), 0 2px 8px rgba(57,43,27,.05);
  --font:"Space Grotesk", Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono:"IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --display:"Cormorant Garamond","Newsreader",Georgia,"Times New Roman",serif;
  --serif:var(--display);
}
* { box-sizing: border-box; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg);
  font-size: 16.5px; line-height: 1.6; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
::selection { background: var(--accent); color: var(--accent-ink); }
/* Headings follow the landing page: Cormorant Garamond display for big titles. */
h1,h2,h3,h4 { font-weight: 600; letter-spacing: -.01em; text-wrap: balance; }

/* Top bar — light, bordered, teal-dot brand (after the main site nav) */
.topbar { position: sticky; top: 0; z-index: 40; display: flex; justify-content: space-between;
  align-items: center; gap: 16px; padding: 14px 24px; background: color-mix(in srgb,var(--bg) 88%,transparent);
  backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.topbar .brand { font-weight: 600; letter-spacing: -.02em; font-size: .98rem; color: var(--ink);
  text-decoration: none; display: flex; align-items: center; gap: 9px; }
.topbar .brand .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; }
.topbar .who { font-family: var(--mono); font-size: .8rem; color: var(--muted); }

main { max-width: 1320px; margin: 0 auto; padding: 32px 24px; }
h1 { font-family: var(--display); font-weight: 600; font-size: 2.5rem; line-height: 1.08; letter-spacing: 0; margin: 0 0 .3em; }
h2 { font-size: 1rem; margin: 18px 0 6px; color: var(--ink); font-weight: 600; }
.error { background: color-mix(in srgb,var(--rose) 10%,var(--bg2)); color: var(--rose);
  border: 1px solid color-mix(in srgb,var(--rose) 35%,var(--line)); padding: 9px 12px; border-radius: 8px; }

/* Entry / topic forms */
.enter-form { display: flex; flex-direction: column; gap: 12px; max-width: 380px; }
.enter-form input, .topic-box textarea { padding: 10px 12px; border: 1px solid var(--line-2);
  border-radius: 8px; width: 100%; font: inherit; background: var(--bg2); color: var(--ink); }
.enter-form input:focus, .topic-box textarea:focus, .scoring textarea:focus, .scoring input.reach:focus {
  outline: 2px solid color-mix(in srgb,var(--accent) 45%,transparent); outline-offset: 1px; border-color: var(--accent); }
.req, .scoring .req { color: var(--rose); }
button { background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 8px;
  padding: 11px 16px; font-weight: 600; font-family: inherit; font-size: .92rem; cursor: pointer; transition: background .15s; }
button:hover { background: var(--accent-deep); }

/* Dashboard */
/* Dashboard: two stacked sections */
.dash-cols { display: flex; flex-direction: column; gap: 36px; max-width: 760px; }
.dash-h { font-family: var(--mono); font-size: .7rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent); font-weight: 600; margin: 0 0 14px; }
.dash-note { font-size: .9rem; color: var(--muted); margin: 0 0 12px; }
.area-count { font-family: var(--mono); font-size: .7rem; color: var(--faint); font-weight: 400; }
.area-tasks { margin: 0; padding-left: 18px; }
.area-tasks li { font-size: .9rem; line-height: 1.4; margin-bottom: 7px; }
.area-tasks li a { color: var(--ink); text-decoration: none; border-bottom: 1px solid transparent; }
.area-tasks li a:hover { color: var(--accent-deep); border-bottom-color: color-mix(in srgb,var(--accent) 40%,transparent); }
.area { background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; box-shadow: var(--shadow); }
.area > summary { cursor: pointer; padding: 13px 16px; font-weight: 500; font-size: 1rem; color: var(--ink);
  list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.area > summary::-webkit-details-marker { display: none; }
.area > summary::after { content: "\002B"; color: var(--faint); font-family: var(--mono); }
.area[open] > summary::after { content: "\2212"; }
.area-body { padding: 0 16px 14px; font-size: .88rem; color: var(--muted); line-height: 1.55; }
.area-body .area-cta { margin-top: 8px; color: var(--accent-deep); font-size: .84rem; }

.proposal-list { list-style: none; padding: 0; }
.proposal-row a { display: flex; flex-direction: column; align-items: flex-start; gap: 10px;
  padding: 16px 18px; background: var(--bg2); border: 1px solid var(--line); border-radius: 12px;
  margin-bottom: 8px; text-decoration: none; color: inherit; box-shadow: var(--shadow); transition: border-color .15s; }
.proposal-row a:hover { border-color: var(--accent); }
.proposal-row.done a { border-left: 3px solid var(--green); }
/* Topic: teal tag on top of the card */
.proposal-row .seed { align-self: flex-start; background: var(--accent-soft); color: var(--accent-deep);
  border: 1px solid color-mix(in srgb,var(--accent) 28%,var(--line)); border-radius: 999px; padding: 3px 12px;
  font-family: var(--mono); font-size: .72rem; font-weight: 500; letter-spacing: .02em; }
/* Header: plain text below */
.proposal-row .phead { font-size: 1.08rem; line-height: 1.32; color: var(--ink); font-weight: 500; }
.proposal-row .stage2-link { display: block; margin: -4px 0 8px 24px; padding: 9px 16px;
  background: var(--bg2); border: 1px dashed var(--line-2); border-radius: 10px;
  text-decoration: none; color: var(--muted); font-size: .88rem; }
.proposal-row .stage2-link:hover { border-color: var(--accent); }
.proposal-row .stage2-link.done { border-style: solid; border-left: 3px solid var(--green); }
.stage-jump { margin: 10px 0 0; font-size: .88rem; background: var(--accent-soft);
  border: 1px solid color-mix(in srgb,var(--accent) 25%,var(--line)); border-radius: 8px; padding: 9px 12px; }
.stage-jump a { color: var(--accent-deep); font-weight: 600; }

/* Single-column pages (after / preview): full readable width, no wasted half. */
.onecol .proposal { position: static; max-height: none; overflow: visible; max-width: 1040px; }

/* Annotate layout */
.annotate { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1.15fr); gap: 24px; align-items: start; }
/* Review reveal: wide AI-thoughts panel, narrower callout on the right. */
.annotate.review-split { grid-template-columns: minmax(0,2fr) minmax(0,1fr); }
.proposal { background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 20px 22px;
  position: sticky; top: 84px; max-height: calc(100vh - 100px); overflow-y: auto; box-shadow: var(--shadow); }
.proposal p, .proposal li { font-size: .92rem; line-height: 1.62; color: var(--muted); }
.back { color: var(--accent); text-decoration: none; font-family: var(--mono); font-size: .8rem;
  letter-spacing: .04em; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0; }
.tag { background: var(--bg3); color: var(--muted); border: 1px solid var(--line); border-radius: 5px;
  padding: 2px 9px; font-family: var(--mono); font-size: .72rem; }
.seed-meta { color: var(--faint); font-size: .84rem; margin: 4px 0 0; }
.source { border-top: 1px solid var(--line); padding: 10px 0; }
.source .role { background: var(--accent-soft); color: var(--accent-deep); border-radius: 5px; padding: 2px 7px;
  font-family: var(--mono); font-size: .66rem; letter-spacing: .08em; text-transform: uppercase; margin-right: 7px; }
.source .summary { color: var(--muted); font-size: .88rem; margin: 5px 0; line-height: 1.55; }
.seed-meta strong, .source .summary strong { color: var(--muted); font-weight: 600; }
.source summary { color: var(--accent); cursor: pointer; font-family: var(--mono); font-size: .78rem; }
/* Section headers inside the proposal — mono teal eyebrows, like the main site */
.proposal h2 { font-family: var(--mono); font-size: .7rem; letter-spacing: .13em; text-transform: uppercase;
  color: var(--accent); font-weight: 600; margin: 16px 0 7px; }
.proposal h1 { font-family: var(--display); font-weight: 600; font-size: 1.7rem; line-height: 1.14; letter-spacing: 0; color: var(--ink); }
.reasoning summary { color: var(--accent); cursor: pointer; font-family: var(--mono); font-size: .78rem; }
.reasoning { margin-top: 14px; }

/* Scoring column */
.scoring { background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; box-shadow: var(--shadow); }
.scoring .nav { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; font-size: .9rem; }
.scoring .nav a { color: var(--accent); text-decoration: none; font-family: var(--mono); font-size: .8rem; }
.scoring .task-brief { font-size: .88rem; line-height: 1.55; color: var(--muted); background: var(--bg3);
  border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 8px; padding: 11px 13px; margin: 0 0 16px; }
.scoring fieldset { border: 1px solid var(--line); border-radius: 10px; margin: 0 0 16px; padding: 14px 16px; }
.scoring legend { font-weight: 600; padding: 0 6px; font-size: 1rem; }
.scoring .rubric { font-size: .76rem; color: var(--faint); margin: 0 0 6px; font-family: var(--mono); }
.scoring label { margin-right: 12px; }
.scoring textarea, .scoring input.reach { width: 100%; margin-top: 8px; border: 1px solid var(--line-2);
  border-radius: 8px; padding: 9px 11px; font-family: inherit; font-size: .9rem; line-height: 1.5;
  background: var(--bg2); color: var(--ink); }
.scoring input.reach { margin: 2px 0 8px; }
.scoring button { width: 100%; }

/* AI verdict block — the object under judgment */
.scoring .verdict { background: var(--accent-soft); border: 1px solid color-mix(in srgb,var(--accent) 25%,var(--line));
  border-radius: 10px; padding: 11px 13px; margin: 4px 0 12px; }
.scoring .verdict-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; margin-bottom: 6px; }
.scoring .verdict .ai-tag { color: var(--accent-deep); font-weight: 600; font-family: var(--mono); font-size: .66rem;
  text-transform: uppercase; letter-spacing: .1em; }
.scoring .verdict .ai-score { color: var(--muted); font-size: .88rem; }
.scoring .verdict .ai-score strong { font-size: 1.05rem; color: var(--ink); }
.scoring .verdict .rubric { flex-basis: 100%; margin: 0; }
.scoring .ai-reason { margin: 0; font-size: .9rem; line-height: 1.62; color: var(--ink); }

.scoring .ask { margin: 12px 0 6px; font-weight: 400; font-size: .92rem; color: var(--ink); line-height: 1.5; }
.scoring .verdict-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.scoring .verdict-choice .choice { margin: 0; display: block; cursor: pointer; }
.scoring .verdict-choice input { position: absolute; opacity: 0; width: 0; height: 0; }
.scoring .verdict-choice .choice > span { display: block; border: 1px solid var(--line-2); border-radius: 8px;
  padding: 9px 11px; font-weight: 600; font-size: .92rem; background: var(--bg2); line-height: 1.3; transition: .12s; }
.scoring .verdict-choice .choice small { display: block; font-weight: 400; font-size: .76rem; color: var(--faint); margin-top: 2px; }
.scoring .verdict-choice .agree input:checked + span { border-color: var(--green);
  background: var(--green-soft); color: var(--green); box-shadow: inset 0 0 0 1px var(--green); }
.scoring .verdict-choice .disagree input:checked + span { border-color: var(--rose);
  background: color-mix(in srgb,var(--rose) 8%,var(--bg2)); color: var(--rose); box-shadow: inset 0 0 0 1px var(--rose); }
.scoring .verdict-choice input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

.scoring .correction { margin-top: 12px; }
.scoring .correction-label { margin: 0; font-size: .8rem; font-weight: 600; color: var(--rose); }
.scoring fieldset.has-review .correction { display: none; }
.scoring fieldset.has-review.mode-own .correction { display: block; }
.scoring fieldset.mode-agree .correction { display: none; }
.scoring .score-row { margin-top: 4px; }

.scoring .guide { font-size: .82rem; color: var(--muted); margin: 8px 0; }
.scoring .guide summary { cursor: pointer; color: var(--accent); font-family: var(--mono); }
.scoring .guide p { margin: 6px 0; }
.scoring .guide ul { margin: 6px 0; padding-left: 18px; }

.scoring .confidence-opts label { display: flex; gap: 8px; align-items: flex-start; margin: 0 0 10px;
  font-size: .84rem; line-height: 1.45; cursor: pointer; }
.scoring .confidence-opts input[type="radio"] { margin: 3px 0 0; flex: 0 0 auto; accent-color: var(--accent); }
.scoring .confidence-opts strong { color: var(--accent-deep); }
.scoring input[type="radio"], .scoring input[type="checkbox"] { accent-color: var(--accent); }

/* ---- stage 2 ---- */
.proposal pre.code { background: var(--bg3); border: 1px solid var(--line); border-radius: 8px;
  padding: 11px 13px; overflow-x: auto; font-size: .76rem; line-height: 1.55; font-family: var(--mono);
  color: var(--ink); margin: 6px 0; }
.proposal pre.code.prose { white-space: pre-wrap; overflow-wrap: break-word; overflow-x: visible;
  font-size: .86rem; line-height: 1.62; font-family: var(--font); color: var(--muted); }
.code-summary { border: 1px solid color-mix(in srgb,var(--accent) 25%,var(--line)); background: var(--accent-soft); border-radius: 8px; margin: 6px 0; }
.code-summary > summary { cursor: pointer; padding: 8px 11px; font-size: .85rem; font-weight: 600;
  color: var(--accent-deep); font-family: var(--mono); }
.code-summary > summary:hover { background: color-mix(in srgb,var(--accent) 12%,var(--bg2)); border-radius: 8px; }
.code-summary .cs-body { padding: 0 13px 10px; }
.code-summary .cs-purpose { font-size: .88rem; line-height: 1.6; color: var(--ink); margin: 0 0 8px; }
.code-summary .cs-h { font-family: var(--mono); font-size: .68rem; text-transform: uppercase; letter-spacing: .09em;
  color: var(--accent); font-weight: 600; margin: 8px 0 3px; }
.code-summary ul { margin: 0; padding-left: 18px; }
.code-summary li { font-size: .85rem; line-height: 1.55; color: var(--muted); margin-bottom: 3px; }
.code-summary ul.cs-notes li { color: var(--amber); }
/* ---- prominent "open the environment" callout ---- */
.env-callout { display: flex; align-items: center; justify-content: space-between; gap: 16px;
  flex-wrap: wrap; margin: 16px 0 4px; padding: 16px 18px; border-radius: 12px;
  background: var(--accent-soft); border: 1px solid color-mix(in srgb,var(--accent) 30%,var(--line)); }
.env-callout-txt { font-size: .92rem; color: var(--ink); line-height: 1.45; max-width: 46ch; }
.env-callout-txt strong { display: block; font-size: 1rem; color: var(--accent-deep); margin-bottom: 2px; }
.env-callout-btn { flex: none; background: var(--accent); color: var(--accent-ink); border: 0;
  border-radius: 9px; padding: 12px 18px; font-family: var(--mono); font-size: .84rem; font-weight: 500;
  cursor: pointer; box-shadow: var(--shadow); transition: background .15s; }
.env-callout-btn:hover { background: var(--accent-deep); }

/* ---- IDE-style environment code drawer ---- */
.ide-open { display: inline-flex; align-items: center; gap: 8px; background: var(--bg2);
  color: var(--accent-deep); border: 1px solid color-mix(in srgb,var(--accent) 32%,var(--line));
  border-radius: 9px; padding: 10px 16px; font-family: var(--mono); font-size: 0.82rem;
  cursor: pointer; box-shadow: var(--shadow); }
.ide-open:hover { border-color: var(--accent); background: var(--accent-soft); }
.ide-overlay { position: fixed; inset: 0; z-index: 60; display: flex; justify-content: flex-end;
  background: rgba(32,29,24,.45); }
.ide-overlay[hidden] { display: none; }
.ide-panel { width: min(72vw, 940px); height: 100%; display: flex; flex-direction: column;
  background: #1e2127; color: #d7dae0; box-shadow: -24px 0 70px rgba(0,0,0,.45);
  animation: ide-in .16s ease-out; }
@keyframes ide-in { from { transform: translateX(24px); opacity: .6; } to { transform: none; opacity: 1; } }
.ide-bar { display: flex; align-items: center; justify-content: space-between; padding: 11px 16px;
  background: #171a1f; border-bottom: 1px solid #2a2e37; }
.ide-title { font-family: var(--mono); font-size: 0.76rem; color: #8a93a2; }
.ide-close { background: none; border: 0; color: #8a93a2; font-size: 1rem; cursor: pointer;
  padding: 2px 8px; border-radius: 5px; }
.ide-close:hover { background: #2a2e37; color: #fff; }
.ide-body { display: flex; flex: 1; min-height: 0; }
.ide-files { width: 220px; flex: none; background: #191c22; border-right: 1px solid #2a2e37;
  padding: 8px 0; overflow-y: auto; }
.ide-group { font-family: var(--mono); font-size: 0.62rem; letter-spacing: 0.1em;
  text-transform: uppercase; color: #5f6875; padding: 12px 16px 4px; }
.ide-file { padding: 7px 16px; font-family: var(--mono); font-size: 0.8rem; color: #9aa4b2;
  cursor: pointer; white-space: nowrap; border-left: 2px solid transparent; }
.ide-file:hover { background: #22262e; color: #d7dae0; }
.ide-file.active { background: #2a2e37; color: #fff; border-left-color: var(--accent); }
.ide-code { flex: 1; margin: 0; padding: 16px 20px; overflow: auto; white-space: pre;
  font-family: var(--mono); font-size: 0.8rem; line-height: 1.6; color: #d7dae0; background: #1e2127; }
@media (max-width: 760px) { .ide-panel { width: 100vw; } .ide-files { width: 150px; } }

.scoreboard table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.scoreboard th, .scoreboard td { text-align: left; padding: 7px 9px; border-bottom: 1px solid var(--line); }
.scoreboard th { font-family: var(--mono); font-size: .68rem; text-transform: uppercase; letter-spacing: .08em;
  color: var(--faint); font-weight: 500; background: var(--bg3); }
.scoreboard td.num { font-variant-numeric: tabular-nums; font-weight: 600; font-family: var(--mono); }
.scoreboard tr.ref { background: var(--accent-soft); }
.scoreboard tr.ref td.num { color: var(--accent-deep); }
.scoreboard tr.solver td.num { color: var(--campus); }
.scoreboard-note { font-size: .82rem; color: var(--muted); margin: 6px 0 0; font-family: var(--mono); }
.solver-round > summary { cursor: pointer; color: var(--accent); font-weight: 600; margin-top: 6px; font-family: var(--mono); font-size: .85rem; }
.solver-round .summary { font-size: .88rem; color: var(--muted); margin: 6px 0; }
.scoring .verdict.no-ai { background: color-mix(in srgb,var(--amber) 10%,var(--bg2)); border-color: color-mix(in srgb,var(--amber) 35%,var(--line)); }
.scoring .verdict.no-ai .ai-reason { color: var(--ink); }
.scoring .ai-tag.warn { color: var(--amber); }
.scoring .axes { margin: 6px 0; padding-left: 0; list-style: none; font-size: .84rem; }
.scoring .axes li { margin-bottom: 2px; color: var(--muted); }
.scoring .ax-pass { color: var(--green); font-weight: 700; margin-right: 6px; }
.scoring .ax-fail { color: var(--rose); font-weight: 700; margin-right: 6px; }

.scoring .nov-refs { font-size: .84rem; margin: 8px 0; }
.scoring .nov-refs > summary { color: var(--accent); cursor: pointer; font-family: var(--mono); }
.scoring .nov-refs ol { margin: 6px 0 0; padding-left: 20px; }
.scoring .nov-refs li { margin-bottom: 6px; line-height: 1.5; }
.scoring .nov-refs p { color: var(--muted); margin: 4px 0 0; }

@media (max-width: 900px) {
  .annotate { grid-template-columns: 1fr; }
  .proposal { position: static; max-height: none; overflow: visible; }
  .scoring .verdict-choice { grid-template-columns: 1fr; }
}

/* Topic suggestions */
.topic-box { background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; margin-bottom: 16px; box-shadow: var(--shadow); }
.topic-box > summary { font-weight: 600; cursor: pointer; }
.topic-intro { color: var(--muted); font-size: .9rem; margin: 8px 0 12px; }
.topic-box .enter-form { max-width: 520px; }
.topic-list { list-style: none; padding: 0; margin: 16px 0 0; }
.topic-item { border-top: 1px solid var(--line); padding: 10px 0; }
.topic-name { font-weight: 600; }
.topic-notes { color: var(--muted); margin: 4px 0 0; white-space: pre-wrap; }
.topic-meta { color: var(--faint); font-size: .78rem; font-family: var(--mono); }
.topic-empty { color: var(--faint); margin: 12px 0 0; }
.topic-status { font-family: var(--mono); font-size: .68rem; text-transform: uppercase; letter-spacing: .06em;
  border-radius: 999px; padding: 2px 9px; margin-left: 8px; vertical-align: middle; }
.status-pending  { background: var(--bg3); color: var(--muted); }
.status-running  { background: color-mix(in srgb,var(--amber) 16%,var(--bg2)); color: var(--amber); }
.status-accepted { background: var(--green-soft); color: var(--green); }
.topic-edit { margin-top: 8px; }
.topic-edit > summary { font-size: .82rem; color: var(--accent); cursor: pointer; font-family: var(--mono); }
.topic-edit .enter-form { max-width: 520px; margin-top: 8px; }
.topic-admin { display: flex; gap: 6px; margin-top: 8px; }
.topic-admin button { font-family: var(--mono); font-size: .72rem; padding: 4px 12px; background: var(--bg2);
  color: var(--muted); border: 1px solid var(--line-2); border-radius: 999px; cursor: pointer; }
.topic-admin button:hover { border-color: var(--accent); color: var(--accent-deep); }
.topic-admin button[disabled] { background: var(--bg3); color: var(--faint); cursor: default; border-color: var(--line); }
