/* ==========================================================================
   Jam – Just a Minute – Minimal, Cinematic Impromptu Speaking
   Global Visibility and Accessibility Contrast System
   Design Tokens:
     Background:         #101713
     Primary text:       #F5F0E6
     Secondary text:     #C0BCAF
     Navigation text:    #E8E3D8
     Button text:        #F5F0E6
     Accent:             #D28A5D
     Border:             #424B43
     Button background:  #202A23
     Hover background:   #303C33
   Typography: DM Serif Display, DM Sans, Space Mono
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Design System Tokens
   -------------------------------------------------------------------------- */
:root {
  /* Core Design Tokens specified by user */
  --bg-canvas: #101713;
  --bg-canvas-subtle: #141E18;
  --bg-surface: #17221B;
  --bg-surface-elevated: #202A23;
  --bg-surface-hover: #303C33;
  --bg-button: #202A23;
  --bg-button-hover: #303C33;

  --text-primary: #F5F0E6;
  --text-secondary: #C0BCAF;
  --text-nav: #E8E3D8;
  --text-button: #F5F0E6;
  --text-muted: #A39F93;
  --text-dim: #8E8B82;

  --accent: #D28A5D;
  --accent-hover: #DF9B70;
  --accent-active: #BA764B;
  --accent-subtle: rgba(210, 138, 93, 0.18);
  --accent-border: rgba(210, 138, 93, 0.55);

  --border: #424B43;
  --border-hover: #606C62;
  --border-focus: #D28A5D;

  /* Aliases & Fallbacks for timers, progress rings and scripts */
  --primary-accent: #D28A5D;
  --warning: #E5A855;
  --danger: #E06C75;

  --status-ready: #9BC4AC;
  --status-rolling: #D28A5D;
  --status-prep: #88C2AE;
  --status-research: #6FB3B5;

  --timer-track: #222E26;
  --timer-fill: #D28A5D;
  --backdrop: rgba(10, 15, 12, 0.88);

  /* Typography Stacks */
  --font-serif: 'DM Serif Display', Georgia, serif;
  --font-sans: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: 'Space Mono', Consolas, monospace;

  /* Spacing System */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;

  /* Radii */
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-smooth: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* --------------------------------------------------------------------------
   2. Base & Layout Fundamentals
   -------------------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  height: 100%;
}

::placeholder {
  color: var(--text-dim);
  opacity: 1;
}

select, option {
  background-color: #202A23 !important;
  color: #F5F0E6 !important;
}

html {
  scrollbar-gutter: stable;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  position: relative;
}

/* Custom Sleek Dark Scrollbars */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

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

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: var(--radius-full);
}

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

/* Atmospheric Ambient Vignette (Soft non-obstructive radial glow) */
.ambient-vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(circle at 50% 48%, rgba(26, 38, 30, 0.35) 0%, rgba(16, 23, 19, 0) 80%);
}

.app-viewport {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
}

:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 3px;
}

.hidden {
  display: none !important;
}

/* --------------------------------------------------------------------------
   3. Main Cinematic Home Screen Layout
   -------------------------------------------------------------------------- */
.stage-view {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: var(--space-6) var(--space-8);
}

/* Top Navigation Header */
.stage-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding-bottom: var(--space-4);
  gap: var(--space-4);
}

.brand-mark {
  display: flex;
  align-items: center;
  gap: 8px;
  user-select: none;
}

.brand-logo-icon {
  color: var(--accent);
  flex-shrink: 0;
  opacity: 1;
}

.brand-title {
  font-family: var(--font-sans);
  font-size: 1.1875rem; /* ~19px */
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--text-primary);
  opacity: 1;
}

.brand-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--accent);
  box-shadow: 0 0 8px rgba(210, 138, 93, 0.6);
  opacity: 1;
}

.header-tools {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.header-tools-desktop {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.header-tools-mobile {
  display: none;
  align-items: center;
  gap: 8px;
}

/* Mobile Menu Hamburger Toggle Button */
.mobile-menu-toggle-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  background-color: var(--bg-button);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-nav);
  cursor: pointer;
  transition: all var(--transition-fast);
  padding: 0;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.mobile-menu-toggle-btn:hover {
  background-color: var(--bg-button-hover);
  border-color: var(--border-hover);
  color: var(--text-primary);
}

.mobile-menu-toggle-btn:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
}

.hamburger-icon {
  width: 20px;
  height: 14px;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  pointer-events: none;
}

.hamburger-icon span {
  display: block;
  width: 100%;
  height: 2px;
  background-color: currentColor;
  border-radius: 2px;
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease;
}

.mobile-menu-toggle-btn.is-active .hamburger-icon span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.mobile-menu-toggle-btn.is-active .hamburger-icon span:nth-child(2) {
  opacity: 0;
}

.mobile-menu-toggle-btn.is-active .hamburger-icon span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

/* Mobile Navigation Backdrop */
.mobile-nav-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(10, 15, 12, 0.78);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 95;
  animation: fadeIn 0.2s ease;
}

/* Mobile Navigation Slide-out Drawer Panel */
.mobile-nav-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(320px, 86vw);
  max-width: 100vw;
  background-color: var(--bg-surface);
  border-left: 1px solid var(--border);
  box-shadow: -10px 0 35px rgba(0, 0, 0, 0.8);
  z-index: 96;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.mobile-nav-drawer.is-open {
  transform: translateX(0);
}

.mobile-nav-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border);
  min-height: 60px;
}

.mobile-nav-close-btn {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  padding: 0;
}

.mobile-nav-close-btn:hover {
  color: var(--text-primary);
  background-color: var(--bg-button);
  border-color: var(--border);
}

.mobile-nav-close-btn:focus-visible {
  outline: 2px solid var(--border-focus);
}

.mobile-nav-links {
  display: flex;
  flex-direction: column;
  padding: var(--space-4);
  gap: 10px;
  flex: 1;
}

.mobile-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 52px;
  padding: 12px 14px;
  background-color: var(--bg-button);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-sans);
  text-align: left;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.mobile-nav-item:hover,
.mobile-nav-item:focus-visible,
.mobile-nav-item:active {
  background-color: var(--bg-button-hover);
  border-color: var(--border-hover);
  color: var(--text-primary);
}

.mobile-nav-item:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
}

.mobile-nav-item-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background-color: rgba(26, 38, 30, 0.85);
  color: var(--accent);
  flex-shrink: 0;
}

.mobile-nav-item-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.mobile-nav-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.25;
}

.mobile-nav-sub {
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.2;
}

.mobile-nav-arrow {
  color: var(--text-muted);
  flex-shrink: 0;
}

.nav-status-pill {
  font-size: 0.6875rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  letter-spacing: 0.05em;
  flex-shrink: 0;
}

.nav-status-pill.on {
  background-color: rgba(72, 187, 120, 0.2);
  color: #7CE6A7;
  border: 1px solid rgba(124, 230, 167, 0.4);
}

.nav-status-pill.off {
  background-color: rgba(224, 108, 117, 0.15);
  color: #FA9595;
  border: 1px solid rgba(250, 149, 149, 0.35);
}

.mobile-nav-footer {
  padding: var(--space-4) var(--space-5);
  border-top: 1px solid var(--border);
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
}

/* Header & Tool Navigation Buttons */
.tool-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  background-color: var(--bg-button);
  color: var(--text-nav);
  border: 1px solid var(--border);
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  font-weight: 500;
  transition: all var(--transition-fast);
  opacity: 1 !important;
  user-select: none;
}

.tool-btn svg {
  opacity: 1 !important;
  stroke: currentColor;
  flex-shrink: 0;
}

.tool-btn .tool-label {
  opacity: 1;
  color: inherit;
}

.tool-btn .tool-icon {
  color: var(--accent);
  font-size: 0.875rem;
  line-height: 1;
  opacity: 1;
}

.tool-btn:hover {
  color: var(--text-primary);
  background-color: var(--bg-button-hover);
  border-color: var(--border-hover);
}

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

/* Distinct Sound Toggle ON/OFF States */
.tool-btn.is-muted,
.icon-btn.is-muted {
  border-color: #E06C75;
  color: #E06C75;
  background-color: rgba(224, 108, 117, 0.12);
}

.tool-btn.is-muted:hover,
.icon-btn.is-muted:hover {
  border-color: #FC8181;
  color: #FC8181;
  background-color: rgba(224, 108, 117, 0.22);
}

.pill-btn {
  height: 38px;
  min-height: 38px;
  padding: 0 14px;
  border-radius: var(--radius-full);
}

.icon-btn {
  width: 38px;
  height: 38px;
  min-width: 38px;
  min-height: 38px;
  border-radius: var(--radius-full);
  padding: 0;
}

.streak-mini-badge {
  font-size: 0.6875rem;
  padding: 1px 7px;
  background-color: var(--accent);
  color: #101713;
  border-radius: var(--radius-full);
  font-weight: 700;
  opacity: 1;
}

.streak-pill-btn,
.streak-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background-color: var(--bg-button);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 0 14px;
  height: 38px;
  min-height: 38px;
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.streak-pill-btn:hover,
.streak-nav-btn:hover {
  background-color: rgba(210, 138, 93, 0.12);
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}

.streak-pill-btn:active,
.streak-nav-btn:active {
  transform: translateY(0);
}

.streak-nav-icon {
  font-size: 1rem;
  line-height: 1;
}

.streak-nav-count {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--accent);
}

/* --------------------------------------------------------------------------
   4. Visual Centerpiece: The Speaking Topic
   -------------------------------------------------------------------------- */
.stage-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  flex: 1;
  padding: var(--space-8) 0;
  width: 100%;
  max-width: 880px;
  margin: 0 auto;
}

/* Topic Meta Bar (Above the Topic) */
.topic-meta-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-bottom: var(--space-4);
}

/* Category & Difficulty Filters */
.filter-controls-row {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.filter-label {
  font-family: var(--font-sans);
  font-size: 0.75rem; /* 12px */
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-secondary);
  user-select: none;
  opacity: 1;
}

.filter-select-wrap {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 180px;
}

.real-select-hidden {
  position: absolute !important;
  opacity: 0 !important;
  pointer-events: none !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  clip: rect(0, 0, 0, 0) !important;
  overflow: hidden !important;
}

.custom-select-wrap {
  width: 100%;
}

.custom-select-trigger {
  width: 100%;
  height: 44px;
  min-height: 44px;
  background-color: var(--bg-button);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0 36px 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-align: left;
  cursor: pointer;
  outline: none;
  transition: all var(--transition-fast);
  box-sizing: border-box;
}

.custom-select-trigger:hover {
  border-color: var(--border-hover);
  background-color: var(--bg-surface-hover);
}

.custom-select-trigger:focus-visible,
.custom-select-trigger.is-open {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 2px var(--accent-subtle);
}

.custom-select-trigger.is-open ~ .filter-chevron {
  transform: translateY(-50%) rotate(180deg);
  color: var(--accent);
}

.custom-select-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-right: 6px;
  display: block;
}

.custom-select-menu {
  position: absolute;
  left: 0;
  right: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  background-color: #1A251E;
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-sm);
  box-shadow: 0 14px 35px rgba(0, 0, 0, 0.85);
  max-height: 220px;
  overflow-y: auto;
  overscroll-behavior: contain;
  z-index: 120;
  list-style: none;
  padding: 4px 0;
  margin: 0;
  text-align: left;
}

.custom-select-menu.opens-down {
  top: calc(100% + 4px);
  bottom: auto;
}

.custom-select-menu.opens-up {
  bottom: calc(100% + 4px);
  top: auto;
}

.custom-select-option {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  text-align: left;
  padding: 10px 14px;
  min-height: 44px;
  font-size: 0.875rem;
  font-family: var(--font-sans);
  color: var(--text-primary);
  cursor: pointer;
  user-select: none;
  transition: background-color var(--transition-fast), color var(--transition-fast);
  box-sizing: border-box;
}

.custom-select-option[data-value="Fun and Creative Topics"] {
  text-align: left;
  justify-content: flex-start;
}

.custom-select-option:hover,
.custom-select-option.is-highlighted {
  background-color: var(--bg-surface-hover);
  color: var(--accent);
}

.custom-select-option.is-selected {
  color: var(--accent);
  font-weight: 600;
  background-color: rgba(210, 138, 93, 0.12);
}

.filter-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  width: 100%;
  height: 44px;
  background-color: var(--bg-button);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0 36px 0 14px;
  cursor: pointer;
  outline: none;
  transition: all var(--transition-fast);
  opacity: 1;
}

.filter-select:hover {
  border-color: var(--border-hover);
  background-color: var(--bg-surface-hover);
}

.filter-select:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 2px var(--accent-subtle);
}

.filter-select option {
  background-color: #202A23 !important;
  color: #F5F0E6 !important;
  padding: 10px 14px;
}

.filter-chevron {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--text-secondary);
  transition: color var(--transition-fast);
  opacity: 1;
}

.filter-select:hover ~ .filter-chevron,
.filter-select:focus ~ .filter-chevron {
  color: var(--accent);
}

/* Favorite Star Button */
.star-group {
  align-items: center;
}

.btn-star {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background-color: var(--bg-button);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-button);
  cursor: pointer;
  transition: all var(--transition-fast);
  opacity: 1;
}

.btn-star svg {
  opacity: 1;
  stroke: currentColor;
}

.btn-star:hover {
  color: var(--text-primary);
  border-color: var(--border-hover);
  background-color: var(--bg-button-hover);
}

.btn-star.active {
  color: var(--accent);
  border-color: var(--accent);
  background-color: var(--accent-subtle);
}

.btn-star.active svg {
  fill: var(--accent);
}

/* Uppercase Status Kicker */
.topic-status-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
  height: 24px;
}

.topic-kicker-text {
  font-family: var(--font-sans);
  font-size: 0.75rem; /* 12px */
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-secondary);
  transition: color var(--transition-fast);
  opacity: 1;
}

.topic-kicker-text.is-active {
  color: var(--accent);
}

.topic-spinner-indicator {
  display: flex;
  align-items: center;
}

.mini-spinner {
  width: 12px;
  height: 12px;
  border: 2px solid rgba(210, 138, 93, 0.25);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: miniSpin 0.7s linear infinite;
  display: inline-block;
  opacity: 1;
}

@keyframes miniSpin {
  to { transform: rotate(360deg); }
}

/* Main Topic Viewport */
.topic-reel-viewport {
  position: relative;
  min-height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0 var(--space-4);
  overflow: hidden;
}

/* Stable fixed height on desktop to prevent any layout jumping during roulette */
@media (min-width: 769px) {
  .topic-reel-viewport {
    height: 170px;
    min-height: 170px;
    max-height: 170px;
  }
}

.topic-serif-display {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(2.125rem, 4.75vw, 3.625rem);
  line-height: 1.25;
  color: var(--text-primary);
  letter-spacing: -0.015em;
  max-width: 840px;
  margin: 0 auto;
  word-wrap: break-word;
  transition: transform 0.15s cubic-bezier(0.16, 1, 0.3, 1), color 0.4s ease;
  opacity: 1 !important;
}

.topic-serif-display.topic-rolling {
  opacity: 0.95 !important;
}

.topic-serif-display.reel-step {
  animation: reelVerticalCycle 0.08s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes reelVerticalCycle {
  0% {
    transform: translateY(12px);
    opacity: 0.8;
  }
  100% {
    transform: translateY(0);
    opacity: 1;
  }
}

.topic-serif-display.topic-settle {
  animation: settleAccentPulse 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes settleAccentPulse {
  0% {
    transform: translateY(6px);
    color: var(--accent);
  }
  50% {
    color: var(--accent);
  }
  100% {
    transform: translateY(0);
    color: var(--text-primary);
  }
}

/* Idea Starters Accordion */
.hints-accordion {
  margin-top: var(--space-3);
  margin-bottom: var(--space-6);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hints-toggle-btn {
  background: var(--bg-button);
  border: 1px solid var(--border);
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  transition: all var(--transition-fast);
  opacity: 1;
}

.hints-toggle-btn:hover,
.hints-toggle-btn.active {
  color: var(--text-primary);
  background-color: var(--bg-button-hover);
  border-color: var(--border-hover);
}

.hints-toggle-icon {
  font-size: 0.75rem;
  color: var(--accent);
  opacity: 1;
}

.hints-drawer {
  max-width: 580px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-4) var(--space-5);
  margin-top: var(--space-3);
  text-align: left;
  animation: fadeIn 0.2s ease;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.hints-clean-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hints-clean-list li {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.5;
  position: relative;
  padding-left: 16px;
  opacity: 1;
}

.hints-clean-list li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   5. Action Buttons (All Screens)
   -------------------------------------------------------------------------- */
.stage-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  flex-wrap: wrap;
  width: 100%;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;
  padding: 0 24px;
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
  opacity: 1 !important;
  user-select: none;
}

.action-btn svg {
  opacity: 1 !important;
  stroke: currentColor;
  flex-shrink: 0;
}

.action-btn span {
  opacity: 1 !important;
}

/* Primary Action: Start Talking, Finish Research & Continue, Try Another Topic, Start Preparation */
.action-primary {
  background-color: var(--accent);
  color: #101713;
  font-weight: 600;
  border-color: var(--accent);
}

.action-primary svg {
  stroke: #101713;
}

.action-primary:hover {
  background-color: var(--accent-hover);
  border-color: var(--accent-hover);
  color: #101713;
}

.action-primary:active {
  background-color: var(--accent-active);
  border-color: var(--accent-active);
  transform: scale(0.985);
}

.action-primary:focus-visible {
  outline: 2px solid var(--text-primary);
  outline-offset: 3px;
}

/* Secondary Action with Distinct Treatment: Research & Talk */
.action-research {
  background-color: var(--bg-button);
  color: var(--text-button);
  border: 1.5px solid var(--accent);
  font-weight: 600;
}

.action-research svg {
  color: var(--accent);
}

.action-research:hover {
  background-color: var(--accent-subtle);
  border-color: var(--accent-hover);
  color: #FFFFFF;
}

.action-research:hover svg {
  color: #FFFFFF;
}

.action-research:active {
  background-color: var(--accent);
  color: #101713;
  transform: scale(0.985);
}

.action-research:active svg {
  stroke: #101713;
}

.action-research:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* Secondary Action: Quiet Muted Border (New Topic, Settings, Pause, Resume, Restart, Return Home) */
.action-secondary {
  background-color: var(--bg-button);
  color: var(--text-button);
  border: 1px solid var(--border);
}

.action-secondary:hover {
  background-color: var(--bg-button-hover);
  border-color: var(--border-hover);
  color: var(--text-primary);
}

.action-secondary:active {
  background-color: #26332B;
  transform: scale(0.985);
}

.action-secondary:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 3px;
}

/* Only genuinely disabled buttons should look faded */
.action-btn:disabled,
.tool-btn:disabled,
.btn:disabled,
.filter-select:disabled,
.btn-star:disabled {
  opacity: 0.45 !important;
  cursor: not-allowed !important;
  transform: none !important;
  pointer-events: none;
}

/* Keyboard Legend: visible on desktop/large screens (>= 768px), hidden below 768px */
.stage-legend {
  display: none;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  margin-top: var(--space-4);
  font-size: 0.8125rem;
  color: var(--text-secondary);
  opacity: 1;
}

@media (min-width: 768px) {
  .stage-legend {
    display: flex;
  }
}

@media (max-width: 767px) {
  .stage-legend {
    display: none;
  }
}

.legend-dot {
  color: var(--accent);
  opacity: 1;
}

kbd {
  display: inline-block;
  padding: 2px 7px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-primary);
  background-color: var(--bg-button);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  opacity: 1;
}

/* Bottom Footer */
.stage-footer {
  text-align: center;
  padding-top: var(--space-4);
}

.footer-note {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  opacity: 1;
}

/* Daily Challenge Flyout */
.daily-flyout {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 8px 16px 8px 22px;
  display: flex;
  align-items: center;
  gap: var(--space-4);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.65);
  z-index: 40;
  animation: fadeIn 0.2s ease;
  opacity: 1;
}

.daily-flyout-tag {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--accent);
  opacity: 1;
}

.daily-flyout-text {
  font-size: 0.875rem;
  color: var(--text-primary);
  white-space: nowrap;
  max-width: 340px;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 1;
}

#btn-practice-daily {
  background-color: var(--accent);
  color: #101713;
  font-weight: 600;
  border: 1px solid var(--accent);
  height: 32px;
  padding: 0 14px;
}

#btn-practice-daily:hover {
  background-color: var(--accent-hover);
  border-color: var(--accent-hover);
}

/* --------------------------------------------------------------------------
   6. Modals & Settings Drawer
   -------------------------------------------------------------------------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 500;
  background-color: rgba(10, 15, 12, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  animation: fadeIn 0.2s ease;
}

.cinematic-modal-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  max-width: 500px;
  width: 100%;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.75);
  animation: modalScale 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
  opacity: 1;
}

@keyframes modalScale {
  from { opacity: 0; transform: scale(0.96) translateY(6px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-6);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background-color: var(--bg-surface);
  z-index: 10;
}

.modal-heading {
  font-family: var(--font-sans);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  opacity: 1;
}

.modal-kicker {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--accent);
  display: block;
  margin-bottom: 3px;
  opacity: 1;
}

.modal-close-btn {
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 1.5rem;
  line-height: 1;
  color: var(--text-secondary);
  cursor: pointer;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  opacity: 1;
  padding: 0;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.modal-close-btn:hover {
  color: var(--text-primary);
  background-color: var(--bg-surface-hover);
  border-color: var(--border-hover);
}

.modal-close-btn:focus-visible {
  outline: 2px solid var(--border-focus);
}

/* Modal Bottom Action Bar */
.modal-bottom-actions {
  position: sticky;
  bottom: 0;
  background-color: var(--bg-surface);
  border-top: 1px solid var(--border);
  padding: var(--space-4) var(--space-6);
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  width: 100%;
}

.btn-save-settings {
  width: 100%;
  min-height: 46px;
  font-size: 0.9375rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background-color: var(--accent);
  color: #101713;
  border: 1px solid var(--accent);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-save-settings:hover {
  background-color: var(--accent-hover);
  border-color: var(--accent-hover);
}

.modal-scroll-body {
  padding: var(--space-4) var(--space-6);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.setting-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.setting-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
}

.setting-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-primary);
  display: block;
  opacity: 1;
}

.setting-subtext {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin-top: 3px;
  opacity: 1;
}

.setting-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 0;
}

/* Switch Component with 44px Touch Target */
.switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 48px;
  height: 26px;
  min-height: 44px;
  cursor: pointer;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 9px;
  left: 0;
  right: 0;
  height: 26px;
  background-color: #243028;
  border: 1px solid var(--border);
  transition: 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  border-radius: var(--radius-full);
}

.slider::before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 2px;
  bottom: 2px;
  background-color: var(--text-primary);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.2s ease;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

input:checked + .slider {
  background-color: var(--accent);
  border-color: var(--accent);
}

input:checked + .slider::before {
  transform: translateX(22px);
  background-color: #101713;
}

.switch input:focus-visible + .slider {
  outline: 2px solid var(--border-focus);
  outline-offset: 3px;
}

/* Preset Duration Pills in Settings */
.segmented-pills-wrap {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  width: 100%;
}

.segmented-pills-wrap.disabled {
  opacity: 0.45;
  pointer-events: none;
}

.segmented-pills {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(52px, 1fr));
  gap: 8px;
  width: 100%;
}

.prep-preset-btn,
.speaking-preset-btn,
.research-preset-btn {
  min-height: 44px;
  padding: 0 10px;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-button);
  background-color: var(--bg-button);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.prep-preset-btn:hover,
.speaking-preset-btn:hover,
.research-preset-btn:hover {
  color: var(--text-primary);
  background-color: var(--bg-button-hover);
  border-color: var(--border-hover);
}

.prep-preset-btn.active,
.speaking-preset-btn.active,
.research-preset-btn.active {
  background-color: var(--accent-subtle);
  color: var(--accent);
  border-color: var(--accent);
  font-weight: 700;
  box-shadow: 0 0 0 1px var(--accent);
}

/* Interactive Duration Slider Controls */
.slider-control-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px;
  background-color: rgba(24, 34, 27, 0.7);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color var(--transition-fast);
  width: 100%;
}

.slider-control-group:hover {
  border-color: var(--border-hover);
}

.slider-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
}

.slider-header-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.duration-display-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--accent);
  background-color: var(--accent-subtle);
  border: 1px solid rgba(210, 138, 93, 0.35);
  border-radius: var(--radius-full);
  padding: 3px 12px;
  letter-spacing: 0.02em;
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.duration-display-badge.badge-disabled {
  color: var(--text-muted);
  background-color: rgba(255, 255, 255, 0.04);
  border-color: var(--border);
}

.clean-range-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 44px; /* Touch target area */
  background: transparent;
  cursor: pointer;
  margin: 0;
  padding: 0;
  outline: none;
  touch-action: none;
  display: block;
}

.clean-range-slider::-webkit-slider-runnable-track {
  width: 100%;
  height: 8px;
  border-radius: 9999px;
  background: linear-gradient(
    to right,
    var(--accent) 0%,
    var(--accent) var(--slider-progress, 0%),
    #243028 var(--slider-progress, 0%),
    #243028 100%
  );
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: background 0.05s linear;
}

.clean-range-slider::-moz-range-track {
  width: 100%;
  height: 8px;
  border-radius: 9999px;
  background: #243028;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.clean-range-slider::-moz-range-progress {
  height: 8px;
  border-radius: 9999px;
  background: var(--accent);
}

.clean-range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #F5F0E6;
  border: 3px solid var(--accent);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(0, 0, 0, 0.2);
  margin-top: -10px;
  cursor: pointer;
  transition: transform 0.15s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.15s ease, border-color 0.15s ease;
}

.clean-range-slider::-moz-range-thumb {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #F5F0E6;
  border: 3px solid var(--accent);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  transition: transform 0.15s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.15s ease, border-color 0.15s ease;
}

.clean-range-slider:hover::-webkit-slider-thumb,
.clean-range-slider:active::-webkit-slider-thumb {
  transform: scale(1.15);
  box-shadow: 0 3px 12px rgba(210, 138, 93, 0.5), 0 0 0 2px rgba(210, 138, 93, 0.3);
}

.clean-range-slider:hover::-moz-range-thumb,
.clean-range-slider:active::-moz-range-thumb {
  transform: scale(1.15);
  box-shadow: 0 3px 12px rgba(210, 138, 93, 0.5), 0 0 0 2px rgba(210, 138, 93, 0.3);
}

.clean-range-slider:active::-webkit-slider-thumb,
.clean-range-slider:active::-moz-range-thumb {
  cursor: grabbing;
}

.clean-range-slider:focus-visible::-webkit-slider-thumb {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.clean-range-slider:focus-visible::-moz-range-thumb {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.clean-range-slider:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

.clean-range-slider:disabled::-webkit-slider-runnable-track {
  background: #243028 !important;
}

.slider-bounds-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 2px;
}

.slider-bound-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 500;
  letter-spacing: 0.02em;
}

#modal-settings .cinematic-modal-card {
  max-width: 530px;
  max-height: 90vh;
}

/* --------------------------------------------------------------------------
   Streak & Progress Overlay Interface (Desktop Base)
   -------------------------------------------------------------------------- */
#modal-streak-progress {
  align-items: center;
  justify-content: center;
}

#modal-streak-progress .cinematic-modal-card,
#modal-streak-progress .streak-progress-modal-card {
  max-width: 680px;
  width: min(100% - 32px, 680px);
  max-height: calc(100dvh - 48px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background-color: var(--bg-surface);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.9);
  animation: modalScale 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.streak-modal-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  background-color: var(--bg-surface);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 10;
  flex-shrink: 0;
}

.streak-modal-body {
  padding: 24px 24px 32px;
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: 28px;
  flex: 1;
}

/* SECTION 1: Main Streak Centerpiece */
.streak-hero-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 10px 16px 6px;
  gap: 8px;
}

.streak-hero-kicker {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--accent);
  text-transform: uppercase;
}

/* Subtle Living Burning Flame Effect */
.streak-flame-wrapper {
  margin: 6px 0 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  filter: drop-shadow(0 0 10px rgba(210, 138, 93, 0.42)) drop-shadow(0 -2px 8px rgba(234, 126, 63, 0.22));
  animation: flameGlowPulse 2.8s ease-in-out infinite alternate;
}

.streak-flame-svg {
  transform-origin: 50% 90%;
  animation: flameSway 2.4s ease-in-out infinite alternate;
  will-change: transform;
}

.streak-flame-outer {
  transform-origin: 12px 18px;
  animation: flameFlickerOuter 2s ease-in-out infinite alternate;
}

.streak-flame-core {
  transform-origin: 12px 15px;
  animation: flameFlickerCore 1.6s ease-in-out infinite alternate;
}

@keyframes flameGlowPulse {
  0% {
    filter: drop-shadow(0 0 9px rgba(210, 138, 93, 0.35)) drop-shadow(0 -2px 7px rgba(234, 126, 63, 0.18));
  }
  50% {
    filter: drop-shadow(0 0 14px rgba(210, 138, 93, 0.52)) drop-shadow(0 -3px 12px rgba(234, 126, 63, 0.32));
  }
  100% {
    filter: drop-shadow(0 0 10px rgba(210, 138, 93, 0.38)) drop-shadow(0 -2px 8px rgba(234, 126, 63, 0.2));
  }
}

@keyframes flameSway {
  0% {
    transform: scale(1) translateY(0) rotate(-0.5deg);
  }
  35% {
    transform: scaleY(1.025) scaleX(0.99) translateY(-0.8px) rotate(0.4deg);
  }
  70% {
    transform: scaleY(0.985) scaleX(1.015) translateY(0.4px) rotate(-0.3deg);
  }
  100% {
    transform: scaleY(1.03) scaleX(0.985) translateY(-1px) rotate(0.5deg);
  }
}

@keyframes flameFlickerOuter {
  0% {
    opacity: 0.96;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scaleY(1.02) scaleX(0.99);
  }
  100% {
    opacity: 0.95;
    transform: scaleY(0.99) scaleX(1.01);
  }
}

@keyframes flameFlickerCore {
  0% {
    opacity: 0.92;
    transform: scale(0.98);
  }
  40% {
    opacity: 1;
    transform: scale(1.04) translateY(-0.4px);
  }
  100% {
    opacity: 0.94;
    transform: scale(0.99) translateY(0.3px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .streak-flame-wrapper,
  .streak-flame-svg,
  .streak-flame-outer,
  .streak-flame-core {
    animation: none !important;
    transform: none !important;
  }
}

.streak-hero-number-wrap {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 8px;
  line-height: 1;
}

.streak-hero-count {
  font-family: var(--font-mono);
  font-size: clamp(2.5rem, 8vw, 3.8rem);
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -0.02em;
}

.streak-hero-unit {
  font-size: clamp(1rem, 3.2vw, 1.3rem);
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.streak-hero-caption {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  font-style: italic;
  max-width: 340px;
  margin: 2px 0 6px;
  line-height: 1.4;
}

.streak-hero-secondary {
  display: flex;
  justify-content: center;
}

.streak-best-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 14px;
  background-color: var(--bg-button);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.streak-best-badge strong {
  color: var(--text-primary);
  font-weight: 700;
}

/* Common Section Container */
.streak-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.streak-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.streak-section-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.streak-section-tag {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-primary);
  margin: 0;
}

.streak-section-meta {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

/* SECTION 2: Weekly Tracker */
.weekly-tracker-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  width: 100%;
}

.weekly-day-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 4px;
  background-color: var(--bg-button);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  min-width: 0;
  position: relative;
  cursor: pointer;
  user-select: none;
}

.weekly-day-col:hover {
  border-color: var(--border-hover);
  background-color: var(--bg-surface-hover);
}

.weekly-day-col.is-today {
  border-color: rgba(210, 138, 93, 0.6);
  background-color: rgba(210, 138, 93, 0.1);
}

.weekly-day-col.is-completed {
  border-color: rgba(210, 138, 93, 0.45);
}

.weekly-day-col.is-selected {
  border-color: var(--accent);
  background-color: rgba(210, 138, 93, 0.18);
  box-shadow: 0 0 0 1.5px var(--accent);
}

.weekly-day-col.is-selected .weekly-day-num {
  color: var(--accent);
}

.weekly-day-name {
  font-size: clamp(0.5625rem, 2.2vw, 0.65rem);
  font-weight: 700;
  color: var(--text-secondary);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.weekly-day-col.is-today .weekly-day-name {
  color: var(--accent);
}

.weekly-day-num {
  font-family: var(--font-mono);
  font-size: clamp(0.8125rem, 2.8vw, 0.9375rem);
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}

.weekly-day-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 0.75rem;
  line-height: 1;
}

.weekly-day-indicator.completed {
  background-color: rgba(210, 138, 93, 0.22);
  color: var(--accent);
  font-weight: 700;
}

.weekly-day-indicator.incomplete {
  color: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.15);
  font-size: 0.625rem;
}

/* Integrated Daily Records in Calendar Panel */
.calendar-records-panel {
  margin-top: 14px;
  background-color: rgba(18, 26, 21, 0.65);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.calendar-records-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  padding-bottom: 8px;
}

.calendar-records-title-wrap {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.calendar-records-day-title {
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-primary);
}

.calendar-records-meta-date {
  font-size: 0.75rem;
  color: var(--accent);
  font-family: var(--font-mono);
}

.calendar-records-count {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

.calendar-records-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-records-clear {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 500;
  padding: 3px 10px;
  cursor: pointer;
  transition: all var(--transition-fast);
  line-height: 1.2;
}

.btn-records-clear:hover {
  color: var(--danger, #E06C75);
  border-color: rgba(224, 108, 117, 0.4);
  background-color: rgba(224, 108, 117, 0.08);
}

.btn-records-clear:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.calendar-day-records-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 280px;
  overflow-y: auto;
}

.calendar-record-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  background-color: var(--bg-button);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color var(--transition-fast);
}

.calendar-record-card:hover {
  border-color: var(--border-hover);
}

.calendar-record-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  flex: 1;
}

.calendar-record-topic {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.calendar-record-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 0.75rem;
}

.calendar-record-category {
  color: var(--accent);
  font-weight: 500;
}

.calendar-record-diff {
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
}

.calendar-record-diff.easy {
  color: #8bc34a;
  background-color: rgba(139, 195, 74, 0.15);
}

.calendar-record-diff.medium {
  color: #ffb74d;
  background-color: rgba(255, 183, 77, 0.15);
}

.calendar-record-diff.hard {
  color: #e57373;
  background-color: rgba(229, 115, 115, 0.15);
}

.calendar-record-meta-stat {
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

.calendar-record-action {
  flex-shrink: 0;
}

.calendar-record-practice-btn {
  height: 32px;
  min-height: 32px;
  padding: 0 12px;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  background-color: rgba(210, 138, 93, 0.15);
  border: 1px solid rgba(210, 138, 93, 0.4);
  color: var(--accent);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.calendar-record-practice-btn:hover {
  background-color: var(--accent);
  color: #121A15;
}

.calendar-records-empty {
  padding: 24px 12px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.8125rem;
  font-style: italic;
}

/* SECTION 3 & 4: Records & Saved Lists */
.streak-records-list,
.streak-saved-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.streak-records-list .list-item-card,
.streak-saved-list .list-item-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 2px;
  border: none;
  border-bottom: 1px solid var(--border);
  background: transparent;
  border-radius: 0;
}

.streak-records-list .list-item-card:last-child,
.streak-saved-list .list-item-card:last-child {
  border-bottom: none;
}

.streak-view-all-wrap {
  display: flex;
  justify-content: center;
  padding-top: 10px;
}

.btn-view-all {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 6px 16px;
  font-size: 0.8125rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-view-all:hover {
  color: var(--text-primary);
  border-color: var(--border-hover);
  background-color: var(--bg-button);
}

/* SECTION 5: Activity Stats Grid */
.activity-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.activity-stat-tile {
  background-color: var(--bg-button);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 4px;
  min-width: 0;
}

.activity-stat-tile .stat-tile-label {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.activity-stat-tile .stat-tile-val {
  font-family: var(--font-mono);
  font-size: clamp(1.15rem, 3.5vw, 1.35rem);
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.activity-category-wrap {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.activity-subhead {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  text-transform: uppercase;
  margin: 0;
}

.activity-category-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* --------------------------------------------------------------------------
   7. Distraction-Free Practice & Research Interfaces
   -------------------------------------------------------------------------- */
.practice-stage,
.research-stage {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
  max-width: 820px;
  margin: 0 auto;
  padding: var(--space-6) var(--space-8);
  animation: fadeIn 0.25s ease;
}

.practice-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: var(--space-4);
}

.practice-phase-wrap {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.phase-badge-text {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  background-color: var(--accent-subtle);
  border: 1px solid var(--accent-border);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  opacity: 1;
}

.phase-badge-research {
  color: var(--accent);
  background-color: var(--accent-subtle);
  border-color: var(--accent-border);
}

.target-sub-text {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-weight: 600;
  opacity: 1;
}

/* Practice Topic Display */
.practice-topic-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-3);
  padding: var(--space-4) 0;
}

.practice-topic-heading {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  line-height: 1.3;
  color: var(--text-primary);
  max-width: 720px;
  opacity: 1;
}

.practice-meta-tags {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 0.8125rem;
  color: var(--text-secondary);
  font-weight: 500;
  opacity: 1;
}

.practice-meta-tags .meta-sep {
  color: var(--accent);
}

.practice-hints-popover {
  margin-top: var(--space-2);
  text-align: left;
}

.practice-hints-toggle {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
  font-weight: 500;
  opacity: 1;
}

.practice-hints-toggle:hover {
  color: var(--text-primary);
}

.practice-hints-popover .hints-clean-list {
  margin-top: var(--space-2);
  max-width: 540px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-sm);
}

/* Practice & Research Timer Dial (Generous Whitespace, Perfectly Centered) */
.practice-timer-center {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: clamp(var(--space-2), 2vh, var(--space-4)) 0;
  width: 100%;
}

.timer-dial-container {
  position: relative;
  width: clamp(260px, min(76vw, 48vh), 300px);
  height: clamp(260px, min(76vw, 48vh), 300px);
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  user-select: none;
}

.timer-dial-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
  z-index: 1;
  pointer-events: none;
}

.dial-bg-track {
  fill: none;
  stroke: var(--timer-track);
  stroke-width: 5;
  opacity: 1;
}

.dial-active-bar {
  fill: none;
  stroke: var(--timer-fill);
  stroke-width: 5;
  stroke-linecap: round;
  stroke-dasharray: 753.98;
  transform-origin: 140px 140px;
  transition: stroke var(--transition-normal);
  opacity: 1;
}

/* Timer Content: CSS Grid layout keeping digits dead center with separate top & bottom rows */
.dial-inner {
  position: relative;
  z-index: 2;
  width: 72%;
  height: 72%;
  max-width: 210px;
  max-height: 210px;
  display: grid;
  grid-template-rows: 1fr auto 1fr;
  align-items: center;
  justify-items: center;
  text-align: center;
  margin: auto;
  padding: 4px;
  box-sizing: border-box;
}

/* Phase Label (Top Slot in Grid - comfortably above countdown) */
.dial-phase-label {
  grid-row: 1;
  align-self: end;
  font-family: var(--font-sans);
  font-size: clamp(0.6875rem, 2vw, 0.75rem); /* 11px - 12px */
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
  line-height: 1.25;
  padding-bottom: 8px;
  margin: 0;
  max-width: 100%;
  overflow-wrap: break-word;
  opacity: 1;
}

/* Countdown Digits (Center Slot in Grid - Perfectly centered horizontally and vertically) */
.dial-digits {
  grid-row: 2;
  align-self: center;
  justify-self: center;
  font-family: var(--font-mono);
  font-size: clamp(2.35rem, 7.5vw, 3rem); /* ~38px - 48px */
  font-weight: 700;
  line-height: 1;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  margin: 0;
  padding: 0;
  opacity: 1;
}

/* Motivational Encouragement Message (Bottom Slot in Grid - safely below countdown) */
.dial-encouragement {
  grid-row: 3;
  align-self: start;
  font-family: var(--font-sans);
  font-size: clamp(0.75rem, 2vw, 0.8125rem); /* 12px - 13px */
  color: var(--text-secondary);
  line-height: 1.35;
  padding-top: 8px;
  margin: 0;
  max-width: 100%;
  word-wrap: break-word;
  overflow-wrap: break-word;
  opacity: 1;
  transition: transform 0.2s ease, color var(--transition-fast);
}

/* Practice Controls Row */
.practice-controls-row {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  padding-bottom: var(--space-4);
}

.ctrl-group {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}

#ctrl-speaking-active {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
}

#ctrl-speaking-active .action-btn {
  min-width: 120px;
}

.record-mic-option {
  display: flex;
  justify-content: center;
  padding-top: var(--space-2);
}

.clean-checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
  opacity: 1;
}

.clean-checkbox-label input {
  accent-color: var(--accent);
}

/* Research Notes Area */
.research-notes-container {
  width: 100%;
  max-width: 700px;
  margin: var(--space-3) auto 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.research-notes-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.research-notes-label {
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  opacity: 1;
}

.research-notes-status {
  font-size: 0.8125rem;
  color: var(--status-ready);
  font-weight: 500;
  opacity: 1;
}

.clean-textarea {
  width: 100%;
  min-height: 110px;
  max-height: 220px;
  background-color: var(--bg-button);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  line-height: 1.55;
  padding: var(--space-3) var(--space-4);
  resize: vertical;
  outline: none;
  transition: border-color var(--transition-fast);
  opacity: 1;
}

.clean-textarea:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 2px var(--accent-subtle);
}

.clean-textarea::placeholder {
  color: var(--text-dim);
  opacity: 1;
}

/* --------------------------------------------------------------------------
   8. Countdown & Completion Modals
   -------------------------------------------------------------------------- */
.countdown-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
}

.countdown-backdrop {
  position: absolute;
  inset: 0;
  background-color: rgba(10, 15, 12, 0.9);
  backdrop-filter: blur(8px);
}

.countdown-center-content {
  position: relative;
  z-index: 101;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
}

.countdown-serif-digit {
  font-family: var(--font-serif);
  font-size: 6.5rem;
  font-weight: 400;
  color: var(--text-primary);
  line-height: 1;
  opacity: 1;
}

.countdown-label {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
  opacity: 1;
}

/* --------------------------------------------------------------------------
   Completion Screen (Desktop & Base)
   -------------------------------------------------------------------------- */
#modal-completion .cinematic-modal-card {
  max-width: 560px;
  width: 100%;
  padding: 32px 34px 28px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.85);
  display: flex;
  flex-direction: column;
  overflow: visible;
  box-sizing: border-box;
}

#modal-completion .modal-top {
  position: static;
  padding: 0;
  margin-bottom: 18px;
  border-bottom: none;
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  width: 100%;
}

#modal-completion .modal-kicker {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--accent);
  text-transform: uppercase;
  display: block;
  line-height: 1;
}

#modal-completion .modal-heading {
  font-family: var(--font-sans);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
  margin: 0;
}

.completion-topic-quote {
  padding: 16px 20px;
  background-color: var(--bg-surface-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 18px;
  width: 100%;
  box-sizing: border-box;
}

.quote-sublabel {
  font-size: 0.6875rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  display: block;
  margin-bottom: 6px;
  opacity: 1;
}

.quote-text {
  font-family: var(--font-serif);
  font-size: 1.1875rem;
  color: var(--text-primary);
  line-height: 1.45;
  word-break: break-word;
  opacity: 1;
  margin: 0;
}

.completion-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 22px;
  width: 100%;
  box-sizing: border-box;
}

.metric-box {
  background-color: var(--bg-button);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 10px;
  text-align: center;
  min-width: 0;
  box-sizing: border-box;
  opacity: 1;
}

.metric-label {
  font-size: 0.6875rem;
  color: var(--text-secondary);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: block;
  margin-bottom: 4px;
  opacity: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.metric-val {
  font-family: var(--font-mono);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  display: block;
  opacity: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.audio-playback-box {
  margin-bottom: 18px;
  padding: 12px 16px;
  background-color: var(--bg-surface-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  width: 100%;
  box-sizing: border-box;
}

.audio-playback-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  display: block;
  margin-bottom: 6px;
}

.clean-audio-player {
  width: 100%;
  height: 38px;
}

.completion-actions-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  width: 100%;
  margin-top: 0;
  box-sizing: border-box;
}

#modal-completion .action-btn {
  height: 48px;
  min-height: 48px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  font-size: 0.9375rem;
  font-weight: 600;
  white-space: nowrap;
  width: 100%;
  box-sizing: border-box;
}

/* --------------------------------------------------------------------------
   9. Activity & Records Dashboard Modal
   -------------------------------------------------------------------------- */
.dashboard-modal-card {
  max-width: 700px;
  width: 100%;
}

.dashboard-hero-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-3);
  padding: var(--space-4) var(--space-6) var(--space-3);
}

.dash-metric-tile {
  background-color: var(--bg-button);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: var(--space-3) var(--space-2);
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 4px;
  opacity: 1;
}

.dash-tile-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-weight: 700;
  opacity: 1;
}

.dash-tile-val {
  font-family: var(--font-mono);
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--text-primary);
  opacity: 1;
}

.dashboard-nav-tabs {
  display: flex;
  gap: 8px;
  padding: 0 var(--space-6);
  border-bottom: 1px solid var(--border);
  background-color: var(--bg-surface);
}

.tab-label-short {
  display: none;
}

.tab-label-full {
  display: inline;
}

.dash-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background-color: var(--bg-button);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  color: var(--text-nav);
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  opacity: 1;
}

.dash-tab-btn svg {
  opacity: 1;
  stroke: currentColor;
}

.dash-tab-btn:hover {
  color: var(--text-primary);
  background-color: var(--bg-surface-hover);
  border-color: var(--border-hover);
}

.dash-tab-btn.active {
  color: var(--text-primary);
  background-color: var(--bg-surface-hover);
  border-color: var(--border);
  border-bottom: 2px solid var(--accent);
  font-weight: 700;
}

.dash-tab-btn.active svg {
  color: var(--accent);
}

.dash-tab-body {
  min-height: 280px;
  max-height: 55vh;
}

.dash-pane {
  animation: fadeIn 0.2s ease;
}

.dash-section-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-3);
}

.dash-section-header {
  margin-bottom: var(--space-3);
}

.dash-section-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-primary);
  opacity: 1;
}

.dash-section-sub {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  display: block;
  margin-top: 2px;
  opacity: 1;
}

.category-breakdown-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.category-bar-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.category-bar-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  font-weight: 600;
  opacity: 1;
}

.category-bar-track {
  height: 6px;
  background-color: #26332B;
  border-radius: var(--radius-full);
  overflow: hidden;
  opacity: 1;
}

.category-bar-fill {
  height: 100%;
  background-color: var(--accent);
  border-radius: var(--radius-full);
  opacity: 1;
}

.item-list-container {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  max-height: 340px;
  overflow-y: auto;
}

.list-item-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background-color: var(--bg-button);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  opacity: 1;
}

.list-item-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 0;
}

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

.list-item-title {
  font-size: 0.875rem;
  color: var(--text-primary);
  font-weight: 600;
  line-height: 1.35;
  opacity: 1;
}

.list-item-meta {
  font-size: 0.75rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  opacity: 1;
}

/* Badges for Categories & Difficulties */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  border-radius: var(--radius-full);
  text-transform: capitalize;
  line-height: 1.2;
  opacity: 1;
}

.badge-easy {
  background-color: rgba(72, 187, 120, 0.22);
  color: #7CE6A7;
  border: 1px solid rgba(124, 230, 167, 0.45);
}

.badge-medium {
  background-color: rgba(237, 137, 54, 0.22);
  color: #F8BC70;
  border: 1px solid rgba(248, 188, 112, 0.45);
}

.badge-hard {
  background-color: rgba(245, 101, 101, 0.22);
  color: #FA9595;
  border: 1px solid rgba(250, 149, 149, 0.45);
}

/* General Action Buttons in Modals */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-sans);
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  border: 1px solid var(--border);
  text-decoration: none;
  opacity: 1;
}

.btn-sm {
  height: 32px;
  padding: 0 12px;
  font-size: 0.75rem;
}

.btn-primary {
  background-color: var(--accent);
  color: #101713;
  border-color: var(--accent);
}

.btn-primary:hover {
  background-color: var(--accent-hover);
  border-color: var(--accent-hover);
}

.btn-secondary {
  background-color: var(--bg-button);
  color: var(--text-button);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background-color: var(--bg-button-hover);
  border-color: var(--border-hover);
  color: var(--text-primary);
}

.btn-outline {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.btn-outline:hover {
  color: #FC8181;
  border-color: rgba(252, 129, 129, 0.5);
  background-color: rgba(252, 129, 129, 0.12);
}

.empty-state {
  text-align: center;
  padding: var(--space-8) var(--space-4);
  color: var(--text-secondary);
  font-size: 0.875rem;
  line-height: 1.5;
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  background-color: var(--bg-surface);
  opacity: 1;
}

.empty-state.minimal-empty-state {
  border: none;
  background: transparent;
  padding: var(--space-6) var(--space-4);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 4px;
}

.empty-state-star,
.empty-state-icon {
  font-size: 1.5rem;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 6px;
  display: block;
  opacity: 0.9;
}

.empty-state-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.35;
}

.empty-state-sub {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  max-width: 280px;
  line-height: 1.4;
  margin: 0;
}

.btn-clear-link {
  background: transparent;
  border: none;
  font-size: 0.8125rem;
  color: #E06C75;
  cursor: pointer;
  padding: 2px 6px;
  font-weight: 600;
  opacity: 1;
}

.btn-clear-link:hover {
  text-decoration: underline;
  color: #FC8181;
}

/* Stats / List Modals */
.stats-metric-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.stats-subheading {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  margin-bottom: var(--space-3);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Body Scroll Lock when Modal or Mobile Nav is open */
body.modal-open {
  overflow: hidden !important;
  touch-action: none;
}

/* Modal Bottom Sheet Slide Up Animation for Mobile */
@keyframes modalSlideUp {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}

/* --------------------------------------------------------------------------
   10. Responsive Design & Accessibility
   -------------------------------------------------------------------------- */

/* Breakpoint: Tablets & Small Desktops (<= 1024px) */
@media (max-width: 1024px) {
  .dashboard-modal-card {
    max-width: 90vw;
  }

  #modal-settings .cinematic-modal-card {
    max-width: 90vw;
  }
}

/* Breakpoint: Tablet Portrait & Mobile Screens (<= 768px) */
@media (max-width: 768px) {
  /* Minimal Navigation Bar on Tablet/Mobile */
  .header-tools {
    display: flex !important;
    align-items: center;
    gap: 8px;
  }

  .header-tools-desktop {
    display: none !important;
  }

  .header-tools-mobile {
    display: none !important;
  }

  .mobile-menu-toggle-btn {
    display: none !important;
  }

  .stage-view,
  .practice-stage,
  .research-stage {
    padding: var(--space-4) var(--space-5);
  }

  /* Mobile Session Header (Preparation, Speaking, Research) */
  .practice-nav {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    width: 100%;
    gap: 8px;
    padding-bottom: var(--space-3);
    min-height: 44px;
  }

  .practice-nav > :first-child {
    justify-self: start;
  }

  .practice-nav > .practice-phase-wrap {
    justify-self: center;
  }

  .practice-nav > :last-child {
    justify-self: end;
  }

  .practice-phase-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-width: 0;
    text-align: center;
  }

  .phase-badge-text {
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.10em;
    padding: 3px 9px;
    border-radius: var(--radius-full);
    white-space: nowrap;
    line-height: 1.2;
  }

  .target-sub-text {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
  }

  .practice-nav .pill-btn {
    height: 36px;
    min-height: 36px;
    padding: 0 10px;
    font-size: 0.8125rem;
    gap: 5px;
    white-space: nowrap;
    flex-shrink: 0;
  }

  .practice-nav .icon-btn {
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
    padding: 0;
    flex-shrink: 0;
  }

  .topic-serif-display {
    font-size: clamp(1.75rem, 6.5vw, 2.5rem);
  }

  .stage-actions {
    flex-direction: column;
    width: 100%;
  }

  .stage-actions .action-btn {
    width: 100%;
  }

  .filter-controls-row {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    align-items: flex-end;
    gap: 8px;
    width: 100%;
    max-width: 100%;
  }

  .filter-group {
    min-width: 0;
    width: 100%;
    flex: unset;
  }

  .filter-select-wrap {
    min-width: 100%;
    width: 100%;
  }

  .star-group {
    width: auto;
    flex: unset;
  }

  .completion-metrics,
  .stats-metric-strip {
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
  }

  /* Dashboard on Tablet */
  .dashboard-modal-card {
    max-width: 94vw;
  }

  .dashboard-hero-strip {
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    padding: 14px 18px 10px;
  }

  .dashboard-nav-tabs {
    padding: 0 16px;
    gap: 8px;
    display: flex;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    flex-wrap: nowrap;
  }

  .dashboard-nav-tabs::-webkit-scrollbar {
    display: none;
  }

  .tab-label-short {
    display: none;
  }

  .tab-label-full {
    display: inline;
  }

  .dash-tab-btn {
    padding: 10px 14px;
    min-height: 44px;
    font-size: 0.8125rem;
    white-space: nowrap;
    flex-shrink: 0;
  }

  .dash-tab-body {
    padding: 16px;
    min-height: 240px;
  }

  .item-list-container {
    max-height: none;
    overflow-y: visible;
  }
}

/* Breakpoint: Mobile Devices (<= 640px) */
@media (max-width: 640px) {
  /* Modals as Responsive Bottom Sheets (Settings, Stats, Saved, History) */
  #modal-settings,
  #modal-stats,
  #modal-favorites,
  #modal-history {
    align-items: flex-end;
    padding: 0;
  }

  #modal-settings .cinematic-modal-card,
  #modal-stats .cinematic-modal-card,
  #modal-favorites .cinematic-modal-card,
  #modal-history .cinematic-modal-card {
    width: 100%;
    max-width: 100%;
    max-height: 94dvh;
    border-radius: 20px 20px 0 0;
    margin: 0;
    border-bottom: none;
    animation: modalSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  }

  /* Centered Viewport Modals (Session Complete & Streak/Progress) */
  #modal-completion,
  #modal-streak-progress,
  #modal-dashboard {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
  }

  /* ----------------------------------------------------
     Session Complete Screen Mobile (Centered in Viewport)
     ---------------------------------------------------- */
  #modal-completion .cinematic-modal-card {
    background-color: var(--bg-surface);
    width: min(100% - 32px, 520px);
    max-height: calc(100dvh - 32px);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    margin: auto;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    padding: 22px 20px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.85);
    animation: modalScale 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  }

  #modal-completion .modal-top {
    position: static;
    padding: 0 0 14px 0;
    border-bottom: none;
    background: transparent;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    width: 100%;
  }

  #modal-completion .modal-kicker {
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--accent);
    text-transform: uppercase;
    display: block;
  }

  #modal-completion .modal-heading {
    font-size: clamp(1.35rem, 5.5vw, 1.6rem);
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.25;
    margin: 0;
  }

  #modal-completion .completion-topic-quote {
    margin: 0 0 14px 0;
    padding: 14px 16px;
    background-color: var(--bg-surface-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    width: 100%;
  }

  #modal-completion .quote-sublabel {
    font-size: 0.6875rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
    display: block;
    margin-bottom: 4px;
  }

  #modal-completion .quote-text {
    font-family: var(--font-serif);
    font-size: clamp(1rem, 4.2vw, 1.15rem);
    color: var(--text-primary);
    line-height: 1.4;
    word-break: break-word;
  }

  #modal-completion .completion-metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin: 0 0 16px 0;
    width: 100%;
  }

  #modal-completion .metric-box {
    background-color: var(--bg-button);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 8px 4px;
    text-align: center;
    min-width: 0;
  }

  #modal-completion .metric-label {
    font-size: clamp(0.5625rem, 2.4vw, 0.65rem);
    color: var(--text-secondary);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  #modal-completion .metric-val {
    font-family: var(--font-mono);
    font-size: clamp(1rem, 4vw, 1.15rem);
    font-weight: 700;
    color: var(--text-primary);
    margin-top: 3px;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* Completion Action Buttons (3 equal columns, consistent heights & typography) */
  #modal-completion .completion-actions-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    width: 100%;
    margin-top: 8px;
  }

  #modal-completion #btn-practice-again,
  #modal-completion #btn-try-another-topic,
  #modal-completion #btn-return-home {
    grid-column: auto;
    width: 100%;
    height: 44px;
    min-height: 44px;
    white-space: nowrap;
    justify-content: center;
    padding: 0 8px;
    font-size: 0.8125rem;
    font-weight: 600;
    box-sizing: border-box;
  }

  /* ----------------------------------------------------
     Streak & Progress Mobile (Centered with Clean Structure)
     ---------------------------------------------------- */
  #modal-streak-progress .cinematic-modal-card,
  #modal-streak-progress .streak-progress-modal-card {
    width: min(100% - 32px, 680px);
    max-height: calc(100dvh - 32px);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    margin: auto;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.85);
    animation: modalScale 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  }

  #modal-streak-progress .streak-modal-header {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    background-color: var(--bg-surface);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 10;
    gap: 12px;
  }

  #modal-streak-progress .streak-modal-body {
    padding: 18px 16px 28px;
    gap: 22px;
  }

  .weekly-tracker-grid {
    gap: 5px;
  }

  .weekly-day-col {
    padding: 8px 2px;
    gap: 4px;
  }

  .weekly-day-indicator {
    width: 20px;
    height: 20px;
    font-size: 0.7rem;
  }

  .activity-stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .activity-stat-tile {
    padding: 10px 12px;
  }

  .streak-records-list .list-item-card,
  .streak-saved-list .list-item-card {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 12px 2px;
  }

  .streak-records-list .list-item-actions,
  .streak-saved-list .list-item-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 4px;
  }

  .streak-records-list .list-item-actions .btn,
  .streak-saved-list .list-item-actions .btn {
    height: 36px;
    min-height: 36px;
    padding: 0 14px;
    font-size: 0.8125rem;
    font-weight: 600;
  }

  .streak-saved-list .list-item-actions .btn-remove-fav {
    width: 36px;
    min-width: 36px;
    height: 36px;
    min-height: 36px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .modal-top {
    padding: 14px 16px;
    position: sticky;
    top: 0;
    background-color: var(--bg-surface);
    z-index: 10;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
  }

  .modal-top > div {
    min-width: 0;
    flex: 1;
  }

  .modal-kicker {
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    line-height: 1.25;
    color: var(--accent);
    display: block;
    text-transform: uppercase;
  }

  .modal-heading {
    font-size: clamp(1.125rem, 5vw, 1.35rem);
    line-height: 1.25;
    margin: 0;
  }

  .modal-scroll-body {
    padding: 16px;
  }

  .modal-bottom-actions {
    padding: 12px 16px;
    position: sticky;
    bottom: 0;
    z-index: 10;
    background-color: var(--bg-surface);
  }

  /* Responsive Dashboard Hero Strip (2-columns on standard mobile) */
  .dashboard-hero-strip {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    padding: 12px 16px 8px;
  }

  .dash-metric-tile {
    padding: 10px 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 4px;
    min-width: 0;
    background-color: var(--bg-button);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
  }

  .dash-tile-label {
    font-size: 0.6875rem;
    letter-spacing: 0.04em;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
  }

  .dash-tile-val {
    font-family: var(--font-mono);
    font-size: clamp(1.125rem, 4.5vw, 1.35rem);
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
  }

  /* Dashboard Navigation Tabs: Responsive 3-column equal grid */
  .tab-label-full {
    display: none;
  }

  .tab-label-short {
    display: inline;
  }

  .dashboard-nav-tabs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    padding: 0 12px;
    border-bottom: 1px solid var(--border);
    background-color: var(--bg-surface);
    overflow-x: visible;
  }

  .dash-tab-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 4px;
    min-height: 44px;
    font-size: 0.8125rem;
    font-weight: 600;
    gap: 6px;
    text-align: center;
    white-space: nowrap;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  }

  .dash-tab-btn svg {
    flex-shrink: 0;
    width: 14px;
    height: 14px;
  }

  .dash-tab-body {
    padding: 16px;
    max-height: calc(94dvh - 210px);
    overscroll-behavior: contain;
  }

  /* Tab 1: Category Breakdown Cards & Responsive Progress Bars */
  .category-breakdown-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .category-bar-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 10px 12px;
    background-color: var(--bg-button);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    min-width: 0;
  }

  .category-bar-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    font-size: 0.8125rem;
    color: var(--text-primary);
    min-width: 0;
  }

  .category-bar-info span:first-child {
    font-weight: 600;
    color: var(--text-primary);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .category-bar-info span:last-child {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--accent);
    font-weight: 600;
    flex-shrink: 0;
    white-space: nowrap;
  }

  .category-bar-track {
    height: 8px;
    background-color: rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-full);
    overflow: hidden;
    width: 100%;
  }

  .category-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent) 0%, #E69D70 100%);
    border-radius: var(--radius-full);
    transition: width 0.3s ease;
  }

  /* Tab 2: Session History Header Row & Clear Link */
  .dash-section-header-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
  }

  .dash-section-header-row > div {
    min-width: 0;
    flex: 1;
  }

  .dash-section-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
  }

  .dash-section-sub {
    font-size: 0.75rem;
    color: var(--text-secondary);
    display: block;
    margin-top: 2px;
    line-height: 1.3;
  }

  .btn-clear-link {
    font-size: 0.75rem;
    font-weight: 600;
    color: #FA9595;
    background: rgba(245, 101, 101, 0.12);
    border: 1px solid rgba(245, 101, 101, 0.28);
    border-radius: var(--radius-sm);
    padding: 6px 12px;
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: all var(--transition-fast);
  }

  .btn-clear-link:hover {
    background: rgba(245, 101, 101, 0.22);
    border-color: rgba(245, 101, 101, 0.45);
    color: #FFB3B3;
  }

  /* Dashboard History & Saved Topics Cards: Stacked Touch-Friendly Layout */
  .list-item-card {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 12px;
    min-width: 0;
  }

  .list-item-content {
    width: 100%;
    min-width: 0;
  }

  .list-item-title {
    font-size: 0.875rem;
    line-height: 1.4;
    word-break: break-word;
    overflow-wrap: break-word;
  }

  .list-item-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 0.75rem;
    align-items: center;
    line-height: 1.4;
  }

  .list-item-actions {
    width: 100%;
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 4px;
  }

  .list-item-actions .btn {
    min-height: 44px;
    padding: 0 16px;
    font-size: 0.8125rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .list-item-actions .btn-primary,
  .list-item-actions .btn-practice-history,
  .list-item-actions .btn-practice-fav {
    flex: 1;
  }

  .list-item-actions .btn-remove-fav {
    width: 44px;
    min-width: 44px;
    flex-shrink: 0;
  }

  /* Speaking Active Timer Controls Responsive Alignment */
  #ctrl-speaking-active {
    display: flex;
    width: 100%;
    max-width: 440px;
    justify-content: center;
    gap: 10px;
    margin: 0 auto;
  }

  #ctrl-speaking-active .action-btn {
    flex: 1 1 0;
    min-width: 0;
    padding: 0 12px;
    height: 46px;
    font-size: 0.875rem;
    gap: 6px;
  }
}

/* Breakpoint: Small Mobile Devices (<= 480px) */
@media (max-width: 480px) {
  #modal-settings .cinematic-modal-card,
  #modal-stats .cinematic-modal-card,
  #modal-favorites .cinematic-modal-card,
  #modal-history .cinematic-modal-card {
    max-height: 96dvh;
    border-radius: 16px 16px 0 0;
  }

  #modal-completion,
  #modal-streak-progress,
  #modal-dashboard {
    padding: 12px;
  }

  #modal-completion .cinematic-modal-card {
    width: min(100% - 24px, 520px);
    max-height: calc(100dvh - 24px);
    padding: 20px 16px;
  }

  #modal-streak-progress .cinematic-modal-card,
  #modal-streak-progress .streak-progress-modal-card {
    width: min(100% - 24px, 680px);
    max-height: calc(100dvh - 24px);
  }

  .dash-tab-body {
    max-height: calc(96dvh - 210px);
  }

  .dashboard-hero-strip {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    padding: 10px 14px 6px;
  }

  .dash-metric-tile {
    padding: 8px 6px;
  }

  .dash-tile-label {
    font-size: 0.6875rem;
    letter-spacing: 0.03em;
  }

  .dash-tile-val {
    font-size: clamp(1.125rem, 4.5vw, 1.25rem);
  }

  /* Daily Flyout Mobile */
  .daily-flyout {
    width: calc(100% - 24px);
    max-width: calc(100vw - 24px);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    bottom: 12px;
  }

  .daily-flyout-text {
    white-space: normal;
    max-width: 100%;
    line-height: 1.35;
  }

  #btn-practice-daily {
    width: 100%;
    height: 44px;
    min-height: 44px;
    justify-content: center;
  }

  /* Settings Presets & Sliders */
  .segmented-pills {
    grid-template-columns: repeat(auto-fit, minmax(46px, 1fr));
    gap: 6px;
  }

  .prep-preset-btn,
  .speaking-preset-btn,
  .research-preset-btn {
    min-height: 44px;
    padding: 0 6px;
    font-size: 0.8125rem;
  }

  .setting-title-row {
    gap: 8px;
  }

  .setting-title {
    font-size: 0.9375rem;
  }

  .setting-subtext {
    font-size: 0.75rem;
    line-height: 1.3;
  }

  .practice-stage,
  .research-stage {
    padding: var(--space-3) var(--space-4);
  }

  .practice-topic-area {
    padding: var(--space-2) 0;
    gap: var(--space-2);
  }

  .practice-topic-heading {
    font-size: clamp(1.25rem, 5.5vw, 1.625rem);
  }

  .timer-dial-container {
    width: clamp(230px, min(72vw, 42vh), 270px);
    height: clamp(230px, min(72vw, 42vh), 270px);
  }

  .dial-digits {
    font-size: clamp(2rem, 7vw, 2.5rem);
  }

  .dial-phase-label {
    padding-bottom: 6px;
  }

  .dial-encouragement {
    padding-top: 6px;
    font-size: 0.75rem;
  }

  #ctrl-speaking-active {
    max-width: 380px;
    gap: 8px;
  }

  #ctrl-speaking-active .action-btn {
    padding: 0 8px;
    height: 44px;
    font-size: 0.8125rem;
    gap: 6px;
  }
}

/* Breakpoint: Extra Narrow Mobile (<= 360px: 320px - 360px) */
@media (max-width: 360px) {
  .practice-stage,
  .research-stage {
    padding: var(--space-3) 10px;
  }

  .practice-nav {
    gap: 4px;
    padding-bottom: var(--space-2);
  }

  .practice-nav .pill-btn {
    height: 34px;
    min-height: 34px;
    padding: 0 7px;
    font-size: 0.75rem;
    gap: 4px;
  }

  .practice-nav .icon-btn {
    width: 34px;
    height: 34px;
    min-width: 34px;
    min-height: 34px;
  }

  .phase-badge-text {
    font-size: 0.625rem;
    letter-spacing: 0.08em;
    padding: 2px 7px;
  }

  .target-sub-text {
    font-size: 0.6875rem;
  }

  .mobile-nav-drawer {
    width: 100vw;
    border-left: none;
  }

  .segmented-pills {
    grid-template-columns: repeat(3, 1fr);
  }

  .modal-top {
    padding: 12px;
  }

  .modal-kicker {
    font-size: 0.625rem;
    letter-spacing: 0.04em;
  }

  .modal-heading {
    font-size: 1.0625rem;
  }

  .modal-scroll-body {
    padding: 12px;
  }

  .dash-tab-body {
    padding: 12px;
  }

  .modal-bottom-actions {
    padding: 10px 12px;
  }

  .category-bar-info {
    font-size: 0.75rem;
  }

  .dash-section-header-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .btn-clear-link {
    align-self: flex-start;
  }

  /* Completion screen micro-adjustments for <= 360px */
  #modal-completion .completion-metrics {
    gap: 4px;
  }

  #modal-completion .metric-box {
    padding: 8px 4px;
  }

  #modal-completion .metric-label {
    font-size: 0.625rem;
  }

  #modal-completion .metric-val {
    font-size: 0.9375rem;
  }

  #modal-completion .completion-actions-row {
    gap: 6px;
  }

  #modal-completion #btn-practice-again,
  #modal-completion #btn-try-another-topic,
  #modal-completion #btn-return-home {
    font-size: 0.75rem;
    padding: 0 4px;
    height: 44px;
  }

  /* Streak & Progress micro-adjustments for <= 360px */
  #modal-streak-progress .cinematic-modal-card,
  #modal-streak-progress .streak-progress-modal-card {
    width: min(100% - 20px, 680px);
    max-height: calc(100dvh - 20px);
  }

  .weekly-tracker-grid {
    gap: 3px;
  }

  .weekly-day-col {
    padding: 6px 1px;
  }
}

/* Breakpoint: Narrow Mobile (<= 350px: e.g. 320px) - Single-Column Statistics */
@media (max-width: 350px) {
  #modal-completion .cinematic-modal-card {
    padding: 16px 12px;
  }
  #modal-completion .completion-actions-row {
    gap: 4px;
  }
  #modal-completion #btn-practice-again,
  #modal-completion #btn-try-another-topic,
  #modal-completion #btn-return-home {
    font-size: 0.7rem;
    padding: 0 2px;
    letter-spacing: -0.01em;
  }
  .activity-stats-grid {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .dashboard-hero-strip {
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 8px 12px 6px;
  }

  .dash-metric-tile {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    gap: 10px;
    text-align: left;
  }

  .dash-tile-label {
    font-size: 0.75rem;
    text-align: left;
    white-space: normal;
    max-width: none;
  }

  .dash-tile-val {
    font-size: 1.125rem;
    text-align: right;
    flex-shrink: 0;
    max-width: none;
  }

  .dash-tab-btn {
    font-size: 0.75rem;
    padding: 8px 2px;
    gap: 4px;
  }

  .dash-tab-btn svg {
    width: 12px;
    height: 12px;
  }

  #ctrl-speaking-active {
    gap: 6px;
  }

  #ctrl-speaking-active .action-btn {
    padding: 0 4px;
    font-size: 0.75rem;
    gap: 4px;
  }

  #ctrl-speaking-active .action-btn svg {
    width: 12px;
    height: 12px;
  }
}

@media (max-height: 650px) {
  .practice-stage,
  .research-stage {
    padding: var(--space-2) var(--space-4);
  }

  .practice-topic-area {
    padding: 4px 0;
    gap: 4px;
  }

  .practice-topic-heading {
    font-size: 1.25rem;
  }

  .timer-dial-container {
    width: clamp(200px, 36vh, 240px);
    height: clamp(200px, 36vh, 240px);
  }

  .dial-digits {
    font-size: 2rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
