:root {
  --app-bg: #eef4ef;
  --surface: #ffffff;
  --surface-soft: #edf6f2;
  --ink: #14211d;
  --muted: #60716a;
  --line: #d8e3de;
  --primary: #176c5f;
  --primary-strong: #0d4f48;
  --blue: #385a7c;
  --accent: #d96d3a;
  --accent-soft: #fff0e8;
  --shadow: 0 14px 34px rgba(30, 55, 48, 0.12);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  background: #dfe9e3;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background:
    radial-gradient(circle at top left, rgba(23, 108, 95, 0.14), transparent 280px),
    #dfe9e3;
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.auth-screen {
  display: grid;
  width: min(100%, 430px);
  min-height: 100vh;
  min-height: 100dvh;
  align-content: center;
  gap: 18px;
  margin: 0 auto;
  padding: 28px 18px;
  background:
    linear-gradient(180deg, rgba(23, 108, 95, 0.12), transparent 230px),
    var(--app-bg);
}

.auth-brand {
  display: grid;
  gap: 8px;
}

.auth-brand h1 {
  font-size: 30px;
}

.auth-brand span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.auth-card {
  display: grid;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.auth-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 4px;
  border-radius: 8px;
  background: #f4f8f6;
}

.auth-tab {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-weight: 900;
}

.auth-tab.is-active {
  background: var(--primary);
  color: #fff;
}

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

.auth-field {
  display: grid;
  gap: 7px;
  color: var(--primary-strong);
  font-size: 13px;
  font-weight: 900;
}

.auth-field input {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #fff;
  color: var(--ink);
  font-size: 16px;
  outline: none;
}

.auth-field input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(23, 108, 95, 0.12);
}

.auth-submit {
  min-height: 48px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 900;
}

.auth-note {
  margin: -2px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.45;
}

.auth-message {
  min-height: 22px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.auth-message.is-error {
  color: #b13526;
}

.auth-message.is-success {
  color: var(--primary-strong);
}

.app-shell {
  position: relative;
  width: min(100%, 430px);
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  padding: 0 14px calc(92px + env(safe-area-inset-bottom));
  background:
    linear-gradient(180deg, rgba(23, 108, 95, 0.1), transparent 230px),
    var(--app-bg);
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  margin: 0 -14px 12px;
  padding: 10px 14px 12px;
  border-bottom: 1px solid rgba(216, 227, 222, 0.72);
  background: rgba(238, 244, 239, 0.94);
  backdrop-filter: blur(18px);
}

.app-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 20px;
  color: var(--primary-strong);
  font-size: 12px;
  font-weight: 800;
}

.account-chip {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 6px;
}

.account-chip span {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-chip button {
  min-height: 24px;
  border: 1px solid rgba(23, 108, 95, 0.2);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--primary-strong);
  font-size: 12px;
  font-weight: 900;
}

.account-chip button:active {
  transform: translateY(1px);
}


.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 6px;
}

.top-bar > div,
.lesson-head > div,
.vocabulary-head > div,
.practice-head > div,
.unit-head > div {
  min-width: 0;
}

.eyebrow,
.lesson-level {
  margin: 0 0 5px;
  color: var(--primary);
  font-size: 13px;
  font-weight: 800;
}

h1,
h2 {
  margin: 0;
  line-height: 1.18;
  letter-spacing: 0;
}

h1 {
  font-size: 26px;
}

h2 {
  font-size: 22px;
}

.streak-box {
  display: grid;
  min-width: 62px;
  min-height: 62px;
  place-items: center;
  padding: 8px;
  border: 1px solid rgba(23, 108, 95, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.8);
}

.streak-box span {
  font-size: 24px;
  font-weight: 900;
  line-height: 1;
}

.streak-box small {
  color: var(--muted);
  font-size: 12px;
}

.grade-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.grade-pill,
.speed-btn {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--muted);
  font-weight: 800;
}

.grade-pill.is-active,
.speed-btn.is-active {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

.course-switcher {
  display: grid;
  grid-template-columns: minmax(138px, 188px) auto;
  gap: 10px;
  align-items: stretch;
  justify-content: start;
}

.grade-select-field {
  position: relative;
  display: grid;
  gap: 5px;
}

.grade-select-field span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.grade-select-field::after {
  content: "";
  position: absolute;
  right: 15px;
  bottom: 17px;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--primary-strong);
  border-bottom: 2px solid var(--primary-strong);
  pointer-events: none;
  transform: rotate(45deg);
}

.grade-select-field select {
  width: 100%;
  min-height: 46px;
  padding: 0 42px 0 14px;
  border: 1px solid rgba(23, 108, 95, 0.24);
  border-radius: 8px;
  appearance: none;
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
  font-size: 16px;
  font-weight: 900;
  outline: none;
}

.grade-select-field select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(23, 108, 95, 0.12);
}

.content-entry-row {
  display: flex;
  gap: 8px;
  align-items: end;
  overflow-x: auto;
}

.content-entry-btn {
  min-width: 124px;
  min-height: 46px;
  padding: 7px 13px;
  border: 1px solid rgba(23, 108, 95, 0.22);
  border-radius: 8px;
  background: linear-gradient(135deg, #176c5f, #1f8a78);
  color: #fff;
  text-align: left;
  box-shadow: 0 14px 28px -22px rgba(23, 108, 95, 0.8);
}

.story-entry-btn {
  background: linear-gradient(135deg, #255f8d, #2b7aa7);
  box-shadow: 0 14px 28px -22px rgba(37, 95, 141, 0.8);
}

.content-entry-btn span,
.content-entry-btn small {
  display: block;
}

.content-entry-btn span {
  font-size: 15px;
  font-weight: 900;
  line-height: 1.2;
}

.content-entry-btn small {
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 11px;
  font-weight: 800;
}

.trial-panel {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid rgba(23, 108, 95, 0.18);
  border-radius: 8px;
  background: #f8fbf9;
  box-shadow: var(--shadow);
}

.trial-panel.is-expired {
  border-color: rgba(217, 109, 58, 0.4);
  background: var(--accent-soft);
}

.trial-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.trial-copy small {
  color: var(--primary);
  font-size: 12px;
  font-weight: 900;
}

.trial-copy strong {
  color: var(--ink);
  font-size: 17px;
  line-height: 1.25;
}

.trial-copy span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.4;
}

.trial-activate-btn {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  padding: 0 12px;
  background: var(--primary);
  color: #fff;
  font-size: 13px;
  font-weight: 900;
}

.activation-form {
  grid-column: 1 / -1;
  display: grid;
  gap: 10px;
}

.trial-panel .auth-message {
  grid-column: 1 / -1;
  min-height: 0;
}

.today-panel,
.content-panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.today-panel {
  padding: 16px;
}

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

.duration {
  flex: 0 0 auto;
  min-width: 52px;
  padding: 8px 9px;
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--primary-strong);
  font-size: 13px;
  font-weight: 900;
  text-align: center;
}

.lesson-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 14px;
}

.lesson-meta span {
  min-width: 0;
  padding: 7px 10px;
  border-radius: 8px;
  background: #f5f8f6;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.lesson-meta span:last-child {
  color: var(--blue);
}

.daily-plan-card {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  padding: 12px;
  border: 0;
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  background: #f7faf8;
}

.daily-plan-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.daily-plan-copy small {
  color: var(--primary);
  font-size: 12px;
  font-weight: 900;
}

.daily-plan-copy strong {
  color: var(--ink);
  font-size: 16px;
  line-height: 1.35;
}

.daily-plan-copy span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.daily-plan-btn {
  min-width: 74px;
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 900;
}

.coming-soon {
  display: grid;
  gap: 8px;
  padding: 18px;
  border: 1px dashed rgba(23, 108, 95, 0.42);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--muted);
}

.coming-soon strong {
  color: var(--ink);
  font-size: 18px;
}

.progress-wrap {
  padding: 14px;
  border-radius: 8px;
  background: #f7faf8;
}

.subtitle-panel {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  padding: 12px 13px;
  border: 1px solid rgba(56, 90, 124, 0.18);
  border-radius: 8px;
  background: #f4f8fb;
}

.subtitle-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.subtitle-label {
  width: fit-content;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(56, 90, 124, 0.1);
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
}

.subtitle-title {
  overflow: hidden;
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.subtitle-english {
  color: var(--ink);
  font-size: 16px;
  line-height: 1.45;
}

.subtitle-chinese {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.progress-range {
  width: 100%;
  accent-color: var(--primary);
}

.time-row {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 13px;
}

.player-actions {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) 56px;
  gap: 10px;
  margin: 16px 0 12px;
}

.icon-btn,
.play-btn {
  display: inline-flex;
  min-height: 56px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
}

.icon-btn {
  background: var(--surface-soft);
  color: var(--primary-strong);
}

.play-btn {
  gap: 8px;
  background: var(--primary);
  color: #fff;
  font-size: 17px;
  font-weight: 900;
}

svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.speed-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.check-btn {
  width: 100%;
  min-height: 50px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 900;
}

.check-btn.is-done {
  background: var(--primary-strong);
}

.tabs {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  width: min(100%, 430px);
  margin: 0 auto;
  padding: 8px 14px calc(8px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(216, 227, 222, 0.92);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(18px);
  box-shadow: 0 -12px 34px rgba(35, 58, 52, 0.1);
}

.tab-btn {
  display: grid;
  min-height: 56px;
  place-items: center;
  gap: 3px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.tab-btn.is-active {
  background: var(--surface-soft);
  color: var(--primary-strong);
}

.tab-glyph {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  color: currentColor;
  font-size: 16px;
  line-height: 1;
}

.content-panel {
  margin-top: 12px;
  padding: 16px;
}

.transcript {
  display: grid;
  gap: 12px;
}

.script-block {
  display: grid;
  gap: 7px;
}

.script-block.is-extra-section {
  padding: 10px;
  border: 1px solid rgba(23, 108, 95, 0.18);
  border-left: 4px solid var(--primary);
  border-radius: 8px;
  background: #f2faf6;
}

.script-block.is-focus-flash {
  box-shadow: 0 0 0 4px rgba(23, 108, 95, 0.12);
}

.picture-book-section {
  padding: 10px;
  border: 1px solid rgba(43, 122, 167, 0.18);
  border-left: 4px solid #2b7aa7;
  border-radius: 8px;
  background: #f1f8fb;
}

.script-section-head {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

.script-block h3 {
  margin: 0;
  color: var(--primary-strong);
  font-size: 15px;
}

.picture-book-section h3 {
  color: #245b83;
}

.picture-book-status {
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(43, 122, 167, 0.12);
  color: #245b83;
  font-size: 12px;
  font-weight: 900;
}

.picture-book-card {
  display: grid;
  grid-template-columns: 46px 1fr;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid rgba(43, 122, 167, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
}

.picture-book-icon {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 8px;
  background: #deeff7;
  color: #245b83;
}

.picture-book-icon svg {
  width: 24px;
  height: 24px;
}

.picture-book-card strong {
  display: block;
  color: var(--text);
  font-size: 15px;
}

.picture-book-card p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.extra-audio-player {
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 1px solid rgba(23, 108, 95, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
}

.extra-player-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.extra-player-controls {
  display: grid;
  grid-template-columns: 40px minmax(96px, 1fr) 40px;
  gap: 8px;
  align-items: center;
}

.extra-control-btn,
.extra-toggle-btn {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 0;
  border-radius: 8px;
  font-weight: 900;
}

.extra-control-btn {
  background: #e5f2ed;
  color: var(--primary-strong);
}

.extra-toggle-btn {
  background: var(--primary);
  color: #fff;
}

.extra-toggle-btn.is-playing {
  background: var(--primary-strong);
}

.extra-control-btn svg,
.extra-toggle-btn svg {
  width: 18px;
  height: 18px;
}

.extra-time-row {
  display: flex;
  min-width: 76px;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.extra-progress-range {
  width: 100%;
  accent-color: var(--primary);
}

.extra-subtitle-panel {
  padding: 10px 12px;
  border-radius: 8px;
  background: #f7faf8;
}

.extra-subtitle-label {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.extra-subtitle-panel strong {
  display: block;
  color: var(--text);
  font-size: 15px;
  line-height: 1.45;
}

.extra-subtitle-panel p {
  margin: 5px 0 0;
  color: var(--primary-strong);
  font-size: 14px;
  line-height: 1.5;
}

.script-line {
  margin: 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: #f7faf8;
  line-height: 1.55;
}

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

.lesson-tools {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
}

.lesson-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.lesson-head h3 {
  margin: 0;
  line-height: 1.3;
  font-size: 18px;
}

.lesson-filter-row {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.lesson-quick {
  display: grid;
  gap: 8px;
}

.resume-lesson-btn {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 62px;
  padding: 11px 12px;
  border: 1px solid rgba(23, 108, 95, 0.22);
  border-radius: 8px;
  background: #fff;
  color: inherit;
  text-align: left;
}

.resume-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.resume-copy small {
  color: var(--primary);
  font-size: 12px;
  font-weight: 900;
}

.resume-copy strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.resume-meta {
  max-width: 128px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
  text-align: right;
}

.lesson-unit-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.mini-action-btn {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--primary-strong);
  font-weight: 900;
}

.mini-action-btn:disabled,
.resume-lesson-btn:disabled {
  opacity: 0.55;
}

.lesson-unit {
  display: grid;
  gap: 8px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.lesson-unit:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.lesson-unit-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 50px;
  padding: 9px 10px;
  border: 0;
  border-radius: 8px;
  background: #f7faf8;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.lesson-unit.has-current .lesson-unit-head {
  background: #eef8f3;
  box-shadow: inset 3px 0 0 var(--primary);
}

.lesson-unit-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.lesson-unit-copy strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lesson-unit-copy span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.3;
}

.lesson-unit-count {
  padding: 5px 7px;
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--primary-strong);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.lesson-unit-chevron {
  color: var(--muted);
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
  transition: transform 0.18s ease;
}

.lesson-unit.is-collapsed .lesson-unit-chevron {
  transform: rotate(-90deg);
}

.lesson-unit-lessons {
  display: grid;
  gap: 8px;
}

.lesson-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 66px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  text-align: left;
}

.lesson-item.is-current {
  border-color: rgba(23, 108, 95, 0.5);
  background: #f6fbf8;
}

.lesson-item strong {
  display: block;
  margin-bottom: 4px;
  color: var(--ink);
}

.lesson-item span {
  color: var(--muted);
  font-size: 13px;
}

.lesson-copy {
  display: grid;
  gap: 4px;
}

.lesson-card-meta {
  line-height: 1.45;
}

.status-chip {
  padding: 6px 8px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: #9a431d;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.status-chip.done {
  background: var(--surface-soft);
  color: var(--primary-strong);
}

.progress-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.summary-tile {
  min-height: 74px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf8;
}

.summary-tile strong {
  display: block;
  margin-bottom: 4px;
  color: var(--primary-strong);
  font-size: 22px;
}

.summary-tile span {
  color: var(--muted);
  font-size: 13px;
}

.calendar-card {
  display: grid;
  gap: 12px;
  margin: 0 0 14px;
  padding: 2px 0 16px;
  border-bottom: 1px solid var(--line);
}

.calendar-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.calendar-head h3 {
  margin: 0;
  color: var(--ink);
  font-size: 18px;
}

.calendar-week {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.calendar-day {
  display: grid;
  min-height: 64px;
  place-items: center;
  gap: 4px;
  padding: 8px 2px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
}

.calendar-day span {
  font-size: 11px;
  font-weight: 800;
}

.calendar-day strong {
  color: var(--ink);
  font-size: 17px;
}

.calendar-day.is-done {
  border-color: rgba(23, 108, 95, 0.34);
  background: var(--surface-soft);
}

.calendar-day.is-done strong {
  color: var(--primary-strong);
}

.calendar-day.is-today {
  outline: 2px solid rgba(217, 109, 58, 0.36);
  outline-offset: 1px;
}

.calendar-note {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.progress-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.day-dot {
  display: grid;
  min-height: 48px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-weight: 900;
}

.day-dot.done {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

.day-dot.practiced:not(.done) {
  border-color: rgba(217, 109, 58, 0.42);
  background: #fff7f1;
  color: #9a431d;
}

.day-dot.is-current {
  outline: 2px solid rgba(216, 109, 58, 0.5);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
  padding: 0;
}

.vocabulary-head,
.unit-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.vocabulary-head {
  margin-bottom: 14px;
}

.panel-kicker {
  margin: 0 0 5px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 900;
}

.vocabulary-head h3,
.unit-head h4 {
  margin: 0;
  line-height: 1.3;
}

.vocabulary-head h3 {
  font-size: 18px;
}

.edition-chip,
.unit-head strong {
  flex: 0 0 auto;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 900;
}

.edition-chip {
  padding: 7px 9px;
  background: var(--surface-soft);
  color: var(--primary-strong);
}

.vocabulary-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.vocabulary-tile {
  min-height: 74px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf8;
}

.vocabulary-tile strong {
  display: block;
  margin-bottom: 4px;
  color: var(--primary-strong);
  font-size: 22px;
}

.vocabulary-tile span,
.unit-head span,
.vocabulary-note,
.empty-state span {
  color: var(--muted);
  font-size: 13px;
}

.vocabulary-tools {
  display: grid;
  gap: 10px;
  margin-bottom: 10px;
}

.search-field {
  display: block;
}

.search-field input {
  width: 100%;
  min-height: 46px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: 16px;
  outline: none;
}

.search-field input:focus {
  border-color: rgba(23, 108, 95, 0.58);
  box-shadow: 0 0 0 3px rgba(23, 108, 95, 0.12);
}

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

.filter-btn {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-weight: 900;
}

.filter-btn.is-active {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

.vocabulary-note {
  margin: 0 0 14px;
  line-height: 1.6;
}

.vocabulary-list {
  display: grid;
  gap: 12px;
}

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

.practice-head h3 {
  margin: 0;
  font-size: 18px;
  line-height: 1.3;
}

.practice-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.practice-mini-tile {
  min-height: 68px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf8;
}

.practice-mini-tile strong {
  display: block;
  margin-bottom: 4px;
  color: var(--primary-strong);
  font-size: 20px;
}

.practice-mini-tile span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.review-panel {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
  padding: 13px;
  border: 1px solid rgba(56, 90, 124, 0.18);
  border-radius: 8px;
  background: #f4f8fb;
}

.review-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.review-head div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.review-head span {
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
}

.review-head strong {
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.35;
}

.review-head em {
  flex: 0 0 auto;
  max-width: 110px;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
  line-height: 1.35;
  text-align: right;
}

.review-list {
  display: grid;
  gap: 8px;
}

.review-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 82px;
  align-items: center;
  gap: 10px;
  padding: 11px;
  border: 1px solid rgba(56, 90, 124, 0.16);
  border-radius: 8px;
  background: #fff;
}

.review-item-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.review-item-copy span,
.review-item-copy small,
.review-empty {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.review-item-copy strong {
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.35;
}

.review-item-copy p {
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--blue);
  font-size: 13px;
  font-weight: 900;
  line-height: 1.45;
}

.review-done-btn {
  min-height: 44px;
  padding: 0 8px;
}

.review-empty {
  margin: 0;
}

.practice-list {
  display: grid;
  gap: 12px;
}

.practice-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf8;
}

.practice-card.is-correct {
  border-color: rgba(23, 108, 95, 0.26);
  background: #eef7f3;
}

.practice-card.is-incorrect {
  border-color: rgba(217, 109, 58, 0.26);
  background: #fff7f1;
}

.practice-question {
  display: grid;
  gap: 5px;
}

.practice-question span {
  width: fit-content;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(23, 108, 95, 0.1);
  color: var(--primary-strong);
  font-size: 12px;
  font-weight: 900;
}

.practice-question h4 {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.45;
}

.practice-question p,
.practice-feedback {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.practice-options {
  display: grid;
  gap: 8px;
}

.practice-option {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-weight: 800;
  line-height: 1.45;
  text-align: left;
}

.practice-option.is-selected {
  border-color: rgba(56, 90, 124, 0.5);
  background: #f4f8fb;
  color: var(--blue);
}

.practice-option.is-answer {
  border-color: rgba(23, 108, 95, 0.46);
  background: var(--surface-soft);
  color: var(--primary-strong);
}

.practice-option.is-wrong {
  border-color: rgba(217, 109, 58, 0.54);
  background: var(--accent-soft);
  color: #9a431d;
}

.practice-submit {
  margin-top: 14px;
}

.practice-submit:disabled {
  opacity: 0.55;
}

.vocabulary-unit,
.empty-state {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf8;
}

.vocabulary-unit {
  padding: 14px;
}

.unit-head {
  margin-bottom: 12px;
}

.unit-head strong {
  min-width: 48px;
  padding: 7px 8px;
  background: rgba(23, 108, 95, 0.1);
  color: var(--primary-strong);
  text-align: center;
}

.word-chip-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.word-chip {
  display: grid;
  gap: 4px;
  min-height: 68px;
  padding: 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: #fff;
}

.word-chip strong {
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.35;
}

.word-chip span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.word-chip.is-covered {
  border-color: rgba(23, 108, 95, 0.22);
  background: #eef7f3;
}

.word-chip.is-missing {
  border-color: rgba(217, 109, 58, 0.24);
  background: #fff7f1;
}

.empty-state {
  display: grid;
  gap: 8px;
  padding: 18px;
}

.empty-state strong {
  color: var(--ink);
  font-size: 16px;
}

.parent-notes {
  display: grid;
  gap: 12px;
}

.parent-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf8;
}

.parent-card h3 {
  margin: 0 0 8px;
  color: var(--primary-strong);
  font-size: 16px;
}

.parent-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.parent-report-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.parent-report-grid div {
  min-height: 68px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.parent-report-grid strong {
  display: block;
  margin-bottom: 3px;
  color: var(--primary-strong);
  font-size: 20px;
}

.parent-report-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

@media (min-width: 700px) {
  body {
    padding: 18px 0;
  }

  .auth-screen {
    width: min(calc(100% - 36px), 760px);
    border: 1px solid rgba(23, 108, 95, 0.16);
    border-radius: 8px;
    box-shadow: 0 24px 70px rgba(23, 58, 49, 0.14);
  }

  .app-shell {
    width: min(calc(100% - 36px), 700px);
    min-height: calc(100vh - 36px);
    min-height: calc(100dvh - 36px);
    border: 1px solid rgba(23, 108, 95, 0.16);
    border-radius: 8px;
    box-shadow: 0 24px 70px rgba(23, 58, 49, 0.18);
  }

  .tabs {
    bottom: 18px;
    border-right: 1px solid rgba(216, 227, 222, 0.92);
    border-left: 1px solid rgba(216, 227, 222, 0.92);
    border-radius: 0 0 8px 8px;
  }
}

@media (min-width: 760px) {
  .auth-screen {
    grid-template-columns: minmax(0, 1fr) 360px;
    align-items: center;
    gap: 26px;
    padding: 34px;
  }

  .auth-brand h1 {
    font-size: 34px;
  }

  .auth-card {
    align-self: center;
  }

  .app-shell {
    display: grid;
    width: min(calc(100% - 36px), 1060px);
    grid-template-columns: minmax(320px, 390px) minmax(0, 1fr);
    grid-template-areas:
      "header header"
      "grades grades"
      "today tabs"
      "today content";
    grid-template-rows: auto auto auto 1fr;
    align-items: start;
    gap: 14px;
    padding: 0 16px 18px;
  }

  .app-header {
    grid-area: header;
    margin: 0 -16px;
    padding-right: 16px;
    padding-left: 16px;
    border-radius: 8px 8px 0 0;
  }

  .grade-strip {
    grid-area: grades;
    margin-bottom: 0;
  }

  .today-panel {
    grid-area: today;
  }

  .tabs {
    position: sticky;
    top: 12px;
    right: auto;
    bottom: auto;
    left: auto;
    grid-area: tabs;
    width: 100%;
    margin: 0;
    padding: 8px;
    border: 1px solid rgba(216, 227, 222, 0.92);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: none;
  }

  .tab-btn {
    min-height: 50px;
  }

  .content-panel {
    grid-area: content;
    margin-top: 0;
  }

  .progress-grid {
    grid-template-columns: repeat(10, minmax(0, 1fr));
  }

  .word-chip-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  }
}

@media (min-width: 1024px) {
  .app-shell {
    grid-template-columns: minmax(360px, 420px) minmax(0, 1fr);
  }
}

@media (max-width: 430px) {
  h1 {
    font-size: 25px;
  }

  h2 {
    font-size: 20px;
  }

  .grade-pill {
    min-height: 40px;
    font-size: 14px;
  }

  .course-switcher {
    grid-template-columns: minmax(128px, 160px) minmax(112px, auto);
    gap: 8px;
  }

  .grade-select-field select,
  .content-entry-btn {
    min-height: 44px;
  }

  .content-entry-btn {
    min-width: 112px;
    padding: 7px 10px;
  }

  .trial-panel {
    grid-template-columns: 1fr;
  }

  .trial-activate-btn {
    width: 100%;
  }

  .today-panel,
  .content-panel {
    padding: 14px;
  }

  .daily-plan-card {
    grid-template-columns: 1fr;
  }

  .daily-plan-btn {
    width: 100%;
  }

  .progress-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tab-btn {
    min-height: 54px;
    font-size: 11px;
  }

  .resume-lesson-btn {
    grid-template-columns: 1fr;
  }

  .resume-meta {
    max-width: none;
    text-align: left;
  }

  .review-item {
    grid-template-columns: 1fr;
  }

  .review-done-btn {
    width: 100%;
  }

  .word-chip-grid {
    grid-template-columns: 1fr;
  }

  .extra-player-top {
    grid-template-columns: 1fr;
  }

  .extra-time-row {
    min-width: 0;
  }
}

@media (max-width: 360px) {
  .app-shell {
    padding-right: 10px;
    padding-left: 10px;
  }

  .app-header {
    margin-right: -10px;
    margin-left: -10px;
    padding-right: 10px;
    padding-left: 10px;
  }

  .player-actions {
    grid-template-columns: 48px minmax(0, 1fr) 48px;
  }

  .icon-btn,
  .play-btn {
    min-height: 52px;
  }

  .tabs {
    padding-right: 8px;
    padding-left: 8px;
  }
}
