@import url('/fonts/fonts.css');

/* ------------------------------------------------------------------
   Beis Hamikdash · interface system
   Two surfaces carry the whole interface:
     ink   – tools that sit over the model (buttons, route strip, chips)
     paper – things you read (labels, sources, plan, dialogs)
   Bronze is the only accent. Everything else is limestone and shadow.
   Walking-mode rules live in assets/v7/walk.css; onboarding and the
   display popover live in assets/v10/exploration.css.
   ------------------------------------------------------------------ */
:root {
  --font-ui: Manrope, "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-display: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --font-hebrew: 'Cormorant Garamond', 'David Libre', David, FrankRuehl, Narkisim, 'Times New Roman', serif;

  --paper: #f6f1e7;
  --paper-2: #ede6d7;
  --paper-veil: rgb(246 241 231 / .95);
  --paper-text: #f3eee3;
  --paper-text-2: #cbd0cc;
  --paper-text-3: #98a4a3;

  --ink: #1d2427;
  --ink-2: #3b464b;
  --ink-3: #66737a;
  --ink-veil: rgb(29 36 39 / .88);
  --ink-veil-2: rgb(29 36 39 / .74);
  --ink-hover: rgb(58 68 72 / .92);

  --bronze: #86652c;
  --bronze-2: #c8a15b;
  --bronze-3: #e7cf98;

  --line-ink: rgb(29 36 39 / .16);
  --line-paper: rgb(246 241 231 / .2);
  --shadow: 0 12px 34px rgb(18 26 30 / .24);
  --shadow-soft: 0 4px 16px rgb(18 26 30 / .16);

  --radius: 10px;
  --radius-s: 6px;
  --gutter: clamp(14px, 2.2vw, 30px);
  --tap: 44px;
  --header-h: 46px;
  --strip-h: 60px;
  --narration-h: 0px; /* becomes the player's height while #narration-player is visible; see exploration.css */

  --z-labels: 1;
  --z-ui: 3;
  --z-panel: 5;
  --z-welcome: 6;
  --z-overlay: 12;

  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.5;
  color: var(--paper-text);
  background: var(--ink);
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
* { box-sizing: border-box; }
body { margin: 0; overflow: hidden; background: var(--ink); }
[hidden] { display: none !important; }
.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; }
button, a, input, select { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; padding: 0; margin: 0; }
button:disabled { cursor: default; opacity: .55; }
button, .view { transition: background-color .18s, color .18s, border-color .18s, opacity .18s; }
:is(button, a, input, select, summary):focus-visible {
  outline: 2px solid var(--bronze-2);
  outline-offset: 3px;
  box-shadow: 0 0 0 5px rgb(29 36 39 / .6);
}
kbd { font: 600 .92em var(--font-ui); letter-spacing: .04em; }
.eyebrow { font-size: 11px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--bronze-2); margin: 0; }

/* Scene ------------------------------------------------------------ */
#experience { position: relative; height: 100dvh; min-height: 0; overflow: hidden; }
#scene { position: absolute; inset: 0; touch-action: none; outline: none; }
#scene:focus-visible { box-shadow: inset 0 0 0 3px var(--bronze-2); }
#scene canvas { display: block; width: 100%; height: 100%; }
.vignette { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, rgb(20 32 38 / .14), transparent 18%, transparent 80%, rgb(20 32 38 / .16)); }

/* Header ----------------------------------------------------------- */
header {
  position: absolute; top: 18px; left: var(--gutter); right: var(--gutter);
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px;
  pointer-events: none; z-index: var(--z-ui);
}
header > * { pointer-events: none; min-width: 0; }
header a, header button, header .era, header .display-panel, header .entry-hint, header .tour-step { pointer-events: auto; }
.brand {
  justify-self: start; display: inline-flex; align-items: center; gap: 11px;
  height: var(--header-h); padding: 0 14px 0 9px; text-decoration: none; color: var(--ink);
  background: var(--paper-veil); border: 1px solid rgb(29 36 39 / .1); border-radius: var(--radius);
  box-shadow: var(--shadow-soft); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.brand-mark {
  display: grid; place-items: center; width: 30px; height: 34px;
  font-family: var(--font-hebrew); font-size: 24px; line-height: 1; color: var(--bronze);
  border: 1px solid rgb(134 101 44 / .55); border-radius: 15px 15px 2px 2px; padding-top: 2px;
}
.brand-text { font-family: var(--font-display); font-weight: 600; font-size: 18px; letter-spacing: .02em; line-height: 1; white-space: nowrap; }
.brand-text small { display: block; margin-top: 4px; font-family: var(--font-ui); font-size: 9.5px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: var(--ink-3); }
.brand:hover .brand-mark { border-color: var(--bronze); }

.top-tools { justify-self: center; position: relative; display: flex; align-items: center; gap: 8px; }
.walk-primary, .tour-button, .listen-button, .display-button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--header-h); padding: 0 18px; border-radius: var(--radius);
  font-size: 13.5px; font-weight: 600; white-space: nowrap;
  background: var(--ink-veil); color: var(--paper-text); border: 1px solid var(--line-paper);
  box-shadow: var(--shadow-soft); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.tour-button:hover, .listen-button:hover, .display-button:hover, .display-button[aria-expanded=true] { background: var(--ink-hover); }
.walk-primary { background: var(--bronze-2); color: var(--ink); border-color: rgb(231 207 152 / .7); font-weight: 700; padding: 0 20px; }
.walk-primary:hover { background: var(--bronze-3); }
.walk-primary[aria-pressed=true] { background: var(--paper); border-color: var(--paper); }
#tour-icon { font-size: 15px; line-height: 1; color: var(--bronze-2); }
.tour-step {
  font-family: var(--font-display); font-size: 15px; font-weight: 600; letter-spacing: .02em;
  padding: 6px 11px; border-radius: var(--radius-s); background: var(--ink-veil); color: var(--bronze-3); border: 1px solid var(--line-paper);
}
.entry-hint {
  position: absolute; top: calc(100% + 8px); left: 0; padding: 6px 10px; border-radius: var(--radius-s);
  background: var(--ink-veil); color: var(--paper-text-2); font-size: 12px; white-space: nowrap; pointer-events: none;
  opacity: 0; transform: translateY(-3px); transition: opacity .18s, transform .18s;
}
.top-tools:has(#walk-toggle:hover, #walk-toggle:focus-visible) .entry-hint { opacity: 1; transform: none; }
.entry-hint b { color: var(--bronze-3); font-weight: 600; }

.header-right { justify-self: end; position: relative; display: flex; align-items: center; gap: 8px; }
.era {
  margin-right: 6px; padding: 6px 12px 7px; text-align: right; color: var(--ink); font-size: 10.5px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; line-height: 1.2;
  background: var(--paper-veil); border: 1px solid rgb(29 36 39 / .1); border-radius: var(--radius-s); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.era span { display: block; font-size: 12px; font-weight: 500; letter-spacing: .01em; text-transform: none; color: var(--ink-2); margin-top: 1px; }
.icon-button {
  display: grid; place-items: center; width: var(--header-h); height: var(--header-h); border-radius: 50%;
  background: var(--ink-veil); color: var(--paper-text); border: 1px solid var(--line-paper);
  box-shadow: var(--shadow-soft); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.icon-button:hover { background: var(--ink-hover); }
.about-glyph { font-family: var(--font-display); font-style: italic; font-weight: 600; font-size: 22px; line-height: 1; color: var(--bronze-3); transform: translateY(-1px); }
.display-button { padding: 0 15px 0 12px; }
.display-button svg { color: var(--bronze-2); flex: none; }

/* Interpretive label ------------------------------------------------ */
.detail-card {
  position: absolute; left: var(--gutter); top: calc(18px + var(--header-h) + 14px);
  width: 312px; max-height: calc(100dvh - 18px - var(--header-h) - 14px - var(--strip-h) - 40px);
  overflow: auto; overscroll-behavior: contain;
  padding: 16px 20px 18px; border-radius: var(--radius);
  background: var(--paper-veil); color: var(--ink); border: 1px solid rgb(29 36 39 / .1);
  box-shadow: var(--shadow); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  scrollbar-width: thin; scrollbar-color: rgb(29 36 39 / .3) transparent; z-index: var(--z-ui);
}
.detail-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
#detail-kicker { font-size: 11px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--bronze); }
#collapse-detail {
  flex: none; display: grid; place-items: center; width: 32px; height: 32px; margin: -6px -8px -6px 0; border-radius: 50%;
  font-family: var(--font-display); font-size: 24px; line-height: 1; color: var(--ink-2); border: 1px solid transparent;
}
#collapse-detail:hover { background: var(--paper-2); border-color: var(--line-ink); color: var(--ink); }
.detail-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; margin-top: 10px; }
.detail-card h2 { font-family: var(--font-display); font-weight: 500; font-size: 32px; line-height: 1.05; letter-spacing: -.01em; margin: 0; }
#detail-hebrew { font-family: var(--font-hebrew); font-size: 20px; line-height: 1; color: var(--bronze); margin: 0; flex: none; }
#detail-description { font-size: 14px; line-height: 1.7; color: var(--ink-2); margin: 14px 0 0; }
.detail-stat { display: flex; flex-direction: column; gap: 3px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line-ink); }
.detail-stat strong { font-family: var(--font-display); font-weight: 600; font-size: 28px; line-height: 1; color: var(--ink); font-variant-numeric: tabular-nums; }
.detail-stat span { font-size: 12px; line-height: 1.45; color: var(--ink-3); }
#detail-learning { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line-ink); font-size: 13px; line-height: 1.65; color: var(--ink-2); }
#detail-learning summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; padding: 4px 0; font-weight: 700; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--bronze); border-radius: 4px; }
#detail-learning summary::-webkit-details-marker { display: none; }
#detail-learning summary::before { content: ''; width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(-45deg); transition: transform .18s; flex: none; margin-left: 2px; }
#detail-learning[open] summary::before { transform: rotate(45deg); }
#detail-learning summary:hover { color: var(--ink); }
#detail-learning p { margin: 10px 0 0; }
#detail-learning strong { color: var(--ink); font-weight: 700; }
#detail-learning ul { list-style: none; margin: 8px 0 0; padding: 0; }
#detail-learning li { margin: 0; border-top: 1px solid var(--line-ink); }
#detail-learning li:first-child { border-top: 0; }
#detail-learning a { display: block; padding: 7px 0; color: var(--ink); text-decoration: none; }
#detail-learning a:hover { color: var(--bronze); text-decoration: underline; text-underline-offset: 3px; }
.detail-card:has(#detail-content[hidden]) { width: auto; min-width: 200px; max-width: min(360px, calc(100% - 2 * var(--gutter))); padding: 12px 16px 13px; }
.detail-card:has(#detail-content[hidden]) .detail-heading { margin-top: 6px; }
.detail-card:has(#detail-content[hidden]) h2 { font-size: 24px; }
.detail-card:has(#detail-content[hidden]) #detail-hebrew { font-size: 17px; }

/* Keilim close-ups ---------------------------------------------------- */
.vessel-closeups {
  position: absolute; right: var(--gutter); top: calc(18px + var(--header-h) + 14px);
  display: flex; flex-direction: column; gap: 2px; min-width: 150px; padding: 10px;
  background: var(--ink-veil); border: 1px solid var(--line-paper); border-radius: var(--radius);
  box-shadow: var(--shadow-soft); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); z-index: var(--z-ui);
}
.vessel-closeups > span { font-size: 11px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--bronze-2); margin: 2px 8px 6px; }
.vessel-closeups button { min-height: 40px; padding: 8px 12px; border-radius: var(--radius-s); text-align: left; font-size: 13.5px; font-weight: 500; color: var(--paper-text); }
.vessel-closeups button:hover { background: var(--ink-hover); }
.vessel-closeups button[aria-pressed=true] { background: var(--paper); color: var(--ink); font-weight: 600; }

/* Landmark labels ------------------------------------------------------ */
#labels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: var(--z-labels); }
.landmark {
  pointer-events: auto; position: absolute; left: 0; top: 0; transform: translate(-50%, -50%);
  display: inline-flex; align-items: center; gap: 7px; padding: 6px 11px 6px 9px; white-space: nowrap;
  background: var(--ink-veil); color: var(--paper-text); border: 1px solid var(--line-paper); border-radius: var(--radius-s);
  font-size: 12px; font-weight: 500; letter-spacing: .01em; box-shadow: var(--shadow-soft); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.landmark::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: var(--bronze-2); flex: none; }
.landmark:hover { background: var(--paper); color: var(--ink); }
.landmark:hover::before { background: var(--bronze); }

/* Compass -------------------------------------------------------------- */
.orientation { position: absolute; right: calc(var(--gutter) + 2px); bottom: calc(var(--strip-h) + 32px); width: 62px; height: 62px; pointer-events: none; z-index: var(--z-ui); }
#compass { position: relative; width: 100%; height: 100%; border-radius: 50%; border: 1px solid rgb(29 36 39 / .35); background: rgb(246 241 231 / .55); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); color: var(--ink); }
#compass span { position: absolute; font-size: 9.5px; font-weight: 700; letter-spacing: .04em; }
#compass .north { top: 5px; left: 50%; transform: translateX(-50%); color: var(--bronze); }
#compass .south { bottom: 5px; left: 50%; transform: translateX(-50%); }
#compass .east { right: 7px; top: 50%; transform: translateY(-50%); }
#compass .west { left: 6px; top: 50%; transform: translateY(-50%); }
#compass i { position: absolute; left: 50%; top: 17px; width: 1px; height: 28px; margin-left: -.5px; background: linear-gradient(var(--bronze) 50%, rgb(29 36 39 / .3) 50%); }
#compass i::before { content: ''; position: absolute; top: -1px; left: -3px; border-left: 3px solid transparent; border-right: 3px solid transparent; border-bottom: 8px solid var(--bronze); }

/* Route strip ------------------------------------------------------------ */
.bottom-area { position: absolute; left: 0; right: 0; bottom: 16px; display: flex; flex-direction: column; align-items: center; gap: 10px; pointer-events: none; z-index: var(--z-ui); padding: 0 var(--gutter); }
.bottom-area > * { pointer-events: auto; }
.viewpoints {
  display: flex; gap: 2px; max-width: 100%; padding: 4px; overflow-x: auto; overscroll-behavior-x: contain;
  scrollbar-width: none; background: var(--ink-veil); border: 1px solid var(--line-paper); border-radius: var(--radius);
  box-shadow: var(--shadow); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
}
.viewpoints::-webkit-scrollbar { display: none; }
.view {
  position: relative; flex: none; display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  min-width: 122px; min-height: 52px; padding: 7px 14px 8px; border-radius: 7px; text-align: left; color: var(--paper-text);
}
.view > span { font-family: var(--font-display); font-weight: 600; font-size: 14px; line-height: 1; color: var(--bronze-2); font-variant-numeric: tabular-nums; }
.view strong { font-size: 12.5px; font-weight: 600; line-height: 1.2; white-space: nowrap; letter-spacing: -.005em; }
.view small { font-size: 11px; line-height: 1.2; color: var(--paper-text-2); white-space: nowrap; }
.view:hover:not(.active) { background: rgb(246 241 231 / .1); }
.view.active { background: var(--paper); color: var(--ink); }
.view.active > span { color: var(--bronze); }
.view.active small { color: var(--ink-3); }
.view:focus-visible { outline-offset: -2px; box-shadow: none; }

/* Loading and errors ------------------------------------------------------ */
#loading {
  position: absolute; inset: 0; z-index: var(--z-overlay); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0;
  background: var(--paper); color: var(--ink); text-align: center; padding: 24px; transition: opacity .6s;
}
.loader-mark { font-family: var(--font-hebrew); font-size: 64px; line-height: 1; color: var(--bronze); animation: breathe 2.4s ease-in-out infinite; }
#loading p { font-family: var(--font-display); font-weight: 500; font-size: 34px; line-height: 1.1; letter-spacing: -.01em; margin: 22px 0 8px; }
#loading > span { font-size: 13px; color: var(--ink-3); max-width: 90%; }
.loader-line { position: relative; width: 140px; height: 1px; margin-top: 26px; background: var(--line-ink); overflow: hidden; }
.loader-line i { position: absolute; top: 0; bottom: 0; left: 0; width: 40%; background: var(--bronze); animation: slide 1.6s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: .45; } }
@keyframes slide { 0% { transform: translateX(-100%); } 100% { transform: translateX(350%); } }
#error {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: calc(var(--z-overlay) + 1);
  width: min(440px, calc(100% - 32px)); padding: 28px 30px 30px; border-radius: var(--radius);
  background: var(--paper); color: var(--ink); box-shadow: var(--shadow); border: 1px solid rgb(29 36 39 / .1);
}
#error .eyebrow { display: block; color: var(--bronze); }
#error h2 { font-family: var(--font-display); font-weight: 500; font-size: 30px; line-height: 1.1; margin: 12px 0 10px; }
#error p { font-size: 14.5px; line-height: 1.7; color: var(--ink-2); margin: 0 0 18px; }
#error button { min-height: var(--tap); padding: 0 20px; border-radius: var(--radius-s); background: var(--ink); color: var(--paper-text); font-weight: 600; }
#error button:hover { background: var(--ink-2); }

/* Dialogs ------------------------------------------------------------------- */
dialog {
  position: fixed; inset: 0; margin: auto; width: min(640px, calc(100% - 32px)); max-height: min(86dvh, 900px); overflow: auto; overscroll-behavior: contain;
  padding: 40px 44px 36px; border: 0; border-radius: 14px; background: var(--paper); color: var(--ink); box-shadow: 0 30px 90px rgb(10 16 20 / .55);
  scrollbar-width: thin; scrollbar-color: rgb(29 36 39 / .3) transparent;
}
dialog::backdrop { background: rgb(18 26 30 / .62); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.dialog-close { position: absolute; top: 12px; right: 12px; display: grid; place-items: center; width: var(--tap); height: var(--tap); border-radius: 50%; font-family: var(--font-display); font-size: 30px; line-height: 1; color: var(--ink-2); }
.dialog-close:hover { background: var(--paper-2); color: var(--ink); }
dialog .eyebrow { color: var(--bronze); }
dialog h2 { font-family: var(--font-display); font-weight: 500; font-size: 38px; line-height: 1.08; letter-spacing: -.01em; margin: 14px 0 18px; max-width: 14em; }
dialog p { font-size: 15px; line-height: 1.75; color: var(--ink-2); margin: 0 0 14px; }
dialog h3 { font-size: 11px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--bronze); margin: 30px 0 4px; }
dialog > a { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line-ink); color: var(--ink); font-size: 14px; line-height: 1.5; text-decoration: none; }
dialog > a:first-of-type, dialog h3 + a { border-top: 0; }
dialog > a:hover { color: var(--bronze); text-decoration: underline; text-underline-offset: 3px; }
dialog p a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgb(134 101 44 / .6); }
dialog p a:hover { color: var(--bronze); }
dialog .keyboard-help, dialog .dialog-note { font-size: 13px; color: var(--ink-3); margin-bottom: 0; }
dialog em { font-style: normal; font-weight: 700; color: var(--ink); }
.key-legend { margin: 0 0 16px; padding: 0; }
.key-legend > div { display: grid; grid-template-columns: 118px 1fr; gap: 14px; align-items: baseline; padding: 11px 0; border-top: 1px solid var(--line-ink); }
.key-legend > div:first-child { border-top: 0; }
.key-legend dt { display: flex; flex-wrap: wrap; gap: 4px; font-weight: 700; color: var(--ink); font-size: 13px; }
.key-legend dt kbd { display: inline-grid; place-items: center; min-width: 26px; height: 26px; padding: 0 7px; border-radius: 5px; background: #fff; border: 1px solid var(--line-ink); box-shadow: 0 1px 0 var(--line-ink); font-size: 12px; }
.key-legend dd { margin: 0; font-size: 14px; line-height: 1.6; color: var(--ink-2); }
.walk-eye { display: flex; align-items: center; gap: 12px; margin: 4px 0 16px; font-weight: 700; font-size: 13px; color: var(--ink); }
.walk-eye select { min-height: var(--tap); padding: 8px 12px; border-radius: var(--radius-s); border: 1px solid var(--line-ink); background: #fff; color: var(--ink); font: inherit; font-weight: 500; }

/* Responsive ------------------------------------------------------------------- */
@media (min-width: 1500px) {
  .detail-card { width: 340px; padding: 18px 22px 20px; }
  .detail-card h2 { font-size: 36px; }
  #detail-description { font-size: 15px; }
  .view { min-width: 136px; padding: 8px 16px 9px; }
  .view strong { font-size: 13px; }
}
@media (max-width: 1100px) {
  .era { display: none; }
  .detail-card { width: 280px; }
  .view { min-width: 112px; padding: 7px 12px 8px; }
  .view strong { font-size: 12px; }
}
@media (max-width: 760px) {
  :root { --gutter: 12px; --header-h: 40px; --strip-h: 48px; }
  header { top: 12px; grid-template-columns: auto 1fr auto; gap: 8px; }
  .brand { padding: 0 6px; gap: 0; }
  .brand-text { display: none; }
  .brand-mark { width: 26px; height: 28px; font-size: 20px; border-radius: 13px 13px 2px 2px; }
  .top-tools { gap: 6px; }
  .walk-primary, .tour-button, .listen-button, .display-button { font-size: 13px; padding: 0 13px; }
  .walk-primary { padding: 0 14px; }
  .tour-button { width: var(--header-h); padding: 0; }
  #tour-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  #tour-icon { font-size: 16px; }
  .tour-step { position: absolute; top: calc(100% + 6px); right: 0; font-size: 13px; padding: 4px 8px; }
  .entry-hint { display: none; }
  .header-right { gap: 6px; }
  .display-button { width: var(--header-h); padding: 0; }
  .display-button span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .detail-card { top: calc(12px + var(--header-h) + 10px); width: auto; left: var(--gutter); right: var(--gutter); max-width: none; max-height: calc(100dvh - 12px - var(--header-h) - 10px - var(--strip-h) - 60px); padding: 14px 16px 16px; z-index: var(--z-panel); }
  .detail-card h2 { font-size: 27px; }
  #detail-hebrew { font-size: 18px; }
  #detail-description { font-size: 13.5px; line-height: 1.6; margin-top: 10px; }
  .detail-stat strong { font-size: 24px; }
  .detail-card:has(#detail-content[hidden]) { right: auto; min-width: 0; max-width: calc(100% - 2 * var(--gutter)); padding: 9px 13px 10px; z-index: var(--z-ui); }
  .detail-card:has(#detail-content[hidden]) h2 { font-size: 21px; }
  .detail-card:has(#detail-content[hidden]) #detail-hebrew { display: none; }
  #detail-kicker { font-size: 10px; letter-spacing: .12em; }
  .vessel-closeups { top: calc(12px + var(--header-h) + 10px + 66px); left: var(--gutter); right: var(--gutter); flex-direction: row; flex-wrap: wrap; align-items: center; gap: 4px; min-width: 0; padding: 6px; }
  .vessel-closeups > span { width: 100%; margin: 2px 6px 2px; font-size: 10px; }
  .vessel-closeups button { flex: 1 1 auto; min-height: 38px; padding: 6px 10px; font-size: 13px; text-align: center; }
  .orientation { display: none; }
  .landmark { font-size: 11.5px; padding: 5px 9px 5px 8px; }
  .bottom-area { bottom: 12px; gap: 8px; }
  .viewpoints { padding: 3px 34px 3px 3px; gap: 1px; border-radius: 9px; scroll-padding-inline: 34px; -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 34px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 34px), transparent); }
  .view { flex-direction: row; align-items: baseline; gap: 7px; min-width: 0; min-height: 42px; padding: 0 13px; border-radius: 7px; }
  .view > span { font-size: 13px; }
  .view strong { font-size: 12.5px; }
  .view small { display: none; }
  dialog { padding: 30px 22px 26px; border-radius: 12px; max-height: 92dvh; }
  dialog h2 { font-size: 30px; }
  dialog p { font-size: 14.5px; }
  .key-legend > div { grid-template-columns: 96px 1fr; gap: 10px; }
  #loading p { font-size: 28px; }
}
@media (max-height: 520px) {
  :root { --header-h: 38px; --strip-h: 44px; }
  header { top: 8px; }
  .brand-text small, .era { display: none; }
  .brand-text { font-size: 16px; }
  .detail-card { top: calc(8px + var(--header-h) + 8px); width: 250px; max-height: calc(100dvh - 8px - var(--header-h) - 8px - var(--strip-h) - 28px); padding: 10px 14px 12px; }
  .detail-card h2 { font-size: 22px; }
  #detail-hebrew { font-size: 15px; }
  #detail-description { font-size: 12.5px; line-height: 1.55; margin-top: 8px; }
  .detail-stat { margin-top: 10px; padding-top: 8px; }
  .detail-stat strong { font-size: 20px; }
  .detail-card:has(#detail-content[hidden]) { padding: 7px 12px 8px; }
  .detail-card:has(#detail-content[hidden]) h2 { font-size: 19px; }
  .vessel-closeups { top: calc(8px + var(--header-h) + 8px); padding: 6px; min-width: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 2px; }
  .vessel-closeups > span { grid-column: 1 / -1; margin: 2px 6px 4px; }
  .vessel-closeups button { min-height: 36px; padding: 6px 10px; font-size: 12.5px; }
  .orientation { display: none; }
  .bottom-area { bottom: 8px; }
  .viewpoints { padding: 3px; }
  .view { flex-direction: row; align-items: baseline; gap: 7px; min-width: 0; min-height: 38px; padding: 0 12px; }
  .view small { display: none; }
  .view > span { font-size: 13px; }
  .view strong { font-size: 12px; }
  .walk-primary, .tour-button, .listen-button, .display-button, .icon-button { min-height: var(--header-h); height: var(--header-h); font-size: 12.5px; }
  dialog { padding: 24px 24px 22px; }
  dialog h2 { font-size: 26px; margin: 10px 0 12px; }
}
@media (pointer: coarse) {
  .mouse-hint { display: none; }
  .landmark { min-height: 40px; padding: 0 12px 0 10px; }
}
@media (pointer: fine), (pointer: none) {
  .touch-hint { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
  .loader-line i { width: 100%; }
}
