/* styles.css — Pamphleteer-inspired, Typeform-paced.
   Paper sheet on tan backdrop, mono headlines, serif body, hard offset shadows. */
:root {
  --paper: #f4efe9;
  --paper-2: #efe8dc;
  --ink: #241a1a;
  --accent: #f83a1a;
  --tan: #b6ab99;
  --muted: #7a6f66;
  --line: rgba(36, 26, 26, 0.25);
  --mono: "IBM Plex Mono", "Courier New", Courier, monospace;
  --serif: "IBM Plex Serif", "Times New Roman", Times, serif;
  --display: "Krona One", Arial, Helvetica, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--serif); color: var(--ink);
  background: var(--paper);
  min-height: 100vh; line-height: 1.55;
}

.sheet {
  max-width: 760px; margin: 0 auto; min-height: 100dvh;
  display: flex; flex-direction: column; position: relative;
}

/* ---- full-width progress bar ---- */
.progress { position: fixed; top: 0; left: 0; width: 100%; height: 4px; background: rgba(36,26,26,0.12); z-index: 100; }
.progress i { display: block; height: 100%; background: var(--accent); width: 8%; transition: width 0.45s ease; }

/* ---- panels ---- */
.stage { flex: 1; display: flex; }
.panel { display: none; }
.panel.active {
  display: flex; flex-direction: column; justify-content: center;
  width: 100%; max-width: 640px; margin: 0 auto; padding: 56px 28px 110px;
  animation: enter 0.4s ease;
}
@keyframes enter { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: none; } }

.kicker {
  font-family: var(--display); color: var(--accent); font-size: 11px;
  letter-spacing: 0.14em; text-transform: uppercase; margin-bottom: 16px;
}
.q {
  font-family: var(--mono); font-weight: 700;
  font-size: clamp(26px, 5.5vw, 40px); line-height: 1.12; letter-spacing: -0.5px;
  margin: 0 0 14px;
}
.q .red { color: var(--accent); }
.lede { font-size: 17px; margin: 0 0 26px; max-width: 52ch; }
.lede b, .fact b { font-weight: 600; }
.small { font-family: var(--mono); font-size: 12px; color: var(--muted); margin-top: 12px; }

/* ---- inputs: typeform-style underline ---- */
.ask { display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap; }
.ask input {
  flex: 1; min-width: 220px; font-family: var(--mono); font-size: clamp(18px, 3.5vw, 24px);
  color: var(--ink); background: transparent; border: none;
  border-bottom: 2px solid var(--ink); padding: 8px 2px; outline: none; border-radius: 0;
}
.ask input::placeholder { color: rgba(36,26,26,0.35); }
.ask input:focus { border-bottom-color: var(--accent); }

.btn {
  font-family: var(--mono); font-weight: 700; font-size: 13px; letter-spacing: 0.08em;
  text-transform: uppercase; background: var(--ink); color: var(--paper);
  border: 2px solid var(--ink); padding: 13px 22px; cursor: pointer;
  box-shadow: 4px 4px 0 var(--accent); transition: transform 0.08s, box-shadow 0.08s;
  white-space: nowrap;
}
.btn:hover { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--accent); }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--accent); }
.btn:disabled { opacity: 0.55; cursor: wait; box-shadow: 4px 4px 0 rgba(36,26,26,0.25); }
.btn.ghost { background: transparent; color: var(--ink); box-shadow: 4px 4px 0 rgba(36,26,26,0.2); }
.next-row { margin-top: 30px; }

button.linkish {
  background: none; border: none; padding: 0; cursor: pointer;
  font-family: var(--mono); font-size: 12.5px; color: var(--ink);
  text-decoration: underline; text-underline-offset: 3px;
}
button.linkish:hover { color: var(--accent); }

/* ---- status / matches ---- */
.status { margin-top: 20px; font-family: var(--mono); font-size: 13.5px; display: none; }
.status.show { display: block; }
.status.error { color: var(--accent); }
.spinner {
  display: inline-block; width: 13px; height: 13px; border: 2px solid var(--line);
  border-top-color: var(--ink); border-radius: 50%; animation: spin 0.7s linear infinite;
  vertical-align: -2px; margin-right: 8px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.matches { margin-top: 18px; display: none; }
.matches.show { display: block; }
.matches h3 { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); margin: 0 0 10px; }
.match-btn {
  display: block; width: 100%; text-align: left; background: var(--paper);
  border: 1px solid var(--ink); padding: 11px 14px; margin-bottom: -1px; cursor: pointer;
  font-family: var(--mono); font-size: 14px; color: var(--ink);
}
.match-btn:hover { background: var(--ink); color: var(--paper); }
.match-btn .meta { opacity: 0.6; font-size: 12px; }

/* ---- figures ---- */
.prop-line { font-family: var(--mono); font-size: 12.5px; color: var(--muted); margin-bottom: 18px; }
.fig {
  font-family: var(--mono); font-weight: 700; font-size: clamp(42px, 10vw, 64px);
  letter-spacing: -2px; line-height: 1; margin: 6px 0 4px;
}
.fig.red { color: var(--accent); }
.fig.down { color: #2a7a12; }
.fig-lab { font-family: var(--display); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }

/* ---- reappraisal value move (2024 → 2025) ---- */
.value-move { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin: 6px 0 4px; }
.value-move .vm-old {
  font-family: var(--mono); font-weight: 700; font-size: clamp(24px, 5vw, 34px);
  letter-spacing: -1px; color: var(--muted);
  text-decoration: line-through; text-decoration-color: var(--tan); text-decoration-thickness: 2px;
}
.value-move .vm-arrow { font-family: var(--mono); font-size: 24px; color: var(--muted); align-self: center; }
.value-move .fig { margin: 0; }

/* ---- adjust: enter the real 2024 value when we only had an estimate ---- */
.adjust { margin-top: 18px; }
.adjust-form { margin-top: 12px; }

/* ---- refine link on the result card (estimated runs only) ---- */
.est-refine { margin-top: 18px; }

.rate-flip { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; margin: 18px 0 6px; font-family: var(--mono); }
.rf { display: flex; flex-direction: column; }
.rf .n { font-weight: 700; font-size: clamp(28px, 6vw, 40px); letter-spacing: -1px; }
.rf .n.old { text-decoration: line-through; text-decoration-color: var(--accent); text-decoration-thickness: 3px; opacity: 0.65; }
.rf .n.red { color: var(--accent); }
.rf .l { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); margin-top: 4px; }
.rf-arrow { font-size: 26px; align-self: center; }

.fact {
  border-left: 3px solid var(--accent); padding: 4px 0 4px 16px; margin: 20px 0 0;
  font-size: 17px; max-width: 52ch;
}
.est-tag { font-family: var(--mono); font-size: 10.5px; border: 1px solid var(--ink); padding: 1px 7px; margin-left: 6px; vertical-align: 2px; white-space: nowrap; }

/* ---- council member + their vote (result card) ---- */
.council-line {
  display: flex; align-items: center; gap: 14px;
  border: 1.5px solid var(--ink); background: var(--paper-2);
  padding: 12px 14px; margin: 22px 0 0;
}
.council-line .cm-photo {
  flex: 0 0 auto; width: 60px; height: 72px; object-fit: cover; object-position: top center;
  border: 1.5px solid var(--ink); background: var(--paper);
}
.council-line .cm-text { font-size: 15.5px; line-height: 1.45; }
.council-line .down { color: #2a7a12; }
.council-line a { color: var(--ink); text-decoration-color: var(--accent); text-underline-offset: 3px; font-family: var(--mono); font-size: 12.5px; white-space: nowrap; }
.council-line a:hover { color: var(--accent); }

/* ---- details dropdowns ---- */
details.more { margin-top: 22px; border: 1px solid var(--ink); background: var(--paper-2); }
details.more summary {
  cursor: pointer; padding: 11px 14px; font-family: var(--mono); font-size: 12px;
  font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; list-style: none;
}
details.more summary::before { content: "+ "; color: var(--accent); }
details.more[open] summary::before { content: "− "; }
details.more summary::-webkit-details-marker { display: none; }
details.more .dm-body { padding: 0 16px 14px; font-size: 15px; }
details.more .dm-body ul { margin: 6px 0; padding-left: 20px; }
details.more .dm-body li { margin-bottom: 8px; }
details.more a { color: var(--ink); text-decoration-color: var(--accent); text-underline-offset: 3px; }
details.more a:hover { color: var(--accent); }

.form-msg { font-family: var(--mono); font-size: 12.5px; margin-top: 10px; min-height: 16px; color: var(--accent); }

/* ---- vote / link chips ---- */
.chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
a.chip {
  font-family: var(--mono); font-size: 12px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--ink); text-decoration: none;
  border: 1.5px solid var(--ink); padding: 9px 13px; background: var(--paper);
  box-shadow: 3px 3px 0 rgba(36,26,26,0.18);
}
a.chip:hover { background: var(--ink); color: var(--paper); box-shadow: 3px 3px 0 var(--accent); }
a.chip .arrow { color: var(--accent); }
a.chip:hover .arrow { color: var(--paper); }

/* ---- panel 5: the bill (receipt style) ---- */
.bill-table { margin: 22px 0 4px; }
.bt-row { display: flex; align-items: baseline; gap: 10px; padding: 7px 0; font-size: 16px; }
.bt-row .dots { flex: 1; border-bottom: 2px dotted var(--line); transform: translateY(-4px); }
.bt-row .amt { font-family: var(--mono); font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bt-row.total { border-top: 2px solid var(--ink); margin-top: 6px; padding-top: 12px; font-weight: 600; }
.bt-row.total .amt { font-size: 20px; color: var(--accent); }
.bt-row .sub-lab { font-size: 13.5px; color: var(--muted); }

/* who-did-it split chart */
.split { margin: 26px 0 0; }
.split-head { font-family: var(--display); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; }
.sp-row { display: grid; grid-template-columns: 110px 1fr auto; align-items: center; gap: 12px; margin-bottom: 10px; }
.sp-lab { font-family: var(--mono); font-size: 12px; line-height: 1.35; }
.sp-lab .who { display: block; color: var(--muted); font-size: 10.5px; }
.sp-track { height: 22px; position: relative; }
.sp-bar { height: 100%; min-width: 2px; }
.sp-bar.hike { background: var(--accent); }
.sp-bar.reap { background: var(--ink); opacity: 0.75; }
.sp-bar.neg { background: transparent; border: 1.5px dashed var(--ink); opacity: 0.65; }
.sp-amt { font-family: var(--mono); font-weight: 700; font-size: 14px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.sp-amt.red { color: var(--accent); }
.split-note { font-size: 15px; margin: 14px 0 0; max-width: 52ch; }
.split-note b { color: var(--accent); }

/* ---- capture + share ---- */
.capture { margin-top: 30px; border-top: 3px double var(--ink); padding-top: 22px; }
.cap-head { font-family: var(--mono); font-weight: 700; font-size: 18px; margin: 0 0 4px; }
.cap-sub { font-size: 14.5px; margin: 0 0 14px; color: var(--muted); }
.cap-form { display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap; }
.cap-form input {
  flex: 1; min-width: 200px; font-family: var(--mono); font-size: 17px;
  background: transparent; border: none; border-bottom: 2px solid var(--ink);
  padding: 8px 2px; outline: none; border-radius: 0; color: var(--ink);
}
.cap-form input:focus { border-bottom-color: var(--accent); }
.cap-msg { font-family: var(--mono); font-size: 12.5px; margin-top: 10px; min-height: 16px; }
.cap-msg.ok { color: #2a7a12; }
.cap-msg.err { color: var(--accent); }
.cap-fine { font-family: var(--mono); font-size: 10.5px; color: var(--muted); margin: 8px 0 0; }
.capture.done .cap-form, .capture.done .cap-fine, .capture.done .cap-sub { display: none; }

.actions { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 26px; }

/* ---- back link ---- */
.back-link {
  background: none; border: none; padding: 0; cursor: pointer;
  font-family: var(--mono); font-size: 11.5px; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 18px;
  align-self: flex-start;
}
.back-link:hover { color: var(--accent); }

/* ---- footer ---- */
.colophon {
  padding: 14px 28px 18px;
  font-family: var(--mono); font-size: 10.5px; color: var(--muted); line-height: 1.7;
}
.colophon a { color: var(--muted); }
.colophon a:hover { color: var(--accent); }

@media (max-width: 620px) {
  .panel.active { padding: 34px 18px 84px; }
  .colophon { padding: 12px 18px 16px; }
  .q { font-size: clamp(20px, 5.4vw, 25px); line-height: 1.25; letter-spacing: -0.3px; }
  .fig { font-size: clamp(32px, 11vw, 48px); letter-spacing: -1.5px; }
  .fig-lab { font-size: 9.5px; }
  .lede { font-size: 16px; }
  .fact { font-size: 15.5px; }
  .rate-flip { gap: 12px; }
  .rf .n { font-size: clamp(24px, 7.5vw, 34px); }
  /* receipt: drop the inline /$100 sub-labels (still in "the receipts" dropdown) */
  .bt-row { font-size: 14.5px; gap: 8px; }
  .bt-row .sub-lab { display: none; }
  .bt-row.total .amt { font-size: 18px; }
  /* split chart: tighter label column */
  .sp-row { grid-template-columns: 84px 1fr auto; gap: 10px; }
  .sp-amt { font-size: 13px; }
  .split-note { font-size: 14.5px; }
  /* tappable, full-width primary buttons */
  .ask, .cap-form { gap: 12px; }
  .ask .btn, .next-row .btn { width: 100%; }
}
