/* ==========================================================================
   Names of Allah PWA — Homepage Iterations Stylesheet (iterations.css)
   Layered on top of ../css/variables.css, base.css, components.css, names.css
   Inspired by Quran.com's compact rebrand + Usul.ai's dusky teal & gold palette
   ========================================================================== */

/* ---------- 1. Sticky Iteration Switcher Bar (Studio Controls) ---------- */
/* Bar height is exposed as --studio-bar-h so the app header can pin below it
   (components.css: .header { top: var(--studio-bar-h) }). Keep these values
   in sync with the bar's padding + one content row. */
:root {
  --studio-bar-h: 53px; /* 12px padding + 36px row + 4px tab strip pad + 1px border */
}

.iter-studio-bar {
  position: sticky;
  top: 0;
  z-index: calc(var(--z-sticky, 1100) + 10); /* above the app header */
  background: var(--teal-800, #163836);
  color: #FAF8F3;
  border-bottom: 1px solid rgba(201, 169, 97, 0.35);
  padding: 6px 12px;
  padding-left: max(12px, env(safe-area-inset-left, 0px));
  padding-right: max(12px, env(safe-area-inset-right, 0px));
  font-size: 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
}

.iter-studio-inner {
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: nowrap; /* one row at every width; tabs scroll instead */
}

.iter-studio-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--gold-300, #DCC68E);
  white-space: nowrap;
}

.iter-studio-badge {
  background: rgba(201, 169, 97, 0.2);
  border: 1px solid rgba(201, 169, 97, 0.45);
  color: #F5EFE0;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.iter-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  max-width: 100%;
  min-width: 0; /* shrink inside the nowrap bar row, then scroll */
  padding: 2px 0;
  scrollbar-width: none;
  scroll-snap-type: x proximity;
  /* fade hints that the strip continues past the right edge */
  mask-image: linear-gradient(to right, #000 0, #000 calc(100% - 18px), transparent 100%);
  -webkit-mask-image: linear-gradient(to right, #000 0, #000 calc(100% - 18px), transparent 100%);
}
.iter-tabs::-webkit-scrollbar {
  display: none;
}

.iter-tab {
  appearance: none;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: rgba(250, 248, 243, 0.84);
  font-family: var(--font-ui);
  font-size: 11.5px;
  font-weight: 500;
  padding: 5px 11px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 150ms ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.iter-tab:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #FFFFFF;
}

.iter-tab.active {
  background: var(--gold-400, #C9A961);
  border-color: var(--gold-400, #C9A961);
  color: #162624;
  font-weight: 600;
}

.iter-tab-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.2);
  font-size: 10px;
  font-weight: 700;
}
.iter-tab.active .iter-tab-num {
  background: rgba(22, 38, 36, 0.18);
}

/* Desktop controls match --studio-bar-h: 48px = 12px padding + 36px row */
.iter-tab {
  min-height: 36px;
}

/* Phones: tab strip only — the brand badge is noise here and the page header
   already carries a theme toggle, so both are dropped to save vertical space. */
@media (max-width: 767px) {
  :root {
    --studio-bar-h: 47px; /* 12px padding + 30px tabs + 4px strip pad + 1px border */
  }
  .iter-studio-brand,
  .studio-theme-btn {
    /* !important: both pages ship a later inline <style> with
       display:inline-flex on this button; phones must not show it */
    display: none !important;
  }
  .iter-tab {
    min-height: 30px;
    padding: 4px 10px;
    font-size: 12px;
  }
}

/* Adjust main container for tighter, modern layout */
#welcomeView.iter-welcome-view {
  padding-top: var(--space-sm);
  padding-bottom: var(--space-xl);
}

.iter-pane {
  display: none;
  animation: iterFadeIn 220ms ease-out;
}
.iter-pane.active {
  display: block;
}

@keyframes iterFadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- 2. Shared Compact Components Across Iterations ---------- */

/* Compact Hadith Ribbon (replaces the tall 280px hadith box) */
.compact-hadith-bar {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-left: 3px solid var(--gold-500);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  margin-bottom: 16px;
  transition: all 180ms ease;
}

.compact-hadith-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  list-style: none;
}
.compact-hadith-summary::-webkit-details-marker {
  display: none;
}

.compact-hadith-quote {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.45;
}

.compact-hadith-quote strong {
  color: var(--text-primary);
  font-weight: 600;
}

.compact-hadith-ar-inline {
  font-family: var(--font-arabic);
  font-size: 16px;
  color: var(--color-arabic-card);
  direction: rtl;
}

.compact-hadith-toggle {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-accent);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
}

.compact-hadith-expanded {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border-light);
  display: grid;
  gap: 8px;
}

.compact-hadith-ar-full {
  font-family: var(--font-arabic);
  font-size: 20px;
  line-height: 1.85;
  color: var(--color-arabic-card);
  text-align: right;
  direction: rtl;
}

.compact-hadith-narrations {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.compact-narration-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.compact-narration-pill {
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--border-medium);
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 140ms ease;
}

.compact-narration-pill.active,
.compact-narration-pill:hover {
  background: var(--color-primary);
  color: #FFFFFF;
  border-color: var(--color-primary);
}

/* Section Headers (Quran.com shelf header pattern) */
.shelf-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.shelf-title-group {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.shelf-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.shelf-subtitle {
  font-size: 12px;
  color: var(--text-quaternary);
}

.shelf-link {
  appearance: none;
  background: none;
  border: none;
  padding: 0;
  font-family: var(--font-ui);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--color-accent);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  text-decoration: none;
}
.shelf-link:hover {
  text-decoration: underline;
}

/* ==========================================================================
   ITERATION 1: QURAN.COM INSPIRED (Hero Search + Continue + Curated Shelves)
   ========================================================================== */

.v1-hero {
  position: relative;
  background: linear-gradient(145deg, var(--teal-700, #1C4644) 0%, var(--teal-800, #163836) 60%, #102A28 100%);
  color: #FAF8F3;
  border-radius: var(--radius-lg);
  padding: 20px 20px 18px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(201, 169, 97, 0.28);
  overflow: visible;
}

.v1-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius-lg);
  background: radial-gradient(circle at 85% 20%, rgba(201, 169, 97, 0.16), transparent 55%);
  pointer-events: none;
}

.v1-hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  position: relative;
  z-index: 1;
}

.v1-hero-title-block {
  text-align: left;
  min-width: 0; /* share the row safely with the calligraphy */
}

.v1-hero-eyebrow {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gold-300, #DCC68E);
  font-weight: 600;
  margin-bottom: 2px;
}

.v1-hero-heading {
  font-size: clamp(18px, 2.6vw, 22px);
  font-weight: 700;
  color: #FFFFFF;
  margin: 0;
  line-height: 1.25;
}

.v1-hero-calligraphy {
  font-family: var(--font-arabic);
  font-size: clamp(24px, 3.8vw, 32px);
  color: var(--gold-300, #DCC68E);
  line-height: 1.2;
  white-space: nowrap;
  min-width: 0;
}

/* Narrow phones: let the calligraphy take its own row and wrap instead of
   pushing the hero ~94px past the viewport */
@media (max-width: 519px) {
  .v1-hero-top {
    flex-wrap: wrap;
  }
  .v1-hero-calligraphy {
    white-space: normal;
    line-height: 1.45;
  }
}

/* Prominent Search Bar (Quran.com centerpiece) */
.v1-search-box {
  position: relative;
  z-index: 30;
  margin-bottom: 12px;
}

.v1-search-input-wrap {
  display: flex;
  align-items: center;
  background: #FFFFFF;
  color: #1A1A1A;
  border-radius: 999px;
  padding: 4px 6px 4px 14px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
  border: 2px solid transparent;
  transition: border-color 150ms ease;
}

[data-theme="dark"] .v1-search-input-wrap {
  background: #1B2927;
  color: #EAE6DF;
  border-color: rgba(201, 169, 97, 0.35);
}

.v1-search-input-wrap:focus-within {
  border-color: var(--gold-400, #C9A961);
}

.v1-search-icon {
  color: var(--teal-600, #2A5F5C);
  flex-shrink: 0;
  margin-right: 10px;
}
[data-theme="dark"] .v1-search-icon {
  color: var(--gold-400, #C9A961);
}

.v1-search-input {
  width: 100%;
  border: none;
  background: transparent;
  font-family: var(--font-ui);
  font-size: 14px;
  color: inherit;
  padding: 7px 0;
  outline: none;
}

.v1-search-input::placeholder {
  color: #6E6A63;
}
[data-theme="dark"] .v1-search-input::placeholder {
  color: #96ACA8;
}

.v1-search-btn {
  background: var(--teal-600, #2A5F5C);
  color: #FFFFFF;
  border: none;
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 150ms ease;
}
.v1-search-btn:hover {
  background: var(--teal-500, #357A76);
}

/* Instant Search Dropdown Results */
.v1-search-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xl);
  max-height: 320px;
  overflow-y: auto;
  overscroll-behavior: contain;
  z-index: 100;
  padding: 6px;
}

/* v1 search dropdown rows (built by app.js; 44px touch targets) */
.v1-drop-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-quaternary);
  padding: 6px 10px;
}

.v1-drop-label-sits {
  margin-top: 4px;
}

.v1-drop-item {
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  min-height: 44px;
  border: none;
  background: transparent;
  color: var(--text-primary);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  border-radius: 8px;
  cursor: pointer;
}

.v1-drop-item:hover,
.v1-drop-item:active {
  background: var(--bg-subtle);
}

.v1-drop-meaning {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.v1-drop-arabic {
  font-family: var(--font-arabic);
  font-size: 1.25rem;
  color: var(--teal-600);
  flex-shrink: 0;
}

.v1-drop-cat {
  color: var(--text-quaternary);
  font-size: 0.78rem;
}

.v1-drop-open {
  font-size: 0.78rem;
  color: var(--teal-600);
  font-weight: 600;
  flex-shrink: 0;
}

.v1-drop-empty {
  padding: 12px;
  color: var(--text-quaternary);
  font-size: 0.85rem;
}

.v1-search-result-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border: none;
  background: transparent;
  border-radius: var(--radius-sm);
  text-align: left;
  cursor: pointer;
  color: var(--text-primary);
  font-family: var(--font-ui);
}
.v1-search-result-item:hover {
  background: var(--bg-subtle);
}

.v1-search-result-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.v1-search-result-num {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-quaternary);
  background: var(--bg-subtle);
  padding: 2px 6px;
  border-radius: 4px;
}

.v1-search-result-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.v1-search-result-sub {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.v1-search-result-ar {
  font-family: var(--font-arabic);
  font-size: 19px;
  color: var(--color-arabic-card);
  flex-shrink: 0;
}

/* Quick Navigation / Popular Pills under Search (Quran.com pattern) */
.v1-quick-pills {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}

.v1-pill-label {
  font-size: 11px;
  color: rgba(250, 248, 243, 0.7);
  margin-right: 2px;
}

.v1-quick-pill {
  appearance: none;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #FAF8F3;
  font-family: var(--font-ui);
  font-size: 11.5px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 140ms ease;
}

.v1-quick-pill:hover {
  background: rgba(201, 169, 97, 0.28);
  border-color: var(--gold-300, #DCC68E);
  transform: translateY(-1px);
}

.v1-quick-pill-ar {
  font-family: var(--font-arabic);
  font-size: 14px;
  color: var(--gold-300, #DCC68E);
}

/* Row 2: "Continue / Start Here" 3-Column Strip (Quran.com Start Reading + My Quran + Goal) */
.v1-continue-grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr 0.9fr;
  gap: 10px;
  margin-bottom: 18px;
}

@media (max-width: 820px) {
  .v1-continue-grid {
    grid-template-columns: 1fr;
  }
}

.v1-spotlight-card {
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  padding: 13px 15px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  box-shadow: var(--shadow-xs);
  position: relative;
  overflow: hidden;
}

.v1-spotlight-card.primary-spotlight {
  border-left: 4px solid var(--color-primary);
  background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-subtle) 100%);
}

.v1-card-kicker {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-accent);
}

.v1-shuffle-btn {
  appearance: none;
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.v1-shuffle-btn:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.v1-spotlight-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.v1-spotlight-translit {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 2px;
}

.v1-spotlight-meaning {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-primary);
  margin: 0 0 4px;
}

.v1-spotlight-invoke {
  font-size: 12px;
  color: var(--text-secondary);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.v1-spotlight-arabic {
  font-family: var(--font-arabic);
  font-size: 36px;
  color: var(--color-arabic-card);
  line-height: 1.1;
  flex-shrink: 0;
  padding-left: 6px;
}

.v1-spotlight-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 6px;
  border-top: 1px solid var(--border-light);
  font-size: 12px;
}

.v1-spotlight-ref {
  color: var(--text-quaternary);
  font-size: 11.5px;
}

.v1-spotlight-cta {
  appearance: none;
  background: none;
  border: none;
  padding: 0;
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 700;
  color: var(--color-primary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
[data-theme="dark"] .v1-spotlight-cta {
  color: var(--gold-400);
}

/* Row 3: Horizontal Situation Shelf (Quran.com Learning Plans style) */
.v1-shelf-section {
  margin-bottom: 18px;
}

.v1-situation-scroller {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 10px;
}

@media (max-width: 640px) {
  .v1-situation-scroller {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: 6px;
    gap: 10px;
  }
  .v1-situation-scroller .v1-sit-card {
    min-width: 235px;
    scroll-snap-align: start;
  }
}

.v1-sit-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 12px 13px;
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  transition: all 160ms ease;
  box-shadow: var(--shadow-xs);
}

.v1-sit-card:hover {
  border-color: var(--color-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.v1-sit-cat {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-accent);
  display: block;
  margin-bottom: 3px;
}

.v1-sit-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.35;
  margin: 0;
}

.v1-sit-names-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding-top: 8px;
  border-top: 1px dashed var(--border-light);
}

.v1-sit-ar-chips {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.v1-sit-ar-chip {
  font-family: var(--font-arabic);
  font-size: 14px;
  background: var(--bg-subtle);
  color: var(--color-arabic-card);
  padding: 1px 7px;
  border-radius: 999px;
  border: 1px solid var(--border-light);
}

.v1-sit-count {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-quaternary);
  white-space: nowrap;
}

/* Row 4: Two-Column Split — Featured Names Grid (Left) + Featured Video Series (Right) */
.v1-bottom-split {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); /* 0 min: cards must shrink, not push wide */
  gap: 14px;
  align-items: start;
}

@media (max-width: 860px) {
  .v1-bottom-split {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Compact Quran.com-style Name Mini-Cards */
.v1-mini-names-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

@media (max-width: 520px) {
  .v1-mini-names-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.v1-mini-name-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  text-align: left;
  transition: all 150ms ease;
}

.v1-mini-name-card:hover {
  border-color: var(--color-primary);
  background: var(--bg-subtle);
  transform: translateY(-1px);
}

.v1-mini-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.v1-mini-diamond {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-medium);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.v1-mini-info {
  min-width: 0;
  overflow: hidden; /* lets the ellipsis meaning clip instead of sizing the card */
}

.v1-mini-translit {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 5px;
}

.v1-mini-meaning {
  font-size: 11.5px;
  color: var(--text-secondary);
  margin: 1px 0 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.v1-mini-arabic {
  font-family: var(--font-arabic);
  font-size: 22px;
  color: var(--color-arabic-card);
  flex-shrink: 0;
  line-height: 1;
}

/* Compact Video Shelf Cards */
.v1-video-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.v1-video-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 8px 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  text-align: left;
  transition: all 150ms ease;
}

.v1-video-card:hover {
  border-color: var(--color-primary);
  background: var(--bg-subtle);
}

.v1-video-thumb {
  position: relative;
  width: 76px;
  height: 44px;
  border-radius: 6px;
  overflow: hidden;
  background: #102A28;
  flex-shrink: 0;
}

.v1-video-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.v1-video-play-badge {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.32);
  color: #FFFFFF;
}

.v1-video-meta {
  min-width: 0;
  flex: 1;
}

.v1-video-title {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.v1-video-sub {
  font-size: 11px;
  color: var(--text-quaternary);
  margin: 0;
}

/* ==========================================================================
   ITERATION 2: COMPACT BENTO SANCTUARY (All 6 App Pillars Above the Fold)
   ========================================================================== */

.v2-bento-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 12px;
}

.bento-cell {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 15px 16px;
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.bento-hero-name {
  grid-column: span 7;
  background: linear-gradient(135deg, var(--teal-700, #1C4644) 0%, var(--teal-800, #163836) 100%);
  color: #FAF8F3;
  border-color: rgba(201, 169, 97, 0.35);
  position: relative;
  overflow: hidden;
}

.bento-situations {
  grid-column: span 5;
}

.bento-browse {
  grid-column: span 6;
}

.bento-videos {
  grid-column: span 6;
}

.bento-practice-dock {
  grid-column: span 12;
  padding: 12px 16px;
  background: var(--bg-subtle);
}

@media (max-width: 860px) {
  .bento-hero-name,
  .bento-situations,
  .bento-browse,
  .bento-videos {
    grid-column: span 12;
  }
}

.bento-hero-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.bento-hero-Arabic {
  font-family: var(--font-arabic);
  font-size: clamp(38px, 5vw, 52px);
  color: var(--gold-300, #DCC68E);
  line-height: 1.05;
}

.bento-worship-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 10px 0;
}

.bento-worship-pill {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #FAF8F3;
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
}
.bento-worship-pill.active {
  background: var(--gold-400, #C9A961);
  color: #162624;
  border-color: var(--gold-400, #C9A961);
  font-weight: 600;
}

.bento-worship-box {
  background: rgba(0, 0, 0, 0.2);
  border-left: 3px solid var(--gold-400, #C9A961);
  padding: 8px 11px;
  border-radius: 6px;
  font-size: 12.5px;
  line-height: 1.45;
  color: rgba(250, 248, 243, 0.92);
  margin-bottom: 12px;
}

.bento-sit-chips {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  margin: 10px 0;
}

@media (max-width: 480px) {
  .bento-sit-chips {
    grid-template-columns: 1fr;
  }
}

.bento-sit-chip {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 3px;
  transition: all 140ms ease;
}
.bento-sit-chip:hover {
  border-color: var(--color-primary);
  background: var(--bg-card);
}

.bento-sit-chip-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
}

.bento-sit-chip-names {
  font-size: 11px;
  color: var(--color-accent);
  font-weight: 600;
}

.bento-arabic-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)); /* 0 min lets tracks shrink, content wraps */
  gap: 7px;
  margin: 10px 0;
}

@media (max-width: 400px) {
  .bento-arabic-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr)); /* 22px Arabic needs ~120px per tile */
  }
}

.bento-arabic-tile {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 8px 6px;
  text-align: center;
  cursor: pointer;
  transition: all 140ms ease;
}
.bento-arabic-tile:hover {
  border-color: var(--color-primary);
  transform: translateY(-1px);
}

.bento-arabic-tile-ar {
  font-family: var(--font-arabic);
  font-size: 22px;
  color: var(--color-arabic-card);
  display: block;
  line-height: 1.2;
}

.bento-arabic-tile-en {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-primary);
  display: block;
  margin-top: 2px;
}

.bento-arabic-tile-sub {
  font-size: 10px;
  color: var(--text-quaternary);
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bento-series-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  margin: 10px 0;
}

.bento-series-card {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  text-align: left;
  cursor: pointer;
  transition: all 140ms ease;
}
.bento-series-card:hover {
  border-color: var(--color-primary);
}

.bento-series-count {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--color-accent);
}

.bento-series-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 2px 0;
  line-height: 1.3;
}

.bento-series-speaker {
  font-size: 11px;
  color: var(--text-quaternary);
}

.bento-dock-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.bento-dock-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* ==========================================================================
   ITERATION 3: HEART & SITUATION COMPASS (Empathy First + Compact Tab Deck)
   ========================================================================== */

.v3-compass-header {
  text-align: center;
  padding: 14px 12px 10px;
}

.v3-compass-arabic {
  font-family: var(--font-arabic);
  font-size: 24px;
  color: var(--color-arabic-card);
  margin-bottom: 4px;
}

.v3-compass-title {
  font-size: clamp(19px, 3vw, 24px);
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 4px;
}

.v3-compass-sub {
  font-size: 13.5px;
  color: var(--text-secondary);
  margin: 0 auto 14px;
  max-width: 560px;
}

.v3-compass-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}

@media (max-width: 820px) {
  .v3-compass-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 520px) {
  .v3-compass-grid {
    grid-template-columns: 1fr;
  }
}

.v3-compass-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-top: 3px solid var(--color-primary);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  box-shadow: var(--shadow-xs);
  transition: all 150ms ease;
}

.v3-compass-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.v3-compass-quote {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.35;
  margin: 0;
  cursor: pointer;
}
.v3-compass-quote:hover {
  color: var(--color-primary);
}

.v3-compass-point {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.45;
  margin: 4px 0 0;
}

.v3-compass-remedy-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding-top: 8px;
  border-top: 1px solid var(--border-light);
  flex-wrap: wrap;
}

.v3-remedy-pill {
  appearance: none;
  background: var(--bg-subtle);
  border: 1px solid var(--border-medium);
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.v3-remedy-pill:hover {
  border-color: var(--color-primary);
  background: var(--teal-50);
  color: var(--teal-700);
}
[data-theme="dark"] .v3-remedy-pill:hover {
  background: var(--teal-800);
  color: var(--gold-300);
}

.v3-remedy-pill-ar {
  font-family: var(--font-arabic);
  font-size: 14px;
  color: var(--color-arabic-card);
}

/* Tabbed Lower Deck for V3 (Zero Scroll Clutter) */
.v3-deck {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  box-shadow: var(--shadow-xs);
}

.v3-deck-tabs {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.v3-deck-tab-group {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.v3-deck-tab {
  appearance: none;
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
  font-family: var(--font-ui);
  font-size: 12.5px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 140ms ease;
}

.v3-deck-tab.active {
  background: var(--color-primary);
  color: #FFFFFF;
  border-color: var(--color-primary);
}

.v3-deck-panel {
  display: none;
}
/* v3 deck overrides: wider auto grids, min()-guarded so tracks never exceed
   the container on narrow phones (was inline style in index.html) */
.v3-deck .v1-mini-names-grid {
  grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr));
}

.v3-deck .v1-video-stack {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
  gap: 10px;
}

.v3-deck-panel.active {
  display: block;
}

/* ==========================================================================
   ITERATION 4: DAILY COMPANION SPLIT-DECK (Worship Card + Stacked Shelves)
   ========================================================================== */

.v4-split-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1.25fr); /* 0 min: worship card stays in bounds */
  gap: 16px;
  align-items: start;
}

@media (max-width: 860px) {
  .v4-split-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

.v4-worship-card {
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-top: 4px solid var(--gold-500);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-sm);
}

.v4-worship-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.v4-name-stage {
  text-align: center;
  padding: 14px 10px;
  background: var(--bg-subtle);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  margin-bottom: 12px;
}

.v4-name-arabic {
  font-family: var(--font-arabic);
  /* unbreakable Arabic word: scale down on phones so it never exceeds the stage */
  font-size: clamp(34px, 12.5vw, 46px);
  color: var(--color-arabic-card);
  line-height: 1.15;
  margin-bottom: 4px;
}

.v4-name-translit {
  font-size: 19px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.v4-name-meaning {
  font-size: 13.5px;
  color: var(--color-primary);
  font-weight: 600;
  margin: 2px 0 0;
}

.v4-lens-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)); /* 0 min: labels wrap, card stays in bounds */
  gap: 4px;
  background: var(--bg-subtle);
  padding: 4px;
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
}

.v4-lens-tab {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-ui);
  font-size: 11.5px;
  font-weight: 600;
  padding: 6px 4px;
  border-radius: 6px;
  cursor: pointer;
}

.v4-lens-tab.active {
  background: var(--bg-card);
  color: var(--text-primary);
  box-shadow: var(--shadow-xs);
}

.v4-lens-body {
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-secondary);
  background: var(--bg-subtle);
  padding: 11px 13px;
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--color-primary);
  min-height: 74px;
  margin-bottom: 12px;
}

.v4-right-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.v4-stack-box {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 13px 15px;
  box-shadow: var(--shadow-xs);
}

/* ---------- Touch targets & tap feedback (phones) ---------- */
@media (pointer: coarse) {
  .v1-quick-pill,
  .compact-narration-pill,
  .shelf-link,
  .v1-shuffle-btn,
  .bento-worship-pill,
  .v1-sit-ar-chip,
  .v4-lens-tab,
  .v3-deck-tab {
    min-height: 30px; /* compact by request — 44px rows of pills ate phone screens */
    padding-top: max(3px, calc((30px - 1.4em) / 2));
    padding-bottom: max(3px, calc((30px - 1.4em) / 2));
  }
  /* Arabic with harakat is illegible below 18px on tappable chips */
  .v1-sit-ar-chip {
    font-size: 18px;
  }
  .v1-quick-pill-ar {
    font-size: 18px;
  }
}

/* Hover transforms latch on touch (sticky :hover) — disable without hover */
@media (hover: none) {
  .v1-mini-name-card:hover,
  .v1-quick-pill:hover,
  .bento-arabic-tile:hover,
  .v1-video-card:hover,
  .v1-sit-card:hover,
  .v3-compass-card:hover,
  .v4-worship-card:hover {
    transform: none;
  }
}

/* Pressed feedback replaces hover affordance on touch */
.v1-mini-name-card:active,
.v1-quick-pill:active,
.bento-arabic-tile:active,
.v1-video-card:active,
.iter-tab:active {
  transform: scale(0.98);
  transition-duration: 80ms;
}

/* ---------- Text floors on phones (≤640px) ---------- */
@media (max-width: 640px) {
  .iter-tab {
    font-size: 12px;
  }
  .iter-studio-badge {
    font-size: 11px; /* floor also serves the v2 pane's "Name in Focus" label */
  }
  .v1-mini-meaning {
    font-size: 12.5px;
  }
  .v1-sit-count {
    font-size: 12.5px;
  }
  .v1-video-title {
    font-size: 14px;
  }
  .v1-video-sub {
    font-size: 12.5px;
  }
  .bento-arabic-tile-en {
    font-size: 12.5px;
  }
  .bento-arabic-tile-sub {
    font-size: 11.5px;
  }
  .v4-lens-tab {
    font-size: 12.5px;
  }
  .v1-shuffle-btn {
    font-size: 12.5px;
  }
  .shelf-link {
    font-size: 13px;
  }
}
