:root {
    font-family: Inter, sans-serif;
    color: #1e293b;
    background: #fff;
    scroll-behavior: smooth;
    -webkit-tap-highlight-color: transparent;
}
* { box-sizing: border-box; }
body { margin: 0; padding: 12px 14px 40px; }
a { color: inherit; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
    outline: 2px solid #059669;
    outline-offset: 2px;
}
main, .topbar, footer { width: 100%; max-width: 448px; margin: 0 auto; }
main { display: flex; flex-direction: column; gap: 8px; }
.wrap { width: 100%; }
.topbar-inner, .hero, .method, .library, .reader-section, .editor-section, footer {
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    box-shadow: 0 1px 2px rgba(0,0,0,.05);
}
.topbar { margin-bottom: 8px; }
.topbar-inner { background: #f8fafc; padding: 14px 16px; display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.brand { display: flex; align-items: center; gap: 8px; color: #0f172a; text-decoration: none; font-size: 12px; font-weight: 700; line-height: 1.2; }
.brand small { display: block; color: #64748b; font-size: 10px; font-weight: 500; margin-top: 2px; }
.brand-mark { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 999px; background: #047857; color: #fff; font-family: "JetBrains Mono", monospace; font-weight: 700; }
.topbar nav { order: 3; width: 100%; display: flex; gap: 6px; flex-wrap: wrap; }
.topbar nav a { flex: 1; text-align: center; text-decoration: none; background: #fff; border: 1px solid #e2e8f0; border-radius: 8px; padding: 9px 5px; font-size: 11px; font-weight: 700; color: #475569; white-space: nowrap; }
.topbar nav a:hover { background: #ecfdf5; border-color: #a7f3d0; color: #047857; }
.top-link { margin-left: auto; font-size: 11px; font-weight: 700; color: #047857; text-decoration: none; }
.hero { background: #f8fafc; padding: 16px; }
.eyebrow, .form-kicker, .sidebar-title, .search-label {
    font-size: 10px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: #047857;
}
.live-dot { display: inline-block; width: 8px; height: 8px; margin-right: 4px; background: #10b981; border-radius: 50%; }
.eyebrow-separator { color: #94a3b8; }
.hero h1 { margin: 10px 0 8px; color: #0f172a; font-size: 24px; font-weight: 800; line-height: 1.2; letter-spacing: -.025em; }
.hero h1 em { color: #047857; font-style: normal; }
.hero-lead, .section-heading p:not(.eyebrow), .reader-heading > p:last-child {
    color: #475569; font-size: 12px; line-height: 1.65;
}
.hero-actions, .form-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 9px 12px; border: 1px solid transparent; border-radius: 10px; text-decoration: none; font-size: 12px; font-weight: 700; text-align: center; }
.button-primary { background: #047857; color: #fff; }
.button-primary:hover { background: #065f46; }
.button-ghost, .button-outline { background: #fff; color: #047857; border-color: #cbd5e1; }
.button-ghost:hover, .button-outline:hover { background: #ecfdf5; }
.button[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 8px 14px; padding-top: 12px; margin-top: 12px; border-top: 1px solid #e2e8f0; color: #64748b; font-size: 10px; }
.hero-meta strong { color: #0f172a; font: 700 12px "JetBrains Mono", monospace; }
.hero-visual { margin-top: 14px; padding: 8px; border: 1px solid #e2e8f0; border-radius: 12px; background: #fff; }
.board-top { display: flex; justify-content: space-between; gap: 8px; color: #475569; font-size: 10px; font-weight: 700; padding: 3px 4px; }
.board-top i { display: inline-block; width: 7px; height: 7px; margin-right: 4px; border-radius: 50%; background: #10b981; }
.pitch { display: block; width: 100%; margin-top: 6px; border-radius: 8px; background: #1b6338; }
.board-legend { display: flex; flex-wrap: wrap; gap: 10px; margin: 8px 4px 0; color: #475569; font-size: 10px; font-weight: 600; }
.board-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 4px; border: 1px solid #94a3b8; }
.legend-white { background: #fff; }
.legend-green { background: #fbbf24; }
.board-note { margin: 7px 4px 2px; color: #64748b; font-size: 10px; line-height: 1.5; }
.section-pad { padding: 16px; background: #fff; }
.section-heading { margin-bottom: 12px; }
.section-heading h2, .reader-heading h2 { margin: 5px 0; color: #0f172a; font-size: 16px; line-height: 1.3; font-weight: 800; }
.section-heading p, .reader-heading p { margin: 5px 0; }
.section-index { display: inline-block; margin-top: 4px; font: 700 10px "JetBrains Mono", monospace; color: #64748b; }
.method-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.method-card { min-width: 0; padding: 10px; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 10px; }
.method-card > span { color: #047857; font: 700 10px "JetBrains Mono", monospace; }
.method-card h3 { margin: 6px 0 4px; color: #1e293b; font-size: 12px; overflow-wrap: anywhere; }
.method-card p { margin: 0; color: #64748b; font-size: 11px; line-height: 1.55; }
.library-layout, .editor-grid, .editor-aside { display: grid; gap: 12px; min-width: 0; }
.library-sidebar, .library-content { min-width: 0; }
.search-label, .sidebar-title { display: block; color: #64748b; }
.search-box { display: flex; align-items: center; gap: 6px; padding: 8px 10px; margin-top: 5px; background: #f8fafc; border: 1px solid #cbd5e1; border-radius: 8px; }
.search-box span { color: #64748b; font-size: 18px; line-height: 1; }
.search-box input { min-width: 0; width: 100%; padding: 0; border: 0; outline: 0; background: transparent; color: #1e293b; font-size: 16px; }
.search-box:focus-within { outline: 2px solid #059669; outline-offset: 2px; }
.sidebar-title { margin: 12px 0 6px; }
.category-list { display: flex; gap: 5px; max-width: 100%; overflow-x: auto; padding-bottom: 5px; }
.category-button { flex: 0 0 auto; display: flex; align-items: center; gap: 6px; min-height: 36px; border: 1px solid #e2e8f0; border-radius: 8px; padding: 7px 9px; background: #f8fafc; color: #475569; font-size: 11px; font-weight: 700; white-space: nowrap; }
.category-button:hover, .category-button[aria-pressed="true"] { background: #ecfdf5; border-color: #a7f3d0; color: #047857; }
.category-button span:last-child { color: #64748b; font-family: "JetBrains Mono", monospace; }
.sidebar-note { padding: 10px; margin-top: 8px; background: #ecfdf5; border: 1px solid #a7f3d0; border-radius: 10px; }
.sidebar-note span { color: #047857; font-size: 10px; font-weight: 700; }
.sidebar-note p { margin: 4px 0 0; color: #065f46; font-size: 11px; font-weight: 600; line-height: 1.5; }
.library-toolbar { display: flex; align-items: end; justify-content: space-between; gap: 8px; padding-bottom: 8px; border-bottom: 1px solid #e2e8f0; }
.library-toolbar .eyebrow { margin: 0 0 4px; }
.library-toolbar h3 { margin: 0; color: #0f172a; font-size: 13px; }
.library-toolbar > span { color: #64748b; font-size: 11px; white-space: nowrap; }
.lesson-list { display: grid; gap: 6px; margin-top: 8px; }
.lesson-card { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 8px; padding: 10px; border: 1px solid #e2e8f0; border-radius: 10px; background: #f8fafc; overflow-wrap: anywhere; }
.lesson-number { color: #94a3b8; font: 700 11px "JetBrains Mono", monospace; padding-top: 3px; }
.lesson-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; color: #64748b; font-size: 10px; font-weight: 700; }
.category-chip { padding: 3px 5px; color: #047857; background: #d1fae5; border: 1px solid #a7f3d0; border-radius: 5px; }
.complete-indicator { color: #047857; }
.lesson-card h4 { margin: 7px 0 4px; color: #0f172a; font-size: 13px; line-height: 1.4; }
.lesson-card p { margin: 0; color: #64748b; font-size: 11px; line-height: 1.6; }
.lesson-actions { grid-column: 2; display: flex; flex-wrap: wrap; gap: 6px; }
.open-lesson, .small-action { min-height: 36px; padding: 7px 10px; border: 1px solid #cbd5e1; border-radius: 8px; background: #fff; color: #047857; font-size: 11px; font-weight: 700; }
.open-lesson:hover, .small-action:hover { background: #ecfdf5; }
.small-action.delete { color: #be123c; }
.empty { color: #64748b; font-size: 12px; line-height: 1.6; }
.reader-heading { margin-bottom: 10px; }
.reader-empty { padding: 12px; border: 1px dashed #cbd5e1; border-radius: 10px; color: #64748b; font-size: 12px; line-height: 1.6; }
.reader { min-width: 0; overflow-wrap: anywhere; }
.reader h3 { margin: 12px 0 6px; color: #0f172a; font-size: 16px; line-height: 1.4; }
.reader-intro, .reader-block p, .reader-block li { color: #475569; font-size: 12px; line-height: 1.7; }
.reader-block { padding-top: 12px; margin-top: 12px; border-top: 1px solid #e2e8f0; }
.reader-block h4 { margin: 0 0 6px; color: #047857; font-size: 11px; font-weight: 800; text-transform: uppercase; }
.reader-block ul, .reader-block ol { padding-left: 18px; margin: 0; }
.reader-block li + li { margin-top: 6px; }
.reader-task { padding: 12px; background: #ecfdf5; border: 1px solid #a7f3d0; border-radius: 10px; }
.reader-task p { margin: 0; }
.reader-footer { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.reader-footer span { width: 100%; }
.editor-form, .aside-card { min-width: 0; padding: 12px; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 12px; }
.form-heading { display: flex; justify-content: space-between; align-items: start; gap: 8px; margin-bottom: 12px; }
.form-heading h3, .aside-card h3 { margin: 5px 0; color: #0f172a; font-size: 13px; font-weight: 800; }
.form-tag { padding: 4px 6px; border-radius: 5px; background: #d1fae5; color: #047857; font-size: 10px; font-weight: 700; }
.form-row { display: grid; gap: 0; }
.editor-form label { display: block; margin-bottom: 10px; color: #475569; font-size: 11px; font-weight: 600; }
.editor-form label small { color: #64748b; font-size: 10px; font-weight: 500; }
.editor-form input, .editor-form select, .editor-form textarea { display: block; width: 100%; min-width: 0; margin-top: 5px; padding: 8px 10px; border: 1px solid #cbd5e1; border-radius: 8px; background: #fff; color: #1e293b; font-size: 16px; line-height: 1.45; }
.editor-form textarea { resize: vertical; }
.form-status { margin: 8px 0 0; color: #047857; font-size: 11px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.form-status.error { color: #be123c; }
.aside-card p, .aside-card li { color: #64748b; font-size: 11px; line-height: 1.6; }
.aside-card ol { margin: 8px 0 0; padding-left: 18px; }
.aside-icon { color: #047857; font-size: 18px; }
.backup { background: #fff; }
.backup .button { width: 100%; }
.export-hint { margin: 6px 0 0; }
.import-label { display: block; margin-top: 12px; color: #047857; font-size: 11px; font-weight: 700; }
.backup input[type="file"] { display: block; width: 100%; margin-top: 5px; color: #475569; font-size: 11px; }
footer { margin-top: 8px; padding: 14px 16px; background: #f8fafc; }
.footer-inner { display: flex; flex-wrap: wrap; gap: 8px; color: #64748b; font-size: 10px; line-height: 1.5; }
.footer-inner b { color: #1e293b; }
.footer-inner p { width: 100%; margin: 0; }
.footer-inner a { margin-left: auto; color: #047857; font-weight: 700; text-decoration: none; }
[hidden] { display: none !important; }
@media (min-width: 400px) {
    .form-row { grid-template-columns: 1fr 1fr; gap: 10px; }
}
