/* ═══════════════════════════════════════════════════════════
   AWL Pronunciation Coach — Student-Friendly Stylesheet
   Palette: vibrant purple, teal, orange, pink, yellow
   ═══════════════════════════════════════════════════════════ */

/* ── Variables ─────────────────────────────────────────── */
:root {
  --purple:      #7c3aed;
  --purple-lt:   #ede9fe;
  --purple-md:   #a78bfa;
  --teal:        #0d9488;
  --teal-lt:     #ccfbf1;
  --teal-md:     #2dd4bf;
  --orange:      #ea580c;
  --orange-lt:   #ffedd5;
  --orange-md:   #fb923c;
  --pink:        #db2777;
  --pink-lt:     #fce7f3;
  --pink-md:     #f472b6;
  --yellow:      #ca8a04;
  --yellow-lt:   #fefce8;
  --yellow-md:   #facc15;
  --blue:        #2563eb;
  --blue-lt:     #dbeafe;
  --red:         #dc2626;
  --red-lt:      #fee2e2;
  --green:       #16a34a;
  --green-lt:    #dcfce7;

  --text-dark:   #1e1b4b;
  --text-mid:    #4b5563;
  --text-light:  #9ca3af;
  --bg:          #f8f7ff;
  --bg-card:     #ffffff;
  --border:      #e5e7eb;
  --shadow:      0 4px 20px rgba(124,58,237,.08);
  --shadow-lg:   0 8px 40px rgba(124,58,237,.14);
  --radius:      16px;
  --radius-sm:   8px;
  --radius-pill: 999px;
  --transition:  .22s ease;
  --font-body:   'Nunito', sans-serif;
  --font-display:'Poppins', sans-serif;
}

/* ── Reset & Base ───────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text-dark);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; }
img { max-width: 100%; }

/* ── Typography ─────────────────────────────────────────── */
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 700; line-height: 1.25; }
h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); }
h3 { font-size: 1.2rem; }
p  { line-height: 1.7; color: var(--text-mid); }

/* ── Utility ────────────────────────────────────────────── */
.hidden { display: none !important; }
.section { padding: 2.5rem 1.5rem; max-width: 1100px; margin: 0 auto; }
.section-title { text-align: center; margin-bottom: .5rem; color: var(--text-dark); }
.section-sub   { text-align: center; margin-bottom: 2rem; color: var(--text-mid); }

/* ── Navbar ─────────────────────────────────────────────── */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  height: 64px;
  background: var(--bg-card);
  border-bottom: 2px solid var(--purple-lt);
  box-shadow: 0 2px 12px rgba(124,58,237,.06);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--purple);
}
.brand-icon { font-size: 1.5rem; }

.nav-links {
  display: flex;
  gap: .25rem;
}
.nav-link {
  padding: .5rem 1rem;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: .9rem;
  color: var(--text-mid);
  transition: background var(--transition), color var(--transition);
}
.nav-link:hover, .nav-link.active {
  background: var(--purple-lt);
  color: var(--purple);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--purple);
}

/* Mobile menu */
.mobile-menu {
  display: none;
  flex-direction: column;
  background: var(--bg-card);
  border-bottom: 2px solid var(--purple-lt);
  padding: .5rem 1rem;
}
.mobile-menu.open { display: flex; }
.mob-link {
  padding: .75rem 1rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  color: var(--text-mid);
  transition: background var(--transition);
}
.mob-link:hover { background: var(--purple-lt); color: var(--purple); }

@media (max-width: 700px) {
  .nav-links { display: none; }
  .nav-toggle { display: block; }
}

/* ── Main Content ───────────────────────────────────────── */
.main-content { flex: 1; }

/* ── Buttons ────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .65rem 1.4rem;
  border-radius: var(--radius-pill);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: .95rem;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
}
.btn:hover  { transform: translateY(-2px); box-shadow: var(--shadow); }
.btn:active { transform: scale(.97); }

.btn--primary { background: var(--purple); color: #fff; }
.btn--primary:hover { background: #6d28d9; }

.btn--outline { background: transparent; border-color: var(--purple); color: var(--purple); }
.btn--outline:hover { background: var(--purple-lt); }

.btn--danger { background: var(--red); color: #fff; }
.btn--danger:hover { background: #b91c1c; }

.btn--white { background: rgba(255,255,255,.9); color: var(--purple); }
.btn--white:hover { background: #fff; }

.btn--lg { padding: .85rem 2rem; font-size: 1.05rem; }
.btn--sm { padding: .4rem .9rem; font-size: .82rem; }

.btn:disabled { opacity: .45; pointer-events: none; }

/* ── Flash Messages ─────────────────────────────────────── */
.flash-container { padding: .75rem 1.5rem; }
.flash {
  padding: 1rem 1.5rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  margin-bottom: .5rem;
}
.flash--success { background: var(--green-lt); color: var(--green); }
.flash--error   { background: var(--red-lt);   color: var(--red);   }
.flash--info    { background: var(--blue-lt);   color: var(--blue);  }

/* ── Page Header ────────────────────────────────────────── */
.page-header {
  text-align: center;
  padding: 3rem 1.5rem 2.5rem;
  position: relative;
  overflow: hidden;
}
.page-header h1 { color: #fff; margin-bottom: .5rem; }
.page-header p  { color: rgba(255,255,255,.85); font-size: 1.05rem; }
.page-header--purple { background: linear-gradient(135deg, var(--purple) 0%, var(--purple-md) 100%); }
.page-header--teal   { background: linear-gradient(135deg, var(--teal)   0%, var(--teal-md)   100%); }
.page-header--orange { background: linear-gradient(135deg, var(--orange) 0%, var(--orange-md) 100%); }
.page-header--pink   { background: linear-gradient(135deg, var(--pink)   0%, var(--pink-md)   100%); }

/* ═══════════════════════════════════════════════════════════
   HOME PAGE
   ═══════════════════════════════════════════════════════════ */

/* Hero */
.hero {
  position: relative;
  min-height: 520px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #4f1d96 0%, var(--purple) 50%, #0891b2 100%);
  overflow: hidden;
  padding: 4rem 2rem;
}

.hero-content {
  text-align: center;
  position: relative;
  z-index: 2;
  max-width: 700px;
}
.hero-title {
  color: #fff;
  margin-bottom: 1rem;
  font-size: clamp(2rem, 5vw, 3.2rem);
}
.wave { display: inline-block; animation: wave 2s infinite; transform-origin: 70% 70%; }
@keyframes wave { 0%,100%{transform:rotate(0deg)} 25%{transform:rotate(20deg)} 75%{transform:rotate(-10deg)} }

.hero-subtitle {
  color: rgba(255,255,255,.88);
  font-size: 1.15rem;
  margin-bottom: 2.5rem;
}

.hero-cta { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* Floating word bubbles */
.hero-bubbles { position: absolute; inset: 0; pointer-events: none; }
.bubble {
  position: absolute;
  background: rgba(255,255,255,.12);
  color: rgba(255,255,255,.7);
  border-radius: var(--radius-pill);
  padding: .35rem .9rem;
  font-weight: 700;
  font-size: .85rem;
  animation: float 6s ease-in-out infinite;
}
.b1 { top: 10%; left:  8%; animation-delay: 0s; }
.b2 { top: 20%; right: 10%; animation-delay: 1s; }
.b3 { top: 55%; left:  5%; animation-delay: 2s; }
.b4 { bottom: 15%; right: 12%; animation-delay: .5s; }
.b5 { bottom: 25%; left: 20%; animation-delay: 1.5s; }
.b6 { top: 40%; right: 5%;  animation-delay: 2.5s; }
@keyframes float { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-14px)} }

/* Feature Cards */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1.5rem;
}
.feature-card {
  border-radius: var(--radius);
  padding: 2rem 1.5rem;
  color: #fff;
  box-shadow: var(--shadow-lg);
  transition: transform var(--transition);
  display: flex;
  flex-direction: column;
  gap: .75rem;
}
.feature-card:hover { transform: translateY(-6px); }
.card-icon { font-size: 2.5rem; }
.feature-card h3 { font-size: 1.2rem; }
.feature-card p  { color: rgba(255,255,255,.88); font-size: .92rem; }

.card--purple { background: linear-gradient(135deg, var(--purple)  0%, #9333ea 100%); }
.card--teal   { background: linear-gradient(135deg, var(--teal)    0%, #0891b2 100%); }
.card--orange { background: linear-gradient(135deg, var(--orange)  0%, #f59e0b 100%); }
.card--pink   { background: linear-gradient(135deg, var(--pink)    0%, #e11d48 100%); }

/* Quick Check */
.quick-check { background: var(--bg-card); border-radius: var(--radius); box-shadow: var(--shadow); }
.quick-check-inner { max-width: 600px; margin: 0 auto; text-align: center; }
.quick-form { display: flex; gap: .75rem; margin: 1.5rem 0; }
.quick-input {
  flex: 1;
  padding: .75rem 1.2rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-pill);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  outline: none;
  transition: border-color var(--transition);
}
.quick-input:focus { border-color: var(--purple); }
.quick-result {
  background: var(--purple-lt);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  text-align: left;
  animation: fadeIn .3s ease;
}
@keyframes fadeIn { from{opacity:0;transform:translateY(6px)} to{opacity:1;transform:translateY(0)} }

/* Stats Banner */
.stats-banner {
  display: flex;
  justify-content: space-around;
  flex-wrap: wrap;
  gap: 1.5rem;
  background: linear-gradient(135deg, var(--purple) 0%, var(--teal) 100%);
  border-radius: var(--radius);
  padding: 2.5rem 1.5rem;
  margin: 0 1.5rem 2.5rem;
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
}
.stat-item { text-align: center; color: #fff; }
.stat-num  { display: block; font-size: 3rem; font-weight: 900; font-family: var(--font-display); }
.stat-label{ font-size: .9rem; opacity: .85; font-weight: 600; }

/* ═══════════════════════════════════════════════════════════
   RECORD PAGE
   ═══════════════════════════════════════════════════════════ */
.record-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  max-width: 1100px;
  margin: 2rem auto;
  padding: 0 1.5rem;
}
@media (max-width: 750px) { .record-layout { grid-template-columns: 1fr; } }

.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
}

/* Mic visualiser */
.mic-visualiser {
  position: relative;
  width: 140px;
  height: 140px;
  margin: 0 auto 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.mic-ring {
  position: absolute;
  border-radius: 50%;
  border: 2px solid var(--purple-md);
  opacity: 0;
  animation: pulse 2.5s ease-out infinite;
}
.ring1 { width: 80px;  height: 80px;  animation-delay: 0s; }
.ring2 { width: 110px; height: 110px; animation-delay: .6s; }
.ring3 { width: 140px; height: 140px; animation-delay: 1.2s; }
@keyframes pulse { 0%{opacity:.6;transform:scale(.8)} 100%{opacity:0;transform:scale(1.15)} }

.mic-btn {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--purple) 0%, var(--purple-md) 100%);
  border: none;
  cursor: pointer;
  font-size: 1.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 20px rgba(124,58,237,.4);
  transition: transform var(--transition), box-shadow var(--transition);
  z-index: 1;
}
.mic-btn:hover { transform: scale(1.08); box-shadow: 0 10px 28px rgba(124,58,237,.5); }
.mic-btn.recording {
  background: linear-gradient(135deg, var(--red) 0%, #f87171 100%);
  box-shadow: 0 6px 20px rgba(220,38,38,.5);
  animation: mic-pulse .9s ease-in-out infinite alternate;
}
@keyframes mic-pulse { from{transform:scale(1)} to{transform:scale(1.1)} }

.mic-status {
  text-align: center;
  font-weight: 700;
  color: var(--text-mid);
  margin-bottom: .5rem;
}
.mic-timer {
  text-align: center;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--red);
  margin-bottom: .75rem;
  font-family: var(--font-display);
}

/* Transcript */
.transcript-box {
  min-height: 120px;
  background: var(--purple-lt);
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
  font-size: .95rem;
  line-height: 1.7;
}
.transcript-placeholder { color: var(--text-light); font-style: italic; }
.transcript-text { color: var(--text-dark); font-weight: 600; }

.record-controls {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.advanced-opts {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .75rem 1rem;
  font-size: .9rem;
}
.advanced-opts summary { cursor: pointer; font-weight: 700; color: var(--purple); }
.advanced-opts label   { display: block; margin: .6rem 0 .25rem; color: var(--text-mid); font-size: .85rem; }
.form-input {
  width: 100%;
  padding: .6rem 1rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: .9rem;
  outline: none;
  transition: border-color var(--transition);
}
.form-input:focus { border-color: var(--purple); }

/* Highlight panel */
.panel-title { font-size: 1.1rem; margin-bottom: .25rem; }
.panel-sub   { font-size: .85rem; color: var(--text-light); margin-bottom: 1rem; }
.awl-live { min-height: 200px; display: flex; flex-wrap: wrap; gap: .5rem; align-content: flex-start; }
.awl-empty { width: 100%; text-align: center; color: var(--text-light); padding: 2rem; }
.awl-empty-icon { font-size: 2.5rem; display: block; margin-bottom: .5rem; }

/* Sublist colour system */
.sublist-key { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: 1rem; align-items: center; }
.key-title   { font-size: .8rem; font-weight: 700; color: var(--text-mid); margin-right: .25rem; }
.key-chip, .sl-pill-1, .sl-pill-2, .sl-pill-3, .sl-pill-4, .sl-pill-5,
.sl-pill-6, .sl-pill-7, .sl-pill-8, .sl-pill-9, .sl-pill-10 {
  padding: .2rem .55rem;
  border-radius: var(--radius-pill);
  font-size: .75rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: transform var(--transition);
}
.sl-1,.key-chip.sl-1,.sl-pill-1 { background:#ede9fe; color:#6d28d9; }
.sl-2,.key-chip.sl-2,.sl-pill-2 { background:#ccfbf1; color:#0f766e; }
.sl-3,.key-chip.sl-3,.sl-pill-3 { background:#ffedd5; color:#c2410c; }
.sl-4,.key-chip.sl-4,.sl-pill-4 { background:#fce7f3; color:#be185d; }
.sl-5,.key-chip.sl-5,.sl-pill-5 { background:#fef9c3; color:#a16207; }
.sl-6,.key-chip.sl-6,.sl-pill-6 { background:#dbeafe; color:#1d4ed8; }
.sl-7,.key-chip.sl-7,.sl-pill-7 { background:#d1fae5; color:#065f46; }
.sl-8,.key-chip.sl-8,.sl-pill-8 { background:#fee2e2; color:#b91c1c; }
.sl-9,.key-chip.sl-9,.sl-pill-9 { background:#f3e8ff; color:#7e22ce; }
.sl-10,.key-chip.sl-10,.sl-pill-10 { background:#fdf4ff; color:#86198f; }

/* AWL word chips in live panel */
.awl-chip-live {
  padding: .3rem .8rem;
  border-radius: var(--radius-pill);
  font-size: .85rem;
  font-weight: 700;
  animation: pop .25s ease;
}
@keyframes pop { 0%{transform:scale(.7);opacity:0} 100%{transform:scale(1);opacity:1} }

/* Loading overlay */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(30,27,75,.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
}
.loading-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 2.5rem 3rem;
  text-align: center;
  box-shadow: var(--shadow-lg);
}
.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--purple-lt);
  border-top-color: var(--purple);
  border-radius: 50%;
  animation: spin .8s linear infinite;
  margin: 0 auto 1rem;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Tips bar */
.tips-bar {
  max-width: 1100px;
  margin: 0 auto 2rem;
  padding: .85rem 1.5rem;
  background: var(--yellow-lt);
  border-left: 4px solid var(--yellow-md);
  border-radius: var(--radius-sm);
  font-size: .9rem;
  color: var(--text-dark);
}

/* ═══════════════════════════════════════════════════════════
   RESULTS PAGE
   ═══════════════════════════════════════════════════════════ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.25rem;
}
.stat-card {
  border-radius: var(--radius);
  padding: 1.75rem 1.5rem;
  text-align: center;
  color: #fff;
  box-shadow: var(--shadow);
}
.stat-card--purple { background: linear-gradient(135deg, var(--purple), #9333ea); }
.stat-card--teal   { background: linear-gradient(135deg, var(--teal),   #0891b2); }
.stat-card--orange { background: linear-gradient(135deg, var(--orange), #f59e0b); }
.stat-card--pink   { background: linear-gradient(135deg, var(--pink),   #e11d48); }
.stat-icon  { font-size: 2rem; display: block; margin-bottom: .4rem; }
.stat-value { font-size: 2.5rem; font-weight: 900; font-family: var(--font-display); line-height: 1; }
.stat-label { font-size: .85rem; opacity: .88; font-weight: 600; margin-top: .3rem; }

/* Sublist bars */
.sublist-bars { max-width: 700px; margin: 1.5rem auto 0; display: flex; flex-direction: column; gap: .75rem; }
.sl-bar-row { display: flex; align-items: center; gap: .75rem; }
.sl-label   { width: 80px; font-weight: 700; font-size: .85rem; color: var(--text-mid); flex-shrink: 0; }
.sl-bar-wrap{ flex: 1; background: var(--border); border-radius: var(--radius-pill); overflow: hidden; height: 28px; }
.sl-bar {
  height: 100%;
  min-width: 40px;
  background: linear-gradient(90deg, var(--purple) 0%, var(--teal-md) 100%);
  border-radius: var(--radius-pill);
  display: flex;
  align-items: center;
  padding: 0 .75rem;
  font-size: .8rem;
  font-weight: 700;
  color: #fff;
  transition: width .6s ease;
}

/* Annotated transcript */
.annotated-transcript {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  line-height: 2.2;
  font-size: 1.05rem;
}
.word-chip {
  display: inline-block;
  margin: .1rem .2rem;
  padding: .15rem .5rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
}
.awl-chip {
  font-weight: 700;
  cursor: default;
  transition: transform var(--transition);
  position: relative;
}
.awl-chip:hover { transform: scale(1.06); }
.chip-badge {
  font-size: .65rem;
  font-weight: 800;
  vertical-align: super;
  margin-left: .15rem;
}
.plain-chip { color: var(--text-mid); }
.transcript-legend { margin-top: 1rem; font-size: .85rem; color: var(--text-mid); display: flex; align-items: center; gap: .35rem; }
.legend-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; }
.awl-dot   { background: var(--purple); }
.plain-dot { background: var(--border); border: 1px solid var(--text-light); }

/* Phoneme cards */
.phoneme-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
}
.phoneme-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  border-top: 4px solid var(--purple);
}
.phoneme-card.level-easy      { border-top-color: var(--green); }
.phoneme-card.level-medium    { border-top-color: var(--yellow); }
.phoneme-card.level-hard      { border-top-color: var(--orange); }
.phoneme-card.level-very-hard { border-top-color: var(--red); }

.ph-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: .75rem; }
.ph-word { font-size: 1.3rem; font-family: var(--font-display); color: var(--text-dark); }

.ph-badge {
  padding: .25rem .7rem;
  border-radius: var(--radius-pill);
  font-size: .75rem;
  font-weight: 800;
  text-transform: uppercase;
}
.badge-easy      { background: var(--green-lt);  color: var(--green);  }
.badge-medium    { background: var(--yellow-lt);  color: var(--yellow); }
.badge-hard      { background: var(--orange-lt);  color: var(--orange); }
.badge-very-hard { background: var(--red-lt);     color: var(--red);    }

.ph-gauge-wrap { display: flex; align-items: center; gap: .75rem; margin-bottom: .75rem; }
.ph-gauge { flex: 1; height: 10px; background: var(--border); border-radius: var(--radius-pill); overflow: hidden; }
.ph-gauge-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--purple) 0%, var(--pink-md) 100%);
  border-radius: var(--radius-pill);
  transition: width .6s ease;
}
.ph-score { font-size: .85rem; font-weight: 700; color: var(--text-mid); white-space: nowrap; }

.ph-tokens { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: .75rem; }
.ph-token {
  padding: .3rem .55rem;
  border-radius: var(--radius-sm);
  font-family: monospace;
  font-size: .85rem;
  font-weight: 700;
  cursor: help;
  transition: transform .15s;
}
.ph-token:hover { transform: scale(1.15); }
.ph-vowel { background: var(--teal-lt);   color: var(--teal); }
.ph-cons  { background: var(--purple-lt); color: var(--purple); }
.diff-3   { background: var(--red-lt);    color: var(--red); }

.ph-tips { background: var(--yellow-lt); border-radius: var(--radius-sm); padding: .75rem 1rem; font-size: .85rem; }
.ph-tips ul { padding-left: 1rem; margin-top: .4rem; }
.ph-tips li { margin-bottom: .25rem; color: var(--text-dark); }

/* Results actions */
.results-actions { display: flex; gap: 1rem; flex-wrap: wrap; justify-content: center; }

/* Empty state */
.empty-state { text-align: center; padding: 5rem 2rem; }
.empty-icon  { font-size: 4rem; display: block; margin-bottom: 1rem; }

/* ═══════════════════════════════════════════════════════════
   WORD LIST PAGE
   ═══════════════════════════════════════════════════════════ */
.wl-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
}
.wl-search { max-width: 300px; }
.sublist-filters { display: flex; flex-wrap: wrap; gap: .35rem; }
.filter-btn {
  padding: .3rem .75rem;
  border-radius: var(--radius-pill);
  border: 2px solid var(--border);
  background: var(--bg-card);
  font-weight: 700;
  font-size: .8rem;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
}
.filter-btn.active, .filter-btn:hover {
  border-color: var(--purple);
  background: var(--purple-lt);
  color: var(--purple);
}

.wl-sublist { transition: opacity .2s; }
.sublist-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .75rem 1.25rem;
  border-radius: var(--radius-sm);
  margin-bottom: .75rem;
}
.sublist-header h2 { color: #fff; font-size: 1.1rem; }
.word-count { font-size: .8rem; color: rgba(255,255,255,.8); font-weight: 700; }

.sl-header-1  { background: linear-gradient(90deg,#7c3aed,#a78bfa); }
.sl-header-2  { background: linear-gradient(90deg,#0d9488,#2dd4bf); }
.sl-header-3  { background: linear-gradient(90deg,#ea580c,#fb923c); }
.sl-header-4  { background: linear-gradient(90deg,#db2777,#f472b6); }
.sl-header-5  { background: linear-gradient(90deg,#ca8a04,#facc15); }
.sl-header-6  { background: linear-gradient(90deg,#2563eb,#60a5fa); }
.sl-header-7  { background: linear-gradient(90deg,#16a34a,#4ade80); }
.sl-header-8  { background: linear-gradient(90deg,#dc2626,#f87171); }
.sl-header-9  { background: linear-gradient(90deg,#7e22ce,#c084fc); }
.sl-header-10 { background: linear-gradient(90deg,#86198f,#e879f9); }

.word-cloud { display: flex; flex-wrap: wrap; gap: .45rem; }
.sl-pill-1,.sl-pill-2,.sl-pill-3,.sl-pill-4,.sl-pill-5,
.sl-pill-6,.sl-pill-7,.sl-pill-8,.sl-pill-9,.sl-pill-10 {
  padding: .35rem .9rem;
  border-radius: var(--radius-pill);
  font-size: .88rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
}
.sl-pill-1:hover,.sl-pill-2:hover,.sl-pill-3:hover,.sl-pill-4:hover,.sl-pill-5:hover,
.sl-pill-6:hover,.sl-pill-7:hover,.sl-pill-8:hover,.sl-pill-9:hover,.sl-pill-10:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(30,27,75,.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
  padding: 1rem;
}
.modal-box {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 2rem;
  max-width: 560px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  position: relative;
  animation: slideUp .25s ease;
}
@keyframes slideUp { from{transform:translateY(30px);opacity:0} to{transform:translateY(0);opacity:1} }
.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  color: var(--text-light);
  line-height: 1;
}
.modal-close:hover { color: var(--red); }
.modal-loading { text-align: center; padding: 2rem 0; }

/* ═══════════════════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════════════════ */
.footer {
  background: var(--text-dark);
  color: rgba(255,255,255,.7);
  padding: 1.25rem 2rem;
  font-size: .85rem;
  margin-top: auto;
}
.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: .5rem;
}
.footer-badge {
  background: var(--purple);
  color: #fff;
  padding: .2rem .7rem;
  border-radius: var(--radius-pill);
  font-size: .75rem;
  font-weight: 700;
}

/* ── Print ──────────────────────────────────────────────── */
@media print {
  .navbar,.footer,.record-controls,.results-actions,.tips-bar { display: none; }
  .page-header { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .phoneme-card, .stat-card { break-inside: avoid; }
}
