/* === Reset === */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

img {
    max-width: 100%;
    display: block;
}

/* === Design Tokens === */
:root {
    --bg: #fef9f4;
    --surface: #ffffff;
    --text: #1f1f1f;
    --subtext: #5f6368;
    --brand: #DA291C;
    --brand-light: #fde8e6;
    --brand-dark: #b71c1c;
    --accent: #F4D03F;
    --green: #34a853;
    --yellow: #F4D03F;
    --line: #e0d6cc;
    --shadow: 0 1px 3px rgba(60, 64, 67, .15);
    --shadow-lg: 0 8px 24px rgba(60, 64, 67, .12);
    --radius: 16px;
    --radius-sm: 8px;
    --font: 'Noto Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

body {
    font-family: var(--font);
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

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

a:hover {
    text-decoration: underline;
}

.container {
    width: min(1140px, 92%);
    margin: 0 auto;
}

/* === Nav === */
.nav {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, .92);
    backdrop-filter: saturate(180%) blur(16px);
    border-bottom: 1px solid var(--line);
}

.nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.brand {
    display: inline-flex;
    gap: 10px;
    align-items: center;
    text-decoration: none !important;
}

.brand-logo {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
}

.brand-name {
    font-weight: 700;
    font-size: 18px;
    letter-spacing: -.2px;
}

.brand-tag {
    font-size: 11px;
    font-weight: 600;
    color: var(--brand);
    background: var(--brand-light);
    padding: 2px 8px;
    border-radius: 999px;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.welcome {
    color: var(--subtext);
    font-size: 14px;
}

/* === Buttons === */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--brand);
    color: #fff;
    padding: 10px 20px;
    border-radius: 999px;
    font-weight: 500;
    font-size: 14px;
    border: none;
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: all .15s ease;
    text-decoration: none !important;
}

.btn:hover {
    background: var(--brand-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.btn:active {
    transform: translateY(0);
}

.btn-ghost {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--line);
    box-shadow: none;
}

.btn-ghost:hover {
    background: #f1f3f4;
}

.btn-lg {
    padding: 12px 24px;
    font-size: 15px;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 13px;
}

.btn-full {
    width: 100%;
    justify-content: center;
}

.btn-icon {
    font-size: 18px;
}

/* === Hero === */
.hero {
    padding: 60px 0 24px;
    overflow: hidden;
}

.hero-inner {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    align-items: center;
    gap: 40px;
}

.hero-eyebrow {
    font-size: 14px;
    font-weight: 600;
    color: var(--brand);
    background: var(--brand-light);
    display: inline-block;
    padding: 4px 14px;
    border-radius: 999px;
    margin-bottom: 16px;
}

.hero-title {
    font-size: clamp(32px, 5vw, 52px);
    line-height: 1.1;
    margin-bottom: 16px;
    letter-spacing: -.5px;
}

.hero-accent {
    color: var(--brand);
}

.hero-subtitle {
    color: var(--subtext);
    font-size: 17px;
    margin-bottom: 24px;
    max-width: 520px;
}

.hero-cta {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 28px;
}

.hero-modes {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.mode-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--subtext);
    background: var(--surface);
    border: 1px solid var(--line);
    padding: 6px 14px;
    border-radius: 999px;
}

.mode-pill .material-icons-outlined {
    font-size: 16px;
}

/* Hero floating cards */
.hero-art {
    position: relative;
    height: 340px;
}

.hero-card {
    position: absolute;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 16px 20px;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: float 6s ease-in-out infinite;
}

.hero-card .hc-icon {
    font-size: 28px;
}

.hero-card .hc-text {
    font-weight: 600;
    font-size: 16px;
}

.hc1 {
    top: 10%;
    right: 10%;
    animation-delay: 0s;
}

.hc2 {
    top: 45%;
    left: 5%;
    animation-delay: 2s;
}

.hc3 {
    bottom: 10%;
    right: 20%;
    animation-delay: 4s;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-12px);
    }
}

.blob {
    position: absolute;
    border-radius: 50%;
    opacity: .4;
    filter: blur(40px);
}

.blob.a {
    width: 200px;
    height: 200px;
    top: 0;
    right: 0;
    background: #DA291C;
}

.blob.b {
    width: 160px;
    height: 160px;
    bottom: 20%;
    left: 10%;
    background: #F4D03F;
}

.blob.c {
    width: 140px;
    height: 140px;
    bottom: 0;
    right: 30%;
    background: #E67E22;
}

/* === Features Strip === */
.features-strip {
    background: var(--surface);
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    padding: 20px 0;
}

.features-row {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 16px;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
}

.feature-icon {
    font-size: 28px;
    color: var(--brand);
}

.feature-desc {
    color: var(--subtext);
    font-size: 13px;
}

/* === Sections === */
.section {
    padding: 32px 0 48px;
}

.section-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
}

.section-subtitle {
    color: var(--subtext);
    margin-bottom: 20px;
}

.section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.breadcrumb {
    display: inline-block;
    font-size: 14px;
    color: var(--brand);
    margin-bottom: 8px;
    text-decoration: none !important;
}

.breadcrumb:hover {
    text-decoration: underline !important;
}

/* === Chips === */
.chips-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    padding: 0 0 20px;
}

.chip {
    appearance: none;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--text);
    padding: 8px 16px;
    border-radius: 999px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all .15s ease;
}

.chip:hover {
    background: #f1f3f4;
}

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

/* === Card Grid === */
.card-grid {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: all .2s ease;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.card-link {
    display: block;
    padding: 24px;
    color: inherit;
    text-decoration: none !important;
}

.card-head {
    margin-bottom: 12px;
}

.card-badge {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    color: var(--brand);
    background: var(--brand-light);
    padding: 3px 10px;
    border-radius: 999px;
}

.card-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 8px;
}

.card-desc {
    color: var(--subtext);
    font-size: 14px;
    margin-bottom: 16px;
    line-height: 1.5;
}

.card-cta {
    color: var(--brand);
    font-weight: 600;
    font-size: 14px;
}

/* === List (topic detail) === */
.list {
    list-style: none;
    display: grid;
    gap: 14px;
}

.card-list {
    max-width: 860px;
    margin: 0 auto;
}

.list-item {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px 24px;
    box-shadow: var(--shadow);
    transition: all .15s ease;
}

.list-item:hover {
    box-shadow: var(--shadow-lg);
}

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

.list-item-title {
    font-size: 18px;
    font-weight: 600;
}

.list-item-title a:hover {
    color: var(--brand);
}

.meta {
    font-size: 13px;
    color: var(--subtext);
    margin: 6px 0;
}

.article-excerpt {
    font-size: 14px;
    color: var(--subtext);
    margin-top: 4px;
}

.list-item-modes {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.mode-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--subtext);
    background: #f1f3f4;
    padding: 4px 10px;
    border-radius: 999px;
}

.mode-tag .material-icons-outlined {
    font-size: 14px;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--subtext);
}

.empty-icon {
    font-size: 48px;
    color: var(--line);
    display: block;
    margin-bottom: 12px;
}

/* === Mode Tabs === */
.modes {
    display: flex;
    gap: 8px;
    margin: 8px 0 16px;
    flex-wrap: wrap;
}

.tab {
    appearance: none;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--text);
    padding: 10px 18px;
    border-radius: 999px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all .15s ease;
}

.tab .material-icons-outlined {
    font-size: 18px;
}

.tab:hover {
    background: #f1f3f4;
}

.tab.is-active {
    background: var(--brand);
    color: #fff;
    border-color: var(--brand);
}

.mode-panel {
    display: none;
}

.mode-panel.is-active {
    display: block;
}

.panel-card {
    padding: 24px;
}

.panel-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.panel-header h4 {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.panel-icon {
    font-size: 24px;
    color: var(--brand);
}

/* Empty panel */
.empty-panel {
    text-align: center;
    padding: 40px 20px;
    color: var(--subtext);
}

.empty-panel .material-icons-outlined {
    font-size: 40px;
    color: var(--line);
    display: block;
    margin-bottom: 8px;
}

.empty-panel code {
    font-size: 12px;
    background: #f1f3f4;
    padding: 2px 6px;
    border-radius: 4px;
}

/* Slides viewer */
.slides-viewer {
    text-align: center;
}

.slides-container {
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slide-item img {
    margin: 0 auto;
    border-radius: var(--radius-sm);
    max-height: 500px;
}

.slides-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 12px;
}

.slide-counter {
    font-size: 14px;
    color: var(--subtext);
    font-weight: 500;
}

.slide-json {
    max-width: 600px;
    width: 100%;
    text-align: left;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.slide-content {
    padding: 32px;
    flex: 1;
}

.slide-title {
    font-size: 24px;
    color: var(--brand);
    margin-bottom: 20px;
    border-bottom: 2px solid var(--brand-light);
    padding-bottom: 10px;
}

.slide-body ul {
    padding-left: 20px;
}

.slide-body li {
    margin-bottom: 12px;
    font-size: 18px;
}

.slide-narration {
    background: var(--brand-light);
    padding: 20px;
    border-top: 1px solid var(--line);
    font-size: 14px;
    color: var(--subtext);
}

/* Mindmap */
.mindmap-container {
    background: white;
    border-radius: var(--radius);
    padding: 20px;
    border: 1px solid var(--line);
    overflow: auto;
}

.mindmap-img {
    border-radius: var(--radius-sm);
    margin: 0 auto;
}

.mermaid {
    width: 100%;
}

/* === Article Layout (Immersive Text) === */
.article-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 20px;
}

.toc {
    position: sticky;
    top: 80px;
    align-self: start;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 16px;
}

.toc-title {
    font-weight: 600;
    font-size: 14px;
    color: var(--subtext);
    text-transform: uppercase;
    letter-spacing: .5px;
    margin-bottom: 10px;
}

.toc-list {
    list-style: none;
    display: grid;
    gap: 6px;
}

.toc-item a {
    font-size: 14px;
    color: var(--text);
    transition: color .1s;
}

.toc-item a:hover,
.toc-item a.is-active {
    color: var(--brand);
    text-decoration: none;
    font-weight: 600;
}

.article-rich {
    min-width: 0;
    width: 100%;
    overflow: hidden;
}

.article-content {
    line-height: 1.7;
    overflow-wrap: break-word;
    word-break: break-word;
}

.article-rendered {
    overflow-wrap: break-word;
    word-break: break-word;
    max-width: 100%;
}

.article-rendered * {
    max-width: 100%;
    box-sizing: border-box;
}

.article-content * {
    max-width: 100%;
}

.article-content h2 {
    font-size: 20px;
    margin: 24px 0 12px;
    scroll-margin-top: 96px;
}

.article-content p {
    margin-bottom: 12px;
}

.article-content img {
    border-radius: var(--radius-sm);
    margin: 12px 0;
}

.section-block {
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
    margin-bottom: 16px;
}

.section-block h2 {
    margin-top: 0;
    scroll-margin-top: 96px;
}

/* Quiz card */
.quiz-card {
    margin-top: 16px;
    border-top: 2px solid var(--brand-light);
    padding-top: 16px;
}

.quiz-head {
    font-weight: 700;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--brand);
    margin-bottom: 8px;
}

.quiz-head .material-icons-outlined {
    font-size: 20px;
}

.quiz-prompts {
    margin: 8px 0 12px;
    padding-left: 20px;
    font-size: 14px;
    color: var(--subtext);
}

.quiz-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--bg);
    font-family: var(--font);
    font-size: 14px;
    resize: vertical;
}

.quiz-input:focus {
    outline: 2px solid var(--brand);
    border-color: transparent;
}

.quiz-actions {
    margin-top: 8px;
}

/* Multiple-choice quiz */
.quiz-question {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--line);
}

.quiz-question:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.quiz-q-text {
    margin-bottom: 10px;
    font-size: 15px;
}

.quiz-options {
    display: grid;
    gap: 8px;
}

.quiz-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all .15s;
    font-size: 14px;
}

.quiz-option:hover {
    background: #f1f3f4;
}

.quiz-option input[type="radio"] {
    display: none;
}

.quiz-option-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--brand-light);
    color: var(--brand);
    font-weight: 700;
    font-size: 13px;
    flex-shrink: 0;
}

.quiz-option.quiz-correct {
    background: #e6f4ea;
    border-color: #34a853;
}

.quiz-option.quiz-correct .quiz-option-label {
    background: #34a853;
    color: #fff;
}

.quiz-option.quiz-wrong {
    background: #fce8e6;
    border-color: #d93025;
}

.quiz-option.quiz-wrong .quiz-option-label {
    background: #d93025;
    color: #fff;
}

.quiz-feedback {
    margin-top: 10px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    background: var(--bg);
}

.quiz-result {
    font-weight: 600;
    font-size: 14px;
}

.quiz-result.correct {
    color: #1e8e3e;
}

.quiz-result.wrong {
    color: #d93025;
}

.quiz-explanation {
    margin-top: 6px;
    font-size: 13px;
    color: var(--subtext);
}

/* Transcript */
.transcript-content {
    display: none;
    margin-top: 12px;
}

.transcript-content.is-visible {
    display: block;
}

.transcript-body {
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 20px 24px;
    font-size: 15px;
    line-height: 1.7;
    white-space: pre-wrap;
    max-height: 500px;
    overflow-y: auto;
    color: var(--text);
    overflow-wrap: break-word;
    font-family: inherit;
    /* Unify font */
}

/* Transcript speaker labels */
.transcript-body .speaker {
    font-weight: 700;
    margin-right: 8px;
    text-transform: uppercase;
    font-size: 0.85em;
    letter-spacing: 0.5px;
}

.transcript-body .speaker.Person1 {
    color: #d81b60;
    /* Host - Bold Pink */
}

.transcript-body .speaker.Person2 {
    color: #1976d2;
    /* Expert - Bold Blue */
}

.transcript-body .dialogue {
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.03);
}

.transcript-body .dialogue:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

/* === Auth Forms === */
.auth-card {
    max-width: 420px;
    margin: 40px auto;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 40px;
    box-shadow: var(--shadow-lg);
    text-align: center;
}

.auth-title {
    font-size: 28px;
    margin-bottom: 8px;
}

.auth-subtitle {
    color: var(--subtext);
    margin-bottom: 24px;
}

.auth-form {
    text-align: left;
}

.auth-form label {
    font-weight: 600;
    font-size: 14px;
    display: block;
    margin-bottom: 4px;
    margin-top: 14px;
}

.auth-form input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    font-size: 15px;
}

.auth-form input:focus {
    outline: 2px solid var(--brand);
    border-color: transparent;
}

.auth-form .btn {
    margin-top: 20px;
}

.auth-alt {
    margin-top: 20px;
    font-size: 14px;
    color: var(--subtext);
    text-align: center;
}

.auth-alt a {
    color: var(--brand);
    font-weight: 600;
}

.error {
    color: var(--accent);
    font-size: 14px;
    margin-top: 8px;
}

/* === Lesson Form === */
.form-card {
    max-width: 780px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 32px;
    box-shadow: var(--shadow);
}

.lesson-form label {
    font-weight: 600;
    font-size: 14px;
    display: block;
    margin: 16px 0 6px;
}

.lesson-form input[type="text"],
.lesson-form textarea,
.lesson-form select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 14px;
}

.lesson-form textarea {
    resize: vertical;
}

.lesson-form input:focus,
.lesson-form textarea:focus,
.lesson-form select:focus {
    outline: 2px solid var(--brand);
    border-color: transparent;
}

.form-section {
    margin: 16px 0;
}

.form-section summary {
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    color: var(--brand);
    padding: 8px 0;
}

.editor-toolbar {
    display: flex;
    gap: 8px;
    margin: 8px 0;
}

.upload-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin: 20px 0;
}

.upload-box {
    background: var(--bg);
    border: 2px dashed var(--line);
    border-radius: var(--radius-sm);
    padding: 16px;
    text-align: center;
}

.upload-box label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 13px;
}

.upload-box .material-icons-outlined {
    font-size: 20px;
    color: var(--brand);
}

.upload-box input[type="file"] {
    margin-top: 8px;
    font-size: 13px;
}

/* === Footer === */
.site-footer {
    border-top: 1px solid var(--line);
    background: var(--surface);
    margin-top: 40px;
}

.footer-inner {
    padding: 24px 0;
    color: var(--subtext);
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.foot-brand {
    font-weight: 700;
}

/* === Dashboard Table === */
.dash-table {
    width: 100%;
    border-collapse: collapse;
}

.dash-table th,
.dash-table td {
    padding: 15px;
    text-align: left;
}

.dash-table thead tr {
    border-bottom: 2px solid #eee;
}

.dash-table tbody tr {
    border-bottom: 1px solid #eee;
}

.dash-table a {
    text-decoration: none;
    color: var(--brand);
    font-weight: 500;
}

.dash-table .meta {
    font-size: 0.9em;
    color: #666;
}

.visibility-select {
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid var(--line);
    font-size: 14px;
    background: var(--surface);
    font-family: var(--font);
    cursor: pointer;
    min-width: 160px;
    max-width: 100%;
    box-sizing: border-box;
}

.visibility-select:focus {
    outline: 2px solid var(--brand);
    border-color: transparent;
}

/* Dashboard card list (mobile) */
.dash-card-list {
    display: none;
}

.dash-card-item {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: var(--shadow);
}

.dash-card-item .dash-title {
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 8px;
}

.dash-card-item .dash-title a {
    color: var(--brand);
    text-decoration: none;
}

.dash-card-item .dash-meta {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 10px;
    font-size: 13px;
    color: var(--subtext);
}

.dash-card-item .visibility-select {
    width: 100%;
    margin-top: 4px;
}

/* === Responsive === */

/* Tablet */
@media (max-width:900px) {
    .hero-inner {
        grid-template-columns: 1fr;
    }

    .hero-art {
        height: 240px;
    }

    .article-layout {
        grid-template-columns: 1fr;
    }

    .toc {
        position: static;
    }

    .features-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        padding: 0 16px;
    }

    .section-head {
        flex-direction: column;
        align-items: flex-start;
    }

    .slide-json {
        max-width: 100%;
    }

    .slides-container {
        min-height: 300px;
    }

    .slide-body li {
        font-size: 16px;
    }
}

/* Mobile */
@media (max-width:560px) {
    .nav-inner {
        height: 56px;
    }

    .brand-name {
        font-size: 16px;
    }

    .brand-tag {
        display: none;
    }

    .hero {
        padding: 40px 0 16px;
    }

    .hero-art {
        height: 180px;
    }

    .section {
        padding: 20px 0 32px;
    }

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

    .auth-card {
        padding: 24px;
        margin: 20px auto;
    }

    .form-card {
        padding: 20px;
    }

    .footer-inner {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }

    /* Mode tabs scroll horizontally */
    .modes {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        gap: 6px;
        padding-bottom: 4px;
    }

    .tab {
        white-space: nowrap;
        padding: 8px 14px;
        font-size: 13px;
        flex-shrink: 0;
    }

    .tab .material-icons-outlined {
        font-size: 16px;
    }

    /* Slides */
    .slides-container {
        min-height: auto;
    }

    .slide-content {
        padding: 20px;
    }

    .slide-title {
        font-size: 18px;
        margin-bottom: 14px;
    }

    .slide-body li {
        font-size: 15px;
        margin-bottom: 8px;
    }

    .slide-narration {
        padding: 14px;
        font-size: 13px;
    }

    .panel-card {
        padding: 16px;
    }

    /* Dashboard: hide table, show cards */
    .dash-table-wrap {
        display: none;
    }

    .dash-card-list {
        display: block;
    }

    .visibility-select {
        min-width: 0;
        width: 100%;
        font-size: 16px;
    }

    /* Audio player */
    audio {
        max-width: 100%;
    }

    /* Mindmap scroll */
    .mindmap-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .mermaid {
        min-width: 600px;
    }

    /* Chips scroll */
    .chips-row {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 8px;
    }

    .chip {
        flex-shrink: 0;
    }

    /* Section head */
    .section-head {
        gap: 8px;
    }

    .section-title {
        font-size: 20px;
    }

    /* Better TOC on mobile: vertical and compact */
    .toc {
        background: var(--surface);
        border: 1px solid var(--line);
        padding: 16px;
        border-radius: var(--radius-sm);
        margin-bottom: 16px;
        width: 100%;
    }

    .toc-title {
        display: block;
        font-size: 12px;
        color: var(--subtext);
        margin-bottom: 8px;
        opacity: 1;
    }

    .toc-list {
        display: grid;
        gap: 10px;
        overflow-x: visible;
        padding-bottom: 0;
        flex-direction: column;
    }

    .toc-item {
        background: none;
        border: none;
        padding: 0;
        flex-shrink: 1;
    }

    .toc-item a {
        white-space: normal;
        font-size: 14px;
        line-height: 1.4;
        color: var(--text);
    }

    .toc-item a.is-active {
        color: var(--brand);
        font-weight: 700;
    }

    .section-block {
        padding: 16px;
        margin-bottom: 12px;
        width: 100%;
        max-width: 100%;
    }

    .article-layout {
        gap: 12px;
        overflow: hidden;
        width: 100%;
    }

    /* Quiz */
    .quiz-card {
        padding: 12px 0 0;
    }

    .quiz-input {
        font-size: 16px;
        /* prevent iOS zoom */
    }

    /* Upload grid */
    .upload-grid {
        grid-template-columns: 1fr;
    }

    /* List items */
    .list-item {
        padding: 14px 16px;
    }

    .list-item-head {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
}