/* Verity: calm, boardroom-quiet. Warm paper, deep ink, a little brass.
   Brand colours are the tokens below; a white-label version changes these and config.js. */
:root {
  --paper: #f4f1ea;
  --surface: #fbfaf6;
  --ink: #18212b;
  --ink-soft: #3e4a56;
  --muted: #5d6873;
  --line: #ddd6c8;
  --line-strong: #c4bba9;
  --accent: #8a6a2f; /* brass */
  --accent-deep: #6b5022;
  --accent-tint: #efe6d3;
  --good: #2f6b4e;
  --good-tint: #e1eee5;
  --warn: #8a5a12;
  --warn-tint: #f6ead2;
  --bad: #9b3426;
  --bad-tint: #f7e1dc;
  --maker: #d9620f;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --radius: 14px;
  --shadow: 0 1px 2px rgb(24 33 43 / 0.05), 0 10px 30px rgb(24 33 43 / 0.07);
  color-scheme: light;
}

* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
html,
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
}
body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.muted {
  color: var(--muted);
}
.small {
  font-size: 0.85rem;
}
a {
  color: var(--accent-deep);
}
button {
  font: inherit;
}
button:focus-visible,
a:focus-visible,
textarea:focus-visible,
input:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Header ---------------------------------------------------------------- */
.top {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 28px 20px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.wordmark {
  font-family: var(--serif);
  font-size: 1.7rem;
  letter-spacing: 0.01em;
  color: var(--ink);
  text-decoration: none;
}
.topnav {
  display: flex;
  align-items: center;
  gap: 4px 6px;
  flex-wrap: wrap;
}
.navlink {
  background: none;
  border: 0;
  color: var(--ink-soft);
  font-size: 0.9rem;
  padding: 6px 10px;
  border-radius: 999px;
  cursor: pointer;
}
.navlink:hover {
  color: var(--accent-deep);
  background: var(--surface);
}
.key-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}
.key-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--line-strong);
}
.key-btn.set .key-dot {
  background: var(--good);
}

/* Page ------------------------------------------------------------------ */
.page {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 56px 20px 40px;
  flex: 1;
}
.intro h1 {
  font-family: var(--sans);
  font-weight: 650;
  font-size: clamp(30px, 4.6vw, 46px);
  line-height: 1.1;
  letter-spacing: -0.035em;
  margin: 0 0 14px;
}
.lede {
  max-width: 40rem;
  margin: 0 0 32px;
  color: var(--ink-soft);
  font-size: 1.05rem;
}

/* The question form ------------------------------------------------------- */
.ask {
  max-width: 820px;
}
textarea,
input[type="password"] {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 16px 18px;
  resize: vertical;
}
#decision {
  font-size: 1.15rem;
  box-shadow: var(--shadow);
}
textarea::placeholder,
input::placeholder {
  color: var(--muted);
}
.more {
  margin: 14px 0 0;
}
.more summary {
  cursor: pointer;
  color: var(--ink-soft);
  font-size: 0.92rem;
}
.more-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 12px;
}
.more-grid label {
  font-size: 0.85rem;
  color: var(--ink-soft);
  display: grid;
  gap: 6px;
}
.more-grid .wide {
  grid-column: 1 / -1;
}
.more-grid textarea {
  font-size: 0.95rem;
  padding: 12px 14px;
}

.drop {
  margin: 18px 0 0;
  padding: 22px;
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius);
  text-align: center;
  background: color-mix(in srgb, var(--surface) 60%, transparent);
  transition: border-color 0.15s, background 0.15s;
}
.drop p {
  margin: 2px 0;
}
.drop.over {
  border-color: var(--accent);
  background: var(--accent-tint);
}
.linkish {
  background: none;
  border: 0;
  padding: 0;
  color: var(--accent-deep);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.docs {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: grid;
  gap: 6px;
}
.doc {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 0.92rem;
}
.doc-name {
  font-weight: 600;
  overflow-wrap: anywhere;
}
.doc-meta {
  color: var(--muted);
  font-size: 0.85rem;
}
.doc-warn {
  color: var(--warn);
  font-size: 0.85rem;
}
.doc .remove {
  margin-left: auto;
  background: none;
  border: 0;
  color: var(--muted);
  font-size: 1.2rem;
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex: none;
}
.doc .remove:hover {
  color: var(--bad);
  background: var(--bad-tint);
}
.doc.reading {
  color: var(--muted);
}

.seats {
  border: 0;
  padding: 0;
  margin: 22px 0 0;
}
.seats legend {
  font-size: 0.9rem;
  color: var(--ink-soft);
  margin-bottom: 8px;
  padding: 0;
}
.seat-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.seat {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  font-size: 0.92rem;
}
.seat .dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--seat);
}
.seat .co {
  color: var(--muted);
  font-size: 0.82rem;
}
.seat[aria-pressed="false"] {
  opacity: 0.45;
  background: transparent;
}

.toggle {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 18px 0 0;
  font-size: 0.92rem;
  color: var(--ink-soft);
  cursor: pointer;
}
.toggle input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--accent);
  flex: none;
}

.go {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin: 26px 0 0;
}
.estimate {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.92rem;
  max-width: 34rem;
}
.primary {
  background: var(--ink);
  color: #fff;
  border: 0;
  border-radius: 999px;
  padding: 14px 30px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}
.primary:hover {
  background: var(--accent-deep);
}
.primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.primary.small,
.secondary.small {
  padding: 8px 16px;
  font-size: 0.88rem;
}
.secondary {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 10px 20px;
  cursor: pointer;
}
.secondary:hover {
  border-color: var(--accent);
  color: var(--accent-deep);
}
.form-error {
  color: var(--bad);
  margin: 12px 0 0;
  min-height: 1.2em;
}

/* The run ------------------------------------------------------------------ */
.run {
  margin-top: 48px;
}
.run-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.steps {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: step;
}
.steps li {
  counter-increment: step;
  font-size: 0.9rem;
  color: var(--muted);
  padding: 6px 14px 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
}
.steps li::before {
  content: counter(step);
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--line);
  color: var(--ink);
  font-size: 0.75rem;
}
.steps li.active {
  color: var(--ink);
  border-color: var(--accent);
}
.steps li.active::before {
  background: var(--accent);
  color: #fff;
}
.steps li.done {
  color: var(--good);
}
.steps li.done::before {
  content: "✓";
  background: var(--good);
  color: #fff;
}
.run-note {
  flex-basis: 100%;
  order: 3;
  margin: 0;
  color: var(--bad);
  font-size: 0.92rem;
}
.run-note:empty {
  display: none;
}
.run-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.spent {
  color: var(--muted);
  font-size: 0.88rem;
}

.brief {
  margin: 28px 0 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 28px 34px 34px;
}
.brief-tools {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.checks {
  margin: 0;
  font-size: 0.9rem;
  color: var(--ink-soft);
}
.exports {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.round {
  margin-top: 40px;
}
.round h2 {
  font-family: var(--sans);
  font-weight: 650;
  letter-spacing: -0.035em;
  font-size: 1.5rem;
  margin: 0 0 14px;
}
.round h2 .muted {
  font-family: var(--sans);
  font-size: 0.9rem;
}
.cards {
  display: grid;
  gap: 10px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--seat);
  border-radius: 12px;
}
.card summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  cursor: pointer;
  list-style: none;
}
.card summary::-webkit-details-marker {
  display: none;
}
.card .who {
  font-weight: 600;
}
.card .co {
  color: var(--muted);
  font-size: 0.85rem;
}
.card .state {
  margin-left: auto;
  font-size: 0.85rem;
  color: var(--muted);
  text-align: right;
}
.card.failed .state {
  color: var(--bad);
}
.card.working .state::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 8px;
  background: var(--accent);
  animation: pulse 1.2s ease-in-out infinite;
}
.card .md {
  padding: 0 22px 18px;
  border-top: 1px solid var(--line);
}
@keyframes pulse {
  50% {
    opacity: 0.25;
  }
}

.again {
  margin: 36px 0 0;
}
.more-why {
  margin: -6px 0 12px;
  font-style: italic;
  color: var(--ink-soft);
}

/* Parting thoughts: footnote-like, under the brief. */
.parting {
  margin: 26px 0 0;
  padding: 14px 0 0;
  border-top: 1px solid var(--line);
  font-size: 0.88rem;
  color: var(--ink-soft);
}
.parting-head {
  margin: 0 0 8px;
  font-family: var(--serif);
  font-style: italic;
  color: var(--muted);
}
.parting ol {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 6px;
}
.parting li {
  padding-left: 10px;
  border-left: 3px solid var(--seat, var(--line-strong));
}
.parting-who {
  font-weight: 600;
  color: var(--seat, var(--ink));
  margin-right: 4px;
}
.report {
  display: none;
}

/* Rendered answers ----------------------------------------------------------- */
.md {
  font-size: 0.97rem;
  line-height: 1.6;
}
.md h3,
.md h4,
.md h5 {
  font-family: var(--sans);
  font-weight: 650;
  letter-spacing: -0.02em;
  margin: 20px 0 6px;
}
.md h3 {
  font-size: 1.6rem;
}
.md h4 {
  font-size: 1.2rem;
}
.md h5 {
  font-size: 1.05rem;
}
.md p,
.md ul,
.md ol {
  margin: 8px 0;
}
.md li {
  margin: 4px 0;
}
.cite {
  padding: 1px 6px;
  border-radius: 6px;
  font-size: 0.92em;
}
.cite-mark {
  font-weight: 700;
  margin-right: 4px;
}
.cite-where {
  color: var(--muted);
  font-size: 0.88em;
  white-space: nowrap;
}
.cite.verified {
  background: var(--good-tint);
}
.cite.verified .cite-mark {
  color: var(--good);
}
.cite.elsewhere {
  background: var(--warn-tint);
}
.cite.elsewhere .cite-mark {
  color: var(--warn);
}
.cite.not-found,
.cite.unknown-file {
  background: var(--bad-tint);
}
.cite.not-found .cite-mark,
.cite.unknown-file .cite-mark {
  color: var(--bad);
}
.sources {
  margin: 10px 0 0;
  padding: 10px 0 0;
  border-top: 1px dashed var(--line);
  font-size: 0.88rem;
}

/* Panels --------------------------------------------------------------- */
.panel {
  width: min(560px, calc(100vw - 24px));
  max-height: calc(100vh - 40px);
  border: 0;
  border-radius: 18px;
  padding: 30px 30px 26px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 30px 80px rgb(24 33 43 / 0.3);
}
.panel::backdrop {
  background: rgb(24 33 43 / 0.45);
  backdrop-filter: blur(2px);
}
.panel h2 {
  font-family: var(--sans);
  font-weight: 650;
  letter-spacing: -0.035em;
  font-size: 1.5rem;
  margin: 0 44px 14px 0;
}
.panel .close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 0;
  background: var(--paper);
  font-size: 1.2rem;
  cursor: pointer;
}
.panel-list {
  margin: 0;
  padding-left: 1.2em;
  display: grid;
  gap: 10px;
  color: var(--ink-soft);
}
.panel-list b {
  color: var(--ink);
}
.panel-note {
  margin: 16px 0 0;
  color: var(--ink-soft);
  font-size: 0.92rem;
}
.key-form {
  display: grid;
  gap: 12px;
  margin: 14px 0;
}
.key-form input[type="password"] {
  padding: 12px 14px;
  font-family: ui-monospace, Menlo, monospace;
}
.key-row {
  display: flex;
  gap: 8px;
}
.key-status {
  margin: 0;
  min-height: 1.2em;
  font-size: 0.9rem;
}
.key-status.bad {
  color: var(--bad);
}
.key-status.good {
  color: var(--good);
}

/* Footer: the maker's mark, small, bottom left --------------------------------- */
.foot {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 24px 20px 32px;
}
.maker {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--maker);
}
.maker img {
  width: 26px;
  height: auto;
}

@media (max-width: 640px) {
  .page {
    padding-top: 36px;
  }
  .more-grid {
    grid-template-columns: 1fr;
  }
  .go {
    flex-direction: column;
    align-items: stretch;
  }
  .primary {
    width: 100%;
  }
  .brief {
    padding: 22px 18px 26px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .card.working .state::before {
    animation: none;
  }
}

/* Printing: the report. Prompt, synthesis, parting thoughts, then the complete conversation in two columns.
   Colour marks names and narrow rules only, so it reads well in black and white. */
@page {
  size: letter;
  margin: 0.75in 0.7in 0.8in;
  @bottom-left {
    content: "Decision report";
    font: 7.5pt Georgia, serif;
    color: #777;
  }
  @bottom-right {
    content: counter(page) " of " counter(pages);
    font: 7.5pt Georgia, serif;
    color: #777;
  }
}
@media print {
  html,
  body {
    background: #fff;
  }
  body.print-report > *:not(.report) {
    display: none !important;
  }
  body.print-report .report {
    display: block;
    color: #111;
    font: 10pt/1.42 "Times New Roman", Times, Georgia, serif;
  }
  .report a {
    color: #111;
    text-decoration: underline;
    text-decoration-color: #999;
  }
  .r-date,
  .r-kicker {
    font: 8pt/1.3 var(--sans);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #555;
    margin: 0 0 6pt;
  }
  .r-prompt h1 {
    font: 400 20pt/1.2 "Times New Roman", Times, serif;
    margin: 0 0 8pt;
  }
  .r-prompt p {
    margin: 3pt 0;
  }
  .r-label {
    font-weight: 700;
  }
  .r-synthesis {
    margin: 20pt 0 0;
    padding: 14pt 0 0;
    border-top: 1.5pt solid #111;
    font-size: 12.5pt;
    line-height: 1.5;
  }
  .r-synthesis h3 {
    font: 400 17pt/1.2 "Times New Roman", serif;
    margin: 0 0 8pt;
  }
  .r-synthesis h4 {
    font: 700 11pt/1.3 "Times New Roman", serif;
    margin: 12pt 0 3pt;
  }
  .report .parting {
    margin: 16pt 0 0;
    padding: 10pt 0 0;
    border-top: 0.5pt solid #999;
    font-size: 9pt;
    color: #222;
    break-inside: avoid;
  }
  .report .parting li {
    border-left-width: 2pt;
  }
  .r-transcript {
    margin: 22pt 0 0;
    padding: 12pt 0 0;
    border-top: 1.5pt solid #111;
  }
  .r-round {
    column-count: 2;
    column-gap: 18pt;
    column-rule: 0.5pt solid #ccc;
    margin: 0 0 14pt;
  }
  .r-round h2 {
    column-span: all;
    font: 700 11.5pt/1.3 "Times New Roman", serif;
    margin: 6pt 0 8pt;
  }
  .r-entry {
    break-inside: avoid;
    margin: 0 0 9pt;
    padding-left: 6pt;
    border-left: 2pt solid var(--seat, #999);
  }
  .r-entry h3 {
    font: 700 9.5pt/1.3 var(--sans);
    color: var(--seat, #111);
    margin: 0 0 2pt;
  }
  .r-entry h3 span {
    font-weight: 400;
    color: #666;
  }
  .r-entry p,
  .r-entry ul,
  .r-entry ol {
    margin: 2pt 0;
  }
  .r-entry ul,
  .r-entry ol {
    padding-left: 12pt;
  }
  .r-entry h3 ~ h3,
  .r-entry h4,
  .r-entry h5 {
    font-size: 10pt;
    margin: 4pt 0 1pt;
  }
  .r-sources {
    font-size: 8pt;
    color: #444;
  }
  .r-failed {
    font-style: italic;
    color: #555;
  }
  .r-meta {
    font: 7.5pt/1.4 var(--sans);
    color: #666;
    margin: 12pt 0 0;
  }
  /* Quote-check marks stay legible without colour: the ✓ ≈ ✗ symbol carries the meaning. */
  .report .cite {
    background: none;
    padding: 0;
  }
  .report .cite-where {
    white-space: normal;
  }
}

/* Adding advisors from OpenRouter's list. */
.seat.add-seat {
  border-style: dashed;
  color: var(--accent-deep);
  background: transparent;
}
.add-list {
  display: grid;
  gap: 4px;
  max-height: min(56vh, 460px);
  margin: 12px 0 0;
  padding: 0;
  overflow-y: auto;
  list-style: none;
}
.add-item {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.add-item:hover,
.add-item:focus-visible {
  border-color: var(--accent);
}
.add-item .co,
.add-price {
  color: var(--ink-soft);
  font-size: 0.82rem;
}
#add-search {
  width: 100%;
  box-sizing: border-box;
  margin-top: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}

/* The footer: the maker's mark beside the caveat and the note on where to send ideas. */
.foot {
  display: flex;
  align-items: center;
  gap: 14px;
  border-top: 1px solid var(--line);
}
.foot-text {
  color: var(--ink-soft);
  font-size: 0.8rem;
  line-height: 1.5;
}
.foot-text p {
  margin: 0;
}
.foot-text a {
  color: var(--accent-deep);
  font-weight: 600;
}
.maker img {
  width: 24px;
  height: auto;
  opacity: 0.85;
}

/* Added by this site: the three rooms, centred in the header, as in the other rooms. The filled
   pill is the room's name, so there is no separate wordmark. */
.top {
  display: grid;
  grid-template-columns: minmax(max-content, 1fr) auto minmax(max-content, 1fr);
}
.top .room-switch {
  grid-column: 2;
}
.top .topnav {
  grid-column: 3;
  justify-self: end;
}
.room-switch {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
}
.room-switch a {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 18px;
  border-radius: 999px;
  color: var(--ink-soft);
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.01em;
  text-decoration: none;
  white-space: nowrap;
}
.room-switch a:hover {
  color: var(--ink);
}
.room-switch a:focus-visible {
  outline: 2px solid #1c6b5c;
  outline-offset: 1px;
}
.room-switch a[aria-current="page"] {
  color: #ffffff;
  background: #1c6b5c;
}
@media (max-width: 1040px) {
  .top {
    grid-template-columns: 1fr;
  }
  .top .room-switch {
    grid-row: 2;
    grid-column: 1;
    justify-self: center;
  }
  .top .topnav {
    grid-row: 1;
    grid-column: 1;
  }
}
@media (max-width: 420px) {
  .room-switch a {
    padding: 0 11px;
    font-size: 13px;
  }
}
