:root {
  color-scheme: light;
  --ink:#242724; --muted:#626a64; --line:#e5e7e1; --paper:#fff;
  --canvas:#f7f8f4; --deep:#193c31; --green:#285542; --mint:#e9f1e8;
  --orange:#e98758; --peach:#fbe3d5; --sans:"Aptos","Segoe UI",system-ui,sans-serif;
  font-family:var(--sans); color:var(--ink); background:var(--canvas); font-size:16px;
}
* { box-sizing:border-box }
body { margin:0; min-width:300px }
button,input,textarea,select { font:inherit }
button,a,input,select,textarea { -webkit-tap-highlight-color:transparent }
button,a { touch-action:manipulation }
button { cursor:pointer }
button:disabled { cursor:wait; opacity:.65 }
a { color:inherit }
button:focus-visible,a:focus-visible,input:focus-visible,textarea:focus-visible,select:focus-visible { outline:3px solid #5f947c; outline-offset:3px }
[hidden] { display:none!important }
p,h1,h2,h3 { margin:0 }
p { line-height:1.55 }
.shell { display:grid; grid-template-columns:252px minmax(0,1fr); min-height:100dvh }
.sidebar { padding:30px 20px 22px; display:flex; flex-direction:column; gap:34px; height:100dvh; position:sticky; top:0; background:var(--paper); border-right:1px solid var(--line); }
.brand { display:flex; gap:12px; align-items:center; text-decoration:none; margin:0 5px; width:max-content }
.brand-mark { display:grid; place-items:center; width:42px; height:42px; border-radius:13px; color:#fff; background:var(--deep) }
.brand-mark svg { width:24px;height:24px }
.brand strong { display:block; font-size:21px; letter-spacing:-.85px; line-height:1 }
.brand small { color:var(--muted); font-size:13px; display:block; margin-top:5px }
.nav { display:grid; gap:5px }
.nav-label { font-size:12px; font-weight:750; letter-spacing:1.15px; color:#69716b; padding:4px 12px 8px; text-transform:uppercase }
.nav a,.nav button { display:flex; align-items:center; gap:11px; text-decoration:none; border:0; background:transparent; color:#4e5851; border-radius:10px; padding:11px 12px; font-weight:550; text-align:left; font-size:15px }
.nav a[aria-current="page"] { color:var(--deep); background:var(--mint); font-weight:720 }
.nav a:hover,.nav button:hover { background:#eef2ec }
.nav svg,.btn svg { width:19px;height:19px;flex:none }
.sidebar-footer { margin-top:auto; display:grid; gap:16px }
.profile { border-top:1px solid var(--line); padding:17px 7px 0; display:flex; align-items:center; gap:11px; color:var(--muted); font-size:14px }
.profile b { color:var(--ink); display:block }
.avatar { display:grid;place-items:center;width:36px;height:36px;border-radius:50%;background:var(--peach);color:#6a3b28;font-weight:760;flex:none }
.stage { min-width:0; }
.topbar { height:72px; display:flex; justify-content:space-between; align-items:center; border-bottom:1px solid var(--line); background:#fff; padding:0 36px; }
.crumb { display:flex; align-items:center; gap:10px; font-size:14px; font-weight:680 }
.crumb span { color:var(--muted); font-weight:500 }
.workspace { padding:32px 36px 50px; max-width:1390px; margin:auto }
.page-heading { display:flex; align-items:flex-end; justify-content:space-between; gap:18px; margin-bottom:24px }
.page-heading p { color:var(--muted); margin-top:8px }
h1 { letter-spacing:-1.5px; font-size:clamp(1.85rem,4vw,2.65rem); line-height:1.1; font-weight:760 }
h2 { font-size:1.38rem; line-height:1.25; letter-spacing:-.38px }
h3 { font-size:1.1rem; line-height:1.35 }
.tag { display:inline-flex; width:max-content; align-items:center; gap:6px; color:var(--deep); background:var(--mint); border-radius:100px; padding:5px 10px; font-size:13px; font-weight:700; white-space:nowrap }
.tag.warm { background:var(--peach);color:#78432f }
.tag.gray { background:#f1f2ee;color:#505951 }
.btn { display:inline-flex; align-items:center; justify-content:center; gap:8px; text-decoration:none; border:1px solid transparent; background:var(--deep); color:#fff; min-height:42px; border-radius:9px; padding:9px 15px; font-weight:680; font-size:14px; line-height:1.3; white-space:nowrap }
.btn:hover { background:var(--green) }
.btn.secondary { background:#fff; color:var(--deep); border-color:#dce2d9 }
.btn.secondary:hover { background:#f2f5ef }
.btn.danger { background:#fff; color:#8a3225; border-color:#e7c5bd }
.btn.danger:hover { background:#fff1ed }
.btn.link { color:var(--deep); background:transparent; padding-inline:0; min-height:30px }
.btn.link:hover { text-decoration:underline }
.hero { display:grid; grid-template-columns:minmax(0,1fr) minmax(225px,33%); background:#193c31; color:#fff; min-height:252px; overflow:hidden; border-radius:17px; margin-bottom:24px }
.hero-copy { padding:29px 34px; align-self:center; z-index:1 }
.hero-copy h2 { font-size:clamp(1.65rem,3.7vw,2.48rem); letter-spacing:-1.2px; margin:12px 0 8px }
.hero-copy p { color:#d9e6de; max-width:42ch; margin-bottom:18px }
.hero .tag { color:#f5e9df; background:#ffffff20 }
.hero .btn { background:#fff; color:var(--deep) }
.hero .btn:hover { background:#eef4ec }
.art { position:relative; display:grid; place-items:center; color:#173b2e; isolation:isolate; background:#f3ad86; min-width:0 }
.art::before,.art::after { content:""; position:absolute; border-radius:50%; border:1px solid #804e3854; width:220px; height:220px; z-index:-1 }
.art::after { width:285px; height:285px }
.art-core { position:relative; display:grid; place-items:center; width:155px; height:155px; border-radius:50%; background:#f8cab0; box-shadow:0 0 0 1px #804e3854; transform:rotate(-10deg) }
.art-core svg { width:74px;height:74px;stroke-width:1.35 }
.spark { position:absolute; display:block; font-size:40px; font-family:Georgia,serif; line-height:1; color:#774733 }
.spark.first { top:26px; right:17% }
.spark.second { bottom:22px; left:14%; font-size:28px }
.stats { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:15px; margin-bottom:30px }
.stat { display:flex; gap:12px; align-items:center; padding:17px; background:#fff; border:1px solid var(--line); border-radius:13px }
.stat-icon { display:grid; place-items:center; width:44px; height:44px; color:var(--deep); background:var(--mint); border-radius:11px; flex:none }
.stat-icon.warm { color:#805037;background:var(--peach) }
.stat-icon svg { width:21px;height:21px }
.stat strong { display:block; font-size:23px;line-height:1.1 }
.stat small { display:block; font-size:14px; color:var(--muted); margin-top:4px }
.section-heading { display:flex; justify-content:space-between; align-items:center; gap:12px; margin-bottom:12px }
.stack { display:grid; gap:14px }
.lesson-row { background:#fff; border:1px solid var(--line); border-radius:13px; padding:16px; display:flex; gap:13px; align-items:center }
.lesson-row h3 { overflow-wrap:anywhere; margin-bottom:4px }
.lesson-row p { color:var(--muted); font-size:14px }
.lesson-row .row-body { flex:1; min-width:0 }
.card { background:#fff; border:1px solid var(--line); padding:22px; border-radius:15px; min-width:0 }
.card h2 { margin-bottom:8px }
.card p,.hint { color:var(--muted) }
.empty { padding:25px; text-align:center; color:var(--muted); background:#fff; border:1px dashed #cfd9cd; border-radius:13px }
.editor-grid { display:grid; grid-template-columns:minmax(0,1fr) minmax(260px,31%); gap:18px; align-items:start }
.fields { display:grid; gap:15px; margin-top:16px }
.field-pair { display:grid; grid-template-columns:minmax(0,1fr) 100px; gap:12px }
label { display:grid; gap:7px; font-weight:650; font-size:14px }
input,select,textarea { min-width:0; width:100%; background:#fff; color:var(--ink); border:1px solid #ccd4ca; padding:10px 11px; border-radius:8px }
textarea { resize:vertical; line-height:1.5 }
input[type="checkbox"] { width:auto; height:17px; accent-color:var(--deep) }
input[type="file"] { font-size:14px; padding:8px }
input::file-selector-button { background:var(--mint); color:var(--deep); border:0; padding:8px; border-radius:5px; margin-right:8px; cursor:pointer }
.check { display:flex; align-items:center; gap:8px }
.hint { font-size:14px; font-weight:400 }
.actions { display:flex; align-items:center; gap:9px; flex-wrap:wrap }
.error { margin:10px 0; color:#8a3225; line-height:1.5; overflow-wrap:anywhere }
.back { margin-bottom:16px }
.picker { border:1px solid var(--line); border-radius:9px; background:#f8f9f5; padding:12px; line-height:2.25; white-space:pre-wrap; overflow-wrap:anywhere; max-height:380px; overflow:auto }
.word { border:1px solid #d7dfd4; border-radius:5px; background:white; padding:0 4px; font-size:15px; line-height:1.65; color:var(--ink); max-width:100%; overflow-wrap:anywhere }
.word[aria-pressed="true"] { color:#fff; background:var(--deep); border-color:var(--deep) }
.invites { max-height:340px; overflow:auto }
.invite { display:flex; align-items:center; justify-content:space-between; gap:8px; padding:8px 0; border-top:1px solid var(--line); overflow-wrap:anywhere }
.invite .actions { flex-wrap:nowrap }
.invite .btn { padding:6px 9px; min-height:32px }
.table-wrap { overflow:auto; border:1px solid var(--line); border-radius:14px; background:#fff }
table { width:100%; border-collapse:collapse; font-size:15px }
th,td { text-align:left; padding:13px 16px; border-bottom:1px solid var(--line); vertical-align:middle; overflow-wrap:anywhere }
th { background:#eef2ec; font-size:14px; color:#3d584a }
tr:last-child td { border-bottom:0 }
.filters { display:flex; align-items:end; gap:12px; margin-bottom:14px; flex-wrap:wrap }
.filters label { width:min(100%,240px) }
dialog { width:min(690px,calc(100% - 26px)); border:1px solid var(--line); border-radius:16px; padding:23px; color:var(--ink); max-height:88dvh }
dialog::backdrop { background:#19372e86 }
dialog .table-wrap { margin-top:16px }
#delete-dialog .actions, #purge-dialog .actions { margin-top:16px }
.deleted-lessons { margin-top:24px }
.deleted-lessons summary { cursor:pointer; font-weight:680; margin-bottom:10px }
.progress-note { margin-bottom:12px }
.lesson-groups { display:grid; gap:25px }
.account-directory { margin-top:25px }
.account-directory>label { max-width:25rem }
.account-fields { display:grid; grid-template-columns:minmax(0,2fr) minmax(0,1fr); gap:12px }
.assignment-list { max-height:205px; overflow:auto }
.assignment-row { display:flex; align-items:center; justify-content:space-between; gap:8px; border-bottom:1px solid var(--line); padding:7px 0 }
@media (max-width:540px) { .account-fields { grid-template-columns:1fr } }
.author-part,.author-block { display:grid; gap:12px; border-top:1px solid var(--line); padding-top:14px }
.author-part>.btn { justify-self:start }
.author-text { display:grid; gap:8px }
.author-question { display:grid; grid-template-columns:minmax(0,1fr) minmax(108px,32%) auto; align-items:end; gap:9px; background:#f6f8f3; border-radius:9px; padding:12px }
.author-question textarea { min-height:43px }
.author-question .btn { justify-self:start }
.author-thumbnail { width:100%; height:95px; object-fit:contain; background:#fff; border-radius:6px }
.picture-bank { display:grid; grid-template-columns:repeat(auto-fit,minmax(125px,1fr)); gap:9px; margin-bottom:14px }
.picture-bank figure { margin:0; padding:8px; border:1px solid var(--line); border-radius:8px; text-align:center }
.picture-bank img { display:block; width:100%; height:125px; object-fit:contain }
.picture-bank figcaption { font-weight:650; margin-top:6px }
@media (max-width:650px) { .author-question { grid-template-columns:1fr } }
.practice-section { margin:22px 0 }
.practice-section h3 { margin-bottom:4px }
.practice-block { border-top:1px solid var(--line); margin-top:14px; padding-top:12px }
.practice-texts { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,220px),1fr)); gap:10px; margin-bottom:12px }
.practice-text { background:var(--mint); padding:13px; border-radius:8px }
.practice-text p { white-space:pre-line; color:var(--ink) }
.practice-choice { grid-template-columns:minmax(0,1fr) minmax(115px,35%); align-items:center; gap:9px; margin:8px 0 }
.practice-gap { display:block; line-height:2.3; margin:4px 0 }
.practice-gap input { width:min(10rem,45%); margin-inline:4px; padding:5px 8px }
.question-number { color:var(--deep); font-weight:750 }
.word-bank { margin-bottom:10px }
[data-answer][aria-invalid="true"] { border-color:#a44938; background:#fff5ef }
@media (max-width:480px) { .practice-choice {grid-template-columns:1fr} }
#progress-dialog details { margin-top:8px }
.student-top { display:flex; align-items:center; justify-content:space-between; gap:10px; background:#fff; padding:15px max(17px,calc((100vw - 950px)/2)); border-bottom:1px solid var(--line) }
.student-main { width:min(890px,100%); margin:auto; padding:30px 20px 50px; display:grid; gap:18px }
.student-title { background:var(--deep); color:#fff; padding:24px; border-radius:15px }
.student-title h1 { margin:11px 0 4px }
.student-title p { color:#d9e6de }
audio { width:100%; margin-top:8px; height:46px }
.gap-text { white-space:pre-wrap; line-height:2.7; overflow-wrap:anywhere; margin:14px 0 }
.gap { display:inline-flex; width:min(150px,100%); margin:0 4px; align-items:center; gap:5px; vertical-align:middle; color:var(--deep); line-height:1.2 }
.gap span { min-width:18px; font-size:13px; text-align:center }
.gap input { padding:6px 8px; background:#f3f7f2 }
.gap input[aria-invalid="true"], .learner-name input[aria-invalid="true"] { border-color:#a44938; background:#fff5ef }
.learner-name { max-width:25rem; margin-bottom:20px }
.listen-part { border-top:1px solid var(--line); margin-top:16px; padding-top:14px }
.listen-part .gap-text { margin-bottom:0 }
.student-deadline { margin-top:9px }
.deadline-closed { color:#8a3225; background:#fff1ed }
.result { background:var(--mint); border-color:#bed5c1 }
.result .table-wrap { margin:12px 0 8px }
.feedback { padding:12px; border:1px solid #dbe6d9; background:#f2f7ef; border-radius:9px }
.loading { padding:30px; color:var(--muted) }
#toast { position:fixed; right:19px; bottom:19px; z-index:20; background:var(--deep); color:#fff; padding:12px 18px; border-radius:9px; box-shadow:0 8px 25px #18271f33; max-width:calc(100% - 38px) }
@media (max-width:1080px) {
  .shell { grid-template-columns:207px minmax(0,1fr) }
  .sidebar { padding-inline:13px }
  .workspace,.topbar { padding-inline:22px }
  .editor-grid { grid-template-columns:minmax(0,1fr) }
}
@media (max-width:760px) {
  .shell { display:block }
  .sidebar { position:static; height:auto; gap:12px; padding:13px 14px 8px; border:0; border-bottom:1px solid var(--line) }
  .sidebar-footer,.nav-label,.topbar { display:none }
  .nav { display:flex; gap:4px; overflow:auto }
  .nav a { white-space:nowrap; padding:8px; font-size:14px; gap:5px }
  .nav svg { width:16px;height:16px }
  .workspace { padding:21px 14px 36px }
  .hero-copy { padding:21px }
  .hero { grid-template-columns:minmax(0,1fr) minmax(95px,24%); min-height:0 }
  .art-core { width:84px;height:84px }
  .art-core svg { width:44px;height:44px }
  .art::before { width:114px;height:114px }
  .art::after { width:150px;height:150px }
  .spark { display:none }
  .stats { gap:7px }
  .stat { display:block; padding:9px }
  .stat-icon { width:30px;height:30px;margin-bottom:7px }
  .stat-icon svg { width:17px;height:17px }
  .stat small { font-size:13px }
  .page-heading { align-items:flex-start; flex-wrap:wrap }
  .lesson-row { gap:8px; flex-wrap:wrap;padding:12px }
  .lesson-row .btn { margin-left:auto }
  .card { padding:15px }
  th,td { padding:9px 10px }
}
.tag svg { width:15px; height:15px }
