:root {
  --primary: #4f46e5;
  --primary-dark: #3730a3;
  --primary-soft: #e8e7ff;
  --secondary: #818cf8;
  --accent: #16a34a;
  --accent-dark: #0f7a39;
  --accent-soft: #dcfce7;
  --sun: #f6b83f;
  --sun-soft: #fff1d6;
  --danger: #dc2626;
  --danger-soft: #fee2e2;
  --ink: #29275e;
  --ink-soft: #4c4a78;
  --muted: #626b85;
  --page: #f1f3ff;
  --card: #ffffff;
  --line: #dfe2f4;
  --soft: #f7f8fd;
  --shadow: 0 18px 44px rgba(61, 57, 151, 0.12);
  --clay-shadow:
    0 20px 48px rgba(73, 65, 180, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.92);
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --font: "Segoe UI Variable", "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 4% 5%, rgba(255, 202, 103, 0.24), transparent 24rem),
    radial-gradient(circle at 95% 15%, rgba(108, 99, 255, 0.17), transparent 28rem),
    linear-gradient(180deg, #f8f9ff 0%, var(--page) 52%, #eef1fc 100%);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  touch-action: manipulation;
}

button,
input {
  font: inherit;
}

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

button {
  color: inherit;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid rgba(79, 70, 229, 0.34);
  outline-offset: 3px;
}

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

.svg-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.app-shell {
  width: min(1120px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 0 24px calc(112px + var(--safe-bottom));
}

.topbar {
  min-height: 88px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark,
.avatar {
  display: grid;
  place-items: center;
  color: white;
  font-size: 16px;
  font-weight: 900;
  letter-spacing: -0.04em;
  background: linear-gradient(145deg, #6d63fb, var(--primary-dark));
  border-radius: 16px;
  box-shadow:
    0 9px 0 #f6ba48,
    0 14px 24px rgba(79, 70, 229, 0.23),
    inset 0 2px 2px rgba(255, 255, 255, 0.32);
}

.brand-mark {
  width: 47px;
  height: 47px;
  transform: rotate(-3deg);
}

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

.brand-copy strong {
  font-size: 15px;
  font-weight: 850;
}

.brand-copy small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

.streak-chip,
.icon-button {
  border: 1px solid rgba(79, 70, 229, 0.1);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 10px 24px rgba(79, 70, 229, 0.09);
  cursor: pointer;
}

.streak-chip {
  min-width: 64px;
  height: 44px;
  padding: 0 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 999px;
  color: #b05a00;
}

.streak-chip .icon {
  width: 19px;
  height: 19px;
  fill: #ffb85c;
  stroke: #b05a00;
}

.icon-button {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 15px;
}

.icon-button:hover,
.streak-chip:hover {
  background: white;
}

.page {
  display: none;
  padding-bottom: 30px;
  animation: page-enter 0.3s ease both;
}

.page.active {
  display: block;
}

@keyframes page-enter {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

.date-line {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin: 4px 0 18px;
}

.eyebrow {
  display: block;
  color: var(--primary);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.date-text {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.level-pill {
  min-height: 44px;
  padding: 8px 13px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(79, 70, 229, 0.12);
  border-radius: 999px;
  background: white;
  box-shadow: 0 8px 20px rgba(79, 70, 229, 0.07);
  cursor: pointer;
}

.level-pill span {
  padding: 4px 7px;
  border-radius: 8px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 11px;
  font-weight: 900;
}

.level-pill b {
  font-size: 12px;
}

.clay-card {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(79, 70, 229, 0.08);
  box-shadow: var(--clay-shadow);
}

.today-hero {
  position: relative;
  min-height: 310px;
  padding: clamp(26px, 5vw, 48px);
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(230px, 0.8fr);
  gap: 22px;
  align-items: center;
  overflow: hidden;
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at 4% 8%, rgba(246, 184, 63, 0.2), transparent 13rem),
    radial-gradient(circle at 86% 7%, rgba(129, 140, 248, 0.2), transparent 17rem),
    rgba(255, 255, 255, 0.93);
}

.today-hero::before {
  content: "";
  position: absolute;
  width: 240px;
  height: 240px;
  right: -100px;
  bottom: -120px;
  border-radius: 44% 56% 62% 38%;
  background: rgba(79, 70, 229, 0.08);
}

.hero-copy {
  position: relative;
  z-index: 2;
}

.mission-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--sun-soft);
  color: #9c5a00;
  font-size: 11px;
  font-weight: 900;
}

.mission-label .icon {
  width: 15px;
  height: 15px;
  fill: var(--sun);
  stroke: #9c5a00;
}

.hero-copy h1 {
  margin: 14px 0 10px;
  font-size: clamp(38px, 6vw, 62px);
  line-height: 0.98;
  letter-spacing: -0.055em;
}

.hero-copy h1 em {
  color: var(--primary);
  font-style: normal;
  text-decoration: underline;
  text-decoration-thickness: 7px;
  text-decoration-color: rgba(246, 184, 63, 0.46);
  text-underline-offset: 7px;
}

.hero-copy p {
  max-width: 520px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.75;
}

.hero-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 23px;
}

.primary-button,
.ghost-button,
.text-button,
.quiz-option,
.answer-action,
.session-speak {
  cursor: pointer;
  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease,
    background-color 0.16s ease,
    border-color 0.16s ease,
    opacity 0.16s ease;
}

.primary-button,
.ghost-button {
  min-height: 48px;
  padding: 11px 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  border-radius: 15px;
  font-size: 14px;
  font-weight: 850;
}

.primary-button {
  border: 0;
  background: linear-gradient(145deg, #5c53f0, var(--primary-dark));
  color: white;
  box-shadow:
    0 7px 0 #2c277f,
    0 15px 26px rgba(79, 70, 229, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.primary-button:active {
  transform: translateY(4px);
  box-shadow:
    0 3px 0 #2c277f,
    0 8px 16px rgba(79, 70, 229, 0.2);
}

.primary-button .icon {
  width: 18px;
  height: 18px;
}

.ghost-button {
  border: 1px solid var(--line);
  background: white;
  color: var(--primary-dark);
  box-shadow: 0 8px 18px rgba(79, 70, 229, 0.06);
}

.ghost-button:hover {
  border-color: rgba(79, 70, 229, 0.26);
  box-shadow: 0 10px 22px rgba(79, 70, 229, 0.1);
}

.hero-visual {
  position: relative;
  min-height: 250px;
  isolation: isolate;
}

.word-backdrop {
  position: absolute;
  z-index: -1;
  top: 50%;
  left: 50%;
  color: rgba(79, 70, 229, 0.06);
  font-size: clamp(72px, 11vw, 132px);
  font-weight: 1000;
  letter-spacing: -0.08em;
  transform: translate(-50%, -52%) rotate(-8deg);
}

.hero-card {
  position: absolute;
  width: clamp(142px, 19vw, 210px);
  aspect-ratio: 1;
  object-fit: cover;
  border: 6px solid white;
  border-radius: 28px;
  box-shadow: 0 20px 38px rgba(57, 50, 150, 0.18);
}

.hero-card-back {
  top: 25px;
  left: 4%;
  transform: rotate(-11deg);
  opacity: 0.72;
}

.hero-card-mid {
  top: 4px;
  right: 2%;
  transform: rotate(10deg);
  opacity: 0.84;
}

.hero-card-front {
  left: 50%;
  top: 50%;
  transform: translate(-50%, -46%) rotate(-2deg);
}

.hero-badge {
  position: absolute;
  right: 2%;
  bottom: 10px;
  padding: 9px 13px;
  border-radius: 13px;
  background: var(--sun);
  color: #603900;
  font-size: 12px;
  font-weight: 950;
  box-shadow: 0 8px 0 #d89924, 0 14px 24px rgba(246, 184, 63, 0.24);
  transform: rotate(4deg);
}

.quick-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 18px 0 38px;
}

.quick-stat {
  min-height: 84px;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 13px;
  border: 1px solid rgba(79, 70, 229, 0.07);
  border-radius: 21px;
  background: rgba(255, 255, 255, 0.79);
  box-shadow: 0 10px 30px rgba(61, 57, 151, 0.06);
}

.stat-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 15px;
}

.stat-icon .icon {
  width: 21px;
  height: 21px;
}

.new-stat .stat-icon {
  color: var(--primary);
  background: var(--primary-soft);
}

.review-stat .stat-icon {
  color: #a26400;
  background: var(--sun-soft);
}

.mastered-stat .stat-icon {
  color: var(--accent-dark);
  background: var(--accent-soft);
}

.quick-stat div {
  display: grid;
}

.quick-stat b {
  font-size: 25px;
  line-height: 1;
}

.quick-stat small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
}

.section-block {
  margin-top: 34px;
}

.section-heading,
.mode-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}

.section-heading h2,
.mode-heading h1 {
  margin: 5px 0 0;
  font-size: clamp(24px, 3.8vw, 36px);
  letter-spacing: -0.035em;
}

.section-score {
  color: var(--primary);
  font-size: 14px;
}

.text-button {
  min-height: 44px;
  padding: 7px 2px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 0;
  background: transparent;
  color: var(--primary);
  font-size: 12px;
  font-weight: 850;
}

.text-button .icon {
  width: 16px;
  height: 16px;
}

.daily-card {
  margin-top: 12px;
  padding: 22px;
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 24px;
  align-items: center;
  border-radius: var(--radius-lg);
}

.daily-ring {
  position: relative;
  width: 135px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
}

.daily-ring svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.ring-track,
.ring-value {
  fill: none;
  stroke-width: 9;
}

.ring-track {
  stroke: #edf0fb;
}

.ring-value {
  stroke: var(--primary);
  stroke-linecap: round;
  stroke-dasharray: 314;
  stroke-dashoffset: 314;
  transition: stroke-dashoffset 0.5s ease;
}

.daily-ring div {
  display: grid;
  place-items: center;
}

.daily-ring b {
  font-size: 28px;
}

.daily-ring small {
  color: var(--muted);
  font-size: 11px;
}

.daily-detail {
  display: grid;
  gap: 8px;
}

.daily-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--ink-soft);
  font-size: 12px;
}

.daily-row span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.dot {
  width: 8px;
  height: 8px;
  display: inline-block;
  border-radius: 50%;
}

.dot-indigo {
  background: var(--primary);
}

.dot-green {
  background: var(--accent);
}

.bar {
  height: 9px;
  margin-bottom: 5px;
  overflow: hidden;
  border-radius: 99px;
  background: #eceffa;
}

.bar i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #7369fa, var(--primary));
  transition: width 0.45s ease;
}

.bar i.green {
  background: linear-gradient(90deg, #31c66d, var(--accent));
}

.scene-grid {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.scene-card {
  min-height: 112px;
  padding: 15px;
  text-align: left;
  border: 1px solid rgba(79, 70, 229, 0.08);
  border-radius: 19px;
  background: white;
  box-shadow: 0 10px 24px rgba(61, 57, 151, 0.06);
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.scene-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 30px rgba(61, 57, 151, 0.1);
}

.scene-card i {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: var(--scene-color);
  background: var(--scene-soft);
}

.scene-card i .icon {
  width: 19px;
  height: 19px;
}

.scene-card b {
  display: block;
  margin-top: 10px;
  font-size: 13px;
}

.scene-card small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.review-preview {
  margin-top: 12px;
  padding: 16px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  border-radius: var(--radius-lg);
}

.review-mini {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 10px;
  padding: 10px;
  border: 0;
  border-radius: 16px;
  background: var(--soft);
  text-align: left;
  cursor: pointer;
}

.review-mini img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 13px;
}

.review-mini b,
.review-mini span {
  min-width: 0;
  display: block;
}

.review-mini b {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.review-mini span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.review-empty-mini {
  grid-column: 1 / -1;
  padding: 22px;
  color: var(--muted);
  text-align: center;
}

.mode-heading {
  margin: 22px 0 24px;
}

.search-wrap {
  min-height: 56px;
  padding: 0 16px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: white;
  box-shadow: 0 10px 28px rgba(61, 57, 151, 0.07);
}

.search-wrap > .icon {
  color: var(--muted);
}

.search-wrap input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 14px;
}

.search-wrap input::placeholder {
  color: #8b93a8;
}

.inline-clear {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.filter-panel {
  margin-top: 14px;
  display: grid;
  gap: 10px;
}

.segmented {
  width: max-content;
  padding: 5px;
  display: flex;
  gap: 4px;
  border-radius: 15px;
  background: #e7eaf6;
}

.segmented button {
  min-height: 44px;
  padding: 8px 14px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.segmented button.active {
  background: white;
  color: var(--ink);
  box-shadow: 0 5px 14px rgba(61, 57, 151, 0.1);
}

.wide-segmented {
  width: 100%;
  margin: 16px 0;
}

.wide-segmented button {
  flex: 1;
}

.chip-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 1px 1px 6px;
  scrollbar-width: none;
}

.chip-row::-webkit-scrollbar {
  display: none;
}

.filter-chip {
  min-height: 44px;
  padding: 8px 12px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.84);
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
  white-space: nowrap;
}

.filter-chip i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--chip-color);
}

.filter-chip.active {
  border-color: var(--primary);
  background: var(--primary);
  color: white;
}

.filter-chip.active i {
  background: white;
}

.result-meta {
  margin: 18px 0 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 11px;
}

.source-pill {
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-weight: 800;
}

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

.learn-card {
  position: relative;
  min-width: 0;
  padding: 11px;
  text-align: left;
  border: 1px solid rgba(79, 70, 229, 0.07);
  border-radius: 21px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 10px 26px rgba(61, 57, 151, 0.065);
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.learn-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 34px rgba(61, 57, 151, 0.11);
}

.learn-card img {
  width: 100%;
  aspect-ratio: 1.12;
  object-fit: cover;
  border-radius: 15px;
  background: var(--soft);
}

.card-topline {
  margin: 10px 2px 4px;
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.card-topline span:first-child {
  padding: 3px 6px;
  border-radius: 6px;
  background: var(--primary-soft);
  color: var(--primary);
}

.learn-card h3 {
  margin: 0 2px;
  overflow: hidden;
  font-size: 16px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.learn-card p {
  min-height: 36px;
  margin: 4px 2px 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.learned-badge {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  box-shadow: 0 7px 14px rgba(22, 163, 74, 0.22);
}

.learned-badge .icon {
  width: 15px;
  height: 15px;
  stroke-width: 2.5;
}

.empty-state {
  padding: 64px 20px;
  text-align: center;
}

.empty-icon {
  width: 50px;
  height: 50px;
  color: var(--primary);
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
}

.empty-state h3 {
  margin: 9px 0 5px;
}

.empty-state p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.review-summary {
  padding: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-radius: var(--radius-lg);
}

.review-summary > div {
  display: grid;
  gap: 1px;
}

.summary-kicker {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.review-summary strong {
  font-size: 42px;
  line-height: 1;
}

.review-summary small {
  color: var(--muted);
}

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

.review-item {
  padding: 12px;
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid rgba(79, 70, 229, 0.07);
  border-radius: 19px;
  background: white;
  box-shadow: 0 8px 22px rgba(61, 57, 151, 0.05);
}

.review-item img {
  width: 76px;
  height: 76px;
  object-fit: cover;
  border-radius: 14px;
}

.review-item-copy {
  min-width: 0;
}

.review-item-copy b {
  display: block;
  overflow: hidden;
  font-size: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.review-item-copy span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.review-tags {
  margin-top: 7px;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.review-tags em {
  padding: 3px 7px;
  border-radius: 99px;
  background: var(--sun-soft);
  color: #8d5700;
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
}

.review-item .icon-button {
  width: 42px;
  height: 42px;
}

.profile-head {
  margin: 18px 0 22px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.avatar {
  width: 70px;
  height: 70px;
  border-radius: 22px;
  font-size: 22px;
  transform: rotate(-3deg);
}

.profile-head h1 {
  margin: 5px 0 2px;
  font-size: clamp(27px, 4vw, 38px);
  letter-spacing: -0.04em;
}

.profile-head p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.xp-card {
  padding: 20px;
  border-radius: var(--radius-lg);
}

.xp-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.xp-top span {
  padding: 5px 8px;
  border-radius: 8px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 11px;
  font-weight: 900;
}

.xp-top b {
  font-size: 15px;
}

.xp-bar {
  height: 11px;
  margin-top: 12px;
  overflow: hidden;
  border-radius: 99px;
  background: #e9ecf7;
}

.xp-bar i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--sun), #ff8e3c);
}

.xp-card p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.profile-stats {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 9px;
}

.profile-stat {
  padding: 14px;
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(79, 70, 229, 0.07);
}

.profile-stat span,
.profile-stat b {
  display: block;
}

.profile-stat span {
  color: var(--muted);
  font-size: 10px;
}

.profile-stat b {
  margin-top: 3px;
  font-size: 21px;
}

.week-strip {
  margin-top: 12px;
  padding: 15px;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  border-radius: var(--radius-lg);
  background: white;
  box-shadow: 0 10px 26px rgba(61, 57, 151, 0.06);
}

.day-chip {
  display: grid;
  place-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 10px;
}

.day-chip i {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: #edf0f9;
  color: #a1a7b9;
  font-style: normal;
  font-size: 11px;
  font-weight: 900;
}

.day-chip.done i {
  background: var(--accent);
  color: white;
}

.day-chip.today i {
  outline: 3px solid rgba(79, 70, 229, 0.2);
}

.badge-grid {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 9px;
}

.badge-card {
  min-height: 112px;
  padding: 14px;
  text-align: center;
  border: 1px solid rgba(79, 70, 229, 0.07);
  border-radius: 18px;
  background: white;
  opacity: 0.45;
}

.badge-card.unlocked {
  opacity: 1;
  box-shadow: 0 10px 24px rgba(61, 57, 151, 0.06);
}

.badge-icon {
  width: 40px;
  height: 40px;
  margin: 0 auto 8px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--primary-soft);
  color: var(--primary);
}

.badge-icon .icon {
  width: 21px;
  height: 21px;
}

.badge-card b {
  display: block;
  font-size: 11px;
}

.badge-card span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.category-progress-list {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 9px;
}

.category-progress-item {
  padding: 14px;
  border: 1px solid rgba(79, 70, 229, 0.07);
  border-radius: 17px;
  background: white;
}

.category-progress-item > div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 11px;
}

.category-progress-item i {
  display: block;
  height: 7px;
  margin-top: 10px;
  overflow: hidden;
  border-radius: 99px;
  background: #eceff8;
}

.category-progress-item i::after {
  content: "";
  display: block;
  width: var(--item-progress);
  height: 100%;
  border-radius: inherit;
  background: var(--item-color);
}

.profile-actions {
  margin-top: 26px;
  display: grid;
  gap: 8px;
}

.settings-row {
  min-height: 56px;
  padding: 0 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: white;
  cursor: pointer;
}

.settings-row span {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 12px;
  font-weight: 750;
}

.settings-row > .icon {
  width: 16px;
  height: 16px;
  color: var(--muted);
}

.settings-row.danger span {
  color: var(--danger);
}

.privacy-note {
  margin-top: 15px;
  padding: 14px;
  display: flex;
  align-items: flex-start;
  gap: 9px;
  border-radius: 15px;
  background: var(--accent-soft);
  color: #166534;
}

.privacy-note .icon {
  width: 18px;
  height: 18px;
  margin-top: 2px;
}

.privacy-note p {
  margin: 0;
  font-size: 11px;
  line-height: 1.6;
}

.bottom-nav {
  position: fixed;
  z-index: 40;
  left: 50%;
  bottom: calc(13px + var(--safe-bottom));
  width: min(510px, calc(100% - 24px));
  padding: 7px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  border: 1px solid rgba(79, 70, 229, 0.12);
  border-radius: 23px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 18px 45px rgba(53, 47, 137, 0.18);
  backdrop-filter: blur(18px);
  transform: translateX(-50%);
}

.nav-item {
  position: relative;
  min-height: 56px;
  display: grid;
  place-items: center;
  gap: 1px;
  border: 0;
  border-radius: 17px;
  background: transparent;
  color: #59627a;
  cursor: pointer;
}

.nav-item .icon {
  width: 21px;
  height: 21px;
}

.nav-item b {
  font-size: 10px;
}

.nav-item.active {
  background: linear-gradient(145deg, #5f56f1, var(--primary-dark));
  color: white;
  box-shadow: 0 8px 18px rgba(79, 70, 229, 0.24);
}

.nav-badge {
  position: absolute;
  top: 7px;
  right: calc(50% - 24px);
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  display: grid;
  place-items: center;
  border-radius: 99px;
  background: var(--danger);
  color: white;
  font-size: 9px;
  font-weight: 900;
}

.session-page {
  max-width: 860px;
  margin: 0 auto;
}

.session-header {
  position: sticky;
  z-index: 15;
  top: 0;
  min-height: 76px;
  padding: 10px 0;
  display: grid;
  grid-template-columns: 44px 1fr auto;
  align-items: center;
  gap: 13px;
  background: linear-gradient(180deg, rgba(241, 243, 255, 0.98) 70%, rgba(241, 243, 255, 0));
}

.session-progress {
  display: grid;
  gap: 5px;
}

.session-progress > div {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #dfe3f3;
}

.session-progress i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #7167ff, var(--primary));
  transition: width 0.25s ease;
}

.session-progress span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-align: right;
}

.session-xp {
  min-width: 60px;
  color: #946000;
  font-size: 12px;
  font-weight: 900;
  text-align: right;
}

.session-card {
  min-height: calc(100dvh - 185px);
  padding: clamp(20px, 4.6vw, 40px);
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(79, 70, 229, 0.08);
  border-radius: 30px;
  background:
    radial-gradient(circle at 8% 3%, rgba(255, 193, 86, 0.17), transparent 14rem),
    radial-gradient(circle at 94% 12%, rgba(129, 140, 248, 0.15), transparent 16rem),
    white;
  box-shadow: var(--shadow);
}

.session-kicker {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.session-kicker b {
  color: var(--primary);
}

.study-layout {
  flex: 1;
  margin-top: 18px;
  display: grid;
  grid-template-columns: minmax(200px, 0.82fr) minmax(0, 1.18fr);
  gap: clamp(22px, 4vw, 42px);
  align-items: center;
}

.study-visual {
  position: relative;
  display: grid;
  place-items: center;
}

.study-visual img {
  width: min(360px, 100%);
  border-radius: 25px;
  box-shadow: 0 18px 36px rgba(61, 57, 151, 0.13);
}

.study-copy h1 {
  margin: 7px 0 4px;
  font-size: clamp(42px, 7vw, 72px);
  line-height: 1;
  letter-spacing: -0.055em;
  overflow-wrap: anywhere;
}

.study-meaning {
  margin: 5px 0 12px;
  color: var(--ink-soft);
  font-size: 20px;
  font-weight: 750;
}

.study-letter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 12px 0 16px;
}

.letter-chip {
  min-width: 27px;
  height: 31px;
  padding: 0 5px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-size: 11px;
  font-weight: 900;
}

.study-example {
  padding: 14px;
  border-radius: 15px;
  background: #f7f8fd;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.7;
}

.study-example b {
  display: block;
  margin-bottom: 4px;
  color: var(--primary);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.study-source {
  margin-top: 7px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}

.study-actions {
  margin-top: 22px;
  display: grid;
  grid-template-columns: 0.7fr 1.3fr;
  gap: 9px;
}

.study-actions .ghost-button,
.study-actions .primary-button {
  min-height: 52px;
}

.session-speak {
  min-height: 44px;
  padding: 8px 12px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 0;
  border-radius: 12px;
  background: var(--sun-soft);
  color: #8d5700;
  font-size: 12px;
  font-weight: 850;
}

.session-speak .icon {
  width: 18px;
  height: 18px;
}

.quiz-layout {
  flex: 1;
  margin-top: 14px;
  display: flex;
  flex-direction: column;
}

.quiz-visual {
  width: min(250px, 52vw);
  margin: 4px auto 10px;
  border-radius: 22px;
}

.quiz-prompt {
  margin: 3px 0 6px;
  text-align: center;
  font-size: clamp(25px, 4.8vw, 38px);
  letter-spacing: -0.035em;
}

.quiz-subprompt {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.quiz-options {
  width: min(650px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.quiz-option {
  min-height: 58px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: white;
  color: var(--ink-soft);
  text-align: left;
  font-size: 13px;
  font-weight: 700;
}

.quiz-option i {
  width: 27px;
  height: 27px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--soft);
  color: var(--muted);
  font-style: normal;
  font-size: 10px;
  font-weight: 900;
}

.quiz-option:hover:not(:disabled) {
  border-color: rgba(79, 70, 229, 0.28);
}

.quiz-option.correct {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: #14532d;
}

.quiz-option.wrong {
  border-color: var(--danger);
  background: var(--danger-soft);
  color: #7f1d1d;
}

.quiz-option:disabled {
  cursor: default;
}

.listen-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.listen-orb {
  position: relative;
  width: 170px;
  height: 170px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background:
    radial-gradient(circle at 38% 32%, rgba(255, 255, 255, 0.9), transparent 22px),
    linear-gradient(145deg, var(--secondary), var(--primary-dark));
  color: white;
  box-shadow:
    0 11px 0 #2b267d,
    0 25px 42px rgba(79, 70, 229, 0.25),
    inset 0 2px 5px rgba(255, 255, 255, 0.3);
  cursor: pointer;
}

.listen-orb::after {
  content: "";
  position: absolute;
  inset: -12px;
  border: 2px dashed rgba(79, 70, 229, 0.2);
  border-radius: 50%;
}

.listen-orb .icon {
  width: 53px;
  height: 53px;
  stroke-width: 1.6;
}

.listen-pulse {
  animation: audio-pulse 1.4s ease-in-out infinite;
}

@keyframes audio-pulse {
  50% {
    transform: scale(1.035);
    box-shadow: 0 11px 0 #2b267d, 0 32px 58px rgba(79, 70, 229, 0.33);
  }
}

.listen-stage h1 {
  margin: 22px 0 4px;
  font-size: clamp(25px, 5vw, 36px);
}

.listen-stage p {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 12px;
}

.spell-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.spell-stage img {
  width: min(235px, 47vw);
  border-radius: 22px;
}

.spell-stage h1 {
  margin: 14px 0 3px;
  font-size: clamp(27px, 5vw, 40px);
}

.spell-stage > p {
  margin: 0 0 13px;
  color: var(--muted);
  font-size: 12px;
}

.spell-form {
  width: min(590px, 100%);
  display: grid;
  gap: 9px;
}

.spell-form label {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-align: left;
}

.spell-input {
  width: 100%;
  min-height: 60px;
  padding: 0 16px;
  border: 2px solid var(--line);
  border-radius: 15px;
  background: #fbfcff;
  color: var(--ink);
  font-size: 22px;
  font-weight: 850;
  text-align: center;
  outline: 0;
}

.spell-input.correct {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.spell-input.wrong {
  border-color: var(--danger);
  background: var(--danger-soft);
}

.spell-feedback {
  min-height: 24px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.spell-feedback.correct {
  color: var(--accent-dark);
}

.spell-feedback.wrong {
  color: var(--danger);
}

.spell-hint {
  margin: 0;
  color: var(--primary);
  font-size: 12px;
}

.answer-action {
  width: 100%;
  margin-top: 4px;
}

.session-feedback {
  width: min(650px, 100%);
  margin: 13px auto 0;
  padding: 12px 14px;
  border-radius: 13px;
  font-size: 12px;
  font-weight: 750;
}

.session-feedback.good {
  background: var(--accent-soft);
  color: #14532d;
}

.session-feedback.bad {
  background: var(--danger-soft);
  color: #7f1d1d;
}

.session-complete {
  min-height: min(650px, calc(100dvh - 180px));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.complete-orbit {
  position: relative;
  width: 170px;
  height: 170px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--sun-soft);
  color: #a86400;
}

.complete-orbit::before,
.complete-orbit::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  border: 3px dashed rgba(246, 184, 63, 0.5);
}

.complete-orbit::before {
  inset: -12px;
}

.complete-orbit::after {
  inset: -26px;
  opacity: 0.45;
}

.complete-orbit .icon {
  width: 72px;
  height: 72px;
  stroke-width: 1.5;
}

.session-complete h1 {
  margin: 32px 0 4px;
  font-size: clamp(34px, 7vw, 56px);
}

.session-complete > p {
  margin: 0;
  color: var(--muted);
}

.complete-stats {
  width: min(530px, 100%);
  margin: 23px 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.complete-stat {
  padding: 13px;
  border-radius: 15px;
  background: var(--soft);
}

.complete-stat span,
.complete-stat b {
  display: block;
}

.complete-stat span {
  color: var(--muted);
  font-size: 10px;
}

.complete-stat b {
  margin-top: 2px;
  font-size: 21px;
}

.complete-actions {
  width: min(530px, 100%);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

dialog {
  padding: 0;
  border: 0;
}

dialog::backdrop {
  background: rgba(30, 27, 78, 0.42);
  backdrop-filter: blur(8px);
}

.detail-dialog {
  width: min(940px, calc(100% - 28px));
  max-height: min(760px, calc(100dvh - 28px));
  overflow: auto;
  border-radius: 29px;
  background: white;
  color: var(--ink);
  box-shadow: 0 35px 90px rgba(28, 24, 89, 0.3);
}

.dialog-close {
  position: absolute;
  z-index: 4;
  top: 13px;
  right: 13px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 8px 20px rgba(61, 57, 151, 0.12);
  cursor: pointer;
}

.detail-layout {
  display: grid;
  grid-template-columns: 0.84fr 1.16fr;
  min-height: 580px;
}

.detail-visual {
  position: relative;
  padding: 40px;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 12% 7%, rgba(246, 184, 63, 0.22), transparent 14rem),
    linear-gradient(145deg, #eef0ff, #fbfaff);
}

.detail-visual img {
  width: min(330px, 100%);
  border-radius: 24px;
}

.detail-kind {
  position: absolute;
  left: 23px;
  bottom: 23px;
  padding: 6px 10px;
  border-radius: 999px;
  background: white;
  color: var(--primary);
  font-size: 10px;
  font-weight: 900;
  box-shadow: 0 8px 17px rgba(61, 57, 151, 0.1);
}

.detail-content {
  padding: clamp(28px, 5vw, 52px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.detail-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.speak-pill {
  min-height: 44px;
  padding: 8px 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  border-radius: 999px;
  background: var(--sun-soft);
  color: #8d5700;
  font-size: 11px;
  font-weight: 850;
  cursor: pointer;
}

.speak-pill .icon {
  width: 17px;
  height: 17px;
}

.detail-content h2 {
  margin: 14px 0 4px;
  font-size: clamp(36px, 5.5vw, 58px);
  line-height: 1.1;
  letter-spacing: -0.045em;
  overflow-wrap: anywhere;
}

.detail-meaning {
  margin: 0;
  color: var(--ink-soft);
  font-size: 18px;
  font-weight: 650;
}

.letters {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 18px 0;
}

.letter-box {
  min-width: 30px;
  height: 36px;
  padding: 0 6px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 900;
}

.letter-box.space {
  width: 11px;
  min-width: 11px;
  background: transparent;
  color: transparent;
}

.chat-example {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--soft);
}

.chat-label {
  color: var(--primary);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.chat-example blockquote {
  margin: 8px 0;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.65;
}

.source-meta {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}

.detail-actions {
  margin-top: 18px;
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 8px;
}

.help-dialog,
.about-dialog {
  width: min(540px, calc(100% - 28px));
  max-height: calc(100dvh - 28px);
  overflow: auto;
  padding: 32px;
  border-radius: 26px;
  color: var(--ink);
  box-shadow: 0 35px 90px rgba(28, 24, 89, 0.3);
}

.help-dialog h2,
.about-dialog h2 {
  margin: 8px 0 10px;
  font-size: 30px;
}

.help-dialog p,
.help-dialog li,
.about-dialog p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.75;
}

.help-dialog code {
  padding: 2px 5px;
  border-radius: 5px;
  background: #eef0f8;
  color: var(--ink);
}

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

.reference-list a {
  padding: 13px;
  display: grid;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--ink);
  text-decoration: none;
}

.reference-list a:hover {
  border-color: rgba(79, 70, 229, 0.28);
  background: var(--soft);
}

.reference-list b {
  font-size: 13px;
}

.reference-list span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.muted-note {
  margin-top: 15px;
}

.toast {
  position: fixed;
  z-index: 60;
  left: 50%;
  bottom: calc(94px + var(--safe-bottom));
  max-width: calc(100% - 32px);
  padding: 11px 16px;
  border-radius: 999px;
  background: var(--ink);
  color: white;
  box-shadow: 0 18px 38px rgba(41, 39, 94, 0.26);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 10px);
  transition: opacity 0.18s ease, transform 0.18s ease;
  font-size: 12px;
  font-weight: 750;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

body.session-active .topbar,
body.session-active .bottom-nav {
  display: none;
}

body.session-active .app-shell {
  padding-bottom: 24px;
}

@media (max-width: 900px) {
  .library-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

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

  .page {
    padding-bottom: 78px;
  }

  body.session-active .page {
    padding-bottom: 10px;
  }

  .topbar {
    min-height: 74px;
  }

  .brand-copy strong {
    font-size: 13px;
  }

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

  .brand-mark {
    width: 43px;
    height: 43px;
    border-radius: 14px;
  }

  .streak-chip {
    min-width: 58px;
    height: 44px;
  }

  .date-line {
    align-items: center;
  }

  .level-pill b {
    display: none;
  }

  .today-hero {
    min-height: 0;
    grid-template-columns: 1fr;
    padding: 23px 20px 26px;
    border-radius: 27px;
  }

  .hero-visual {
    min-height: 214px;
    order: -1;
  }

  .hero-card {
    width: min(166px, 42vw);
    border-width: 5px;
    border-radius: 23px;
  }

  .hero-card-back {
    left: 9%;
    top: 21px;
  }

  .hero-card-mid {
    right: 8%;
    top: 2px;
  }

  .hero-copy h1 {
    font-size: clamp(37px, 12vw, 52px);
  }

  .hero-copy p {
    font-size: 12px;
  }

  .hero-buttons {
    align-items: stretch;
  }

  .hero-buttons .primary-button {
    flex: 1.25;
  }

  .hero-buttons .ghost-button {
    flex: 0.75;
  }

  .quick-stats {
    gap: 7px;
    margin-bottom: 31px;
  }

  .quick-stat {
    min-height: 75px;
    padding: 11px 9px;
    gap: 7px;
    border-radius: 17px;
  }

  .stat-icon {
    width: 34px;
    height: 34px;
    border-radius: 11px;
  }

  .stat-icon .icon {
    width: 17px;
    height: 17px;
  }

  .quick-stat b {
    font-size: 20px;
  }

  .quick-stat small {
    font-size: 10px;
  }

  .daily-card {
    padding: 16px;
    grid-template-columns: 108px 1fr;
    gap: 14px;
  }

  .daily-ring {
    width: 106px;
  }

  .daily-ring b {
    font-size: 22px;
  }

  .scene-grid {
    display: flex;
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 7px;
  }

  .scene-grid::-webkit-scrollbar {
    display: none;
  }

  .scene-card {
    flex: 0 0 112px;
  }

  .review-preview {
    display: flex;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .review-preview::-webkit-scrollbar {
    display: none;
  }

  .review-mini {
    flex: 0 0 min(290px, 86vw);
  }

  .library-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
  }

  .learn-card {
    padding: 9px;
    border-radius: 18px;
  }

  .learn-card h3 {
    font-size: 14px;
  }

  .learn-card p {
    font-size: 11px;
  }

  .review-summary {
    padding: 17px;
  }

  .review-summary strong {
    font-size: 34px;
  }

  .review-summary .primary-button {
    padding-left: 14px;
    padding-right: 14px;
  }

  .review-item {
    grid-template-columns: 64px minmax(0, 1fr) 42px;
    gap: 9px;
  }

  .review-item img {
    width: 64px;
    height: 64px;
  }

  .profile-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .badge-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .category-progress-list {
    grid-template-columns: 1fr;
  }

  .session-page {
    margin: -2px auto 0;
  }

  .session-header {
    min-height: 66px;
  }

  .session-card {
    min-height: calc(100dvh - 92px);
    padding: 18px;
    border-radius: 25px;
  }

  .study-layout {
    grid-template-columns: 1fr;
    gap: 14px;
    margin-top: 10px;
  }

  .study-visual img {
    width: min(205px, 53vw);
    border-radius: 19px;
  }

  .study-copy {
    text-align: center;
  }

  .study-copy h1 {
    font-size: clamp(38px, 12vw, 54px);
  }

  .study-meaning {
    font-size: 17px;
  }

  .study-letter-row {
    justify-content: center;
  }

  .study-example {
    text-align: left;
    font-size: 12px;
  }

  .study-source {
    text-align: left;
  }

  .study-actions {
    margin-top: 14px;
  }

  .quiz-options {
    grid-template-columns: 1fr;
  }

  .quiz-option {
    min-height: 52px;
  }

  .quiz-visual {
    width: min(176px, 44vw);
  }

  .quiz-prompt {
    font-size: 25px;
  }

  .listen-orb {
    width: 132px;
    height: 132px;
  }

  .listen-orb .icon {
    width: 42px;
    height: 42px;
  }

  .spell-stage {
    justify-content: flex-start;
  }

  .spell-stage img {
    width: min(170px, 42vw);
  }

  .session-complete {
    min-height: calc(100dvh - 120px);
  }

  .complete-orbit {
    width: 135px;
    height: 135px;
  }

  .complete-orbit .icon {
    width: 58px;
    height: 58px;
  }

  .detail-dialog {
    width: calc(100% - 16px);
    max-height: calc(100dvh - 16px);
    margin: auto auto 8px;
    border-radius: 26px 26px 14px 14px;
  }

  .detail-layout {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .detail-visual {
    padding: 24px;
  }

  .detail-visual img {
    width: 190px;
  }

  .detail-content {
    padding: 20px;
  }

  .detail-content h2 {
    font-size: 36px;
  }

  .help-dialog,
  .about-dialog {
    padding: 25px;
  }
}

@media (max-width: 390px) {
  .brand-copy small {
    display: none;
  }

  .today-hero {
    padding-left: 17px;
    padding-right: 17px;
  }

  .hero-copy h1 {
    font-size: 38px;
  }

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

  .daily-ring {
    margin: 0 auto;
  }

  .review-summary {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (max-height: 480px) and (orientation: landscape) {
  .session-header {
    min-height: 58px;
    padding-top: 6px;
    padding-bottom: 6px;
  }

  .session-card {
    min-height: 0;
    padding: 14px 18px;
    border-radius: 22px;
  }

  .study-layout {
    grid-template-columns: 0.7fr 1.3fr;
    gap: 18px;
    margin-top: 8px;
  }

  .study-visual img {
    width: min(155px, 25vw);
  }

  .study-copy h1 {
    font-size: 34px;
  }

  .study-example {
    font-size: 11px;
  }

  .study-letter-row {
    margin: 7px 0;
  }

  .study-actions {
    margin-top: 9px;
  }

  .quiz-layout {
    display: grid;
    grid-template-columns: minmax(140px, 0.62fr) minmax(0, 1.38fr);
    grid-template-rows: auto auto auto auto;
    gap: 6px 18px;
    align-content: center;
    margin-top: 8px;
  }

  .quiz-visual {
    width: min(155px, 24vw);
    margin: 0;
    grid-column: 1;
    grid-row: 1 / 4;
    align-self: center;
    justify-self: center;
  }

  .quiz-prompt,
  .quiz-subprompt {
    grid-column: 2;
    text-align: left;
  }

  .quiz-prompt {
    grid-row: 1;
    margin: 0;
  }

  .quiz-subprompt {
    grid-row: 2;
    margin: 0;
  }

  .quiz-options {
    grid-column: 2;
    grid-row: 3;
    grid-template-columns: 1fr 1fr;
    width: 100%;
    margin: 0;
  }

  .quiz-option {
    min-height: 44px;
    padding-top: 7px;
    padding-bottom: 7px;
  }

  .quiz-layout > .session-feedback,
  .quiz-layout > .answer-action {
    grid-column: 1 / -1;
    margin-top: 3px;
  }

  .listen-stage {
    display: grid;
    grid-template-columns: minmax(130px, 0.58fr) minmax(0, 1.42fr);
    grid-template-rows: auto auto auto auto;
    gap: 5px 18px;
    align-content: center;
    text-align: left;
  }

  .listen-orb {
    width: 105px;
    height: 105px;
    grid-column: 1;
    grid-row: 1 / 4;
    justify-self: center;
  }

  .listen-stage h1,
  .listen-stage > p,
  .listen-stage .quiz-options {
    grid-column: 2;
    text-align: left;
  }

  .listen-stage h1 {
    margin: 0;
    grid-row: 1;
  }

  .listen-stage > p {
    margin: 0;
    grid-row: 2;
  }

  .listen-stage .quiz-options {
    grid-row: 3;
    margin: 0;
  }

  .listen-stage > .session-feedback,
  .listen-stage > .answer-action {
    grid-column: 1 / -1;
    margin-top: 3px;
  }

  .spell-stage {
    display: grid;
    grid-template-columns: minmax(130px, 0.58fr) minmax(0, 1.42fr);
    grid-template-rows: auto auto auto;
    align-items: center;
    gap: 4px 18px;
    text-align: left;
  }

  .spell-stage img {
    width: min(150px, 24vw);
    grid-column: 1;
    grid-row: 1 / 4;
    justify-self: center;
  }

  .spell-stage h1,
  .spell-stage > p,
  .spell-stage .spell-form,
  .spell-stage > .session-feedback,
  .spell-stage > .answer-action {
    grid-column: 2;
  }

  .spell-stage h1 {
    margin: 0;
    font-size: 30px;
    grid-row: 1;
  }

  .spell-stage > p {
    margin: 0;
    grid-row: 2;
  }

  .spell-stage .spell-form,
  .spell-stage > .session-feedback,
  .spell-stage > .answer-action {
    grid-row: 3;
  }

  .spell-input {
    min-height: 48px;
  }

  .session-complete {
    min-height: 0;
    padding: 4px 0;
  }

  .complete-orbit {
    width: 92px;
    height: 92px;
  }

  .complete-orbit .icon {
    width: 42px;
    height: 42px;
  }

  .session-complete h1 {
    margin: 18px 0 2px;
    font-size: 32px;
  }

  .complete-stats {
    margin: 10px 0;
  }

  .complete-stat {
    padding: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation: none !important;
    transition: none !important;
  }
}
