/* ============================================================
   Hebrew Today — Lesson SPA skin overlay
   Loads AFTER lesson.css. Re-skins the page chrome (header,
   buttons, sidebar, auth modal, content header, chat balloons,
   flashcard display) to match the kid-friendly design system
   without touching activity-specific UI (vocab cards, free
   speech mic, letter writing canvas, etc).
   ============================================================ */

/* ---------- Foundation ---------- */

body {
  font-family: var(--body);
  font-weight: 600;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

body, .lesson-container, .main-content, .content-header,
.chat-container, .chat-input-area, .sections-sidebar {
  font-family: var(--body);
}

/* Kill italics globally inside lesson chrome — they read as adult/literary
   in this kids-game context. Body weight does the emphasis instead.
   Excludes FA <i class="fa-..."> icons via :not. */
.flashcard-transliteration,
.vocab-transliteration,
.intro-content em,
em {
  font-style: normal !important;
}
i:not([class*="fa-"]) { font-style: normal !important; }

/* Hebrew text uses production-parity Arial stack via --hebrew. */
.flashcard-hebrew,
.vocab-hebrew,
.vocab-hebrew-large,
.intro-hebrew,
.hebrew-word,
[class*="-hebrew"] {
  font-family: var(--hebrew) !important;
  font-style: normal !important;
}

/* ---------- Header (legacy .header) ---------- */

.header {
  background: rgba(255, 245, 230, 0.92) !important;
  color: var(--ink) !important;
  border-bottom: 1px solid var(--hair) !important;
  box-shadow: none !important;
  backdrop-filter: blur(6px);
  padding: 0.75rem 1rem !important;
  z-index: 4;
}
@media (min-width: 768px) {
  .header { padding: 0.95rem 2.25rem !important; }
}
@media (min-width: 1024px) {
  .header { padding: 1rem 3rem !important; }
}

.header-logo img {
  height: 32px;
}
@media (min-width: 768px) { .header-logo img { height: 38px; } }

.header h1 {
  font-family: var(--display);
  font-weight: 800;
  letter-spacing: -0.015em;
  color: var(--ink);
  font-size: 1rem;
  text-align: center;
  justify-self: center;
}
@media (min-width: 768px) {
  .header h1 { font-size: 1.4rem; }
}

/* Logo + wordmark spacing inside the legacy .header */
.header .header-logo.brand { gap: 0.7rem; align-items: center; display: inline-flex; text-decoration: none; color: inherit; flex-shrink: 0; }
.header .header-logo img { height: 32px; }
@media (min-width: 768px) {
  .header .header-logo img { height: 38px; }
}
.header .brand-wordmark-name { color: var(--ink); }
.header .brand-wordmark-tag  { color: var(--coral); }

.header-actions { gap: 0.5rem !important; }
@media (min-width: 768px) { .header-actions { gap: 0.6rem !important; } }

/* All header pills — chunky, friendly */
.header .btn {
  background: var(--bg-soft);
  color: var(--ink);
  border: 2px solid var(--hair-strong);
  border-radius: 999px;
  padding: 0.45rem 0.9rem;
  font-family: var(--display);
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: -0.005em;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
  white-space: nowrap;
}
.header .btn:hover {
  background: #fff;
  border-color: var(--ink);
  transform: translateY(-1px);
}

.header #mobile-sections-toggle {
  background: var(--coral);
  color: #fff;
  border-color: var(--coral-shade);
  box-shadow: 0 3px 0 var(--ink);
  font-weight: 800;
}
.header #mobile-sections-toggle:hover { box-shadow: 0 4px 0 var(--ink); }
.header #mobile-sections-toggle:active { box-shadow: 0 1px 0 var(--ink); transform: translateY(2px); }

.header .btn-signup {
  background: var(--coral) !important;
  color: #fff !important;
  border: 2px solid var(--coral-shade) !important;
  box-shadow: 0 3px 0 var(--ink);
  font-weight: 800;
}
.header .btn-signup:hover { box-shadow: 0 4px 0 var(--ink); transform: translateY(-1px); }
.header .btn-signup:active { box-shadow: 0 1px 0 var(--ink); transform: translateY(2px); }

.header .btn-admin {
  background: var(--gold) !important;
  color: var(--ink) !important;
  border: 2px solid var(--gold-shade) !important;
  box-shadow: 0 3px 0 var(--gold-shade);
  font-weight: 800;
}
.header .btn-admin:hover { box-shadow: 0 4px 0 var(--gold-shade); transform: translateY(-1px); }
.header .btn-admin:active { box-shadow: 0 1px 0 var(--gold-shade); transform: translateY(2px); }

/* Compatibility shim for existing .btn-primary inside lesson.ejs */
.btn-primary {
  background: var(--coral) !important;
  color: #fff !important;
  border: 2px solid var(--coral-shade) !important;
  box-shadow: 0 3px 0 var(--ink);
  font-family: var(--display);
  font-weight: 800;
}
.btn-primary:hover { box-shadow: 0 4px 0 var(--ink); transform: translateY(-1px); }
.btn-primary:active { box-shadow: 0 1px 0 var(--ink); transform: translateY(2px); }

/* ---------- Sections sidebar ---------- */

.sections-sidebar {
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: 0 24px 24px 0;
  box-shadow: 6px 0 0 var(--ink);
}
@media (min-width: 768px) {
  .sections-sidebar {
    border-right-width: 3px;
    border-radius: 0;
    border: none;
    border-right: 3px solid var(--ink);
    box-shadow: 4px 0 0 rgba(43, 34, 71, 0.06);
  }
}

.lesson-info { border-bottom: 2px dashed var(--hair-strong); }
.lesson-info h2 {
  font-family: var(--display);
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.sections-title {
  font-family: var(--display);
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.01em;
  border-bottom: 2px dashed var(--hair-strong);
}

/* The vocab flashcard preview at the top of the sidebar */
.flashcard-display {
  background: linear-gradient(135deg, var(--teal) 0%, var(--teal-shade) 100%) !important;
  border: 3px solid var(--ink);
  border-radius: 18px;
  box-shadow: 0 4px 0 var(--ink);
  position: relative;
  overflow: hidden;
}
.flashcard-display::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    -45deg,
    rgba(255,255,255,0.06) 0 8px,
    transparent 8px 18px
  );
  pointer-events: none;
}
.flashcard-hebrew {
  font-family: var(--hebrew) !important;
  font-weight: 900;
  color: #fff;
  position: relative;
  z-index: 1;
}
.flashcard-transliteration {
  color: rgba(255,255,255,0.95) !important;
  font-family: var(--display);
  font-weight: 700;
  font-style: normal !important;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 0.85rem;
  position: relative;
  z-index: 1;
}
.flashcard-translation {
  font-family: var(--display);
  font-weight: 800;
  color: #fff;
  position: relative;
  z-index: 1;
}

/* Section list items — like miniature lesson-cards */
.section-item {
  background: #fff;
  border: 2px solid var(--hair-strong);
  border-radius: 14px;
  font-family: var(--body);
  font-weight: 700;
  color: var(--ink);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  box-shadow: 0 3px 0 var(--hair-strong);
}
.section-item:hover {
  background: var(--bg-soft);
  transform: translateY(-1px);
  box-shadow: 0 4px 0 var(--hair-strong);
}

.section-item.active {
  background: var(--coral) !important;
  color: #fff !important;
  border-color: var(--coral-shade) !important;
  box-shadow: 0 4px 0 var(--ink) !important;
}
.section-item.active:hover { transform: translateY(-1px); box-shadow: 0 5px 0 var(--ink) !important; }

.section-item.completed {
  background: rgba(78, 199, 127, 0.10) !important;
  border-color: var(--done) !important;
  box-shadow: 0 3px 0 var(--done-shade) !important;
}
.section-item.completed .section-icon { color: var(--done-shade) !important; }

.section-item.active.completed {
  background: var(--done) !important;
  border-color: var(--done-shade) !important;
  box-shadow: 0 4px 0 var(--done-shade) !important;
  color: #fff !important;
}

.section-item.disabled {
  background: rgba(214, 208, 224, 0.20) !important;
  border-color: var(--locked-shade) !important;
  box-shadow: 0 3px 0 var(--locked-shade) !important;
  opacity: 0.85;
}
.section-item.disabled .section-icon,
.section-item.disabled .section-title { color: var(--locked-fg) !important; }

.section-title { font-family: var(--display); font-weight: 700; }

/* ---------- Content header ---------- */

.content-header { border-bottom: 2px dashed var(--hair-strong); }
.content-header h2 {
  font-family: var(--display);
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.015em;
}
.content-header p {
  font-family: var(--body);
  color: var(--ink-soft);
  font-weight: 600;
}

/* ---------- Chat (lesson activity) area ---------- */

.chat-messages { background: transparent; }
@media (min-width: 768px) {
  .chat-messages { background: rgba(255, 245, 230, 0.45); border-radius: 14px; }
}

.message-avatar {
  border: 2px solid var(--ink);
  box-shadow: 0 2px 0 var(--ink);
  font-family: var(--display);
  font-weight: 800;
}
.message.user .message-avatar { background: var(--coral) !important; }
.message.assistant .message-avatar { background: var(--teal) !important; }

.message-content {
  font-family: var(--body);
  font-weight: 600;
  border-radius: 18px;
  border: 2px solid var(--hair-strong);
  box-shadow: 0 3px 0 var(--hair-strong);
}
.message.user .message-content {
  background: var(--coral) !important;
  color: #fff !important;
  border-color: var(--coral-shade) !important;
  box-shadow: 0 3px 0 var(--ink) !important;
}
.message.assistant .message-content {
  background: #fff !important;
  color: var(--ink) !important;
  border-color: var(--hair-strong) !important;
  box-shadow: 0 3px 0 var(--hair-strong) !important;
}

#message-input {
  border: 2px solid var(--hair-strong);
  border-radius: 14px;
  background: #fff;
  font-family: var(--body);
  font-weight: 600;
  color: var(--ink);
}
#message-input:focus {
  border-color: var(--coral) !important;
  box-shadow: 0 0 0 3px rgba(255, 124, 90, 0.18);
  outline: none;
}

#send-button {
  background: var(--coral) !important;
  color: #fff !important;
  border: 2px solid var(--coral-shade) !important;
  border-radius: 999px !important;
  font-family: var(--display);
  font-weight: 800;
  box-shadow: 0 4px 0 var(--ink);
}
#send-button:hover { background: var(--coral) !important; transform: translateY(-1px); box-shadow: 0 5px 0 var(--ink); }
#send-button:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
#send-button:disabled {
  background: var(--locked) !important;
  color: var(--locked-fg) !important;
  border-color: var(--locked-shade) !important;
  box-shadow: 0 3px 0 var(--locked-shade) !important;
}

.section-complete-btn {
  background: var(--done) !important;
  color: #fff !important;
  border: 2px solid var(--done-shade) !important;
  border-radius: 999px !important;
  font-family: var(--display);
  font-weight: 800;
  box-shadow: 0 4px 0 var(--done-shade);
  letter-spacing: 0.02em;
}
.section-complete-btn:hover { background: var(--done) !important; transform: translateY(-1px); box-shadow: 0 5px 0 var(--done-shade); }
.section-complete-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--done-shade); }

/* Auth modal styles moved to /static/css/auth-modal.css (loaded by the shared
   page-head partial) so every page that includes the modal gets them. */

/* ---------- Mobile overlay backdrop ---------- */

.mobile-overlay-backdrop {
  background: rgba(43, 34, 71, 0.5) !important;
  backdrop-filter: blur(2px);
}

/* ---------- Activity-specific gradient swaps (light touch) ----------
   The lesson activities use legacy purple/blue gradients. Replace the
   most jarring ones with palette colors. Activity layout untouched. */

/* Vocab "primary" buttons → coral chunky */
.vocab-btn-primary {
  background: var(--coral) !important;
  color: #fff !important;
  border: 2px solid var(--coral-shade) !important;
  border-radius: 999px !important;
  font-family: var(--display) !important;
  font-weight: 800 !important;
  box-shadow: 0 4px 0 var(--ink) !important;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.vocab-btn-primary:hover { transform: translateY(-1px); box-shadow: 0 5px 0 var(--ink) !important; }
.vocab-btn-primary:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink) !important; }
.vocab-btn-primary:disabled {
  background: var(--locked) !important;
  color: var(--locked-fg) !important;
  border-color: var(--locked-shade) !important;
  box-shadow: 0 3px 0 var(--locked-shade) !important;
}

/* Generic .btn family inside lesson body should NOT keep the
   translucent-on-teal recipe — re-establish a chunky ink-bordered look
   except where overridden above. */
.lesson-container .btn,
.main-content .btn {
  background: #fff;
  color: var(--ink);
  border: 2px solid var(--ink);
  border-radius: 999px;
  box-shadow: 0 3px 0 var(--ink);
  font-family: var(--display);
  font-weight: 700;
}
.lesson-container .btn:hover,
.main-content .btn:hover {
  background: var(--bg-soft);
  transform: translateY(-1px);
  box-shadow: 0 4px 0 var(--ink);
}

/* Ink-coloured focus rings everywhere */
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

/* Reduced-motion safety net (theme.css already applies it, but
   re-state here in case theme.css fails to load on a degraded path). */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

/* ============================================================
   FA ICON DEFAULTS — shared color/spacing inside lesson chrome
   ============================================================ */
.fa-solid, .fa-regular, .fa-light, .fa-thin,
[class*="fa-solid"], [class*="fa-regular"] {
  vertical-align: -0.08em;
}
.btn .fa-solid + span,
.vocab-btn .fa-solid + span,
.next-step-btn .fa-solid + span,
.back-btn .fa-solid + span { margin-left: 0.4em; }

/* ============================================================
   PLAY BUTTONS — chunky 3D, kid-intuitive
   Triggers on .play-btn (lesson.css owns the original styling).
   The lesson JS swaps button textContent between '▶' and '⏸';
   we keep those characters but render them BIG and white inside
   a chunky tactile knob.
   ============================================================ */

.play-btn {
  /* Override lesson.css's gold-gradient soft-shadow */
  background: var(--coral) !important;
  border: 3px solid var(--ink) !important;
  border-radius: 50% !important;
  box-shadow: 0 5px 0 var(--ink) !important;
  color: #fff !important;
  font-family: var(--display) !important;
  font-weight: 800 !important;
  font-size: 1.2rem !important;
  padding: 0 !important;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.18s ease !important;
  animation: invitePulse 3.2s ease-in-out infinite !important;
  width: 56px !important;
  height: 56px !important;
  line-height: 1 !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  text-indent: 2px; /* center the off-balanced ▶ glyph optically */
  touch-action: manipulation;
  cursor: pointer;
}

@media (min-width: 768px) {
  .play-btn {
    width: 64px !important;
    height: 64px !important;
    font-size: 1.4rem !important;
    box-shadow: 0 6px 0 var(--ink) !important;
  }
}

.play-btn:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 7px 0 var(--ink) !important;
  background: var(--coral) !important;
}
@media (min-width: 768px) {
  .play-btn:hover { box-shadow: 0 8px 0 var(--ink) !important; }
}

.play-btn:active {
  transform: translateY(4px) !important;
  box-shadow: 0 1px 0 var(--ink) !important;
}

.play-btn:focus-visible {
  outline: 4px solid var(--gold) !important;
  outline-offset: 3px;
}

/* Subtle "press me" animation — gentle scale, only on the prominent
   non-inline play buttons. Honored by reduced-motion below. */
@keyframes invitePulse {
  0%, 100% { transform: translateY(0) scale(1); }
  50%      { transform: translateY(-1px) scale(1.04); }
}

/* PLAYING STATE — switch to teal, halt the invite-pulse, add an
   outward sound-ring pulse so it's obvious which button is firing. */
.play-btn.playing {
  background: var(--teal) !important;
  box-shadow: 0 5px 0 var(--teal-shade) !important;
  animation: none !important;
  position: relative;
  text-indent: 0; /* ⏸ is symmetric, no nudge needed */
}
@media (min-width: 768px) {
  .play-btn.playing { box-shadow: 0 6px 0 var(--teal-shade) !important; }
}
.play-btn.playing::after {
  content: "";
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 3px solid var(--teal);
  opacity: 0;
  animation: soundRing 1.4s ease-out infinite;
  pointer-events: none;
}
@keyframes soundRing {
  0%   { transform: scale(0.8); opacity: 0.7; }
  100% { transform: scale(1.6); opacity: 0; }
}

.play-btn.loading {
  background: var(--locked) !important;
  color: var(--locked-fg) !important;
  border-color: var(--locked-shade) !important;
  box-shadow: 0 4px 0 var(--locked-shade) !important;
  animation: none !important;
  cursor: wait;
  pointer-events: none;
}

/* INLINE PLAY BUTTONS — small, sit next to text, less assertive. */
.inline-play-btn {
  width: 36px !important;
  height: 36px !important;
  font-size: 0.85rem !important;
  margin-left: 6px !important;
  vertical-align: middle !important;
  background: var(--coral) !important;
  border: 2px solid var(--ink) !important;
  box-shadow: 0 3px 0 var(--ink) !important;
  animation: none !important; /* don't pulse all of them — too busy */
  text-indent: 1px;
}
.inline-play-btn:hover {
  box-shadow: 0 4px 0 var(--ink) !important;
  transform: translateY(-1px) !important;
}
.inline-play-btn:active {
  box-shadow: 0 1px 0 var(--ink) !important;
  transform: translateY(2px) !important;
}

.inline-play-btn.small {
  width: 28px !important;
  height: 28px !important;
  font-size: 0.7rem !important;
  margin-left: 4px !important;
  border-width: 2px !important;
  box-shadow: 0 2px 0 var(--ink) !important;
}
.inline-play-btn.small:hover { box-shadow: 0 3px 0 var(--ink) !important; }
.inline-play-btn.small:active { box-shadow: 0 0 0 var(--ink) !important; transform: translateY(1px) !important; }

.inline-play-btn.playing {
  background: var(--teal) !important;
  box-shadow: 0 3px 0 var(--teal-shade) !important;
}
.inline-play-btn.playing::after { display: none; } /* skip the sound-ring on small inlines */

/* The yogi-play-btn / audio-play-btn variants share the .play-btn class
   so they inherit everything above. The original pulse-glow keyframe in
   lesson.css now no-ops because we override the shadow with !important. */
.yogi-play-btn,
.audio-play-btn { animation: invitePulse 3.2s ease-in-out infinite !important; }
.audio-play-btn.playing,
.yogi-play-btn.playing { animation: none !important; }

@media (prefers-reduced-motion: reduce) {
  .play-btn,
  .yogi-play-btn,
  .audio-play-btn { animation: none !important; }
  .play-btn.playing::after { animation: none !important; }
}

/* ============================================================
   BACK BUTTON — between sections
   ============================================================ */

.back-btn {
  background: #fff !important;
  color: var(--ink) !important;
  border: 2px solid var(--ink) !important;
  border-radius: 999px !important;
  font-family: var(--display) !important;
  font-weight: 800 !important;
  font-size: 0.9rem !important;
  letter-spacing: 0.005em !important;
  padding: 0.55rem 1.1rem !important;
  box-shadow: 0 4px 0 var(--ink) !important;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.18s ease !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.5rem !important;
  margin-bottom: 1rem !important;
  cursor: pointer;
  touch-action: manipulation;
}
.back-btn:hover {
  background: var(--bg-soft) !important;
  transform: translateX(-2px) !important;
  box-shadow: 0 5px 0 var(--ink) !important;
}
.back-btn:active {
  transform: translateY(2px) !important;
  box-shadow: 0 1px 0 var(--ink) !important;
}
.back-btn:focus-visible {
  outline: 4px solid var(--gold) !important;
  outline-offset: 3px;
}

/* ============================================================
   NEXT-STEP BUTTON — coral chunky, kid-friendly
   The .vocab-btn-success.next-step-btn pattern.
   ============================================================ */

.next-step-btn,
.vocab-btn-success {
  background: var(--coral) !important;
  color: #fff !important;
  border: 3px solid var(--ink) !important;
  border-radius: 28px !important; /* less circular so longer copy reads naturally */
  font-family: var(--display) !important;
  font-weight: 800 !important;
  font-size: 1rem !important;
  letter-spacing: 0.005em !important;
  padding: 0.85rem 1.5rem !important;
  box-shadow: 0 5px 0 var(--ink) !important;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.18s ease !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.6rem !important;
  cursor: pointer;
  touch-action: manipulation;
  margin: 0.8rem 0.3rem !important;
  /* Make the button accommodate any label length without overflow:
     allow text to wrap inside, give a sensible min/max width range,
     and let the button height grow with multi-line copy. */
  white-space: normal !important;
  text-align: center !important;
  line-height: 1.25 !important;
  min-width: 8rem;
  max-width: 100%;
  width: auto;
  height: auto;
  word-break: break-word;
  hyphens: auto;
}
@media (min-width: 480px) {
  .next-step-btn,
  .vocab-btn-success { font-size: 1.05rem !important; padding: 0.95rem 1.75rem !important; }
}
.next-step-btn:hover,
.vocab-btn-success:hover {
  background: var(--coral) !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 7px 0 var(--ink) !important;
}
.next-step-btn:active,
.vocab-btn-success:active {
  transform: translateY(4px) !important;
  box-shadow: 0 1px 0 var(--ink) !important;
}
.next-step-btn:focus-visible,
.vocab-btn-success:focus-visible {
  outline: 4px solid var(--gold) !important;
  outline-offset: 3px;
}

.next-step-btn .fa-solid,
.vocab-btn-success .fa-solid {
  font-size: 0.85em;
  /* gentle nudge so the arrow visually centers with the body text */
  position: relative;
  top: -1px;
}

/* The "Next" arrow lives at the END — drift right on hover for delight */
.next-step-btn:hover .fa-arrow-right,
.vocab-btn-success:hover .fa-arrow-right { transform: translateX(2px); transition: transform 0.18s ease; }

/* Mark Section Complete is a sibling success-style button */
.section-complete-btn {
  letter-spacing: 0.02em !important;
}


/* ============================================================
   PHASE C — intrinsic-height tightening (fewer pages needed)
   Override inherent fixed font-sizes/heights with clamp() so most
   activities fit one viewport without pagination kicking in.
   ============================================================ */

.vocab-hebrew-large {
  font-size: clamp(2.75rem, 11vh, 6rem) !important;
  margin: clamp(0.5rem, 2vh, 1.5rem) 0 !important;
  line-height: 1.05 !important;
}

.vocab-hebrew {
  font-size: clamp(2rem, 7vh, 3rem) !important;
  margin: clamp(0.5rem, 1.5vh, 1rem) 0 !important;
}

.vocab-glyph-image {
  max-height: clamp(120px, 22vh, 220px) !important;
  margin-bottom: clamp(0.5rem, 1.5vh, 1rem) !important;
}

.letter-display {
  font-size: clamp(4rem, 14vh, 8rem) !important;
  line-height: 1 !important;
}

.write-canvas-area {
  height: clamp(160px, 32vh, 280px) !important;
}

.wordsearch-cell {
  width: clamp(28px, min(8vw, 6vh), 44px) !important;
  height: clamp(28px, min(8vw, 6vh), 44px) !important;
  font-size: clamp(0.95rem, 3.5vh, 1.3rem) !important;
}

.quiz-option-btn {
  font-size: clamp(1.6rem, 5.5vh, 2.5rem) !important;
}

/* When the viewport is tight (short laptops, landscape phones), shave
   step padding so activity content has more room before scrolling. */
@media (max-height: 720px) {
  .vocab-step { padding: 0.35rem !important; }
  .vocab-flashcard-large { padding: 0.6rem !important; margin-bottom: 0.5rem !important; }

  /* Find-word activity — keep targets + grid visible at smaller heights */
  .wordsearch-cell {
    width: clamp(24px, min(7vw, 4.5vh), 32px) !important;
    height: clamp(24px, min(7vw, 4.5vh), 32px) !important;
    font-size: clamp(0.85rem, 2.6vh, 1.05rem) !important;
  }
  .wordsearch-targets {
    padding: 0.45rem 0.55rem !important;
    margin-bottom: 0.5rem !important;
    gap: 0.4rem !important;
  }
  .wordsearch-target {
    font-size: 1.05rem !important;
    padding: 0.2rem 0.5rem !important;
  }
}

/* ---------- Find-the-Letter cumulative targets row ----------
   Shown between the instructions and the grid on lessons where the
   student has been taught more than one letter or vowel. Each chip
   is a chunky kid-friendly token — Hebrew character front and center,
   the newest item gets the gold treatment so the lesson's hero stays
   visible even though the activity is now cumulative review.
   ------------------------------------------------------------ */

.letter-targets-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.55rem;
  /* Extra top margin so the floating "new" badge (which sits above the chip)
     never gets clipped by upstream layout. Bottom margin unchanged. */
  margin: 1.4rem auto 1.1rem;
  max-width: 30rem;
}

.letter-targets-row.hidden { display: none; }

.letter-target-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.6rem;
  height: 2.6rem;
  padding: 0 0.55rem;
  background: var(--bg-soft);
  border: 2px solid var(--ink);
  border-radius: 14px;
  box-shadow: 0 3px 0 var(--ink);
  font-family: var(--hebrew, "Arial Hebrew", "Arial", sans-serif);
  font-weight: 700;
  color: var(--ink);
  line-height: 1;
  transition: transform 0.12s ease;
}

.letter-target-chip:hover {
  transform: translateY(-1px);
}

.letter-target-chip .letter-target-char {
  font-size: 1.5rem;
  display: inline-block;
  /* Vowel marks are tiny on their own — give them a faint baseline so the
     diacritic doesn't float at the top of the chip. */
}

.letter-target-chip.is-vowel .letter-target-char {
  /* The vowel is paired with a Unicode dotted-circle placeholder (◌ U+25CC)
     in the markup, so the glyph already has visual mass — no padding hack
     needed. Slight size bump keeps the diacritic readable against the chunky
     border. */
  font-size: 1.45rem;
  line-height: 1;
}

/* Newest item — the lesson's hero — gets the gold medallion treatment. */
.letter-target-chip.is-new {
  background: var(--gold);
  border-color: var(--ink);
  box-shadow: 0 4px 0 var(--ink);
  transform: translateY(-2px);
}

.letter-target-chip .letter-target-new {
  /* Sit centered ABOVE the chip — never overlapping the character area, so
     letters with high diacritics (cholam dot, shin dot, qubbutz) stay fully
     visible. A small whitespace gap separates it from the chip border. */
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--coral);
  color: #fff;
  font-family: var(--display);
  font-weight: 800;
  font-size: 0.6rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.18rem 0.5rem;
  border: 2px solid var(--ink);
  border-radius: 999px;
  box-shadow: 0 2px 0 var(--ink);
  white-space: nowrap;
  pointer-events: none;
}

@media (max-width: 480px) {
  .letter-targets-row { gap: 0.4rem; max-width: 22rem; margin-top: 1.25rem; }
  .letter-target-chip { min-width: 2.2rem; height: 2.2rem; padding: 0 0.4rem; }
  .letter-target-chip .letter-target-char { font-size: 1.3rem; }
  .letter-target-chip.is-vowel .letter-target-char { font-size: 1.25rem; }
  .letter-target-chip .letter-target-new {
    top: -12px;
    font-size: 0.55rem;
    padding: 0.14rem 0.4rem;
  }
}

