:root {
  --bg: #f3f1ec;
  --surface: rgba(252, 251, 248, 0.94);
  --surface-solid: #fcfbf8;
  --ink: #171815;
  --muted: #74746d;
  --line: rgba(25, 25, 20, 0.12);
  --line-strong: rgba(25, 25, 20, 0.2);
  --accent: #df6f2b;
  --accent-rgb: 223, 111, 43;
  --selection: #087f9b;
  --map-label: #252925;
  --map-label-halo: rgba(250, 249, 245, .94);
  --map-land: #e9e6df;
  --map-water: #f5f4f0;
  --shadow: 0 24px 70px rgba(25, 24, 18, 0.12);
  --panel-width: 340px;
  --detail-width: min(440px, 36vw);
}

[data-theme="dark"] {
  --bg: #161714;
  --surface: rgba(28, 29, 26, 0.95);
  --surface-solid: #1c1d1a;
  --ink: #f0eee7;
  --muted: #9a9b93;
  --line: rgba(255, 255, 255, 0.11);
  --line-strong: rgba(255, 255, 255, 0.2);
  --accent: #f08a4b;
  --accent-rgb: 240, 138, 75;
  --selection: #54d6ee;
  --map-label: #f0f0eb;
  --map-label-halo: rgba(15, 16, 14, .88);
  --map-land: #20211e;
  --map-water: #141512;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; white-space: nowrap !important; border: 0 !important; }
[hidden] { display: none !important; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; overscroll-behavior: none; }
body { font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: var(--ink); background: var(--bg); font-size: 14px; }
button, input { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.app-shell { position: relative; width: 100%; height: 100%; background: var(--bg); }
.topbar { position: fixed; z-index: 30; top: 0; left: 0; right: 0; height: 72px; display: grid; grid-template-columns: var(--panel-width) minmax(300px, 560px) 1fr; gap: 28px; align-items: center; padding: 0 24px; border-bottom: 1px solid var(--line); background: var(--surface); backdrop-filter: blur(20px); }
.brand { display: flex; align-items: center; gap: 10px; border: 0; background: none; padding: 0; color: inherit; font-weight: 600; font-size: 16px; text-decoration: none; cursor: pointer; }
.brand-mark { flex: 0 0 20px; width: 20px; height: 20px; background: url("./favicon.svg") center / contain no-repeat; }
.search-wrap { position: relative; justify-self: start; width: 42px; height: 42px; display: flex; align-items: center; gap: 0; padding: 0; overflow: visible; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; transition: width .28s ease, padding .28s ease, gap .28s ease; }
.search-wrap.open { width: 100%; gap: 10px; padding: 0 12px; }
.search-toggle { flex: 0 0 40px; width: 40px; height: 40px; padding: 0; border: 0; background: transparent; color: var(--muted); font-size: 21px; cursor: pointer; transform: rotate(-15deg); }
.search-wrap.open .search-toggle { flex-basis: 22px; width: 22px; }
.search-wrap input { width: 0; min-width: 0; padding: 0; border: 0; background: transparent; color: var(--ink); outline: 0; opacity: 0; pointer-events: none; transition: opacity .18s ease; }
.search-wrap.open input { width: 100%; opacity: 1; pointer-events: auto; }
.search-wrap input::placeholder { color: var(--muted); }
.search-wrap > kbd { display: none; }
.search-wrap.open > kbd { display: inline-block; }
kbd { padding: 3px 7px; border: 1px solid var(--line); border-radius: 6px; color: var(--muted); background: var(--surface-solid); font-size: 10px; white-space: nowrap; }
.search-results { position: absolute; top: 48px; left: 0; right: 0; max-height: min(520px, calc(100vh - 100px)); overflow: auto; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-solid); box-shadow: var(--shadow); padding: 8px; }
.search-group-label { padding: 9px 10px 5px; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .1em; }
.search-result { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 12px; border: 0; background: none; padding: 10px; border-radius: 9px; cursor: pointer; text-align: left; }
.search-result:hover, .search-result.active { background: var(--bg); }
.search-result.active { outline: 1px solid color-mix(in srgb, var(--accent), transparent 58%); }
.search-result small { color: var(--muted); }
.top-actions { grid-column: 3; justify-self: end; display: flex; align-items: center; gap: 8px; }
.tool-button, .icon-button { height: 40px; border: 1px solid var(--line); background: var(--surface-solid); border-radius: 11px; cursor: pointer; }
.tool-button { display: flex; align-items: center; gap: 8px; padding: 0 13px; }
.tool-button[aria-pressed="true"] { color: var(--accent); border-color: rgba(var(--accent-rgb), .45); background: rgba(var(--accent-rgb), .1); }
.passion-icon { display: block; flex: 0 0 19px; width: 19px; height: 19px; background: currentColor; -webkit-mask: url("./assets/resurrection.svg") center / contain no-repeat; mask: url("./assets/resurrection.svg") center / contain no-repeat; }
.icon-button { flex: 0 0 40px; width: 40px; font-size: 17px; }
.share-icon { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
#jerusalem-exit { display: none; }
.jerusalem-active #jerusalem-exit { display: flex; }

.filter-panel { position: fixed; z-index: 20; top: 72px; bottom: 0; left: 0; width: var(--panel-width); padding: 24px 20px 20px; border-right: 1px solid var(--line); background: var(--surface); backdrop-filter: blur(20px); overflow-y: auto; transition: transform .35s ease; }
.filter-head { display: flex; justify-content: space-between; align-items: flex-start; }
.eyebrow { margin: 0 0 8px; color: var(--muted); text-transform: uppercase; letter-spacing: .14em; font-size: 10px; font-weight: 600; }
h1 { margin: 0; font-size: 25px; letter-spacing: -.04em; }
.filter-intro { color: var(--muted); line-height: 1.45; margin: 10px 0 20px; font-size: 12px; }
.panel-close { display: none; }
.filter-kicker { margin: 0 0 9px; color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; }
.quick-filters { display: flex; flex-wrap: wrap; gap: 6px; }
.quick-filter { padding: 7px 10px; border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--muted); font-size: 11px; cursor: pointer; }
.quick-filter:hover { color: var(--ink); border-color: var(--line-strong); }
.quick-filter.active { color: var(--accent); border-color: rgba(var(--accent-rgb),.45); background: rgba(var(--accent-rgb),.1); }
.filter-summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 18px 0 8px; padding: 11px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.filter-summary strong { color: var(--ink); }
.filter-summary button { padding: 0; border: 0; background: none; color: var(--accent); font-size: 10px; cursor: pointer; }
.filter-summary button:disabled { color: var(--muted); opacity: .45; cursor: default; }
.filter-area { border-top: 1px solid var(--line); }
.filter-area:last-child { border-bottom: 1px solid var(--line); }
.filter-area-toggle { width: 100%; min-height: 64px; display: grid; grid-template-columns: 1fr auto auto; gap: 9px; align-items: center; padding: 0 4px; border: 0; background: none; text-align: left; cursor: pointer; }
.filter-area-toggle > span { display: grid; gap: 3px; }
.filter-area-toggle strong { font-size: 14px; }
.filter-area-toggle small { color: var(--muted); font-size: 10px; font-weight: 400; }
.filter-area-toggle b, .filter-subgroup-toggle b { display: grid; min-width: 20px; height: 20px; place-items: center; padding: 0 6px; border-radius: 999px; background: rgba(var(--accent-rgb),.12); color: var(--accent); font-size: 9px; }
.filter-area-toggle i { color: var(--muted); font-size: 16px; font-style: normal; transition: transform .2s; }
.filter-area.open .filter-area-toggle i { transform: rotate(45deg); }
.filter-area-content { display: none; padding: 0 0 12px; }
.filter-area.open > .filter-area-content { display: block; }
.filter-subgroup { border-top: 1px solid color-mix(in srgb,var(--line),transparent 25%); }
.filter-subgroup-toggle { width: 100%; height: 42px; display: grid; grid-template-columns: 1fr auto auto; gap: 8px; align-items: center; padding: 0 7px; border: 0; background: none; text-align: left; color: var(--muted); font-size: 11px; cursor: pointer; }
.filter-subgroup-toggle i { font-style: normal; transition: transform .2s; }
.filter-subgroup.open .filter-subgroup-toggle { color: var(--ink); }
.filter-subgroup.open .filter-subgroup-toggle i { transform: rotate(180deg); }
.filter-subgroup-content { display: none; padding: 1px 0 10px; }
.filter-subgroup.open .filter-subgroup-content { display: grid; gap: 3px; }
.person-filter-search { width: calc(100% - 12px); height: 36px; margin: 2px 6px 7px; padding: 0 11px; border: 1px solid var(--line); border-radius: 9px; background: var(--bg); color: var(--ink); outline: 0; }
.person-filter-search:focus { border-color: rgba(var(--accent-rgb),.55); }
.person-filter-results { display: grid; gap: 3px; }
.filter-empty { margin: 5px 8px; color: var(--muted); font-size: 10px; line-height: 1.45; }
.filter-section-label { margin: 10px 8px 3px; color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.filter-option { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 8px; border-radius: 7px; cursor: pointer; }
.filter-option:hover { background: var(--bg); }
.filter-option.disabled { opacity: .42; cursor: not-allowed; }
.filter-option-child { position: relative; padding-left: 29px; }
.filter-option-child::before { content: ""; position: absolute; left: 15px; top: 0; bottom: 0; width: 1px; background: var(--line); }
.filter-option span:first-child { display: flex; align-items: center; gap: 9px; }
.filter-option input { appearance: none; width: 15px; height: 15px; margin: 0; border: 1px solid var(--line-strong); border-radius: 4px; }
.filter-option input:checked { border-color: var(--accent); background: var(--accent); box-shadow: inset 0 0 0 3px var(--surface-solid); }
.filter-option small { color: var(--muted); }
.filtered-list-button { width: 100%; display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; margin-top: 14px; padding: 13px 14px; border: 1px solid rgba(var(--accent-rgb),.35); border-radius: 11px; background: rgba(var(--accent-rgb),.07); color: var(--ink); text-align: left; cursor: pointer; }
.filtered-list-button[hidden] { display: none; }
.filtered-list-button:hover { border-color: rgba(var(--accent-rgb),.6); background: rgba(var(--accent-rgb),.11); }
.filtered-list-button > span:first-child { display: grid; gap: 3px; }
.filtered-list-button strong { font-size: 11px; }
.filtered-list-button small { color: var(--muted); font-size: 9px; }
.filtered-list-button > span:last-child { color: var(--accent); font-size: 17px; }
.filtered-worklist-head { margin-bottom: 18px; padding-right: 42px; }
.filtered-worklist-head h2 { margin: 5px 0 8px; font-size: clamp(25px,3vw,38px); line-height: 1; }
.filtered-worklist-query { color: var(--muted); font-size: 11px; line-height: 1.5; }
.filtered-worklist-actions { display: flex; flex-wrap: wrap; gap: 7px; margin: 16px 0 20px; }
.filtered-worklist-actions button { padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-solid); color: var(--ink); font: inherit; font-size: 9px; cursor: pointer; }
.filtered-worklist-actions button:hover { border-color: var(--accent); color: var(--accent); }
.filtered-worklist { counter-reset: worklist; border-top: 1px solid var(--line); }
.filtered-worklist-item { position: relative; padding: 16px 0 16px 34px; border-bottom: 1px solid var(--line); }
.filtered-worklist-item::before { counter-increment: worklist; content: counter(worklist, decimal-leading-zero); position: absolute; top: 18px; left: 0; color: var(--accent); font-size: 9px; font-weight: 700; }
.filtered-worklist-item h3 { margin: 0 0 5px; font-size: 13px; line-height: 1.3; }
.filtered-worklist-item .worklist-meta { margin: 0 0 7px; color: var(--muted); font-size: 9px; }
.filtered-worklist-item .worklist-summary { margin: 0 0 8px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.filtered-worklist-item .scripture-links { display: flex; flex-wrap: wrap; gap: 5px; }
.filter-footer { margin: 20px 3px 2px; padding-top: 14px; border-top: 1px solid var(--line); }
.method-link { display: flex; justify-content: space-between; color: var(--muted); text-decoration: none; font-size: 12px; }
.feedback-link { display: flex; justify-content: space-between; margin-top: 11px; color: var(--muted); text-decoration: none; font-size: 11px; }
.filter-footer-secondary { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; margin-top: 12px; }
.legal-links { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.legal-link { display: flex; gap: 6px; color: var(--muted); text-decoration: none; font-size: 11px; }
.method-link:hover, .feedback-link:hover, .legal-link:hover { color: var(--accent); }
.footer-preferences { display: flex; align-items: center; gap: 6px; margin-left: -7px; }
.language-picker { position: relative; }
.language-picker-toggle { display: grid; grid-template-columns: 14px auto 9px; align-items: center; gap: 7px; height: 28px; padding: 0 8px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-solid); color: var(--ink); font: inherit; font-size: 10px; cursor: pointer; }
.language-picker-toggle svg { width: 14px; height: 14px; fill: none; stroke: var(--muted); stroke-width: 1.7; }
.language-caret { color: var(--muted); font-size: 8px; transform: translateY(1px) rotate(180deg); transition: transform .2s; }
.language-picker-toggle[aria-expanded="true"] .language-caret { transform: translateY(-1px); }
.language-menu { position: absolute; z-index: 8; left: 0; bottom: 34px; width: 128px; max-width: calc(100vw - 40px); padding: 4px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-solid); box-shadow: var(--shadow); }
.language-menu button { display: grid; grid-template-columns: 14px 1fr; align-items: center; gap: 8px; width: 100%; height: 32px; padding: 0 8px; border: 0; border-radius: 6px; background: transparent; color: var(--ink); text-align: left; font: inherit; font-size: 10px; cursor: pointer; }
.language-menu button:hover { background: var(--bg); }
.language-menu button:focus-visible { outline: 0; background: var(--bg); }
.language-radio { width: 11px; height: 11px; border: 1px solid var(--line-strong); border-radius: 50%; }
.language-menu button[aria-selected="true"] .language-radio { border-color: var(--accent); box-shadow: inset 0 0 0 3px var(--surface-solid); background: var(--accent); }
.footer-theme-toggle { display: flex; align-items: center; gap: 7px; height: 28px; padding: 0 7px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-solid); color: var(--ink); font: inherit; font-size: 9px; white-space: nowrap; cursor: pointer; }
.footer-theme-toggle:hover { color: var(--accent); border-color: rgba(var(--accent-rgb),.4); }
.theme-switch { position: relative; width: 27px; height: 15px; border-radius: 9px; background: var(--line-strong); transition: background .22s; }
.theme-switch span { position: absolute; top: 2px; left: 2px; width: 11px; height: 11px; border-radius: 50%; background: var(--surface-solid); box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .22s; }
.footer-theme-toggle[aria-pressed="true"] .theme-switch { background: var(--accent); }
.footer-theme-toggle[aria-pressed="true"] .theme-switch span { transform: translateX(12px); }
.filter-opener { position: fixed; z-index: 18; top: 92px; left: 22px; display: none; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--surface); border-radius: 11px; padding: 10px 13px; box-shadow: var(--shadow); }
.filter-opener b { display: none; min-width: 18px; height: 18px; place-items: center; border-radius: 9px; background: var(--accent); color: white; font-size: 10px; }

.map-stage { position: absolute; top: 72px; left: var(--panel-width); right: 0; bottom: 0; overflow: hidden; background: var(--map-water); transition: left .35s ease, right .35s ease; }
#map-canvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: grab; touch-action: none; -webkit-user-select: none; user-select: none; }
#map-canvas.dragging { cursor: grabbing; }
.map-labels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.map-label { position: absolute; transform: translate(-50%, -50%); color: var(--map-label); font-size: 11px; font-weight: 600; text-shadow: -1px -1px 0 var(--map-label-halo), 1px -1px 0 var(--map-label-halo), -1px 1px 0 var(--map-label-halo), 1px 1px 0 var(--map-label-halo), 0 0 5px var(--map-label-halo), 0 0 10px var(--map-label-halo); white-space: nowrap; }
.map-label.selected { z-index: 3; color: var(--selection); font-weight: 800; text-shadow: -1px -1px 0 var(--map-label-halo), 1px -1px 0 var(--map-label-halo), -1px 1px 0 var(--map-label-halo), 1px 1px 0 var(--map-label-halo), 0 0 5px var(--map-label-halo), 0 0 11px var(--map-label-halo), 0 0 15px color-mix(in srgb, var(--selection), transparent 68%); }
.map-label.region { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .18em; }
.map-label.historical { color: color-mix(in srgb, var(--accent), var(--ink) 38%); font-size: 9px; font-weight: 600; text-transform: uppercase; letter-spacing: .14em; text-shadow: 0 1px 7px var(--map-water), 0 0 12px var(--map-water); }
.map-label.historical small { display: block; margin-top: 3px; color: var(--muted); font-size: 7px; font-weight: 500; letter-spacing: .08em; }
.map-label.historical.context { color: var(--muted); font-weight: 500; }
.map-label.historical.city { transform: none; color: color-mix(in srgb, var(--accent), var(--ink) 52%); font-size: 7px; font-weight: 500; letter-spacing: .04em; text-transform: none; }
.map-label.historical.road { color: var(--accent); font-size: 7px; letter-spacing: .12em; opacity: .72; }
.map-tooltip { position: absolute; z-index: 16; min-width: 170px; max-width: 240px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); box-shadow: var(--shadow); backdrop-filter: blur(15px); pointer-events: none; transform: translate(12px, 12px); }
.map-tooltip strong { display: block; margin-bottom: 3px; }
.map-tooltip small { color: var(--muted); }
.active-filters { position: absolute; top: 20px; left: 22px; right: 170px; display: flex; flex-wrap: wrap; gap: 7px; pointer-events: none; }
.filter-chip { pointer-events: auto; padding: 7px 10px; border: 1px solid rgba(var(--accent-rgb), .3); border-radius: 999px; background: var(--surface); color: var(--accent); backdrop-filter: blur(12px); cursor: pointer; box-shadow: 0 6px 18px rgba(0,0,0,.05); }
.map-meta { position: absolute; top: 20px; right: 22px; display: flex; gap: 18px; align-items: center; color: var(--muted); font-size: 11px; }
.map-source { padding-left: 18px; border-left: 1px solid var(--line); }
.result-count strong { color: var(--ink); }
.result-count span { margin-left: 3px; }
.result-count button { margin-left: 5px; padding: 3px 6px; border: 1px solid rgba(var(--accent-rgb), .35); border-radius: 6px; background: rgba(var(--accent-rgb), .08); color: var(--accent); font: inherit; cursor: pointer; }
.result-count button:hover { background: rgba(var(--accent-rgb), .16); }
.heat-key { display: flex; align-items: center; gap: 7px; }
.heat-key span { width: 38px; height: 6px; border-radius: 3px; background: linear-gradient(90deg, #fffce1, #fff400 24%, #ffb100 50%, #ff5b00 76%, #ff1c0c); }
.zoom-controls { position: absolute; right: 22px; top: 62px; display: grid; border: 1px solid var(--line); background: var(--surface); border-radius: 11px; overflow: hidden; box-shadow: 0 8px 30px rgba(0,0,0,.06); }
.zoom-controls button { width: 38px; height: 36px; border: 0; border-bottom: 1px solid var(--line); background: none; cursor: pointer; font-size: 17px; }
.zoom-controls button:last-child { border-bottom: 0; font-size: 14px; }
.jerusalem-map-head { position: absolute; z-index: 15; top: 20px; left: 22px; right: 76px; display: flex; align-items: center; pointer-events: none; }
.jerusalem-map-head > span { display: grid; gap: 2px; padding: 10px 13px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow); backdrop-filter: blur(16px); }
.jerusalem-map-head small { color: var(--muted); font-size: 8px; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; }
.jerusalem-map-head strong { font-size: 13px; }
.jerusalem-mode .map-meta, .jerusalem-mode .active-filters, .jerusalem-mode .timeline-card, .jerusalem-mode .journey-card, .jerusalem-mode .onboarding { display: none !important; }
.jerusalem-active .filter-panel { transform: translateX(-105%); }
.jerusalem-active .filter-panel.open { transform: translateX(0); }
.jerusalem-active .map-stage { left: 0; }
.jerusalem-active .filter-opener { display: flex !important; }
.jerusalem-active .jerusalem-map-head { left: 126px; }
.jerusalem-active .search-wrap, .jerusalem-active #history-toggle, .jerusalem-active #route-toggle, .jerusalem-active #passion-map-shortcut { display: none !important; }
.jerusalem-mode .zoom-controls { top: 78px; }
.jerusalem-mode .tool-button:disabled { opacity: .42; cursor: default; }
.jerusalem-label { z-index: 4; padding: 2px 5px; border: 1px solid rgba(255,255,255,.08); border-radius: 4px; color: rgba(255,253,247,.86); font-size: 8px; font-weight: 680; line-height: 1; background: rgba(29,25,19,.58); box-shadow: 0 1px 3px rgba(0,0,0,.16); text-shadow: 0 1px 2px rgba(23,19,14,.8); opacity: .84; }
.jerusalem-label.context { color: rgba(255,253,247,.76); font-size: 7px; font-weight: 650; text-transform: uppercase; letter-spacing: .11em; }
.jerusalem-label.landmark { color: rgba(255,253,247,.9); font-size: 8px; text-transform: uppercase; letter-spacing: .1em; }
.jerusalem-label.uncertain::after { content: none; }
.jerusalem-label.district { color: rgba(255,253,247,.78); font-size: 7px; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; text-shadow: 0 1px 2px rgba(23,19,14,.8); }
.jerusalem-label.micro-landmark { color: rgba(255,253,247,.72); font-size: 6px; font-weight: 650; letter-spacing: .07em; text-transform: uppercase; }
.jerusalem-label.water-landmark { color: rgba(233,253,255,.82); font-size: 6px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
.jerusalem-label.gate-label { color: rgba(255,244,233,.78); font-size: 6px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
.jerusalem-uncertainty-note { position: absolute; z-index: 15; right: 22px; bottom: 20px; max-width: 245px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); background: color-mix(in srgb,var(--surface),transparent 8%); box-shadow: var(--shadow); backdrop-filter: blur(12px); font-size: 9px; line-height: 1.35; }
.jerusalem-detail-cta { width: 100%; display: grid; grid-template-columns: 1fr auto; gap: 4px 14px; align-items: center; margin: 22px 0 4px; padding: 15px 16px; border: 1px solid rgba(var(--accent-rgb),.38); border-radius: 13px; background: rgba(var(--accent-rgb),.09); color: var(--ink); text-align: left; cursor: pointer; }
.jerusalem-detail-cta strong { font-size: 13px; }
.jerusalem-detail-cta small { color: var(--muted); font-size: 10px; }
.jerusalem-detail-cta span { grid-column: 2; grid-row: 1 / span 2; color: var(--accent); font-size: 19px; }
.station-time { margin: -10px 0 20px; color: var(--accent); font-size: 12px; font-weight: 650; }
.station-place-card { display: grid; gap: 4px; margin: 0 0 20px; padding: 14px 15px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); }
.station-place-card small { color: var(--accent); font-size: 8px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.station-place-card strong { font-size: 15px; }
.station-place-card span { color: var(--muted); font-size: 10px; }
.timeline-card { position: absolute; left: 50%; bottom: 18px; width: min(820px, calc(100% - 120px)); transform: translateX(-50%); padding: 8px 14px 7px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); backdrop-filter: blur(18px); box-shadow: var(--shadow); }
.journey-card { position: absolute; z-index: 17; left: 50%; bottom: 18px; width: min(760px,calc(100% - 120px)); transform: translateX(-50%); padding: 13px 16px 10px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); backdrop-filter: blur(20px); box-shadow: var(--shadow); }
.journey-head { display: flex; justify-content: space-between; gap: 18px; align-items: start; }
.journey-head > span { min-width: 0; display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; align-items: baseline; }
.journey-head small { grid-column: 1/-1; color: var(--muted); font-size: 8px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.journey-head strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.journey-head em { overflow: hidden; color: var(--muted); font-size: 10px; font-style: normal; text-overflow: ellipsis; white-space: nowrap; }
.journey-head label { display: flex; gap: 6px; align-items: center; color: var(--muted); font-size: 9px; white-space: nowrap; }
.journey-head select { border: 1px solid var(--line); border-radius: 6px; background: var(--surface-solid); color: var(--ink); font-size: 10px; }
.journey-scrubber { display: grid; grid-template-columns: 28px 1fr 28px; gap: 9px; align-items: center; margin-top: 10px; }
.journey-scrubber button { width: 28px; height: 25px; border: 1px solid var(--line); border-radius: 7px; background: transparent; color: var(--ink); cursor: pointer; }
.journey-scrubber button:disabled { opacity: .3; cursor: default; }
.journey-scrubber input { width: 100%; accent-color: var(--accent); cursor: ew-resize; }
.journey-legend { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; margin: 1px 38px 0; color: var(--muted); font-size: 8px; }
.journey-legend .past { color: var(--selection); }
.journey-legend .future { color: var(--accent); text-align: right; }
.journey-legend output { padding: 0 10px; }
.journey-mode .heat-key, .journey-mode .onboarding { display: none; }
.timeline-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 4px; }
.phase-track { position: relative; display: grid; grid-template-columns: repeat(7, 1fr); }
.phase-track::before { content: ""; position: absolute; top: 5px; left: 5%; right: 0; height: 1px; background: var(--line-strong); }
.phase-reset { position: relative; min-height: 28px; display: flex; align-items: flex-start; margin-left: 1px; padding: 1px 3px 0 25px; border: 0; background: none; color: var(--muted); font-size: 9px; line-height: 1; white-space: nowrap; cursor: pointer; }
.phase-reset > span { position: absolute; left: 0; top: 5px; width: 17px; height: 10px; transform: translateY(-50%); border-top: 1px solid var(--line-strong); border-right: 1px solid var(--line-strong); border-bottom: 1px solid var(--line-strong); }
.phase-reset > span::after { content: ""; position: absolute; left: 17px; top: 4px; width: 8px; height: 1px; background: var(--line-strong); }
.phase-reset:hover, .phase-reset:focus-visible { color: var(--ink); }
.phase { position: relative; min-height: 28px; border: 0; background: none; padding: 15px 3px 0; color: var(--muted); font-size: 9px; cursor: pointer; white-space: nowrap; }
.phase::before { content: ""; position: absolute; top: 0; left: 50%; width: 10px; height: 10px; transform: translateX(-50%); border: 2px solid var(--surface-solid); border-radius: 50%; background: #aaa99f; box-shadow: 0 0 0 1px var(--line); }
.phase.active { color: var(--accent); }
.phase.active::before { background: var(--accent); box-shadow: 0 0 14px rgba(var(--accent-rgb), .6); }
.onboarding { position: absolute; left: 22px; bottom: 108px; width: 220px; display: flex; gap: 10px; padding: 13px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); box-shadow: var(--shadow); transition: opacity .3s, transform .3s; }
.onboarding.hidden { opacity: 0; transform: translateY(10px); pointer-events: none; }
.onboarding span { color: var(--accent); font-size: 10px; }
.onboarding p { margin: 0; line-height: 1.4; font-size: 12px; }
.onboarding button { margin-left: auto; align-self: flex-start; border: 0; background: none; color: var(--muted); cursor: pointer; }

.detail-panel { position: fixed; z-index: 25; top: 72px; right: 0; bottom: 0; width: var(--detail-width); padding: 28px; background: var(--surface-solid); border-left: 1px solid var(--line); box-shadow: var(--shadow); overflow-y: auto; transform: translateX(105%); transition: transform .38s cubic-bezier(.2,.8,.2,1); }
.detail-panel.open { transform: translateX(0); }
.detail-close { position: absolute; top: 20px; right: 20px; width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 10px; background: transparent; cursor: pointer; font-size: 18px; }
.place-index { color: var(--accent); font-size: 11px; }
.place-title { margin: 12px 50px 5px 0; font-size: clamp(32px, 3.2vw, 48px); line-height: 1; letter-spacing: -.055em; }
.place-modern { margin: 0; color: var(--muted); }
.unmapped-view .place-modern { max-width: 38em; line-height: 1.55; margin-bottom: 24px; }
.place-meta { display: flex; gap: 7px; flex-wrap: wrap; margin: 18px 0 22px; }
.meta-pill { padding: 6px 8px; border: 1px solid var(--line); border-radius: 7px; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .06em; }
.event-list { margin-top: 0; }
.event-list-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding-bottom: 10px; }
.event-list-head p { margin: 0; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .12em; }
.event-list-head span { flex: none; color: var(--muted); font-size: 10px; }
.event-list-head strong { color: var(--accent); font-size: 12px; }
.event-card { border-top: 1px solid var(--line); }
.event-card > button { width: 100%; display: grid; grid-template-columns: 38px 1fr auto; gap: 10px; align-items: start; padding: 15px 0; border: 0; background: none; text-align: left; cursor: pointer; }
.event-card .event-number { color: var(--accent); font-size: 10px; padding-top: 3px; }
.event-card h3 { margin: 0 0 5px; font-size: 14px; line-height: 1.3; }
.event-card small { color: var(--muted); }
.event-card .arrow { color: var(--muted); }
.event-detail { animation: detail-in .25s ease; }
.editorial-note { margin: 20px 0 6px; padding: 15px 16px; border: 1px solid rgba(var(--accent-rgb), .24); border-radius: 12px; background: rgba(var(--accent-rgb), .055); }
.editorial-note .eyebrow { margin: 0 0 8px; color: var(--accent); }
.editorial-note p:not(.eyebrow) { margin: 6px 0 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
@keyframes detail-in { from { opacity: 0; transform: translateX(8px); } }
.back-button { border: 0; background: none; color: var(--muted); padding: 0; margin-bottom: 30px; cursor: pointer; }
.event-detail h2 { margin: 12px 0 16px; font-size: 34px; letter-spacing: -.045em; line-height: 1.05; }
.event-detail .summary { font-size: 16px; line-height: 1.65; }
.event-facts { margin-top: 28px; }
.fact-row { display: grid; grid-template-columns: 110px 1fr; gap: 15px; padding: 13px 0; border-top: 1px solid var(--line); }
.fact-row dt { color: var(--muted); }
.fact-row dd { margin: 0; }
.participant-list { display: grid; gap: 9px; margin: 0; padding: 0; list-style: none; }
.participant-list li { display: grid; gap: 2px; }
.participant-list span { color: var(--muted); font-size: 11px; line-height: 1.45; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { padding: 5px 7px; border-radius: 6px; background: rgba(var(--accent-rgb), .1); color: var(--accent); font-size: 11px; }
.context-tag { background: transparent; border: 1px solid var(--line); color: var(--muted); }
.scripture-links { display: flex; flex-wrap: wrap; gap: 7px; }
.scripture-link { display: inline-flex; align-items: center; gap: 5px; padding: 5px 7px; border: 1px solid var(--line); border-radius: 6px; color: var(--ink); text-decoration: none; font-size: 12px; transition: border-color .2s, color .2s; }
.scripture-link:hover { border-color: var(--accent); color: var(--accent); }
.event-segments { margin: 28px 0 8px; }
.event-segments > p { margin-bottom: 9px; }
.event-segments > a { display: grid; grid-template-columns: 28px 1fr auto; gap: 9px; align-items: center; padding: 11px 0; border-top: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.event-segments > a > span { color: var(--accent); font-size: 9px; }
.event-segments > a strong { font-size: 12px; line-height: 1.3; }
.event-segments > a small { color: var(--muted); white-space: nowrap; }
.event-segments > a:hover strong { color: var(--accent); }
.event-navigation { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 34px; padding-top: 18px; border-top: 1px solid var(--line); }
.event-navigation button { min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: transparent; color: var(--ink); text-align: left; cursor: pointer; }
.event-navigation button.next { text-align: right; }
.event-navigation small, .event-navigation span { display: block; color: var(--muted); font-size: 10px; }
.event-navigation strong { display: block; margin: 6px 0 4px; font-size: 12px; line-height: 1.3; }
.event-navigation button:hover { border-color: var(--accent); }

.method-modal { position: fixed; z-index: 60; inset: 0; display: grid; place-items: center; padding: 30px; background: rgba(10,10,8,.38); backdrop-filter: blur(8px); }
.method-card { position: relative; width: min(900px, 100%); max-height: 90vh; overflow-y: auto; padding: 42px; border-radius: 22px; background: var(--surface-solid); box-shadow: var(--shadow); }
.method-card h2 { margin: 0 0 30px; font-size: 36px; letter-spacing: -.05em; }
.method-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); }
.method-grid section { padding: 24px; background: var(--surface-solid); }
.method-grid span { color: var(--accent); font-size: 10px; }
.method-grid h3 { margin: 18px 0 8px; }
.method-grid p { margin: 0; color: var(--muted); line-height: 1.55; }
.toast { position: fixed; z-index: 80; left: 50%; bottom: 26px; transform: translate(-50%, 20px); padding: 10px 14px; border-radius: 10px; background: var(--ink); color: var(--surface-solid); opacity: 0; pointer-events: none; transition: .25s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.legal-page { min-height: 100vh; overflow: auto; background: var(--bg); color: var(--ink); }
.legal-header { position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between; align-items: center; height: 72px; padding: 0 clamp(22px, 5vw, 72px); border-bottom: 1px solid var(--line); background: var(--surface); backdrop-filter: blur(18px); }
.legal-header .brand { color: var(--ink); text-decoration: none; }
.legal-back { color: var(--muted); text-decoration: none; font-size: 12px; }
.legal-back:hover { color: var(--accent); }
.legal-main { width: min(720px, calc(100% - 44px)); margin: 0 auto; padding: 72px 0 100px; }
.legal-main > .eyebrow { color: var(--accent); }
.legal-main h1 { margin: 12px 0 34px; font-size: clamp(46px, 8vw, 78px); line-height: .95; letter-spacing: -.06em; }
.legal-main section { padding: 28px 0; border-top: 1px solid var(--line); }
.legal-main h2 { margin: 0 0 12px; font-size: 17px; }
.legal-main p, .legal-main address, .legal-main li { color: var(--muted); font-size: 14px; line-height: 1.7; font-style: normal; }
.legal-main p { margin: 0; }
.legal-main p + p { margin-top: 12px; }
.legal-main ul { margin: 12px 0 0; padding-left: 20px; }
.legal-main li + li { margin-top: 5px; }
.legal-main a { color: var(--ink); text-underline-offset: 3px; }
.legal-main address { margin-top: 16px; }
.legal-main address strong { color: var(--ink); }
.legal-page-links { display: flex; flex-wrap: wrap; gap: 12px 20px; }

@media (max-width: 1100px) {
  :root { --panel-width: 310px; --detail-width: 420px; }
  .topbar { grid-template-columns: 240px minmax(280px, 1fr) auto; }
  .tool-button span:last-child { display: none; }
  .onboarding { display: none; }
}

@media (max-width: 820px) {
  :root { --panel-width: min(350px, 88vw); --detail-width: min(440px, 100vw); }
  .topbar { height: 64px; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; padding: 0 14px; }
  .brand { gap: 7px; font-size: 13px; white-space: nowrap; }
  .brand-mark { flex-basis: 18px; width: 18px; height: 18px; }
  .search-wrap { position: fixed; top: 74px; left: auto; right: 14px; z-index: 22; background: var(--surface); }
  .search-wrap.open { left: 66px; width: auto; }
  .top-actions { grid-column: 2; grid-row: 1; gap: 6px; }
  .tool-button { display: none; }
  .tool-button#route-toggle, .tool-button#history-toggle, .tool-button#passion-map-shortcut { display: flex; width: 36px; padding: 0; justify-content: center; }
  #share-button { display: none; }
  .filter-panel { top: 64px; z-index: 45; transform: translateX(-105%); box-shadow: var(--shadow); }
  .filter-panel.open { transform: translateX(0); }
  .panel-close { display: block; }
  .filter-opener { display: flex; top: 74px; left: 14px; }
  .map-stage { top: 64px; left: 0; }
  .map-meta { top: 66px; right: 14px; }
  .heat-key { display: none; }
  .map-source { display: none; }
  .zoom-controls { right: 14px; top: 100px; }
  .active-filters { top: 122px; left: 14px; right: 60px; }
  .timeline-card { width: calc(100% - 28px); bottom: 14px; padding: 8px 10px 7px; }
  .timeline-row { display: flex; gap: 6px; align-items: center; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .timeline-row::-webkit-scrollbar { display: none; }
  .phase-track { display: contents; }
  .phase-track::before { display: none; }
  .phase { flex: 0 0 auto; min-height: 32px; padding: 0 11px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-solid); color: var(--muted); font-size: 10px; }
  .phase::before { display: none; }
  .phase.active { border-color: var(--accent); background: var(--accent); color: #fff; box-shadow: 0 5px 16px rgba(var(--accent-rgb),.24); }
  .phase-reset { position: sticky; z-index: 2; left: 0; order: -1; flex: 0 0 auto; min-height: 32px; margin: 0; padding: 0 12px; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-solid); color: var(--muted); font-size: 0; line-height: 1.2; }
  .phase-reset::after { content: attr(data-mobile-label); display: block; font-size: 10px; line-height: 1.2; }
  .phase-reset > span { display: none; }
  .phase-reset.active { border-color: var(--accent); background: var(--accent); color: #fff; box-shadow: 0 5px 16px rgba(var(--accent-rgb),.24); }
  .journey-card { width: calc(100% - 28px); bottom: 14px; padding: 11px 12px 9px; }
  .journey-head strong { font-size: 11px; }
  .phase { overflow: hidden; text-overflow: ellipsis; }
  .detail-panel { z-index: 50; top: auto; left: 0; right: 0; bottom: 0; width: 100%; height: min(58dvh, 560px); padding: 28px 24px max(24px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); border-left: 0; border-radius: 20px 20px 0 0; overscroll-behavior: contain; transform: translateY(105%); transition: transform .38s cubic-bezier(.2,.8,.2,1); }
  .detail-panel.open { transform: translateY(0); }
  .detail-panel::before { content: ""; position: sticky; z-index: 2; top: -18px; display: block; width: 38px; height: 4px; margin: -8px auto 14px; border-radius: 999px; background: var(--line-strong); }
  .detail-panel .detail-close { top: 14px; right: 16px; }
  .jerusalem-mode .jerusalem-map-head { top: 12px; left: 14px; right: 14px; gap: 10px; align-items: flex-start; }
  .jerusalem-mode .jerusalem-map-head > span { max-width: 190px; padding: 8px 10px; }
  .jerusalem-mode .jerusalem-map-head strong { font-size: 12px; line-height: 1.2; }
  .jerusalem-uncertainty-note { right: 12px; bottom: 12px; max-width: min(220px,calc(100vw - 24px)); font-size: 8px; }
  .jerusalem-mode .zoom-controls { top: 70px; }
}

@media (max-width: 560px) {
  kbd { display: none; }
  .icon-button { flex-basis: 36px; width: 36px; height: 36px; }
  .timeline-card { padding-bottom: 7px; }
  .detail-panel { height: min(62dvh, 540px); padding: 25px 20px max(22px, env(safe-area-inset-bottom)); }
  .method-card { padding: 30px 22px; }
  .method-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
