/* Raised High — shared styles for index.html and hajj.html */
  :root {
    --bg-deep: #050811;
    --bg-panel: rgba(11, 16, 29, 0.86);
    --bg-card: rgba(18, 25, 44, 0.66);
    --border-subtle: rgba(216, 180, 86, 0.18);
    --border-soft: rgba(244, 239, 230, 0.09);
    --gold: #d8b456;
    --gold-bright: #efd07b;
    --text-main: #f4efe6;
    --text-muted: #adb6c8;
    --text-dim: #8791a6;
    --c-fajr: #5b8def;
    --c-gap: #586c7e;
    --c-dhuhr: #e8c15a;
    --c-asr: #e08a44;
    --c-maghrib: #cc5c6e;
    --c-isha: #8468c4;
    --font-serif: 'Cormorant Garamond', Georgia, serif;
    --font-arabic: 'Amiri', serif;
    --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  }
  /* Per-script typography (web fonts for these are loaded on demand when the language is chosen) */
  html[lang="ar"], html[lang="ur"] {
    --font-sans: 'Noto Sans Arabic', 'Segoe UI', Tahoma, sans-serif;
    --font-serif: 'Amiri', 'Noto Naskh Arabic', serif;
  }
  html[lang="bn"] { --font-sans: 'Noto Sans Bengali', 'Nirmala UI', sans-serif; --font-serif: 'Noto Serif Bengali', 'Noto Sans Bengali', 'Nirmala UI', serif; }
  html[lang="hi"] { --font-sans: 'Noto Sans Devanagari', 'Nirmala UI', sans-serif; --font-serif: 'Noto Serif Devanagari', 'Noto Sans Devanagari', 'Nirmala UI', serif; }
  html[lang="zh"] {
    --font-sans: 'PingFang SC', 'Microsoft YaHei', 'Noto Sans SC', sans-serif;
    --font-serif: 'Songti SC', 'Noto Serif SC', 'SimSun', 'Microsoft YaHei', serif;
  }
  /* Scripts without letter case, or with joined letters, must not be tracked out or upper-cased */
  html.no-caps * { letter-spacing: 0 !important; text-transform: none !important; }
  html.no-caps body { line-height: 1.65; }

  * { box-sizing: border-box; margin: 0; padding: 0; }
  html, body {
    width: 100%; height: 100%;
    background: radial-gradient(ellipse at 35% 45%, #0c1428 0%, #060913 60%, #04060c 100%);
    color: var(--text-main); font-family: var(--font-sans);
    font-size: 14px; line-height: 1.5; overflow: hidden;
    -webkit-font-smoothing: antialiased;
  }
  button, select, input { font-family: inherit; }
  :focus-visible { outline: 2px solid var(--gold-bright); outline-offset: 2px; border-radius: 4px; }
  .app-shell { display: flex; flex-direction: column; width: 100%; height: 100%; height: 100dvh; }
  header.topbar {
    flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between;
    gap: 14px; padding: 10px 22px;
    background: linear-gradient(180deg, rgba(6,9,18,0.95) 0%, rgba(6,9,18,0.75) 100%);
    border-bottom: 1px solid var(--border-subtle); backdrop-filter: blur(12px); z-index: 30;
    position: relative;
  }
  .brand-block { display: flex; align-items: center; gap: 16px; min-width: 0; }
  .title-wrap h1 {
    font-family: var(--font-serif); font-weight: 600; font-size: 1.55rem;
    letter-spacing: 0.03em; color: var(--gold-bright); line-height: 1.15; white-space: nowrap;
  }
  .verse-inline {
    display: flex; align-items: baseline; gap: 4px 10px; flex-wrap: wrap; min-width: 0;
    border-inline-start: 1px solid var(--border-subtle); padding-inline-start: 14px;
  }
  .verse-ar { font-family: var(--font-arabic); font-size: 1.22rem; color: var(--text-main); direction: rtl; white-space: nowrap; }
  .verse-en { font-family: var(--font-serif); font-style: italic; font-size: 0.95rem; color: var(--text-muted); }
  html.no-caps .verse-en { font-style: normal; font-size: 0.85rem; }
  .mode-switch {
    display: inline-flex; flex: 0 0 auto; background: rgba(14, 20, 36, 0.9);
    border: 1px solid var(--border-subtle); border-radius: 999px; padding: 3px; gap: 2px;
  }
  .mode-btn {
    background: transparent; border: none; color: var(--text-muted);
    font-size: 0.84rem; font-weight: 500; letter-spacing: 0.03em; padding: 7px 16px;
    border-radius: 999px; cursor: pointer; transition: all 0.25s ease; white-space: nowrap;
  }
  .mode-btn:hover { color: var(--text-main); }
  .mode-btn.active {
    background: linear-gradient(135deg, rgba(216,180,86,0.28), rgba(216,180,86,0.12));
    color: var(--gold-bright); box-shadow: inset 0 0 0 1px rgba(216,180,86,0.45);
  }
  .nav-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
  .nav-menu { display: flex; align-items: center; gap: 8px; }
  .ghost-btn {
    background: rgba(255,255,255,0.03); border: 1px solid var(--border-soft); color: var(--text-muted);
    font-size: 0.78rem; padding: 7px 11px; border-radius: 6px;
    cursor: pointer; transition: all 0.2s ease; white-space: nowrap;
  }
  .ghost-btn:hover { border-color: var(--gold); color: var(--gold-bright); background: rgba(216,180,86,0.08); }
  a.ghost-btn { text-decoration: none; display: inline-block; }
  .menu-btn { display: none; font-size: 1rem; line-height: 1; padding: 6px 10px; }
  .lang-wrap {
    display: inline-flex; align-items: center; gap: 5px; color: var(--text-muted);
    background: rgba(255,255,255,0.03); border: 1px solid var(--border-soft); border-radius: 6px;
    padding-inline-start: 8px; transition: border-color 0.2s ease;
  }
  .lang-wrap:hover, .lang-wrap:focus-within { border-color: var(--gold); color: var(--gold-bright); }
  .lang-wrap svg { flex: 0 0 auto; }
  .lang-select {
    background: transparent; color: var(--text-main); border: none; outline: none; cursor: pointer;
    font-size: 0.8rem; padding: 7px 6px 7px 2px; max-width: 150px;
  }
  .lang-select option { background: #121a2e; color: var(--text-main); }

  .workspace { flex: 1 1 auto; display: flex; min-height: 0; position: relative; }
  .globe-stage { flex: 1 1 auto; position: relative; min-width: 0; overflow: hidden; display: flex; flex-direction: column; }
  .globe-view { flex: 1 1 auto; min-height: 0; position: relative; user-select: none; -webkit-user-select: none; }
  #globe-canvas-wrap { position: absolute; inset: 0; cursor: grab; touch-action: none; }
  #globe-canvas-wrap:active { cursor: grabbing; }

  .globe-legend {
    position: absolute; top: 14px; inset-inline-start: 16px; background: rgba(8, 12, 22, 0.8);
    border: 1px solid var(--border-soft); border-radius: 10px; padding: 9px 13px;
    backdrop-filter: blur(10px); max-width: 250px; z-index: 10;
  }
  .legend-toggle {
    display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%;
    background: none; border: none; cursor: pointer; text-align: start;
    font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.09em; color: var(--gold); font-weight: 600;
  }
  .legend-toggle .chev {
    width: 7px; height: 7px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
    transform: rotate(-135deg); margin-top: 3px; transition: transform 0.2s ease; flex: 0 0 auto;
  }
  .globe-legend.collapsed .legend-toggle .chev { transform: rotate(45deg); margin-top: -3px; }
  .legend-body { margin-top: 6px; }
  .globe-legend.collapsed .legend-body { display: none; }
  .legend-item { display: flex; align-items: center; gap: 8px; font-size: 0.76rem; color: var(--text-muted); margin: 4px 0; }
  .legend-item.sep { margin-top: 6px; padding-top: 5px; border-top: 1px solid var(--border-soft); }
  .legend-desc { font-size: 0.74rem; color: var(--text-muted); }
  .legend-scale { display: flex; justify-content: space-between; gap: 8px; font-size: 0.7rem; color: var(--text-dim); }
  .swatch { width: 10px; height: 10px; border-radius: 50%; flex: 0 0 10px; box-shadow: 0 0 6px currentColor; }
  .swatch.sm { width: 7px; height: 7px; flex-basis: 7px; }
  .swatch-line { width: 14px; height: 2px; border-radius: 2px; flex: 0 0 14px; background: linear-gradient(90deg,#fff,#efd07b); }
  .hist-scale-bar {
    height: 7px; border-radius: 4px; margin: 6px 0 4px;
    background: linear-gradient(90deg, rgba(216,180,86,0.08) 0%, rgba(216,180,86,0.48) 45%, #f6df96 100%);
    border: 1px solid rgba(216,180,86,0.28);
  }
  [dir="rtl"] .hist-scale-bar { transform: scaleX(-1); }

  .globe-hint {
    position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%); z-index: 9;
    background: rgba(8, 12, 22, 0.72); border: 1px solid var(--border-soft); border-radius: 999px;
    padding: 5px 14px; font-size: 0.74rem; color: var(--text-muted); pointer-events: none;
    max-width: calc(100% - 24px); text-align: center; transition: opacity 0.8s ease; backdrop-filter: blur(8px);
  }
  .globe-hint.gone { opacity: 0; }
  .adhan-box {
    position: absolute; top: 14px; inset-inline-end: 16px; z-index: 9; pointer-events: none;
    background: rgba(8, 12, 22, 0.8); border: 1px solid var(--border-soft); border-radius: 10px;
    padding: 8px 12px; backdrop-filter: blur(10px); max-width: 230px;
  }
  .adhan-box-title { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.09em; color: var(--gold); font-weight: 600; margin-bottom: 4px; }
  .adhan-box-row { display: flex; align-items: baseline; gap: 7px; font-size: 0.76rem; color: var(--text-main); margin-top: 3px; line-height: 1.35; }
  .adhan-box-row .swatch { align-self: center; }
  .adhan-box-row small { color: var(--text-muted); font-size: 0.7rem; white-space: nowrap; }
  .globe-fail {
    position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
    padding: 30px; text-align: center; color: var(--text-muted); font-size: 0.95rem; z-index: 8;
  }

  .globe-tooltip {
    position: absolute; pointer-events: none; background: rgba(7, 11, 20, 0.94);
    border: 1px solid rgba(216,180,86,0.45); border-radius: 8px; padding: 9px 12px;
    font-size: 0.78rem; color: var(--text-main); box-shadow: 0 8px 24px rgba(0,0,0,0.65);
    backdrop-filter: blur(8px); z-index: 25; display: none; width: max-content; max-width: 245px;
  }
  .tt-name { font-family: var(--font-serif); font-size: 1.05rem; font-weight: 600; color: var(--gold-bright); line-height: 1.2; }
  .tt-sub { color: var(--text-muted); font-size: 0.73rem; margin-bottom: 5px; }
  .tt-row { display: flex; justify-content: space-between; gap: 10px; font-size: 0.74rem; margin-top: 2px; }

  .time-dock {
    flex: 0 0 auto; margin: 0 16px 16px;
    background: rgba(8, 12, 23, 0.86); border: 1px solid var(--border-subtle);
    border-radius: 12px; padding: 12px 16px; backdrop-filter: blur(12px); z-index: 12;
  }
  .dock-top { display: flex; align-items: center; justify-content: space-between; gap: 8px 12px; margin-bottom: 10px; flex-wrap: wrap; }
  .dock-left { display: flex; align-items: center; gap: 8px 10px; flex-wrap: wrap; }
  .play-btn {
    display: inline-flex; align-items: center; gap: 6px;
    background: rgba(216,180,86,0.16); border: 1px solid rgba(216,180,86,0.45);
    color: var(--gold-bright); font-size: 0.78rem;
    font-weight: 500; padding: 6px 13px; border-radius: 999px; cursor: pointer; transition: all 0.2s ease;
  }
  .follow-wrap {
    display: inline-flex; align-items: center; gap: 4px; font-size: 0.76rem; color: var(--text-muted);
    background: rgba(255,255,255,0.03); border: 1px solid var(--border-soft); border-radius: 999px;
    padding-inline-start: 11px; transition: border-color 0.2s ease;
  }
  .follow-wrap:hover, .follow-wrap:focus-within { border-color: var(--gold); }
  .follow-select {
    background: transparent; color: var(--gold-bright); border: none; outline: none; cursor: pointer;
    font-size: 0.78rem; font-weight: 600; padding: 5px 6px 5px 2px; max-width: 170px;
  }
  .follow-select option { background: #121a2e; color: var(--text-main); font-weight: 400; }
  .play-btn:hover { background: rgba(216,180,86,0.28); }
  .play-btn .ico { font-size: 0.7rem; }
  .ms-nav { display: inline-flex; gap: 4px; direction: ltr; }
  .icon-btn {
    width: 28px; height: 28px; border-radius: 50%; background: rgba(255,255,255,0.03);
    border: 1px solid var(--border-soft); color: var(--text-muted); font-size: 1.05rem; line-height: 1;
    cursor: pointer; transition: all 0.2s ease;
  }
  .icon-btn:hover { border-color: var(--gold); color: var(--gold-bright); }
  .status-pill {
    font-size: 0.7rem; letter-spacing: 0.07em; text-transform: uppercase;
    padding: 3px 9px; border-radius: 999px; font-weight: 600; white-space: nowrap;
  }
  .status-pill.live { background: rgba(91,196,137,0.16); color: #7fe0a8; border: 1px solid rgba(91,196,137,0.38); }
  .status-pill.scrub { background: rgba(232,193,90,0.16); color: var(--gold-bright); border: 1px solid rgba(232,193,90,0.38); }
  .clock-readout { font-variant-numeric: tabular-nums; font-size: 0.83rem; color: var(--text-main); }
  .clock-readout span { color: var(--text-muted); font-size: 0.76rem; }

  input[type="range"].gold-slider {
    -webkit-appearance: none; appearance: none; width: 100%; height: 5px; display: block;
    background: rgba(255,255,255,0.12); border-radius: 4px; outline-offset: 6px; cursor: pointer;
  }
  input[type="range"].gold-slider::-webkit-slider-thumb {
    -webkit-appearance: none; appearance: none; width: 18px; height: 18px; border-radius: 50%;
    background: var(--gold-bright); border: 2px solid #090d18;
    box-shadow: 0 0 10px rgba(239,208,123,0.75); cursor: pointer;
  }
  input[type="range"].gold-slider::-moz-range-thumb {
    width: 18px; height: 18px; border-radius: 50%; background: var(--gold-bright);
    border: 2px solid #090d18; box-shadow: 0 0 10px rgba(239,208,123,0.75); cursor: pointer;
  }
  /* Timelines always run left-to-right (matching the growth chart), even in right-to-left languages */
  .time-dock input[type="range"], .milestone-track { direction: ltr; }

  .milestone-track { position: relative; height: 20px; margin-top: 6px; }
  .ms-dot {
    position: absolute; top: 0; width: 20px; height: 20px; margin-left: -10px; padding: 0;
    background: none; border: none; cursor: pointer;
  }
  .ms-dot::after {
    content: ''; position: absolute; top: 6px; left: 6px; width: 7px; height: 7px; border-radius: 50%;
    background: rgba(216,180,86,0.42); border: 1px solid rgba(216,180,86,0.85);
    transition: transform 0.18s ease, background 0.18s ease;
  }
  .ms-dot:hover::after, .ms-dot.active::after { transform: scale(1.65); background: var(--gold-bright); box-shadow: 0 0 8px var(--gold-bright); }
  .ms-dot.active { z-index: 2; }
  .milestone-caption {
    margin-top: 6px; padding-top: 7px; border-top: 1px solid var(--border-soft);
    font-size: 0.8rem; color: var(--text-muted); display: flex; gap: 8px; align-items: baseline; min-height: 3.3em;
  }
  .milestone-caption strong { color: var(--gold-bright); font-weight: 600; white-space: nowrap; }

  aside.side-panel {
    flex: 0 0 445px; width: 445px; background: var(--bg-panel);
    border-inline-start: 1px solid var(--border-subtle); backdrop-filter: blur(16px);
    overflow-y: auto; padding: 16px 18px 28px; z-index: 20; overscroll-behavior: contain;
  }
  aside.side-panel::-webkit-scrollbar { width: 6px; }
  aside.side-panel::-webkit-scrollbar-thumb { background: rgba(216,180,86,0.22); border-radius: 3px; }

  .panel-card { background: var(--bg-card); border: 1px solid var(--border-soft); border-radius: 11px; padding: 14px 15px; }
  .panel-card + .panel-card { margin-top: 12px; }
  .panel-card.highlight {
    border-color: rgba(216,180,86,0.34);
    background: linear-gradient(165deg, rgba(26,34,58,0.75) 0%, rgba(14,20,36,0.75) 100%);
  }
  .card-eyebrow {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    font-size: 0.71rem; text-transform: uppercase; letter-spacing: 0.09em;
    color: var(--gold); margin-bottom: 6px; font-weight: 600;
  }
  .est-badge {
    font-size: 0.66rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted);
    background: rgba(255,255,255,0.05); border: 1px solid var(--border-soft); padding: 1px 6px; border-radius: 4px;
    white-space: nowrap; flex: 0 0 auto;
  }
  .card-desc { font-size: 0.75rem; color: var(--text-muted); }
  .hero-number {
    font-family: var(--font-serif); font-size: 2.15rem; font-weight: 600;
    color: var(--text-main); line-height: 1.15; font-variant-numeric: tabular-nums;
  }
  .hero-number.sm { font-size: 1.85rem; }
  .hero-sub { font-size: 0.76rem; color: var(--text-muted); margin-top: 3px; font-variant-numeric: tabular-nums; }

  .per-sec-box { margin-top: 12px; padding-top: 11px; border-top: 1px solid var(--border-soft); }
  .per-sec-header { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 8px; }
  .per-sec-header > span:first-child { font-size: 0.78rem; color: var(--text-muted); }
  .per-sec-val { font-family: var(--font-serif); font-size: 1.35rem; font-weight: 600; color: var(--gold-bright); font-variant-numeric: tabular-nums; white-space: nowrap; }
  .source-bars { display: flex; flex-direction: column; gap: 6px; }
  .src-row { display: grid; grid-template-columns: minmax(110px, 0.9fr) 1fr 72px; align-items: center; gap: 8px; font-size: 0.75rem; }
  .src-label { color: var(--text-muted); }
  .src-bar-bg { height: 5px; background: rgba(255,255,255,0.07); border-radius: 3px; overflow: hidden; }
  .src-bar-fill { height: 100%; background: linear-gradient(90deg, var(--gold), var(--gold-bright)); border-radius: 3px; transition: width 0.25s ease; }
  [dir="rtl"] .src-bar-fill { background: linear-gradient(270deg, var(--gold), var(--gold-bright)); }
  .src-num { text-align: end; font-variant-numeric: tabular-nums; color: var(--text-main); font-size: 0.74rem; white-space: nowrap; }

  .inline-assumption { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border-soft); }
  .inline-assumption-top { display: flex; justify-content: space-between; gap: 4px 10px; flex-wrap: wrap; font-size: 0.76rem; color: var(--text-muted); margin-bottom: 9px; }
  .inline-assumption-top strong { color: var(--gold-bright); }
  .link-inline {
    background: none; border: none; color: var(--gold); font-size: 0.75rem;
    text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
  }
  .link-inline.xs { font-size: 0.7rem; }
  .link-inline:hover { color: var(--gold-bright); }

  .adhan-now-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; min-height: 28px; }
  .adhan-chip {
    display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px; border-radius: 999px;
    background: rgba(255,255,255,0.04); border: 1px solid var(--border-soft); font-size: 0.75rem; color: var(--text-main);
  }
  .adhan-chip small { color: var(--text-muted); font-size: 0.7rem; }

  .prayer-list { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
  .prayer-item { padding: 9px 11px; border-radius: 8px; background: rgba(255,255,255,0.025); border: 1px solid rgba(255,255,255,0.05); }
  .prayer-item-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
  .prayer-name-wrap { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 0.85rem; }
  .prayer-pop { font-variant-numeric: tabular-nums; font-size: 0.84rem; font-weight: 600; color: var(--text-main); text-align: end; }
  .prayer-pop span { font-weight: 400; color: var(--text-muted); font-size: 0.74rem; }
  .prayer-places { font-size: 0.74rem; color: var(--text-muted); margin-top: 4px; line-height: 1.45; }
  .world-sum-footer {
    margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--border-soft);
    display: flex; justify-content: space-between; gap: 10px; font-size: 0.75rem; color: var(--text-muted); font-variant-numeric: tabular-nums;
  }
  .world-sum-footer strong { color: var(--gold-bright); white-space: nowrap; }

  .stat-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 8px; }
  .mini-stat { background: rgba(255,255,255,0.025); border: 1px solid var(--border-soft); border-radius: 8px; padding: 9px 10px; }
  .mini-stat-label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); margin-bottom: 3px; }
  .mini-stat-val { font-family: var(--font-serif); font-size: 1.22rem; font-weight: 600; color: var(--gold-bright); line-height: 1.2; }
  .uncertainty-note {
    margin-top: 8px; font-size: 0.73rem; color: var(--text-muted);
    background: rgba(216,180,86,0.06); border-inline-start: 2px solid var(--gold); padding: 6px 9px; border-radius: 4px;
  }
  .card-divider { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border-soft); }
  .chart-wrap { margin-top: 10px; background: rgba(5,8,16,0.55); border: 1px solid var(--border-soft); border-radius: 8px; padding: 8px 8px 4px; }
  #cum-chart-svg { direction: ltr; display: block; }
  .chart-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 4px; font-size: 0.7rem; color: var(--text-muted); }
  .region-bars { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
  .reg-row { display: grid; grid-template-columns: minmax(120px, 1.1fr) 1fr minmax(78px, auto); align-items: center; gap: 8px; font-size: 0.75rem; }
  .reg-name { color: var(--text-main); }

  .drawer-backdrop {
    position: fixed; inset: 0; background: rgba(3,5,10,0.76); backdrop-filter: blur(6px);
    z-index: 100; display: none; align-items: center; justify-content: center; padding: 20px;
  }
  .drawer-backdrop.open { display: flex; }
  .drawer-modal {
    width: 100%; max-width: 690px; max-height: 88vh; max-height: 88dvh; background: #0b101e;
    border: 1px solid rgba(216,180,86,0.35); border-radius: 14px;
    box-shadow: 0 24px 64px rgba(0,0,0,0.85); display: flex; flex-direction: column; overflow: hidden;
  }
  .drawer-head {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 16px 22px; border-bottom: 1px solid var(--border-soft); background: rgba(15,22,40,0.7);
  }
  .drawer-head h2 { font-family: var(--font-serif); font-size: 1.45rem; font-weight: 600; color: var(--gold-bright); line-height: 1.25; }
  .close-btn {
    background: none; border: 1px solid var(--border-soft); color: var(--text-muted); flex: 0 0 auto;
    width: 34px; height: 34px; border-radius: 6px; cursor: pointer; font-size: 1.2rem; line-height: 1;
  }
  .close-btn:hover { color: var(--text-main); border-color: var(--gold); }
  .drawer-body { padding: 20px 22px; overflow-y: auto; color: var(--text-muted); font-size: 0.86rem; line-height: 1.65; overscroll-behavior: contain; }
  .drawer-body h3 { font-family: var(--font-serif); font-size: 1.18rem; color: var(--text-main); margin: 18px 0 6px; font-weight: 600; }
  .drawer-body h3:first-child { margin-top: 0; }
  .drawer-body p { margin-bottom: 10px; }
  .drawer-body ul { margin: 6px 0 12px; padding-inline-start: 18px; }
  .drawer-body li { margin-bottom: 6px; }
  .drawer-body strong { color: var(--text-main); }
  b.gold { color: var(--gold-bright); font-weight: 600; }
  .formula-box {
    background: rgba(255,255,255,0.03); border: 1px solid var(--border-subtle);
    border-radius: 8px; padding: 12px 14px; margin: 10px 0;
    font-variant-numeric: tabular-nums; color: var(--text-main); font-size: 0.83rem;
  }
  .formula-box hr { border: none; border-top: 1px solid rgba(255,255,255,0.1); margin: 8px 0; }
  .formula-box .muted { margin-top: 4px; color: var(--text-muted); }
  .setting-group { padding: 12px 0; border-bottom: 1px solid var(--border-soft); }
  .setting-group:last-of-type { border-bottom: none; }
  .setting-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 5px; color: var(--text-main); font-weight: 500; }
  .setting-val { color: var(--gold-bright); font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
  .setting-help { font-size: 0.77rem; color: var(--text-muted); margin-bottom: 10px; }
  .setting-actions { margin-top: 14px; display: flex; justify-content: flex-end; }
  select.dark-select {
    width: 100%; background: #121a2e; color: var(--text-main); border: 1px solid var(--border-subtle);
    padding: 8px 10px; border-radius: 6px; font-size: 0.84rem;
  }
  .welcome-modal { max-width: 560px; }
  .welcome-body { padding: 28px 30px 24px; font-size: 0.9rem; }
  .welcome-body h2 { font-family: var(--font-serif); font-size: 2.1rem; font-weight: 600; color: var(--gold-bright); text-align: center; line-height: 1.2; }
  .welcome-verse { display: flex; flex-direction: column; align-items: center; gap: 2px; margin: 8px 0 18px; text-align: center; }
  .welcome-verse .verse-ar { font-size: 1.7rem; }
  .welcome-body > p { color: var(--text-main); }
  .welcome-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 20px; }
  .welcome-begin { font-size: 0.95rem; padding: 10px 30px; }
  @media (max-width: 980px) {
    .welcome-body { padding: 20px 18px 18px; }
    .welcome-body h2 { font-size: 1.7rem; }
    .welcome-verse .verse-ar { font-size: 1.45rem; }
  }
  /* Guided tour: the spotlight's huge shadow dims everything except the control being explained */
  .tour { position: fixed; inset: 0; z-index: 110; display: none; }
  .tour.open { display: block; }
  .tour-spot {
    position: fixed; border-radius: 12px; border: 2px solid var(--gold-bright); pointer-events: none;
    box-shadow: 0 0 0 200vmax rgba(3,5,10,0.76), 0 0 22px rgba(239,208,123,0.4);
    transition: left 0.25s ease, top 0.25s ease, width 0.25s ease, height 0.25s ease;
  }
  .tour-card {
    position: fixed; width: min(340px, calc(100vw - 24px)); background: #0b101e;
    border: 1px solid rgba(216,180,86,0.45); border-radius: 12px; padding: 14px 16px 12px;
    box-shadow: 0 16px 40px rgba(0,0,0,0.8); font-size: 0.88rem; line-height: 1.6; color: var(--text-main);
    transition: left 0.25s ease, top 0.25s ease;
  }
  .tour-card strong { display: block; font-family: var(--font-serif); font-size: 1.2rem; font-weight: 600; color: var(--gold-bright); line-height: 1.3; margin-bottom: 3px; }
  .tour-foot { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
  .tour-count { font-size: 0.74rem; color: var(--text-dim); font-variant-numeric: tabular-nums; margin-inline-end: auto; }
  .tour-foot .play-btn, .tour-foot .ghost-btn { padding: 7px 16px; }
  @media (prefers-reduced-motion: reduce) { .tour-spot, .tour-card { transition: none; } }
  /* "?" button that replays the tour on the story pages (added by tour.js) */
  .tour-help { min-width: 34px; padding-inline: 10px; font-weight: 600; }
  body[class*="video"] .tour, body[class*="video"] .tour-help { display: none !important; }
  @media (max-width: 480px) {
    /* make room for the extra button in a phone's top bar */
    .tour-help { min-width: 30px; padding: 8px; }
    .nav-actions:has(.tour-help) .lang-select { max-width: 78px; }
    /* a long title (some languages) wraps onto two lines instead of pushing the buttons off screen */
    header.topbar:has(.tour-help) .title-wrap { min-width: 0; }
    header.topbar:has(.tour-help) .title-wrap h1 { white-space: normal; line-height: 1.1; }
  }
  .credit { margin: 16px 0 0; font-size: 0.75rem; color: var(--text-dim); text-align: center; }
  .welcome-body > p.credit { color: var(--text-dim); }
  .credit a { color: var(--gold); text-decoration: underline; text-underline-offset: 3px; }
  .credit a:hover { color: var(--gold-bright); }
  .consent-bar {
    position: fixed; z-index: 90; bottom: 18px; left: 50%; transform: translateX(-50%);
    width: min(560px, calc(100% - 24px)); background: #0b101e; border: 1px solid rgba(216,180,86,0.4);
    border-radius: 12px; padding: 14px 16px; box-shadow: 0 16px 40px rgba(0,0,0,0.7);
    display: flex; align-items: center; gap: 10px 16px; flex-wrap: wrap;
  }
  .consent-bar p { flex: 1 1 260px; font-size: 0.8rem; color: var(--text-muted); line-height: 1.5; }
  .consent-actions { display: flex; gap: 8px; margin-inline-start: auto; }
  .consent-actions .play-btn { padding: 7px 18px; }
  .expand-btn {
    display: none; position: absolute; bottom: 10px; inset-inline-end: 10px; z-index: 11;
    width: 40px; height: 40px; border-radius: 10px; align-items: center; justify-content: center;
    background: rgba(8, 12, 22, 0.82); border: 1px solid var(--border-subtle); color: var(--gold-bright);
    backdrop-filter: blur(8px); cursor: pointer; transition: border-color 0.2s ease, background 0.2s ease;
  }
  .expand-btn:hover { border-color: var(--gold); background: rgba(216,180,86,0.12); }
  .expand-btn svg { width: 19px; height: 19px; }
  .expand-btn .ico-collapse { display: none; }
  .globe-full .expand-btn .ico-expand { display: none; }
  .globe-full .expand-btn .ico-collapse { display: block; }
  /* Full-screen globe: the stage (globe, legend and time dock) lifts out over the whole viewport */
  .globe-stage.globe-full {
    position: fixed !important; inset: 0; z-index: 80;
    height: 100% !important; height: 100dvh !important; min-height: 0 !important;
    background: radial-gradient(ellipse at 50% 40%, #0c1428 0%, #060913 60%, #04060c 100%);
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  }
  .globe-full .globe-hint { display: none; }
  .hidden { display: none !important; }

  /* Medium widths: fold the three info buttons into a menu so the top bar never overflows */
  @media (max-width: 1700px) {
    .menu-btn { display: inline-block; }
    .nav-menu {
      display: none; position: absolute; top: calc(100% + 6px); inset-inline-end: 12px; z-index: 40;
      flex-direction: column; align-items: stretch; gap: 4px; padding: 8px; min-width: 210px;
      background: #0b101e; border: 1px solid rgba(216,180,86,0.35); border-radius: 10px;
      box-shadow: 0 16px 40px rgba(0,0,0,0.7);
    }
    .nav-menu.open { display: flex; }
    .nav-menu .ghost-btn { text-align: start; border-color: transparent; font-size: 0.86rem; padding: 9px 12px; white-space: normal; }
  }

  /* Phones and narrow tablets: globe stays pinned on top, the panel scrolls underneath it */
  @media (max-width: 980px) {
    header.topbar {
      display: grid; grid-template-columns: 1fr auto; align-items: center;
      grid-template-areas: "title actions" "verse verse" "mode mode";
      gap: 6px 10px; padding: 8px 12px;
    }
    .brand-block { display: contents; }
    .title-wrap { grid-area: title; }
    .title-wrap h1 { font-size: 1.35rem; }
    .verse-inline { grid-area: verse; border: none; padding: 0; justify-content: center; text-align: center; }
    .verse-ar { font-size: 1.1rem; }
    .verse-en { font-size: 0.84rem; }
    .mode-switch { grid-area: mode; display: flex; }
    .mode-btn { flex: 1 1 0; padding: 7px 8px; }
    .nav-actions { grid-area: actions; }
    .lang-select { max-width: 110px; }
    .workspace { flex-direction: column; }
    .globe-stage { flex: 0 0 auto; height: 48dvh; min-height: 300px; }
    aside.side-panel { flex: 1 1 auto; width: 100%; min-height: 0; border-inline-start: none; border-top: 1px solid var(--border-subtle); padding: 12px 12px 24px; }
    .globe-legend { top: 8px; inset-inline-start: 8px; padding: 7px 10px; max-width: 210px; }
    .time-dock { margin: 0 8px 8px; padding: 9px 12px; }
    .dock-top { margin-bottom: 8px; }
    .dock-note { display: none; }
    .milestone-caption { font-size: 0.76rem; min-height: 4.6em; }
    .globe-hint { font-size: 0.7rem; bottom: 8px; max-width: calc(100% - 120px); }
    .expand-btn { display: inline-flex; }
    .adhan-box { top: 8px; inset-inline-end: 8px; padding: 6px 9px; max-width: 150px; }
    .adhan-box-row { font-size: 0.7rem; }
    .drawer-backdrop { padding: 10px; }
    .drawer-head { padding: 12px 16px; }
    .drawer-head h2 { font-size: 1.2rem; }
    .drawer-body { padding: 14px 16px; }
  }
  @media (max-width: 980px) and (max-height: 620px) {
    .globe-stage { height: 56dvh; min-height: 230px; }
    .verse-inline { display: none; }
  }

  /* ===== Site menu shared by every page (filled in by nav.js) ===== */
  .site-nav { display: inline-flex; }
  .site-nav-btn { display: inline-flex; align-items: center; gap: 7px; }
  .site-nav-btn[aria-expanded="true"] { border-color: var(--gold); color: var(--gold-bright); }
  .site-menu {
    display: none; position: absolute; top: calc(100% + 6px); inset-inline-end: 12px; z-index: 45;
    width: min(320px, calc(100vw - 24px)); max-height: calc(100dvh - 90px); overflow-y: auto; padding: 10px;
    background: var(--bg-deep); border: 1px solid var(--border-subtle); border-radius: 10px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.7); text-align: start;
  }
  .site-menu.open { display: block; }
  .site-group + .site-group { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border-soft); }
  .site-group-name { font-size: 0.68rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-dim); padding: 2px 10px 4px; }
  .site-link { display: block; padding: 7px 10px; border-radius: 7px; text-decoration: none; border-inline-start: 2px solid transparent; }
  .site-link:hover, .site-link:focus-visible { background: rgba(255, 255, 255, 0.05); }
  .site-link-name { display: block; font-family: var(--font-serif); font-size: 1.08rem; font-weight: 600; color: var(--text-main); line-height: 1.25; }
  .site-link-desc { display: block; font-size: 0.74rem; color: var(--text-muted); line-height: 1.4; }
  .site-link.current { border-inline-start-color: var(--gold); background: rgba(255, 255, 255, 0.04); }
  .site-link.current .site-link-name { color: var(--gold-bright); }
  .site-more .site-group:first-of-type { margin-top: 6px; }
  .site-more .site-group-name, .site-more .site-link { padding-inline: 8px; }
  body[class*="video"] .site-more, body[class*="video"] .site-menu { display: none !important; }
  @media (max-width: 980px) {
    .site-nav-label { display: none; }
    .site-nav-btn { padding: 8px 9px; }
  }
