:root {
    --bg: #f3ead7;
    --paper: rgba(255, 250, 242, 0.82);
    --ink: #223127;
    --muted: #5d685e;
    --accent: #ce6037;
    --accent-soft: #f5d7c8;
    --forest: #5c8664;
    --sun: #f3b24a;
    --line: rgba(34, 49, 39, 0.12);
    --shadow: 0 24px 60px rgba(34, 49, 39, 0.08);
    --hero-shadow: 0 30px 80px rgba(34, 49, 39, 0.12);
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

html {
    overflow-x: hidden;
}

body {
    margin: 0;
    color: var(--ink);
    background:
        radial-gradient(circle at 18% 10%, rgba(206, 96, 55, 0.24), transparent 22%),
        radial-gradient(circle at 85% 22%, rgba(92, 134, 100, 0.22), transparent 18%),
        linear-gradient(180deg, #f7f2e8 0%, #efe2cd 100%);
    font-family: "Alegreya", "Noto Serif SC", serif;
    min-height: 100svh;
    overflow-x: clip;
}

a {
    color: inherit;
    text-decoration: none;
}

.page-shell {
    width: min(1080px, calc(100% - 28px));
    margin: 0 auto;
    padding: 18px 0 64px;
    overflow-x: clip;
}

main {
    min-width: 0;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    padding: 14px 16px;
    position: sticky;
    top: 10px;
    z-index: 20;
    background: rgba(255, 250, 242, 0.72);
    backdrop-filter: blur(14px);
    border: 1px solid rgba(34, 49, 39, 0.08);
    border-radius: 999px;
}

.shell-progress {
    position: fixed;
    left: 14px;
    right: 14px;
    top: calc(8px + env(safe-area-inset-top, 0px));
    z-index: 60;
    display: grid;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 18px;
    background: rgba(255, 250, 242, 0.94);
    backdrop-filter: blur(14px);
    border: 1px solid rgba(34, 49, 39, 0.08);
    box-shadow: 0 16px 28px rgba(34, 49, 39, 0.1);
}

.shell-progress[hidden] {
    display: none;
}

.shell-progress-bar {
    position: relative;
    height: 4px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(34, 49, 39, 0.08);
}

.shell-progress-bar::after {
    content: "";
    position: absolute;
    inset: 0 auto 0 -36%;
    width: 36%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--accent), var(--sun));
    animation: shellProgressRun 920ms ease-in-out infinite;
}

.shell-progress-label {
    color: var(--muted);
    font-size: 0.82rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.brand-wrap {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.brand {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.06em;
}

.topbar-context {
    color: var(--muted);
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.nav {
    display: flex;
    gap: 10px;
    color: var(--muted);
}

.nav a {
    padding: 9px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.28);
    border: 1px solid transparent;
    transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.nav a:hover {
    transform: translateY(-1px);
    border-color: rgba(34, 49, 39, 0.12);
    background: rgba(255, 255, 255, 0.5);
}

.nav a.is-active {
    background: rgba(34, 49, 39, 0.92);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 12px 24px rgba(34, 49, 39, 0.12);
}

.mobile-dock {
    display: none;
}

.install-rail {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: calc(82px + env(safe-area-inset-bottom, 0px));
    z-index: 45;
    display: grid;
    gap: 12px;
    padding: 14px;
    border-radius: 24px;
    background:
        linear-gradient(160deg, rgba(255, 247, 225, 0.96), rgba(255, 252, 247, 0.94)),
        radial-gradient(circle at 92% 12%, rgba(243, 178, 74, 0.18), transparent 28%);
    border: 1px solid rgba(243, 178, 74, 0.22);
    box-shadow: 0 18px 36px rgba(34, 49, 39, 0.14);
}

.install-rail[hidden] {
    display: none;
}

.install-rail-copy {
    display: grid;
    gap: 6px;
}

.install-rail-copy strong {
    font-size: 1rem;
    line-height: 1.35;
}

.install-rail-note,
.install-rail-help {
    margin: 0;
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.45;
}

.install-rail-help {
    color: var(--accent);
}

.install-rail-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.install-button {
    min-width: 108px;
}

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(240px, 0.9fr);
    gap: 20px;
    min-height: min(82svh, 820px);
    padding: 24px;
    border-radius: 36px;
    background:
        linear-gradient(140deg, rgba(255, 252, 247, 0.86), rgba(255, 247, 236, 0.78)),
        linear-gradient(180deg, rgba(255, 255, 255, 0.45), rgba(255, 255, 255, 0));
    border: 1px solid rgba(34, 49, 39, 0.1);
    box-shadow: var(--hero-shadow);
    overflow: hidden;
    position: relative;
}

.hero::after {
    content: "";
    position: absolute;
    inset: auto -8% -12% auto;
    width: 220px;
    height: 220px;
    background: radial-gradient(circle, rgba(243, 178, 74, 0.28), transparent 64%);
    pointer-events: none;
}

.section-header {
    margin: 26px 0 14px;
    padding: 0 4px;
}

.section-header.compact {
    margin-top: 16px;
}

.eyebrow {
    margin: 0 0 12px;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.8rem;
}

h1 {
    margin: 0 0 14px;
    font-size: clamp(2.5rem, 9vw, 5.2rem);
    line-height: 0.94;
    max-width: 11ch;
}

h2 {
    margin: 0 0 12px;
    font-size: clamp(1.2rem, 3.2vw, 1.8rem);
}

.lead {
    max-width: 36ch;
    color: var(--muted);
    font-size: 1.06rem;
    line-height: 1.55;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 26px;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 12px 18px;
    border-radius: 999px;
    border: 1px solid var(--line);
    transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.button.primary {
    background: var(--accent);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 14px 32px rgba(206, 96, 55, 0.24);
}

.button.secondary {
    background: rgba(255, 255, 255, 0.5);
}

.button.button-compact {
    min-height: 38px;
    margin-top: 8px;
    padding: 8px 12px;
    font-size: 0.84rem;
}

.hero-copy {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 8px 4px 8px 2px;
    position: relative;
    z-index: 1;
}

.hero-caption {
    margin-top: 18px;
    color: var(--muted);
    font-size: 0.95rem;
}

.mini-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin: 22px 0 0;
}

.mini-metrics div {
    padding: 14px 12px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.42);
    border: 1px solid rgba(34, 49, 39, 0.08);
}

.mini-metrics dt {
    font-size: 1.5rem;
    font-weight: 700;
}

.mini-metrics dd {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 0.88rem;
    line-height: 1.35;
}

.scope-control-shell {
    display: grid;
    gap: 10px;
    margin-top: 14px;
    padding: 14px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.58);
    border: 1px solid rgba(34, 49, 39, 0.08);
}

.scope-control-shell-compact {
    margin-top: 0;
}

.scope-control-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.scope-control-field {
    display: grid;
    gap: 6px;
    min-width: 0;
}

.scope-control-field span {
    color: var(--muted);
    font-size: 0.82rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.scope-control-actions {
    margin-top: 0;
}

.scope-control-note {
    margin: 0;
}

.route-stage {
    min-height: 360px;
    border-radius: 28px;
    background:
        linear-gradient(180deg, rgba(255, 240, 214, 0.66), rgba(248, 226, 185, 0.48)),
        radial-gradient(circle at 50% 8%, rgba(243, 178, 74, 0.38), transparent 16%);
    border: 1px solid rgba(34, 49, 39, 0.08);
    position: relative;
    overflow: hidden;
    padding: 20px;
}

.route-stage::before {
    content: "";
    position: absolute;
    inset: 18px;
    border-radius: 24px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0));
}

.route-path {
    position: absolute;
    inset: 48px 40px;
}

.route-segment {
    position: absolute;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(92, 134, 100, 0.26), rgba(206, 96, 55, 0.3));
    transform-origin: left center;
    animation: trailReveal 1100ms ease both;
}

.route-segment.one {
    --rotate: 25deg;
    top: 24px;
    left: 44px;
    width: 56%;
    height: 10px;
    transform: rotate(var(--rotate));
}

.route-segment.two {
    --rotate: -32deg;
    top: 132px;
    right: 28px;
    width: 48%;
    height: 10px;
    transform: rotate(var(--rotate));
    animation-delay: 160ms;
}

.route-segment.three {
    --rotate: 18deg;
    bottom: 58px;
    left: 38px;
    width: 58%;
    height: 10px;
    transform: rotate(var(--rotate));
    animation-delay: 320ms;
}

.route-node {
    position: absolute;
    display: grid;
    place-items: center;
    width: 70px;
    height: 70px;
    border-radius: 999px;
    background: rgba(255, 252, 245, 0.9);
    border: 1px solid rgba(34, 49, 39, 0.08);
    box-shadow: 0 14px 24px rgba(34, 49, 39, 0.1);
    animation: floatNode 3.6s ease-in-out infinite;
}

.route-node span {
    font-size: 1.55rem;
}

.route-node strong {
    position: absolute;
    left: 50%;
    bottom: -28px;
    transform: translateX(-50%);
    font-size: 0.84rem;
    white-space: nowrap;
    color: var(--ink);
}

.route-node.start {
    top: 18px;
    left: 20px;
}

.route-node.lesson {
    top: 112px;
    right: 22px;
    animation-delay: 240ms;
}

.route-node.review {
    bottom: 34px;
    left: 24px;
    animation-delay: 480ms;
}

.route-node.reward {
    right: 34px;
    bottom: 18px;
    animation-delay: 720ms;
    background: rgba(255, 244, 223, 0.95);
}

.map-note {
    position: absolute;
    left: 20px;
    bottom: 18px;
    max-width: 170px;
    padding: 12px 14px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(34, 49, 39, 0.08);
    font-size: 0.9rem;
    color: var(--muted);
}

.route-meter {
    position: absolute;
    right: 20px;
    bottom: 20px;
    width: min(220px, calc(100% - 220px));
    display: grid;
    gap: 8px;
    padding: 12px 14px;
    border-radius: 18px;
    background: rgba(255, 250, 242, 0.78);
    border: 1px solid rgba(34, 49, 39, 0.08);
    backdrop-filter: blur(10px);
}

.meter-track {
    height: 10px;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(34, 49, 39, 0.08);
}

.meter-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--forest), var(--sun));
}

.stack-grid {
    display: grid;
    gap: 16px;
    margin-top: 18px;
}

.support-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin: 24px 0 14px;
}

.strip {
    padding: 18px 18px 20px;
    background: rgba(255, 250, 242, 0.74);
    border-radius: 26px;
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 420ms ease, transform 420ms ease;
}

.strip.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.strip p,
.strip li {
    color: var(--muted);
    line-height: 1.5;
}

.feature-list,
.simple-list,
.micro-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.feature-list li,
.simple-list li,
.micro-list li {
    padding: 10px 0;
    border-top: 1px solid rgba(34, 49, 39, 0.08);
}

.feature-list li:first-child,
.simple-list li:first-child,
.micro-list li:first-child {
    border-top: 0;
}

.accent {
    color: var(--accent);
    font-weight: 700;
}

.split-band {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.mode-row {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: center;
}

.mode-tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 0.8rem;
    background: rgba(92, 134, 100, 0.14);
    color: var(--forest);
}

.status-line {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
    color: var(--muted);
    font-size: 0.9rem;
}

.section-lead {
    color: var(--muted);
    max-width: 48ch;
}

.reward-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}

.reward-pill {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(243, 178, 74, 0.16);
    color: #7a5920;
    font-size: 0.9rem;
    border: 1px solid rgba(243, 178, 74, 0.24);
}

.reward-pill.muted {
    background: rgba(255, 255, 255, 0.62);
    color: var(--muted);
    border-color: rgba(34, 49, 39, 0.08);
}

.reward-pill.is-accent {
    background: rgba(206, 96, 55, 0.14);
    color: var(--accent);
    border-color: rgba(206, 96, 55, 0.2);
}

.reward-pill.is-good {
    background: rgba(92, 134, 100, 0.12);
    color: var(--forest);
    border-color: rgba(92, 134, 100, 0.18);
}

.reward-pill.is-hidden {
    display: none;
}

.diagnostic-step {
    display: grid;
    gap: 8px;
}

.diagnostic-step-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.diagnostic-step-copy {
    margin: 0;
}

.diagnostic-code-block {
    margin: 14px 0 0;
    padding: 14px 16px;
    overflow-x: auto;
    border-radius: 18px;
    background: rgba(34, 49, 39, 0.92);
    color: #f7f2e8;
    border: 1px solid rgba(34, 49, 39, 0.18);
    font-family: "IBM Plex Mono", "SFMono-Regular", monospace;
    font-size: 0.82rem;
    line-height: 1.55;
    white-space: pre-wrap;
    word-break: break-word;
}

.diagnostic-code-block code {
    font: inherit;
    color: inherit;
}

.grade-health-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.9rem;
}

.grade-health-row.is-highlighted {
    border-radius: 22px;
    background: rgba(206, 96, 55, 0.1);
    box-shadow: 0 0 0 4px rgba(206, 96, 55, 0.12);
}

.grade-health-row.is-busy {
    opacity: 0.88;
}

.grade-health-main {
    flex: 1;
    min-width: 0;
}

.grade-health-actions {
    display: grid;
    gap: 0.5rem;
    justify-items: stretch;
    min-width: 8.5rem;
}

.grade-health-action-state {
    margin: 0 0 0.1rem;
}

.grade-health-lock-note {
    margin: 0 0 0.1rem;
    color: var(--muted);
}

.grade-health-lock-note.is-active {
    color: var(--accent);
}

.grade-health-inline-result {
    margin: 0 0 0.15rem;
    width: 100%;
}

.grade-health-head {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    flex-wrap: wrap;
}

.grade-health-copy {
    margin: 0.3rem 0 0;
    color: var(--muted-text);
}

.grade-health-pills {
    margin-top: 0.55rem;
}

.grade-health-block-note {
    margin-top: 0.35rem;
    color: #7f331a;
}

.guest-mode-shell {
    display: grid;
    gap: 0.8rem;
}

.guest-mode-token-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.65rem;
    align-items: end;
}

.guest-mode-token-field {
    display: grid;
    gap: 0.35rem;
    min-width: 0;
}

.guest-mode-token-field span {
    color: var(--muted);
    font-size: 0.82rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.guest-mode-status,
.guest-mode-note {
    margin: 0;
}

.audio-runtime-shell {
    display: grid;
    gap: 0.8rem;
    margin-top: 1rem;
    padding: 0.95rem;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.42);
    border: 1px solid rgba(34, 49, 39, 0.08);
}

.audio-runtime-shell.is-busy {
    opacity: 0.88;
}

.audio-runtime-grid {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.audio-runtime-field {
    display: grid;
    gap: 0.35rem;
    min-width: 0;
}

.audio-runtime-field span {
    color: var(--muted);
    font-size: 0.82rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.audio-runtime-field-wide {
    grid-column: 1 / -1;
}

.audio-runtime-note {
    margin: 0;
}

.audio-probe-panel {
    display: grid;
    gap: 10px;
    margin-top: 16px;
    padding: 14px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(34, 49, 39, 0.08);
}

.audio-probe-player {
    width: 100%;
    min-height: 44px;
}

.cta-band {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
}

.library-filter {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto;
    gap: 10px;
}

.scope-switch {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.maintenance-grid {
    display: grid;
    gap: 12px;
    margin-top: 16px;
}

.scope-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 10px 14px;
    border-radius: 999px;
    border: 1px solid rgba(34, 49, 39, 0.12);
    background: rgba(255, 255, 255, 0.6);
    color: var(--ink);
    white-space: nowrap;
}

.scope-link.is-active {
    background: var(--ink);
    border-color: transparent;
    color: #fff;
}

.library-maintenance {
    display: grid;
    gap: 14px;
    padding: 16px;
    border-radius: 22px;
    background: rgba(255, 252, 247, 0.82);
    border: 1px solid rgba(34, 49, 39, 0.08);
}

.library-maintenance-copy {
    display: grid;
    gap: 8px;
}

.filter-input,
.filter-select {
    min-height: 46px;
    width: 100%;
    padding: 0 14px;
    border-radius: 16px;
    border: 1px solid rgba(34, 49, 39, 0.12);
    background: rgba(255, 255, 255, 0.72);
    color: var(--ink);
    font: inherit;
}

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

.empty-state-card {
    display: grid;
    gap: 12px;
    padding: 18px;
    border-radius: 22px;
    background: rgba(255, 252, 247, 0.82);
    border: 1px solid rgba(34, 49, 39, 0.08);
}

.word-row {
    display: grid;
    gap: 10px;
    padding: 16px;
    border-radius: 22px;
    background: rgba(255, 252, 247, 0.82);
    border: 1px solid rgba(34, 49, 39, 0.08);
}

.word-row-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.word-row-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.word-main {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.word-main strong {
    font-size: 1.08rem;
}

.word-main span,
.word-meta {
    color: var(--muted);
}

.word-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 0.9rem;
}

.status-tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.62);
    border: 1px solid rgba(34, 49, 39, 0.1);
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 700;
}

.status-tag.is-good {
    background: rgba(92, 134, 100, 0.12);
    border-color: rgba(92, 134, 100, 0.18);
    color: var(--forest);
}

.status-tag.is-alert {
    background: rgba(206, 96, 55, 0.12);
    border-color: rgba(206, 96, 55, 0.16);
    color: var(--accent);
}

.compact-button {
    min-height: 40px;
    padding: 8px 14px;
    flex-shrink: 0;
}

.compact-button.is-playing {
    background: var(--ink);
    color: #fff;
    border-color: transparent;
}

.inline-link {
    color: var(--accent);
    font-weight: 700;
}

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

.editor-action-bar {
    position: sticky;
    bottom: calc(88px + env(safe-area-inset-bottom, 0px));
    z-index: 10;
    margin-top: 6px;
    padding: 10px;
    border-radius: 22px;
    background: rgba(255, 250, 242, 0.9);
    border: 1px solid rgba(34, 49, 39, 0.08);
    backdrop-filter: blur(12px);
}

.audio-preview-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
    padding: 14px 16px;
    border-radius: 20px;
    background: rgba(255, 252, 247, 0.84);
    border: 1px solid rgba(34, 49, 39, 0.08);
}

.preview-status {
    margin-top: 10px;
}

.preview-status.is-good {
    color: var(--forest);
}

.preview-status.is-alert {
    color: var(--accent);
}

.editor-field {
    display: grid;
    gap: 6px;
}

.example-review-panel {
    display: grid;
    gap: 12px;
    padding: 14px;
    border-radius: 22px;
    background: linear-gradient(180deg, rgba(255, 245, 236, 0.92), rgba(255, 252, 247, 0.88));
    border: 1px solid rgba(206, 96, 55, 0.14);
}

.audio-review-panel {
    display: grid;
    gap: 12px;
    margin-bottom: 14px;
    padding: 14px;
    border-radius: 22px;
    background: linear-gradient(180deg, rgba(246, 251, 248, 0.96), rgba(255, 255, 255, 0.9));
    border: 1px solid rgba(34, 49, 39, 0.1);
}

.example-review-panel.is-hidden {
    display: none;
}

.audio-review-panel.is-hidden {
    display: none;
}

.example-review-head,
.audio-review-head {
    display: grid;
    gap: 6px;
}

.example-review-head h3,
.audio-review-head h3 {
    margin: 0;
    font-size: 1rem;
    line-height: 1.35;
}

.example-review-grid,
.audio-review-grid {
    display: grid;
    gap: 10px;
}

.example-review-card,
.audio-review-card {
    display: grid;
    gap: 6px;
    padding: 14px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(34, 49, 39, 0.08);
}

.example-review-card.is-accent,
.audio-review-card.is-accent {
    background: rgba(255, 247, 238, 0.92);
    border-color: rgba(206, 96, 55, 0.16);
}

.audio-review-card.is-accent {
    background: rgba(240, 248, 243, 0.96);
    border-color: rgba(34, 49, 39, 0.12);
}

.example-review-card strong,
.audio-review-card strong {
    font-size: 0.98rem;
    line-height: 1.4;
}

.example-review-card span:last-child,
.audio-review-card span:last-child {
    color: var(--muted);
    font-size: 0.88rem;
    line-height: 1.4;
}

.example-suggestion-panel {
    display: grid;
    gap: 12px;
    padding: 14px;
    border-radius: 22px;
    background: rgba(255, 252, 247, 0.84);
    border: 1px solid rgba(34, 49, 39, 0.08);
}

.example-suggestion-head {
    display: grid;
    gap: 6px;
}

.example-suggestion-head h3 {
    margin: 0;
    font-size: 1rem;
    line-height: 1.35;
}

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

.example-suggestion-card {
    display: grid;
    gap: 6px;
    width: 100%;
    min-width: 0;
    padding: 14px;
    border-radius: 18px;
    border: 1px solid rgba(34, 49, 39, 0.1);
    background: rgba(255, 255, 255, 0.7);
    color: var(--ink);
    text-align: left;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.example-suggestion-card strong {
    font-size: 0.98rem;
    line-height: 1.35;
}

.example-suggestion-card span:last-child {
    color: var(--muted);
    font-size: 0.88rem;
    line-height: 1.4;
}

.suggestion-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    min-height: 24px;
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(206, 96, 55, 0.12);
    color: var(--accent);
    font-size: 0.74rem;
    font-weight: 700;
}

.editor-field span {
    font-size: 0.9rem;
    color: var(--muted);
}

.editor-textarea {
    min-height: 108px;
    padding: 12px 14px;
    resize: vertical;
}

.study-shell {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
    gap: 16px;
    align-items: start;
}

.study-support-stack {
    display: grid;
    gap: 14px;
    align-content: start;
}

.study-support-footer {
    margin-top: 16px;
}

.study-support-panel {
    border-radius: 24px;
    background: rgba(255, 252, 247, 0.84);
    border: 1px solid rgba(34, 49, 39, 0.08);
}

.study-support-panel[open] {
    box-shadow: 0 14px 28px rgba(34, 49, 39, 0.05);
}

.study-support-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 16px 18px;
    cursor: pointer;
    list-style: none;
}

.study-support-summary::-webkit-details-marker {
    display: none;
}

.study-support-summary strong {
    display: block;
    font-size: 1rem;
    line-height: 1.35;
}

.study-support-summary .eyebrow {
    margin-bottom: 6px;
}

.study-support-content {
    padding: 0 14px 14px;
}

.study-support-article {
    min-width: 0;
}

.study-board {
    position: sticky;
    top: 92px;
}

.study-topline {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: flex-start;
}

.study-section-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 14px 0 10px;
    color: var(--muted);
    font-size: 0.84rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.mode-switcher {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 16px 0 18px;
}

.mode-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    padding: 10px 14px;
    border-radius: 999px;
    border: 1px solid rgba(34, 49, 39, 0.12);
    background: rgba(255, 255, 255, 0.55);
    color: var(--ink);
    transition: transform 180ms ease, background 180ms ease, color 180ms ease;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.mode-chip.is-active {
    background: var(--ink);
    color: #fff;
}

.mode-chip.is-recommended {
    border-color: rgba(206, 96, 55, 0.28);
    background: rgba(255, 241, 233, 0.84);
}

.mode-chip.is-unavailable {
    opacity: 0.82;
    border-style: dashed;
    background: rgba(243, 238, 231, 0.84);
}

.mode-chip.is-active.is-recommended {
    background: linear-gradient(135deg, var(--ink), #394a40);
    border-color: transparent;
}

.mode-chip:disabled {
    cursor: not-allowed;
    opacity: 0.56;
    transform: none;
}

.chip-flag {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(206, 96, 55, 0.14);
    color: var(--accent);
    font-size: 0.74rem;
    font-weight: 700;
}

.chip-state {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 3px 7px;
    border-radius: 999px;
    background: rgba(34, 49, 39, 0.08);
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 700;
}

.chip-state.is-ready {
    background: rgba(85, 110, 96, 0.1);
    color: #51655b;
}

.mode-chip.is-active .chip-flag {
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
}

.study-theme-strip {
    display: grid;
    gap: 10px;
    margin-bottom: 14px;
    padding: 16px 16px 14px;
    border-radius: 22px;
    background: linear-gradient(180deg, rgba(255, 246, 231, 0.94), rgba(255, 252, 247, 0.88));
    border: 1px solid rgba(34, 49, 39, 0.08);
}

.study-theme-strip.is-shifting {
    animation: chapterShiftPulse 560ms ease;
}

.study-focus-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.focus-card {
    display: grid;
    gap: 6px;
    min-width: 0;
    padding: 12px 14px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.56);
    border: 1px solid rgba(34, 49, 39, 0.08);
}

.focus-card-accent {
    background: linear-gradient(180deg, rgba(255, 241, 233, 0.88), rgba(255, 249, 245, 0.82));
    border-color: rgba(206, 96, 55, 0.16);
}

.focus-label {
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.focus-card strong,
.focus-copy {
    min-width: 0;
}

.focus-card strong {
    font-size: 0.98rem;
    line-height: 1.35;
}

.focus-copy {
    color: var(--muted);
    font-size: 0.86rem;
    line-height: 1.4;
}

.study-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.study-flow-strip {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 14px 0 12px;
}

.study-flow-card {
    display: grid;
    gap: 6px;
    min-width: 0;
    padding: 12px 14px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.56);
    border: 1px solid rgba(34, 49, 39, 0.08);
}

.study-flow-card-accent {
    background: linear-gradient(180deg, rgba(255, 241, 233, 0.88), rgba(255, 249, 245, 0.82));
    border-color: rgba(206, 96, 55, 0.16);
}

.chapter-reward-strip {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.reward-track {
    display: grid;
    gap: 8px;
    padding: 14px 14px 12px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.54);
    border: 1px solid rgba(34, 49, 39, 0.08);
}

.reward-track.is-ready {
    border-color: rgba(243, 178, 74, 0.28);
    background: rgba(255, 248, 233, 0.82);
}

.reward-track.is-complete {
    border-color: rgba(92, 134, 100, 0.22);
    background: rgba(236, 245, 238, 0.92);
}

.reward-track strong {
    font-size: 1rem;
}

.reward-track-copy {
    margin: 0;
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.45;
}

.question-stage {
    min-height: 280px;
    padding: 18px 0 8px;
}

.study-loading-card {
    display: grid;
    gap: 8px;
    padding: 18px;
    border-radius: 22px;
    background: linear-gradient(180deg, rgba(255, 246, 231, 0.94), rgba(255, 252, 247, 0.9));
    border: 1px solid rgba(34, 49, 39, 0.08);
}

.study-loading-card.is-error {
    background: linear-gradient(180deg, rgba(255, 241, 233, 0.9), rgba(255, 252, 247, 0.9));
    border-color: rgba(206, 96, 55, 0.18);
}

.study-loading-copy {
    margin: 0;
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.45;
}

.chapter-transition {
    margin: 8px 0 18px;
}

.chapter-transition-card {
    display: grid;
    gap: 12px;
    padding: 18px;
    border-radius: 24px;
    background:
        linear-gradient(160deg, rgba(255, 247, 225, 0.96), rgba(255, 252, 247, 0.9)),
        radial-gradient(circle at 88% 12%, rgba(243, 178, 74, 0.2), transparent 24%);
    border: 1px solid rgba(243, 178, 74, 0.22);
    box-shadow: 0 18px 34px rgba(243, 178, 74, 0.12);
}

.chapter-transition-card h2 {
    margin: 0;
    font-size: clamp(1.6rem, 5vw, 2.2rem);
}

.study-empty {
    margin: 0;
    color: var(--muted);
    font-size: 1rem;
}

.study-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 18px;
    color: var(--muted);
    font-size: 0.9rem;
}

.prompt-block {
    margin-bottom: 16px;
}

.prompt-block.sentence-prompt {
    padding: 18px 18px 16px;
    border-radius: 24px;
    background: linear-gradient(180deg, rgba(255, 246, 231, 0.94), rgba(255, 252, 247, 0.88));
    border: 1px solid rgba(34, 49, 39, 0.08);
}

.prompt-label {
    margin: 0 0 8px;
    color: var(--accent);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-size: 0.78rem;
}

.study-prompt {
    margin: 0;
    font-size: clamp(1.7rem, 5vw, 2.7rem);
    line-height: 1.05;
}

.study-prompt.is-sentence {
    font-size: clamp(1.45rem, 4.6vw, 2.2rem);
    line-height: 1.25;
}

.prompt-note {
    margin: 12px 0 0;
    color: var(--muted);
    font-size: 0.95rem;
    line-height: 1.5;
}

.option-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.option-button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    text-align: left;
    padding: 15px 16px;
    border-radius: 18px;
    border: 1px solid rgba(34, 49, 39, 0.1);
    background: rgba(255, 255, 255, 0.62);
    color: var(--ink);
    font-size: 1rem;
    transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.option-copy {
    flex: 1;
}

.option-state {
    display: none;
    align-items: center;
    min-height: 28px;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
    white-space: nowrap;
}

.option-button:disabled:not(.is-correct-answer):not(.is-wrong-answer):not(.is-muted),
.playback-button:disabled,
.spelling-input:disabled,
.spelling-submit:disabled {
    cursor: not-allowed;
    opacity: 0.58;
}

.option-button.is-correct-answer,
.option-button.is-correct-answer:disabled {
    border-color: rgba(92, 134, 100, 0.32);
    background: rgba(92, 134, 100, 0.16);
    color: #295132;
    opacity: 1;
}

.option-button.is-correct-answer .option-state {
    display: inline-flex;
    background: rgba(92, 134, 100, 0.2);
    color: #295132;
}

.option-button.is-wrong-answer,
.option-button.is-wrong-answer:disabled {
    border-color: rgba(206, 96, 55, 0.34);
    background: rgba(206, 96, 55, 0.16);
    color: #7f331a;
    opacity: 1;
}

.option-button.is-wrong-answer .option-state {
    display: inline-flex;
    background: rgba(255, 255, 255, 0.74);
    color: #7f331a;
}

.option-button.is-muted,
.option-button.is-muted:disabled {
    background: rgba(255, 255, 255, 0.5);
    color: rgba(41, 48, 41, 0.7);
    opacity: 0.88;
}

.audio-prompt {
    display: grid;
    gap: 10px;
    margin-bottom: 18px;
    padding: 16px;
    border-radius: 22px;
    background: linear-gradient(180deg, rgba(255, 247, 236, 0.92), rgba(255, 252, 247, 0.84));
    border: 1px solid rgba(34, 49, 39, 0.08);
}

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

.playback-button {
    min-height: 56px;
    width: 100%;
    padding: 14px 18px;
    border: 0;
    border-radius: 20px;
    background: linear-gradient(135deg, var(--accent), #dd7b54);
    color: #fff;
    font: inherit;
    font-size: 1.02rem;
    font-weight: 700;
    box-shadow: 0 14px 28px rgba(206, 96, 55, 0.22);
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.playback-button.secondary {
    background: rgba(255, 255, 255, 0.84);
    color: var(--ink);
    border: 1px solid rgba(34, 49, 39, 0.12);
    box-shadow: none;
}

.button:focus-visible,
.mode-chip:focus-visible,
.option-button:focus-visible,
.playback-button:focus-visible,
.spelling-submit:focus-visible,
.spelling-input:focus-visible {
    outline: 2px solid rgba(206, 96, 55, 0.44);
    outline-offset: 2px;
}

@media (hover: hover) and (pointer: fine) {
    .button:hover {
        transform: translateY(-1px);
    }

    .option-button:hover {
        transform: translateY(-1px);
        border-color: rgba(206, 96, 55, 0.26);
        background: rgba(255, 255, 255, 0.88);
    }
}

.audio-tip {
    margin: 0;
    font-size: 0.94rem;
}

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

.spelling-label {
    color: var(--muted);
    font-size: 0.94rem;
}

.spelling-input {
    min-height: 56px;
    width: 100%;
    padding: 0 16px;
    border-radius: 20px;
    border: 1px solid rgba(34, 49, 39, 0.12);
    background: rgba(255, 255, 255, 0.84);
    color: var(--ink);
    font: inherit;
    font-size: 1.12rem;
}

.spelling-input:focus {
    outline: none;
    border-color: rgba(206, 96, 55, 0.36);
    box-shadow: 0 0 0 4px rgba(206, 96, 55, 0.1);
}

.spelling-submit {
    width: 100%;
}

.result-band {
    margin: 8px 0 18px;
    padding: 14px 16px;
    border-radius: 18px;
    font-weight: 700;
}

.result-band-copy {
    display: grid;
    gap: 6px;
}

.result-band-summary {
    margin: 0;
    font-size: 0.92rem;
    font-weight: 600;
    line-height: 1.45;
}

.result-band-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}

.result-band.is-correct {
    background: rgba(92, 134, 100, 0.16);
    color: #295132;
}

.result-band.is-pending {
    background: rgba(255, 248, 233, 0.88);
    color: #7a5920;
}

.result-band.is-wrong {
    background: rgba(206, 96, 55, 0.14);
    color: #7f331a;
}

.reward-note {
    margin-top: 8px;
    font-size: 0.95rem;
    font-weight: 600;
}

.feedback-title {
    margin-top: 10px;
    font-size: 0.95rem;
    font-weight: 700;
}

.feedback-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.feedback-chip {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.58);
    border: 1px solid rgba(34, 49, 39, 0.1);
    font-size: 0.88rem;
    font-weight: 600;
}

.summary-footnote {
    margin: 12px 0 10px;
    color: var(--muted);
    font-size: 0.88rem;
    line-height: 1.45;
}

.weak-word-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.weak-word-stack {
    display: grid;
    gap: 6px;
}

.weak-word-tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 5px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.62);
    border: 1px solid rgba(34, 49, 39, 0.1);
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
}

.weak-word-tag.is-urgent {
    background: rgba(206, 96, 55, 0.12);
    border-color: rgba(206, 96, 55, 0.16);
    color: var(--accent);
}

.weak-word-copy {
    margin: 0;
    color: var(--muted);
    font-size: 0.8rem;
    line-height: 1.4;
}

.attempt-list {
    gap: 10px;
}

.attempt-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.attempt-main {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.attempt-copy {
    margin: 0;
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.35;
}

.attempt-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    border: 1px solid rgba(34, 49, 39, 0.1);
    background: rgba(255, 255, 255, 0.62);
    color: var(--muted);
    white-space: nowrap;
}

.attempt-pill.is-correct {
    background: rgba(92, 134, 100, 0.12);
    border-color: rgba(92, 134, 100, 0.16);
    color: var(--forest);
}

.attempt-pill.is-wrong {
    background: rgba(206, 96, 55, 0.12);
    border-color: rgba(206, 96, 55, 0.16);
    color: var(--accent);
}

.chapter-shell {
    display: grid;
    gap: 16px;
}

.parent-focus-band {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 18px;
}

.parent-focus-card {
    min-width: 0;
}

.parent-focus-card-accent {
    background:
        linear-gradient(160deg, rgba(255, 247, 225, 0.96), rgba(255, 252, 247, 0.92)),
        radial-gradient(circle at 90% 14%, rgba(243, 178, 74, 0.16), transparent 24%);
}

.parent-quick-actions {
    margin-top: 18px;
}

.parent-focus-list li {
    line-height: 1.55;
}

.chapter-hero {
    background:
        linear-gradient(180deg, rgba(255, 248, 236, 0.94), rgba(255, 252, 247, 0.9)),
        radial-gradient(circle at 86% 10%, rgba(243, 178, 74, 0.16), transparent 22%);
}

.chapter-hero.is-complete {
    background:
        radial-gradient(circle at 88% 14%, rgba(243, 178, 74, 0.34), transparent 20%),
        radial-gradient(circle at 12% 18%, rgba(92, 134, 100, 0.22), transparent 18%),
        linear-gradient(180deg, rgba(255, 247, 225, 0.96), rgba(255, 252, 247, 0.92));
}

.chapter-complete-panel {
    display: grid;
    gap: 16px;
    margin-bottom: 18px;
    padding: 18px;
    border-radius: 24px;
    background:
        linear-gradient(145deg, rgba(255, 250, 240, 0.94), rgba(255, 241, 209, 0.82)),
        radial-gradient(circle at 90% 10%, rgba(243, 178, 74, 0.28), transparent 24%);
    border: 1px solid rgba(243, 178, 74, 0.24);
    box-shadow: 0 18px 34px rgba(243, 178, 74, 0.12);
}

.chapter-shift-note {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-bottom: 16px;
    padding: 12px 14px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.58);
    border: 1px solid rgba(34, 49, 39, 0.08);
}

.chapter-shift-tag {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(92, 134, 100, 0.14);
    color: var(--forest);
    font-size: 0.82rem;
    font-weight: 700;
}

.chapter-complete-copy {
    display: grid;
    gap: 6px;
}

.chapter-complete-copy .section-lead {
    max-width: 36ch;
}

.chapter-complete-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin: 0;
}

.chapter-complete-metrics div {
    padding: 14px 12px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.58);
    border: 1px solid rgba(34, 49, 39, 0.08);
}

.chapter-complete-metrics dt {
    font-size: 1.45rem;
    font-weight: 700;
}

.chapter-complete-metrics dd {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 0.88rem;
}

.chapter-headline {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
}

.chapter-badge-cluster {
    display: grid;
    gap: 10px;
    justify-items: end;
}

.chapter-badge {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(206, 96, 55, 0.14);
    border: 1px solid rgba(206, 96, 55, 0.2);
    color: var(--accent);
    font-weight: 700;
}

.chapter-badge.muted {
    background: rgba(255, 255, 255, 0.6);
    border-color: rgba(34, 49, 39, 0.08);
    color: var(--muted);
}

.chapter-meter {
    display: grid;
    gap: 10px;
    margin-top: 18px;
}

.chapter-next-reward {
    display: grid;
    gap: 6px;
    margin-top: 16px;
    padding: 14px 16px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.54);
    border: 1px solid rgba(34, 49, 39, 0.08);
}

.chapter-next-reward.complete {
    background: rgba(92, 134, 100, 0.12);
}

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

.chapter-card {
    display: grid;
    gap: 10px;
    padding: 14px 16px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.52);
    border: 1px solid rgba(34, 49, 39, 0.08);
}

.chapter-card.is-active {
    background: linear-gradient(180deg, rgba(255, 245, 232, 0.92), rgba(255, 252, 247, 0.88));
    border-color: rgba(206, 96, 55, 0.18);
}

.chapter-card.is-completed {
    background: rgba(92, 134, 100, 0.1);
}

.chapter-card-top {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
}

.chapter-card-summary,
.chapter-card-foot {
    margin: 0;
    color: var(--muted);
    line-height: 1.5;
}

.chapter-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    color: var(--muted);
    font-size: 0.9rem;
}

.chapter-timeline {
    display: grid;
    gap: 12px;
}

.timeline-node {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 12px;
    align-items: start;
}

.timeline-dot {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(34, 49, 39, 0.1);
    font-weight: 700;
}

.timeline-copy {
    padding: 12px 14px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.56);
    border: 1px solid rgba(34, 49, 39, 0.08);
}

.timeline-node.is-current .timeline-dot {
    background: var(--ink);
    border-color: transparent;
    color: #fff;
}

.timeline-node.is-passed .timeline-dot {
    background: rgba(92, 134, 100, 0.18);
    color: #295132;
}

.timeline-reward {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 0.92rem;
}

@keyframes trailReveal {
    from {
        opacity: 0;
        transform: scaleX(0) rotate(var(--rotate, 0deg));
    }
    to {
        opacity: 1;
        transform: scaleX(1) rotate(var(--rotate, 0deg));
    }
}

@keyframes floatNode {
    0%,
    100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-6px);
    }
}

@keyframes chapterShiftPulse {
    0% {
        transform: translateY(0);
        box-shadow: none;
    }
    35% {
        transform: translateY(-3px);
        box-shadow: 0 18px 32px rgba(206, 96, 55, 0.12);
    }
    100% {
        transform: translateY(0);
        box-shadow: none;
    }
}

@keyframes shellProgressRun {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(380%);
    }
}

@media (max-width: 880px) {
    .hero,
    .support-grid,
    .split-band,
    .study-shell,
    .parent-focus-band {
        grid-template-columns: 1fr;
    }

    .hero {
        min-height: auto;
    }

    .study-board {
        position: static;
    }

    .study-support-content.stack-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .page-shell {
        width: min(100%, calc(100% - 18px));
        padding-top: calc(10px + env(safe-area-inset-top, 0px));
        padding-bottom: calc(104px + env(safe-area-inset-bottom, 0px));
    }

    body.has-install-rail .page-shell {
        padding-bottom: calc(240px + env(safe-area-inset-bottom, 0px));
    }

    .topbar {
        gap: 10px;
        align-items: center;
        border-radius: 22px;
        padding: 12px 14px;
        top: calc(8px + env(safe-area-inset-top, 0px));
    }

    .nav {
        display: none;
    }

    .brand {
        font-size: 1rem;
        letter-spacing: 0.04em;
    }

    .topbar-context {
        font-size: 0.72rem;
        letter-spacing: 0.06em;
    }

    .mobile-dock {
        position: fixed;
        left: 12px;
        right: 12px;
        bottom: calc(10px + env(safe-area-inset-bottom, 0px));
        z-index: 40;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        padding: 10px;
        border-radius: 24px;
        background: rgba(255, 250, 242, 0.92);
        backdrop-filter: blur(16px);
        border: 1px solid rgba(34, 49, 39, 0.08);
        box-shadow: 0 18px 32px rgba(34, 49, 39, 0.12);
    }

    .mobile-dock a {
        display: grid;
        place-items: center;
        min-height: 50px;
        padding: 8px 6px;
        border-radius: 18px;
        color: var(--muted);
        background: rgba(255, 255, 255, 0.4);
        border: 1px solid transparent;
        transition: transform 180ms ease, background 180ms ease, color 180ms ease;
    }

    .mobile-dock a.is-active {
        color: #fff;
        background: linear-gradient(135deg, var(--ink), #394a40);
        border-color: transparent;
        box-shadow: 0 12px 24px rgba(34, 49, 39, 0.12);
    }

    .dock-label {
        font-size: 0.82rem;
        font-weight: 700;
        letter-spacing: 0.04em;
        text-transform: uppercase;
    }

    .install-rail {
        gap: 10px;
        padding: 12px;
        border-radius: 20px;
    }

    .install-rail-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .install-button {
        width: 100%;
        min-width: 0;
    }

    .hero {
        padding: 18px;
        border-radius: 28px;
    }

    h1 {
        font-size: clamp(1.95rem, 10.5vw, 3rem);
    }

    .mini-metrics {
        grid-template-columns: 1fr 1fr;
    }

    .scope-control-grid,
    .audio-actions,
    .guest-mode-token-row {
        grid-template-columns: minmax(0, 1fr);
    }

    .route-stage {
        display: none;
    }

    .route-node {
        width: 62px;
        height: 62px;
    }

    .route-meter {
        position: static;
        width: 100%;
        margin-top: 210px;
    }

    .library-filter {
        grid-template-columns: 1fr;
    }

    .word-row {
        padding: 14px;
        border-radius: 18px;
    }

    .word-row-top {
        flex-direction: column;
    }

    .word-row-actions {
        justify-content: stretch;
    }

    .word-row-actions > * {
        flex: 1 1 0;
    }

    .compact-button {
        width: 100%;
    }

    .editor-action-bar {
        display: grid;
        grid-template-columns: 1fr;
        gap: 10px;
        bottom: calc(94px + env(safe-area-inset-bottom, 0px));
    }

    .audio-preview-panel {
        flex-direction: column;
        align-items: stretch;
    }

    .grade-health-row {
        flex-direction: column;
    }

    .grade-health-actions {
        width: 100%;
        min-width: 0;
    }

    .study-intro {
        display: none;
    }

    .hero .lead {
        font-size: 0.95rem;
        line-height: 1.45;
    }

    .study-intro h1 {
        font-size: clamp(1.95rem, 9vw, 2.55rem);
    }

    .study-intro .section-lead {
        font-size: 0.95rem;
        line-height: 1.45;
    }

    .study-topline {
        flex-direction: column;
        gap: 8px;
    }

    .status-line,
    .study-section-label,
    .hero-actions,
    .study-theme-strip,
    .study-board,
    .question-stage,
    .study-shell > * {
        min-width: 0;
    }

    .study-shell > .study-support-stack,
    .study-support-footer {
        display: none;
    }

    .mode-switcher {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 4px;
        margin: 12px 0 16px;
        scrollbar-width: none;
    }

    .mode-switcher::-webkit-scrollbar {
        display: none;
    }

    .mode-chip {
        flex: 0 0 auto;
        min-height: 40px;
        padding: 9px 12px;
        scroll-snap-align: start;
    }

    .chapter-reward-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .study-theme-strip {
        gap: 9px;
        padding: 14px;
        border-radius: 20px;
    }

    .study-theme-strip .section-lead {
        font-size: 0.92rem;
        line-height: 1.42;
    }

    #chapter-theme-summary {
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .study-focus-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .study-flow-strip {
        grid-template-columns: 1fr;
        gap: 8px;
        margin-top: 12px;
    }

    .study-flow-card {
        padding: 11px 12px;
        border-radius: 16px;
    }

    .button.button-compact {
        min-height: 34px;
        padding: 7px 10px;
    }

    .focus-card {
        padding: 11px 12px;
        border-radius: 16px;
    }

    .focus-card strong {
        font-size: 0.94rem;
    }

    .focus-copy {
        font-size: 0.82rem;
    }

    .study-chip-row,
    .reward-pills {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 2px;
        scrollbar-width: none;
    }

    .study-chip-row::-webkit-scrollbar,
    .reward-pills::-webkit-scrollbar {
        display: none;
    }

    .reward-pill {
        flex: 0 0 auto;
        min-height: 32px;
        padding: 7px 11px;
        font-size: 0.84rem;
    }

    .reward-track {
        gap: 6px;
        padding: 12px 12px 10px;
        border-radius: 16px;
    }

    .reward-track strong {
        font-size: 0.92rem;
    }

    .reward-track-copy {
        font-size: 0.82rem;
        line-height: 1.35;
    }

    .study-section-label {
        margin: 12px 0 8px;
        font-size: 0.76rem;
    }

    .question-stage {
        min-height: 240px;
        padding-top: 14px;
    }

    .study-loading-card {
        padding: 14px;
        border-radius: 18px;
    }

    .study-support-footer {
        margin-top: 12px;
    }

    .study-support-panel {
        border-radius: 18px;
    }

    .study-support-summary {
        padding: 14px;
    }

    .study-support-summary strong {
        font-size: 0.94rem;
    }

    .study-support-summary .mode-tag {
        min-width: 52px;
        justify-content: center;
    }

    .study-support-content {
        padding: 0 10px 10px;
    }

    .study-support-article {
        border-radius: 18px;
        padding: 14px;
    }

    .chapter-headline {
        flex-direction: column;
    }

    .chapter-badge-cluster {
        justify-items: start;
    }

    .chapter-complete-metrics {
        grid-template-columns: 1fr;
    }

    .parent-quick-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .parent-quick-actions .button:first-child {
        grid-column: 1 / -1;
    }

    .audio-runtime-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}
