:root {
  --bg-navy:      #0E1621;
  --bg-navy-2:    #131c2a;
  --bg-navy-3:    #1a2434;
  --gold:         #c9a961;
  --gold-soft:    #d4a96a;
  --gold-dim:     rgba(212,175,55,0.55);
  --gold-faint:   rgba(212,175,55,0.18);
  --text:         #E8EAEF;
  --text-dim:     #9aa3b2;
  --text-faint:   #6b7384;
  --border:       rgba(212,175,55,0.22);
  --serif:        'Playfair Display', 'Cinzel', Georgia, serif;
  --display:      'Cinzel', Georgia, serif;
  --sans:         'Source Sans 3', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { font-size: 18px; }

html, body {
  margin: 0;
  padding: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: var(--bg-navy);
  color: var(--text);
  font-family: var(--sans);
}

button { font-family: inherit; cursor: pointer; }

/* ============ ENTRY DOOR ============ */
.entry-door {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100vh;
  margin: 0;
  padding: 0;
  background: radial-gradient(ellipse at center, var(--bg-navy-2) 0%, var(--bg-navy) 70%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.entry-inner {
  text-align: center;
  max-width: 640px;
  padding: 0 32px;
}

.entry-logo {
  display: block;
  width: 280px;
  height: auto;
  margin: 0 auto 22px;
  filter: drop-shadow(0 0 16px rgba(212,175,55,0.30));
}

.entry-stats{
  text-align:center;
  margin:18px 0 4px;
  font-family:'Source Sans 3', sans-serif;
  color:#9aa3b2;
  font-style:normal;
}
.entry-stats-l1, .entry-stats-l2{
  font-family:'Source Sans 3', sans-serif !important;
  font-style:normal !important;
  font-weight:400;
  font-size:0.95rem;
  line-height:1.4;
  letter-spacing:.3px;
  color:#9aa3b2;
}
.entry-stats-one{
  color:#c9a961;
  font-style:normal !important;
  font-weight:400;
}

.entry-tagline{
  font-family:'Playfair Display', serif;
  font-style:normal !important;
  font-weight:700;
  font-size:1.6rem;
  color:#c9a961;
  text-align:center;
  margin:18px 0 12px;
  letter-spacing:.5px;
  line-height:1.3;
}

.entry-disclosure{
  font-family:'Source Sans 3', sans-serif;
  font-style:normal;
  font-weight:400;
  font-size:0.95rem;
  color:#9aa3b2;
  text-align:center;
  margin:0 0 28px;
  letter-spacing:.3px;
  line-height:1.4;
}

.entry-buttons {
  display: flex;
  gap: 16px;
  justify-content: center;
}

.btn {
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 700;
  font-style: normal;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 14px 32px;
  color: #c9a961;
  border: 2px solid #c9a961;
  border-color: #c9a961;
  border-radius: 4px;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}

.btn-primary {
  background: var(--bg-navy);
  color: #c9a961;
  border-color: #c9a961;
  box-shadow: 0 0 0 1px rgba(212,175,55,0.25) inset;
}
.btn-primary:hover {
  background: var(--gold-faint);
  color: #c9a961;
  box-shadow: 0 0 14px rgba(212,175,55,0.35);
}

.btn-secondary {
  background: transparent;
  color: var(--gold);
  border-color: var(--gold-dim);
}
.btn-secondary:hover {
  background: var(--gold-faint);
  border-color: var(--gold);
}

/* ============ APP SHELL ============ */
.app-shell {
  display: flex;
  flex-direction: column;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

/* --- ZONE A --- */
.zone-a {
  flex-shrink: 0;
  height: 96px;
  display: flex;
  flex-direction: column;
  background: var(--bg-navy-2);
  border-bottom: 1px solid var(--border);
}

.zone-a-row1 {
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
}

.flag-btn {
  background: none;
  border: none;
  padding: 0;
  display: flex;
  align-items: center;
  cursor: pointer;
}

.za-logo {
  display: block;
  height: 28px;
  width: auto;
}

.row1-right {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-wrap { position: relative; display: flex; align-items: center; }
.user-pill {
  font-size: 13.5px;
  letter-spacing: 0.05em;
  color: #7B9DC4;
  background: none;
  border: 1px solid #7B9DC4;
  padding: 3px 12px;
  border-radius: 12px;
  text-transform: uppercase;
  cursor: pointer;
  font-family: var(--sans);
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.user-pill:hover { border-color: #A8BCD9; color: #A8BCD9; background: rgba(123,157,196,0.10); }
.user-dropdown { top: 30px; right: 0; left: auto; min-width: 140px; }

.tools-wrap { position: relative; display: flex; align-items: center; }
.tools-btn {
  background: none;
  border: 1px solid #7B9DC4;
  color: #7B9DC4;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 12px;
  height: 24px;
  border-radius: 12px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.tools-btn:hover { border-color: #A8BCD9; color: #A8BCD9; background: rgba(123,157,196,0.10); }

.tools-dropdown {
  top: 30px;
  right: 0;
  left: auto;
  min-width: 200px;
}

.menu-btn {
  background: none;
  border: 1px solid transparent;
  color: var(--gold);
  font-size: 22px;
  line-height: 1;
  width: 30px;
  height: 28px;
  border-radius: 3px;
  padding: 0;
}
.menu-btn:hover { border-color: var(--gold-dim); }

.menu-dropdown {
  position: absolute;
  top: 36px;
  right: 0;
  background: var(--bg-navy-3);
  border: 1px solid var(--border);
  border-radius: 4px;
  min-width: 220px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.5);
  z-index: 50;
  padding: 5px 0;
}

.menu-item {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  color: var(--text);
  padding: 10px 18px;
  font-size: 15px;
}
.menu-item:hover { background: var(--gold-faint); }
.menu-item.locked { color: var(--text-faint); }

/* Browse mode default: both rows visible, full color, no arrows. */
body[data-tab-mode="browse"] .zone-a { height: auto; }
body[data-tab-mode="browse"] .zone-a-row2,
body[data-tab-mode="browse"] .zone-a-row3 {
  display: flex !important;
  justify-content: center;
  height: 48px;
  padding: 4px 0;
}
body[data-tab-mode="browse"] .tab-arrow { display: none; }
body[data-tab-mode="browse"] .tab-viewport { overflow: visible; }
body[data-tab-mode="browse"] .tab-row {
  transform: none !important;
  margin: 0 auto;
}
body[data-tab-mode="browse"] .tab-btn {
  opacity: 1 !important;
  transform: none !important;
  background: color-mix(in srgb, var(--tab-accent) 28%, transparent);
  border: 1px solid color-mix(in srgb, var(--tab-accent) 60%, transparent);
  color: color-mix(in srgb, var(--tab-accent) 80%, white 20%);
  filter: none !important;
}
body[data-tab-mode="browse"] .tab-btn:hover {
  background: color-mix(in srgb, var(--tab-accent) 42%, transparent);
  color: #fff;
}

/* Focused mode: single row, centered active, others greyscale. */
body[data-tab-mode="focused"] .zone-a-row3 { display: none !important; }
body[data-tab-mode="focused"] .tab-btn {
  opacity: 1;
  transform: scale(0.95);
  filter: grayscale(1) brightness(0.9);
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.18);
  color: #aab1bb;
}
body[data-tab-mode="focused"] .tab-btn:hover {
  filter: grayscale(0.5) brightness(1);
  background: rgba(255,255,255,0.08);
  color: #d8dde5;
}
body[data-tab-mode="focused"] .tab-btn.active {
  filter: none !important;
  opacity: 1 !important;
  transform: scale(1) !important;
  padding: 8px 32px;
  font-size: 15px;
  letter-spacing: 0.18em;
  background: color-mix(in srgb, var(--tab-accent) 45%, transparent);
  border: 1px solid var(--tab-accent);
  color: #ffffff;
  box-shadow: 0 0 0 1px var(--tab-accent), 0 -2px 12px color-mix(in srgb, var(--tab-accent) 35%, transparent);
}
body[data-tab-mode="focused"] .tab-arrow-prev { left: 28px; }
body[data-tab-mode="focused"] .tab-arrow-next { right: 28px; }

/* Viewport that clips the sliding tab row. Arrows are absolutely
   positioned over its edges and don't consume horizontal space. */
.tab-viewport {
  position: relative;
  height: 48px;
  overflow: hidden;
}

.tab-row {
  height: 48px;
  display: flex;
  align-items: stretch;
  gap: 4px;
  padding: 4px 0;
  white-space: nowrap;
  width: max-content;
  transition: transform 0.3s ease;
  will-change: transform;
}

/* Side arrows — prev/next. */
.tab-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 32px; height: 32px;
  border-radius: 50%;
  background: rgba(14,20,32,0.85);
  border: 1px solid rgba(212,175,55,0.45);
  color: #c9a961;
  font-size: 14px;
  cursor: pointer;
  z-index: 5;
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.15s, color 0.15s, border-color 0.15s, background 0.15s;
}
.tab-arrow:hover {
  color: #d4af37;
  border-color: #d4af37;
  background: rgba(212,175,55,0.15);
}
.tab-arrow:disabled {
  opacity: 0.35;
  cursor: default;
  pointer-events: none;
}
.tab-arrow-prev { left: 6px; }
.tab-arrow-next { right: 6px; }

.tab-btn {
  --tab-accent: #c9a961;
  background: color-mix(in srgb, var(--tab-accent) 18%, transparent);
  border: 1px solid color-mix(in srgb, var(--tab-accent) 35%, transparent);
  border-bottom: none;
  color: color-mix(in srgb, var(--tab-accent) 65%, white 35%);
  font-family: var(--display);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.13em;
  padding: 8px 16px;
  margin: 0;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px 4px 0 0;
  position: relative;
  cursor: pointer;
  white-space: nowrap;
  transform-origin: center bottom;
  /* Inactive baseline — heavily dimmed and slightly smaller. */
  opacity: 0.25;
  transform: scale(0.85);
  transition: opacity 0.2s ease, transform 0.2s ease,
              background 0.15s ease, border-color 0.15s ease,
              color 0.15s ease, box-shadow 0.15s ease;
}
.tab-btn:hover {
  background: color-mix(in srgb, var(--tab-accent) 30%, transparent);
  border-color: color-mix(in srgb, var(--tab-accent) 55%, transparent);
  color: color-mix(in srgb, var(--tab-accent) 50%, white 50%);
  opacity: 0.6;
  transform: scale(0.92);
}
.tab-btn.active {
  background: color-mix(in srgb, var(--tab-accent) 42%, transparent);
  border-color: var(--tab-accent);
  color: #ffffff;
  box-shadow: 0 0 0 1px var(--tab-accent), 0 -2px 8px color-mix(in srgb, var(--tab-accent) 30%, transparent);
  opacity: 1;
  transform: scale(1);
}

/* Per-tab accent colors — sober palette grouped by category. Matches
   uppercase data-tab values set by shell.js makeTab(). */
.tab-btn[data-tab="TIMELINE"]  { --tab-accent: #C9A961; } /* gold (warm gold) */
.tab-btn[data-tab="ERAS"]      { --tab-accent: #C8975A; } /* amber */
.tab-btn[data-tab="EVENTS"]    { --tab-accent: #B8825F; } /* bronze */
.tab-btn[data-tab="BOOKS"]     { --tab-accent: #C09060; } /* copper */
.tab-btn[data-tab="SILSILA"]   { --tab-accent: #6B8CAE; } /* slate blue */
.tab-btn[data-tab="THINK"]     { --tab-accent: #7B9DC4; } /* steel blue */
.tab-btn[data-tab="MAP"]       { --tab-accent: #5F95A8; } /* teal blue */
.tab-btn[data-tab="ONE"]       { --tab-accent: #C28968; } /* terracotta */
.tab-btn[data-tab="FOLLOW"]    { --tab-accent: #B07A60; } /* clay */
.tab-btn[data-tab="TALK"]      { --tab-accent: #B8807F; } /* dusty rose */
.tab-btn[data-tab="START"]     { --tab-accent: #88A878; } /* sage green */
.tab-btn[data-tab="EXPLAIN"]   { --tab-accent: #8AA570; } /* moss */
.tab-btn[data-tab="MONASTIC"]  { --tab-accent: #8E7FA8; } /* dusty violet */
.tab-btn[data-tab="STUDY"]     { --tab-accent: #95A06F; } /* olive */

/* --- ZONE B (2-row container) --- */
.zone-b {
  flex-shrink: 0;
  flex-grow: 0;
  background: var(--bg-navy-3);
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  color: var(--text-dim);
  font-size: 14px;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.zb-row1, .zb-row2 {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--gold-dim) transparent;
}
.zb-row1::-webkit-scrollbar, .zb-row2::-webkit-scrollbar { height: 4px; }
.zb-row1::-webkit-scrollbar-thumb, .zb-row2::-webkit-scrollbar-thumb { background: var(--gold-dim); border-radius: 2px; }
.zb-row1::-webkit-scrollbar-track, .zb-row2::-webkit-scrollbar-track { background: transparent; }

.zb-row1 {
  height: 52px;
  min-height: 52px;
  max-height: 52px;
}
.zb-row2 {
  height: 44px;
  min-height: 44px;
  max-height: 44px;
  background: var(--bg-navy-2);
  border-top: 1px solid var(--border);
}
.zb-row2.is-empty { display: none; }

.zb-row1 > *, .zb-row2 > * { flex-shrink: 0; }

/* --- ZONE B CHILD CONTROLS --- */
.zb-pill,
.zb-select,
.zb-search,
.zb-slider,
.zb-icon-btn {
  height: 32px;
  display: inline-flex;
  align-items: center;
  background: var(--bg-navy);
  border: 1px solid var(--border);
  border-radius: 16px;
  color: var(--text);
  font-family: var(--sans);
  font-size: 13px;
  letter-spacing: 0.04em;
  padding: 0 14px;
  transition: border-color 0.15s, background 0.15s, color 0.15s, box-shadow 0.15s;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.zb-pill:hover,
.zb-select:hover,
.zb-search:hover,
.zb-slider:hover,
.zb-icon-btn:hover {
  border-color: var(--gold);
  color: var(--gold-soft);
}

.zb-pill.zb-active,
.zb-select.zb-active,
.zb-search.zb-active,
.zb-slider.zb-active,
.zb-icon-btn.zb-active {
  border-color: var(--gold);
  color: var(--gold);
  box-shadow: 0 0 0 1px var(--gold-dim) inset, 0 0 8px rgba(212,175,55,0.25);
  background: rgba(212,175,55,0.08);
}

.zb-pill { text-transform: uppercase; font-weight: 600; letter-spacing: 0.08em; font-size: 13px; }

.zb-select {
  padding-right: 30px;
  position: relative;
}
.zb-select::after {
  content: '';
  position: absolute;
  right: 12px;
  top: 50%;
  width: 7px;
  height: 7px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-70%) rotate(45deg);
  opacity: 0.7;
}

.zb-search {
  padding: 0 14px 0 34px;
  position: relative;
  width: 100%;
  background-image: none;
}
.zb-search::before {
  content: '';
  position: absolute;
  left: 12px;
  top: 50%;
  width: 12px;
  height: 12px;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  transform: translateY(-50%) translateY(-1px);
  opacity: 0.7;
}
.zb-search::after {
  content: '';
  position: absolute;
  left: 22px;
  top: 50%;
  width: 6px;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(2px) rotate(45deg);
  opacity: 0.7;
}
.zb-search-input {
  background: transparent;
  border: none;
  outline: none;
  color: inherit;
  font: inherit;
  width: 100%;
  height: 100%;
  padding: 0;
}
.zb-search-input::placeholder { color: var(--text-faint); }

.zb-slider { gap: 10px; padding: 0 16px; }
.zb-slider .zb-slider-label { font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-dim); }
.zb-slider input[type=range] { width: 100px; accent-color: var(--gold); }

.zb-icon-btn {
  width: 32px;
  padding: 0;
  justify-content: center;
  font-size: 14px;
  border-radius: 50%;
}

.zb-divider {
  flex-shrink: 0;
  width: 1px;
  height: 24px;
  background: var(--gold-dim);
  opacity: 0.5;
}

.zb-spacer { flex: 1 1 auto; min-width: 8px; }

/* --- ZONE B FIXED SLOTS (positional anchors) --- */
.zb-slot-search {
  flex-shrink: 0;
  flex-grow: 0;
  width: 240px;
  height: 32px;
  display: flex;
  align-items: center;
}
.zb-slot-search > .zb-search { width: 100%; }

.zb-slot-slider {
  flex-shrink: 1;
  flex-grow: 1;
  flex-basis: 560px;
  height: 32px;
  display: flex;
  align-items: center;
}
.zb-slot-slider > #hdrYearControls { width: 100%; }
.zb-row1 > .zb-slot-spacer { flex: 0 0 8px; min-width: 8px; }

.zb-slot-saved {
  flex-shrink: 0;
  flex-grow: 0;
  min-width: 88px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}
.zb-slot-saved:empty { width: 88px; }

.zb-slot-htw {
  flex-shrink: 0;
  flex-grow: 0;
}

.zb-slot-spacer { flex: 1 1 auto; min-width: 8px; }

.zb-row2 { position: relative; }
.zb-row1 { position: relative; }
.zb-slot-hint {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-family: 'Cinzel', serif;
  font-size: 13px;
  letter-spacing: 0.08em;
  color: var(--text-muted, #A0AEC0);
  white-space: nowrap;
  pointer-events: none;
}

/* --- ZONE C --- */
.zone-c {
  flex: 1;
  overflow-y: auto;
  background: var(--bg-navy);
  padding: 0;
}

.view-placeholder {
  margin: 28px auto;
  max-width: 820px;
  border: 2px dotted var(--border);
  border-radius: 6px;
  padding: 80px 56px;
  text-align: center;
  background: var(--bg-navy-2);
}

.placeholder-name {
  font-family: var(--display);
  font-size: 46px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--gold);
  margin-bottom: 18px;
}

.placeholder-sub {
  color: var(--text-dim);
  font-size: 16px;
  letter-spacing: 0.05em;
}

/* --- ZONE D --- */
.zone-d {
  flex-shrink: 0;
  flex-grow: 0;
  height: 56px;
  min-height: 56px;
  max-height: 56px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  background: var(--bg-navy-2);
  border-top: 1px solid var(--border);
  font-size: 13px;
  letter-spacing: 0.04em;
}

.zd-disclaimer {
  color: var(--gold-dim);
  font-size: 12.5px;
  letter-spacing: 0.04em;
  flex-shrink: 0;
  white-space: nowrap;
}

.zd-spacer { flex: 1 1 auto; min-width: 8px; }

/* NAV — back/forward arrows, high-contrast standout */
.zd-nav {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--gold);
  border: 1.5px solid var(--gold);
  border-radius: 50%;
  color: var(--bg-navy);
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s, transform 0.1s;
  box-shadow: 0 0 10px rgba(212,175,55,0.35);
  margin-right: 2px;
}
.zd-nav:hover:not(:disabled) {
  background: var(--gold-soft);
  box-shadow: 0 0 16px rgba(212,175,55,0.6);
  transform: scale(1.05);
}
.zd-nav:active:not(:disabled) {
  transform: scale(0.95);
}

/* ANIMATE — anchor pill, bigger and bolder */
.zd-animate {
  flex-shrink: 0;
  height: 40px;
  padding: 0 22px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-navy);
  border: 1.5px solid var(--gold);
  border-radius: 20px;
  color: var(--gold);
  font-family: var(--sans);
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s, border-color 0.15s;
  box-shadow: 0 0 0 1px rgba(212,175,55,0.18) inset;
}
.zd-animate:hover:not(:disabled) {
  background: var(--gold);
  color: var(--bg-navy);
  box-shadow: 0 0 14px rgba(212,175,55,0.35);
}
.zd-animate.zd-active {
  background: var(--gold);
  color: var(--bg-navy);
  box-shadow: 0 0 14px rgba(212,175,55,0.45);
}
.zd-animate-icon { font-size: 12px; line-height: 1; }
.zd-animate-label { line-height: 1; }

/* SPEED — standard pill-select */
.zd-speed {
  flex-shrink: 0;
  height: 32px;
  padding: 0 16px 0 14px;
  display: inline-flex;
  align-items: center;
  background: var(--bg-navy);
  border: 1px solid var(--border);
  border-radius: 16px;
  color: var(--text);
  font-family: var(--sans);
  font-size: 12.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
  position: relative;
  padding-right: 30px;
}
.zd-speed:hover:not(:disabled) { border-color: var(--gold); color: var(--gold-soft); }
.zd-speed::after {
  content: '';
  position: absolute;
  right: 12px;
  top: 50%;
  width: 7px;
  height: 7px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-70%) rotate(45deg);
  opacity: 0.7;
}

/* TIP — round icon button, far right */
.zd-tip {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-navy);
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--gold-soft);
  font-size: 16px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.zd-tip:hover { border-color: var(--gold); color: var(--gold); }

/* Disabled state — dimmed, NEVER hidden */
.zd-animate:disabled,
.zd-speed:disabled,
.zd-nav:disabled {
  opacity: 0.25;
  cursor: not-allowed;
  pointer-events: none;
}

/* --- MODALS --- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
}

.modal {
  background: var(--bg-navy-3);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 24px 28px;
  min-width: 360px;
  max-width: 520px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.6);
}

.modal-title {
  font-family: var(--display);
  font-size: 22px;
  letter-spacing: 0.1em;
  color: var(--gold);
  margin-bottom: 14px;
}
.modal-body { color: var(--text); font-size: 16px; line-height: 1.5; margin-bottom: 22px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; }

/* ═══════════════════════════════════════════════════════════
   SHARED ZONE B SLIDER + DROPDOWN STYLES
   (Used by TIMELINE, SILSILA, and any view with spec.slider / filters)
   ═══════════════════════════════════════════════════════════ */
#zoneB #hdrYearControls{
  position: relative;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  font-family: 'Cinzel', serif;
  font-size: 11px;
  color: #A0AEC0;
  letter-spacing: .05em;
  padding: 0 6px;
}
#zoneB #yearQuestion{
  font-family: 'Cinzel', serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .08em;
  color: #B8B8B8;
  white-space: nowrap;
  flex-shrink: 0;
  transition: color 0.2s ease;
}
/* Active state — slider has been moved or animation is playing.
   Detected via :has() on the sibling slider track. */
#hdrYearControls:not(:has(#sliderTrack.sl-inactive)) #yearQuestion {
  color: #D4AF37;
}
#zoneB .hdr-range-cap{
  font-family: 'Cinzel', serif;
  font-size: 13px;
  color: #6b7384;
  white-space: nowrap;
  flex-shrink: 0;
}
#zoneB #yrShiftHint{
  position: absolute;
  left: 0;
  bottom: -10px;
  margin: 0;
  font-size: 13px;
  letter-spacing: 0.5px;
  color: #909090;
  white-space: nowrap;
  pointer-events: none;
}
#zoneB #sliderOuter{
  position: relative;
  display: flex;
  align-items: center;
  flex: 1 1 220px;
  min-width: 220px;
  height: 32px;
}
#zoneB #sliderTrack{
  width: 100%;
  height: 4px;
  background: rgba(212,175,55,.10);
  border-radius: 2px;
  position: relative;
  cursor: pointer;
  transition: background 0.2s ease;
}
#zoneB #sliderFill{
  position: absolute;
  left: 0; top: 0; bottom: 0;
  background: rgba(212,175,55,0.45);
  border-radius: 2px;
  pointer-events: none;
  transition: background 0.2s ease;
}
#zoneB #sliderThumb{
  position: absolute;
  top: 50%;
  width: 12px;
  height: 12px;
  margin-top: -6px;
  margin-left: -6px;
  background: #D4AF37;
  border: 2px solid #1B2631;
  border-radius: 50%;
  box-shadow: 0 1px 6px rgba(0,0,0,.5);
  cursor: grab;
  z-index: 5;
  transition: transform .1s, background 0.2s ease, border-color 0.2s ease;
}
#zoneB #sliderThumb:hover{ transform: scale(1.25); }
#zoneB #sliderThumb.dragging{ cursor: grabbing; transform: scale(1.1); }
#zoneB #sliderTrack.sl-inactive{ background: rgba(160,174,192,.18); }
#zoneB #sliderTrack.sl-inactive #sliderFill{ background: #4A5568; }
#zoneB #sliderTrack.sl-inactive #sliderThumb{ background: #6B7280; border-color: #2D3748; box-shadow: none; }
#zoneB #sliderInput{ position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px; }
#zoneB #yearDisplay{
  font-family: 'Cinzel', serif;
  font-size: 13px;
  font-weight: 700;
  color: #B8B8B8;
  letter-spacing: .05em;
  white-space: nowrap;
  min-width: 64px;
  text-align: center;
  flex-shrink: 0;
  transition: color 0.2s ease;
}
/* Active state — slider has been moved or animation is playing.
   Same :has() detection used by #yearQuestion. */
#hdrYearControls:not(:has(#sliderTrack.sl-inactive)) #yearDisplay {
  color: #D4AF37;
}
#zoneB #yrPrecisionPill{
  display: inline-block;
  padding: 1px 6px;
  font-family: 'Cinzel', serif;
  font-size: 13px;
  letter-spacing: 1px;
  color: #d4af37;
  border: 1px solid rgba(212,175,55,0.5);
  border-radius: 8px;
  background: rgba(212,175,55,0.08);
  opacity: 0;
  transition: opacity 150ms ease;
  flex-shrink: 0;
}
#zoneB #yrPrecisionPill.show{ opacity: 0.9; }
#zoneB #yearClearBtn{
  background: transparent;
  border: 1px solid #6b7384;
  color: #6b7384;
  width: 20px;
  height: 20px;
  font-size: 14px;
  line-height: 1;
  border-radius: 3px;
  cursor: pointer;
  opacity: .4;
  pointer-events: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: opacity .15s, color .15s, border-color .15s;
  flex-shrink: 0;
  padding: 0;
}
#zoneB #yearClearBtn.active{ opacity: .7; pointer-events: all; }
#zoneB #yearClearBtn:hover{ opacity: 1; color: #D4AF37; border-color: #D4AF37; }

/* Dropdown panels (TYPE / TRADITION / HAS / etc.) */
.dd-wrap { position: relative; display: inline-block; }

.dd-panel {
  display: none;
  background: #1a1a2e;
  border: 1px solid var(--gold-dim, #6B5A1F);
  border-radius: 6px;
  min-width: 220px;
  max-width: calc(100vw - 24px) !important;
  max-height: calc(100vh - 120px) !important;
  overflow-y: auto !important;
  padding: 6px 0;
  box-shadow: 0 8px 24px rgba(0,0,0,0.6);
  font-family: var(--sans, system-ui, sans-serif);
  z-index: 999999;
}
.dd-panel.open { display: block; }

.dd-search {
  display: block;
  width: calc(100% - 16px);
  margin: 4px 8px 6px;
  padding: 6px 10px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(212,175,55,0.25);
  border-radius: 4px;
  color: #E5E7EB;
  font-size: 13px;
  outline: none;
  box-sizing: border-box;
}
.dd-search:focus { border-color: var(--gold, #D4AF37); }

.dd-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 14px;
  color: #cfd2d6;
  font-size: 13px;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.dd-item:hover { background: rgba(212,175,55,0.1); color: var(--gold, #D4AF37); }
.dd-item.selected { color: var(--gold, #D4AF37); }
.dd-item.dd-all {
  border-bottom: 1px solid rgba(212,175,55,0.2);
  margin-bottom: 4px;
  padding-bottom: 9px;
  font-weight: 600;
}

.dd-checkbox {
  width: 14px;
  height: 14px;
  border: 1px solid rgba(212,175,55,0.5);
  border-radius: 3px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: var(--gold, #D4AF37);
  flex-shrink: 0;
}

.dd-count {
  display: inline-block;
  background: var(--gold, #D4AF37);
  color: #0a0a14;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 8px;
  margin-left: 6px;
}

.dd-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold, #D4AF37);
  display: inline-block;
  margin-left: 6px;
}

.zb-select.filtered {
  border-color: var(--gold, #D4AF37);
  color: var(--gold, #D4AF37);
}

.dd-clear-x {
  margin-left: 6px;
  cursor: pointer;
  font-size: 14px;
  color: var(--gold, #D4AF37);
}
.dd-clear-x:hover { color: #fff; }

#filterBar { display: contents !important; }
#filterSummary,
#filterClearAll { display: none !important; }

body[data-active-tab="START"] .zb-row1 .zb-slot-hint{
  color: var(--gold, #c9a961);
  font-size: 15px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
}

/* ═══════════════════════════════════════════════════════════
   AI METHODOLOGY DISCLOSURE — reusable badges + footer note.
   Anything tagged with .ai-flag (concept chips, tag chips,
   summaries, hierarchy relations) is AI-generated. Variants
   high / med / low map to confidence scores 4-5 / 3 / 1-2.
   See methodology modal "How Cross-References Are Built".
   ═══════════════════════════════════════════════════════════ */
.ai-flag {
  display: inline-block;
  padding: 1px 5px;
  border-radius: 3px;
  font-family: 'Cinzel', serif;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1;
  vertical-align: middle;
  margin-left: 4px;
  user-select: none;
  text-transform: uppercase;
}
.ai-flag-high {
  background: rgba(212,175,55,0.85);
  color: #0e1420;
  border: 1px solid #c9a961;
}
.ai-flag-med {
  background: rgba(212,175,55,0.30);
  color: #d4af37;
  border: 1px solid rgba(212,175,55,0.55);
}
.ai-flag-low {
  background: rgba(154,163,178,0.15);
  color: #9aa3b2;
  border: 1px solid rgba(154,163,178,0.40);
}
/* Convenience superscript variant for inline text. */
sup.ai-flag, .ai-flag.ai-flag-sup {
  font-size: 8px;
  padding: 0 4px;
  vertical-align: super;
  margin-left: 3px;
}
/* Footer line under AI-drafted concept summaries. */
.ai-summary-note {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed rgba(212,175,55,0.20);
  font-size: 11px;
  font-style: italic;
  color: #9aa3b2;
  letter-spacing: 0.02em;
}
.ai-summary-note::before {
  content: 'AI';
  display: inline-block;
  margin-right: 6px;
  padding: 0 4px;
  font-family: 'Cinzel', serif;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.08em;
  background: rgba(154,163,178,0.15);
  color: #9aa3b2;
  border: 1px solid rgba(154,163,178,0.40);
  border-radius: 3px;
  vertical-align: middle;
  font-style: normal;
}

/* Font scale (A−/A+) is only useful for text-heavy reading views.
   Hide it everywhere else so casual tabs aren't cluttered. */
body #fsGroup { display: none !important; }
body[data-active-tab="MONASTIC"] #fsGroup,
body[data-active-tab="EXPLAIN"]  #fsGroup,
body[data-active-tab="START"]    #fsGroup { display: flex !important; }

/* ──────────────────────────────────────────────────────────
   HARD STOP for tab rows so they never overlap the GOLD ARK
   logo (left) or HOW TO USE / TOOLS / user pill (right).
   Arrows live in the buffer between the stop line and the
   viewport edge, and are rectangular instead of circular.
   ────────────────────────────────────────────────────────── */
.zone-a-row2,
.zone-a-row3 {
  padding-left: 240px !important;
  padding-right: 320px !important;
  box-sizing: border-box;
  position: relative;
}

.zone-a-row2 .tab-viewport,
.zone-a-row3 .tab-viewport {
  width: 100%;
}

/* Rectangular arrows, sitting just outside the contained tab strip. */
.tab-arrow {
  width: 38px !important;
  height: 36px !important;
  border-radius: 4px !important;
  font-size: 16px !important;
}
.tab-arrow-prev {
  left: -44px !important;
}
.tab-arrow-next {
  right: -44px !important;
}

/* In focused mode, override the rule that pushed arrows further inward. */
body[data-tab-mode="focused"] .tab-arrow-prev { left: -44px !important; }
body[data-tab-mode="focused"] .tab-arrow-next { right: -44px !important; }

/* Always show tab arrows so users can reach overflowed tabs.
   Tabs are clipped to the contained viewport (padding-left/right
   on zone-a-row2/row3 acts as the dead-zone). */
body[data-tab-mode="browse"] .tab-arrow { display: flex !important; }

/* Tab arrows are always visible — they double as dead-zone markers
   between the tab strip and the GOLD ARK / TOOLS clusters. */
.tab-arrow { display: flex !important; }
body[data-tab-mode="browse"] .tab-arrow { display: flex !important; }
body[data-tab-mode="focused"] .tab-arrow { display: flex !important; }

/* ── Concept chips (shared) ── */
.ga-concept-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 7px;
  border-radius: 10px;
  font-size: 11px;
  font-family: 'Lato', sans-serif;
  cursor: pointer;
  border: 1px solid;
  white-space: nowrap;
  transition: filter .15s, background .15s;
}
.ga-concept-chip:hover { filter: brightness(1.25); }
.ga-concept-chip .ga-cc-sup {
  font-size: 8px;
  opacity: 0.7;
  letter-spacing: .05em;
  text-transform: uppercase;
}

/* AI-scored (Quran) — gold tiers */
.ga-cc-q-hi   { background: rgba(212,175,55,0.28); color: #e8c873; border-color: rgba(212,175,55,0.7); }
.ga-cc-q-mid  { background: rgba(212,175,55,0.14); color: #c9a961; border-color: rgba(212,175,55,0.45); }
.ga-cc-q-low  { background: rgba(212,175,55,0.06); color: rgba(201,169,97,0.55); border-color: rgba(212,175,55,0.25); }

/* Word-matched (Hadith) — neutral */
.ga-cc-h      { background: rgba(160,174,192,0.10); color: #a0aec0; border-color: rgba(160,174,192,0.4); }

/* Popover */
#ga-concept-pop {
  position: fixed;
  z-index: 99998;
  max-width: 380px;
  min-width: 280px;
  background: #131c2a;
  border: 1px solid rgba(212,175,55,0.5);
  border-radius: 6px;
  padding: 16px 18px;
  color: #E8EAEF;
  box-shadow: 0 12px 32px rgba(0,0,0,0.6);
  font-family: 'Lato', sans-serif;
  font-size: 13px;
  line-height: 1.5;
}
#ga-concept-pop .gcp-title {
  font-family: 'Cinzel', serif;
  font-size: 15px;
  letter-spacing: .06em;
  color: #c9a961;
  margin-bottom: 6px;
}
#ga-concept-pop .gcp-meta {
  font-size: 11px;
  color: #9aa3b2;
  margin-bottom: 10px;
}
#ga-concept-pop .gcp-summary { color: #E8EAEF; margin-bottom: 12px; }
#ga-concept-pop .gcp-section-hdr {
  font-family: 'Cinzel', serif;
  font-size: 11px;
  letter-spacing: .08em;
  color: #9aa3b2;
  text-transform: uppercase;
  margin: 8px 0 4px;
}
#ga-concept-pop .gcp-row {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 2px 6px 2px 0;
  padding: 2px 8px;
  border-radius: 3px;
  background: rgba(255,255,255,0.04);
  cursor: pointer;
  font-size: 12px;
  border: 1px solid rgba(255,255,255,0.08);
}
#ga-concept-pop .gcp-row:hover { background: rgba(212,175,55,0.12); border-color: rgba(212,175,55,0.4); }
#ga-concept-pop .gcp-close {
  position: absolute;
  top: 6px; right: 8px;
  background: transparent;
  border: none;
  color: #9aa3b2;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
}

#ga-concept-pop .gcp-title-dim { color: #6B7B8C !important; }
#ga-concept-pop .gcp-verse-grid { display: flex; flex-wrap: wrap; gap: 6px; max-height: 240px; overflow-y: auto; padding: 4px 0; }
#ga-concept-pop .gcp-verse-chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; font-size: var(--fs-3, 13px); font-family: 'Cinzel', serif; letter-spacing: .05em; color: #8fd4b5; background: rgba(150,200,180,0.10); border: 1px solid rgba(150,200,180,0.35); border-radius: 3px; cursor: pointer; }
#ga-concept-pop .gcp-verse-chip:hover { background: rgba(150,200,180,0.22); color: #b9e8d2; }
#ga-concept-pop .gcp-verse-score { font-size: 10px; color: rgba(212,175,55,0.85); font-family: 'Source Sans 3', sans-serif; }
#ga-concept-pop .gcp-empty { font-size: var(--fs-3, 13px); color: #6B7B8C; font-style: italic; padding: 4px 0 8px; }
#ga-concept-pop .gcp-explore { display: block; width: 100%; margin-top: 12px; padding: 8px 12px; background: rgba(212,175,55,0.12); border: 1px solid rgba(212,175,55,0.6); border-radius: 3px; color: #D4AF37; font-family: 'Cinzel', serif; font-size: var(--fs-3, 13px); letter-spacing: .08em; text-transform: uppercase; cursor: pointer; }
#ga-concept-pop .gcp-explore:hover { background: rgba(212,175,55,0.22); }
#ga-concept-pop .gcp-explore-disabled { opacity: 0.45; cursor: not-allowed; border-style: dashed; }

/* ============ LANGUAGE SWITCHER (top bar) ============ */
.lang-wrap { position: relative; display: flex; align-items: center; }
.lang-btn {
  background: none;
  border: 1px solid #7B9DC4;
  color: #7B9DC4;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 12px;
  height: 24px;
  border-radius: 12px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.lang-btn:hover { border-color: #A8BCD9; color: #A8BCD9; background: rgba(123,157,196,0.10); }
.lang-dropdown {
  top: 30px;
  right: 0;
  left: auto;
  min-width: 180px;
}
.lang-dropdown .menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.lang-dropdown .menu-item .lang-name { color: var(--text); }
.lang-dropdown .menu-item .lang-check {
  color: var(--gold);
  font-size: 14px;
  width: 14px;
  text-align: right;
}
.lang-dropdown .menu-item.is-active { background: var(--gold-faint); }
.lang-dropdown .menu-item.is-active .lang-name { color: var(--gold); }

/* ============ ENTRY DOOR LANGUAGE PICKER ============ */
.entry-lang {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin: 0 0 22px;
}
.entry-lang-label {
  font-family: 'Cinzel', serif;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold-dim);
}
.entry-lang-options {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}
.entry-lang-pill {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 6px 16px;
  height: 32px;
  background: transparent;
  color: var(--gold);
  border: 1px solid var(--gold-dim);
  border-radius: 16px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.entry-lang-pill:hover {
  border-color: var(--gold);
  background: var(--gold-faint);
}
.entry-lang-pill.is-active {
  border-color: var(--gold);
  background: var(--gold-faint);
  color: #c9a961;
}

/* ============ RTL FLIP MECHANICS ============ */
html[dir="rtl"] body { direction: rtl; text-align: right; }

/* Numbers stay LTR even inside RTL context */
html[dir="rtl"] .num,
html[dir="rtl"] .stat-value,
html[dir="rtl"] [data-keep-ltr] {
  direction: ltr;
  unicode-bidi: isolate;
  display: inline-block;
}

/* Quran reader (START view) center-spine MUST NOT FLIP — it's sacred. */
html[dir="rtl"] #zoneC #start-view,
html[dir="rtl"] #zoneC .st-vcenter,
html[dir="rtl"] #zoneC .st-verses-list { direction: ltr; }

/* But the top bar inside START still flips */
html[dir="rtl"] #zoneC .st-topbar { direction: rtl; }

/* ============ URDU FONT (lazy-loaded by i18n.js) ============ */
html[dir="rtl"] body,
html.app-lang-ur body {
  font-family: 'Noto Nastaliq Urdu', 'Source Sans 3', sans-serif;
}
html.app-lang-ur .entry-stats-l1,
html.app-lang-ur .entry-stats-l2,
html.app-lang-ur .entry-tagline {
  font-family: 'Noto Nastaliq Urdu', 'Cinzel', serif;
}

/* ════════════════ RTL LAYOUT RULES ════════════════ */

/* Top bar Row 1: logo to right, controls cluster to left */
html[dir="rtl"] .zone-a-row1 {
  flex-direction: row-reverse;
}
html[dir="rtl"] .row1-right {
  flex-direction: row-reverse;
}

/* Tab rows: keep LTR direction so both rows render correctly,
   scroll arrows stay positioned right */
html[dir="rtl"] .zone-a-row2,
html[dir="rtl"] .zone-a-row3,
html[dir="rtl"] #tabRow1,
html[dir="rtl"] #tabRow2,
html[dir="rtl"] .tab-row {
  direction: ltr;
}
/* …but tab BUTTON content (the Urdu label) reads RTL inside the button */
html[dir="rtl"] .tab-row .tab-btn,
html[dir="rtl"] .tab-row button {
  direction: rtl;
  text-align: center;
}

/* Zone D bottom bar: keep LTR so back/forward/animate stay in LTR order */
html[dir="rtl"] .zone-d {
  direction: ltr;
}
html[dir="rtl"] .zone-d .zd-disclaimer {
  direction: rtl;
}

/* Modals: keep buttons in physical LTR order */
html[dir="rtl"] .modal-actions {
  direction: ltr;
}

/* Dropdowns (tools, lang, user) should still flow RTL inside */
html[dir="rtl"] .menu-dropdown {
  direction: rtl;
  text-align: right;
}

/* Filter bar (Zone B): KEEP LTR overall structure (filters left to right),
   but each filter button's text reads RTL inside */
html[dir="rtl"] .zone-b,
html[dir="rtl"] #zoneB {
  direction: ltr;
}
html[dir="rtl"] .zone-b .zb-select,
html[dir="rtl"] .zone-b .zb-pill,
html[dir="rtl"] .zone-b .zb-slot-hint,
html[dir="rtl"] .zone-b button {
  direction: rtl;
}

/* Search input: text RTL but input flow stays normal */
html[dir="rtl"] .zb-search-input,
html[dir="rtl"] input[type="text"],
html[dir="rtl"] input[type="search"],
html[dir="rtl"] textarea {
  text-align: right;
  direction: rtl;
}

/* Tab carousel: viewport + row + arrows ALL stay LTR in RTL mode */
html[dir="rtl"] .tab-viewport,
html[dir="rtl"] #tabViewport,
html[dir="rtl"] .tab-arrow,
html[dir="rtl"] .tab-arrow-prev,
html[dir="rtl"] .tab-arrow-next {
  direction: ltr;
}
/* Tab buttons: outer container LTR (so positions match), inner text
   reads RTL (so Urdu label renders correctly) */
html[dir="rtl"] .tab-btn {
  direction: ltr;
}
html[dir="rtl"] .tab-btn > * {
  direction: rtl;
}

/* Zone D — keep all bottom-bar buttons baseline-aligned */
.zone-d {
  align-items: center !important;
}
.zone-d .zd-nav,
.zone-d .zd-animate,
.zone-d .zd-speed,
.zone-d .zd-tip {
  align-self: center !important;
  vertical-align: middle;
}
/* Keep Zone D LTR even when body is RTL — animate flow is left→right */
body[dir="rtl"] .zone-d,
html[dir="rtl"] .zone-d {
  direction: ltr;
}
