/* Hypotheses for 2031: a pine band with a forest plot (one row per hypothesis: where the facts
   point now, a band for how sure, last week as a hollow ring), then a paper panel per hypothesis
   with its three time views, drivers, signposts and evidence. Towards is blue, away is rose
   (validated: dataviz validate_palette, light and on the pine band). */

:root {
  --hp-t: #1f6fa8; --hp-a: #b8455e;
  --hp-t-band: #358ad0; --hp-a-band: #dc5a72;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --hp-t: #358ad0; --hp-a: #dc5a72; } }
:root[data-theme="dark"] { --hp-t: #358ad0; --hp-a: #dc5a72; }

.hp-band { background: radial-gradient(110% 120% at 90% -20%, #14524a 0%, var(--pine) 52%, #072823 100%); color: #e6efe9; }
.hp-band .in { max-width: 1240px; margin: 0 auto; padding: 30px 20px 30px; }
.hp-band h1 { color: #fff; font-size: clamp(2.2rem, 4.4vw, 3.2rem); margin: 0 0 10px; letter-spacing: -0.02em; }
.hp-lede { font-family: var(--serif); font-size: 1.18rem; line-height: 1.55; color: #dce9e1; max-width: 44em; margin: 0 0 26px; }

/* the forest plot */
.fp { display: grid; gap: 2px; }
.fp-axis, .fp-row { display: grid; grid-template-columns: minmax(180px, 300px) minmax(0, 1fr) 150px; gap: 18px; align-items: center; }
.fp-axis { font-size: 0.74rem; color: #8fb0a3; padding-bottom: 6px; }
.fp-axis span:first-child { grid-column: 2; display: flex; justify-content: space-between; }
.fp-axis { position: relative; }
.fp-axis span { grid-column: 2; grid-row: 1; }
.fp-axis span:nth-child(1) { justify-self: start; }
.fp-axis span:nth-child(2) { justify-self: center; }
.fp-axis span:nth-child(3) { justify-self: end; }
.fp-row { text-decoration: none; color: inherit; padding: 9px 10px; margin: 0 -10px; border-radius: 8px; }
.fp-row:hover, .fp-row:focus-visible { background: rgba(255, 255, 255, 0.05); outline: none; }
.fp-row:focus-visible { box-shadow: 0 0 0 2px var(--chartreuse); }
.fp-name { font-family: var(--serif); font-size: 1.08rem; font-weight: 600; color: #fff; line-height: 1.25; }
.fp-row:hover .fp-name { color: var(--chartreuse); }
.fp-track { position: relative; height: 30px; border-radius: 15px;
  background: linear-gradient(90deg, rgba(220, 90, 114, 0.22) 0%, rgba(220, 90, 114, 0.05) 46%, rgba(255, 255, 255, 0.03) 50%, rgba(53, 138, 208, 0.05) 54%, rgba(53, 138, 208, 0.24) 100%); }
.fp-mid { position: absolute; left: 50%; top: 4px; bottom: 4px; width: 1px; background: rgba(230, 239, 233, 0.35); }
.fp-band { position: absolute; top: 8px; bottom: 8px; border-radius: 7px; background: rgba(230, 239, 233, 0.2); box-shadow: inset 0 0 0 1px rgba(230, 239, 233, 0.28); }
.fp-dot { position: absolute; top: 50%; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%; background: var(--chartreuse); box-shadow: 0 0 0 3px var(--pine), 0 0 16px rgba(183, 201, 88, 0.55); }
.fp-prev { position: absolute; top: 50%; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; border: 2px solid rgba(230, 239, 233, 0.7); }
/* for / against: blue #4a8fc6 and orange #d9763c pass every dataviz check on the pine (CVD dE 19.4) */
.fp-tally { position: relative; display: grid; grid-template-columns: 1fr 1px 1fr; align-items: center; gap: 0 10px; min-height: 30px; }
.fp-tally .fp-mid { position: static; height: 26px; width: 1px; background: rgba(230, 239, 233, 0.35); }
.fp-side { display: flex; flex-wrap: wrap; gap: 4px; }
.fp-side.a { flex-direction: row-reverse; flex-wrap: wrap-reverse; }
.fp-side i { width: 10px; height: 10px; border-radius: 50%; }
.fp-side.t i { background: #4a8fc6; }
.fp-side.a i { background: #d9763c; }
.k-t, .k-a { width: 10px; height: 10px; border-radius: 50%; }
.k-t { background: #4a8fc6; }
.k-a { background: #d9763c; }
.fp-num { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.fp-num b { font-family: var(--serif); font-size: 1.7rem; color: #fff; font-weight: 600; line-height: 1; }
.fp-num small { color: #8fb0a3; font-size: 0.8rem; }
.fp-num .mv { margin-left: auto; font-style: normal; font-size: 0.8rem; font-weight: 600; }
.hp-band .mv.towards { color: #8cc4ef; } .hp-band .mv.away { color: #f1a0b1; } .hp-band .mv.level { color: #7f9c91; font-weight: 400; }
.hp-key { display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 16px 0 0; font-size: 0.78rem; color: #9fbcb1; }
.hp-key span { display: inline-flex; align-items: center; gap: 7px; }
.hp-key i { display: inline-block; }
.k-dot { width: 11px; height: 11px; border-radius: 50%; background: var(--chartreuse); }
.k-band { width: 26px; height: 10px; border-radius: 5px; background: rgba(230, 239, 233, 0.2); box-shadow: inset 0 0 0 1px rgba(230, 239, 233, 0.3); }
.k-prev { width: 10px; height: 10px; border-radius: 50%; border: 2px solid rgba(230, 239, 233, 0.7); }
@media (max-width: 760px) {
  .fp-axis, .fp-row { grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; }
  .fp-axis { display: none; }
  .fp-name { grid-column: 1; }
  .fp-num { grid-column: 2; grid-row: 1; }
  .fp-track, .fp-tally { grid-column: 1 / -1; }
}

/* each hypothesis */
.hp { scroll-margin-top: 16px; }
.hp-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; align-items: start; border-bottom: 1px solid var(--line); padding-bottom: 14px; margin-bottom: 18px; }
.hp-head h2 { margin: 0 0 6px; }
.hp-text { font-family: var(--serif); font-size: 1.06rem; line-height: 1.55; color: var(--ink-soft); margin: 0; max-width: 46em; }
.hp-score { text-align: right; min-width: 150px; }
.hp-score b { font-family: var(--serif); font-size: 2.6rem; line-height: 1; font-weight: 600; color: var(--ink); }
.hp-score span { color: var(--muted); margin-left: 4px; }
.hp-score p { margin: 6px 0 0; color: var(--muted); }

.hp-views { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; margin-bottom: 20px; }
.hp-view { margin: 0; background: var(--band); border-radius: 10px; padding: 14px 16px 12px; }
.hp-view figcaption { font-weight: 600; font-size: 0.9rem; margin-bottom: 8px; }
.hp-view svg { display: block; width: 100%; height: auto; overflow: visible; }
.hp-view .mid { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; opacity: 0.6; }
.hp-view .lab { font-size: 9px; fill: var(--muted); text-anchor: end; }
.hp-view .lab.l { text-anchor: start; }
.hp-line path { fill: none; stroke: var(--ink); stroke-width: 2; stroke-linejoin: round; }
.hp-line circle { fill: var(--ink); stroke: var(--band); stroke-width: 2; }
.hp-line circle:hover { fill: var(--accent); }
.hp-years .t { fill: var(--hp-t); } .hp-years .a { fill: var(--hp-a); }
.hp-years rect { stroke: var(--band); stroke-width: 1; }
.hp-yticks { display: flex; justify-content: space-around; margin: 2px 0 6px; font-size: 0.74rem; color: var(--muted); }
.hp-big { margin: 4px 0 6px; font-size: 0.95rem; }
.hp-big b { font-family: var(--serif); font-size: 2.2rem; font-weight: 600; margin-right: 4px; }
.hp-view .small { margin: 0 0 6px; line-height: 1.45; }
.hp-wait { padding: 26px 0; }
.mv.towards { color: var(--hp-t); } .mv.away { color: var(--hp-a); }

.hp-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 34px; }
.hp-cols h3 { font-size: 1rem; margin: 0 0 10px; display: flex; align-items: baseline; gap: 10px; }
.hp-seen { color: var(--muted); font-weight: 400; }
.hp-drivers { list-style: none; margin: 0; padding: 0; }
.hp-drivers li { display: grid; grid-template-columns: 150px minmax(0, 1fr) 30px; gap: 10px; align-items: center; padding: 4px 0; font-size: 0.88rem; }
.hp-drivers .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hp-drivers .dv { display: grid; grid-template-columns: 1fr 1fr; height: 12px; }
.hp-drivers .dv .l { display: flex; justify-content: flex-end; border-right: 1px solid var(--muted); }
.hp-drivers .dv i { display: block; height: 100%; }
.hp-drivers .dv .a { background: var(--hp-a); border-radius: 4px 0 0 4px; margin-right: 2px; }
.hp-drivers .dv .t { background: var(--hp-t); border-radius: 0 4px 4px 0; margin-left: 2px; }
.hp-drivers .n { text-align: right; color: var(--muted); }
.hp-cats { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 10px 0 0; color: var(--ink-soft); }
.hp-cats span { display: inline-flex; align-items: center; gap: 6px; }
.cat-sw { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }

.hp-signs { list-style: none; margin: 0; padding: 0; }
.hp-signs li { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 0.9rem; line-height: 1.45; }
.hp-signs li > span:last-child > * { display: block; margin-top: 2px; }
.hp-signs li > span:last-child > .sw { display: inline; margin: 0 4px 0 0; }
.hp-signs .tick { width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--line); display: grid; place-items: center; font-size: 0.75rem; color: #fff; }
.hp-signs li.seen.towards .tick { background: var(--hp-t); border-color: var(--hp-t); }
.hp-signs li.seen.against .tick { background: var(--hp-a); border-color: var(--hp-a); }
.hp-signs .sw { font-size: 0.74rem; font-weight: 600; }
.hp-signs .towards .sw { color: var(--hp-t); } .hp-signs .against .sw { color: var(--hp-a); }
.hp-signs li:not(.seen) { color: var(--ink-soft); }
.hp-draft { margin: 10px 0 0; padding: 8px 11px; background: var(--amber-soft); border-radius: 8px; color: var(--ink-soft); }

.hp-ev { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 12px; }
.hp-ev summary { cursor: pointer; font-weight: 600; font-size: 0.95rem; }
.hp-evcols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 30px; margin-top: 12px; }
.hp-evcols h4 { margin: 0 0 6px; font-size: 0.9rem; }
.hp-evcols h4.t { color: var(--hp-t); } .hp-evcols h4.a { color: var(--hp-a); }
.hp-fact { padding: 9px 0 9px 12px; border-left: 3px solid var(--line); margin-bottom: 8px; }
.hp-fact.towards { border-left-color: var(--hp-t); } .hp-fact.against { border-left-color: var(--hp-a); }
.hp-claim { margin: 0 0 4px; font-size: 0.92rem; }
.hp-claim a { font-weight: 600; }
.hp-fact blockquote { margin: 0 0 4px; font-family: var(--serif); font-size: 0.9rem; color: var(--ink-soft); }
.hp-fact p.small { margin: 0; }

.hp-empty { border-color: var(--amber); }
.hp-how { max-width: 60em; }
.hp-tip { position: absolute; z-index: 20; max-width: 280px; background: var(--ink); color: #fff; border-radius: 7px; padding: 6px 10px; font-size: 0.8rem; pointer-events: none; opacity: 0; transform: translateY(-100%); transition: opacity .1s; }
.hp-tip.on { opacity: 1; }

@media (max-width: 960px) {
  .hp-views { grid-template-columns: 1fr; }
  .hp-cols, .hp-evcols { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .hp-head { grid-template-columns: 1fr; }
  .hp-score { text-align: left; }
  .hp-drivers li { grid-template-columns: 110px minmax(0, 1fr) 26px; }
}
@media (prefers-reduced-motion: reduce) { .hp-tip { transition: none; } }

/* the rail on This week */
.wk-hyp ul { list-style: none; margin: 0 0 10px; padding: 0; }
.wk-hyp li { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 0.9rem; }
.wk-hyp li .num { white-space: nowrap; }

/* the Against / For labels sit beside the centre line, on the same grid as the event dots */
.fp-axis span.fp-axis-t { grid-column: 2; grid-row: 1; justify-self: stretch; display: grid; grid-template-columns: 1fr 1px 1fr; gap: 0 10px; }
.fp-axis-t b { font-weight: 400; }
.fp-axis-t b:first-child { text-align: right; }
