/* ===========================
   FONTS
   =========================== */
@font-face
{
  font-family: "AmiriQuran";
  src: url("/fonts/AmiriQuran-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  size-adjust: 95%;
}

@font-face
{
  font-family: "Cinzel";
  src: url("/fonts/Cinzel-VariableFont_wght.ttf") format("truetype");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

@font-face
{
  font-family: "Lateef";
  src: url("/fonts/Lateef-Light.ttf") format("truetype");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
  size-adjust: 130%;
}

@font-face
{
  font-family: "Lateef";
  src: url("/fonts/Lateef-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  size-adjust: 130%;
}

@font-face
{
  font-family: "Montserrat";
  src: url("/fonts/Montserrat-VariableFont_wght.ttf") format("truetype-variations");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face
{
  font-family: "FiraCode";
  src: url("/fonts/FiraCode-VariableFont_wght.ttf") format("truetype-variations");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face
{
  font-family: "Tajawal";
  src: url("/fonts/Tajawal-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face
{
  font-family: "Tajawal";
  src: url("/fonts/Tajawal-Regular.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face
{
  font-family: "Tajawal-Latin";
  src: url("/fonts/Tajawal-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  size-adjust: 111%;
}

@font-face
{
  font-family: "Tajawal-Latin";
  src: url("/fonts/Tajawal-Regular.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
  size-adjust: 111%;
}

.step-card-title,
.modal-title,
.hero-title
{
  letter-spacing: 0.06em;
}

/* ============================================================
   THEME TOKENS — Fresh Garden design language
   Source of truth: DESIGN-GUIDE.md (Vocabulary Harvest)
   ============================================================ */
:root,
html.theme-light
{
  /* ---- Color — Light mode (identity) ---- */
  --color-bg:          #f4f7f2;  /* warm off-white, green breath */
  --color-bg-card:     #fafcf8;  /* barely-tinted white (cards) */
  --color-bg-inset:    #eef3ea;  /* recessed / inset surfaces */
  --color-border:      #dce4d4;  /* soft green-grey hairline */
  --color-divider:     #dce4d4;
  --color-text:        #1a2e14;  /* deep green-black */
  --color-muted:       #5a7a4a;  /* sage green secondary */
  --color-faint:       #8aae7a;  /* captions */
  --color-structure:   #3d7a4a;  /* identity green */
  --color-action:      #3d7a4a;  /* primary button bg */
  --color-action-text: #ffffff;  /* text on primary buttons */
  --action-border: var(--action); /* primary button border (blends in light) */
  --color-text-on-structure: #a8c896;
  --color-accent:      #c49a20;  /* warm gold — sparse */
  --color-accent-bg:   #f5f0d8;
  --color-accent-text: #7a5800;
  --color-offline:     #6b5e3a;
  --color-offline-bg:  #f0ecd8;

  /* ---- Semantic aliases (app + guide) ---- */
  --bg: var(--color-bg);
  --bg2: var(--color-bg-inset);
  --bg-panel: var(--color-bg-inset);
  --card: var(--color-bg-card);
  --card-glow: transparent;
  --border: var(--color-border);
  --border-glow: var(--color-structure);
  --option-border: var(--color-border);
  --spine: var(--color-structure);
  --spine-glow: color-mix(in srgb, var(--color-structure) 28%, transparent);
  --bead: var(--color-structure);
  --bead-border: var(--color-structure);
  --bead-glow: color-mix(in srgb, var(--color-structure) 32%, transparent);
  --accent: var(--color-structure);
  --accent-rgb: 61, 122, 74;
  --accent2: var(--color-accent);
  --accent2-rgb: 196, 154, 32;
  --text: var(--color-text);
  --text-muted: var(--color-muted);
  --text-arabic: var(--color-text);
  --gold: var(--color-accent-bg);
  --gold2: var(--color-accent-bg);
  --shadow-card: none;          /* flat garden — no elevation */
  --shadow-card-hover: none;

  /* ---- Translucent "garden glass" — the stars, glow & fireflies
         peek through the UI. Resolved lazily, so light & dark both work. ---- */
  --glass-card:   color-mix(in srgb, var(--color-bg-card) 58%, transparent);
  --glass-strong: color-mix(in srgb, var(--color-bg-card) 78%, transparent); /* header / persistent chrome */
  --glass-inset:  color-mix(in srgb, var(--color-bg-inset) 52%, transparent);
  --glass-blur: 12px;
  --glass-sat: 1.15;

  /* Named greens / golds (guide) */
  --moss: var(--color-structure);
  --sprout: #b5d99c;
  --sun: #c49a20;
  --terracotta: #c4503a;
  --red: #c4503a;
  --fern: #8db87a;
  --green: var(--color-structure);
  --action: var(--color-structure);
  --action-text: var(--color-action-text);
  --outline-text: var(--color-structure);
  --muted: var(--color-muted);

  /* ---- Fonts ---- */
  --font-title:  'Cinzel', serif;
  --font-body:   'Montserrat', sans-serif;
  --font-button: 'Montserrat', sans-serif;
  --font-mono:   'Fira Code', monospace;
  --font-arabic: 'Tajawal', sans-serif;
  --font-latin:  var(--font-body);

  /* ---- Type scale ---- */
  --text-display: clamp(1.6rem, 4vw, 2.4rem);
  --text-heading: 1.25rem;
  --text-body:    1rem;
  --text-small:   0.875rem;
  --text-label:   0.65rem;
  --leading-tight:  1.2;
  --leading-body:   1.65;
  --leading-arabic: 1.9;

  /* ---- Shape & layout ---- */
  --radius-sm: 10px;
  --radius-md: 10px;
  --radius-lg: 10px;
  --radius-full: 99px;
  --bead-size: 2em;
  --page-gutter: 14px;
}

html.theme-dark
{
  /* ---- Color — Dark mode (deep forest) ---- */
  --color-bg:          #0f1a12;
  --color-bg-card:     #162418;
  --color-bg-inset:    #0c140e;
  --color-border:      #1a3018;
  --color-divider:     #1a3018;
  --color-text:        #e8f0e0;
  --color-muted:       #6aaa5a;
  --color-structure:   #5aad5a;
  --color-action:      #1f3a26;   /* dim lifted chip — lighter than page, not neon */
  --color-action-text: #eef4ea;   /* crisp near-white for clear contrast */
  --action-border: color-mix(in srgb, var(--color-structure) 45%, transparent);
  --action: var(--color-action);  /* primary surfaces use the dim chip, not bright structure */
  --color-text-on-structure: #a8c896;
  --color-accent:      #d4aa30;
  --color-accent-bg:   #1a1c0e;
  --color-accent-text: #e8c850;
  --color-offline:     #7a8a4a;
  --color-offline-bg:  #141c0e;

  /* ---- Overrides (aliases re-resolve via var() automatically) ---- */
  --accent-rgb: 90, 173, 90;
  --accent2-rgb: 212, 170, 48;
  --moss: #3d6a3d;
  --sprout: #4a8a4a;
  --sun: #d4aa30;
  --terracotta: #b86040;
  --red: #b86040;
  --fern: #4a8a4a;
  --green: #2a4d2e;
}

@media (min-width: 640px)
{
  :root
  {
    --page-gutter: 22px;
  }
}

/* If the browser can't blur a backdrop, only the blurred chrome (header /
   popovers) needs to fall back to a near-solid fill; the translucent cards
   don't rely on blur, so they stay translucent everywhere. */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px)))
{
  :root
  {
    --glass-strong: var(--color-bg-card);
  }
}

@media (min-width: 1024px)
{
  :root
  {
    --page-gutter: 34px;
  }
}

/* Disable selection on interactive UI elements */
.btn-modal,
.btn-practice,
.header-back-btn,
.header-close-btn,
.settings-gear,
.speaker-btn,
.step-card-header,
.step-card-type,
.step-card-title,
.ruling-badge,
.step-score,
.mini-bar-caption,
.hero-title,
.hero-subtitle,
.section-label,
.modal-title,
.score-heading,
.breakdown-label,
.weakest-callout,
.info-btn,
.settings-label,
.practice-header span
{
  -webkit-user-select: none;
  user-select: none;
}

/* Explicitly allow selection on content text */
.step-arabic,
.step-transliteration,
.step-meaning,
.step-arabic-source,
.modal-arabic,
.modal-prompt,
.drill-option,
.pool-tile,
.assemble-slot,
.about-body p,
.tutorial-body p,
.tutorial-body li
{
  -webkit-user-select: text;
  user-select: text;
}

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

html,
body
{
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: var(--leading-body);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  text-rendering: optimizeLegibility;
  -moz-osx-font-smoothing: grayscale;
}

/* Gentle garden glow behind the content (decorative, non-interactive) */
body
{
  background:
    radial-gradient(1100px 560px at 88% -6%, color-mix(in srgb, var(--color-structure) 7%, transparent), transparent 60%),
    radial-gradient(820px 480px at -8% 108%, color-mix(in srgb, var(--color-accent) 4%, transparent), transparent 55%),
    var(--bg);
}

/* ===========================
   SCROLLBAR (global)
   =========================== */
::-webkit-scrollbar
{
  width: 4px;
  height: 4px;
}

::-webkit-scrollbar-track
{
  background: transparent;
}

::-webkit-scrollbar-thumb
{
  background: var(--fern);
  border-radius: 2px;
}

::-webkit-scrollbar-thumb:hover
{
  background: var(--accent);
}

*
{
  scrollbar-width: thin;
  scrollbar-color: var(--fern) transparent;
}

/* ===========================
   APP SHELL — strict SPA layout
   =========================== */
#app
{
  display: flex;
  flex-direction: column;
  height: 100dvh;
  overflow: hidden;
  position: relative;
  z-index: 1;
}

.app-header
{
  flex-shrink: 0;
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
  border-bottom: 1px solid var(--border);
  padding: 12px 16px;
}

.app-header-inner
{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.app-header-title
{
  flex: 1;
  text-align: center;
  font-family: var(--font-body);
  font-size: min(0.9rem, 20px);
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--text);
  text-transform: uppercase;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Brand accent — the app name is Cinzel only on the home view */
.app-header-title.brand
{
  font-family: var(--font-title);
  letter-spacing: 0.08em;
}

.app-header-spacer
{
  width: 40px;
  flex-shrink: 0;
}

.app-main
{
  flex: 1 1 auto;
  min-height: 0;
  position: relative;
}

.app-footer
{
  flex-shrink: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  background: transparent;
  border-top: 1px solid var(--border);
  padding: 8px 20px calc(8px + env(safe-area-inset-bottom));
}

.app-nav-btn
{
  background: none;
  border: none;
  font-family: var(--font-mono);
  font-size: min(0.68rem, 14px);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  cursor: pointer;
  padding: 10px 0;
  transition: color 0.2s, opacity 0.15s;
}
.app-nav-btn:hover:not(:disabled) { color: var(--text); }
.app-nav-btn:active:not(:disabled) { opacity: 0.85; }
.app-nav-btn:disabled { opacity: 0.35; cursor: default; }
.app-nav-btn:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }

.app-gear
{
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: min(1rem, 20px);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s, color 0.2s, opacity 0.15s;
}
.app-gear:hover { border-color: var(--accent); color: var(--accent); }
.app-gear:active { opacity: 0.85; }

/* ===========================
   FONT SCALE SETTING (settings view)
   =========================== */
.font-scale-row
{
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
}

.font-scale-value
{
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text);
  min-width: 44px;
}

.font-scale-slider
{
  flex: 1;
  accent-color: var(--color-structure);
  cursor: pointer;
}

.font-scale-steppers
{
  display: flex;
  gap: 8px;
  margin: 4px 0 12px;
}

.font-scale-preview
{
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 14px;
  background: var(--glass-inset);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  text-align: center;
}

.preview-arabic
{
  font-family: var(--font-arabic);
  font-size: 1.8rem;
  color: var(--text-arabic);
  direction: rtl;
  line-height: var(--leading-arabic);
}

.preview-text
{
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ===========================
   PER-FONT BASELINE CORRECTIONS
   Amiri's huge declared ascent pushes Arabic ink down vs Tajawal; Tajawal's
   Latin glyphs sit high vs Montserrat. Values measured from the actual DOM
   rendering (line box + exact glyph metrics) — nudge each font's display text
   so its ink sits centered, matching the default.
   =========================== */
html.arabic-amiri .step-arabic,
html.arabic-amiri .study-anchor,
html.arabic-amiri .preview-arabic,
html.arabic-amiri .modal-arabic
{
  transform: translateY(-0.27em);
}

html.arabic-lateef .step-arabic,
html.arabic-lateef .study-anchor,
html.arabic-lateef .preview-arabic,
html.arabic-lateef .modal-arabic
{
  transform: translateY(0.1em);
}

html.arabic-tajawal .step-arabic,
html.arabic-tajawal .study-anchor,
html.arabic-tajawal .preview-arabic,
html.arabic-tajawal .modal-arabic
{
  transform: translateY(0.28em);
}

html.latin-tajawal p,
html.latin-tajawal .settings-row-title,
html.latin-tajawal .settings-row-desc,
html.latin-tajawal .settings-label,
html.latin-tajawal .preview-text,
html.latin-tajawal .app-header-title,
html.latin-tajawal .step-card-title,
html.latin-tajawal .activity-name,
html.latin-tajawal .study-meaning,
html.latin-tajawal .study-transliteration,
html.latin-tajawal .study-title-caption,
html.latin-tajawal .modal-title,
html.latin-tajawal .tutorial-section h3
{
  transform: translateY(0.18em);
}

/* ===========================
   STACK VIEW CONTAINER
   =========================== */
.stack-view
{
  position: absolute;
  inset: 0;
  overflow-y: auto;
  background: transparent;      /* body provides the garden texture */
  -webkit-overflow-scrolling: touch;
  width: 100%;
  max-width: 36rem;
  margin: 0 auto;
}

.stack-view-inner
{
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

/* ===========================
   SHARED BUTTONS & FEEDBACK
   =========================== */
.btn-modal
{
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-family: var(--font-button);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  cursor: pointer;
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  transition: background 0.2s, border-color 0.2s, opacity 0.15s;
}

.btn-modal:hover:not(:disabled)
{
  background: color-mix(in srgb, var(--color-structure) 12%, transparent);
  border-color: var(--color-structure);
}

.btn-modal:active:not(:disabled)
{
  opacity: 0.85;
}

.btn-modal.primary
{
  background: var(--action);
  color: var(--action-text);
  border: 1px solid var(--action-border);
}

.btn-modal.primary:hover:not(:disabled)
{
  background: color-mix(in srgb, var(--action) 85%, #000);
  border-color: var(--action);
}

.btn-modal:disabled
{
  opacity: 0.4;
  cursor: default;
}

.btn-practice
{
  background: var(--action);
  color: var(--action-text);
  border: 1px solid var(--action-border);
  border-radius: var(--radius-md);
  padding: 10px 26px;
  font-family: var(--font-button);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, opacity 0.15s;
  min-height: 40px;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
}

.btn-practice:hover:not(:disabled)
{
  background: color-mix(in srgb, var(--action) 85%, #000);
  border-color: var(--action);
}

.btn-practice:active:not(:disabled) { opacity: 0.85; }

.btn-practice:disabled { opacity: 0.4; cursor: default; }

.btn-practice:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }

/* Dark mode: the primary lifts gently on hover — never darkens into an inset trap */
html.theme-dark .btn-practice:hover:not(:disabled),
html.theme-dark .btn-modal.primary:hover:not(:disabled)
{
  background: color-mix(in srgb, var(--color-action) 80%, var(--color-structure));
  border-color: color-mix(in srgb, var(--color-structure) 70%, transparent);
}

.header-back-btn,
.header-close-btn
{
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: min(1.2rem, 22px);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, opacity 0.15s;
  flex-shrink: 0;
}

.header-back-btn:hover,
.header-close-btn:hover
{
  border-color: var(--text);
  color: var(--text);
}

.header-back-btn:active,
.header-close-btn:active
{
  opacity: 0.85;
}

.header-back-btn.invisible
{
  visibility: hidden;
  pointer-events: none;
}

.modal-feedback
{
  font-size: 0.85rem;
  min-height: 1.6em;
  margin: 6px 0;
}

.modal-feedback.correct
{
  color: var(--color-structure);
  font-weight: 700;
}

.modal-feedback.wrong
{
  color: var(--terracotta);
}

/* ===========================
   DYNAMIC FONT SCALE — one multiplier 0.5–2.0
   Root rem drives everything; chrome is clamped so the frame can't break.
   =========================== */
:root
{
  --font-scale: 1;
  --bead-size: 2em;
}

html
{
  font-size: calc(17px * var(--font-scale));
}

@media (max-width: 480px)
{
  .step-card
  {
    padding: 8px 10px;
  }

  .step-arabic,
  .modal-arabic
  {
    font-size: 1.2rem;
  }

  .step-card-title
  {
    font-size: 0.8rem;
  }

  .btn-practice,
  .btn-modal
  {
    font-size: 0.65rem;
    padding: 6px 12px;
  }

  .pool-tile
  {
    font-size: 1rem;
    padding: 6px 10px;
  }

  .assemble-slot.filled
  {
    font-size: 1.1rem;
  }

  .timeline
  {
    padding-left: 24px;
  }

  .step-bead
  {
    margin-left: -18px;
  }

  .step-card-header
  {
    flex-wrap: wrap;
    row-gap: 4px;
  }

  .step-card-title
  {
    flex-basis: 100%;
    font-size: 0.85rem;
  }

  .step-card-type,
  .ruling-badge
  {
    font-size: 0.5rem;
  }

  .step-card-chevron
  {
    margin-left: auto;
    font-size: 0.65rem;
  }

  .mini-bar
  {
    flex-basis: 100%;
    margin-top: 2px;
    margin-left: 0;
    padding-left: 0;
    justify-content: flex-start;
  }

  .mini-bar-caption
  {
    font-size: 0.4rem;
    margin-right: 2px;
  }

  .settings-card
  {
    max-width: 100%;
  }

  .assemble-modal
  {
    max-width: 100%;
  }

  .assemble-input-row
  {
    gap: 4px;
    padding: 8px 4px;
  }

  .assemble-slot
  {
    min-width: 32px;
    padding: 4px 8px;
  }
}

/* ===========================
   HEADER GROUP STYLES
   =========================== */
.step-row.header-group {
    margin: 24px 0 6px 0;
    padding-left: 0;
}

.step-row.header-group .step-bead {
    background: transparent !important;
    border: 1px solid var(--accent) !important;
    color: var(--accent) !important;
    font-size: 0.5rem;
    width: calc(var(--bead-size) * 0.8);
    height: calc(var(--bead-size) * 0.8);
    margin-left: -18px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 10px var(--spine-glow);
}

.header-title {
    font-family: var(--font-body);
    font-size: 1.1rem;
    color: var(--color-structure);
    letter-spacing: 0.05em;
    font-weight: 500;
}

/* ===========================
   SUBSTEP GROUP — INDENTED BLOCK
   =========================== */
.substep-group {
    margin-left: 20px;
    padding-left: 12px;
    border-left: 2px solid var(--border);
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.substep-group .step-row.substep .step-bead {
    width: calc(var(--bead-size) * 0.7);
    height: calc(var(--bead-size) * 0.7);
    font-size: 0.5rem;
    margin-left: -16px;
}

.substep-group .step-row.substep .step-card {
    background: var(--bg2);
    border: 1px solid var(--border);
    box-shadow: none;
    padding: 10px 12px;
}

.substep-group .step-row.substep .step-card:hover {
    border-color: var(--border-glow);
}

.substep-group .step-row.substep .step-arabic {
    font-size: 1.3rem;
}

/* Listen button – prominent but clean, centered below Arabic */
.listen-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 8px 20px;
    font-size: 0.85rem;
    font-family: var(--font-button);
    color: var(--text);
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, opacity 0.15s;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    user-select: none;
    min-height: 44px;
    min-width: 120px;
}

.listen-btn:hover {
    border-color: var(--color-structure);
    background: color-mix(in srgb, var(--color-structure) 10%, transparent);
}

.listen-btn:active {
    opacity: 0.85;
}

.listen-btn .listen-icon {
    font-size: 1.1rem;
}

.listen-btn .listen-label {
    font-size: 0.8rem;
    letter-spacing: 0.06em;
    text-transform: lowercase;
}

/* On mobile, keep it readable and tappable */
@media (max-width: 480px) {
    .listen-btn {
        padding: 6px 16px;
        font-size: 0.75rem;
        min-height: 40px;
        min-width: 100px;
    }
    .listen-btn .listen-icon {
        font-size: 1rem;
    }
    .listen-btn .listen-label {
        font-size: 0.7rem;
    }
}


/* Prevent Android tap highlight & focus bleed */
.step-card,
.listen-btn,
.btn-practice,
.btn-modal,
.settings-gear,
.activity-card,
.drill-option,
.pool-tile,
.assemble-slot.filled {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

/* Remove default focus outline, but keep visible for keyboard users */
.step-card:focus,
.listen-btn:focus,
.btn-practice:focus,
.btn-modal:focus,
.settings-gear:focus,
.activity-card:focus,
.drill-option:focus,
.pool-tile:focus,
.assemble-slot.filled:focus {
    outline: none;
}

/* Show a subtle focus ring only when using keyboard (not touch/click) */
.step-card:focus-visible,
.listen-btn:focus-visible,
.btn-practice:focus-visible,
.btn-modal:focus-visible,
.settings-gear:focus-visible,
.activity-card:focus-visible,
.drill-option:focus-visible,
.pool-tile:focus-visible,
.assemble-slot.filled:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}