/* Screen-specific styling. Kept thin — most styling comes from components.css. */

/* ---------- landing / role picker ---------- */
.landing {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: var(--ground);
  display: flex;
  flex-direction: column;
  justify-content: center;
  /* safe centering: on short screens (~568px) content overflows the start edge
     and becomes unreachable — safe alignment falls back to start so it scrolls */
  justify-content: safe center;
  padding: calc(var(--safe-top) + var(--s-8)) var(--s-6) calc(var(--safe-bottom) + var(--s-8));
  gap: var(--s-4);
  overflow-y: auto;
}
.landing > * { position: relative; z-index: 1; }
.landing img { width: 64px; height: 64px; border-radius: var(--r-md); margin-bottom: var(--s-4); }
.landing .roles { display: flex; flex-direction: column; gap: var(--s-3); margin-top: var(--s-6); }

/* faint pathway watermark — echo of the logo ribbon across the screen */
.l-watermark { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; }
.l-watermark path {
  fill: none; stroke: color-mix(in srgb, var(--brand) 5%, transparent);
  stroke-width: 24; stroke-linecap: round;
}

.l-eyebrow {
  font-size: var(--t-caption); line-height: var(--lh-caption);
  font-weight: 800; letter-spacing: .3em; text-transform: uppercase;
  color: var(--brand);
}

.l-feats { display: flex; flex-direction: column; gap: var(--s-3); margin-top: var(--s-2); }
.l-feat {
  display: flex; align-items: center; gap: var(--s-3);
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: var(--s-3) var(--s-4);
  font-size: var(--t-sub); line-height: var(--lh-sub); font-weight: 700; color: var(--ink);
  box-shadow: 0 1px 2px rgba(4, 16, 56, .04);
}
.l-feat .fic {
  width: 34px; height: 34px; flex: none; display: grid; place-items: center;
  border-radius: var(--r-sm); background: var(--tint); color: var(--brand);
}

/* staggered entrance — delays set inline by shell.js (long after the intro
   splash, short when returning from the auth screen) */
.landing .l-rise { opacity: 0; transform: translateY(16px); animation: l-rise .7s var(--ease) both; }
@keyframes l-rise { to { opacity: 1; transform: none; } }
.landing img.l-rise {
  animation: l-rise .7s var(--ease) both, l-logo-glow 4.6s ease-in-out infinite;
}
@keyframes l-logo-glow {
  0%, 100% { box-shadow: 0 0 0 0 transparent; }
  50% { box-shadow: 0 0 36px 2px color-mix(in srgb, var(--glow) 42%, transparent); }
}

/* ---------- intro splash: pathway draws bottom→top, gold tip flash,
   then the ground color blooms out from the tip (first boot only) ---------- */
.intro-splash {
  position: fixed; inset: 0; z-index: 60;
  background: linear-gradient(160deg, var(--electric), var(--brand) 58%, var(--brand-deep));
  animation: intro-out .6s ease 2.55s both;
}
@keyframes intro-out { to { opacity: 0; visibility: hidden; pointer-events: none; } }
.intro-splash .ip { position: absolute; inset: 0; width: 100%; height: 100%; }
.intro-splash .ip path {
  fill: none; stroke-width: 24; stroke-linecap: round;
  stroke-dasharray: 100; stroke-dashoffset: 100;
  animation: intro-draw 1.6s cubic-bezier(.5, .05, .3, 1) .12s both;
}
@keyframes intro-draw { to { stroke-dashoffset: 0; } }
.intro-splash .s0 { stop-color: var(--sky); }
.intro-splash .s1 { stop-color: var(--tint); }
.intro-splash .s2 { stop-color: var(--surface); }
.intro-splash .s3 { stop-color: var(--glow); }
.intro-splash .s4 { stop-color: var(--gold); }
.intro-splash .tipglow {
  position: absolute; top: 3%; left: 43.5%; width: 110px; height: 110px;
  margin: -55px 0 0 -55px; border-radius: var(--r-pill); pointer-events: none;
  background: radial-gradient(circle, color-mix(in srgb, var(--glow) 85%, transparent), transparent 65%);
  opacity: 0; animation: intro-tip .85s ease-out 1.58s both;
}
@keyframes intro-tip {
  0% { opacity: 0; transform: scale(.4); }
  35% { opacity: 1; transform: scale(1.15); }
  100% { opacity: 0; transform: scale(1.7); }
}
.intro-splash .veil {
  position: absolute; inset: 0; background: var(--ground);
  clip-path: circle(0px at 43.5% 3%);
  animation: intro-veil .95s var(--ease) 1.78s both;
}
@keyframes intro-veil { to { clip-path: circle(150% at 43.5% 3%); } }

/* ---------- learner home: guide-led heart check-in ----------
   Guide block ported (behavior, not values) from academy/new-muslim.html:
   gBreathe idle, gTalk while typing, mCheer/mThink reactions, gPeek
   entrance, Maryam eye-sparkles. Academy files themselves are untouched. */
.heartcheck {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: var(--s-3) var(--s-4) var(--s-4);
  box-shadow: 0 1px 2px rgba(4, 16, 56, .04);
  margin-bottom: var(--s-3);
}
.hc-head { display: flex; align-items: center; justify-content: flex-end; min-height: 44px; }
.hc-eyebrow {
  margin-right: auto;
  font-size: var(--t-caption); line-height: var(--lh-caption);
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted); font-weight: 700;
}

/* streak chip — fixed position in both states */
.hc-streak {
  display: inline-flex; align-items: center; gap: var(--s-2);
  background: color-mix(in srgb, var(--gold) 18%, var(--surface));
  color: var(--ink);
  font-size: var(--t-caption); line-height: var(--lh-caption); font-weight: 700;
  border-radius: var(--r-pill); padding: var(--s-2) var(--s-3); min-height: 44px;
  border: 1px solid transparent; cursor: pointer; font-family: inherit;
}
.hc-streak.pulse { animation: hc-streak-pulse .6s ease-out; }
@keyframes hc-streak-pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--glow) 85%, transparent); border-color: var(--glow); }
  100% { box-shadow: 0 0 0 16px transparent; border-color: transparent; }
}

/* streak sheet week row */
.hc-week { display: grid; grid-template-columns: repeat(7, 1fr); gap: var(--s-2); }
.hc-day {
  display: flex; flex-direction: column; align-items: center; gap: var(--s-1);
  font-size: var(--t-caption); line-height: var(--lh-caption); color: var(--muted);
  font-weight: 600;
}
.hc-day em {
  font-style: normal; display: grid; place-items: center;
  width: 32px; height: 32px; border-radius: var(--r-pill);
  background: var(--tint); color: transparent;
}
.hc-day.on em { background: var(--grad-gold); color: var(--ink); }
.hc-day.today em { box-shadow: 0 0 0 2px var(--sky); }

/* ═══════════ GUIDE — ported from academy/new-muslim.html ═══════════ */
.hc-guidebar { display: flex; align-items: flex-end; gap: var(--s-3); padding: 2px 0 var(--s-3); }
.hc-guide { flex: none; width: 64px; height: 89px; position: relative; }
.hc-guide .mimg {
  width: 100%; height: 100%; object-fit: contain; object-position: 50% 100%;
  display: block; filter: drop-shadow(0 3px 7px rgba(11, 47, 166, .20));
  transform-origin: 50% 92%;
}
/* Both guides' artwork has different transparent padding (Ahmed's char fills
   226/256 of his square, Maryam's 469/512 of hers), so each image is scaled
   to make the characters stand the same height (~72px) in the 64px box;
   the overflow is transparent edge padding. Heights measured from the PNG
   alpha bounding boxes. Whole-pixel sizes only — fractional widths rasterize
   blurry on the compositor. */
.hc-guide.ahmad .mimg { width: 82px; max-width: none; margin-left: -9px; }
.hc-guide.maryam .mimg { width: 80px; max-width: none; margin-left: -8px; }

/* idle: breathing bob — always alive (course: gBreathe). Translate-only,
   whole pixels: scaling/rotating a drop-shadowed image forces re-rastering
   every frame, which reads as blur and shimmer. */
.hc-guide:not(.cheer):not(.think):not(.talk):not(.celebrate):not(.peek) .mimg {
  animation: gBreathe 3.6s ease-in-out infinite;
}
@keyframes gBreathe {
  0%, 100% { transform: translateY(0); }
  25% { transform: translateY(-2px); }
  50% { transform: translateY(-3px); }
  75% { transform: translateY(-2px); }
}

/* talk: subtle head bounce while the bubble types (course: gTalk) */
.hc-guide.talk .mimg { animation: gTalk .42s ease-in-out infinite; }
@keyframes gTalk { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-2px); } }

/* cheer: for Steady / Hopeful (course: mCheer) */
.hc-guide.cheer .mimg { animation: mCheer .68s cubic-bezier(.3, 1.5, .4, 1); }
@keyframes mCheer {
  0% { transform: translateY(0) rotate(0); }
  30% { transform: translateY(-13%) rotate(-6deg); }
  52% { transform: translateY(-3%) rotate(5deg); }
  72% { transform: translateY(-9%) rotate(-2.5deg); }
  100% { transform: translateY(0) rotate(0); }
}

/* think: gentle tilt for Unsure / Heavy / Alone (course: mThink) */
.hc-guide.think .mimg { animation: mThink 1.25s ease-in-out; }
@keyframes mThink { 0%, 100% { transform: rotate(0); } 32%, 72% { transform: rotate(-8deg) translateY(1.5%); } }

/* peek: gentle entrance when the screen mounts — a short rise + fade, no
   rotation or overshoot (the bouncy port read as a misalignment glitch) */
.hc-guide.peek .mimg { animation: gPeek .5s ease-out; }
@keyframes gPeek {
  0% { transform: translateY(8px); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}

/* Maryam-only eye sparkles — tiny soft catchlight dots, not star shapes:
   a 4px glowing point that breathes in and out. Subtle by design. */
.hc-spark {
  position: absolute; width: 4px; height: 4px; border-radius: 50%;
  background: #fff; pointer-events: none; opacity: 0;
  box-shadow: 0 0 3px 1px rgba(78, 140, 255, .45);
  animation: mTwinkle 3.4s ease-in-out infinite;
}
.hc-spark.s1 { left: 25%; top: 42%; }
.hc-spark.s2 { left: 64%; top: 41%; animation-delay: 1.6s; }
@keyframes mTwinkle {
  0%, 100% { opacity: 0; transform: scale(.5); }
  50% { opacity: .7; transform: scale(1); }
}

/* speech bubble (course: .bubble — retokenized to the reshell) */
.hc-speech {
  position: relative; flex: 1; background: var(--surface);
  border: 1.5px solid var(--line); border-radius: var(--r-md); border-top-left-radius: 5px;
  padding: 10px 14px; box-shadow: 0 4px 14px rgba(11, 47, 166, .05);
}
.hc-speech .hc-who {
  font-weight: 700; font-size: var(--t-caption); line-height: var(--lh-caption);
  letter-spacing: .12em; text-transform: uppercase; color: var(--gold);
  display: block; margin-bottom: 2px;
}
.hc-speech .hc-txt { font-size: var(--t-body); line-height: var(--lh-body); min-height: 48px; display: block; }
.hc-caret {
  display: inline-block; width: 2px; height: 14px; background: var(--brand);
  vertical-align: -2px; margin-left: 2px; margin-right: -4px; /* net-zero width: the caret must never wrap onto its own line — hiding it would snap the bubble shorter */
  animation: hc-caret 1s steps(1) infinite;
}
.hc-caret[hidden] { display: none; }
@keyframes hc-caret { 50% { opacity: 0; } }
/* ═══════════ end ported GUIDE block ═══════════ */

/* mood row (idle) — grid-rows collapse keeps the card height stable */
.hc-region { display: grid; transition: grid-template-rows .25s ease-out, opacity .25s ease-out; }
.hc-region > .hc-region-inner { overflow: hidden; min-height: 0; }
.hc-region.closed { grid-template-rows: 0fr; opacity: 0; }
.hc-region.open { grid-template-rows: 1fr; opacity: 1; }

.hc-moods { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--s-2); }
.hc-mood {
  appearance: none; border: 1.5px solid var(--line); background: var(--surface);
  border-radius: var(--r-md); padding: 10px var(--s-1); min-height: 64px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: var(--s-1);
  font-family: inherit; color: var(--ink);
  transition: transform .12s ease-out, border-color .15s ease-out, background .15s ease-out;
}
.hc-mood:active { transform: scale(.97); }
.hc-mood .emoji { font-size: 20px; line-height: 1; }
.hc-mood .label { font-size: var(--t-caption); line-height: var(--lh-caption); font-weight: 600; }
.hc-mood[aria-checked="true"] { border-color: var(--brand); background: var(--tint); }
.hc-mood[aria-checked="true"] .label { color: var(--brand-deep); font-weight: 700; }

/* CTA (responded) — revealed after the guide finishes typing */
.hc-cta {
  display: flex; align-items: center; justify-content: center; gap: var(--s-2);
  width: 100%; min-height: 48px; margin-top: var(--s-1);
  border: 0; border-radius: var(--r-pill); cursor: pointer;
  background:
    linear-gradient(rgba(4, 16, 56, .25), rgba(4, 16, 56, .25)),
    var(--grad-brand);
  color: var(--surface);
  font-family: inherit; font-size: var(--t-body); line-height: var(--lh-body); font-weight: 700;
  transition: transform .12s ease-out, filter .15s ease-out;
}
.hc-cta:active { transform: scale(.97); filter: brightness(1.05); }
.hc-cta.reveal { animation: hc-rise .3s ease-out both; }
@keyframes hc-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.hc-change {
  display: block; margin: var(--s-1) auto 0; border: 0; background: none; cursor: pointer;
  font-family: inherit; font-size: var(--t-caption); line-height: var(--lh-caption);
  font-weight: 600; color: var(--muted); padding: var(--s-2) var(--s-3); min-height: 44px;
}

/* ---------- minimal course progress (Home) ---------- */
.course-mini {
  display: flex; align-items: center; gap: var(--s-3);
  width: 100%; text-align: left;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: var(--s-3) var(--s-4); margin-bottom: var(--s-3);
  cursor: pointer; font-family: inherit; color: var(--ink);
  transition: transform 120ms var(--ease), border-color 150ms var(--ease);
}
.course-mini:active { transform: scale(.97); }
.cm-icon {
  flex: none; width: 44px; height: 44px; border-radius: var(--r-pill);
  display: grid; place-items: center;
  background: var(--tint); color: var(--brand-deep);
}
.cm-icon svg { width: 22px; height: 22px; }
/* not started yet — a soft lumen pulse invites the first lesson */
.course-mini.fresh .cm-icon { animation: cm-invite 2.6s ease-out infinite; }
@keyframes cm-invite {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--lumen) 35%, transparent); }
  70% { box-shadow: 0 0 0 10px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}
.cm-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: var(--s-1); }
.cm-top { display: flex; align-items: baseline; gap: var(--s-2); }
.cm-top strong { flex: 1; font-size: var(--t-body); line-height: var(--lh-body); font-weight: 700; }
.cm-top em { font-style: normal; font-size: var(--t-sub); line-height: var(--lh-sub); font-weight: 800; color: var(--brand-deep); }
.cm-bar { height: 6px; border-radius: var(--r-pill); background: var(--line); overflow: hidden; }
.cm-bar i {
  display: block; height: 100%; border-radius: var(--r-pill);
  background: var(--grad-brand); /* the learner's own progress */
  transition: width 450ms var(--ease);
}
.cm-sub { font-size: var(--t-caption); line-height: var(--lh-caption); color: var(--muted); }
.cm-go { flex: none; color: var(--muted); display: grid; place-items: center;
  transition: transform 150ms var(--ease); }
.cm-go svg { width: 18px; height: 18px; }
.course-mini:active .cm-go { transform: translateX(2px); }

/* ---------- da'ee stat tiles ---------- */
.stat-row { display: flex; gap: var(--s-3); margin-bottom: var(--s-4); }
.stat {
  flex: 1;
  background: var(--tint);
  border-radius: var(--r-md);
  padding: var(--s-4) var(--s-3);
  text-align: center;
  transition: transform 120ms var(--ease), background-color var(--fade-ms) var(--ease), border-color var(--fade-ms) var(--ease);
}
.stat strong { display: block; font-size: var(--t-display); line-height: var(--lh-display); color: var(--brand-deep); text-align: center; }
.stat span { display: block; text-align: center; font-size: 10px; line-height: 14px; font-weight: 800; color: var(--muted); letter-spacing: .04em; }

/* ---------- chat thread placeholder ---------- */
.bubble {
  max-width: 78%;
  padding: var(--s-3) var(--s-4);
  border-radius: var(--r-md);
  margin-bottom: var(--s-2);
  font-size: var(--t-body);
  line-height: var(--lh-body);
  background: var(--surface);
  border: 1px solid var(--line);
}
.bubble.me {
  margin-left: auto;
  background: var(--brand);
  border-color: var(--brand);
  color: var(--surface);
}
.bubble time { display: block; font-size: var(--t-caption); color: var(--muted); margin-top: 2px; }
.bubble.me time { color: var(--surface); /* QA: --tint on --brand is 4.49:1 — below the 4.5 floor; --surface is 5.12 */ }

/* ---------- chat header identity (both roles + group) ---------- */
.chat-ident { display: flex; align-items: center; gap: var(--s-2); flex: 1; min-width: 0; }
.chat-ident .avatar { flex: none; }
/* the identity is tappable — it opens the contact profile screen */
.chat-ident[role="button"] { cursor: pointer; border-radius: var(--r-sm); }
.chat-ident[role="button"]:active { opacity: .7; }

/* ---------- contact profile (chat-profile screen) ---------- */
.cp-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
  gap: var(--s-2);
  margin: var(--s-3) 0 var(--s-4);
}
.cp-tile {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: var(--s-1);
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: var(--s-3) var(--s-2);
  min-height: 64px; cursor: pointer; font-family: inherit;
  font-size: var(--t-caption); line-height: var(--lh-caption);
  font-weight: 700; color: var(--ink);
}
.cp-tile .ic { color: var(--brand); display: grid; place-items: center; }
.cp-tile:active { background: var(--tint); }
.chat-ident-main { display: flex; flex-direction: column; min-width: 0; }
.chat-ident-name {
  font-size: var(--t-sub); line-height: var(--lh-sub); font-weight: 800;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.chat-ident-sub {
  font-size: var(--t-caption); line-height: var(--lh-caption); color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ---------- call bubble (kind:'call' messages) ---------- */
/* card-style on both sides — the own-message brand fill would bury the
   status chip, so .me keeps only its alignment and sky ring */
.bubble.call {
  display: flex; flex-direction: column; align-items: flex-start;
  gap: var(--s-1); min-width: min(220px, 100%);
}
.bubble.call.me { background: var(--surface); border-color: var(--line); color: var(--ink); }
.bubble.call.me time { color: var(--muted); }
.call-head {
  display: inline-flex; align-items: center; gap: var(--s-1);
  font-size: var(--t-caption); font-weight: 800; letter-spacing: .02em;
  color: var(--brand-deep); text-transform: uppercase;
}
.call-head svg { width: 16px; height: 16px; }
.call-topic { font-weight: 700; }
.call-when { font-size: var(--t-sub); color: var(--muted); }
.call-acts { display: flex; gap: var(--s-2); width: 100%; margin-top: var(--s-2); }
.call-acts .btn { flex: 1; min-height: 44px; padding: 0 var(--s-3); font-size: var(--t-sub); }

/* ---------- message actions (star / question / note / flag / delete / react) ---------- */
/* deleted — both sides neutralised; JS swaps the text for the placeholder */
.bubble.deleted {
  font-style: italic;
  color: var(--muted);
  background: var(--surface);
  border: 1px dashed var(--line);
}
.bubble.me.deleted {
  background: color-mix(in srgb, var(--line) 35%, var(--surface));
  border-color: var(--line);
  color: var(--muted);
  box-shadow: none; /* drop the own-message sky ring — deleted reads neutral */
}
.bubble.me.deleted time { color: var(--muted); }

/* marked as a question — soft gold fill + gold border, distinct from the
   auto .question heuristic's plain inset bar (components.css) */
.bubble.marked-q {
  background: color-mix(in srgb, var(--gold) 14%, var(--surface));
  border-color: var(--gold);
}
.bubble.me.marked-q { color: var(--ink); }
.bubble.me.marked-q time { color: var(--muted); }

/* flagged for review — danger tint + left inset bar */
.bubble.flagged {
  background: color-mix(in srgb, var(--danger) 8%, var(--surface));
  box-shadow: inset 3px 0 0 var(--danger);
}
.bubble.me.flagged {
  color: var(--ink);
  box-shadow: 0 0 0 2px var(--sky), inset 3px 0 0 var(--danger);
}
.bubble.me.flagged time { color: var(--muted); }

/* da'ee private note — electric tint + left inset bar; the note text line
   (.note-line) styles live with the other bubble tags in components.css */
.bubble.noted {
  background: color-mix(in srgb, var(--electric) 7%, var(--surface));
  box-shadow: inset 3px 0 0 var(--electric);
}
.bubble.me.noted {
  color: var(--ink);
  box-shadow: 0 0 0 2px var(--sky), inset 3px 0 0 var(--electric);
}
.bubble.me.noted time { color: var(--muted); }

/* demo tap press feedback — not on system or deleted bubbles */
.bubble:not(.sys):not(.deleted) { transition: transform var(--fade-ms) var(--ease); }
.bubble:not(.sys):not(.deleted):active { transform: scale(.98); }

/* reactions row at the bubble foot */
.rxn-row { display: inline-flex; gap: var(--s-1); margin-top: var(--s-1); }
.rxn {
  display: inline-block;
  font-size: var(--t-caption);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  padding: 0 var(--s-2);
}
.rxn.pop { animation: rxn-pop 300ms cubic-bezier(.2, .7, .3, 1.4) 1; }
@keyframes rxn-pop {
  0% { transform: scale(.4); }
  60% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

/* jump-to-starred highlight pulse */
.bubble.flash { animation: bubble-flash 900ms var(--ease) 1; }
@keyframes bubble-flash {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--sky) 0%, transparent); }
  35% { box-shadow: 0 0 0 6px var(--sky); }
}

/* call status chips (bubble + da'ee Calls sheet) */
.chip.st-pending { background: color-mix(in srgb, var(--gold) 18%, var(--surface)); color: var(--ink); }
.chip.st-confirmed { background: var(--tint); color: var(--brand-deep); }
.chip.st-declined { background: color-mix(in srgb, var(--danger) 12%, var(--surface)); color: var(--danger); }
.chip.st-done { background: var(--ground); color: var(--muted); }

/* destructive confirm (da'ee unpair sheet) */
.btn.danger { background: var(--danger); }

/* ---------- PAIR sheet placeholder ---------- */
.qr-box {
  background: var(--surface);
  border: 1px solid var(--sky); /* the da'ee's own pairing code — own-content accent */
  border-radius: var(--r-md);
  padding: var(--s-5);
  display: grid;
  place-items: center;
  gap: var(--s-3);
  margin-bottom: var(--s-4);
  box-shadow: 0 0 0 var(--s-1) color-mix(in srgb, var(--sky) 35%, var(--surface));
}
.pair-code {
  font-size: var(--t-title);
  font-weight: 800;
  letter-spacing: .12em;
  background: var(--grad-brand);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- onboarding ---------- */
.onb {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: var(--ground);
  display: flex;
  flex-direction: column;
  padding: calc(var(--safe-top) + var(--s-4)) var(--gutter) calc(var(--safe-bottom) + var(--s-4));
}
.onb-top { display: flex; align-items: center; gap: var(--s-3); margin-bottom: var(--s-5); }
.onb-top .t-caption { flex: none; }
.progress { flex: 1; height: 6px; border-radius: var(--r-pill); background: var(--line); overflow: hidden; }
.progress i {
  display: block;
  height: 100%;
  border-radius: var(--r-pill);
  background: var(--grad-brand); /* the learner's own progress */
  box-shadow: 0 0 6px var(--sky);
  transition: width var(--push-ms) var(--ease);
}
.onb-scroll { flex: 1; overflow-y: auto; }
.onb .options { display: flex; flex-direction: column; gap: var(--s-3); margin-top: var(--s-5); }
.opt {
  display: block;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: var(--s-4);
}
.opt:active, .opt.on { border-color: var(--brand); background: var(--tint); }
.opt strong { display: block; font-size: var(--t-body); line-height: var(--lh-body); font-weight: 800; }
.opt span { font-size: var(--t-sub); line-height: var(--lh-sub); color: var(--muted); }
.onb-footer { display: flex; gap: var(--s-3); padding-top: var(--s-4); }
.onb-footer .spacer { flex: 1; }

/* profile photo picker — onboarding step 1 and the Your profile page */
.photo-picker { display: flex; align-items: center; gap: var(--s-4); margin-bottom: var(--s-5); }
.photo-picker .preview {
  width: 72px; height: 72px; flex: none;
  border-radius: var(--r-pill);
  background: var(--tint);
  border: 1px dashed var(--line);
  display: grid; place-items: center;
  overflow: hidden;
  font-size: var(--t-title);
}
.photo-picker .preview img { width: 100%; height: 100%; object-fit: cover; }
/* preset avatar picker — onboarding step 1 */
.avatar-pick { display: flex; gap: var(--s-2); flex-wrap: wrap; margin: calc(-1 * var(--s-2)) 0 var(--s-5); }
.avatar-pick .av {
  width: 48px; height: 48px; flex: none;
  padding: 0;
  border-radius: var(--r-pill);
  border: 2px solid transparent;
  background: none;
  overflow: hidden;
}
.avatar-pick .av img { width: 100%; height: 100%; display: block; border-radius: var(--r-pill); }
.avatar-pick .av.on { border-color: var(--brand); box-shadow: 0 0 0 2px var(--sky); }

/* gender chips — onboarding step 1 */
.gender-pick { display: flex; gap: var(--s-2); }
.gender-pick .chip {
  min-height: 44px;
  padding: 0 var(--s-4);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
}
.gender-pick .chip.on {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

/* blank / anonymized avatar (no picture chosen, or Privacy Mode) */
.avatar-blank {
  background: var(--tint);
  color: var(--muted);
  border: 1px dashed var(--line);
  display: inline-grid;
  place-items: center;
}

/* welcome tutorial — the guide walks the new learner through the app */
.onb-tut { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.onb-tut-top { display: flex; justify-content: flex-end; margin-bottom: var(--s-3); }
.tut-body { display: flex; flex-direction: column; justify-content: center; gap: var(--s-4); }
/* the tutorial guide reuses the .hc-guide animation system at 1.5x size
   (breathe idle, talk while typing, peek entrance, cheer, Maryam dots) */
.onb-tut .hc-guide { width: 96px; height: 134px; margin: 0 auto; }
.onb-tut .hc-guide.ahmad .mimg { width: 123px; max-width: none; margin-left: -14px; }
.onb-tut .hc-guide.maryam .mimg { width: 120px; max-width: none; margin-left: -12px; }
.tut-bubble {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: var(--s-4) var(--s-5);
  box-shadow: var(--e-raised);
}
.tut-who {
  display: block;
  font-size: var(--t-caption);
  line-height: var(--lh-caption);
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: var(--s-1);
}
.tut-bubble p { font-size: var(--t-body); line-height: var(--lh-body); }
.tut-feature {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  background: var(--tint);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: var(--s-3) var(--s-4);
}
.tut-feature .avatar { color: var(--brand); background: var(--surface); }
.tut-feature strong { display: block; font-size: var(--t-body); font-weight: 800; }
.tut-feature span { font-size: var(--t-sub); color: var(--muted); }
.tut-dots { display: flex; justify-content: center; gap: var(--s-2); }
.tut-dots i {
  width: 7px; height: 7px;
  border-radius: var(--r-pill);
  background: var(--line);
  transition: background var(--fade-ms), transform var(--fade-ms);
}
.tut-dots i.on { background: var(--brand); transform: scale(1.25); }

/* terms consent row on signup */
.tos-row {
  display: flex;
  align-items: flex-start;
  gap: var(--s-3);
  margin: var(--s-2) 0 var(--s-4);
  font-size: var(--t-sub);
  line-height: var(--lh-sub);
  color: var(--muted);
}
.tos-row input { width: 20px; height: 20px; flex: none; margin-top: 1px; accent-color: var(--brand); }
.tos-row a { color: var(--brand); font-weight: 700; text-decoration: none; }

/* ---------- mentor match cards ---------- */
.match-card { display: flex; flex-direction: column; gap: var(--s-3); }
.match-head { display: flex; align-items: center; gap: var(--s-3); }
.match-head .who { flex: 1; min-width: 0; }
.match-head .who strong { display: block; font-size: var(--t-heading); line-height: var(--lh-heading); }
.match-head .who span { font-size: var(--t-sub); color: var(--muted); }
.match-score {
  flex: none;
  font-size: var(--t-heading);
  font-weight: 800;
  color: var(--brand-deep);
  background: var(--tint);
  border-radius: var(--r-pill);
  padding: var(--s-1) var(--s-3);
}
.match-card .reasons { display: flex; flex-wrap: wrap; gap: var(--s-2); }

/* tappable region inside a match card — opens the full mentor profile */
.match-tap {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
  border-radius: var(--r-sm);
}
.match-cue {
  display: inline-flex;
  align-items: center;
  gap: var(--s-1);
  font-size: var(--t-sub);
  font-weight: 700;
  color: var(--brand);
}
.match-tap:active .match-cue { color: var(--brand-deep); }

/* ---------- mentor profile ---------- */
.mp-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s-2);
  text-align: center;
}
.mp-hero .t-title { margin-top: var(--s-1); }
.mp-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--s-2); }
.mp-tags { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.mp-facts { display: flex; flex-direction: column; gap: var(--s-3); }
.mp-fact { display: flex; align-items: flex-start; gap: var(--s-3); }
.mp-fact > .ic { color: var(--brand); margin-top: var(--s-1); }
.mp-fact-txt { min-width: 0; }
.mp-fact-label { display: block; font-size: var(--t-caption); color: var(--muted); }
.mp-fact-txt strong { display: block; font-size: var(--t-sub); line-height: var(--lh-sub); }

/* ---------- community: lounge & stories ----------
   Ported from community update/community.html and mapped to tokens. Both
   roles share these styles (js/screens/community.js). The sample's pulsing
   dot is named .live-pulse here — .live-dot already exists in components.css
   with a different meaning. */

/* segmented control — Lounge | Stories with a sliding thumb */
.segment {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: var(--s-1) 0 var(--s-3);
  background: var(--tint);
  border-radius: var(--r-pill);
  padding: var(--s-1);
}
.segment .thumb {
  position: absolute;
  top: var(--s-1);
  bottom: var(--s-1);
  left: var(--s-1);
  width: calc(50% - var(--s-1));
  background: var(--surface);
  border-radius: var(--r-pill);
  box-shadow: var(--e-raised);
  transition: transform var(--push-ms) var(--ease);
}
.segment.stories .thumb { transform: translateX(100%); }
.segment button {
  position: relative;
  z-index: 1;
  border: 0;
  background: none;
  min-height: 44px;
  font-family: inherit;
  font-size: var(--t-sub);
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  border-radius: var(--r-pill);
}
.segment button.on { color: var(--brand-deep); }

.view { display: none; }
.view.on { display: block; }

.section-label .pin-ic { color: var(--gold); }

/* your circle — presence strip */
.circle-strip {
  display: flex;
  gap: var(--s-3);
  overflow-x: auto;
  padding: var(--s-1) 0 var(--s-2);
  scrollbar-width: none;
}
.circle-strip::-webkit-scrollbar { display: none; }
.person {
  flex: none;
  width: 64px;
  min-height: 44px;
  text-align: center;
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
  font-family: inherit;
  color: var(--ink);
}
.person .pav {
  position: relative;
  width: 52px;
  height: 52px;
  margin: 0 auto var(--s-1);
  border-radius: var(--r-pill);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: var(--t-heading);
  color: var(--surface);
  background: var(--grad-brand);
}
.person .pav img { width: 100%; height: 100%; object-fit: cover; border-radius: var(--r-pill); }
.person .pav.guide { background: var(--tint); }
.person .pav.guide img { object-fit: contain; }
.person .pav.live { box-shadow: 0 0 0 2.5px var(--surface), 0 0 0 5px var(--gold); }
.person .pav.live::after {
  content: "";
  position: absolute;
  inset: -5px;
  border-radius: var(--r-pill);
  border: 2px solid var(--gold);
  animation: ringPulse 2s ease-out infinite;
}
@keyframes ringPulse { 0% { transform: scale(.9); opacity: .9; } 100% { transform: scale(1.25); opacity: 0; } }
.person .pn,
.person .pr {
  font-size: var(--t-caption);
  line-height: var(--lh-caption);
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.person .pn { font-weight: 600; }
.person .pr { color: var(--muted); }
.person .pr.live { color: color-mix(in srgb, var(--gold) 60%, var(--ink)); font-weight: 700; }

/* room cards */
.room-card {
  display: block;
  width: 100%;
  margin: 0 0 var(--s-3);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 14px var(--s-4);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  font-size: var(--t-body);
  color: var(--ink);
  transition: transform 120ms var(--ease), box-shadow var(--fade-ms) var(--ease);
}
.room-card:active { transform: scale(.98); }
.room-card.pinned {
  border-color: var(--gold);
  background: linear-gradient(180deg, color-mix(in srgb, var(--glow) 10%, var(--surface)), var(--surface));
}
.room-card.sched { cursor: default; }
.rc-top { display: flex; align-items: flex-start; gap: 10px; }
.stack { display: flex; flex: none; padding-top: 2px; }
.stack .av {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: var(--r-pill);
  border: 2.5px solid var(--surface);
  margin-left: -10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--surface);
  font-weight: 800;
  font-size: var(--t-caption);
  overflow: hidden;
  background: var(--grad-brand);
}
.stack .av:first-child { margin-left: 0; }
.stack .av img { width: 100%; height: 100%; object-fit: cover; }
.stack .av.guide { background: var(--tint); }
.stack .av.guide img { object-fit: contain; }
.rc-main { flex: 1; min-width: 0; display: block; }
.rc-title { display: block; font-size: var(--t-body); line-height: var(--lh-body); font-weight: 700; margin-bottom: 2px; }
.rc-sub { display: block; font-size: var(--t-sub); line-height: var(--lh-sub); color: var(--muted); }
.rc-meta { display: flex; align-items: center; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.live-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--t-caption);
  font-weight: 800;
  letter-spacing: .06em;
  color: color-mix(in srgb, var(--gold) 60%, var(--ink));
}
.live-pulse { position: relative; width: 8px; height: 8px; border-radius: var(--r-pill); background: var(--gold); }
.live-pulse::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--r-pill);
  background: var(--glow);
  animation: livePulse 1.6s ease-out infinite;
}
@keyframes livePulse { 0% { transform: scale(1); opacity: .9; } 100% { transform: scale(2.6); opacity: 0; } }
.meta-txt { font-size: var(--t-caption); line-height: var(--lh-caption); color: var(--muted); font-weight: 600; }
.familiar {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: var(--s-2);
  padding: 6px 10px;
  background: var(--tint);
  border-radius: var(--r-pill);
  font-size: var(--t-caption);
  line-height: var(--lh-caption);
  font-weight: 600;
  color: var(--brand-deep);
  width: fit-content;
}
.familiar .fav {
  width: 18px;
  height: 18px;
  border-radius: var(--r-pill);
  overflow: hidden;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--surface);
  font-size: var(--t-caption);
  font-weight: 800;
  background: var(--grad-brand);
}
.familiar .fav img { width: 100%; height: 100%; object-fit: cover; }

/* scheduled cards */
.sched-card { display: flex; gap: var(--s-3); align-items: flex-start; }
.date-chip {
  flex: none;
  width: 52px;
  display: flex;
  flex-direction: column;
  text-align: center;
  background: var(--tint);
  border-radius: var(--r-sm);
  padding: var(--s-2) 0;
}
.date-chip .d { font-size: var(--t-heading); line-height: var(--lh-heading); font-weight: 800; color: var(--brand-deep); }
.date-chip .m { font-size: var(--t-caption); line-height: var(--lh-caption); font-weight: 700; color: var(--muted); text-transform: uppercase; }
.remind {
  margin-left: auto;
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1.5px solid var(--line);
  background: var(--surface);
  border-radius: var(--r-pill);
  padding: var(--s-2) var(--s-3);
  min-height: 44px;
  font-family: inherit;
  font-size: var(--t-caption);
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
  transition: transform 120ms var(--ease), border-color var(--fade-ms) var(--ease), background-color var(--fade-ms) var(--ease);
}
.remind.on {
  border-color: var(--gold);
  background: color-mix(in srgb, var(--gold) 14%, var(--surface));
  color: color-mix(in srgb, var(--gold) 60%, var(--ink));
}
.remind:active { transform: scale(.95); }

/* invite chips (start sheet + room invite sheet) */
.chiprow { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.inv-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  border: 1.5px solid var(--line);
  background: var(--surface);
  border-radius: var(--r-pill);
  padding: 6px var(--s-3) 6px 6px;
  min-height: 44px;
  cursor: pointer;
  font-family: inherit;
  font-size: var(--t-sub);
  font-weight: 600;
  color: var(--ink);
  transition: transform 120ms var(--ease), border-color var(--fade-ms) var(--ease), background-color var(--fade-ms) var(--ease);
}
.inv-chip .cav {
  width: 30px;
  height: 30px;
  border-radius: var(--r-pill);
  overflow: hidden;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--surface);
  font-size: var(--t-caption);
  font-weight: 800;
  background: var(--grad-brand);
}
.inv-chip .cav img { width: 100%; height: 100%; object-fit: cover; }
.inv-chip .cav.guide { background: var(--tint); }
.inv-chip .cav.guide img { object-fit: contain; }
.inv-chip .dim { color: var(--muted); }
.inv-chip.on { border-color: var(--brand); background: var(--tint); color: var(--brand-deep); }
.inv-chip:active { transform: scale(.95); }

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  padding: 10px 0;
  font-size: var(--t-sub);
  font-weight: 600;
}
.sheet-note { font-size: var(--t-caption); line-height: var(--lh-caption); color: var(--muted); margin-top: 10px; text-align: center; }

/* pushed live-room screen — footer pins above the dock, only the body
   scrolls (same layout contract as .screen.chat in components.css) */
.screen.liveroom { display: flex; flex-direction: column; overflow: hidden; }
.screen.liveroom .screen-body { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 0; }
.room-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: var(--s-1) var(--gutter) var(--s-4);
}
.leave-btn {
  flex: none;
  border: 0;
  border-radius: var(--r-pill);
  background: color-mix(in srgb, var(--gold) 14%, var(--surface));
  color: color-mix(in srgb, var(--gold) 60%, var(--ink));
  font-family: inherit;
  font-size: var(--t-sub);
  font-weight: 800;
  padding: 10px var(--s-4);
  min-height: 44px;
  cursor: pointer;
}
.spk-label {
  font-size: var(--t-caption);
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: var(--s-3) 0 10px;
}
.speakers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px 10px; }
.spk { position: relative; text-align: center; }
.spk .sav {
  position: relative;
  width: 76px;
  height: 76px;
  margin: 0 auto 6px;
  border-radius: var(--r-pill);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--surface);
  font-weight: 800;
  font-size: 24px;
  background: var(--grad-brand);
}
.spk .sav img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: var(--r-pill); }
.spk .sav.guide { background: var(--tint); }
.spk .sav.guide img { object-fit: contain; }
.spk.speaking .sav::after {
  content: "";
  position: absolute;
  inset: -5px;
  border-radius: var(--r-pill);
  border: 2.5px solid var(--brand);
  animation: ringPulse 1.8s ease-out infinite;
}
.spk .sn,
.spk .sr {
  font-size: var(--t-caption);
  line-height: var(--lh-caption);
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.spk .sn { font-weight: 700; }
.spk .sr { color: var(--muted); }
.host-tag {
  position: absolute;
  top: -4px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1;
  background: var(--grad-gold);
  color: var(--ink);
  font-size: var(--t-caption);
  font-weight: 800;
  padding: 2px var(--s-2);
  border-radius: var(--r-pill);
  white-space: nowrap;
}
.mic {
  position: absolute;
  bottom: -2px;
  right: 2px;
  z-index: 1;
  width: 24px;
  height: 24px;
  border-radius: var(--r-pill);
  background: var(--surface);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--t-caption);
}
.listeners { display: grid; grid-template-columns: repeat(auto-fill, minmax(56px, 1fr)); gap: var(--s-3) var(--s-2); }
.lis { text-align: center; }
.lis .lav {
  position: relative;
  width: 52px;
  height: 52px;
  margin: 0 auto var(--s-1);
  border-radius: var(--r-pill);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--surface);
  font-weight: 800;
  font-size: var(--t-body);
  background: var(--grad-brand);
  overflow: hidden;
}
.lis .lav img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.lis .ln {
  font-size: var(--t-caption);
  line-height: var(--lh-caption);
  color: var(--muted);
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.room-foot {
  display: flex;
  align-items: center;
  justify-content: space-around;
  gap: 6px;
  padding: 10px var(--s-3);
  background: var(--surface);
  border-top: 1px solid var(--line);
  margin-bottom: calc(var(--dock-h) + var(--safe-bottom));
}
.rf-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  border: 0;
  background: none;
  cursor: pointer;
  min-width: 56px;
  min-height: 44px;
  font-family: inherit;
  color: var(--ink);
  font-size: var(--t-caption);
  font-weight: 700;
}
.rf-btn .ric {
  width: 44px;
  height: 44px;
  border-radius: var(--r-pill);
  background: var(--tint);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: transform 120ms var(--ease), background-color var(--fade-ms) var(--ease);
}
.rf-btn:active .ric { transform: scale(.88); }
.rf-btn.on .ric { background: var(--grad-gold); }
.rf-btn.muted .ric { background: var(--line); color: var(--muted); }
.float-heart {
  position: absolute;
  bottom: calc(var(--dock-h) + var(--safe-bottom) + 96px);
  z-index: 5;
  font-size: 22px;
  pointer-events: none;
  animation: floatUp 1.4s ease-out forwards;
}
@keyframes floatUp {
  0% { opacity: 0; transform: translateY(0) scale(.6); }
  15% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-140px) scale(1.15) rotate(8deg); }
}
.hand-toast {
  margin: var(--s-2) 0 0;
  background: var(--tint);
  color: var(--brand-deep);
  font-size: var(--t-sub);
  font-weight: 600;
  border-radius: var(--r-md);
  padding: 10px 14px;
  animation: viewIn .25s ease-out;
}

/* lounge moderation: role tags, mute badges, hand flags, mod panel */
.mod-tag {
  position: absolute;
  top: -4px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1;
  background: var(--tint);
  color: var(--brand-deep);
  font-size: var(--t-caption);
  font-weight: 800;
  padding: 2px var(--s-2);
  border-radius: var(--r-pill);
  white-space: nowrap;
}
.mic.off { color: var(--muted); background: var(--line); }
.spk.is-muted .sav { opacity: .85; }
.lis { position: relative; }
.hand-flag {
  position: absolute;
  top: -4px;
  left: calc(50% + 12px);
  z-index: 1;
  width: 22px;
  height: 22px;
  border-radius: var(--r-pill);
  background: var(--grad-gold);
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: handPop .25s var(--ease);
}
@keyframes handPop {
  from { transform: scale(.4); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.rf-btn .ric { position: relative; }
.rf-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: var(--r-pill);
  background: var(--brand);
  color: var(--surface);
  font-size: 11px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pp-head {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  margin-bottom: var(--s-3);
}
.row .avatar.ps-ic { background: var(--tint); color: var(--brand-deep); }
.row.danger .row-title { color: var(--danger); }
.mp-row { cursor: default; }
.mp-acts { display: flex; align-items: center; gap: var(--s-1); flex-shrink: 0; }

/* stories */
.compose-teaser {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin: 0 0 var(--s-3);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  padding: var(--s-2) var(--s-4) var(--s-2) var(--s-2);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  color: var(--ink);
  transition: transform 120ms var(--ease);
}
.compose-teaser:active { transform: scale(.98); }
.compose-teaser .ct-av {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: var(--r-pill);
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--surface);
  font-weight: 800;
  font-size: var(--t-caption);
  background: var(--grad-brand);
  overflow: hidden;
}
.compose-teaser .ct-av img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.compose-teaser > span:last-child { color: var(--muted); font-size: var(--t-sub); font-weight: 600; }
.story-card {
  margin: 0 0 var(--s-3);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 14px var(--s-4);
  animation: viewIn .25s ease-out;
}
.story-card.fresh { border-color: var(--gold); }
@keyframes viewIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.sc-head { display: flex; align-items: center; gap: 10px; margin-bottom: var(--s-2); }
.sc-av {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: var(--r-pill);
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--surface);
  font-weight: 800;
  font-size: var(--t-sub);
  overflow: hidden;
  background: var(--grad-brand);
}
.sc-av img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.sc-who { display: flex; flex-direction: column; min-width: 0; }
.sc-name { font-size: var(--t-sub); line-height: var(--lh-sub); font-weight: 700; }
.sc-time { font-size: var(--t-caption); line-height: var(--lh-caption); color: var(--muted); }
.sc-title { font-size: var(--t-body); line-height: var(--lh-body); font-weight: 800; margin-bottom: 2px; }
.sc-body { font-size: var(--t-body); line-height: var(--lh-body); margin-bottom: 10px; }
.sc-actions { display: flex; gap: 6px; border-top: 1px solid var(--line); padding-top: var(--s-2); }
.act {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  background: none;
  cursor: pointer;
  min-height: 44px;
  padding: 6px var(--s-3);
  border-radius: var(--r-pill);
  font-family: inherit;
  font-size: var(--t-sub);
  font-weight: 700;
  color: var(--muted);
  transition: transform 120ms var(--ease), background-color var(--fade-ms) var(--ease), color var(--fade-ms) var(--ease);
}
.act:active { transform: scale(.93); }
.act.liked { color: var(--brand-deep); background: var(--tint); }
.act .aic { display: inline-block; }
.act.liked .aic { animation: likePop .35s cubic-bezier(.3, 1.6, .4, 1); }
@keyframes likePop { 40% { transform: scale(1.45); } }
.comments { margin-top: var(--s-2); border-top: 1px dashed var(--line); padding-top: 10px; }
.comment { display: flex; gap: var(--s-2); margin-bottom: var(--s-2); animation: viewIn .2s ease-out; }
.comment .cav2 {
  position: relative;
  width: 28px;
  height: 28px;
  border-radius: var(--r-pill);
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--surface);
  font-weight: 800;
  font-size: var(--t-caption);
  background: var(--grad-brand);
  overflow: hidden;
}
.comment .cav2 img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.comment .cb { flex: 1; display: block; background: var(--ground); border-radius: var(--r-md); padding: var(--s-2) var(--s-3); }
.comment .cn { display: block; font-size: var(--t-caption); font-weight: 700; }
.comment .ct { display: block; font-size: var(--t-sub); line-height: var(--lh-sub); }
.comment-row { display: flex; gap: var(--s-2); margin-top: var(--s-1); }
.comment-row input {
  flex: 1;
  min-width: 0;
  border: 1.5px solid var(--line);
  border-radius: var(--r-pill);
  padding: 10px 14px;
  font-family: inherit;
  font-size: var(--t-sub);
  min-height: 44px;
  background: var(--surface);
  color: var(--ink);
}
.comment-row button {
  border: 0;
  background: var(--tint);
  color: var(--brand-deep);
  font-family: inherit;
  font-weight: 800;
  border-radius: var(--r-pill);
  padding: 0 var(--s-4);
  min-height: 44px;
  cursor: pointer;
}

/* ---------- da'ee workspace ---------- */
.profile-head {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-3) 0 var(--s-2);
}
.profile-head .who { flex: 1; min-width: 0; }
.profile-head .who h1 { font-size: var(--t-title); line-height: var(--lh-title); font-weight: 800; letter-spacing: -0.01em; }
.profile-head .who p { font-size: var(--t-sub); color: var(--muted); }
/* the identity (photo + name) is a button on the da'ee home — opens the
   workspace menu */
.profile-ident {
  display: flex; align-items: center; gap: var(--s-3);
  flex: 1; min-width: 0;
  background: none; border: 0; padding: 0;
  text-align: left; font-family: inherit; color: inherit; cursor: pointer;
}
.profile-ident:active { opacity: .7; }
.profile-ident .who { flex: 1; min-width: 0; }
.profile-chips { display: flex; flex-wrap: wrap; gap: var(--s-2); margin: var(--s-2) 0 var(--s-4); }

.stat { border: 2px solid transparent; position: relative; }
button.stat:active { transform: scale(.97); border-color: var(--brand); }
.stat.on { border-color: var(--brand); }
/* the active tile carries --grad-brand as an accent bar — keeps the numeral
   at full --brand-deep contrast instead of lower-contrast gradient text */
.stat.on::before {
  content: "";
  position: absolute;
  top: var(--s-2);
  left: 50%;
  transform: translateX(-50%);
  width: var(--s-6);
  height: var(--s-1);
  border-radius: var(--r-pill);
  background: var(--grad-brand);
}

/* display:block — daee.js renders .prog on <span>s; inline spans ignore height and collapse to 0×0 */
.prog { display: block; height: 8px; border-radius: var(--r-pill); background: var(--line); overflow: hidden; }
.prog i { display: block; height: 100%; border-radius: var(--r-pill); background: var(--grad-brand); transition: width var(--push-ms) var(--ease); }
.prog.gold i { background: var(--grad-gold); }

details.acc {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  margin-bottom: var(--s-3);
  overflow: hidden;
}
details.acc summary {
  list-style: none;
  cursor: pointer;
  min-height: 56px;
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-3) var(--s-4);
  font-weight: 700;
}
details.acc summary::-webkit-details-marker { display: none; }
details.acc summary:active { background: var(--tint); }
details.acc summary::after { content: "▾"; color: var(--muted); margin-left: auto; }
details.acc[open] summary::after { content: "▴"; }
details.acc .acc-body { padding: 0 var(--s-4) var(--s-4); font-size: var(--t-sub); line-height: var(--lh-sub); color: var(--muted); }

.bulk-bar {
  position: fixed;
  left: var(--gutter); right: var(--gutter);
  bottom: calc(var(--dock-h) + var(--safe-bottom) + var(--s-3));
  z-index: 25;
  display: flex;
  align-items: center;
  gap: var(--s-1);
  background: var(--ink);
  color: var(--surface);
  border-radius: var(--r-pill);
  /* tight chrome so all three actions + count fit a 320px phone */
  padding: var(--s-2) var(--s-2) var(--s-2) var(--s-3);
  box-shadow: var(--e-raised);
}
.bulk-bar span { flex: 1; min-width: 0; font-size: var(--t-sub); font-weight: 700; }
.bulk-bar button {
  min-height: 44px;
  padding: 0 var(--s-2);
  border-radius: var(--r-pill);
  font-size: var(--t-caption);
  font-weight: 800;
  color: var(--surface);
  background: rgba(255, 255, 255, .16);
  transition: transform 120ms var(--ease);
}
.bulk-bar button:active { transform: scale(.97); }

.checkbox {
  width: 24px; height: 24px;
  min-width: 24px; min-height: 24px;
  flex: none;
  border: 2px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  display: grid;
  place-items: center;
  color: var(--surface);
  font-size: var(--t-caption);
  font-weight: 800;
  transition: background-color var(--fade-ms) var(--ease), border-color var(--fade-ms) var(--ease);
}
.checkbox.on { background: var(--grad-brand); border-color: var(--brand); }

.tag-strip {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  border: 1px dashed var(--lumen);
  border-radius: var(--r-md);
  padding: var(--s-3) var(--s-4);
  margin-bottom: var(--s-4);
}
.tag-strip code { flex: 1; font-weight: 800; letter-spacing: .08em; color: var(--brand-deep); background: none; }

/* ---------- da'ee vibrancy moments (Phase 2) ---------- */
/* Uses the shared primitives from components.css: .pulse-gold (completion,
   450ms), .chip-glow (300ms), .check-draw (300ms), .celebrate-burst (800ms).
   Only da'ee-specific shells live here. */

/* the da'ee's own avatar on their Home header — sky marks their own content */
.profile-head.own .avatar {
  border-radius: var(--r-pill);
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 var(--s-1) var(--sky);
}

/* own-bubble sky accent and the gold question-edge preservation live in the
   learner vibrancy block below (the chat screen is shared.js territory — one
   set of rules covers both roles); the send animation itself is the shared
   .bubble.sent primitive in components.css. */

/* celebration shell — centers the shared .celebrate-burst glow as a one-time
   full-screen moment (pairing success, course completion); daee.js inserts
   and removes it, and skips it entirely under reduced motion */
.d-celebrate {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  pointer-events: none;
}
.d-celebrate .celebrate-burst {
  position: relative;
  width: 56px;
  height: 56px;
  border-radius: var(--r-pill);
}

/* ---------- academy surface (Phase 4) ---------- */
/* Full-height frame that stops at the dock: one scroll context (the course's
   own), nothing clips under shell chrome, course dock floats above ours. */
.screen.academy {
  inset: 0 0 calc(var(--dock-h) + var(--safe-bottom)) 0;
  padding: 0;
  overflow: hidden;
  background: #F4FAFF; /* FORMAL EXEMPTION (QA, Phase 4): deliberate raw hex — must match the
     course iframe's own internal canvas color exactly so the embed seam is invisible.
     Not part of the app ramp; do not tokenize. */
}
.screen.academy iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.screen.academy .academy-loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: var(--t-sub);
  font-weight: 600;
}

/* ---------- auth (mock signup / sign-in) ---------- */
.auth-head { display: flex; align-items: center; gap: var(--s-2); margin-bottom: var(--s-4); }
.auth-head img { width: 40px; height: 40px; border-radius: var(--r-sm); }
.auth-head .spacer { flex: 1; }
.auth-role-tiles { display: flex; flex-direction: column; gap: var(--s-3); margin-bottom: var(--s-5); }
.auth-role-tiles .opt { display: flex; align-items: center; gap: var(--s-3); }
/* The Learner tile is the primary path — Sabeely's core focus. Its emphasis
   must NOT reuse the selected-state look (brand border + tint = .opt.on), or
   it reads as selected while another tile is chosen: a soft outline + flag
   only, with the brand-filled avatar reserved for the actually selected tile. */
.auth-role-tiles .opt.primary { border-color: var(--sky); }
.auth-role-tiles .opt .opt-flag {
  display: block;
  font-size: var(--t-caption);
  line-height: var(--lh-caption);
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--brand);
  margin-bottom: 2px;
}
.auth-role-tiles .opt.on .avatar { background: var(--brand); color: #fff; }
/* mobile-compact tiles: unselected roles collapse to a single line */
.auth-role-tiles { display: grid; gap: var(--s-2); margin-bottom: var(--s-3); }
.auth-role-tiles .opt.compact { padding: var(--s-3) var(--s-4); }
.auth-role-tiles .opt.compact .avatar { width: 36px; height: 36px; }
/* missed-consent nudge */
.tos-row.flash { animation: tos-flash 900ms var(--ease); border-radius: var(--r-sm); }
@keyframes tos-flash {
  0%, 100% { background: transparent; box-shadow: none; }
  25% { background: var(--tint); box-shadow: 0 0 0 2px var(--brand); }
  60% { background: var(--tint); box-shadow: 0 0 0 2px var(--brand); }
}
@media (prefers-reduced-motion: reduce) { .tos-row.flash { animation: none; background: var(--tint); } }
.auth-role-tiles .opt .avatar { flex: none; }
.auth-role-tiles .opt .opt-main { flex: 1; }
.auth-role-tiles .opt .tick {
  flex: none;
  width: 26px; height: 26px;
  border-radius: var(--r-pill);
  border: 2px solid var(--line);
  display: grid;
  place-items: center;
  color: var(--surface);
  font-size: var(--t-caption);
  font-weight: 800;
}
.auth-role-tiles .opt.on .tick { background: var(--brand); border-color: var(--brand); }
.sso-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-3);
  width: 100%;
  min-height: 48px;
  border: 1.5px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--surface);
  font-size: var(--t-body);
  font-weight: 700;
  color: var(--ink);
  margin-bottom: var(--s-3);
}
.sso-btn:active { background: var(--tint); }
.sso-btn svg { width: 20px; height: 20px; flex: none; }
.auth-div {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  color: var(--muted);
  font-size: var(--t-caption);
  font-weight: 700;
  margin: var(--s-4) 0;
}
.auth-div::before, .auth-div::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* ---------- learner QR scan (mock camera) ---------- */
.qr-scan {
  position: relative;
  height: 220px;
  border-radius: var(--r-md);
  background: linear-gradient(160deg, var(--brand-deep), var(--ink)); /* tokenized mock-camera canvas */
  display: grid;
  place-items: center;
  margin-bottom: var(--s-4);
  overflow: hidden;
}
.qr-scan .c {
  position: absolute;
  width: 26px; height: 26px;
  border: 3px solid var(--glow);
}
.qr-scan .c.tl { top: 14px; left: 14px; border-right: 0; border-bottom: 0; border-top-left-radius: var(--r-sm); }
.qr-scan .c.tr { top: 14px; right: 14px; border-left: 0; border-bottom: 0; border-top-right-radius: var(--r-sm); }
.qr-scan .c.bl { bottom: 14px; left: 14px; border-right: 0; border-top: 0; border-bottom-left-radius: var(--r-sm); }
.qr-scan .c.br { bottom: 14px; right: 14px; border-left: 0; border-top: 0; border-bottom-right-radius: var(--r-sm); }

/* ---------- learner vibrancy pass (Phase 2) ----------
   Motion-table items owned by the learner agent. Keyframes are prefixed lm-*
   so they cannot collide with the shared primitives the components agent is
   adding to components.css; if canonical shared versions land, these can be
   swapped class-for-class in QA. All animations are one-shot entrances under
   the 500ms cap (celebrations ≤800ms) and inherit the global
   prefers-reduced-motion kill-switch from base.css. */

/* press feedback — scale 0.97, 120ms ease-out (learner-owned controls) */
.opt {
  transition: transform 120ms var(--ease), background-color 120ms var(--ease), border-color 120ms var(--ease);
}
.opt:active { transform: scale(.97); }

/* the learner's own selection, ringed in --sky */
.opt.on { box-shadow: 0 0 0 2px var(--sky); }

/* step completion — gold radial pulse + check draw, once, ≤450ms */
@keyframes lm-gold-pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--glow) 70%, transparent); }
  100% { box-shadow: 0 0 0 14px transparent; }
}
@keyframes lm-check-draw {
  to { stroke-dashoffset: 0; }
}

/* message send — bubble slide + fade, 200ms, lives in components.css as the
   precise .bubble.sent contract (shared.js tags only the freshly appended own
   bubble). An earlier .msgs .bubble:last-child rule here re-animated history
   on every innerHTML re-render and fought .sent for the same node — removed
   in QA reconciliation. */
/* own message accents in --sky */
.bubble.me { box-shadow: 0 0 0 2px var(--sky); }
/* keep the gold question marker on the learner's own questions (the
   question → FAQ funnel) — sky ring outside, gold inset inside */
.bubble.me.question { box-shadow: 0 0 0 2px var(--sky), inset 3px 0 0 var(--gold); }

/* pairing success celebration — the full-screen confetti overlay variant of
   .celebrate-burst (halo + particles) now lives in components.css, keyed off
   body > .celebrate-burst so it matches the exact markup learner.js emits.
   learner.js skips inserting .celebrate-burst entirely under reduced motion,
   so no static fallback is needed. */

/* ---------- learn portal & fatihah recitation course ---------- */
.learn-card {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  width: 100%;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: var(--s-4);
  margin-bottom: var(--s-3);
  cursor: pointer;
  font-family: inherit;
  color: var(--ink);
  font-size: var(--t-body);
  transition: transform 120ms var(--ease);
}
.learn-card:active { transform: scale(.985); }
.learn-card .lc-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--r-sm);
  background: var(--grad-brand);
  color: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.learn-card.gold .lc-icon { background: var(--grad-gold); color: var(--ink); }
.learn-card .lc-main { flex: 1; min-width: 0; }
.learn-card .lc-title { display: block; font-weight: 800; }
.learn-card .lc-sub {
  display: block;
  font-size: var(--t-sub);
  line-height: var(--lh-sub);
  color: var(--muted);
  margin-top: 2px;
}
.learn-card .lc-bar {
  display: block;
  height: 6px;
  border-radius: var(--r-pill);
  background: var(--tint);
  overflow: hidden;
  margin-top: var(--s-2);
}
.learn-card .lc-bar i { display: block; height: 100%; background: var(--grad-brand); border-radius: var(--r-pill); }
.learn-card.gold .lc-bar i { background: var(--grad-gold); }
.learn-card.dimmed { opacity: .55; }

/* pushed academy screen (New Muslim Journey opened from the Learn portal):
   the router header stays visible above the frame */
.screen.academy.pushed { display: flex; flex-direction: column; }
.screen.academy.pushed .screen-header {
  position: relative;
  z-index: 2;
  background: #F4FAFF; /* formal exemption: matches the course canvas (see .screen.academy) */
}
.screen.academy.pushed iframe { position: static; inset: auto; flex: 1; min-height: 0; width: 100%; }

/* Fatihah course guide — reuses the Home .hc-* guide wholesale; this
   modifier only compacts it (the course card already carries a lot).
   Whole pixels only — fractional widths rasterize the persona art blurry. */
.fat-guidebar { padding: 0 0 var(--s-2); }
.fat-guidebar .hc-guide { width: 52px; height: 72px; }
.fat-guidebar .hc-guide.ahmad .mimg { width: 67px; margin-left: -7px; }
.fat-guidebar .hc-guide.maryam .mimg { width: 65px; margin-left: -7px; }
.fat-guidebar .hc-txt { min-height: 40px; }
.fat-guidebar [data-fg-guide] { cursor: pointer; }

/* fatihah course steps */
.fat-dots { display: flex; align-items: center; gap: 6px; margin-bottom: var(--s-3); }
.fat-dots i { flex: 1; height: 4px; border-radius: var(--r-pill); background: var(--sky); }
.fat-dots i.on { background: var(--brand); }
.fat-step { display: flex; flex-direction: column; min-height: 60vh; }
.fat-foot { display: flex; gap: var(--s-2); margin-top: auto; padding-top: var(--s-4); }
.fat-arabic {
  font-family: var(--font-quran);
  font-size: 34px; /* formal exemption: Quran display size — the one off-token
                      size, matching the academy's own display scale */
  line-height: 1.9;
  direction: rtl;
  text-align: center;
  color: var(--ink);
}
.fat-arabic.sm { font-size: 26px; /* same exemption, reference-list size */ }
.fat-arabic span { transition: color 150ms var(--ease); }
.fat-arabic span.lit { color: var(--brand); }
.fat-translit {
  font-style: italic;
  text-align: center;
  color: var(--brand-deep);
  margin-top: var(--s-2);
}
.fat-en { text-align: center; color: var(--muted); font-size: var(--t-sub); line-height: var(--lh-sub); margin-top: var(--s-2); }
.fat-medal {
  width: 88px;
  height: 88px;
  margin: 0 auto var(--s-3);
  border-radius: var(--r-pill);
  background: var(--grad-gold);
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* recorder */
.rec-btn {
  width: 72px;
  height: 72px;
  margin: 0 auto;
  border: 0;
  border-radius: var(--r-pill);
  background: var(--grad-brand);
  color: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 120ms var(--ease);
}
.rec-btn:active { transform: scale(.92); }
.rec-btn.live { background: var(--danger); position: relative; }
.rec-btn.live::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: var(--r-pill);
  border: 2.5px solid var(--danger);
  animation: rec-pulse 1.4s ease-out infinite;
}
@keyframes rec-pulse {
  0% { opacity: .9; transform: scale(.94); }
  100% { opacity: 0; transform: scale(1.18); }
}
.rec-time { text-align: center; font-weight: 800; color: var(--danger); margin-top: var(--s-2); }
.rec-acts { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-top: var(--s-2); }
.rec-acts .btn { min-height: 40px; padding: 0 var(--s-3); font-size: var(--t-sub); }

/* mini player: play/pause + scrub (recording bubbles & send preview) */
.rp { display: flex; align-items: center; gap: var(--s-2); width: 100%; margin-top: var(--s-2); }
.rp-btn {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border: 0;
  border-radius: var(--r-pill);
  background: var(--brand);
  color: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 120ms var(--ease);
}
.rp-btn:active { transform: scale(.9); }
.rp-bar { flex: 1; display: flex; align-items: center; min-height: 44px; cursor: pointer; }
.rp-track {
  flex: 1;
  height: 6px;
  border-radius: var(--r-pill);
  background: var(--sky);
  overflow: hidden;
  pointer-events: none;
}
.rp-fill { display: block; height: 100%; width: 0; background: var(--brand); border-radius: var(--r-pill); }
.rp-time {
  flex-shrink: 0;
  font-size: var(--t-caption);
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* fatihah surfaces elsewhere */
.banner.fatihah-prompt {
  background: color-mix(in srgb, var(--gold) 12%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--gold) 40%, transparent);
}
.bubble.call.recording .chip.st-rec-passed { background: var(--grad-gold); color: var(--ink); }

/* ---------- compliance course ---------- */
.comp-mod.locked { opacity: .55; }
.comp-mod.done .avatar { background: var(--tint); color: var(--success); }
.comp-mod.current { box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--gold) 55%, transparent); }
.comp-verbs { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.comp-verb {
  background: var(--tint);
  color: var(--brand-deep);
  border-radius: var(--r-pill);
  padding: 4px var(--s-3);
  font-size: var(--t-caption);
}
.comp-verb strong { color: var(--brand); }
.comp-nearmiss { border-left: 4px solid var(--gold); }
.comp-ul {
  margin: 0;
  padding-left: var(--s-4);
  display: grid;
  gap: var(--s-2);
  font-size: var(--t-sub);
  line-height: var(--lh-sub);
}
.qz-opt {
  display: block;
  width: 100%;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: var(--s-3) var(--s-4);
  margin-bottom: var(--s-2);
  font-family: inherit;
  font-size: var(--t-sub);
  line-height: var(--lh-sub);
  color: var(--ink);
  cursor: pointer;
  transition: transform 120ms var(--ease), border-color 120ms var(--ease);
}
.qz-opt:active { transform: scale(.99); }
.qz-opt.right { border-color: var(--success); background: color-mix(in srgb, var(--success) 10%, var(--surface)); }
.qz-opt.wrong { border-color: var(--danger); background: color-mix(in srgb, var(--danger) 8%, var(--surface)); }
.qz-pm {
  background: var(--tint);
  border-radius: var(--r-md);
  padding: var(--s-3) var(--s-4);
  font-size: var(--t-sub);
  line-height: var(--lh-sub);
  color: var(--brand-deep);
  margin-top: var(--s-2);
}
.comp-ack {
  display: flex;
  gap: var(--s-2);
  align-items: flex-start;
  font-size: var(--t-sub);
  line-height: var(--lh-sub);
  margin-top: var(--s-3);
  cursor: pointer;
}
.comp-ack input { margin-top: 3px; accent-color: var(--brand); }
.sig-canvas {
  width: 100%;
  height: 150px;
  border: 2px dashed var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  touch-action: none; /* pointer drawing must not be hijacked by scroll */
  display: block;
}
.comp-upload {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-2) 0;
  cursor: pointer;
}
.comp-upload .cu-thumb {
  width: 48px;
  height: 48px;
  border-radius: var(--r-sm);
  background: var(--tint);
  color: var(--brand-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}
.comp-upload .cu-thumb img { width: 100%; height: 100%; object-fit: cover; }
.comp-excl { margin-bottom: var(--s-4); }
.comp-excl summary { cursor: pointer; color: var(--muted); }

/* ---------- reduced motion mirror block (QA, Phase 4) ----------
   The universal kill-switch in base.css (* { transition:none; animation:none })
   has zero specificity, so it LOSES to every rule below that declares its own
   transition or animation. These mirrors repeat each animated selector at equal
   specificity in the last-loaded stylesheet, where they win. One-shot effects
   get explicit static end-states; the JS guards in learner.js/daee.js skip the
   celebration overlays entirely. */
@media (prefers-reduced-motion: reduce) {
  .topbar, .icon-btn, .tab-pane, .screen, .screen::after, .screen.root::before,
  .dock-item, .dock-item .ico, .dock-item .ico svg, .dock-item span,
  .dock-fab .fab, .row, .seg button, .btn, .btn.secondary, .chip,
  .sheet-wrap .scrim, .sheet, .toast, .fab-float, .switch, .switch span,
  .stat, .progress i, .opt, .prog i,
  .checkbox, .bulk-bar button, .bubble .ticks,
  .bubble:not(.sys):not(.deleted),
  .hc-region, .hc-mood, .hc-cta, .hc-streak, .hc-change,
  .course-mini, .cm-go, .cm-bar i,
  .segment .thumb, .room-card, .remind, .inv-chip, .rf-btn .ric,
  .learn-card, .rec-btn, .rp-btn, .qz-opt, .fat-arabic span,
  .compose-teaser, .act {
    transition: none;
  }
  .typing span, .skeleton, .pulse-gold::after, .check-draw, .chip-glow,
  .celebrate-burst::before, body > .celebrate-burst .halo,
  body > .celebrate-burst .p, .bubble.sent,
  .onb-loading .stage.done .dot, .onb-loading .stage.done .dot path,
  .hc-guide:not(.cheer):not(.think):not(.talk):not(.celebrate):not(.peek) .mimg,
  .hc-guide.talk .mimg, .hc-guide.cheer .mimg, .hc-guide.think .mimg,
  .hc-guide.peek .mimg, .hc-guide.celebrate .mimg,
  .hc-spark, .hc-caret, .hc-streak.pulse, .hc-cta.reveal,
  .course-mini.fresh .cm-icon,
  .person .pav.live::after, .live-pulse::after, .spk.speaking .sav::after,
  .float-heart, .hand-toast, .hand-flag, .story-card, .comment, .act.liked .aic,
  .rxn.pop, .bubble.flash,
  .landing .l-rise, .landing img.l-rise,
  .intro-splash, .intro-splash .ip path, .intro-splash .tipglow, .intro-splash .veil,
  .banner.urgent, .row.urgent, .rec-btn.live::after {
    animation: none;
  }
  /* static end-states for one-shot effects */
  .check-draw { stroke-dashoffset: 0; }
  .pulse-gold::after, .celebrate-burst::before { opacity: 0; }
  .bubble.sent { opacity: 1; transform: none; }
  .landing .l-rise { opacity: 1; transform: none; }
  .intro-splash { display: none; }
}
