:root {
    color-scheme: light;
    --ink: #123047;
    --muted: #667d8c;
    --line: #dcebee;
    --surface: #ffffff;
    --canvas: #f4fafb;
    --teal: #0aa5a8;
    --teal-dark: #087f8c;
    --teal-soft: #e3f8f7;
    --blue: #2f80ed;
    --gold: #f1b83b;
    --green: #20a66a;
    --red: #e45858;
    --orange: #f1873f;
    --shadow: 0 18px 50px rgb(31 83 94 / 10%);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--canvas);
    color: var(--ink);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: hidden; }
body { margin: 0; min-width: 320px; overflow-x: hidden; background: var(--canvas); }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

.site-header {
    min-height: 76px;
    padding: 12px max(24px, calc((100vw - 1240px) / 2));
    display: flex;
    align-items: center;
    gap: 30px;
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgb(255 255 255 / 92%);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; margin-right: auto; }
.brand-mark {
    width: 43px; height: 43px; display: grid; place-items: center;
    border-radius: 14px; color: white; font-size: 22px; font-weight: 900;
    background: linear-gradient(145deg, var(--teal), #56c7bd);
    box-shadow: 0 9px 24px rgb(10 165 168 / 25%);
}
.brand strong, .brand small { display: block; }
.brand strong { font-size: 18px; letter-spacing: -.02em; }
.brand small { color: var(--muted); font-size: 11px; margin-top: 1px; }
.top-nav, .header-tools { display: flex; align-items: center; gap: 8px; }
.top-nav { min-width:0;overflow-x:auto;scrollbar-width:none }
.top-nav::-webkit-scrollbar { display:none }
.brand,.header-tools { flex-shrink:0 }
.top-nav > a { padding: 10px 12px; border-radius: 12px; font-size: 14px; font-weight: 650; color: #496273; }
.top-nav > a:hover { color: var(--teal-dark); background: var(--teal-soft); }
.header-tools { padding-left: 14px; border-left: 1px solid var(--line); }
.header-tools > a:not(.avatar-mini) { font-size: 11px; font-weight: 800; color: #79909d; }
.header-tools > a.active { color: var(--teal-dark); }
.avatar-mini {
    width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%;
    color: white; background: var(--ink); font-weight: 800;
}
.life-pill {
    display: inline-flex; align-items: center; gap: 4px; padding: 8px 11px;
    border-radius: 99px; color: var(--red); background: #fff0f0; font-weight: 800;
}

.page-shell { width: min(1240px, calc(100% - 40px)); min-height: calc(100vh - 142px); margin: 0 auto; padding: 38px 0 72px; }
.site-footer {
    width: min(1240px, calc(100% - 40px)); margin: auto; padding: 24px 0;
    border-top: 1px solid var(--line); display: flex; justify-content: space-between;
    color: var(--muted); font-size: 13px;
}
.flash {
    width: min(720px, calc(100% - 32px)); margin: 16px auto 0; padding: 13px 16px;
    border-radius: 12px; text-align: center; font-weight: 650;
}
.flash-success { color: #087446; background: #ddf7e9; }
.flash-error { color: #a63838; background: #ffe4e4; }

.button {
    border: 0; border-radius: 14px; padding: 13px 20px; display: inline-flex;
    align-items: center; justify-content: center; gap: 8px; color: white;
    background: linear-gradient(135deg, var(--teal), #0e8f9c); font-weight: 800;
    box-shadow: 0 8px 20px rgb(10 165 168 / 22%); transition: .2s ease;
}
.button:hover { transform: translateY(-1px); box-shadow: 0 12px 26px rgb(10 165 168 / 28%); }
.button:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.button-small { padding: 9px 13px; border-radius: 11px; font-size: 13px; }
.button-block { width: 100%; }
.button-ghost { color: var(--teal-dark); background: var(--teal-soft); box-shadow: none; }
.button-danger { color: #b54141; background: #ffebeb; box-shadow: none; }
.text-link { color: var(--teal-dark); font-size: 14px; font-weight: 700; }
.eyebrow { display: block; color: var(--teal-dark); font-size: 11px; font-weight: 900; letter-spacing: .13em; text-transform: uppercase; }
.status-chip {
    display: inline-flex; padding: 5px 9px; border-radius: 99px;
    color: var(--teal-dark); background: var(--teal-soft); font-size: 11px; font-weight: 800;
}

.hero { min-height: 590px; display: grid; grid-template-columns: 1.15fr .85fr; align-items: center; gap: 80px; padding: 35px 4%; }
.hero > *, .dashboard-grid > *, .profile-grid > *, .teacher-layout > * { min-width: 0; }
.hero h1 { max-width: 760px; margin: 18px 0; font-size: clamp(42px, 6vw, 76px); line-height: 1.02; letter-spacing: -.055em; }
.hero-copy > p { max-width: 650px; color: var(--muted); font-size: 19px; line-height: 1.65; }
.hero-actions, .trust-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.trust-row { gap: 22px; color: #5c7785; font-size: 13px; }
.teacher-card {
    max-width: 430px; padding: 38px; position: relative; text-align: center;
    border: 1px solid var(--line); border-radius: 32px; background: linear-gradient(160deg,#fff,#effcfa);
    box-shadow: var(--shadow); transform: rotate(1deg);
}
.teacher-avatar {
    width: 116px; height: 116px; margin: auto; display: grid; place-items: center;
    border: 8px solid #d6f5f2; border-radius: 50%; color: white; background: var(--teal);
    font-size: 50px; font-weight: 900;
}
.online-dot { width: 16px; height: 16px; position: absolute; top: 122px; left: calc(50% + 40px); border: 3px solid white; border-radius: 50%; background: var(--green); }
.teacher-card h2 { margin: 16px 0 4px; }
.teacher-card > p { margin: 0; color: var(--muted); }
.chat-preview { margin-top: 28px; display: grid; gap: 10px; text-align: left; }
.chat-preview span { max-width: 88%; padding: 12px 14px; border-radius: 15px 15px 15px 4px; background: white; box-shadow: 0 6px 20px rgb(20 70 80 / 8%); }
.chat-preview .chat-answer { margin-left: auto; color: white; border-radius: 15px 15px 4px; background: var(--teal); }
.feature-grid, .course-grid, .achievement-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 20px; }
.feature-grid article, .panel, .course-card, .achievement-card {
    border: 1px solid var(--line); border-radius: 22px; background: var(--surface); box-shadow: 0 9px 30px rgb(31 83 94 / 6%);
}
.feature-grid article { padding: 28px; }
.feature-grid h3 { margin: 16px 0 8px; }
.feature-grid p { margin: 0; color: var(--muted); line-height: 1.6; }
.feature-icon { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 13px; color: var(--teal-dark); background: var(--teal-soft); font-weight: 900; }

.auth-layout { min-height: 660px; display: grid; grid-template-columns: 1fr minmax(390px,520px); align-items: center; gap: 80px; padding: 30px 8%; }
.auth-aside h1 { max-width: 620px; margin: 16px 0; font-size: clamp(38px,5vw,62px); line-height: 1.05; letter-spacing: -.045em; }
.auth-aside p { max-width: 500px; color: var(--muted); font-size: 18px; line-height: 1.6; }
.form-card, .settings-form { padding: 34px; border: 1px solid var(--line); border-radius: 24px; background: white; box-shadow: var(--shadow); }
.form-card h1, .form-card h2 { margin-top: 0; }
.form-card label, .settings-form label { display: grid; gap: 7px; margin: 15px 0; color: #344f61; font-size: 13px; font-weight: 750; }
input, select, textarea {
    width: 100%; border: 1px solid #cfe1e5; border-radius: 12px; padding: 12px 13px;
    outline: none; color: var(--ink); background: #fbfefe; transition: .2s;
}
input:focus, select:focus, textarea:focus { border-color: var(--teal); box-shadow: 0 0 0 4px rgb(10 165 168 / 10%); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-error, .field-error { color: #ac3e3e; }
.form-error { padding: 11px; border-radius: 10px; background: #ffeded; }
.form-note { margin: 18px 0 0; text-align: center; color: var(--muted); font-size: 14px; }
.form-note a { color: var(--teal-dark); font-weight: 800; }
.narrow-page { width: min(100%,550px); margin: 60px auto; }

.dashboard-hero, .page-heading, .course-banner {
    display: flex; align-items: end; justify-content: space-between; gap: 28px; margin-bottom: 28px;
}
.dashboard-hero h1, .page-heading h1, .course-banner h1 { margin: 8px 0; font-size: clamp(34px,4vw,54px); line-height: 1.08; letter-spacing: -.04em; }
.dashboard-hero p, .page-heading p, .course-banner p { margin: 0; color: var(--muted); }
.metric-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; margin-bottom: 20px; }
.metric-card { padding: 20px; display: flex; align-items: center; gap: 14px; border: 1px solid #ccecec; border-radius: 18px; background: #edfbfa; }
.metric-card > span { width: 43px; height: 43px; display: grid; place-items: center; border-radius: 13px; color: var(--teal-dark); background: white; }
.metric-card strong, .metric-card small { display: block; }
.metric-card strong { font-size: 24px; }
.metric-card small { margin-top: 2px; color: var(--muted); }
.inline-action { padding:0;border:0;color:var(--teal-dark);background:transparent;font-weight:900 }
.metric-card.gold { background:#fff8e8;border-color:#f6e2ad}.metric-card.gold>span{color:#c98b00}
.metric-card.red { background:#fff1f1;border-color:#f5d0d0}.metric-card.red>span{color:var(--red)}
.metric-card.orange { background:#fff5ec;border-color:#f6dac3}.metric-card.orange>span{color:var(--orange)}
.dashboard-grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: 20px; }
.panel { padding: 26px; }
.panel h2 { margin: 7px 0 12px; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.progress-panel { grid-row: span 1; }
.progress-track { height: 10px; overflow: hidden; border-radius: 99px; background: #e5f0f2; }
.progress-track span { height: 100%; display: block; border-radius: inherit; background: linear-gradient(90deg,var(--teal),#50c6ac); }
.gold-track span { background: linear-gradient(90deg,var(--gold),#ffd875); }
.split-stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; margin: 22px 0; }
.split-stats span { display: grid; gap: 3px; color: var(--muted); font-size: 12px; }
.split-stats strong { color: var(--ink); font-size: 22px; }
.daily-panel { background: linear-gradient(145deg,#fff,#fffbef); }
.week-chart { height: 180px; padding-top: 20px; display: flex; align-items: end; gap: 11px; }
.week-chart div { height: 100%; flex: 1; display: flex; flex-direction: column; justify-content: end; align-items: center; gap: 8px; }
.week-chart span { width: min(28px,80%); min-height: 8px; border-radius: 8px 8px 3px 3px; background: var(--teal); }
.week-chart small { color: var(--muted); font-size: 10px; }
.month-chart { height:220px;display:flex;align-items:end;gap:5px;padding-top:25px }
.month-chart div { flex:1;height:100%;display:flex;align-items:end }
.month-chart span { width:100%;min-height:8px;border-radius:5px 5px 2px 2px;background:linear-gradient(var(--teal),#66cfbc) }
.achievement-mini-list { display: grid; gap: 12px; }
.achievement-mini-list > div { display: flex; gap: 12px; padding: 12px; border-radius: 14px; background: var(--canvas); }
.achievement-mini-list strong, .achievement-mini-list small { display: block; }
.achievement-mini-list small { margin-top: 3px; color: var(--muted); }

.profile-grid { display: grid; grid-template-columns: 320px 1fr; gap: 22px; }
.profile-summary { align-self: start; text-align: center; }
.profile-summary > p { color: var(--muted); }
.avatar-large { width: 112px; height: 112px; margin: 0 auto 14px; object-fit: cover; border: 6px solid var(--teal-soft); border-radius: 50%; }
.avatar-fallback { display:grid;place-items:center;color:white;background:var(--teal);font-size:42px;font-weight:900}
.profile-numbers { display: grid; grid-template-columns:1fr 1fr; gap:10px; margin:22px 0; }
.profile-numbers span { padding:12px;border-radius:12px;background:var(--canvas);font-size:11px;color:var(--muted) }
.profile-numbers strong { display:block;color:var(--ink);font-size:20px }
.settings-form { box-shadow:none }
.settings-form hr { margin:28px 0;border:0;border-top:1px solid var(--line) }
.checkbox { display:flex!important;grid-template-columns:auto 1fr!important;align-items:center }
.checkbox input { width:auto }

.achievement-grid { grid-template-columns:repeat(2,1fr) }
.achievement-card { padding:24px;display:flex;gap:18px }
.achievement-icon { flex:0 0 58px;height:58px;display:grid;place-items:center;border-radius:18px;background:#fff5d7;font-size:28px }
.achievement-card h2 { margin:10px 0 6px }
.achievement-card p { margin:0 0 12px;color:var(--muted);line-height:1.5 }
.locked-achievement { opacity:.55;filter:grayscale(.65) }
.locked-achievement .achievement-icon { background:#edf3f4 }

.course-grid { grid-template-columns:repeat(2,1fr) }
.course-card { padding:28px;display:grid;gap:20px }
.course-level { width:70px;height:70px;display:grid;place-items:center;border-radius:22px;color:white;background:linear-gradient(145deg,var(--teal),var(--blue));font-size:24px;font-weight:900;box-shadow:0 12px 25px rgb(10 165 168 / 22%) }
.course-card h2 { margin:12px 0 7px;font-size:28px }
.course-card p { margin:0;color:var(--muted);line-height:1.55 }
.course-banner { justify-content:flex-start;align-items:center;padding:30px;border-radius:25px;background:linear-gradient(130deg,#def8f5,#edf5ff) }
.lesson-map { display:grid;gap:22px }
.section-block { padding:24px;border:1px solid var(--line);border-radius:22px;background:white }
.section-block>header { display:flex;align-items:center;gap:14px;margin-bottom:16px }
.section-block>header span { width:38px;height:38px;display:grid;place-items:center;border-radius:12px;color:var(--teal-dark);background:var(--teal-soft);font-weight:900 }
.section-block h2 { margin:0 }
.lesson-list { display:grid;gap:9px }
.lesson-row { display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:14px;padding:14px;border-radius:15px;background:#f7fbfc }
.lesson-state { width:38px;height:38px;display:grid;place-items:center;border-radius:50%;color:white;background:var(--teal);font-size:13px;font-weight:900 }
.lesson-row strong,.lesson-row small { display:block }
.lesson-row small { margin-top:4px;color:var(--muted) }
.lesson-done .lesson-state { background:var(--green) }
.lesson-locked { opacity:.58 }
.lesson-locked .lesson-state { color:#78909c;background:#e4edef }

.lesson-shell { width:min(860px,100%);margin:auto }
.lesson-header { display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:18px }
.lesson-header h1 { margin:5px 0 0;font-size:27px }
.close-lesson { width:42px;height:42px;display:grid;place-items:center;border-radius:50%;background:white;border:1px solid var(--line);font-size:24px }
.lesson-progress { height:9px;margin:22px 0;border-radius:99px;background:#dfecef;overflow:hidden }
.lesson-progress span { height:100%;display:block;border-radius:inherit;background:var(--teal);transition:.35s }
.lesson-theory { margin:18px 0;padding:18px 20px;line-height:1.65 }
.lesson-theory summary { cursor:pointer;font-weight:800;color:var(--ink) }
.lesson-theory[open] summary { margin-bottom:12px }
.lesson-theory div { color:var(--muted) }
.exercise-card { min-height:470px;padding:38px;border:1px solid var(--line);border-radius:26px;background:white;box-shadow:var(--shadow) }
.exercise-counter { color:var(--teal-dark);font-size:12px;font-weight:900;letter-spacing:.12em }
.exercise-card>h2 { min-height:68px;margin:14px 0 25px;font-size:27px;line-height:1.35 }
.answer-options { display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-bottom:22px }
.answer-option,.word-builder button { padding:15px;border:1px solid #cfe0e4;border-radius:14px;color:var(--ink);background:#fbfefe;font-weight:700 }
.answer-option:hover,.answer-option.selected { border-color:var(--teal);background:var(--teal-soft);color:var(--teal-dark) }
.answer-field { min-height:120px;margin-bottom:22px;resize:vertical;font-size:17px }
.word-builder { min-height:64px;display:flex;flex-wrap:wrap;gap:9px;padding:10px;margin-bottom:14px;border-radius:15px;background:#f3f8f9 }
.chosen-words { border:2px dashed #bcdadd;background:white }
.exercise-feedback { margin:15px 0;padding:16px;border-radius:14px }
.exercise-feedback strong { font-size:18px }
.exercise-feedback p { margin:6px 0 0 }
.feedback-correct { color:#087446;background:#dff8eb }
.feedback-error { color:#9e3d3d;background:#ffeded }
.completion-screen { max-width:600px;margin:15px auto;text-align:center }
.completion-icon { width:90px;height:90px;margin:auto;display:grid;place-items:center;border-radius:50%;color:white;background:var(--gold);font-size:42px }
.completion-stats { display:grid;grid-template-columns:1fr 1fr;gap:12px;margin:28px 0 }
.completion-stats span { padding:17px;border-radius:14px;background:var(--canvas);color:var(--muted);font-size:12px }
.completion-stats strong { display:block;color:var(--ink);font-size:22px }
.lesson-achievements { display:grid;gap:8px;margin:-10px 0 22px }
.lesson-achievements span { padding:10px;border-radius:12px;background:#fff7dc;font-weight:750 }
.empty-state { margin-top:30px;text-align:center }
.empty-icon { font-size:55px;color:var(--red) }
.teacher-layout { min-height:680px;display:grid;grid-template-columns:300px 1fr;border:1px solid var(--line);border-radius:26px;background:white;overflow:hidden;box-shadow:var(--shadow) }
.scenario-panel { padding:24px;border-right:1px solid var(--line);background:#f8fcfc }
.aisha-profile { display:flex;align-items:center;gap:12px;padding-bottom:20px;border-bottom:1px solid var(--line) }
.small-avatar { width:58px;height:58px;margin:0;border-width:4px;font-size:25px }
.aisha-profile strong,.aisha-profile small { display:block }.aisha-profile small{margin-top:4px;color:var(--green)}.aisha-profile i{display:inline-block;width:7px;height:7px;margin-right:5px;border-radius:50%;background:var(--green)}
.scenario-panel h2 { margin:24px 0 12px;font-size:16px }
.scenario-panel>label { display:grid;gap:7px;margin-top:20px;font-size:12px;font-weight:800 }
.scenario-list { display:grid;gap:7px }
.scenario-list button { width:100%;display:flex;align-items:center;gap:10px;padding:11px;border:1px solid transparent;border-radius:13px;text-align:left;color:var(--ink);background:transparent }
.scenario-list button:hover,.scenario-list button.active { border-color:#bfe5e4;background:var(--teal-soft) }
.scenario-list button>span:first-child { width:35px;height:35px;display:grid;place-items:center;border-radius:10px;background:white }
.scenario-list strong,.scenario-list small { display:block }.scenario-list small{margin-top:2px;color:var(--muted)}
.chat-panel { min-width:0;display:grid;grid-template-rows:auto 1fr auto auto auto;height:720px }
.chat-panel>header { padding:19px 24px;display:flex;justify-content:space-between;align-items:center;border-bottom:1px solid var(--line) }
.chat-panel h1 { margin:3px 0 0;font-size:21px }
.icon-button { width:38px;height:38px;border:1px solid var(--line);border-radius:12px;background:white;font-size:18px }
.chat-empty { align-self:center;max-width:500px;margin:auto;padding:30px;text-align:center;color:var(--muted) }.chat-empty h2{color:var(--ink)}
.chat-messages { overflow-y:auto;padding:25px;display:flex;flex-direction:column;gap:15px;background:linear-gradient(#fff,#fbfefe) }
.chat-row { display:flex;align-items:end;gap:9px;max-width:78% }.chat-user{margin-left:auto;flex-direction:row-reverse}
.message-avatar { flex:0 0 32px;height:32px;display:grid;place-items:center;border-radius:50%;color:white;background:var(--teal);font-size:12px;font-weight:900 }.chat-user .message-avatar{background:var(--ink)}
.message-bubble { padding:12px 14px;border-radius:17px 17px 17px 5px;background:#edf7f7;box-shadow:0 5px 16px rgb(30 80 90 / 6%) }.chat-user .message-bubble{color:white;border-radius:17px 17px 5px;background:var(--teal)}
.message-bubble p{margin:0;line-height:1.5}.message-bubble small,.message-bubble time{display:block;margin-top:7px;opacity:.68}.message-bubble time{font-size:9px;text-align:right}
.correction { margin-top:9px;padding:8px;border-radius:9px;color:#087446;background:#dff8eb;font-weight:750 }.chat-user .correction{color:inherit;background:rgb(255 255 255 / 15%)}
.typing { padding:7px 25px;color:var(--muted);font-size:12px }.typing span{display:inline-block;width:6px;height:6px;margin-right:2px;border-radius:50%;background:var(--teal);animation:pulse 1s infinite}.typing span:nth-child(2){animation-delay:.15s}.typing span:nth-child(3){animation-delay:.3s}
@keyframes pulse{50%{opacity:.25;transform:translateY(-2px)}}
.quick-replies { padding:7px 22px;display:flex;gap:7px;overflow-x:auto }.quick-replies button{white-space:nowrap;padding:8px 11px;border:1px solid #bfe2e2;border-radius:99px;color:var(--teal-dark);background:white;font-weight:700}
.chat-composer { padding:15px 20px;display:grid;grid-template-columns:1fr auto;gap:10px;border-top:1px solid var(--line) }.chat-composer textarea{min-height:48px;max-height:100px;resize:none}.chat-composer .button{width:48px;padding:0}
.filter-bar { margin-bottom:20px;padding:14px;display:grid;grid-template-columns:2fr 1.3fr .7fr 1fr auto auto;gap:9px;border:1px solid var(--line);border-radius:18px;background:white }
.favorite-filter { display:flex;align-items:center;gap:5px;padding:0 8px;color:var(--gold);font-size:20px }.favorite-filter input{width:auto}
.word-grid { display:grid;grid-template-columns:repeat(3,1fr);gap:16px }
.word-card { position:relative;padding:22px;border:1px solid var(--line);border-radius:19px;background:white;box-shadow:0 8px 25px rgb(31 83 94 / 5%) }
.word-card h2{margin:15px 0 2px;font-size:27px}.word-card>strong{display:block;margin:12px 0}.word-card p{margin:16px 0 3px;padding-top:13px;border-top:1px solid var(--line);line-height:1.45}.word-card>small,.pronunciation{color:var(--muted)}
.favorite-button { position:absolute;right:16px;top:16px;border:0;color:#c8d4d6;background:transparent;font-size:24px }.favorite-button.active{color:var(--gold)}
.word-status { margin-top:15px;padding:6px 9px;display:inline-flex;border-radius:99px;font-size:11px;font-weight:800;background:#edf3f4;color:var(--muted) }.status-learning{color:#a56d00;background:#fff3d1}.status-learned{color:#087446;background:#dff8eb}
.material-filter { grid-template-columns:2fr 1.3fr .7fr auto }
.material-grid { display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px }
.material-card { padding:0;overflow:hidden }
.material-image { width:100%;height:230px;display:block;object-fit:cover;background:#e7f0f1 }
.material-card-body { padding:24px }
.material-card h2,.reading-card h2 { margin:14px 0 12px;font-size:27px }
.material-text,.reading-text { color:#294653;line-height:1.72 }
.material-examples { margin-top:20px;padding:17px;border-left:4px solid var(--gold);border-radius:0 13px 13px 0;background:#fff8df;line-height:1.7 }
.material-examples strong { display:block;margin-bottom:7px;color:#805b00 }
.reading-list { display:grid;gap:20px }
.reading-card { padding:0;display:grid;grid-template-columns:minmax(250px,34%) 1fr;overflow:hidden }
.reading-card-no-image { grid-template-columns:1fr }
.reading-image { width:100%;height:100%;min-height:330px;object-fit:cover;background:#e7f0f1 }
.reading-content { padding:28px }
.reading-intro { margin:0 0 18px;color:var(--muted);font-size:15px }
.reading-questions { margin-top:22px;padding:15px 17px;border-radius:13px;background:var(--teal-soft) }
.reading-questions summary { cursor:pointer;color:var(--teal-dark);font-weight:850 }
.reading-questions[open] summary { margin-bottom:11px }
.reading-questions div { line-height:1.7 }
.literature-heading h1 { max-width:850px }
.literature-list { display:grid;gap:22px }
.literature-card { padding:0;display:grid;grid-template-columns:minmax(250px,32%) 1fr;overflow:hidden }
.literature-card-no-image { grid-template-columns:1fr }
.literature-image { width:100%;height:100%;min-height:430px;object-fit:cover;background:#efe9df }
.literature-content { padding:30px }
.literature-meta { display:flex;align-items:center;justify-content:space-between;gap:12px;color:var(--muted);font-size:12px }
.literature-author { margin:18px 0 3px;color:#9a682c;font-size:14px;font-weight:850;text-transform:uppercase;letter-spacing:.06em }
.literature-card h2 { margin:4px 0 12px;font-family:Georgia,"Times New Roman",serif;font-size:31px }
.literature-excerpt { margin:22px 0;padding:18px 21px;border-left:4px solid #b9874b;border-radius:0 13px 13px 0;color:#3b3028;background:#faf5ed;font:italic 16px/1.75 Georgia,"Times New Roman",serif }
.literature-details { margin-top:13px;padding:14px 17px;border:1px solid #d9e7e9;border-radius:13px;background:#f8fbfb }
.literature-details summary { cursor:pointer;color:var(--teal-dark);font-weight:850 }
.literature-details[open] summary { margin-bottom:10px }
.literature-details div { line-height:1.7 }
.literature-questions { border-color:#ead9b9;background:#fffaf0 }
.tabs { display:flex;padding:4px;border-radius:13px;background:#e8f1f2 }.tabs a{padding:9px 13px;border-radius:10px;color:var(--muted);font-size:13px;font-weight:800}.tabs a.active{color:var(--teal-dark);background:white;box-shadow:0 3px 10px rgb(30 80 90 / 9%)}
.leaderboard { padding:8px 20px }
.leader-row { display:grid;grid-template-columns:55px 1fr 90px 70px 100px;align-items:center;gap:10px;padding:14px;border-bottom:1px solid var(--line) }.leader-row:last-child{border:0}
.leader-head { color:var(--muted);font-size:11px;font-weight:800;text-transform:uppercase }
.leader-name { display:flex;align-items:center;gap:10px }.leader-name img,.leader-name i{width:38px;height:38px;display:grid;place-items:center;object-fit:cover;border-radius:50%;color:white;background:var(--teal);font-style:normal;font-weight:900}
.current-leader { border-radius:13px;background:var(--teal-soft) }
.admin-body { background:#f2f6f7 }
.admin-header { min-height:70px;padding:10px 24px;display:flex;align-items:center;gap:25px;position:sticky;top:0;z-index:30;border-bottom:1px solid var(--line);background:#102f40;color:white }
.admin-header .brand small{color:#9bb1bc}.admin-header .brand-mark{width:38px;height:38px}
.admin-header nav { flex:1;display:flex;align-items:center;gap:3px;overflow-x:auto }
.admin-header nav a { white-space:nowrap;padding:9px 10px;border-radius:9px;color:#c6d6dd;font-size:12px;font-weight:700 }.admin-header nav a:hover{color:white;background:rgb(255 255 255 / 10%)}
.admin-user { display:flex;align-items:center;gap:10px;white-space:nowrap;font-size:12px }.admin-user form{margin:0}.admin-user button{border:0;color:#ffb8b8;background:transparent}
.admin-shell { width:min(1440px,calc(100% - 40px));margin:auto;padding:30px 0 70px }
.admin-login { width:min(460px,100%);margin:70px auto }.admin-login .text-link{display:block;margin-top:18px;text-align:center}
.admin-heading { display:flex;justify-content:space-between;align-items:end;gap:20px;margin-bottom:22px }.admin-heading h1{margin:5px 0 0;font-size:38px}.admin-heading>div:last-child{display:flex;align-items:center;gap:8px}
.admin-metrics { display:grid;grid-template-columns:repeat(4,1fr);gap:12px;margin-bottom:20px }.admin-metrics article{padding:18px;border:1px solid var(--line);border-radius:17px;background:white}.admin-metrics span,.admin-metrics strong,.admin-metrics small{display:block}.admin-metrics span{margin-bottom:12px}.admin-metrics strong{font-size:27px}.admin-metrics small{margin-top:4px;color:var(--muted)}
.admin-list { display:grid }.admin-list>div{padding:12px 0;display:flex;justify-content:space-between;gap:15px;border-bottom:1px solid var(--line)}.admin-list>div:last-child{border:0}.admin-list span strong,.admin-list span small{display:block}.admin-list small{margin-top:3px;color:var(--muted)}.admin-list a{color:var(--teal-dark);font-weight:750;font-size:13px}
.admin-search { display:flex;gap:7px;margin:0 }.admin-search input,.admin-search select{min-width:230px}
.admin-table-wrap { overflow:auto;border:1px solid var(--line);border-radius:18px;background:white }
.admin-table { width:100%;border-collapse:collapse;font-size:13px }.admin-table th,.admin-table td{padding:13px 14px;text-align:left;border-bottom:1px solid var(--line);vertical-align:middle}.admin-table th{color:var(--muted);background:#f7fafb;font-size:10px;text-transform:uppercase;letter-spacing:.07em}.admin-table tr:last-child td{border:0}.admin-table td strong,.admin-table td small{display:block}.admin-table td small{max-width:380px;margin-top:3px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.row-actions { display:flex;align-items:center;gap:10px }.row-actions form{margin:0}.row-actions a,.row-actions button{padding:0;border:0;color:var(--teal-dark);background:none;font-weight:750;font-size:12px}
.admin-form { max-width:1000px;margin-bottom:22px }.admin-form>label,.admin-form .form-row label{display:grid;gap:7px;margin:12px 0;color:#344f61;font-size:12px;font-weight:750}.admin-form .button{margin-right:7px}
.admin-image-preview { width:min(360px,100%);max-height:230px;margin:10px 0;display:block;border-radius:14px;object-fit:cover }
.admin-content-grid { display:grid;grid-template-columns:1fr 1fr;gap:16px }.admin-content-grid .panel p{color:var(--muted);line-height:1.5}
.code-field { font-family:Consolas,monospace;font-size:13px }
.settings-list { display:grid;margin-bottom:22px }.settings-list label{padding:13px 0;display:grid;grid-template-columns:1fr minmax(220px,420px);align-items:center;gap:20px;border-bottom:1px solid var(--line)}.settings-list strong,.settings-list small{display:block}.settings-list small{margin-top:4px;color:var(--muted)}
.shake { animation:shake .35s }
@keyframes shake { 25%{transform:translateX(-6px)}50%{transform:translateX(6px)}75%{transform:translateX(-3px)} }

@media (max-width: 980px) {
    .site-header { gap:12px;padding-inline:20px }
    .top-nav > a { padding:8px;font-size:12px;white-space:nowrap }
    .hero,.auth-layout { grid-template-columns:1fr;gap:35px;padding-inline:2% }
    .hero { padding-top:60px }
    .teacher-card { margin:auto;width:100% }
    .feature-grid { grid-template-columns:1fr }
    .metric-grid { grid-template-columns:1fr 1fr }
    .dashboard-grid { grid-template-columns:1fr }
    .profile-grid { grid-template-columns:1fr }
    .teacher-layout { grid-template-columns:240px 1fr }
    .word-grid { grid-template-columns:1fr 1fr }
    .material-grid { grid-template-columns:1fr }
    .reading-card { grid-template-columns:1fr }
    .reading-image { height:260px;min-height:0 }
    .literature-card { grid-template-columns:1fr }
    .literature-image { height:300px;min-height:0 }
    .filter-bar { grid-template-columns:1fr 1fr }
    .admin-metrics { grid-template-columns:repeat(3,1fr) }
    .admin-header nav { display:none }
}

@media (max-width: 640px) {
    .site-header { min-height:66px }
    .brand small,.top-nav { display:none }
    .header-tools { gap:6px;padding-left:8px }
    .header-tools .life-pill { display:none }
    .page-shell { width:min(100% - 24px,1240px);padding-top:24px }
    .site-footer { width:calc(100% - 24px);display:grid;gap:7px }
    .hero { min-height:auto;padding:35px 0 }
    .hero h1 { max-width:100%;overflow-wrap:anywhere;font-size:clamp(34px,10vw,40px) }
    .hero-copy>p { font-size:16px }
    .teacher-card { width:auto;max-width:100%;padding:25px }
    .auth-layout { min-height:auto;padding:20px 0 }
    .auth-aside h1 { font-size:38px }
    .form-card,.settings-form { padding:22px }
    .form-row,.metric-grid,.split-stats,.course-grid,.achievement-grid { grid-template-columns:1fr }
    .dashboard-hero,.page-heading { align-items:start;flex-direction:column }
    .metric-grid { gap:10px }
    .profile-summary { display:none }
    .achievement-card { padding:18px }
    .course-banner { align-items:flex-start }
    .lesson-row { grid-template-columns:auto 1fr }
    .lesson-row>a,.lesson-row>.status-chip { grid-column:1/-1 }
    .lesson-header { grid-template-columns:auto 1fr }
    .lesson-header>.life-pill { grid-column:2 }
    .exercise-card { min-height:430px;padding:23px }
    .exercise-card>h2 { font-size:22px }
    .answer-options,.completion-stats { grid-template-columns:1fr }
    .teacher-layout { display:block;overflow:visible;background:transparent;border:0;box-shadow:none }
    .scenario-panel { border:1px solid var(--line);border-radius:18px;margin-bottom:12px }
    .scenario-list { display:flex;overflow-x:auto }.scenario-list button{min-width:155px}
    .chat-panel { height:650px;border:1px solid var(--line);border-radius:18px;background:white;overflow:hidden }
    .word-grid,.filter-bar { grid-template-columns:1fr }
    .leaderboard { overflow-x:auto }.leader-row{min-width:620px}
    .chat-row { max-width:92% }
    .admin-shell { width:calc(100% - 24px) }
    .admin-heading { align-items:flex-start;flex-direction:column }
    .admin-heading>div:last-child,.admin-search { width:100%;flex-wrap:wrap }
    .admin-metrics,.admin-content-grid { grid-template-columns:1fr }
    .settings-list label { grid-template-columns:1fr }
}
