/* English Tutor — a calm, readable space for a first conversation. */
:root {
  color-scheme: light;
  --bg: #f7f8f5;
  --surface: #ffffff;
  --ink: #172b35;
  --muted: #63717a;
  --text: #52616b;
  --teal: #0f766e;
  --teal-dark: #0a5c55;
  --mint: #e6f2ed;
  --mint-light: #f2f8f4;
  --apricot: #f4b860;
  --apricot-light: #fff4e2;
  --line: #e3e8e2;
  --danger: #a73d3d;
  --danger-bg: #fff2ef;
  --radius: 22px;
  --shadow: 0 8px 30px rgb(23 43 53 / 4%);
  --sidebar-width: 232px;
  font-family: Inter, "Segoe UI", -apple-system, BlinkMacSystemFont, Arial, sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 24px; }
body { margin: 0; background: var(--bg); color: var(--ink); font-size: 16px; line-height: 1.55; }
/* First paint while the signed-in home page loads. */
.home-loader {
  display: grid;
  min-height: 100vh;
  min-height: 100svh;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(ellipse at 24% 20%, var(--mint) 0%, transparent 48%),
    radial-gradient(ellipse at 82% 82%, var(--apricot-light) 0%, transparent 43%),
    var(--bg);
}
.home-loader-card {
  display: grid;
  justify-items: center;
  width: min(100%, 420px);
  padding: clamp(30px, 8vw, 52px) 24px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--surface);
  box-shadow: 0 22px 60px rgba(23, 43, 53, .08);
  text-align: center;
}
.home-loader-brand { display: flex; align-items: center; gap: 10px; font-size: 32px; font-weight: 700; letter-spacing: -.065em; }
.home-loader-brand strong { color: var(--teal); }
.home-loader-status { margin-top: 24px; }
.home-loader-title { font-size: clamp(20px, 5vw, 26px); font-weight: 650; letter-spacing: -.035em; }
.home-loader-note { margin-top: 4px; color: var(--muted); font-size: 14px; }
.home-loader-wave { display: flex; align-items: center; gap: 5px; height: 24px; margin-top: 22px; }
.home-loader-wave span { width: 5px; height: 15px; border-radius: 999px; background: var(--teal); }
.home-loader-wave span:nth-child(2) { height: 22px; background: #75a88f; }
.home-loader-wave span:nth-child(3) { background: #e5a74c; }
@media (prefers-reduced-motion: no-preference) {
  .home-loader-wave span { animation: home-loader-wave 1.1s ease-in-out infinite; }
  .home-loader-wave span:nth-child(2) { animation-delay: .12s; }
  .home-loader-wave span:nth-child(3) { animation-delay: .24s; }
  @keyframes home-loader-wave {
    0%, 65%, 100% { transform: scaleY(.55); }
    30% { transform: scaleY(1); }
  }
}
@media (scripting: none) {
  .home-loader { display: none; }
}

button, input, textarea, select { font: inherit; }
button, a, input, textarea, select { -webkit-tap-highlight-color: transparent; }
button { color: inherit; cursor: pointer; }
button, input, textarea, select { max-width: 100%; }
button:disabled { cursor: not-allowed; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
img { height: auto; }
svg.icon { width: 22px; height: 22px; flex: 0 0 22px; stroke-width: 1.7; }
h1, h2, h3, h4, p { margin: 0; }
h1, h2, h3, h4 { line-height: 1.22; font-weight: 650; letter-spacing: -.035em; }
button, a { touch-action: manipulation; }
:focus-visible { outline: 3px solid #d39431; outline-offset: 4px; }
input:focus-visible, textarea:focus-visible { outline: 3px solid rgb(15 118 110 / 22%); outline-offset: 2px; }
::selection { background: #c9e5da; color: var(--ink); }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; top: 12px; left: 12px; z-index: 1000; padding: 12px 20px; border-radius: 12px; background: var(--ink); color: #fff; transform: translateY(-160%); }
.skip-link:focus { transform: translateY(0); }
.muted { color: var(--text); }
.small-label, .eyebrow { font-size: 12px; font-weight: 650; line-height: 1.45; letter-spacing: .1em; text-transform: uppercase; }
.eyebrow { color: var(--teal); margin-bottom: 12px; }
.small-label { color: var(--muted); }
.app-shell { min-height: 100vh; min-height: 100dvh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 40; display: flex; flex-direction: column; width: var(--sidebar-width); padding: 35px 20px 25px; border-right: 1px solid var(--line); background: #fcfdfb; }
.brand { display: flex; align-items: center; gap: 11px; padding: 0 9px; min-height: 48px; border: 0; border-radius: 10px; background: transparent; text-align: left; }
.brand-mark { display: block; flex: 0 0 40px; width: 40px; height: 40px; }
.brand-name { display: block; font-size: 18px; line-height: 1.25; font-weight: 720; letter-spacing: -.055em; white-space: nowrap; }
.brand-name > span { color: var(--teal); }
.brand-subtitle { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; line-height: 1.3; letter-spacing: .035em; }
.mobile-menu-toggle { display: none; }
.nav-list { display: flex; flex-direction: column; gap: 8px; margin: 52px 0 0; padding: 0; list-style: none; }
.nav-item { display: flex; align-items: center; gap: 13px; width: 100%; min-height: 49px; padding: 12px 15px; border: 1px solid transparent; border-radius: 11px; color: var(--text); background: transparent; font-size: 14px; font-weight: 540; text-align: left; transition: background .18s ease, color .18s ease; }
.nav-item:hover { background: #f0f4ef; color: var(--ink); }
.nav-item.active { background: var(--mint); color: var(--teal-dark); font-weight: 650; }
.nav-item.active .icon { stroke-width: 2; }
.nav-item .icon { width: 20px; height: 20px; flex-basis: 20px; }
.sidebar-footer { margin-top: auto; padding: 24px 7px 0; }
.language-card { display: flex; align-items: center; gap: 11px; padding: 15px 12px; border: 1px solid var(--line); border-radius: 13px; background: #fff; font-size: 12px; line-height: 1.5; }
.language-symbol { flex-shrink: 0; white-space: nowrap; }
.language-card > .icon { color: var(--teal); }
.language-card strong { display: block; font-size: 13px; font-weight: 600; }
.language-card p, .language-card span { color: var(--muted); }
.sidebar-caption { margin-top: 17px; padding: 0 8px; font-size: 11px; color: #7d8a8d; line-height: 1.65; }
.main { min-width: 0; margin-left: var(--sidebar-width); }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; max-width: 1260px; min-height: 98px; margin: 0 auto; padding: 22px 40px; }
.breadcrumb { display: flex; align-items: center; gap: 9px; min-width: 0; color: var(--muted); font-size: 12px; letter-spacing: .005em; }
.breadcrumb > span:last-child { color: var(--ink); }
.breadcrumb .icon { width: 13px; height: 13px; flex-basis: 13px; color: #a7b1ae; }
.topbar > div:last-child { display: flex; align-items: center; gap: 18px; }
.profile-button { display: flex; align-items: center; justify-content: center; gap: 9px; min-width: 44px; min-height: 44px; padding: 3px; border: 0; border-radius: 50%; background: transparent; font-size: 13px; }
.avatar { display: grid; place-items: center; width: 36px; height: 36px; border: 3px solid white; border-radius: 50%; background: #eadbcc; color: #755a48; font-size: 12px; font-weight: 650; box-shadow: 0 0 0 1px #e4e6e0; }
.page-content { width: 100%; max-width: 1260px; margin: 0 auto; padding: 12px 40px 54px; }
.app-footer { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; max-width: 1260px; margin: 0 auto; padding: 18px 40px 24px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.app-footer strong { color: var(--ink); }
.page-heading { margin-bottom: 29px; }
.page-heading h1 { font-size: clamp(30px, 2.8vw, 39px); }
.page-heading > .muted, .page-heading > p:last-child:not(.eyebrow) { margin-top: 12px; font-size: 15px; line-height: 1.65; }
.hero { position: relative; display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr); align-items: stretch; min-height: 342px; margin-bottom: 43px; overflow: hidden; border: 1px solid #dcebe1; border-radius: 24px; background: var(--mint); }
.hero-copy { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: flex-start; padding: 32px 0 31px 34px; }
.pill { display: inline-flex; align-items: center; gap: 7px; max-width: 100%; padding: 6px 10px; border: 1px solid #c9ddd0; border-radius: 999px; color: #406653; background: rgb(255 255 255 / 43%); font-size: 10px; font-weight: 600; line-height: 1.35; letter-spacing: .055em; text-transform: uppercase; }
.pill .icon { width: 13px; height: 13px; flex-basis: 13px; }
.hero-title { max-width: 490px; margin-top: 19px; font-size: clamp(31px, 3vw, 43px); line-height: 1.13; font-weight: 650; letter-spacing: -.055em; }
.hero-title em { color: var(--teal); font-style: normal; }
.hero-description { max-width: 360px; margin-top: 17px; color: #4d655c; font-size: 14px; line-height: 1.75; }
.hero-footer { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: auto; padding-top: 24px; }
.hero-footer > span, .hero-footer > p { display: flex; align-items: center; gap: 6px; color: #6a7c71; font-size: 11px; }
.hero-footer > span .icon { width: 14px; height: 14px; flex-basis: 14px; }
.hero-art { position: relative; min-width: 0; min-height: 300px; display: flex; align-items: stretch; justify-content: center; overflow: hidden; }
.hero-art img { width: 100%; height: 100%; min-height: 300px; object-fit: cover; object-position: 50% 50%; }
.hero-art::after { position: absolute; inset: 0; content: ""; pointer-events: none; background: linear-gradient(90deg, var(--mint) 0%, transparent 18%); }
.hero-decoration { position: absolute; z-index: 2; right: 25px; bottom: 22px; padding: 9px 14px; border: 1px solid rgb(255 255 255 / 70%); border-radius: 10px; background: rgb(255 255 255 / 85%); color: var(--teal-dark); box-shadow: var(--shadow); font-size: 13px; transform: rotate(-5deg); }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin: 0 0 20px; }
.section-title { font-size: 20px; font-weight: 650; letter-spacing: -.035em; }
.section-heading > div > p { margin-top: 6px; color: var(--muted); font-size: 13px; }
.text-link { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; border: 0; background: transparent; color: var(--teal); font-size: 12px; font-weight: 600; white-space: nowrap; }
.text-link:hover { color: var(--teal-dark); text-decoration: underline; text-underline-offset: 4px; }
.text-link .icon { width: 15px; height: 15px; flex-basis: 15px; }
.journey-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.unit-card {
  display: flex; flex-direction: column; min-width: 0; padding: 18px; text-align: left;
  border: 1px solid var(--line); border-radius: 18px; background: var(--surface);
  box-shadow: 0 2px 6px rgb(23 43 53 / 3%); transition: border-color .18s, box-shadow .18s, transform .18s;
}
.unit-card.in-progress { border-color: #98beb2; background: linear-gradient(155deg, #eff8f4, #fff 64%); }
.unit-card.complete { border-color: #c5ded2; }
.unit-card.planned { background: #f9faf7; }
@media (hover: hover) {
  .unit-card:hover { border-color: #88ad9f; box-shadow: 0 8px 20px rgb(23 43 53 / 8%); transform: translateY(-2px); }
}
.unit-card-top, .unit-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.unit-icon { display: grid; place-items: center; flex: 0 0 40px; width: 40px; height: 40px; border-radius: 12px; color: var(--teal-dark); background: var(--mint); }
.unit-icon .icon { width: 20px; height: 20px; }
.unit-card:nth-child(2) .unit-icon { background: #fbefdd; color: #855c29; }
.unit-card:nth-child(3) .unit-icon { background: #eceff6; color: #566585; }
.unit-card:nth-child(4) .unit-icon { background: #f3eaea; color: #865d63; }
.unit-status {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px; padding: 4px 8px; border-radius: 20px;
  background: #eef0eb; color: #53625c; font-size: 11px; font-weight: 650; line-height: 1.35; text-align: center;
}
.unit-card.complete .unit-status, .unit-card.in-progress .unit-status { background: #dcefe6; color: var(--teal-dark); }
.unit-status .icon { width: 13px; height: 13px; flex-basis: 13px; }
.unit-card-copy { display: grid; gap: 6px; margin: 13px 0 16px; }
.unit-number { color: var(--muted); font-size: 10px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; }
.unit-title { font-size: 17px; font-weight: 700; line-height: 1.28; letter-spacing: -.025em; }
.unit-description { color: var(--text); font-size: 13px; line-height: 1.55; }
.unit-card-bottom { display: grid; gap: 8px; margin-top: auto; }
.unit-progress { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 3px 10px; color: var(--text); font-size: 11px; }
.unit-progress strong { color: var(--teal-dark); }
.unit-step-meter { display: flex; gap: 4px; }
.unit-step-meter > span { flex: 1; height: 4px; border-radius: 20px; background: #e5ede8; }
.unit-step-meter > .reached { background: #3f8d80; }
.unit-footer { min-height: 34px; padding-top: 8px; border-top: 1px solid var(--line); color: var(--teal-dark); font-size: 12px; font-weight: 700; }
.unit-action-icon { display: grid; place-items: center; flex: 0 0 25px; width: 25px; height: 25px; border-radius: 50%; background: var(--mint-light); }
.unit-action-icon .icon { width: 14px; height: 14px; }
.unit-card.planned .unit-footer { color: var(--text); }
.unit-card.planned .unit-action-icon { background: #eef0eb; }
.dashboard-bottom { display: grid; grid-template-columns: 1.14fr 1fr; gap: 18px; margin-top: 28px; }
.review-teaser, .tip-card { position: relative; padding: 25px; border: 1px solid var(--line); border-radius: 17px; background: #fff; }
.review-teaser { display: flex; align-items: flex-start; gap: 17px; }
.review-teaser > div:not(.card-icon) { flex: 1; min-width: 0; }
.card-icon { display: grid; place-items: center; flex: 0 0 40px; width: 40px; height: 40px; border-radius: 12px; background: var(--mint-light); color: var(--teal); }
.review-teaser h3, .tip-card h3 { font-size: 15px; line-height: 1.4; letter-spacing: -.02em; }
.review-teaser p, .tip-card p { margin-top: 7px; color: var(--text); font-size: 12px; line-height: 1.75; }
.review-teaser .text-link { margin-top: 7px; padding: 0; min-height: 35px; }
.tip-card { background: #f6f2e9; border-color: #eee8db; }
.tip-card .small-label { color: #9d886a; }
.tip-card .card-icon { float: right; margin: 0 0 10px 14px; width: 32px; height: 32px; background: #f0e7d4; color: #a28755; }
.tip-card h3 { margin-top: 9px; font-weight: 550; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 48px; padding: 12px 20px; border: 1px solid transparent; border-radius: 10px; font-size: 13px; line-height: 1.45; font-weight: 600; letter-spacing: -.005em; text-align: center; transition: background .17s, border-color .17s, box-shadow .17s, transform .17s; }
.btn .icon { width: 17px; height: 17px; flex-basis: 17px; }
.btn-primary { background: var(--teal); color: #fff; box-shadow: 0 3px 6px rgb(15 118 110 / 9%); }
.btn-primary:hover:not(:disabled) { background: var(--teal-dark); box-shadow: 0 5px 12px rgb(15 118 110 / 15%); }
.btn-secondary { background: #fff; color: var(--ink); border-color: #d9e2da; }
.btn-secondary:hover:not(:disabled) { background: #f3f7f2; border-color: #c0cfc4; }
.btn-ghost { color: var(--text); border-color: transparent; background: transparent; }
.btn-ghost:hover:not(:disabled) { color: var(--ink); background: #edf2ed; }
.btn-warm { color: #59441d; background: var(--apricot); border-color: #eeb058; }
.btn-warm:hover:not(:disabled) { background: #eeb05a; }
.btn-danger { color: #fff; background: #ab4843; }
.btn-danger:hover:not(:disabled) { background: #923c38; }
.btn:active:not(:disabled), .icon-button:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .47; box-shadow: none; }
.btn-wide { width: 100%; }
.btn-small { min-height: 44px; padding: 10px 15px; font-size: 12px; }
.button-row { display: flex; align-items: center; justify-content: flex-start; flex-wrap: wrap; gap: 12px; }
.icon-button { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 10px; border: 1px solid var(--line); border-radius: 11px; background: #fff; color: var(--text); transition: background .17s, border-color .17s; }
.icon-button:hover:not(:disabled) { border-color: #b7cbc0; background: var(--mint-light); }
.icon-button:disabled { opacity: .4; }
.arrow { margin-left: 4px; font-size: 18px; line-height: 1; }
.lesson-header { margin: 3px 0 27px; }
.lesson-topline { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.lesson-topline .text-link { padding: 0; color: var(--text); }
.step-label { color: var(--teal); font-size: 11px; font-weight: 650; letter-spacing: .07em; text-transform: uppercase; }
.lesson-title { margin-bottom: 13px; font-size: clamp(28px, 2.6vw, 38px); }
.lesson-header > p { color: var(--text); font-size: 15px; }
.lesson-progress { max-width: 340px; }
.lesson-progress-caption { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 8px; color: var(--teal-dark); font-size: 13px; font-weight: 650; }
.step-meter { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.step-dot { height: 5px; border-radius: 5px; background: #e0e6de; }
.step-dot.done { background: #88b5a4; }
.step-dot.active { background: var(--teal); }
.step-counter { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.lesson-layout { display: grid; grid-template-columns: minmax(0, 1fr) 260px; align-items: start; gap: 24px; }
.lesson-main, .lesson-aside { min-width: 0; }
.lesson-main { display: flex; flex-direction: column; gap: 18px; }
.lesson-aside { display: flex; flex-direction: column; gap: 17px; }
.lesson-card { position: relative; padding: 30px; border: 1px solid var(--line); border-radius: 22px; background: #fff; box-shadow: var(--shadow); }
.lesson-scene { margin: -30px -30px 25px; overflow: hidden; border-radius: 21px 21px 0 0; background: #f6f0e5; }
.lesson-scene img { width: 100%; height: auto; }
.scene-caption { padding: 10px 20px; border-bottom: 1px solid var(--line); color: #4d584b; font-size: 12px; line-height: 1.45; }
.lesson-kicker { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; color: var(--teal); font-size: 11px; font-weight: 650; letter-spacing: .075em; text-transform: uppercase; }
.lesson-instruction { margin-bottom: 24px; color: var(--ink); font-size: 21px; font-weight: 550; letter-spacing: -.025em; line-height: 1.4; }
.lesson-instruction + .muted { margin-top: -12px; margin-bottom: 24px; font-size: 14px; }
.dialogue { display: flex; flex-direction: column; gap: 0; }
.dialogue-row { position: relative; display: grid; grid-template-columns: 35px minmax(0, 1fr) 42px; align-items: center; gap: 12px; padding: 19px 0; border-top: 1px solid #edf0eb; }
.dialogue-row:first-child { border-top: 0; padding-top: 0; }
.dialogue-row:last-child { padding-bottom: 0; }
.speaker { display: grid; place-items: center; align-self: start; width: 32px; height: 32px; margin-top: 3px; border-radius: 50%; background: #f2eee4; color: #8b7658; font-size: 11px; font-weight: 600; }
.dialogue-row:nth-child(2n) .speaker { background: var(--mint); color: var(--teal); }
.speaker.speaker-portrait { display: block; object-fit: cover; }
.lesson-opening .lesson-instruction { margin-bottom: 6px; }
.lesson-opening .lesson-instruction + .muted { margin: 0 0 14px; }
.lesson-opening .dialogue { margin-top: 20px; padding: 15px 16px; border: 1px solid var(--line); border-radius: 14px; background: #f8faf7; }
.lesson-opening .dialogue-row { grid-template-columns: 35px minmax(0, 1fr); align-items: start; padding: 12px 0; }
.lesson-opening .dialogue-row:first-child { padding-top: 0; }
.lesson-opening .dialogue-row:last-child { padding-bottom: 0; }
.lesson-opening .opening-actions { margin-top: 18px; padding-top: 16px; }
.lesson-video { margin-top: 16px; color: var(--teal-dark); font-size: 14px; }
.lesson-video summary { width: fit-content; min-height: 44px; padding: 12px 0; font-weight: 600; cursor: pointer; }
.lesson-video video { display: block; width: 100%; max-height: 420px; border-radius: 14px; background: #182520; }
.opening-actions .lesson-note { margin: 0; }
.phrase { font-size: 22px; line-height: 1.35; font-weight: 550; letter-spacing: -.025em; }
.translation { display: block; margin-top: 5px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.phrase-line { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.audio-button { gap: 8px; flex: 0 0 auto; max-width: 100%; min-height: 44px; padding: 10px 15px; border: 1px solid #b8d2c5; border-radius: 11px; background: #eef6f0; color: var(--teal-dark); line-height: 1.3; transition: background .2s, border-color .2s; }
.audio-button:hover { background: #e5f1e9; border-color: #a7c9b6; }
.audio-button.playing { background: var(--teal); border-color: var(--teal); color: white; }
.audio-button .icon { width: 18px; height: 18px; flex-basis: 18px; }
.response-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; margin-bottom: 12px; }
.response-heading .lesson-kicker { margin: 0; }
.question-player { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: #f6f9f6; }
.speaker-avatar { display: grid; place-items: center; flex: 0 0 40px; height: 40px; border-radius: 12px; background: var(--mint); color: var(--teal-dark); }
.question-player > div { display: grid; flex: 1 1 145px; gap: 3px; font-size: 14px; line-height: 1.4; }
.question-player > div > span { color: var(--muted); font-size: 12px; }
.caption-toggle { margin-top: 8px; min-height: 44px; }
.lesson-actions { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-top: 25px; padding-top: 24px; border-top: 1px solid var(--line); }
.lesson-actions > .btn:only-child { margin-left: auto; }
.lesson-note { display: flex; align-items: flex-start; gap: 9px; margin-top: 16px; color: var(--muted); font-size: 12px; line-height: 1.7; }
.lesson-note .icon { width: 16px; height: 16px; flex-basis: 16px; margin-top: 3px; }
.aside-card { padding: 23px; border: 1px solid var(--line); border-radius: 17px; background: #fff; }
.aside-card h2, .aside-card h3 { margin-bottom: 15px; font-size: 15px; line-height: 1.4; letter-spacing: -.02em; }
.aside-card > p { color: var(--text); font-size: 12px; line-height: 1.8; }
.outcome-list { display: flex; flex-direction: column; gap: 17px; margin: 0; padding: 0; list-style: none; }
.outcome-list li { display: flex; align-items: flex-start; gap: 10px; color: var(--text); font-size: 12px; line-height: 1.7; }
.outcome-list li::before { content: ""; flex: 0 0 6px; width: 6px; height: 6px; margin-top: 7px; border: 1px solid #9eafa2; border-radius: 50%; background: #f7f9f5; }
.outcome-list li.done { color: var(--teal-dark); }
.outcome-list li.done::before { border-color: var(--teal); background: var(--teal); }
.outcome-list li .icon { width: 16px; height: 16px; flex-basis: 16px; margin-top: 2px; }
.outcome-list li:has(.icon)::before { display: none; }
.help-card { background: #f1f5ed; border-color: #e3eadc; }
.help-card .card-icon { margin-bottom: 13px; background: #e5eddd; color: #63825e; }
.help-card h3 { margin-bottom: 10px; }
.option-list { display: flex; flex-direction: column; gap: 12px; margin: 24px 0; }
.option-btn { display: flex; align-items: center; gap: 14px; min-height: 70px; width: 100%; padding: 15px 18px; border: 1px solid #dfe6de; border-radius: 12px; background: #fff; text-align: left; transition: border-color .18s, background .18s; }
.option-btn:hover:not(:disabled) { border-color: #8db5a3; background: #f8fbf6; }
.option-letter { display: grid; place-items: center; flex: 0 0 33px; width: 33px; height: 33px; border: 1px solid #e2e7df; border-radius: 9px; background: #f7f9f5; color: var(--muted); font-size: 12px; font-weight: 600; }
.option-text { min-width: 0; flex: 1; font-size: 17px; font-weight: 500; line-height: 1.5; }
.option-btn.selected { border-color: var(--teal); background: #eff7f2; box-shadow: 0 0 0 1px var(--teal); }
.option-btn.selected .option-letter { border-color: var(--teal); background: var(--teal); color: #fff; }
.option-btn.correct { border-color: #72a48a; background: #eef7ed; }
.option-btn.incorrect { border-color: #c7786e; background: var(--danger-bg); }
.option-btn.incorrect .option-letter { color: var(--danger); border-color: #e6beb5; background: #fce7df; }
.option-btn > .icon { color: var(--teal); }
.option-btn.incorrect > .icon { color: var(--danger); }
.explanation { margin-top: 19px; padding: 17px 19px; border: 1px solid #e8ddc4; border-radius: 12px; background: #fcf7eb; color: #716142; font-size: 13px; line-height: 1.8; }
.explanation strong { display: block; margin-bottom: 3px; color: #514b36; font-size: 14px; }
.explanation.success { background: #eef7ee; border-color: #d7e8d5; color: #456a50; }
.explanation.success strong { color: #2f5d3e; }
.practice-phrase { padding: 30px 20px 29px; border: 1px solid #dce9df; border-radius: 17px; background: var(--mint-light); text-align: center; }
.phrase-target { font-size: clamp(32px, 3.4vw, 48px); line-height: 1.25; letter-spacing: -.045em; font-weight: 600; overflow-wrap: break-word; }
.phrase-meaning { margin-top: 13px; color: var(--text); font-size: 15px; line-height: 1.6; }
.practice-phrase .audio-button { margin: 22px auto 0; }
.listening-player { display: grid; justify-items: center; gap: 8px; margin-top: 20px; }
.listening-player .audio-button, .listening-player .caption-toggle { margin-top: 0; }
.listening-player .phrase { margin: 6px 0 0; }
.correct-celebration { animation: correct-answer-pop .44s ease-out; }
@keyframes correct-answer-pop {
  0% { transform: scale(.98); box-shadow: 0 0 0 0 rgb(77 139 106 / 25%); }
  42% { transform: scale(1.015); }
  100% { transform: scale(1); box-shadow: 0 0 0 8px transparent; }
}
.word-exercise { margin-top: 20px; padding-inline: clamp(10px, 3vw, 22px); }
.word-sentence { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .28em; font-size: clamp(24px, 4.8vw, 42px); }
.word-slot { display: inline-grid; place-items: center; min-width: 2.4em; min-height: 1.35em; padding: 0 .2em; border: 2px dashed #8ba99a; border-radius: 10px; background: #fff; color: var(--teal-dark); }
.word-slot.drag-over { border-color: var(--teal); background: var(--mint); }
.word-slot.correct { border: 2px solid #72a48a; background: #eef7ed; }
.word-slot.incorrect { border: 2px solid #c7786e; background: var(--danger-bg); color: var(--danger); }
.word-bank { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 16px; }
.word-tile { min-width: 66px; min-height: 44px; padding: 7px 15px; border: 1px solid #bfd3c7; border-radius: 10px; background: #fff; color: var(--ink); font-size: 17px; font-weight: 650; }
.word-tile:hover:not(:disabled), .word-tile[aria-pressed="true"] { border-color: var(--teal); background: var(--mint-light); color: var(--teal-dark); }
.word-tile[draggable="true"] { cursor: grab; }
.word-tile[draggable="true"]:active { cursor: grabbing; }
.phrase-navigation { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; color: var(--muted); font-size: 12px; }
.pronunciation-card { margin-top: 22px; padding: clamp(16px, 3vw, 24px); border: 1px solid #d6e4d9; border-radius: 16px; background: #f7faf7; }
.pronunciation-card > h3 { margin: 0; font-size: 18px; }
.pronunciation-card .record-panel { padding: 20px 0 0; }
.pronunciation-result { text-align: left; }
.accuracy-card { margin: 14px auto 0; padding: clamp(14px, 3vw, 20px); max-width: 520px; border: 1px solid #c8dfd1; border-radius: 14px; background: #f2f8f3; text-align: left; }
.accuracy-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px 14px; margin-bottom: 8px; }
.accuracy-header h4 { font-size: 15px; }
.accuracy-header strong { color: var(--teal-dark); font-size: 27px; line-height: 1.2; }
.accuracy-header strong span { font-size: 14px; }
.accuracy-card p { color: var(--text); font-size: 13px; line-height: 1.6; }
.accuracy-details { margin: 10px 0; }
.accuracy-details summary { color: var(--teal-dark); font-size: 13px; font-weight: 600; cursor: pointer; }
.accuracy-details p { margin-top: 6px; }
.pronunciation-card .record-controls { margin-top: 12px; }
.record-next { margin-top: 18px; }
.record-panel { padding: 28px 18px 15px; text-align: center; }
.record-orb { display: grid; place-items: center; width: 67px; height: 67px; margin: 0 auto; border: 0; border-radius: 50%; background: #edf3ee; color: #6f8b7d; }
.record-orb .icon { width: 27px; height: 27px; flex-basis: 27px; }
.record-panel.recording .record-orb { background: #f7e3da; color: #b34d41; animation: record-pulse 1.8s ease-out infinite; }
.record-caption { max-width: 370px; margin: 15px auto 0; font-size: 14px; line-height: 1.7; color: var(--text); }
.record-caption strong { color: var(--ink); font-weight: 550; }
.record-controls { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 10px; margin-top: 19px; }
.timer { display: inline-flex; align-items: center; justify-content: center; min-width: 54px; font-variant-numeric: tabular-nums; font-size: 14px; color: #956154; }
.waveform { display: flex; align-items: center; justify-content: center; gap: 4px; height: 32px; margin: 18px auto 0; }
.waveform span { display: block; width: 3px; height: 6px; border-radius: 3px; background: #a9bcb0; }
.recording .waveform span { background: #be7664; animation: waveform .72s ease-in-out infinite alternate; }
.recording .waveform span:nth-child(2n) { animation-delay: -.4s; }
.recording .waveform span:nth-child(3n) { animation-delay: -.2s; }
.recording .waveform span:nth-child(4n) { animation-delay: -.58s; }
.notice { display: flex; align-items: flex-start; gap: 10px; margin: 18px 0; padding: 15px 18px; border: 1px solid #dce6e0; border-radius: 12px; background: #f2f7f3; color: #527064; font-size: 12px; line-height: 1.75; }
.notice .icon { width: 17px; height: 17px; flex-basis: 17px; margin-top: 2px; }
.notice-warning { border-color: #ecd9b1; color: #816338; background: #fff8e9; }
.notice-success { border-color: #d1e4ce; color: #466b45; background: #eff8eb; }
.input-group { display: flex; flex-direction: column; gap: 9px; margin: 20px 0; }
.input-group label { color: var(--ink); font-size: 13px; font-weight: 550; }
.input, textarea.text-answer { display: block; width: 100%; min-height: 49px; padding: 13px 15px; border: 1px solid #d8e1d9; border-radius: 10px; color: var(--ink); background: #fcfdfb; font-size: 16px; line-height: 1.6; }
.input:focus, textarea.text-answer:focus { border-color: var(--teal); }
.input::placeholder, textarea.text-answer::placeholder { color: #98a29b; }
textarea.text-answer { min-height: 135px; resize: vertical; }
.hint { margin-top: 12px; color: var(--muted); font-size: 12px; line-height: 1.7; }
.summary-card { position: relative; overflow: hidden; padding: 36px 30px; text-align: center; }
.summary-symbol { display: grid; place-items: center; width: 76px; height: 76px; margin: 0 auto 24px; border: 1px solid #cce1d0; border-radius: 25px; background: var(--mint); color: var(--teal); }
.summary-symbol .icon { width: 35px; height: 35px; flex-basis: 35px; }
.summary-title { font-size: 32px; margin: 0 0 15px; }
.summary-card > .muted { max-width: 450px; margin: 0 auto; font-size: 14px; line-height: 1.8; }
.summary-metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 27px; padding: 22px 0; border-block: 1px solid var(--line); }
.summary-metrics > div { display: flex; flex-direction: column; gap: 4px; }
.summary-metrics strong { color: var(--teal); font-size: 24px; font-weight: 600; }
.summary-metrics span { color: var(--muted); font-size: 11px; }
.summary-list { display: flex; flex-direction: column; gap: 13px; margin: 23px 0 0; padding: 0; list-style: none; text-align: left; }
.summary-list li { display: flex; align-items: flex-start; gap: 9px; color: var(--text); font-size: 13px; line-height: 1.7; }
.summary-list .icon { color: var(--teal); width: 17px; height: 17px; flex-basis: 17px; margin-top: 3px; }
.summary-card .button-row { justify-content: center; margin-top: 25px; }
.celebration { position: absolute; inset: 0; pointer-events: none; }
.celebration span { position: absolute; top: 35px; width: 6px; height: 12px; border-radius: 2px; background: #d7b073; transform: rotate(30deg); opacity: .55; }
.celebration span:nth-child(1) { left: 19%; top: 45px; transform: rotate(-28deg); }
.celebration span:nth-child(2) { left: 31%; top: 25px; width: 5px; height: 5px; border-radius: 50%; background: #84b9a4; }
.celebration span:nth-child(3) { right: 25%; top: 38px; background: #84b9a4; }
.celebration span:nth-child(4) { right: 14%; top: 72px; width: 5px; height: 5px; border-radius: 50%; }
.review-panel { max-width: 780px; margin: 0 auto; }
.review-footnote { max-width: 780px; margin: 14px auto 0; color: var(--muted); font-size: 12px; line-height: 1.65; }
.review-count { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 17px; color: var(--muted); font-size: 12px; }
.flashcard { position: relative; display: flex; flex-direction: column; align-items: center; padding: clamp(18px, 4vw, 30px); border: 1px solid #dce6db; border-radius: 24px; background: #fff; box-shadow: var(--shadow); text-align: center; }
.flashcard-label { color: #62776a; font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; }
.review-flashcard { gap: 10px; }
.review-flashcard > .btn { margin-top: 4px; }
.review-example { width: 100%; max-width: 520px; padding: 14px 10px; border: 1px solid var(--line); border-radius: 14px; background: var(--mint-light); }
.review-rating { width: 100%; max-width: 520px; margin-top: 4px; padding-top: 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.review-rating .button-row { justify-content: center; gap: 8px; margin-top: 8px; }
.flashcard-phrase { max-width: 100%; font-size: clamp(33px, 4.4vw, 52px); font-weight: 600; letter-spacing: -.045em; line-height: 1.3; overflow-wrap: break-word; }
.flashcard-meaning { margin-top: 4px; color: var(--text); font-size: 17px; line-height: 1.65; }
.flashcard .audio-button { margin-top: 12px; }
.review-word-card { padding-inline: clamp(14px, 4vw, 36px); }
.review-word-card .flashcard-label { margin-bottom: 12px; }
.review-word-card .muted { margin-top: 8px; }
.review-word-sentence { margin-top: 16px; }
.input.review-word-input {
  width: 26ch;
  min-width: 7ch;
  max-width: 100%;
  min-height: 44px;
  padding: 3px 8px;
  font-size: clamp(16px, 4vw, 26px);
  font-weight: inherit;
  text-align: center;
}
@supports (field-sizing: content) {
  .input.review-word-input { field-sizing: content; width: auto; }
}
.review-word-input[aria-invalid="true"] { border-color: #c7786e; }
.review-word-card .button-row { justify-content: center; margin-top: 16px; }
.review-panel > .button-row { margin-top: 22px; justify-content: center; }
.review-panel .lesson-note { justify-content: center; }
.completion-progress { display: grid; gap: 8px; margin-block: 18px; text-align: left; }
.completion-progress > div { display: flex; justify-content: space-between; gap: 12px; }
.completion-progress > progress { width: 100%; height: 10px; accent-color: var(--teal); }
.completion-progress > .form-note { margin: 0; }
.answer-tally { margin: 20px 0; padding: clamp(15px, 3vw, 24px); border: 1px solid var(--line); border-radius: 16px; background: #fff; text-align: left; }
.answer-tally > .muted { margin-top: 5px; font-size: 13px; }
.answer-counts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 14px 0 0; }
.answer-count { display: grid; grid-template-rows: auto 1fr; gap: 4px; padding: 12px 8px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); }
.answer-count dt { grid-row: 2; font-size: 12px; line-height: 1.4; }
.answer-count dd { grid-row: 1; margin: 0; font-size: 24px; font-weight: 650; line-height: 1; }
.answer-count-correct { background: #eef7ed; }
.answer-count-partial { background: #faf5e8; }
.answer-count-incorrect { background: #fbefec; }
.answer-breakdown { margin-top: 14px; border-top: 1px solid var(--line); color: var(--text); }
.answer-breakdown summary { padding: 12px 0 4px; color: var(--teal-dark); font-size: 13px; font-weight: 600; cursor: pointer; }
.answer-breakdown dl { margin: 4px 0 0; }
.answer-breakdown dl > div { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 4px 12px; padding: 7px 0; font-size: 13px; }
.answer-breakdown dd { margin: 0; font-weight: 600; }
.achievement-collection {
  margin: 0 0 26px;
  padding: clamp(16px, 3vw, 29px);
  border: 1px solid #d7e5dc;
  border-radius: 22px;
  background: linear-gradient(145deg, #edf6f0, #f8faf6 58%, #f8f4e9);
}
.achievement-heading > div > .eyebrow { margin-top: 0; color: var(--teal-dark); }
.achievement-count {
  display: inline-flex;
  align-items: center;
  flex: none;
  gap: 7px;
  padding: 8px 12px;
  border: 1px solid #cfdfd4;
  border-radius: 999px;
  background: #fff;
  color: var(--teal-dark);
  font-size: 13px;
  font-weight: 700;
}
.achievement-count .icon { width: 16px; height: 16px; }
.achievement-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.achievement-card {
  --badge-ink: #176759;
  --badge-fill: #b6ded0;
  --badge-ribbon: #87c1ad;
  --badge-disc: #e8f5ed;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  padding: 15px;
  border: 1px solid #dbe6dc;
  border-radius: 17px;
  background: #fff;
  box-shadow: 0 5px 14px #1c3c3010;
}
.achievement-card[data-theme="blue"] { --badge-ink: #315e8a; --badge-fill: #bddef4; --badge-ribbon: #8fb9df; --badge-disc: #eaf4fe; }
.achievement-card[data-theme="lilac"] { --badge-ink: #654981; --badge-fill: #dcccf4; --badge-ribbon: #b99edb; --badge-disc: #f4edff; }
.achievement-card[data-theme="rose"] { --badge-ink: #8b434d; --badge-fill: #f4c7cd; --badge-ribbon: #df9aa6; --badge-disc: #fff1f2; }
.achievement-card[data-theme="gold"] { --badge-ink: #7b5118; --badge-fill: #f7d791; --badge-ribbon: #e9b961; --badge-disc: #fff4d7; }
.achievement-card[data-theme="jade"] { --badge-ink: #426841; --badge-fill: #cce2ad; --badge-ribbon: #a5c580; --badge-disc: #f1f7e4; }
.achievement-card.is-locked { --badge-ink: #5c6a63; --badge-fill: #e4e9e1; --badge-ribbon: #ccd6cc; --badge-disc: #f5f7f3; box-shadow: none; }
.achievement-art {
  display: grid;
  place-items: center;
  min-height: 116px;
  margin: -3px -3px 12px;
  border-radius: 12px;
  background: radial-gradient(ellipse at 50% 36%, #fff, var(--badge-disc));
}
.badge-medal {
  width: 105px;
  height: 105px;
  color: var(--badge-ink);
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 3px 2px #253d3220);
}
.badge-rosette { fill: var(--badge-fill); }
.badge-ribbon { fill: var(--badge-ribbon); }
.badge-disc { fill: var(--badge-disc); }
.badge-stitch { fill: none; stroke-width: 1.15; stroke-dasharray: 1 3.5; }
.badge-ribbon-fold, .badge-sparkles { fill: none; }
.badge-sparkles { stroke-width: 1.3; }
.badge-glyph { fill: none; stroke-width: 2.55; }
.achievement-copy { flex: 1; }
.achievement-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--badge-ink);
  font-size: 11px;
  font-weight: 700;
}
.achievement-status .icon { width: 13px; height: 13px; }
.achievement-copy h3 { margin: 4px 0; font-size: 16px; line-height: 1.25; }
.achievement-copy p { color: var(--muted); font-size: 13px; line-height: 1.45; }
.achievement-progress { display: flex; align-items: center; gap: 9px; margin-top: 13px; color: var(--badge-ink); font-size: 12px; font-weight: 650; }
.achievement-progress progress { flex: 1; min-width: 0; height: 6px; accent-color: var(--badge-ink); }
.achievement-progress span { flex: none; white-space: nowrap; }
@media (min-width: 360px) and (max-width: 560px) {
  .achievement-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .achievement-card { padding: 11px; }
  .achievement-art { min-height: 86px; }
  .badge-medal { width: 80px; height: 80px; }
  .achievement-copy h3 { font-size: 14px; }
  .achievement-copy p { font-size: 12px; }
  .achievement-progress { font-size: 11px; }
}
@media (min-width: 1050px) {
  .achievement-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.stats-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-bottom: 29px; }
.stat-card { padding: 26px; border: 1px solid var(--line); border-radius: 18px; background: #fff; }
.stat-card > .icon { margin-bottom: 18px; color: #76a28e; }
.stat-value { display: block; color: var(--ink); font-size: 34px; line-height: 1.2; font-weight: 600; letter-spacing: -.04em; }
.stat-label { display: block; margin-top: 9px; color: var(--muted); font-size: 12px; }
.progress-details { padding: 27px 30px; border: 1px solid var(--line); border-radius: 20px; background: #fff; }
.progress-details h2 { margin-bottom: 8px; font-size: 21px; }
.progress-details > p { margin-bottom: 22px; color: var(--text); font-size: 13px; }
.skill-row { display: flex; align-items: center; gap: 16px; padding: 20px 0; border-bottom: 1px solid #edf0eb; }
.skill-row:last-child { border-bottom: 0; padding-bottom: 5px; }
.skill-icon { display: grid; place-items: center; flex: 0 0 41px; width: 41px; height: 41px; border-radius: 12px; background: var(--mint-light); color: var(--teal); }
.skill-description { flex: 1; min-width: 0; }
.skill-description h3, .skill-description strong { font-size: 15px; font-weight: 550; }
.skill-description p { margin-top: 4px; color: var(--muted); font-size: 12px; line-height: 1.65; }
.status-pill { display: inline-flex; align-items: center; gap: 5px; flex-shrink: 0; padding: 5px 9px; border-radius: 6px; color: #748076; background: #f0f3ed; font-size: 10px; line-height: 1.5; }
.status-pill.complete, .status-pill.success { color: #37705b; background: var(--mint); }
.course-overview { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 24px; padding: clamp(18px, 3vw, 28px); border: 1px solid var(--line); border-radius: 20px; background: var(--mint-light); }
.course-overview h2 { margin-top: 6px; font-size: clamp(20px, 3vw, 26px); }
.course-overview progress { display: block; width: 100%; max-width: 360px; height: 10px; margin: 12px 0; accent-color: var(--teal); }
.course-overview .muted { font-size: 13px; }
.course-next { display: grid; justify-items: start; align-content: start; gap: 8px; }
.course-group { margin-top: 30px; }
.course-group-heading { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 14px; margin-bottom: 12px; }
.course-group-heading h2 { font-size: clamp(19px, 3vw, 24px); }
.course-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.course-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 12px; width: 100%; padding: 12px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); text-align: left; }
.course-row:hover { border-color: var(--teal); }
.course-index { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: var(--mint); color: var(--teal-dark); font-weight: 650; }
.course-row.planned .course-index { background: #f0f3ed; color: var(--muted); }
.course-details { display: grid; min-width: 0; gap: 3px; overflow-wrap: anywhere; }
.course-details > span { color: var(--text); font-size: 13px; }
.course-state { white-space: nowrap; }
.course-state.in-progress { background: var(--apricot-light); color: var(--ink); }
@media (max-width: 600px) {
  .course-row { grid-template-columns: auto minmax(0, 1fr) auto; gap: 6px 10px; padding: 12px; }
  .course-state { grid-column: 2; grid-row: 2; justify-self: start; }
  .course-row > .icon { grid-column: 3; grid-row: 1; }
}
.profile-hero { display: flex; align-items: center; flex-wrap: wrap; gap: 20px; margin-bottom: 24px; padding: clamp(22px, 4vw, 38px); border: 1px solid #d5e8dd; border-radius: 24px; background: linear-gradient(112deg, var(--mint) 0%, #f2f7f1 72%, #fcf8ee 100%); }
.profile-avatar { flex: 0 0 auto; width: 70px; height: 70px; border-width: 4px; background: var(--teal); color: #fff; font-size: 29px; box-shadow: 0 0 0 1px #c1ddd1; }
.profile-avatar .icon { width: 29px; height: 29px; }
.profile-intro { flex: 1 1 180px; min-width: 0; overflow-wrap: anywhere; }
.profile-intro .eyebrow { margin-bottom: 5px; }
.profile-intro h1 { font-size: clamp(28px, 4vw, 40px); }
.profile-intro h1:focus { outline: none; }
.profile-intro .muted { margin-top: 5px; }
.profile-course-tag { display: inline-flex; align-items: center; gap: 8px; padding: 8px 13px; border: 1px solid #d2e3d7; border-radius: 999px; background: var(--surface); color: var(--teal-dark); font-size: 13px; font-weight: 600; }
.profile-course-tag .icon { width: 17px; height: 17px; flex-basis: 17px; }
.profile-layout { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.profile-column { display: grid; min-width: 0; gap: 20px; }
.settings-card { min-width: 0; padding: 28px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); box-shadow: var(--shadow); }
.profile-card-heading { display: flex; align-items: center; gap: 13px; margin-bottom: 19px; }
.profile-card-heading h2 { font-size: 21px; }
.profile-card-heading p { margin-top: 4px; }
.profile-card-heading p, .settings-card > p { color: var(--text); font-size: 14px; line-height: 1.55; }
.profile-name-field .form-note { margin: 0; }
.profile-motion-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 20px; padding: 16px; border: 1px solid var(--line); border-radius: 13px; background: var(--mint-light); }
.profile-motion-row label { font-size: 14px; font-weight: 650; cursor: pointer; }
.profile-motion-row p { margin-top: 3px; color: var(--text); font-size: 13px; }
.profile-switch { position: relative; display: grid; flex: 0 0 48px; place-items: center; min-height: 44px; }
.profile-switch input { position: absolute; z-index: 1; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.profile-switch span { position: relative; display: block; width: 48px; height: 26px; border: 1px solid #a6b8ad; border-radius: 99px; background: #e1eae2; }
.profile-switch span::after { position: absolute; content: ""; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: white; box-shadow: 0 1px 3px rgb(23 43 53 / 20%); }
.profile-switch input:checked + span { border-color: var(--teal); background: var(--teal); }
.profile-switch input:checked + span::after { left: 25px; }
.profile-switch input:focus-visible + span { outline: 3px solid #d39431; outline-offset: 3px; }
.profile-save { margin-top: 22px; }
.profile-speech .profile-card-heading { align-items: flex-start; margin-bottom: 0; }
.profile-course-details { margin: 0 0 16px; }
.profile-course-details > div { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.profile-course-details dt { color: var(--text); }
.profile-course-details dd { margin: 0; font-weight: 650; text-align: right; }
.profile-account-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; }
.profile-reset { margin-top: 14px; padding-top: 7px; border-top: 1px solid var(--line); }
.profile-reset .text-link { padding-inline: 0; color: var(--danger); }
@media (max-width: 1000px) {
  .profile-layout { grid-template-columns: 1fr; }
}
@media (max-width: 550px) {
  .profile-hero { gap: 12px; }
  .profile-avatar { width: 54px; height: 54px; font-size: 22px; }
  .profile-intro { flex-basis: 130px; }
  .profile-save .btn { width: 100%; }
}
.form-note { margin-top: 13px; color: var(--muted); font-size: 11px; line-height: 1.75; }
.modal-overlay { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgb(23 43 53 / 40%); backdrop-filter: blur(3px); }
.modal { width: min(520px, calc(100vw - 40px)); max-height: calc(100dvh - 40px); margin: auto; padding: 0; overflow: auto; border: 1px solid #dde4d9; border-radius: 22px; background: #fff; color: var(--ink); box-shadow: 0 25px 90px rgb(14 35 29 / 19%); }
dialog:not([open]) { display: none; }
dialog[open] { display: block; animation: dialog-enter .2s ease both; }
dialog::backdrop { background: rgb(23 43 53 / 40%); backdrop-filter: blur(3px); }
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; padding: 27px 27px 16px; }
.modal-header h2 { padding-top: 5px; font-size: 24px; line-height: 1.3; }
.modal-header .icon-button { flex-shrink: 0; border-color: transparent; width: 40px; height: 44px; }
.modal-body { padding: 0 27px 25px; color: var(--text); font-size: 14px; line-height: 1.85; }
.modal-body p + p { margin-top: 13px; }
.modal-body ul { padding-left: 19px; }
.lesson-feedback-image { display: block; width: 100%; height: auto; aspect-ratio: 2 / 1; object-fit: cover; border-radius: 14px; margin-bottom: 14px; }
.lesson-feedback-form { display: grid; gap: 8px; margin-top: 14px; }
.lesson-feedback-form label { font-weight: 650; }
.lesson-feedback-form textarea { width: 100%; min-height: 96px; resize: vertical; }
.lesson-feedback-form [role="status"]:empty { display: none; }
.lesson-feedback-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
.modal-footer { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; padding: 18px 27px 25px; border-top: 1px solid var(--line); }
.toast { position: fixed; z-index: 200; right: 28px; bottom: 26px; max-width: min(440px, calc(100vw - 40px)); padding: 15px 20px; border: 1px solid #37564b; border-radius: 12px; background: #24463c; color: #fff; box-shadow: 0 12px 35px rgb(23 43 53 / 16%); font-size: 13px; line-height: 1.7; animation: dialog-enter .2s ease both; }
noscript { display: block; max-width: 650px; margin: 50px auto; padding: 25px; }
@keyframes enter { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }
@keyframes dialog-enter { from { opacity: 0; transform: translateY(8px) scale(.99); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes record-pulse { 0% { box-shadow: 0 0 0 0 rgb(179 77 65 / 16%); } 75%, 100% { box-shadow: 0 0 0 15px rgb(179 77 65 / 0%); } }
@keyframes waveform { from { height: 6px; } to { height: 26px; } }
.page-heading, .lesson-header, .hero, .lesson-card, .review-panel, .stats-grid, .course-list, .profile-layout { animation: enter .32s ease both; }
.hero { animation-delay: .025s; }
.unit-card { animation: enter .32s ease both; }
.unit-card:nth-child(2) { animation-delay: .045s; }
.unit-card:nth-child(3) { animation-delay: .09s; }
.unit-card:nth-child(4) { animation-delay: .135s; }
@media (min-width: 1500px) { .lesson-layout { grid-template-columns: minmax(0, 1fr) 300px; gap: 28px; } }
@media (max-width: 1190px) {
  :root { --sidebar-width: 212px; }
  .sidebar { padding-inline: 15px; }
  .brand { gap: 9px; padding-inline: 5px; }
  .brand-name { font-size: 17px; }
  .topbar { padding-inline: 30px; }
  .page-content, .app-footer { padding-inline: 30px; }
  .hero-copy { padding-left: 28px; }
  .hero { grid-template-columns: 1.15fr 1fr; min-height: 330px; }
  .hero-title { font-size: 35px; }
  .hero-description { font-size: 13px; }
  .hero-footer { gap: 10px; }
  .journey-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
  .lesson-layout { grid-template-columns: minmax(0, 1fr) 222px; gap: 20px; }
  .lesson-card { padding: 25px; }
  .lesson-scene { margin: -25px -25px 24px; }
  .aside-card { padding: 20px; }
  .lesson-instruction { font-size: 20px; }
  .phrase { font-size: 20px; }

}
@media (max-width: 950px) and (min-width: 761px) {
  :root { --sidebar-width: 190px; }
  .sidebar { padding-inline: 12px; }
  .brand-name { font-size: 15px; }
  .brand-mark { width: 34px; height: 34px; flex-basis: 34px; }
  .brand-subtitle { font-size: 10px; }
  .nav-item { gap: 10px; padding-inline: 12px; font-size: 13px; }
  .topbar, .page-content, .app-footer { padding-inline: 25px; }
  .topbar { min-height: 88px; }
  .hero { min-height: 330px; grid-template-columns: 1.35fr .85fr; }
  .hero-copy { padding: 27px 0 27px 25px; }
  .hero-title { font-size: 32px; }
  .hero-description { font-size: 13px; }
  .hero-footer > span { display: none; }
  .hero-art img { object-position: 58% center; }
  .dashboard-bottom { grid-template-columns: 1fr; }
  .lesson-layout { grid-template-columns: minmax(0, 1fr); }
  .lesson-aside { display: grid; grid-template-columns: 1fr 1fr; }
  .stats-grid { gap: 12px; }
  .stat-card { padding: 20px 17px; }
  .stat-value { font-size: 30px; }
}
@media (max-width: 760px) {
  :root { --sidebar-width: 0px; }
  body { font-size: 16px; }
  .sidebar { position: relative; z-index: auto; flex-direction: row; align-items: center; gap: 12px; width: 100%; height: auto; padding: 18px 23px 0; border: 0; background: var(--bg); }
  .brand { padding: 0; min-height: 39px; gap: 10px; width: max-content; }
  .brand-mark { width: 34px; height: 34px; flex-basis: 34px; }
  .brand-name { font-size: 17px; }
  .brand-subtitle { font-size: 9px; margin-top: 2px; }
  .sidebar-footer { display: none; }
  .mobile-menu-toggle { order: -1; display: grid; place-items: center; width: 44px; height: 44px; flex: 0 0 44px; padding: 0; border: 1px solid var(--line); border-radius: 11px; color: var(--teal-dark); background: #fff; }
  .mobile-menu-toggle[aria-expanded="true"] { background: var(--mint); }
  .nav-list { display: none; position: absolute; z-index: 60; inset: calc(100% + 8px) auto auto 23px; width: min(320px, calc(100% - 46px)); max-height: calc(100dvh - 84px); overflow: auto; gap: 3px; margin: 0; padding: 8px; border: 1px solid var(--line); border-radius: 15px; background: #fcfdfb; box-shadow: 0 12px 28px rgb(23 43 53 / 14%); }
  .mobile-menu-toggle[aria-expanded="true"] + .nav-list { display: flex; }
  .nav-item { min-height: 44px; padding: 8px 12px; font-size: 14px; }
  .nav-item .icon { width: 21px; height: 21px; flex-basis: 21px; }
  .nav-item.active { background: #e8f1e8; }
  .main { margin-left: 0; }
  .topbar { position: relative; min-height: 55px; padding: 15px 23px 13px; }
  .breadcrumb { font-size: 10px; gap: 6px; }
  .topbar > div:last-child { gap: 10px; }
  .profile-button { position: absolute; right: 19px; top: -43px; }
  .profile-button > span:not(.avatar) { display: none; }
  .avatar { width: 33px; height: 33px; font-size: 11px; }
  .page-content { padding: 12px 23px 32px; }
  .app-footer { padding: 14px 23px calc(24px + env(safe-area-inset-bottom)); }
  .page-heading { margin-bottom: 25px; }
  .eyebrow { font-size: 10px; margin-bottom: 11px; }
  .page-heading h1 { font-size: 31px; line-height: 1.15; }
  .page-heading > .muted, .page-heading > p:last-child:not(.eyebrow) { font-size: 13px; margin-top: 13px; }
  .hero { grid-template-columns: 1.1fr 1fr; min-height: 316px; margin-bottom: 31px; border-radius: 20px; }
  .hero-copy { padding: 26px 0 26px 25px; }
  .hero-title { font-size: 31px; letter-spacing: -.05em; }
  .hero-description { font-size: 13px; margin-top: 14px; }
  .hero-art { min-height: 300px; }
  .hero-art img { min-height: 300px; object-position: 58% 50%; }
  .hero-footer > span { display: none; }
  .hero-footer { padding-top: 20px; }
  .pill { font-size: 9px; padding: 5px 9px; }
  .section-heading { margin-bottom: 16px; gap: 10px; }
  .section-title { font-size: 19px; }
  .section-heading .text-link { font-size: 11px; }
  .journey-grid { gap: 12px; }
  .unit-card { padding: 15px; border-radius: 15px; }
  .unit-title { font-size: 16px; }
  .unit-description { font-size: 12px; }
  .dashboard-bottom { grid-template-columns: 1fr 1fr; gap: 13px; margin-top: 22px; }
  .review-teaser, .tip-card { padding: 20px; }
  .review-teaser { gap: 12px; }
  .review-teaser .card-icon { flex-basis: 32px; width: 32px; height: 32px; border-radius: 10px; }
  .review-teaser .card-icon .icon { width: 18px; height: 18px; }
  .lesson-header { margin-top: 0; margin-bottom: 22px; }
  .lesson-topline { margin-bottom: 17px; gap: 9px; }
  .lesson-topline .text-link { font-size: 11px; }
  .lesson-title { font-size: 30px; }
  .lesson-header > p { font-size: 13px; }
  .lesson-layout { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .lesson-main { gap: 14px; }
  .lesson-card { padding: 27px; border-radius: 19px; }
  .lesson-scene { margin: -27px -27px 25px; border-radius: 18px 18px 0 0; }
  .lesson-aside { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
  .aside-card { border-radius: 15px; padding: 20px; }
  .lesson-instruction { font-size: 21px; }
  .lesson-actions { gap: 10px; margin-top: 23px; padding-top: 22px; }
  .phrase-target { font-size: 40px; }
  .stats-grid { gap: 12px; margin-bottom: 23px; }
  .stat-card { padding: 22px 18px; border-radius: 15px; }
  .stat-value { font-size: 29px; }
  .stat-label { font-size: 11px; }
  .progress-details { padding: 24px; }
  .profile-layout, .profile-column { gap: 16px; }
  .settings-card { padding: 25px; }
  .toast { bottom: calc(20px + env(safe-area-inset-bottom)); right: 20px; font-size: 12px; }
}
@media (max-width: 550px) {
  .hero { display: flex; flex-direction: column; min-height: 0; }
  .hero-copy { padding: 24px 24px 0; }
  .hero-title { max-width: 330px; font-size: 35px; line-height: 1.12; margin-top: 17px; }
  .hero-description { max-width: 310px; font-size: 13px; line-height: 1.75; margin-top: 14px; }
  .hero-footer { width: 100%; padding-top: 22px; }
  .hero-footer .btn { min-height: 47px; }
  .hero-art { min-height: 0; height: 204px; margin-top: -6px; }
  .hero-art img { min-height: 0; height: 100%; width: 100%; object-fit: cover; object-position: 50% 50%; }
  .hero-art::after { background: linear-gradient(180deg, var(--mint), transparent 18%); }
  .hero-decoration { right: 20px; bottom: 15px; font-size: 11px; padding: 6px 11px; }
  .journey-grid { grid-template-columns: 1fr; gap: 10px; }
  .unit-card { padding: 16px; }
  .unit-card-copy { margin-block: 10px 12px; }
  .dashboard-bottom { grid-template-columns: 1fr; gap: 14px; margin-top: 20px; }
  .review-teaser, .tip-card { padding: 21px; }
  .review-teaser { gap: 15px; }
  .review-teaser .card-icon { width: 37px; height: 37px; flex-basis: 37px; }
  .section-heading { align-items: center; }
  .section-title { font-size: 19px; }
  .section-heading .text-link { font-size: 10px; gap: 3px; }
  .section-heading .text-link .icon { width: 13px; height: 13px; flex-basis: 13px; }
  .lesson-card { padding: 22px 20px; }
  .lesson-scene { margin: -22px -20px 23px; }
  .scene-caption { padding-inline: 16px; }
  .lesson-kicker { font-size: 10px; }
  .lesson-instruction { font-size: 20px; line-height: 1.4; margin-bottom: 23px; }
  .dialogue-row { grid-template-columns: 27px minmax(0, 1fr) 38px; gap: 9px; }
  .speaker { width: 26px; height: 26px; font-size: 9px; }
  .phrase { font-size: 20px; line-height: 1.4; }
  .translation { font-size: 11px; }
  .question-player > div { flex-basis: 0; min-width: 0; }
  .question-player .audio-button { flex: 1 1 100%; }
  .lesson-actions .btn { font-size: 12px; padding-inline: 13px; }
  .lesson-actions .btn .icon { width: 15px; height: 15px; flex-basis: 15px; }
  .lesson-aside { grid-template-columns: 1fr; }
  .aside-card { padding: 22px; }
  .outcome-list { gap: 13px; }
  .outcome-list li { font-size: 12px; }
  .option-btn { gap: 11px; padding: 13px 13px; min-height: 68px; }
  .option-text { font-size: 16px; }
  .option-letter { flex-basis: 29px; width: 29px; height: 29px; font-size: 11px; border-radius: 8px; }
  .practice-phrase { padding: 25px 13px; border-radius: 14px; }
  .phrase-target { font-size: 35px; }
  .phrase-meaning { font-size: 13px; }
  .record-panel { padding: 26px 0 9px; }
  .record-caption { font-size: 13px; }
  .record-controls .btn { font-size: 12px; padding-inline: 13px; }
  .notice { padding: 13px; font-size: 11px; }
  .summary-card { padding: 30px 20px; }
  .summary-title { font-size: 28px; }
  .summary-metrics { gap: 10px; }
  .summary-metrics strong { font-size: 23px; }
  .summary-metrics span { font-size: 10px; }
  .summary-card .button-row { flex-direction: column; }
  .summary-card .button-row .btn { width: 100%; }
  .flashcard { border-radius: 20px; }
  .flashcard-phrase { font-size: 37px; }
  .flashcard-meaning { font-size: 15px; }
  .review-panel > .button-row { gap: 9px; }
  .review-panel > .button-row .btn { padding-inline: 12px; font-size: 12px; flex: 1; }
  .stats-grid { grid-template-columns: 1fr; gap: 12px; }
  .stat-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 16px; padding: 22px; }
  .stat-value { grid-column: 2; grid-row: 1 / span 2; font-size: 32px; }
  .stat-label { grid-column: 1; grid-row: 2; margin-top: 5px; font-size: 12px; }
  .stat-card > .icon { grid-column: 1; grid-row: 1; margin-bottom: 3px; }
  .progress-details { padding: 23px 21px; border-radius: 17px; }
  .progress-details h2 { font-size: 20px; }
  .skill-row { flex-wrap: wrap; gap: 12px; }
  .skill-icon { width: 36px; height: 36px; flex-basis: 36px; border-radius: 10px; }
  .skill-description h3, .skill-description strong { font-size: 14px; }
  .skill-description p { font-size: 11px; }
  .skill-row .status-pill { margin-left: 48px; }
  .settings-card { padding: 24px 21px; border-radius: 18px; }
  .settings-row { gap: 17px; }
  .modal { width: calc(100vw - 30px); max-height: calc(100dvh - 30px); border-radius: 18px; }
  .modal-header { padding: 22px 21px 14px; }
  .modal-header h2 { font-size: 22px; }
  .modal-body { padding: 0 21px 21px; font-size: 13px; }
  .modal-footer { padding: 17px 21px 22px; }
  .modal-footer .btn { flex: 1; font-size: 12px; padding-inline: 12px; }
}
@media (max-width: 360px) {
  .sidebar { padding-inline: 17px; }
  .topbar { padding-inline: 17px; }
  .page-content, .app-footer { padding-inline: 17px; }
  .profile-button { right: 14px; }
  .breadcrumb { font-size: 9px; }
  .page-heading h1 { font-size: 29px; }
  .hero-copy { padding: 23px 20px 0; }
  .hero-title { font-size: 32px; }
  .hero-art { height: 183px; }
  .nav-list { left: 17px; width: min(320px, calc(100% - 34px)); }
  .lesson-title { font-size: 28px; }
  .lesson-topline .text-link { font-size: 10px; }
  .lesson-card { padding: 21px 17px; }
  .lesson-scene { margin: -21px -17px 22px; }
  .lesson-instruction { font-size: 19px; }
  .phrase { font-size: 18px; }
  .phrase-target { font-size: 31px; }
  .lesson-actions { justify-content: center; }
  .lesson-actions .btn { width: 100%; }
  .lesson-actions .btn-ghost { order: 2; }
  .flashcard-phrase { font-size: 32px; }
  .section-title { font-size: 18px; }
  .section-heading .text-link { font-size: 9px; }
}
body.reduce-motion *, body.reduce-motion *::before, body.reduce-motion *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media print {
  .sidebar, .topbar, .toast, .record-controls, .lesson-actions, .modal { display: none !important; }
  .main { margin: 0; }
  .page-content { padding: 0; max-width: none; }
  .hero, .lesson-card, .unit-card { break-inside: avoid; }
}

/* Account screens share the course palette and components. */
.account-body { min-height: 100dvh; background: radial-gradient(ellipse at 12% 0%, var(--mint), transparent 48%), var(--bg); }
.account-header, .account-layout { width: min(1100px, calc(100% - 64px)); margin-inline: auto; }
.account-header { padding-block: 29px; }
.account-header .brand { padding: 0; }
.account-layout { display: grid; grid-template-columns: 1.15fr 1fr; gap: 24px; align-items: stretch; padding: clamp(12px, 5vh, 60px) 0 48px; }
.account-story, .account-card { min-width: 0; padding: clamp(28px, 4.2vw, 58px); border: 1px solid var(--line); border-radius: 28px; }
.account-story { display: flex; flex-direction: column; justify-content: center; background: linear-gradient(145deg, var(--mint-light), var(--mint) 70%, var(--apricot-light)); }
.account-headline { max-width: 9em; font-size: clamp(38px, 5vw, 64px); font-weight: 650; line-height: 1.04; letter-spacing: -.065em; }
.account-headline em { color: var(--teal); font-style: normal; }
.account-story-copy { max-width: 32ch; margin-top: 20px; color: var(--text); }
.account-dialogue { display: grid; gap: 10px; margin-top: 36px; max-width: 340px; }
.account-dialogue span { justify-self: start; padding: 10px 17px; border: 1px solid var(--line); border-radius: 16px 16px 16px 4px; background: var(--surface); color: var(--teal-dark); font-weight: 650; }
.account-dialogue span + span { justify-self: end; border-radius: 16px 16px 4px 16px; }
.account-dialogue small { display: block; color: var(--muted); font-size: 12px; font-weight: 400; }
.account-card { display: flex; flex-direction: column; justify-content: center; background: var(--surface); box-shadow: var(--shadow); }
.account-card h1 { font-size: clamp(30px, 3vw, 41px); }
.account-intro { margin-top: 10px; color: var(--text); }
.account-form { display: grid; gap: 16px; margin-top: 25px; }
.account-google-form { margin-top: 12px; }
.account-google-form .btn { display: flex; justify-content: center; width: 100%; gap: 10px; }
.account-google-form svg { flex-shrink: 0; }
.account-form .input-group { margin: 0; }
.account-form .input { width: 100%; }
.account-form .btn { display: flex; justify-content: space-between; width: 100%; margin-top: 4px; }
.account-error { margin-top: 18px; padding: 11px 14px; border-radius: 12px; background: var(--danger-bg); color: var(--danger); font-size: 14px; }
.account-switch { margin-top: 23px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--text); font-size: 14px; }
.account-switch a { color: var(--teal-dark); font-weight: 650; text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 760px) {
  .account-header, .account-layout { width: min(480px, calc(100% - 32px)); }
  .account-header { padding-block: 16px; }
  .account-layout { grid-template-columns: 1fr; gap: 14px; padding-top: 4px; }
  .account-card { grid-row: 1; }
  .account-story { padding: 23px; }
  .account-headline { max-width: none; font-size: 30px; }
  .account-story-copy { margin-top: 10px; }
  .account-dialogue { display: none; }
}

.account-password { position: relative; }
.account-password .input { padding-inline-end: 50px; }
.account-password-toggle { position: absolute; inset-block: 0; inset-inline-end: 0; display: grid; place-items: center; width: 44px; padding: 0; border: 0; border-radius: 10px; background: transparent; color: var(--muted); }
.account-password-toggle:hover { color: var(--teal-dark); }
.password-eye { width: 20px; height: 20px; }
.password-eye-slash { display: none; }
.account-password-toggle[aria-pressed="true"] .password-eye-slash { display: block; }
.account-forgot { justify-self: end; color: var(--teal-dark); font-size: 14px; text-decoration: underline; text-underline-offset: 3px; }
.account-notice { margin-top: 18px; padding: 11px 14px; border-radius: 12px; background: var(--mint); color: var(--teal-dark); font-size: 14px; }

.checkpoint-home-link {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .85rem 1rem;
  margin: 1.5rem 0;
  padding: 1rem 1.25rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: white;
}
.checkpoint-home-link h2 { margin: 0; font-size: 1.15rem; }
.checkpoint-home-link p { margin: .2rem 0 0; }
.checkpoint-home-link .btn { margin-left: auto; }
.test-overview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  max-width: 64rem;
}
.test-overview-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .6rem;
  min-width: 0;
  padding: clamp(1rem, 3vw, 1.65rem);
  border: 1px solid var(--line);
  border-radius: 1.25rem;
  background: white;
}
.test-overview-card[data-status="available"] { border-color: #a9d0c3; background: #f4fbf8; }
.test-overview-card h2, .test-overview-card p { margin: 0; }
.test-overview-card h2 { font-size: clamp(1.15rem, 2.5vw, 1.5rem); }
.test-overview-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; width: 100%; }
.test-status { display: inline-flex; align-items: center; gap: .3rem; border-radius: 999px; padding: .25rem .65rem; background: #eef1ef; color: var(--text); font-size: .8rem; font-weight: 650; }
.test-status .icon { width: 1rem; height: 1rem; flex-basis: 1rem; }
.test-overview-card[data-status="available"] .test-status,
.test-overview-card[data-status="complete"] .test-status { background: #e0f0e9; color: var(--teal-dark); }
.test-result strong { color: var(--teal-dark); }
.test-overview-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: auto; padding-top: .4rem; }
.test-overview-actions:empty { display: none; }
@media (max-width: 620px) {
  .test-overview-grid { grid-template-columns: 1fr; }
  .checkpoint-home-link .btn { margin-left: 0; }
}
.checkpoint-card { padding: clamp(1rem, 4vw, 2rem); max-width: 48rem; }
.checkpoint-card h2 { margin: .4rem 0 .75rem; }
.checkpoint-card .button-row { margin-top: 1rem; }

.unit-card.locked, .course-row.locked { background: #f9faf7; }
.unit-card.locked .unit-footer, .course-row.locked > .icon { color: var(--muted); }
.unit-card.locked .unit-action-icon, .course-row.locked .course-index { background: #eef0eb; }

.progress-overview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 290px), 1fr));
  gap: 22px;
  padding: clamp(20px, 4vw, 34px);
  border: 1px solid #d5e6dc;
  border-radius: 24px;
  background: linear-gradient(112deg, var(--mint), #f9faf3);
}
.progress-overview h2 { margin: 6px 0 12px; font-size: clamp(27px, 3.5vw, 40px); }
.progress-overview progress { display: block; width: 100%; max-width: 420px; height: 10px; accent-color: var(--teal); }
.progress-overview .muted { margin-top: 10px; font-size: 13px; }
.progress-next { align-self: stretch; padding: 16px 20px; border: 1px solid #dce8dc; border-radius: 16px; background: #ffffffb8; }
.progress-next h3 { margin: 5px 0 12px; font-size: 19px; }
.progress-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 12px; margin: 15px 0 24px; }
.progress-metrics > div { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 15px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.progress-metrics dt { color: var(--text); font-size: 13px; }
.progress-metrics dt a { text-decoration: underline; text-underline-offset: 3px; }
.progress-metrics dd { margin: 0; font-size: 26px; line-height: 1.25; font-weight: 650; }
.progress-metrics dd small { color: var(--muted); font-size: 14px; }
.progress-results-layout { display: grid; gap: 16px; align-items: start; }
.progress-results-layout > section { min-width: 0; margin: 0; }
.progress-library, .progress-lesson-panel { padding: clamp(16px, 2.5vw, 24px); }
.progress-library h2 { font-size: 19px; }
.progress-library-tools { display: grid; gap: 5px; margin-top: 14px; }
.progress-library-tools label { color: var(--text); font-size: 13px; font-weight: 600; }
.progress-library-tools label:not(:first-child) { margin-top: 6px; }
.progress-library-tools .input { width: 100%; min-width: 0; }
.progress-library-count, .progress-library-empty { margin: 12px 0 8px; color: var(--text); font-size: 13px; }
.progress-library-list { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.progress-library-row { min-height: 52px; font-size: 14px; }
.progress-library-row strong, .progress-library-row small { display: block; }
.progress-library-row small { color: var(--text); font-size: 12px; }
.progress-library-score { color: var(--teal-dark); font-weight: 650; font-variant-numeric: tabular-nums; }
.progress-library-pages { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; margin-top: 12px; }
.progress-lesson-panel .answer-tally { margin: 18px 0 4px; }
.progress-lesson-panel > .btn { margin-top: 16px; }
.progress-results-layout + .achievement-collection { margin-top: 25px; }
#progress-lesson-title { scroll-margin-top: 24px; }
@media (min-width: 1050px) {
  .progress-results-layout { grid-template-columns: minmax(285px, 1fr) minmax(0, 1.6fr); }
}
#achievements-title { scroll-margin-top: 24px; }
@media (min-width: 1250px) {
  .achievement-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.support-layout { display: grid; gap: 18px; width: min(680px, calc(100% - 32px)); margin: 48px auto; }
.support-layout textarea { resize: vertical; }

.vocabulary-panel { margin-block: 18px; overflow: hidden; border: 1px solid #d5e6dc; border-radius: 18px; background: #f5faf7; }
.vocabulary-panel > summary { display: flex; align-items: center; gap: 12px; padding: 14px clamp(12px, 3vw, 20px); list-style: none; cursor: pointer; }
.vocabulary-panel > summary::-webkit-details-marker { display: none; }
.vocabulary-panel > summary:focus-visible { outline-offset: -3px; }
.vocabulary-header-icon { display: grid; flex: 0 0 40px; height: 40px; place-items: center; border-radius: 12px; background: var(--mint); color: var(--teal-dark); }
.vocabulary-header-copy { flex: 1; min-width: 0; }
.vocabulary-header-copy strong, .vocabulary-header-copy > span { display: block; }
.vocabulary-header-copy strong { color: var(--ink); font-size: 17px; }
.vocabulary-header-copy > span { color: var(--muted); font-size: 12px; }
.vocabulary-chevron { color: var(--teal-dark); }
.vocabulary-panel[open] .vocabulary-chevron { transform: rotate(90deg); }
.vocabulary-body { padding: 0 clamp(10px, 3vw, 20px) clamp(12px, 3vw, 20px); }
.vocabulary-switch { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; margin-bottom: 12px; padding: 4px; border: 1px solid #deebe2; border-radius: 12px; background: #eaf3ed; }
.vocabulary-switch > button { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 4px 6px; min-height: 40px; padding: 5px 3px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--text); font: inherit; font-size: 13px; font-weight: 650; }
.vocabulary-switch > button:hover { color: var(--teal-dark); }
.vocabulary-switch > button[aria-pressed="true"] { border-color: #dce8df; color: var(--teal-dark); background: var(--surface); box-shadow: 0 1px 3px #17352b12; }
.vocabulary-switch > button span { min-width: 19px; padding: 0 4px; border-radius: 10px; background: #deede4; color: var(--teal-dark); font-size: 10px; }
.vocabulary-list { display: grid; gap: 7px; margin: 0; padding: 0; list-style: none; }
.vocabulary-words { grid-template-columns: repeat(auto-fit, minmax(min(100%, 205px), 1fr)); }
.vocabulary-digits { grid-template-columns: repeat(auto-fit, minmax(min(100%, 112px), 1fr)); }
.vocabulary-entry { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; padding: 7px 9px 7px 12px; border: 1px solid #deebe2; border-radius: 11px; background: var(--surface); }
.vocabulary-entry-copy { min-width: 0; overflow-wrap: anywhere; }
.vocabulary-entry-copy strong, .vocabulary-entry-copy span { display: block; }
.vocabulary-entry-copy strong { color: var(--ink); font-size: 15px; }
.vocabulary-entry-copy span { margin-top: 2px; color: var(--text); font-size: 12px; }
.vocabulary-entry-audio { display: flex; gap: 4px; }
.vocabulary-entry-audio .audio-button { width: 44px; min-height: 44px; padding: 0; border-radius: 11px; background: #edf6ef; color: var(--teal-dark); }
.vocabulary-entry-audio .audio-button span { display: none; }
.vocabulary-entry-audio [data-speech-id^="vocabulary-example-"] { width: auto; padding-inline: 8px; }
.vocabulary-entry-audio [data-speech-id^="vocabulary-example-"]:not(.playing) span { display: inline; }
.vocabulary-entry-audio .audio-button.playing { background: var(--teal-dark); color: white; }
.vocabulary-check { display: grid; gap: 10px; padding: 12px; border: 1px solid #deebe2; border-radius: 12px; background: var(--surface); }
.vocabulary-check + .vocabulary-check { margin-top: 8px; }
.vocabulary-check-heading, .vocabulary-check-answer { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.vocabulary-check-heading label { flex: 1 1 120px; min-width: 0; font-size: 14px; font-weight: 650; }
.vocabulary-check-number { padding: 3px 6px; border-radius: 6px; background: var(--mint); color: var(--teal-dark); font-size: 11px; font-weight: 650; }
.vocabulary-check-answer .input { flex: 1 1 160px; min-width: 0; }
.vocabulary-check-feedback:empty { display: none; }
.vocabulary-check-feedback { margin: 0; padding: 8px 10px; border-radius: 8px; color: var(--teal-dark); background: var(--mint-light); font-size: 13px; }
.vocabulary-check-feedback[data-result="incorrect"] { color: #774629; background: #fcf0e4; }

/* Review lesson library */
.review-library { display: grid; gap: 14px; margin: 0 auto 18px; padding: clamp(14px, 4vw, 22px); border: 1px solid var(--line); border-radius: 20px; background: var(--surface); }
.review-library-current { display: flex; align-items: center; gap: 13px; }
.review-library-current h2 { margin-top: 3px; font-size: clamp(18px, 4vw, 22px); }
.review-library-icon { display: grid; flex: 0 0 44px; height: 44px; place-items: center; border-radius: 13px; color: var(--teal-dark); background: var(--mint); }
.review-library-quick h3, .review-library-group h3 { margin-bottom: 6px; color: var(--text); font-size: 14px; }
.review-library ul { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.review-library-quick ul { grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.review-lesson-option { display: flex; align-items: center; gap: 9px; width: 100%; min-height: 45px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: var(--surface); text-align: start; }
.review-lesson-option:is(:hover, [aria-pressed="true"]) { border-color: #bdd8c9; background: var(--mint-light); }
.review-lesson-option .icon { width: 16px; height: 16px; flex-basis: 16px; color: var(--teal-dark); }
.review-lesson-number { flex: 0 0 auto; min-width: 30px; padding: 2px 4px; border-radius: 6px; color: var(--teal-dark); background: var(--mint-light); text-align: center; font-size: 12px; font-variant-numeric: tabular-nums; }
.review-lesson-title { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.review-lesson-quick { font-size: 14px; }
.review-library details > summary { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 44px; padding: 8px 12px; border-radius: 10px; color: var(--teal-dark); background: var(--mint-light); font-weight: 650; cursor: pointer; list-style: none; }
.review-library details > summary::-webkit-details-marker { display: none; }
.review-library details[open] > summary .icon { transform: rotate(90deg); }
.review-library-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 12px; }
.review-library-tools > div { flex: 1 1 240px; }
.review-library-filter { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; cursor: pointer; }
.review-library-filter input { accent-color: var(--teal); }
.review-library-count, .review-library-empty { margin-top: 8px; color: var(--text); font-size: 13px; }
.review-library-group, #review-lesson-results > .btn { margin-top: 10px; }

.checkpoint-finished { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 14px; padding: 12px; border-radius: 12px; background: var(--mint); color: var(--teal-dark); }
.checkpoint-finished h2 { margin: 0 0 4px; }

.checkpoint-exam-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; color: var(--text); }
.checkpoint-exam-progress { display: block; width: 100%; height: 10px; margin: 12px 0 20px; accent-color: var(--teal); }
.checkpoint-exam-context { margin: 12px 0; padding: 12px; border-radius: 10px; background: var(--mint-light); color: var(--ink); font-size: 18px; }
.checkpoint-exam-form { display: grid; gap: 8px; margin-top: 16px; }
.checkpoint-exam-form label { font-weight: 650; }
.checkpoint-exam-form .button-row { margin: 5px 0 0; }
#checkpoint-exam-status:empty { display: none; }
.checkpoint-exam-results { display: grid; gap: 7px; margin: 14px 0; padding: 0; list-style: none; }
.checkpoint-exam-results li { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 6px 12px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; }
.checkpoint-exam-results p { color: var(--text); font-size: 14px; }

.reading-library-hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(185px, 240px); align-items: center; gap: 20px; margin-bottom: 28px; padding: clamp(20px, 4vw, 42px); border: 1px solid #dce9df; border-radius: 24px; background: linear-gradient(120deg, #e8f4ed, #fbf5e8); }
.reading-library-hero h1 { margin: 4px 0 8px; font-size: clamp(32px, 5vw, 50px); line-height: 1.1; }
.reading-library-hero p:last-child { max-width: 46ch; color: var(--text); }
.reading-library-progress { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 10px; padding: 14px; border: 1px solid #e1e8de; border-radius: 16px; background: var(--surface); }
.reading-progress-icon { display: grid; width: 40px; height: 40px; flex: 0 0 40px; place-items: center; border-radius: 12px; background: var(--mint); color: var(--teal-dark); }
.reading-library-progress strong, .reading-library-progress div > span { display: block; }
.reading-library-progress strong { color: var(--teal-dark); font-size: 19px; line-height: 1.2; }
.reading-library-progress div > span { color: var(--muted); font-size: 12px; }
.reading-library-progress progress { grid-column: 1 / -1; width: 100%; height: 7px; border: 0; border-radius: 10px; accent-color: var(--teal-dark); }
.reading-library-heading { display: flex; align-items: baseline; flex-wrap: wrap; justify-content: space-between; gap: 6px 14px; margin: 0 0 12px; }
.reading-library-heading h2 { font-size: 21px; }
.reading-library-heading > span { color: var(--muted); font-size: 12px; }
.reading-library { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 265px), 1fr)); gap: 14px; }
.reading-card { min-width: 0; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); }
.reading-library .reading-card { display: flex; flex-direction: column; padding: 18px; }
.reading-card-top { display: flex; align-items: center; flex-wrap: wrap; gap: 5px 8px; color: var(--muted); font-size: 12px; }
.reading-card-number { padding: 3px 7px; border-radius: 7px; background: var(--mint); color: var(--teal-dark); font-weight: 700; }
.reading-library h3 { margin: 12px 0 5px; font-size: 19px; line-height: 1.25; }
.reading-library .muted { margin: 0 0 16px; font-size: 13px; }
.reading-card-footer { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 10px; border-top: 1px solid var(--line); }
.reading-card-footer .btn { min-height: 42px; padding-inline: 10px; font-size: 12px; }
.reading-card-status { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 12px; }
.reading-card-status .icon { width: 15px; height: 15px; }
.reading-card-status.is-complete { color: var(--teal-dark); font-weight: 650; }
.reading-page { display: grid; gap: 16px; max-width: 790px; margin-inline: auto; }
.reading-page > :is(.btn, .reading-back) { justify-self: start; }
.reading-passage, .reading-questions { padding: clamp(16px, 4vw, 34px); }
.reading-passage-header { margin: calc(-1 * clamp(16px, 4vw, 34px)) calc(-1 * clamp(16px, 4vw, 34px)) 16px; padding: clamp(18px, 4vw, 34px); border-radius: 19px 19px 0 0; border-bottom: 1px solid #e6ecdf; background: linear-gradient(120deg, var(--mint-light), #fbf5e8); }
.reading-passage-header h1 { margin: 4px 0 8px; font-family: Georgia, serif; font-size: clamp(28px, 5vw, 46px); line-height: 1.14; }
.reading-passage-header p:last-child { color: var(--text); font-size: 14px; }
.reading-translation-tip { display: flex; align-items: center; gap: 8px; padding: 9px 10px; border-radius: 10px; background: var(--mint-light); color: var(--teal-dark); font-size: 13px; }
.reading-translation-tip .icon { flex: 0 0 18px; width: 18px; height: 18px; }
.reading-passage > p { max-width: 64ch; margin: 16px auto 0; padding: 2px 4px; border-radius: 7px; font: clamp(18px, 2.2vw, 22px)/1.75 Georgia, serif; scroll-margin-top: 16px; overflow-wrap: break-word; }
.reading-gloss { display: inline; max-width: 100%; padding: 0; border: 0; border-radius: 3px; color: var(--teal-dark); background: transparent; font: inherit; text-align: start; text-decoration: underline dotted; text-underline-offset: .19em; overflow-wrap: anywhere; }
.reading-gloss:is(:hover, [aria-expanded="true"]), .reading-evidence { background: var(--mint-light); }
.reading-translation { margin-inline: .25em; padding: .14em .4em; border-radius: 5px; background: var(--mint); color: var(--teal-dark); font-family: system-ui, sans-serif; font-size: .76em; box-decoration-break: clone; }
.reading-jump { display: inline-flex; align-items: center; gap: 5px; min-height: 44px; margin-top: 14px; color: var(--teal-dark); font-size: 14px; font-weight: 650; }
.reading-jump .icon { width: 16px; height: 16px; transform: rotate(90deg); }
.reading-questions-heading { display: flex; align-items: center; gap: 10px; }
.reading-questions-heading h2 { font-size: clamp(18px, 3vw, 24px); scroll-margin-top: 16px; }
.reading-questions form { display: grid; gap: 16px; margin-top: 18px; }
.reading-questions fieldset { min-width: 0; margin: 0; padding: 8px 10px 10px; border: 1px solid var(--line); border-radius: 12px; }
.reading-questions legend { max-width: 100%; padding: 0 5px; font-weight: 650; }
.reading-question-number { display: inline-block; min-width: 23px; border-radius: 7px; background: var(--mint); color: var(--teal-dark); font-size: 13px; text-align: center; }
.reading-questions label { display: flex; align-items: center; gap: 9px; min-height: 44px; padding: 6px 9px; border: 1px solid transparent; border-radius: 8px; cursor: pointer; }
.reading-questions label:is(:hover, :focus-within) { background: var(--mint-light); }
.reading-questions label:has(input:checked) { border-color: #b4d5c6; background: var(--mint); }
.reading-questions input { flex: 0 0 auto; accent-color: var(--teal-dark); }
.reading-questions .btn { justify-self: start; }
.reading-feedback { margin-top: 8px; padding: 8px 10px; border-radius: 8px; color: var(--teal-dark); background: var(--mint-light); }
.reading-feedback[data-correct="false"] { color: #734526; background: #fcf1e4; }
.reading-feedback a { text-decoration: underline; }
.reading-result:empty { display: none; }
.reading-result { margin: 0; color: var(--teal-dark); font-weight: 650; }
@media (max-width: 540px) { .reading-library-hero { grid-template-columns: 1fr; gap: 14px; } }
.reading-lesson-link { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin: 16px 0; padding: 12px; border: 1px solid var(--line); border-radius: 12px; }
.reading-lesson-link .btn { margin-left: auto; }
@media (max-width: 760px) {
}

.adventure-entry, .adventure-wallet {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 1.75rem;
  padding: clamp(1rem, 3vw, 1.75rem);
  margin: 1.25rem 0;
  border: 1px solid #ccdfd9;
  border-radius: 1.25rem;
  background: #edf7f3;
}
.adventure-entry h2, .adventure-entry p, .adventure-wallet p { margin: 0; }
.adventure-wallet strong { font-size: 1.6rem; color: #145a51; }
.adventure-wallet small { font-size: .9rem; }
.adventure-pack { margin-left: auto; }
#adventure-status { flex-basis: 100%; }
#adventure-status:empty { display: none; }
.adventure-odds { margin-block: 1.25rem; }
.adventure-odds summary { cursor: pointer; font-weight: 650; }
.adventure-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr));
  gap: 1rem;
  padding: 0;
  margin: 1rem 0 1.5rem;
  list-style: none;
}
.adventure-card {
  --card-edge: #72b4a2;
  --card-back: #175c58;
  --card-paper: #f0f9f5;
  --rarity-ink: #115448;
  --rarity-fill: #d3eee4;
  min-width: 0;
  overflow: hidden;
  border: 2px solid var(--card-edge);
  border-radius: 1rem;
  background: var(--card-paper);
  box-shadow: 0 .25rem .7rem #18383912;
}
.adventure-card[data-rarity="rare"] {
  --card-edge: #a695d1;
  --card-back: #544781;
  --card-paper: #f7f2ff;
  --rarity-ink: #492983;
  --rarity-fill: #e8dcff;
}
.adventure-card[data-rarity="legendary"] {
  --card-edge: #bc8228;
  --card-back: #805a17;
  --card-paper: #fff5dd;
  --rarity-ink: #6d4200;
  --rarity-fill: #ffe49e;
}
.adventure-card.is-new { outline: 2px solid var(--card-edge); outline-offset: 3px; }
.adventure-card-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .3rem .5rem;
  padding: .55rem .65rem;
  border-bottom: 1px solid var(--card-edge);
}
.adventure-rarity {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .2rem .55rem;
  border: 1px solid var(--card-edge);
  border-radius: 999px;
  color: var(--rarity-ink);
  background: var(--rarity-fill);
  font-size: .78rem;
  font-weight: 750;
}
.adventure-card-number {
  color: var(--rarity-ink);
  font-size: .72rem;
  font-variant-numeric: tabular-nums;
}
.adventure-art {
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: center;
  aspect-ratio: 3 / 2;
  color: white;
  background: repeating-linear-gradient(135deg, #ffffff10 0 1px, transparent 1px 13px), var(--card-back);
  border-bottom: 2px solid var(--card-edge);
}
.adventure-art span { display: grid; place-items: center; font-size: 2rem; }
.adventure-art .icon { width: 1.7rem; height: 1.7rem; }
.adventure-scene {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.adventure-copy { display: grid; gap: .4rem; padding: .85rem; }
.adventure-copy h2 { font-size: 1.05rem; }
.adventure-copy > * { margin: 0; }
.adventure-copy .btn { justify-self: start; }
@media (max-width: 520px) {
  .adventure-pack { flex-basis: 100%; margin-left: 0; }
}

.adventure-art-open {
  position: absolute;
  inset: 0;
  width: 100%;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}
.adventure-art-open:focus-visible { outline-offset: -4px; }
.adventure-art-open span {
  position: absolute;
  right: .5rem;
  bottom: .5rem;
  width: 1.8rem;
  height: 1.8rem;
  border-radius: .4rem;
  background: #173837;
  color: white;
  font-size: 1.05rem;
}
.modal:has(.adventure-viewer) { width: min(680px, calc(100vw - 28px)); }
.adventure-zoom-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .65rem;
  margin-bottom: .75rem;
}
.adventure-zoom-level { min-width: 3rem; text-align: center; font-variant-numeric: tabular-nums; }
.adventure-zoom-viewport {
  max-height: 60dvh;
  overflow: auto;
  border-radius: .65rem;
  background: #edf7f3;
}
.adventure-zoom-image { display: block; width: 100%; max-width: none; height: auto; }
