:root {
    --background: #f5f6fb;
    --surface: #ffffff;
    --text: #182039;
    --muted: #66708c;
    --accent: #5b55d7;
    --accent-dark: #4640b7;
    --accent-soft: #eeedff;
    --green: #36a978;
    --border: #e4e7f1;
    --shadow: 0 24px 60px rgba(35, 40, 78, 0.12);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--background);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.6;
}

a {
    color: inherit;
}

.container {
    width: min(1120px, calc(100% - 40px));
    margin: 0 auto;
}

.site-header {
    position: relative;
    z-index: 2;
    border-bottom: 1px solid rgba(228, 231, 241, 0.9);
    background: rgba(255, 255, 255, 0.86);
}

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

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: var(--text);
    font-size: 1.13rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    text-decoration: none;
}

.brand-mark {
    position: relative;
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    overflow: hidden;
    border-radius: 13px;
    background: linear-gradient(145deg, #6862ea, #4942be);
    box-shadow: 0 9px 22px rgba(91, 85, 215, 0.28);
    color: white;
}

.brand-mark::after {
    position: absolute;
    right: 8px;
    bottom: 7px;
    width: 17px;
    height: 2px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.72);
    box-shadow: 0 5px 0 rgba(255, 255, 255, 0.45);
    content: "";
}

.brand-play {
    margin: 0 0 8px -10px;
    font-size: 0.68rem;
}

.brand-kana {
    position: absolute;
    top: 2px;
    right: 6px;
    font-size: 0.82rem;
    font-weight: 700;
}

.phase-badge {
    padding: 7px 11px;
    border: 1px solid #d9d6ff;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent-dark);
    font-size: 0.78rem;
    font-weight: 700;
}

.hero {
    position: relative;
    overflow: hidden;
    padding: 96px 0 88px;
    background:
        radial-gradient(circle at 90% 0%, rgba(91, 85, 215, 0.16), transparent 35%),
        radial-gradient(circle at 5% 60%, rgba(54, 169, 120, 0.09), transparent 30%);
}

.hero::before {
    position: absolute;
    top: 50px;
    left: 50%;
    width: 540px;
    height: 540px;
    border: 1px solid rgba(91, 85, 215, 0.08);
    border-radius: 50%;
    content: "";
    transform: translateX(22%);
}

.hero-grid {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.12fr) minmax(340px, 0.88fr);
    align-items: center;
    gap: 72px;
}

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

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1,
h2,
h3 {
    line-height: 1.16;
}

h1 {
    max-width: 690px;
    margin-bottom: 24px;
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    letter-spacing: -0.055em;
}

h2 {
    margin-bottom: 0;
    font-size: clamp(1.8rem, 3vw, 2.6rem);
    letter-spacing: -0.04em;
}

h3 {
    margin-bottom: 12px;
    font-size: 1.18rem;
}

.hero-copy {
    max-width: 640px;
    margin-bottom: 32px;
    color: var(--muted);
    font-size: 1.08rem;
}

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

.button {
    display: inline-flex;
    min-height: 46px;
    align-items: center;
    justify-content: center;
    padding: 10px 18px;
    border: 0;
    border-radius: 12px;
    background: var(--accent);
    box-shadow: 0 10px 22px rgba(91, 85, 215, 0.18);
    color: white;
    font-size: 0.92rem;
    font-weight: 750;
    text-decoration: none;
    transition: background 160ms ease, transform 160ms ease;
}

.button:hover {
    background: var(--accent-dark);
    transform: translateY(-1px);
}

.button-muted {
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.72);
    box-shadow: none;
    color: var(--muted);
    cursor: default;
}

.button-muted:hover {
    background: rgba(255, 255, 255, 0.72);
    transform: none;
}

.clip-preview {
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.85);
    border-radius: 24px;
    background: var(--surface);
    box-shadow: var(--shadow);
    transform: rotate(1.2deg);
}

.preview-video {
    position: relative;
    display: grid;
    min-height: 210px;
    place-items: center;
    background:
        linear-gradient(135deg, rgba(15, 18, 40, 0.34), rgba(15, 18, 40, 0.7)),
        linear-gradient(135deg, #7f78ed, #312b80);
}

.preview-video::before,
.preview-video::after {
    position: absolute;
    height: 4px;
    border-radius: 99px;
    background: rgba(255, 255, 255, 0.56);
    content: "";
}

.preview-video::before {
    right: 28px;
    bottom: 28px;
    width: 42%;
}

.preview-video::after {
    right: 28px;
    bottom: 18px;
    width: 30%;
}

.preview-play {
    display: grid;
    width: 70px;
    height: 70px;
    place-items: center;
    padding-left: 5px;
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    color: white;
    font-size: 1.25rem;
    backdrop-filter: blur(5px);
}

.preview-time {
    position: absolute;
    right: 20px;
    top: 18px;
    padding: 5px 9px;
    border-radius: 7px;
    background: rgba(12, 14, 32, 0.7);
    color: white;
    font-size: 0.75rem;
    font-variant-numeric: tabular-nums;
}

.preview-content {
    padding: 26px 28px 28px;
}

.preview-label,
.progress-caption {
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 0.77rem;
    font-weight: 700;
}

.japanese-text {
    margin-bottom: 9px;
    color: #12172d;
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1.55;
}

.translation {
    margin-bottom: 24px;
    color: var(--muted);
}

.progress-track {
    width: 100%;
    height: 7px;
    overflow: hidden;
    border-radius: 99px;
    background: #e8eaf2;
}

.progress-track span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--accent), #817bee);
}

.progress-caption {
    margin: 8px 0 0;
    text-align: right;
}

.section {
    padding: 90px 0 104px;
}

.section-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 40px;
    margin-bottom: 38px;
}

.section-heading > p {
    max-width: 430px;
    margin-bottom: 4px;
    color: var(--muted);
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.feature-card {
    padding: 26px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--surface);
    box-shadow: 0 12px 32px rgba(35, 40, 78, 0.05);
}

.feature-card p {
    margin-bottom: 0;
    color: var(--muted);
}

.feature-number {
    display: inline-block;
    margin-bottom: 30px;
    color: var(--accent);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.empty-page {
    display: grid;
    min-height: calc(100vh - 152px);
    place-items: center;
    padding: 70px 0;
}

.empty-card {
    max-width: 590px;
    margin: 0 auto;
    padding: 50px;
    border: 1px solid var(--border);
    border-radius: 24px;
    background: var(--surface);
    box-shadow: var(--shadow);
    text-align: center;
}

.empty-card h1 {
    margin-bottom: 14px;
    font-size: clamp(2rem, 5vw, 3.5rem);
}

.empty-card > p:not(.eyebrow) {
    margin-bottom: 26px;
    color: var(--muted);
}

.site-footer {
    padding: 26px 0;
    border-top: 1px solid var(--border);
    background: var(--surface);
    color: var(--muted);
    font-size: 0.82rem;
}

.site-footer p {
    margin: 0;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 18px;
}

.nav-link {
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 700;
    text-decoration: none;
}

.nav-link:hover {
    color: var(--accent);
}

.button-small {
    min-height: 38px;
    padding: 7px 14px;
    border-radius: 10px;
    font-size: 0.84rem;
}

.button-large {
    min-height: 52px;
    padding: 13px 22px;
}

.button-full {
    width: 100%;
}

button.button {
    font-family: inherit;
    cursor: pointer;
}

.dashboard-hero {
    padding: 72px 0 64px;
    border-bottom: 1px solid var(--border);
    background:
        radial-gradient(circle at 85% 10%, rgba(91, 85, 215, 0.18), transparent 30%),
        linear-gradient(180deg, #fafaff, #f5f6fb);
}

.dashboard-hero-inner {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 60px;
}

.dashboard-hero h1 {
    max-width: 760px;
    margin-bottom: 18px;
    font-size: clamp(2.5rem, 5vw, 4rem);
}

.dashboard-hero .hero-copy {
    margin-bottom: 0;
}

.dashboard-section {
    padding-top: 68px;
}

.empty-state {
    display: grid;
    min-height: 330px;
    place-items: center;
    padding: 56px 24px;
    border: 1px dashed #cfd3e2;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.58);
    text-align: center;
}

.empty-state-icon {
    display: grid;
    width: 62px;
    height: 62px;
    place-items: center;
    padding-left: 4px;
    border-radius: 20px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 1.15rem;
}

.empty-state h3 {
    margin: 18px 0 6px;
    font-size: 1.4rem;
}

.empty-state p {
    max-width: 520px;
    margin-bottom: 24px;
    color: var(--muted);
}

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

.project-card {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--surface);
    box-shadow: 0 14px 38px rgba(35, 40, 78, 0.07);
}

.project-thumbnail {
    position: relative;
    display: block;
    aspect-ratio: 16 / 8.5;
    overflow: hidden;
    background: #242745;
}

.project-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 220ms ease;
}

.project-thumbnail:hover img {
    transform: scale(1.025);
}

.thumbnail-play {
    position: absolute;
    left: 50%;
    top: 50%;
    display: grid;
    width: 52px;
    height: 52px;
    place-items: center;
    padding-left: 4px;
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: 50%;
    background: rgba(24, 32, 57, 0.72);
    color: white;
    transform: translate(-50%, -50%);
}

.project-card-body {
    padding: 24px;
}

.card-meta,
.chapter-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 700;
}

.project-card h3 {
    margin: 15px 0 8px;
    font-size: 1.35rem;
}

.project-card h3 a {
    text-decoration: none;
}

.project-card h3 a:hover {
    color: var(--accent);
}

.project-created {
    margin: 0 0 24px;
    color: var(--muted);
    font-size: 0.76rem;
}

.status-badge {
    display: inline-flex;
    padding: 4px 9px;
    border-radius: 999px;
    background: #eceef5;
    color: #5f6881;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

.status-ready,
.status-completed {
    background: #e4f7ef;
    color: #257a58;
}

.status-in_progress {
    background: #fff3cd;
    color: #8a6511;
}

.status-not_started {
    background: #eceef5;
    color: #5f6881;
}

.progress-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 9px;
    color: var(--muted);
    font-size: 0.84rem;
}

.progress-summary strong {
    color: var(--text);
}

.project-stats {
    display: flex;
    gap: 18px;
    margin: 20px 0;
    color: var(--muted);
    font-size: 0.78rem;
}

.project-stats strong {
    color: var(--text);
}

.page-section {
    min-height: calc(100vh - 152px);
    padding: 46px 0 92px;
}

.narrow-container {
    max-width: 980px;
}

.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 42px;
    color: var(--muted);
    font-size: 0.82rem;
}

.breadcrumbs a {
    color: var(--accent);
    font-weight: 700;
    text-decoration: none;
}

.page-heading {
    max-width: 780px;
    margin-bottom: 36px;
}

.page-heading h1,
.project-heading h1 {
    margin-bottom: 16px;
    font-size: clamp(2.25rem, 5vw, 3.8rem);
}

.page-heading > p:last-child,
.project-heading > div > p:last-child {
    color: var(--muted);
    font-size: 1.02rem;
}

.alert {
    margin-bottom: 24px;
    padding: 17px 20px;
    border-radius: 14px;
}

.alert ul {
    margin: 8px 0 0;
    padding-left: 20px;
}

.alert-error {
    border: 1px solid #efc5c9;
    background: #fff0f1;
    color: #9b303b;
}

.project-form {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 22px;
    background: var(--surface);
    box-shadow: 0 18px 46px rgba(35, 40, 78, 0.07);
}

.form-section {
    padding: 32px;
    border-bottom: 1px solid var(--border);
}

.form-section-heading {
    display: flex;
    align-items: start;
    gap: 16px;
    margin-bottom: 26px;
}

.form-section-heading > span {
    display: grid;
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 11px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 0.8rem;
    font-weight: 800;
}

.form-section-heading h2 {
    margin-bottom: 5px;
    font-size: 1.35rem;
}

.form-section-heading p {
    margin: 0;
    color: var(--muted);
    font-size: 0.88rem;
}

.form-section-heading code,
.empty-card code {
    padding: 2px 5px;
    border-radius: 5px;
    background: #eef0f6;
    color: #464f68;
    font-size: 0.82em;
}

.field-grid,
.subtitle-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.field label {
    display: block;
    margin-bottom: 8px;
    color: var(--text);
    font-size: 0.84rem;
    font-weight: 800;
}

.field input,
.field textarea {
    width: 100%;
    border: 1px solid #d6d9e5;
    border-radius: 11px;
    outline: none;
    background: #fbfcff;
    color: var(--text);
    font: inherit;
    transition: border-color 150ms ease, box-shadow 150ms ease;
}

.field input {
    min-height: 48px;
    padding: 10px 13px;
}

.field textarea {
    min-height: 330px;
    padding: 14px;
    line-height: 1.62;
    resize: vertical;
}

.field textarea[lang="ja"] {
    font-size: 1rem;
}

.field input:focus,
.field textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(91, 85, 215, 0.12);
}

.field input[aria-invalid="true"],
.field textarea[aria-invalid="true"] {
    border-color: #d85d69;
}

.field-error {
    margin: 7px 0 0;
    color: #ad3440;
    font-size: 0.79rem;
    font-weight: 650;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 22px 32px;
    background: #fafbfe;
}

.project-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 40px;
    margin-bottom: 38px;
}

.project-heading > div {
    max-width: 760px;
}

.project-heading .card-meta {
    justify-content: flex-start;
    margin-bottom: 15px;
}

.project-overview {
    display: grid;
    grid-template-columns: minmax(0, 1.65fr) minmax(280px, 0.65fr);
    gap: 24px;
    margin-bottom: 70px;
}

.video-frame {
    overflow: hidden;
    border-radius: 20px;
    background: #16192b;
    box-shadow: var(--shadow);
}

.video-frame iframe {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    border: 0;
}

.progress-card {
    padding: 28px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--surface);
    box-shadow: 0 14px 38px rgba(35, 40, 78, 0.07);
}

.progress-number {
    display: block;
    margin-bottom: 2px;
    font-size: 3.5rem;
    letter-spacing: -0.06em;
}

.progress-card > p:not(.eyebrow) {
    color: var(--muted);
}

.progress-card .progress-note {
    margin: 20px 0 0;
    font-size: 0.78rem;
}

.chapter-section .section-heading {
    margin-bottom: 28px;
}

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

.chapter-row {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) auto;
    align-items: center;
    gap: 20px;
    padding: 21px 22px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--surface);
}

.chapter-row-completed {
    border-color: #b8e5d1;
    background: #fbfffd;
}

.chapter-row-next {
    border-color: #c8c4f3;
    box-shadow: 0 0 0 2px rgba(91, 85, 215, 0.06);
}

.next-chapter-badge {
    padding: 3px 8px;
    border-radius: 999px;
    background: #fff3cd;
    color: #8a6511;
    font-size: 0.68rem;
    font-weight: 800;
    white-space: nowrap;
}

.chapter-order {
    display: grid;
    width: 44px;
    height: 44px;
    place-items: center;
    border-radius: 13px;
    background: var(--accent-soft);
    color: var(--accent);
    font-weight: 850;
}

.chapter-copy h3 {
    margin: 7px 0 4px;
    font-size: 1.08rem;
    line-height: 1.5;
}

.chapter-copy > p {
    margin-bottom: 0;
    color: var(--muted);
    font-size: 0.88rem;
}

.chapter-meta {
    justify-content: flex-start;
}

.chapter-coming-soon {
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 700;
    white-space: nowrap;
}

@media (max-width: 850px) {
    .dashboard-hero-inner,
    .project-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .project-grid,
    .project-overview {
        grid-template-columns: 1fr;
    }

    .subtitle-grid,
    .field-grid {
        grid-template-columns: 1fr;
    }

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

    .chapter-coming-soon {
        grid-column: 2;
    }
}

@media (max-width: 540px) {
    .nav-link {
        display: none;
    }

    .dashboard-hero {
        padding: 52px 0;
    }

    .dashboard-hero h1 {
        font-size: 2.55rem;
    }

    .form-section {
        padding: 24px 20px;
    }

    .form-actions {
        align-items: stretch;
        flex-direction: column-reverse;
        padding: 20px;
    }

    .chapter-row {
        grid-template-columns: 38px minmax(0, 1fr);
        gap: 14px;
        padding: 18px 16px;
    }

    .chapter-order {
        width: 38px;
        height: 38px;
    }
}

@media (max-width: 850px) {
    .hero {
        padding: 70px 0;
    }

    .hero-grid {
        grid-template-columns: 1fr;
        gap: 50px;
    }

    .clip-preview {
        max-width: 560px;
        transform: none;
    }

    .section-heading {
        display: block;
    }

    .section-heading > p {
        margin-top: 16px;
    }

    .feature-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 540px) {
    .container {
        width: min(100% - 28px, 1120px);
    }

    .phase-badge {
        display: none;
    }

    .hero {
        padding: 54px 0 62px;
    }

    h1 {
        font-size: 2.55rem;
    }

    .hero-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .preview-video {
        min-height: 175px;
    }

    .preview-content,
    .feature-card {
        padding: 22px;
    }

    .section {
        padding: 68px 0 76px;
    }

    .empty-card {
        padding: 36px 22px;
    }
}

.alert-success {
    border: 1px solid #b8e5d1;
    background: #e8f8f1;
    color: #246d51;
}

.alert-warning {
    border: 1px solid #ecd98e;
    background: #fff8dc;
    color: #765a0b;
}

.openrouter-warning {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.chapter-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 32px;
    margin-bottom: 34px;
}

.chapter-heading h1 {
    margin-bottom: 8px;
    font-size: clamp(2.35rem, 5vw, 4.25rem);
}

.chapter-heading-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--muted);
    font-size: 0.88rem;
    font-weight: 700;
}

.difficulty-badge {
    padding: 3px 8px;
    border-radius: 7px;
    background: var(--accent-soft);
    color: var(--accent-dark);
    font-size: 0.74rem;
}

.chapter-study-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    align-items: start;
    gap: 28px;
}

.study-main {
    display: grid;
    gap: 28px;
}

.study-card,
.lesson-empty,
.vocabulary-card,
.grammar-card,
.exercise-card {
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--surface);
    box-shadow: 0 12px 34px rgba(35, 40, 78, 0.055);
}

.study-card {
    padding: 28px;
}

.section-kicker {
    margin-bottom: 8px;
    color: var(--accent);
    font-size: 0.72rem;
    font-weight: 850;
    letter-spacing: 0.11em;
    text-transform: uppercase;
}

.chapter-japanese {
    margin-bottom: 24px;
    color: #12172d;
    font-size: clamp(1.65rem, 3.5vw, 2.35rem);
    font-weight: 750;
    line-height: 1.62;
}

.subtitle-card-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 8px;
}

.subtitle-card-heading .section-kicker {
    margin-bottom: 0;
}

.tts-button {
    display: inline-flex;
    min-height: 36px;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 6px 10px;
    border: 1px solid #d9d6ff;
    border-radius: 10px;
    background: var(--accent-soft);
    color: var(--accent-dark);
    font: inherit;
    font-size: 0.75rem;
    font-weight: 800;
    cursor: pointer;
    transition: border-color 150ms ease, background 150ms ease, transform 150ms ease;
}

.tts-button:hover:not(:disabled) {
    border-color: #b8b3f4;
    background: #e4e2ff;
    transform: translateY(-1px);
}

.tts-button.is-speaking {
    border-color: #9fd8c0;
    background: #e4f7ef;
    color: #257a58;
}

.tts-button:disabled {
    border-color: var(--border);
    background: #f1f2f6;
    color: var(--muted);
    cursor: not-allowed;
}

.vocabulary-tts {
    margin-top: 17px;
}

.translation-toggle {
    padding-top: 18px;
    border-top: 1px solid var(--border);
}

.translation-toggle summary,
.answer-reveal summary {
    color: var(--accent);
    font-size: 0.85rem;
    font-weight: 800;
    cursor: pointer;
}

.translation-toggle p {
    margin: 14px 0 0;
    color: var(--muted);
}

.lesson-empty {
    display: grid;
    min-height: 290px;
    place-items: center;
    padding: 44px 28px;
    text-align: center;
}

.lesson-empty-icon {
    display: grid;
    width: 58px;
    height: 58px;
    place-items: center;
    border-radius: 18px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 1.3rem;
    font-weight: 850;
}

.lesson-empty h2 {
    margin: 16px 0 8px;
    font-size: 1.4rem;
}

.lesson-empty p {
    max-width: 560px;
    margin-bottom: 22px;
    color: var(--muted);
}

.lesson-summary > p:last-child {
    margin-bottom: 0;
    font-size: 1.02rem;
}

.lesson-section {
    display: grid;
    gap: 18px;
}

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

.lesson-section-heading h2 {
    font-size: 1.65rem;
}

.lesson-section-heading > span {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 750;
}

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

.vocabulary-card,
.grammar-card,
.exercise-card {
    padding: 23px;
}

.lesson-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 14px;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 750;
}

.importance {
    padding: 3px 7px;
    border-radius: 7px;
    background: #eef0f5;
}

.importance-essential {
    background: #fce7e9;
    color: #a63843;
}

.importance-normal {
    background: var(--accent-soft);
    color: var(--accent-dark);
}

.importance-optional {
    background: #eef0f5;
    color: #66708c;
}

.vocabulary-card h3,
.grammar-card h3 {
    margin-bottom: 2px;
    font-size: 1.55rem;
}

.reading {
    margin-bottom: 13px;
    color: var(--muted);
    font-size: 0.9rem;
}

.meaning {
    margin-bottom: 10px;
    font-weight: 800;
}

.lemma {
    margin-bottom: 12px;
    color: var(--muted);
    font-size: 0.76rem;
}

.lesson-explanation {
    margin-bottom: 0;
    color: var(--muted);
    font-size: 0.86rem;
}

.grammar-list,
.exercise-list {
    display: grid;
    gap: 15px;
}

.grammar-title {
    margin-bottom: 12px;
    color: var(--accent-dark);
    font-size: 0.86rem;
    font-weight: 800;
}

.video-example {
    display: grid;
    gap: 4px;
    margin: 17px 0 13px;
    padding: 13px 15px;
    border-left: 3px solid var(--accent);
    border-radius: 0 10px 10px 0;
    background: #f6f5ff;
}

.video-example-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.video-example-heading > span {
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.video-example strong {
    font-size: 1.05rem;
}

.muted-copy {
    margin: 0;
    color: var(--muted);
}

.exercise-number {
    color: var(--accent);
    font-size: 0.7rem;
    font-weight: 850;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.exercise-card h3 {
    margin: 9px 0 15px;
    font-size: 1.06rem;
}

.exercise-question-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.exercise-question-heading h3 {
    flex: 1;
}

.exercise-options {
    display: grid;
    gap: 7px;
    margin: 0 0 18px;
    padding-left: 28px;
    color: #39415b;
}

.exercise-options li {
    padding-left: 5px;
}

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

.tts-button-compact {
    flex: 0 0 auto;
    min-height: 30px;
    padding: 4px 8px;
    font-size: 0.68rem;
}

.answer-reveal {
    padding-top: 14px;
    border-top: 1px solid var(--border);
}

.answer-reveal strong {
    display: block;
    margin-top: 12px;
    color: var(--green);
}

.answer-reveal p {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 0.84rem;
}

.study-sidebar {
    position: sticky;
    top: 22px;
    display: grid;
    gap: 13px;
}

.completion-card {
    display: grid;
    gap: 13px;
    padding: 22px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--surface);
    box-shadow: 0 12px 34px rgba(35, 40, 78, 0.055);
}

.completion-card .section-kicker,
.completion-card p,
.completion-card h2 {
    margin: 0;
}

.completion-card h2 {
    font-size: 1.25rem;
}

.completion-card > .status-badge {
    justify-self: start;
}

.completion-card > p:not(.section-kicker) {
    color: var(--muted);
    font-size: 0.84rem;
}

.completion-card .completion-finished {
    color: var(--green);
    font-weight: 800;
}

.completion-card form {
    margin: 0;
}

.chapter-video {
    border-radius: 16px;
    box-shadow: 0 14px 38px rgba(35, 40, 78, 0.11);
}

.chapter-navigation {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-top: 48px;
    padding-top: 26px;
    border-top: 1px solid var(--border);
}

@media (max-width: 980px) {
    .chapter-study-grid {
        grid-template-columns: 1fr;
    }

    .study-sidebar {
        position: static;
        grid-row: 1;
    }

    .chapter-video {
        max-width: 680px;
    }
}

@media (max-width: 700px) {
    .chapter-heading,
    .lesson-section-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .vocabulary-grid {
        grid-template-columns: 1fr;
    }

    .openrouter-warning {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (max-width: 540px) {
    .study-card,
    .vocabulary-card,
    .grammar-card,
    .exercise-card {
        padding: 21px;
    }

    .chapter-navigation {
        align-items: stretch;
        flex-direction: column;
    }

    .chapter-navigation .button {
        width: 100%;
    }
}
