:root {
    --ink: #17212b;
    --muted: #66717d;
    --paper: #f4f7fb;
    --panel: #ffffff;
    --line: #dfe5ec;
    --primary: #6558d3;
    --primary-deep: #473aa5;
    --primary-soft: #efedff;
    --accent: #ff7455;
    --green: #16845b;
    --green-soft: #e8f7ef;
    --red: #c54444;
    --red-soft: #fff0ef;
    --shadow: 0 18px 50px rgba(32, 44, 59, 0.09);
    --shadow-small: 0 8px 24px rgba(32, 44, 59, 0.08);
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    font-size: 16px;
}

body {
    min-width: 320px;
    min-height: 100vh;
    margin: 0;
    overflow-x: hidden;
    color: var(--ink);
    background:
        radial-gradient(circle at 10% -10%, rgba(101, 88, 211, 0.09), transparent 32rem),
        radial-gradient(circle at 95% 10%, rgba(255, 116, 85, 0.08), transparent 30rem),
        var(--paper);
    font-family: "Segoe UI", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

button,
input,
textarea,
select {
    font: inherit;
}

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

a {
    color: inherit;
}

[hidden] {
    display: none !important;
}

.page-shell {
    width: min(1380px, calc(100% - 3rem));
    margin: 0 auto;
    padding: 1.5rem 0 3rem;
}

.language-theme {
    --primary: #6558d3;
    --primary-deep: #473aa5;
    --primary-soft: #efedff;
    --accent: #ff7455;
}

.theme-india {
    --primary: #12845b;
    --primary-deep: #075e46;
    --primary-soft: #eaf7f0;
    --accent: #f28c28;
}

.theme-korea {
    --primary: #145aa8;
    --primary-deep: #0e3b73;
    --primary-soft: #edf4fc;
    --accent: #d83d4a;
}

.theme-world {
    --primary: #6558d3;
    --primary-deep: #473aa5;
    --primary-soft: #efedff;
    --accent: #ff7455;
}

.brand-mark {
    display: inline-flex;
    width: 3rem;
    height: 3rem;
    align-items: center;
    justify-content: center;
    border-radius: 1rem;
    background: var(--ink);
    color: white;
    font-size: 1.15rem;
    font-weight: 900;
    letter-spacing: -0.05em;
    transform: rotate(-4deg);
}

.brand-mark-small {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.7rem;
    background: var(--primary);
    font-size: 0.9rem;
}

.brand-link {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    font-weight: 850;
    letter-spacing: -0.02em;
    text-decoration: none;
}

.top-nav,
.top-nav-actions,
.section-heading,
.practice-heading,
.practice-direction,
.card-actions,
.form-actions,
.answer-actions,
.result-heading,
.type-card-heading,
.keyboard-heading,
.keyboard-footer,
.report-row,
.auto-advance-heading,
.language-card-top,
.learning-section-heading {
    display: flex;
    align-items: center;
}

.top-nav,
.section-heading,
.practice-heading,
.practice-direction,
.type-card-heading,
.keyboard-heading,
.report-row,
.auto-advance-heading,
.language-card-top {
    justify-content: space-between;
}

.top-nav {
    min-height: 3rem;
    margin-bottom: 1.15rem;
}

.top-nav-actions,
.card-actions,
.form-actions,
.answer-actions,
.keyboard-footer {
    gap: 0.75rem;
}

.top-nav-actions {
    flex-wrap: wrap;
}

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

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

.eyebrow,
.card-kicker,
.prompt-label {
    margin: 0 0 0.55rem;
    color: var(--primary);
    font-size: 0.7rem;
    font-weight: 850;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.hero-copy {
    max-width: 620px;
    margin: 1rem 0 0;
    color: var(--muted);
    font-size: 1rem;
    line-height: 1.65;
}

.button,
.keyboard-control,
.icon-link {
    display: inline-flex;
    min-height: 2.9rem;
    align-items: center;
    justify-content: center;
    padding: 0.72rem 1.05rem;
    border: 1px solid transparent;
    border-radius: 0.9rem;
    cursor: pointer;
    font-size: 0.88rem;
    font-weight: 800;
    text-decoration: none;
    transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease, border-color 160ms ease;
}

.button:hover,
.keyboard-control:hover,
.icon-link:hover {
    transform: translateY(-2px);
}

.button:focus-visible,
.keyboard-control:focus-visible,
.icon-link:focus-visible,
a:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--primary) 25%, transparent);
    outline-offset: 2px;
}

.button-primary {
    background: var(--primary);
    box-shadow: 0 7px 16px color-mix(in srgb, var(--primary) 22%, transparent);
    color: white;
}

.button-primary:hover {
    background: var(--primary-deep);
}

.button-secondary,
.keyboard-control {
    border-color: var(--line);
    background: white;
    color: var(--ink);
}

.button-compact {
    min-height: 2.45rem;
    padding: 0.5rem 0.85rem;
    border-radius: 0.75rem;
}

.empty-state,
.muted-copy {
    color: var(--muted);
}

.empty-state {
    padding: 2rem;
    border: 1px dashed var(--line);
    border-radius: 1.2rem;
    text-align: center;
}

.empty-state h3,
.empty-state p {
    margin: 0;
}

/* Welcome dashboard */
.welcome-shell {
    display: grid;
    gap: 1.25rem;
    padding-top: 1.25rem;
}

.welcome-hero {
    position: relative;
    display: grid;
    min-height: 330px;
    overflow: hidden;
    grid-template-columns: 1.05fr 0.95fr;
    border-radius: 2rem;
    background: #1c2633;
    box-shadow: var(--shadow);
    color: white;
}

.welcome-hero > * {
    min-width: 0;
}

.welcome-hero::before {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(120deg, transparent 0 58%, rgba(255, 255, 255, 0.05) 58% 59%, transparent 59%),
        radial-gradient(circle at 82% 34%, rgba(242, 140, 40, 0.32), transparent 16rem),
        radial-gradient(circle at 62% 115%, rgba(31, 136, 99, 0.42), transparent 21rem);
    content: "";
}

.hero-copy-panel {
    position: relative;
    z-index: 1;
    align-self: center;
    padding: 2.35rem 1rem 2.35rem clamp(2rem, 5vw, 4.5rem);
}

.hero-copy-panel .brand-mark {
    margin-bottom: 1.25rem;
    background: white;
    color: var(--ink);
}

.hero-copy-panel .eyebrow {
    color: #98e4c7;
}

.hero-copy-panel h1 {
    margin: 0;
    font-size: clamp(2.9rem, 4.2vw, 4.9rem);
    font-weight: 860;
    line-height: 0.91;
    letter-spacing: -0.065em;
    overflow-wrap: anywhere;
}

.hero-copy-panel h1 span {
    color: #ffad55;
}

.hero-copy-panel .hero-copy {
    max-width: 500px;
    margin-top: 1rem;
    color: #c8d0d9;
}

.hero-language-cloud {
    position: relative;
    z-index: 1;
    min-height: 330px;
}

.script-orbit {
    position: absolute;
    display: grid;
    min-width: 155px;
    gap: 0.2rem;
    padding: 1rem 1.2rem;
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 1.25rem;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.18);
    backdrop-filter: blur(10px);
}

.script-orbit span {
    font-family: "Segoe UI", "Noto Sans", sans-serif;
    font-size: 1.85rem;
    font-weight: 750;
}

.script-orbit small {
    color: rgba(255, 255, 255, 0.68);
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.orbit-hindi {
    top: 2.8rem;
    right: 20%;
    background: rgba(16, 128, 88, 0.88);
    transform: rotate(4deg);
}

.orbit-korean {
    top: 8.9rem;
    right: 6%;
    background: rgba(20, 90, 168, 0.88);
    transform: rotate(-5deg);
}

.orbit-marathi {
    right: 32%;
    bottom: 2rem;
    background: rgba(226, 113, 34, 0.9);
    transform: rotate(-2deg);
}

.hero-spark {
    position: absolute;
    color: #ffc166;
}

.spark-one {
    top: 3rem;
    right: 5%;
    font-size: 2.2rem;
}

.spark-two {
    right: 21%;
    bottom: 2.6rem;
    color: #70d6b1;
    font-size: 0.75rem;
}

.language-dashboard {
    display: grid;
    gap: 0.9rem;
}

.dashboard-heading h2,
.section-heading h2,
.history-panel h2,
.report-panel h2 {
    margin: 0;
    font-size: clamp(1.45rem, 2.2vw, 2.2rem);
    font-weight: 830;
    letter-spacing: -0.045em;
}

.dashboard-heading .eyebrow {
    margin-bottom: 0.25rem;
}

.collection-count,
.language-pill,
.count-pill,
.focus-label {
    display: inline-flex;
    min-height: 2rem;
    align-items: center;
    padding: 0.4rem 0.75rem;
    border-radius: 999px;
    background: white;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 800;
    white-space: nowrap;
}

.language-grid,
.type-grid,
.stat-cards,
.form-grid,
.report-grid {
    display: grid;
    gap: 1rem;
}

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

.language-card {
    --primary: #6558d3;
    --primary-deep: #473aa5;
    --primary-soft: #efedff;
    --accent: #ff7455;
    position: relative;
    display: grid;
    min-height: 235px;
    overflow: hidden;
    gap: 0.75rem;
    padding: 1.25rem;
    border: 1px solid color-mix(in srgb, var(--primary) 15%, var(--line));
    border-radius: 1.4rem;
    background:
        radial-gradient(circle at 90% 0, color-mix(in srgb, var(--accent) 14%, transparent), transparent 9rem),
        white;
    box-shadow: var(--shadow-small);
}

.language-card.theme-india {
    --primary: #12845b;
    --primary-deep: #075e46;
    --primary-soft: #eaf7f0;
    --accent: #f28c28;
}

.language-card.theme-korea {
    --primary: #145aa8;
    --primary-deep: #0e3b73;
    --primary-soft: #edf4fc;
    --accent: #d83d4a;
}

.language-emblem {
    display: inline-flex;
    width: 2.7rem;
    height: 2.7rem;
    align-items: center;
    justify-content: center;
    border-radius: 0.85rem;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 1.25rem;
    font-weight: 850;
}

.language-arrow {
    color: var(--accent);
    font-size: 1.3rem;
}

.language-card-copy {
    align-self: end;
}

.language-card .card-kicker {
    margin-bottom: 0.15rem;
}

.language-card h3 {
    margin: 0;
    font-size: 2rem;
    font-weight: 860;
    letter-spacing: -0.055em;
}

.native-greeting {
    margin: 0.1rem 0 0;
    color: var(--muted);
    font-size: 0.9rem;
}

.language-card .card-actions {
    align-self: end;
}

.language-card .button-primary {
    flex: 1;
    justify-content: space-between;
}

.icon-link {
    width: 2.9rem;
    flex: 0 0 2.9rem;
    padding: 0;
    border-color: var(--line);
    background: white;
    color: var(--muted);
}

/* Shared panels and forms */
.practice-panel,
.history-panel,
.form-panel,
.report-panel,
.content-section,
.stat-card,
.type-card {
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.94);
    box-shadow: var(--shadow-small);
}

.practice-panel,
.history-panel,
.form-panel,
.report-panel,
.content-section {
    padding: clamp(1.15rem, 2.3vw, 2rem);
    border-radius: 1.5rem;
}

.form-panel {
    padding: clamp(1.25rem, 3vw, 2.8rem);
}

.form-hero,
.stats-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 2rem;
}

.form-hero {
    margin-bottom: 1.5rem;
}

.form-panel h1,
.stats-heading h1 {
    margin: 0;
    font-size: clamp(2.5rem, 5vw, 4.75rem);
    font-weight: 870;
    line-height: 0.96;
    letter-spacing: -0.065em;
}

.form-hero-glyph {
    display: inline-flex;
    width: 5rem;
    height: 5rem;
    flex: 0 0 5rem;
    align-items: center;
    justify-content: center;
    border-radius: 1.5rem;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 2rem;
    font-weight: 800;
    transform: rotate(5deg);
}

.learning-form {
    display: grid;
    gap: 1rem;
}

.learning-section {
    display: grid;
    gap: 1rem;
    padding: 1.25rem;
    border: 1px solid var(--line);
    border-radius: 1.15rem;
    background: #fbfcfe;
}

.learning-section-heading {
    align-items: flex-start;
    gap: 0.8rem;
}

.learning-section-heading h2 {
    margin: 0;
    font-size: 1.05rem;
}

.learning-section-heading h2 em {
    color: var(--muted);
    font-size: 0.8rem;
    font-style: normal;
    font-weight: 600;
}

.learning-section-heading p {
    margin: 0.25rem 0 0;
    color: var(--muted);
    font-size: 0.78rem;
    line-height: 1.45;
}

.step-badge {
    display: inline-flex;
    min-width: 2.25rem;
    height: 2.25rem;
    align-items: center;
    justify-content: center;
    padding: 0 0.45rem;
    border-radius: 0.7rem;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 0.68rem;
    font-weight: 900;
}

.form-grid.two-columns {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-grid.three-columns {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

label {
    display: grid;
    gap: 0.45rem;
    color: #47525e;
    font-size: 0.79rem;
    font-weight: 780;
}

label em {
    color: var(--muted);
    font-style: normal;
    font-weight: 500;
}

input,
textarea,
select {
    width: 100%;
    border: 1px solid #d8dfe8;
    border-radius: 0.78rem;
    background: white;
    color: var(--ink);
    outline: none;
    padding: 0.75rem 0.85rem;
}

textarea {
    resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 13%, transparent);
}

.checkbox-label {
    display: flex;
    min-height: 2.65rem;
    align-items: center;
    align-self: end;
    gap: 0.65rem;
    padding: 0.65rem 0.75rem;
    border: 1px solid #d8dfe8;
    border-radius: 0.78rem;
    background: white;
}

.checkbox-label input {
    width: auto;
    accent-color: var(--primary);
}

.variant-section {
    border-top: 1px solid var(--line);
}

.primary-form-actions {
    position: sticky;
    z-index: 2;
    bottom: 0.5rem;
    padding: 0.75rem;
    border: 1px solid rgba(223, 229, 236, 0.86);
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: var(--shadow-small);
    backdrop-filter: blur(12px);
}

.bulk-import-section {
    margin-top: 1.25rem;
}

.bulk-guidance {
    display: grid;
    gap: 0.4rem;
}

.bulk-format {
    margin: 0;
    overflow-x: auto;
    color: var(--primary);
    font-size: 0.72rem;
    line-height: 1.5;
}

.bulk-format code {
    white-space: nowrap;
}

.bulk-form {
    margin-top: 0;
}

.bulk-import-errors {
    display: grid;
    gap: 0.35rem;
    margin: 0;
    padding: 0.8rem 1rem 0.8rem 2rem;
    border: 1px solid #e7aaa3;
    border-radius: 0.75rem;
    background: var(--red-soft);
    color: #922e26;
    font-size: 0.8rem;
}

.field-help {
    margin: 0;
    color: var(--muted);
    font-size: 0.76rem;
    line-height: 1.5;
}

.form-status {
    min-height: 1.2rem;
    color: var(--green);
    font-size: 0.85rem;
}

.error-message {
    color: var(--red);
}

/* Practice */
.practice-layout {
    display: grid;
    min-width: 0;
    grid-template-columns: minmax(0, 1fr) minmax(310px, 0.38fr);
    gap: 1rem;
}

.practice-panel {
    min-width: 0;
}

.practice-heading {
    gap: 1rem;
    margin-bottom: 0.8rem;
}

.practice-heading h1 {
    margin: 0;
    font-size: clamp(2.25rem, 4vw, 4.2rem);
    font-weight: 870;
    line-height: 0.95;
    letter-spacing: -0.065em;
}

.practice-heading h1 span,
.stats-heading h1 span {
    color: var(--primary);
}

.language-pill {
    background: var(--primary-soft);
    color: var(--primary-deep);
    text-transform: capitalize;
}

.practice-direction {
    min-height: 2.7rem;
    margin-bottom: 0.8rem;
    padding: 0.55rem 0.7rem;
    border-radius: 0.8rem;
    background: #f7f9fb;
}

.direction-summary {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin: 0;
    font-size: 0.78rem;
}

.direction-summary strong {
    color: var(--ink);
}

.direction-arrow {
    color: var(--primary);
    font-size: 1rem;
    font-weight: 900;
}

.focus-label {
    min-height: 1.75rem;
    background: white;
    font-size: 0.65rem;
}

.prompt-card {
    position: relative;
    display: flex;
    min-height: 210px;
    align-items: center;
    justify-content: space-between;
    overflow: hidden;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: clamp(1.35rem, 3.5vw, 2.6rem);
    border-radius: 1.4rem;
    background:
        linear-gradient(135deg, var(--primary-soft), color-mix(in srgb, var(--accent) 7%, white));
}

.prompt-card::after {
    position: absolute;
    width: 12rem;
    height: 12rem;
    right: -4rem;
    bottom: -6rem;
    border: 1.8rem solid color-mix(in srgb, var(--accent) 14%, transparent);
    border-radius: 50%;
    content: "";
}

.prompt-card > div {
    position: relative;
    z-index: 1;
    min-width: 0;
}

.prompt-text {
    margin: 0;
    font-family: "Segoe UI", "Noto Sans", sans-serif;
    font-size: clamp(2.4rem, 5.5vw, 5rem);
    font-weight: 760;
    line-height: 1.1;
    letter-spacing: -0.035em;
    overflow-wrap: anywhere;
}

.prompt-glyph {
    position: relative;
    z-index: 1;
    display: inline-flex;
    width: 6.8rem;
    height: 6.8rem;
    flex: 0 0 6.8rem;
    align-items: center;
    justify-content: center;
    border: 1px solid color-mix(in srgb, var(--primary) 18%, transparent);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.62);
    color: var(--primary);
    font-size: 2.6rem;
    font-weight: 800;
}

.new-prompt-panel,
.reveal-panel {
    display: grid;
    gap: 0.85rem;
    margin-bottom: 1rem;
    padding: 1.1rem;
    border: 1px solid color-mix(in srgb, var(--primary) 22%, var(--line));
    border-radius: 1rem;
    background: var(--primary-soft);
}

.new-prompt-panel h2,
.reveal-panel h2 {
    margin: 0;
    font-size: 1.35rem;
}

.new-prompt-panel p:not(.eyebrow),
.reveal-panel p:not(.eyebrow) {
    margin: 0;
}

.reveal-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.reveal-badge {
    flex-shrink: 0;
    padding: 0.35rem 0.6rem;
    border-radius: 999px;
    background: color-mix(in srgb, var(--primary) 14%, white);
    color: var(--primary-deep);
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
}

.reveal-grid {
    display: grid;
    gap: 0.7rem;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.reveal-card {
    display: grid;
    align-content: start;
    gap: 0.5rem;
    min-width: 0;
    padding: 0.85rem;
    border: 1px solid color-mix(in srgb, var(--primary) 16%, var(--line));
    border-radius: 0.8rem;
    background: rgba(255, 255, 255, 0.72);
}

.reveal-label {
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
}

.reveal-values {
    display: grid;
    gap: 0.35rem;
}

.reveal-value {
    color: var(--ink);
    font-family: Georgia, "Noto Sans", serif;
    font-size: 1.1rem;
    overflow-wrap: anywhere;
}

.reveal-value-empty {
    color: var(--muted);
    font-family: inherit;
    font-size: 0.82rem;
}

.answer-form {
    display: grid;
    gap: 0.55rem;
}

.answer-form[data-first-exposure="true"] {
    display: none;
}

.answer-form label {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
    color: var(--ink);
}

.answer-target {
    color: var(--primary-deep);
    font-size: 0.74rem;
    font-weight: 800;
}

.answer-form input {
    min-height: 3.45rem;
    font-size: 1.18rem;
}

.answer-actions {
    flex-wrap: wrap;
}

.answer-actions .button-primary {
    min-width: 155px;
    justify-content: space-between;
}

.history-panel {
    min-width: 0;
}

.compact-heading {
    align-items: flex-start;
    margin-bottom: 1rem;
}

.count-pill {
    background: var(--primary-soft);
    color: var(--primary-deep);
}

.history-list {
    display: grid;
    max-height: 640px;
    gap: 0.6rem;
    overflow-y: auto;
    padding-right: 0.25rem;
}

.history-item {
    padding: 0.75rem;
    border: 1px solid var(--line);
    border-left: 4px solid var(--muted);
    border-radius: 0.75rem;
    background: #fafbfd;
}

.history-item.correct-history {
    border-left-color: var(--green);
}

.history-item.incorrect-history {
    border-left-color: var(--red);
}

.history-item strong,
.history-item span,
.history-item small {
    display: block;
}

.history-item strong {
    overflow-wrap: anywhere;
}

.history-item span,
.history-item small {
    margin-top: 0.22rem;
    color: var(--muted);
    font-size: 0.72rem;
    line-height: 1.4;
}

.keyboard-panel,
.result-panel {
    margin-top: 1rem;
    padding: 1rem;
    border: 1px solid var(--line);
    border-radius: 1rem;
    background: #f9fafc;
}

.keyboard-heading {
    align-items: flex-start;
    gap: 1rem;
}

.virtual-keyboard {
    display: grid;
    gap: 0.4rem;
    margin-top: 0.8rem;
}

.keyboard-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.32rem;
}

.keyboard-key {
    min-width: 2.2rem;
    min-height: 2.2rem;
    padding: 0.3rem;
    border: 1px solid #d8dfe8;
    border-radius: 0.45rem;
    background: white;
    color: var(--ink);
    cursor: pointer;
    font-family: "Segoe UI", "Noto Sans", sans-serif;
    font-size: 1rem;
}

.keyboard-key:hover,
.keyboard-key:focus {
    border-color: var(--primary);
    background: var(--primary-soft);
}

.keyboard-footer {
    margin-top: 0.5rem;
}

.keyboard-space {
    flex: 1;
}

.result-panel.correct-result {
    border-color: #a6d4be;
    background: var(--green-soft);
}

.result-panel.incorrect-result {
    border-color: #e2b0aa;
    background: var(--red-soft);
}

.result-heading {
    gap: 0.6rem;
}

.result-heading h2 {
    margin: 0;
    font-size: 1.25rem;
}

.result-panel p {
    margin: 0.65rem 0 0;
    line-height: 1.5;
}

.answer-comparison {
    display: grid;
    gap: 0.55rem;
    margin-top: 0.85rem;
}

.answer-comparison-row {
    display: grid;
    gap: 0.25rem;
    padding: 0.75rem 0.85rem;
    border: 1px solid rgba(15, 35, 54, 0.12);
    border-radius: 0.7rem;
    background: rgba(255, 255, 255, 0.64);
}

.answer-comparison-row span {
    color: var(--muted);
    font-size: 0.67rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.answer-comparison-row strong {
    overflow-wrap: anywhere;
}

.expected-comparison {
    border-color: color-mix(in srgb, var(--primary) 28%, transparent);
    background: rgba(255, 255, 255, 0.82);
}

.expected-comparison strong,
.usage-note {
    color: var(--primary-deep);
}

.alternate-answer-action {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.55rem 0.75rem;
    margin-top: 0.85rem;
    padding-top: 0.85rem;
    border-top: 1px solid rgba(15, 35, 54, 0.14);
}

.alternate-answer-action p {
    flex: 1 0 100%;
    margin: 0;
    color: var(--muted);
    font-size: 0.8rem;
}

.form-status-success {
    color: var(--green);
}

.form-status-error {
    color: var(--red);
}

.auto-advance {
    margin-top: 1rem;
    padding-top: 0.85rem;
    border-top: 1px solid rgba(15, 35, 54, 0.14);
}

.auto-advance-track {
    height: 0.4rem;
    overflow: hidden;
    margin-top: 0.55rem;
    border-radius: 99px;
    background: rgba(15, 35, 54, 0.12);
}

.auto-advance-track span {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: inherit;
    background: var(--primary);
    transition: width 0.9s linear;
}

.auto-advance p {
    color: var(--muted);
    font-size: 0.76rem;
}

.result-marker,
.status-dot {
    display: inline-flex;
    width: 1.15rem;
    height: 1.15rem;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--muted);
    color: white;
    font-size: 0.7rem;
}

.correct-result .result-marker,
.correct-row .status-dot {
    background: var(--green);
}

.incorrect-result .result-marker,
.incorrect-row .status-dot {
    background: var(--red);
}

.result-status {
    display: inline-flex;
    min-height: 1.9rem;
    align-items: center;
    gap: 0.45rem;
    padding: 0.32rem 0.65rem;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
}

.result-status-icon {
    display: inline-flex;
    width: 1rem;
    height: 1rem;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: white;
    font-size: 0.68rem;
    font-weight: 900;
}

.result-status-correct {
    border-color: #a6d4be;
    background: var(--green-soft);
    color: var(--green);
}

.result-status-correct .result-status-icon {
    background: var(--green);
}

.result-status-incorrect {
    border-color: #e2b0aa;
    background: var(--red-soft);
    color: var(--red);
}

.result-status-incorrect .result-status-icon {
    background: var(--red);
}

/* Statistics */
.stats-heading {
    min-height: 210px;
    margin-bottom: 1rem;
    padding: 2rem;
    overflow: hidden;
    border-radius: 1.5rem;
    background:
        radial-gradient(circle at 90% 10%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 18rem),
        var(--ink);
    color: white;
}

.stats-heading .eyebrow {
    color: color-mix(in srgb, var(--accent) 65%, white);
}

.stats-heading .hero-copy {
    max-width: 480px;
    color: #c7cfd8;
}

.stat-cards {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 1rem;
}

.stat-card,
.type-card {
    padding: 1.15rem;
    border-radius: 1rem;
}

.stat-card {
    display: grid;
    gap: 0.4rem;
}

.stat-card span,
.type-card p,
.report-row span,
.report-metric span,
.history-table small {
    color: var(--muted);
    font-size: 0.75rem;
}

.stat-card strong {
    font-size: 2.25rem;
    font-weight: 850;
    letter-spacing: -0.05em;
}

.accent-stat {
    border-color: color-mix(in srgb, var(--primary) 25%, var(--line));
    background: var(--primary-soft);
}

.type-grid {
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    margin-top: 1rem;
}

.type-card h3 {
    margin: 0;
    font-size: 1.4rem;
}

.type-card-heading {
    gap: 1rem;
}

.type-card-heading strong {
    color: var(--primary);
}

.type-card p {
    margin: 0.8rem 0 0;
}

.report-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 1rem;
}

.report-grid + .content-section,
.content-section + .content-section {
    margin-top: 1rem;
}

.report-list,
.activity-chart {
    display: grid;
    gap: 0.7rem;
}

.report-row {
    gap: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--line);
}

.report-row:last-child {
    border-bottom: 0;
}

.report-row > div:first-child {
    min-width: 0;
}

.report-row strong,
.report-row span {
    display: block;
    overflow-wrap: anywhere;
}

.report-metric {
    flex: 0 0 auto;
    text-align: right;
}

.report-metric strong {
    font-size: 1.35rem;
}

.danger-metric strong {
    color: var(--red);
}

.success-metric strong {
    color: var(--green);
}

.activity-chart {
    margin-top: 1rem;
}

.activity-row {
    display: grid;
    grid-template-columns: 4.5rem minmax(0, 1fr) 2.5rem 3rem;
    align-items: center;
    gap: 0.7rem;
    color: var(--muted);
    font-size: 0.76rem;
}

.activity-row strong,
.activity-row small {
    color: var(--ink);
    text-align: right;
}

.activity-track {
    height: 0.6rem;
    overflow: hidden;
    border-radius: 99px;
    background: #e8edf2;
}

.activity-bar {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--primary), var(--accent));
}

.history-table-wrap {
    margin-top: 0.7rem;
    overflow-x: auto;
}

.history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}

.history-table th,
.history-table td {
    padding: 0.8rem 0.55rem;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

.history-table th {
    color: var(--muted);
    font-size: 0.66rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.history-table td:first-child {
    white-space: nowrap;
}

.history-table td:nth-child(2) strong,
.history-table td:nth-child(2) small {
    display: block;
}

@media (max-width: 980px) {
    .page-shell {
        width: min(100% - 2rem, 1380px);
    }

    .welcome-hero {
        grid-template-columns: 1.2fr 0.8fr;
    }

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

    .practice-layout {
        grid-template-columns: minmax(0, 1fr) 300px;
    }

    .stat-cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .page-shell {
        width: min(100% - 1rem, 1380px);
        padding-top: 0.65rem;
    }

    .welcome-shell {
        gap: 0.9rem;
        padding-top: 0.5rem;
    }

    .welcome-hero {
        min-height: 235px;
        grid-template-columns: 1fr;
        border-radius: 1.35rem;
    }

    .hero-copy-panel {
        align-self: stretch;
        padding: 1.25rem;
    }

    .hero-copy-panel .brand-mark {
        width: 2.25rem;
        height: 2.25rem;
        margin-bottom: 0.65rem;
        border-radius: 0.7rem;
        font-size: 0.9rem;
    }

    .hero-copy-panel .eyebrow {
        margin-bottom: 0.35rem;
        font-size: 0.58rem;
    }

    .hero-copy-panel h1 {
        font-size: clamp(2.25rem, 11vw, 3.25rem);
        line-height: 0.9;
    }

    .hero-copy-panel .hero-copy {
        max-width: 80%;
        margin-top: 0.7rem;
        font-size: 0.78rem;
        line-height: 1.45;
    }

    .hero-language-cloud {
        display: none;
    }

    .script-orbit {
        min-width: auto;
        padding: 0.55rem 0.65rem;
        border-radius: 0.8rem;
    }

    .script-orbit span {
        font-size: 1rem;
    }

    .script-orbit small {
        font-size: 0.5rem;
    }

    .orbit-hindi {
        top: 1rem;
        right: 1rem;
    }

    .orbit-korean {
        top: 4.4rem;
        right: 0.7rem;
    }

    .orbit-marathi {
        right: 1.4rem;
        bottom: 1rem;
    }

    .hero-spark {
        display: none;
    }

    .dashboard-heading {
        padding: 0 0.25rem;
    }

    .dashboard-heading h2 {
        font-size: 1.3rem;
    }

    .collection-count {
        min-height: 1.7rem;
        padding: 0.3rem 0.55rem;
        font-size: 0.62rem;
    }

    .language-grid {
        grid-template-columns: 1fr;
        gap: 0.65rem;
    }

    .language-card {
        min-height: 132px;
        grid-template-columns: auto 1fr;
        grid-template-rows: 1fr auto;
        gap: 0.25rem 0.75rem;
        padding: 0.85rem;
        border-radius: 1rem;
    }

    .language-card-top {
        grid-row: 1 / 3;
        align-self: start;
    }

    .language-card-top .language-arrow {
        display: none;
    }

    .language-emblem {
        width: 2.5rem;
        height: 2.5rem;
    }

    .language-card-copy {
        align-self: center;
    }

    .language-card h3 {
        font-size: 1.35rem;
    }

    .native-greeting {
        font-size: 0.75rem;
    }

    .language-card .card-kicker {
        font-size: 0.55rem;
    }

    .language-card .card-actions {
        grid-column: 2;
        gap: 0.45rem;
    }

    .language-card .button {
        min-height: 2.25rem;
        padding: 0.45rem 0.7rem;
        font-size: 0.72rem;
    }

    .language-card .icon-link {
        width: 2.25rem;
        min-height: 2.25rem;
        flex-basis: 2.25rem;
        border-radius: 0.7rem;
        font-size: 0.75rem;
    }

    .practice-layout,
    .report-grid,
    .form-grid.two-columns,
    .form-grid.three-columns,
    .practice-options-grid,
    .reveal-grid {
        grid-template-columns: 1fr;
    }

    .history-panel {
        order: 2;
    }

    .form-hero,
    .stats-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .form-hero-glyph {
        display: none;
    }

    .stats-heading {
        min-height: 0;
    }
}

@media (max-width: 480px) {
    .page-shell {
        width: min(100% - 0.75rem, 1380px);
        padding-bottom: 1.5rem;
    }

    .top-nav {
        min-height: 2.6rem;
        margin-bottom: 0.55rem;
    }

    .brand-link > span:last-child {
        display: none;
    }

    .top-nav-actions {
        gap: 0.45rem;
    }

    .nav-link,
    .button-compact {
        font-size: 0.72rem;
    }

    .button-compact {
        min-height: 2.15rem;
        padding: 0.4rem 0.65rem;
    }

    .practice-panel,
    .history-panel,
    .form-panel,
    .report-panel,
    .content-section {
        padding: 0.9rem;
        border-radius: 1rem;
    }

    .practice-heading {
        align-items: flex-start;
        margin-bottom: 0.65rem;
    }

    .practice-selection-bar {
        align-items: flex-start;
        flex-direction: column;
    }

    .practice-heading h1 {
        font-size: 2.15rem;
    }

    .language-pill {
        min-height: 1.7rem;
        padding: 0.3rem 0.55rem;
        font-size: 0.62rem;
    }

    .practice-direction {
        margin-bottom: 0.65rem;
    }

    .focus-label {
        display: none;
    }

    .prompt-card {
        min-height: 150px;
        margin-bottom: 0.75rem;
        padding: 1rem;
        border-radius: 1rem;
    }

    .prompt-text {
        font-size: clamp(1.85rem, 10vw, 2.6rem);
    }

    .prompt-glyph {
        width: 4.2rem;
        height: 4.2rem;
        flex-basis: 4.2rem;
        font-size: 1.7rem;
    }

    .answer-form input {
        min-height: 3.1rem;
        font-size: 1rem;
    }

    .answer-actions .button {
        flex: 1;
    }

    .history-list {
        max-height: none;
    }

    .form-panel h1,
    .stats-heading h1 {
        font-size: 2.65rem;
    }

    .form-hero {
        margin-bottom: 1rem;
    }

    .form-hero .hero-copy {
        font-size: 0.82rem;
    }

    .learning-section {
        padding: 0.85rem;
    }

    .primary-form-actions {
        bottom: 0.25rem;
    }

    .primary-form-actions .button {
        width: 100%;
    }

    .stats-heading {
        gap: 1rem;
        padding: 1.25rem;
        border-radius: 1rem;
    }

    .stats-heading .hero-copy {
        margin-top: 0;
        font-size: 0.8rem;
    }

    .stat-cards {
        gap: 0.6rem;
    }

    .stat-card {
        padding: 0.85rem;
    }

    .stat-card strong {
        font-size: 1.75rem;
    }

    .activity-row {
        grid-template-columns: 3.7rem minmax(0, 1fr) 1.8rem 2.5rem;
        gap: 0.35rem;
    }
}

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

/* Focused navigation and practice choices for the language workflow. */
.compact-hero {
    min-height: 18rem;
}

.language-card {
    color: inherit;
    text-decoration: none;
}

.landing-shell,
.history-page {
    min-height: 100vh;
}

.landing-hero,
.history-hero {
    align-items: center;
    display: flex;
    justify-content: space-between;
    margin: 1.5rem auto 2.5rem;
    max-width: 76rem;
    padding: 1.5rem 0;
}

.landing-hero h1,
.history-hero h1 {
    font-size: clamp(2.5rem, 6vw, 5.4rem);
    line-height: 0.98;
    margin: 0.5rem 0 1rem;
}

.landing-hero h1 span,
.history-hero h1 span {
    color: var(--accent-strong, #d36b46);
}

.landing-glyph {
    align-items: center;
    background: var(--surface-strong, #f5e9df);
    border: 1px solid var(--line, #ead9cc);
    border-radius: 2rem;
    color: var(--accent-strong, #d36b46);
    display: flex;
    font-size: clamp(5rem, 13vw, 10rem);
    height: 13rem;
    justify-content: center;
    line-height: 1;
    width: 13rem;
}

.practice-options-section {
    margin: 0 auto 4rem;
    max-width: 76rem;
}

.practice-options-section > .section-heading {
    margin-bottom: 0.8rem;
}

.practice-options-grid {
    display: grid;
    gap: 0.85rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.category-choice-grid,
.direction-selection-grid {
    display: grid;
    gap: 0.85rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

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

.category-choice-option {
    min-height: 10rem;
}

.direction-selection-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.practice-option {
    background: var(--surface, #fffaf6);
    border: 1px solid var(--line, #ead9cc);
    border-radius: 1rem;
    color: inherit;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    min-height: 8rem;
    padding: 1.1rem;
    position: relative;
    text-decoration: none;
    transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.practice-option:hover,
.practice-option:focus-visible {
    border-color: var(--accent, #d36b46);
    box-shadow: 0 0.7rem 1.5rem rgba(79, 52, 39, 0.08);
    transform: translateY(-2px);
}

.practice-option strong {
    font-size: 1.05rem;
    max-width: 85%;
}

.practice-option > span:last-child {
    color: var(--muted, #806e63);
    font-size: 0.84rem;
    line-height: 1.45;
}

.practice-option-arrow {
    color: var(--accent-strong, #d36b46);
    font-size: 1.2rem;
    position: absolute;
    right: 1rem;
    top: 0.9rem;
}

.practice-option-featured {
    background: var(--accent-soft, #f9e5d8);
    border-color: var(--accent, #d36b46);
}

.practice-random-option {
    min-height: 6rem;
}

.practice-direction-option {
    min-height: 8.5rem;
}

.practice-direction-option > span:last-child {
    color: var(--muted, #806e63);
    font-size: 0.84rem;
    line-height: 1.45;
}

.direction-option-icon {
    font-size: 1.45rem;
}

.landing-companion {
    align-items: center;
    background: var(--primary-soft);
    border: 1px solid color-mix(in srgb, var(--primary) 18%, var(--line));
    border-radius: 2rem;
    color: var(--primary);
    display: flex;
    flex-direction: column;
    font-size: clamp(4rem, 10vw, 7rem);
    gap: 0.4rem;
    justify-content: center;
    min-height: 13rem;
    min-width: 13rem;
    padding: 1rem;
    transform: rotate(3deg);
}

.landing-companion small {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.04em;
}

.practice-option-icon {
    align-items: center;
    background: var(--primary-soft);
    border-radius: 0.75rem;
    color: var(--primary);
    display: inline-flex;
    font-size: 1.1rem;
    font-weight: 850;
    height: 2.5rem;
    justify-content: center;
    width: 2.5rem;
}

.optional-details > summary {
    align-items: center;
    color: var(--ink);
    cursor: pointer;
    display: flex;
    font-size: 0.9rem;
    font-weight: 800;
    gap: 0.7rem;
    list-style: none;
}

.optional-details > summary::-webkit-details-marker {
    display: none;
}

.optional-details > summary::after {
    color: var(--primary);
    content: "+";
    font-size: 1.2rem;
    margin-left: auto;
}

.optional-details[open] > summary::after {
    content: "−";
}

.optional-details > summary em {
    color: var(--muted);
    font-size: 0.76rem;
    font-style: normal;
    font-weight: 600;
}

.optional-details-content {
    margin-top: 1rem;
}

.practice-mode-nav {
    display: flex;
    gap: 0.45rem;
    margin: 1.25rem 0;
    overflow-x: auto;
    padding-bottom: 0.35rem;
}

.practice-selection-bar {
    display: flex;
    min-height: 2.7rem;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin: 1rem 0 0.8rem;
    padding: 0.55rem 0.7rem;
    border-radius: 0.8rem;
    background: #f7f9fb;
}

.selected-practice-mode {
    color: var(--ink);
    font-size: 0.78rem;
    font-weight: 800;
}

.practice-direction-picker {
    margin: 1rem 0 1.25rem;
}

.direction-mode-nav {
    margin-bottom: 0;
}

.mode-link {
    border: 1px solid var(--line, #ead9cc);
    border-radius: 999px;
    color: var(--muted, #806e63);
    flex: 0 0 auto;
    font-size: 0.75rem;
    padding: 0.5rem 0.75rem;
    text-decoration: none;
}

.mode-link:hover,
.mode-link:focus-visible,
.mode-link.active {
    background: var(--accent-soft, #f9e5d8);
    border-color: var(--accent, #d36b46);
    color: var(--ink, #33231c);
}

.practice-heading-tools {
    align-items: flex-end;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.toggle-control {
    align-items: center;
    color: var(--muted, #806e63);
    display: inline-flex;
    font-size: 0.75rem;
    gap: 0.45rem;
    white-space: nowrap;
}

.toggle-control input {
    accent-color: var(--accent, #d36b46);
    height: 1rem;
    width: 1rem;
}

.history-link {
    color: var(--accent-strong, #d36b46);
    font-size: 0.8rem;
    text-decoration: none;
}

.history-link:hover,
.history-link:focus-visible {
    text-decoration: underline;
}

.report-row small {
    color: var(--muted, #806e63);
    display: block;
    font-size: 0.7rem;
    margin-top: 0.2rem;
}

@media (max-width: 720px) {
    .landing-hero,
    .history-hero {
        align-items: flex-start;
        flex-direction: column;
        gap: 1.25rem;
    }

    .landing-glyph {
        border-radius: 1rem;
        font-size: 4rem;
        height: 5.5rem;
        width: 5.5rem;
    }

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

    .category-choice-grid,
    .direction-selection-grid {
        grid-template-columns: 1fr;
    }

    .practice-heading-tools {
        align-items: flex-start;
    }
}
