:root {
  --bg: #f8f7f3;
  --paper: #fffdf8;
  --ink: #202420;
  --muted: #68716c;
  --line: rgba(32, 36, 32, 0.16);
  --prediction: #2e7470;
  --event: #9b3f2d;
  --shadow: 0 18px 44px rgba(34, 37, 34, 0.08);
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { background: var(--bg); color: var(--ink); font-family: var(--font); line-height: 1.5; }
body { margin: 0; }
a { color: inherit; }

.site-header,
main { margin: 0 auto; max-width: 1180px; padding: 0 24px; }
.site-header { padding-top: 24px; }

.topbar { align-items: center; display: flex; gap: 18px; justify-content: space-between; }
.brand,
.topbar-links a { color: rgba(32, 36, 32, 0.72); font-size: 0.74rem; font-weight: 780; letter-spacing: 0.1em; text-decoration: none; text-transform: uppercase; }
.topbar-links { display: flex; flex-wrap: wrap; gap: 16px; }

.intro { align-items: end; display: grid; gap: 28px; grid-template-columns: minmax(0, 520px) minmax(280px, 460px); padding: 42px 0 24px; position: relative; }
h1 { font-size: clamp(2.4rem, 6vw, 4.2rem); letter-spacing: -0.04em; line-height: 0.98; margin: 0; }
.intro p { color: var(--muted); font-size: 1rem; margin: 0 0 6px; }
.feedback-nudge {
  align-items: center;
  background: transparent;
  border: 0;
  color: #a33a2b;
  cursor: pointer;
  display: inline-flex;
  font-family: "Marker Felt", "Comic Sans MS", "Bradley Hand", var(--font);
  font-size: 0.98rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  padding: 0 8px 8px;
  position: absolute;
  right: 22px;
  text-decoration: none;
  top: 19px;
  transform: rotate(-3deg);
  white-space: nowrap;
  z-index: 2;
}
.feedback-nudge:hover,
.feedback-nudge:focus-visible {
  color: #7f2e23;
  outline: 0;
}

.timeline-card,
.detail-card,
.event-form-card { background: var(--paper); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); }
.timeline-card { margin-bottom: 22px; overflow-x: auto; padding: 20px 22px 28px; position: relative; }
.timeline-header { align-items: center; border-bottom: 1px solid var(--line); display: flex; gap: 16px; justify-content: space-between; margin-bottom: 18px; padding-bottom: 16px; }
.timeline-header h2,
.event-form-card h2 { font-size: 1rem; margin: 0 0 4px; }
.timeline-header p,
.form-intro { color: var(--muted); margin: 0; }
.add-event-button,
.event-form-card button { background: var(--ink); border: 0; border-radius: 10px; color: white; cursor: pointer; font: inherit; font-weight: 700; padding: 10px 14px; }

.timeline-canvas { height: 280px; min-width: 940px; position: relative; }
.timeline-line { background: rgba(32, 36, 32, 0.78); border-radius: 999px; height: 3px; left: 28px; position: absolute; right: 28px; top: 136px; }
.year-tick { color: rgba(32, 36, 32, 0.44); font-size: 0.78rem; font-weight: 800; letter-spacing: 0.08em; position: absolute; top: 156px; transform: translateX(-50%); }

.timeline-node { background: transparent; border: 0; cursor: pointer; left: 0; padding: 0; position: absolute; top: 136px; transform: translate(-50%, -50%); }
.node-mark { align-items: center; background: var(--paper); border: 3px solid var(--prediction); border-radius: 999px; box-shadow: 0 0 0 7px var(--paper); color: var(--event); display: flex; font-size: 1.6rem; font-weight: 800; height: 24px; justify-content: center; line-height: 1; width: 24px; }
.timeline-node.event .node-mark { border: 0; box-shadow: none; transform: translateY(-1px); }
.timeline-node.is-active .node-mark { outline: 3px solid rgba(32, 36, 32, 0.16); outline-offset: 7px; }
.node-label { color: rgba(32, 36, 32, 0.76); font-size: 0.76rem; left: 50%; line-height: 1.18; max-width: 150px; opacity: 0; pointer-events: none; position: absolute; text-align: center; top: calc(34px * var(--label-shift)); transform: translateX(-50%); width: max-content; }
.timeline-node.is-active .node-label,
.timeline-node:hover .node-label,
.timeline-node:focus-visible .node-label { opacity: 1; }
.node-label span { color: var(--muted); display: block; font-size: 0.65rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; }
.node-label strong { display: block; font-weight: 760; }

.workspace-grid { align-items: start; display: grid; gap: 22px; grid-template-columns: minmax(0, 1fr) 360px; margin-bottom: 72px; }
.detail-card,
.event-form-card { padding: 24px; }
.site-footnotes {
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  font-size: 0.78rem;
  gap: 8px 16px;
  justify-content: space-between;
  margin: 18px 0 52px;
  padding: 0 4px;
}
.site-footnotes p {
  margin: 0;
}
.site-footnotes a {
  color: var(--prediction);
  font-weight: 650;
  text-decoration: none;
}
.site-footnotes a:hover {
  text-decoration: underline;
}
.detail-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.pill { background: rgba(32, 36, 32, 0.07); border-radius: 999px; color: rgba(32, 36, 32, 0.74); display: inline-flex; font-size: 0.72rem; font-weight: 780; letter-spacing: 0.04em; padding: 6px 9px; text-decoration: none; text-transform: uppercase; }
.prediction-pill { background: rgba(46, 116, 112, 0.1); color: var(--prediction); }
.event-pill { background: rgba(155, 63, 45, 0.1); color: var(--event); }
.detail-card h2 { font-size: clamp(1.5rem, 2.4vw, 2rem); letter-spacing: -0.02em; margin: 0 0 10px; }
.detail-body { color: var(--ink); font-size: 1.02rem; margin: 0 0 18px; }
.detail-note { border-top: 1px solid var(--line); color: var(--muted); margin: 0; padding-top: 16px; }

form { display: grid; gap: 12px; }
label { color: var(--muted); display: grid; font-size: 0.78rem; font-weight: 760; gap: 6px; letter-spacing: 0.06em; text-transform: uppercase; }
input,
textarea { background: white; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); font: inherit; padding: 10px 12px; text-transform: none; }
textarea { resize: vertical; }

@media (max-width: 860px) {
  .intro,
  .workspace-grid { grid-template-columns: 1fr; }
  .timeline-card {
    padding-top: 54px;
  }
  .timeline-canvas { min-width: 760px; }
  .feedback-nudge {
    left: 22px;
    right: auto;
    top: 18px;
    transform: rotate(-2deg);
    width: max-content;
  }
}

@media (max-width: 560px) {
  .site-header,
  main { padding: 0 14px; }
  .site-header { padding-top: 18px; }
  .topbar { align-items: flex-start; flex-direction: column; }
  .topbar-links {
    gap: 10px 14px;
  }
  .brand,
  .topbar-links a {
    font-size: 0.68rem;
    letter-spacing: 0.08em;
  }
  .intro {
    gap: 18px;
    padding: 34px 0 18px;
  }
  .intro p {
    font-size: 0.95rem;
  }
  .timeline-header { align-items: flex-start; flex-direction: column; }
  .timeline-header p {
    font-size: 0.94rem;
  }
  .detail-card,
  .event-form-card { padding: 20px; }
}

/* v3 bucket timeline override */
.timeline-canvas { height: 230px; min-width: 760px; }
.timeline-line { top: 108px; }
.year-tick { top: 132px; }
.timeline-node { top: 108px; }
.timeline-node.bucket .node-mark {
  border: 3px solid var(--prediction);
  border-radius: 999px;
  color: var(--prediction);
  height: 26px;
  width: 26px;
}
.timeline-node.bucket:not(.is-empty) .node-mark::after {
  background: var(--prediction);
  border-radius: 999px;
  content: "";
  height: 9px;
  width: 9px;
}
.node-event-marks {
  align-items: center;
  display: inline-flex;
  gap: 2px;
  left: 50%;
  position: absolute;
  top: -23px;
  transform: translateX(-50%);
}
.node-event-marks i {
  color: var(--event);
  font-size: 1rem;
  font-style: normal;
  font-weight: 900;
  line-height: 1;
}
.timeline-node.bucket.is-empty .node-mark {
  border-color: rgba(32, 36, 32, 0.22);
}
.timeline-node.bucket.is-active .node-mark {
  outline: 3px solid rgba(46, 116, 112, 0.18);
  outline-offset: 8px;
}
.node-label {
  opacity: 1;
  top: 34px;
}
.node-label span { font-size: 0.7rem; }
.node-label strong { color: var(--muted); font-size: 0.7rem; font-weight: 650; }
.entry-list {
  display: grid;
  gap: 14px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.entry-row {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 16px;
  grid-template-columns: 110px minmax(0, 1fr);
  padding-top: 16px;
}
.entry-row:first-child { border-top: 0; padding-top: 0; }
.entry-kind {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.prediction-entry .entry-kind { color: var(--prediction); }
.event-entry .entry-kind { color: var(--event); }
.entry-row h3 {
  font-size: 1rem;
  margin: 0 0 6px;
}
.entry-row p {
  margin: 0 0 8px;
}
.entry-meta {
  color: var(--muted);
  font-size: 0.9rem;
}
.entry-meta a { color: var(--prediction); text-decoration: none; }
.entry-meta a:hover { text-decoration: underline; }
.news-groups {
  display: grid;
  gap: 12px;
}
.news-theme-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.theme-chip {
  align-items: center;
  background: rgba(155, 63, 45, 0.08);
  border: 1px solid rgba(155, 63, 45, 0.12);
  border-radius: 999px;
  color: var(--event);
  cursor: pointer;
  display: inline-flex;
  font-size: 0.72rem;
  font-weight: 780;
  gap: 6px;
  letter-spacing: 0.02em;
  padding: 5px 8px;
}
.theme-chip:hover {
  background: rgba(155, 63, 45, 0.12);
  border-color: rgba(155, 63, 45, 0.22);
}
.theme-chip:focus-visible,
.news-group summary:focus-visible {
  outline: 2px solid rgba(155, 63, 45, 0.45);
  outline-offset: 3px;
}
.theme-chip strong {
  background: var(--paper);
  border-radius: 999px;
  color: var(--event);
  min-width: 18px;
  padding: 1px 5px;
  text-align: center;
}
.news-group {
  background: rgba(155, 63, 45, 0.035);
  border: 1px solid rgba(155, 63, 45, 0.12);
  border-radius: 8px;
  overflow: hidden;
  padding: 0;
}
.news-group summary {
  align-items: center;
  color: var(--event);
  cursor: pointer;
  display: grid;
  gap: 8px 12px;
  grid-template-columns: 18px minmax(0, 1fr) max-content;
  list-style: none;
  padding: 13px 14px;
}
.news-group summary::-webkit-details-marker {
  display: none;
}
.news-group-toggle::before {
  color: rgba(155, 63, 45, 0.75);
  content: "+";
  display: inline-block;
  font-weight: 900;
  text-align: center;
  width: 18px;
}
.news-group[open] .news-group-toggle::before {
  content: "-";
}
.news-group-title {
  font-size: 0.82rem;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.news-group-count {
  background: rgba(155, 63, 45, 0.12);
  border-radius: 999px;
  color: var(--event);
  display: inline-flex;
  font-size: 0.72rem;
  font-weight: 850;
  justify-content: center;
  min-width: 22px;
  padding: 2px 6px;
}
.news-group-preview {
  color: var(--muted);
  font-size: 0.86rem;
  grid-column: 2 / 4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.news-group ul {
  border-top: 1px solid rgba(155, 63, 45, 0.12);
  display: grid;
  gap: 10px;
  list-style: none;
  margin: 0;
  padding: 14px;
}
.news-item {
  border-top: 1px solid rgba(155, 63, 45, 0.12);
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) max-content;
  padding-top: 10px;
}
.news-item:first-child {
  border-top: 0;
  padding-top: 0;
}
.news-item h4 {
  font-size: 0.98rem;
  margin: 0 0 4px;
}
.news-item p {
  color: var(--muted);
  margin: 0;
}
@media (max-width: 560px) {
  .entry-row { grid-template-columns: 1fr; }
  .entry-kind {
    font-size: 0.68rem;
  }
  .entry-row h3 {
    font-size: 0.98rem;
  }
  .entry-row p,
  .entry-meta {
    font-size: 0.92rem;
  }
  .news-theme-summary {
    gap: 6px;
  }
  .theme-chip {
    max-width: 100%;
  }
  .news-group summary { grid-template-columns: 18px minmax(0, 1fr) max-content; }
  .news-group-preview {
    grid-column: 1 / -1;
    overflow: visible;
    text-overflow: initial;
    white-space: normal;
  }
  .news-item { grid-template-columns: 1fr; }
}

/* v3 two-lane year timeline */
.timeline-card { overflow-x: visible; }
.timeline-header { margin-bottom: 8px; }
.timeline-canvas {
  display: grid;
  gap: 34px;
  height: auto;
  min-width: 0;
  padding: 8px 0 4px;
}
.timeline-year {
  display: grid;
  gap: 18px;
  padding: 8px 0 18px;
}
.timeline-year + .timeline-year {
  border-top: 1px solid var(--line);
  padding-top: 24px;
}
.timeline-year h3 {
  font-size: clamp(1.6rem, 4vw, 2.5rem);
  letter-spacing: 0.02em;
  line-height: 1;
  margin: 0;
  text-align: center;
}
.timeline-lane {
  height: 74px;
  position: relative;
}
.lane-label {
  color: rgba(32, 36, 32, 0.72);
  font-size: 0.9rem;
  font-weight: 720;
  left: 0;
  position: absolute;
  top: 24px;
}
.lane-line {
  background: rgba(32, 36, 32, 0.82);
  border-radius: 999px;
  height: 3px;
  left: 110px;
  position: absolute;
  right: 20px;
  top: 34px;
}
.period-node,
.event-node {
  background: transparent;
  border: 0;
  cursor: pointer;
  left: 0;
  padding: 0;
  position: absolute;
  top: 34px;
  transform: translate(-50%, -50%);
}
.period-dot {
  background: var(--paper);
  border: 6px solid var(--ink);
  border-radius: 999px;
  box-shadow: inset 0 0 0 5px #f5d967, 0 0 0 5px var(--paper);
  display: block;
  height: 25px;
  width: 25px;
}
.period-node.is-empty .period-dot {
  border-color: rgba(32, 36, 32, 0.36);
  box-shadow: inset 0 0 0 5px rgba(245, 217, 103, 0.35), 0 0 0 5px var(--paper);
}
.period-node.is-active .period-dot,
.event-node.is-active .event-dot {
  outline: 3px solid rgba(32, 36, 32, 0.16);
  outline-offset: 7px;
}
.period-label {
  color: rgba(32, 36, 32, 0.82);
  display: block;
  font-size: 0.86rem;
  font-weight: 700;
  left: 50%;
  position: absolute;
  text-align: center;
  top: 31px;
  transform: translateX(-50%);
  white-space: nowrap;
}
.event-node {
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 1.85rem;
  font-weight: 900;
  line-height: 1;
}
.event-node:hover,
.period-node:hover .period-dot {
  filter: brightness(0.9);
}
.status-chip {
  border-radius: 999px;
  display: inline-flex;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  margin-left: 8px;
  padding: 3px 7px;
  text-transform: uppercase;
  vertical-align: middle;
}
.status-pending {
  background: rgba(174, 126, 31, 0.12);
  color: #8a651b;
}
.status-validated {
  background: rgba(25, 124, 83, 0.12);
  color: #197c53;
}
.status-validated-late {
  background: rgba(25, 124, 83, 0.12);
  color: #197c53;
}
.status-mixed {
  background: rgba(196, 119, 39, 0.14);
  color: #a35f19;
}
.status-incorrect {
  background: rgba(155, 63, 45, 0.12);
  color: var(--event);
}
.evidence-pill {
  background: rgba(32, 36, 32, 0.07);
  color: var(--muted);
}
.evidence-primary-source {
  background: rgba(46, 116, 112, 0.1);
  color: var(--prediction);
}
.evidence-credible-reporting,
.evidence-tracker-judgment {
  background: rgba(32, 36, 32, 0.07);
  color: var(--muted);
}
.evidence-needs-review {
  background: rgba(174, 126, 31, 0.12);
  color: #8a651b;
}

@media (max-width: 680px) {
  .timeline-card { overflow-x: auto; }
  .timeline-canvas { min-width: 680px; }
  .lane-label { font-size: 0.82rem; }
  .lane-line { left: 96px; }
}

/* v3 merged timeline */
.timeline-card { overflow-x: auto; }
.timeline-canvas {
  display: grid;
  gap: 16px;
  height: 250px;
  min-width: max(980px, calc(var(--timeline-years, 3) * 330px));
  padding: 14px 0 10px;
}
.year-ruler {
  height: 54px;
  position: relative;
}
.year-ruler span {
  color: var(--ink);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 850;
  letter-spacing: 0.03em;
  line-height: 1;
  position: absolute;
  top: 2px;
  transform: translateX(-50%);
}
.timeline-lane {
  height: 76px;
  position: relative;
}
.lane-label {
  color: rgba(32, 36, 32, 0.72);
  font-size: 0.92rem;
  font-weight: 760;
  left: 0;
  position: absolute;
  top: 25px;
}
.lane-line {
  background: rgba(32, 36, 32, 0.82);
  border-radius: 999px;
  height: 3px;
  left: 10%;
  position: absolute;
  right: 10%;
  top: 35px;
}
.period-node,
.event-node {
  top: 35px;
}
.period-label {
  top: 32px;
}
.event-node {
  color: var(--ink);
  font-size: 1.85rem;
}

@media (max-width: 680px) {
  .timeline-card {
    overflow-x: hidden;
    padding: 54px 14px 18px;
  }
  .timeline-canvas {
    gap: 10px;
    height: 242px;
    min-width: 0;
    overflow: visible;
    padding-top: 4px;
  }
  .year-ruler {
    height: 42px;
  }
  .year-ruler span {
    font-size: clamp(1.5rem, 10vw, 2.15rem);
  }
  .timeline-lane {
    height: 86px;
  }
  .news-lane {
    align-items: center;
    display: flex;
    height: 74px;
    justify-content: space-between;
    padding-top: 28px;
  }
  .lane-label {
    font-size: 0.84rem;
    left: 0;
    top: 0;
  }
  .lane-line {
    left: 0;
    right: 0;
    top: 42px;
  }
  .period-node,
  .event-node {
    top: 42px;
  }
  .period-dot {
    height: 22px;
    width: 22px;
  }
  .period-label {
    font-size: 0.76rem;
    top: 28px;
  }
  .event-node {
    height: 17px;
    width: 17px;
  }
  .event-dot {
    border-width: 2px;
    box-shadow: 0 0 0 1px rgba(155, 63, 45, 0.22);
    font-size: 0.52rem;
  }
  .news-lane .event-node {
    flex: 0 0 auto;
    left: auto;
    position: relative;
    top: auto;
    transform: none;
    z-index: 1;
  }
  .news-lane .event-node.is-active .event-dot {
    outline-offset: 5px;
  }
  .period-node.is-active .period-dot,
  .event-node.is-active .event-dot {
    outline-width: 2px;
  }
  .granular-buttons { grid-template-columns: 1fr; }
}

.granular-block {
  border-top: 1px solid rgba(32, 36, 32, 0.1);
  margin-top: 12px;
  padding-top: 12px;
}
.granular-summary {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 650;
  margin-bottom: 10px;
}
.granular-buttons {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.granular-button {
  align-items: center;
  background: rgba(32, 36, 32, 0.035);
  border: 1px solid rgba(32, 36, 32, 0.08);
  border-left: 5px solid var(--ink);
  border-radius: 8px;
  color: var(--ink);
  cursor: pointer;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  font: inherit;
  font-size: 0.86rem;
  font-weight: 650;
  gap: 9px;
  line-height: 1.25;
  max-width: none;
  min-height: 44px;
  padding: 9px 10px;
  text-align: left;
  white-space: normal;
}
.granular-status-dot {
  display: none;
}
.granular-button.status-validated,
.granular-button.status-validated-late { border-left-color: #197c53; }
.granular-button.status-mixed { border-left-color: #c47727; }
.granular-button.status-pending { border-left-color: #a87920; }
.granular-button.status-incorrect { border-left-color: var(--event); }
.granular-button.evidence-needs-review {
  border-style: dashed;
}
.granular-index {
  align-items: center;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 999px;
  display: inline-flex;
  height: 18px;
  justify-content: center;
  min-width: 18px;
  padding: 0 5px;
  place-self: center;
  width: max-content;
}
.granular-label {
  color: var(--ink);
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.granular-button:hover {
  background: rgba(32, 36, 32, 0.06);
  border-color: rgba(32, 36, 32, 0.14);
}
.modal-backdrop {
  align-items: center;
  background: rgba(32, 36, 32, 0.32);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 24px;
  position: fixed;
  z-index: 20;
}
.modal-backdrop[hidden] {
  display: none;
}
.prediction-modal {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 28px 80px rgba(32, 36, 32, 0.22);
  max-height: min(720px, calc(100vh - 48px));
  max-width: 720px;
  overflow: auto;
  padding: 24px;
  position: relative;
  width: min(720px, 100%);
}
.feedback-modal {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 28px 80px rgba(32, 36, 32, 0.2);
  max-width: 440px;
  padding: 24px;
  position: relative;
  width: min(440px, 100%);
}
.modal-close {
  background: rgba(32, 36, 32, 0.08);
  border: 0;
  border-radius: 999px;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-size: 1.4rem;
  font-weight: 700;
  height: 36px;
  line-height: 1;
  position: absolute;
  right: 16px;
  top: 16px;
  width: 36px;
}
.prediction-modal h2 {
  font-size: 1.5rem;
  letter-spacing: -0.02em;
  margin: 0 44px 12px 0;
}
.feedback-modal h2 {
  font-size: 1.35rem;
  letter-spacing: -0.02em;
  margin: 0 44px 8px 0;
}
.feedback-modal p {
  color: var(--muted);
  margin: 0 0 16px;
}
.prediction-modal h3 {
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  margin: 18px 0 8px;
  text-transform: uppercase;
}
.modal-prediction {
  font-size: 1.05rem;
  font-weight: 650;
  margin: 0;
}
.modal-evidence {
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.6;
}
.modal-evidence a {
  color: var(--prediction);
  overflow-wrap: anywhere;
  text-decoration: none;
}
.modal-evidence a:hover {
  text-decoration: underline;
}
.modal-evidence-empty {
  margin: 0;
}
.feedback-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 4px;
}
.feedback-actions button,
.feedback-actions a {
  background: var(--ink);
  border: 1px solid var(--ink);
  border-radius: 10px;
  color: white;
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-weight: 760;
  justify-content: center;
  padding: 9px 13px;
  text-decoration: none;
}
.feedback-actions .feedback-secondary {
  background: transparent;
  border-color: var(--line);
  color: var(--ink);
}
.feedback-actions button:hover,
.feedback-actions button:focus-visible,
.feedback-actions a:hover,
.feedback-actions a:focus-visible {
  filter: brightness(0.94);
}

@media (max-width: 560px) {
  .detail-card {
    border-radius: 14px;
  }
  .detail-card h2 {
    font-size: 1.55rem;
  }
  .detail-meta {
    gap: 6px;
  }
  .pill {
    font-size: 0.66rem;
    padding: 5px 8px;
  }
  .granular-summary {
    font-size: 0.8rem;
  }
  .granular-buttons {
    grid-template-columns: 1fr;
  }
  .granular-button {
    grid-template-columns: 24px minmax(0, 1fr);
    min-height: 42px;
    padding: 8px 9px;
  }
  .granular-label {
    -webkit-line-clamp: 3;
  }
  .modal-backdrop {
    align-items: flex-end;
    padding: 10px;
  }
  .prediction-modal {
    border-radius: 14px;
    max-height: min(82vh, calc(100vh - 20px));
    padding: 18px;
    width: 100%;
  }
  .modal-close {
    height: 34px;
    right: 12px;
    top: 12px;
    width: 34px;
  }
  .prediction-modal h2 {
    font-size: 1.25rem;
    margin-right: 42px;
  }
  .modal-prediction {
    font-size: 0.98rem;
  }
  .modal-evidence {
    font-size: 0.9rem;
    overflow-wrap: anywhere;
  }
}

/* Monthly news dots */
.event-node {
  align-items: center;
  color: var(--event);
  display: flex;
  font-size: 0.7rem;
  font-weight: 850;
  height: 22px;
  justify-content: center;
  line-height: 1;
  width: 22px;
}
.event-dot {
  align-items: center;
  background: var(--event);
  border: 3px solid var(--paper);
  border-radius: 999px;
  box-shadow: 0 0 0 2px rgba(155, 63, 45, 0.28);
  color: var(--paper);
  display: flex;
  font-size: 0.66rem;
  font-weight: 900;
  height: 100%;
  justify-content: center;
  line-height: 1;
  width: 100%;
}
.event-count {
  display: none;
  color: white;
  font-size: 0.66rem;
  left: 50%;
  pointer-events: none;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
}
.event-node.is-active .event-dot {
  outline: 3px solid rgba(155, 63, 45, 0.16);
  outline-offset: 7px;
}
.event-node:hover .event-dot {
  background: #7f3123;
}

@media (max-width: 680px) {
  .news-lane .event-node {
    height: 15px;
    width: 15px;
  }
  .news-lane .event-dot {
    border-width: 1px;
    box-shadow: 0 0 0 1px rgba(155, 63, 45, 0.2);
    font-size: 0.48rem;
  }
}

.timeline-scroll {
  overflow-x: hidden;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}

/* Final mobile layout pass */
@media (max-width: 720px) {
  html,
  body {
    overflow-x: hidden;
  }

  .site-header,
  main {
    max-width: none;
    padding-left: 14px;
    padding-right: 14px;
  }

  .site-header {
    padding-top: 16px;
  }

  .topbar {
    align-items: flex-start;
    gap: 12px;
  }

  .topbar-links {
    justify-content: flex-start;
  }

  .intro {
    align-items: start;
    gap: 16px;
    grid-template-columns: 1fr;
    padding: 30px 0 18px;
  }

  h1 {
    font-size: clamp(2.5rem, 16vw, 4rem);
    max-width: 8ch;
  }

  .intro p {
    font-size: 1rem;
    line-height: 1.55;
    max-width: 34rem;
  }

  .timeline-card {
    border-radius: 14px;
    margin-left: -2px;
    margin-right: -2px;
    overflow: hidden;
    padding: 52px 14px 18px;
  }

  .timeline-card::after {
    background: linear-gradient(90deg, rgba(255, 253, 248, 0), var(--paper));
    bottom: 20px;
    content: "";
    pointer-events: none;
    position: absolute;
    right: 0;
    top: 94px;
    width: 26px;
    z-index: 3;
  }

  .timeline-scroll {
    margin-left: -4px;
    margin-right: -4px;
    overflow-x: auto;
    padding-left: 4px;
    padding-right: 4px;
  }

  .feedback-nudge {
    font-size: 0.82rem;
    left: auto !important;
    padding: 0;
    right: 18px;
    top: 18px;
    transform: rotate(-2deg);
  }

  .timeline-header {
    margin-bottom: 8px;
    padding-bottom: 10px;
  }

  .timeline-header h2 {
    font-size: 1rem;
  }

  .timeline-header p {
    font-size: 0.88rem;
    line-height: 1.42;
    max-width: 18rem;
  }

  .timeline-canvas {
    gap: 8px;
    height: 198px;
    min-width: 700px;
    overflow: visible;
    padding: 4px 10px 0;
    width: 700px;
  }

  .year-ruler {
    height: 36px;
  }

  .year-ruler span {
    font-size: 1.8rem;
  }

  .timeline-lane {
    height: 62px;
  }

  .lane-label {
    font-size: 0.82rem;
    top: 24px;
  }

  .lane-line {
    left: 10%;
    right: 10%;
    top: 34px;
  }

  .period-node,
  .event-node {
    top: 34px;
  }

  .period-dot {
    height: 23px;
    width: 23px;
  }

  .period-label {
    font-size: 0.78rem;
    top: 30px;
  }

  .news-lane {
    display: block;
    height: 58px;
    padding-top: 0;
  }

  .news-lane .event-node {
    height: 15px;
    position: absolute;
    top: 34px;
    transform: translate(-50%, -50%);
    width: 15px;
  }

  .news-lane .event-dot {
    border-width: 1px;
    box-shadow: 0 0 0 1px rgba(155, 63, 45, 0.18);
    font-size: 0.46rem;
  }

  .detail-card {
    border-radius: 14px;
    padding: 18px 16px;
  }

  .detail-card h2 {
    font-size: clamp(1.55rem, 9vw, 2.3rem);
    line-height: 1.05;
  }

  .detail-body,
  .entry-row p {
    font-size: 0.98rem;
    line-height: 1.48;
  }

  .entry-list {
    gap: 16px;
  }

  .entry-row {
    gap: 8px;
    grid-template-columns: 1fr;
    padding-top: 16px;
  }

  .entry-kind {
    font-size: 0.68rem;
  }

  .news-group summary {
    align-items: start;
    column-gap: 10px;
    grid-template-columns: 18px minmax(0, 1fr) max-content;
    padding: 12px;
  }

  .news-group-count {
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
  }

  .news-group-title {
    line-height: 1.25;
    min-width: 0;
    overflow-wrap: normal;
    padding-right: 0;
    word-break: normal;
  }

  .news-group-preview {
    grid-column: 1 / -1;
    white-space: normal;
  }

  .news-item {
    grid-template-columns: 1fr;
  }

  .granular-buttons {
    grid-template-columns: 1fr;
  }

  .site-footnotes {
    display: grid;
    gap: 8px;
    font-size: 0.76rem;
  }
}

@media (max-width: 420px) {
  .site-header,
  main {
    padding-left: 10px;
    padding-right: 10px;
  }

  .brand,
  .topbar-links a {
    font-size: 0.66rem;
    letter-spacing: 0.075em;
  }

  .topbar-links {
    gap: 8px 12px;
  }

  .timeline-card {
    padding-left: 12px;
    padding-right: 12px;
  }

  .timeline-canvas {
    min-width: 660px;
    width: 660px;
  }

  .news-lane .event-node {
    height: 14px;
    width: 14px;
  }

  .news-lane .event-dot {
    font-size: 0.42rem;
  }

  .detail-card {
    padding-left: 14px;
    padding-right: 14px;
  }
}
