:root {
  color-scheme: dark;
  --bg: #0b0d10;
  --panel: #13161b;
  --panel-2: #1a1e25;
  --border: #262b33;
  --text: #e8eaed;
  --muted: #9aa3af;
  --accent: #5b8def;
  --warn: #d9a441;
  --danger: #d96a6a;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

main {
  max-width: 640px;
  margin: 0 auto;
  padding: 24px 16px 64px;
}

h1 {
  font-size: 20px;
  margin: 0 0 4px;
}

.subtitle {
  color: var(--muted);
  font-size: 14px;
  margin: 0 0 24px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
}

.disclosure {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 16px;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--text);
}

.disclosure ul {
  margin: 8px 0 0;
  padding-left: 18px;
}

.disclosure li {
  margin-bottom: 4px;
}

.disclosure .write-warn {
  color: var(--warn);
  font-weight: 600;
}

label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
}

input[type="password"],
input[type="date"] {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 10px 12px;
  font-size: 15px;
  margin-bottom: 14px;
}

input[type="password"]:focus,
input[type="date"]:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.checkbox-row label {
  margin: 0;
  color: var(--text);
  font-size: 14px;
}

.row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

button {
  font-size: 14px;
  font-weight: 600;
  border-radius: 8px;
  border: 1px solid var(--border);
  padding: 10px 16px;
  cursor: pointer;
}

button.primary {
  background: var(--accent);
  color: #0b0d10;
  border-color: var(--accent);
}

button.primary:disabled {
  opacity: 0.5;
  cursor: default;
}

button.ghost {
  background: transparent;
  color: var(--danger);
  border-color: var(--danger);
}

.status {
  font-size: 13px;
  color: var(--muted);
  margin-top: 12px;
  min-height: 18px;
}

.status.error {
  color: var(--danger);
}

.status.ok {
  color: #7bc296;
}

#results {
  margin-top: 8px;
}

.convo-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 10px;
  background: var(--panel-2);
}

.convo-title {
  font-weight: 600;
  font-size: 15px;
  margin-bottom: 4px;
}

.convo-meta {
  font-size: 12.5px;
  color: var(--muted);
  margin-bottom: 6px;
}

.convo-summary {
  font-size: 13.5px;
  line-height: 1.5;
  margin-bottom: 6px;
}

.convo-quote {
  font-size: 13px;
  color: var(--muted);
  border-left: 2px solid var(--border);
  padding-left: 8px;
  margin: 4px 0;
}

.empty-state {
  color: var(--muted);
  font-size: 14px;
  padding: 8px 0;
}

/* The three-step loop, in plain words (design doc §5, 2.4) — calmer than the rest of the
   page on purpose: it is signage, not something you interact with. */
.loop-card {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 16px;
}

.loop-head {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}

.loop-step {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  font-size: 13px;
  line-height: 1.45;
  margin-bottom: 7px;
}

.loop-step:last-child {
  margin-bottom: 0;
}

.loop-step b {
  color: var(--text);
}

.loop-n {
  flex: 0 0 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(91, 141, 239, 0.18);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}

/* Game state (2.4) — points/streak/run status, and the accumulated awards for the active
   day. Awards persist across sweeps and across a reload (localStorage), unlike the raw
   conversation cards under #results which are rebuilt fresh every Sweep. */
.game-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  align-items: baseline;
  margin-bottom: 10px;
}

.game-stats .stat {
  font-size: 14px;
  font-weight: 600;
}

.game-stats .run-status {
  font-size: 13px;
  color: var(--muted);
  flex-basis: 100%;
}

.today-awards {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.today-awards:empty::before {
  content: "No awards yet this run — Sweep to look for some.";
  font-size: 13px;
  color: var(--muted);
}

.award-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.award-chip {
  display: inline-block;
  background: rgba(91, 141, 239, 0.15);
  border: 1px solid var(--accent);
  color: var(--accent);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 600;
}

.award-chip.award-error {
  background: rgba(217, 106, 106, 0.12);
  border-color: var(--danger);
  color: var(--danger);
  font-weight: 400;
}

/* Click-to-reveal (design §5, "each award clickable to the exact quote that earned it").
   Hidden by default, toggled by app.js — never innerHTML, just a hidden attribute flip. */
.award-detail {
  font-size: 12.5px;
  color: var(--muted);
  border-left: 2px solid var(--border);
  padding: 4px 0 4px 10px;
  margin: 4px 0 2px;
  max-width: 520px;
}

.after-action {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 16px;
}

.aar-heading {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 4px;
}

.aar-sub {
  font-size: 13px;
  color: var(--muted);
}

.detail-cap-notice {
  font-size: 12.5px;
  color: var(--warn);
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--warn);
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 12px;
}

/* 2026-09-03 (hub finding, round 2) — the AI-scoring status notice: what actually happened on
   the AI side this sweep (unavailable / failed / no-extra), same insertion pattern as
   .detail-cap-notice above. .ai-status-failed gets the danger color (a real error, not an
   informational note) — the other two kinds stay at .detail-cap-notice's warn weight. */
.ai-status-notice {
  font-size: 12.5px;
  color: var(--warn);
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--warn);
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 12px;
}

.ai-status-notice.ai-status-failed {
  color: var(--danger);
  border-left-color: var(--danger);
}

/* 2026-09-03 (hub finding, task 5b) — labels a run of conversation cards by calendar date so
   a Sweep result spanning more than one day (e.g. the 48h first-sweep lookback) never shows
   an unexplained "different day" card. */
.date-group-header {
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 16px 0 6px;
}

.date-group-header:first-child {
  margin-top: 0;
}

/* 2026-09-03 (hub finding, task 4) — a conversation Fieldy hasn't finished summarizing (or
   hasn't even diarized) yet. Says so plainly instead of rendering a blank-looking card. */
.convo-processing {
  font-size: 13px;
  color: var(--muted);
  font-style: italic;
}

footer {
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  margin-top: 32px;
}
