/* Thần Châu Hoa Ngữ — Traditional Chinese Learning UI */
@import url('https://fonts.googleapis.com/css2?family=Be+Vietnam+Pro:wght@300;400;500;600;700&display=swap');
/* TW Kai đã cắt nhỏ (woff2 + unicode-range) — trình duyệt chỉ tải chữ đang hiện */
@import url('../fonts/twkai-split/result.css');

/* UVN Mang Cau — tiêu đề trang chủ */
@font-face {
  font-family: 'UVN Mang Cau';
  src: url('../fonts/uvn-mang-cau/UVNMangCau_R.TTF') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'UVN Mang Cau';
  src: url('../fonts/uvn-mang-cau/UVNMangCau_I.TTF') format('truetype');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: 'UVN Mang Cau';
  src: url('../fonts/uvn-mang-cau/UVNMangCau_B.TTF') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'UVN Mang Cau';
  src: url('../fonts/uvn-mang-cau/UVNMangCau_BI.TTF') format('truetype');
  font-weight: 700;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: 'UVN Mang Cau';
  src: url('../fonts/uvn-mang-cau/UVNMangCauNang_R.TTF') format('truetype');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'UVN Mang Cau';
  src: url('../fonts/uvn-mang-cau/UVNMangCauNang_I.TTF') format('truetype');
  font-weight: 300;
  font-style: italic;
  font-display: swap;
}

:root {
  --ink: #3d2b1f;
  --ink-soft: #5c4033;
  --brown: #6b4423;
  --brown-deep: #4a2f1f;
  --brown-btn: #7a4a2a;
  --brown-hover: #5e3820;
  --cream: #f5efe3;
  --cream-dark: #ebe2d0;
  --parchment: #f8f3e8;
  --paper: #fffdf8;
  --border: #d4c4a8;
  --border-soft: #e8dcc8;
  --muted: #8a7a68;
  --success: #3d7a4a;
  --success-bg: #e8f3ea;
  --accent-gold: #c4a35a;
  --shadow: 0 8px 28px rgba(61, 43, 31, 0.08);
  --radius: 14px;
  --radius-sm: 10px;
  --sidebar-w: 240px;
  --font-cjk: 'TW-Kai', 'Microsoft JhengHei', 'Noto Serif TC', serif;
  /* Việt / số / Latin trước — TW-Kai chỉ fallback chữ Hán (unicode-range CJK) */
  --font-display: 'Be Vietnam Pro', 'TW-Kai', system-ui, sans-serif;
  --font-body: 'Be Vietnam Pro', 'TW-Kai', system-ui, sans-serif;
  --font-pinyin: 'Be Vietnam Pro', system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--cream);
  line-height: 1.55;
  min-height: 100vh;
}

/* Chỉ khối chữ Hán → TW Kai */
.zh,
.zh-text,
.focus-zh,
.title_zh,
.hanzi,
.d-speaker strong,
[lang="zh"],
[lang="zh-TW"],
[lang="zh-CN"] {
  font-family: var(--font-cjk);
  -webkit-font-smoothing: antialiased;
}

/* Phiên âm / nghĩa Việt / số — không dùng TW Kai */
.py,
.py-text,
.pinyin,
.vi,
.vi-text,
.d-text .py,
.d-text .vi,
.flash-face .py,
.flash-face .vi,
.vocab-item .py,
.example-card .py,
.char-card .py,
.big-stat,
.stat-card .value,
.account-stats strong,
.journey-stats strong {
  font-family: var(--font-pinyin) !important;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; }
ul { list-style: none; }

/* ---------- Public layout ---------- */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 0.85rem 3.5rem;
  background: rgba(248, 243, 232, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border-soft);
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  color: var(--brown-deep);
  white-space: nowrap;
}

.logo-mark {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(145deg, #8b5e3c, #4a2f1f);
  color: #f5efe3;
  display: grid;
  place-items: center;
  font-family: 'Noto Serif SC', 'TW-Kai', serif;
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 2px 8px rgba(74, 47, 31, 0.25);
  flex-shrink: 0;
}

.logo span.sub {
  display: block;
  font-family: var(--font-body);
  font-size: 0.65rem;
  font-weight: 400;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.nav-main {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--ink-soft);
}

.nav-main a:hover,
.nav-main a.active { color: var(--brown-deep); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.7rem 1.4rem;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
}

.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--brown-btn);
  color: #fff;
  box-shadow: 0 4px 14px rgba(106, 68, 35, 0.28);
}

.btn-primary:hover { background: var(--brown-hover); }

.btn-outline {
  background: transparent;
  color: var(--brown-deep);
  border: 1.5px solid var(--brown);
}

.btn-outline:hover { background: rgba(122, 74, 42, 0.08); }

.btn-ghost {
  background: rgba(255, 253, 248, 0.85);
  color: var(--brown-deep);
  border: 1px solid var(--border);
}

.btn-block { width: 100%; }
.btn-lg { padding: 0.9rem 1.8rem; font-size: 0.95rem; }
.btn-sm { padding: 0.45rem 1rem; font-size: 0.82rem; }

/* ---------- Hero / Homepage ---------- */
body.home-lock {
  overflow: hidden;
  height: 100vh;
  height: 100dvh;
}
body.home-lock .hero {
  height: calc(100vh - 72px);
  height: calc(100dvh - 72px);
  min-height: 0;
}

.hero {
  position: relative;
  min-height: calc(100vh - 72px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Ảnh dừng trên feature-bar; neo đáy ảnh → thuyền/sông lộ rõ */
.hero-bg {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 5.75rem;
  background: url('../images/home-hero-bg.jpg?v=3') center bottom / cover no-repeat;
  z-index: 0;
}

.hero-content {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  text-align: center;
  padding: clamp(2.75rem, 8vh, 5.5rem) 1.5rem 2rem;
}

/* Cả khối chữ cùng trục giữa + cùng tỷ lệ scale */
.hero-copy {
  --hero-scale: clamp(0.55, (100vw - 2.5rem) / 980, 1);
  width: min(100%, 56rem);
  margin: 0 auto 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: calc(0.45rem * var(--hero-scale));
}

.hero-title {
  font-family: 'UVN Mang Cau', 'Be Vietnam Pro', serif;
  font-weight: 700;
  font-style: normal;
  color: var(--brown-deep);
  letter-spacing: 0.01em;
  line-height: 1.22;
  margin: 0;
  text-shadow:
    0 0 24px rgba(245, 239, 227, 0.95),
    0 0 48px rgba(245, 239, 227, 0.9),
    0 1px 0 rgba(255, 253, 248, 0.8);
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: calc(0.28rem * var(--hero-scale));
}
.hero-title-top,
.hero-title-sub {
  display: block;
  width: 100%;
  text-align: center;
  font-size: calc(2.95rem * var(--hero-scale));
  font-weight: 700;
}
.hero-title-sub {
  white-space: nowrap;
}
.hero-sub-a,
.hero-sub-b,
.hero-sub-dash {
  display: inline;
}
.hero-tagline {
  margin: calc(0.35rem * var(--hero-scale)) 0 0;
  width: 100%;
  text-align: center;
  font-family: var(--font-body);
  font-size: calc(0.9rem * var(--hero-scale));
  font-weight: 600;
  letter-spacing: 0.1em;
  /* letter-spacing làm lệch quang học — bù nhẹ */
  padding-left: 0.1em;
  box-sizing: border-box;
  text-transform: uppercase;
  color: var(--brown);
  text-shadow: 0 0 18px rgba(245, 239, 227, 0.95);
  white-space: nowrap;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}

.feature-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  background: rgba(255, 253, 248, 0.72);
  backdrop-filter: blur(6px);
  border-top: 1px solid var(--border-soft);
  padding: 1.1rem 2rem;
}

.feature-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.5rem 1.25rem;
  border-right: 1px solid var(--border-soft);
}

.feature-item:last-child { border-right: none; }

.feature-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--cream-dark);
  display: grid;
  place-items: center;
  color: var(--brown);
  flex-shrink: 0;
}

.feature-icon svg { width: 22px; height: 22px; }

.feature-text strong {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink);
}

.feature-text span {
  font-size: 0.75rem;
  color: var(--muted);
}

/* ---------- Auth pages ---------- */
.auth-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  position: relative;
  padding: clamp(3rem, 8vh, 5.5rem) 1rem clamp(10rem, 28vh, 14rem);
  box-sizing: border-box;
}

.auth-bg {
  position: absolute;
  inset: 0;
  /* Neo đáy ảnh — thuyền nằm dưới form, không bị cắt/che */
  background: url('../images/auth-bg.jpg?v=3') center bottom / cover no-repeat;
  z-index: 0;
}

.auth-card {
  position: relative;
  z-index: 1;
  width: min(420px, calc(100% - 2rem));
  margin: 0;
  background: rgba(255, 253, 248, 0.95);
  border: 1px solid var(--border-soft);
  border-radius: 18px;
  padding: 2.25rem 2rem;
  box-shadow: var(--shadow);
}

.auth-card .logo {
  justify-content: center;
  margin-bottom: 1.75rem;
  flex-direction: column;
  text-align: center;
  gap: 0.5rem;
}

.auth-card h1 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  text-align: center;
  margin-bottom: 1.5rem;
  color: var(--brown-deep);
}

.form-group { margin-bottom: 1.1rem; }

.form-group label {
  display: block;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--ink-soft);
  margin-bottom: 0.4rem;
}

.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--paper);
  color: var(--ink);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
  border-color: var(--brown);
  box-shadow: 0 0 0 3px rgba(122, 74, 42, 0.12);
}

.form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 0.85rem 0 1.35rem;
  font-size: 0.82rem;
  color: var(--muted);
}

.form-row a { color: var(--brown); font-weight: 500; }
.form-row a:hover { text-decoration: underline; }

.checkbox {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  cursor: pointer;
}

.checkbox input { accent-color: var(--brown-btn); width: 15px; height: 15px; }

.social-login {
  margin-top: 1.5rem;
  text-align: center;
}

.social-login p {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.85rem;
  position: relative;
}

.social-login p::before,
.social-login p::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 28%;
  height: 1px;
  background: var(--border);
}

.social-login p::before { left: 0; }
.social-login p::after { right: 0; }

.social-icons {
  display: flex;
  justify-content: center;
  gap: 0.85rem;
}

.social-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--paper);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.social-btn:hover {
  background: var(--cream-dark);
  border-color: var(--brown);
}

.auth-footer {
  text-align: center;
  margin-top: 1.35rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.auth-footer a {
  color: var(--brown);
  font-weight: 600;
}

.auth-footer a:hover { text-decoration: underline; }

/* ---------- Student app shell ---------- */
.app-shell {
  display: flex;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(245, 239, 227, 0.88), rgba(245, 239, 227, 0.95)),
    url('../images/ink-landscape-hero.png?v=20260827b') center 30% / cover fixed;
}

.sidebar {
  width: var(--sidebar-w);
  background:
    linear-gradient(180deg, rgba(243, 235, 224, 0.97) 0%, rgba(235, 226, 208, 0.98) 100%);
  border-right: 1px solid var(--border-soft);
  display: flex;
  flex-direction: column;
  padding: 1.25rem 0.9rem;
  position: sticky;
  top: 0;
  height: 100vh;
  flex-shrink: 0;
  box-shadow: 4px 0 24px rgba(61, 43, 31, 0.04);
}

.sidebar .logo {
  padding: 0.35rem 0.5rem 1.25rem;
  font-size: 0.95rem;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.85rem;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--ink-soft);
  transition: background 0.15s, color 0.15s;
}

.sidebar-nav a:hover { background: rgba(122, 74, 42, 0.08); color: var(--brown-deep); }

.sidebar-nav a.active {
  background: var(--brown-btn);
  color: #fff;
  box-shadow: 0 3px 10px rgba(106, 68, 35, 0.25);
}

.sidebar-nav a svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  opacity: 0.9;
}

.sidebar-footer {
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-soft);
}

.sidebar-footer a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.85rem;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--muted);
}

.sidebar-footer a:hover { color: #a33; background: rgba(170, 50, 50, 0.06); }

.app-main {
  flex: 1;
  padding: 1.75rem 2rem 2.5rem;
  min-width: 0;
  background: transparent;
}

.app-main-ink {
  background:
    linear-gradient(180deg, rgba(248, 243, 232, 0.72), rgba(245, 239, 227, 0.88));
  border-radius: 0;
  min-height: calc(100vh - 56px);
}

.lesson-chip.locked { opacity: 0.45; pointer-events: none; }
.lesson-chip.more-chip .num {
  background: var(--brown-btn);
  color: #fff;
}

.review-banner {
  background: var(--cream-dark);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.65rem 1rem;
  margin-bottom: 1rem;
  font-size: 0.88rem;
  color: var(--ink-soft);
}

.review-banner a {
  color: var(--brown);
  font-weight: 600;
  text-decoration: underline;
}

.admin-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  padding: 1.75rem;
  margin-bottom: 1.5rem;
}

.admin-hero h1 {
  font-family: var(--font-display);
  font-size: 1.55rem;
  color: var(--brown-deep);
  margin: 0.2rem 0 0.35rem;
}

.admin-hero p { color: var(--muted); font-size: 0.92rem; max-width: 36em; }

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.page-header h1 {
  font-family: var(--font-display);
  font-size: 1.55rem;
  color: var(--brown-deep);
}

.page-header .sub {
  font-size: 0.9rem;
  color: var(--muted);
  margin-top: 0.2rem;
}

.breadcrumb {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.85rem;
}

.breadcrumb a:hover { color: var(--brown); }

/* Cards */
.card {
  background: var(--paper);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem 1.35rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.stat-card {
  background: var(--paper);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 1.15rem 1.25rem;
  box-shadow: var(--shadow);
}

.stat-card .label {
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 0.45rem;
}

.stat-card .value {
  font-family: var(--font-display);
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--brown-deep);
}

.stat-card .bar {
  margin-top: 0.65rem;
  height: 6px;
  background: var(--cream-dark);
  border-radius: 99px;
  overflow: hidden;
}

.stat-card .bar > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--brown), var(--accent-gold));
  border-radius: 99px;
}

.section-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--brown-deep);
  margin-bottom: 1rem;
}

/* Learning path */
.path-scroll {
  display: flex;
  gap: 0.85rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  margin-bottom: 1.75rem;
  scrollbar-width: thin;
}

.lesson-chip {
  flex: 0 0 140px;
  background: var(--paper);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 1rem 0.9rem;
  text-align: center;
  box-shadow: var(--shadow);
  transition: border-color 0.2s, transform 0.15s;
}

.lesson-chip:hover { border-color: var(--brown); transform: translateY(-2px); }

.lesson-chip .num {
  width: 36px;
  height: 36px;
  margin: 0 auto 0.55rem;
  border-radius: 50%;
  background: var(--cream-dark);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--brown);
}

.lesson-chip.done .num {
  background: var(--success-bg);
  color: var(--success);
}

.lesson-chip.current {
  border-color: var(--brown);
  background: linear-gradient(180deg, #fffdf8, #f5efe3);
}

.lesson-chip.current .num {
  background: var(--brown-btn);
  color: #fff;
}

.lesson-chip .title {
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 0.2rem;
}

.lesson-chip .meta {
  font-size: 0.72rem;
  color: var(--muted);
}

.continue-card {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 1.25rem;
  background: var(--paper);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.continue-media {
  min-height: 220px;
  background:
    linear-gradient(135deg, rgba(74, 47, 31, 0.12), rgba(245, 239, 227, 0.15)),
    url('../images/ink-bamboo-panel.png') center / cover no-repeat;
  position: relative;
}

.continue-media .play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}

.continue-media .play span {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(255, 253, 248, 0.92);
  display: grid;
  place-items: center;
  box-shadow: var(--shadow);
  color: var(--brown-deep);
}

.continue-body {
  padding: 1.5rem 1.5rem 1.5rem 0.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.continue-body .tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--brown);
  background: var(--cream-dark);
  padding: 0.25rem 0.65rem;
  border-radius: 99px;
  margin-bottom: 0.65rem;
  width: fit-content;
}

.continue-body h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  margin-bottom: 0.45rem;
}

.continue-body p {
  font-size: 0.88rem;
  color: var(--muted);
  margin-bottom: 1rem;
}

.progress-line {
  height: 8px;
  background: var(--cream-dark);
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 0.45rem;
}

.progress-line > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--brown), var(--accent-gold));
}

.progress-meta {
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 1.1rem;
}

/* Lesson page */
.lesson-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 1.25rem;
  align-items: start;
}

.lesson-toc {
  background: var(--paper);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow);
  position: sticky;
  top: 1rem;
}

.lesson-toc h3 {
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 0.75rem;
  padding: 0 0.4rem;
}

.toc-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 0.7rem;
  border-radius: 9px;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--ink-soft);
  margin-bottom: 0.2rem;
}

.toc-item:hover { background: var(--cream); }
.toc-item.active {
  background: var(--brown-btn);
  color: #fff;
}

.toc-item .step {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--cream-dark);
  display: grid;
  place-items: center;
  font-size: 0.72rem;
  font-weight: 700;
  flex-shrink: 0;
}

.toc-item.active .step { background: rgba(255,255,255,0.2); color: #fff; }
.toc-item.done .step { background: var(--success-bg); color: var(--success); }

.lesson-content .video-box {
  background: #1a1410;
  border-radius: var(--radius);
  aspect-ratio: 16 / 9;
  overflow: hidden;
  position: relative;
  margin-bottom: 1.15rem;
  box-shadow: var(--shadow);
}

.lesson-content .video-box .poster {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.9;
  background:
    linear-gradient(180deg, transparent 40%, rgba(0,0,0,0.45)),
    url('../images/ink-landscape-hero.png?v=20260827b') center 50% / cover;
}

.video-controls {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 0.85rem 1rem;
  background: linear-gradient(transparent, rgba(0,0,0,0.65));
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: #fff;
  font-size: 0.78rem;
}

.video-controls .track {
  flex: 1;
  height: 4px;
  background: rgba(255,255,255,0.3);
  border-radius: 99px;
  overflow: hidden;
}

.video-controls .track > span {
  display: block;
  width: 35%;
  height: 100%;
  background: #fff;
}

.lesson-note {
  background: var(--paper);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 1.25rem 1.35rem;
  margin-bottom: 1.15rem;
  box-shadow: var(--shadow);
}

.lesson-note h3 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  margin-bottom: 0.65rem;
}

.lesson-note p { color: var(--ink-soft); font-size: 0.92rem; }

.lesson-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* Quiz */
.quiz-layout {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 1.25rem;
  align-items: start;
}

.q-nav {
  background: var(--paper);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow);
}

.q-nav h3 {
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 0.75rem;
}

.q-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.45rem;
}

.q-grid a {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  border: 1px solid var(--border);
  background: var(--cream);
  color: var(--ink-soft);
}

.q-grid a.current {
  background: var(--brown-btn);
  color: #fff;
  border-color: var(--brown-btn);
}

.q-grid a.answered {
  background: var(--success-bg);
  border-color: #a8d0b0;
  color: var(--success);
}

.quiz-card {
  background: var(--paper);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 1.75rem;
  box-shadow: var(--shadow);
  min-height: 420px;
  display: flex;
  flex-direction: column;
}

.quiz-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.quiz-meta .badge {
  background: var(--cream-dark);
  color: var(--brown);
  padding: 0.3rem 0.75rem;
  border-radius: 99px;
  font-weight: 600;
  font-size: 0.78rem;
}

.quiz-question {
  font-family: var(--font-display);
  font-size: 1.35rem;
  margin-bottom: 0.5rem;
  color: var(--brown-deep);
}

.quiz-question .hanzi { font-size: 1.6rem; }
.quiz-hint { color: var(--muted); font-size: 0.9rem; margin-bottom: 1.5rem; }

.options { display: flex; flex-direction: column; gap: 0.65rem; flex: 1; }

.option {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.9rem 1.1rem;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  background: var(--paper);
}

.option:hover { border-color: var(--brown); background: var(--cream); }

.option.selected,
.option.correct {
  border-color: var(--success);
  background: var(--success-bg);
}

.option .letter {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--cream-dark);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--brown);
  flex-shrink: 0;
}

.option.selected .letter,
.option.correct .letter {
  background: var(--success);
  color: #fff;
}

.quiz-nav-btns {
  display: flex;
  justify-content: space-between;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-soft);
}

/* AI Reading */
.ai-layout {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 1.25rem;
  align-items: start;
}

.practice-panel {
  background: var(--paper);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
  text-align: center;
  min-height: 480px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.practice-panel .hanzi {
  font-family: var(--font-display);
  font-size: 2.75rem;
  font-weight: 700;
  color: var(--brown-deep);
  margin-bottom: 0.65rem;
  letter-spacing: 0.08em;
}

.practice-panel .pinyin {
  font-size: 1.15rem;
  color: var(--brown);
  margin-bottom: 0.35rem;
}

.practice-panel .meaning {
  font-size: 0.95rem;
  color: var(--muted);
  margin-bottom: 2.25rem;
}

.mic-btn {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(145deg, var(--brown-btn), var(--brown-deep));
  color: #fff;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(74, 47, 31, 0.35);
  display: grid;
  place-items: center;
  transition: transform 0.15s, box-shadow 0.2s;
}

.mic-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 10px 28px rgba(74, 47, 31, 0.45);
}

.mic-btn.listening {
  animation: micPulse 1.1s ease-in-out infinite;
  background: linear-gradient(145deg, #a65d2e, #6b3218);
}

.mic-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

@keyframes micPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(166, 93, 46, 0.45); }
  50% { box-shadow: 0 0 0 16px rgba(166, 93, 46, 0); }
}

.mic-btn svg { width: 36px; height: 36px; }

.mic-hint {
  margin-top: 1rem;
  font-size: 0.85rem;
  color: var(--muted);
  max-width: 28rem;
  line-height: 1.45;
}

.heard-text {
  margin-top: 0.85rem;
  padding: 0.55rem 0.85rem;
  border-radius: 10px;
  background: var(--cream);
  border: 1px solid var(--border-soft);
  color: var(--brown-deep);
  font-size: 0.95rem;
  max-width: 100%;
}

.ai-status {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  border: 1px solid var(--border);
  background: var(--paper);
  color: var(--ink-soft);
  white-space: nowrap;
}
.ai-status.listening { background: #f5ebe0; color: #8a5a2b; border-color: #d4b07a; }
.ai-status.done { background: #e8f3ea; color: #2f6b3a; border-color: #a8d0b0; }
.ai-status.warn { background: #f8ecec; color: #8b3a3a; border-color: #e0b4b4; }

.char-card.bad {
  border-color: #d4a0a0;
  background: #faf0f0;
}
.char-card.bad .sc { color: #8b3a3a; }

.result-panel {
  background: var(--paper);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.result-panel h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  margin-bottom: 1.25rem;
  text-align: center;
}

.score-circle {
  width: 140px;
  height: 140px;
  margin: 0 auto 1.25rem;
  border-radius: 50%;
  background: conic-gradient(var(--success) 0% 86%, var(--cream-dark) 86% 100%);
  display: grid;
  place-items: center;
  position: relative;
}

.score-circle::before {
  content: '';
  position: absolute;
  inset: 12px;
  background: var(--paper);
  border-radius: 50%;
}

.score-circle .inner {
  position: relative;
  z-index: 1;
  text-align: center;
}

.score-circle .num {
  font-family: var(--font-display);
  font-size: 1.85rem;
  font-weight: 700;
  color: var(--brown-deep);
  line-height: 1;
}

.score-circle .label {
  font-size: 0.72rem;
  color: var(--muted);
}

.score-bars { display: flex; flex-direction: column; gap: 0.75rem; margin-bottom: 1.25rem; }

.score-row {
  display: grid;
  grid-template-columns: 90px 1fr 40px;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.82rem;
}

.score-row .bar {
  height: 8px;
  background: var(--cream-dark);
  border-radius: 99px;
  overflow: hidden;
}

.score-row .bar > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--brown), var(--success));
  border-radius: 99px;
}

.score-row .pct { text-align: right; font-weight: 600; color: var(--ink-soft); }

.result-actions {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

/* Pronunciation detail */
.char-breakdown {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin: 1.5rem 0;
}

.char-card {
  background: var(--cream);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  text-align: center;
  min-width: 80px;
}

.char-card .hanzi {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--brown-deep);
}

.char-card .py {
  font-size: 0.78rem;
  color: var(--brown);
  margin: 0.2rem 0;
}

.char-card .sc {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--success);
}

.char-card.warn .sc { color: #c47a2a; }
.char-card.bad .sc { color: #b33; }

.tips-box {
  background: var(--cream);
  border-left: 3px solid var(--accent-gold);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 1rem 1.15rem;
  margin-top: 1.25rem;
}

.tips-box h4 {
  font-size: 0.9rem;
  margin-bottom: 0.45rem;
  color: var(--brown-deep);
}

.tips-box ul {
  list-style: disc;
  padding-left: 1.15rem;
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.tips-box li { margin-bottom: 0.3rem; }

/* Lesson result */
.result-layout {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 1.25rem;
  align-items: stretch;
  max-width: 960px;
  margin: 0 auto;
}

.celebrate-card {
  background: var(--paper);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 2.5rem 2rem;
  box-shadow: var(--shadow);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.trophy {
  width: 88px;
  height: 88px;
  margin-bottom: 1.25rem;
  border-radius: 50%;
  background: linear-gradient(145deg, #f0d78c, #c4a35a);
  display: grid;
  place-items: center;
  box-shadow: 0 6px 20px rgba(196, 163, 90, 0.4);
  font-size: 2.25rem;
}

.celebrate-card h2 {
  font-family: var(--font-display);
  font-size: 1.55rem;
  color: var(--brown-deep);
  margin-bottom: 0.45rem;
}

.celebrate-card p {
  color: var(--muted);
  font-size: 0.92rem;
  margin-bottom: 1.5rem;
}

.summary-card {
  background: var(--paper);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 1.75rem;
  box-shadow: var(--shadow);
}

.summary-card h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  margin-bottom: 1.15rem;
}

.summary-list { margin-bottom: 1.5rem; }

.summary-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--border-soft);
  font-size: 0.92rem;
}

.summary-item:last-child { border-bottom: none; }

.summary-item .left {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.check {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--success-bg);
  color: var(--success);
  display: grid;
  place-items: center;
  font-size: 0.72rem;
  font-weight: 700;
}

.final-score {
  text-align: center;
  padding: 1.25rem;
  background: var(--cream);
  border-radius: var(--radius-sm);
  margin-bottom: 1.25rem;
}

.final-score .big {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--brown-deep);
  line-height: 1;
}

.final-score .stars {
  color: var(--accent-gold);
  letter-spacing: 0.15em;
  margin-top: 0.45rem;
  font-size: 1.15rem;
}

/* ---------- App shell v2 (Qilin structure + ink theme) ---------- */
.app-content { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.app-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 1.75rem;
  background: rgba(248, 243, 232, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border-soft);
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-quote {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.88rem;
  color: var(--brown);
  font-family: var(--font-display);
}

.topbar-quote .star { color: var(--accent-gold); }

.topbar-stats {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  font-size: 0.85rem;
  font-weight: 600;
}

.topbar-stats .stat { display: inline-flex; align-items: center; gap: 0.25rem; color: var(--ink-soft); }
.topbar-stats .level { color: var(--brown-deep); letter-spacing: 0.04em; }
.topbar-stats .heart { color: #b54; }
.topbar-stats .avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(145deg, #8b5e3c, #4a2f1f);
  color: #fff; display: grid; place-items: center; font-size: 0.85rem;
}

.eyebrow {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--brown);
  margin-bottom: 0.35rem;
}

.muted { color: var(--muted); font-size: 0.9rem; }
.form-error { background: #fde8e8; color: #a33; padding: 0.65rem 0.85rem; border-radius: 8px; margin-bottom: 1rem; font-size: 0.88rem; }

.card-ink {
  background:
    linear-gradient(135deg, rgba(255,253,248,0.92), rgba(245,239,227,0.88)),
    url('../images/ink-landscape-hero.png?v=20260827b') right center / cover;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.dash-continue {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.75rem 1.75rem;
  margin-bottom: 1.25rem;
}

.dash-continue h1 {
  font-family: var(--font-display);
  font-size: 1.65rem;
  color: var(--brown-deep);
  margin-bottom: 0.35rem;
}

.dash-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 1rem;
}

.quest-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.85rem;
}

.quest-row .progress-line { margin-top: 0.35rem; }
.quest-num { font-weight: 700; color: var(--brown); white-space: nowrap; }
.big-stat { font-family: var(--font-pinyin); font-size: 2.75rem; font-weight: 700; color: var(--brown-deep); line-height: 1; }
.big-stat.accent { color: var(--brown-btn); }

.journey-hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  padding: 1.5rem 1.75rem;
  margin-bottom: 1rem;
}

.journey-hero h1 { font-family: var(--font-display); font-size: 1.45rem; color: var(--brown-deep); }

.journey-stats {
  display: flex;
  gap: 0.75rem;
}

.journey-stats > div {
  background: rgba(255,253,248,0.9);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 0.65rem 1rem;
  text-align: center;
  min-width: 72px;
}

.journey-stats strong { display: block; font-size: 1.25rem; color: var(--brown-deep); }
.journey-stats span { font-size: 0.7rem; color: var(--muted); font-weight: 600; }

.continue-banner {
  display: block;
  padding: 0.95rem 1.25rem;
  margin-bottom: 1.25rem;
  border-radius: var(--radius);
  background:
    linear-gradient(90deg, rgba(74,47,31,0.72), rgba(74,47,31,0.45)),
    url('../images/ink-bamboo-panel.png') center / cover;
  color: #fff;
  font-weight: 600;
  box-shadow: var(--shadow);
}

.book-block {
  background: var(--paper);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1.15rem;
  box-shadow: var(--shadow);
}

.book-block.locked { opacity: 0.72; }
.book-head { display: flex; gap: 1rem; margin-bottom: 1rem; }
.book-icon {
  width: 52px; height: 52px; border-radius: 14px;
  background: var(--cream-dark); display: grid; place-items: center;
  font-size: 1.5rem; flex-shrink: 0;
}
.book-head h2 { font-size: 1.05rem; color: var(--brown-deep); margin-bottom: 0.25rem; }
.book-head h2 .zh { font-family: var(--font-cjk); margin-right: 0.35rem; }
.book-head p { font-size: 0.85rem; color: var(--muted); }
.lock-note { color: var(--brown); font-weight: 600; margin-top: 0.5rem; }

.lesson-path { display: flex; flex-direction: column; gap: 0.55rem; }
.path-item {
  display: flex; align-items: center; gap: 0.85rem;
  padding: 0.75rem 0.9rem; border-radius: 12px;
  border: 1px solid var(--border-soft); background: var(--cream);
}
.path-item.current { border-color: var(--brown); background: linear-gradient(90deg, #f8f3e8, #fffdf8); }
.path-item.done { border-color: #b5d4ba; background: var(--success-bg); }
.path-item.locked { opacity: 0.55; }
.path-node {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--brown-btn); color: #fff;
  display: grid; place-items: center; font-weight: 700; font-size: 0.85rem; flex-shrink: 0;
}
.path-item.done .path-node { background: var(--success); }
.path-item.locked .path-node { background: #aaa; }
.path-body { flex: 1; min-width: 0; }
.path-body .zh { font-family: var(--font-cjk); font-weight: 700; color: var(--brown-deep); }
.path-body .vi { font-size: 0.82rem; color: var(--muted); }

/* Lesson workspace */
.lesson-shell {
  display: grid !important;
  grid-template-columns: 1fr 280px;
  gap: 1rem;
  align-items: start;
}

.lesson-workspace { min-width: 0; }

.dialogue-card {
  display: grid;
  grid-template-columns: 40px 1fr 40px;
  gap: 0.5rem;
  align-items: start;
}

.dialogue-main {
  background: var(--paper);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}

.dialogue-main h2 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--brown-deep);
  margin-bottom: 0.85rem;
  text-align: center;
}

.dialogue-image {
  height: 200px;
  border-radius: 12px;
  background-size: cover;
  background-position: center;
  margin-bottom: 1rem;
  border: 1px solid var(--border-soft);
}

.d-line {
  display: grid;
  grid-template-columns: 110px 1fr 36px;
  gap: 0.65rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border-soft);
}

.d-speaker strong { display: block; font-family: var(--font-cjk); color: var(--brown-deep); }
.d-speaker span { font-size: 0.75rem; color: var(--muted); font-family: var(--font-pinyin); }
.d-text .zh { font-family: var(--font-cjk); font-size: 1.2rem; margin-bottom: 0.2rem; }
.d-text .py { font-size: 0.85rem; color: var(--brown); font-family: var(--font-pinyin); }
.d-text .vi { font-size: 0.85rem; color: var(--muted); margin-top: 0.25rem; font-family: var(--font-pinyin); }

.d-line.tts-active {
  background: rgba(196, 134, 63, 0.18);
  border-radius: 10px;
  margin: 0 -0.35rem;
  padding: 0.75rem 0.35rem;
  border: 2px solid var(--brown-btn);
  box-shadow: inset 4px 0 0 var(--brown-btn), 0 2px 10px rgba(106, 68, 35, 0.12);
  animation: tts-line-pulse 1.1s ease-in-out infinite;
}
.d-line.tts-active .zh {
  color: var(--brown-deep);
  font-weight: 700;
}
.d-line.tts-done {
  opacity: 0.5;
  border-left: 3px solid rgba(139, 90, 43, 0.35);
  padding-left: 0.5rem;
}
@keyframes tts-line-pulse {
  0%, 100% {
    border-color: var(--brown-btn);
    background: rgba(196, 134, 63, 0.16);
  }
  50% {
    border-color: #d4a056;
    background: rgba(212, 160, 86, 0.26);
  }
}

.side-arrow {
  width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--paper);
  display: grid; place-items: center; font-size: 1.25rem;
  color: var(--brown); margin-top: 8rem;
}
.dlg-nav-mobile { display: none; }

.lesson-toolbar {
  display: flex; align-items: center; gap: 0.55rem; flex-wrap: wrap;
  margin-top: 1.15rem; padding-top: 1rem;
  border-top: 1px solid var(--border-soft);
}
.lesson-toolbar.center { justify-content: center; }

.icon-btn {
  width: 32px; height: 32px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--cream);
  cursor: pointer; display: grid; place-items: center;
}

.transition-card {
  max-width: 420px; margin: 2rem auto; text-align: center;
  background: var(--paper); border: 1px solid var(--border-soft);
  border-radius: var(--radius); padding: 2rem 1.5rem; box-shadow: var(--shadow);
}
.trans-done, .trans-next {
  padding: 1rem; border-radius: 12px; margin-bottom: 0.75rem;
}
.trans-done { background: var(--success-bg); }
.trans-next { background: #f3ebe0; }
.badge-ok, .badge-next {
  display: inline-block; font-size: 0.72rem; font-weight: 700;
  letter-spacing: 0.06em; margin-bottom: 0.35rem;
}
.badge-ok { color: var(--success); }
.badge-next { color: var(--brown); }
.trans-line { width: 2px; height: 24px; background: var(--border); margin: 0 auto 0.75rem; }
.transition-card strong { display: block; font-family: var(--font-display); font-size: 1.1rem; }

.grammar-layout {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 1rem;
}
.grammar-card, .example-card {
  background: var(--paper); border: 1px solid var(--border-soft);
  border-radius: var(--radius); padding: 1.35rem; box-shadow: var(--shadow);
}
.grammar-card h2 { font-family: var(--font-display); color: var(--brown); font-size: 1.15rem; margin: 0.75rem 0 0.35rem; }
.grammar-card h3 { font-size: 0.9rem; margin: 1rem 0 0.4rem; color: var(--ink-soft); }
.focus-zh { font-family: var(--font-cjk); font-size: 2.25rem; font-weight: 700; color: var(--brown-deep); }
.callout { border-radius: 10px; padding: 0.85rem 1rem; margin-top: 0.85rem; font-size: 0.88rem; }
.callout.warn { background: #faf0e0; border-left: 3px solid var(--accent-gold); }
.callout.tip { background: #eef4ef; border-left: 3px solid var(--success); }
.callout p { margin-top: 0.35rem; }
.example-card .zh.big { font-family: var(--font-cjk); font-size: 1.55rem; font-weight: 700; margin: 0.75rem 0 0.35rem; }
.progress-line.thin { height: 5px; margin-bottom: 0.75rem; }

.flash-wrap { text-align: center; max-width: 480px; margin: 0 auto; }
.flash-meta { font-weight: 700; color: var(--brown); margin-bottom: 0.85rem; }
.flash-card {
  position: relative; height: 280px; perspective: 1000px; cursor: pointer; margin-bottom: 1.25rem;
}
.flash-face {
  position: absolute; inset: 0;
  background: var(--paper); border: 1px solid var(--border-soft);
  border-radius: 18px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  backface-visibility: hidden; transition: transform 0.45s;
  padding: 1.5rem;
}
.flash-face .zh { font-family: var(--font-cjk); font-size: 3.4rem; font-weight: 700; color: var(--brown-deep); }
.flash-face .hint { margin-top: 0.75rem; color: var(--muted); font-size: 0.85rem; }
.flash-face.back { transform: rotateY(180deg); }
.flash-face.back .py { color: var(--brown); margin: 0.35rem 0; }
.flash-face.back .vi { font-size: 1.05rem; }
.flash-face.back .hv { color: var(--accent-gold); margin-top: 0.5rem; font-weight: 600; }
.flash-card.flipped .front { transform: rotateY(180deg); }
.flash-card.flipped .back { transform: rotateY(360deg); }
.keys-hint { margin-top: 0.75rem; font-size: 0.78rem; }
.center { text-align: center; }

.exercise-wrap {
  background: var(--paper); border: 1px solid var(--border-soft);
  border-radius: var(--radius); padding: 1.75rem; box-shadow: var(--shadow);
  max-width: 720px; margin: 0 auto;
}
.ex-prompt {
  text-align: center; font-size: 1.35rem; color: var(--brown-deep);
  margin: 1rem 0 1.5rem; font-family: var(--font-body);
}
.ex-prompt .zh { font-size: 1.85rem; font-family: var(--font-cjk); }
.fill-sentence {
  font-family: var(--font-body); font-size: 1.45rem;
  margin-top: 0.75rem; letter-spacing: 0.04em;
}
.ex-options { display: flex; flex-direction: column; gap: 0.65rem; }
.option-btn, .opt-form { width: 100%; }
.option-btn {
  display: block; width: 100%; text-align: left;
  padding: 0.95rem 1.15rem; border-radius: 12px;
  border: 1.5px solid var(--border); background: var(--paper);
  cursor: pointer; font-weight: 500; color: var(--ink);
  transition: border-color 0.15s, background 0.15s;
}
.option-btn:hover { border-color: var(--brown); background: var(--cream); }

.match-board { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 1rem; }
.match-col { display: flex; flex-direction: column; gap: 0.55rem; }
.match-item {
  padding: 0.85rem 1rem; border-radius: 12px;
  border: 1.5px solid var(--border); background: var(--cream);
  cursor: pointer; font-family: var(--font-body); font-weight: 600;
}
.match-item.left { font-family: var(--font-cjk); }
.match-item.selected { border-color: var(--brown); background: #f3ebe0; }
.match-item.done { border-color: var(--success); background: var(--success-bg); color: var(--success); pointer-events: none; }
.match-item.wrong { border-color: #c66; background: #fde8e8; }

.lesson-sidepanel {
  background: var(--paper); border: 1px solid var(--border-soft);
  border-radius: var(--radius); box-shadow: var(--shadow);
  position: sticky; top: 64px; max-height: calc(100vh - 80px);
  display: flex; flex-direction: column; overflow: hidden;
}
.side-tabs {
  display: flex; border-bottom: 1px solid var(--border-soft); flex-shrink: 0;
}
.side-tabs button {
  flex: 1; padding: 0.75rem 0.5rem; border: none; background: transparent;
  cursor: pointer; font-weight: 600; font-size: 0.85rem; color: var(--muted);
  border-bottom: 2px solid transparent;
}
.side-tabs button.active { color: var(--brown-deep); border-bottom-color: var(--brown-btn); }
.side-pane { display: none; overflow-y: auto; padding: 0.75rem; flex: 1; }
.side-pane.active { display: block; }
.vocab-item {
  position: relative; padding: 0.75rem 2rem 0.75rem 0.75rem;
  border-bottom: 1px solid var(--border-soft); font-size: 0.85rem;
}
.vocab-item .zh { font-family: var(--font-cjk); font-size: 1.3rem; font-weight: 700; color: var(--brown-deep); }
.vocab-item .py { color: var(--brown); font-size: 0.8rem; font-family: var(--font-pinyin); }
.vocab-item .vi { color: var(--ink-soft); margin-top: 0.15rem; }
.vocab-item .hv { color: var(--accent-gold); font-size: 0.78rem; font-weight: 600; margin-top: 0.15rem; }
.vocab-item .icon-btn { position: absolute; top: 0.65rem; right: 0.5rem; }

.gym-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 0.5rem;
}
.gym-card {
  padding: 1.75rem 1.5rem; border-radius: var(--radius);
  border: 1px solid var(--border-soft); background: var(--paper);
  box-shadow: var(--shadow); transition: transform 0.15s, border-color 0.15s;
}
.gym-card:hover { transform: translateY(-2px); border-color: var(--brown); }
.gym-ico { font-size: 2rem; margin-bottom: 0.65rem; }
.gym-card h3 { font-family: var(--font-display); color: var(--brown-deep); margin-bottom: 0.25rem; }
.gym-card p { color: var(--muted); font-size: 0.88rem; }
.gym-card.listen { background: linear-gradient(160deg, #f8f3e8, #efe6d4); }
.gym-card.speak { background: linear-gradient(160deg, #f5efe3, #e8dcc8); }
.gym-card.read { background: linear-gradient(160deg, #f3ebe0, #e6d7c0); }
.gym-card.write { background: linear-gradient(160deg, #faf6ee, #ebe2d0); }

.review-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 0.85rem;
}
.review-card {
  position: relative; background: var(--paper); border: 1px solid var(--border-soft);
  border-radius: 12px; padding: 1.25rem 1rem; text-align: center;
  cursor: pointer; box-shadow: var(--shadow); min-height: 120px;
}
.review-card .zh { font-family: var(--font-cjk); font-size: 1.85rem; font-weight: 700; color: var(--brown-deep); }
.review-card .reveal { display: none; margin-top: 0.45rem; }
.review-card.show .reveal { display: block; }
.review-card .icon-btn { position: absolute; top: 0.5rem; right: 0.5rem; }

.dict-search { display: flex; gap: 0.65rem; margin-bottom: 1.15rem; }
.dict-list { background: var(--paper); border: 1px solid var(--border-soft); border-radius: var(--radius); overflow: hidden; }
.dict-row {
  display: grid; grid-template-columns: 100px 1fr 40px; gap: 0.75rem;
  padding: 0.85rem 1rem; border-bottom: 1px solid var(--border-soft); align-items: center;
}
.dict-row .zh { font-family: var(--font-cjk); font-size: 1.5rem; font-weight: 700; color: var(--brown-deep); }

.admin-nav-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.admin-link { display: block; transition: border-color 0.15s; }
.admin-link:hover { border-color: var(--brown); }
.admin-link strong { display: block; font-size: 1.05rem; margin-bottom: 0.35rem; color: var(--brown-deep); }
.admin-link span { font-size: 0.85rem; color: var(--muted); }
.admin-form-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0.85rem; align-items: end;
}
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.admin-table th, .admin-table td { padding: 0.75rem 0.5rem; border-bottom: 1px solid var(--border-soft); text-align: left; vertical-align: top; }
.admin-table th { color: var(--muted); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; }
.admin-tabs { display: flex; gap: 0.35rem; margin-bottom: 1rem; flex-wrap: wrap; }
.admin-tabs a {
  padding: 0.55rem 1rem; border-radius: 99px; border: 1px solid var(--border);
  background: var(--paper); font-weight: 600; font-size: 0.85rem; color: var(--ink-soft);
}
.admin-tabs a.active { background: var(--brown-btn); color: #fff; border-color: var(--brown-btn); }
.admin-line { padding: 0.55rem 0; border-bottom: 1px solid var(--border-soft); font-size: 0.9rem; }
.table-scroll { overflow-x: auto; }
.member-cell { display: flex; align-items: center; gap: 0.7rem; }
.actions-cell { white-space: nowrap; }
.row-self td { background: rgba(139, 90, 43, 0.06); }
.status-pill {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
}
.status-pill.active { background: #e8f3ea; color: #2f6b3a; }
.status-pill.paused { background: #f5ebe0; color: #8a5a2b; }
.rank-chip {
  display: inline-block;
  margin-right: 0.35rem;
  padding: 0.15rem 0.45rem;
  border-radius: 6px;
  background: var(--cream);
  border: 1px solid var(--border);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--brown-deep);
}

/* Leaderboard */
.lb-hero {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1.5rem;
  align-items: center;
  margin-bottom: 1.5rem;
  padding: 1.5rem 1.75rem;
  border-radius: 18px;
  border: 1px solid var(--border);
  background:
    radial-gradient(ellipse at 85% 20%, rgba(180, 130, 60, 0.18), transparent 50%),
    linear-gradient(135deg, #f7f0e4 0%, #efe2cc 48%, #e8d5b5 100%);
  position: relative;
  overflow: hidden;
}
.lb-hero-copy h1 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  color: var(--brown-deep);
  margin: 0.35rem 0 0.5rem;
}
.lb-hero-copy p { color: var(--ink-soft); max-width: 38rem; margin: 0; line-height: 1.55; }
.lb-you-rank {
  margin-top: 0.85rem !important;
  padding: 0.55rem 0.85rem;
  display: inline-block;
  background: rgba(255,255,255,0.55);
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  font-size: 0.92rem;
}
.lb-seal {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 2.6rem;
  font-weight: 700;
  color: #7a4e22;
  background: radial-gradient(circle at 35% 30%, #f3e4c8, #d4b07a 70%);
  border: 3px double #a67c42;
  box-shadow: 0 10px 28px rgba(90, 55, 20, 0.18);
  animation: lb-seal-in 0.7s ease both;
}
@keyframes lb-seal-in {
  from { transform: scale(0.85) rotate(-8deg); opacity: 0; }
  to { transform: scale(1) rotate(0); opacity: 1; }
}

.lb-podium {
  display: grid;
  grid-template-columns: 1fr 1.15fr 1fr;
  gap: 0.85rem;
  align-items: end;
  margin-bottom: 1.35rem;
}
.lb-pod {
  position: relative;
  text-align: center;
  padding: 1.25rem 1rem 1.4rem;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--paper);
  animation: lb-rise 0.55s ease both;
}
.lb-pod.place-1 {
  padding-top: 1.6rem;
  background: linear-gradient(180deg, #fff8e8 0%, #f3e2bf 100%);
  border-color: #c9a45a;
  transform: translateY(-8px);
  animation-delay: 0.08s;
}
.lb-pod.place-2 { animation-delay: 0s; background: linear-gradient(180deg, #f6f4f1, #e8e4de); }
.lb-pod.place-3 { animation-delay: 0.14s; background: linear-gradient(180deg, #f7efe6, #ead7c2); }
.lb-pod.is-me { outline: 2px solid var(--brown); }
.lb-medal {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--brown-deep);
  margin-bottom: 0.45rem;
  letter-spacing: 0.08em;
}
.lb-pod h3 {
  margin: 0.55rem 0 0.2rem;
  font-size: 1.05rem;
  color: var(--brown-deep);
}
.lb-title { margin: 0; font-size: 0.82rem; color: var(--muted); }
.lb-pod-stats {
  display: flex;
  justify-content: center;
  gap: 0.65rem;
  margin-top: 0.7rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ink-soft);
}
.lb-place-num {
  position: absolute;
  top: 0.65rem;
  right: 0.75rem;
  font-family: var(--font-display);
  font-weight: 700;
  color: rgba(90, 55, 20, 0.35);
  font-size: 1.1rem;
}
@keyframes lb-rise {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}
.lb-pod.place-1 { animation-name: lb-rise-first; }
@keyframes lb-rise-first {
  from { opacity: 0; transform: translateY(22px); }
  to { opacity: 1; transform: translateY(-8px); }
}

.lb-avatar {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(145deg, #efe0c8, #d8b88a);
  border: 1.5px solid #b8894f;
  color: #5c3a18;
  font-weight: 800;
  font-size: 0.78rem;
  flex-shrink: 0;
}
.lb-avatar.lg { width: 68px; height: 68px; font-size: 1.15rem; margin: 0 auto; }
.lb-avatar.sm { width: 36px; height: 36px; font-size: 0.7rem; }

.lb-list-card { margin-bottom: 1.15rem; }
.lb-list { list-style: none; margin: 0; padding: 0; }
.lb-row {
  display: grid;
  grid-template-columns: 42px 42px 1fr auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.75rem 0.35rem;
  border-bottom: 1px solid var(--border-soft);
  transition: background 0.15s;
}
.lb-row:hover { background: rgba(139, 90, 43, 0.04); }
.lb-row.is-me {
  background: rgba(139, 90, 43, 0.08);
  border-radius: 10px;
  border-bottom-color: transparent;
  padding-left: 0.55rem;
  padding-right: 0.55rem;
}
.lb-row.top .lb-pos { color: #9a6b2f; }
.lb-pos {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--muted);
  text-align: center;
}
.lb-info strong { display: block; color: var(--brown-deep); }
.lb-info span { font-size: 0.8rem; color: var(--muted); }
.lb-level { text-align: right; }
.lb-xp { display: block; margin-top: 0.25rem; font-size: 0.82rem; font-weight: 700; color: var(--ink-soft); }

.lb-legend-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.75rem;
}
.lb-legend-item {
  padding: 0.85rem 0.75rem;
  border-radius: 12px;
  border: 1px solid var(--border-soft);
  background: var(--cream);
  text-align: center;
}
.lb-legend-item strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.35rem;
  color: var(--brown-deep);
}
.lb-legend-item span { display: block; font-size: 0.88rem; margin: 0.2rem 0; }
.lb-legend-item em { font-style: normal; font-size: 0.75rem; color: var(--muted); }

.account-form .form-group { margin-bottom: 0.9rem; }
.account-summary { text-align: center; }
.account-avatar {
  width: 72px;
  height: 72px;
  margin: 0.25rem auto 0.85rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 1.2rem;
  color: #5c3a18;
  background: linear-gradient(145deg, #efe0c8, #d8b88a);
  border: 1.5px solid #b8894f;
}
.account-name {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--brown-deep);
  font-weight: 700;
}
.account-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin-top: 0.5rem;
}
.account-stats > div {
  padding: 0.65rem 0.35rem;
  border-radius: 10px;
  background: var(--cream);
  border: 1px solid var(--border-soft);
}
.account-stats .label {
  display: block;
  font-size: 0.72rem;
  color: var(--muted);
  margin-bottom: 0.2rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.account-stats strong {
  font-size: 0.95rem;
  color: var(--brown-deep);
}
.rank-line {
  margin: 1rem 0 0;
  font-size: 0.9rem;
  color: var(--ink-soft);
}

@media (max-width: 900px) {
  .lb-hero { grid-template-columns: 1fr; }
  .lb-seal { width: 72px; height: 72px; font-size: 2rem; }
  .lb-podium { grid-template-columns: 1fr; }
  .lb-pod.place-1 { transform: none; }
  .lb-pod.place-1 { animation-name: lb-rise; }
  .lb-row { grid-template-columns: 32px 36px 1fr; }
  .lb-level { grid-column: 2 / -1; text-align: left; display: flex; gap: 0.65rem; align-items: center; padding-left: 0.15rem; }
  .lb-xp { margin-top: 0; }
}

.picker-row {
  display: grid;
  grid-template-columns: 1.1fr 1.4fr auto;
  gap: 0.85rem;
  align-items: end;
}
.picker-actions label { display: block; }
.editor-picker .form-group { margin-bottom: 0; }

/* Voice settings */
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  align-items: start;
}
.choice-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}
.choice-btn {
  position: relative;
  text-align: left;
  padding: 1rem 2.5rem 1rem 1.1rem;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  background: var(--cream);
  cursor: pointer;
  color: var(--ink);
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.choice-btn strong { display: block; font-family: var(--font-display); color: var(--brown-deep); margin-bottom: 0.2rem; }
.choice-btn .choice-desc { font-size: 0.8rem; color: var(--muted); }
.choice-btn:hover { border-color: var(--brown); }
.choice-tick {
  position: absolute;
  top: 0.7rem;
  right: 0.7rem;
  width: 1.45rem;
  height: 1.45rem;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: #fff;
  color: transparent;
  display: grid;
  place-items: center;
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.choice-btn.active {
  border-color: var(--brown-btn);
  background: linear-gradient(180deg, #fffdf8, #f3ebe0);
  box-shadow: 0 0 0 3px rgba(122, 74, 42, 0.14);
}
.choice-btn.active .choice-tick {
  border-color: var(--brown-btn);
  background: var(--brown-btn);
  color: #fff;
  content: '';
}
.choice-btn.active .choice-tick::before {
  content: '✓';
}
.gender-hint-box {
  margin-top: 0.65rem;
  padding: 0.75rem 0.85rem;
  border-radius: 10px;
  border: 1px solid var(--border-soft);
  background: rgba(248, 236, 236, 0.55);
}
.gender-hint-box[hidden] { display: none !important; }
.voice-guide-sheet ul { color: var(--ink-soft); font-size: 0.9em; }
.rate-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}
.rate-row input[type=range] { flex: 1; accent-color: var(--brown-btn); }
.auto-play-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-top: 1.25rem;
  font-size: 0.9rem;
  cursor: pointer;
}
.tts-chip {
  padding: 0.25rem 0.65rem;
  border-radius: 99px;
  background: var(--cream-dark);
  border: 1px solid var(--border-soft);
  text-decoration: none !important;
}
.tts-chip.muted-tts { opacity: 0.55; }
.tts-controls {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.tts-stop-btn {
  display: none;
  border: 1px solid var(--border);
  background: var(--brown-btn);
  color: #fff;
  font-weight: 700;
  font-size: 0.78rem;
  padding: 0.3rem 0.7rem;
  border-radius: 99px;
  cursor: pointer;
  line-height: 1.2;
  border-color: var(--brown-btn);
  animation: ttsPulse 1.2s ease-in-out infinite;
}
.tts-stop-btn:hover {
  filter: brightness(0.95);
}
.tts-stop-btn.speaking {
  display: inline-flex;
  align-items: center;
}
@keyframes ttsPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.75; }
}
.tts-unlock-bar {
  position: fixed;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 300;
  background: var(--brown-deep);
  color: #fff;
  padding: 0.75rem 1.25rem;
  border-radius: 99px;
  font-size: 0.88rem;
  font-weight: 600;
  box-shadow: var(--shadow);
  cursor: pointer;
  display: none;
}
.tts-unlock-bar.show { display: block; }

/* Responsive */
@media (max-width: 1024px) {
  .site-header { padding: 0.85rem 1.25rem; }
  .nav-main { display: none; }
  .feature-bar { display: none; }
  .hero-content { padding: 2.25rem 1rem 1.5rem; }
  .hero-copy {
    --hero-scale: clamp(0.48, (100vw - 2rem) / 820, 0.82);
    width: 100%;
    max-width: 100%;
    padding: 0 0.75rem;
    box-sizing: border-box;
  }
  .hero-title-top,
  .hero-title-sub {
    white-space: normal;
    line-height: 1.28;
  }
  .hero-title-sub .hero-sub-a,
  .hero-title-sub .hero-sub-b {
    display: block;
  }
  .hero-title-sub .hero-sub-dash {
    display: none;
  }
  .hero-tagline {
    white-space: normal;
    line-height: 1.45;
    max-width: 22rem;
    letter-spacing: 0.08em;
  }
  /* Mobile có bottom nav → ẩn Đăng ký / Đăng nhập trên header */
  .header-auth-group { display: none !important; }
  .header-auth-btn {
    padding: 0.5rem 0.85rem;
    font-size: 0.78rem;
  }
  /* Nền mobile app — giữ ảnh cũ (không dùng ảnh trang chủ) */
  .app-shell {
    background:
      linear-gradient(180deg, rgba(245, 239, 227, 0.93) 0%, rgba(245, 239, 227, 0.97) 40%, rgba(248, 243, 232, 0.99) 100%),
      url('../images/ink-landscape-hero.png?v=20260827b') center 12% / 135% auto no-repeat;
    background-attachment: scroll;
  }
  /* Trang chủ mobile: ảnh cũ + scale 135% auto → thấy full cảnh (không cover cắt) */
  .hero-bg {
    bottom: calc(4.75rem + env(safe-area-inset-bottom));
    background-color: #f5efe3;
    background-image: url('../images/ink-landscape-hero.png?v=20260827c');
    background-position: center 12%;
    background-size: 135% auto;
    background-repeat: no-repeat;
  }
  .auth-page {
    padding: 3.5rem 1rem calc(9rem + env(safe-area-inset-bottom));
  }
  .auth-page .auth-bg {
    background: url('../images/auth-bg.jpg?v=3') center bottom / cover no-repeat;
  }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .continue-card,
  .lesson-layout,
  .quiz-layout,
  .ai-layout,
  .result-layout,
  .dash-grid,
  .grammar-layout,
  .lesson-shell,
  .gym-grid,
  .admin-nav-cards,
  .admin-form-grid,
  .settings-grid,
  .choice-row,
  .picker-row { grid-template-columns: 1fr; }
  .continue-body { padding: 1.25rem; }
  .app-menu-btn { display: inline-flex; }
  .topbar-brand-mobile { display: block; }
  .topbar-quote { display: none; }
  .hide-xs { display: none !important; }
  .app-topbar { padding: 0.55rem 0.85rem; padding-top: calc(0.55rem + env(safe-area-inset-top)); }
  .app-main {
    padding: 1rem 1rem calc(5.5rem + env(safe-area-inset-bottom));
  }
  .app-main-ink { min-height: calc(100vh - 56px - 64px); }
  .sidebar {
    position: fixed;
    left: -100%;
    top: 0;
    z-index: 200;
    transition: left 0.25s ease;
    height: 100vh;
    height: 100dvh;
    padding-top: calc(1rem + env(safe-area-inset-top));
  }
  .sidebar.open { left: 0; }
  body.sidebar-open { overflow: hidden; }
  .lesson-sidepanel { position: static; max-height: none; }
  .dash-continue { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 600px) {
  .feature-bar { display: none !important; }
  .feature-item { border-right: none; border-bottom: 1px solid var(--border-soft); }
  .stats-grid { grid-template-columns: 1fr; }
  .hero-content { padding: 2rem 1rem 1.25rem; }
  .hero-copy {
    --hero-scale: clamp(0.42, (100vw - 2rem) / 720, 0.7);
    margin-bottom: 1.15rem;
    padding: 0 0.5rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
  .hero-title-top,
  .hero-title-sub {
    white-space: normal;
    line-height: 1.28;
    overflow-wrap: anywhere;
    word-break: keep-all;
  }
  /* Điện thoại: mỗi ý một dòng — không bị che/cắt ngang */
  .hero-title-sub .hero-sub-a,
  .hero-title-sub .hero-sub-b {
    display: block;
  }
  .hero-title-sub .hero-sub-dash {
    display: none;
  }
  .hero-tagline {
    white-space: normal;
    line-height: 1.45;
    max-width: 18rem;
    letter-spacing: 0.06em;
    padding-left: 0.06em;
  }
  .hero-actions { gap: 0.65rem; width: 100%; max-width: 320px; }
  .hero-actions .btn {
    flex: 1;
    min-width: 0;
    padding: 0.6rem 0.85rem;
    font-size: 0.82rem;
  }
  .journey-hero { flex-direction: column; align-items: flex-start; }

  /* Nút gọn hơn trên điện thoại */
  .btn {
    padding: 0.55rem 1rem;
    font-size: 0.82rem;
  }
  .btn-lg {
    padding: 0.62rem 1.1rem;
    font-size: 0.84rem;
  }
  .btn-sm {
    padding: 0.4rem 0.75rem;
    font-size: 0.78rem;
  }
  .page-header .btn,
  .lesson-toolbar .btn,
  .admin-tabs a {
    padding: 0.48rem 0.8rem;
    font-size: 0.78rem;
  }
  .site-header .btn {
    padding: 0.5rem 0.9rem;
    font-size: 0.78rem;
  }

  /* Hội thoại — full width, không bóp hẹp */
  body.lesson-mode .lesson-shell {
    display: flex !important;
    flex-direction: column;
    gap: 0.85rem;
  }
  body.lesson-mode .lesson-sidepanel {
    display: none;
  }
  .dialogue-card {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .dialogue-nav-side {
    display: none;
  }
  .dialogue-main {
    padding: 1rem 0.85rem;
    width: 100%;
    max-width: 100%;
  }
  .dialogue-main h2 {
    font-size: 1.05rem;
    text-align: left;
  }
  .dialogue-image {
    height: 140px;
  }
  .d-line {
    grid-template-columns: 1fr auto;
    gap: 0.45rem 0.55rem;
    padding: 0.85rem 0;
  }
  .d-speaker {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.65rem;
    align-items: baseline;
  }
  .d-speaker strong { font-size: 0.95rem; }
  .d-text {
    grid-column: 1;
    min-width: 0;
  }
  .d-text .zh {
    font-size: 1.15rem;
    line-height: 1.45;
    word-break: break-word;
  }
  .d-line .icon-btn {
    grid-column: 2;
    grid-row: 2;
    align-self: start;
  }
  .d-line.tts-active {
    margin: 0 -0.15rem;
    padding: 0.85rem 0.5rem;
    border-width: 2px;
  }
  .lesson-toolbar {
    gap: 0.4rem;
  }
  .lesson-toolbar form {
    margin-left: 0 !important;
    width: 100%;
  }
  .lesson-toolbar .dlg-next-form {
    width: 100%;
  }
  .lesson-toolbar .dlg-next-form .btn {
    width: 100%;
  }
  .dlg-nav-mobile { display: inline-flex; }

  /* Trang công khai có menu dưới */
  body.public-page {
    padding-bottom: calc(4.5rem + env(safe-area-inset-bottom));
  }
  body.home-lock.public-page {
    padding-bottom: 0;
    overflow: hidden;
  }
  body.home-lock .hero {
    height: calc(100dvh - 56px);
    min-height: 0;
  }
  body.home-lock .hero-bg {
    bottom: calc(4.75rem + env(safe-area-inset-bottom));
  }
  .dlg-nav-mobile { display: inline-flex; }
}

/* ---------- PWA + app chrome ---------- */
.topbar-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}
.app-menu-btn {
  display: none;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--paper);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  flex-shrink: 0;
}
.app-menu-btn span {
  display: block;
  width: 16px;
  height: 2px;
  background: var(--brown-deep);
  border-radius: 2px;
}
.topbar-brand-mobile {
  display: none;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--brown-deep);
  font-size: 1rem;
}
.pwa-install-chip {
  border: 1px solid var(--brown);
  background: linear-gradient(145deg, #8b5a2b, #6a4423);
  color: #fff !important;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  font-size: 0.78rem;
}
.sidebar-install {
  display: none;
  width: 100%;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.85rem;
  margin-bottom: 0.35rem;
  border-radius: 10px;
  border: 1px dashed var(--brown);
  background: rgba(139, 90, 43, 0.08);
  color: var(--brown-deep);
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
}
.sidebar-install:not([hidden]) { display: flex; }
.sidebar-install[hidden] { display: none !important; }

.app-bottom-nav {
  display: none !important;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  z-index: 180;
  background: rgba(248, 243, 232, 0.96);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border-soft);
  padding: 0.35rem 0 calc(0.35rem + env(safe-area-inset-bottom));
  box-shadow: 0 -6px 24px rgba(61, 43, 31, 0.08);
  pointer-events: auto;
  overflow: hidden;
}
.app-bottom-nav-scroll {
  display: flex;
  gap: 0.15rem;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  touch-action: pan-x;
  scrollbar-width: none;
  padding: 0 0.35rem;
}
.app-bottom-nav-scroll::-webkit-scrollbar { display: none; }
.app-bottom-nav a.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  padding: 0.4rem 0.55rem;
  font-size: 0.62rem;
  font-weight: 600;
  color: var(--muted);
  border-radius: 10px;
  flex: 0 0 auto;
  min-width: 58px;
  text-align: center;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.app-bottom-nav a.nav-item svg {
  width: 20px;
  height: 20px;
  max-width: 20px;
  max-height: 20px;
  flex-shrink: 0;
}
.app-bottom-nav a.nav-item.active {
  color: var(--brown-deep);
  background: rgba(139, 90, 43, 0.1);
}
.app-bottom-nav a.nav-logout {
  color: #8b4545;
}
.app-bottom-nav a.nav-logout.active {
  background: rgba(170, 50, 50, 0.08);
}
.app-scrim {
  display: none !important;
  position: fixed;
  inset: 0;
  background: rgba(40, 28, 18, 0.45);
  z-index: 190;
  pointer-events: auto;
}
.app-scrim.show { display: block !important; }

.pwa-install-fab {
  display: none !important;
  position: fixed;
  right: 1rem;
  bottom: 1.5rem;
  z-index: 170;
  align-items: center;
  gap: 0.4rem;
  padding: 0.65rem 0.95rem;
  border: none;
  border-radius: 999px;
  background: linear-gradient(145deg, #8b5a2b, #5c3a18);
  color: #fff;
  font-weight: 700;
  font-size: 0.82rem;
  box-shadow: 0 10px 28px rgba(74, 47, 31, 0.35);
  cursor: pointer;
  animation: pwaFabIn 0.45s ease both;
  pointer-events: auto;
}
.pwa-install-fab.show { display: inline-flex !important; }
.pwa-install-fab[hidden] { display: none !important; }
@keyframes pwaFabIn {
  from { opacity: 0; transform: translateY(12px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.pwa-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(40, 28, 18, 0.5);
  z-index: 220;
}
.pwa-backdrop[hidden] { display: none !important; }
.pwa-ios-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 230;
  background: var(--paper);
  border-radius: 18px 18px 0 0;
  padding: 0.75rem 1.25rem calc(1.25rem + env(safe-area-inset-bottom));
  box-shadow: 0 -12px 40px rgba(40, 28, 18, 0.2);
  animation: pwaSheetUp 0.35s ease both;
  max-width: 520px;
  margin: 0 auto;
}
.pwa-ios-sheet[hidden] { display: none !important; }
@keyframes pwaSheetUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}
.pwa-sheet-handle {
  width: 42px;
  height: 4px;
  border-radius: 99px;
  background: var(--border);
  margin: 0.15rem auto 0.85rem;
}
.pwa-ios-sheet h3 {
  margin: 0 0 0.85rem;
  font-family: var(--font-display);
  color: var(--brown-deep);
  font-size: 1.25rem;
}
.pwa-ios-steps {
  margin: 0;
  padding-left: 1.2rem;
  color: var(--ink-soft);
  line-height: 1.55;
  font-size: 0.92rem;
}
.pwa-ios-steps li { margin-bottom: 0.55rem; }
.ios-share-ico {
  display: inline-flex;
  vertical-align: middle;
  color: var(--brown);
  margin: 0 0.15rem;
}
.pwa-ios-note { margin: 0.75rem 0 1rem; font-size: 0.8rem; line-height: 1.45; }
.pwa-sheet-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

html.pwa-standalone .pwa-install-fab,
html.pwa-standalone .pwa-install-chip,
html.pwa-standalone .sidebar-install { display: none !important; }

/* Mobile app chrome — luôn đặt cuối file để ưu tiên */
@media (max-width: 1024px) {
  .app-bottom-nav { display: block !important; }
  .pwa-install-fab.show { bottom: calc(5.25rem + env(safe-area-inset-bottom)); }
}

.header-auth-group {
  display: flex;
  gap: 0.45rem;
  align-items: center;
  flex-wrap: wrap;
}
.plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.85rem;
  margin-bottom: 1.25rem;
}
.plan-card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1.1rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: 14px;
  background: var(--cream);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, background 0.15s;
}
.plan-card:hover { border-color: var(--brown); }
.plan-card.active {
  border-color: var(--brown-btn);
  background: linear-gradient(180deg, rgba(196,134,63,0.12), var(--cream));
}
.plan-months {
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.plan-label { font-family: var(--font-display); color: var(--brown-deep); font-size: 1.05rem; }
.plan-price { font-size: 1.2rem; font-weight: 700; color: var(--brown-btn); margin: 0.2rem 0 0.35rem; }
.plan-cta { font-size: 0.82rem; color: var(--brown); }

.pay-card { margin-top: 0.5rem; }
.pay-layout {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 1.25rem;
  align-items: start;
  margin-top: 1rem;
}
.pay-qr img {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
}
.pay-qr-empty {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 1rem;
  border: 1px dashed var(--border);
  border-radius: 12px;
  color: var(--muted);
  font-size: 0.85rem;
  background: var(--cream);
}
.pay-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  align-items: baseline;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--border-soft);
}
.pay-row > span { min-width: 140px; color: var(--muted); font-size: 0.85rem; }
.pay-amount { color: var(--brown-btn); font-size: 1.1rem; }
.pay-msg strong {
  display: block;
  width: 100%;
  font-family: ui-monospace, Consolas, monospace;
  background: var(--cream);
  padding: 0.55rem 0.7rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  margin: 0.25rem 0 0.45rem;
  word-break: break-word;
}
.plan-activate-box {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-soft);
}
.account-plan-box {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  background: var(--cream);
  border: 1px solid var(--border-soft);
  text-align: left;
}
.account-plan-box .label {
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.writing-list { display: flex; flex-direction: column; gap: 0.75rem; }
.writing-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  text-decoration: none;
  color: inherit;
  padding: 1rem 1.1rem;
}
.writing-item:hover { border-color: var(--brown); }
.writing-meta { margin: 0.35rem 0 0; font-size: 0.8rem; }
.writing-subs { margin: 0; padding-left: 1.1rem; line-height: 1.6; }
@media (max-width: 720px) {
  .pay-layout { grid-template-columns: 1fr; }
  .pay-qr { max-width: 220px; }
}

/* ---------- Học video + banner trang chủ (60+) ---------- */
.home-video-banner {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: min(100%, 32rem);
  margin: 0 auto 1.15rem;
  padding: 1.1rem 1.25rem;
  border-radius: 16px;
  border: 2px solid var(--brown-btn);
  background: linear-gradient(135deg, #fffdf8 0%, #f3ebe0 55%, #e8dcc8 100%);
  box-shadow: 0 10px 32px rgba(74, 47, 31, 0.18);
  text-decoration: none;
  color: var(--brown-deep);
  transition: transform 0.15s, box-shadow 0.15s;
}
.home-video-banner:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 36px rgba(74, 47, 31, 0.22);
}
.home-video-icon {
  flex-shrink: 0;
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 50%;
  background: linear-gradient(145deg, #8b5e3c, #4a2f1f);
  color: #f5efe3;
  display: grid;
  place-items: center;
}
.home-video-icon svg { width: 1.65rem; height: 1.65rem; }
.home-video-text {
  flex: 1;
  text-align: left;
  min-width: 0;
}
.home-video-text strong {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 4vw, 1.45rem);
  letter-spacing: 0.04em;
  margin-bottom: 0.2rem;
}
.home-video-text span {
  display: block;
  font-size: clamp(0.88rem, 3vw, 1rem);
  color: var(--ink-soft);
  line-height: 1.4;
}
.home-video-arrow {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--brown-btn);
  flex-shrink: 0;
}
.hero-actions-logged {
  flex-direction: column;
  width: min(100%, 22rem);
  gap: 0.65rem;
}
.hero-actions-logged .btn {
  width: 100%;
  font-size: clamp(0.95rem, 3.5vw, 1.05rem);
  padding: 0.85rem 1.25rem;
}
.btn-video-main {
  font-size: clamp(1.05rem, 4vw, 1.15rem) !important;
  font-weight: 700;
  letter-spacing: 0.03em;
}
body.home-has-video .hero {
  min-height: calc(100vh - 72px);
  min-height: calc(100dvh - 72px);
}
body.home-has-video {
  overflow: auto;
}

.dash-video-banner {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
  padding: 1.15rem 1.25rem;
  text-decoration: none;
  color: inherit;
  border: 2px solid var(--brown-btn);
  background: linear-gradient(135deg, #fffdf8, #f0e6d8);
  transition: border-color 0.15s, transform 0.15s;
}
.dash-video-banner:hover {
  border-color: var(--brown-deep);
  transform: translateY(-1px);
}
.dash-video-icon {
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background: var(--brown-btn);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}
.dash-video-copy strong {
  display: block;
  font-size: 1.15rem;
  color: var(--brown-deep);
  margin-bottom: 0.15rem;
}
.dash-video-copy span {
  font-size: 0.92rem;
  color: var(--muted);
}
.dash-video-go {
  margin-left: auto;
  font-size: 1.5rem;
  color: var(--brown-btn);
  font-weight: 700;
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.15rem;
}
.video-grid-compact {
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}
.video-card {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius);
  border: 1.5px solid var(--border);
  background: var(--paper);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.video-card:hover {
  border-color: var(--brown);
  box-shadow: var(--shadow);
}
.video-card-locked { opacity: 0.92; }
.video-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #222;
  overflow: hidden;
}
.video-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.video-play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 2.5rem;
  color: #fff;
  text-shadow: 0 2px 12px rgba(0,0,0,0.5);
  background: rgba(0,0,0,0.15);
}
.video-lock {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: rgba(0,0,0,0.65);
  color: #fff;
  padding: 0.25rem 0.45rem;
  border-radius: 8px;
  font-size: 0.9rem;
}
.video-card-body { padding: 1rem 1.05rem 1.1rem; }
.video-card-sm .video-title {
  padding: 0.65rem 0.75rem 0.85rem;
  font-size: 0.92rem;
}
.video-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 0.2rem 0.55rem;
  border-radius: 99px;
  margin-bottom: 0.45rem;
}
.video-badge.free {
  background: var(--success-bg);
  color: var(--success);
}
.video-badge.paid {
  background: #f8f1e2;
  color: #7a5a28;
  border: 1px solid #e0c48a;
}
.video-title {
  display: block;
  font-family: var(--font-display);
  font-size: 1.08rem;
  color: var(--brown-deep);
  line-height: 1.35;
  margin-bottom: 0.35rem;
}
.video-desc {
  font-size: 0.88rem;
  margin: 0 0 0.5rem;
  line-height: 1.45;
}
.video-cta {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--brown-btn);
}
.video-player-wrap { padding: 0; overflow: hidden; }
.video-embed {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  background: #111;
}
.video-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.video-thumb-youtube {
  background: #222;
}
.video-source-note {
  margin: 0;
  padding: 0.75rem 1rem 1rem;
  font-size: 0.85rem;
  border-top: 1px solid var(--border-soft);
}
.video-source-note a { color: var(--brown-btn); }
.app-bottom-nav a.nav-video span {
  font-weight: 600;
}

@media (max-width: 600px) {
  .home-video-banner {
    padding: 1rem;
    gap: 0.75rem;
  }
  .home-video-text strong { font-size: 1.12rem; }
  .video-grid { grid-template-columns: 1fr; }
}

/* Trang Giới thiệu / Liên hệ (menu trang chủ) */
.site-page-main {
  max-width: 720px;
  margin: 0 auto;
  padding: 2rem 1.25rem 5.5rem;
}
.site-page-card h1 {
  font-family: var(--font-display);
  font-size: 1.75rem;
  color: var(--brown-deep);
  margin: 0.35rem 0 1rem;
}
.site-page-body {
  font-size: 0.98rem;
  line-height: 1.75;
  color: var(--ink-soft);
}
.site-page-body p { margin: 0 0 1rem; }
.contact-list {
  list-style: none;
  margin: 1.5rem 0 0;
  padding: 0;
  border-top: 1px solid var(--border-soft);
}
.contact-list li {
  display: grid;
  grid-template-columns: 8.5rem 1fr;
  gap: 0.75rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--border-soft);
  font-size: 0.95rem;
}
.contact-label {
  font-weight: 600;
  color: var(--brown-deep);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.contact-list a {
  color: var(--brown-btn);
  word-break: break-word;
}
.contact-list a:hover { text-decoration: underline; }
body.site-static-page {
  background: var(--paper-warm);
  min-height: 100vh;
}
@media (max-width: 520px) {
  .contact-list li { grid-template-columns: 1fr; gap: 0.25rem; }
  .site-page-main { padding-top: 1.25rem; }
}

.home-board {
  max-width: 920px;
  margin: 0 auto 1.25rem;
  padding: 1.15rem 1.25rem 1.2rem;
  text-align: left;
}
.home-board h2 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--brown-deep);
  margin: 0.25rem 0 0.85rem;
}
.home-board-block {
  margin-bottom: 0.85rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border-soft);
}
.home-board-block:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: 0;
}
.home-board-block strong {
  display: block;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--brown);
  margin-bottom: 0.35rem;
}
.home-board-text {
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--ink-soft);
}
.home-board-note {
  background: rgba(139, 90, 43, 0.06);
  border-radius: var(--radius);
  padding: 0.75rem 0.85rem !important;
  border-bottom: 0 !important;
}
.hero-content .home-board {
  width: 100%;
  background: rgba(255, 252, 245, 0.92);
  backdrop-filter: blur(6px);
}
.curriculum-tabs {
  margin-bottom: 1.15rem;
}
