/* Statement timeline. Dark card, white text, indigo and cyan accents, rose only for "not stated".
   Two designs on one DOM: tall (the fixed 1060px frame used below 900px) is the base,
   wide (aspect ratio 13:10 or wider) overrides it at the foot of this file. */
:root {
  --bg: #0b1726; --panel: #102039; --panel2: #16294a; --line: #2f4668;
  --mute: #b9c7dc;
  --indigo: #635bff; --indigo-t: #b3afff; --cyan: #06b6d4; --cyan-t: #3fd9f0; --rose: #fb7185;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
html { background: var(--bg); color-scheme: dark; font-size: 16px; }
body { margin: 0; background: var(--bg); color: #fff; font-family: var(--font); line-height: 1.35; min-height: 100vh; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
ol, ul { margin: 0; padding: 0; list-style: none; }
.lw { display: none; }
.lt { display: inline; }

.stage { position: relative; display: flex; flex-direction: column; height: 100vh; padding: 0.76rem 0.875rem 0.6rem; gap: 0.5rem; max-width: 46rem; margin: 0 auto; }
.top { display: flex; flex-direction: column; gap: 0.5rem; }
h1 { margin: 0; font-size: 1.25rem; line-height: 1.2; font-weight: 700; }
.ctl { display: flex; gap: 0.5rem; }
.btn { min-height: 2.75rem; min-width: 5.5rem; padding: 0 1rem; border: 1px solid #5b7399; background: var(--panel2); border-radius: 0.5rem; font-size: 0.875rem; font-weight: 600; }
.btn:hover:not(:disabled) { border-color: #fff; }
.btn:disabled { color: #a8b6cc; border-color: var(--line); background: transparent; cursor: default; }
.btn[hidden] { display: none; }
.sub { display: none; margin: 0; font-size: 0.875rem; color: var(--mute); }

/* ---------- the year strip ---------- */
.strip { display: grid; grid-template-columns: 1fr; gap: 0.2rem; flex: none; }
.big-col { position: absolute; top: 3.2rem; right: 0.875rem; display: flex; align-items: baseline; }
.big { font-size: 2.6rem; line-height: 1; font-weight: 800; font-variant-numeric: tabular-nums; min-width: 4ch; text-align: right; min-height: 2.6rem; color: var(--cyan-t); }
.big[data-y="2007"] { color: var(--indigo-t); }
.big[data-y="1978"] { color: #fff; }
.big-cap { display: none; font-size: 0.875rem; color: var(--mute); }
.strip-main { min-width: 0; }
.bar-wrap { position: relative; padding-top: 1.45rem; }
.bar { position: relative; height: 2.7rem; border: 1px solid var(--line); border-radius: 0.3rem; background: rgba(255, 255, 255, 0.05); }
.seg { position: absolute; top: 0; bottom: 0; clip-path: inset(0 0 0 100%); transition: clip-path var(--dur, 0.5s) cubic-bezier(0.3, 0.7, 0.2, 1); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.seg.on { clip-path: inset(0 0 0 0); }
.seg[data-y="2010"] { background: var(--cyan); }
.seg[data-y="2007"] { background: var(--indigo); }
.seg[data-y="1978"] { background: #fff; }
.seg-t { font-size: 0.875rem; font-weight: 700; line-height: 1.15; color: #0b1726; text-align: center; padding: 0 0.3rem; }
.mk { position: absolute; top: -0.2rem; bottom: -0.2rem; width: 3px; margin-left: -1.5px; background: #fff; border-radius: 2px; opacity: 0; transition: left var(--dur, 0.5s) cubic-bezier(0.3, 0.7, 0.2, 1), opacity 0.2s; z-index: 2; }
.mk::before { content: ""; position: absolute; top: -0.5rem; left: 50%; margin-left: -0.35rem; border: 0.35rem solid transparent; border-top-color: #fff; border-bottom-width: 0; }
.mk.on { opacity: 1; }
.yt { position: relative; height: 1.4rem; margin-top: 0.15rem; }
.tk { position: absolute; top: 0; transform: translateX(-50%); font-size: 0.875rem; color: var(--mute); white-space: nowrap; font-variant-numeric: tabular-nums; }
.tk.first { transform: none; }
.tk.st.on { color: #fff; font-weight: 700; }
.tk.end { transform: translateX(-100%); }
.tk[data-y="2007"] { transform: translateX(-100%); }
.tk[data-y="2010"] { transform: none; }
.tk.opt { display: none; }
.tag { position: absolute; top: 0; transform: translateX(-50%); font-size: 0.875rem; font-weight: 600; color: #fff; background: #1d2b57; border: 1px dashed var(--indigo-t); border-radius: 0.3rem; padding: 0 0.45rem; white-space: nowrap; opacity: 0; transition: opacity 0.3s; }
.tag.on { opacity: 1; }
.read { margin: 0.1rem 0 0; font-size: 0.875rem; min-height: 2.7em; }
.chip { display: none; width: fit-content; max-width: 100%; font-size: 0.875rem; color: var(--rose); border: 1px solid var(--rose); border-radius: 0.9rem; padding: 0.05rem 0.7rem; }
.chip.on { display: block; }

/* ---------- the timeline, tall design: a rail drawn to scale, cards beside it ---------- */
.tl { position: relative; flex: none; height: calc(var(--tl-h, 440px) + 2.9rem); }
.plot { position: absolute; left: 0; right: 0; top: 2.9rem; bottom: 0; --gcol: 5rem; --railw: 1.1rem; --cardx: calc(var(--gcol) + var(--railw) + 16px); }
.plot::before { content: ""; position: absolute; left: calc(var(--gcol) + var(--railw) / 2 - 1px); top: 0; height: var(--rail, 280px); width: 2px; background: var(--line); }
.decor { display: none; }
.evli { margin: 0.35rem 0; }
.js .evli { position: absolute; margin: 0; top: var(--ty, 0); left: var(--cardx); right: 0; height: var(--card-h, 48px); z-index: 3; }
.ev { width: 100%; height: 100%; display: grid; grid-template-columns: 3.6rem 1fr; grid-template-rows: 1fr 1fr; align-items: center; text-align: left; padding: 0.1rem 0.5rem 0.1rem 0.4rem; background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--line); border-radius: 0.4rem; color: #fff; transition: background-color 0.3s, border-color 0.3s, box-shadow 0.3s; }
.ev .y { grid-row: 1 / span 2; font-size: 1.25rem; font-weight: 800; color: var(--mute); font-variant-numeric: tabular-nums; transition: color 0.3s; }
.ev time { font-size: 0.875rem; font-weight: 700; line-height: 1.15; align-self: end; }
.ev .l { font-size: 0.875rem; color: var(--mute); line-height: 1.15; align-self: start; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev[data-y="2010"] { --c: var(--cyan); --ct: var(--cyan-t); }
.ev[data-y="2007"] { --c: var(--indigo); --ct: var(--indigo-t); }
.ev[data-y="1978"] { --c: #fff; --ct: #fff; }
.ev.lit { background: var(--panel2); border-color: var(--c); }
.ev.lit .y { color: var(--ct); }
.ev.now { box-shadow: 0 0 0 2px var(--c); }
.ev.check { border-style: dashed; }
.ev:hover, .ev.pin { background: #1d3560; border-color: #fff; }
.ev.pin { box-shadow: 0 0 0 2px #fff; }

.dot { position: absolute; z-index: 2; left: calc(var(--gcol) + var(--railw) / 2); top: var(--ty, 0); width: 0.8rem; height: 0.8rem; margin: -0.4rem 0 0 -0.4rem; border-radius: 50%; border: 2px solid var(--line); background: var(--bg); }
.dot[data-y="2010"], .sp[data-y="2010"] { --c: var(--cyan); }
.dot[data-y="2007"], .sp[data-y="2007"] { --c: var(--indigo); }
.dot[data-y="1978"], .sp[data-y="1978"] { --c: #fff; }
.dot.lit { background: var(--c); border-color: var(--c); }
.sp { position: absolute; z-index: 1; left: calc(var(--gcol) + var(--railw) / 2); top: var(--ty, 0); width: var(--len, 20px); height: 2px; margin-top: -1px; background: var(--line); transform-origin: 0 50%; transform: rotate(var(--ang, 0rad)); }
.sp.lit { background: var(--c); }
.ph { position: absolute; z-index: 2; left: var(--gcol); width: calc(var(--railw) + 8px); margin-left: -4px; height: 3px; margin-top: -1px; top: calc(var(--pu, 0) * var(--rail, 280px)); background: #fff; border-radius: 2px; pointer-events: none; }

.gapli { position: absolute; z-index: 2; }
.gapli.ruler { left: 0; width: calc(var(--gcol) + var(--railw)); top: calc(var(--u0) * var(--rail, 280px)); height: calc((var(--u1) - var(--u0)) * var(--rail, 280px)); }
.gapli.bracket { left: 0; right: 0; top: -2.9rem; height: 2.6rem; }
.gap { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; display: grid; grid-template-columns: 1fr var(--railw); align-items: center; background: transparent; border: 0; --c: #8aa0c4; --cf: rgba(138, 160, 196, 0.28); color: #fff; overflow: hidden; }
.gap[data-y="2010"] { --c: var(--cyan); --cf: rgba(6, 182, 212, 0.32); }
.gap[data-y="2007"] { --c: var(--indigo); --cf: rgba(99, 91, 255, 0.5); }
.gap .fill { grid-column: 2; grid-row: 1; align-self: stretch; background: var(--c); transform-origin: 50% 0; transform: scaleY(var(--k, 0)); border-radius: 2px; }
.gap .gl { grid-column: 1; grid-row: 1; justify-self: end; text-align: right; padding-right: 0.45rem; display: flex; flex-direction: column; line-height: 1.05; font-size: 0.875rem; }
.gap .gl b { font-size: 0.875rem; }
.gap .dv { color: var(--mute); font-size: 0.875rem; }
.gap:hover .gl, .gap.pin .gl { text-decoration: underline; }
.gap.pin { outline: 2px solid #fff; outline-offset: 1px; }
.gapli.bracket .gap { grid-template-columns: 1fr; border: 1px solid var(--c); border-radius: 0.4rem; background: rgba(11, 23, 38, 0.6); }
.gapli.bracket .gap .fill { grid-column: 1; transform-origin: 0 50%; transform: scaleX(var(--k, 0)); background: var(--cf); border-radius: 0; }
.gapli.bracket .gap .gl { grid-column: 1; justify-self: center; text-align: center; flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 0 0.3em; padding: 0 0.5rem; position: relative; }

/* ---------- scrub row ---------- */
.scrub { display: grid; grid-template-columns: 3.6rem 1fr; column-gap: 0.4rem; align-items: center; flex: none; }
.scrub-l { font-size: 0.875rem; color: var(--mute); }
.scrub input[type="range"] { -webkit-appearance: none; appearance: none; display: block; width: 100%; height: 2.4rem; margin: 0; background: transparent; cursor: pointer; }
.scrub input[type="range"]::-webkit-slider-runnable-track { height: 6px; border-radius: 3px; background: #3a5278; }
.scrub input[type="range"]::-moz-range-track { height: 6px; border-radius: 3px; background: #3a5278; }
.scrub input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 26px; height: 26px; margin-top: -10px; border-radius: 50%; background: #fff; border: 5px solid var(--indigo); }
.scrub input[type="range"]::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 5px solid var(--indigo); }
.when { grid-column: 1 / span 2; margin: 0; font-size: 0.875rem; min-height: 2.7em; }

/* ---------- tooltip: docked below the scrub row in the tall design, floating in the wide one ---------- */
.dock { flex: 1 1 auto; min-height: 7rem; position: relative; }
.hint { margin: 0; padding: 0.6rem 0.8rem; font-size: 0.875rem; color: var(--mute); border: 1px dashed var(--line); border-radius: 0.5rem; }
.hint[hidden] { display: none; }
.tip { position: relative; max-height: 100%; overflow: auto; padding: 0.35rem 0.8rem; background: #09111f; border: 1px solid #5b7399; border-radius: 0.5rem; font-size: 0.875rem; }
.tip[hidden] { display: none; }
.tip p { margin: 0; }
.tip[data-y="2010"] { border-left: 5px solid var(--cyan); }
.tip[data-y="2007"] { border-left: 5px solid var(--indigo); }
.tip[data-y="1978"] { border-left: 5px solid #fff; }
.tk-kick { display: none; color: var(--mute); }
.tk-date { font-weight: 700; font-size: 1rem; }
.tk-range { font-weight: 600; }
.tk-who { margin-top: 0.1rem; }
.qb { margin-top: 0.2rem; }
.qh, .qn { color: var(--mute); }
.q { margin: 0.05rem 0 0; padding: 0 0 0 0.6rem; border-left: 2px solid #5b7399; font-style: italic; }
.tk-der { margin-top: 0.2rem; color: var(--cyan-t); font-weight: 600; }
.tk-mid { margin-top: 0.2rem; }
.tk-ns { margin-top: 0.2rem; color: var(--rose); font-weight: 600; }
.tk-src { margin-top: 0.25rem; color: var(--mute); }
.tk-close { display: none; position: absolute; top: 0.25rem; right: 0.35rem; min-height: 2.75rem; padding: 0 1rem; background: var(--panel2); border: 1px solid #5b7399; border-radius: 0.4rem; font-weight: 600; font-size: 0.875rem; }
.tip.pinned .tk-close { display: inline-block; }
.src { margin: 0; flex: none; font-size: 0.875rem; color: var(--mute); }
.tipping .src { display: none; }

/* ---------- wide design: statements in lanes above and below a date ruler ---------- */
@media (min-aspect-ratio: 13/10) {
  .lw { display: inline; }
  .lt { display: none; }
  html { font-size: min(calc(100vw / 53), calc(100vh / 33.125)); }
  body { overflow: hidden; }
  .stage { max-width: calc(100vh * 1.6); padding: 0.6rem 1rem 0.4rem; gap: 0.3rem; }
  .top { flex-direction: row; align-items: center; justify-content: space-between; gap: 1rem; }
  h1 { font-size: 1.2rem; }
  .btn { min-height: 1.9rem; min-width: 4.6rem; padding: 0 0.8rem; font-size: 0.8rem; }
  .sub { display: block; font-size: 0.78rem; margin-top: -0.25rem; }

  .strip { grid-template-columns: 7rem 1fr; column-gap: 0.6rem; margin-top: 0.15rem; }
  .big-col { position: static; flex-direction: column; align-items: flex-start; gap: 0.05rem; padding-top: 0.9rem; }
  .big-cap { display: block; }
  .big { font-size: 2.4rem; min-height: 2.4rem; min-width: 0; text-align: left; }
  .big-cap { font-size: 0.76rem; }
  .bar-wrap { padding-top: 1.3rem; }
  .bar { height: 1.6rem; }
  .seg-t { font-size: 0.78rem; white-space: nowrap; }
  .yt { height: 1rem; }
  .tk { font-size: 0.76rem; }
  .tk[data-y="2007"] { transform: translateX(-50%); }
  .tk[data-y="2010"] { transform: translateX(-50%); }
  .tk.first { transform: none; }
  .tk.opt { display: block; }
  .tag { font-size: 0.76rem; }
  .read { font-size: 0.8rem; min-height: 1.3em; margin-top: 0.1rem; }
  .chip { font-size: 0.76rem; margin-top: 0.1rem; }
  .strip-main { min-height: 6.1rem; }

  .tl { flex: 1 1 auto; height: auto; min-height: 14.8rem; }
  .plot { left: 7.6rem; right: 0.2rem; top: 0; bottom: 0; --cw: 6rem; }
  .plot::before { display: none; }
  .decor { display: block; position: absolute; inset: 0; pointer-events: none; }
  .lane-l { position: absolute; left: -7.4rem; width: 6.8rem; text-align: right; font-size: 0.76rem; line-height: 1.2; color: var(--mute); }
  .lane-l[data-lane="0"] { top: 2.95rem; }
  .lane-l[data-lane="1"] { top: 8.85rem; }
  .lane-l[data-lane="2"] { top: 12.2rem; }
  .qline { position: absolute; left: calc(var(--u) * 100%); top: 1.75rem; bottom: 1.1rem; width: 1px; background: rgba(255, 255, 255, 0.09); }
  .qlab { position: absolute; left: calc(var(--u) * 100%); bottom: 0; transform: translateX(-50%); font-size: 0.76rem; color: var(--mute); white-space: nowrap; }

  .evli, .js .evli { position: absolute; margin: 0; width: var(--cw); height: 3.1rem; left: calc(var(--u) * 100%); right: auto; }
  .evli[data-lane="0"], .js .evli[data-lane="0"] { top: 1.75rem; }
  .evli[data-lane="1"], .js .evli[data-lane="1"] { top: 7.85rem; }
  .evli[data-lane="2"], .js .evli[data-lane="2"] { top: 11.25rem; }
  .evli.rh, .js .evli.rh { left: auto; right: calc((1 - var(--u)) * 100% + 0.9rem); }
  .ev { grid-template-columns: 1fr; grid-template-rows: none; padding: 0.1rem 0.25rem 0.1rem 0.4rem; align-content: center; }
  .ev .y { grid-row: auto; font-size: 1.05rem; line-height: 1.05; }
  .ev time { font-size: 0.76rem; align-self: auto; }
  .ev .l { font-size: 0.76rem; align-self: auto; }
  .ev .lw { display: block; }

  .evli.rh .ev { position: relative; }
  .evli.rh .ev::after { content: ""; position: absolute; left: 100%; top: 50%; width: 0.9rem; height: 2px; margin-top: -1px; background: var(--line); transition: background-color 0.3s; }
  .evli.rh .ev.lit::after { background: var(--c); }
  .dot { left: calc(var(--u) * 100%); top: 5.1rem; width: 0.6rem; height: 0.6rem; margin: -0.3rem 0 0 -0.3rem; }
  .dot[data-lane="1"], .dot[data-lane="2"] { top: 7.5rem; }
  .sp { left: calc(var(--u) * 100%); width: 2px; margin: 0 0 0 -1px; transform: none; }
  .sp[data-lane="0"] { top: 4.85rem; height: 0.3rem; }
  .sp[data-lane="1"] { top: 7.5rem; height: 0.4rem; }
  .sp[data-lane="2"] { top: 7.5rem; height: 3.8rem; }
  .ph { top: 1.75rem; bottom: 1.1rem; height: auto; left: calc(var(--pu, 0) * 100%); width: 2px; margin: 0 0 0 -1px; background: rgba(255, 255, 255, 0.8); border-radius: 0; }
  .ph::before { content: ""; position: absolute; left: 50%; top: 3.1rem; width: 0.7rem; height: 0.7rem; margin-left: -0.35rem; border-radius: 50%; background: #fff; box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.25); }

  .gapli.ruler, .gapli.bracket { left: calc(var(--u0) * 100%); right: auto; width: calc((var(--u1) - var(--u0)) * 100%); }
  .gapli.ruler { top: 5.1rem; height: 2.4rem; }
  .gapli.bracket { top: 0; height: 1.5rem; }
  .gap { grid-template-columns: 1fr; border: 1px solid var(--c); border-radius: 0.3rem; background: rgba(11, 23, 38, 0.55); }
  .gap .fill { grid-column: 1; transform-origin: 0 50%; transform: scaleX(var(--k, 0)); background: var(--cf); border-radius: 0; }
  .gap .gl { grid-column: 1; justify-self: center; text-align: center; padding: 0 0.25rem; font-size: 0.78rem; position: relative; }
  .gap .gl b { font-size: 0.82rem; }
  .gap .dv { font-size: 0.76rem; }

  .scrub { grid-template-columns: 7.6rem 1fr; column-gap: 0; align-items: center; }
  .scrub-l { font-size: 0.78rem; }
  .scrub input[type="range"] { height: 1.6rem; width: calc(100% + 20px); margin: 0 -10px; }
  .scrub input[type="range"]::-webkit-slider-thumb { width: 20px; height: 20px; margin-top: -7px; border-width: 4px; }
  .when { font-size: 0.8rem; min-height: 1.3em; }

  .dock { flex: none; min-height: 0; height: 0; position: static; }
  .hint { display: none; }
  .tip { pointer-events: none; position: absolute; z-index: 30; width: 24rem; max-width: calc(100% - 1rem); max-height: calc(100% - 1rem); font-size: 0.8rem; padding: 0.5rem 0.7rem; box-shadow: 0 0.6rem 1.6rem rgba(0, 0, 0, 0.55); }
  .tk-kick { display: block; font-size: 0.76rem; }
  .tk-date { font-size: 0.9rem; }
  .tk-close { position: static; margin-top: 0.4rem; min-height: 1.9rem; font-size: 0.8rem; pointer-events: auto; }
  .src, .tipping .src { display: block; font-size: 0.76rem; }
}

/* Without script the plain list and the plain gap list show as text, in order. */
html:not(.js) body { overflow: auto; }
html:not(.js) .stage { height: auto; min-height: 100vh; }
html:not(.js) .tl { height: auto; min-height: 0; }
html:not(.js) .plot { position: static; }
html:not(.js) .plot::before { display: none; }
html:not(.js) .events, html:not(.js) .gaps { list-style: disc; padding-left: 1.2rem; margin: 0.4rem 0; font-size: 0.875rem; }
html:not(.js) .gapli, html:not(.js) .evli { position: static; }
html:not(.js) .scrub, html:not(.js) .dock, html:not(.js) .ctl { display: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
.frozen *, .frozen *::before, .frozen *::after { transition: none !important; animation: none !important; }
