:root {
  --ink: #f4f7fb;
  --bar: #850942;
  --header: #14151c;
  --stage-top: #123f78;
  --stage-mid: #1a5696;
  --stage-bottom: #0d3c72;
  --paper: #ffffff;
  --muted: #5c564e;
  --header-h: 64px;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--header);
  color: var(--ink);
  font-family: "Source Sans 3", "Source Sans Pro", Helvetica, Arial, sans-serif;
}

button, select { font: inherit; color: inherit; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.topbar {
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 18px;
  padding: 0 22px;
  background: var(--header);
  position: relative;
  z-index: 20;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  background: transparent;
  border: 0;
  padding: 6px 0;
  cursor: pointer;
  letter-spacing: 0.01em;
  font-weight: 600;
  font-size: 18px;
  white-space: nowrap;
}

.brand svg { display: block; }

.brand-row {
  display: flex;
  align-items: center;
  gap: 8px;
  order: 1;
}

.info-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex: none;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.86);
  cursor: pointer;
  padding: 0;
}

.info-btn:hover,
.info-btn:focus-visible {
  background: rgba(255, 255, 255, 0.11);
  border-color: rgba(255, 255, 255, 0.32);
  outline: none;
}

.topbar-tools {
  display: flex;
  align-items: center;
  gap: 14px;
  order: 3;
  margin-left: auto;
}

.count {
  margin: 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}

/* Overview: ribbons only — no dots, pins, date cards, links or inventions. */
.stage.overview .pin,
.stage.overview .yearpin,
.stage.overview .link,
.stage.overview .dot,
.stage.overview .invention,
.stage.overview .event,
.stage.overview .datetip,
.stage.overview .route-sign { display: none; }

/* Overview ribbons start at their date: the left edge, not the arrow tip, sits on the year. */
.stage.overview .person { transform: translate(0, -50%); }

/* Hovering a ribbon in Overview fades the rest and shows that person's own date line. */
.stage.overview.peeking .person,
.stage.overview.peeking .person.lit,
.stage.overview.peeking .person.dim { opacity: 0.18; }
.stage.overview.peeking .person.peek-on,
.stage.overview.peeking .person.peek-on.lit,
.stage.overview.peeking .person.peek-on.dim {
  opacity: 1;
  z-index: 6;
  filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.55)) drop-shadow(0 3px 8px rgba(0, 0, 0, 0.4));
}

.peek {
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
}
.peek[hidden] { display: none; }

.peek-line,
.peek-join {
  position: absolute;
  background: var(--topic, #fff);
  border-radius: 2px;
}
.peek-line {
  height: 3px;
  margin-top: -1.5px;
}
.peek-join {
  width: 3px;
  margin-left: -1.5px;
}
.peek-dot {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--topic, #fff);
  box-shadow: 0 0 0 2px rgba(8, 30, 60, 0.45);
  transform: translate(-50%, -50%);
}
.peek-dot.tech {
  width: 8px;
  height: 8px;
  border-radius: 1.5px;
  transform: translate(-50%, -50%) rotate(45deg);
}
.peek-stem {
  position: absolute;
  width: 2px;
  margin-left: -1px;
  background: rgba(255, 255, 255, 0.92);
}
.peek-note {
  position: absolute;
  padding: 6px 9px;
  border-radius: 8px;
  background: #fff;
  color: #221e1a;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  text-align: center;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.32);
}


.picker {
  position: relative;
  z-index: 16;
}

.picker-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 220px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  padding: 8px 12px;
  cursor: pointer;
  text-align: left;
}

.picker-btn:hover,
.picker-btn[aria-expanded="true"] {
  background: rgba(255, 255, 255, 0.11);
  border-color: rgba(255, 255, 255, 0.32);
}

.picker-label { flex: 1; font-weight: 600; font-size: 15px; }

.chevron {
  width: 10px;
  height: 10px;
  flex: none;
  border-right: 2px solid rgba(255, 255, 255, 0.8);
  border-bottom: 2px solid rgba(255, 255, 255, 0.8);
  transform: translateY(-2px) rotate(45deg);
}

.picker-btn[aria-expanded="true"] .chevron {
  transform: translateY(2px) rotate(225deg);
}

.swatch {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--swatch, #8aa0b8);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.25);
  flex: none;
}

.swatch.all {
  background: conic-gradient(#e23b6a, #f0b429, #2ec4b6, #5b92ff, #c49bff, #e14eca, #3dce8a, #e23b6a);
}

.picker-list {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: 280px;
  max-height: calc(100dvh - var(--header-h) - 12px);
  margin: 0;
  padding: 6px;
  list-style: none;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
  background: #1b1e28;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.4);
  z-index: 30;
}

.picker-list[hidden] { display: none; }

/* The Level and View menus are short, so their buttons and lists are narrower than the topic menu's. */
.level-picker .picker-btn { min-width: 118px; }
.level-picker .picker-list { width: 168px; }
.view-picker .picker-btn { min-width: 168px; }
.view-picker .picker-list { width: 200px; }
.picker-list li[hidden] { display: none; }

.picker-list .rule {
  height: 1px;
  margin: 6px 10px;
  background: rgba(255, 255, 255, 0.14);
}

.picker-list button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: 0;
  background: transparent;
  border-radius: 7px;
  padding: 8px 10px;
  cursor: pointer;
  text-align: left;
  font-weight: 600;
}

.picker-list button:hover:not(:disabled),
.picker-list button:focus-visible:not(:disabled),
.picker-list button[aria-selected="true"] {
  background: rgba(255, 255, 255, 0.08);
  outline: none;
}

.picker-list button:disabled {
  color: rgba(255, 255, 255, 0.38);
  cursor: default;
}

.search {
  position: relative;
  z-index: 17;
  order: 2;
  display: flex;
  align-items: center;
  flex: 0 1 240px;
  min-width: 0;
}

.search-input {
  width: 100%;
  min-width: 140px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  padding: 8px 36px 8px 12px;
  color: inherit;
  font-weight: 600;
  font-size: 15px;
}

.search-input::placeholder {
  color: rgba(255, 255, 255, 0.45);
  font-weight: 500;
}

.search-input:hover,
.search-input:focus {
  background: rgba(255, 255, 255, 0.11);
  border-color: rgba(255, 255, 255, 0.32);
  outline: none;
}

.search-input::-webkit-search-cancel-button { display: none; }

.search-clear {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: rgba(255, 255, 255, 0.75);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.search-clear:hover,
.search-clear:focus-visible { background: rgba(255, 255, 255, 0.12); outline: none; }

.search-list {
  position: absolute;
  left: 0;
  top: calc(100% + 8px);
  width: 360px;
  max-height: min(70vh, calc(100dvh - var(--header-h) - 16px));
  margin: 0;
  padding: 6px;
  list-style: none;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
  background: #1b1e28;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.4);
  z-index: 30;
}

.search-list[hidden] { display: none; }

.search-list button,
.search-empty {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  border: 0;
  background: transparent;
  border-radius: 7px;
  padding: 8px 10px;
  color: inherit;
  cursor: pointer;
  text-align: left;
}

.search-empty {
  cursor: default;
  color: rgba(255, 255, 255, 0.62);
  font-weight: 600;
}

.search-list button:hover,
.search-list button:focus-visible {
  background: rgba(255, 255, 255, 0.08);
  outline: none;
}

.search-kind {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
}

.search-title { font-weight: 600; font-size: 15px; }

.search-snippet {
  color: rgba(255, 255, 255, 0.68);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.35;
}

.stage {
  position: relative;
  height: calc(100% - var(--header-h));
  overflow: hidden;
  cursor: grab;
  touch-action: none;
  user-select: none;
  background:
    radial-gradient(ellipse 80% 60% at 50% 42%, rgba(120, 176, 230, 0.18), transparent 60%),
    linear-gradient(180deg, var(--stage-top) 0%, var(--stage-mid) 48%, var(--stage-bottom) 100%);
}

.stage.dragging { cursor: grabbing; }

.ornament {
  position: absolute;
  left: 50%;
  top: 46%;
  width: min(92vmin, 820px);
  height: min(92vmin, 820px);
  transform: translate(-50%, -50%);
  pointer-events: none;
  opacity: 0.32;
}

.stage-title,
.hint {
  position: absolute;
  left: 0;
  right: 0;
  text-align: center;
  pointer-events: none;
  z-index: 2;
  margin: 0;
}

.stage-title {
  top: 16px;
  font-weight: 300;
  font-size: 40px;
  letter-spacing: 0.01em;
  text-shadow: 0 2px 18px rgba(0, 20, 40, 0.28);
}

/* The name of the history being shown, after the title: "Timeline of Physics:  History of Spin". */
.stage-history { font-weight: 500; white-space: pre; }
.stage-history[hidden] { display: none; }

.hint {
  top: 62px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 16px;
  font-weight: 400;
}

.track {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  will-change: transform;
}

.notes {
  position: fixed;
  top: 0;
  left: 0;
  height: 100%;
  z-index: 12;
  pointer-events: none;
  will-change: transform;
}

.band {
  position: absolute;
  top: 108px;
  bottom: 108px;
  pointer-events: none;
}

.band.alt { background: rgba(255, 255, 255, 0.025); }

.guide {
  position: absolute;
  top: 108px;
  bottom: 108px;
  width: 1px;
  background: rgba(255, 255, 255, 0.08);
  pointer-events: none;
}

.era {
  position: absolute;
  bottom: 94px;
  text-align: center;
  color: rgba(255, 255, 255, 0.55);
  font-weight: 400;
  font-size: 24px;
  line-height: 1;
  pointer-events: none;
  white-space: nowrap;
}

.person {
  position: absolute;
  display: flex;
  align-items: stretch;
  height: var(--ribbon-h, 42px);
  width: max-content;
  padding: 0;
  border: 0;
  background: transparent;
  transform: translate(calc(-100% - 12px), -50%);
  cursor: pointer;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.28));
  transition: opacity 0.2s ease;
}

.person .pin {
  position: absolute;
  left: calc(100% + 12px);
  top: 50%;
  width: 12px;
  height: 12px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: var(--topic);
  box-shadow: 0 0 0 2px rgba(8, 30, 60, 0.45);
  pointer-events: auto;
}

.person .pin::before {
  content: "";
  position: absolute;
  inset: -6px;
}

.person .thumb {
  width: 38px;
  flex: none;
  border-radius: 3px 0 0 3px;
  background-color: #c8b59a;
  background-size: var(--zoom, cover);
  background-position: var(--focus, center 15%);
  background-repeat: no-repeat;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.18);
}

.person .name {
  display: flex;
  align-items: center;
  background: var(--bar);
  color: white;
  font-weight: 600;
  font-size: var(--ribbon-font, 18px);
  line-height: 1;
  padding: 0 12px 0 10px;
  white-space: nowrap;
  box-shadow: inset 4px 0 0 var(--topic);
}

.person .arrow {
  width: 0;
  height: 0;
  flex: none;
  align-self: stretch;
  border-top: calc(var(--ribbon-h, 42px) / 2) solid transparent;
  border-bottom: calc(var(--ribbon-h, 42px) / 2) solid transparent;
  border-left: 13px solid var(--bar);
}

.person:hover,
.person:focus-visible { z-index: 5; }

.person:hover .name { background: var(--bar-hover, #9d1452); }
.person:hover .arrow { border-left-color: var(--bar-hover, #9d1452); }

/* Big-science experiments (data.js: kind "experiment") wear an orange ribbon instead of red. */
.person.experiment { --bar: #d9640b; --bar-hover: #f07a1a; }

.person:focus-visible {
  outline: 2px solid white;
  outline-offset: 3px;
}

.person.open { z-index: 4; }
.person.open .thumb { box-shadow: 0 0 0 2px #fff, inset 0 0 0 1px rgba(0, 0, 0, 0.18); }

.person.dim { opacity: 0.34; }
.stage.history .person.dim { opacity: 0.18; }
.person.lit { z-index: 3; opacity: 1; }
.person.lit .thumb { box-shadow: 0 0 0 3px var(--topic); }
.person.lit .name { box-shadow: inset 0 0 0 2px var(--topic), inset 4px 0 0 var(--topic); }
.person.lit .pin { box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.85); }
.person .pin.dim,
.person.lit .pin.dim {
  opacity: 0.35;
  box-shadow: 0 0 0 2px rgba(8, 30, 60, 0.45);
}
.stage.history .person .pin.dim,
.stage.history .person.lit .pin.dim { opacity: 0.18; }
.person .pin.tech {
  width: 9px;
  height: 9px;
  border-radius: 1.5px;
  transform: translate(-50%, -50%) rotate(45deg);
}
.person.open .pin { box-shadow: 0 0 0 3px white; }

.link {
  position: absolute;
  height: 3px;
  margin-top: -1.5px;
  border-radius: 2px;
  background: var(--topic);
  pointer-events: none;
}

.link.dim { opacity: 0.35; }
.stage.history .link.dim { opacity: 0.18; }

.yearpin {
  position: absolute;
  width: 12px;
  height: 12px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--topic);
  box-shadow: 0 0 0 2px rgba(8, 30, 60, 0.45);
  transform: translate(-50%, -50%);
  cursor: pointer;
  z-index: 8;
}

.yearpin::before {
  content: "";
  position: absolute;
  inset: -6px;
}

.yearpin:hover,
.yearpin:focus-visible { transform: translate(-50%, -50%) scale(1.35); z-index: 7; }
.yearpin:focus-visible { outline: 2px solid white; outline-offset: 2px; }
.yearpin.dim { opacity: 0.35; }
.stage.history .yearpin.dim { opacity: 0.18; }
.yearpin.lit { box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.85); }
.yearpin.open { box-shadow: 0 0 0 3px white; }
.yearpin.tech {
  width: 9px;
  height: 9px;
  border-radius: 1.5px;
  transform: translate(-50%, -50%) rotate(45deg);
}
.yearpin.tech:hover,
.yearpin.tech:focus-visible { transform: translate(-50%, -50%) rotate(45deg) scale(1.35); }

.axis {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 78px;
  pointer-events: none;
}

.axis-line {
  position: absolute;
  left: 0;
  right: 0;
  top: 28px;
  height: 2px;
  background: rgba(255, 255, 255, 0.55);
}

.tick {
  position: absolute;
  /* Year labels sit in the band where the epoch names used to be, each tick mark just above its label. */
  top: -49px;
  width: 1px;
  height: 8px;
  background: rgba(255, 255, 255, 0.7);
}

.tick span {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 15px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.82);
  white-space: nowrap;
}

.dot {
  position: absolute;
  /* --drop: extra entries that share a year sit lower on the axis, one step each. */
  top: calc(23px + var(--drop, 0px));
  width: 12px;
  height: 12px;
  margin-left: -6px;
  border: 0;
  border-radius: 50%;
  background: var(--topic);
  box-shadow: 0 0 0 2px rgba(8, 30, 60, 0.35);
  pointer-events: auto;
  cursor: pointer;
  padding: 0;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.dot:hover,
.dot:focus-visible { transform: scale(1.35); z-index: 2; }
.dot:focus-visible { outline: 2px solid white; outline-offset: 2px; }
.dot.dim { opacity: 0.35; transform: scale(0.75); }
.stage.history .dot.dim { opacity: 0.18; }
.dot.lit { transform: scale(1.35); box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.35); }
.dot.open { box-shadow: 0 0 0 3px white; }
.dot.tech {
  width: 9px;
  height: 9px;
  margin-left: -4.5px;
  top: calc(24.5px + var(--drop, 0px));
  border-radius: 1.5px;
  transform: rotate(45deg);
}
.dot.tech.dim { transform: rotate(45deg) scale(0.75); }
.dot.tech.lit { transform: rotate(45deg) scale(1.35); }
.dot.tech:hover,
.dot.tech:focus-visible { transform: rotate(45deg) scale(1.35); }

.invention {
  position: absolute;
  top: 0;
  width: 9px;
  height: 9px;
  margin-left: -4.5px;
  border: 0;
  padding: 0;
  border-radius: 1.5px;
  background: #fff;
  box-shadow: 0 0 0 2px rgba(8, 30, 60, 0.5);
  transform: rotate(45deg);
  pointer-events: auto;
  cursor: pointer;
  z-index: 3;
  transition: transform 0.2s ease;
}

.invention::before {
  content: "";
  position: absolute;
  inset: -8px -8px -3px -8px;
}

.invention:hover,
.invention:focus-visible {
  transform: rotate(45deg) scale(1.45);
  z-index: 4;
}

/* World events: squares in the row of inventions, in a warm tint so they read as a different kind of marker. */
.invention.event {
  border-radius: 1px;
  background: #f4c27a;
  transform: none;
}

.invention.event.low { top: 13px; }

.invention.event:hover,
.invention.event:focus-visible { transform: scale(1.45); }

.invention:focus-visible {
  outline: 2px solid white;
  outline-offset: 3px;
}

.datetip {
  position: absolute;
  z-index: 30;
  max-width: 260px;
  padding: 8px 11px;
  border-radius: 8px;
  background: #fff;
  color: #221e1a;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  text-align: center;
  pointer-events: none;
  transform: translate(-50%, calc(-100% - 28px));
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.32);
}

.datetip::after {
  content: "";
  position: absolute;
  left: calc(50% + var(--tip-shift, 0px));
  top: 100%;
  transform: translateX(-50%);
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-top: var(--arrow, 28px) solid #fff;
}

.datetip[hidden] { display: none; }

.datetip.story-note { z-index: 28; }

.datetip.below {
  transform: translate(-50%, 28px);
}

.datetip.below::after {
  top: auto;
  bottom: 100%;
  border-top: 0;
  border-bottom: var(--arrow, 28px) solid #fff;
}

.datetip.side-right {
  transform: translate(18px, calc(-50% + var(--side-nudge, 0px)));
}

.datetip.side-left {
  transform: translate(calc(-100% - 18px), calc(-50% + var(--side-nudge, 0px)));
}

.datetip.side-right::after,
.datetip.side-left::after {
  top: calc(50% - var(--side-nudge, 0px));
  transform: translateY(-50%);
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
}

.datetip.side-right::after {
  left: auto;
  right: 100%;
  border-left: 0;
  border-right: var(--arrow, 18px) solid #fff;
}

.datetip.side-left::after {
  left: 100%;
  border-right: 0;
  border-left: var(--arrow, 18px) solid #fff;
}

.datetip.diagonal {
  transform: none;
}

/* A note in a tiered row: a fixed width so the row is even, placed by its left and top edges. */
.datetip.tiered {
  width: 260px;
  transform: none;
}

.datetip.diagonal::after {
  content: none;
}

.leaders {
  position: absolute;
  inset: 0;
  overflow: visible;
  pointer-events: none;
}

.leaders polygon {
  fill: #fff;
  stroke: none;
}

.datetip.story-note:not(.side-left):not(.side-right)::after { content: none; }

/* START and STOP signs at the two ends of a history. */
.route-sign {
  position: absolute;
  z-index: 28;
  overflow: visible;
  pointer-events: none;
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.38));
}

.route-sign polygon {
  stroke: #fff;
  stroke-width: 3;
  stroke-linejoin: round;
}

.route-sign.start polygon {
  fill: #1f9d55;
  stroke: #d9f5e3;
  stroke-width: 1.5;
}
.route-sign.stop polygon { fill: #d62d2d; }

.route-sign text {
  fill: #fff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.05em;
}

.leaders line,
.leaders polyline {
  stroke: #fff;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.35));
}

.overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgba(6, 16, 32, 0.62);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.overlay[hidden] { display: none; }

.bio {
  position: relative;
  width: min(760px, 100%);
  max-height: min(86vh, 780px);
  overflow: auto;
  background: var(--paper);
  color: #221e1a;
  border-radius: 12px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
  display: grid;
  grid-template-columns: 210px 1fr;
  gap: 6px 26px;
  padding: 28px 28px 26px;
  user-select: text;
  cursor: auto;
}

.bio h2 {
  margin: 0 0 4px;
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #1a1a1a;
}

.bio h3 {
  margin: 16px 0 6px;
  font-size: 15px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #850942;
}

.meta, .marker { margin: 0; }

.meta {
  color: #444;
  font-size: 16px;
}

.marker {
  margin-top: 4px;
  color: var(--muted);
  font-size: 14px;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.tag {
  border: 1px solid color-mix(in srgb, var(--topic) 55%, #bbb);
  background: color-mix(in srgb, var(--topic) 16%, white);
  color: #241c18;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.tag:hover,
.tag:focus-visible { filter: brightness(0.97); outline: 2px solid var(--topic); }

.prose p {
  margin: 12px 0 0;
  font-size: 16.5px;
  line-height: 1.5;
  color: #2a2622;
}

.unit-entry[hidden] { display: none; }

.unit-entry p {
  margin: 0;
  font-size: 16.5px;
  line-height: 1.5;
  color: #2a2622;
}

.unit-entry p.unit-named {
  margin-top: 8px;
}

.unit-named strong {
  color: #7a1f3d;
}

.bio ul {
  margin: 0;
  padding-left: 18px;
}

.bio li {
  margin: 6px 0;
  line-height: 1.4;
}

.bio figure { margin: 0; }

.nobel {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.nobel[hidden] { display: none; }

.nobel p {
  margin: 0;
  font-size: 13px;
  line-height: 1.4;
  color: #3a342e;
}

.nobel strong {
  display: block;
  margin-bottom: 2px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #850942;
}

.bio img {
  width: 100%;
  height: 260px;
  object-fit: cover;
  object-position: var(--focus, center 15%);
  border-radius: 4px;
  background: #ddd;
  display: block;
}

.bio figcaption {
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.35;
  color: #6d675f;
}

.close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #333;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.close:hover,
.close:focus-visible { background: rgba(0, 0, 0, 0.06); }

.help-overlay { z-index: 22; }

.help {
  position: relative;
  width: min(560px, 100%);
  max-height: min(86vh, 780px);
  overflow: auto;
  background: var(--paper);
  color: #221e1a;
  border-radius: 12px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
  padding: 28px 32px 26px;
  user-select: text;
  cursor: auto;
}

.help h2 {
  margin: 0 28px 12px 0;
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #1a1a1a;
}

.help h3 {
  margin: 18px 0 6px;
  font-size: 15px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #850942;
}

.help p {
  margin: 0 0 10px;
  font-size: 16.5px;
  line-height: 1.5;
}

.help kbd {
  display: inline-block;
  min-width: 1.4em;
  padding: 1px 6px;
  border: 1px solid #c8c2ba;
  border-bottom-width: 2px;
  border-radius: 5px;
  background: #f4f1ea;
  color: #2a2622;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.4;
  text-align: center;
}

@media (max-width: 800px) {
  body {
    display: flex;
    flex-direction: column;
  }
  .stage-title { font-size: 28px; top: 12px; }
  .hint { top: 48px; font-size: 14px; padding: 0 16px; }
  .topbar {
    flex: none;
    height: auto;
    min-height: var(--header-h);
    flex-wrap: wrap;
    padding: 8px 12px 10px;
    gap: 8px;
  }
  .brand span { display: none; }
  .topbar-tools {
    flex: 1 1 100%;
    width: 100%;
    gap: 6px;
    order: 2;
    margin-left: 0;
  }
  .search {
    flex: 1 1 100%;
    width: 100%;
    order: 3;
  }
  .search-input { width: 100%; }
  .search-list {
    position: fixed;
    left: 10px;
    right: 10px;
    width: auto;
  }
  .search-list button { padding: 12px; min-height: 44px; }
  .picker { flex: 1; min-width: 0; }
  .picker-btn,
  .level-picker .picker-btn,
  .view-picker .picker-btn {
    width: 100%;
    min-width: 0;
    padding: 8px;
    gap: 6px;
  }
  .picker-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
  }
  .picker-list,
  .level-picker .picker-list,
  .view-picker .picker-list {
    position: fixed;
    left: 10px;
    right: 10px;
    width: auto;
    z-index: 30;
  }
  .picker-list button {
    padding: 12px;
    min-height: 44px;
  }
  .count { display: none; }
  .stage {
    flex: 1;
    min-height: 0;
    height: auto;
  }
  .bio {
    grid-template-columns: 1fr;
    padding: 22px 18px 18px;
  }
  .bio img { height: 220px; width: min(100%, 280px); }
  .bio h2 { font-size: 26px; padding-right: 28px; }
  .info-btn { width: 36px; height: 36px; }
  .help { padding: 22px 18px 18px; }
  .help h2 { font-size: 24px; }
}

@media (max-height: 700px) {
  .stage-title { font-size: 28px; }
  .hint { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .person, .dot, .yearpin, .invention, .link { transition: none; }
}
