/* 
  Abang Danial - Malay Tutor Design System v1.0
  Kid-friendly, warm, mobile-first responsive palette
  Primary Colors: Coral (#FF7A59), Sunshine (#FFC857), Teal (#2EC4B6), Cream (#FFF8EC), Dark Text (#2B2D42)
  Zero external CDN or Google Fonts dependencies.
*/

:root {
  --color-coral: #FF7A59;
  --color-coral-dark: #E25D3B;
  --color-coral-soft: #FFEAE4;
  --color-sunshine: #FFC857;
  --color-sunshine-soft: #FFF8E7;
  --color-teal: #2EC4B6;
  --color-teal-dark: #20998E;
  --color-teal-soft: #E6F9F7;
  --color-cream: #FFF8EC;
  --color-white: #FFFFFF;
  --color-text-main: #2B2D42;
  --color-text-muted: #64748B;
  --color-text-subtle: #8D99AE;
  --color-border: rgba(43, 45, 66, 0.10);
  --color-border-card: rgba(43, 45, 66, 0.08);

  --font-system-rounded: system-ui, -apple-system, "Segoe UI", Roboto, "Quicksand", "Comic Sans MS", "Comfortaa", sans-serif;
  --radius-card: 24px;
  --radius-pill: 9999px;
  --radius-button: 16px;

  --shadow-sm: 0 2px 8px rgba(43, 45, 66, 0.04);
  --shadow-card: 0 10px 30px rgba(255, 122, 89, 0.08), 0 2px 8px rgba(43, 45, 66, 0.04);
  --shadow-hover: 0 14px 34px rgba(255, 122, 89, 0.16), 0 4px 12px rgba(43, 45, 66, 0.06);

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
}

/* Dark Scheme Support */
@media (prefers-color-scheme: dark) {
  :root {
    --color-cream: #1A1B26;
    --color-white: #24283B;
    --color-text-main: #F8FAFC;
    --color-text-muted: #CBD5E1;
    --color-text-subtle: #94A3B8;
    --color-border: rgba(255, 255, 255, 0.12);
    --color-border-card: rgba(255, 255, 255, 0.08);
    --color-coral-soft: rgba(255, 122, 89, 0.18);
    --color-sunshine-soft: rgba(255, 200, 87, 0.15);
    --color-teal-soft: rgba(46, 196, 182, 0.18);
    --shadow-card: 0 10px 30px rgba(0, 0, 0, 0.25);
  }
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-system-rounded);
  background-color: var(--color-cream);
  color: var(--color-text-main);
  min-height: 100vh;
  min-height: -webkit-fill-available;
  display: flex;
  flex-direction: column;
  line-height: 1.5;
  font-size: 15px; /* Minimum >= 14px rule */
  -webkit-font-smoothing: antialiased;
  padding-left: var(--safe-left);
  padding-right: var(--safe-right);
}

/* Focus styles for keyboard accessibility */
button:focus-visible,
input:focus-visible,
.bubble-text:focus-visible {
  outline: 3px solid var(--color-teal);
  outline-offset: 2px;
}

/* ══════════════════════════════════════════════════════════════
   1. App Header & Version Pill
   ══════════════════════════════════════════════════════════════ */
.app-header {
  background: var(--color-white);
  border-bottom: 1px solid var(--color-border);
  padding: max(12px, var(--safe-top)) 20px 12px 20px;
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
}

.brand-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-avatar {
  width: 48px;
  height: 48px;
  position: relative;
  flex-shrink: 0;
}

.avatar-svg {
  width: 100%;
  height: 100%;
  border-radius: var(--radius-pill);
  box-shadow: 0 2px 6px rgba(255, 200, 87, 0.35);
}

.online-indicator {
  position: absolute;
  bottom: 1px;
  right: 1px;
  width: 13px;
  height: 13px;
  background-color: var(--color-teal);
  border: 2px solid var(--color-white);
  border-radius: var(--radius-pill);
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.title-row h1 {
  font-size: 19px;
  font-weight: 800;
  color: var(--color-text-main);
  letter-spacing: -0.3px;
}

.version-pill {
  font-size: 14px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background-color: var(--color-coral-soft);
  color: var(--color-coral);
  border: 1px solid var(--color-coral);
  display: inline-block;
}

.tagline {
  font-size: 14px;
  color: var(--color-text-muted);
  font-weight: 500;
}

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

.btn-icon {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--color-border);
  background: var(--color-white);
  color: var(--color-text-main);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, background 0.15s ease;
}

.btn-icon:hover {
  background: var(--color-sunshine-soft);
  transform: scale(1.05);
}

.btn-auth {
  height: 44px;
  min-height: 44px;
  padding: 0 16px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--color-border);
  background: var(--color-white);
  color: var(--color-text-main);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn-auth:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-hover);
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--color-sunshine-soft);
  padding: 4px 12px 4px 6px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 200, 87, 0.4);
  font-size: 14px;
  font-weight: 600;
}

.user-chip-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-pill);
  object-fit: cover;
}

.user-chip-fallback {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.btn-signout {
  width: 24px;
  height: 24px;
  min-width: 24px;
  border-radius: var(--radius-pill);
  border: none;
  background: rgba(43, 45, 66, 0.1);
  color: var(--color-text-main);
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Alert Banner */
.alert-banner {
  padding: 10px 20px;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
}

.alert-banner.info {
  background-color: var(--color-teal-soft);
  color: var(--color-teal-dark);
}

.alert-banner.error {
  background-color: var(--color-coral-soft);
  color: var(--color-coral-dark);
}

.alert-banner.success {
  background-color: var(--color-sunshine-soft);
  color: #B45309;
}

/* ══════════════════════════════════════════════════════════════
   2. Main Layout Container
   ══════════════════════════════════════════════════════════════ */
.app-main {
  flex: 1;
  max-width: 760px;
  width: 100%;
  margin: 0 auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ══════════════════════════════════════════════════════════════
   3. Telemetry & Circular 15-Minute Timer Bar
   ══════════════════════════════════════════════════════════════ */
.session-tracker-card {
  background: var(--color-white);
  border-radius: var(--radius-card);
  padding: 16px 20px;
  border: 1px solid var(--color-border-card);
  box-shadow: var(--shadow-card);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.tracker-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.timer-dial-wrap {
  position: relative;
  width: 76px;
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.timer-svg {
  transform: rotate(-90deg);
  width: 76px;
  height: 76px;
}

.timer-bg {
  fill: none;
  stroke: var(--color-border);
  stroke-width: 8;
}

.timer-progress {
  fill: none;
  stroke: var(--color-coral);
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 263.89;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 0.8s linear, stroke 0.3s ease;
}

.timer-content {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.timer-digits {
  font-size: 16px;
  font-weight: 800;
  color: var(--color-text-main);
  line-height: 1;
}

.timer-unit {
  font-size: 14px;
  color: var(--color-text-subtle);
  font-weight: 600;
}

.phase-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.phase-badge {
  font-size: 15px;
  font-weight: 700;
  color: var(--color-coral);
}

.student-meta {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-muted);
}

.tracker-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.streak-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--color-coral-soft);
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  font-size: 14px;
  font-weight: 700;
  color: var(--color-coral);
}

.btn-subtle {
  background: transparent;
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 6px 12px;
  min-height: 44px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.btn-subtle:hover {
  background: var(--color-border);
  color: var(--color-text-main);
}

/* ══════════════════════════════════════════════════════════════
   4. Chat Feed & Interactive Blur/Gloss Bubbles
   ══════════════════════════════════════════════════════════════ */
.chat-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 280px;
}

.chat-feed {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
  padding: 8px 4px;
  max-height: 48vh;
  scroll-behavior: smooth;
}

.chat-bubble {
  max-width: 88%;
  border-radius: var(--radius-card);
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease;
}

/* Tutor Bubble (Left aligned, warm white/teal tone) */
.tutor-bubble {
  align-self: flex-start;
  background: var(--color-white);
  border: 1px solid var(--color-border-card);
  border-bottom-left-radius: 6px;
}

/* Kid Bubble (Right aligned, coral/sunshine gradient) */
.kid-bubble {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--color-coral-soft), var(--color-sunshine-soft));
  border: 1px solid rgba(255, 122, 89, 0.2);
  border-bottom-right-radius: 6px;
}

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

.speaker-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--color-teal-dark);
}

.kid-bubble .speaker-name {
  color: var(--color-coral-dark);
}

.bubble-tag {
  font-size: 14px;
  color: var(--color-text-subtle);
  font-weight: 500;
}

.btn-bubble-audio {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border-radius: var(--radius-pill);
  border: none;
  background: var(--color-teal-soft);
  color: var(--color-teal-dark);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease;
}

.btn-bubble-audio:hover {
  transform: scale(1.1);
}

.bubble-text {
  font-size: 17px;
  line-height: 1.5;
  color: var(--color-text-main);
  font-weight: 500;
}

/* Blur-Until-Tapped Subtitles for Tutor */
.bubble-text.blurred-text {
  filter: blur(6px);
  user-select: none;
  cursor: pointer;
  background: var(--color-teal-soft);
  border-radius: 12px;
  padding: 6px 10px;
  transition: filter 0.25s ease, background 0.2s ease;
}

.bubble-text.blurred-text:hover {
  filter: blur(4px);
  background: rgba(46, 196, 182, 0.18);
}

.bubble-text.unblurred-text {
  filter: none;
  cursor: pointer;
}

.tap-hint {
  font-size: 14px;
  color: var(--color-text-subtle);
  font-weight: 600;
  display: block;
}

.gloss-box {
  background: var(--color-sunshine-soft);
  border: 1px dashed var(--color-sunshine);
  border-radius: 12px;
  padding: 8px 12px;
  font-size: 15px;
  color: #B45309;
  font-weight: 500;
  margin-top: 4px;
}

.gloss-label {
  font-weight: 700;
}

/* ══════════════════════════════════════════════════════════════
   5. Rescue Chip & Drawer ("Macam mana nak cakap...?")
   ══════════════════════════════════════════════════════════════ */
.rescue-strip {
  display: flex;
  justify-content: center;
  margin-top: 4px;
}

.rescue-chip {
  background: var(--color-white);
  border: 2px solid var(--color-sunshine);
  color: var(--color-text-main);
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  padding: 10px 20px;
  min-height: 44px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 14px rgba(255, 200, 87, 0.25);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.rescue-chip:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(255, 200, 87, 0.35);
}

.rescue-drawer {
  background: var(--color-white);
  border-radius: var(--radius-card);
  padding: 18px 20px;
  border: 2px solid var(--color-sunshine);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 10px;
  animation: slideDown 0.2s ease-out;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

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

.rescue-header h3 {
  font-size: 16px;
  font-weight: 800;
  color: var(--color-text-main);
}

.rescue-desc {
  font-size: 14px;
  color: var(--color-text-muted);
}

.rescue-form {
  display: flex;
  gap: 10px;
}

.rescue-input {
  flex: 1;
  height: 44px;
  min-height: 44px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--color-border);
  padding: 0 16px;
  font-family: inherit;
  font-size: 15px;
  background: var(--color-cream);
  color: var(--color-text-main);
}

.btn-primary-small {
  height: 44px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: var(--radius-pill);
  border: none;
  background: var(--color-coral);
  color: var(--color-white);
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

/* ══════════════════════════════════════════════════════════════
   6. Control Dock & Voice Orb
   ══════════════════════════════════════════════════════════════ */
.control-dock {
  background: var(--color-white);
  border-radius: var(--radius-card);
  padding: 18px 20px;
  border: 1px solid var(--color-border-card);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.status-indicator-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-pip {
  width: 10px;
  height: 10px;
  border-radius: var(--radius-pill);
  background-color: var(--color-text-subtle);
  transition: background-color 0.2s ease;
}

.status-pip.idle {
  background-color: var(--color-text-subtle);
}

.status-pip.listening {
  background-color: var(--color-coral);
  animation: pulsePip 1.5s infinite;
}

.status-pip.thinking {
  background-color: var(--color-sunshine);
}

.status-pip.speaking {
  background-color: var(--color-teal);
  animation: pulsePip 1.2s infinite;
}

@keyframes pulsePip {
  0% { transform: scale(0.9); opacity: 0.7; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.7; }
}

.status-live-text {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-muted);
}

/* Voice Orb */
.voice-orb-wrapper {
  position: relative;
  width: 100px;
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.orb-waves {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: var(--radius-pill);
  pointer-events: none;
}

.wave {
  position: absolute;
  inset: 0;
  border-radius: var(--radius-pill);
  opacity: 0;
}

/* Wave animations when listening or speaking */
.orb-waves.listening .wave-1 {
  border: 2px solid var(--color-coral);
  animation: waveExpand 1.8s infinite ease-out;
}

.orb-waves.listening .wave-2 {
  border: 2px solid var(--color-coral);
  animation: waveExpand 1.8s 0.6s infinite ease-out;
}

.orb-waves.speaking .wave-1 {
  border: 2px solid var(--color-teal);
  animation: waveExpand 1.5s infinite ease-out;
}

.orb-waves.speaking .wave-2 {
  border: 2px solid var(--color-teal);
  animation: waveExpand 1.5s 0.5s infinite ease-out;
}

@keyframes waveExpand {
  0% { transform: scale(0.85); opacity: 0.8; }
  100% { transform: scale(1.6); opacity: 0; }
}

.voice-orb {
  width: 88px;
  height: 88px;
  min-width: 88px;
  min-height: 88px;
  border-radius: var(--radius-pill);
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-family: inherit;
  box-shadow: 0 8px 24px rgba(255, 122, 89, 0.28);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.3s ease;
  position: relative;
  z-index: 2;
}

.voice-orb:hover {
  transform: scale(1.04);
}

.voice-orb:active {
  transform: scale(0.96);
}

.voice-orb.idle {
  background: var(--color-coral);
  color: var(--color-white);
}

.voice-orb.listening {
  background: linear-gradient(135deg, var(--color-coral), #E25D3B);
  color: var(--color-white);
  box-shadow: 0 0 0 6px var(--color-coral-soft);
}

.voice-orb.thinking {
  background: var(--color-sunshine);
  color: var(--color-text-main);
  box-shadow: 0 0 0 6px var(--color-sunshine-soft);
}

.voice-orb.speaking {
  background: var(--color-teal);
  color: var(--color-white);
  box-shadow: 0 0 0 6px var(--color-teal-soft);
}

.orb-icon {
  width: 28px;
  height: 28px;
}

.orb-text {
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
}

/* Typed Input Fallback */
.typed-form {
  width: 100%;
  display: flex;
  gap: 10px;
}

.text-input {
  flex: 1;
  height: 48px;
  min-height: 48px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--color-border);
  padding: 0 18px;
  font-family: inherit;
  font-size: 15px;
  background: var(--color-cream);
  color: var(--color-text-main);
}

.btn-send {
  height: 48px;
  min-height: 48px;
  padding: 0 20px;
  border-radius: var(--radius-pill);
  border: none;
  background: var(--color-teal);
  color: var(--color-white);
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: background 0.15s ease;
}

.btn-send:hover {
  background: var(--color-teal-dark);
}

/* Dock Actions */
.dock-actions {
  width: 100%;
  display: flex;
  justify-content: center;
}

.btn-report-action {
  height: 44px;
  min-height: 44px;
  padding: 0 20px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--color-border);
  background: transparent;
  color: var(--color-text-muted);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.15s ease;
}

.btn-report-action:hover {
  background: var(--color-sunshine-soft);
  color: var(--color-text-main);
  border-color: var(--color-sunshine);
}

/* ══════════════════════════════════════════════════════════════
   7. Dialogs & Modals (Onboarding, Report, Guest Limit, Quota)
   ══════════════════════════════════════════════════════════════ */
.modal-dialog {
  border: none;
  border-radius: var(--radius-card);
  padding: 0;
  background: transparent;
  max-width: 520px;
  width: 90%;
  margin: auto;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
}

.modal-dialog::backdrop {
  background: rgba(43, 45, 66, 0.45);
  backdrop-filter: blur(4px);
}

.modal-card {
  background: var(--color-white);
  border-radius: var(--radius-card);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-hero {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.hero-avatar-wrap {
  width: 64px;
  height: 64px;
}

.modal-icon-big {
  font-size: 48px;
}

.modal-hero h2 {
  font-size: 22px;
  font-weight: 800;
  color: var(--color-text-main);
}

.modal-hero p {
  font-size: 14px;
  color: var(--color-text-muted);
}

.onboarding-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label,
.group-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--color-text-main);
}

.form-group input[type="text"] {
  height: 48px;
  min-height: 48px;
  border-radius: 14px;
  border: 1px solid var(--color-border);
  padding: 0 16px;
  font-family: inherit;
  font-size: 15px;
  background: var(--color-cream);
  color: var(--color-text-main);
}

/* Level Chips Grid */
.level-chips-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.level-chip {
  cursor: pointer;
}

.level-chip input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.chip-content {
  background: var(--color-cream);
  border: 2px solid var(--color-border);
  border-radius: 16px;
  padding: 10px 8px;
  min-height: 44px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  transition: all 0.15s ease;
}

.chip-grade {
  font-size: 17px;
  font-weight: 800;
  color: var(--color-text-main);
}

.chip-gear {
  font-size: 14px;
  font-weight: 700;
  color: var(--color-coral);
}

.chip-desc {
  font-size: 14px;
  color: var(--color-text-subtle);
}

.level-chip input[type="radio"]:checked + .chip-content {
  border-color: var(--color-coral);
  background: var(--color-coral-soft);
  box-shadow: 0 4px 12px rgba(255, 122, 89, 0.2);
}

/* Tutor Radio Toggle Grid */
.tutor-toggle-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

@media (max-width: 420px) {
  .tutor-toggle-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.tutor-radio-card {
  cursor: pointer;
  position: relative;
  min-width: 0;
}

.tutor-card-inner > div {
  min-width: 0;
  overflow-wrap: anywhere;
}

.tutor-radio-card input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.tutor-card-inner {
  background: var(--color-cream);
  border: 2px solid var(--color-border);
  border-radius: 16px;
  padding: 12px;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.15s ease;
}

.tutor-icon {
  font-size: 28px;
}

.tutor-card-inner strong {
  display: block;
  font-size: 15px;
  color: var(--color-text-main);
}

.tutor-card-inner p {
  font-size: 14px;
  color: var(--color-text-muted);
}

.tutor-radio-card input[type="radio"]:checked + .tutor-card-inner {
  border-color: var(--color-teal);
  background: var(--color-teal-soft);
  box-shadow: 0 4px 12px rgba(46, 196, 182, 0.2);
}

.guest-info-hint {
  font-size: 14px;
  color: var(--color-text-muted);
  background: var(--color-sunshine-soft);
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 200, 87, 0.4);
}

.modal-footer-btns {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn-primary-large {
  height: 52px;
  min-height: 52px;
  border-radius: var(--radius-pill);
  border: none;
  background: var(--color-coral);
  color: var(--color-white);
  font-family: inherit;
  font-size: 17px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(255, 122, 89, 0.35);
  transition: transform 0.15s ease;
}

.btn-primary-large:hover {
  transform: translateY(-1px);
}

.btn-auth-large {
  height: 52px;
  min-height: 52px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--color-border);
  background: var(--color-white);
  color: var(--color-text-main);
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: var(--shadow-sm);
}

.btn-subtle-large {
  height: 48px;
  min-height: 48px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--color-border);
  background: transparent;
  color: var(--color-text-muted);
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

/* ══════════════════════════════════════════════════════════════
   8. Report Card Specifics
   ══════════════════════════════════════════════════════════════ */
.report-header {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.report-icon-star {
  font-size: 38px;
}

.report-header h2 {
  font-size: 22px;
  font-weight: 800;
  color: var(--color-text-main);
}

.report-subtitle {
  font-size: 14px;
  color: var(--color-text-muted);
}

.report-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.stat-box {
  background: var(--color-cream);
  border-radius: 16px;
  padding: 12px;
  text-align: center;
  border: 1px solid var(--color-border);
}

.stat-label {
  font-size: 14px;
  color: var(--color-text-subtle);
  font-weight: 600;
  display: block;
}

.stat-value {
  font-size: 22px;
  font-weight: 800;
  color: var(--color-text-main);
}

.ratio-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ratio-header {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  font-weight: 700;
  color: var(--color-text-main);
}

.ratio-percent {
  color: var(--color-coral);
}

.ratio-bar-track {
  height: 14px;
  background: var(--color-cream);
  border-radius: var(--radius-pill);
  border: 1px solid var(--color-border);
  overflow: hidden;
}

.ratio-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-sunshine), var(--color-coral));
  border-radius: var(--radius-pill);
  transition: width 0.8s ease;
}

.report-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.report-section h3 {
  font-size: 15px;
  font-weight: 800;
  color: var(--color-text-main);
}

.words-list-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.word-card {
  background: var(--color-teal-soft);
  border: 1px solid rgba(46, 196, 182, 0.3);
  border-radius: 14px;
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.word-card strong {
  font-size: 16px;
  color: var(--color-teal-dark);
}

.word-card span {
  font-size: 14px;
  color: var(--color-text-muted);
}

.tip-card {
  background: var(--color-sunshine-soft);
  border: 1px solid rgba(255, 200, 87, 0.5);
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 14px;
  color: #92400E;
  line-height: 1.5;
  font-weight: 500;
}

.report-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn-whatsapp {
  height: 52px;
  min-height: 52px;
  border-radius: var(--radius-pill);
  border: none;
  background: #25D366;
  color: var(--color-white);
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 6px 18px rgba(37, 211, 102, 0.3);
  transition: transform 0.15s ease;
}

.btn-whatsapp:hover {
  transform: translateY(-1px);
}

.wa-direct-link {
  font-size: 14px;
  color: #128C7E;
  text-align: center;
  font-weight: 600;
  text-decoration: underline;
}

/* Reduced motion */
@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;
  }
}
