/* Holy History — dark theme, mobile-first */

html, body { margin: 0; padding: 0; background: #0B0F16; overflow: hidden; }
* { box-sizing: border-box; }
button { -webkit-tap-highlight-color: transparent; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #27303F; border-radius: 4px; }

.app {
  position: fixed; inset: 0;
  background: radial-gradient(1400px 700px at 50% -12%, #141C2A 0%, #0B0F16 62%);
  color: #E8E3D5;
  font-family: 'Albert Sans', system-ui, sans-serif;
  display: flex; flex-direction: column; overflow: hidden;
  padding-bottom: env(safe-area-inset-bottom);
}

/* ---------------- Header ---------------- */
.hdr {
  flex: none; display: flex; flex-direction: column; gap: 6px;
  padding: 10px 14px 8px;
  border-bottom: 1px solid rgba(217,164,65,0.18);
}
.hdr-row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.brand-title {
  font-family: 'Cormorant Garamond', serif; font-size: 21px; font-weight: 600;
  letter-spacing: 0.05em; color: #F0E6CC; line-height: 1; white-space: nowrap;
}
.brand-sub {
  font-size: 8px; letter-spacing: 0.22em; text-transform: uppercase; color: #7E8797; white-space: nowrap;
}
.spacer { flex: 1; }
.range {
  display: none;
  font-family: 'Spline Sans Mono', monospace; font-size: 11px; color: #8B93A3;
  letter-spacing: .05em; white-space: nowrap;
}
.divider { width: 1px; height: 22px; background: rgba(255,255,255,0.1); flex: none; }

.icon-btn {
  flex: none; width: 32px; height: 32px; border-radius: 9px;
  border: 1px solid rgba(255,255,255,0.15); background: rgba(255,255,255,0.04);
  color: #C9D0DB; cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.icon-btn:hover { background: rgba(255,255,255,0.1); }
.lang-select {
  flex: none; height: 32px; border-radius: 9px; padding: 0 8px;
  border: 1px solid rgba(255,255,255,0.15); background: rgba(255,255,255,0.04);
  color: #C9D0DB; cursor: pointer; font: inherit; font-size: 12px;
}
.lang-select:hover { background: rgba(255,255,255,0.1); }
.lang-select option { background: #141A24; color: #C9D0DB; }
.icon-btn.copied { color: #7DBE8A; border-color: rgba(125,190,138,0.5); background: rgba(125,190,138,0.12); }
/* "on this day" match indicator */
#open-today { position: relative; }
.today-dot {
  position: absolute; top: -3px; right: -3px; width: 8px; height: 8px; border-radius: 50%;
  background: #E4C06A; border: 2px solid #0B0F16; box-shadow: 0 0 6px #E4C06A99;
}
.today-dot[hidden] { display: none; }
.ov-row-when { font-family: 'Spline Sans Mono', monospace; font-size: 11px; color: #D9A441; white-space: nowrap; margin-left: auto; padding-left: 10px; }
.icon-btn.active { color: #E4C06A; border-color: rgba(217,164,65,0.5); background: rgba(217,164,65,0.14); }

.hdr-tools { overflow-x: auto; scrollbar-width: none; }
.hdr-tools::-webkit-scrollbar { display: none; }

.pills { display: flex; gap: 6px; flex: none; }
.pill {
  padding: 5px 11px; border-radius: 999px; flex: none;
  border: 1px solid rgba(255,255,255,0.12); background: transparent; color: #6E7889;
  font-size: 11px; font-weight: 600; cursor: pointer;
  font-family: 'Albert Sans', sans-serif; transition: background .12s, color .12s, border-color .12s;
}
.pill.on { border-color: rgba(217,164,65,0.4); background: rgba(217,164,65,0.12); color: #E4C06A; }

.zoom { display: flex; gap: 6px; align-items: center; flex: none; }
.zbtn {
  width: 30px; height: 28px; border-radius: 8px; flex: none;
  border: 1px solid rgba(255,255,255,0.15); background: rgba(255,255,255,0.04);
  color: #C9D0DB; font-size: 15px; cursor: pointer; line-height: 1;
}
.zbtn:hover { background: rgba(255,255,255,0.1); }
.fitbtn {
  height: 28px; padding: 0 12px; border-radius: 8px; flex: none;
  border: 1px solid rgba(217,164,65,0.35); background: rgba(217,164,65,0.08);
  color: #D9A441; font-size: 11px; font-weight: 600; cursor: pointer;
  font-family: 'Albert Sans', sans-serif;
}
.fitbtn:hover { background: rgba(217,164,65,0.16); }

/* ---------------- Filter chips ---------------- */
.filters {
  flex: none; display: flex; align-items: center; gap: 7px;
  padding: 7px 14px; border-bottom: 1px solid rgba(255,255,255,0.06);
  overflow-x: auto; scrollbar-width: none;
}
.filters::-webkit-scrollbar { display: none; }
.filter-label {
  display: none;
  font-size: 9px; letter-spacing: .2em; color: #5C6573; text-transform: uppercase;
  font-weight: 600; margin-right: 4px;
}
.chips { display: flex; align-items: center; gap: 7px; }
.chip {
  display: flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px;
  border: 1px solid transparent; font-size: 10.5px; font-weight: 600; cursor: pointer;
  font-family: 'Albert Sans', sans-serif; letter-spacing: .02em; flex: none; white-space: nowrap;
}
.chip-dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }

/* "Show all" reset + magnitude (detail-level) segmented control */
.chip-reset {
  padding: 4px 10px; border-radius: 999px; flex: none; white-space: nowrap;
  border: 1px solid rgba(217,164,65,0.35); background: rgba(217,164,65,0.1);
  color: #D9A441; font-size: 10.5px; font-weight: 600; cursor: pointer;
  font-family: 'Albert Sans', sans-serif; letter-spacing: .02em;
}
.chip-reset[hidden] { display: none; }
.chip-reset:hover { background: rgba(217,164,65,0.18); }
.divider-filters { display: none; }
.seg {
  display: inline-flex; flex: none; border-radius: 999px; overflow: hidden;
  border: 1px solid rgba(255,255,255,0.12);
}
.seg-btn {
  padding: 4px 11px; border: none; background: transparent; color: #6E7889;
  font-size: 10.5px; font-weight: 600; cursor: pointer; white-space: nowrap;
  font-family: 'Albert Sans', sans-serif; letter-spacing: .02em;
  border-left: 1px solid rgba(255,255,255,0.1);
}
.seg-btn:first-child { border-left: none; }
.seg-btn:hover { color: #C9D0DB; }
.seg-btn.on { background: rgba(217,164,65,0.16); color: #E4C06A; }

/* ---------------- Viewport ---------------- */
.vp {
  flex: 1; position: relative; overflow: hidden; cursor: grab;
  touch-action: none; min-height: 0;
}
.vp.grabbing { cursor: grabbing; }
.layer { position: absolute; inset: 0; pointer-events: none; }
.layer .event { pointer-events: auto; }

/* era backgrounds — subtle full-height bands tinting each era behind the timeline */
.era-bg-layer { position: absolute; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.era-bg {
  position: absolute; top: 0; bottom: 0;
  border-left: 1px solid rgba(255,255,255,0.04);
}

.tick-line {
  position: absolute; top: 0; bottom: 0; width: 1px;
  background: rgba(255,255,255,0.045); pointer-events: none;
}
.tick-label {
  position: absolute; top: 6px; transform: translateX(-50%);
  font-family: 'Spline Sans Mono', monospace; font-size: 10px; color: #6E7889;
  pointer-events: none; letter-spacing: .06em; white-space: nowrap;
}

/* era band */
.era-band { position: absolute; top: 24px; left: 0; right: 0; height: 20px; pointer-events: none; }
.era {
  position: absolute; top: 0; height: 20px; border-radius: 4px;
  border: 1px solid transparent; overflow: hidden; pointer-events: auto; cursor: pointer;
}
.era:hover { filter: brightness(1.5); }
.era-label {
  position: absolute; left: 8px; top: 3.5px; font-size: 9px; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase; white-space: nowrap; opacity: 0.9;
}

.gold-hairline {
  position: absolute; top: 50px; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(217,164,65,0.45), transparent);
  pointer-events: none;
}
.hint {
  position: absolute; top: 56px; right: 12px; font-size: 9px; letter-spacing: .12em;
  color: #4D5663; text-transform: uppercase; pointer-events: none;
}
.hint-desktop { display: none; }
.loading {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: #7E8797; font-size: 12px; letter-spacing: .22em; text-transform: uppercase;
}

/* minimap / overview navigator */
.minimap {
  flex: none; position: relative; height: 30px; cursor: pointer;
  background: rgba(6,9,13,0.95); border-top: 1px solid rgba(217,164,65,0.18);
  touch-action: none; overflow: hidden;
}
.mm-eras { position: absolute; inset: 4px 0; }
.mm-era { position: absolute; top: 0; bottom: 0; border-radius: 2px; }
.mm-mark { position: absolute; top: 0; bottom: 0; width: 1px; background: rgba(217,164,65,0.4); }
.mm-window {
  position: absolute; top: 2px; bottom: 2px; min-width: 6px;
  border: 1px solid rgba(217,164,65,0.85); border-radius: 4px;
  background: rgba(217,164,65,0.14); box-shadow: 0 0 0 100vmax rgba(6,9,13,0.45);
  cursor: grab; pointer-events: none;
}
.minimap.grabbing .mm-window { cursor: grabbing; }

/* guided-tour control bar (floats over the timeline) */
.tour-bar {
  position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%);
  z-index: 9; display: flex; align-items: center; gap: 10px;
  max-width: calc(100% - 24px);
  padding: 7px 9px 7px 14px; border-radius: 999px;
  background: rgba(16,22,31,0.94); border: 1px solid rgba(217,164,65,0.4);
  box-shadow: 0 12px 34px rgba(0,0,0,0.6); backdrop-filter: blur(6px);
}
.tour-bar[hidden] { display: none; }
.tour-meta { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.tour-name {
  font-family: 'Cormorant Garamond', serif; font-size: 15px; font-weight: 600;
  color: #F0E6CC; line-height: 1.05; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tour-step {
  font-family: 'Spline Sans Mono', monospace; font-size: 9.5px; color: #8B93A3;
  letter-spacing: .06em; white-space: nowrap;
}
.tour-btns { display: flex; align-items: center; gap: 4px; flex: none; }
.tour-btn {
  width: 30px; height: 30px; border-radius: 50%; flex: none; padding: 0;
  border: 1px solid rgba(255,255,255,0.14); background: rgba(255,255,255,0.04);
  color: #D8DDE6; cursor: pointer; display: flex; align-items: center; justify-content: center;
  font-size: 13px; line-height: 1;
}
.tour-btn:hover { background: rgba(255,255,255,0.1); }
.tour-btn:disabled { opacity: 0.35; cursor: default; }
.tour-btn.tour-play { border-color: rgba(217,164,65,0.5); background: rgba(217,164,65,0.14); color: #E4C06A; }
.tour-btn.tour-exit { color: #9AA3B3; }

/* guided-tour menu rows */
.tours-intro { color: #9AA3B3 !important; font-size: 12.5px !important; margin-top: 0; }
.tours-list { display: flex; flex-direction: column; gap: 9px; }
.tour-row {
  display: block; width: 100%; text-align: left; cursor: pointer;
  background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.09);
  border-radius: 11px; padding: 13px 15px; font-family: 'Albert Sans', sans-serif;
}
.tour-row:hover { border-color: rgba(217,164,65,0.4); background: rgba(217,164,65,0.07); }
.tour-row-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.tour-row-name { font-family: 'Cormorant Garamond', serif; font-size: 18px; font-weight: 600; color: #F0E6CC; }
.tour-row-count { font-family: 'Spline Sans Mono', monospace; font-size: 10px; color: #8B93A3; white-space: nowrap; }
.tour-row-blurb { font-size: 12px; line-height: 1.5; color: #9AA3B3; margin-top: 4px; }

/* events */
.event {
  position: absolute; transform: translateX(-6px);
  display: flex; align-items: center; gap: 8px; cursor: pointer; z-index: 2;
}
.event:hover { filter: brightness(1.3); }
.event-dot { flex: none; border-radius: 50%; position: relative; z-index: 2; }
/* dashed "fuzzy" ring marks a traditional or disputed date */
.event-dot.unc::after {
  content: ""; position: absolute; inset: -3px; border-radius: 50%;
  border: 1.4px dashed currentColor; opacity: 0.6; box-sizing: border-box;
}
/* span bar for events that run over a range of years (y2) */
.event-range {
  position: absolute; top: 50%; transform: translateY(-50%);
  height: 3px; border-radius: 2px; opacity: 0.5; z-index: 1; pointer-events: none;
}
.event-range::after {
  content: ""; position: absolute; right: 0; top: -2px; width: 2px; height: 7px;
  border-radius: 1px; background: inherit; opacity: 0.9;
}
.event-label { white-space: nowrap; letter-spacing: .01em; }

/* pinned events (compare mode) */
.event.pinned { z-index: 4; }
.event.pinned .event-dot {
  box-shadow: 0 0 0 3px #0B0F16, 0 0 0 5px #E4C06A, 0 0 12px #E4C06A99 !important;
}
.pin-badge {
  position: absolute; top: -9px; left: -10px;
  width: 15px; height: 15px; border-radius: 50%;
  background: #E4C06A; color: #10161F; font-size: 9px; font-weight: 800;
  display: flex; align-items: center; justify-content: center; line-height: 1;
  font-family: 'Albert Sans', sans-serif; box-shadow: 0 1px 4px rgba(0,0,0,0.5);
}

/* compare bar (floats over the timeline) */
.compare-bar {
  position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%);
  z-index: 9; display: flex; align-items: center; gap: 12px;
  max-width: calc(100% - 24px);
  padding: 8px 10px 8px 15px; border-radius: 14px;
  background: rgba(16,22,31,0.94); border: 1px solid rgba(217,164,65,0.4);
  box-shadow: 0 12px 34px rgba(0,0,0,0.6); backdrop-filter: blur(6px);
}
.compare-bar[hidden] { display: none; }
.cmp-end { display: flex; flex-direction: column; gap: 1px; min-width: 0; max-width: 168px; }
.cmp-end-name {
  font-family: 'Cormorant Garamond', serif; font-size: 14px; font-weight: 600; color: #F0E6CC;
  line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cmp-end-date { font-family: 'Spline Sans Mono', monospace; font-size: 9.5px; color: #8B93A3; letter-spacing: .04em; white-space: nowrap; }
.cmp-end.cmp-empty .cmp-end-name { color: #6E7889; font-style: italic; font-family: 'Albert Sans', sans-serif; font-size: 12px; font-weight: 500; }
.cmp-gap {
  display: flex; flex-direction: column; align-items: center; gap: 1px; flex: none;
  padding: 0 4px;
}
.cmp-gap-num { font-family: 'Cormorant Garamond', serif; font-size: 18px; font-weight: 700; color: #E4C06A; line-height: 1; }
.cmp-gap-unit { font-size: 8.5px; letter-spacing: .16em; text-transform: uppercase; color: #7E8797; }
.cmp-prompt { font-size: 12px; color: #9AA3B3; white-space: nowrap; }
.cmp-btns { display: flex; align-items: center; gap: 4px; flex: none; margin-left: 2px; }
.cmp-btn {
  height: 28px; padding: 0 11px; border-radius: 999px; flex: none;
  border: 1px solid rgba(255,255,255,0.14); background: rgba(255,255,255,0.04);
  color: #C9D0DB; cursor: pointer; font-size: 11px; font-weight: 600;
  font-family: 'Albert Sans', sans-serif;
}
.cmp-btn:hover { background: rgba(255,255,255,0.1); }
.cmp-btn.cmp-exit { width: 28px; padding: 0; color: #9AA3B3; }

/* detail card — floating (desktop)
   position:fixed (not absolute) so the card isn't clipped by the timeline
   viewport's `overflow:hidden` — otherwise a tall card gets cut off where the
   lanes below begin. Coordinates are translated to screen space in app.js. */
.card {
  position: fixed; width: 340px; max-width: calc(100vw - 24px);
  background: #10161F;
  border: 1px solid rgba(217,164,65,0.35); border-radius: 10px;
  box-shadow: 0 18px 50px rgba(0,0,0,0.65); padding: 15px 18px; z-index: 50; cursor: default;
}
/* detail card — bottom sheet (mobile) */
.card.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; width: auto; max-width: none;
  border-radius: 16px 16px 0 0; border-bottom: none;
  max-height: 46vh; overflow-y: auto;
  padding: 14px 18px calc(16px + env(safe-area-inset-bottom));
  box-shadow: 0 -14px 50px rgba(0,0,0,0.7);
  z-index: 40;
}
.card-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.card-kicker { font-size: 9.5px; letter-spacing: .2em; text-transform: uppercase; font-weight: 700; }
.card-close { background: none; border: none; color: #6E7889; font-size: 15px; cursor: pointer; padding: 4px 0 4px 14px; line-height: 1; }
.card-title { font-family: 'Cormorant Garamond', serif; font-size: 22px; font-weight: 600; color: #F0E6CC; line-height: 1.15; margin-bottom: 4px; }
.card-date { font-family: 'Spline Sans Mono', monospace; font-size: 11px; color: #D9A441; margin-bottom: 9px; }
.card-desc { font-size: 12.5px; line-height: 1.55; color: #B8BFCB; text-wrap: pretty; }
.card-ref { margin-top: 10px; padding-top: 9px; border-top: 1px solid rgba(255,255,255,0.08); font-family: 'Cormorant Garamond', serif; font-style: italic; font-size: 15px; color: #D9A441; }
.card-xrefs { margin-top: 11px; padding-top: 10px; border-top: 1px solid rgba(255,255,255,0.08); }
.card-xrefs-label { font-size: 9px; letter-spacing: .18em; text-transform: uppercase; color: #5C6573; font-weight: 700; margin-bottom: 7px; }
.xref-list { display: flex; flex-wrap: wrap; gap: 6px; }
.xref {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px;
  border-radius: 999px; border: 1px solid transparent; background: transparent;
  font-family: 'Albert Sans', sans-serif; font-size: 11px; font-weight: 600; color: #D8DDE6;
  cursor: pointer;
}
button.xref:hover { filter: brightness(1.25); background: rgba(255,255,255,0.05); }
.xref-static { cursor: default; opacity: 0.85; }
.xref-dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.card-note { margin-top: 8px; font-size: 10.5px; line-height: 1.5; color: #707A8A; }
/* connector arcs between cross-referenced events */
.xlinks { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 5; overflow: visible; }

/* curated related-events section in the detail card */
.card-related { margin-top: 11px; padding-top: 10px; border-top: 1px solid rgba(255,255,255,0.08); }
.card-related-label { font-size: 9px; letter-spacing: .18em; text-transform: uppercase; color: #5C6573; font-weight: 700; margin-bottom: 7px; }
.rel-list { display: flex; flex-direction: column; gap: 6px; }
.xlink {
  display: flex; align-items: baseline; gap: 8px; width: 100%; text-align: left;
  padding: 6px 9px; border-radius: 8px; border: 1px solid transparent;
  background: rgba(255,255,255,0.03); cursor: pointer;
  font-family: 'Albert Sans', sans-serif; color: #D8DDE6;
}
.xlink:hover { background: rgba(255,255,255,0.07); filter: brightness(1.1); }
.xlink-rel { flex: none; font-size: 9px; letter-spacing: .08em; text-transform: uppercase; color: #8B93A3; font-weight: 700; }
.xlink-title { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; }
.xlink-date { flex: none; font-family: 'Spline Sans Mono', monospace; font-size: 9.5px; color: #707A8A; }

/* citations / sources */
.card-sources { margin-top: 11px; padding-top: 10px; border-top: 1px solid rgba(255,255,255,0.08); }
.card-sources-label { font-size: 9px; letter-spacing: .18em; text-transform: uppercase; color: #5C6573; font-weight: 700; margin-bottom: 6px; }
.src-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.src-list li { font-size: 11.5px; line-height: 1.45; }
.src-link {
  display: inline-flex; align-items: center; gap: 4px;
  color: #9FC6E6; text-decoration: none; border-bottom: 1px solid rgba(159,198,230,0.3);
}
.src-link:hover { color: #C7E0F5; border-bottom-color: rgba(159,198,230,0.7); }
.src-ext { flex: none; opacity: 0.7; margin-bottom: 1px; }
.src-text { color: #9098A6; }

/* ---------------- Lanes ---------------- */
.lane { flex: none; }
.lane-books { border-top: 1px solid rgba(217,164,65,0.2); background: rgba(10,14,20,0.88); }
.lane-lives { border-top: 1px solid rgba(217,164,65,0.15); background: rgba(10,13,19,0.89); }
.lane-kings { border-top: 1px solid rgba(217,164,65,0.12); background: rgba(9,13,19,0.9); }
.lane-councils { border-top: 1px solid rgba(217,164,65,0.1); background: rgba(9,12,18,0.9); }
.lane-emp { border-top: 1px solid rgba(255,255,255,0.07); background: rgba(8,11,16,0.92); padding-bottom: 8px; }

.lane-head { display: flex; align-items: center; gap: 13px; padding: 7px 14px 4px; overflow-x: auto; scrollbar-width: none; }
.lane-head::-webkit-scrollbar { display: none; }
.lane-title { font-size: 9.5px; letter-spacing: .24em; text-transform: uppercase; font-weight: 700; white-space: nowrap; }
.lane-title.gold { color: #D9A441; }
.lane-title.muted { color: #7E8797; }

.legend { display: flex; align-items: center; gap: 13px; }
.legend-item { display: flex; align-items: center; gap: 5px; font-size: 9.5px; color: #7E8797; letter-spacing: .03em; white-space: nowrap; }
.legend-swatch { width: 8px; height: 8px; border-radius: 2px; flex: none; }

.lane-scroll { position: relative; max-height: 100px; overflow-y: auto; overflow-x: hidden; margin: 2px 0 7px; }
.lane-scroll-lives { max-height: 84px; }
.lane-scroll-kings { max-height: 82px; }
.lane-scroll-councils { max-height: 82px; }
.lane-inner { position: relative; }

.bar {
  position: absolute; height: 15px; border-radius: 8px; overflow: hidden;
  border: 1px solid transparent;
}
.bar.clickable { cursor: pointer; }
.bar.clickable:hover { filter: brightness(1.6); }
.bar.neutral { background: rgba(151,160,176,0.12); border-color: rgba(151,160,176,0.32); }
.bar-label {
  position: absolute; top: 1px; font-size: 9.5px; font-weight: 600;
  white-space: nowrap; letter-spacing: .03em;
}
.bar.neutral .bar-label { font-weight: 400; color: #9AA3B3; letter-spacing: .04em; }

/* ---------------- Overlays (search / about) ---------------- */
.overlay {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(5,8,12,0.72); backdrop-filter: blur(4px);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 0;
}
.overlay[hidden] { display: none; }
.ov-panel {
  width: 100%; height: 100%;
  background: #0E141D; border: none;
  display: flex; flex-direction: column; overflow: hidden;
}
.ov-head {
  flex: none; display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border-bottom: 1px solid rgba(255,255,255,0.08);
}
.ov-title {
  font-family: 'Cormorant Garamond', serif; font-size: 20px; font-weight: 600; color: #F0E6CC;
}
#search-input {
  flex: 1; min-width: 0; background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.12); border-radius: 9px;
  padding: 9px 13px; color: #E8E3D5; font-size: 14px;
  font-family: 'Albert Sans', sans-serif; outline: none;
}
#search-input:focus { border-color: rgba(217,164,65,0.45); }
#search-input::placeholder { color: #5C6573; }
.ov-close {
  flex: none; background: none; border: none; color: #8B93A3; font-size: 16px;
  cursor: pointer; padding: 6px 8px; line-height: 1; margin-left: auto;
}
.ov-results { flex: 1; overflow-y: auto; padding: 6px 8px 16px; }
.ov-empty { padding: 18px 12px; color: #5C6573; font-size: 12.5px; }
.ov-row {
  display: flex; align-items: center; gap: 11px; width: 100%; text-align: left;
  background: none; border: none; border-radius: 9px; padding: 9px 10px; cursor: pointer;
  font-family: 'Albert Sans', sans-serif;
}
.ov-row:hover { background: rgba(255,255,255,0.05); }
.ov-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.ov-row-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ov-row-title { font-size: 13.5px; font-weight: 600; color: #E2E7EF; }
.ov-row-sub { font-size: 11px; color: #707A8A; font-family: 'Spline Sans Mono', monospace; }

.ov-body { flex: 1; overflow-y: auto; padding: 16px 20px 28px; }
.ov-body p, .ov-body li { font-size: 13px; line-height: 1.65; color: #B8BFCB; }
.ov-body ul { padding-left: 20px; }
.ov-body li { margin-bottom: 8px; }
.ov-body strong { color: #E2DCC8; }
.ov-body em { color: #D9A441; font-style: italic; }
.ov-foot { color: #707A8A !important; font-size: 12px !important; border-top: 1px solid rgba(255,255,255,0.07); padding-top: 12px; }

/* bigger touch targets on touch devices */
@media (pointer: coarse) {
  .event::after { content: ""; position: absolute; inset: -10px; }
  .era::after { content: ""; position: absolute; inset: -4px 0; }
}

/* ---------------- Desktop refinements ---------------- */
@media (min-width: 761px) {
  .hdr { flex-direction: row; align-items: center; gap: 18px; padding: 13px 20px 10px; }
  .hdr-row { gap: 14px; }
  .hdr-tools { overflow: visible; }
  .brand-title { font-size: 25px; }
  .brand-sub { font-size: 9px; }
  .range { display: block; margin-right: 4px; }
  .filters { padding: 8px 20px; }
  .filter-label { display: block; }
  .divider-filters { display: block; }
  .hint-desktop { display: block; }
  .hint-mobile { display: none; }
  .lane-head { padding: 8px 20px 4px; }
  .lane-scroll { max-height: 150px; }
  .lane-scroll-lives { max-height: 110px; }
  .lane-scroll-kings { max-height: 100px; }

  .overlay { padding: 9vh 18px 18px; }
  .ov-panel {
    width: 640px; max-width: 100%; height: auto; max-height: 76vh;
    border: 1px solid rgba(217,164,65,0.3); border-radius: 14px;
    box-shadow: 0 24px 70px rgba(0,0,0,0.7);
  }
}
