/* AeroGyan — Lesson plan & course file (lessonplan.js), 2026-11-12. Light + dark via the theme tokens. */
.lsp-wrap { display: grid; gap: 14px; min-width: 0; }
.lsp-wrap .pw-card { min-width: 0; }
.lsp-loading { display: flex; align-items: center; gap: 10px; justify-content: center; padding: 28px 12px; color: var(--text-secondary); font-size: 14px; }
.lsp-empty { text-align: center; padding: 36px 18px; }
.lsp-empty > i, .lsp-empty-in > i { font-size: 28px; color: var(--brand-500); margin-bottom: 10px; display: block; }
.lsp-empty-in { text-align: center; padding: 26px 12px; border: 1.5px dashed var(--border-default); border-radius: 14px; margin: 6px 0 12px; }
.lsp-empty-in h3 { margin: 0 0 4px; font-size: 16px; }
.lsp-empty-in p { margin: 0 auto 12px; max-width: 420px; color: var(--text-secondary); font-size: 13.5px; }
.lsp-sub { margin: 6px 0 12px; color: var(--text-secondary); font-size: 13.5px; line-height: 1.5; }
.lsp-muted { color: var(--text-tertiary); font-size: 12.5px; }
.lsp-h { margin: 18px 0 4px; font-size: 15px; display: flex; align-items: center; gap: 8px; color: var(--text-primary); }
.lsp-body > .lsp-h:first-child { margin-top: 0; }

/* head */
.lsp-head h3 { margin: 0; font-size: 18px; display: flex; align-items: center; gap: 8px; }
.lsp-head h3 i { color: var(--brand-500); }
.lsp-head-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.lsp-head-row h3 { margin-right: auto; }
.lsp-cname { font-size: 14px; color: var(--text-secondary); }
.lsp-select, .lsp-wrap select, .lsp-wrap input[type="text"], .lsp-wrap input[type="date"], .lsp-wrap input[type="number"], .lsp-ta {
  font: inherit; font-size: 14px; color: var(--text-primary); background: var(--bg-surface-2); border: 1px solid var(--border-default);
  border-radius: 10px; padding: 8px 10px; min-width: 0; max-width: 100%; }
.lsp-select { max-width: 340px; }
.lsp-wrap select:focus, .lsp-wrap input:focus, .lsp-ta:focus { outline: 2px solid var(--brand-400); outline-offset: 1px; border-color: var(--brand-400); }
.lsp-ta { width: 100%; resize: vertical; line-height: 1.5; }
[data-theme="dark"] .lsp-wrap input[type="date"], [data-theme="dim"] .lsp-wrap input[type="date"] { color-scheme: dark; }

/* pace */
.lsp-pace { border-radius: 14px; padding: 12px 14px; margin: 4px 0 12px; border: 1px solid var(--border-subtle); background: var(--bg-surface-2); }
.lsp-pace-top { display: flex; align-items: center; gap: 12px; }
.lsp-pace-ic { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; flex: none; font-size: 16px; }
.lsp-pace.good .lsp-pace-ic { background: rgba(16,185,129,.14); color: var(--emerald-600); }
.lsp-pace.bad .lsp-pace-ic { background: rgba(245,158,11,.16); color: var(--gold-600); }
.lsp-pace.info .lsp-pace-ic { background: rgba(99,102,241,.12); color: var(--brand-500); }
.lsp-pace.bad { border-color: rgba(245,158,11,.45); background: rgba(245,158,11,.06); }
.lsp-pace-txt { flex: 1; min-width: 0; display: grid; }
.lsp-pace-txt b { font-size: 15px; }
.lsp-pace-txt small { color: var(--text-secondary); font-size: 12.5px; }
.lsp-pace-pct { font-weight: 700; font-size: 20px; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.lsp-proj { margin: 8px 0 8px; font-size: 13px; color: var(--text-secondary); }
.lsp-proj i { color: var(--brand-500); margin-right: 4px; }
.lsp-bar { height: 8px; background: var(--bg-surface-3); border-radius: 99px; overflow: hidden; margin-top: 10px; }
.lsp-bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--brand-500), var(--accent-500)); transition: width .3s var(--ease); }
.lsp-bar.sm { height: 5px; margin: 0; flex: 1; }

/* tabs */
.lsp-tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin-top: 4px; padding-bottom: 2px; }
.lsp-tabs::-webkit-scrollbar { display: none; }
.lsp-tabs button { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 99px; border: 1px solid var(--border-default);
  background: var(--bg-surface); color: var(--text-secondary); font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.lsp-tabs button:hover { border-color: var(--brand-400); color: var(--text-primary); }
.lsp-tabs button.active { background: var(--brand-500); border-color: var(--brand-500); color: #fff; }
.lsp-count { font-style: normal; font-size: 11px; padding: 1px 7px; border-radius: 99px; background: rgba(99,102,241,.15); color: var(--brand-600); }
.lsp-tabs button.active .lsp-count { background: rgba(255,255,255,.25); color: #fff; }

/* forms */
.lsp-row { display: flex; align-items: center; gap: 8px; margin: 10px 0; }
.lsp-wrap-row { flex-wrap: wrap; }
.lsp-inline { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--text-secondary); }
.lsp-num { width: 76px; }
.lsp-file { cursor: pointer; }
.lsp-field { display: grid; gap: 5px; font-size: 13px; font-weight: 600; color: var(--text-secondary); min-width: 0; }
.lsp-field small { font-weight: 400; color: var(--text-tertiary); }
.lsp-field input, .lsp-field select, .lsp-field textarea { font-weight: 400; width: 100%; }
.lsp-grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 8px 0; }
.lsp-grid3 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 8px 0; }
.lsp-acts { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; align-items: center; margin-top: 14px; }
.lsp-acts-left { justify-content: flex-start; margin-top: 10px; }
.lsp-check { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--text-primary); cursor: pointer; }
.lsp-note { font-size: 13px; margin: 10px 0; }
.lsp-note.bad { color: var(--rose-600); }
.lsp-ic { border: 1px solid var(--border-default); background: var(--bg-surface); color: var(--text-secondary); width: 34px; height: 34px; border-radius: 10px; cursor: pointer; display: inline-grid; place-items: center; flex: none; }
.lsp-ic:hover { color: var(--text-primary); border-color: var(--border-strong); }
.lsp-ic.ok { color: var(--emerald-600); border-color: rgba(16,185,129,.4); background: rgba(16,185,129,.08); }
.lsp-ic.ok:hover { background: var(--emerald-500); color: #fff; }

/* AI preview */
.lsp-aiprev { border: 1px solid rgba(99,102,241,.35); background: rgba(99,102,241,.05); border-radius: 14px; padding: 12px 14px; margin: 10px 0; }
.lsp-aiprev-top { font-size: 14px; color: var(--text-primary); }
.lsp-aiprev-top i { color: var(--brand-500); }
.lsp-aiunits { margin: 8px 0 0; padding-left: 20px; font-size: 13.5px; max-height: 360px; overflow: auto; }
.lsp-aiunits > li { margin: 6px 0; }
.lsp-aiunits ol { margin: 4px 0; padding-left: 20px; color: var(--text-secondary); }

/* toolbar + suggestions */
.lsp-toolbar { display: flex; flex-wrap: wrap; gap: 10px 22px; margin-bottom: 12px; }
.lsp-switch { display: flex; align-items: center; gap: 10px; font-size: 13.5px; font-weight: 600; color: var(--text-primary); cursor: pointer; flex-wrap: wrap; }
.lsp-switch small { font-weight: 400; color: var(--text-tertiary); width: 100%; margin-left: 48px; margin-top: -6px; }
.lsp-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.lsp-switch span { width: 38px; height: 22px; border-radius: 99px; background: var(--border-strong); position: relative; flex: none; transition: background .2s; }
.lsp-switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .2s var(--ease); box-shadow: var(--shadow-xs); }
.lsp-switch input:checked + span { background: var(--brand-500); }
.lsp-switch input:checked + span::after { transform: translateX(16px); }
.lsp-switch input:focus-visible + span { outline: 2px solid var(--brand-400); outline-offset: 2px; }
.lsp-sugg { border: 1px solid rgba(245,158,11,.45); background: rgba(245,158,11,.07); border-radius: 12px; padding: 10px 12px; margin-bottom: 12px; font-size: 13.5px; }
.lsp-sugg b i { color: var(--gold-600); }
.lsp-sugg ul { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.lsp-sugg li { display: flex; align-items: center; gap: 10px; justify-content: space-between; flex-wrap: wrap; }
.lsp-sugg small { color: var(--text-tertiary); }

/* units and lectures */
.lsp-unit { border: 1px solid var(--border-subtle); border-radius: 14px; padding: 10px 10px 12px; margin-bottom: 12px; background: var(--bg-surface); }
.lsp-unit-head { display: flex; align-items: center; gap: 8px; }
.lsp-unit-n { font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--brand-600); background: rgba(99,102,241,.1); padding: 3px 9px; border-radius: 99px; flex: none; }
[data-theme="dark"] .lsp-unit-n, [data-theme="dim"] .lsp-unit-n { color: var(--brand-300); }
.lsp-wrap input.lsp-unit-title { flex: 1 1 0; min-width: 0; font-weight: 600; background: transparent; border-color: transparent; padding: 6px 8px; }
.lsp-wrap input.lsp-unit-title:hover { border-color: var(--border-default); }
.lsp-unit-h { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--text-tertiary); }
.lsp-unit-h input { width: 58px; }
.lsp-unit-bar { display: flex; align-items: center; gap: 10px; margin: 8px 4px 2px; }
.lsp-unit-bar small { color: var(--text-tertiary); font-size: 12px; white-space: nowrap; }
.lsp-lecs { list-style: none; margin: 8px 0 8px; padding: 0; display: grid; gap: 6px; }
.lsp-lec { border: 1px solid var(--border-subtle); border-radius: 12px; background: var(--bg-surface-2); }
.lsp-lec.taught { border-left: 3px solid var(--emerald-500); }
.lsp-lec.skipped { opacity: .7; }
.lsp-lec.open { border-color: var(--brand-400); box-shadow: var(--shadow-sm); }
.lsp-lec-top { display: flex; align-items: center; gap: 8px; padding: 6px 8px; }
.lsp-n { width: 26px; height: 26px; flex: none; border-radius: 8px; display: grid; place-items: center; font-size: 12px; font-weight: 700; color: var(--text-secondary); background: var(--bg-surface-3); }
.lsp-lec-main { flex: 1 1 0; min-width: 0; width: 100%; display: grid; grid-template-columns: minmax(0, 1fr); justify-items: start; gap: 3px; text-align: left; background: none; border: 0; padding: 4px 2px; font: inherit; color: inherit; cursor: pointer; border-radius: 8px; }
.lsp-lec-main:focus-visible { outline: 2px solid var(--brand-400); outline-offset: 2px; }
.lsp-topic { font-size: 14px; font-weight: 600; color: var(--text-primary); overflow-wrap: anywhere; }
.lsp-topic:empty::before { content: "New lecture — add a topic"; color: var(--text-tertiary); font-weight: 400; }
.lsp-meta { display: flex; flex-wrap: wrap; gap: 4px; }
.lsp-meta:empty { display: none; }
.lsp-kind, .lsp-co, .lsp-ev { font-size: 11px; padding: 1px 7px; border-radius: 99px; border: 1px solid var(--border-default); color: var(--text-secondary); white-space: nowrap; }
.lsp-kind.extra { border-color: rgba(245,158,11,.5); color: var(--gold-600); }
.lsp-kind.beyond { border-color: rgba(6,182,212,.5); color: var(--accent-600); }
.lsp-co { border-color: rgba(99,102,241,.35); color: var(--brand-600); }
[data-theme="dark"] .lsp-co, [data-theme="dim"] .lsp-co { color: var(--brand-300); }
.lsp-ev { background: rgba(16,185,129,.08); border-color: rgba(16,185,129,.3); color: var(--emerald-600); }
.lsp-ev.manual { background: var(--bg-surface-3); border-color: var(--border-default); color: var(--text-secondary); }
.lsp-st { font-size: 12px; font-weight: 600; white-space: nowrap; padding: 3px 9px; border-radius: 99px; flex: none; }
.lsp-st.taught { color: var(--emerald-600); background: rgba(16,185,129,.1); }
.lsp-st.planned { color: var(--text-secondary); background: var(--bg-surface-3); }
.lsp-st.late { color: var(--gold-600); background: rgba(245,158,11,.12); }
.lsp-st.skipped { color: var(--text-tertiary); background: var(--bg-surface-3); }
[data-theme="dark"] .lsp-st.taught, [data-theme="dark"] .lsp-ev { color: var(--emerald-400); }
[data-theme="dark"] .lsp-st.late, [data-theme="dark"] .lsp-kind.extra { color: var(--gold-400); }
.lsp-quick { flex: none; }
.lsp-lec-edit { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; padding: 4px 12px 12px; border-top: 1px solid var(--border-subtle); padding-top: 12px; }
.lsp-wide { grid-column: 1 / -1; }
.lsp-lec-edit .lsp-field.lsp-wide:first-child { grid-column: 1 / -1; }
.lsp-lec-acts { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.lsp-sp { flex: 1; }
.lsp-taughton { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.lsp-taughton input { width: 150px; padding: 5px 8px !important; }
.lsp-del { color: var(--rose-600) !important; }
.lsp-addlec { margin-left: 2px; }
.lsp-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.lsp-chip { font: inherit; font-size: 12.5px; font-weight: 600; padding: 4px 11px; border-radius: 99px; border: 1px solid var(--border-default); background: var(--bg-surface); color: var(--text-secondary); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.lsp-chip.on { background: var(--brand-500); border-color: var(--brand-500); color: #fff; }
.lsp-chip.off { opacity: .55; cursor: not-allowed; }
.lsp-chip input { display: none; }

/* dates */
.lsp-days { display: flex; flex-wrap: wrap; gap: 8px; }
.lsp-day { display: inline-flex; align-items: center; border: 1px solid var(--border-default); border-radius: 99px; overflow: hidden; background: var(--bg-surface); }
.lsp-day button { font: inherit; font-size: 13px; font-weight: 600; padding: 7px 14px; border: 0; background: none; color: var(--text-secondary); cursor: pointer; }
.lsp-day.on { border-color: var(--brand-500); }
.lsp-day.on button { background: var(--brand-500); color: #fff; }
.lsp-wrap .lsp-day select { border: 0; border-radius: 0; padding: 6px 4px; font-size: 12.5px; background: rgba(99,102,241,.08); }
.lsp-hols { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px; margin: 6px 0 10px; }
.lsp-hol { display: flex; gap: 8px; align-items: center; padding: 8px 10px; border: 1px solid var(--border-subtle); border-radius: 10px; font-size: 13px; cursor: pointer; background: var(--bg-surface-2); }
.lsp-hol b { font-weight: 600; margin-right: 4px; }
.lsp-ownhol { list-style: none; padding: 0; margin: 6px 0; display: grid; gap: 4px; }
.lsp-ownhol li { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; padding: 4px 4px 4px 10px; border: 1px solid var(--border-subtle); border-radius: 10px; }

/* save bar */
.lsp-savebar { position: sticky; bottom: 12px; z-index: 5; display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 14px; background: var(--bg-elevated); border: 1px solid var(--brand-400); box-shadow: var(--shadow-lg); }
.lsp-savebar[hidden] { display: none; }
.lsp-savebar span { flex: 1; font-size: 13.5px; font-weight: 600; color: var(--text-primary); }
.lsp-savebar span i { color: var(--brand-500); margin-right: 4px; }

/* course file */
.lsp-cf-top { display: flex; gap: 16px; align-items: center; }
.lsp-ring { --p: 0; width: 84px; height: 84px; flex: none; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--brand-500) calc(var(--p) * 1%), var(--bg-surface-3) 0); }
.lsp-ring b { width: 66px; height: 66px; border-radius: 50%; background: var(--bg-surface); display: grid; place-items: center; font-size: 22px; line-height: 1; color: var(--text-primary); }
.lsp-ring b { display: flex; align-items: center; justify-content: center; gap: 1px; }
.lsp-ring b small { font-size: 12px; color: var(--text-tertiary); }
.lsp-cf-txt { min-width: 0; flex: 1; }
.lsp-cf-txt .lsp-sub { margin: 4px 0 0; }
.lsp-miss { margin: 14px 0; border: 1px solid rgba(245,158,11,.4); border-radius: 12px; background: rgba(245,158,11,.05); }
.lsp-miss summary { cursor: pointer; padding: 10px 12px; font-weight: 600; font-size: 14px; }
.lsp-miss summary i { color: var(--gold-600); }
.lsp-miss ul { list-style: none; margin: 0; padding: 0 12px 10px; display: grid; gap: 6px; }
.lsp-miss li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; border-radius: 10px; background: var(--bg-surface); border: 1px solid var(--border-subtle); }
.lsp-miss li span { display: grid; min-width: 0; font-size: 13.5px; }
.lsp-miss li small { color: var(--text-secondary); font-size: 12.5px; }
.lsp-cf-exams { margin: 12px 0; font-size: 13.5px; display: grid; gap: 8px; }
.lsp-rem { margin: 14px 0; }
.lsp-remlist { display: grid; gap: 8px; }
.lsp-remrow { display: grid; grid-template-columns: minmax(0, 220px) minmax(0, 1fr); gap: 10px; align-items: center; }
.lsp-remwho { display: grid; min-width: 0; font-size: 13.5px; }
.lsp-remwho small { color: var(--rose-600); font-size: 12px; }
.lsp-remrow input { width: 100%; }
.lsp-preview { border: 1px solid var(--border-default); border-radius: 14px; overflow: hidden; margin-top: 14px; background: var(--bg-surface-3); }
.lsp-preview-bar { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 12px; font-size: 13px; font-weight: 600; color: var(--text-secondary); border-bottom: 1px solid var(--border-default); }
.lsp-frame { display: block; width: 100%; height: 900px; border: 0; background: #fff; }

/* students: the course page card */
.lsp-ccard:empty { display: none; }
.lsp-ccard { margin: 0 0 14px; }
.lsp-card { border: 1px solid var(--border-subtle); background: var(--bg-surface); border-radius: 16px; padding: 12px 14px; }
.lsp-card summary { display: flex; align-items: center; gap: 12px; cursor: pointer; list-style: none; }
.lsp-card summary::-webkit-details-marker { display: none; }
.lsp-card-ic { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; flex: none; background: rgba(99,102,241,.12); color: var(--brand-500); }
.lsp-card-main { flex: 1; min-width: 0; display: grid; }
.lsp-card-main b { font-size: 15px; color: var(--text-primary); }
.lsp-card-main small { color: var(--text-secondary); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lsp-card-pct { font-weight: 700; font-size: 18px; color: var(--text-primary); }
.lsp-card-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 12px; }
.lsp-card-cols h4 { margin: 0 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-tertiary); }
.lsp-card-cols ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.lsp-card-cols li { display: flex; justify-content: space-between; gap: 8px; font-size: 13.5px; color: var(--text-primary); }
.lsp-card-cols li small { color: var(--text-tertiary); white-space: nowrap; }
.lsp-card-units { display: grid; gap: 6px; margin-top: 12px; }
.lsp-card-units > div { display: grid; grid-template-columns: minmax(0, 1fr) 90px auto; gap: 8px; align-items: center; font-size: 12.5px; color: var(--text-secondary); }
.lsp-card-units span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 760px) {
  .lsp-grid3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lsp-lec-edit { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lsp-remrow { grid-template-columns: 1fr; gap: 4px; }
}
@media (max-width: 560px) {
  .lsp-unit-head { flex-wrap: wrap; }
  .lsp-wrap input.lsp-unit-title { order: 5; flex-basis: 100%; }
  .lsp-unit-h { margin-left: auto; }
  .lsp-unit-n { padding: 3px 7px; }
  .lsp-unit-h input { width: 50px; }
  .lsp-head-row .lsp-select { width: 100%; max-width: none; }
  .lsp-grid2, .lsp-card-cols { grid-template-columns: 1fr; }
  .lsp-lec-edit { grid-template-columns: 1fr 1fr; padding: 10px; }
  .lsp-lec-top { flex-wrap: wrap; }
  .lsp-lec-main { flex-basis: calc(100% - 80px); }
  .lsp-st { margin-left: 34px; }
  .lsp-quick { margin-left: auto; }
  .lsp-cf-top { flex-direction: column; align-items: flex-start; }
  .lsp-frame { height: 640px; }
  .lsp-tabs button span { font-size: 13px; }
  .lsp-switch small { margin-left: 0; margin-top: 0; }
  .lsp-miss li { flex-direction: column; align-items: stretch; }
}
@media print { .lsp-savebar { display: none; } }
