@import url('https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,400;0,500;0,600;0,700;1,400;1,600&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Tajawal:wght@400;500;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

/* ==========================================================================
   CALLVOCAB THEME: "THE LEXICON" (Aged Paper, Crimson & Gold)
   ========================================================================== */
:root {
  /* Paper & Surfaces */
  --paper: #f5eedc;
  --paper-deep: #ece0c4;
  --card: #fdfaf3;
  --card-hover: #ffffff;
  
  /* Ink & Typography */
  --ink: #231e17;
  --ink-soft: #54493b;
  --ink-muted: #827460;
  
  /* Book Accents */
  --crimson: #a4322a;
  --oxblood: #7c2318;
  --oxblood-hot: #9c2f1e;
  --gold: #b38234;
  --gold-soft: #d9ab55;
  --forest: #3d5a41;
  --forest-soft: #e2e9df;
  
  /* Leather & Spine */
  --leather-1: #3b2a1b;
  --leather-2: #221710;
  
  /* Rules & Borders */
  --rule: #d8cbaf;
  --rule-strong: #c2b191;
  --rule-dark: rgba(35, 30, 23, 0.12);

  /* Fonts */
  --font-serif: 'Lora', 'Iowan Old Style', 'Palatino Linotype', Palatino, Georgia, serif;
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-arabic: 'Tajawal', 'Plus Jakarta Sans', sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', ui-monospace, monospace;

  /* Geometry & Shadows */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-pill: 9999px;

  --shadow-book: 0 4px 20px rgba(60, 45, 20, 0.08), 0 1px 3px rgba(60, 45, 20, 0.06);
  --shadow-panel: 0 1px 0 #dccfa9, 0 3px 0 #cdbd94, 0 5px 0 rgba(60, 45, 20, 0.12), 0 20px 40px rgba(40, 30, 15, 0.15);
  --shadow-showcase: 0 16px 48px rgba(60, 45, 20, 0.15), 0 2px 8px rgba(60, 45, 20, 0.06);
}

/* ==========================================================================
   RESET & BASE
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  background-color: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  line-height: 1.65;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

html[dir="rtl"] {
  font-family: var(--font-arabic);
}

html[dir="rtl"] .hero-title,
html[dir="rtl"] .section-title,
html[dir="rtl"] .step-box h3,
html[dir="rtl"] .feature-tile h3,
html[dir="rtl"] .faq-toggle-btn {
  font-family: var(--font-arabic);
  font-weight: 800;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: hidden;
  background-color: var(--paper);
  background-image: 
    radial-gradient(120% 80% at 50% 0%, rgba(193, 146, 69, 0.08) 0%, transparent 60%),
    repeating-linear-gradient(0deg, rgba(101, 80, 47, 0.02) 0 1px, transparent 1px 3px);
}

.container {
  width: 100%;
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ==========================================================================
   NAVIGATION & TOP LANGUAGE SWITCHER
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: rgba(245, 238, 220, 0.94);
  border-bottom: 1px solid var(--rule);
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--ink);
  flex-shrink: 0;
}

.brand-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  box-shadow: 0 2px 6px rgba(124, 35, 24, 0.2);
}

.brand-title {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--oxblood);
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 8px;
}

html[dir="rtl"] .brand-title {
  font-family: var(--font-arabic);
}

.brand-badge {
  font-family: var(--font-sans);
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 2px 7px;
  background: var(--paper-deep);
  color: var(--ink-soft);
  border-radius: var(--radius-pill);
  border: 1px solid var(--rule);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 22px;
  list-style: none;
}

.nav-links a {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  transition: color 0.15s ease;
  white-space: nowrap;
}

.nav-links a:hover {
  color: var(--oxblood);
}

.nav-right-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

/* Header Global Language Switcher */
.header-lang-picker,
.lang-dropdown-wrapper {
  position: relative;
}

.global-lang-btn,
.lang-select-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: var(--card);
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius-pill);
  color: var(--ink);
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.16s ease;
}

.global-lang-btn:hover,
.lang-select-btn:hover {
  background: #ffffff;
  border-color: var(--oxblood);
  color: var(--oxblood);
}

.global-lang-menu,
.lang-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--card);
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius-md);
  box-shadow: 0 10px 30px rgba(40, 30, 15, 0.18);
  padding: 6px;
  min-width: 170px;
  display: none;
  z-index: 150;
  max-height: 380px;
  overflow-y: auto;
}

html[dir="rtl"] .global-lang-menu,
html[dir="rtl"] .lang-dropdown-menu {
  right: auto;
  left: 0;
}

.global-lang-menu.show,
.lang-dropdown-menu.show {
  display: block;
}

.lang-menu-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border: none;
  background: none;
  color: var(--ink);
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  text-align: left;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.12s ease;
}

/* Universal Cross-Platform Flags (Windows, Mac, Linux, iOS, Android) */
.flag-svg-icon {
  display: inline-block;
  width: 19px;
  height: 13px;
  object-fit: cover;
  border-radius: 2px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
  vertical-align: middle;
  flex-shrink: 0;
}

.lang-select-btn .flag-svg-icon {
  width: 18px;
  height: 12px;
}

.lang-menu-item .flag-svg-icon,
.mobile-lang-chip .flag-svg-icon {
  width: 18px;
  height: 12px;
  margin-inline-end: 8px;
}

.lang-card-flag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.lang-card-flag .flag-svg-icon {
  width: 28px;
  height: 19px;
  border-radius: 3px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.16);
}

html[dir="rtl"] .lang-menu-item {
  text-align: right;
}

.lang-menu-item:hover, .lang-menu-item.active {
  background: rgba(164, 50, 42, 0.1);
  color: var(--oxblood);
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  text-decoration: none;
  border-radius: var(--radius-pill);
  padding: 10px 20px;
  cursor: pointer;
  transition: all 0.18s ease;
  border: 1px solid transparent;
  white-space: nowrap;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--oxblood);
  color: #ffffff;
  box-shadow: 0 2px 10px rgba(124, 35, 24, 0.25);
  border-color: #641c13;
}

.btn-primary:hover {
  background: var(--oxblood-hot);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(124, 35, 24, 0.35);
}

.btn-secondary {
  background: var(--card);
  color: var(--ink);
  border-color: var(--rule-strong);
  box-shadow: 0 1px 3px rgba(60, 45, 20, 0.05);
}

.btn-secondary:hover {
  background: #ffffff;
  border-color: var(--oxblood);
  color: var(--oxblood);
}

.btn-lg {
  padding: 13px 26px;
  font-size: 1rem;
}

/* ==========================================================================
   HERO SECTION
   ========================================================================== */
.hero {
  padding: 60px 0 50px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1.05fr;
  gap: 48px;
  align-items: center;
}

.hero-title {
  font-family: var(--font-serif);
  font-size: clamp(2.4rem, 4.5vw, 3.6rem);
  font-weight: 700;
  color: var(--ink);
  line-height: 1.18;
  letter-spacing: -0.02em;
  margin-bottom: 18px;
  text-wrap: balance;
}

.hero-title em {
  font-style: italic;
  color: var(--oxblood);
}

.hero-desc {
  font-size: 1.1rem;
  color: var(--ink-soft);
  line-height: 1.65;
  margin-bottom: 28px;
  text-wrap: balance;
}

.hero-cta {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 26px;
  flex-wrap: wrap;
}

.hero-trust-bar {
  display: flex;
  align-items: center;
  gap: 24px;
  font-size: 0.85rem;
  color: var(--ink-muted);
  font-weight: 600;
  white-space: nowrap;
  flex-wrap: nowrap;
}

.hero-trust-bar span {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.hero-trust-bar svg {
  color: var(--forest);
  flex-shrink: 0;
}

/* ==========================================================================
   LEXICON HUD DEMO
   ========================================================================== */
.lexicon-panel {
  background: var(--paper);
  border: 1px solid #8d7a55;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-panel);
  overflow: hidden;
  direction: ltr !important; /* The HUD preview mirrors an English call */
  text-align: left !important;
}

.panel-leather-head {
  padding: 10px 14px;
  background: linear-gradient(var(--leather-1), var(--leather-2));
  border-bottom: 1px solid #14100a;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.leather-title {
  font-family: var(--font-serif);
  font-variant-caps: small-caps;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 1.6px;
  color: var(--gold);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.75), 0 0 14px rgba(193, 146, 69, 0.25);
  display: flex;
  align-items: center;
  gap: 6px;
}

.leather-status {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: #a8946f;
}

.panel-caption-box {
  padding: 20px;
  background: var(--paper-deep);
  border-bottom: 1px solid var(--rule);
}

.caption-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 0.78rem;
  color: var(--ink-soft);
}

.caption-speaker {
  font-weight: 700;
  color: var(--oxblood);
  display: flex;
  align-items: center;
  gap: 5px;
}

.caption-line-text {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  line-height: 1.6;
  color: var(--ink);
  margin-bottom: 12px;
}

.btn-translate-line {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--card);
  border: 1px solid var(--rule-strong);
  color: var(--oxblood);
  font-family: inherit;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all 0.16s ease;
  box-shadow: 0 1px 3px rgba(60, 45, 20, 0.06);
}

.btn-translate-line:hover {
  background: #ffffff;
  border-color: var(--oxblood);
  transform: translateY(-1px);
}

.btn-translate-line.active {
  background: var(--oxblood);
  color: #ffffff;
  border-color: #641c13;
  box-shadow: 0 2px 8px rgba(124, 35, 24, 0.25);
}

.caption-line-translation {
  background: rgba(253, 250, 243, 0.95);
  border: 1px solid var(--rule-strong);
  border-left: 3px solid var(--oxblood);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-top: 6px;
  transition: all 0.25s ease;
  box-shadow: 0 2px 8px rgba(60, 45, 20, 0.04);
}

.caption-line-translation.rtl {
  border-left: 1px solid var(--rule-strong);
  border-right: 3px solid var(--oxblood);
  text-align: right;
  direction: rtl;
}

.line-trans-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--oxblood);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.line-trans-text {
  font-family: var(--font-serif);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.5;
}

.word-token-btn {
  background: none;
  border: none;
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  cursor: pointer;
  padding: 1px 5px;
  border-radius: 4px;
  font-weight: 600;
  border-bottom: 2px dashed rgba(164, 50, 42, 0.4);
  transition: all 0.15s ease;
}

.word-token-btn:hover, .word-token-btn.active {
  background: rgba(164, 50, 42, 0.15);
  color: var(--oxblood);
  border-bottom-style: solid;
  border-bottom-color: var(--oxblood);
}

.panel-entry-card {
  padding: 22px;
  background: var(--card);
}

.entry-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.entry-headword {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--oxblood);
  letter-spacing: -0.01em;
}

.entry-phonetic {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--ink-muted);
  margin-left: 8px;
}

.btn-audio-speak {
  background: rgba(164, 50, 42, 0.08);
  border: 1px solid rgba(164, 50, 42, 0.25);
  color: var(--oxblood);
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  font-size: 0.78rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-audio-speak:hover {
  background: var(--oxblood);
  color: #ffffff;
}

.entry-translation-band {
  background: var(--paper-deep);
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 10px 0 12px;
  box-shadow: 0 2px 8px rgba(35, 32, 27, 0.04);
}

.entry-trans-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
}

.entry-trans-left-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.entry-pos {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.82rem;
  color: var(--gold);
  font-weight: 700;
  background: rgba(179, 130, 52, 0.12);
  padding: 1px 7px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(179, 130, 52, 0.25);
  display: inline-block;
}

.entry-trans-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--ink-muted);
  letter-spacing: 0.05em;
}

.trans-text-val {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--oxblood);
  line-height: 1.35;
  word-break: break-word;
}

.trans-text-val.rtl {
  direction: rtl;
  text-align: right;
  font-family: var(--font-arabic);
  font-size: 1.25rem;
}

.entry-sense {
  font-size: 0.92rem;
  color: var(--ink-soft);
  line-height: 1.55;
  border-top: 1px dashed var(--rule);
  padding-top: 10px;
  margin-top: 4px;
}

.lang-dropdown-select {
  background: var(--card);
  color: var(--oxblood);
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius-sm);
  padding: 3px 8px;
  font-size: 0.76rem;
  font-weight: 600;
  outline: none;
  cursor: pointer;
  max-width: 65%;
  text-overflow: ellipsis;
}

/* ==========================================================================
   BEAUTIFIED 16 LANGUAGES SHOWCASE MATRIX (HIGH-INTERACTION)
   ========================================================================== */
.lang-matrix-word-selector {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 24px auto 16px auto;
  flex-wrap: wrap;
  padding: 8px 16px;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius-pill);
  max-width: fit-content;
  box-shadow: var(--shadow-sm);
}

.matrix-select-label {
  font-family: var(--font-serif);
  font-size: 0.92rem;
  color: var(--ink);
  font-weight: 700;
}

html[dir="rtl"] .matrix-select-label {
  font-family: var(--font-arabic);
}

.matrix-word-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.matrix-word-btn {
  background: var(--paper);
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius-pill);
  padding: 3px 12px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ink-soft);
  cursor: pointer;
  transition: all 0.15s ease;
}

.matrix-word-btn:hover {
  background: #ffffff;
  border-color: var(--oxblood);
  color: var(--oxblood);
}

.matrix-word-btn.active {
  background: var(--oxblood);
  color: #ffffff;
  border-color: var(--oxblood);
  box-shadow: 0 2px 8px rgba(164, 50, 42, 0.25);
}

.languages-matrix-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-top: 24px;
  margin-bottom: 10px;
}

.lang-matrix-card {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
  padding: 20px 18px;
  min-height: 155px;
  min-width: 0;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-book);
  position: relative;
  overflow: hidden;
  text-align: left;
  transform: none !important;
  transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

html[dir="rtl"] .lang-matrix-card {
  text-align: right;
}

.lang-matrix-card:hover {
  background: #ffffff;
  border-color: var(--rule-strong);
  box-shadow: 0 4px 12px rgba(60, 45, 20, 0.08);
}

.lang-matrix-card:hover .lang-sample-preview {
  background: rgba(164, 50, 42, 0.05);
  border-color: rgba(164, 50, 42, 0.25);
  color: var(--oxblood);
}

.lang-matrix-card.active {
  background: #ffffff;
  border-color: var(--oxblood);
  box-shadow: 0 8px 24px rgba(164, 50, 42, 0.16);
  outline: 2px solid var(--oxblood);
}

.lang-matrix-card.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--oxblood);
}

.lang-matrix-card.active .lang-card-code {
  background: var(--oxblood);
  color: #ffffff;
  font-weight: 800;
  box-shadow: 0 2px 6px rgba(164, 50, 42, 0.25);
}

.lang-matrix-card.active .lang-sample-preview {
  background: rgba(164, 50, 42, 0.1);
  border-color: var(--oxblood);
  color: var(--oxblood);
  font-weight: 700;
}

.lang-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.lang-card-flag {
  font-size: 1.75rem;
  line-height: 1;
  display: inline-block;
}

.lang-card-code {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--ink-muted);
  background: var(--paper-deep);
  padding: 2px 7px;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.lang-native-name {
  font-size: 1.12rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 2px;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lang-english-name {
  font-size: 0.8rem;
  color: var(--ink-muted);
  margin-bottom: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lang-sample-preview {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-size: 0.8rem;
  color: var(--oxblood);
  font-weight: 600;
  line-height: 1.35;
  white-space: normal;
  word-break: break-word;
  display: block;
  width: 100%;
  box-sizing: border-box;
  transition: all 0.2s ease;
  min-height: 38px;
}

/* ==========================================================================
   ELEGANT SPOTLIGHT SHOWCASE
   ========================================================================== */
.section {
  padding: 80px 0;
  border-top: 1px solid var(--rule);
}

.section-tag {
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--oxblood);
  margin-bottom: 8px;
  text-align: center;
}

.section-title {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 3.8vw, 2.8rem);
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 14px;
  text-align: center;
  text-wrap: balance;
}

.section-sub {
  font-size: 1.1rem;
  color: var(--ink-soft);
  text-align: center;
  max-width: 620px;
  margin: 0 auto 36px;
  text-wrap: balance;
}

.showcase-step-pipeline {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin-bottom: 24px;
}

.step-nav-tab {
  background: var(--card);
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  text-align: inherit;
  box-shadow: 0 1px 3px rgba(35, 32, 27, 0.04);
}

.step-tab-num {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 800;
  color: var(--gold);
  background: var(--paper-deep);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--rule);
  flex-shrink: 0;
}

.step-tab-text {
  font-family: var(--font-serif);
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

html[dir="rtl"] .step-tab-text {
  font-family: var(--font-arabic);
}

.step-nav-tab:hover {
  background: #ffffff;
  border-color: var(--gold);
  transform: translateY(-2px);
}

.step-nav-tab.active {
  background: #ffffff;
  border-color: var(--oxblood);
  box-shadow: 0 4px 12px rgba(164, 50, 42, 0.12);
}

.step-nav-tab.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 12px;
  right: 12px;
  height: 3px;
  background: var(--oxblood);
  border-radius: 3px 3px 0 0;
}

.step-nav-tab.active .step-tab-num {
  background: var(--oxblood);
  color: #ffffff;
  border-color: var(--oxblood);
}

.spotlight-frame {
  background: var(--card);
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-showcase);
  margin-bottom: 24px;
  position: relative;
  direction: ltr !important;
}

.spotlight-browser-bar {
  background: var(--paper-deep);
  border-bottom: 1px solid var(--rule);
  padding: 10px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.browser-dots {
  display: flex;
  gap: 6px;
}

.b-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #c2b191;
}

.browser-dots .b-red { background: #e76d63; }
.browser-dots .b-yellow { background: #f0c355; }
.browser-dots .b-green { background: #60c578; }

.browser-address {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--ink-muted);
  background: var(--card);
  border: 1px solid var(--rule);
  padding: 3px 14px;
  border-radius: var(--radius-pill);
}

.browser-step-badge {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--oxblood);
  background: rgba(164, 50, 42, 0.09);
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(164, 50, 42, 0.2);
  letter-spacing: 0.06em;
}

.spotlight-img-container {
  position: relative;
  width: 100%;
  background: #11141e;
  overflow: hidden;
  min-height: 380px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.spotlight-img-container img {
  width: 100%;
  height: auto;
  display: block;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.showcase-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(245, 238, 220, 0.9);
  border: 1px solid var(--rule-strong);
  color: var(--oxblood);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  transition: all 0.18s ease;
  font-size: 1.2rem;
  font-weight: 700;
}

.showcase-arrow:hover {
  background: #ffffff;
  color: var(--oxblood);
  transform: translateY(-50%) scale(1.08);
}

.showcase-arrow.prev { left: 16px; }
.showcase-arrow.next { right: 16px; }

html[dir="rtl"] .showcase-arrow.prev {
  left: auto;
  right: 16px;
  transform: translateY(-50%) scaleX(-1);
}

html[dir="rtl"] .showcase-arrow.prev:hover {
  transform: translateY(-50%) scaleX(-1) scale(1.08);
}

html[dir="rtl"] .showcase-arrow.next {
  right: auto;
  left: 16px;
  transform: translateY(-50%) scaleX(-1);
}

html[dir="rtl"] .showcase-arrow.next:hover {
  transform: translateY(-50%) scaleX(-1) scale(1.08);
}

.spotlight-info-bar {
  padding: 18px 24px;
  background: var(--card);
  border-top: 1px solid var(--rule);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

html[dir="rtl"] .spotlight-info-bar {
  direction: rtl !important;
  text-align: right;
}

.spotlight-text-col {
  flex: 1;
  min-width: 260px;
}

.spotlight-heading {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--oxblood);
  margin-bottom: 4px;
}

.spotlight-subtext {
  font-size: 0.92rem;
  color: var(--ink-soft);
  line-height: 1.5;
}

.spotlight-controls-col {
  display: flex;
  align-items: center;
  gap: 16px;
}

.spotlight-dots-bar {
  display: flex;
  align-items: center;
  gap: 6px;
}

.s-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--rule-strong);
  cursor: pointer;
  transition: all 0.2s ease;
}

.s-dot:hover {
  background: var(--gold);
}

.s-dot.active {
  width: 22px;
  border-radius: var(--radius-pill);
  background: var(--oxblood);
}

/* Sequential Numbered Thumbnails Row */
.thumbnails-strip {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
}

.thumb-card {
  background: var(--card);
  border: 2px solid var(--rule);
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  box-shadow: var(--shadow-book);
}

.thumb-order-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  background: rgba(35, 32, 27, 0.78);
  color: #ffffff;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 3px;
  z-index: 2;
  backdrop-filter: blur(4px);
}

html[dir="rtl"] .thumb-order-badge {
  left: auto;
  right: 6px;
}

.thumb-card img {
  width: 100%;
  height: 80px;
  object-fit: cover;
  display: block;
}

.thumb-label {
  padding: 6px 8px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--ink);
  background: var(--paper);
  border-top: 1px solid var(--rule);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.thumb-card:hover {
  transform: translateY(-2px);
  border-color: var(--gold);
}

.thumb-card.active {
  border-color: var(--oxblood);
  box-shadow: 0 0 0 2px rgba(164, 50, 42, 0.25);
}

.thumb-card.active .thumb-order-badge {
  background: var(--oxblood);
}

.thumb-card.active .thumb-label {
  background: var(--oxblood);
  color: #ffffff;
}

@media (max-width: 900px) {
  .showcase-step-pipeline {
    grid-template-columns: 1fr;
  }
  .thumbnails-strip {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ==========================================================================
   WORKFLOW (HOW IT WORKS) ELEVATED CRAFT
   ========================================================================== */
.steps-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  align-items: stretch;
}

.step-card {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: 22px 20px;
  box-shadow: var(--shadow-book);
  transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
  gap: 16px;
}

.step-card-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1 1 auto;
}

.step-card:hover {
  background: #ffffff;
  border-color: var(--oxblood);
  box-shadow: 0 8px 24px rgba(60, 45, 20, 0.1);
}

.step-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.step-pill-tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--oxblood);
  background: rgba(164, 50, 42, 0.1);
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.step-icon-indicator {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--gold);
  white-space: nowrap;
}

.step-card h3 {
  font-family: var(--font-serif);
  font-size: 1.22rem;
  font-weight: 700;
  color: var(--ink);
  margin: 0;
  line-height: 1.35;
  min-height: 3.2rem;
  display: flex;
  align-items: center;
}

html[dir="rtl"] .step-card h3 {
  font-family: var(--font-arabic);
}

.step-card p {
  color: var(--ink-soft);
  font-size: 0.9rem;
  line-height: 1.55;
  margin: 0;
  flex-grow: 1;
}

/* Micro Demonstration Canvas inside each step - strictly equal and compact */
.step-micro-canvas {
  background: var(--paper);
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  margin-top: auto;
  font-size: 0.8rem;
  direction: ltr !important;
  text-align: left !important;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 6px;
  height: 102px;
  min-height: 102px;
  max-height: 102px;
  box-sizing: border-box;
}

.canvas-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.68rem;
  color: var(--ink-muted);
  font-family: var(--font-mono);
  white-space: nowrap;
  gap: 6px;
  height: 16px;
  flex-shrink: 0;
}

.canvas-header-bar > * {
  white-space: nowrap;
}

.canvas-pulse-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--forest);
  margin-right: 4px;
}

.canvas-snippet-text {
  font-family: var(--font-serif);
  color: var(--ink);
  font-size: 0.82rem;
  line-height: 22px;
  height: 22px;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 0;
}

.canvas-highlight-token {
  background: rgba(164, 50, 42, 0.15);
  color: var(--oxblood);
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 3px;
  border-bottom: 2px solid var(--oxblood);
}

.canvas-mini-popover {
  background: #ffffff;
  border: 1px solid var(--rule-strong);
  border-radius: 4px;
  padding: 4px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--oxblood);
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
  box-sizing: border-box;
  white-space: nowrap;
  gap: 8px;
  height: 26px;
  flex-shrink: 0;
}

.canvas-mini-popover span {
  white-space: nowrap;
}

.canvas-srs-pill {
  background: var(--paper-deep);
  color: var(--ink-soft);
  padding: 1px 5px;
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  white-space: nowrap;
  line-height: 1.3;
}

.canvas-srs-pill.active {
  background: var(--forest-soft);
  color: var(--forest);
  border: 1px solid var(--forest);
}

.features-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.feature-tile {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
  padding: 30px 26px;
  box-shadow: var(--shadow-book);
  transition: all 0.2s ease;
}

.feature-tile:hover {
  background: #ffffff;
  border-color: var(--rule-strong);
  transform: translateY(-2px);
}

.feature-icon-badge {
  font-size: 1.6rem;
  margin-bottom: 16px;
}

.feature-tile h3 {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--oxblood);
  margin-bottom: 8px;
}

.feature-tile p {
  color: var(--ink-soft);
  font-size: 0.94rem;
  line-height: 1.6;
}

/* ==========================================================================
   AUTHENTIC FLASHCARDS SECTION (MATCHING ACTUAL EXTENSION)
   ========================================================================== */
.flashcards-split-block {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 48px;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: 44px;
  box-shadow: var(--shadow-book);
  position: relative;
  overflow: hidden;
}

.flashcards-info-pane {
  display: flex;
  flex-direction: column;
}

.fc-stats-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

.fc-stat-chip {
  background: var(--paper);
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius-pill);
  padding: 4px 12px;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--ink-soft);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.fc-chip-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--forest);
  display: inline-block;
}

.fc-action-row {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.fc-deck-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.fc-nav-btn {
  background: var(--paper);
  border: 1px solid var(--rule-strong);
  border-radius: 4px;
  padding: 5px 14px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
  transition: all 0.15s ease;
}

.fc-nav-btn:hover {
  background: #ffffff;
  border-color: var(--oxblood);
  color: var(--oxblood);
}

.fc-counter-badge {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink-muted);
  letter-spacing: 0.05em;
  margin-left: 6px;
}

html[dir="rtl"] .fc-counter-badge {
  margin-left: 0;
  margin-right: 6px;
}

/* Authentic Index-Card Deck Container */
.flashcard-deck-wrapper {
  position: relative;
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
  perspective: 1400px;
}

.fc-top-counter {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--ink-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-align: center;
  margin-bottom: 8px;
}

.flashcard-stack-layer {
  position: absolute;
  border-radius: 6px;
  border: 1px solid var(--rule-strong);
  border-top: 4px double var(--oxblood);
  background-color: var(--card);
  background-image: repeating-linear-gradient(to bottom, transparent, transparent 27px, rgba(202, 189, 159, 0.28) 27px, rgba(202, 189, 159, 0.28) 28px);
  box-shadow: 0 8px 20px rgba(35, 32, 27, 0.08);
  pointer-events: none;
  transition: all 0.3s ease;
  z-index: 1;
}

.flashcard-stack-layer.layer-1 {
  top: 30px;
  bottom: 30px;
  left: 6px;
  right: -6px;
  opacity: 0.75;
  transform: rotate(1.5deg);
}

.flashcard-stack-layer.layer-2 {
  top: 36px;
  bottom: 24px;
  left: 12px;
  right: -12px;
  opacity: 0.45;
  transform: rotate(3deg);
}

html[dir="rtl"] .flashcard-stack-layer.layer-1 {
  left: -6px;
  right: 6px;
  transform: rotate(-1.5deg);
}

html[dir="rtl"] .flashcard-stack-layer.layer-2 {
  left: -12px;
  right: 12px;
  transform: rotate(-3deg);
}

.flashcard-card-box {
  width: 100%;
  min-height: 250px;
  cursor: pointer;
  user-select: none;
  outline: none;
  position: relative;
  z-index: 2;
}

.card-inner-rotator {
  position: relative;
  width: 100%;
  min-height: 250px;
  transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
  transform-style: preserve-3d;
}

.flashcard-card-box.flipped .card-inner-rotator {
  transform: rotateY(180deg);
}

.card-face-front,
.card-face-back {
  position: absolute;
  inset: 0;
  min-height: 250px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 18px 20px;
  border: 1px solid var(--rule-strong);
  border-radius: 6px;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  box-shadow: 0 8px 24px rgba(35, 32, 27, 0.09);
  background-color: var(--card);
  /* Authentic ruled index-card lines */
  background-image: repeating-linear-gradient(to bottom, transparent, transparent 27px, rgba(202, 189, 159, 0.28) 27px, rgba(202, 189, 159, 0.28) 28px);
  box-sizing: border-box;
  border-top: 4px double var(--oxblood);
}

.card-face-front::before {
  content: '';
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: 22px;
  width: 1px;
  background: rgba(164, 50, 42, 0.25);
  pointer-events: none;
}

.card-face-front {
  direction: ltr !important;
  text-align: center;
}

.card-face-back {
  transform: rotateY(180deg);
  direction: ltr !important;
  text-align: left;
}

.fc-front-source {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--ink-muted);
  letter-spacing: 0.06em;
  text-align: right;
  width: 100%;
}

.fc-front-word-wrap {
  margin: auto 0;
}

.fc-front-word {
  font-family: var(--font-serif);
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 2px;
}

.fc-front-ipa {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--ink-muted);
  font-weight: 600;
}

.fc-front-sentence {
  font-family: var(--font-serif);
  font-size: 0.86rem;
  font-style: italic;
  color: var(--ink-soft);
  line-height: 1.4;
  margin-bottom: 4px;
}

.fc-flip-hint-bar {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--ink-muted);
  text-align: center;
  border-top: 1px dashed var(--rule);
  padding-top: 6px;
  letter-spacing: 0.04em;
}

/* Back Face Styling matching Extension */
.fc-back-top {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-bottom: 4px;
}

.card-face-back .word-lg {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--oxblood);
}

.card-face-back .pos {
  font-family: var(--font-serif);
  font-size: 0.8rem;
  font-style: italic;
  color: var(--gold);
}

.card-face-back .def {
  font-family: var(--font-serif);
  font-size: 0.88rem;
  color: var(--ink);
  line-height: 1.4;
  text-align: center;
  margin-bottom: 6px;
}

.card-ctx-container {
  width: 100%;
  margin: 4px 0 8px 0;
  padding: 6px 10px;
  background: rgba(251, 248, 241, 0.85);
  border: 1px dashed var(--rule-strong);
  border-radius: 4px;
  box-sizing: border-box;
}

.card-ctx-text {
  font-family: var(--font-serif);
  font-size: 0.82rem;
  font-style: italic;
  color: var(--ink-soft);
  line-height: 1.35;
  margin-bottom: 4px;
}

.card-ctx-trans {
  font-family: var(--font-serif);
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--forest);
  background: var(--forest-soft);
  padding: 3px 8px;
  border-radius: 3px;
}

html[dir="rtl"] .card-ctx-trans {
  font-family: var(--font-arabic);
}

.fc-srs-rating-bar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  width: 100%;
  margin-top: 4px;
}

.fc-srs-btn {
  border-radius: 4px;
  padding: 4px 6px;
  border: 1px solid transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  transition: all 0.15s ease;
}

.fc-srs-btn .srs-days {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  opacity: 0.85;
}

.fc-srs-btn.btn-hard {
  background: rgba(164, 50, 42, 0.09);
  color: var(--oxblood);
  border-color: rgba(164, 50, 42, 0.22);
}
.fc-srs-btn.btn-hard:hover {
  background: var(--oxblood);
  color: #ffffff;
}

.fc-srs-btn.btn-good {
  background: rgba(179, 130, 52, 0.09);
  color: var(--gold);
  border-color: rgba(179, 130, 52, 0.25);
}
.fc-srs-btn.btn-good:hover {
  background: var(--gold);
  color: #ffffff;
}

.fc-srs-btn.btn-mastered {
  background: rgba(30, 107, 69, 0.09);
  color: var(--forest);
  border-color: rgba(30, 107, 69, 0.25);
}
.fc-srs-btn.btn-mastered:hover {
  background: var(--forest);
  color: #ffffff;
}

.fc-front-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 2px;
}

.fc-pos-tag {
  font-family: var(--font-serif);
  font-size: 0.78rem;
  font-style: italic;
  color: var(--gold);
}

.fc-deck-controls-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
}

.fc-deck-controls-bar .fc-nav-btn {
  background: var(--paper);
  border: 1px solid var(--rule-strong);
  border-radius: 4px;
  padding: 6px 18px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.fc-deck-controls-bar .fc-nav-btn:hover {
  background: #ffffff;
  border-color: var(--oxblood);
  color: var(--oxblood);
}

.fc-bottom-hint {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--ink-muted);
  text-align: center;
  margin-top: 6px;
}

.fc-toast {
  position: absolute;
  bottom: -15px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: #ffffff;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s ease;
  z-index: 10;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  white-space: nowrap;
}

.fc-toast.show {
  bottom: 8px;
  opacity: 1;
}

@media (max-width: 900px) {
  .flashcards-split-block {
    grid-template-columns: 1fr;
    gap: 32px;
    padding: 24px;
  }
}

/* ==========================================================================
   FAQ ACCORDION
   ========================================================================== */
.faq-box-list {
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.faq-row-item {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.faq-toggle-btn {
  width: 100%;
  text-align: left;
  padding: 18px 22px;
  background: none;
  border: none;
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: 1.08rem;
  font-weight: 700;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}

html[dir="rtl"] .faq-toggle-btn {
  text-align: right;
}

.faq-symbol-icon {
  font-size: 1.2rem;
  color: var(--oxblood);
  transition: transform 0.2s ease;
}

.faq-row-item.open .faq-symbol-icon {
  transform: rotate(45deg);
}

.faq-body-text {
  padding: 0 22px 18px;
  color: var(--ink-soft);
  font-size: 0.95rem;
  line-height: 1.6;
  display: none;
}

.faq-row-item.open .faq-body-text {
  display: block;
}

/* ==========================================================================
   ORGANIZED FOOTER WITH CLEAR COLUMNS
   ========================================================================== */
.bottom-cta-card {
  background: var(--card);
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius-lg);
  padding: 50px 30px;
  text-align: center;
  margin: 40px auto 60px;
  box-shadow: var(--shadow-book);
}

.site-footer-sec {
  background: var(--leather-2);
  color: #a8946f;
  border-top: 1px solid #14100a;
  padding: 50px 0 30px;
  font-size: 0.9rem;
}

.footer-columns-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}

.footer-col-title {
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 14px;
}

html[dir="rtl"] .footer-col-title {
  font-family: var(--font-arabic);
}

.footer-col-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-col-list a {
  color: #d9ab55;
  text-decoration: none;
  font-size: 0.88rem;
  transition: color 0.15s ease;
}

.footer-col-list a:hover {
  color: #ffffff;
}

.footer-brand-info p {
  color: #a8946f;
  font-size: 0.88rem;
  line-height: 1.6;
  margin-top: 12px;
  max-width: 320px;
}

.footer-bottom-line {
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.8rem;
  color: #78664a;
}

/* ==========================================================================
   MOBILE CONTROLS & RESPONSIVE RE-ENGINEERING (MOBILE & TABLET EXCELLENCE)
   ========================================================================== */

html {
  overflow-x: hidden;
  max-width: 100vw;
}

body {
  overflow-x: hidden;
  width: 100%;
}

/* Header Controls */
.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.desktop-only-action {
  display: flex;
  align-items: center;
}

.mobile-menu-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 38px;
  height: 38px;
  background: var(--paper-deep);
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius-sm);
  cursor: pointer;
  padding: 8px;
  transition: all 0.2s ease;
  z-index: 1001;
}

.mobile-menu-btn .hamburger-bar {
  width: 18px;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  transform-origin: center;
}

.mobile-menu-btn.open .hamburger-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
  background: var(--oxblood);
}
.mobile-menu-btn.open .hamburger-bar:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.mobile-menu-btn.open .hamburger-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
  background: var(--oxblood);
}

/* Mobile Navigation Drawer Overlay */
.mobile-drawer {
  position: fixed;
  top: 64px;
  left: 0;
  right: 0;
  background: rgba(246, 238, 219, 0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1.5px solid var(--rule-strong);
  box-shadow: 0 20px 40px rgba(35, 32, 27, 0.16);
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.38s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease;
  opacity: 0;
  z-index: 999;
}

.mobile-drawer.open {
  max-height: calc(100vh - 64px);
  opacity: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.mobile-drawer-inner {
  padding: 16px 16px 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.mobile-nav-links {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mobile-nav-item {
  display: flex;
  align-items: center;
  padding: 11px 14px;
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
  transition: all 0.15s ease;
}

.mobile-nav-item:hover,
.mobile-nav-item:active {
  background: #ffffff;
  border-color: var(--oxblood);
  color: var(--oxblood);
  transform: translateX(4px);
}

html[dir="rtl"] .mobile-nav-item:hover,
html[dir="rtl"] .mobile-nav-item:active {
  transform: translateX(-4px);
}

.mobile-drawer-divider {
  height: 1px;
  background: var(--rule);
  margin: 2px 0;
}

.mobile-drawer-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--gold);
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}

.mobile-lang-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}

.mobile-lang-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink-soft);
  background: var(--paper-deep);
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
}

html[dir="rtl"] .mobile-lang-chip {
  text-align: right;
}

.mobile-lang-chip:hover,
.mobile-lang-chip.active {
  background: #ffffff;
  border-color: var(--oxblood);
  color: var(--oxblood);
  font-weight: 700;
}

.mobile-drawer-cta {
  margin-top: 6px;
}

.mobile-drawer-cta .btn-block {
  width: 100%;
  padding: 13px;
  font-size: 0.95rem;
  justify-content: center;
}

/* Mobile Sticky Bottom Install Action Bar */
.mobile-sticky-bar {
  display: none;
  position: fixed !important;
  top: auto !important;
  bottom: 0 !important;
  left: 0 !important;
  right: 0 !important;
  background: rgba(246, 238, 219, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--rule-strong);
  box-shadow: 0 -4px 20px rgba(35, 32, 27, 0.12);
  padding: 9px 16px;
  padding-bottom: calc(9px + env(safe-area-inset-bottom, 0px));
  z-index: 990;
  animation: slideUpBar 0.3s ease;
}

@keyframes slideUpBar {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.mobile-sticky-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 600px;
  margin: 0 auto;
  gap: 10px;
}

.mobile-sticky-brand {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mobile-sticky-name {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--ink);
  line-height: 1.15;
}

.mobile-sticky-tag {
  font-size: 0.7rem;
  color: var(--forest);
  font-weight: 700;
}

.mobile-sticky-btn {
  padding: 7px 14px;
  font-size: 0.82rem;
  flex-shrink: 0;
}

/* ==========================================================================
   BREAKPOINTS: <= 960px, <= 640px, <= 375px
   ========================================================================== */

@media (max-width: 960px) {
  body {
    padding-bottom: calc(68px + env(safe-area-inset-bottom, 0px));
  }

  .container {
    padding: 0 20px;
  }

  .site-header {
    height: 60px;
  }

  .desktop-nav {
    display: none !important;
  }

  .mobile-menu-btn {
    display: flex !important;
  }

  .desktop-only-action,
  .site-header #headerInstallBtn,
  .site-header .header-cta-btn,
  .header-actions #headerInstallBtn,
  #headerInstallBtn {
    display: none !important;
  }

  .mobile-sticky-bar {
    display: block !important;
  }

  /* Hero Section */
  .hero {
    padding: 36px 0 28px;
  }

  .hero-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .hero-title {
    font-size: clamp(2rem, 7vw, 2.6rem);
    line-height: 1.18;
    margin-bottom: 12px;
  }

  .hero-desc {
    font-size: 0.98rem;
    line-height: 1.6;
    margin-bottom: 22px;
  }

  .hero-cta {
    flex-direction: column;
    width: 100%;
    gap: 10px;
  }

  .hero-cta .btn {
    width: 100%;
    justify-content: center;
    min-height: 48px;
    font-size: 0.98rem;
  }

  .hero-trust-bar {
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 10px 20px;
    font-size: 0.82rem;
  }

  /* Workflow Steps */
  .steps-cards-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
  }

  .hiw-step-card {
    padding: 20px 16px;
  }

  /* Showcase Horizontal Tabs */
  .showcase-step-pipeline {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    gap: 8px !important;
    padding-bottom: 8px !important;
    scroll-snap-type: x mandatory !important;
  }

  .showcase-step-pipeline::-webkit-scrollbar {
    display: none !important;
  }

  .step-nav-tab {
    flex-shrink: 0 !important;
    min-width: 145px !important;
    padding: 9px 12px !important;
    font-size: 0.8rem !important;
    scroll-snap-align: start !important;
  }

  .spotlight-img-container {
    min-height: 240px;
    max-height: 380px;
  }

  .showcase-arrow {
    width: 36px;
    height: 36px;
    font-size: 0.95rem;
  }

  /* 16 Languages Matrix on Tablet (4x4) */
  .languages-matrix-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
  }

  .lang-matrix-card {
    min-height: auto;
    padding: 12px 10px;
  }

  /* Flashcards Split Block */
  .flashcards-split-block {
    grid-template-columns: 1fr;
    padding: 22px 18px;
    gap: 24px;
  }

  .fc-stage-box {
    max-width: 380px;
    margin: 0 auto;
    width: 100%;
  }

  /* Footer */
  .footer-columns-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
  }
}

@media (max-width: 680px) {
  .container {
    padding: 0 16px;
  }

  .section {
    padding: 44px 0;
  }

  .section-title {
    font-size: 1.55rem;
    line-height: 1.22;
    margin-bottom: 8px;
  }

  .section-tag {
    font-size: 0.7rem;
    margin-bottom: 6px;
  }

  /* Workflow Steps on Mobile */
  .steps-cards-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .step-card h3 {
    min-height: auto;
  }

  /* Lexicon HUD Demo on Mobile */
  .lexicon-panel {
    width: 100%;
    max-width: 100%;
    margin: 0;
    box-sizing: border-box;
    overflow: hidden;
  }

  .panel-leather-head {
    padding: 8px 12px;
    width: 100%;
    box-sizing: border-box;
  }

  .leather-title {
    font-size: 0.95rem;
  }

  .panel-caption-box {
    padding: 12px 10px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .caption-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    width: 100%;
    box-sizing: border-box;
  }

  .caption-speaker {
    font-size: 0.76rem;
  }

  .caption-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 6px;
  }

  .btn-translate-line {
    padding: 3px 8px;
    font-size: 0.74rem;
  }

  .caption-prompt-text {
    font-size: 0.72rem;
  }

  .caption-line-text {
    font-size: 0.96rem;
    line-height: 1.6;
    word-break: break-word;
  }

  .word-token {
    display: inline-block;
    padding: 3px 6px;
    margin: 2px 1px;
    font-size: 0.88rem;
    border-radius: 4px;
  }

  .panel-entry-card {
    padding: 14px 10px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .entry-head {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    justify-content: space-between;
    width: 100%;
  }

  .entry-headword {
    font-size: 1.35rem;
  }

  .entry-phonetic {
    font-size: 0.82rem;
  }

  .btn-audio-speak {
    flex-shrink: 0;
    padding: 5px 9px;
    font-size: 0.74rem;
  }

  .entry-sense {
    font-size: 0.84rem;
    line-height: 1.5;
    word-break: break-word;
  }

  .entry-translation-band {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 8px 10px;
    gap: 6px;
  }

  .entry-trans-top-row {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    width: 100%;
  }

  .lang-dropdown-select {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    font-size: 0.74rem;
  }

  .trans-text-val {
    font-size: 0.88rem;
    word-break: break-word;
  }

  /* Dynamic entry popup on mobile */
  .word-popup-card {
    position: static !important;
    width: 100% !important;
    margin-top: 12px !important;
    transform: none !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12) !important;
    padding: 14px !important;
    box-sizing: border-box;
  }

  /* Showcase Section on Mobile */
  .showcase-step-pipeline {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  /* 16 Languages Matrix on Mobile (2x8) */
  .languages-matrix-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .lang-matrix-card {
    padding: 10px 8px;
    min-height: auto;
    box-sizing: border-box;
  }

  .lang-card-flag {
    font-size: 1.25rem;
  }

  .lang-card-code {
    font-size: 0.65rem;
  }

  .lang-native-name {
    font-size: 0.9rem;
    margin: 2px 0;
  }

  .lang-english-name {
    font-size: 0.7rem;
    margin-bottom: 6px;
  }

  .lang-sample-preview {
    font-size: 0.72rem;
    padding: 4px 6px;
    white-space: normal;
    word-break: break-word;
    min-height: 38px;
    box-sizing: border-box;
  }

  /* Flashcards Review on Mobile */
  .flashcards-split-block {
    padding: 18px 14px;
    gap: 20px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .fc-stage-box {
    max-width: 100%;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
  }

  .fc-card-face {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 18px 14px;
  }

  .fc-stats-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 4px;
    padding: 6px 8px;
  }

  .fc-stat-chip {
    font-size: 0.72rem;
  }

  .fc-srs-rating-bar {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
  }

  .fc-srs-btn {
    padding: 8px 2px;
    min-height: 44px;
    font-size: 0.72rem;
  }

  .fc-deck-controls-bar {
    display: flex;
    gap: 6px;
    margin-top: 10px;
  }

  .fc-nav-btn {
    flex: 1;
    min-height: 42px;
    font-size: 0.78rem;
  }

  /* FAQ on Mobile */
  .faq-box-list {
    gap: 8px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .faq-row-item {
    border-radius: var(--radius-sm);
  }

  .faq-toggle-btn {
    padding: 14px 12px;
    font-size: 0.92rem;
  }

  .faq-body-text {
    padding: 0 12px 14px;
    font-size: 0.85rem;
    line-height: 1.55;
  }

  /* Footer on Mobile */
  .footer-columns-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .footer-bottom-line {
    flex-direction: column;
    text-align: center;
    gap: 6px;
  }

  /* Onboarding Tour Box Floating Responsively on Mobile */
  .onboarding-tour-box {
    max-width: calc(100vw - 28px) !important;
    width: min(310px, calc(100vw - 28px)) !important;
    box-sizing: border-box !important;
    z-index: 900 !important;
  }

  /* Hide tour when mobile navigation drawer is active */
  .mobile-menu-btn.open ~ * #tourBox,
  body.menu-open #tourBox {
    display: none !important;
  }
}

/* Small Phone Screens (iPhone SE, mini <= 380px) */
@media (max-width: 380px) {
  .container {
    padding: 0 12px;
  }

  .nav-container {
    gap: 8px;
  }

  .brand-title {
    font-size: 1.15rem;
  }

  .brand {
    gap: 6px;
  }

  .brand-icon {
    width: 30px;
    height: 30px;
  }

  .header-actions {
    gap: 6px;
  }

  .lang-select-btn {
    padding: 5px 7px;
    gap: 3px;
  }

  .lang-select-btn #currentLangLabel {
    display: none;
  }

  .hero-title {
    font-size: 1.65rem;
  }

  .languages-matrix-grid {
    grid-template-columns: 1fr !important;
    gap: 8px;
  }

  .lang-matrix-card {
    padding: 10px 12px;
  }

  .lang-native-name {
    font-size: 0.95rem;
  }

  .mobile-lang-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   ONBOARDING GUIDED TOUR (DELIGHTFUL & NON-INTRUSIVE)
   ========================================================================== */
.onboarding-tour-box {
  position: absolute;
  width: 310px;
  background: var(--card);
  border: 1.5px solid var(--gold);
  border-radius: var(--radius-md);
  box-shadow: 0 14px 40px rgba(60, 45, 20, 0.22), 0 2px 8px rgba(0, 0, 0, 0.08);
  padding: 16px 18px 14px;
  z-index: 9999;
  animation: tourPop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}

@keyframes tourPop {
  from { opacity: 0; transform: translateY(6px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.tour-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.tour-step-badge {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--oxblood);
  background: rgba(164, 50, 42, 0.1);
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  letter-spacing: 0.05em;
}

.tour-btn-skip {
  background: none;
  border: none;
  color: var(--ink-muted);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: all 0.15s ease;
}

.tour-btn-skip:hover {
  color: var(--oxblood);
  background: rgba(164, 50, 42, 0.08);
}

.tour-title-text {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 4px;
  line-height: 1.35;
}

html[dir="rtl"] .tour-title-text {
  font-family: var(--font-arabic);
}

.tour-desc-text {
  font-size: 0.85rem;
  color: var(--ink-soft);
  line-height: 1.5;
  margin-bottom: 14px;
}

.tour-footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--rule);
  padding-top: 10px;
}

.tour-dots-indicator {
  display: flex;
  gap: 5px;
}

.tour-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--paper-deep);
  transition: all 0.2s ease;
}

.tour-dot.active {
  background: var(--oxblood);
  width: 14px;
  border-radius: var(--radius-pill);
}

.tour-btn-next {
  background: var(--oxblood);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 5px 14px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
}

.tour-btn-next:hover {
  background: #8b2820;
}

.tour-pointer-arrow {
  position: absolute;
  width: 10px;
  height: 10px;
  background: var(--card);
  border-left: 1.5px solid var(--gold);
  border-top: 1.5px solid var(--gold);
}

.tour-pointer-arrow.top {
  top: -6px;
  left: 30px;
  transform: rotate(45deg);
}

.tour-pointer-arrow.bottom {
  bottom: -6px;
  left: 30px;
  transform: rotate(225deg);
}

.tour-pointer-arrow.left {
  left: -6px;
  top: 24px;
  transform: rotate(-45deg);
}

.tour-pointer-arrow.right {
  right: -6px;
  top: 24px;
  transform: rotate(135deg);
}

/* Pulsing highlight on the target element */
.tour-target-active {
  position: relative;
  z-index: 99;
  outline: 2.5px solid var(--gold) !important;
  box-shadow: 0 0 0 4px rgba(179, 130, 52, 0.35) !important;
  animation: tourHaloPulse 1.6s infinite !important;
}

@keyframes tourHaloPulse {
  0% { box-shadow: 0 0 0 2px rgba(179, 130, 52, 0.4); }
  50% { box-shadow: 0 0 0 6px rgba(179, 130, 52, 0.15); }
  100% { box-shadow: 0 0 0 2px rgba(179, 130, 52, 0.4); }
}

/* ==========================================================================
   DOCUMENT & LEGAL PAGES CRAFT (PRIVACY & TERMS)
   ========================================================================== */
.doc-wrapper {
  padding: 48px 0 80px;
  max-width: 860px;
  margin: 0 auto;
}

.doc-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
  flex-wrap: wrap;
}

.doc-breadcrumb {
  font-size: 0.85rem;
  color: var(--ink-muted);
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
}

.doc-breadcrumb a {
  color: var(--oxblood);
  text-decoration: none;
  font-weight: 700;
  transition: color 0.15s ease;
}

.doc-breadcrumb a:hover {
  color: #8b2820;
  text-decoration: underline;
}

.legal-hub-switcher {
  display: inline-flex;
  background: var(--paper-deep);
  padding: 4px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--rule);
  gap: 4px;
}

.legal-tab-item {
  padding: 6px 14px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ink-muted);
  border-radius: var(--radius-pill);
  text-decoration: none;
  transition: all 0.18s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legal-tab-item:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.6);
}

.legal-tab-item.active {
  background: #ffffff;
  color: var(--oxblood);
  box-shadow: 0 2px 6px rgba(60, 45, 20, 0.08);
}

.doc-card-container {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: 48px 44px;
  box-shadow: var(--shadow-book);
  position: relative;
  line-height: 1.7;
}

@media (max-width: 640px) {
  .doc-card-container {
    padding: 28px 20px;
  }
}

.doc-card-container h1 {
  font-family: var(--font-serif);
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--ink);
  margin-bottom: 6px;
}

html[dir="rtl"] .doc-card-container h1,
html[dir="rtl"] .doc-card-container h2 {
  font-family: var(--font-arabic);
}

.doc-card-container h2 {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--ink);
  margin: 36px 0 12px;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 8px;
}

.doc-card-container h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
  margin: 20px 0 8px;
}

.doc-card-container p {
  color: var(--ink-soft);
  margin-bottom: 16px;
  font-size: 0.95rem;
}

.doc-card-container ul {
  margin-bottom: 20px;
  padding-left: 24px;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

html[dir="rtl"] .doc-card-container ul {
  padding-left: 0;
  padding-right: 24px;
}

.doc-card-container li {
  margin-bottom: 8px;
}

.doc-card-container code {
  background: var(--paper-deep);
  color: var(--oxblood);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.85em;
  border: 1px solid var(--rule);
}

.doc-highlight-box {
  background: rgba(179, 130, 52, 0.08);
  border-left: 4px solid var(--gold);
  padding: 16px 20px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 24px 0 28px;
  font-size: 0.92rem;
  color: var(--ink);
  line-height: 1.6;
}

html[dir="rtl"] .doc-highlight-box {
  border-left: none;
  border-right: 4px solid var(--gold);
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.doc-table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0 24px;
  font-size: 0.88rem;
  background: var(--paper);
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--rule);
}

.doc-table th {
  background: var(--paper-deep);
  padding: 10px 14px;
  text-align: left;
  font-weight: 700;
  color: var(--ink);
  border-bottom: 1px solid var(--rule-strong);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

html[dir="rtl"] .doc-table th {
  text-align: right;
}

.doc-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--rule);
  color: var(--ink-soft);
  vertical-align: top;
}

.doc-table tr:last-child td {
  border-bottom: none;
}

.doc-table tr:hover td {
  background: #ffffff;
}

.doc-link {
  color: var(--oxblood);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px dotted var(--oxblood);
  transition: all 0.15s ease;
}

.doc-link:hover {
  color: #8b2820;
  border-bottom-style: solid;
}

.doc-nav-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--rule);
  gap: 16px;
  flex-wrap: wrap;
}
