:root {
  --ink: #1c1a17;
  --paper: #f7f4ee;
  --card: #fffdf9;
  --rule: #d9d2c5;
  --accent: #7a2e1d;        /* terracotta — Q&A mode */
  --accent-soft: #f0e3dd;
  --creative: #3a4a6b;      /* indigo — continuation mode */
  --creative-soft: #e4e8f1;
  --muted: #6b645a;
  --ls: #2f6f4e;            /* parliamentary speech */
  --gov: #8a5a1a;           /* government statement */
  --press: #6b4fa0;         /* press release */
  --letter: #b03a5b;        /* cleared letter */
  --essay: #2a6b8a;         /* cleared essay */
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.6 Georgia, "Iowan Old Style", "Times New Roman", serif;
}

.wrap { max-width: 760px; margin: 0 auto; padding: 0 20px; }
/* .site-header is owned by components.css (the shared chrome nav). */

.mode-toggle { display: inline-flex; border: 1px solid var(--rule); border-radius: 8px; overflow: hidden; }
.mode-btn {
  font: inherit; font-size: 15px; background: transparent; border: none; cursor: pointer;
  padding: 8px 16px; color: var(--muted); display: flex; flex-direction: column; align-items: flex-start;
}
.mode-btn + .mode-btn { border-left: 1px solid var(--rule); }
.mode-btn .mode-hint { font-size: 11px; opacity: 0.7; }
.mode-btn.active { background: var(--accent); color: #fff; }
#app[data-mode="continuation"] .mode-btn#mode-continuation.active { background: var(--creative); }

main.wrap { padding-top: 22px; padding-bottom: 60px; }

.creative-banner {
  background: var(--creative-soft); border: 1px solid var(--creative); color: var(--creative);
  padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; font-size: 14px;
}

#ask-form { display: flex; gap: 10px; align-items: stretch; }
#question {
  flex: 1; font: inherit; padding: 12px 14px; border: 1px solid var(--rule);
  border-radius: 8px; background: var(--card); resize: vertical; min-height: 52px;
}
#ask-btn {
  font: inherit; font-size: 16px; padding: 0 22px; border: none; border-radius: 8px;
  background: var(--accent); color: #fff; cursor: pointer;
}
#app[data-mode="continuation"] #ask-btn { background: var(--creative); }
#ask-btn:disabled { opacity: 0.5; cursor: default; }

.status { color: var(--muted); font-style: italic; margin: 16px 2px; }

.answer { margin-top: 22px; }
.answer-disclaimer {
  background: var(--creative-soft); border-left: 3px solid var(--creative); color: var(--creative);
  padding: 8px 12px; border-radius: 4px; margin-bottom: 12px; font-size: 14px; font-weight: bold;
}
.answer-body {
  background: var(--card); border: 1px solid var(--rule); border-radius: 10px;
  padding: 18px 20px; font-size: 18px; line-height: 1.7;
}
.answer-body.declined { color: var(--muted); font-style: italic; }
.audio-source-badge {
  font-family: var(--sans); font-size: 13px; line-height: 1.45;
  background: #efe4d3; color: #6b4a1a; border: 1px solid #e0cba8;
  border-radius: 8px; padding: 8px 12px; margin-bottom: 14px;
}
.audio-source-badge a { color: var(--accent); font-weight: 600; white-space: nowrap; }
.cite-marker {
  cursor: pointer; color: var(--accent); font-weight: bold; font-size: 0.7em;
  vertical-align: super; padding: 0 1px; text-decoration: none;
}
.cite-marker:hover { text-decoration: underline; }

.decline-actions { margin-top: 14px; }
.continuation-cta {
  font: inherit; font-size: 15px; padding: 9px 16px; border: 1px solid var(--creative);
  background: var(--creative-soft); color: var(--creative); border-radius: 8px; cursor: pointer;
}

.citation-list { list-style: none; padding: 0; margin: 18px 0 0; }
.citation-list li {
  border: 1px solid var(--rule); border-radius: 8px; padding: 10px 12px; margin-bottom: 8px;
  background: var(--card); cursor: pointer; font-size: 14px;
}
.citation-list li:hover { border-color: var(--accent); }
.cite-num { font-weight: bold; color: var(--accent); margin-right: 6px; }

.badge {
  display: inline-block; font-size: 11px; font-weight: bold; letter-spacing: 0.03em;
  text-transform: uppercase; padding: 2px 7px; border-radius: 10px; color: #fff; margin-right: 6px;
}
.badge.parliamentary_speech { background: var(--ls); }
.badge.government_statement { background: var(--gov); }
.badge.press_release { background: var(--press); }
.badge.cleared_letter { background: var(--letter); }
.badge.cleared_essay { background: var(--essay); }
.cite-meta { color: var(--muted); }

.citation-panel {
  position: fixed; top: 0; right: 0; width: min(460px, 92vw); height: 100vh; overflow-y: auto;
  background: var(--card); border-left: 1px solid var(--rule); box-shadow: -8px 0 30px rgba(0,0,0,0.12);
  padding: 24px 24px 60px; z-index: 20;
}
.panel-close {
  position: absolute; top: 12px; right: 16px; font-size: 28px; line-height: 1; border: none;
  background: none; cursor: pointer; color: var(--muted);
}
.panel-title { font-size: 16px; margin: 4px 0 12px; }
.panel-context {
  border-top: 1px solid var(--rule); margin-top: 14px; padding-top: 14px; font-size: 16px; line-height: 1.7;
}
.panel-row { font-size: 14px; color: var(--muted); margin: 4px 0; }
.panel-row b { color: var(--ink); }
.cleared-basis { font-size: 13px; color: var(--muted); font-style: italic; margin-top: 8px; }

.site-footer { color: var(--muted); font-size: 13px; border-top: 1px solid var(--rule); padding: 18px 20px 40px; }
