:root {
  color-scheme: light;
  --lotus: #ef3f7d;
  --bamboo: #16884a;
  --rice: #ffd255;
  --aodai: #082767;
  --river: #0e76bc;
  --ink: #17213a;
  --muted: #63708a;
  --paper: #fff7e8;
  --card: #ffffff;
  --line: #d8e1ee;
  --mint: #dff6e7;
  --peach: #ffe6c7;
  --sky: #dceeff;
  --shadow: 0 20px 52px rgba(15, 35, 75, 0.16);
  --shadow-soft: 0 12px 26px rgba(15, 35, 75, 0.1);
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
}

.home-shell,
.mobile-course-shell {
  width: min(1180px, calc(100% - 24px));
}

.home-shell {
  width: min(1500px, calc(100% - 48px));
}

.home-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.95fr) minmax(360px, 0.92fr);
  grid-template-areas:
    "hero entries"
    "dashboard scenes"
    "cheer scenes";
  gap: 18px;
  padding-top: 16px;
  padding-bottom: 34px;
}

.courses-shell {
  width: min(1180px, calc(100% - 24px));
}

.home-hero {
  grid-area: hero;
  position: relative;
  overflow: hidden;
  display: flex;
  min-height: 410px;
  flex-direction: column;
  justify-content: space-between;
  padding: 32px;
  background:
    linear-gradient(90deg, rgba(255, 247, 232, 0.98) 0%, rgba(255, 247, 232, 0.82) 36%, rgba(255, 247, 232, 0.12) 78%),
    linear-gradient(180deg, rgba(255, 210, 85, 0.1), rgba(255, 255, 255, 0.08)),
    url("../assets/home-banner-vietnamese-app.png") 66% center / auto 100% no-repeat,
    #fff9ed;
  border: 1px solid rgba(8, 39, 103, 0.16);
  border-radius: 22px;
  box-shadow: 0 30px 86px rgba(15, 35, 75, 0.16);
}

.home-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, transparent 62%, rgba(255, 247, 232, 0.82));
  pointer-events: none;
}

.home-brand-badge {
  position: relative;
  z-index: 1;
  display: flex;
  width: fit-content;
  align-items: center;
  gap: 10px;
  padding: 8px 14px 8px 8px;
  color: var(--aodai);
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(8, 39, 103, 0.12);
  border-radius: 999px;
  box-shadow: 0 14px 32px rgba(15, 35, 75, 0.12);
  backdrop-filter: blur(14px);
}

.home-brand-badge span {
  overflow: hidden;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  background: var(--rice);
  border-radius: 50%;
}

.home-brand-badge img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.home-brand-badge strong {
  font-size: 15px;
  line-height: 1;
}

.home-hero-copy {
  position: relative;
  z-index: 1;
  width: min(610px, 100%);
}

.home-hero h1 {
  position: relative;
  z-index: 1;
  max-width: 600px;
  margin: 12px 0 12px;
  color: var(--aodai);
  font-size: clamp(46px, 5.5vw, 72px);
  line-height: 0.94;
  letter-spacing: 0;
}

.home-hero h1 span {
  display: block;
}

.home-hero p:not(.ribbon),
.hero-points {
  position: relative;
  z-index: 1;
  max-width: 560px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.hero-subtitle {
  margin: 0;
  font-size: 18px;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 22px;
}

.hero-actions .primary-button {
  min-height: 48px;
  padding: 13px 24px;
  border-radius: 999px;
}

.play-intro {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(8, 39, 103, 0.12);
  border-radius: 999px;
  padding: 10px 16px;
  box-shadow: 0 12px 28px rgba(15, 35, 75, 0.08);
}

.play-intro::before {
  content: "▶";
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  color: var(--aodai);
  background: #fff;
  border-radius: 50%;
}

.hero-points {
  display: grid;
  gap: 8px;
  width: min(500px, 100%);
  padding: 16px;
  margin: 0;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(8, 39, 103, 0.1);
  border-radius: 8px;
  list-style: none;
  backdrop-filter: blur(14px);
}

.hero-points li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.hero-points li::before {
  content: "✓";
  flex: 0 0 auto;
  display: grid;
  width: 20px;
  height: 20px;
  margin-top: 2px;
  place-items: center;
  color: #fff;
  background: var(--bamboo);
  border-radius: 50%;
  font-size: 13px;
  font-weight: 900;
}

.hero-points {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  width: min(560px, 100%);
  padding: 12px 14px;
  border-radius: 14px;
}

.hero-points li {
  display: grid;
  gap: 2px;
  padding: 0 16px;
}

.hero-points li + li {
  border-left: 1px solid rgba(8, 39, 103, 0.1);
}

.hero-points li::before {
  content: none;
}

.hero-points strong {
  color: var(--aodai);
  font-size: 14px;
}

.hero-points span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.daily-phrase-card {
  position: absolute;
  right: 18px;
  bottom: 18px;
  z-index: 2;
  display: grid;
  width: min(280px, calc(100% - 36px));
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(8, 39, 103, 0.12);
  border-radius: 18px;
  box-shadow: 0 16px 38px rgba(15, 35, 75, 0.16);
  backdrop-filter: blur(14px);
}

.daily-phrase-card > span {
  overflow: hidden;
  display: grid;
  width: 50px;
  height: 50px;
  place-items: center;
  background: var(--rice);
  border-radius: 16px;
}

.daily-phrase-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.daily-phrase-card small,
.daily-phrase-card em {
  display: block;
  color: var(--muted);
  font-style: normal;
}

.daily-phrase-card strong {
  display: block;
  color: var(--aodai);
  font-size: 18px;
}

.home-entry-panel {
  grid-area: entries;
  order: 2;
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin: 0;
}

.entry-card {
  position: relative;
  overflow: hidden;
  display: grid;
  min-height: 126px;
  gap: 10px;
  align-content: center;
  padding: 22px 68px 22px 22px;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0.78)),
    linear-gradient(135deg, rgba(14, 118, 188, 0.14), rgba(255, 210, 85, 0.22)),
    var(--card);
  border: 1px solid rgba(8, 39, 103, 0.14);
  border-radius: 18px;
  box-shadow: 0 18px 44px rgba(15, 35, 75, 0.1);
}

.entry-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 6px;
  background: linear-gradient(180deg, var(--rice), var(--river));
}

.entry-card::after {
  content: "01";
  position: absolute;
  right: 18px;
  bottom: 18px;
  color: rgba(8, 39, 103, 0.1);
  font-size: 58px;
  font-weight: 1000;
  line-height: 0.85;
}

.entry-card:nth-child(2)::after {
  content: "02";
}

.entry-card:nth-child(3)::after {
  content: "03";
}

.entry-card span {
  width: fit-content;
  padding: 5px 10px;
  color: var(--aodai);
  background: rgba(255, 210, 85, 0.78);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.entry-card strong {
  color: var(--aodai);
  font-size: 24px;
  line-height: 1.08;
  letter-spacing: 0;
}

.entry-card small {
  max-width: 420px;
  color: var(--muted);
  line-height: 1.55;
}

.entry-card--primary {
  min-height: 126px;
  padding: 22px 80px 22px 24px;
  background:
    linear-gradient(135deg, rgba(8, 39, 103, 0.94), rgba(14, 118, 188, 0.84)),
    linear-gradient(135deg, rgba(255, 210, 85, 0.44), rgba(255, 255, 255, 0)),
    var(--card);
  color: #fff;
  border-color: rgba(8, 39, 103, 0.26);
  box-shadow: 0 28px 72px rgba(8, 39, 103, 0.24);
}

.entry-card--primary::before {
  background: var(--rice);
}

.entry-card--primary::after {
  color: rgba(255, 255, 255, 0.14);
  font-size: 78px;
}

.entry-card--primary span {
  color: var(--aodai);
  background: var(--rice);
}

.entry-card--primary strong,
.entry-card--primary small {
  color: #fff;
}

.entry-card--course {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.96), rgba(220, 238, 255, 0.72)),
    var(--card);
}

.entry-card--vocab {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.96), rgba(255, 230, 199, 0.74)),
    var(--card);
}

.course-type-gateway {
  order: 2;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 14px 0 18px;
}

.type-card {
  position: relative;
  display: grid;
  min-height: 124px;
  gap: 8px;
  padding: 16px;
  color: var(--ink);
  text-align: left;
  background:
    linear-gradient(135deg, rgba(255, 212, 95, 0.24), transparent 58%),
    var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  cursor: pointer;
}

.type-card::after {
  content: "→";
  position: absolute;
  right: 16px;
  bottom: 14px;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: #fff;
  background: var(--aodai);
  border-radius: 999px;
  font-weight: 900;
}

.type-card span {
  width: fit-content;
  padding: 5px 11px;
  color: var(--aodai);
  background: var(--rice);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 900;
}

.type-card strong {
  color: var(--aodai);
  font-size: 21px;
}

.type-card small {
  max-width: calc(100% - 40px);
  color: var(--muted);
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.type-card.is-active {
  border-color: var(--aodai);
  box-shadow: 0 18px 38px rgba(11, 43, 111, 0.18);
}

.vocab-type-card {
  background:
    linear-gradient(135deg, rgba(239, 63, 125, 0.13), transparent 58%),
    var(--card);
}

.home-review-grid {
  order: 4;
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin: 20px 0 28px;
}

.courses-section {
  order: 3;
}

.dashboard {
  order: 4;
}

.course-list {
  padding-bottom: 28px;
}

.mobile-course-shell {
  padding-bottom: 96px;
}

.bottom-action-bar {
  position: fixed;
  bottom: 0;
  left: 50%;
  width: min(100vw, 720px);
  transform: translateX(-50%);
  z-index: 60;
  display: flex;
  gap: 8px;
  padding: 10px max(12px, env(safe-area-inset-left)) calc(12px + env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-right));
  background: linear-gradient(180deg, rgba(255, 247, 232, 0), rgba(255, 247, 232, 0.86) 34%, rgba(255, 247, 232, 0.94));
  border: 0;
  box-shadow: 0 -12px 30px rgba(15, 35, 75, 0.08);
  backdrop-filter: blur(18px);
}

.bottom-action-bar[hidden] {
  display: none !important;
}

.bottom-action-bar .primary-button,
.bottom-action-bar .secondary-button {
  display: grid;
  flex: 1 1 0;
  width: 0;
  min-height: 44px;
  padding: 8px 6px;
  place-items: center;
  text-align: center;
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 18px rgba(8, 39, 103, 0.12);
}

.bottom-action-bar [hidden] {
  display: none !important;
}

[data-theme="dark"] .bottom-action-bar {
  background: linear-gradient(180deg, rgba(11, 18, 34, 0), rgba(11, 18, 34, 0.84) 34%, rgba(11, 18, 34, 0.94));
  box-shadow: 0 -12px 30px rgba(0, 0, 0, 0.24);
}

[data-theme="dark"] {
  color-scheme: dark;
  --ink: #eef4ff;
  --muted: #aebad0;
  --paper: #0b1222;
  --card: #121c31;
  --line: #263955;
  --shadow: 0 18px 45px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Nunito", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 18% 0%, rgba(255, 210, 85, 0.45), transparent 260px),
    linear-gradient(180deg, rgba(14, 118, 188, 0.08), transparent 560px),
    var(--paper);
  overflow-x: hidden;
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 24px;
  justify-content: space-between;
  padding: 12px clamp(14px, 4vw, 44px);
  background: rgba(255, 247, 232, 0.86);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

[data-theme="dark"] .site-header {
  background: rgba(11, 18, 34, 0.88);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 240px;
}

.brand-mark {
  overflow: hidden;
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  background: var(--rice);
  border: 2px solid rgba(8, 39, 103, 0.16);
  border-radius: 14px;
  box-shadow: 0 8px 18px rgba(8, 39, 103, 0.12);
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand strong,
.brand small {
  display: block;
}

.brand small,
.course-card small,
.active-card small {
  color: var(--muted);
}

.top-nav {
  display: flex;
  gap: 8px;
  padding: 6px;
  background: rgba(11, 43, 111, 0.06);
  border-radius: 999px;
}

.top-nav a {
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--aodai);
  font-weight: 800;
}

.home-header {
  display: grid;
  grid-template-columns: auto minmax(420px, 1fr) auto;
  gap: 24px;
  padding: 14px clamp(22px, 4vw, 52px);
  background: rgba(255, 255, 255, 0.78);
}

.home-nav {
  justify-self: center;
  background: transparent;
  gap: 18px;
}

.home-nav a {
  padding: 10px 15px;
  color: var(--ink);
  border-radius: 12px;
}

.home-nav a.is-active {
  color: #0d66e5;
  background: rgba(13, 102, 229, 0.1);
}

.header-search {
  min-width: 260px;
  min-height: 42px;
  padding: 10px 42px 10px 18px;
  color: var(--muted);
  text-align: left;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.76)),
    var(--card);
  border: 1px solid rgba(8, 39, 103, 0.13);
  border-radius: 14px;
  cursor: pointer;
}

.header-search::after {
  content: "⌕";
  float: right;
  color: var(--aodai);
  font-size: 22px;
  line-height: 1;
}

.header-avatar {
  overflow: hidden;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  background: var(--rice);
  border: 1px solid rgba(8, 39, 103, 0.13);
  border-radius: 50%;
}

.header-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.header-actions,
.hero-actions,
.reader-tools,
.quiz-actions,
.card-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.primary-button,
.secondary-button,
.ghost-button,
.icon-button,
.chip {
  border: 0;
  cursor: pointer;
  font-weight: 900;
}

.primary-button,
.secondary-button,
.ghost-button {
  min-height: 42px;
  padding: 11px 18px;
  border-radius: 14px;
}

.audio-variant-toggle {
  display: inline-flex;
  gap: 4px;
  min-height: 42px;
  padding: 4px;
  background: rgba(8, 39, 103, 0.07);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.audio-variant-button {
  min-width: 58px;
  min-height: 32px;
  padding: 6px 12px;
  color: var(--aodai);
  background: transparent;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 900;
}

.audio-variant-button.is-active {
  color: #fff;
  background: var(--aodai);
  box-shadow: 0 5px 12px rgba(8, 39, 103, 0.18);
}

.primary-button {
  color: #fff;
  background: var(--aodai);
  box-shadow: 0 8px 18px rgba(8, 39, 103, 0.26);
}

.secondary-button {
  color: var(--aodai);
  background: var(--rice);
  box-shadow: inset 0 0 0 2px rgba(8, 39, 103, 0.12);
}

.ghost-button {
  color: var(--aodai);
  background: transparent;
  border: 1px solid var(--line);
}

.icon-button {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: var(--aodai);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 50%;
}

main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.hero-section {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(320px, 1.1fr);
  gap: 28px;
  align-items: center;
  padding: 56px 0 22px;
}

.hero-copy h1 {
  margin: 14px 0;
  color: var(--aodai);
  font-size: clamp(44px, 7vw, 92px);
  line-height: 0.95;
}

.hero-copy p:not(.ribbon) {
  max-width: 620px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.8;
}

.ribbon {
  display: inline-block;
  margin: 0;
  padding: 9px 22px;
  color: #111827;
  background: var(--rice);
  border-radius: var(--radius-sm);
  font-weight: 900;
  clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 50%, calc(100% - 18px) 100%, 0 100%);
}

.hero-visual {
  position: relative;
}

.poster-frame {
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: #fff;
  border: 6px solid #fff;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
}

.poster-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.speech-chip {
  position: absolute;
  padding: 13px 18px;
  color: #fff;
  border: 4px solid #fff;
  border-radius: 24px 24px 24px 6px;
  font-size: clamp(18px, 2.4vw, 30px);
  font-weight: 900;
  box-shadow: var(--shadow);
}

.speech-chip--blue {
  top: 7%;
  left: 37%;
  background: #1267d4;
}

.speech-chip--green {
  top: 16%;
  right: 13%;
  background: var(--bamboo);
}

.dashboard,
.split-section,
.course-discovery,
.reader-section,
.quiz-section,
.courses-section {
  margin: 28px 0;
}

.home-shell .dashboard {
  grid-area: dashboard;
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin: 26px 0 0;
  padding: 22px;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(8, 39, 103, 0.12);
  border-radius: 24px;
  box-shadow: 0 24px 70px rgba(15, 35, 75, 0.1);
  backdrop-filter: blur(14px);
}

.dashboard {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.dashboard-title {
  margin: 0;
  color: var(--aodai);
  font-size: clamp(26px, 3vw, 38px);
  line-height: 1.05;
  letter-spacing: 0;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.stat-card,
.progress-panel,
.review-card,
.tips-card,
.course-filter-panel,
.reader-section,
.quiz-section {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.stat-card {
  display: grid;
  min-height: 116px;
  gap: 8px;
  align-content: center;
  justify-items: center;
  padding: 18px 16px;
  text-align: center;
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 247, 232, 0.72)),
    var(--card);
  box-shadow: 0 16px 36px rgba(15, 35, 75, 0.08);
}

.stat-card strong {
  display: block;
  color: var(--aodai);
  font-size: 38px;
  line-height: 1.05;
  letter-spacing: 0;
}

.stat-card--1 {
  background:
    linear-gradient(135deg, rgba(255, 210, 85, 0.3), rgba(255, 255, 255, 0.96)),
    var(--card);
  border-color: rgba(255, 210, 85, 0.72);
}

.stat-label,
.progress-panel span {
  color: var(--muted);
}

.stat-label {
  font-size: 13px;
  font-weight: 900;
  line-height: 1.25;
}

.progress-panel {
  position: relative;
  display: grid;
  gap: 16px;
  min-height: 138px;
  padding: 20px 22px 22px;
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 247, 232, 0.96), rgba(255, 255, 255, 0.9)),
    var(--card);
  box-shadow: inset 0 0 0 1px rgba(8, 39, 103, 0.08);
}

.progress-panel::after {
  content: none;
}

.progress-status {
  margin: 0;
  color: var(--muted);
  font-size: 18px;
  font-weight: 800;
}

.progress-status strong {
  color: var(--aodai);
  font-size: 24px;
}

.progress-lane {
  display: flex;
  align-items: center;
  gap: 10px;
}

.progress-cat {
  overflow: hidden;
  display: grid;
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  place-items: center;
  background: #fff;
  border: 3px solid var(--rice);
  border-radius: 50%;
  box-shadow: 0 10px 22px rgba(15, 35, 75, 0.14);
}

.progress-cat--finish {
  border-color: var(--river);
}

.progress-cat img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.progress-track,
.mini-progress {
  overflow: hidden;
  position: relative;
  z-index: 1;
  display: block;
  height: 10px;
  background: #e7edf6;
  border-radius: 999px;
}

.progress-panel .progress-track {
  height: 18px;
  flex: 1 1 auto;
  background: rgba(8, 39, 103, 0.08);
  border: 1px solid rgba(8, 39, 103, 0.1);
  box-shadow: inset 0 2px 5px rgba(8, 39, 103, 0.08);
}

.progress-track i,
.mini-progress i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--bamboo), var(--river));
}

.progress-panel .progress-track i {
  background: linear-gradient(90deg, var(--rice), var(--bamboo), var(--river));
}

.hot-scenes {
  grid-area: scenes;
  display: grid;
  gap: 14px;
  padding: 22px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(8, 39, 103, 0.12);
  border-radius: 22px;
  box-shadow: 0 22px 56px rgba(15, 35, 75, 0.1);
}

.hot-scenes .panel-head {
  margin: 0;
}

.hot-scenes .panel-head a {
  color: #0d66e5;
  font-size: 13px;
  font-weight: 900;
}

.scene-tile-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.scene-tile {
  display: grid;
  min-height: 82px;
  gap: 8px;
  place-items: center;
  color: var(--aodai);
  text-align: center;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 247, 232, 0.62)),
    var(--card);
  border: 1px solid rgba(8, 39, 103, 0.1);
  border-radius: 10px;
  font-weight: 900;
}

.scene-tile img {
  display: block;
  width: 54px;
  height: 54px;
  object-fit: contain;
  filter: drop-shadow(0 8px 12px rgba(15, 35, 75, 0.12));
}

.scene-tile span {
  display: block;
  line-height: 1;
}

.scene-recommend {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  color: var(--muted);
  background: #fff;
  border: 1px solid rgba(8, 39, 103, 0.1);
  border-radius: 14px;
  font-weight: 800;
}

.scene-recommend a {
  flex: 0 0 auto;
  padding: 8px 13px;
  color: var(--aodai);
  background: rgba(8, 39, 103, 0.06);
  border-radius: 999px;
  font-weight: 900;
}

.home-cheer {
  grid-area: cheer;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 18px;
  align-items: center;
  padding: 18px 24px;
  background:
    linear-gradient(90deg, rgba(255, 210, 85, 0.34), rgba(255, 255, 255, 0.88)),
    var(--card);
  border: 1px solid rgba(255, 210, 85, 0.6);
  border-radius: 20px;
  box-shadow: 0 18px 42px rgba(15, 35, 75, 0.08);
}

.home-cheer > span {
  overflow: hidden;
  display: grid;
  width: 70px;
  height: 70px;
  place-items: center;
  background: var(--rice);
  border-radius: 22px;
}

.home-cheer img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.home-cheer strong,
.home-cheer small {
  display: block;
}

.home-cheer strong {
  color: var(--aodai);
  font-size: 22px;
}

.home-cheer small {
  color: var(--muted);
  line-height: 1.6;
}

.split-section {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 16px;
}

.review-card,
.tips-card,
.quiz-section {
  padding: 22px;
}

.section-heading {
  margin-bottom: 16px;
}

.eyebrow,
.reader-badge,
.card-kicker,
.course-type {
  margin: 0 0 6px;
  color: var(--lotus);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.section-heading h2,
.section-heading h1,
.reader-title {
  margin: 0;
  color: var(--aodai);
  font-size: clamp(26px, 4vw, 40px);
}

.course-filter-panel {
  display: grid;
  gap: 16px;
  padding: 18px;
}

.course-query-field {
  display: grid;
  gap: 8px;
}

.course-query-field span,
.filter-group > span {
  color: var(--aodai);
  font-size: 13px;
  font-weight: 900;
}

.course-query {
  width: 100%;
  min-height: 46px;
  padding: 11px 13px;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  outline: none;
}

.filter-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.filter-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 2px;
}

.course-count {
  color: var(--aodai);
}

.favorites-list {
  display: grid;
  gap: 10px;
}

.favorite-item,
.word-row,
.search-result {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  color: var(--ink);
  text-align: left;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.favorite-item span,
.word-row small,
.search-result span {
  color: var(--muted);
}

.favorite-item em {
  flex: 0 0 auto;
  color: var(--lotus);
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}

.favorites-list--library {
  display: grid;
  gap: 16px;
}

.favorite-group {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 14px;
  background:
    linear-gradient(135deg, rgba(255, 210, 85, 0.22), transparent 48%),
    linear-gradient(180deg, rgba(14, 118, 188, 0.08), transparent 72%),
    #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.favorite-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--aodai);
}

.favorite-group-head span {
  padding: 4px 10px;
  color: var(--lotus);
  background: rgba(239, 63, 125, 0.1);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.favorites-list--library .favorite-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  min-width: 0;
  min-height: 88px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.86);
  border-color: rgba(8, 39, 103, 0.12);
  border-radius: 16px;
  box-shadow: 0 12px 28px rgba(15, 35, 75, 0.08);
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    border-color 160ms ease;
}

.favorites-list--library .favorite-item:hover,
.favorites-list--library .favorite-item:focus-visible {
  border-color: rgba(14, 118, 188, 0.42);
  box-shadow: 0 18px 34px rgba(15, 35, 75, 0.14);
  transform: translateY(-1px);
  outline: none;
}

.favorite-copy {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.favorite-copy strong {
  color: var(--aodai);
  font-size: 22px;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.favorite-copy span {
  color: var(--muted);
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.favorite-meta {
  display: grid;
  justify-items: end;
  gap: 6px;
}

.favorite-meta small {
  width: fit-content;
  padding: 4px 9px;
  color: var(--bamboo);
  background: rgba(22, 136, 74, 0.1);
  border-radius: 999px;
  font-weight: 900;
}

.favorite-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.favorite-actions .icon-button {
  width: 38px;
  height: 38px;
  color: var(--aodai);
  background: #fff;
  border: 1px solid rgba(8, 39, 103, 0.12);
  box-shadow: 0 8px 18px rgba(8, 39, 103, 0.08);
}

.favorite-actions .favorite-remove {
  color: var(--lotus);
  background: rgba(239, 63, 125, 0.08);
}

.vocab-shell {
  width: min(1040px, calc(100% - 24px));
  margin: 0 auto;
}

.vocab-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
  gap: 18px;
  align-items: stretch;
  padding: 28px 0 14px;
}

.vocab-hero-copy {
  position: relative;
  overflow: hidden;
  min-width: 0;
  min-height: 280px;
  padding: 30px;
  background:
    linear-gradient(110deg, rgba(255, 247, 232, 0.96), rgba(255, 255, 255, 0.78)),
    linear-gradient(135deg, rgba(255, 210, 85, 0.18), transparent 58%),
    #fff;
  border: 1px solid rgba(8, 39, 103, 0.14);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
}

.vocab-hero-copy::after {
  content: "á ă â đ ê ô ơ ư";
  position: absolute;
  right: 22px;
  bottom: 18px;
  color: rgba(8, 39, 103, 0.08);
  font-size: clamp(34px, 6vw, 72px);
  font-weight: 900;
  letter-spacing: 0;
  pointer-events: none;
}

.vocab-hero h1 {
  margin: 12px 0 8px;
  color: var(--aodai);
  font-size: clamp(42px, 7vw, 76px);
  line-height: 1;
  letter-spacing: 0;
}

.vocab-hero p:not(.ribbon) {
  max-width: 720px;
  color: var(--muted);
  line-height: 1.75;
  overflow-wrap: anywhere;
}

.vocab-command-card {
  display: grid;
  align-content: space-between;
  gap: 16px;
  min-width: 0;
  padding: 22px;
  color: #fff;
  background:
    linear-gradient(145deg, rgba(14, 118, 188, 0.36), transparent 58%),
    linear-gradient(180deg, #082767, #0b3478);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: var(--radius-lg);
  box-shadow: 0 22px 48px rgba(8, 39, 103, 0.22);
}

.vocab-command-card .primary-button {
  min-height: 50px;
  color: var(--aodai);
  background: var(--rice);
  box-shadow: 0 14px 28px rgba(255, 210, 85, 0.22);
}

.vocab-command-card .primary-button:disabled {
  cursor: not-allowed;
  opacity: 0.54;
}

.vocab-command-card p {
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
  font-weight: 800;
}

.vocab-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.vocab-stats span {
  display: grid;
  gap: 4px;
  min-width: 0;
  min-height: 76px;
  place-items: center;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 16px;
}

.vocab-stats strong {
  font-size: 28px;
  line-height: 1;
}

.vocab-stats small {
  color: rgba(255, 255, 255, 0.72);
  font-weight: 900;
}

.vocab-panel {
  margin: 22px 0 48px;
  min-width: 0;
  padding: 18px;
  background:
    linear-gradient(180deg, rgba(220, 238, 255, 0.45), transparent 180px),
    var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
}

.vocab-panel-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.72fr);
  gap: 16px;
  align-items: end;
  margin-bottom: 14px;
}

.vocab-search {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.vocab-search input {
  width: 100%;
  min-height: 46px;
  padding: 12px 14px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid var(--line);
  border-radius: 14px;
  outline: none;
}

.vocab-search input:focus {
  border-color: var(--river);
  box-shadow: 0 0 0 3px rgba(14, 118, 188, 0.12);
}

.vocab-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.vocab-empty-state {
  display: grid;
  gap: 8px;
  min-height: 180px;
  place-content: center;
  padding: 28px;
  color: var(--muted);
  text-align: center;
  background:
    linear-gradient(135deg, rgba(22, 136, 74, 0.1), transparent 58%),
    rgba(255, 255, 255, 0.72);
  border: 1px dashed var(--line);
  border-radius: var(--radius-lg);
}

.vocab-empty-state strong {
  color: var(--aodai);
  font-size: 20px;
}

.vocab-empty-state p {
  margin: 0;
}

[data-theme="dark"] .vocab-hero-copy,
[data-theme="dark"] .favorite-group,
[data-theme="dark"] .favorites-list--library .favorite-item,
[data-theme="dark"] .vocab-search input,
[data-theme="dark"] .favorite-actions .icon-button,
[data-theme="dark"] .vocab-empty-state {
  background-color: var(--card);
}

[data-theme="dark"] .vocab-hero-copy,
[data-theme="dark"] .favorite-group,
[data-theme="dark"] .favorites-list--library .favorite-item {
  border-color: var(--line);
}

[data-theme="dark"] .favorite-actions .icon-button {
  color: var(--ink);
  border-color: var(--line);
}

[data-theme="dark"] .vocab-hero-copy {
  background:
    linear-gradient(110deg, rgba(18, 28, 49, 0.98), rgba(18, 28, 49, 0.78)),
    linear-gradient(135deg, rgba(255, 210, 85, 0.12), transparent 58%),
    var(--card);
}

[data-theme="dark"] .favorite-group {
  background:
    linear-gradient(135deg, rgba(255, 210, 85, 0.1), transparent 48%),
    linear-gradient(180deg, rgba(14, 118, 188, 0.12), transparent 72%),
    var(--card);
}

[data-theme="dark"] .favorites-list--library .favorite-item,
[data-theme="dark"] .vocab-search input,
[data-theme="dark"] .vocab-empty-state {
  background: rgba(18, 28, 49, 0.86);
}

.empty-note {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.tips-list {
  display: grid;
  gap: 12px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.tips-list li {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 10px;
  align-items: start;
}

.tips-list b {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  color: #fff;
  background: var(--aodai);
  border-radius: 50%;
}

.reader-section {
  overflow: hidden;
  padding: 14px;
}

.reader-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 18px;
  align-items: end;
  padding: 8px 8px 14px;
}

.reader-subtitle {
  max-width: 680px;
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.reader-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 16px;
}

.scene-stage {
  overflow: hidden;
  display: grid;
  place-items: center;
  justify-self: center;
  align-self: start;
  width: fit-content;
  max-width: 100%;
  min-height: 0;
  padding: 0;
  background: #fff;
  border: 2px solid rgba(8, 39, 103, 0.12);
  border-radius: 18px;
  box-shadow: inset 0 0 0 6px rgba(255, 210, 85, 0.14);
}

.scene-media {
  position: relative;
  width: min(100%, var(--scene-width, 1024px));
  aspect-ratio: var(--scene-aspect, 2 / 3);
  background: #fff;
}

.scene-image {
  width: 100%;
  height: 100%;
  object-fit: fill;
  background: #fff;
}

.scene-hotspots {
  position: absolute;
  inset: 0;
  z-index: 2;
}

.scene-stage--calibrating {
  outline: 3px solid rgba(239, 63, 125, 0.5);
  outline-offset: 5px;
}

.scene-media.is-calibrating {
  cursor: crosshair;
}

.scene-media.is-calibrating::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(239, 63, 125, 0.28) 1px, transparent 1px),
    linear-gradient(90deg, rgba(239, 63, 125, 0.28) 1px, transparent 1px);
  background-size: 10% 10%;
}

.calibration-readout {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  padding: 9px 12px;
  color: var(--aodai);
  background: rgba(255, 210, 85, 0.28);
  border: 1px solid rgba(8, 39, 103, 0.14);
  border-radius: var(--radius-sm);
  font-weight: 900;
}

.calibration-toggle.is-active {
  color: #fff;
  background: var(--lotus);
  border-color: transparent;
}

.calibration-output {
  flex: 1 0 100%;
  grid-column: 1 / -1;
  width: 100%;
  min-height: 112px;
  padding: 10px 12px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  resize: vertical;
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 13px;
  line-height: 1.45;
}

.hotspot {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 48px;
  height: 48px;
  padding: 0;
  color: transparent;
  background: transparent;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0;
}

/* 全透明扩散水纹效果 - 使用伪元素创建动画 */
.hotspot::before,
.hotspot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 999px;
  pointer-events: none;
}

/* 第一层水纹 - 初始状态 */
.hotspot::before {
  border: 2px solid rgba(255, 255, 255, 0.6);
  background: transparent;
  animation: ripple 2s ease-out infinite;
}

/* 第二层水纹 - 延迟动画 */
.hotspot::after {
  border: 2px solid rgba(255, 210, 85, 0.4);
  background: transparent;
  animation: ripple 2s ease-out infinite 0.5s;
}

/* 扩散水纹动画 */
@keyframes ripple {
  0% {
    transform: scale(0.5);
    opacity: 1;
  }
  100% {
    transform: scale(2);
    opacity: 0;
  }
}

.hotspot.is-active,
.hotspot:hover {
  background: transparent;
}

/* 悬停和激活状态 - 增强水纹效果 */
.hotspot.is-active::before,
.hotspot:hover::before {
  border-color: rgba(255, 210, 85, 0.8);
  animation: ripple 1.5s ease-out infinite;
}

.hotspot.is-active::after,
.hotspot:hover::after {
  border-color: rgba(255, 255, 255, 0.6);
  animation: ripple 1.5s ease-out infinite 0.3s;
}

/* 校准模式样式 - 保持可见性以便拖拽 */
.hotspot.is-calibrating {
  color: #fff;
  background: rgba(239, 63, 125, 0.86);
  border: 3px solid #fff;
  box-shadow:
    0 0 0 3px rgba(8, 39, 103, 0.22),
    0 8px 20px rgba(15, 35, 75, 0.26);
  cursor: grab;
  touch-action: none;
}

.hotspot.is-calibrating:active {
  cursor: grabbing;
}

.hotspot.is-calibrating::before {
  inset: 12px;
  background: #fff;
  border: 0;
  box-shadow: none;
  animation: none;
}

.hotspot.is-calibrating::after {
  inset: -9px;
  border: 2px dashed rgba(239, 63, 125, 0.72);
  opacity: 1;
  animation: none;
}

.hotspot.is-calibrating:hover::before,
.hotspot.is-calibrating.is-active::before {
  inset: 12px;
  background: #fff;
  border: 0;
  box-shadow: none;
  animation: none;
}

.hotspot:focus-visible {
  outline: 3px solid var(--aodai);
  outline-offset: 4px;
}

.audio-playback-status {
  position: fixed;
  left: 50%;
  bottom: calc(76px + env(safe-area-inset-bottom));
  z-index: 120;
  max-width: min(86vw, 360px);
  padding: 10px 14px;
  color: #fff;
  background: rgba(8, 39, 103, 0.92);
  border-radius: 999px;
  box-shadow: 0 12px 32px rgba(8, 39, 103, 0.24);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.35;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.audio-playback-status.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.audio-playback-status[data-type="error"] {
  background: rgba(198, 54, 70, 0.94);
}

.audio-playback-status[data-type="done"] {
  background: rgba(0, 121, 92, 0.94);
}

.active-card {
  align-self: start;
  min-height: 242px;
  display: grid;
  gap: 18px;
  padding: 20px;
  background:
    linear-gradient(180deg, rgba(255, 210, 85, 0.3), transparent 120px),
    var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.card-meta,
.card-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-meta {
  justify-content: space-between;
}

.card-primary {
  display: grid;
  gap: 8px;
}

.active-card h3 {
  margin: 0;
  color: var(--aodai);
  font-size: 36px;
  line-height: 1.02;
}

.card-translation {
  width: fit-content;
  margin: 0;
  padding: 2px 0;
  color: var(--ink);
  font-size: 24px;
  font-weight: 900;
  line-height: 1.2;
}

.card-toolbar {
  padding-top: 2px;
}

.card-toolbar .icon-button {
  width: 46px;
  height: 46px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 8px 18px rgba(8, 39, 103, 0.1);
}

.learned-pill {
  flex: 0 0 auto;
  padding: 7px 11px;
  color: var(--bamboo);
  background: rgba(22, 136, 74, 0.1);
  border-radius: 999px;
  font-size: 15px;
  font-weight: 900;
}

.learned-pill.is-learned {
  color: #fff;
  background: var(--bamboo);
}

.quiz-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.quiz-row {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

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

.quiz-row .quiz-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.quiz-row .quiz-word {
  color: var(--aodai);
  font-weight: 900;
}

.quiz-row span {
  color: var(--aodai);
  font-weight: 900;
}

/* 播放按钮样式 */
.quiz-play-btn {
  width: 28px;
  height: 28px;
  padding: 0;
  font-size: 14px;
  line-height: 1;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.quiz-play-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  transform: scale(1.05);
}

.quiz-play-btn:active {
  transform: scale(0.95);
}

/* 收藏按钮样式 */
.quiz-favorite-btn {
  width: 28px;
  height: 28px;
  padding: 0;
  font-size: 16px;
  line-height: 1;
  color: var(--muted);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.quiz-favorite-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
  transform: scale(1.05);
}

.quiz-favorite-btn.is-favorited,
.quiz-favorite-btn:has-text("★") {
  color: #f59e0b;
  border-color: #f59e0b;
}

.quiz-row input,
.search-input {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  outline: none;
}

.quiz-row input.is-correct {
  border-color: var(--bamboo);
}

.quiz-row input.is-wrong {
  border-color: var(--lotus);
}

.quiz-actions {
  margin-top: 16px;
}

.quiz-result {
  color: var(--aodai);
  font-weight: 900;
}

.category-filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.chip {
  padding: 9px 15px;
  color: var(--aodai);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
}

.chip.is-active {
  color: #fff;
  background: var(--aodai);
}

.course-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.course-card {
  position: relative;
  display: grid;
  min-height: 236px;
  gap: 10px;
  padding: 14px;
  color: var(--ink);
  text-align: left;
  background:
    linear-gradient(180deg, rgba(255, 210, 85, 0.18), transparent 52%),
    var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
}

.course-thumb {
  overflow: hidden;
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  margin-bottom: 4px;
  background: #fff;
  border: 4px solid #fff;
  border-radius: 18px;
  box-shadow: 0 10px 26px rgba(8, 39, 103, 0.12);
}

.course-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.course-card:not(.course-card--live) {
  opacity: 0.72;
  cursor: default;
}

.course-card.is-selected {
  outline: 4px solid rgba(255, 212, 95, 0.75);
}

.course-number {
  position: absolute;
  top: 20px;
  right: 20px;
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  color: #fff;
  background: var(--aodai);
  border: 3px solid var(--rice);
  border-radius: 50%;
  font-size: 18px;
  font-weight: 900;
}

.course-card strong {
  color: var(--aodai);
  font-size: 23px;
  line-height: 1.16;
}

.course-foot {
  color: var(--muted);
  font-weight: 800;
}

.side-panel {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 80;
  width: min(390px, 92vw);
  height: 100svh;
  padding: 18px;
  background: var(--card);
  border-left: 1px solid var(--line);
  box-shadow: var(--shadow);
  transform: translateX(105%);
  transition: transform 180ms ease-out;
}

.side-panel.is-open {
  transform: translateX(0);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.word-list {
  display: grid;
  max-height: calc(100svh - 90px);
  gap: 10px;
  overflow: auto;
}

.word-row span:first-child {
  display: grid;
  gap: 3px;
}

.modal[hidden] {
  display: none;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: start center;
  padding: 90px 16px 16px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(11, 18, 34, 0.52);
}

.modal-card {
  position: relative;
  width: min(720px, 100%);
  padding: 18px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
}

.search-results {
  display: grid;
  gap: 10px;
  max-height: 56svh;
  margin-top: 14px;
  overflow: auto;
}

.course-loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: max(18px, env(safe-area-inset-top)) 18px max(18px, env(safe-area-inset-bottom));
  background:
    linear-gradient(180deg, rgba(255, 247, 232, 0.94), rgba(255, 247, 232, 0.86)),
    radial-gradient(circle at 18% 12%, rgba(255, 210, 85, 0.38), transparent 270px),
    radial-gradient(circle at 82% 20%, rgba(14, 118, 188, 0.2), transparent 280px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 220ms ease,
    visibility 220ms ease;
}

body.course-assets-loading .course-loading-overlay {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

body.course-assets-loading main,
body.course-assets-loading .bottom-action-bar,
body.course-assets-loading .side-panel {
  visibility: hidden;
  pointer-events: none;
}

.course-loading-card {
  position: relative;
  overflow: hidden;
  display: grid;
  width: min(420px, 100%);
  gap: 12px;
  justify-items: center;
  padding: 28px 24px 24px;
  text-align: center;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.98), rgba(255, 247, 232, 0.9)),
    var(--card);
  border: 1px solid rgba(8, 39, 103, 0.14);
  border-radius: 22px;
  box-shadow: 0 28px 76px rgba(15, 35, 75, 0.18), 0 8px 0 rgba(255, 210, 85, 0.24);
}

.course-loading-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, transparent, rgba(255, 210, 85, 0.18), transparent);
  transform: translateX(-100%);
  animation: course-loading-shine 1.8s ease-in-out infinite;
}

.course-loading-card > * {
  position: relative;
  z-index: 1;
}

.course-loading-mark {
  overflow: hidden;
  display: grid;
  width: 68px;
  height: 68px;
  place-items: center;
  background: var(--rice);
  border: 3px solid rgba(8, 39, 103, 0.12);
  border-radius: 20px;
  box-shadow: 0 14px 28px rgba(8, 39, 103, 0.14);
}

.course-loading-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.course-loading-kicker {
  width: fit-content;
  margin: 0;
  padding: 5px 12px;
  color: var(--aodai);
  background: var(--rice);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.course-loading-card h2 {
  margin: 0;
  color: var(--aodai);
  font-size: 28px;
  line-height: 1.1;
}

.course-loading-card p:not(.course-loading-kicker) {
  max-width: 310px;
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.course-loading-track {
  overflow: hidden;
  width: 100%;
  height: 12px;
  margin-top: 2px;
  background: rgba(8, 39, 103, 0.08);
  border: 1px solid rgba(8, 39, 103, 0.1);
  border-radius: 999px;
}

.course-loading-track i {
  display: block;
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--rice), var(--bamboo), var(--river));
  border-radius: inherit;
  transition: width 180ms ease;
}

.course-loading-progress {
  color: var(--aodai);
  font-size: 13px;
  font-weight: 900;
}

@keyframes course-loading-shine {
  0% {
    transform: translateX(-100%);
  }
  55%,
  100% {
    transform: translateX(100%);
  }
}

@media (max-width: 920px) {
  .site-header,
  .hero-section,
  .dashboard,
  .split-section,
  .reader-layout {
    grid-template-columns: 1fr;
  }

  .site-header {
    display: grid;
  }

  .top-nav {
    justify-content: center;
  }

  .hero-section {
    min-height: auto;
  }

  .home-shell {
    grid-template-columns: 1fr;
    grid-template-areas:
      "hero"
      "entries"
      "dashboard"
      "scenes"
      "cheer";
  }

  .home-hero {
    min-height: 440px;
    background:
      linear-gradient(180deg, rgba(8, 39, 103, 0.14), rgba(255, 247, 232, 0.92) 100%),
      linear-gradient(90deg, rgba(255, 247, 232, 0.98) 0%, rgba(255, 247, 232, 0.72) 43%, rgba(255, 247, 232, 0.1) 100%),
      url("../assets/home-banner-vietnamese-app.png") 68% center / auto 100% no-repeat,
      #fff9ed;
  }

  .home-hero h1 {
    max-width: 460px;
    font-size: 56px;
  }

  .vocab-hero,
  .vocab-panel-head {
    grid-template-columns: 1fr;
  }

  .vocab-command-card {
    min-height: 220px;
  }

  .stats-grid,
  .course-grid,
  .quiz-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .home-entry-panel {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .entry-card {
    min-height: 168px;
    padding-right: 20px;
  }

  .entry-card--primary {
    min-height: 206px;
  }

  .entry-card::after {
    font-size: 44px;
  }

  .home-header {
    grid-template-columns: 1fr;
  }

  .home-nav {
    justify-self: stretch;
    overflow-x: auto;
  }

  .header-search {
    min-width: 0;
    flex: 1 1 auto;
  }
}

@media (max-width: 620px) {
  main {
    width: min(100% - 16px, 1180px);
  }

  .stats-grid,
  .course-grid,
  .home-entry-panel,
  .quiz-list {
    grid-template-columns: 1fr;
  }

  .course-type-gateway {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .brand {
    min-width: 0;
  }

  .header-actions,
  .reader-head {
    align-items: stretch;
  }

  .reader-head {
    display: grid;
  }

  .hotspot {
    width: 38px;
    height: 38px;
  }

  .home-hero h1 {
    max-width: 100%;
    font-size: 34px;
    line-height: 1.02;
    word-break: keep-all;
    margin: 8px 0;
  }

  .home-hero p:not(.ribbon),
  .hero-points {
    font-size: 14px;
    line-height: 1.5;
    max-width: 315px;
  }

  .hero-points {
    gap: 7px;
  }

  .home-hero {
    min-height: 418px;
    padding: 18px 14px 14px;
    background:
      linear-gradient(180deg, rgba(255, 247, 232, 0.99) 0%, rgba(255, 247, 232, 0.94) 43%, rgba(255, 247, 232, 0.48) 70%, rgba(255, 247, 232, 0.08) 100%),
      linear-gradient(90deg, rgba(255, 247, 232, 0.95) 0%, rgba(255, 247, 232, 0.68) 48%, rgba(255, 247, 232, 0.12) 100%),
      url("../assets/home-banner-vietnamese-app.png") 66% center / auto 100% no-repeat;
  }

  .home-entry-panel {
    margin-top: 12px;
  }

  .entry-card {
    min-height: 124px;
    padding: 15px;
  }

  .entry-card--primary {
    min-height: 154px;
    padding: 18px 58px 18px 18px;
  }

  .entry-card::after {
    font-size: 40px;
    right: 12px;
    bottom: 12px;
  }

  .entry-card strong {
    font-size: 24px;
  }

  .hero-actions {
    align-items: stretch;
    flex-direction: column;
    max-width: 220px;
  }

  .daily-phrase-card {
    position: relative;
    right: auto;
    bottom: auto;
    width: 100%;
    margin-top: 12px;
  }

  .scene-tile-grid,
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .home-cheer {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .home-cheer > span {
    justify-self: center;
  }

  .stat-card,
  .progress-panel {
    min-height: 78px;
    padding: 14px;
  }

  .course-type-gateway {
    gap: 10px;
    margin: 8px 0 16px;
  }

  .type-card {
    min-height: 116px;
    padding: 12px;
  }

  .type-card strong {
    font-size: 17px;
  }

  .type-card small {
    font-size: 12px;
    line-height: 1.45;
    max-width: 100%;
  }

  .type-card::after {
    width: 30px;
    height: 30px;
    right: 10px;
    bottom: 10px;
  }

  .vocab-hero {
    padding-top: 20px;
  }

  .vocab-hero-copy,
  .vocab-command-card {
    padding: 18px;
    border-radius: 18px;
  }

  .vocab-hero h1 {
    font-size: 40px;
  }

  .vocab-stats {
    gap: 8px;
  }

  .vocab-stats span {
    min-height: 66px;
    border-radius: 14px;
  }

  .vocab-stats strong {
    font-size: 24px;
  }

  .vocab-panel {
    padding: 14px;
  }

  .favorites-list--library .favorite-item {
    grid-template-columns: minmax(0, 1fr);
  }

  .favorite-meta {
    justify-items: start;
  }

  .favorite-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .site-header {
    gap: 10px;
    padding: 9px 10px;
  }

  .brand small,
  .top-nav {
    display: none;
  }

  .header-actions {
    justify-content: space-between;
  }

  .ghost-button {
    min-height: 38px;
    padding: 8px 10px;
  }

  .reader-section,
  .quiz-section,
  .review-card,
  .tips-card {
    padding: 12px;
    border-radius: 18px;
  }

  .reader-layout {
    gap: 12px;
    min-width: 0;
  }

  .scene-stage,
  .scene-media,
  .reader-section,
  .mobile-course-shell {
    min-width: 0;
    max-width: 100%;
  }

  .active-card {
    min-height: auto;
    padding: 14px;
    gap: 14px;
  }

  .active-card h3 {
    font-size: 30px;
  }

  .card-translation {
    font-size: 20px;
  }

  .course-card {
    min-height: 0;
    padding: 12px;
  }

  .course-thumb {
    aspect-ratio: 16 / 10;
  }

  .course-number {
    width: 38px;
    height: 38px;
    font-size: 16px;
  }

  .scene-media,
  .scene-media[style*="3 / 4"] {
    width: 100%;
  }

  .bottom-action-bar .primary-button,
  .bottom-action-bar .secondary-button {
    font-size: 12px;
    min-width: 0;
    overflow: hidden;
    text-overflow: clip;
    white-space: nowrap;
  }
}

@media (min-width: 780px) {
  .home-review-grid {
    grid-template-columns: 0.9fr 1.1fr;
  }
}

.auth-control {
  display: flex;
  align-items: center;
  gap: 8px;
}

.auth-user {
  display: none;
  max-width: 180px;
  overflow: hidden;
  color: var(--ink);
  font-size: 0.9rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-modal[hidden] {
  display: none;
}

.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 20px;
}

.auth-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 39, 103, 0.52);
}

.auth-card {
  position: relative;
  width: min(420px, 100%);
  padding: 32px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
}

.auth-close {
  position: absolute;
  top: 16px;
  right: 16px;
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.2s ease;
}

.auth-close:hover {
  color: var(--ink);
  background: rgba(8, 39, 103, 0.06);
}

.auth-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 24px;
}

.auth-brand-mark {
  overflow: hidden;
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  background: var(--rice);
  border: 2px solid rgba(8, 39, 103, 0.16);
  border-radius: 14px;
  box-shadow: 0 8px 18px rgba(8, 39, 103, 0.12);
}

.auth-brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.auth-brand-text {
  text-align: left;
}

.auth-brand-text strong {
  display: block;
  color: var(--aodai);
  font-size: 22px;
  line-height: 1.2;
}

.auth-brand-text small {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.auth-header {
  text-align: center;
  margin-bottom: 24px;
}

.auth-header h2 {
  margin: 0 0 6px;
  color: var(--aodai);
  font-size: 28px;
  line-height: 1.2;
}

.auth-header p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 0 0 20px;
}

.auth-tabs button {
  padding: 12px;
  color: var(--muted);
  background: var(--sky);
  border: 1px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
  font-weight: 800;
  font-size: 15px;
  transition: all 0.2s ease;
}

.auth-tabs button.is-active {
  color: #fff;
  background: var(--aodai);
  border-color: var(--aodai);
  box-shadow: 0 4px 12px rgba(8, 39, 103, 0.2);
}

.auth-form {
  display: grid;
  gap: 16px;
}

.auth-form label {
  display: grid;
  gap: 8px;
  color: var(--aodai);
  font-size: 14px;
  font-weight: 800;
}

.auth-form input {
  width: 100%;
  min-height: 48px;
  padding: 12px 16px;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.auth-form input:focus {
  border-color: var(--river);
  box-shadow: 0 0 0 3px rgba(14, 118, 188, 0.12);
}

.auth-form input::placeholder {
  color: var(--muted);
  opacity: 0.6;
}

.auth-error {
  margin: 0;
  color: #b42318;
  font-size: 14px;
  font-weight: 800;
}

.auth-submit {
  width: 100%;
  min-height: 48px;
  margin-top: 4px;
  font-size: 16px;
  border-radius: 12px;
}

.auth-agreement {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  margin: 0;
}

.auth-agreement input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-height: 18px;
  padding: 0;
  flex-shrink: 0;
  margin: 0;
  accent-color: var(--aodai);
  cursor: pointer;
}

.auth-agreement span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.5;
}

.auth-agreement a {
  color: var(--river);
  font-weight: 800;
  text-decoration: underline;
}

.auth-agreement a:hover {
  color: var(--aodai);
}

body[data-route-locked] main,
body[data-route-locked] .bottom-action-bar,
body[data-route-locked] .side-panel {
  visibility: hidden;
  pointer-events: none;
}

body.auth-route-locked main,
body.auth-route-locked .bottom-action-bar,
body.auth-route-locked .side-panel {
  visibility: hidden;
  pointer-events: none;
}

.auth-route-guard {
  display: contents;
}

.auth-modal {
  overflow: auto;
  align-items: center;
  justify-items: center;
  padding: max(18px, env(safe-area-inset-top)) 18px max(18px, env(safe-area-inset-bottom));
}

.auth-backdrop {
  background:
    radial-gradient(circle at 18% 18%, rgba(110, 231, 183, 0.32), transparent 28%),
    radial-gradient(circle at 78% 22%, rgba(28, 176, 246, 0.28), transparent 26%),
    linear-gradient(135deg, rgba(255, 253, 245, 0.96), rgba(229, 247, 239, 0.92));
  backdrop-filter: blur(10px);
}

.auth-card {
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(280px, 0.92fr) minmax(320px, 1fr);
  width: min(900px, 100%);
  max-height: min(760px, calc(100vh - 36px));
  padding: 0;
  background: #fffdf5;
  border: 2px solid rgba(15, 23, 42, 0.08);
  border-radius: 24px;
  box-shadow: 0 26px 70px rgba(17, 24, 39, 0.2), 0 8px 0 rgba(15, 23, 42, 0.08);
}

.auth-close {
  top: 18px;
  right: 18px;
  z-index: 3;
  width: 40px;
  height: 40px;
  color: #64748b;
  background: rgba(255, 255, 255, 0.86);
  border: 2px solid rgba(203, 213, 225, 0.8);
  box-shadow: 0 4px 0 rgba(148, 163, 184, 0.28);
}

.auth-close:hover {
  color: #0f172a;
  background: #ffffff;
  transform: translateY(-1px);
}

.auth-close:active {
  box-shadow: 0 1px 0 rgba(148, 163, 184, 0.28);
  transform: translateY(2px);
}

.auth-visual {
  position: relative;
  overflow: hidden;
  display: grid;
  align-content: space-between;
  min-height: 540px;
  padding: 30px;
  color: #0f172a;
  background:
    linear-gradient(135deg, rgba(88, 204, 2, 0.9), rgba(45, 212, 191, 0.82)),
    url("../assets/home-banner-vietnamese-app.png") center / cover;
}

.auth-visual::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(255, 253, 245, 0.72);
}

.auth-visual::after {
  content: "";
  position: absolute;
  right: -58px;
  bottom: -70px;
  width: 220px;
  height: 220px;
  background: rgba(252, 211, 77, 0.56);
  border: 18px solid rgba(255, 255, 255, 0.52);
  border-radius: 42% 58% 54% 46%;
  transform: rotate(-10deg);
}

.auth-visual > * {
  position: relative;
  z-index: 1;
}

.auth-brand {
  justify-content: flex-start;
  margin: 0;
}

.auth-brand-mark {
  width: 58px;
  height: 58px;
  background: #ffffff;
  border: 3px solid rgba(15, 23, 42, 0.08);
  border-radius: 18px;
  box-shadow: 0 7px 0 rgba(15, 23, 42, 0.1);
}

.auth-brand-text strong {
  color: #0f172a;
  font-size: 24px;
  letter-spacing: 0;
}

.auth-brand-text small {
  color: #334155;
  font-size: 13px;
}

.auth-lesson-stack {
  display: grid;
  gap: 12px;
  margin: 36px 0;
}

.auth-mini-card {
  width: min(270px, 100%);
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.9);
  border: 2px solid rgba(15, 23, 42, 0.08);
  border-bottom-width: 5px;
  border-radius: 18px;
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.08);
}

.auth-mini-card:nth-child(2) {
  justify-self: end;
  border-bottom-color: #1cb0f6;
}

.auth-mini-card:nth-child(3) {
  margin-left: 24px;
  border-bottom-color: #fcd34d;
}

.auth-mini-card-main {
  border-bottom-color: #58a700;
}

.auth-mini-card span,
.auth-mini-card small,
.auth-sync-strip small {
  display: block;
  color: #64748b;
  font-size: 12px;
  font-weight: 900;
}

.auth-mini-card strong {
  display: block;
  margin: 4px 0 2px;
  color: #0f172a;
  font-size: 22px;
  line-height: 1.1;
}

.auth-sync-strip {
  display: grid;
  grid-template-columns: 12px 1fr;
  gap: 2px 10px;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.9);
  border: 2px solid rgba(15, 23, 42, 0.08);
  border-radius: 999px;
}

.auth-sync-strip span {
  grid-row: 1 / 3;
  width: 12px;
  height: 12px;
  background: #58cc02;
  border-radius: 50%;
  box-shadow: 0 0 0 5px rgba(88, 204, 2, 0.16);
}

.auth-sync-strip strong {
  color: #0f172a;
  font-size: 14px;
  line-height: 1;
}

.auth-panel {
  overflow-y: auto;
  display: grid;
  align-content: center;
  padding: 56px 46px 42px;
  background:
    linear-gradient(#ffffff, #ffffff) padding-box,
    linear-gradient(135deg, rgba(255, 253, 245, 0.9), rgba(255, 255, 255, 0.72)) border-box;
}

.auth-header {
  margin: 0 0 22px;
  text-align: left;
}

.auth-kicker {
  margin: 0 0 8px;
  color: #58a700;
  font-size: 12px;
  font-weight: 1000;
  letter-spacing: 0.08em;
}

.auth-header h2 {
  margin: 0 0 8px;
  color: #0f172a;
  font-size: clamp(30px, 4vw, 42px);
  font-weight: 1000;
  line-height: 1.05;
}

.auth-header p {
  max-width: 34rem;
  color: #64748b;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.65;
}

.auth-lock-note {
  margin-top: 12px !important;
  padding: 10px 12px;
  color: #0f5132 !important;
  background: #e8f8df;
  border: 2px solid rgba(88, 204, 2, 0.26);
  border-radius: 14px;
}

.auth-tabs {
  gap: 10px;
  margin: 0 0 20px;
  padding: 5px;
  background: #f1f5f9;
  border: 2px solid #e2e8f0;
  border-radius: 18px;
}

.auth-tabs button {
  min-height: 46px;
  padding: 10px 14px;
  color: #64748b;
  background: transparent;
  border: 0;
  border-radius: 13px;
  box-shadow: none;
  font-size: 15px;
  font-weight: 1000;
}

.auth-tabs button.is-active {
  color: #ffffff;
  background: #58cc02;
  border-color: #58cc02;
  box-shadow: inset 0 -4px 0 rgba(88, 167, 0, 0.8);
}

.auth-form {
  gap: 14px;
}

.auth-form label {
  gap: 7px;
  color: #334155;
  font-size: 13px;
  font-weight: 1000;
}

.auth-form input {
  min-height: 54px;
  padding: 13px 15px;
  color: #0f172a;
  background: #ffffff;
  border: 2px solid #dbe4ef;
  border-bottom-width: 4px;
  border-radius: 15px;
  font-size: 16px;
  font-weight: 800;
}

.auth-form input:hover {
  border-color: #cbd5e1;
}

.auth-form input:focus {
  border-color: #1cb0f6;
  box-shadow: 0 0 0 4px rgba(28, 176, 246, 0.14);
}

.auth-agreement {
  display: flex !important;
  grid-template-columns: none;
  align-items: flex-start;
  padding: 12px;
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: 14px;
}

.auth-agreement[hidden] {
  display: none !important;
}

.auth-agreement span {
  color: #64748b;
  font-size: 13px;
  font-weight: 700;
}

.auth-agreement a {
  color: #0e76bc;
}

.auth-error {
  padding: 11px 12px;
  color: #b42318;
  background: #fff1f0;
  border: 2px solid rgba(180, 35, 24, 0.16);
  border-radius: 14px;
}

.auth-submit {
  min-height: 54px;
  margin-top: 2px;
  color: #ffffff;
  background: #58cc02;
  border: 0;
  border-bottom: 5px solid #58a700;
  border-radius: 16px;
  box-shadow: 0 14px 24px rgba(88, 204, 2, 0.24);
  font-size: 17px;
  font-weight: 1000;
  letter-spacing: 0;
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.auth-submit:hover {
  filter: brightness(1.02);
  transform: translateY(-1px);
}

.auth-submit:active {
  border-bottom-width: 2px;
  box-shadow: 0 8px 18px rgba(88, 204, 2, 0.18);
  transform: translateY(3px);
}

.auth-submit:disabled {
  cursor: wait;
  filter: grayscale(0.25);
  opacity: 0.72;
}

.auth-footnote {
  margin: 16px 0 0;
  color: #94a3b8;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.55;
  text-align: center;
}

@media (max-width: 760px) {
  .auth-modal {
    padding: 10px;
  }

  .auth-card {
    grid-template-columns: 1fr;
    width: min(430px, 100%);
    max-height: calc(100vh - 20px);
    border-radius: 22px;
  }

  .auth-visual {
    min-height: auto;
    padding: 20px 18px 14px;
  }

  .auth-lesson-stack {
    display: none;
  }

  .auth-sync-strip {
    margin-top: 18px;
    border-radius: 18px;
  }

  .auth-panel {
    padding: 28px 20px 24px;
  }

  .auth-header h2 {
    font-size: 30px;
  }

  .auth-close {
    top: 14px;
    right: 14px;
  }
}

@media (max-width: 760px) {
  :root {
    --shadow: 0 14px 34px rgba(15, 35, 75, 0.14);
    --shadow-soft: 0 8px 20px rgba(15, 35, 75, 0.1);
    --radius-lg: 18px;
    --radius-md: 14px;
  }

  body {
    background:
      radial-gradient(circle at 10% 0%, rgba(255, 210, 85, 0.32), transparent 210px),
      linear-gradient(180deg, rgba(14, 118, 188, 0.07), transparent 430px),
      var(--paper);
  }

  .home-shell,
  .courses-shell,
  .vocab-shell,
  .mobile-course-shell,
  main {
    width: min(100% - 16px, 1180px);
  }

  .home-shell {
    gap: 12px;
    padding-top: 10px;
    padding-bottom: 22px;
  }

  .site-header {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    padding: 8px 10px;
  }

  .home-header {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .home-header .header-avatar {
    display: none;
  }

  .brand {
    min-width: 0;
    gap: 9px;
  }

  .brand > span:last-child {
    min-width: 0;
  }

  .brand strong {
    overflow: hidden;
    max-width: 44vw;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 12px;
  }

  .header-actions {
    justify-content: flex-end;
    gap: 7px;
  }

  .home-header .header-actions {
    width: 100%;
    flex-wrap: nowrap;
  }

  .header-search {
    display: none;
    min-width: 0;
    flex: 1 1 auto;
    padding-right: 34px;
  }

  .header-actions .ghost-button.search-open {
    display: none;
  }

  .auth-control {
    min-width: 0;
  }

  .auth-control .ghost-button,
  .auth-control .primary-button,
  .auth-control .secondary-button {
    min-height: 36px;
    padding: 8px 10px;
    border-radius: 12px;
    font-size: 13px;
  }

  .icon-button {
    width: 38px;
    height: 38px;
  }

  .home-hero {
    min-height: auto;
    padding: 16px 14px;
    border-radius: 18px;
    background:
      linear-gradient(180deg, rgba(255, 247, 232, 0.98) 0%, rgba(255, 247, 232, 0.94) 50%, rgba(255, 247, 232, 0.78) 100%),
      url("../assets/home-banner-vietnamese-app.png") 70% bottom / auto 72% no-repeat,
      #fff9ed;
  }

  .home-brand-badge {
    gap: 8px;
    max-width: 100%;
    padding: 6px 10px 6px 6px;
  }

  .home-brand-badge span {
    width: 32px;
    height: 32px;
  }

  .home-brand-badge strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .home-hero-copy {
    width: min(100%, 520px);
  }

  .home-hero h1 {
    margin: 10px 0 8px;
    font-size: clamp(31px, 10vw, 44px);
    line-height: 1.03;
  }

  .hero-subtitle {
    max-width: 92%;
    font-size: 14px;
    line-height: 1.55;
  }

  .hero-actions {
    display: grid;
    grid-template-columns: 1fr;
    width: min(100%, 260px);
    gap: 9px;
    margin-top: 14px;
  }

  .hero-actions .primary-button,
  .play-intro {
    width: 100%;
    min-height: 44px;
    justify-content: center;
  }

  .hero-points {
    grid-template-columns: 1fr;
    width: 100%;
    max-width: 100%;
    gap: 8px;
    padding: 12px;
    margin-top: 12px;
  }

  .hero-points li {
    grid-template-columns: auto 1fr;
    align-items: baseline;
    padding: 0;
  }

  .hero-points li + li {
    border-left: 0;
    border-top: 1px solid rgba(8, 39, 103, 0.09);
    padding-top: 8px;
  }

  .hero-points span {
    font-size: 12px;
  }

  .daily-phrase-card {
    grid-template-columns: 42px minmax(0, 1fr) 38px;
    padding: 10px;
    border-radius: 14px;
  }

  .daily-phrase-card > span {
    width: 42px;
    height: 42px;
    border-radius: 12px;
  }

  .home-entry-panel {
    gap: 10px;
    margin-top: 2px;
  }

  .entry-card,
  .entry-card--primary {
    min-height: 108px;
    padding: 14px 56px 14px 16px;
    border-radius: 16px;
  }

  .entry-card span {
    padding: 4px 9px;
    font-size: 11px;
  }

  .entry-card strong {
    font-size: 21px;
  }

  .entry-card small {
    font-size: 13px;
    line-height: 1.45;
  }

  .home-shell .dashboard,
  .hot-scenes,
  .home-cheer {
    margin-top: 0;
    padding: 14px;
    border-radius: 18px;
  }

  .dashboard-title,
  .section-heading h2,
  .section-heading h1,
  .reader-title {
    font-size: clamp(24px, 8vw, 34px);
    line-height: 1.08;
  }

  .scene-tile-grid,
  .stats-grid {
    gap: 10px;
  }

  .scene-tile {
    min-height: 92px;
    border-radius: 16px;
  }

  .courses-shell {
    padding-bottom: 24px;
  }

  .course-discovery,
  .courses-section,
  .reader-section,
  .quiz-section,
  .vocab-panel {
    margin: 16px 0;
  }

  .course-filter-panel {
    gap: 12px;
    padding: 12px;
    border-radius: 18px;
  }

  .course-query {
    min-height: 44px;
    border-radius: 12px;
  }

  .filter-group,
  .vocab-filter-bar {
    flex-wrap: nowrap;
    margin-inline: -12px;
    padding: 0 12px 2px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
  }

  .filter-group::-webkit-scrollbar,
  .vocab-filter-bar::-webkit-scrollbar {
    display: none;
  }

  .filter-group > span {
    flex: 0 0 auto;
    align-self: center;
  }

  .chip {
    flex: 0 0 auto;
    min-height: 38px;
    padding: 8px 13px;
    white-space: nowrap;
  }

  .filter-summary {
    align-items: stretch;
  }

  .filter-summary .ghost-button {
    flex: 0 0 auto;
  }

  .course-grid {
    gap: 10px;
  }

  .course-card {
    grid-template-columns: 96px minmax(0, 1fr);
    min-height: 0;
    gap: 7px 12px;
    align-items: start;
    padding: 10px;
    border-radius: 16px;
  }

  .course-thumb {
    grid-row: 1 / span 5;
    aspect-ratio: 1;
    margin: 0;
    border-width: 3px;
    border-radius: 14px;
  }

  .course-number {
    top: 16px;
    left: 16px;
    right: auto;
    width: 32px;
    height: 32px;
    border-width: 2px;
    font-size: 13px;
  }

  .course-card strong {
    min-width: 0;
    font-size: 18px;
    line-height: 1.2;
    overflow-wrap: anywhere;
  }

  .course-card small {
    display: -webkit-box;
    min-width: 0;
    overflow: hidden;
    line-height: 1.42;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .course-type,
  .course-foot {
    font-size: 12px;
  }

  .mini-progress {
    height: 8px;
  }

  .vocab-hero {
    gap: 10px;
    padding-top: 14px;
  }

  .vocab-hero-copy {
    min-height: 0;
  }

  .vocab-hero-copy::after {
    right: 12px;
    bottom: 10px;
    font-size: 42px;
  }

  .vocab-hero h1 {
    font-size: clamp(32px, 10vw, 42px);
  }

  .vocab-command-card {
    min-height: 0;
  }

  .vocab-stats span {
    min-height: 62px;
  }

  .vocab-panel-head {
    gap: 10px;
  }

  .reader-section {
    padding: 10px;
  }

  .reader-head {
    gap: 12px;
    padding: 4px 4px 10px;
  }

  .reader-tools {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
    gap: 8px;
  }

  .audio-variant-toggle {
    width: 100%;
  }

  .audio-variant-button {
    flex: 1 1 0;
  }

  .reader-layout {
    gap: 10px;
  }

  .scene-stage {
    width: 100%;
    border-width: 1px;
    border-radius: 16px;
    box-shadow: inset 0 0 0 4px rgba(255, 210, 85, 0.12);
  }

  .scene-media {
    width: 100%;
  }

  .hotspot {
    width: 42px;
    height: 42px;
  }

  .active-card {
    grid-template-columns: minmax(0, 1fr);
    padding: 13px;
    border-radius: 16px;
  }

  .active-card h3 {
    font-size: clamp(26px, 8vw, 34px);
  }

  .card-translation {
    font-size: 19px;
  }

  .card-meta,
  .card-toolbar {
    gap: 8px;
  }

  .card-toolbar .icon-button {
    width: 42px;
    height: 42px;
  }

  .quiz-section {
    padding: 14px;
  }

  .quiz-row {
    padding: 11px;
    border-radius: 14px;
  }

  .quiz-row input,
  .search-input {
    min-height: 44px;
    border-radius: 12px;
  }

  .quiz-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 9px;
  }

  .quiz-actions .primary-button,
  .quiz-actions .secondary-button {
    width: 100%;
  }

  .bottom-action-bar {
    width: 100%;
    gap: 7px;
    padding: 8px max(8px, env(safe-area-inset-left)) calc(9px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-right));
  }

  .bottom-action-bar .primary-button,
  .bottom-action-bar .secondary-button {
    min-height: 42px;
    padding: 8px 6px;
    border-radius: 12px;
    white-space: normal;
    line-height: 1.15;
  }
}

@media (max-width: 430px) {
  .home-hero {
    background:
      linear-gradient(180deg, rgba(255, 247, 232, 0.99) 0%, rgba(255, 247, 232, 0.96) 58%, rgba(255, 247, 232, 0.86) 100%),
      url("../assets/home-banner-vietnamese-app.png") 74% bottom / auto 62% no-repeat,
      #fff9ed;
  }

  .hero-subtitle {
    max-width: 100%;
  }

  .course-card {
    grid-template-columns: 82px minmax(0, 1fr);
    gap: 6px 10px;
  }

  .course-card strong {
    font-size: 17px;
  }

  .course-card small {
    font-size: 12px;
  }

  .filter-summary {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .filter-summary .ghost-button {
    width: 100%;
  }

  .vocab-stats {
    grid-template-columns: 1fr 1fr 1fr;
  }

  .daily-phrase-card small {
    font-size: 11px;
  }
}

@media (max-width: 620px) {
  .home-shell {
    gap: 10px;
  }

  .home-brand-badge,
  .play-intro,
  .hero-points {
    display: none;
  }

  .home-hero {
    padding: 18px 14px 14px;
  }

  .home-hero h1 {
    max-width: 12em;
    margin-top: 2px;
  }

  .hero-subtitle,
  .vocab-hero p:not(.ribbon) {
    display: -webkit-box;
    max-width: 100%;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .hero-actions {
    width: min(100%, 280px);
    margin-top: 12px;
  }

  .daily-phrase-card {
    margin-top: 14px;
  }

  .entry-card,
  .entry-card--primary {
    min-height: 82px;
    gap: 6px;
    padding: 12px 52px 12px 14px;
  }

  .entry-card small {
    display: none;
  }

  .entry-card strong {
    font-size: 20px;
  }

  .home-cheer small,
  .scene-recommend {
    display: none;
  }

  .course-discovery .section-heading,
  .courses-section .eyebrow {
    display: none;
  }

  .course-discovery {
    margin-top: 12px;
  }

  .course-filter-panel {
    gap: 10px;
  }

  .course-filter-status {
    display: none;
  }

  .filter-group > span {
    display: none;
  }

  .filter-summary {
    padding-top: 0;
  }

  .courses-section .section-heading {
    margin-bottom: 10px;
  }

  .course-card {
    grid-template-columns: 78px minmax(0, 1fr);
    padding: 9px;
  }

  .course-thumb {
    border-width: 2px;
    border-radius: 12px;
  }

  .course-number {
    top: 13px;
    left: 13px;
    width: 28px;
    height: 28px;
    font-size: 12px;
  }

  .course-card small {
    display: none;
  }

  .course-card strong {
    font-size: 17px;
  }

  .course-type {
    margin-bottom: 0;
    font-size: 11px;
  }

  .vocab-hero-copy {
    padding-bottom: 18px;
  }

  .vocab-hero-copy::after {
    display: none;
  }

  .vocab-command-card {
    gap: 12px;
  }

  .vocab-command-card p {
    display: none;
  }

  .vocab-panel .section-heading p {
    display: none;
  }

  .favorites-list--library .favorite-item {
    min-height: 74px;
    padding: 12px;
  }

  .favorite-copy strong {
    font-size: 19px;
  }

  .favorite-meta {
    display: none;
  }

  .reader-subtitle,
  .calibration-toggle,
  .calibration-save-official,
  .calibration-readout,
  .calibration-output {
    display: none !important;
  }

  .reader-head {
    padding-bottom: 8px;
  }

  .reader-tools {
    grid-template-columns: 1fr;
  }

  .reader-badge {
    margin-bottom: 2px;
  }

  .active-card {
    gap: 10px;
  }

  .active-card small {
    display: none;
  }

  .card-primary {
    gap: 5px;
  }

  .learned-pill {
    padding: 6px 9px;
    font-size: 13px;
  }

  .quiz-section .section-heading {
    margin-bottom: 10px;
  }

  .quiz-row {
    gap: 7px;
  }
}

@media (max-width: 620px) {
  body {
    font-size: 15px;
  }

  .brand strong {
    font-size: 15px;
    line-height: 1.2;
  }

  .brand small {
    font-size: 11px;
  }

  .ribbon,
  .entry-card span,
  .course-type,
  .eyebrow,
  .reader-badge,
  .card-kicker {
    font-size: 12px;
  }

  .home-hero h1 {
    font-size: 36px;
    line-height: 1.04;
  }

  .hero-subtitle {
    font-size: 14px;
    line-height: 1.55;
  }

  .primary-button,
  .secondary-button,
  .ghost-button,
  .chip,
  .audio-variant-button {
    font-size: 14px;
  }

  .daily-phrase-card small {
    font-size: 11px;
  }

  .daily-phrase-card strong {
    font-size: 18px;
  }

  .daily-phrase-card em {
    font-size: 14px;
  }

  .entry-card strong {
    font-size: 19px;
    line-height: 1.18;
  }

  .dashboard-title,
  .section-heading h2,
  .section-heading h1 {
    font-size: 27px;
    line-height: 1.12;
  }

  .stat-card strong,
  .progress-status strong {
    font-size: 24px;
  }

  .stat-label,
  .progress-status,
  .course-foot,
  .vocab-command-card p,
  .empty-note {
    font-size: 13px;
  }

  .course-card strong {
    font-size: 16px;
    line-height: 1.22;
  }

  .course-count {
    font-size: 16px;
  }

  .course-query,
  .vocab-search input,
  .search-input,
  .quiz-row input {
    font-size: 15px;
  }

  .vocab-hero h1 {
    font-size: 34px;
    line-height: 1.08;
  }

  .vocab-stats strong {
    font-size: 24px;
  }

  .vocab-stats small {
    font-size: 12px;
  }

  .favorite-copy strong {
    font-size: 18px;
    line-height: 1.22;
  }

  .favorite-copy span {
    font-size: 14px;
  }

  .reader-title {
    font-size: 31px;
    line-height: 1.08;
  }

  .card-translation {
    font-size: 18px;
  }

  .active-card h3 {
    font-size: 28px;
    line-height: 1.08;
  }

  .learned-pill {
    font-size: 13px;
  }

  .quiz-row .quiz-word,
  .quiz-row span {
    font-size: 15px;
  }

  .bottom-action-bar .primary-button,
  .bottom-action-bar .secondary-button {
    font-size: 14px;
  }
}

@media (max-width: 430px) {
  .home-hero h1 {
    font-size: 34px;
  }

  .dashboard-title,
  .section-heading h2,
  .section-heading h1 {
    font-size: 25px;
  }

  .reader-title {
    font-size: 29px;
  }

  .vocab-hero h1 {
    font-size: 32px;
  }
}
