/* ==========================================================================
   DARIJA HERO v8 — 3D Royal Moroccan Scroll, Leather Book & Gold Medallion UI
   ========================================================================== */

:root {
  --bg: #efe4ce;
  --bg-deep: #e2d1b3;
  --paper: #fbf3e2;
  --paper-soft: #f3e5ca;
  --paper-deep: #e7d4b0;
  --ink: #23180b;
  --ink-soft: #4a3720;
  --muted: #6c5334;
  --emerald: #0b493f;
  --emerald-mid: #126658;
  --emerald-deep: #062b25;
  --emerald-soft: rgba(11, 73, 63, 0.12);
  --gold: #c99738;
  --gold-light: #f4d88a;
  --gold-dark: #8c6115;
  --terracotta: #b5482a;
  --success: #16794f;
  --danger: #b8332a;
  --border: rgba(156, 114, 42, 0.34);
  --shadow-sm: 0 4px 10px rgba(42, 27, 8, 0.10);
  --shadow: 0 10px 24px rgba(42, 27, 8, 0.15);
  --shadow-lg: 0 18px 36px rgba(32, 20, 5, 0.24);
  --serif: 'Fraunces', Georgia, serif;
  --sans: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --ar: 'IBM Plex Sans Arabic', Tahoma, sans-serif;
}

[data-theme="dark"] {
  --bg: #081310;
  --bg-deep: #050c0a;
  --paper: #13241f;
  --paper-soft: #192e28;
  --paper-deep: #0e1b17;
  --ink: #f7eedb;
  --ink-soft: #dfd0b4;
  --muted: #b5a382;
  --emerald: #197a69;
  --emerald-mid: #229480;
  --emerald-deep: #061b17;
  --emerald-soft: rgba(231, 200, 126, 0.14);
  --gold: #d9aa4c;
  --gold-light: #f7df9c;
  --gold-dark: #e6bc64;
  --border: rgba(217, 170, 76, 0.28);
  --shadow-sm: 0 6px 14px rgba(0, 0, 0, 0.38);
  --shadow: 0 12px 28px rgba(0, 0, 0, 0.48);
  --shadow-lg: 0 20px 42px rgba(0, 0, 0, 0.62);
}

*, *::before, *::after {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  padding: 0;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 246, 224, 0.65), transparent 60%),
    repeating-linear-gradient(45deg, rgba(168, 124, 48, 0.03) 0 14px, transparent 14px 28px),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-deep) 100%);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.45;
  min-height: 100dvh;
  overflow-x: hidden;
}

[data-theme="dark"] body {
  background:
    radial-gradient(circle at 50% 0%, rgba(24, 92, 79, 0.25), transparent 60%),
    linear-gradient(180deg, #091512 0%, #050b09 100%);
}

a {
  color: inherit;
  text-decoration: none;
}

button, select, input {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  position: relative;
  padding-bottom: calc(92px + env(safe-area-inset-bottom, 0px));
}

/* ---------- Top Metallic Emerald & Brushed Gold Bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 14px 10px;
  background:
    linear-gradient(90deg, #062b25 0%, #0c443b 48%, #2a5648 76%, #7d6b3d 100%);
  border-bottom: 1.5px solid rgba(238, 205, 130, 0.42);
  box-shadow: 0 6px 20px rgba(4, 24, 20, 0.32), inset 0 1px 0 rgba(255, 244, 212, 0.22);
  color: #fff9ec;
}

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

.brand-badge {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  padding: 1.5px;
  background: linear-gradient(135deg, #f5da8e, #9e7120);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35), inset 0 1px 1px #fff8dc;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.brand-crest-img {
  width: 100%;
  height: 100%;
  border-radius: 9.5px;
  display: block;
  object-fit: cover;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand-name {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.14rem;
  color: #fffdf7;
  letter-spacing: -0.01em;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.35);
}

.brand-sub {
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: #f3d483;
  margin-top: 2px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #f7f1e1;
  background: rgba(7, 38, 33, 0.62);
  border: 1px solid rgba(242, 211, 136, 0.38);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.status-dot-led {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #3be285;
  box-shadow: 0 0 8px #3be285;
}

.status-pill.is-offline .status-dot-led {
  background: #f0b24a;
  box-shadow: 0 0 6px #f0b24a;
}

.icon-pill {
  padding: 6px 11px;
  border-radius: 999px;
  background: rgba(8, 41, 35, 0.68);
  color: #fdf5e2;
  border: 1px solid rgba(242, 211, 136, 0.45);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.icon-circle {
  position: relative;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: rgba(8, 41, 35, 0.68);
  color: #fdf5e2;
  border: 1px solid rgba(242, 211, 136, 0.45);
  display: grid;
  place-items: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.settings-dot {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #f4c862;
}

/* ---------- Main Content ---------- */
.main-content {
  flex: 1;
  padding: 0 12px 24px;
}

/* ---------- 3D Royal Emerald Hero Banner ---------- */
.hero-banner.hero-3d {
  position: relative;
  overflow: hidden;
  margin: 10px -4px -18px;
  padding: 20px 18px 34px;
  border-radius: 22px 22px 16px 16px;
  background:
    radial-gradient(circle at 85% 22%, rgba(239, 204, 122, 0.22), transparent 48%),
    repeating-linear-gradient(60deg, rgba(240, 215, 150, 0.03) 0 12px, transparent 12px 24px),
    linear-gradient(145deg, #0b483f 0%, #052520 100%);
  border: 1.5px solid rgba(232, 196, 114, 0.42);
  box-shadow: 0 14px 28px rgba(5, 32, 27, 0.28), inset 0 1px 0 rgba(255, 245, 214, 0.22);
  color: #f9eccb;
}

.hero-arabesque {
  position: absolute;
  top: -18px;
  right: -18px;
  width: 148px;
  height: 148px;
  pointer-events: none;
  opacity: 0.92;
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.38));
}

.hero-compact-copy {
  position: relative;
  z-index: 2;
  max-width: 78%;
}

.hero-compact-title {
  font-family: var(--serif);
  font-size: 1.62rem;
  line-height: 1.14;
  margin: 0 0 10px;
  color: #f7deb0;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.hero-compact-title em {
  font-style: italic;
  color: #ffe7a8;
}

.cockpit-sub {
  margin: 4px 0 0;
  font-size: 0.8rem;
  color: rgba(249, 238, 212, 0.85);
}

.streak-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fcebc8;
  background: rgba(7, 35, 30, 0.65);
  border: 1px solid rgba(235, 200, 118, 0.4);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.streak-chip svg {
  color: #f2b84b;
}

/* ---------- 3D Unfurling Parchment Scroll & Wooden/Brass Rollers ---------- */
.scroll-stage {
  position: relative;
  z-index: 4;
  margin: 0 0 12px;
  filter: drop-shadow(0 14px 26px rgba(38, 24, 6, 0.22));
}

.scroll-roller {
  display: flex;
  align-items: center;
  position: relative;
  z-index: 6;
  margin: 0 -2px;
}

.roller-spindle {
  width: 14px;
  height: 24px;
  border-radius: 5px;
  background: linear-gradient(180deg, #6e4e1e 0%, #e5be67 35%, #9c6f23 70%, #4a310e 100%);
  border: 1px solid rgba(255, 236, 179, 0.55);
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.35);
  flex-shrink: 0;
}

.roller-spindle.left {
  border-radius: 7px 3px 3px 7px;
}

.roller-spindle.right {
  border-radius: 3px 7px 7px 3px;
}

.roller-cylinder {
  flex: 1;
  min-height: 28px;
  border-radius: 999px;
  background:
    linear-gradient(180deg,
      #fffef9 0%,
      #f6ead2 28%,
      #dfc89e 68%,
      #b5935a 92%,
      #8b6830 100%);
  border-top: 1px solid rgba(255, 255, 255, 0.9);
  border-bottom: 1.5px solid rgba(110, 76, 22, 0.65);
  box-shadow:
    0 6px 12px rgba(34, 21, 5, 0.28),
    inset 0 2px 3px rgba(255, 255, 255, 0.85),
    inset 0 -3px 6px rgba(96, 65, 16, 0.35);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 2px 12px;
}

[data-theme="dark"] .roller-cylinder {
  background:
    linear-gradient(180deg,
      #3a4d45 0%,
      #253630 45%,
      #16221e 85%,
      #0d1512 100%);
  border-top-color: rgba(235, 200, 120, 0.45);
  border-bottom-color: rgba(0, 0, 0, 0.8);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.55), inset 0 1px 2px rgba(245, 215, 142, 0.25);
}

.roller-band {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 8px;
  background: linear-gradient(180deg, #fae29c 0%, #c69232 50%, #734f10 100%);
  opacity: 0.75;
}

.roller-band.left { left: 10px; }
.roller-band.right { right: 10px; }

/* Scroll Roller Tab Bar (Used on Book Detail & Practice Hub) */
.scroll-roller-tabs {
  display: flex;
  align-items: center;
  position: relative;
  z-index: 6;
  margin: 0 -2px;
}

.segmented-tabs-3d {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 4px 8px;
  border-radius: 999px;
  background:
    linear-gradient(180deg, #fffdf6 0%, #f1e2c5 55%, #d6bc8e 100%);
  border-top: 1px solid rgba(255, 255, 255, 0.92);
  border-bottom: 1.5px solid rgba(118, 82, 24, 0.6);
  box-shadow:
    0 6px 14px rgba(34, 21, 5, 0.26),
    inset 0 2px 3px rgba(255, 255, 255, 0.8);
}

.segmented-tabs-3d.two-tabs {
  grid-template-columns: repeat(2, 1fr);
}

[data-theme="dark"] .segmented-tabs-3d {
  background: linear-gradient(180deg, #243831 0%, #15231f 100%);
  border-color: rgba(226, 185, 96, 0.35);
}

.seg-tab-3d {
  border: none;
  background: transparent;
  color: var(--ink-soft);
  font-size: 0.76rem;
  font-weight: 800;
  padding: 8px 6px;
  border-radius: 999px;
  transition: all 0.16s ease;
  white-space: nowrap;
}

.seg-tab-3d.active {
  background: linear-gradient(145deg, #0d5449 0%, #062c26 100%);
  color: #fff9ea;
  border: 1px solid rgba(239, 206, 128, 0.55);
  box-shadow: 0 3px 8px rgba(6, 40, 35, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

[data-theme="dark"] .seg-tab-3d.active {
  background: linear-gradient(145deg, #d8a848 0%, #9b6e1b 100%);
  color: #161005;
}

/* Parchment Scroll Interior */
.scroll-parchment-body {
  position: relative;
  margin: -4px 6px;
  padding: 22px 16px 20px;
  background:
    radial-gradient(circle at 50% 25%, rgba(255, 253, 246, 0.85), transparent 70%),
    linear-gradient(90deg, rgba(164, 122, 52, 0.16) 0%, transparent 6%, transparent 94%, rgba(164, 122, 52, 0.16) 100%),
    linear-gradient(180deg, #fcf5e6 0%, #f5e7cb 52%, #eedbb7 100%);
  border-left: 2px solid rgba(182, 138, 60, 0.55);
  border-right: 2px solid rgba(182, 138, 60, 0.55);
  box-shadow:
    inset 0 8px 14px rgba(120, 84, 24, 0.14),
    inset 0 -8px 14px rgba(120, 84, 24, 0.16);
}

[data-theme="dark"] .scroll-parchment-body {
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.35) 0%, transparent 7%, transparent 93%, rgba(0, 0, 0, 0.35) 100%),
    linear-gradient(180deg, #162923 0%, #101f1b 55%, #0c1815 100%);
  border-left-color: rgba(217, 170, 76, 0.35);
  border-right-color: rgba(217, 170, 76, 0.35);
  box-shadow:
    inset 0 8px 16px rgba(0, 0, 0, 0.45),
    inset 0 -8px 16px rgba(0, 0, 0, 0.45);
}

/* 4 Zellige Corner Filigree Ornaments */
.zellige-corner {
  position: absolute;
  width: 40px;
  height: 40px;
  pointer-events: none;
  z-index: 1;
  opacity: 0.9;
}

.zellige-corner.tl { top: 4px; left: 4px; }
.zellige-corner.tr { top: 4px; right: 4px; transform: scaleX(-1); }
.zellige-corner.bl { bottom: 4px; left: 4px; transform: scaleY(-1); }
.zellige-corner.br { bottom: 4px; right: 4px; transform: scale(-1, -1); }

/* Middle Scroll Fold Roller */
.scroll-mid-divider {
  display: flex;
  align-items: center;
  margin: 18px -18px;
  position: relative;
  z-index: 3;
}

.mid-spindle {
  width: 10px;
  height: 18px;
  background: linear-gradient(180deg, #74521e, #e4bd66, #5c3d11);
  border-radius: 4px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.mid-rod {
  flex: 1;
  height: 16px;
  background: linear-gradient(180deg, #fffdf8 0%, #ead8b6 55%, #bfa06d 100%);
  border-top: 1px solid rgba(255, 255, 255, 0.85);
  border-bottom: 1px solid rgba(124, 88, 28, 0.55);
  box-shadow: 0 5px 10px rgba(48, 31, 7, 0.18);
}

[data-theme="dark"] .mid-rod {
  background: linear-gradient(180deg, #2b423a 0%, #172621 100%);
  border-color: rgba(217, 170, 76, 0.32);
}

/* ---------- 3D Embossed Gold Medallion Progress Ring ---------- */
.medallion-3d {
  position: relative;
  border-radius: 999px;
  background:
    radial-gradient(circle at 32% 28%, #fff6cc 0%, #e4b953 38%, #a6741c 78%, #6d480a 100%);
  padding: 7px;
  box-shadow:
    0 10px 22px rgba(58, 38, 6, 0.35),
    0 0 18px rgba(238, 196, 96, 0.45),
    inset 0 2px 3px rgba(255, 250, 224, 0.9),
    inset 0 -3px 6px rgba(78, 50, 6, 0.7);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.medallion-3d.emerald {
  background:
    radial-gradient(circle at 32% 28%, #f8df95 0%, #c69635 32%, #0f564a 68%, #072d26 100%);
}

.medallion-filigree-rim {
  position: absolute;
  inset: 3px;
  border-radius: 999px;
  border: 1.5px dashed rgba(255, 245, 206, 0.65);
  pointer-events: none;
}

.medallion-svg {
  transform: rotate(-90deg);
  display: block;
  position: relative;
  z-index: 2;
}

.medallion-core {
  position: absolute;
  inset: 14px;
  border-radius: 999px;
  background:
    radial-gradient(circle at 35% 30%, #d4a644 0%, #986917 65%, #6e490b 100%);
  box-shadow: inset 0 3px 6px rgba(38, 23, 2, 0.55), 0 1px 1px rgba(255, 243, 198, 0.65);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2px;
  z-index: 1;
}

.medallion-3d.emerald .medallion-core {
  background:
    radial-gradient(circle at 35% 30%, #156758 0%, #093b32 72%, #05221d 100%);
}

.medallion-main {
  font-family: var(--sans);
  font-weight: 800;
  font-size: 0.84rem;
  line-height: 1.0;
  color: #fff9e6;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.55);
}

.medallion-sub {
  font-size: 0.54rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #ffeaac;
  margin-top: 2px;
  line-height: 1;
}

/* ---------- 3D Diamond Medallion Badges ---------- */
.diamond-3d {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  transform: rotate(45deg);
  background: linear-gradient(135deg, #f8df96 0%, #c69330 52%, #7d5610 100%);
  padding: 3px;
  box-shadow:
    0 6px 14px rgba(32, 20, 4, 0.28),
    inset 0 1px 2px rgba(255, 250, 224, 0.9);
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
}

.diamond-3d.lg {
  width: 62px;
  height: 62px;
  border-radius: 13px;
  padding: 4px;
}

.diamond-3d.sm {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  padding: 2.5px;
}

.diamond-inner {
  width: 100%;
  height: 100%;
  border-radius: 7px;
  background: radial-gradient(circle at 30% 30%, #167262 0%, #083830 85%);
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.45);
  display: grid;
  place-items: center;
  color: #f6d786;
}

.diamond-3d.gold .diamond-inner {
  background: radial-gradient(circle at 30% 30%, #e5b852 0%, #8c6014 88%);
  color: #fff8de;
}

.diamond-3d.terra .diamond-inner {
  background: radial-gradient(circle at 30% 30%, #ca5938 0%, #7d2b14 88%);
  color: #ffe7bd;
}

.diamond-inner > svg {
  transform: rotate(-45deg);
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.4));
}

/* ---------- Today Screen (#today) ---------- */
.continue-scroll-section {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 14px;
  padding: 4px 4px 2px;
}

.continue-copy {
  flex: 1;
  min-width: 0;
}

.scroll-eyebrow, .eyebrow {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold-dark);
}

/* Fixed high-contrast dark espresso ink on parchment! */
.scroll-lesson-title {
  font-family: var(--serif);
  font-size: 1.32rem;
  line-height: 1.2;
  margin: 5px 0 6px;
  color: var(--ink);
}

.scroll-lesson-sub {
  font-size: 0.84rem;
  color: var(--ink-soft);
  margin: 0 0 14px;
}

/* 3D Brushed Gold Pill Button */
.gold-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 999px;
  border: 1.5px solid #9c6e1c;
  background:
    linear-gradient(180deg, #fff3c4 0%, #efd080 18%, #cfa042 68%, #a6761e 100%);
  background-color: #d8ac4e;
  color: #201506;
  font-weight: 800;
  font-size: 0.88rem;
  box-shadow:
    0 6px 14px rgba(92, 62, 10, 0.32),
    inset 0 2px 2px rgba(255, 252, 235, 0.9),
    inset 0 -2px 4px rgba(102, 68, 12, 0.45);
  transition: transform 0.14s ease, box-shadow 0.14s ease;
}

.gold-cta:active {
  transform: translateY(1px);
}

/* Today 2-Column 3D Diamond Action Tiles */
.today-diamond-grid {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding: 6px 4px 2px;
}

.diamond-action-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 14px 10px 10px;
  border-radius: 18px;
  background: rgba(255, 250, 238, 0.62);
  border: 1px solid rgba(180, 136, 56, 0.34);
  box-shadow: 0 6px 14px rgba(54, 36, 8, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.8);
  transition: transform 0.15s ease;
}

[data-theme="dark"] .diamond-action-tile {
  background: rgba(24, 44, 38, 0.72);
  border-color: rgba(217, 170, 76, 0.28);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.35);
}

.diamond-action-tile:active {
  transform: scale(0.98);
}

.diamond-tile-title {
  font-family: var(--serif);
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--ink);
  margin-top: 16px;
}

.diamond-tile-sub {
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 2px;
}

/* ---------- 3D Beveled Parchment Plaques ---------- */
.plaque-3d {
  position: relative;
  border-radius: 18px;
  background:
    linear-gradient(180deg, #fffdf7 0%, #f5e8ce 100%);
  border: 1.5px solid rgba(176, 132, 54, 0.48);
  box-shadow:
    0 8px 18px rgba(48, 31, 7, 0.12),
    inset 0 2px 0 rgba(255, 255, 255, 0.92),
    inset 0 -3px 6px rgba(156, 114, 42, 0.14);
}

[data-theme="dark"] .plaque-3d {
  background: linear-gradient(180deg, #1a2f29 0%, #12211d 100%);
  border-color: rgba(217, 170, 76, 0.34);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255, 240, 195, 0.12);
}

/* Daily Phrase & Clean Phrase Cards */
.potd-card, .phrase-clean-card {
  padding: 15px 16px;
  margin-bottom: 10px;
}

.potd-top, .phrase-clean-top {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  margin-bottom: 8px;
}

.tag-pill {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: rgba(182, 136, 52, 0.16);
  color: var(--gold-dark);
  border: 1px solid rgba(182, 136, 52, 0.32);
}

.mastered-pill {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.66rem;
  font-weight: 800;
  background: var(--emerald-soft);
  color: var(--emerald);
}

.potd-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.slow-btn {
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--paper-soft);
  color: var(--ink);
  font-size: 0.74rem;
  font-weight: 800;
}

.circle-action-btn {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--paper-soft);
  color: var(--ink);
  display: grid;
  place-items: center;
  font-size: 0.88rem;
  box-shadow: var(--shadow-sm);
}

.circle-action-btn.primary {
  background: linear-gradient(145deg, #0d5246, #062b25);
  color: #fff9eb;
  border-color: rgba(235, 200, 120, 0.5);
}

.circle-action-btn.active {
  background: linear-gradient(145deg, #e7c065, #b48222);
  color: #1d1304;
}

.potd-ar {
  font-family: var(--ar);
  font-size: 1.5rem;
  font-weight: 700;
  text-align: right;
  direction: rtl;
  color: var(--ink);
  margin: 6px 0 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(168, 124, 48, 0.2);
}

.potd-latin {
  font-weight: 800;
  font-size: 1.02rem;
  color: var(--emerald);
  margin-bottom: 4px;
}

[data-theme="dark"] .potd-latin {
  color: var(--gold-light);
}

.potd-bottom {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
}

.potd-en {
  font-size: 0.86rem;
  color: var(--muted);
}

.breakdown-link {
  border: none;
  background: transparent;
  padding: 0;
  color: var(--gold-dark);
  font-size: 0.8rem;
  font-weight: 800;
  white-space: nowrap;
}

/* ---------- Books Tab (#books): 2x2 Upright 3D Hardcover Books ---------- */
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  gap: 10px;
  margin: 14px 2px 10px;
}

.section-head h2 {
  font-family: var(--serif);
  font-size: 1.48rem;
  margin: 2px 0 0;
  color: var(--ink);
}

.section-sub {
  margin: 2px 0 0;
  font-size: 0.78rem;
  color: var(--muted);
}

.section-pill {
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 800;
  background: var(--paper);
  border: 1px solid var(--border);
  color: var(--ink-soft);
  box-shadow: var(--shadow-sm);
  white-space: nowrap;
}

.books-3d-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px 12px;
  margin-bottom: 18px;
}

.book-3d-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: transform 0.18s ease;
}

.book-3d-card:active {
  transform: scale(0.97);
}

.book-3d-visual {
  position: relative;
  width: 100%;
  display: flex;
  justify-content: center;
}

.book-3d-img {
  width: 100%;
  max-width: 205px;
  height: auto;
  display: block;
  filter: drop-shadow(0 14px 18px rgba(28, 17, 4, 0.36));
}

.book-3d-ring-badge {
  position: absolute;
  top: 4px;
  right: 2px;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: radial-gradient(circle, rgba(255, 245, 214, 0.35), rgba(186, 144, 64, 0.25));
  backdrop-filter: blur(3px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.28), 0 0 12px rgba(245, 215, 135, 0.45);
}

.book-3d-ring-badge svg {
  transform: rotate(-90deg);
}

.book-3d-pct {
  position: absolute;
  font-size: 0.68rem;
  font-weight: 800;
  color: #fff9e6;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.75);
}

.book-3d-meta {
  text-align: center;
  margin-top: 4px;
  padding: 0 4px;
}

.book-3d-vol {
  display: block;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--gold-dark);
  text-transform: uppercase;
}

.book-3d-sub {
  display: block;
  font-size: 0.73rem;
  color: var(--muted);
  line-height: 1.25;
}

/* ---------- Ornate 3D Carved Moroccan Archway Card (Books Tab Only) ---------- */
.moroccan-arch-showcase {
  margin-top: 6px;
}

.arch-wood-frame {
  border-radius: 24px 24px 20px 20px;
  padding: 12px;
  background:
    radial-gradient(circle at 50% 0%, rgba(226, 176, 84, 0.22), transparent 55%),
    repeating-linear-gradient(45deg, rgba(255, 220, 150, 0.04) 0 8px, transparent 8px 16px),
    linear-gradient(180deg, #5e3b1e 0%, #3d2410 55%, #291709 100%);
  border: 2px solid #a87b34;
  box-shadow:
    0 16px 32px rgba(28, 16, 4, 0.35),
    inset 0 2px 3px rgba(255, 230, 175, 0.38),
    inset 0 -3px 8px rgba(0, 0, 0, 0.6);
}

.arch-frame-header {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  padding: 4px 6px 10px;
  color: #f7dfb2;
}

.arch-header-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--serif);
  font-size: 0.98rem;
  font-weight: 700;
}

.arch-header-ico {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(245, 214, 138, 0.16);
  border: 1px solid rgba(245, 214, 138, 0.38);
  display: grid;
  place-items: center;
  color: #f5d68a;
}

.arch-next-btn {
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(245, 214, 138, 0.45);
  background: rgba(24, 13, 4, 0.45);
  color: #f7dfb2;
  font-size: 0.7rem;
  font-weight: 700;
}

.arch-parchment-niche {
  border-radius: 90px 90px 14px 14px;
  padding: 22px 14px 14px;
  background:
    radial-gradient(circle at 50% 15%, #fffdf7 0%, #f5e6c8 65%, #e5cfa3 100%);
  border: 2px solid #c49644;
  box-shadow:
    inset 0 6px 16px rgba(72, 46, 10, 0.25),
    0 4px 10px rgba(0, 0, 0, 0.28);
  color: #261a0b;
}

[data-theme="dark"] .arch-parchment-niche {
  background: radial-gradient(circle at 50% 15%, #1d332c 0%, #11201b 85%);
  color: #f7eedb;
}

.arch-niche-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.arch-mini-door {
  width: 82px;
  height: 108px;
  border-radius: 44px 44px 10px 10px;
  overflow: hidden;
  border: 2px solid #c59642;
  box-shadow: 0 6px 14px rgba(42, 26, 6, 0.25);
  flex-shrink: 0;
}

.arch-mini-door img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.arch-note-copy h4 {
  font-family: var(--serif);
  font-size: 1.06rem;
  margin: 2px 0 5px;
}

.arch-note-copy p {
  margin: 0;
  font-size: 0.79rem;
  line-height: 1.42;
  opacity: 0.9;
}

.arch-tea-footer {
  margin-top: 8px;
  border-radius: 12px;
  overflow: hidden;
  border: 1.5px solid rgba(212, 166, 76, 0.48);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

.arch-tea-footer img {
  width: 100%;
  height: 112px;
  object-fit: cover;
  display: block;
}

/* ---------- Book Detail Screen (#book/1..4) ---------- */
.book-header-parchment {
  position: relative;
  overflow: hidden;
  margin: 10px 0 8px;
  padding: 16px 16px;
  border-radius: 20px;
  background:
    radial-gradient(circle at 88% 20%, rgba(19, 108, 92, 0.16), transparent 50%),
    linear-gradient(145deg, #fbf2df 0%, #edd9b4 100%);
  border: 1.5px solid rgba(176, 132, 54, 0.48);
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
}

[data-theme="dark"] .book-header-parchment {
  background: linear-gradient(145deg, #0d3f36 0%, #072520 100%);
  border-color: rgba(226, 185, 96, 0.38);
}

.book-header-copy {
  position: relative;
  z-index: 2;
  min-width: 0;
}

.back-link-gold, .back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.76rem;
  font-weight: 800;
  color: var(--gold-dark);
  margin-bottom: 6px;
}

.book-header-eyebrow {
  display: block;
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--gold-dark);
}

.book-header-title {
  font-family: var(--serif);
  font-size: 1.75rem;
  margin: 2px 0 3px;
  color: var(--ink);
}

.book-header-sub {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.book-header-medallion {
  position: relative;
  z-index: 2;
}

/* Ornate 3D Brass & Emerald Banner Button */
.ornate-brass-banner {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 18px;
  margin-bottom: 14px;
  border-radius: 14px;
  background:
    linear-gradient(90deg, #0e584b 0%, #7d5b21 14%, #a87c2f 50%, #7d5b21 86%, #0e584b 100%);
  border: 1.5px solid #e7c26d;
  color: #fff8e4;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 0.94rem;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.55);
  box-shadow:
    0 6px 14px rgba(42, 27, 6, 0.26),
    inset 0 1px 2px rgba(255, 245, 205, 0.65);
}

/* Collapsible Unit Groups & 3D Lesson Plaques */
.unit-scroll-group {
  position: relative;
  z-index: 2;
  margin-bottom: 14px;
}

.unit-scroll-head {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  padding: 6px 4px 10px;
  cursor: pointer;
}

.unit-scroll-head::-webkit-details-marker {
  display: none;
}

.unit-head-left {
  display: flex;
  align-items: center;
  gap: 6px;
}

.unit-eyebrow {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: var(--gold-dark);
}

.unit-fold-indicator {
  font-size: 0.82rem;
  color: var(--gold-dark);
}

.unit-pin-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.pin-action-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--ink);
  background: rgba(255, 249, 235, 0.78);
  border: 1px solid rgba(176, 132, 54, 0.42);
  box-shadow: 0 2px 5px rgba(42, 27, 6, 0.1);
}

[data-theme="dark"] .pin-action-pill {
  background: rgba(24, 44, 38, 0.85);
}

.lesson-list-3d {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.lesson-plaque-3d {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  padding: 13px 15px;
  border-radius: 16px;
  background: linear-gradient(180deg, #fffdf7 0%, #f3e4c6 100%);
  border: 1.5px solid rgba(174, 130, 52, 0.52);
  box-shadow:
    0 6px 14px rgba(46, 30, 6, 0.12),
    inset 0 2px 0 rgba(255, 255, 255, 0.92),
    inset 0 0 0 2px rgba(212, 172, 94, 0.18);
  transition: transform 0.14s ease;
}

[data-theme="dark"] .lesson-plaque-3d {
  background: linear-gradient(180deg, #1b312a 0%, #12211d 100%);
  border-color: rgba(217, 170, 76, 0.35);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.4);
}

.lesson-plaque-3d:active {
  transform: scale(0.99);
}

.lesson-row-main {
  min-width: 0;
  flex: 1;
}

.lesson-code {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--gold-dark);
}

.lesson-name {
  font-family: var(--sans);
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--ink);
  margin: 1px 0 2px;
}

.lesson-sub {
  font-size: 0.75rem;
  color: var(--muted);
}

/* 3D Emerald & Gold Diamond Status Knob on Lesson Rows */
.diamond-status-3d {
  width: 34px;
  height: 34px;
  border-radius: 7px;
  transform: rotate(45deg);
  background: linear-gradient(135deg, #166a5b 0%, #08352d 100%);
  border: 2px solid #d9ab4e;
  box-shadow: 0 4px 10px rgba(28, 18, 4, 0.26);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.diamond-knob {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  transform: rotate(-45deg);
  background: radial-gradient(circle at 32% 30%, #fff4c2 0%, #d8a642 65%, #8a5e12 100%);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.45);
  display: grid;
  place-items: center;
  font-size: 0.68rem;
  font-weight: 900;
  color: #1c1203;
}

.diamond-status-3d.done .diamond-knob {
  background: radial-gradient(circle at 32% 30%, #a6f7d4 0%, #1ea876 70%, #0b5c3e 100%);
  color: #fff;
}

/* ---------- Drills Hub (#practice) ---------- */
.scroll-parchment-body.has-floating-medallion {
  padding-top: 24px;
}

.floating-cockpit-medallion {
  float: right;
  margin: -8px -4px 8px 10px;
  position: relative;
  z-index: 5;
}

.drills-stack-3d {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.drill-plaque-3d {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 16px;
  background: linear-gradient(180deg, #fffdf8 0%, #f3e6cc 100%);
  border: 1.5px solid rgba(176, 132, 54, 0.48);
  box-shadow:
    0 6px 14px rgba(42, 27, 6, 0.12),
    inset 0 2px 0 rgba(255, 255, 255, 0.9);
  position: relative;
  overflow: hidden;
}

[data-theme="dark"] .drill-plaque-3d {
  background: linear-gradient(180deg, #1b312a 0%, #12211d 100%);
  border-color: rgba(217, 170, 76, 0.34);
}

.drill-plaque-3d.featured {
  padding-right: 40px;
}

.drill-gold-edge {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 30px;
  background: linear-gradient(180deg, #f3d27a 0%, #c4902e 100%);
  color: #201505;
  display: grid;
  place-items: center;
  font-weight: 900;
  border-left: 1px solid rgba(124, 86, 20, 0.45);
}

.drill-plaque-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.drill-plaque-title {
  font-weight: 800;
  font-size: 0.94rem;
  color: var(--ink);
}

.drill-plaque-sub {
  font-size: 0.74rem;
  color: var(--muted);
  line-height: 1.3;
}

.drill-chev {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--muted);
}

.emblem-triangle-3d, .emblem-star-3d {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: radial-gradient(circle at 30% 30%, #fff5d6, #e6cc92);
  border: 1.5px solid rgba(182, 126, 44, 0.55);
  box-shadow: 0 4px 10px rgba(48, 30, 6, 0.16);
  display: grid;
  place-items: center;
  color: #b84b29;
  flex-shrink: 0;
}

.emblem-star-3d {
  color: #d49c2a;
}

/* By Book 2x2 Selector & 2x3 3D Mode Grid */
.book-selector-grid-3d {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  padding-right: 78px;
}

.book-sel-plaque {
  padding: 11px 10px;
  border-radius: 13px;
  border: 1.5px solid rgba(176, 132, 54, 0.48);
  background: linear-gradient(180deg, #fffdf7 0%, #f1e1c1 100%);
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 800;
  text-align: left;
  box-shadow: 0 4px 10px rgba(42, 27, 6, 0.1);
}

[data-theme="dark"] .book-sel-plaque {
  background: linear-gradient(180deg, #1b312a 0%, #12211d 100%);
  color: var(--ink);
}

.book-sel-plaque.active {
  background: linear-gradient(145deg, #0d5246 0%, #062b25 100%);
  color: #fff9eb;
  border-color: #e4bc64;
  box-shadow: 0 6px 14px rgba(6, 40, 35, 0.32);
}

.book-practice-top {
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  margin-bottom: 12px;
}

.pick-unit-link {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--ink-soft);
}

.mode-3d-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.mode-3d-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 14px 8px 12px;
  border-radius: 16px;
  background: linear-gradient(180deg, #fffdf7 0%, #f1dfc0 100%);
  border: 1.5px solid rgba(176, 132, 54, 0.52);
  box-shadow:
    0 6px 14px rgba(42, 27, 6, 0.14),
    inset 0 2px 0 rgba(255, 255, 255, 0.92);
  color: var(--ink);
  transition: transform 0.14s ease;
}

[data-theme="dark"] .mode-3d-tile {
  background: linear-gradient(180deg, #1b312a 0%, #12211d 100%);
  border-color: rgba(217, 170, 76, 0.38);
}

.mode-3d-tile.active {
  background: linear-gradient(145deg, #115c4f 0%, #073029 100%);
  border: 2px solid #e7c26d;
  color: #fff9eb;
  box-shadow: 0 8px 18px rgba(7, 46, 40, 0.35), 0 0 12px rgba(23, 148, 124, 0.35);
}

.mode-3d-ico {
  color: #b88420;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.2));
}

.mode-3d-tile.active .mode-3d-ico {
  color: #f6d580;
}

.mode-3d-lbl {
  font-size: 0.8rem;
  font-weight: 800;
}

/* ---------- Phrasebook (#phrasebook) ---------- */
.search-input-3d {
  width: 100%;
  padding: 12px 15px;
  margin: 10px 0;
  border-radius: 14px;
  border: 1.5px solid rgba(176, 132, 54, 0.48);
  background: #fffdf8;
  color: var(--ink);
  font-size: 0.9rem;
  box-shadow: inset 0 2px 5px rgba(58, 38, 8, 0.1), 0 2px 6px rgba(255, 255, 255, 0.7);
}

[data-theme="dark"] .search-input-3d {
  background: #0e1b17;
  border-color: rgba(217, 170, 76, 0.35);
  color: var(--ink);
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.filter-chip {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(176, 132, 54, 0.42);
  background: rgba(255, 251, 240, 0.85);
  color: var(--ink-soft);
  font-size: 0.76rem;
  font-weight: 700;
}

[data-theme="dark"] .filter-chip {
  background: rgba(24, 44, 38, 0.85);
}

.filter-chip.active {
  background: linear-gradient(145deg, #0d5246, #062b25);
  color: #fff9eb;
  border-color: #e4bc64;
}

.pb-cat-grid-3d {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.pb-cat-plaque-3d {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 14px 10px 12px;
  border-radius: 16px;
  background: linear-gradient(180deg, #fffdf7 0%, #f2e2c3 100%);
  border: 1.5px solid rgba(176, 132, 54, 0.52);
  box-shadow:
    0 6px 14px rgba(42, 27, 6, 0.12),
    inset 0 2px 0 rgba(255, 255, 255, 0.9);
  color: var(--ink);
}

[data-theme="dark"] .pb-cat-plaque-3d {
  background: linear-gradient(180deg, #1b312a 0%, #12211d 100%);
  border-color: rgba(217, 170, 76, 0.35);
}

.pb-medallion-circle {
  width: 46px;
  height: 46px;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 30%, #177362 0%, #07332b 85%);
  border: 2.5px solid #ddb151;
  box-shadow: 0 5px 12px rgba(24, 15, 3, 0.25), inset 0 2px 4px rgba(255, 255, 255, 0.25);
  display: grid;
  place-items: center;
  color: #f6d685;
  margin-bottom: 8px;
}

.pb-cat-title {
  font-weight: 800;
  font-size: 0.86rem;
  color: var(--ink);
  line-height: 1.2;
}

.pb-cat-count {
  font-size: 0.74rem;
  color: var(--muted);
  margin-top: 3px;
}

/* ---------- Progress / Stats Screen (#stats) ---------- */
.stats-medallion-showcase {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 2px 0 16px;
}

.stats-medallion-caption {
  margin: 8px 0 0;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
}

.split-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.stat-plaque {
  padding: 12px 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.stat-plaque h3 {
  font-family: var(--sans);
  font-size: 1.05rem;
  font-weight: 800;
  margin: 2px 0;
  color: var(--ink);
}

.stat-plaque p {
  margin: 0;
  font-size: 0.71rem;
  color: var(--muted);
}

/* 7-Day Activity 3D Emerald & Gold Vertical Pillars */
.activity-pillars-3d {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 7px;
  margin-top: 8px;
}

.pillar-3d {
  height: 78px;
  border-radius: 12px;
  background: linear-gradient(180deg, #b89852 0%, #3a5c4d 45%, #0b3c33 100%);
  border: 2px solid #d5ab54;
  box-shadow:
    0 5px 10px rgba(32, 20, 4, 0.22),
    inset 0 2px 3px rgba(255, 244, 204, 0.55);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  padding-bottom: 6px;
}

.pillar-3d.today {
  border-color: #ffe291;
  box-shadow: 0 0 12px rgba(238, 196, 92, 0.55), 0 5px 10px rgba(32, 20, 4, 0.28);
}

.pillar-fill {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(180deg, rgba(245, 212, 128, 0.55), rgba(19, 132, 110, 0.85));
  pointer-events: none;
}

.pillar-count {
  position: relative;
  z-index: 2;
  font-size: 0.72rem;
  font-weight: 900;
  color: #fff9e6;
  margin-bottom: auto;
  padding-top: 5px;
}

.pillar-day {
  position: relative;
  z-index: 2;
  font-size: 0.68rem;
  font-weight: 800;
  color: #fff6dc;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.65);
}

/* Progress by Volume: 2x2 Grid of 3D Brushed Brass Plaques (All 4 Volumes) */
.brass-volumes-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 9px;
  margin-top: 8px;
}

.brass-volume-plaque {
  padding: 10px 12px;
  border-radius: 12px;
  background:
    linear-gradient(180deg, #ecd08a 0%, #c89b42 52%, #9a6e1d 100%);
  border: 1.5px solid #78520e;
  box-shadow:
    0 5px 12px rgba(48, 31, 5, 0.24),
    inset 0 1.5px 2px rgba(255, 248, 220, 0.85);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  color: #211504;
}

.brass-vol-name {
  font-size: 0.8rem;
  font-weight: 800;
}

.brass-vol-pct {
  font-size: 0.86rem;
  font-weight: 900;
  margin-top: 2px;
}

/* ---------- Lesson Audio Player & Interactive Practice Elements ---------- */
.phrase-progress-bar {
  height: 6px;
  border-radius: 999px;
  background: rgba(164, 120, 44, 0.22);
  overflow: hidden;
  margin-bottom: 8px;
}

.phrase-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #0d584b, #d8a846);
  border-radius: 999px;
}

.phrase-counter {
  font-size: 0.74rem;
  font-weight: 800;
  color: var(--muted);
  text-align: center;
  margin-bottom: 10px;
}

.script-pills {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-bottom: 12px;
}

.script-pill {
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--paper-soft);
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
}

.script-pill.on {
  background: linear-gradient(145deg, #0d5246, #062b25);
  color: #fff9eb;
  border-color: #e4bc64;
}

.arch-arabic {
  font-family: var(--ar);
  font-size: 1.8rem;
  font-weight: 700;
  text-align: center;
  direction: rtl;
  color: var(--ink);
  margin: 8px 0;
}

.arabizi-pill {
  text-align: center;
  font-size: 1.12rem;
  font-weight: 800;
  color: var(--emerald);
  margin-bottom: 6px;
}

[data-theme="dark"] .arabizi-pill {
  color: var(--gold-light);
}

.arch-english {
  text-align: center;
  font-size: 0.92rem;
  color: var(--muted);
  margin-bottom: 12px;
}

.is-masked {
  filter: blur(6px);
  cursor: pointer;
}

.is-hidden {
  opacity: 0.1;
  cursor: pointer;
}

.waveform {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: 34px;
  margin: 10px 0;
}

.wave-bar {
  width: 3.5px;
  border-radius: 999px;
  background: rgba(180, 134, 50, 0.45);
  transition: transform 0.2s ease;
}

.waveform.playing .wave-bar {
  background: var(--emerald);
  animation: wavePulse 0.6s infinite ease-in-out alternate;
}

@keyframes wavePulse {
  from { transform: scaleY(0.45); }
  to { transform: scaleY(1.18); }
}

.player-main-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin: 12px 0;
}

.star-play-btn {
  width: 58px;
  height: 58px;
  border-radius: 999px;
  border: 2.5px solid #edd082;
  background: radial-gradient(circle at 30% 30%, #167262 0%, #062b25 85%);
  color: #fff8e6;
  display: grid;
  place-items: center;
  box-shadow: 0 8px 18px rgba(7, 46, 40, 0.35);
}

.silver-pill, .pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--paper);
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 800;
  box-shadow: var(--shadow-sm);
}

.pill-btn.primary, .silver-pill.active {
  background: linear-gradient(145deg, #0d5246, #062b25);
  color: #fff9eb;
  border-color: #e4bc64;
}

.player-toggles {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin: 10px 0;
  padding: 10px;
  border-radius: 14px;
  background: rgba(182, 138, 60, 0.1);
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  font-size: 0.76rem;
  font-weight: 700;
}

.switch-btn {
  width: 40px;
  height: 22px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(140, 100, 32, 0.28);
  position: relative;
}

.switch-btn::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: #fffdf7;
  transition: transform 0.16s ease;
}

.switch-btn.on, .switch-btn.recording {
  background: var(--emerald);
}

.switch-btn.on::after, .switch-btn.recording::after {
  transform: translateX(17px);
}

.phrase-nav-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  margin-top: 8px;
}

/* Flashcards, Quiz, Match & Builder */
.flashcard-stage {
  perspective: 900px;
  margin: 10px 0 14px;
  cursor: pointer;
}

.flashcard-inner {
  min-height: 165px;
  border-radius: 18px;
  padding: 22px 16px;
  background: linear-gradient(180deg, #fffdf8 0%, #f1e1c2 100%);
  border: 1.5px solid rgba(176, 132, 54, 0.52);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

[data-theme="dark"] .flashcard-inner {
  background: linear-gradient(180deg, #1b312a 0%, #12211d 100%);
}

.flashcard-back {
  display: none;
}

.flashcard-stage.is-flipped .flashcard-face:first-child {
  display: none;
}

.flashcard-stage.is-flipped .flashcard-back {
  display: block;
}

.srs-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.srs-btn {
  padding: 10px 8px;
  border-radius: 14px;
  border: 1.5px solid var(--border);
  background: var(--paper);
  font-weight: 800;
  font-size: 0.84rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.srs-btn span {
  font-size: 0.68rem;
  color: var(--muted);
  font-weight: 600;
}

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.quiz-opt {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1.5px solid rgba(176, 132, 54, 0.45);
  background: linear-gradient(180deg, #fffdf8 0%, #f3e4c7 100%);
  color: var(--ink);
  text-align: left;
  font-weight: 700;
  font-size: 0.88rem;
}

[data-theme="dark"] .quiz-opt {
  background: linear-gradient(180deg, #1b312a 0%, #12211d 100%);
}

.quiz-opt.correct {
  background: rgba(22, 121, 79, 0.18);
  border-color: var(--success);
}

.quiz-opt.wrong {
  background: rgba(184, 51, 42, 0.18);
  border-color: var(--danger);
}

.match-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 12px;
}

.match-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.match-card {
  padding: 11px 10px;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  background: var(--paper);
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 700;
  text-align: center;
}

.match-card.selected {
  border-color: var(--emerald);
  background: var(--emerald-soft);
}

.match-card.matched {
  opacity: 0.32;
  pointer-events: none;
}

.tile-answer, .tile-pool {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 48px;
  padding: 10px;
  border-radius: 14px;
  border: 1px dashed var(--border);
  margin: 10px 0;
}

.word-tile, .word-chip-3d {
  padding: 7px 12px;
  border-radius: 10px;
  border: 1px solid rgba(176, 132, 54, 0.5);
  background: linear-gradient(180deg, #fffdf8, #eddcb9);
  color: #211505;
  font-weight: 800;
  font-size: 0.84rem;
  box-shadow: 0 3px 6px rgba(42, 27, 6, 0.12);
}

.typing-input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1.5px solid var(--border);
  background: var(--paper);
  color: var(--ink);
  font-size: 0.95rem;
  margin-bottom: 12px;
}

/* Tables & Grammar Notes */
.data-table-wrap {
  overflow-x: auto;
}

.darija-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.darija-table th, .darija-table td {
  padding: 8px 10px;
  border-bottom: 1px solid rgba(168, 124, 48, 0.22);
  text-align: left;
}

.darija-table th {
  font-weight: 800;
  color: var(--gold-dark);
}

.clickable-row {
  cursor: pointer;
}

.row-play-tag {
  display: inline-block;
  margin-right: 6px;
  color: var(--emerald);
  font-size: 0.7rem;
}

.grammar-details summary {
  padding: 12px 14px;
  font-weight: 800;
  cursor: pointer;
}

.grammar-details-body {
  padding: 0 14px 12px;
  font-size: 0.85rem;
}

/* ---------- 3D Settings & Breakdown Modals ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(5, 22, 18, 0.72);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  overflow-y: auto;
}

.modal-backdrop[hidden] {
  display: none !important;
}

.modal-card {
  width: 100%;
  max-width: 430px;
  max-height: 90dvh;
  overflow-y: auto;
  background: transparent;
  border: none;
  box-shadow: none;
}

.settings-3d-modal {
  border-radius: 24px;
  overflow: hidden;
  background: linear-gradient(180deg, #072e28 0%, #0b4138 30%, #e9d8b8 30%, #e9d8b8 100%);
  padding: 14px 10px 10px;
  border: 1.5px solid rgba(235, 200, 120, 0.45);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.55);
}

[data-theme="dark"] .settings-3d-modal {
  background: linear-gradient(180deg, #072e28 0%, #0c1815 35%, #0c1815 100%);
}

.settings-hero-head {
  position: relative;
  padding: 4px 10px 16px;
}

.scroll-modal-wrap {
  position: relative;
}

.scroll-modal-body {
  position: relative;
  margin: -4px 6px;
  padding: 20px 16px;
  background: linear-gradient(180deg, #fcf5e6 0%, #eedbb7 100%);
  border-left: 2px solid rgba(182, 138, 60, 0.55);
  border-right: 2px solid rgba(182, 138, 60, 0.55);
  color: var(--ink);
}

[data-theme="dark"] .scroll-modal-body {
  background: linear-gradient(180deg, #162923 0%, #0d1916 100%);
}

.brass-close-btn {
  padding: 4px 14px;
  border-radius: 8px;
  border: 1.5px solid #8a5e12;
  background: linear-gradient(180deg, #f9e29b 0%, #c99635 100%);
  color: #1f1404;
  font-size: 0.76rem;
  font-weight: 800;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.28);
}

.settings-row-3d {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  position: relative;
  z-index: 2;
}

.settings-row-title {
  font-weight: 800;
  font-size: 0.94rem;
}

.settings-row-sub {
  font-size: 0.75rem;
  color: var(--muted);
}

.settings-divider {
  height: 1px;
  background: rgba(168, 124, 48, 0.25);
  margin: 12px 0;
}

/* 3D Gold Toggle Switch */
.gold-toggle-3d {
  width: 56px;
  height: 30px;
  border-radius: 999px;
  padding: 3px;
  border: 1.5px solid #8e6317;
  background: linear-gradient(180deg, #d7b268 0%, #9e7426 100%);
  box-shadow: inset 0 2px 5px rgba(42, 26, 4, 0.45), 0 2px 5px rgba(255, 255, 255, 0.6);
  display: flex;
  align-items: center;
}

.gold-toggle-3d.on {
  background: linear-gradient(180deg, #167362 0%, #083830 100%);
  border-color: #e8c067;
}

.gold-toggle-knob {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: radial-gradient(circle at 32% 30%, #fff9df 0%, #deb04d 65%, #8c5e10 100%);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
  transition: transform 0.18s ease;
  transform: translateX(24px);
}

.gold-toggle-3d:not(.on) .gold-toggle-knob {
  transform: translateX(0);
}

.brass-select-3d {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1.5px solid #8c6115;
  background: linear-gradient(180deg, #f3d993 0%, #c69638 100%);
  color: #1f1404;
  font-size: 0.8rem;
  font-weight: 800;
  box-shadow: 0 4px 10px rgba(52, 34, 6, 0.22), inset 0 1px 1px rgba(255, 250, 224, 0.85);
}

/* Moroccan Archway Frame inside Settings Modal */
.settings-arch-box {
  position: relative;
  margin-top: 16px;
  padding: 28px 14px 12px;
  text-align: center;
}

.settings-arch-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.settings-arch-content {
  position: relative;
  z-index: 2;
}

.settings-arch-title {
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  color: var(--ink);
}

.settings-arch-sub {
  font-size: 0.74rem;
  color: var(--muted);
  margin: 4px 0 10px;
}

.brass-wide-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 88%;
  margin: 0 auto 8px;
  padding: 9px 14px;
  border-radius: 999px;
  border: 1.5px solid #75500e;
  background: linear-gradient(180deg, #d8b263 0%, #9b7021 100%);
  color: #fff8e6;
  font-size: 0.82rem;
  font-weight: 800;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
  box-shadow: 0 4px 10px rgba(42, 27, 5, 0.25), inset 0 1px 1px rgba(255, 245, 205, 0.65);
}

.settings-backup-heading {
  font-family: var(--serif);
  font-size: 1.05rem;
  margin: 12px 0 8px;
}

.settings-backup-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.emerald-plaque-btn, .brass-plaque-btn {
  padding: 9px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  text-align: center;
  box-shadow: 0 4px 10px rgba(32, 20, 4, 0.24);
}

.emerald-plaque-btn {
  background: linear-gradient(180deg, #126152 0%, #07332b 100%);
  border: 1.5px solid #d9ab4e;
  color: #fff9eb;
}

.brass-plaque-btn {
  background: linear-gradient(180deg, #c99b42 0%, #835a12 100%);
  border: 1.5px solid #6b4709;
  color: #fff8e6;
}

.emerald-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 11px 16px;
  border-radius: 999px;
  background: linear-gradient(145deg, #0e584b, #062b25);
  border: 1.5px solid #e4bc64;
  color: #fff9eb;
  font-weight: 800;
  font-size: 0.86rem;
  box-shadow: var(--shadow);
}

/* ---------- 5-Tab Bottom Navigation Dock ---------- */
.app-dock-nav {
  position: fixed;
  left: 50%;
  bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  width: calc(100% - 20px);
  max-width: 460px;
  z-index: 50;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  padding: 6px;
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255, 251, 240, 0.96) 0%, rgba(242, 227, 198, 0.96) 100%);
  border: 1.5px solid rgba(182, 138, 58, 0.48);
  box-shadow:
    0 12px 28px rgba(32, 20, 4, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
}

[data-theme="dark"] .app-dock-nav {
  background: linear-gradient(180deg, rgba(22, 40, 35, 0.96) 0%, rgba(12, 23, 20, 0.96) 100%);
  border-color: rgba(217, 170, 76, 0.36);
}

.nav-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 7px 4px;
  border-radius: 17px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  transition: all 0.16s ease;
}

.nav-item.active {
  background:
    linear-gradient(180deg, #f8e29e 0%, #d8ab4c 60%, #b58222 100%);
  color: #07332b;
  font-weight: 800;
  box-shadow:
    0 5px 12px rgba(148, 104, 24, 0.36),
    inset 0 1.5px 1px rgba(255, 252, 235, 0.85);
}

.nav-badge {
  position: absolute;
  top: 3px;
  right: 10px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: #c83e2b;
  color: #fff;
  font-size: 0.62rem;
  font-weight: 800;
  display: grid;
  place-items: center;
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(88px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 100;
  padding: 9px 16px;
  border-radius: 999px;
  background: #072e28;
  color: #fff9eb;
  border: 1px solid #e4bc64;
  font-size: 0.8rem;
  font-weight: 700;
  box-shadow: var(--shadow-lg);
}


/* ==========================================================================
   v9 UPGRADES: 3D Unit Cards, Beginner Guide Preview, Example Chips,
   3D Phrasebook Medallions, 7-Day Star Coins & Horizontal Progress Graphs
   ========================================================================== */

/* 1. Rich 3D Closed & Open Unit Plaque Cards */
.unit-card-3d {
  position: relative;
  z-index: 2;
  margin-bottom: 12px;
  border-radius: 18px;
  background: linear-gradient(180deg, #fffdf7 0%, #f3e4c5 100%);
  border: 1.5px solid rgba(174, 130, 52, 0.55);
  box-shadow:
    0 8px 18px rgba(46, 30, 6, 0.12),
    inset 0 2px 0 rgba(255, 255, 255, 0.92),
    inset 0 -3px 6px rgba(156, 114, 42, 0.12);
  overflow: hidden;
  transition: box-shadow 0.18s ease;
}

[data-theme="dark"] .unit-card-3d {
  background: linear-gradient(180deg, #1b312a 0%, #11201c 100%);
  border-color: rgba(217, 170, 76, 0.38);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.42);
}

.unit-card-summary {
  list-style: none;
  padding: 13px 14px 12px;
  cursor: pointer;
  user-select: none;
}

.unit-card-summary::-webkit-details-marker {
  display: none;
}

.unit-card-top {
  display: flex;
  align-items: center;
  gap: 11px;
}

.unit-badge-3d {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  background: linear-gradient(135deg, #f8df95 0%, #c69330 52%, #7d5610 100%);
  padding: 2.5px;
  box-shadow: 0 5px 12px rgba(32, 20, 4, 0.24), inset 0 1px 1px rgba(255, 250, 224, 0.9);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.unit-badge-inner {
  width: 100%;
  height: 100%;
  border-radius: 8.5px;
  background: radial-gradient(circle at 30% 30%, #177262 0%, #07332b 88%);
  color: #fff6dc;
  font-weight: 900;
  font-size: 0.84rem;
  display: grid;
  place-items: center;
}

.unit-badge-3d.done .unit-badge-inner {
  background: radial-gradient(circle at 30% 30%, #27a878 0%, #0b5c3e 90%);
}

.unit-card-info {
  flex: 1;
  min-width: 0;
}

.unit-card-eyebrow {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--gold-dark);
}

.unit-card-title {
  font-family: var(--serif);
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--ink);
  margin: 1px 0 6px;
  line-height: 1.2;
}

.unit-progress-track {
  height: 6px;
  border-radius: 999px;
  background: rgba(156, 114, 42, 0.22);
  overflow: hidden;
}

.unit-progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #0d584b, #dfa93e);
}

.unit-expand-pill {
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(182, 138, 60, 0.16);
  border: 1px solid rgba(176, 132, 54, 0.38);
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--gold-dark);
  flex-shrink: 0;
}

.unit-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px dashed rgba(168, 124, 48, 0.25);
}

.unit-lessons-body {
  padding: 4px 12px 14px;
  border-top: 1px solid rgba(168, 124, 48, 0.22);
  background: rgba(255, 252, 244, 0.45);
}

[data-theme="dark"] .unit-lessons-body {
  background: rgba(8, 18, 15, 0.35);
}

/* 2. Beginner Lesson Guide Preview & Clickable Example Chips */
.guide-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 10px;
  margin-bottom: 8px;
}

.guide-summary-preview {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--ink);
}

.example-chips-box {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(182, 138, 60, 0.11);
  border: 1px solid rgba(176, 132, 54, 0.32);
}

.example-chips-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.example-chip-3d {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 11px;
  border-radius: 999px;
  border: 1.2px solid #b88728;
  background: linear-gradient(180deg, #fffdf7 0%, #f1dfb8 100%);
  color: #1f1404;
  font-size: 0.78rem;
  font-weight: 800;
  box-shadow: 0 3px 7px rgba(42, 27, 6, 0.12), inset 0 1px 0 #fff;
}

[data-theme="dark"] .example-chip-3d {
  background: linear-gradient(180deg, #213b33 0%, #142520 100%);
  color: #f7eedb;
  border-color: #d9aa4c;
}

.inline-example-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 8px;
  margin: 0 2px;
  border-radius: 999px;
  border: 1px solid rgba(180, 132, 42, 0.55);
  background: rgba(245, 218, 150, 0.32);
  color: var(--emerald);
  font-weight: 800;
  font-size: 0.82rem;
}

[data-theme="dark"] .inline-example-chip {
  background: rgba(217, 170, 76, 0.2);
  color: var(--gold-light);
}

.guide-divider {
  height: 1px;
  background: rgba(168, 124, 48, 0.25);
  margin: 12px 0;
}

.guide-subhead {
  font-family: var(--serif);
  font-size: 1rem;
  margin: 12px 0 4px;
  color: var(--emerald);
}

[data-theme="dark"] .guide-subhead {
  color: var(--gold-light);
}

.guide-para {
  margin: 8px 0;
  font-size: 0.86rem;
  line-height: 1.52;
  color: var(--ink);
}

.play-all-pill {
  padding: 5px 11px;
  border-radius: 999px;
  border: 1.2px solid #c69535;
  background: linear-gradient(180deg, #fff5cc 0%, #e1b655 100%);
  color: #1f1404;
  font-size: 0.72rem;
  font-weight: 800;
  box-shadow: 0 3px 8px rgba(64, 42, 6, 0.2);
}

.play-all-pill.playing {
  background: linear-gradient(180deg, #d84b35 0%, #962615 100%);
  border-color: #f7c297;
  color: #fff;
}

/* 3. Cloze Fill-in-the-Blank Box */
.cloze-sentence-box {
  padding: 12px;
  border-radius: 12px;
  background: rgba(11, 73, 63, 0.08);
  border: 1px dashed rgba(11, 73, 63, 0.35);
  font-size: 1.08rem;
  font-weight: 800;
  color: var(--emerald);
}

[data-theme="dark"] .cloze-sentence-box {
  background: rgba(231, 200, 126, 0.1);
  border-color: rgba(231, 200, 126, 0.35);
  color: var(--gold-light);
}

.cloze-blank {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 8px;
  background: rgba(212, 162, 62, 0.24);
  border-bottom: 2px solid var(--gold-dark);
  color: var(--gold-dark);
}

.cloze-blank.filled {
  background: rgba(22, 121, 79, 0.2);
  border-bottom-color: var(--success);
  color: var(--success);
}

/* 4. 3D Phrasebook Category Medallions & Mistake Tag */
.pb-medallion-3d-wrap {
  display: inline-grid;
  place-items: center;
  margin-bottom: 8px;
  filter: drop-shadow(0 6px 10px rgba(24, 15, 3, 0.28));
}

.mistake-tag-pill {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.66rem;
  font-weight: 800;
  background: rgba(181, 72, 42, 0.15);
  color: var(--terracotta);
}

/* 5. Progress Tab: 7-Day Gold Star Coin Strip & Horizontal 3D Bar Graphs */
.streak-coins-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.streak-coin-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.streak-coin-circle {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: rgba(168, 124, 48, 0.14);
  border: 1.5px dashed rgba(168, 124, 48, 0.45);
  display: grid;
  place-items: center;
  font-size: 1rem;
  color: var(--muted);
}

.streak-coin-slot.today .streak-coin-circle {
  border-style: solid;
  border-color: var(--emerald);
  box-shadow: 0 0 0 2px rgba(11, 73, 63, 0.16);
}

.streak-coin-slot.stamped .streak-coin-circle {
  border-style: solid;
  border-color: #8f6214;
  background: radial-gradient(circle at 32% 28%, #fff5c4 0%, #e5b852 55%, #9e6e18 100%);
  color: #211504;
  box-shadow: 0 4px 10px rgba(142, 98, 20, 0.35), inset 0 1px 2px #fff;
}

.streak-coin-day {
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--muted);
}

.graph-bars-stack {
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.graph-bar-row {
  display: block;
  text-decoration: none;
  color: inherit;
}

.graph-bar-top {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  margin-bottom: 4px;
}

.graph-bar-title {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--ink);
}

.graph-bar-meta {
  font-size: 0.73rem;
  font-weight: 700;
  color: var(--muted);
}

.graph-bar-track {
  height: 11px;
  border-radius: 999px;
  background: rgba(156, 114, 42, 0.18);
  border: 1px solid rgba(156, 114, 42, 0.32);
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.12);
}

.graph-bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.3s ease;
}

.graph-bar-fill.emerald {
  background: linear-gradient(90deg, #0d584b 0%, #1ea088 65%, #e2b653 100%);
}

.graph-bar-fill.gold {
  background: linear-gradient(90deg, #b88420 0%, #ecc362 100%);
}

.graph-bar-fill.terra {
  background: linear-gradient(90deg, #a6391e 0%, #e06d48 100%);
}


/* ==========================================================================
   v10 UPGRADES: 3D Moroccan Nav Icons, Voice Coach Row, Roleplay Chat,
   Survival Cheat-Sheets & Verb Conjugator
   ========================================================================== */

.nav-ico-3d {
  display: inline-grid;
  place-items: center;
  filter: drop-shadow(0 3px 6px rgba(24, 15, 3, 0.28));
  transition: transform 0.16s ease;
}

.nav-item.active .nav-ico-3d {
  transform: translateY(-1px) scale(1.06);
  filter: drop-shadow(0 4px 8px rgba(18, 11, 2, 0.38));
}

.voice-coach-row {
  display: flex;
  gap: 8px;
  margin: 8px 0 6px;
}

.pron-score-banner {
  padding: 10px 12px;
  margin: 6px 0 8px;
  font-size: 0.82rem;
  line-height: 1.4;
}

/* Survival Cheat-Sheets 2x2 Grid in Phrasebook */
.survival-grid-2x2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 9px;
  margin-bottom: 6px;
}

.survival-chip-card {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 11px;
  border-radius: 14px;
  background: linear-gradient(180deg, #fffdf7 0%, #f1dfc0 100%);
  border: 1.5px solid rgba(176, 132, 54, 0.52);
  box-shadow: 0 5px 12px rgba(42, 27, 6, 0.11), inset 0 1.5px 0 #fff;
  text-align: left;
  color: var(--ink);
}

[data-theme="dark"] .survival-chip-card {
  background: linear-gradient(180deg, #1b312a 0%, #12211d 100%);
  border-color: rgba(217, 170, 76, 0.35);
}

.surv-ico {
  font-size: 1.35rem;
  flex-shrink: 0;
}

.surv-title {
  font-weight: 800;
  font-size: 0.82rem;
  line-height: 1.2;
}

.surv-sub {
  font-size: 0.68rem;
  color: var(--muted);
  margin-top: 2px;
  line-height: 1.2;
}

/* Roleplay Chat Simulator Bubbles */
.rp-chat-stream {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-bottom: 10px;
}

.rp-bubble {
  padding: 11px 13px;
  border-radius: 16px;
  max-width: 92%;
  box-shadow: 0 4px 10px rgba(42, 27, 6, 0.1);
}

.rp-bubble.partner {
  align-self: flex-start;
  border-bottom-left-radius: 4px;
  background: linear-gradient(180deg, #fffdf8 0%, #f2e2c4 100%);
  border: 1.5px solid rgba(176, 132, 54, 0.48);
}

[data-theme="dark"] .rp-bubble.partner {
  background: linear-gradient(180deg, #1b312a 0%, #12211d 100%);
}

.rp-bubble.you {
  align-self: flex-end;
  border-bottom-right-radius: 4px;
  background: linear-gradient(145deg, #0e584b 0%, #073029 100%);
  border: 1.5px solid #e2b85e;
  color: #fff9eb;
}

.rp-speaker {
  font-size: 0.66rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold-dark);
}

.rp-bubble.you .rp-speaker {
  color: #f6d786;
}

.rp-lat {
  font-weight: 800;
  font-size: 0.92rem;
  margin-top: 2px;
}

.rp-en {
  font-size: 0.76rem;
  opacity: 0.84;
  margin-top: 2px;
}


/* ==========================================================================
   v11 NATIVE SINGLE-SCREEN FIT & LIVE RECORDING INDICATOR
   ========================================================================== */

/* 1. Single-Line Today Hero & Compact Scroll Fit */
.hero-banner.hero-3d.hero-compact-one-line {
  padding: 13px 16px 26px;
  margin: 6px -4px -18px;
}

.hero-one-line-title {
  font-family: var(--serif);
  font-size: 1.24rem;
  line-height: 1.15;
  margin: 0 0 7px;
  color: #f7deb0;
  text-shadow: 0 2px 5px rgba(0, 0, 0, 0.35);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hero-one-line-title em {
  font-style: italic;
  color: #ffe7a8;
}

.hero-banner.hero-3d.hero-with-medallion {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding: 14px 16px 28px;
  margin: 6px -4px -18px;
}

.hero-medallion-slot {
  position: relative;
  z-index: 3;
  flex-shrink: 0;
}

/* Compact Today Scroll & POTD so full screen fits without scrolling */
.scroll-parchment-body {
  padding: 15px 14px 14px;
}

.scroll-mid-divider {
  margin: 11px -16px;
}

.diamond-action-tile {
  padding: 10px 8px 8px;
}

.diamond-3d.lg {
  width: 52px;
  height: 52px;
}

.diamond-tile-title {
  margin-top: 11px;
  font-size: 0.98rem;
}

.potd-card.potd-compact {
  margin-top: 9px !important;
  padding: 11px 14px;
  margin-bottom: 4px;
}

.potd-card.potd-compact .potd-ar {
  font-size: 1.32rem;
  margin: 4px 0 5px;
  padding-bottom: 5px;
}

/* 2. Compact Books Grid so Culture Archway is fully visible on load */
.books-3d-grid {
  gap: 8px 10px;
  margin-bottom: 10px;
}

.book-3d-img {
  max-width: 142px;
}

.book-3d-ring-badge {
  width: 38px;
  height: 38px;
  top: 2px;
  right: 8px;
}

.book-3d-ring-badge svg {
  width: 38px;
  height: 38px;
}

.book-3d-meta {
  margin-top: 2px;
}

.book-3d-sub {
  font-size: 0.69rem;
}

.arch-wood-frame {
  padding: 9px 10px 10px;
}

.arch-frame-header {
  padding: 2px 4px 7px;
}

.arch-parchment-niche {
  padding: 14px 12px 12px;
  border-radius: 68px 68px 12px 12px;
}

.arch-mini-door {
  width: 68px;
  height: 88px;
}

/* 3. Compact Drills Plaques */
.drills-stack-3d {
  gap: 8px;
}

.drill-plaque-3d {
  padding: 10px 12px;
}

/* 4. Live Pulsing Recording Button & Status */
.pill-btn.recording-live {
  background: linear-gradient(180deg, #dc432d 0%, #991f10 100%) !important;
  color: #fff !important;
  border-color: #ffb8a8 !important;
  box-shadow: 0 0 12px rgba(220, 67, 45, 0.5);
  animation: recBtnPulse 1.1s infinite ease-in-out alternate;
}

@keyframes recBtnPulse {
  from { transform: scale(1); }
  to { transform: scale(1.02); }
}

.rec-live-status {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #a82414;
}

.rec-pulse-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #dc3522;
  box-shadow: 0 0 8px #dc3522;
  flex-shrink: 0;
  animation: recDotBlink 0.7s infinite alternate;
}

@keyframes recDotBlink {
  from { opacity: 1; }
  to { opacity: 0.35; }
}


/* ==========================================================================
   v12 FULL-HEIGHT VIEWPORT BALANCE & PHRASEBOOK TABBED CARDS
   ========================================================================== */

/* 1. Today Tab: Slightly fuller Hero Banner & balanced cards to eliminate bottom gap */
.hero-banner.hero-3d.hero-compact-one-line {
  padding: 18px 16px 32px;
  margin: 8px -4px -18px;
}

.hero-one-line-title {
  font-size: 1.32rem;
  margin: 0 0 10px;
}

.continue-scroll-section {
  padding: 8px 4px 6px;
}

.diamond-action-tile {
  padding: 14px 10px 12px;
}

.potd-card.potd-compact {
  margin-top: 14px !important;
  padding: 16px 16px;
}

.potd-card.potd-compact .potd-ar {
  font-size: 1.48rem;
  margin: 8px 0 8px;
  padding-bottom: 8px;
}

/* 2. Books Tab: Slightly larger 3D covers & padded Culture Archway to fill to bottom dock */
.books-3d-grid {
  gap: 12px 12px;
  margin-bottom: 14px;
}

.book-3d-img {
  max-width: 158px;
}

.arch-wood-frame {
  padding: 12px;
}

.arch-parchment-niche {
  padding: 18px 14px 16px;
}

/* 3. Drills Tab: Comfortable plaque breathing room to fill down to bottom dock */
.drills-stack-3d {
  gap: 12px;
}

.drill-plaque-3d {
  padding: 13px 14px;
}

/* 4. Phrasebook Survival Cards */
.survival-card-lg {
  padding: 16px 12px 14px;
}

.surv-ico-lg {
  font-size: 2rem;
  margin-bottom: 6px;
  display: inline-block;
  filter: drop-shadow(0 4px 6px rgba(32, 20, 4, 0.2));
}


/* ==========================================================================
   v13 FIXED TOP BAR & 2-ROW PHRASEBOOK FILTER CHIPS
   ========================================================================== */

.topbar {
  position: fixed !important;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  z-index: 60 !important;
}

.app-shell {
  padding-top: calc(64px + env(safe-area-inset-top, 0px)) !important;
}

/* Tighten Phrasebook filter chips so Status chips & Book chips sit on 2 clean rows */
.filter-row {
  gap: 5px !important;
}

.filter-chip {
  padding: 5px 9px !important;
  font-size: 0.72rem !important;
}


/* ==========================================================================
   v14 ZERO-SCROLL MAIN TABS & COMPACT PHRASEBOOK / BOOKS FIT
   ========================================================================== */

/* Lock scrolling on the 5 main tab home views so they behave like a native app */
.app-shell.is-locked-tab {
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
}

.app-shell.is-locked-tab .main-content {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding-bottom: 4px;
}

/* Compact Phrasebook so all 6 Daily Category medallions fit on 1 screen without scrolling */
.app-shell.is-locked-tab .scroll-stage {
  margin-top: 6px !important;
  margin-bottom: 4px !important;
}

.app-shell.is-locked-tab .search-input-3d {
  padding: 9px 13px;
  margin: 6px 0;
  font-size: 0.85rem;
}

.app-shell.is-locked-tab .pb-cat-grid-3d {
  gap: 7px;
}

.app-shell.is-locked-tab .pb-cat-plaque-3d {
  padding: 8px 8px 7px;
}

.app-shell.is-locked-tab .pb-medallion-3d-wrap {
  margin-bottom: 4px;
}

.app-shell.is-locked-tab .pb-medallion-3d-wrap svg {
  width: 36px;
  height: 36px;
}

.app-shell.is-locked-tab .pb-cat-title {
  font-size: 0.78rem;
}

.app-shell.is-locked-tab .pb-cat-count {
  font-size: 0.68rem;
  margin-top: 1px;
}

/* Compact Books tab so 2x2 Books + Verb Conjugator + Grammar Guide all fit on 1 screen */
.app-shell.is-locked-tab .book-3d-img {
  max-width: 132px;
}

.app-shell.is-locked-tab .books-3d-grid {
  gap: 6px 10px;
  margin-bottom: 8px;
}

.app-shell.is-locked-tab .book-3d-sub {
  font-size: 0.66rem;
}

.app-shell.is-locked-tab .drill-plaque-3d {
  padding: 9px 12px;
}

/* Compact Home tab so Hero + Continue/Level Test + Daily Phrase + Culture Arch all fit on 1 screen */
.app-shell.is-locked-tab .hero-banner.hero-3d.hero-compact-one-line {
  padding: 10px 14px 22px;
  margin: 4px -4px -16px;
}

.app-shell.is-locked-tab .hero-one-line-title {
  font-size: 1.2rem;
  margin: 0 0 6px;
}

.app-shell.is-locked-tab .potd-card.potd-compact {
  padding: 10px 14px;
  margin-top: 6px !important;
  margin-bottom: 6px !important;
}

.app-shell.is-locked-tab .potd-card.potd-compact .potd-ar {
  font-size: 1.26rem;
  margin: 3px 0 4px;
  padding-bottom: 4px;
}

.app-shell.is-locked-tab .arch-wood-frame {
  padding: 8px 9px !important;
}

.app-shell.is-locked-tab .arch-parchment-niche {
  padding: 11px 10px 10px !important;
}


/* ==========================================================================
   v15 FINAL PHASE-1 FILL TUNING (Books, Home Daily Phrase & 8-Cat Phrasebook)
   ========================================================================== */

/* Books Tab: Slightly larger covers & comfortable card padding to fill bottom space */
.app-shell.is-locked-tab .book-3d-img {
  max-width: 148px;
}

.app-shell.is-locked-tab .books-3d-grid {
  gap: 10px 12px;
  margin-bottom: 12px;
}

.app-shell.is-locked-tab .drill-plaque-3d {
  padding: 12px 13px;
}

/* Home Tab: Slightly larger Daily Phrase card & comfortable spacing */
.app-shell.is-locked-tab .potd-card.potd-compact {
  padding: 15px 16px;
  margin-top: 10px !important;
  margin-bottom: 10px !important;
}

.app-shell.is-locked-tab .potd-card.potd-compact .potd-ar {
  font-size: 1.48rem;
  margin: 6px 0 8px;
  padding-bottom: 7px;
}

.app-shell.is-locked-tab .potd-card.potd-compact .potd-latin {
  font-size: 1.06rem;
}

/* Phrasebook: Compact 2x4 Grid (8 Categories) */
.app-shell.is-locked-tab .pb-cat-grid-3d {
  gap: 6px;
}

.app-shell.is-locked-tab .pb-cat-plaque-3d {
  padding: 6px 6px 5px;
}

.app-shell.is-locked-tab .pb-medallion-3d-wrap svg {
  width: 31px;
  height: 31px;
}


/* ==========================================================================
   v16 TRUE ZERO-SCROLL LOCKED TABS + SMOOTH INNER SCROLLING + MEDIUM CARDS
   ========================================================================== */

html.locked-tab,
body.locked-tab {
  overflow: hidden !important;
  height: 100dvh !important;
  max-height: 100dvh !important;
  overscroll-behavior: none;
}

.app-shell.is-locked-tab {
  height: 100dvh !important;
  max-height: 100dvh !important;
  overflow: hidden !important;
  padding-bottom: calc(78px + env(safe-area-inset-bottom, 0px)) !important;
}

.app-shell.is-locked-tab .main-content {
  flex: 1;
  min-height: 0;
  overflow: hidden !important;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding-bottom: 4px;
}

/* Responsive dvh-aware sizing so cards never clip under topbar or dock on shorter phone screens */
.app-shell.is-locked-tab .book-3d-img {
  max-width: clamp(108px, 16dvh, 144px);
}

.app-shell.is-locked-tab .pb-cat-plaque-3d {
  padding: clamp(5px, 0.9dvh, 9px) 8px !important;
}

.app-shell.is-locked-tab .pb-medallion-3d-wrap svg {
  width: clamp(26px, 3.8dvh, 34px);
  height: clamp(26px, 3.8dvh, 34px);
}

.app-shell.is-locked-tab .pb-cat-title {
  font-size: clamp(0.72rem, 1.5dvh, 0.8rem);
}

.app-shell.is-locked-tab .pb-cat-count {
  font-size: clamp(0.64rem, 1.2dvh, 0.72rem);
}

.app-shell.is-locked-tab .survival-card-lg {
  padding: clamp(8px, 1.3dvh, 13px) 10px !important;
}

.app-shell.is-locked-tab .surv-ico-lg {
  font-size: clamp(1.3rem, 2.5dvh, 1.8rem);
  margin-bottom: 3px;
}

.app-shell.is-locked-tab .hero-banner.hero-3d.hero-compact-one-line {
  padding: clamp(8px, 1.2dvh, 14px) 14px clamp(18px, 2.4dvh, 26px);
  margin: 4px -4px -16px;
}

.app-shell.is-locked-tab .potd-card.potd-compact {
  padding: clamp(9px, 1.3dvh, 14px) 14px;
  margin-top: 6px !important;
  margin-bottom: 6px !important;
}

.app-shell.is-locked-tab .potd-card.potd-compact .potd-ar {
  font-size: clamp(1.15rem, 2.1dvh, 1.44rem);
  margin: 4px 0;
  padding-bottom: 4px;
}

.app-shell.is-locked-tab .arch-mini-door {
  width: clamp(54px, 8dvh, 66px) !important;
  height: clamp(70px, 10dvh, 86px) !important;
}

.app-shell.is-locked-tab .drill-plaque-3d {
  padding: clamp(7px, 1.1dvh, 11px) 12px;
}

.app-shell.is-locked-tab .survival-card-lg {
  padding: clamp(5px, 0.8dvh, 8px) 8px !important;
}
.app-shell.is-locked-tab .survival-card-lg .pin-action-pill {
  margin-top: 3px !important;
  padding: 2px 7px !important;
  font-size: 0.65rem !important;
}
.app-shell.is-locked-tab .hero-banner.hero-3d.hero-compact-one-line {
  margin-top: 6px !important;
}


/* ==========================================================================
   v17 BOOKS GAP FIX
   ========================================================================== */
.app-shell.is-locked-tab .books-3d-grid {
  margin-bottom: 4px !important;
  gap: 8px 12px !important;
}
.app-shell.is-locked-tab .book-3d-img {
  max-width: clamp(122px, 17.5dvh, 152px) !important;
}
.books-lab-stack {
  margin-top: 0 !important;
  gap: 8px !important;
}


/* === PHASE 2: AUTH GATE, SUBSCRIPTIONS & ADMIN PANEL === */
.admin-pill {
  background: linear-gradient(135deg, #f6d57a, #c98d20) !important;
  color: #2f1e02 !important;
  border-color: #ffe8a3 !important;
  font-weight: 800 !important;
}
.auth-gate-wrap {
  max-width: 440px;
  margin: 14px auto 24px;
  padding: 0 4px;
}
.auth-trial-banner {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(20, 108, 88, 0.12);
  border: 1px solid rgba(20, 108, 88, 0.28);
  color: var(--emerald-deep, #07332b);
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  margin-bottom: 12px;
}
[data-theme="dark"] .auth-trial-banner {
  background: rgba(223, 169, 62, 0.14);
  border-color: rgba(223, 169, 62, 0.35);
  color: #f4d88a;
}
.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  background: rgba(7, 46, 40, 0.08);
  padding: 4px;
  border-radius: 12px;
  margin-bottom: 14px;
}
.auth-tab-btn {
  border: none;
  background: transparent;
  padding: 9px 10px;
  border-radius: 9px;
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--ink-muted, #4f5954);
  cursor: pointer;
}
.auth-tab-btn.active {
  background: linear-gradient(180deg, #0f5c4d, #07332b);
  color: #fff4c2;
  box-shadow: 0 2px 6px rgba(7, 46, 40, 0.22);
}
.auth-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 12px;
}
.auth-field label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink-muted, #4f5954);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.auth-field input {
  width: 100%;
  box-sizing: border-box;
  padding: 11px 13px;
  border-radius: 11px;
  border: 1.5px solid rgba(139, 94, 16, 0.28);
  background: rgba(255, 255, 255, 0.9);
  color: #14221e;
  font-size: 0.96rem;
  font-family: inherit;
}
[data-theme="dark"] .auth-field input {
  background: rgba(12, 36, 31, 0.9);
  color: #f4efe2;
  border-color: rgba(223, 169, 62, 0.35);
}
.auth-error {
  background: rgba(184, 59, 36, 0.11);
  border: 1px solid rgba(184, 59, 36, 0.35);
  color: #9e2a16;
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 0.84rem;
  font-weight: 600;
  margin-bottom: 12px;
}
[data-theme="dark"] .auth-error {
  color: #ffb4a6;
}
.auth-info {
  background: rgba(15, 92, 77, 0.11);
  border: 1px solid rgba(15, 92, 77, 0.32);
  color: #0b4a3d;
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 0.84rem;
  font-weight: 600;
  margin-bottom: 12px;
}
[data-theme="dark"] .auth-info {
  color: #9be7d3;
}
.auth-submit-btn {
  width: 100%;
  padding: 12px 16px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(180deg, #f3cd6d, #c78b1e);
  color: #2b1a02;
  font-weight: 800;
  font-size: 0.96rem;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(139, 94, 16, 0.28);
}
.auth-submit-btn:disabled {
  opacity: 0.65;
  cursor: wait;
}
.plan-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}
.plan-pill.admin { background: linear-gradient(135deg, #f6d57a, #c98d20); color: #2b1a02; }
.plan-pill.active { background: rgba(15, 118, 92, 0.14); color: #095945; border: 1px solid rgba(15, 118, 92, 0.28); }
.plan-pill.trial { background: rgba(209, 138, 23, 0.15); color: #8c5604; border: 1px solid rgba(209, 138, 23, 0.32); }
.plan-pill.revoked { background: rgba(184, 59, 36, 0.14); color: #9e2a16; border: 1px solid rgba(184, 59, 36, 0.3); }
[data-theme="dark"] .plan-pill.active { color: #88e6cb; }
[data-theme="dark"] .plan-pill.trial { color: #ffd480; }
[data-theme="dark"] .plan-pill.revoked { color: #ffaba0; }

.admin-stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-bottom: 12px;
}
.admin-stat-box {
  background: rgba(7, 46, 40, 0.06);
  border: 1px solid rgba(139, 94, 16, 0.18);
  border-radius: 10px;
  padding: 7px 6px;
  text-align: center;
}
.admin-stat-num { font-size: 1.05rem; font-weight: 800; color: var(--emerald-deep, #07332b); }
.admin-stat-lbl { font-size: 0.68rem; font-weight: 700; color: var(--ink-muted, #5c6560); text-transform: uppercase; }
[data-theme="dark"] .admin-stat-num { color: #f4d88a; }

.admin-user-card {
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid rgba(139, 94, 16, 0.22);
  border-radius: 12px;
  padding: 10px 11px;
  margin-bottom: 9px;
}
[data-theme="dark"] .admin-user-card {
  background: rgba(10, 38, 32, 0.65);
}
.admin-user-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.admin-user-email {
  font-weight: 700;
  font-size: 0.86rem;
  word-break: break-all;
}
.admin-actions-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 7px;
}
.admin-plan-btn {
  border: 1px solid rgba(139, 94, 16, 0.28);
  background: rgba(255, 248, 228, 0.9);
  color: #3a2705;
  border-radius: 8px;
  padding: 5px 8px;
  font-size: 0.73rem;
  font-weight: 700;
  cursor: pointer;
}
.admin-plan-btn.current {
  background: #0b4a3d;
  color: #fff4c2;
  border-color: #0b4a3d;
}
.admin-plan-btn.danger {
  background: rgba(184, 59, 36, 0.1);
  color: #9e2a16;
  border-color: rgba(184, 59, 36, 0.35);
}
.account-box-3d {
  background: rgba(15, 92, 77, 0.07);
  border: 1px solid rgba(15, 92, 77, 0.22);
  border-radius: 12px;
  padding: 11px 12px;
  margin-bottom: 12px;
}
[data-theme="dark"] .account-box-3d {
  background: rgba(223, 169, 62, 0.08);
  border-color: rgba(223, 169, 62, 0.24);
}

nav.bottom-nav[hidden], .bottom-nav[hidden] { display: none !important; }
