/* Lesson Planner — standalone stylesheet (no framework, no build step) */

:root {
  --bg: #f5f8f6; --surface: #fff; --surface-2: #eef3f0; --border: #dde6e0;
  --text: #17211b; --muted: #5d6b62;
  --primary: #166534; --primary-hover: #14532d; --primary-soft: #e6f2ea; --on-primary: #fff;
  --success: #15803d; --success-soft: #e7f7ed;
  --warning: #b45309; --warning-soft: #fff4e0;
  --danger: #c0262d;  --danger-soft: #fdecec;
  --info: #0e7490;    --info-soft: #e3f5f9;
  --lesson: #166534; --exam: #b45309; --project: #0f766e;
  --radius: 14px; --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(10,32,20,.05), 0 4px 14px rgba(10,32,20,.05);
  --shadow-lg: 0 10px 30px rgba(10,32,20,.14);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --nav-h: 60px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c1410; --surface: #131e18; --surface-2: #1a2820; --border: #26382d;
    --text: #e6efe9; --muted: #98aa9f;
    --primary: #4ade80; --primary-hover: #86efac; --primary-soft: #133524; --on-primary: #052e16;
    --success: #4ade80; --success-soft: #133222; --warning: #fbbf24; --warning-soft: #3a2c10;
    --danger: #f87171;  --danger-soft: #3d1a1d;  --info: #22d3ee;    --info-soft: #10303a;
    --lesson: #86efac; --exam: #fbbf24; --project: #5eead4;
    --shadow: 0 1px 2px rgba(0,0,0,.4); --shadow-lg: 0 10px 30px rgba(0,0,0,.5);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.55 var(--font); color: var(--text); background: var(--bg); min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--primary); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--primary-hover); }
h1, h2, h3 { line-height: 1.2; letter-spacing: -.015em; margin: 0 0 .4em; }
h1 { font-size: clamp(24px, 4vw, 32px); font-weight: 750; }
h2 { font-size: 20px; } h3 { font-size: 16px; }
p { margin: 0 0 .8em; }
img { max-width: 100%; height: auto; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--primary) 55%, transparent); outline-offset: 2px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); } .small { font-size: 13px; }
.skip-link { position: absolute; left: -9999px; top: 8px; z-index: 100; background: var(--primary); color: var(--on-primary); padding: 8px 14px; border-radius: 8px; }
.skip-link:focus { left: 12px; }

/* ---------- Shell ---------- */
.topbar { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: saturate(160%) blur(10px); border-bottom: 1px solid var(--border); }
.topbar__inner { max-width: 1320px; margin: 0 auto; padding: 0 16px; min-height: var(--nav-h); display: flex; align-items: center; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 750; font-size: 17px; text-decoration: none; white-space: nowrap; }
.brand:hover { color: var(--text); }
.brand__mark { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: linear-gradient(135deg, var(--primary), #0f766e); color: #fff; flex: none; }
.mainnav { display: flex; align-items: center; gap: 8px; flex: 1; }
.mainnav__list { display: flex; gap: 2px; list-style: none; margin: 0; padding: 0; flex: 1; }
.mainnav__link { display: block; padding: 8px 12px; border-radius: 9px; color: var(--muted); font-weight: 600; text-decoration: none; }
.mainnav__link:hover { background: var(--surface-2); color: var(--text); }
.mainnav__link.is-active { background: var(--primary-soft); color: var(--primary); }
.nav-toggle { display: none; margin-left: auto; width: 42px; height: 42px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); cursor: pointer; }
.nav-toggle__bars, .nav-toggle__bars::before, .nav-toggle__bars::after { display: block; width: 18px; height: 2px; background: var(--text); border-radius: 2px; margin: 0 auto; position: relative; transition: transform .2s; }
.nav-toggle__bars::before, .nav-toggle__bars::after { content: ""; position: absolute; left: 0; }
.nav-toggle__bars::before { top: -6px; } .nav-toggle__bars::after { top: 6px; }
.usermenu { position: relative; }
.usermenu__trigger { list-style: none; display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 6px 10px; border-radius: 10px; font-weight: 600; }
.usermenu__trigger::-webkit-details-marker { display: none; }
.usermenu__trigger:hover { background: var(--surface-2); }
.usermenu__name { max-width: 16ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.usermenu__panel { position: absolute; right: 0; top: calc(100% + 6px); min-width: 200px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; display: grid; }
.usermenu__panel a, .usermenu__panel .linklike { display: block; text-align: left; padding: 9px 12px; border-radius: 8px; color: var(--text); text-decoration: none; font: inherit; width: 100%; }
.usermenu__panel a:hover, .usermenu__panel .linklike:hover { background: var(--surface-2); }
.linklike { background: none; border: 0; cursor: pointer; }
@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .mainnav { display: none; position: absolute; left: 0; right: 0; top: var(--nav-h); background: var(--surface); border-bottom: 1px solid var(--border); box-shadow: var(--shadow-lg); flex-direction: column; align-items: stretch; padding: 8px 12px 14px; }
  .mainnav.is-open { display: flex; }
  .mainnav__list { flex-direction: column; }
  .mainnav__link { padding: 12px 14px; font-size: 16px; }
  .usermenu__panel { position: static; box-shadow: none; border: 0; padding: 0 0 0 36px; }
}

.page { flex: 1 0 auto; width: 100%; max-width: 1320px; margin: 0 auto; padding: 24px 16px 48px; outline: none; display: grid; gap: 20px; align-content: start; }
@media (min-width: 768px) { .page { padding: 32px 28px 64px; } }
.footer { text-align: center; color: var(--muted); font-size: 13px; padding: 18px 16px; border-top: 1px solid var(--border); }
.narrow { max-width: 860px; width: 100%; margin: 0 auto; display: grid; gap: 16px; }

/* ---------- Page header ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.page-head > div:first-child { max-width: 72ch; }
.page-head__id { display: flex; align-items: center; gap: 16px; }
.eyebrow { margin: 0 0 4px; font-size: 13px; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.lede { color: var(--muted); margin: 4px 0 0; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
.section-title { font-size: 17px; margin: 4px 0 -8px; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 38px; padding: 7px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); color: var(--text); font: 600 14px/1.2 var(--font); text-decoration: none; cursor: pointer; transition: background-color .15s, border-color .15s; }
.btn:hover { background: var(--surface-2); color: var(--text); }
.btn--primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.btn--primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: var(--on-primary); }
.btn--ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn--ghost:hover { background: var(--surface-2); color: var(--text); }
.btn--danger-ghost { background: transparent; border-color: transparent; color: var(--danger); }
.btn--danger-ghost:hover { background: var(--danger-soft); color: var(--danger); }
.btn--sm { min-height: 30px; padding: 4px 10px; font-size: 13px; border-radius: 8px; }
.btn--block { width: 100%; }
.btn:disabled { opacity: .6; cursor: progress; }
.inline-form { display: inline; margin: 0; }

/* ---------- Forms ---------- */
.form { display: grid; gap: 16px; }
.stack { display: grid; gap: 14px; }
.field { display: grid; gap: 5px; min-width: 0; }
.field__label { font-weight: 650; font-size: 14px; }
.field__req { color: var(--danger); }
.field__help { margin: 0; color: var(--muted); font-size: 13px; }
.field__errors { margin: 0; padding: 0; list-style: none; color: var(--danger); font-size: 13px; font-weight: 600; }
.field--error .input { border-color: var(--danger); }
.field--check { display: flex; align-items: center; gap: 10px; }
.field--check label { font-weight: 550; cursor: pointer; }
.input { width: 100%; min-height: 40px; padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font: inherit; }
textarea.input { min-height: 96px; resize: vertical; }
select.input { appearance: auto; }
.input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 22%, transparent); }
.check { width: 20px; height: 20px; accent-color: var(--primary); margin: 0; flex: none; }
.fieldset { border: 1px solid var(--border); border-radius: 12px; padding: 12px 16px 16px; margin: 0; display: grid; gap: 12px; }
.fieldset legend { font-weight: 700; padding: 0 6px; }
.weights-total.is-off { color: var(--warning); }
.form-actions { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 4px; }
.grid-2, .grid-3, .grid-4 { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 900px) { .grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.inline-fields { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.inline-check { display: inline-flex; gap: 6px; align-items: center; font-weight: 550; }
.grow { flex: 1 1 220px; }
.filter-bar { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; }
.filter-bar .field { min-width: 160px; }

/* Rich-text editor (Quill) */
.ql-toolbar.ql-snow, .ql-container.ql-snow { border-color: var(--border) !important; background: var(--surface); }
.ql-toolbar.ql-snow { border-radius: var(--radius-sm) var(--radius-sm) 0 0; }
.ql-container.ql-snow { border-radius: 0 0 var(--radius-sm) var(--radius-sm); font: inherit; min-height: 140px; }
.ql-editor { min-height: 140px; color: var(--text); }
.ql-snow .ql-stroke { stroke: var(--muted); } .ql-snow .ql-fill { fill: var(--muted); } .ql-snow .ql-picker { color: var(--muted); }
.ql-editor.ql-blank::before { color: var(--muted); font-style: normal; }

/* ---------- Surfaces ---------- */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.panel.subtle { box-shadow: none; background: var(--surface-2); border-color: transparent; }
.panel > summary { cursor: pointer; font-weight: 650; }
.alert { border-radius: 12px; padding: 12px 16px; font-weight: 550; background: var(--info-soft); color: var(--info); }
.alert--success { background: var(--success-soft); color: var(--success); }
.alert--danger, .alert--error { background: var(--danger-soft); color: var(--danger); }
.alert--warning { background: var(--warning-soft); color: var(--warning); }
.empty { text-align: center; padding: 40px 20px; background: var(--surface); border: 1px dashed var(--border); border-radius: var(--radius); }
.empty p { color: var(--muted); }
.empty-inline { color: var(--muted); padding: 12px 0 2px; margin: 0; }
.danger-zone { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; border-top: 1px solid var(--border); padding-top: 14px; }

/* Breadcrumbs */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; padding: 10px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
.crumbs ol { display: flex; flex-wrap: wrap; align-items: flex-end; list-style: none; margin: 0; padding: 0; gap: 4px 0; min-width: 0; }
.crumbs li { display: inline-flex; flex-direction: column; min-width: 0; }
.crumbs li + li { padding-left: 22px; position: relative; }
.crumbs li + li::before { content: "›"; position: absolute; left: 7px; bottom: 0; color: var(--muted); font-size: 16px; line-height: 1.4; }
.crumbs a, .crumbs li > span:last-child { font-weight: 650; max-width: 28ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 1.4; }
.crumbs li[aria-current] > span:last-child { color: var(--muted); }
.crumbs__kind { font-size: 10px; font-weight: 750; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); line-height: 1.2; }
@media (max-width: 600px) { .crumbs a, .crumbs li > span:last-child { max-width: 16ch; } }

/* Pills, tags, status */
.pill, .count { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 650; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.pill--accent { background: var(--primary-soft); color: var(--primary); }
.pill--danger { background: var(--danger-soft); color: var(--danger); }
.pill--success { background: var(--success-soft); color: var(--success); }
.tag { display: inline-block; padding: 1px 8px; border-radius: 6px; font-size: 11px; font-weight: 750; text-transform: uppercase; letter-spacing: .05em; color: #fff; background: var(--lesson); }
.tag--exam { background: var(--exam); } .tag--project { background: var(--project); }
@media (prefers-color-scheme: dark) { .tag { color: #10131f; } }
.status { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 650; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.status--success { background: var(--success-soft); color: var(--success); }
.status--danger { background: var(--danger-soft); color: var(--danger); }
.status--warning { background: var(--warning-soft); color: var(--warning); }
.status--info { background: var(--info-soft); color: var(--info); }
.avatar { --student: hsl(var(--hue, 150) 55% 30%); display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; flex: none; background: var(--student); color: #fff; font-weight: 750; font-size: 15px; }
.avatar--sm { width: 28px; height: 28px; border-radius: 50%; font-size: 12px; background: var(--primary); color: var(--on-primary); }
.avatar--lg { width: 56px; height: 56px; border-radius: 16px; font-size: 20px; }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 768px) { .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.stat { background: var(--surface); border: 1px solid var(--border); border-top: 3px solid var(--border); border-radius: var(--radius); padding: 14px 18px; box-shadow: var(--shadow); display: grid; }
.stat__value { font-size: 30px; font-weight: 750; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat__label { color: var(--muted); font-size: 13px; font-weight: 550; }
.stat--accent { border-top-color: var(--primary); } .stat--warning { border-top-color: var(--warning); } .stat--danger { border-top-color: var(--danger); }

/* Student panels */
.student { --student: hsl(var(--hue, 150) 55% 30%); --student-soft: hsl(var(--hue, 150) 40% 94%); padding: 0; overflow: hidden; border-left: 5px solid var(--student); }
@media (prefers-color-scheme: dark) { .student { --student: hsl(var(--hue, 150) 50% 55%); --student-soft: hsl(var(--hue, 150) 30% 15%); } }
.student__head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 18px; cursor: pointer; list-style: none; background: linear-gradient(90deg, var(--student-soft), transparent 70%); }
.student__head::-webkit-details-marker { display: none; }
.student__name { font-size: 18px; font-weight: 700; flex: 1 1 auto; min-width: 8ch; margin: 0; }
.student__meta { display: flex; gap: 6px; flex-wrap: wrap; }
.student__body { padding: 4px 18px 18px; }
.student--static { padding: 18px; }
.chevron { width: 10px; height: 10px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform .2s; margin: 0 4px 4px; }
details[open] > summary .chevron { transform: rotate(-135deg); margin-bottom: -4px; }

/* Toolbar / chips / search */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; padding: 12px 0; }
.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; flex-wrap: wrap; }
.chip { flex: none; border: 1px solid var(--border); background: var(--surface); color: var(--muted); border-radius: 999px; padding: 5px 13px; font: 600 13px var(--font); cursor: pointer; text-decoration: none; }
.chip:hover { background: var(--surface-2); color: var(--text); }
.chip.is-active { background: var(--text); border-color: var(--text); color: var(--surface); }
.search { flex: 1 1 220px; max-width: 340px; margin: 0; }
.search .input { border-radius: 999px; padding-left: 16px; }
@media (max-width: 600px) { .search { max-width: none; } }

/* Task list (dashboard) */
.tasks { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.task { display: grid; gap: 10px 16px; grid-template-columns: 1fr; grid-template-areas: "main" "meta" "toggle"; padding: 14px 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); transition: border-color .15s, background-color .15s, opacity .15s; }
@media (min-width: 768px) { .task { grid-template-columns: 112px minmax(0, 1fr) auto; grid-template-areas: "toggle main meta"; } }
.task.is-current { border-color: color-mix(in srgb, var(--primary) 45%, var(--border)); background: color-mix(in srgb, var(--primary-soft) 55%, var(--surface)); }
.task.is-saving, .check-item.is-saving { opacity: .6; }
[data-task][hidden] { display: none; }
.task__toggle { grid-area: toggle; display: flex; align-items: center; gap: 8px; }
.task__toggle label { font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; }
.task__main { grid-area: main; min-width: 0; }
.task__tags { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-bottom: 6px; }
.task__subject { font-weight: 700; }
.task__unit { color: var(--muted); font-size: 13px; }
.task__unit::before { content: "›"; margin-right: 8px; opacity: .6; }
.task__title { font-weight: 650; margin: 0 0 2px; }
.task__desc { overflow-wrap: anywhere; }
.task__notes { display: block; margin-top: 8px; font-size: 13px; color: var(--muted); background: var(--surface-2); border-radius: 8px; padding: 8px 10px; }
.task__meta { grid-area: meta; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; font-size: 13px; color: var(--muted); }
@media (min-width: 768px) { .task__meta { flex-direction: column; align-items: flex-end; } }
.task__meta .is-stale { color: var(--danger); font-weight: 650; }
.richtext > :last-child { margin-bottom: 0; }
.richtext p { margin: 0 0 .4em; }
.richtext ul, .richtext ol { margin: 0 0 .4em; padding-left: 1.3em; }
.richtext table { display: block; overflow-x: auto; max-width: 100%; }

.switch { appearance: none; flex: none; width: 40px; height: 24px; border-radius: 999px; background: var(--border); position: relative; cursor: pointer; margin: 0; transition: background-color .2s; vertical-align: middle; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s; }
.switch:checked { background: var(--primary); }
.switch:checked::after { transform: translateX(16px); }
.switch:disabled { opacity: .6; cursor: progress; }

/* Weekly board */
.board { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); padding-top: 12px; }
.column { background: var(--surface-2); border-radius: 12px; padding: 12px; min-width: 0; }
.column__title { margin: 0 0 10px; font-size: 15px; display: flex; justify-content: space-between; gap: 8px; }
.cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; position: relative; transition: opacity .2s; }
.card:not(.is-current) { opacity: .45; } .card:not(.is-current) .card__body { text-decoration: line-through; }
.card__top { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.card__unit { margin: 0 0 4px; font-size: 12px; color: var(--muted); font-weight: 650; }
.card__title { margin: 0 0 2px; font-weight: 650; }
.card__body { font-size: 14px; overflow-wrap: anywhere; }
.card__remove { margin-left: auto; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 8px; cursor: pointer; color: var(--muted); font-size: 18px; }
.card__remove:hover { background: var(--danger-soft); color: var(--danger); }
.card__remove:has(input:focus-visible) { outline: 3px solid color-mix(in srgb, var(--primary) 55%, transparent); }
.print-box { display: none; }

/* Student checklist */
.progress-card { display: grid; gap: 8px; margin-bottom: 16px; }
.progress-card__text { display: flex; justify-content: space-between; align-items: baseline; }
.progress-card__text span { color: var(--muted); font-size: 14px; }
.progress { height: 12px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.progress__bar { height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--student, var(--primary)), var(--success)); transition: width .4s ease; }
.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.check-item { display: flex; gap: 14px; align-items: flex-start; padding: 14px 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); transition: background-color .2s, opacity .2s; }
.check-item__box { appearance: none; flex: none; margin: 2px 0 0; width: 28px; height: 28px; border-radius: 8px; border: 2px solid var(--border); background: var(--surface); cursor: pointer; display: grid; place-items: center; }
.check-item__box:checked { background: var(--success); border-color: var(--success); }
.check-item__box:checked::after { content: ""; width: 8px; height: 14px; border: solid #fff; border-width: 0 3px 3px 0; transform: rotate(45deg) translate(-1px, -2px); }
.check-item__label { flex: 1; min-width: 0; cursor: pointer; display: block; }
.check-item__title { display: block; font-weight: 700; font-size: 16px; }
.check-item__desc { display: block; font-size: 16px; overflow-wrap: anywhere; }
.check-item.is-done { background: var(--success-soft); border-color: transparent; }
.check-item.is-done .check-item__title, .check-item.is-done .check-item__desc { text-decoration: line-through; color: var(--muted); }

/* Tiles & lists */
.tiles { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); }
.tile { display: flex; align-items: center; gap: 14px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); color: var(--text); text-decoration: none; height: 100%; transition: border-color .15s, transform .15s; }
.tile:hover { border-color: var(--primary); color: var(--text); transform: translateY(-1px); }
.tile.is-muted { opacity: .65; }
.tile__body { flex: 1; min-width: 0; display: grid; }
.tile__title { font-weight: 700; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile__meta { color: var(--muted); font-size: 13px; }
.weights { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.list__item { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 12px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; color: var(--text); text-decoration: none; }
a.list__item:hover { border-color: var(--primary); color: var(--text); }
.list__title { font-weight: 650; flex: 1 1 240px; min-width: 0; }
.list__meta { color: var(--muted); font-size: 13px; }
.meter { display: inline-block; width: 80px; height: 6px; border-radius: 6px; background: var(--surface-2); overflow: hidden; vertical-align: middle; }
.meter > span { display: block; height: 100%; background: var(--primary); }

/* Tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); overflow-x: auto; }
.tab { padding: 10px 14px; color: var(--muted); font-weight: 650; text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; }
.tab:hover { color: var(--text); }
.tab.is-active { color: var(--primary); border-bottom-color: var(--primary); }

/* Tables (collapse into cards on phones) */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.report .table-wrap { box-shadow: none; }
.table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.table th, .table td { padding: 11px 14px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
.table thead th { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: var(--surface-2); white-space: nowrap; }
.table tbody tr:last-child > * { border-bottom: 0; }
.table tbody tr:hover { background: var(--surface-2); }
.table .num { text-align: right; white-space: nowrap; }
.row-title { font-weight: 650; text-decoration: none; color: var(--text); }
.row-title:hover { color: var(--primary); }
.row-actions { white-space: nowrap; text-align: right; }
@media (max-width: 700px) {
  .table--cards thead { display: none; }
  .table--cards, .table--cards tbody, .table--cards tr, .table--cards th, .table--cards td { display: block; width: 100%; }
  .table--cards tr { border-bottom: 1px solid var(--border); padding: 8px 0; }
  .table--cards td, .table--cards th { display: flex; justify-content: space-between; align-items: center; gap: 12px; border: 0; padding: 5px 14px; text-align: right; }
  .table--cards td[data-label]::before, .table--cards th[data-label]::before { content: attr(data-label); color: var(--muted); font-weight: 650; font-size: 13px; text-align: left; }
  .table--cards td:first-child, .table--cards th:first-child { display: block; text-align: left; font-size: 16px; }
  .table--cards td:first-child::before, .table--cards th:first-child::before { display: none; }
  .table--cards .row-actions { justify-content: flex-end; }
}

/* Report */
.report__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.score { font-weight: 750; padding: 2px 8px; border-radius: 8px; }
.score--success { background: var(--success-soft); color: var(--success); }
.score--info { background: var(--info-soft); color: var(--info); }
.score--warning { background: var(--warning-soft); color: var(--warning); }
.score--danger { background: var(--danger-soft); color: var(--danger); }
.report .meter { display: block; width: 100%; min-width: 60px; height: 4px; margin-top: 6px; }

/* Auth */
body.auth, body.standalone { background: radial-gradient(1200px 600px at 10% -10%, var(--primary-soft), transparent), var(--bg); }
body.auth .page { place-content: center; min-height: 100vh; }
.auth-card { width: min(420px, 100%); margin: 0 auto; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow-lg); padding: 28px; display: grid; gap: 14px; }
.auth-card__brand { display: flex; align-items: center; gap: 10px; font-weight: 750; }
.auth-card__title { font-size: 24px; margin: 4px 0 0; }
.auth-card__links { margin: 0; font-size: 14px; color: var(--muted); text-align: center; }
body.standalone .page { max-width: 1100px; }

/* Toasts */
.toasts { position: fixed; z-index: 200; left: 50%; bottom: max(16px, env(safe-area-inset-bottom)); transform: translateX(-50%); display: grid; gap: 8px; width: min(92vw, 380px); pointer-events: none; }
.toast { pointer-events: auto; padding: 12px 16px; border-radius: 12px; background: var(--text); color: var(--surface); box-shadow: var(--shadow-lg); font-weight: 600; opacity: 0; transform: translateY(8px); transition: opacity .25s, transform .25s; }
.toast.is-visible { opacity: 1; transform: none; }
.toast--error { background: var(--danger); color: #fff; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }

/* Print */
@media print {
  :root { --bg: #fff; --surface: #fff; --surface-2: #f4f4f4; --border: #bbb; --text: #000; --muted: #444; --shadow: none; color-scheme: light; }
  body { font-size: 12pt; }
  .topbar, .footer, .toasts, .hidden-print, .chevron, .toolbar, .crumbs, .danger-zone, .card__remove { display: none !important; }
  .page { padding: 0; max-width: none; }
  .panel, .student, .stat { box-shadow: none; break-inside: avoid; }
  .print-page { break-after: page; } .print-page:last-child { break-after: auto; }
  .board { grid-template-columns: repeat(3, 1fr); }
  .column, .card { break-inside: avoid; }
  .card { padding-right: 34px; }
  .print-box { display: block; position: absolute; right: 10px; bottom: 10px; width: 14px; height: 14px; border: 1.5px solid #000; border-radius: 3px; }
}

/* ---------- Landing page ---------- */
body.landing { background: radial-gradient(1100px 520px at 85% -10%, color-mix(in srgb, var(--primary) 18%, transparent), transparent), radial-gradient(900px 500px at -10% 10%, color-mix(in srgb, #0f766e 12%, transparent), transparent), var(--bg); }
body.landing .page { max-width: 1180px; gap: 0; padding-top: 0; }
.lp-nav { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 0; }
.lp-nav__links { display: flex; align-items: center; gap: 18px; }
.lp-nav__links a:not(.btn) { color: var(--muted); font-weight: 600; text-decoration: none; }
.lp-nav__links a:not(.btn):hover { color: var(--text); }
@media (max-width: 640px) { .lp-nav__links a:not(.btn) { display: none; } }
.btn--lg { min-height: 48px; padding: 12px 22px; font-size: 16px; border-radius: 12px; }

.hero { display: grid; gap: 40px; align-items: center; padding: 40px 0 64px; }
@media (min-width: 960px) { .hero { grid-template-columns: 1.05fr 1fr; padding: 72px 0 96px; } }
.hero__title { font-size: clamp(34px, 6vw, 58px); line-height: 1.05; letter-spacing: -.03em; margin: 8px 0 18px; }
.hero__accent { background: linear-gradient(90deg, var(--primary), #0f766e); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero__lede { font-size: 18px; color: var(--muted); max-width: 56ch; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; margin: 24px 0 20px; }
.hero__points { display: flex; flex-wrap: wrap; gap: 8px 20px; list-style: none; padding: 0; margin: 0; color: var(--muted); font-weight: 550; font-size: 14px; }
.hero__points li::before { content: "✓"; color: var(--success); font-weight: 800; margin-right: 6px; }

.hero__preview { position: relative; }
.mock { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; box-shadow: 0 30px 60px -20px rgba(5, 46, 22, .35); overflow: hidden; transform: perspective(1400px) rotateY(-6deg) rotateX(2deg); }
@media (max-width: 959px) { .mock { transform: none; } }
@media (prefers-reduced-motion: reduce) { .mock { transform: none; } }
.mock__bar { display: flex; gap: 6px; padding: 12px 14px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.mock__bar span { width: 10px; height: 10px; border-radius: 50%; background: var(--border); }
.mock__body { padding: 16px; display: grid; gap: 14px; pointer-events: none; }
.stats--mini { grid-template-columns: repeat(2, 1fr) !important; }
.stats--mini .stat__value { font-size: 24px; }
.mock .student__body { display: grid; gap: 12px; padding-top: 10px; }
.mock .check-item { padding: 10px 12px; }
.mock-box { display: grid; }
.mock-box.is-checked { background: var(--success); border-color: var(--success); }
.mock-box.is-checked::after { content: ""; width: 8px; height: 14px; border: solid #fff; border-width: 0 3px 3px 0; transform: rotate(45deg) translate(-1px, -2px); }
.mock-progress { width: 34%; }
.mock .is-done .check-item__desc { text-decoration: line-through; color: var(--muted); }

.lp-section { padding: 64px 0; border-top: 1px solid var(--border); }
.lp-section--alt { background: linear-gradient(180deg, transparent, color-mix(in srgb, var(--primary-soft) 60%, transparent), transparent); }
.lp-section__title { font-size: clamp(26px, 4vw, 36px); text-align: center; margin-bottom: 8px; }
.lp-section__lede { text-align: center; color: var(--muted); font-size: 17px; margin: 0 auto 36px; max-width: 60ch; }
.features { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.feature { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 22px; box-shadow: var(--shadow); }
.feature__icon { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--primary-soft); font-size: 22px; margin-bottom: 10px; }
.feature h3 { font-size: 17px; margin-bottom: 6px; }
.feature p { color: var(--muted); margin: 0; }
.steps { list-style: none; padding: 0; margin: 32px 0 0; display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); counter-reset: none; }
.step { padding: 22px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; }
.step__n { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--primary); color: var(--on-primary); font-weight: 800; margin-bottom: 10px; }
.step h3 { font-size: 16px; } .step p { color: var(--muted); margin: 0; }
.faq { max-width: 760px; margin: 28px auto 0; display: grid; gap: 10px; }
.faq__item { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px 18px; }
.faq__item summary { cursor: pointer; font-weight: 650; }
.faq__item p { color: var(--muted); margin: 10px 0 0; }
.cta-band { text-align: center; padding: 56px 24px; margin: 24px 0 40px; border-radius: 24px; background: linear-gradient(135deg, var(--primary), #0f766e); color: #fff; display: grid; gap: 18px; justify-items: center; }
.cta-band h2 { color: #fff; font-size: clamp(24px, 4vw, 32px); margin: 0; }
.cta-band .btn--primary { background: #fff; color: #14532d; border-color: #fff; }
.cta-band .btn--primary:hover { background: #e6f2ea; color: #14532d; }
body.landing .footer a { color: var(--muted); }

/* Rich-text editor accents in the brand colour */
.ql-snow.ql-toolbar button:hover .ql-stroke, .ql-snow.ql-toolbar button.ql-active .ql-stroke, .ql-snow.ql-toolbar .ql-picker-label:hover .ql-stroke { stroke: var(--primary) !important; }
.ql-snow.ql-toolbar button:hover .ql-fill, .ql-snow.ql-toolbar button.ql-active .ql-fill { fill: var(--primary) !important; }
.ql-snow.ql-toolbar button:hover, .ql-snow.ql-toolbar button.ql-active, .ql-snow .ql-picker-label:hover, .ql-snow .ql-picker-label.ql-active { color: var(--primary) !important; }
.ql-snow .ql-tooltip { background: var(--surface); color: var(--text); border-color: var(--border); box-shadow: var(--shadow-lg); }
.ql-snow .ql-tooltip input[type=text] { background: var(--surface); color: var(--text); border-color: var(--border); }
.ql-snow a { color: var(--primary); }
.ql-editor img { max-width: 100%; }
.richtext img[src*="emoticons"], .ql-editor img[src*="emoticons"] { display: inline; width: 18px; height: 18px; vertical-align: -3px; }

/* Library items shown by name (goals, materials, books, media) */
.name-chips { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0; padding: 0; }
.name-chip { padding: 3px 10px; border-radius: 999px; background: var(--primary-soft); color: var(--primary); font-size: 13px; font-weight: 600; }
.unit-info__grid { display: grid; gap: 18px; grid-template-columns: 1fr; padding-top: 10px; }
@media (min-width: 900px) { .unit-info__grid { grid-template-columns: 2fr 1fr 1fr; } }
.unit-info__grid h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
section.unit-info__grid { padding: 16px 18px; }
@media (min-width: 900px) { section.unit-info__grid { grid-template-columns: 1fr 1fr; } }

/* Searchable checkbox list for library multi-selects */
.lookup { display: grid; gap: 8px; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px; background: var(--surface); }
.lookup__options { display: grid; gap: 2px 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); max-height: 260px; overflow-y: auto; padding: 2px; }
.lookup__option { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 8px; cursor: pointer; font-weight: 500; }
.lookup__option:hover { background: var(--surface-2); }
.lookup__option:has(input:checked) { background: var(--primary-soft); color: var(--primary); font-weight: 650; }
.lookup__option[hidden] { display: none; }
.lookup__meta { margin: 0; font-size: 12px; color: var(--muted); }

/* Search box above list pages */
.list-search { display: grid; gap: 6px; max-width: 420px; }
.list-search .input { border-radius: 999px; padding-left: 16px; }
[data-filter-item][hidden] { display: none !important; }

/* Auth pages: way back to the homepage */
.auth-card__home { justify-self: start; font-size: 14px; font-weight: 600; text-decoration: none; color: var(--muted); }
.auth-card__home:hover { color: var(--primary); }
a.auth-card__brand { color: var(--text); text-decoration: none; }

/* Auth: sign in / create account tabs */
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; background: var(--surface-2); border-radius: 12px; }
.auth-tabs__tab { text-align: center; padding: 9px 10px; border-radius: 9px; font-weight: 650; color: var(--muted); text-decoration: none; }
.auth-tabs__tab:hover { color: var(--text); }
.auth-tabs__tab.is-active { background: var(--surface); color: var(--primary); box-shadow: var(--shadow); }
.auth-card__icon { font-size: 34px; line-height: 1; }
.field__row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.linklike.link { color: var(--primary); text-decoration: underline; padding: 0; font: inherit; }
.invite-summary { background: var(--primary-soft); border-radius: 12px; padding: 12px 14px; }
.invite-summary p { margin: 0 0 4px; } .invite-summary p:last-child { margin: 0; }
.auth-card .alert { margin: 0; }

/* Reviewers admin + family invites */
.grid-reviewers { display: grid; gap: 18px; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 960px) { .grid-reviewers { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); } }
.grid-reviewers .section-title { margin: 0 0 10px; }

/* Reviewer read-only student view */
.review-subject > summary { cursor: pointer; }
.review-subject[open] > summary { margin-bottom: 8px; }
.review-unit { border-top: 1px solid var(--border); padding-top: 12px; margin-top: 12px; }
.review-unit h3 { font-size: 15px; margin: 0 0 8px; }

/* School-year rollover */
.rollover-list { display: grid; gap: 6px; }
.rollover-item { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; font-weight: 500; }
.rollover-item:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.rollover-item__name { font-weight: 700; }
.rollover-item__meta { grid-column: 2; color: var(--muted); font-size: 13px; }
.rollover-item.is-done .rollover-item__name { color: var(--muted); }

/* ---------- Branding: free badge, pricing, comparison, footer, legal ---------- */
.free-badge { display: inline-flex; align-items: center; gap: 6px; margin: 0 0 6px; padding: 5px 12px; border-radius: 999px; background: var(--primary-soft); color: var(--primary); font-weight: 750; font-size: 14px; }
.price-card { max-width: 520px; margin: 0 auto; background: var(--surface); border: 2px solid var(--primary); border-radius: 20px; padding: 26px; box-shadow: var(--shadow-lg); display: grid; gap: 16px; }
.price-card__head { display: flex; align-items: baseline; gap: 10px; }
.price-card__price { font-size: 48px; font-weight: 800; letter-spacing: -.03em; color: var(--primary); line-height: 1; }
.price-card__period { color: var(--muted); font-weight: 600; }
.price-card__list, .compare__card ul, .compare__when ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.price-card__list li::before, .compare__card li::before { content: "✓"; color: var(--success); font-weight: 800; margin-right: 8px; }
.compare { display: grid; gap: 16px; grid-template-columns: 1fr; margin-top: 8px; }
@media (min-width: 860px) { .compare { grid-template-columns: 1fr 1fr; } }
.compare__card { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 24px; display: grid; gap: 12px; align-content: start; }
.compare__card--lp { border: 2px solid var(--primary); }
.compare__card h3 { font-size: 22px; margin: 0; }
.compare__price { margin: 0; font-size: 17px; }
.compare__for { margin: 0; color: var(--muted); }
.compare__when { margin-top: 22px; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 22px 24px; }
.compare__when h3 { margin-top: 0; }
.compare__when li { padding-left: 14px; border-left: 3px solid var(--primary-soft); }
.site-footer { border-top: 1px solid var(--border); padding: 22px 16px 26px; color: var(--muted); font-size: 14px; }
.site-footer__inner { max-width: 1320px; margin: 0 auto; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; }
.site-footer__links { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--primary); }
.site-footer__copy { max-width: 1320px; margin: 12px auto 0; font-size: 12px; }
body.landing .site-footer { margin-top: 8px; }
.auth-legal { text-align: center; color: var(--muted); font-size: 13px; margin: 18px auto 0; max-width: 420px; }
.auth-legal a { color: var(--muted); }

/* Long-form pages (privacy policy) */
.prose { max-width: 760px; margin: 0 auto; width: 100%; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: clamp(20px, 4vw, 40px); }
.prose h2 { font-size: 20px; margin-top: 1.6em; }
.prose h3 { font-size: 16px; margin-top: 1.2em; }
.prose ul { padding-left: 1.2em; display: grid; gap: 6px; }
.prose p, .prose li { line-height: 1.65; }
