*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }

:root {
  --bg: #f5f5f0;
  --surface: #ffffff;
  --border: #e8e8e0;
  --text: #1a1a1a;
  --mid: #888880;
  --off: #f0f0eb;
  --green: #58cc02;
  --green-dark: #46a302;
  --green-bg: #edffd0;
  --blue: #1cb0f6;
  --blue-dark: #0a90d0;
  --blue-bg: #e0f7ff;
  --amber: #ff9600;
  --amber-bg: #fff3d6;
  --purple: #a560f8;
  --purple-bg: #f0e8ff;
  --red: #ff4b4b;
  --red-bg: #ffe8e8;
  --cyan: #00cd9c;
  --cyan-bg: #d6fff4;
  --black: #1a1a1a;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

html, body { height:100%; background:var(--bg); }

body {
  font-family:'Nunito',sans-serif;
  color:var(--text);
  max-width:520px;
  margin:0 auto;
  padding:0 0 100px;
  min-height:100vh;
  overflow-x: hidden;
}

/* ══ TOPBAR ══ */
.topbar {
  padding:16px 20px 14px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  position:sticky;
  top:0;
  background:var(--bg);
  z-index:100;
  border-bottom:1px solid var(--border);
}
.logo {
  display:flex;
  align-items:center;
  gap:8px;
  font-size:17px;
  font-weight:900;
  color:var(--text);
  letter-spacing:-0.3px;
}
.logo span { color:var(--green); }
.topbar-tag {
  font-size:11px;
  font-weight:800;
  text-transform:uppercase;
  letter-spacing:1px;
  color:var(--mid);
  background:var(--off);
  padding:4px 10px;
  border-radius:20px;
  border:1px solid var(--border);
}
.topbar-tag.teacher-mode {
  background:#fff3d6;
  color:#d07a00;
  border-color:#ffd080;
}

/* ══ PAGES ══ */
.page { display:none; }
.page.active { display:block; }
.page:last-child {
  padding-bottom: 20px;
}

/* ══ BOTTOM NAV ══ */
.bnav {
  position:fixed;
  bottom:0; left:50%;
  transform:translateX(-50%);
  width:100%; max-width:520px;
  background:var(--surface);
  border-top:2px solid var(--border);
  display:flex;
  padding:8px 0 16px;
  z-index:200;
}
.nbtn {
  flex:1;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:2px;
  background:none;
  border:none;
  cursor:pointer;
  padding:4px 2px;
  transition:transform 0.1s;
}
.nbtn:active { transform:scale(0.88); }
.ni { font-size:20px; line-height:1; }
.nl {
  font-size:9px;
  font-weight:800;
  text-transform:uppercase;
  letter-spacing:0.5px;
  color:var(--mid);
  font-family:'Nunito',sans-serif;
}
.nbtn.active .nl { color:var(--green); }

/* ══ SECTION LABEL ══ */
.slabel {
  padding:20px 20px 10px;
  font-size:11px;
  font-weight:800;
  text-transform:uppercase;
  letter-spacing:1.5px;
  color:var(--mid);
  display:flex;
  align-items:center;
  justify-content:space-between;
}
.slabel-btn {
  font-size:11px;
  font-weight:800;
  font-family:'Nunito',sans-serif;
  color:var(--blue);
  background:var(--blue-bg);
  border:none;
  border-radius:12px;
  padding:4px 10px;
  cursor:pointer;
}

.spacer { height:30px; }

/* ══ HOME PAGE ══ */
.greeting { padding:22px 20px 0; }
.greeting-title { font-size:26px; font-weight:900; line-height:1.2; margin-bottom:4px; }
.greeting-sub { font-size:13px; color:var(--mid); font-weight:600; }

.hero-btn {
  margin:20px 20px 0;
  background:var(--green);
  border-radius:20px;
  padding:22px 20px;
  display:flex;
  align-items:center;
  gap:14px;
  text-decoration:none;
  border-bottom:4px solid var(--green-dark);
  cursor:pointer;
  position:relative;
  overflow:hidden;
  transition:transform 0.1s, border-bottom-width 0.1s;
}
.hero-btn::before {
  content:'';
  position:absolute;
  top:0; left:0;
  width:100%; height:40%;
  background:rgba(255,255,255,0.15);
  border-radius:20px 20px 50% 50%;
}
.hero-btn:active { transform:translateY(2px); border-bottom-width:2px; }
.hbi { font-size:44px; flex-shrink:0; filter:drop-shadow(0 3px 6px rgba(0,0,0,0.2)); }
.hbt { flex:1; }
.hb-label { font-size:10px; font-weight:800; text-transform:uppercase; letter-spacing:1.5px; color:rgba(255,255,255,0.8); margin-bottom:3px; }
.hb-title { font-size:20px; font-weight:900; color:#fff; line-height:1.2; }
.hb-arrow { font-size:22px; color:rgba(255,255,255,0.8); flex-shrink:0; }

.app-grid {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
  padding:0 20px;
}
.app-btn {
  background:var(--surface);
  border:2px solid var(--border);
  border-radius:18px;
  padding:18px 14px;
  text-decoration:none;
  display:flex;
  flex-direction:column;
  gap:8px;
  cursor:pointer;
  border-bottom-width:4px;
  transition:transform 0.15s, box-shadow 0.15s;
}
.app-btn:active { transform:translateY(2px); border-bottom-width:2px; }
.app-btn:hover { transform:translateY(-2px); box-shadow:0 8px 24px rgba(0,0,0,0.08); }
.abi { font-size:34px; line-height:1; }
.abt { font-size:13px; font-weight:800; color:var(--text); }
.abd { font-size:11px; font-weight:600; color:var(--mid); line-height:1.4; }
.ab-tag {
  display:inline-block;
  font-size:9px; font-weight:800;
  text-transform:uppercase;
  letter-spacing:0.5px;
  padding:3px 8px;
  border-radius:8px;
  align-self:flex-start;
}
.green  { border-color:#b8f078; border-bottom-color:var(--green-dark); }
.green  .ab-tag { background:var(--green-bg); color:var(--green-dark); }
.blue   { border-color:#a0dff8; border-bottom-color:var(--blue-dark); }
.blue   .ab-tag { background:var(--blue-bg); color:var(--blue-dark); }
.amber  { border-color:#ffd580; border-bottom-color:#d07a00; }
.amber  .ab-tag { background:var(--amber-bg); color:var(--amber); }
.purple { border-color:#d4a8ff; border-bottom-color:#7a30d0; }
.purple .ab-tag { background:var(--purple-bg); color:var(--purple); }
.red    { border-color:#ffb0b0; border-bottom-color:#c83030; }
.red    .ab-tag { background:var(--red-bg); color:var(--red); }
.cyan   { border-color:#80ebd4; border-bottom-color:#009870; }
.cyan   .ab-tag { background:var(--cyan-bg); color:var(--cyan); }

.wide-btn {
  margin:0 20px;
  background:var(--surface);
  border:2px solid var(--border);
  border-bottom:4px solid #d0d0c8;
  border-radius:18px;
  padding:16px 18px;
  display:flex;
  align-items:center;
  gap:12px;
  text-decoration:none;
  cursor:pointer;
  transition:transform 0.15s;
}
.wide-btn:active { transform:translateY(2px); border-bottom-width:2px; }
.wide-btn:hover { transform:translateY(-2px); box-shadow:0 6px 20px rgba(0,0,0,0.07); }
.wide-btn + .wide-btn { margin-top:10px; }
.wbi { font-size:30px; flex-shrink:0; }
.wbb { flex:1; }
.wbt { font-size:14px; font-weight:800; color:var(--text); }
.wbs { font-size:11px; font-weight:600; color:var(--mid); }
.wba { font-size:16px; color:var(--mid); }
.divider { height:1px; background:var(--border); margin:20px 20px 0; }

/* ══ ABOUT PAGE ══ */
.about-hero {
  padding:28px 20px 24px;
  background:linear-gradient(135deg,#1a1a1a 0%,#2d2d2d 100%);
  color:white;
  margin-bottom:4px;
}
.ah-eye { font-size:10px; font-weight:800; text-transform:uppercase; letter-spacing:2px; color:var(--green); margin-bottom:10px; }
.ah-title { font-size:32px; font-weight:900; line-height:1.1; margin-bottom:10px; }
.ah-sub { font-size:13px; color:rgba(255,255,255,0.65); font-weight:600; }

.stats {
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:0;
  border-bottom:1px solid var(--border);
  background:var(--surface);
}
.stat { padding:16px; text-align:center; border-right:1px solid var(--border); }
.stat:last-child { border-right:none; }
.stat-n { font-size:24px; font-weight:900; color:var(--green); }
.stat-l { font-size:10px; font-weight:800; text-transform:uppercase; letter-spacing:1px; color:var(--mid); }

.info-block { padding:18px 20px; border-bottom:1px solid var(--border); background:var(--surface); margin-bottom:1px; overflow:visible; }
.info-title { font-size:13px; font-weight:800; color:var(--text); margin-bottom:6px; }
.info-text { font-size:13px; font-weight:600; color:var(--mid); line-height:1.6; }

.contact-row {
  display:flex;
  align-items:center;
  gap:12px;
  padding:14px 20px;
  background:var(--surface);
  border-bottom:1px solid var(--border);
  cursor:pointer;
  text-decoration:none;
  transition:background 0.15s;
}
.contact-row:hover { background:var(--off); }
.cr-icon { font-size:28px; flex-shrink:0; }
.crb { flex:1; }
.crt { font-size:14px; font-weight:800; color:var(--text); }
.crs { font-size:12px; font-weight:600; color:var(--mid); }
.cr-arrow { font-size:16px; color:var(--mid); }

/* ══ EXCHANGE PAGE ══ */
.exch-hero {
  padding:28px 20px 24px;
  background:linear-gradient(135deg,#0a3d7a 0%,#1a5fa0 100%);
  color:white;
}
.eh-eye { font-size:10px; font-weight:800; text-transform:uppercase; letter-spacing:2px; color:#7ed4f8; margin-bottom:10px; }
.eh-title { font-size:32px; font-weight:900; line-height:1.1; margin-bottom:10px; }
.eh-sub { font-size:13px; color:rgba(255,255,255,0.65); font-weight:600; }

.dest-card {
  margin:0 20px 12px;
  background:var(--surface);
  border:2px solid var(--border);
  border-radius:18px;
  overflow:visible;
  border-bottom-width:3px;
}
.dest-head {
  display:flex;
  align-items:center;
  gap:12px;
  padding:14px 16px 10px;
}
.dest-flag { font-size:32px; }
.dest-country { font-size:15px; font-weight:900; color:var(--text); }
.dest-cities { font-size:11px; font-weight:600; color:var(--mid); }
.dest-pill {
  margin-left:auto;
  font-size:9px;
  font-weight:800;
  text-transform:uppercase;
  letter-spacing:0.5px;
  background:var(--green-bg);
  color:var(--green-dark);
  padding:4px 8px;
  border-radius:10px;
}
.dest-body { padding:0 16px 14px; font-size:12px; font-weight:600; color:var(--mid); line-height:1.6; }

.cta-btn {
  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  margin:4px 20px 0;
  padding:16px;
  background:var(--blue);
  border:none;
  border-bottom:3px solid var(--blue-dark);
  border-radius:16px;
  font-size:15px;
  font-weight:800;
  font-family:'Nunito',sans-serif;
  color:white;
  cursor:pointer;
  text-decoration:none;
  transition:transform 0.1s;
}
.cta-btn:active { transform:translateY(2px); }

/* ══ LISTENING PAGE ══ */
.listen-box {
  margin:20px;
  background:var(--surface);
  border:2px solid var(--border);
  border-radius:20px;
  padding:24px 20px;
  text-align:center;
}
.listen-sentence {
  font-size:18px;
  font-weight:800;
  color:var(--text);
  line-height:1.4;
  margin-bottom:20px;
  min-height:50px;
}
.listen-btns { display:flex; flex-direction:column; gap:10px; margin-bottom:16px; }
.listen-btn {
  padding:14px;
  border:2px solid var(--border);
  border-bottom:3px solid #d0d0c8;
  border-radius:14px;
  font-size:14px;
  font-weight:800;
  font-family:'Nunito',sans-serif;
  background:var(--surface);
  cursor:pointer;
  transition:transform 0.1s;
}
.listen-btn:active { transform:translateY(2px); }
.listen-btn.green { border-color:#b8f078; border-bottom-color:var(--green-dark); color:var(--green-dark); }
.listen-btn.blue  { border-color:#a0dff8; border-bottom-color:var(--blue-dark);  color:var(--blue-dark); }
.listen-btn.amber { border-color:#ffd580; border-bottom-color:#d07a00;            color:#d07a00; }
#student-result { font-size:13px; font-weight:700; color:var(--mid); margin-top:8px; min-height:20px; }

/* ══ HOMEWORK PAGE ══ */
.hw-topbar {
  padding:12px 20px;
  display:flex;
  align-items:center;
  gap:12px;
  border-bottom:1px solid var(--border);
  background:var(--bg);
  position:sticky;
  top:57px;
  z-index:50;
}
.back-btn {
  font-size:12px;
  font-weight:800;
  font-family:'Nunito',sans-serif;
  color:var(--mid);
  background:var(--off);
  border:1px solid var(--border);
  border-radius:10px;
  padding:6px 12px;
  cursor:pointer;
  flex-shrink:0;
}
.hw-progress-outer { height:6px; background:var(--border); border-radius:3px; flex:1; }
.hw-progress-inner { height:100%; background:var(--green); border-radius:3px; transition:width 0.4s; }
.hw-pct { font-size:12px; font-weight:900; color:var(--blue); flex-shrink:0; }

.hw-hud {
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:0;
  background:var(--surface);
  border-bottom:1px solid var(--border);
}
.hw-hud-cell { padding:12px; text-align:center; border-right:1px solid var(--border); }
.hw-hud-cell:last-child { border-right:none; }
.hw-hud-n { font-size:20px; font-weight:900; }
.hw-hud-n.total   { color:var(--blue); }
.hw-hud-n.done    { color:var(--green); }
.hw-hud-n.pending { color:var(--amber); }
.hw-hud-l { font-size:9px; font-weight:800; text-transform:uppercase; letter-spacing:1px; color:var(--mid); }

.hw-view { display:none; }
.hw-view.active { display:block; }

.hw-hero { padding:22px 20px 16px; }
.hw-eye { font-size:10px; font-weight:800; text-transform:uppercase; letter-spacing:2px; color:var(--green); margin-bottom:8px; }
.hw-title { font-size:26px; font-weight:900; line-height:1.1; margin-bottom:6px; }
.hw-title em { font-style:italic; color:var(--green); }
.hw-sub { font-size:13px; color:var(--mid); font-weight:600; }

.hw-section-head {
  display:flex;
  align-items:center;
  gap:8px;
  padding:14px 20px 8px;
}
.hw-section-dot { width:8px; height:8px; border-radius:50%; flex-shrink:0; }
.hw-section-label { font-size:11px; font-weight:800; text-transform:uppercase; letter-spacing:1px; color:var(--text); }
.hw-section-count { font-size:10px; font-weight:700; color:var(--mid); margin-left:auto; }

.hw-topic-cards { padding:0 20px; display:flex; flex-direction:column; gap:10px; margin-bottom:10px; }
.hw-topic-card {
  background:var(--surface);
  border:2px solid var(--border);
  border-radius:16px;
  overflow:visible;
  cursor:pointer;
  transition:transform 0.15s, box-shadow 0.15s;
  border-bottom-width:3px;
}
.hw-topic-card:hover { transform:translateY(-2px); box-shadow:0 8px 20px rgba(0,0,0,0.07); }
.hw-topic-banner { height:4px; }
.hw-topic-body { display:flex; align-items:center; gap:12px; padding:14px 16px; }
.hw-topic-icon { font-size:28px; flex-shrink:0; }
.hw-topic-info { flex:1; min-width:0; }
.hw-topic-name { font-size:14px; font-weight:800; color:var(--text); margin-bottom:2px; }
.hw-topic-meta { font-size:11px; font-weight:600; color:var(--mid); margin-bottom:8px; }
.hw-topic-progress-label { display:flex; justify-content:space-between; font-size:10px; font-weight:700; color:var(--mid); margin-bottom:4px; }
.hw-topic-bar-outer { height:5px; background:var(--border); border-radius:3px; }
.hw-topic-bar-inner { height:100%; border-radius:3px; transition:width 0.4s; }
.hw-topic-arrow { width:32px; height:32px; border-radius:10px; display:flex; align-items:center; justify-content:center; font-size:14px; font-weight:800; flex-shrink:0; }
.hw-empty { text-align:center; padding:40px 20px; color:var(--mid); font-weight:700; }
.hw-empty-icon { font-size:40px; margin-bottom:10px; }

.act-list-hero {
  padding:20px 20px 18px 24px;
  border-left:4px solid var(--green);
  background:var(--surface);
  margin-bottom:4px;
}
.act-list-eyebrow { font-size:10px; font-weight:800; text-transform:uppercase; letter-spacing:2px; margin-bottom:6px; }
.act-list-title { font-size:22px; font-weight:900; margin-bottom:4px; }
.act-list-sub { font-size:12px; font-weight:600; color:var(--mid); }

.act-cards { padding:0 20px; display:flex; flex-direction:column; gap:10px; }
.act-card {
  background:var(--surface);
  border:2px solid var(--border);
  border-radius:14px;
  display:flex;
  align-items:center;
  gap:0;
  cursor:pointer;
  overflow:visible;
  transition:transform 0.15s;
  border-bottom-width:3px;
}
.act-card:hover { transform:translateY(-2px); }
.act-card.act-done { border-color:#b8f078; border-bottom-color:var(--green-dark); }
.act-card-stripe { width:4px; align-self:stretch; flex-shrink:0; }
.act-card-body { flex:1; padding:14px 12px; }
.act-card-title { font-size:14px; font-weight:800; color:var(--text); margin-bottom:3px; }
.act-card-meta { font-size:11px; font-weight:600; color:var(--mid); margin-bottom:8px; }
.act-card-status { display:flex; align-items:center; gap:8px; }
.act-status-pill {
  font-size:9px; font-weight:800; text-transform:uppercase; letter-spacing:0.5px;
  padding:3px 8px; border-radius:8px;
}
.act-status-new  { background:var(--amber-bg); color:var(--amber); }
.act-status-done { background:var(--green-bg); color:var(--green-dark); }
.act-score-badge { font-size:11px; font-weight:900; color:var(--blue); }
.act-card-right { padding:0 14px; font-size:18px; }

.act-header {
  display:flex;
  align-items:center;
  gap:12px;
  padding:12px 20px;
  border-bottom:1px solid var(--border);
  background:var(--bg);
  position:sticky;
  top:57px;
  z-index:50;
}
.act-header-info { flex:1; }
.act-header-title { font-size:13px; font-weight:800; color:var(--text); }
.act-header-sub { font-size:11px; font-weight:600; color:var(--mid); }

.act-progress-strip { height:6px; background:var(--border); }
.act-progress-fill { height:100%; background:var(--blue); transition:width 0.4s; }

.act-q-counter { padding:10px 20px 0; font-size:11px; font-weight:800; text-transform:uppercase; letter-spacing:1px; color:var(--mid); }

.act-question {
  padding:16px 20px;
}
.act-q-type-tag {
  display:inline-block;
  font-size:9px; font-weight:800; text-transform:uppercase; letter-spacing:0.5px;
  padding:4px 10px; border-radius:10px; margin-bottom:12px;
}
.act-q-type-mc     { background:var(--blue-bg); color:var(--blue-dark); }
.act-q-type-fill   { background:var(--amber-bg); color:#d07a00; }
.act-q-type-drag   { background:var(--purple-bg); color:#7a30d0; }
.act-q-type-match  { background:var(--cyan-bg); color:#009870; }
.act-q-type-listen { background:var(--green-bg); color:var(--green-dark); }
.act-q-type-speak  { background:var(--red-bg); color:#c83030; }

.act-q-text { font-size:17px; font-weight:800; color:var(--text); line-height:1.4; margin-bottom:6px; }
.act-q-hint { font-size:12px; font-weight:600; color:var(--mid); font-style:italic; margin-bottom:6px; }
.act-q-example { font-size:12px; font-weight:700; color:var(--blue); background:var(--blue-bg); padding:8px 12px; border-radius:10px; margin-bottom:10px; }

.mc-options { display:flex; flex-direction:column; gap:8px; margin-top:12px; }
.mc-option {
  display:flex;
  align-items:center;
  gap:12px;
  padding:14px 16px;
  background:var(--surface);
  border:2px solid var(--border);
  border-radius:14px;
  cursor:pointer;
  font-family:'Nunito',sans-serif;
  font-size:14px;
  font-weight:700;
  color:var(--text);
  transition:border-color 0.15s, background 0.15s;
  text-align:left;
}
.mc-option:hover { border-color:var(--blue); }
.mc-option.selected { border-color:var(--blue); background:var(--blue-bg); }
.mc-option.correct  { border-color:var(--green); background:var(--green-bg); }
.mc-option.wrong    { border-color:var(--red); background:var(--red-bg); }
.mc-letter {
  width:28px; height:28px;
  border-radius:8px;
  background:var(--off);
  border:1px solid var(--border);
  display:flex; align-items:center; justify-content:center;
  font-size:11px; font-weight:900;
  flex-shrink:0;
}
.mc-text { flex:1; }

.fill-wrap { margin-top:12px; }
.fill-input {
  width:100%;
  padding:14px 16px;
  border:2px solid var(--border);
  border-radius:14px;
  font-size:15px;
  font-weight:700;
  font-family:'Nunito',sans-serif;
  background:var(--surface);
  color:var(--text);
  outline:none;
  transition:border-color 0.15s;
}
.fill-input:focus { border-color:var(--blue); }
.fill-input.correct { border-color:var(--green); background:var(--green-bg); }
.fill-input.wrong { border-color:var(--red); background:var(--red-bg); }
.fill-input:disabled { opacity:0.8; }

.drag-sentence { font-size:16px; font-weight:700; line-height:2.2; padding:12px 0; }
.drag-blank {
  display:inline-block;
  min-width:80px;
  border-bottom:2px solid var(--blue);
  padding:2px 8px;
  margin:0 4px;
  border-radius:6px;
  cursor:pointer;
  background:var(--blue-bg);
  font-weight:800;
  color:var(--blue-dark);
  transition:border-color 0.15s;
}
.drag-blank.filled { color:var(--text); background:var(--off); border-color:var(--border); }
.drag-pool { display:flex; flex-wrap:wrap; gap:8px; margin-top:16px; }
.drag-chip {
  padding:8px 14px;
  background:var(--surface);
  border:2px solid var(--border);
  border-radius:10px;
  font-size:13px;
  font-weight:800;
  cursor:pointer;
  transition:opacity 0.2s, border-color 0.15s;
}
.drag-chip:hover { border-color:var(--blue); }
.drag-chip.used { opacity:0.3; pointer-events:none; }

.match-wrap { display:grid; grid-template-columns:1fr 1fr; gap:10px; margin-top:12px; }
.match-col { display:flex; flex-direction:column; gap:8px; }
.match-item {
  padding:10px 12px;
  background:var(--surface);
  border:2px solid var(--border);
  border-radius:12px;
  font-size:12px;
  font-weight:800;
  cursor:pointer;
  text-align:center;
  transition:border-color 0.15s, background 0.15s;
}
.match-item:hover { border-color:var(--blue); }
.match-item.selected { border-color:var(--amber); background:var(--amber-bg); }
.match-item.matched  { border-color:var(--green); background:var(--green-bg); color:var(--green-dark); pointer-events:none; }
.match-item.wrong-match { border-color:var(--red); background:var(--red-bg); }

.listen-audio-wrap { margin-top:16px; text-align:center; }
.listen-play-btn {
  padding:14px 28px;
  background:var(--green);
  border:none;
  border-bottom:3px solid var(--green-dark);
  border-radius:14px;
  font-size:15px;
  font-weight:800;
  font-family:'Nunito',sans-serif;
  color:white;
  cursor:pointer;
  margin-bottom:14px;
}
.listen-answer-input { width:100%; padding:12px 14px; border:2px solid var(--border); border-radius:12px; font-size:14px; font-weight:700; font-family:'Nunito',sans-serif; outline:none; }
.listen-answer-input:focus { border-color:var(--blue); }

.speak-wrap { margin-top:16px; text-align:center; }
.speak-target { font-size:28px; font-weight:900; letter-spacing:3px; color:var(--blue); margin-bottom:6px; }
.speak-hint { font-size:12px; font-weight:600; color:var(--mid); margin-bottom:16px; }
.speak-record-btn {
  padding:16px 28px;
  background:var(--red);
  border:none;
  border-bottom:3px solid #c83030;
  border-radius:14px;
  font-size:15px;
  font-weight:800;
  font-family:'Nunito',sans-serif;
  color:white;
  cursor:pointer;
}
.speak-record-btn.recording { background:var(--amber); border-bottom-color:#d07a00; animation:pulse 1s infinite; }
@keyframes pulse { 0%,100% { opacity:1; } 50% { opacity:0.7; } }
.speak-wave-wrap { height:30px; margin:12px 0; display:flex; align-items:center; justify-content:center; gap:3px; }
.speak-wave-bar { width:4px; background:var(--blue); border-radius:2px; height:6px; }
.speak-wave-wrap.active .speak-wave-bar { animation:wave 0.6s ease infinite; }
.speak-wave-bar:nth-child(2) { animation-delay:0.1s; }
.speak-wave-bar:nth-child(3) { animation-delay:0.2s; }
.speak-wave-bar:nth-child(4) { animation-delay:0.3s; }
.speak-wave-bar:nth-child(5) { animation-delay:0.4s; }
@keyframes wave { 0%,100% { height:6px; } 50% { height:22px; } }
.speak-transcript { font-size:13px; font-weight:600; color:var(--mid); min-height:20px; margin-top:6px; }

.act-nav { display:grid; grid-template-columns:1fr 1fr; gap:10px; padding:0 20px 20px; }
.act-btn-check, .act-btn-next {
  padding:14px;
  border-radius:14px;
  font-size:14px;
  font-weight:800;
  font-family:'Nunito',sans-serif;
  cursor:pointer;
  transition:transform 0.1s;
  border:none;
}
.act-btn-check:active, .act-btn-next:active { transform:translateY(2px); }
.act-btn-check { background:var(--off); color:var(--text); border:2px solid var(--border); }
.act-btn-check:disabled { opacity:0.4; cursor:not-allowed; }
.act-btn-next { background:var(--green); color:white; border:2px solid var(--green); border-bottom:3px solid var(--green-dark); }
.act-btn-next:disabled { background:var(--off); color:var(--mid); border-color:var(--border); }

.act-results { padding:20px; }
.act-results-score-ring {
  width:100px; height:100px;
  border-radius:50%;
  border:6px solid var(--border);
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  margin:0 auto 16px;
}
.act-results-score-ring.excellent { border-color:var(--green); }
.act-results-score-ring.good      { border-color:var(--blue); }
.act-results-score-ring.ok        { border-color:var(--amber); }
.act-results-score-ring.bad       { border-color:var(--red); }
.act-results-score-n { font-size:22px; font-weight:900; }
.act-results-score-l { font-size:10px; font-weight:800; text-transform:uppercase; letter-spacing:1px; color:var(--mid); }
.act-results-title { font-size:26px; font-weight:900; text-align:center; margin-bottom:6px; }
.act-results-sub { font-size:13px; font-weight:600; color:var(--mid); text-align:center; margin-bottom:20px; }

.act-review-list { display:flex; flex-direction:column; gap:8px; margin-bottom:20px; }
.act-review-item {
  display:flex;
  align-items:flex-start;
  gap:10px;
  padding:12px 14px;
  border-radius:12px;
  border:2px solid var(--border);
}
.act-review-item.r-correct { border-color:#b8f078; background:var(--green-bg); }
.act-review-item.r-wrong   { border-color:#ffb0b0; background:var(--red-bg); }
.act-review-icon { font-size:16px; flex-shrink:0; margin-top:1px; }
.act-review-q { font-size:12px; font-weight:700; color:var(--text); }
.act-review-correct-ans { font-size:11px; font-weight:700; color:var(--green-dark); margin-top:3px; }
.act-retry-btn {
  display:block; width:100%;
  padding:14px;
  background:var(--blue);
  border:none;
  border-bottom:3px solid var(--blue-dark);
  border-radius:14px;
  font-size:14px; font-weight:800;
  font-family:'Nunito',sans-serif;
  color:white; cursor:pointer; margin-bottom:10px;
}
.act-back-btn-results {
  display:block; width:100%;
  padding:13px;
  background:var(--off);
  border:2px solid var(--border);
  border-radius:14px;
  font-size:14px; font-weight:800;
  font-family:'Nunito',sans-serif;
  color:var(--text); cursor:pointer;
}

/* ══ TEACHER PAGE ══ */
.lock-screen {
  display:flex;
  flex-direction:column;
  align-items:center;
  padding:60px 30px 40px;
  text-align:center;
}
.lock-icon { font-size:52px; margin-bottom:16px; }
.lock-title { font-size:22px; font-weight:900; margin-bottom:8px; }
.lock-sub { font-size:13px; font-weight:600; color:var(--mid); margin-bottom:24px; line-height:1.6; }
.lock-input {
  width:100%; max-width:240px;
  padding:14px 16px;
  border:2px solid var(--border);
  border-radius:14px;
  font-size:18px;
  font-family:'Nunito',sans-serif;
  font-weight:800;
  text-align:center;
  letter-spacing:8px;
  outline:none;
  background:var(--surface);
  color:var(--text);
  margin-bottom:10px;
}
.lock-input:focus { border-color:var(--blue); }
.lock-error {
  color:var(--red);
  font-size:12px;
  font-weight:800;
  margin-bottom:12px;
  display:none;
}
.lock-btn {
  width:100%; max-width:240px;
  padding:14px;
  background:var(--green);
  border:none;
  border-bottom:3px solid var(--green-dark);
  border-radius:14px;
  font-size:15px; font-weight:800;
  font-family:'Nunito',sans-serif;
  color:white; cursor:pointer;
}

.teacher-subnav {
  display:flex;
  background:var(--surface);
  border-bottom:2px solid var(--border);
  position:sticky;
  top:57px;
  z-index:80;
}
.t-tab {
  flex:1;
  padding:12px 8px;
  background:none;
  border:none;
  font-size:13px;
  font-weight:800;
  font-family:'Nunito',sans-serif;
  color:var(--mid);
  cursor:pointer;
  border-bottom:2px solid transparent;
  margin-bottom:-2px;
  transition:color 0.2s;
}
.t-tab.active { color:var(--green); border-bottom-color:var(--green); }

.t-subpage { display:none; }
.t-subpage.active { display:block; }

.teacher-hero { padding:22px 20px 16px; }
.teacher-eyebrow { font-size:10px; font-weight:800; text-transform:uppercase; letter-spacing:2px; color:var(--amber); margin-bottom:8px; }

.stats-row {
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:10px;
  padding:0 20px;
  margin-bottom:4px;
}
.stat-card { background:var(--surface); border:2px solid var(--border); border-radius:14px; padding:14px; text-align:center; overflow:visible; }
.stat-n2 { font-size:26px; font-weight:900; color:var(--blue); }
.stat-l2 { font-size:10px; font-weight:800; text-transform:uppercase; letter-spacing:1px; color:var(--mid); }

.class-list { padding:0 20px; display:flex; flex-direction:column; gap:10px; }
.class-card {
  background:var(--surface);
  border:2px solid var(--border);
  border-radius:16px;
  cursor:pointer;
  overflow:visible;
  transition:transform 0.15s;
  border-bottom-width:3px;
}
.class-card:hover { transform:translateY(-2px); }
.class-card-head { display:flex; align-items:center; gap:12px; padding:14px 16px 10px; }
.class-color-bar { width:4px; height:36px; border-radius:2px; flex-shrink:0; }
.class-info { flex:1; }
.class-name { font-size:14px; font-weight:800; color:var(--text); }
.class-meta { font-size:11px; font-weight:600; color:var(--mid); }
.class-count { font-size:18px; font-weight:900; color:var(--blue); }
.class-count-l { font-size:9px; font-weight:800; text-transform:uppercase; letter-spacing:1px; color:var(--mid); }
.progress-label { display:flex; justify-content:space-between; font-size:10px; font-weight:700; color:var(--mid); margin-bottom:5px; }
.progress-bar-outer { height:6px; background:var(--border); border-radius:3px; }
.progress-bar-inner { height:100%; border-radius:3px; transition:width 0.4s; }
.class-foot { padding:8px 16px 14px; display:flex; flex-wrap:wrap; gap:6px; }
.topic-pill {
  font-size:10px; font-weight:700;
  padding:3px 8px;
  border-radius:8px;
  background:var(--off);
  color:var(--mid);
  border:1px solid var(--border);
}
.topic-pill.done { background:var(--green-bg); color:var(--green-dark); border-color:#b8f078; }

.student-list { padding:0 20px; display:flex; flex-direction:column; gap:8px; }
.student-row {
  display:flex;
  align-items:center;
  gap:12px;
  padding:12px 14px;
  background:var(--surface);
  border:2px solid var(--border);
  border-radius:14px;
  cursor:pointer;
  transition:transform 0.15s;
}
.student-row:hover { transform:translateY(-1px); }
.avatar {
  width:40px; height:40px;
  border-radius:12px;
  display:flex; align-items:center; justify-content:center;
  font-size:13px; font-weight:900;
  color:white; flex-shrink:0;
}
.student-body { flex:1; }
.student-name { font-size:14px; font-weight:800; color:var(--text); }
.student-meta { font-size:11px; font-weight:600; color:var(--mid); }
.attendance-badge { font-size:11px; font-weight:800; padding:4px 10px; border-radius:10px; background:var(--off); color:var(--mid); }
.att-good { background:var(--green-bg); color:var(--green-dark); }
.att-warn { background:var(--amber-bg); color:var(--amber); }
.att-bad  { background:var(--red-bg); color:var(--red); }

.inner-tabs {
  display:flex;
  background:var(--surface);
  border-bottom:1px solid var(--border);
  overflow-x:auto;
}
.i-tab {
  flex-shrink:0;
  padding:11px 16px;
  background:none;
  border:none;
  font-size:12px; font-weight:800;
  font-family:'Nunito',sans-serif;
  color:var(--mid);
  cursor:pointer;
  border-bottom:2px solid transparent;
  margin-bottom:-1px;
}
.i-tab.active { color:var(--blue); border-bottom-color:var(--blue); }

.detail-hero {
  padding:16px 20px 16px 24px;
  border-left:4px solid var(--blue);
  background:var(--surface);
  border-bottom:1px solid var(--border);
}
.detail-title { font-size:20px; font-weight:900; color:var(--text); margin-bottom:3px; }
.detail-sub { font-size:12px; font-weight:600; color:var(--mid); }

.checklist { padding:0 20px; display:flex; flex-direction:column; gap:8px; }
.check-item {
  display:flex;
  align-items:center;
  gap:10px;
  padding:12px 14px;
  background:var(--surface);
  border:2px solid var(--border);
  border-radius:13px;
  cursor:pointer;
  transition:border-color 0.15s;
}
.check-item.checked { border-color:#b8f078; background:var(--green-bg); }
.check-box {
  width:24px; height:24px;
  border:2px solid var(--border);
  border-radius:7px;
  display:flex; align-items:center; justify-content:center;
  font-size:13px; font-weight:900; color:var(--green-dark);
  flex-shrink:0;
  background:var(--surface);
}
.check-item.checked .check-box { background:var(--green); border-color:var(--green); color:white; }
.check-label { flex:1; font-size:13px; font-weight:700; color:var(--text); }
.check-date { font-size:10px; font-weight:700; color:var(--mid); }

.grade-grid { padding:0 20px; display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.grade-card { background:var(--surface); border:2px solid var(--border); border-radius:14px; padding:14px; overflow:visible; }
.grade-title { font-size:11px; font-weight:800; text-transform:uppercase; letter-spacing:0.5px; color:var(--mid); margin-bottom:8px; }
.grade-input-row { display:flex; align-items:center; gap:6px; }
.grade-input {
  flex:1;
  padding:8px 10px;
  border:2px solid var(--border);
  border-radius:10px;
  font-size:16px; font-weight:900;
  font-family:'Nunito',sans-serif;
  text-align:center;
  outline:none;
  color:var(--blue);
}
.grade-input:focus { border-color:var(--blue); }
.grade-max { font-size:12px; font-weight:800; color:var(--mid); }

.notes-area { padding:0 20px; }
.notes-field {
  width:100%;
  height:160px;
  padding:14px 16px;
  border:2px solid var(--border);
  border-radius:14px;
  font-size:13px; font-weight:600;
  font-family:'Nunito',sans-serif;
  color:var(--text);
  background:var(--surface);
  outline:none;
  resize:none;
  line-height:1.6;
  margin-bottom:10px;
}
.notes-field:focus { border-color:var(--blue); }
.save-btn {
  padding:12px 20px;
  background:var(--blue);
  border:none;
  border-bottom:3px solid var(--blue-dark);
  border-radius:12px;
  font-size:13px; font-weight:800;
  font-family:'Nunito',sans-serif;
  color:white; cursor:pointer;
}
.save-btn.saved { background:var(--green); border-bottom-color:var(--green-dark); }

.modal-overlay {
  position:fixed;
  inset:0;
  background:rgba(0,0,0,0.5);
  z-index:1000;
  display:none;
  align-items:flex-end;
  justify-content:center;
}
.modal-overlay.open { display:flex; }
.modal {
  background:var(--surface);
  border-radius:24px 24px 0 0;
  padding:24px 24px 40px;
  width:100%;
  max-width:520px;
  max-height:85vh;
  overflow-y:auto;
}
.modal-title { font-size:18px; font-weight:900; margin-bottom:4px; }
.modal-sub { font-size:12px; font-weight:600; color:var(--mid); margin-bottom:20px; }
.form-group { margin-bottom:14px; }
.form-label { font-size:11px; font-weight:800; text-transform:uppercase; letter-spacing:0.5px; color:var(--mid); display:block; margin-bottom:6px; }
.form-input {
  width:100%;
  padding:12px 14px;
  border:2px solid var(--border);
  border-radius:12px;
  font-size:14px; font-weight:700;
  font-family:'Nunito',sans-serif;
  background:var(--surface);
  color:var(--text);
  outline:none;
}
.form-input:focus { border-color:var(--blue); }
.modal-actions { display:flex; gap:10px; margin-top:20px; }
.btn-cancel {
  flex:1; padding:13px;
  background:var(--off);
  border:2px solid var(--border);
  border-radius:12px;
  font-size:14px; font-weight:800;
  font-family:'Nunito',sans-serif;
  color:var(--text); cursor:pointer;
}
.btn-primary {
  flex:1; padding:13px;
  background:var(--green);
  border:none;
  border-bottom:3px solid var(--green-dark);
  border-radius:12px;
  font-size:14px; font-weight:800;
  font-family:'Nunito',sans-serif;
  color:white; cursor:pointer;
}

.empty-state { text-align:center; padding:20px; font-size:13px; font-weight:600; color:var(--mid); }

/* ══════════════════════════════════════
   CORREÇÃO DE CONTEÚDO CORTADO
══════════════════════════════════════ */
.card, .act-card, .dest-card, .info-block, .modal, .stat-card, .grade-card {
  overflow: visible;
}

@media (max-height: 700px) {
  body {
    padding-bottom: 110px !important;
  }
  .spacer {
    height: 40px;
  }
}

.page:last-child .spacer:last-child {
  height: 40px;
}

/* ══════════════════════════════════════
   CORREÇÃO PARA PC/DESKTOP
══════════════════════════════════════ */

/* Para telas maiores que 768px (tablet/PC) */
@media (min-width: 768px) {
  body {
    max-width: 100% !important;
    padding: 0 20px 100px !important;
  }
  
  #app {
    max-width: 1200px !important;
    margin: 0 auto !important;
    padding: 28px 24px 100px !important;
  }
  
  /* Cards em grid para PC */
  .app-grid {
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 20px !important;
  }
  
  .hw-topic-cards {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 16px !important;
  }
  
  .act-cards {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 16px !important;
  }
  
  /* Bottom nav centralizado e mais largo */
  .bnav {
    max-width: 100% !important;
    left: 0 !important;
    transform: none !important;
    padding: 12px 0 !important;
  }
  
  .bnav .nbtn {
    max-width: 120px !important;
  }
  
  /* Topbar mais largo */
  .topbar {
    max-width: 100% !important;
  }
  
  /* Cards de pesquisa em grid */
  #search-preview {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 16px !important;
  }
  
  .search-card {
    margin-bottom: 0 !important;
  }
  
  /* TikTok view em PC fica centralizado */
  .tk-video-area {
    max-width: 500px !important;
  }
  
  .tk-quiz-area {
    max-width: 500px !important;
  }
}

/* Para telas muito grandes (acima de 1200px) */
@media (min-width: 1200px) {
  .app-grid {
    grid-template-columns: repeat(4, 1fr) !important;
  }
  
  .hw-topic-cards,
  .act-cards,
  #search-preview {
    grid-template-columns: repeat(3, 1fr) !important;
  }
}

.listen-btn.purple {
  background: #8b5cf6;
  color: white;
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.3);
}

.listen-btn.purple:hover {
  background: #7c3aed;
  transform: translateY(-2px);
}

/* Botão de nível */
.listen-btn.level {
  background: #6b7280;
  color: white;
  box-shadow: 0 2px 8px rgba(107, 114, 128, 0.3);
}

.listen-btn.level:hover {
  background: #4b5563;
  transform: translateY(-2px);
}

/* Modal de nível */
.level-modal {
  max-width: 500px;
}

.level-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 20px 0;
  max-height: 400px;
  overflow-y: auto;
  padding: 4px;
}

.level-option {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
  width: 100%;
}

.level-option:hover {
  background: #eef2ff;
  border-color: #667eea;
  transform: translateX(4px);
}

.level-icon {
  font-size: 2rem;
}

.level-name {
  font-weight: 700;
  font-size: 1.1rem;
  color: #1e293b;
  min-width: 100px;
}

.level-desc {
  font-size: 0.8rem;
  color: #64748b;
  flex: 1;
}

/* Nível ativo (opcional) */
.level-option.active-level {
  background: linear-gradient(135deg, #667eea, #764ba2);
  border-color: #667eea;
}

.level-option.active-level .level-name,
.level-option.active-level .level-desc {
  color: white;
}

/* Badge de nível atual */
.current-level-badge {
  display: inline-block;
  background: #667eea;
  color: white;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 600;
  margin-left: 10px;
}

/* ========== MODAL OVERLAY (O QUE ESTAVA FALTANDO) ========== */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    justify-content: center;
    align-items: center;
}

.modal-overlay.active {
    display: flex !important;
}

.modal {
    background: white;
    border-radius: 24px;
    padding: 24px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: #1e293b;
}

.modal-sub {
    color: #64748b;
    margin-bottom: 20px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 20px;
}

.btn-cancel {
    padding: 10px 20px;
    background: #e2e8f0;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
}

.btn-primary {
    padding: 10px 20px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
}

/* ========== FRASES SALVAS ========== */
.listen-btn.saved {
    background: #10b981;
    color: white;
}

.listen-btn.saved:hover {
    background: #059669;
    transform: translateY(-2px);
}

.saved-section {
    margin-top: 24px;
    padding: 16px;
    background: #f8fafc;
    border-radius: 20px;
}

.saved-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-weight: 700;
    color: #1e293b;
}

.clear-all-btn {
    background: #ef4444;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 12px;
    font-size: 0.7rem;
    cursor: pointer;
}

.clear-all-btn:hover {
    background: #dc2626;
}

.saved-list {
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: 12px;
}

.empty-saved {
    text-align: center;
    color: #94a3b8;
    padding: 20px;
    font-size: 0.85rem;
}

.saved-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: white;
    border-radius: 12px;
    margin-bottom: 8px;
    border: 1px solid #e2e8f0;
}

.saved-item-content {
    flex: 1;
    cursor: pointer;
}

.saved-item-text {
    font-size: 0.85rem;
    font-weight: 500;
    color: #1e293b;
}

.saved-item-level {
    font-size: 0.7rem;
    color: #667eea;
    margin-top: 4px;
}

.saved-item-date {
    font-size: 0.65rem;
    color: #94a3b8;
    margin-top: 2px;
}

.saved-item-actions {
    display: flex;
    gap: 8px;
}

.remove-saved-btn {
    background: #fee2e2;
    border: none;
    padding: 6px 10px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.7rem;
    color: #ef4444;
}

.remove-saved-btn:hover {
    background: #fecaca;
}

.share-btn {
    width: 100%;
    background: linear-gradient(135deg, #25D366, #128C7E);
    color: white;
    border: none;
    padding: 10px;
    border-radius: 40px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    margin-top: 8px;
}

.share-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}