/* ════════════════════════════════════════════════════════════════════════
   v2 design system — "Parchment & Night"
   Warm parchment surfaces, night-sky navy for depth, gold for honour, and a
   semantic palette that keeps CLAUDE.md's meaning: blue = learning,
   gold = verse level, coral = connection, green = mastery, red = danger.
   Scripture (Amiri) is always the hero; UI text is IBM Plex Sans Arabic.
   Loaded by templates/base.html — the app's only design since 2026-10-18.
   ════════════════════════════════════════════════════════════════════════ */

:root {
  --night: #0E1A3A;
  --night-2: #1B2C5E;
  --night-3: #2A3F7A;
  --parchment: #FAF6EE;
  --parchment-2: #F3ECDD;
  --paper: #FFFFFF;
  --ink: #1B2233;
  --ink-soft: #4E5769;
  --muted: #8A90A0;
  --line: #E9E1D1;
  --line-soft: #F1EBDF;

  --gold: #C9A24A;
  --gold-deep: #9C7A2A;
  --gold-soft: #FBF3DF;
  --sky: #3D6FE0;
  --sky-deep: #2852B8;
  --sky-soft: #EAF0FD;
  --olive: #2E7D58;
  --olive-deep: #22603F;
  --olive-soft: #E5F3EB;
  --coral: #E06B4A;
  --coral-soft: #FDEEE8;
  --rose: #D64545;
  --rose-soft: #FDECEC;

  --r-sm: 12px;
  --r-md: 16px;
  --r-lg: 22px;
  --r-xl: 28px;
  --shadow-1: 0 1px 2px rgba(27, 34, 51, .05), 0 6px 18px -10px rgba(27, 34, 51, .14);
  --shadow-2: 0 2px 6px rgba(27, 34, 51, .06), 0 18px 40px -18px rgba(27, 34, 51, .28);
  --shadow-glow-sky: 0 10px 24px -10px rgba(40, 82, 184, .6);
  --shadow-glow-olive: 0 10px 24px -10px rgba(34, 96, 63, .55);
  --shadow-glow-gold: 0 10px 24px -10px rgba(156, 122, 42, .55);
  --nav-h: 68px;
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
  --ease-out: cubic-bezier(.22, 1, .36, 1);
}

/* ── base ─────────────────────────────────────────────────────────────── */
html { -webkit-tap-highlight-color: transparent; }
body.v2 {
  background-color: var(--parchment);
  background-image:
    radial-gradient(1200px 500px at 110% -10%, rgba(201, 162, 74, .10), transparent 60%),
    radial-gradient(900px 500px at -10% 0%, rgba(61, 111, 224, .07), transparent 60%);
  background-attachment: fixed;
  color: var(--ink);
  font-family: 'IBM Plex Sans Arabic', 'Inter', system-ui, sans-serif;
}
.scripture { font-family: 'Amiri', 'Noto Naskh Arabic', serif; line-height: 2.05; color: var(--ink); }
.v2 ::selection { background: rgba(201, 162, 74, .28); }
.v2 :focus-visible { outline: 3px solid rgba(61, 111, 224, .45); outline-offset: 2px; border-radius: 10px; }

/* ── layout ───────────────────────────────────────────────────────────── */
.v-page { min-height: 100vh; }
.v-wrap { max-width: 30rem; margin-inline: auto; padding-inline: 16px; }
.v-pad-nav { padding-bottom: calc(var(--nav-h) + 40px + env(safe-area-inset-bottom)); }

/* ── headers ──────────────────────────────────────────────────────────── */
.v-topbar { display: flex; align-items: center; gap: 10px; padding-block: 18px 14px; }
.v-topbar h1 { flex: 1; text-align: center; font-size: 1.05rem; font-weight: 700; color: var(--ink); }
.v-iconbtn {
  display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; flex-shrink: 0;
  border-radius: 14px; background: var(--paper); border: 1px solid var(--line); color: var(--ink-soft);
  box-shadow: var(--shadow-1); transition: transform .15s var(--ease-out), background .2s;
}
.v-iconbtn:active { transform: scale(.92); }
.v-iconbtn.ghost { background: transparent; border-color: transparent; box-shadow: none; }

/* Night-sky hero (Home / Treasures / Login) */
.v-hero {
  position: relative; overflow: hidden; color: #fff;
  background: radial-gradient(120% 140% at 85% -20%, #31478C 0%, var(--night-2) 38%, var(--night) 75%);
  border-radius: 0 0 var(--r-xl) var(--r-xl);
  box-shadow: 0 20px 40px -24px rgba(14, 26, 58, .7);
}
.v-hero::before {               /* stars */
  content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .9;
  background-image:
    radial-gradient(1.5px 1.5px at 12% 22%, #fff 50%, transparent 52%),
    radial-gradient(1px 1px at 28% 12%, #fff 50%, transparent 52%),
    radial-gradient(1.2px 1.2px at 45% 30%, #fff 50%, transparent 52%),
    radial-gradient(1px 1px at 62% 16%, #fff 50%, transparent 52%),
    radial-gradient(1.6px 1.6px at 78% 34%, #F4E3B0 50%, transparent 52%),
    radial-gradient(1px 1px at 90% 10%, #fff 50%, transparent 52%),
    radial-gradient(1.2px 1.2px at 8% 52%, #fff 50%, transparent 52%),
    radial-gradient(1px 1px at 35% 58%, #fff 50%, transparent 52%),
    radial-gradient(1.4px 1.4px at 70% 60%, #fff 50%, transparent 52%);
  animation: v-twinkle 6s ease-in-out infinite alternate;
}
.v-hero .v-hills { position: absolute; inset-inline: 0; bottom: -1px; width: 100%; height: 56px; pointer-events: none; }
.v-hero-inner { position: relative; padding: 22px 18px 54px; }
/* G1 (design review 2026-11-09): one compact header for the tab roots كنوزي · الكلمة · حسابي
   (Home keeps its big banner): the title on one line with its mark, no hills. */
.v-hero-sm .v-hero-inner { padding: 12px 18px 18px; }
.v-hero-sm .v-build-gap { height: 18px; }
.v-hero-title { display: flex; align-items: center; gap: 8px; font-family: Amiri, 'Noto Naskh Arabic', serif; font-size: 24px; font-weight: 700; line-height: 1.5; }
.v-hero-sub { font-size: 12.5px; color: rgba(255, 255, 255, .72); }
.v-hero-sm .a-stats { margin-top: 10px; }

/* ── cards ────────────────────────────────────────────────────────────── */
.v-card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow-1);
}
.v-card-pad { padding: 18px; }
.v-card-lift { transition: transform .2s var(--ease-out), box-shadow .2s; }
.v-card-lift:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); }
.v-card-lift:active { transform: scale(.985); }
.v-card-learning { background: linear-gradient(160deg, #FFFFFF 0%, #F4F7FF 100%); border-color: #D8E3FB; }
.v-card-review { background: linear-gradient(160deg, #FFFDF7 0%, #FBF3DF 100%); border-color: #EEDDB0; }
.v-card-mastery { background: linear-gradient(160deg, #FFFFFF 0%, #EEF8F2 100%); border-color: #CBE7D7; }
.v-card-danger { background: var(--rose-soft); border-color: #F5C9C9; }
.v-accent-bar { position: absolute; inset-block: 14px; inset-inline-start: 0; width: 4px; border-radius: 0 4px 4px 0; }

.v-section-title {
  display: flex; align-items: center; gap: 8px; font-size: .78rem; font-weight: 700; letter-spacing: .02em;
  color: var(--ink-soft); margin: 22px 4px 10px;
}
.v-section-title::after { content: ''; flex: 1; height: 1px; background: linear-gradient(to left, transparent, var(--line)); }

/* ── buttons ──────────────────────────────────────────────────────────── */
.v-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%;
  padding: 14px 18px; border-radius: var(--r-md); font-weight: 700; font-size: .95rem; line-height: 1.2;
  border: 1px solid transparent; cursor: pointer; text-decoration: none;
  transition: transform .14s var(--ease-out), box-shadow .2s, filter .2s, background .2s, opacity .2s;
  -webkit-user-select: none; user-select: none;
}
.v-btn:active:not(:disabled) { transform: scale(.97); }
.v-btn:disabled { opacity: .55; cursor: not-allowed; }
.v-btn:hover:not(:disabled) { filter: brightness(1.04); }
.v-btn-primary { color: #fff; background: linear-gradient(135deg, #5583EC 0%, var(--sky) 45%, var(--sky-deep) 100%); box-shadow: var(--shadow-glow-sky); }
.v-btn-success { color: #fff; background: linear-gradient(135deg, #43A273 0%, var(--olive) 50%, var(--olive-deep) 100%); box-shadow: var(--shadow-glow-olive); }
.v-btn-gold { color: #fff; background: linear-gradient(135deg, #DDBB64 0%, var(--gold) 45%, var(--gold-deep) 100%); box-shadow: var(--shadow-glow-gold); }
.v-btn-night { color: #fff; background: linear-gradient(135deg, var(--night-3), var(--night)); box-shadow: 0 10px 24px -12px rgba(14, 26, 58, .7); }
.v-btn-danger { color: #fff; background: linear-gradient(135deg, #E25B5B, #B93434); box-shadow: 0 10px 24px -12px rgba(185, 52, 52, .6); }
.v-btn-ghost { color: var(--ink-soft); background: var(--paper); border-color: var(--line); box-shadow: 0 1px 2px rgba(27, 34, 51, .04); }
.v-btn-ghost:hover:not(:disabled) { background: #FFFDF8; border-color: #DCCFB4; }
.v-btn-outline { color: var(--sky-deep); background: var(--sky-soft); border-color: #CBD9F8; }
.v-btn-soft-gold { color: var(--gold-deep); background: var(--gold-soft); border-color: #EEDDB0; }
.v-btn-sm { padding: 10px 14px; font-size: .85rem; border-radius: var(--r-sm); }
.v-btn-xs { padding: 7px 12px; font-size: .78rem; border-radius: 10px; width: auto; }
.v-link { color: var(--sky-deep); font-weight: 600; text-decoration: none; }
.v-link:hover { text-decoration: underline; }
.v-link-muted { color: var(--muted); font-size: .82rem; }
.v-link-muted:hover { color: var(--ink-soft); text-decoration: underline; }

/* ── pills / chips / segmented ───────────────────────────────────────── */
.v-seg { display: inline-flex; padding: 4px; gap: 4px; background: var(--parchment-2); border: 1px solid var(--line); border-radius: 999px; }
.v-seg-btn { padding: 8px 16px; border-radius: 999px; font-size: .86rem; font-weight: 600; color: var(--ink-soft); transition: all .2s var(--ease-out); }
.v-seg-on { background: var(--paper); color: var(--sky-deep); box-shadow: 0 2px 8px -2px rgba(27, 34, 51, .18); }
.v-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: .74rem; font-weight: 600; white-space: nowrap; }
.v-chip-sky { background: var(--sky-soft); color: var(--sky-deep); }
.v-chip-gold { background: var(--gold-soft); color: var(--gold-deep); }
.v-chip-olive { background: var(--olive-soft); color: var(--olive-deep); }
.v-chip-coral { background: var(--coral-soft); color: #B4482C; }
.v-chip-rose { background: var(--rose-soft); color: #B93434; }
.v-chip-muted { background: var(--parchment-2); color: var(--ink-soft); }
.v-chip-night { background: rgba(255, 255, 255, .14); color: #fff; border: 1px solid rgba(255, 255, 255, .18); backdrop-filter: blur(6px); }

/* ── forms ────────────────────────────────────────────────────────────── */
.v-label { display: block; font-size: .84rem; font-weight: 600; color: var(--ink-soft); margin-bottom: 6px; }
.v-input, .v2 .v-field input, .v2 .v-field select, .v2 .v-field textarea {
  width: 100%; padding: 13px 15px; border: 1.5px solid var(--line); border-radius: 14px; background: #fff;
  font-size: .95rem; color: var(--ink); transition: border-color .2s, box-shadow .2s;
}
.v-input:focus, .v2 .v-field input:focus, .v2 .v-field select:focus, .v2 .v-field textarea:focus {
  outline: none; border-color: var(--sky); box-shadow: 0 0 0 4px rgba(61, 111, 224, .14);
}
.v-input::placeholder { color: #A9AEBA; }
.v-select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%238A90A0' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: left 14px center; padding-inline-end: 40px; }
.v-check { width: 20px; height: 20px; border-radius: 6px; accent-color: var(--sky); }
/* G4 (design review 2026-11-09): on/off settings = one switch everywhere (like «اسمع وردّد»).
   The same <input type=checkbox>, so forms and their save-on-tap JS don't change. */
.v-switch { appearance: none; -webkit-appearance: none; width: 46px; height: 28px; border-radius: 999px; background: var(--line);
  position: relative; flex-shrink: 0; cursor: pointer; transition: background .2s; margin: 0; }
.v-switch::after { content: ''; position: absolute; top: 4px; inset-inline-start: 4px; width: 20px; height: 20px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: inset-inline-start .2s; }
.v-switch:checked { background: var(--sky); }
.v-switch:checked::after { inset-inline-start: 22px; }
.v-switch:focus-visible { outline: 3px solid rgba(61,111,224,.35); outline-offset: 2px; }
.v-switch:disabled { opacity: .5; }
@media (prefers-reduced-motion: reduce) { .v-switch, .v-switch::after { transition: none; } }
/* S7: the seven days as chips (the same checkbox inside each) */
.s-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.s-chip { position: relative; height: 42px; border-radius: 12px; display: grid; place-items: center; font-weight: 700; font-size: 14px;
  background: var(--parchment-2); color: var(--ink-soft); border: 1px solid var(--line); cursor: pointer; user-select: none; }
.s-chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.s-chip.is-on { background: var(--sky); color: #fff; border-color: var(--sky); }
.s-chip:focus-within { outline: 3px solid rgba(61,111,224,.35); outline-offset: 2px; }
.s-dayrow { display: grid; grid-template-columns: 4.5rem 1fr 1fr; gap: 6px; align-items: center; }
.v-error { margin-top: 6px; font-size: .78rem; color: var(--rose); }

/* ── practice input footer ───────────────────────────────────────────── */
.v-footer {
  flex-shrink: 0; background: rgba(255, 255, 255, .92); backdrop-filter: blur(14px);
  border-top: 1px solid var(--line); border-radius: var(--r-xl) var(--r-xl) 0 0;
  box-shadow: 0 -14px 34px -22px rgba(27, 34, 51, .35);
  padding: 16px 16px calc(22px + env(safe-area-inset-bottom));
}
.v-answer { width: 100%; padding: 14px 16px; border: 2px solid #E8D9B5; border-radius: 18px; background: #FFFEFA; font-size: 1.15rem; transition: border-color .2s, box-shadow .2s; }
.v-answer:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 5px rgba(201, 162, 74, .16); }
.v-mic {
  position: relative; width: 76px; height: 76px; margin-inline: auto; border-radius: 999px; display: flex; align-items: center; justify-content: center;
  color: #fff; background: radial-gradient(circle at 35% 30%, #6C93F0, var(--sky) 55%, var(--sky-deep));
  box-shadow: 0 14px 28px -12px rgba(40, 82, 184, .75), inset 0 -4px 10px rgba(0, 0, 0, .15);
  transition: transform .15s var(--ease-out);
}
.v-mic:active { transform: scale(.94); }
.v-mic.recording { background: radial-gradient(circle at 35% 30%, #F17E7E, #DD4B4B 55%, #B52F2F); box-shadow: 0 14px 28px -12px rgba(181, 47, 47, .8); }
.v-mic.recording::before, .v-mic.recording::after {
  content: ''; position: absolute; inset: -8px; border-radius: inherit; border: 3px solid rgba(221, 75, 75, .45);
  animation: v-ripple 1.6s ease-out infinite;
}
.v-mic.recording::after { animation-delay: .8s; }
.v-voicebox { padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 16px; background: #FFFEFA; font-size: 1.15rem; }
.v-diff { padding: 14px 16px; border-radius: 18px; background: #FFFDF6; border: 1.5px solid #EEDFBD; font-size: 1.2rem; }

/* progress */
.v-progress { height: 6px; background: rgba(27, 34, 51, .08); border-radius: 999px; overflow: hidden; }
.v-progress > div { height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--sky), #7EA2F2); transition: width .5s var(--ease-out); }
.v-progress.gold > div { background: linear-gradient(90deg, var(--gold-deep), var(--gold)); }
.v-progress.olive > div { background: linear-gradient(90deg, var(--olive), #5DB98A); }
.v-progress-top { height: 4px; border-radius: 0; }

/* ── bottom sheet / modal ─────────────────────────────────────────────── */
.v-scrim { position: fixed; inset: 0; background: rgba(14, 26, 58, .45); backdrop-filter: blur(3px); }
.v-sheet {
  position: fixed; inset-inline: 0; bottom: 0; background: var(--paper); border-radius: var(--r-xl) var(--r-xl) 0 0;
  box-shadow: 0 -20px 60px -20px rgba(14, 26, 58, .45);
}
.v-sheet-handle { width: 42px; height: 5px; border-radius: 999px; background: #E2D9C6; margin: 10px auto 6px; }
.v-modal {
  background: var(--paper); border-radius: var(--r-xl); box-shadow: 0 30px 70px -20px rgba(14, 26, 58, .55);
  border: 1px solid var(--line); width: 100%; max-width: 360px; padding: 22px 20px 18px; text-align: center;
  animation: v-pop .35s var(--ease-spring) both;
}

/* ── bottom navigation ───────────────────────────────────────────────── */
.v-nav {
  position: fixed; inset-inline: 12px; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 40;
  max-width: 28rem; margin-inline: auto;
  background: rgba(255, 255, 255, .86); backdrop-filter: blur(18px) saturate(1.4);
  border: 1px solid rgba(233, 225, 209, .9); border-radius: 24px;
  box-shadow: 0 18px 40px -18px rgba(14, 26, 58, .45);
}
.v-nav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 9px 4px 8px; color: #8C93A3; font-size: 11px; font-weight: 600; position: relative; transition: color .2s; }
.v-nav a .v-nav-ico { display: flex; align-items: center; justify-content: center; width: 44px; height: 30px; border-radius: 12px; transition: background .25s var(--ease-out), transform .25s var(--ease-spring); }
.v-nav a[aria-current="page"] { color: var(--sky-deep); }
.v-nav a[aria-current="page"] .v-nav-ico { background: var(--sky-soft); transform: translateY(-2px); }

/* ── nav loader ───────────────────────────────────────────────────────── */
.v-loader { position: fixed; inset: 0; z-index: 100; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; background: linear-gradient(180deg, var(--parchment), #FFFFFF); }
.v-loader-dots { display: flex; gap: 6px; }
.v-loader-dots span { width: 8px; height: 8px; border-radius: 999px; background: var(--gold); animation: v-dot 1s ease-in-out infinite; }
.v-loader-dots span:nth-child(2) { animation-delay: .15s; }
.v-loader-dots span:nth-child(3) { animation-delay: .3s; }

/* ── progress dots (passage detail) ──────────────────────────────────── */
.v-dot-state { font-size: 15px; line-height: 1; }

/* ── build badge ──────────────────────────────────────────────────────── */
.v-build { position: fixed; top: 6px; inset-inline-end: 12px; z-index: 30; font-size: 8.5px; color: #A9AEBA; pointer-events: none; }
.v-hero .v-build-gap { height: 22px; }

/* ════════════════════════════════════════════════════════════════════════
   COACH "داود"
   ════════════════════════════════════════════════════════════════════════ */
.coach-dock {
  position: fixed; inset-inline: 10px; z-index: 70; display: flex; justify-content: center; pointer-events: none;
}
.coach-dock.bottom { bottom: calc(var(--nav-h) + 22px + env(safe-area-inset-bottom)); }
.coach-dock.bottom.no-nav { bottom: calc(18px + env(safe-area-inset-bottom)); }
.coach-dock.top { top: 74px; }
.coach-card {
  pointer-events: auto; display: flex; align-items: flex-end; gap: 10px; width: 100%; max-width: 27rem;
}
.coach-avatar {
  position: relative; flex-shrink: 0; width: 66px; height: 66px; border-radius: 999px;
  background: radial-gradient(circle at 50% 35%, #FFF8E6, #F3E1B5 70%, #E8CD8C);
  border: 3px solid #fff; box-shadow: 0 10px 24px -10px rgba(14, 26, 58, .55), 0 0 0 1.5px #E8CD8C;
  overflow: hidden;
}
.coach-avatar.lg { width: 112px; height: 112px; border-width: 4px; }
.coach-avatar.xl { width: 148px; height: 148px; border-width: 5px; }
.coach-avatar.sm { width: 48px; height: 48px; border-width: 2px; }
.coach-avatar svg { width: 100%; height: 100%; display: block; }
.coach-bubble {
  position: relative; flex: 1; min-width: 0; background: var(--paper); border: 1px solid var(--line);
  border-radius: 20px 20px 20px 6px; padding: 12px 14px 12px 12px; box-shadow: 0 16px 36px -16px rgba(14, 26, 58, .45);
}
[dir="rtl"] .coach-bubble { border-radius: 20px 20px 6px 20px; }
.coach-name { font-size: .72rem; font-weight: 800; color: var(--gold-deep); display: flex; align-items: center; gap: 6px; margin-bottom: 3px; }
.coach-text { font-size: .93rem; line-height: 1.65; color: var(--ink); font-weight: 500; }
.coach-detail { margin-top: 6px; font-size: .8rem; line-height: 1.55; color: var(--ink-soft); background: var(--parchment); border-radius: 10px; padding: 6px 9px; }
.coach-tools { margin-inline-start: auto; display: flex; gap: 2px; margin-block: -4px; }
.coach-tools button { width: 26px; height: 26px; border-radius: 9px; display: flex; align-items: center; justify-content: center; color: #A9AEBA; font-size: 13px; }
.coach-tools button:hover { background: var(--parchment); color: var(--ink-soft); }
.coach-card.mood-concern .coach-bubble { border-color: #F2CFC6; background: linear-gradient(160deg, #fff, #FFF6F3); }
.coach-card.mood-cheer .coach-bubble { border-color: #EEDDB0; background: linear-gradient(160deg, #fff, #FFFAEE); }
.coach-enter { animation: coach-in .45s var(--ease-spring) both; }
.coach-leave { animation: coach-out .22s ease-in both; }
.coach-dock.top .coach-enter { animation-name: coach-in-top; }

/* the inline (in-dialog / in-panel) variant */
.coach-inline { display: flex; align-items: center; gap: 12px; text-align: start; }
.coach-inline .coach-bubble { box-shadow: none; background: var(--parchment); border-color: var(--line-soft); }
.coach-stack { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.coach-stack .coach-bubble { border-radius: 20px; text-align: center; box-shadow: var(--shadow-1); }
.coach-stack .coach-bubble::before {
  content: ''; position: absolute; top: -8px; left: 50%; width: 16px; height: 16px; background: inherit;
  border-top: 1px solid var(--line); border-inline-start: 1px solid var(--line); transform: translateX(-50%) rotate(45deg);
}

/* character parts & moods (partials/coach_svg.html) */
.dv .mp { display: none; }
.dv[data-mood="happy"] .m-happy, .dv[data-mood="think"] .m-think, .dv[data-mood="cheer"] .m-cheer, .dv[data-mood="concern"] .m-concern { display: inline; }
.dv .eyes-open { display: inline; }
.dv[data-mood="cheer"] .eyes-open { display: none; }
.dv .staff { transform-box: fill-box; transform-origin: 50% 100%; transition: transform .45s var(--ease-spring); }
.dv[data-mood="cheer"] .staff { transform: rotate(-10deg) translateY(-4px); }
.dv .sparkle { opacity: 0; }
.dv[data-mood="cheer"] .sparkle { animation: v-sparkle 1.4s ease-in-out infinite; }
.dv[data-mood="cheer"] .sparkle.s2 { animation-delay: .5s; }
.dv .head { transform-box: fill-box; transform-origin: 50% 90%; }
.dv.idle .head { animation: v-bob 4.5s ease-in-out infinite; }
.dv[data-mood="think"] .head { transform: rotate(-4deg); }
.dv[data-mood="concern"] .head { transform: rotate(3deg); }
.dv .mouth-talk { display: none; }
.dv.talking .mouth-talk { display: inline; animation: v-talk .32s steps(2, jump-none) infinite; }
.dv .blink { transform-box: fill-box; transform-origin: center; animation: v-blink 5.2s infinite; }

/* ── motion ───────────────────────────────────────────────────────────── */
@keyframes v-pop { 0% { opacity: 0; transform: scale(.88) translateY(8px); } 100% { opacity: 1; transform: none; } }
@keyframes v-rise { 0% { opacity: 0; transform: translateY(14px); } 100% { opacity: 1; transform: none; } }
@keyframes v-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes v-twinkle { from { opacity: .55; } to { opacity: 1; } }
@keyframes v-ripple { 0% { transform: scale(1); opacity: .9; } 100% { transform: scale(1.45); opacity: 0; } }
@keyframes v-dot { 0%, 100% { transform: translateY(0); opacity: .5; } 50% { transform: translateY(-6px); opacity: 1; } }
@keyframes v-bob { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-1.5px) rotate(-1deg); } }
@keyframes v-talk { 0% { opacity: 1; } 100% { opacity: 0; } }
@keyframes v-blink { 0%, 94%, 100% { transform: scaleY(1); } 96% { transform: scaleY(.1); } }
@keyframes v-sparkle { 0%, 100% { opacity: 0; transform: scale(.6); } 50% { opacity: 1; transform: scale(1.1); } }
@keyframes v-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes coach-in { 0% { opacity: 0; transform: translateY(18px) scale(.94); } 100% { opacity: 1; transform: none; } }
@keyframes coach-in-top { 0% { opacity: 0; transform: translateY(-16px) scale(.94); } 100% { opacity: 1; transform: none; } }
@keyframes coach-out { to { opacity: 0; transform: translateY(10px) scale(.96); } }
@keyframes v-check { 0% { transform: scale(.4) rotate(-12deg); opacity: 0; } 60% { transform: scale(1.12) rotate(4deg); opacity: 1; } 100% { transform: scale(1) rotate(0); } }
@keyframes v-confetti { 0% { transform: translateY(-10px) rotate(0); opacity: 1; } 100% { transform: translateY(120px) rotate(320deg); opacity: 0; } }
.v-rise { animation: v-rise .5s var(--ease-out) both; }
.v-rise-2 { animation: v-rise .5s .07s var(--ease-out) both; }
.v-rise-3 { animation: v-rise .5s .14s var(--ease-out) both; }
.v-rise-4 { animation: v-rise .5s .21s var(--ease-out) both; }
.v-float { animation: v-float 5s ease-in-out infinite; }
.v-pop { animation: v-pop .4s var(--ease-spring) both; }
.v-check-pop { animation: v-check .5s var(--ease-spring) both; }

/* classes practice.js / v1 logic still toggles — keep them alive in v2 */
@keyframes shake { 10%, 90% { transform: translateX(-1px); } 20%, 80% { transform: translateX(2px); } 30%, 50%, 70% { transform: translateX(-4px); } 40%, 60% { transform: translateX(4px); } }
.animate-shake { animation: shake .4s; }
@keyframes flashStep { 0% { background-color: rgba(201, 162, 74, .28); } 100% { background-color: rgba(201, 162, 74, 0); } }
.animate-flash-step { animation: flashStep 1.3s ease-out; }
@keyframes spin { to { transform: rotate(360deg); } }

/* compare.js diff spans carry inline colors — retune them to this palette */
.v2 .diff-correct { color: var(--olive) !important; }
.v2 .diff-said { color: var(--rose) !important; }
.v2 .diff-fix { color: var(--sky-deep) !important; background: var(--sky-soft); border-radius: 6px; padding: 0 4px; }
.v2 .diff-missing { color: var(--sky-deep) !important; background: var(--sky-soft); border-radius: 6px; padding: 0 4px; text-underline-offset: 6px; }
.v2 .diff-extra { color: var(--rose) !important; }

@media (prefers-reduced-motion: reduce) {
  .v2 *, .v2 *::before, .v2 *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* ── David studio (/studio/) ──────────────────────────────────────────── */
.studio-steps { margin: 0; padding-inline-start: 1.2em; display: grid; gap: 4px; font-size: 14px; color: var(--ink-soft); }
.studio-traps { border-collapse: collapse; width: 100%; font-size: 13px; }
.studio-traps th, .studio-traps td { text-align: start; padding: 6px 8px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.studio-traps th { font-size: 12px; color: var(--muted); font-weight: 600; }
.studio-meter { height: 8px; border-radius: 999px; background: var(--parchment-2); overflow: hidden; }
.studio-meter > span { display: block; height: 100%; background: linear-gradient(90deg, var(--olive), var(--gold)); transition: width .08s linear; }
.studio-bar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; display: grid; gap: 8px; padding-block: 10px; background: var(--parchment); }
.studio-chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; }
.studio-chips .v-chip { border: 0; cursor: pointer; }
.studio-code { font: 600 11px ui-monospace, Consolas, monospace; background: var(--parchment-2); color: var(--ink-soft); padding: 2px 7px; border-radius: 6px; }
.studio-line.is-approved { border-color: #BFE0CC; }
.studio-line.is-rejected { border-color: #F3C9BB; }
.studio-rec { margin-top: 14px; display: flex; justify-content: center; }
.studio-rec .v-mic[disabled] { opacity: .45; cursor: not-allowed; }
.studio-takes { margin-top: 14px; display: grid; gap: 10px; border-top: 1px dashed var(--line); padding-top: 12px; }
.studio-take { padding: 10px; border-radius: var(--r-sm); background: #FFFDF8; border: 1px solid var(--line-soft); }
.studio-take.is-approved { background: var(--olive-soft); border-color: #BFE0CC; }
.studio-take audio { height: 36px; }

/* ── Practice: step ladder, tone band, step-change bubble (2026-10-20) ── */
.v-ladder { display: flex; flex-wrap: wrap; gap: 4px; list-style: none; margin: 8px 0 0; padding: 0; }
.v-ladder-pill { display: inline-flex; align-items: center; gap: 3px; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600;
  border: 1px solid var(--line); color: var(--muted); background: #fff; transition: all .25s var(--ease-out); }
.v-ladder-pill.is-done { background: var(--olive-soft); border-color: #BFE0CC; color: var(--olive-deep); }
.v-ladder-pill.is-now { background: var(--sky-soft); border-color: var(--sky); color: var(--sky-deep); box-shadow: 0 0 0 2px rgba(61,111,224,.12); }
.v-tone { overflow: hidden; }
.v-tone::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 4px; transition: background .3s; }
.v-tone-learn::before { background: var(--sky); }
.v-tone-memory::before { background: var(--gold); }
.v-tone-link::before { background: var(--coral); }
.v-tone-group::before { background: var(--olive); }
.v-tone-tag { position: absolute; top: 10px; inset-inline-start: 12px; font-size: 10.5px; font-weight: 700; padding: 1px 8px; border-radius: 999px; }
.v-tone-learn .v-tone-tag { background: var(--sky-soft); color: var(--sky-deep); }
.v-tone-memory .v-tone-tag { background: var(--gold-soft); color: var(--gold-deep); }
.v-tone-link .v-tone-tag { background: var(--coral-soft); color: #B4482C; }
.v-tone-group .v-tone-tag { background: var(--olive-soft); color: var(--olive-deep); }
.v-step-intro { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 16px; background: var(--gold-soft); border: 1px solid #E8D29A; text-align: start; }
.v-step-intro-bar { height: 3px; margin-top: 6px; border-radius: 999px; background: rgba(156,122,42,.18); overflow: hidden; }
.v-step-intro-bar > span { display: block; height: 100%; background: var(--gold); animation: stepIntroBar 2.6s linear forwards; }
@keyframes stepIntroBar { from { width: 100%; } to { width: 0; } }

/* ── Home listen player (2026-10-21): card ▶/🔁 buttons + mini bar above the nav ── */
.v-listen-btn { width: 34px; height: 34px; border-radius: 999px; display: inline-grid; place-items: center; font-size: 14px; line-height: 1;
  background: #fff; border: 1px solid var(--line); color: var(--sky-deep); transition: all .2s var(--ease-out); flex-shrink: 0; }
.v-listen-btn:hover { border-color: var(--sky); }
.v-listen-btn.is-on { background: var(--sky-soft); border-color: var(--sky); box-shadow: 0 0 0 3px rgba(61,111,224,.12); }
.v-listen-btn.is-main { width: 42px; height: 42px; font-size: 16px; background: var(--sky); border-color: var(--sky); color: #fff; }
.v-listen-spin { width: 14px; height: 14px; border-radius: 999px; border: 2px solid var(--sky-soft); border-top-color: var(--sky); animation: listenSpin .8s linear infinite; }
@keyframes listenSpin { to { transform: rotate(360deg); } }
.v-listen-bar { position: fixed; inset-inline: 12px; bottom: calc(var(--nav-h) + 20px + env(safe-area-inset-bottom)); z-index: 45;
  max-width: 28rem; margin-inline: auto; padding: 10px 12px 10px; border-radius: 20px; overflow: hidden;
  background: rgba(255,255,255,.96); border: 1px solid var(--line); box-shadow: 0 18px 40px -18px rgba(14,26,58,.35); }
.v-listen-progress { position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--sky-soft); }
.v-listen-progress > span { display: block; height: 100%; background: var(--sky); transition: width .3s linear; }
.v-pad-listen { padding-bottom: calc(var(--nav-h) + 150px + env(safe-area-inset-bottom)); }

/* ── Verse search (2026-10-21): matched words, range tree ── */
.v-hit { background: var(--gold-soft); color: var(--gold-deep); border-radius: 6px; box-shadow: 0 0 0 2px var(--gold-soft); }
.v-tree, .v-tree ul { list-style: none; margin: 0; padding: 0; }
.v-tree > li { margin-bottom: 10px; border: 1px solid var(--line); border-radius: 16px; background: #fff; overflow: hidden; }
.v-tree-row { display: flex; align-items: center; gap: 10px; padding: 9px 12px; font-size: 14px; color: var(--ink); cursor: pointer; }
.v-tree-top { background: var(--parchment-2); font-weight: 700; font-size: 15px; }
.v-tree ul[role=group] > li + li { border-top: 1px solid var(--line-soft); }
.v-tree-fold { display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px; border-radius: 8px; color: var(--muted); }
.v-tree-books { background: #FFFDF8; }
.v-tree-book { padding-inline-start: 34px; font-size: 13.5px; }
.v-drag-handle { cursor: grab; touch-action: none; color: var(--muted); font-size: 15px; letter-spacing: -2px; padding: 4px 2px; user-select: none; }
.v-li-item.sortable-ghost { opacity: .45; }
/* list reorder: the moved verse glows briefly after sliding into place */
.v-li-item.v-li-moved { animation: liMoved 1.1s var(--ease-out); }
@keyframes liMoved { 0%, 35% { box-shadow: 0 0 0 3px rgba(61,111,224,.35), 0 12px 28px -14px rgba(61,111,224,.5); border-color: var(--sky); } 100% { box-shadow: none; } }

/* verse search query rows (2026-10-22): chip inputs + the plain-sentence summary */
.v-chipbox { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-height: 46px; padding: 6px 10px; border: 1.5px solid var(--line); border-radius: 14px; background: #fff; cursor: text; }
.v-chipbox:focus-within { border-color: var(--sky); box-shadow: 0 0 0 4px rgba(61,111,224,.14); }
.v-chipbox-input { flex: 1; min-width: 7em; border: 0 !important; outline: 0 !important; box-shadow: none !important; -webkit-appearance: none; appearance: none; background: transparent; font-size: 16px; padding: 4px 2px; color: var(--ink); }
.v-term { display: inline-flex; align-items: center; gap: 4px; padding: 3px 4px 3px 10px; border-radius: 999px; font-size: 14px; }
.v-term button { width: 20px; height: 20px; border-radius: 999px; display: grid; place-items: center; font-size: 14px; line-height: 1; }
.v-term-no { background: var(--rose-soft); color: #9B2C2C; }
.v-term-or { background: var(--gold-soft); color: var(--gold-deep); }
.v-query-summary { margin-top: 12px; padding: 10px 12px; border-radius: 14px; background: var(--parchment-2); font-size: 13px; color: var(--ink-soft); line-height: 1.7; }


/* ════════════════════════════════════════════════════════════════════════
   HOME — design A (night sky, candles, gold button, arch tiles) + B's arch verse
   ════════════════════════════════════════════════════════════════════════ */
.h-sky { position: relative; color: #fff; overflow: hidden; padding: 10px 0 40px;
  background: radial-gradient(120% 80% at 50% -10%, #2A3F86 0%, var(--night-2) 38%, var(--night) 75%); }
.h-sky .v-build-gap { height: 18px; }
.h-stars { position: absolute; inset: 0; pointer-events: none; opacity: .85;
  background-image:
    radial-gradient(1.2px 1.2px at 12% 18%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 28% 42%, #fff 50%, transparent 51%),
    radial-gradient(1.4px 1.4px at 45% 12%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 63% 30%, #fff 50%, transparent 51%),
    radial-gradient(1.6px 1.6px at 80% 16%, #FFF3C4 50%, transparent 51%), radial-gradient(1px 1px at 90% 44%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 8% 60%, #fff 50%, transparent 51%), radial-gradient(1.2px 1.2px at 52% 56%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 72% 66%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 36% 72%, #fff 50%, transparent 51%); }
.h-rays { position: absolute; top: -40px; left: 50%; width: 460px; height: 380px; transform: translateX(-50%); pointer-events: none;
  background: conic-gradient(from 180deg at 50% 0%, transparent 0deg, rgba(244,212,124,.10) 8deg, transparent 16deg, rgba(244,212,124,.07) 26deg,
    transparent 34deg, rgba(244,212,124,.10) 44deg, transparent 52deg, transparent 308deg, rgba(244,212,124,.08) 318deg, transparent 326deg,
    rgba(244,212,124,.10) 336deg, transparent 346deg);
  -webkit-mask-image: radial-gradient(70% 70% at 50% 0%, #000 30%, transparent 75%); mask-image: radial-gradient(70% 70% at 50% 0%, #000 30%, transparent 75%); }
.h-hills { position: absolute; inset-inline: 0; bottom: -1px; width: 100%; height: 34px; pointer-events: none; }
.h-gear { width: 34px; height: 34px; border-radius: 999px; display: grid; place-items: center; color: #fff;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); }

/* the week's candles */
.h-candles { display: flex; gap: 8px; align-items: flex-end; }
.h-candle { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 10px; color: rgba(255,255,255,.6); }
.h-candle.is-today .h-day { color: #F4D47C; font-weight: 700; }
.h-flame { width: 9px; height: 13px; border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  background: radial-gradient(circle at 50% 70%, #FFF6D8 0%, #F4D47C 45%, #E09B2D 80%); box-shadow: 0 0 10px 3px rgba(244,212,124,.55); }
.h-wick { width: 7px; height: 16px; border-radius: 2px; background: linear-gradient(180deg, #FBF1D3, #E9D9B0); }
.h-candle.off .h-flame { background: rgba(255,255,255,.16); box-shadow: none; }
.h-candle.off .h-wick { background: rgba(255,255,255,.18); }
.h-candle.today .h-flame { animation: h-flick 1.6s ease-in-out infinite; transform-origin: 50% 100%; }
/* 2026-10-27 schedule states (apps/accounts/schedule.py) */
.h-candle { position: relative; }
.h-candle.s-missed .h-flame { visibility: hidden; }
.h-candle.s-missed .h-wick { height: 9px; background: rgba(255,255,255,.12); }
.h-candle.s-makeup_open .h-flame { visibility: hidden; }
.h-candle.s-makeup_open .h-wick { background: transparent; border: 1.5px dashed rgba(244,212,124,.75); }
.h-candle.s-ahead { opacity: .55; }
.h-candle.s-ahead .h-flame { visibility: hidden; }
.h-candle.s-today .h-wick { background: rgba(255,255,255,.3); }
.h-made { position: absolute; top: -13px; font-size: 10px; color: #F4D47C; }
.h-offday { justify-content: flex-end; }
.h-offmark { height: 31px; display: flex; align-items: flex-end; padding-bottom: 2px; font-size: 13px; line-height: 1; color: rgba(255,255,255,.35); }
.h-offmark.is-bonus { color: #F4D47C; text-shadow: 0 0 8px rgba(244,212,124,.7); }
@keyframes h-flick { 0%,100% { transform: scale(1) } 50% { transform: scale(1.14) translateY(-1px) } }

/* gold primary button */
.h-gbtn { position: relative; display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 18px; padding: 13px;
  border-radius: 999px; font-weight: 700; font-size: 15px; color: var(--night); text-decoration: none;
  background: linear-gradient(180deg, #F7E3A6 0%, #E2BE63 55%, #C9A24A 100%);
  box-shadow: 0 0 0 1px rgba(255,240,200,.6) inset, 0 10px 30px -8px rgba(244,212,124,.65); transition: transform .15s var(--ease-out); }
.h-gbtn:active { transform: scale(.98); }
.h-gbtn:focus-visible, .h-pill:focus-visible, .h-gear:focus-visible { outline: 2px solid #F4D47C; outline-offset: 3px; }

/* ornament heading */
.h-orn { display: flex; align-items: center; gap: 8px; color: var(--gold-deep); font: 700 14px 'Amiri', serif; margin: 14px 2px 12px; }
.h-orn::before, .h-orn::after { content: ''; flex: 1; height: 1px; background: linear-gradient(to left, transparent, rgba(201,162,74,.7)); }
.h-orn::after { background: linear-gradient(to right, transparent, rgba(201,162,74,.7)); }
.h-orn span { font-size: 12px; color: var(--gold); }

/* parchment tiles with a halo ring */
.h-tile { position: relative; display: flex; align-items: center; gap: 12px; margin-bottom: 12px; padding: 12px 14px 12px 12px;
  background: linear-gradient(180deg, #FFFDF8, #FFF9EE); border-radius: 22px; border: 1px solid #EFE4CC;
  box-shadow: 0 8px 22px -16px rgba(156,122,42,.6); color: inherit; }
.h-tile-treasure { background: linear-gradient(180deg, #FFFDF5, #FBF3DF); }
.h-halo { width: 46px; height: 46px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center; font-size: 11px; font-weight: 700;
  color: var(--night); text-decoration: none;
  background: radial-gradient(circle, #fff 56%, transparent 57%), conic-gradient(var(--c, #3D6FE0) calc(var(--p, 40) * 1%), #E8EEF9 0);
  box-shadow: 0 0 14px -2px var(--g, rgba(61,111,224,.35)); }
.h-halo.gold { --c: var(--gold); --g: rgba(244,212,124,.65); color: var(--gold-deep); font-size: 16px; }
.h-ribbon { position: absolute; top: -9px; inset-inline-start: 16px; font-size: 11px; padding: 2px 10px; border-radius: 999px;
  background: linear-gradient(180deg, #F7E3A6, #E2BE63); color: var(--night); font-weight: 700; box-shadow: 0 4px 10px -4px rgba(156,122,42,.6); }
.h-mini-gold { padding: 7px 16px; border-radius: 999px; font-size: 13px; font-weight: 700; color: var(--night);
  background: linear-gradient(180deg, #F7E3A6, #E2BE63); box-shadow: 0 0 0 1px rgba(255,240,200,.6) inset; }

/* «آيتك اليوم» — a night-sky arch window */
.h-arch { position: relative; overflow: hidden; margin-top: 18px; padding: 30px 18px 20px; text-align: center; color: #fff;
  border-radius: 160px 160px 22px 22px;
  background: radial-gradient(120% 90% at 50% 0%, #2A3F86 0%, var(--night-2) 45%, var(--night) 85%);
  border: 1px solid rgba(244,212,124,.55);
  box-shadow: 0 0 0 4px rgba(244,212,124,.10), 0 0 40px -10px rgba(244,212,124,.35) inset, 0 14px 30px -18px rgba(14,26,58,.7); }
/* B1 (2026-11-09): not the ⋯ sheet + scrim — `position: relative` from this rule
   (same specificity, later in the file) beat their `position: fixed`, so the
   sheet opened INSIDE the arch, under the bottom nav. */
.h-arch > :not(.v-sheet):not(.v-scrim) { position: relative; }
.h-arch > .h-stars { position: absolute; }
.h-arch-kicker { font-size: 12.5px; font-weight: 700; color: #F4D47C; }
.h-arch-verse { font-size: 22px; line-height: 1.9; margin: 8px 0 4px; }
.h-arch-first { color: #F4D47C; text-shadow: 0 0 12px rgba(244,212,124,.6); }
.h-arch-ref { font-size: 12.5px; color: rgba(255,255,255,.72); }
.h-pill { display: inline-flex; align-items: center; gap: 6px; padding: 8px 15px; border-radius: 999px; font-size: 13px; font-weight: 600; color: #fff;
  background: rgba(255,255,255,.10); border: 1px solid rgba(244,212,124,.45); }
.h-pill.is-on { background: rgba(244,212,124,.22); }

@media (prefers-reduced-motion: reduce) { .h-candle.today .h-flame { animation: none; } .h-gbtn { transition: none; } }

/* ── FIRST-VISIT SETUP /welcome/ (2026-10-25): night sky, parchment cards, the held prayer ── */
.w-page { position: relative; min-height: 100vh; min-height: 100dvh; overflow: hidden; color: #fff;
  padding-bottom: calc(28px + env(safe-area-inset-bottom));
  background: radial-gradient(120% 70% at 50% -10%, #2A3F86 0%, var(--night-2) 40%, var(--night) 80%); }
.w-wrap { position: relative; }
.w-page .v-build-gap { height: 20px; }   /* clear the build badge */
.w-card { margin-top: 16px; padding: 14px; border-radius: 24px; color: var(--ink);
  background: linear-gradient(180deg, #FFFDF8, #FBF6EA); border: 1px solid rgba(244,212,124,.45);
  box-shadow: 0 0 0 4px rgba(244,212,124,.08), 0 18px 40px -22px rgba(0,0,0,.6); }
.w-row { display: flex; align-items: flex-start; gap: 12px; padding: 8px 4px; font-size: 14.5px; line-height: 1.7; }
.w-row + .w-row { border-top: 1px solid var(--line-soft); }
.w-ico { width: 36px; height: 36px; flex-shrink: 0; display: grid; place-items: center; font-size: 18px; border-radius: 14px; background: var(--gold-soft); color: var(--gold-deep); }
.w-opt { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; margin-bottom: 10px; padding: 12px 14px;
  border-radius: 18px; border: 1.5px solid var(--line); background: #FFFDF8; color: var(--ink);
  font-size: 15px; font-weight: 700; text-align: start; transition: border-color .15s, box-shadow .15s, background .15s; }
.w-opt.is-on { border-color: var(--gold-deep); background: linear-gradient(180deg, #FFF6DA, #FBE9B6); box-shadow: 0 0 0 3px rgba(201,162,74,.28); }
.w-opt:focus-visible { outline: 2px solid var(--sky); outline-offset: 2px; }
.w-passage { display: block; padding-top: 16px; cursor: pointer; }
.w-passage .h-ribbon { top: -9px; }
.w-next { margin-top: 18px; border: 0; }
/* weekly schedule rows (Settings «مواعيدك», 2026-10-27) */
.s-row { display: grid; grid-template-columns: minmax(84px, auto) 1fr 1fr; gap: 6px; align-items: center; min-height: 48px; padding: 6px 8px; border-radius: 14px;
  border: 1px solid var(--line-soft); background: #FFFDF8; }
.s-row.is-on { border-color: rgba(201,162,74,.55); background: #FFF8E6; }
.s-day { display: flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 700; color: var(--ink); cursor: pointer; min-width: 0; }
.s-sel { padding: 6px 24px 6px 8px; padding-inline-start: 8px; padding-inline-end: 24px; background-position: left 6px center; background-size: 12px;
  font-size: 12.5px; min-width: 0; }
.s-rest { grid-column: span 2; font-size: 12.5px; color: var(--muted); }
.s-sel:disabled { opacity: .45; }
/* theme chips «حسب احتياجك» (Browse + /welcome/) */
.t-chip { display: inline-flex; align-items: center; gap: 4px; padding: 6px 12px; border-radius: 999px; font-size: 13px; font-weight: 700;
  color: var(--ink); background: #FFFDF8; border: 1.5px solid var(--line); transition: border-color .15s, background .15s; }
.t-chip.is-on { border-color: var(--gold-deep); background: linear-gradient(180deg, #FFF6DA, #FBE9B6); }
.t-chip:focus-visible { outline: 2px solid var(--sky); outline-offset: 2px; }
.w-next:disabled { cursor: not-allowed; }

.w-ring-wrap { position: relative; width: 172px; height: 172px; margin: 26px auto 12px; display: grid; place-items: center; }
.w-ring { position: relative; width: 156px; height: 156px; border-radius: 50%; display: grid; place-items: center; touch-action: none;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
  background: radial-gradient(circle, rgba(244,212,124,.16) 0%, rgba(14,26,58,.2) 70%);
  box-shadow: 0 0 0 1px rgba(244,212,124,.35) inset, 0 0 34px -6px rgba(244,212,124,.45); transition: transform .2s var(--ease-out), box-shadow .3s; }
.w-ring.is-holding { transform: scale(.96); box-shadow: 0 0 0 1px rgba(244,212,124,.6) inset, 0 0 50px 0 rgba(244,212,124,.6); }
.w-ring.is-done { box-shadow: 0 0 0 1px rgba(255,243,196,.9) inset, 0 0 70px 8px rgba(244,212,124,.75); }
.w-ring:focus-visible { outline: 2px solid #F4D47C; outline-offset: 5px; }
.w-ring svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.w-ring-track { fill: none; stroke: rgba(255,255,255,.14); stroke-width: 5; }
.w-ring-fill { fill: none; stroke: #F4D47C; stroke-width: 5; stroke-linecap: round; stroke-dasharray: 327; filter: drop-shadow(0 0 6px rgba(244,212,124,.8)); }
.w-ring-core { font-size: 38px; line-height: 1; color: #F4D47C; text-shadow: 0 0 14px rgba(244,212,124,.7); }
/* the light when the prayer is held to the end — gold only, it fades out (no dark particles) */
.w-bloom { position: absolute; left: 50%; top: 50%; width: 160px; height: 160px; margin: -80px 0 0 -80px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(255,246,216,.95) 0%, rgba(244,212,124,.55) 35%, rgba(244,212,124,0) 70%);
  animation: w-bloom 1.6s var(--ease-out) forwards; }
@keyframes w-bloom { 0% { transform: scale(.4); opacity: .95 } 100% { transform: scale(3.4); opacity: 0 } }
@media (prefers-reduced-motion: reduce) { .w-bloom { display: none; } .w-ring, .w-opt { transition: none; } }

/* ── PASSAGE page: one flowing text in pieces + follow-along listening (2026-11-01) ── */
.p-flow { font-size: 21px; line-height: 2.25; color: var(--ink); text-align: justify; }
.p-vnum { font: 700 12px 'IBM Plex Sans Arabic', sans-serif; color: var(--gold-deep); margin-inline: 3px 4px; vertical-align: super; }
.p-piece { display: inline; padding: 2px 6px; border-radius: 10px; cursor: pointer; transition: background .2s, box-shadow .2s;
  -webkit-box-decoration-break: clone; box-decoration-break: clone; -webkit-tap-highlight-color: transparent; }
.p-piece.p-a { background: #EEF3FD; box-shadow: inset 0 0 0 1px #DCE6FA; }   /* sky, soft */
.p-piece.p-b { background: #FBF3DF; box-shadow: inset 0 0 0 1px #F0E3BE; }   /* gold, soft */
.p-piece:hover { filter: brightness(.97); }
.p-piece:focus-visible { outline: 2px solid var(--sky); outline-offset: 2px; }
.p-piece.is-playing { background: #DCE7FF; color: var(--night); box-shadow: inset 0 0 0 2px var(--sky), 0 0 0 3px rgba(61,111,224,.15); }
/* «اسمع وردّد»: the pause after a piece — the member says it now (dashed gold, a soft pulse) */
.p-piece.is-saying { background: #FBEFCF; color: var(--night); outline: 2px dashed var(--gold); outline-offset: 1px; animation: p-say 1.6s ease-in-out infinite; }
@keyframes p-say { 50% { background: #F6E3B0; } }
@media (prefers-reduced-motion: reduce) { .p-piece { transition: none; } .p-piece.is-saying { animation: none; } }
/* «كلمات بتغلطك» (2026-11-02): a word this member keeps missing — a soft rose dotted underline */
.p-weak { text-decoration: underline dotted var(--rose); text-decoration-thickness: 2px; text-underline-offset: 6px; }
/* «سجّل صوتك» (2026-11-08): a piece the member has recorded */
.p-mine { font-size: .55em; margin-inline-start: 2px; vertical-align: super; font-family: system-ui, sans-serif; }

/* ── CHAPTER screen «اقرأ الإصحاح» (2026-10-24): beads on a gold thread → a passage ── */
.c-pad-foot { padding-bottom: calc(var(--nav-h) + 300px + env(safe-area-inset-bottom)); }   /* 2026-11-09: + the second choice row */
.c-readlink { font-size: 12px; font-weight: 700; color: var(--gold-deep); text-decoration: none; }
.c-readlink:hover { text-decoration: underline; }
.c-runchip { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-top: 8px; padding: 6px 12px; border-radius: 999px;
  font-size: 12.5px; font-weight: 700; color: var(--gold-deep); text-decoration: none;
  background: linear-gradient(135deg, var(--gold-soft), #fff); border: 1px solid #E8D29A; box-shadow: var(--shadow-glow-gold); }
.c-strip { margin-bottom: 12px; padding: 10px 12px; border-radius: var(--r-md); background: var(--paper); border: 1px solid var(--line); }
.c-strip-title { font-size: 12px; font-weight: 700; color: var(--ink-soft); margin-bottom: 6px; }
.c-chip-on { background: var(--gold); color: #fff; }

.c-verses { list-style: none; margin: 0; padding: 0; }
.c-verse { position: relative; border-radius: var(--r-md); transition: background .25s var(--ease-out); }
.c-vbtn { position: relative; display: flex; align-items: flex-start; gap: 8px; width: 100%; padding-block: 10px; padding-inline: 8px 10px;
  text-align: start; border-radius: var(--r-md); background: transparent; }
.c-vbtn:focus-visible { outline: 2px solid var(--sky); outline-offset: 2px; }
/* the bead column (inline-start): a bead per verse; the picked ones are strung on one gold thread */
.c-bead { position: relative; z-index: 2; flex-shrink: 0; width: 18px; height: 18px; margin-top: 9px; border-radius: 999px;
  border: 2px solid #D9C99F; background: var(--parchment); transition: all .2s var(--ease-spring); }
.c-thread-wrap { position: relative; }
/* the loose gold thread through the picked beads — an SVG path drawn by chapter-pick.js */
.c-thread { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.c-thread path { fill: none; stroke-linecap: round; transition: opacity .25s; }
.c-thread-main { stroke: url(#cThreadGold); stroke-width: 2.6; filter: drop-shadow(0 1px 1.5px rgba(156,122,42,.35)); }
.c-thread-shine { stroke: #FFF3CF; stroke-width: 1; stroke-dasharray: 5 6; opacity: .85; }
.c-verse.is-on { background: var(--gold-soft); }
.c-verse.is-on.is-first { border-end-start-radius: 0; border-end-end-radius: 0; }
.c-verse.is-on.is-last { border-start-start-radius: 0; border-start-end-radius: 0; }
.c-verse.is-on:not(.is-first):not(.is-last) { border-radius: 0; }
.c-verse.is-on.is-first.is-last { border-radius: var(--r-md); }
.c-verse.is-on .c-bead { background: radial-gradient(circle at 40% 35%, #F7E3A8, var(--gold) 70%); border-color: var(--gold-deep);
  box-shadow: 0 0 0 3px rgba(201,162,74,.22), 0 0 10px rgba(201,162,74,.55); transform: scale(1.08); }
.c-verse.is-playing .c-text { color: var(--sky-deep); }
.c-num { flex-shrink: 0; min-width: 22px; margin-top: 6px; font-size: 12px; font-weight: 700; color: var(--gold-deep); text-align: center; }
.c-text { flex: 1; min-width: 0; font-size: 19px; line-height: 2; color: var(--ink); }
/* the member's own passages: a thin line on the far edge (sky = learning, olive = mastered) */
.c-mark-learning .c-vbtn { box-shadow: inset -3px 0 0 var(--sky); }
.c-mark-mastered .c-vbtn { box-shadow: inset -3px 0 0 var(--olive); }
[dir="rtl"] .c-mark-learning .c-vbtn { box-shadow: inset 3px 0 0 var(--sky); }
[dir="rtl"] .c-mark-mastered .c-vbtn { box-shadow: inset 3px 0 0 var(--olive); }
.c-midchips { display: flex; gap: 8px; justify-content: center; padding: 0 0 10px; }
.c-midchips .v-chip { font-size: 13px; padding: 6px 14px; }
/* the verse the member came from glows once */
.c-anchor .c-vbtn { animation: cAnchor 2.2s var(--ease-out) 1; }
@keyframes cAnchor { 0%, 40% { box-shadow: 0 0 0 2px var(--gold), 0 0 22px rgba(201,162,74,.55); } 100% { box-shadow: 0 0 0 0 transparent; } }

.c-foot { position: fixed; inset-inline: 12px; bottom: calc(var(--nav-h) + 20px + env(safe-area-inset-bottom)); z-index: 45;
  max-width: 28rem; margin-inline: auto; padding: 10px 12px 12px; border-radius: 22px;
  background: rgba(255,255,255,.97); border: 1px solid var(--line); box-shadow: 0 18px 40px -18px rgba(14,26,58,.38); }
.c-hint { margin-bottom: 8px; align-items: flex-start; gap: 8px; }
.c-hint .coach-avatar { width: 40px; height: 40px; border-width: 2px; }
.c-hint .coach-bubble { padding: 7px 10px; }
.c-hint .coach-text { font-size: .84rem; line-height: 1.55; }
.c-hint .coach-detail { margin-top: 4px; padding: 4px 8px; }
.c-range { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-bottom: 8px; font-size: 13px; }
.c-range-part { display: inline-flex; align-items: center; gap: 4px; }
.c-range-label { color: var(--ink-soft); font-weight: 600; }
.c-range-n { min-width: 26px; text-align: center; font-weight: 800; color: var(--gold-deep); font-size: 15px; }
.c-step { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; font-size: 17px; line-height: 1;
  background: var(--parchment); border: 1px solid var(--line); color: var(--ink); }
.c-step:disabled { opacity: .35; }
.c-step:focus-visible { outline: 2px solid var(--sky); outline-offset: 1px; }
.c-range-count { margin-inline-start: auto; font-weight: 700; color: var(--ink-soft); }
.c-listen { width: 52px !important; flex-shrink: 0; padding-inline: 0; }
@media (prefers-reduced-motion: reduce) {
  .c-verse, .c-bead, .c-thread path { transition: none; }
  .c-anchor .c-vbtn { animation: none; }
}

/* ── Power-user batch 1 (2026-11-05) ─────────────────────────────────────── */
/* A3: previous / next chapter */
.c-chnav { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: -4px 0 12px; }
.c-chnav-link { max-width: 48%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; padding: 6px 12px; }
/* A2: «روح لشاهد…» landed here — the verse(s) glow once, nothing is picked */
.c-flash .c-vbtn { animation: cFlash 3s var(--ease-out) 1; }
@keyframes cFlash { 0%, 45% { background: var(--gold-soft); box-shadow: 0 0 0 2px var(--gold); } 100% { background: transparent; box-shadow: 0 0 0 0 transparent; } }
.v-gobox { display: flex; align-items: center; gap: 8px; position: relative; }
.v-gobox .v-input { flex: 1; min-width: 0; padding-inline-start: 2.4rem; font-size: 16px; }
.v-gobox-ico { position: absolute; inset-inline-start: 12px; font-size: 15px; pointer-events: none; opacity: .7; }
/* A7: «حجم خط الآيات» — per device (static/js/text-size.js sets <html data-text>) */
html[data-text="lg"] :is(.scripture, .p-flow, .v-answer, .v-diff, .v-voicebox) { zoom: 1.15; }
html[data-text="xl"] :is(.scripture, .p-flow, .v-answer, .v-diff, .v-voicebox) { zoom: 1.3; }
html[data-text] :is(.scripture, .p-flow) :is(.scripture, .p-flow) { zoom: 1; }   /* never twice */
html[data-text="xl"] .v-nav a > span:last-child { font-size: 13px; }
@media (prefers-reduced-motion: reduce) {
  .c-flash .c-vbtn { animation: none; }
}

/* ── Reader core (2026-11-05): read mode on the chapter screen ───────────── */
.c-readbar { display: flex; gap: 8px; margin: 0 0 8px; }
.c-readbar .v-btn { width: auto; }
.c-seg { border-radius: 6px; transition: background .25s, color .25s; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.c-seg.is-now { background: var(--gold-soft); color: var(--ink); box-shadow: 0 0 0 2px var(--gold-soft); }
.c-verse.is-reading .c-num { color: var(--sky-deep); }
.c-verse.is-reading .c-bead { background: radial-gradient(circle at 40% 35%, #DCE6FB, var(--sky) 75%); border-color: var(--sky-deep); }
.c-toread { display: block; margin: 8px auto 0; font-size: 12.5px; font-weight: 700; color: var(--ink-soft); background: none; border: 0; }
@media (prefers-reduced-motion: reduce) { .c-seg { transition: none; } }
/* Home: «كمّل قراية …» (reader core B2) — one quiet line, not a card */
.h-continue { display: flex; align-items: center; gap: 8px; margin: 2px 0 12px; padding: 9px 14px; border-radius: 14px;
  background: var(--sky-soft); color: var(--sky-deep); font-size: 13.5px; font-weight: 600; }

/* ── «خطط القراية» (power-user review B4, 2026-11-05) ─────────────────────── */
.pl-bar { height: 6px; border-radius: 99px; background: var(--parchment-2); overflow: hidden; }
.pl-bar > span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--sky), var(--olive)); }
.pl-stop { display: block; margin: 10px auto 0; font-size: 12.5px; font-weight: 600; color: var(--ink-soft); background: none; border: 0; }
.pl-books { display: flex; flex-wrap: wrap; gap: 6px; max-height: 15rem; overflow-y: auto; padding: 2px; }
.pl-book { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 12px; border: 1px solid var(--line);
  background: #fff; font-size: 14.5px; cursor: pointer; }
.pl-book.is-on { border-color: var(--sky); background: var(--sky-soft); }
.pl-book .v-check { margin: 0; }
/* chapter screen: today's plan strip + the «✓ قريت الإصحاح ده» button */
.c-planbar { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; padding: 8px 12px; border-radius: 14px;
  background: var(--olive-soft); color: var(--olive); font-size: 13px; font-weight: 700; }

/* ── UI Part 1 (2026-11-06): the four drawn tab icons ─────────────────────── */
.v-ti { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.v-ti .gold { fill: #D9C08A; stroke: #B79B5B; stroke-width: 1; }
.v-ti .lens { fill: var(--paper); }
.v-nav a[aria-current="page"] .v-ti { stroke-width: 1.9; }
.v-nav a[aria-current="page"] .v-ti .gold { fill: var(--gold); stroke: var(--gold-deep); }
/* كنوزي ← قيد الحفظ: compact passage rows */
.k-rows { list-style: none; margin: 0; padding: 0; background: var(--paper); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.k-rows li + li { border-top: 1px solid var(--line-soft); }
.k-row { display: flex; align-items: center; gap: 12px; padding: 11px 14px; color: inherit; }
.k-row .h-halo { width: 40px; height: 40px; }
.k-ico { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--parchment-2); font-size: 15px; flex-shrink: 0; }
/* G2 (design review 2026-11-09): one line-icon style ({% icon %}), tinted by meaning */
.v-i { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; display: inline-block; vertical-align: middle; }
.k-ico { color: var(--ink-soft); }
.k-ico.sky   { background: var(--sky-soft);   color: var(--sky-deep); }
.k-ico.gold  { background: var(--gold-soft);  color: var(--gold-deep); }
.k-ico.olive { background: var(--olive-soft); color: var(--olive-deep); }
.k-ico.coral { background: var(--coral-soft); color: #B4482C; }
.k-ico.rose  { background: var(--rose-soft);  color: #B93434; }
.k-row.danger, .k-row.danger .text-ink { color: #B93434; }
.v-listen-btn .v-i { width: 18px; height: 18px; }
.k-row:is(button) { background: none; border: 0; font: inherit; color: inherit; cursor: pointer; }
.h-more { z-index: 61; max-width: 560px; margin-inline: auto; padding: 4px 18px calc(22px + env(safe-area-inset-bottom)); text-align: start; color: var(--ink);
  max-height: 88vh; max-height: 88dvh; overflow-y: auto; overscroll-behavior: contain; }  /* short screens (phone sideways): the sheet scrolls inside */
/* حسابي: three progress numbers in the night header */
.a-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.a-stats div { background: rgba(255,255,255,.08); border-radius: 14px; padding: 8px 4px; text-align: center; font-size: 11.5px; color: rgba(255,255,255,.78); }
.a-stats b { display: block; font-size: 19px; color: #fff; }
/* ── UI Part 2 (2026-11-06): كنوزي ── */
/* «+ مقطع جديد» sheet: the typed-reference row */
.np-form { display: flex; gap: 8px; align-items: center; }
.np-form .v-input { flex: 1; min-width: 0; font-size: 16px; padding-block: 9px; }
/* محفوظة: review health — shape + colour, never colour alone (● safe · ◐ soon · ○ due) */
.k-dot { width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center; font-size: 17px; line-height: 1; }
.k-dot.green { background: var(--olive-soft); color: var(--olive); }
.k-dot.amber { background: var(--gold-soft); color: var(--gold-deep); }
.k-dot.red { background: var(--rose-soft); color: var(--rose); }
.k-dot.none { background: var(--parchment-2); color: var(--gold-deep); }
.k-health { font-weight: 700; }
.k-health.green { color: var(--olive); }
.k-health.amber { color: var(--gold-deep); }
.k-health.red { color: var(--rose); }
/* ── UI Part 3 (2026-11-06): the chapter screen ── */
/* the title IS the «اذهب إلى سفر وإصحاح» button */
.c-titlebtn { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 6px 14px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--paper); color: var(--ink); font-size: 1.15rem; font-weight: 700; cursor: pointer; }
.c-titlebtn:hover { border-color: var(--gold); }
.c-titlebtn-caret { font-size: 12px; color: var(--gold-deep); }
/* ‹ › once, at the bottom */
.c-chnav-foot { margin: 22px 0 6px; }
.c-chnav-foot .c-chnav-link { width: auto; }
