/* === MOBILE STYLES — World at War ============================================
   Loaded after src/styles.css. Establishes a separate mobile layout with the
   m- prefix to avoid colliding with desktop classes. The Cesium globe + the
   Timeline component still use the shared rb-/cesium- styles.
*/

/* iOS safe-area / no zoom on input focus */
.mobile-body {
  font-size: 16px; /* prevent iOS auto-zoom on inputs */
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
  background: var(--stage);
}

.m-app {
  position: fixed;
  inset: 0;
  /* Use dvh so the layout follows the live visible viewport on iOS Safari
     (URL bar collapsing/expanding) instead of the static 100vh. */
  height: 100dvh;
  display: grid;
  grid-template-rows: 52px 1fr auto;
  grid-template-columns: minmax(0, 1fr);
  background: var(--paper);
  color: var(--ink);
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
  box-sizing: border-box;
  font-family: var(--sans);
  min-width: 0;
  overflow: hidden;
  /* Belt-and-braces against iOS Safari pinch-zoom propagation. The timeline
     track and globe re-enable the gestures they need with their own JS. */
  touch-action: pan-x pan-y;
}

/* === HEADER ================================================================= */
.m-header {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 40px auto;
  align-items: center;
  gap: 10px;
  padding: 0 10px;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
  z-index: 5;
  min-width: 0;
}
.m-icon-btn {
  appearance: none;
  width: 40px; height: 40px;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent;
  border: 0;
  color: var(--ink);
  border-radius: 8px;
  padding: 0;
  cursor: pointer;
}
.m-icon-btn:active { background: color-mix(in srgb, var(--ink) 10%, transparent); }

.m-brand {
  min-width: 0;
  overflow: hidden;
}
.m-brand-name {
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.012em;
  line-height: 1.05;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.m-brand-name .amp {
  color: var(--red);
  font-style: italic;
  font-weight: 400;
}

.m-lens-pill {
  appearance: none;
  display: inline-flex; align-items: center;
  gap: 6px;
  padding: 7px 11px;
  background: color-mix(in srgb, var(--paper) 80%, var(--ink) 4%);
  border: 1px solid var(--rule);
  border-radius: 999px;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  min-height: 36px;
}
.m-lens-pill:active {
  background: color-mix(in srgb, var(--paper) 60%, var(--ink) 8%);
}
.m-lens-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--red);
}
.m-lens-dot.myth { background: color-mix(in srgb, var(--red) 55%, gold 45%); }
.m-lens-dot.real { background: var(--red); }
.m-lens-label {
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* === STAGE (globe) ========================================================== */
.m-stage {
  position: relative;
  background: var(--stage);
  overflow: hidden;
  min-height: 0;
  touch-action: none;
}
.m-globe-wrap { position: absolute; inset: 0; }

.m-loading {
  position: absolute; inset: 0; z-index: 20;
  background: var(--stage);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 16px;
}
.m-loading-ring {
  width: 32px; height: 32px; border-radius: 50%;
  border: 1px solid var(--stage-rule-2);
  border-top-color: var(--paper);
  animation: spin 1.1s linear infinite;
}
.m-loading-label {
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 0.22em;
  color: var(--stage-ink-2);
  text-transform: uppercase;
}

/* Stat chip — top-left, tap to expand */
.m-statchip {
  appearance: none;
  position: absolute;
  top: 14px; left: 12px;
  z-index: 6;
  display: flex; flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 10px 14px 9px;
  background: rgba(13, 18, 25, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--stage-rule-2);
  border-radius: 12px;
  color: var(--stage-ink);
  cursor: pointer;
  text-align: left;
  max-width: calc(100vw - 24px);
  transition: padding 0.2s ease;
}
.m-statchip-year {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 22px;
  line-height: 1;
  letter-spacing: -0.02em;
  font-feature-settings: "lnum";
}
.m-statchip-year .era {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: 12px;
  margin-left: 4px;
  color: var(--stage-ink-2);
  letter-spacing: 0;
  vertical-align: 0.2em;
}
/* YearInput in dark stat chip — make caret/affordance visible on dark bg */
.m-statchip .yi-display {
  color: var(--stage-ink);
}
.m-statchip .yi-display:hover {
  background: rgba(255,255,255,0.10);
}
.m-statchip-year-input {
  color: var(--stage-ink);
  background: rgba(255,255,255,0.10);
  border-bottom-color: var(--stage-ink);
  min-width: 4ch;
  width: auto;
  max-width: 9ch;
  font-feature-settings: "lnum";
}
.m-statchip-year-input::placeholder {
  color: var(--stage-ink-3);
}
.m-statchip-meta {
  appearance: none;
  background: transparent;
  border: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px 4px 0;
  margin: -2px -6px -2px 0;
  font-family: var(--sans);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--stage-ink-2);
  cursor: pointer;
  border-radius: 4px;
}
.m-statchip-meta:active {
  background: rgba(255,255,255,0.10);
}
.m-statchip-meta .caret {
  color: var(--stage-ink-3);
  margin-left: 2px;
}
.m-statchip-meta .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--red);
}
.m-statchip-meta .dot.pulse { animation: pulse 1.8s ease-in-out infinite; }

.m-statchip.open {
  padding: 14px 16px 8px;
  width: calc(100vw - 24px);
  max-width: 360px;
}
.m-statchip-expand {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--stage-rule);
  width: 100%;
  display: flex; flex-direction: column;
  gap: 8px;
  cursor: default;
}
.m-sx-row {
  display: flex; align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.m-sx-k {
  font-family: var(--sans);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--stage-ink-3);
}
.m-sx-v {
  font-family: var(--serif);
  font-size: 14px;
  color: var(--stage-ink);
  font-feature-settings: "lnum";
}
.m-sx-list {
  margin-top: 6px;
  border-top: 1px solid var(--stage-rule);
  padding-top: 8px;
  max-height: 240px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.m-sx-listk {
  font-family: var(--sans);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--stage-ink-3);
  margin-bottom: 6px;
}
.m-sx-item {
  appearance: none;
  display: grid;
  grid-template-columns: 8px 1fr auto;
  gap: 8px;
  align-items: center;
  width: 100%;
  padding: 8px 4px;
  background: transparent;
  border: 0;
  color: var(--stage-ink);
  text-align: left;
  cursor: pointer;
  border-bottom: 1px solid var(--stage-rule);
}
.m-sx-item:last-child { border-bottom: none; }
.m-sx-item:active { background: color-mix(in srgb, var(--stage-ink) 8%, transparent); }
.m-sx-dot { width: 8px; height: 8px; border-radius: 50%; }
.m-sx-dot.active { background: var(--red); }
.m-sx-dot.ended  { background: var(--sage); }
.m-sx-name {
  font-family: var(--serif);
  font-size: 13.5px;
  color: var(--stage-ink);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.m-sx-region {
  font-family: var(--sans);
  font-size: 10px;
  color: var(--stage-ink-3);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}
.m-sx-more {
  font-family: var(--sans);
  font-size: 10px;
  color: var(--stage-ink-3);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding-top: 6px;
  text-align: center;
}

/* Rotate FAB — bottom-right */
.m-fab {
  appearance: none;
  position: absolute;
  bottom: 14px; right: 14px;
  z-index: 6;
  width: 48px; height: 48px;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(13, 18, 25, 0.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--stage-rule-2);
  border-radius: 50%;
  color: var(--stage-ink-2);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.m-fab.on { color: var(--paper); border-color: rgba(245, 241, 232, 0.5); }
.m-fab:active { transform: scale(0.94); }

/* === DOCK (timeline at bottom) ============================================= */
.m-dock {
  background: var(--paper);
  border-top: 1px solid var(--rule);
  padding: 10px 12px 12px;
  padding-bottom: calc(12px + env(safe-area-inset-bottom));
  z-index: 4;
}
/* The Timeline component renders these fragments; we constrain layout here. */
.m-dock-inner {
  display: flex; flex-direction: column;
  gap: 6px;
  width: 100%;
}
.m-dock-inner .rb-left {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 2px 2px;
  width: 100%;
}
.m-dock-inner .rb-left .rb-eyebrow {
  font-size: 9px;
  letter-spacing: 0.18em;
}
.m-dock-inner .rb-left .rb-zoom {
  font-size: 11.5px;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.m-dock-inner .rb-left .rb-hint { display: none; }
.m-dock-inner .rb-left .rb-pcontrols {
  margin-top: 0;
  gap: 8px;
  flex-shrink: 0;
}
.m-dock-inner .rb-step {
  width: 40px; height: 40px;
}
.m-dock-inner .rb-step svg { width: 18px; height: 18px; }

.m-dock-inner .rb-track-wrap {
  /* Taller track on mobile = far easier to land a finger and scrub */
  height: 76px;
  width: 100%;
  padding-right: 22px;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}
.m-dock-inner .rb-track {
  inset: 0 0 22px 0;
  /* Track is the entire hit area — bump the touch target so the thumb is
     easy to grab even when the user lands slightly above or below it. */
  touch-action: none;
}
.m-dock-inner .rb-density { gap: 0.6px; }
.m-dock-inner .rb-bar { flex: 1 1 0; }
.m-dock-inner .rb-tick {
  font-size: 9.5px;
}
.m-dock-inner .rb-ticks { height: 18px; }
/* Bigger thumb grip for fingers */
.m-dock-inner .rb-thumb-grip { width: 18px; height: 32px; }
.m-dock-inner .rb-thumb-line { width: 2px; }

/* Era buttons row */
.m-dock-inner .rb-eras {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  gap: 6px;
  justify-content: flex-start;
  align-items: center;
  padding: 2px 2px 4px;
  scrollbar-width: none;
}
.m-dock-inner .rb-eras::-webkit-scrollbar { display: none; }
.m-dock-inner .rb-era {
  flex: 0 0 auto;
  font-size: 11px;
  padding: 7px 12px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: transparent;
  min-height: 32px;
  white-space: nowrap;
}
.m-dock-inner .rb-era.now {
  color: var(--red);
  border-color: var(--red-soft);
  background: var(--red-soft);
}

/* === SHEETS ================================================================= */
.m-sheet-scrim {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.46);
  z-index: 50;
  animation: scrimIn 0.16s ease;
}
@keyframes scrimIn { from { opacity: 0 } to { opacity: 1 } }

.m-sheet {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 60;
  background: var(--paper);
  border-radius: 18px 18px 0 0;
  box-shadow: 0 -24px 60px rgba(0,0,0,0.45);
  /* dvh so the sheet top never disappears above a collapsing URL bar */
  max-height: 86dvh;
  display: flex; flex-direction: column;
  animation: sheetIn 0.26s cubic-bezier(0.32, 0.72, 0, 1);
  padding-bottom: env(safe-area-inset-bottom);
  color: var(--ink);
}
@keyframes sheetIn {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}
.m-sheet-handle-wrap {
  /* Generous tap target — easier to grab the dossier's collapse handle */
  padding: 12px 0 10px;
  display: flex; justify-content: center;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  flex-shrink: 0;
  position: relative;
}
.m-sheet-handle {
  width: 44px; height: 5px;
  background: var(--ink-3);
  opacity: 0.55;
  border-radius: 3px;
}
.m-sheet-head {
  display: flex; align-items: center;
  justify-content: space-between;
  padding: 4px 18px 14px;
  border-bottom: 1px solid var(--rule);
  flex-shrink: 0;
}
.m-sheet-title {
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.008em;
  color: var(--ink);
}
.m-sheet-close {
  appearance: none;
  width: 32px; height: 32px;
  background: transparent;
  border: 0;
  font-size: 16px;
  color: var(--ink-3);
  cursor: pointer;
  border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
}
.m-sheet-close:active { background: color-mix(in srgb, var(--ink) 10%, transparent); }
.m-sheet-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 8px 12px 24px;
}
.m-sheet-section {
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding: 14px 8px 6px;
}
.m-sheet-section:first-child { padding-top: 4px; }

/* --- Lens sheet rows --- */
.m-lens-row {
  appearance: none;
  display: grid;
  grid-template-columns: 14px 1fr 18px;
  gap: 12px;
  align-items: center;
  width: 100%;
  padding: 14px 12px;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--rule);
  text-align: left;
  cursor: pointer;
  color: var(--ink);
  min-height: 56px;
}
.m-lens-row:last-child { border-bottom: none; }
.m-lens-row:active { background: color-mix(in srgb, var(--ink) 6%, transparent); }
.m-lens-row.on { background: color-mix(in srgb, var(--red) 8%, transparent); }
.m-lens-row .m-lens-dot { width: 10px; height: 10px; }
.m-lens-row .m-lens-row-text {
  display: flex; flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.m-lens-row .nm {
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
}
.m-lens-row .sub {
  font-family: var(--sans);
  font-size: 12px;
  color: var(--ink-3);
  line-height: 1.35;
}
.m-lens-row svg {
  color: var(--red);
  justify-self: end;
}

/* --- Menu sheet --- */
.m-menu-search {
  appearance: none;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 14px;
  background: color-mix(in srgb, var(--paper) 60%, var(--ink) 5%);
  border: 1px solid var(--rule);
  border-radius: 12px;
  color: var(--ink-3);
  font-family: var(--sans);
  font-size: 14px;
  cursor: pointer;
  margin: 8px 4px 4px;
  text-align: left;
}
.m-menu-search:active { background: color-mix(in srgb, var(--paper) 40%, var(--ink) 10%); }
.m-menu-search svg { color: var(--ink-3); flex-shrink: 0; }

.m-menu-stats {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 4px;
  padding: 16px 8px 12px;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 4px;
}
.m-menu-stat .k {
  font-family: var(--sans);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 4px;
}
.m-menu-stat .v {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.m-menu-section {
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding: 14px 8px 8px;
}

.m-theme-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 0 4px 4px;
}
.m-theme-card {
  appearance: none;
  padding: 0;
  background: transparent;
  border: 1px solid var(--rule);
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  text-align: left;
}
.m-theme-card.on {
  border-color: var(--ink);
  box-shadow: 0 0 0 1px var(--ink);
}
.m-theme-preview {
  height: 52px;
  display: flex;
  align-items: stretch;
}
.m-theme-preview .pl, .m-theme-preview .pr {
  flex: 1;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--serif);
  font-style: italic;
  font-size: 16px;
  gap: 4px;
}
.m-theme-preview .dot {
  width: 4px; height: 4px; border-radius: 50%;
}
.m-theme-preview .arc {
  width: 18px; height: 1.5px;
}
.m-theme-name {
  padding: 7px 10px 8px;
  border-top: 1px solid var(--rule);
  display: flex; align-items: center;
  justify-content: space-between;
}
.m-theme-name .nm {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
}
.m-theme-name .sub {
  font-family: var(--sans);
  font-size: 9.5px;
  color: var(--ink-3);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.m-toggle-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 8px;
  font-family: var(--sans);
  font-size: 14px;
  color: var(--ink);
  border-bottom: 1px solid var(--rule);
  min-height: 48px;
}
.m-toggle-row:last-of-type { border-bottom: none; }
.m-toggle-row input[type="checkbox"] {
  width: 22px; height: 22px;
  accent-color: var(--red);
}

.m-menu-link {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 8px;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
  min-height: 48px;
}
.m-menu-link:last-child { border-bottom: none; }
.m-menu-link svg { color: var(--ink-3); }

.m-menu-credit {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 18px 8px 4px;
  margin-top: 12px;
  border-top: 1px solid var(--rule);
  text-decoration: none;
  color: var(--ink);
}
.m-menu-credit .k {
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.m-menu-credit .v {
  font-family: var(--serif);
  font-style: italic;
  font-size: 17px;
  color: var(--ink);
  letter-spacing: -0.005em;
}
.m-menu-credit:active .v { color: var(--accent); }

/* === DOSSIER SHEET ========================================================== */
.m-dossier {
  position: fixed;
  left: 0; right: 0;
  bottom: 0;
  z-index: 60;
  background: var(--paper);
  border-radius: 18px 18px 0 0;
  box-shadow: 0 -24px 60px rgba(0,0,0,0.5);
  /* dvh: tracks the live visible viewport on iOS so the collapse handle is
     never pushed above the URL bar. Capped so the handle clears safe-area. */
  height: 62dvh;
  max-height: calc(100dvh - 56px - env(safe-area-inset-top));
  display: flex; flex-direction: column;
  animation: sheetIn 0.28s cubic-bezier(0.32, 0.72, 0, 1);
  padding-bottom: env(safe-area-inset-bottom);
  transition: height 0.26s cubic-bezier(0.32, 0.72, 0, 1);
}
.m-dossier.full {
  height: calc(100dvh - 56px - env(safe-area-inset-top));
}
.m-dossier.dragging {
  transition: none;
}
.m-dossier-head {
  padding: 4px 18px 14px;
  border-bottom: 1px solid var(--rule);
  flex-shrink: 0;
}
.m-dossier-kicker {
  display: flex; align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.m-dossier-status {
  display: inline-flex; align-items: center;
  gap: 6px;
  font-family: var(--sans);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}
.m-dossier-status.active { color: var(--red); }
.m-dossier-status.ended  { color: var(--sage); }
.m-dossier-status .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: currentColor;
}
.m-dossier-status.active .dot { animation: pulse 1.8s ease-in-out infinite; }
.m-dossier-region {
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-left: auto;
  max-width: 50%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.m-dossier-close {
  appearance: none;
  width: 30px; height: 30px;
  background: transparent;
  border: 0;
  font-size: 15px;
  color: var(--ink-3);
  cursor: pointer;
  border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  margin-right: -6px;
}
.m-dossier-close:active { background: color-mix(in srgb, var(--ink) 10%, transparent); }
.m-dossier-name {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.013em;
  color: var(--ink);
  margin: 0;
  text-wrap: pretty;
}
.m-dossier-dates {
  font-family: var(--serif);
  font-style: italic;
  font-size: 13px;
  color: var(--ink-3);
  margin-top: 5px;
  font-feature-settings: "lnum";
}
.m-dossier-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 14px 18px 24px;
}
.m-dossier-summary {
  font-family: var(--serif);
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-2);
  margin: 0 0 16px;
  text-wrap: pretty;
}
.m-dossier-summary::first-letter {
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 600;
  float: left;
  line-height: 0.9;
  margin: 2px 6px 0 0;
  color: var(--ink);
}

.m-ds-fields {
  display: flex; flex-direction: column;
  gap: 14px;
}
.m-ds-row {
  display: flex; flex-direction: column;
  gap: 4px;
}
.m-ds-k {
  font-family: var(--sans);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.m-ds-v {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--ink);
  line-height: 1.45;
}
.m-ds-v.numeric {
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 500;
  font-feature-settings: "lnum";
}
.m-ds-v.serif {
  font-family: var(--serif);
  font-size: 13.5px;
  line-height: 1.55;
}
.m-ds-v.small { font-size: 12px; }
.m-ds-v.italic { font-style: italic; color: var(--ink-2); }
.m-ds-int {
  display: inline-flex; gap: 3px; align-items: center;
}
.m-ds-int .seg {
  width: 22px; height: 5px;
  background: var(--paper-3);
}
.m-ds-int .seg.on { background: var(--red); }
.m-ds-int.ended .seg.on { background: var(--sage); }
.m-ds-int .lbl {
  margin-left: 8px;
  font-family: var(--sans);
  font-size: 11px;
  color: var(--ink-3);
  letter-spacing: 0.04em;
}
.m-ds-parties {
  display: flex; flex-wrap: wrap; gap: 5px;
}
.m-ds-party {
  font-family: var(--sans);
  font-size: 11.5px;
  padding: 4px 9px;
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: 999px;
  color: var(--ink-2);
}
.m-ds-sub {
  display: flex; align-items: baseline;
  gap: 6px;
  margin-bottom: 3px;
}
.m-ds-subk {
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.m-ds-list {
  margin: 0;
  padding: 0 0 0 16px;
  font-family: var(--sans);
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--ink);
}
.m-ds-list li { margin-bottom: 4px; }
.m-ds-wiki {
  display: inline-flex; align-items: center;
  gap: 8px;
  margin-top: 14px;
  font-family: var(--sans);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--red);
  text-decoration: none;
  border-bottom: 1px solid currentColor;
  padding-bottom: 2px;
}

/* === SEARCH (full screen) =================================================== */
.m-search-full {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--paper);
  display: flex; flex-direction: column;
  padding-top: env(safe-area-inset-top);
}
.m-search-bar {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid var(--rule);
}
.m-search-input-wrap {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 12px;
  background: color-mix(in srgb, var(--paper) 60%, var(--ink) 5%);
  border: 1px solid var(--rule);
  border-radius: 10px;
  min-height: 40px;
}
.m-search-input-wrap svg { color: var(--ink-3); flex-shrink: 0; }
.m-search-input-wrap input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: 0;
  outline: 0;
  font-family: var(--sans);
  font-size: 16px;  /* prevent iOS zoom */
  color: var(--ink);
  -webkit-appearance: none;
}
.m-search-input-wrap input::placeholder {
  color: var(--ink-3);
  font-style: italic;
}
.m-clear {
  appearance: none;
  background: transparent;
  border: 0;
  color: var(--ink-3);
  font-size: 20px;
  line-height: 1;
  padding: 0 4px;
  cursor: pointer;
}
.m-search-results {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 6px 0 24px;
}
.m-search-hint {
  padding: 18px 18px;
  font-family: var(--serif);
  font-style: italic;
  font-size: 14px;
  color: var(--ink-3);
}
.m-search-row {
  appearance: none;
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 12px 18px;
  border-bottom: 1px solid var(--rule);
  cursor: pointer;
  min-height: 60px;
}
.m-search-row:active { background: color-mix(in srgb, var(--ink) 6%, transparent); }
.m-search-name {
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 4px;
  line-height: 1.25;
}
.m-search-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-family: var(--sans);
  font-size: 11px;
  color: var(--ink-3);
  letter-spacing: 0.04em;
}
.m-search-meta .years {
  font-family: var(--mono);
  color: var(--ink-2);
}
.m-search-meta .status {
  margin-left: auto;
  font-family: var(--sans);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 2px;
  border: 1px solid currentColor;
}
.m-search-meta .status.on { color: var(--red); }
.m-search-meta .status.off { color: var(--ink-3); }

/* === Hide desktop-only chrome ================================================ */
.mobile-body .masthead,
.mobile-body .rail,
.mobile-body .compass,
.mobile-body .globe-controls,
.mobile-body .ribbon,
.mobile-body .panel-toggle,
.mobile-body .theme-panel,
.mobile-body .tweaks,
.mobile-body .mh-burger,
.mobile-body .mobile-drawer {
  display: none !important;
}
/* Re-enable globe loading inside our stage */
.mobile-body .globe-loading { display: none; }

/* === Cesium widget overrides for mobile ===================================== */
.m-globe-wrap .cesium-widget,
.m-globe-wrap .cesium-widget canvas {
  width: 100% !important;
  height: 100% !important;
}
.cesium-widget-credits { display: none !important; }

/* === Extra small phones ===================================================== */
@media (max-width: 360px) {
  .m-brand-name { font-size: 15px; }
  .m-lens-label { max-width: 70px; }
  .m-statchip-year { font-size: 20px; }
}

/* === Landscape phones — keep dock thin ====================================== */
@media (max-height: 480px) and (orientation: landscape) {
  .m-app { grid-template-rows: 44px 1fr auto; }
  .m-dock { padding: 6px 12px 8px; }
  .m-dock-inner .rb-track-wrap { height: 44px; }
  .m-dock-inner .rb-eras { display: none !important; }
  .m-dossier { height: 80vh; }
}
