/* Broadsheet — the same tokens the Credits prototype uses, cut down to what a
   single static page needs. No build step, no framework, no external requests
   beyond the one webfont. */

@import url('https://fonts.googleapis.com/css2?family=Source+Serif+4:ital,wght@0,400;0,600;1,400&display=swap');

:root {
  --bg: #f3f2f2;
  --surface: #eae9e9;
  --text: #201e1d;
  --accent: #0088b0;
  --accent-700: #006786;
  --accent-100: #e9f8ff;
  --accent-200: #cbeeff;
  --accent-800: #004961;
  --flag: #d6006c;
  --flag-100: #fff1f4;
  --flag-200: #ffdee6;
  --flag-700: #aa0b56;
  --divider: color-mix(in srgb, #201e1d 16%, transparent);
  --muted: color-mix(in srgb, #201e1d 55%, transparent);
  --font: "Source Serif 4", Georgia, serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --shadow-md: 0 3px 10px color-mix(in srgb, #2d2b2b 16%, transparent);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #191817;
    --surface: #232120;
    --text: #efedec;
    --accent: #62c5ee;
    --accent-700: #99e0ff;
    --accent-100: #0a303e;
    --accent-200: #004961;
    --accent-800: #cbeeff;
    --flag: #ff90b1;
    --flag-100: #4b1528;
    --flag-200: #790e3d;
    --flag-700: #ffc0d0;
    --divider: color-mix(in srgb, #efedec 20%, transparent);
    --muted: color-mix(in srgb, #efedec 58%, transparent);
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.55;
  padding-bottom: 88px;
}

.wrap { max-width: 940px; margin: 0 auto; padding: 0 22px; }
a { color: var(--accent-700); }
h1, h2, h3 { font-weight: 600; letter-spacing: -0.015em; line-height: 1.15; }
h1 { font-size: 40px; margin: 0 0 6px; }
h2 { font-size: 22px; margin: 34px 0 10px; }
h3 { font-size: 17px; margin: 0; }
p { margin: 0 0 12px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: var(--mono); font-size: 12.5px; }

/* ── masthead ─────────────────────────────────────────────────────── */
header { padding: 40px 0 0; }
.rule-thick { height: 3px; background: var(--text); margin-top: 18px; }
.rule-thin { height: 1px; background: var(--text); }
.strapline {
  display: flex; flex-wrap: wrap; gap: 6px 18px; padding: 7px 0;
  font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase;
}

/* ── drop zone ────────────────────────────────────────────────────── */
.drop {
  margin: 26px 0; padding: 46px 24px; text-align: center; cursor: pointer;
  border: 2px dashed var(--divider); background: var(--surface);
  transition: border-color .18s, background .18s, transform .18s;
}
.drop:hover, .drop:focus-visible { border-color: var(--accent); outline: none; }
.drop.over { border-color: var(--accent); background: var(--accent-100); transform: scale(1.006); }
.drop h2 { margin: 0 0 6px; font-size: 24px; }
.drop input { display: none; }

/* ── buttons ──────────────────────────────────────────────────────── */
.btn {
  font-family: inherit; font-size: 14px; padding: 8px 16px; cursor: pointer;
  border: 1px solid var(--text); background: var(--text); color: var(--bg);
  border-radius: 2px; transition: transform .14s, opacity .18s;
}
.btn:hover { opacity: .86; }
.btn:active { transform: scale(.965); }
.btn.secondary { background: transparent; color: var(--text); }
.btn.small { font-size: 12.5px; padding: 5px 11px; }
.btn:disabled { opacity: .4; cursor: not-allowed; }

/* ── tags ─────────────────────────────────────────────────────────── */
.tag {
  display: inline-block; font-size: 10.5px; letter-spacing: .06em;
  text-transform: uppercase; padding: 2px 7px; border-radius: 2px;
  border: 1px solid var(--divider); white-space: nowrap;
}
.tag.suggested { background: var(--accent-100); color: var(--accent-800); border-color: transparent; }
.tag.unknown { background: var(--flag-100); color: var(--flag-700); border-color: transparent; }
.tag.done { background: var(--accent-200); color: var(--accent-800); border-color: transparent; }

/* ── summary ──────────────────────────────────────────────────────── */
.counts { display: flex; flex-wrap: wrap; gap: 30px; margin: 18px 0 6px; }
.count b { display: block; font-size: 34px; line-height: 1; font-weight: 600; }
.count span { font-size: 12px; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }

.layers { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 20px 0; }
.layer { border-left: 2px solid var(--divider); padding: 4px 0 4px 10px; font-size: 13px; }
.layer.on { border-left-color: var(--accent); }
.layer b { display: block; font-size: 12px; }
.layer.off { opacity: .5; }

/* ── pack cards ───────────────────────────────────────────────────── */
.pack { border-top: 1px solid var(--divider); padding: 20px 0; }
.pack:last-of-type { border-bottom: 1px solid var(--divider); }
.pack.accepted { opacity: .72; }
.pack-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.pack-head .spacer { margin-left: auto; }
.evidence { font-size: 13px; color: var(--muted); margin: 4px 0 0; }

.fields { display: flex; gap: 12px; flex-wrap: wrap; margin: 14px 0 4px; }
.field { flex: 1 1 210px; }
.field label { display: block; font-size: 11px; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); margin-bottom: 3px; }
.field input {
  width: 100%; font-family: inherit; font-size: 15px; padding: 6px 8px;
  border: 1px solid var(--divider); background: var(--bg); color: var(--text); border-radius: 2px;
}
.field input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }

/* ── five questions ───────────────────────────────────────────────── */
.q { display: grid; grid-template-columns: 1fr auto; gap: 8px 14px; align-items: center; padding: 7px 0; border-bottom: 1px dotted var(--divider); }
.q:last-child { border-bottom: 0; }
.q-text { font-size: 14.5px; }
.q-text small { display: block; color: var(--muted); font-size: 12px; }
.cue { display: block; font-size: 12.5px; color: var(--accent-700); font-style: italic; margin-top: 3px; }
.seg { display: inline-flex; border: 1px solid var(--divider); border-radius: 2px; overflow: hidden; }
.seg button {
  font-family: inherit; font-size: 12.5px; padding: 4px 12px; cursor: pointer;
  border: 0; border-right: 1px solid var(--divider); background: transparent; color: var(--text);
}
.seg button:last-child { border-right: 0; }
.seg button[aria-pressed="true"] { background: var(--accent-200); color: var(--accent-800); font-weight: 600; }
.seg button.unclear[aria-pressed="true"] { background: var(--flag-200); color: var(--flag-700); }

.prose {
  margin: 12px 0 0; padding: 10px 12px; background: var(--surface);
  font-size: 13.5px; white-space: pre-wrap; max-height: 190px; overflow: auto;
  border-left: 2px solid var(--divider);
}

/* ── output ───────────────────────────────────────────────────────── */
.out {
  width: 100%; min-height: 320px; font-family: var(--mono); font-size: 12.5px;
  padding: 14px; border: 1px solid var(--divider); background: var(--surface);
  color: var(--text); border-radius: 2px; resize: vertical; line-height: 1.6;
}
.out-actions { display: flex; gap: 10px; align-items: center; margin: 10px 0 0; flex-wrap: wrap; }

/* ── the footer that never goes away (§8.1) ───────────────────────── */
.disclaimer {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 20;
  background: var(--text); color: var(--bg);
  font-size: 12.5px; padding: 9px 22px; text-align: center;
}
.disclaimer a { color: var(--bg); text-decoration: underline; }

/* ── status, notes, explainer ─────────────────────────────────────── */
.status {
  text-align: center; font-size: 14px; color: var(--accent-700);
  margin: -12px 0 18px;
}

.notes {
  margin: 14px 0; padding: 10px 14px; background: var(--flag-100);
  border-left: 2px solid var(--flag); font-size: 13.5px;
}
.notes p { margin: 0 0 5px; }
.notes p:last-child { margin: 0; }

.explainer { margin: 14px 0 6px; }
.explainer summary { cursor: pointer; color: var(--accent-700); }
.explainer > div { padding: 10px 0 0 14px; border-left: 2px solid var(--divider); margin-top: 8px; }
.explainer p { margin: 0 0 9px; }

#error { border-left: 2px solid var(--flag); padding: 4px 0 4px 14px; margin: 24px 0; }

.push-right { margin-left: auto; }
#reset-wrap { margin: 16px 0; }

.hidden { display: none !important; }

@media (max-width: 720px) {
  h1 { font-size: 30px; }
  .layers { grid-template-columns: 1fr 1fr; }
  .q { grid-template-columns: 1fr; }
  .counts { gap: 18px; }
}
