:root {
  color-scheme: light;
  --ink: #17324d;
  --muted: #60778b;
  --blue: #2f80ed;
  --blue-dark: #1768c5;
  --sky: #dff1ff;
  --cream: #fff8e5;
  --yellow: #ffd36a;
  --paper: #ffffff;
  --background: #f4f9fd;
  --line: #dce9f2;
  --shadow: 0 14px 40px rgba(47, 91, 128, 0.1);
  font-family: ui-rounded, "SF Pro Rounded", "PingFang SC", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { background: var(--background); }
body { margin: 0; color: var(--ink); background: radial-gradient(circle at 80% -10%, #d9efff 0, transparent 34rem), var(--background); }
button, input { font: inherit; }
button { color: inherit; }
main:focus { outline: none; }
.app-shell { width: min(100%, 850px); min-height: 100dvh; margin: 0 auto; padding: env(safe-area-inset-top) 24px calc(112px + env(safe-area-inset-bottom)); }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 24px 0 30px; }
.topbar h1 { margin: 3px 0 0; font-size: clamp(23px, 4vw, 34px); letter-spacing: -0.03em; }
.eyebrow { margin: 0; color: var(--blue); font-size: 11px; font-weight: 850; letter-spacing: 0.14em; }
.status-pill { padding: 8px 12px; border: 1px solid #badcf5; border-radius: 999px; background: rgba(255,255,255,.72); color: #34709c; font-size: 12px; font-weight: 750; white-space: nowrap; }
.status-pill.offline { color: #517047; border-color: #c9dfbd; background: #f6fff1; }
.card { border: 1px solid rgba(211, 227, 239, .9); border-radius: 26px; background: rgba(255,255,255,.94); box-shadow: var(--shadow); }
.empty-state { padding: clamp(34px, 8vw, 70px); text-align: center; }
.hero-mark { display: grid; place-items: center; width: 88px; height: 88px; margin: 0 auto 24px; border-radius: 30px 30px 36px 36px; background: var(--blue); box-shadow: inset 0 -8px 0 rgba(0,0,0,.08), 0 14px 28px rgba(47,128,237,.24); color: white; font-size: 48px; font-weight: 900; }
.empty-state h2 { margin: 8px 0 12px; font-size: clamp(26px, 5vw, 38px); }
.empty-state > p:not(.eyebrow,.fine-print) { max-width: 520px; margin: 0 auto; color: var(--muted); font-size: 17px; line-height: 1.7; }
.action-stack { display: flex; justify-content: center; gap: 12px; margin-top: 28px; }
.primary-button, .secondary-button, .complete-button, .segment-button, .record-button { min-height: 52px; border: 0; border-radius: 17px; padding: 0 22px; font-weight: 800; cursor: pointer; }
.primary-button { background: var(--blue); color: white; box-shadow: 0 8px 18px rgba(47,128,237,.23); }
.primary-button:active { background: var(--blue-dark); transform: translateY(1px); }
.secondary-button { border: 1px solid var(--line); background: white; }
.fine-print { margin: 24px 0 0 !important; color: #7c8e9b !important; font-size: 12px !important; }
.bottom-nav { position: fixed; z-index: 10; right: 0; bottom: 0; left: 0; display: grid; grid-template-columns: repeat(4, 1fr); width: min(100%, 850px); margin: auto; padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); border: 1px solid rgba(208,225,238,.85); border-bottom: 0; border-radius: 25px 25px 0 0; background: rgba(255,255,255,.94); box-shadow: 0 -12px 34px rgba(39,80,113,.1); backdrop-filter: blur(16px); }
.nav-item { display: grid; place-items: center; gap: 3px; min-height: 56px; border: 0; border-radius: 17px; background: transparent; color: #73889a; font-size: 11px; font-weight: 750; }
.nav-item span:first-child { font-size: 21px; filter: grayscale(1); opacity: .7; }
.nav-item.active { color: var(--blue); background: #edf7ff; }
.nav-item.active span:first-child { filter: none; opacity: 1; }
.welcome-row, .section-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.welcome-row { margin: 0 4px 20px; }
.welcome-row h2, .section-heading h2, .settings-header h2 { margin: 5px 0 0; font-size: clamp(25px, 4vw, 34px); }
.streak-badge { display: grid; place-items: center; min-width: 76px; height: 76px; border-radius: 25px; background: var(--cream); border: 1px solid #f6df9e; }
.streak-badge strong { font-size: 26px; line-height: 1; }.streak-badge span { color: #8b722f; font-size: 11px; font-weight: 750; }
.lesson-hero { position: relative; overflow: hidden; padding: 32px; background: linear-gradient(145deg, #fff 20%, #e7f5ff 100%); }
.lesson-hero::after { content: ""; position: absolute; top: -70px; right: -55px; width: 190px; height: 190px; border: 38px solid rgba(112,183,255,.16); border-radius: 50%; }
.lesson-number { display: grid; place-items: center; width: 58px; height: 58px; margin-bottom: 26px; border-radius: 19px; background: var(--blue); color: white; font-size: 20px; font-weight: 900; }
.lesson-copy { position: relative; z-index: 1; max-width: 570px; }
.episode-label { margin: 0 0 7px; color: var(--blue); font-size: 13px; font-weight: 850; letter-spacing: .05em; }
.lesson-copy h3 { margin: 0; font-size: clamp(27px, 5vw, 42px); letter-spacing: -.03em; }
.lesson-copy p { color: var(--muted); font-size: 16px; line-height: 1.65; }
.wide { position: relative; z-index: 1; width: 100%; margin-top: 12px; }
.progress-card { margin-top: 18px; padding: 25px 28px; }
.section-heading h3 { margin: 0; font-size: 20px; }.section-heading > span { color: var(--muted); font-size: 13px; font-weight: 750; }
.progress-track { overflow: hidden; height: 12px; margin: 19px 0 10px; border-radius: 999px; background: #e8f0f5; }
.progress-track span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--blue), #72bbff); transition: width .3s; }
.progress-card p { margin: 0; color: var(--muted); font-size: 13px; }
.package-section + .package-section { margin-top: 34px; }.package-section > .section-heading { margin: 0 5px 16px; }
.lesson-list { display: grid; gap: 11px; }
.lesson-row { display: grid; grid-template-columns: 48px 1fr auto; align-items: center; gap: 16px; width: 100%; padding: 16px 20px; border-radius: 20px; text-align: left; cursor: pointer; }
.lesson-row > span:nth-child(2) { display: grid; gap: 4px; }.lesson-row strong { font-size: 16px; }.lesson-row small { color: var(--muted); }
.row-number { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 15px; background: var(--sky); color: var(--blue); font-weight: 900; }
.row-number.complete { color: #3d792e; background: #e8f7df; }
.record-hero { display: flex; align-items: center; gap: 24px; padding: 30px; margin-bottom: 30px; background: linear-gradient(135deg, var(--cream), white); }
.record-hero h2 { margin: 5px 0; font-size: 30px; }.record-hero p:last-child { margin: 0; color: var(--muted); }.big-star { font-size: 58px; }
.completed-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 14px; }
.mini-card { display: flex; align-items: center; gap: 12px; min-height: 72px; padding: 15px; border: 1px solid #f1dda6; border-radius: 18px; background: var(--cream); text-align: left; }
.mini-card span { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--yellow); }.mini-card strong { font-size: 14px; }
.muted-panel { grid-column: 1 / -1; padding: 28px; border-radius: 18px; background: #eaf3f8; color: var(--muted); text-align: center; }
.settings-header { margin: 4px 5px 20px; }.settings-header > p:last-child { color: var(--muted); }
.settings-list { overflow: hidden; }.settings-list button { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 21px 24px; border: 0; border-bottom: 1px solid var(--line); background: white; text-align: left; }.settings-list button:last-child { border: 0; }.settings-list button span:first-child { display: grid; gap: 5px; }.settings-list small { color: var(--muted); }
.storage-note { margin-top: 18px; padding: 24px; }.storage-note h3 { margin: 0 0 8px; }.storage-note p { margin: 0; color: var(--muted); line-height: 1.65; }
.danger-button { width: 100%; margin-top: 22px; padding: 17px; border: 1px solid #f0c8c8; border-radius: 17px; background: #fff7f7; color: #b54040; font-weight: 750; }
.lesson-page { padding-bottom: 20px; }.back-button { margin-bottom: 22px; padding: 8px 0; border: 0; background: transparent; color: var(--blue); font-weight: 800; }.lesson-page > h2 { margin: 0; font-size: clamp(29px, 5vw, 42px); }.lesson-intro { color: var(--muted); font-size: 16px; line-height: 1.7; }
.media-card { overflow: hidden; margin-top: 22px; background: #10273a; }.media-card video { display: block; width: 100%; max-height: 55vh; background: #0b1b28; }.media-placeholder { display: grid; place-items: center; min-height: 260px; padding: 40px; color: #dcefff; text-align: center; }.media-placeholder span { font-size: 48px; }.media-placeholder p { max-width: 430px; line-height: 1.6; }
.segment-button { width: 100%; margin-top: 12px; border: 1px solid #badcf5; background: #eaf6ff; color: var(--blue-dark); }
.task-section { margin-top: 34px; }.steps-list { display: grid; gap: 10px; margin: 15px 0 0; padding: 0; list-style: none; counter-reset: step; }.steps-list li { position: relative; padding: 18px 18px 18px 58px; border-radius: 18px; background: white; border: 1px solid var(--line); line-height: 1.5; }.steps-list li::before { counter-increment: step; content: counter(step); position: absolute; top: 13px; left: 15px; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 12px; background: var(--sky); color: var(--blue); font-weight: 900; }
.phrase-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 15px; }.phrase-card { display: flex; gap: 14px; min-height: 104px; padding: 18px; border-radius: 20px; box-shadow: none; }.phrase-card > span { display: grid; place-items: center; flex: 0 0 32px; height: 32px; border-radius: 11px; background: var(--cream); color: #987721; font-weight: 900; }.phrase-card strong { font-size: 17px; line-height: 1.35; }.phrase-card p { margin: 7px 0 0; color: var(--muted); font-size: 13px; }
.record-card { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-top: 34px; padding: 28px; background: linear-gradient(135deg, #fff, #f0f8ff); }.record-card h3 { margin: 5px 0 7px; }.record-card p:last-child { margin: 0; color: var(--muted); }.record-actions { display: grid; gap: 10px; min-width: 185px; }.record-button { background: var(--blue); color: white; }.record-button span { color: #ffdfdf; }.record-button.recording { background: #d34d4d; }.record-actions audio { width: 100%; }
.complete-button { width: 100%; margin-top: 18px; background: var(--yellow); color: #5f4b13; }.complete-button.done { background: #dcf2d1; color: #3d742e; }
.toast { position: fixed; z-index: 30; bottom: calc(100px + env(safe-area-inset-bottom)); left: 50%; max-width: calc(100% - 40px); padding: 12px 18px; border-radius: 14px; background: #17324d; color: white; font-size: 14px; font-weight: 700; opacity: 0; transform: translate(-50%, 12px); pointer-events: none; transition: .2s; }.toast.visible { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 600px) {
  .app-shell { padding-right: 16px; padding-left: 16px; }
  .topbar { padding-top: 18px; }.topbar .eyebrow { display: none; }
  .status-pill { padding: 7px 9px; font-size: 11px; }
  .action-stack, .record-card { flex-direction: column; align-items: stretch; }
  .action-stack button { width: 100%; }
  .lesson-hero { padding: 25px; }.progress-card { padding: 22px; }
  .phrase-list { grid-template-columns: 1fr; }
  .record-actions { min-width: 0; }
  .completed-grid { grid-template-columns: 1fr; }
  .record-hero { align-items: flex-start; }.big-star { font-size: 44px; }
}

@media (display-mode: standalone) {
  .topbar { padding-top: 18px; }
}
