/* Rizelex LMS v1.0 — design system matches Rizelex Modern theme
   cream #FAF5EC · forest #0E1F1A · saffron #E8862E · Fraunces + Manrope */
:root {
  --cream: #FAF5EC;
  --cream-2: #F3EBDC;
  --forest: #0E1F1A;
  --forest-2: #16302818;
  --forest-soft: #1C332B;
  --saffron: #E8862E;
  --saffron-2: #D97420;
  --wa: #25D366;
  --ink: #172420;
  --body: #47534E;
  --line: #E5DCC9;
  --ok: #1F7A4D;
  --warn: #A66A12;
  --danger: #B3402E;
  --r: 14px;
  --shadow: 0 10px 30px rgba(14, 31, 26, .08);
  --serif: "Fraunces", Georgia, serif;
  --sans: "Manrope", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--cream); color: var(--body);
  font: 16px/1.6 var(--sans);
}
h1, h2, h3 { font-family: var(--serif); color: var(--ink); font-weight: 600; line-height: 1.2; margin: 0 0 .4em; }
h1 em, .auth-sub em { font-style: italic; color: var(--saffron); }
a { color: var(--saffron-2); text-decoration: none; }
a:hover { text-decoration: underline; }
small, .muted { color: #7d867f; }
code { background: var(--cream-2); padding: 2px 6px; border-radius: 6px; font-size: .85em; }
hr.rule { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }

/* ---------- buttons ---------- */
/* Any author rule that sets `display` beats the UA stylesheet's [hidden]{display:none},
   so .btn and friends would stay visible when marked hidden. Restore the intent globally
   rather than per-component — this bit us once already with the PDF fullscreen button. */
[hidden] { display: none !important; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 18px; border-radius: 999px; border: 1.5px solid var(--forest);
  background: #fff; color: var(--forest); font: 600 15px var(--sans);
  cursor: pointer; text-decoration: none !important; transition: transform .12s, box-shadow .12s;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(14,31,26,.12); }
.btn-primary { background: var(--forest); color: #fff; }
.btn-primary:hover { background: var(--forest-soft); }
.btn-ghost { border-color: var(--line); background: transparent; }
.btn-danger { border-color: var(--danger); color: var(--danger); background: #fff; }
.btn-done { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn-small { padding: 5px 12px; font-size: 13px; }
.btn-icon { padding: 5px 9px; font-size: 13px; border-color: var(--line); }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; pointer-events: none; }

/* ---------- forms ---------- */
.stack { display: flex; flex-direction: column; gap: 14px; }
label { display: flex; flex-direction: column; gap: 6px; font: 600 13px var(--sans); color: var(--ink); }
label small { font-weight: 500; }
input, select, textarea {
  font: 500 15px var(--sans); color: var(--ink);
  padding: 10px 14px; border: 1.5px solid var(--line); border-radius: 10px; background: #fff;
  width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--saffron); outline-offset: 1px; border-color: var(--saffron); }
input[disabled] { background: var(--cream-2); color: #8a8f8a; }
textarea { resize: vertical; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-err { color: var(--danger); font-weight: 600; font-size: 14px; margin: 0; }
.search { display: flex; gap: 8px; }
.search input { width: 260px; }

/* ---------- auth ---------- */
body.auth { display: grid; place-items: center; min-height: 100vh; padding: 20px;
  background:
    radial-gradient(700px 380px at 85% -10%, rgba(232,134,46,.14), transparent 60%),
    radial-gradient(600px 400px at -10% 110%, rgba(14,31,26,.10), transparent 60%),
    var(--cream);
}
.auth-card { width: 100%; max-width: 400px; background: #fff; border: 1px solid var(--line);
  border-radius: 22px; box-shadow: var(--shadow); padding: 36px 32px; }
.auth-brand { text-align: center; margin-bottom: 22px; }
.auth-brand h1 { font-size: 26px; margin: 12px 0 2px; }
.auth-sub { margin: 0; font-family: var(--serif); font-size: 17px; color: var(--body); }
.auth-help { text-align: center; font-size: 13px; margin: 18px 0 0; color: #7d867f; }

/* ---------- app shell ---------- */
.shell { display: flex; min-height: 100vh; }
.side {
  width: 240px; flex: 0 0 240px; background: var(--forest); color: #E9EFEA;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.side-brand { display: flex; gap: 12px; align-items: center; padding: 22px 20px 18px; }
.side-mark {
  width: 40px; height: 40px; flex: 0 0 40px; display: grid; place-items: center;
  background: var(--saffron); color: #fff; border-radius: 12px;
  font: 700 22px var(--serif);
}
.side-mark.big { width: 54px; height: 54px; font-size: 30px; margin: 0 auto; border-radius: 16px; }
.side-name { font: 700 15px var(--sans); color: #fff; line-height: 1.25; }
.side-name small { display: block; font: 500 11px var(--sans); color: #9DB3A8; letter-spacing: .08em; text-transform: uppercase; }
.side-nav { display: flex; flex-direction: column; gap: 2px; padding: 8px 12px; flex: 1; }
.side-nav a {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px;
  color: #C9D6CD; font: 600 14px var(--sans); text-decoration: none !important;
}
.side-nav a i { font-style: normal; width: 20px; text-align: center; opacity: .8; }
.side-nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
.side-nav a.on { background: rgba(232,134,46,.18); color: #FFC08A; }
.side-foot { padding: 14px 16px 18px; display: flex; flex-direction: column; gap: 8px; }
.side-wa { display: block; text-align: center; background: var(--wa); color: #06301a !important;
  font: 700 13px var(--sans); padding: 9px 12px; border-radius: 999px; text-decoration: none !important; }
.side-out { text-align: center; color: #9DB3A8 !important; font: 600 13px var(--sans); text-decoration: none !important; }
.side-out:hover { color: #fff !important; }

.main-wrap { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 14px; padding: 14px 28px;
  background: rgba(250,245,236,.92); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20; backdrop-filter: blur(6px);
}
.top-title { font: 600 17px var(--serif); color: var(--ink); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-user { display: flex; align-items: center; gap: 9px; font: 600 13px var(--sans); color: var(--ink); }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  background: var(--forest); color: #fff; font: 700 14px var(--sans); }
.burger { display: none; background: none; border: 0; font-size: 22px; cursor: pointer; color: var(--ink); padding: 2px 6px; }
.main { padding: 28px; max-width: 1080px; width: 100%; margin: 0 auto; }

/* ---------- cards, grids, tables ---------- */
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--r);
  padding: 22px; box-shadow: 0 2px 10px rgba(14,31,26,.04); margin-bottom: 18px; }
.card-title { font-size: 18px; margin-bottom: 14px; }
.card.narrow { max-width: 540px; }
.grid { display: grid; gap: 18px; }
.grid.two { grid-template-columns: 1fr 1fr; align-items: start; }
.grid.cards { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.grid.kpis { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-bottom: 18px; }
.kpi { text-align: left; margin: 0; }
.kpi b { display: block; font: 700 34px var(--serif); color: var(--ink); }
.kpi span { font: 600 12px var(--sans); text-transform: uppercase; letter-spacing: .08em; color: #7d867f; }
.split { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.spacer { flex: 1; }
.page-actions { margin-bottom: 18px; display: flex; }
.page-actions .btn { margin-left: auto; }
.page-actions.split .btn { margin-left: 0; }
.section-head { margin: 26px 0 14px; }
.section-head h2 { margin: 0; font-size: 21px; }

.table-card { padding: 8px 0; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 560px; }
th { text-align: left; font: 700 11px var(--sans); text-transform: uppercase; letter-spacing: .08em;
  color: #8a8f8a; padding: 10px 16px; border-bottom: 1px solid var(--line); }
td { padding: 12px 16px; border-bottom: 1px solid #F0E9DA; vertical-align: middle; color: var(--body); }
tr:last-child td { border-bottom: 0; }
.t-right { text-align: right; white-space: nowrap; }
.row-link { color: var(--ink); }
.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font: 700 11px var(--sans);
  text-transform: uppercase; letter-spacing: .05em; background: var(--cream-2); color: var(--body); }
.pill.ok { background: #E2F2E8; color: var(--ok); }
.pill.warn { background: #F9EBD4; color: var(--warn); }
.pill.danger { background: #F7E2DD; color: var(--danger); }
.lead { font-size: 16px; margin: 0 0 14px; color: var(--body); }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }

.feed { list-style: none; margin: 0; padding: 0; }
.feed li { padding: 9px 0; border-bottom: 1px solid #F0E9DA; font-size: 14px; }
.feed li:last-child { border-bottom: 0; }
.feed small { display: block; }
.empty { text-align: center; padding: 56px 20px; background: #fff; border: 1.5px dashed var(--line); border-radius: var(--r); }
.empty-ico { font-size: 34px; margin-bottom: 8px; }
.empty h3 { margin-bottom: 4px; }
.empty p { margin: 0 auto; max-width: 380px; font-size: 14px; }

/* ---------- student: dashboard ---------- */
.hero-greet { margin-bottom: 22px; }
.hero-greet h1 { font-size: 30px; margin-bottom: 2px; }
.hero-greet p { margin: 0; }
.course-card { display: flex; flex-direction: column; gap: 10px; margin: 0; }
.course-card h2 { font-size: 20px; margin: 0; }
.course-card h2 a { color: var(--ink); }
.cc-tag { margin: 2px 0 0; font-size: 14px; }
.cc-progress { display: flex; align-items: center; gap: 10px; }
.cc-pct { font: 700 13px var(--sans); color: var(--ink); min-width: 38px; text-align: right; }
.cc-meta { margin: 0; font-size: 13px; color: #7d867f; }
.cc-actions { display: flex; gap: 8px; margin-top: 4px; flex-wrap: wrap; }
.bar { flex: 1; height: 8px; border-radius: 99px; background: var(--cream-2); overflow: hidden; }
.bar span { display: block; height: 100%; border-radius: 99px;
  background: linear-gradient(90deg, var(--saffron), var(--saffron-2)); transition: width .4s; }

/* ---------- student: course outline ---------- */
.eyebrow { font: 700 11px var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--saffron-2); margin: 0 0 6px; }
.course-hero h1 { font-size: 28px; }
.course-hero .lead { font-size: 16px; margin: 0 0 14px; }
.course-hero .cc-progress { max-width: 420px; margin-bottom: 16px; }
.rich { font-size: 15px; }
.rich a { word-break: break-all; }
.outline { display: flex; flex-direction: column; gap: 12px; }
.module { background: #fff; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.module summary { display: flex; align-items: center; gap: 14px; padding: 16px 20px; cursor: pointer; list-style: none; }
.module summary::-webkit-details-marker { display: none; }
.module[open] summary { border-bottom: 1px solid #F0E9DA; }
.mod-num { font: 600 18px var(--serif); color: var(--saffron); }
.mod-head { display: flex; flex-direction: column; min-width: 0; }
.mod-head strong { font: 700 15px var(--sans); color: var(--ink); }
.mod-head small { font-size: 13px; }
.mod-count { margin-left: auto; font: 600 12px var(--sans); color: #8a8f8a; white-space: nowrap; }
.lesson-list { list-style: none; margin: 0; padding: 6px 10px; }
.lesson-list li a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px;
  color: var(--ink); font: 600 14px var(--sans); text-decoration: none !important; }
.lesson-list li a:hover { background: var(--cream); }
.lesson-list li.done .l-title { color: #8a8f8a; }
.l-check { width: 26px; height: 26px; flex: 0 0 26px; display: grid; place-items: center;
  border-radius: 50%; background: var(--cream-2); color: var(--forest); font-size: 12px; }
li.done .l-check { background: #E2F2E8; color: var(--ok); }
.l-title { flex: 1; min-width: 0; }
.l-dur { font: 600 12px var(--sans); color: #8a8f8a; }
.muted-row { padding: 10px 12px; font-size: 13px; color: #8a8f8a; }

/* ---------- student: lesson page ---------- */
.lesson-layout { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 22px; align-items: start; }
.crumbs { font: 600 13px var(--sans); margin: 0 0 8px; }
.lesson-h1 { font-size: 26px; }
.player { position: relative; aspect-ratio: 16 / 9; border-radius: var(--r); overflow: hidden;
  background: var(--forest); box-shadow: var(--shadow); margin-bottom: 18px; }
.player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.file-card .file-name { font: 600 15px var(--sans); color: var(--ink); }
.lesson-notes { background: var(--cream); border-color: #F0E9DA; }
.lesson-notes-label { font: 700 11px var(--sans); letter-spacing: .1em; text-transform: uppercase;
  color: var(--saffron-2); margin: 0 0 10px; }
.lesson-notes-body { user-select: none; -webkit-user-select: none; -moz-user-select: none; }
.lesson-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 4px; }
.lesson-nav { margin-left: auto; display: flex; gap: 8px; }
.lesson-side { position: sticky; top: 76px; max-height: calc(100vh - 96px); overflow: auto; margin: 0; }
.lesson-side h3 { font-size: 15px; margin-bottom: 8px; }
.mini-list { list-style: none; margin: 0; padding: 0; font-size: 13px; }
.mini-list .mini-mod { font: 700 11px var(--sans); text-transform: uppercase; letter-spacing: .07em;
  color: #8a8f8a; padding: 10px 0 4px; }
.mini-list li a { display: flex; gap: 8px; align-items: center; padding: 6px 8px; border-radius: 8px;
  color: var(--body); font-weight: 600; text-decoration: none !important; }
.mini-list li a:hover { background: var(--cream); }
.mini-list li.now a { background: rgba(232,134,46,.13); color: var(--saffron-2); }
.mini-list .l-check { width: 20px; height: 20px; flex-basis: 20px; font-size: 10px; }

/* ---------- admin: course editor ---------- */
.module-card { padding: 16px 18px; }
.mod-row { margin-bottom: 6px; }
.admin-lessons { list-style: none; margin: 0; padding: 0; }
.admin-lessons li { display: flex; align-items: center; gap: 9px; padding: 8px 4px; border-top: 1px solid #F0E9DA; font-size: 14px; }
.admin-lessons .l-title { font-weight: 600; color: var(--ink); }
.admin-lessons .add-row { justify-content: flex-start; }
.enroll-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.enroll-list li { border: 1px solid #F0E9DA; border-radius: 10px; padding: 12px 14px; }
.enroll-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.upload-card form { margin-top: 8px; }
.upload-card input[type=file] { max-width: 320px; }

/* ---------- admin: mini progress bar (tables, summary rows) ---------- */
.mini-progress { display: inline-flex; align-items: center; gap: 8px; }
.mini-progress b { font: 700 12px var(--sans); color: var(--ink); min-width: 30px; text-align: right; }
.bar.mini { flex: none; width: 64px; height: 6px; }

/* ---------- admin: student detail — learning snapshot per course ---------- */
.snap-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 10px 0; }
.snap-label { font: 700 11px var(--sans); text-transform: uppercase; letter-spacing: .06em; color: #9DB3A8; margin: 0 0 3px; }
.snap-val { font-size: 13px; margin: 0; }
.snap-block { margin: 10px 0; }
.snap-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.snap-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13px; }
.snap-foot { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 10px; padding-top: 10px; border-top: 1px solid #F0E9DA; font-size: 13px; color: var(--body); }
.snap-foot .pill { margin-left: 4px; }

/* ---------- admin: batch progress (dashboard card + attendance list) ---------- */
.batch-progress-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.batch-progress-list li { border-bottom: 1px solid #F0E9DA; padding-bottom: 10px; }
.batch-progress-list li:last-child { border-bottom: 0; padding-bottom: 0; }
.batch-progress-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.batch-progress-head strong { font-size: 14px; }
.batch-progress-meta { font-size: 12px; color: #7d867f; margin: 2px 0 0; }

/* ---------- modal + toast ---------- */
dialog.modal { border: 0; border-radius: 18px; padding: 26px; width: min(480px, calc(100vw - 32px));
  box-shadow: 0 24px 60px rgba(14,31,26,.25); }
dialog.modal::backdrop { background: rgba(14,31,26,.45); backdrop-filter: blur(2px); }
dialog.modal h3 { font-size: 20px; margin-bottom: 16px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px; }
.toast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(20px);
  background: var(--forest); color: #fff; font: 600 14px var(--sans); padding: 11px 20px;
  border-radius: 999px; opacity: 0; pointer-events: none; transition: .25s; z-index: 99; box-shadow: var(--shadow); }
.toast.toast-show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- v1.1: quiz — admin editor ---------- */
.mod-quiz-row { padding: 0 4px 10px; }
.quiz-chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px;
  background: var(--cream-2); color: var(--ink); font: 600 13px var(--sans); }
.question-card { padding: 16px 18px; }
.q-row { margin-bottom: 8px; }
.q-options { list-style: none; margin: 0; padding: 0 0 0 41px; display: flex; flex-direction: column; gap: 4px; }
.q-options li { font-size: 13px; color: #8a8f8a; }
.q-options li.correct { color: var(--ok); font-weight: 700; }
.modal-wide { max-width: 640px; }
.opt-builder { display: flex; flex-direction: column; gap: 8px; }
.opt-label-row { margin-bottom: -2px; }
.opt-rows { display: flex; flex-direction: column; gap: 8px; }
.opt-row { display: flex; align-items: center; gap: 10px; }
.opt-row input[type=checkbox] { width: auto; flex: 0 0 auto; }
.opt-row input[type=text] { flex: 1; }
.opt-row [data-remove-opt] { flex: 0 0 auto; }

/* ---------- v1.1: quiz — taking flow ---------- */
.quiz-hero { text-align: left; }
.quiz-meta { list-style: none; margin: 14px 0; padding: 0; display: flex; gap: 22px; flex-wrap: wrap; }
.quiz-meta li { font-size: 13px; color: var(--body); }
.quiz-meta strong { display: block; font: 700 22px var(--serif); color: var(--ink); }
.quiz-timer-bar { display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 76px; z-index: 15; background: var(--forest); color: #fff; padding: 12px 22px; }
.qt-label { font: 600 12px var(--sans); text-transform: uppercase; letter-spacing: .08em; color: #9DB3A8; }
.qt-clock { font: 700 22px var(--serif); }
.quiz-timer-bar.low { background: var(--danger); }
.quiz-timer-bar.low .qt-label { color: #F7D9D0; }
.quiz-q { padding: 20px 22px; }
.quiz-q-num { margin: 0 0 6px; font: 700 12px var(--sans); text-transform: uppercase; letter-spacing: .06em; color: var(--saffron-2); }
.quiz-q-text { font: 600 16px/1.4 var(--sans); color: var(--ink); margin: 0 0 14px; }
.quiz-opts { display: flex; flex-direction: column; gap: 8px; }
.quiz-opt { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border: 1.5px solid var(--line); border-radius: 10px; cursor: pointer; font-weight: 600; }
.quiz-opt:has(input:checked) { border-color: var(--saffron); background: rgba(232,134,46,.07); }
.quiz-opt input { width: auto; }
.quiz-result { text-align: center; padding: 40px 24px; }
.quiz-result .eyebrow, .quiz-result h1 { text-align: center; }
.quiz-score { font: 700 30px var(--serif); color: var(--ok); margin: 10px 0; }

/* ---------- v1.1: student course outline — quiz row ---------- */
li.quiz-row { border-top: 1px dashed var(--line); margin-top: 4px; padding-top: 4px; }
li.quiz-row a, li.quiz-row .quiz-row-inner { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; font: 600 14px var(--sans); }
li.quiz-row a { color: var(--saffron-2); text-decoration: none !important; }
li.quiz-row a:hover { background: var(--cream); }
li.quiz-row.locked .quiz-row-inner { color: #a9ada7; }

/* ---------- v1.1: attendance ---------- */
.att-meta { margin: 2px 0; font-size: 14px; }
.attendance-grid { display: flex; flex-direction: column; gap: 4px; }
.att-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px;
  padding: 10px 4px; border-bottom: 1px solid #F0E9DA; }
.att-row:last-child { border-bottom: 0; }
.att-name { font-weight: 700; color: var(--ink); }
.att-choices { display: flex; gap: 6px; flex-wrap: wrap; }
.att-choice { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px;
  border: 1.5px solid var(--line); font: 600 12px var(--sans); cursor: pointer; }
.att-choice input { width: auto; margin: 0; }
.att-choice:has(input:checked) { border-color: transparent; }
.att-choice.att-present:has(input:checked) { background: #E2F2E8; color: var(--ok); }
.att-choice.att-late:has(input:checked) { background: #F9EBD4; color: var(--warn); }
.att-choice.att-absent:has(input:checked) { background: #F7E2DD; color: var(--danger); }
.att-choice.att-excused:has(input:checked) { background: var(--cream-2); color: var(--body); }
.att-choice:has(input:disabled) { opacity: .7; cursor: default; }

/* ---------- v1.1: assignments ---------- */
.submission-card { padding: 16px 18px; }
.sub-answer { font-size: 14px; background: var(--cream); border-radius: 10px; padding: 12px 14px; margin: 10px 0; }
.grade-form { display: grid; grid-template-columns: 140px 1fr auto; gap: 10px; align-items: end; margin-top: 12px; }
.grade-form .form-err { grid-column: 1 / -1; }
.assignment-h1 { font-size: 24px; margin-bottom: 4px; }

/* ---------- v1.8: mentor feedback ---------- */
.feedback-card { margin-bottom: 18px; }
.stars { color: var(--saffron); letter-spacing: 1px; font-size: 15px; }
.star-field { display: flex; align-items: center; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid #F0E9DA; }
.star-field:last-of-type { border-bottom: 0; }
.star-field-label { font: 600 13px var(--sans); color: var(--ink); }
.star-input { display: inline-flex; flex-direction: row-reverse; gap: 2px; }
.star-input input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.star-input label { font-size: 22px; line-height: 1; color: var(--line); cursor: pointer; transition: color .1s; }
.star-input label:hover,
.star-input label:hover ~ label,
.star-input input:checked ~ label { color: var(--saffron); }

/* ---------- v1.10: copy modules/lessons between courses ---------- */
.copy-filter { margin: 4px 0 10px; }
.copy-tree { max-height: 48vh; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; padding: 2px 14px; }
.copy-course { border-bottom: 1px solid #F0E9DA; padding: 8px 0; }
.copy-course:last-child { border-bottom: 0; }
.copy-course summary { cursor: pointer; font: 700 14px var(--sans); color: var(--ink); padding: 4px 0; }
.copy-module { margin: 8px 0 8px 16px; }
.copy-module-head { display: flex; flex-direction: row; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; cursor: pointer; }
.copy-module-head input { width: auto; margin: 0; }
.copy-lesson-list { list-style: none; margin: 6px 0 0 26px; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.copy-lesson-list label { display: flex; flex-direction: row; align-items: center; gap: 8px; font-size: 13px; font-weight: 400; color: var(--body); cursor: pointer; }
.copy-lesson-list input { width: auto; margin: 0; }

/* ---------- v1.11: custom course builder + course content peek (student page) ---------- */
.course-peek { margin-top: 8px; }
.course-peek summary { cursor: pointer; font-size: 13px; color: var(--body); }
.course-peek summary:hover { color: var(--ink); }
.peek-tree { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.peek-tree > li { font-size: 13px; color: var(--ink); }
.peek-lessons { list-style: none; margin: 4px 0 0 14px; padding: 0; display: flex; flex-direction: column; gap: 3px; font-weight: 400; color: var(--body); }
.peek-lessons li.peek-done { color: var(--ok); font-weight: 600; }
.att-peek .table-card { margin-top: 8px; }
.assign-student-list { max-height: 40vh; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; margin: 4px 0 14px; }
.assign-student-list label { display: flex; flex-direction: row; align-items: center; gap: 8px; font-size: 13px; font-weight: 400; color: var(--body); cursor: pointer; }
.assign-student-list input { width: auto; margin: 0; }

/* ---------- v1.12: student page split into attention/progress row + simplified course list ---------- */
.progress-toggle-row { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 10px 16px;
  margin-top: 12px; padding-top: 10px; border-top: 1px solid #F0E9DA; }
.progress-toggle-row details[open] { flex-basis: 100%; }
.details-toggle summary { cursor: pointer; list-style: none; display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; font: 600 12px var(--sans); color: var(--body); border: 1px solid var(--line); border-radius: 999px; }
.details-toggle summary::-webkit-details-marker { display: none; }
.details-toggle summary::after { content: '▾'; font-size: 9px; color: #9DB3A8; }
.details-toggle summary:hover { border-color: var(--saffron); color: var(--ink); }
.details-toggle[open] summary { margin-bottom: 12px; }
.details-toggle[open] summary::after { content: '▴'; }

/* ---------- v1.13: module library ---------- */
.side-nav a.sub { padding-left: 30px; font-size: 13px; }
.side-nav a.sub i { font-size: 11px; width: 14px; }
.lib-note { margin: -6px 0 14px; }
.new-course-picker { margin: 4px 0 8px; }
.new-course-picker .copy-tree { max-height: 34vh; }

/* ---------- v1.14: question bank ---------- */
.bank-filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.chip { padding: 5px 14px; border: 1px solid var(--line); border-radius: 999px; background: transparent;
  font: 600 12px var(--sans); color: var(--body); cursor: pointer; }
.chip:hover { border-color: var(--saffron); color: var(--ink); }
.chip.on { background: var(--forest); border-color: var(--forest); color: #fff; }
.chip-n { opacity: .6; margin-left: 3px; }
.bank-topic { padding: 0; margin-bottom: 12px; }
.bank-sum { display: flex; align-items: center; gap: 10px; padding: 14px 18px; cursor: pointer; list-style: none; }
.bank-sum::-webkit-details-marker { display: none; }
.bank-topic[open] .bank-sum { border-bottom: 1px solid #F0E9DA; }
.bank-title { font: 700 15px var(--sans); color: var(--ink); }
.bank-draw-row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 12px 18px; border-bottom: 1px solid #F0E9DA; }
.bank-draw-row label { display: flex; flex-direction: row; align-items: center; gap: 6px; margin: 0;
  font: 600 13px var(--sans); color: var(--body); }
.bank-draw-row input[type=number] { width: 68px; margin: 0; }
.bank-draw-row .form-err { flex-basis: 100%; margin: 0; }
.bank-list { list-style: none; margin: 0; padding: 6px 18px 14px; display: flex; flex-direction: column; gap: 10px; }
.bank-q { border: 1px solid #F0E9DA; border-radius: 10px; padding: 10px 12px; }
.bank-q-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.bank-q-text { font: 600 14px var(--sans); color: var(--ink); flex: 1 1 260px; }
.bank-q .q-options { margin-top: 6px; }
.bank-import { padding: 14px 18px; margin-bottom: 14px; }
.bank-import .bank-draw-row { padding: 8px 0 0; border-bottom: none; }
.bank-import select { margin: 0; min-width: 240px; }

/* ---------- v1.15: in-place course material ---------- */
/* Covers only the top strip of the player, where YouTube draws the video title and its
   "Watch on YouTube" link. Height is deliberately modest: the control bar sits at the
   bottom and the centre stays clickable, so pause/rewind/scrub all keep working. */
.player-guard { position: absolute; top: 0; left: 0; right: 0; height: 62px; z-index: 2; cursor: default; }
@media (max-width: 760px) { .player-guard { height: 46px; } }
/* v1.16: pdf.js canvas viewer. Scrolls within a fixed height like a document reader,
   with no toolbar of any kind — there's nothing to hide because nothing is drawn but
   the pages themselves. */
.pdf-view { margin: 10px 0 8px; }
.pdf-pages { max-height: 78vh; overflow: auto; background: #F4F1E8;
  border: 1px solid var(--line); border-radius: var(--r); padding: 12px;
  display: flex; flex-direction: column; align-items: center; gap: 12px; }
/* Zoomed past the container, a centred flex item overflows on both sides and its left
   edge becomes unreachable by scrolling. Left-align instead once that happens. */
.pdf-pages.pdf-zoomed { align-items: flex-start; }
/* A slot is created for every page at the right size straight away, so layout and the
   scrollbar are correct from the start; the canvas inside it only exists while the page
   is near the viewport. Flex would otherwise shrink these to fit — hence flex: none. */
.pdf-page { display: block; flex: none; background: #fff; max-width: none;
  border-radius: 4px; box-shadow: 0 1px 4px rgba(14,31,26,.12);
  user-select: none; -webkit-user-drag: none; overflow: hidden; }
.pdf-page-canvas { display: block; width: 100%; height: 100%;
  user-select: none; -webkit-user-drag: none; }
.pdf-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.pdf-head .file-name { margin: 0; min-width: 0; flex: 1 1 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pdf-head .btn { flex: none; }
.pdf-tools { display: inline-flex; align-items: center; gap: 4px; }
.pdf-tools .btn-icon { width: 32px; padding: 5px 0; }
.pdf-zoom-level { min-width: 58px; font-variant-numeric: tabular-nums; }
.pdf-status { margin: 6px 0 0; }

/* Fullscreen: the whole .pdf-view becomes the screen, so the page area has to grow to
   fill it — the 78vh cap and the rounded card framing only make sense inline. The head
   row stays pinned at the top so the exit button is always reachable. */
.pdf-view:fullscreen, .pdf-view:-webkit-full-screen {
  background: var(--cream); padding: 0; display: flex; flex-direction: column; }
.pdf-view:fullscreen .pdf-head, .pdf-view:-webkit-full-screen .pdf-head {
  margin: 0; padding: 10px 18px; background: #fff; border-bottom: 1px solid var(--line); flex: none; }
.pdf-view:fullscreen .pdf-pages, .pdf-view:-webkit-full-screen .pdf-pages {
  flex: 1 1 auto; max-height: none; border: 0; border-radius: 0; padding: 18px; }
.pdf-view:fullscreen .pdf-status, .pdf-view:-webkit-full-screen .pdf-status { display: none; }
/* the 1000px cap is applied by JS when computing render width, so nothing to do here —
   overriding max-width in CSS would fight the zoom control */
.file-view .doc-image { margin: 10px 0 8px; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.file-view .doc-image img { display: block; width: 100%; height: auto; user-select: none; -webkit-user-drag: none; }
.file-view { user-select: none; }

/* ---------- v1.18: student guidelines ---------- */
.gl-card { border-left: 4px solid var(--saffron); }
.gl-body { max-height: 46vh; overflow-y: auto; padding: 14px 16px; margin: 10px 0 14px;
  background: #FBF8F1; border: 1px solid var(--line); border-radius: var(--r); font-size: 14px; }
.gl-body h2, .gl-body h3 { font: 700 15px var(--sans); color: var(--ink); margin: 16px 0 6px; }
.gl-body h4 { font: 700 14px var(--sans); color: var(--ink); margin: 12px 0 4px; }
.gl-body h2:first-child, .gl-body h3:first-child { margin-top: 0; }
.gl-body p { margin: 0 0 8px; color: var(--body); }
.doc-list { margin: 0 0 10px; padding-left: 20px; color: var(--body); }
.doc-list li { margin-bottom: 4px; }
.gl-full { margin-bottom: 14px; }
.gl-agree { border-top: 1px solid var(--line); padding-top: 14px; }
.gl-check { display: flex; flex-direction: row; align-items: flex-start; gap: 10px;
  font-size: 13px; font-weight: 400; color: var(--body); cursor: pointer; margin-bottom: 12px; }
.gl-check input { width: auto; margin: 3px 0 0; flex: none; }
.gl-done, .gl-status { margin: 6px 0 0; }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .lesson-layout { grid-template-columns: 1fr; }
  .lesson-side { position: static; max-height: none; }
  .grid.two { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .side { position: fixed; z-index: 50; left: -260px; transition: left .22s; height: 100dvh; }
  body.nav-open .side { left: 0; box-shadow: 0 0 0 100vmax rgba(14,31,26,.4); }
  .burger { display: block; }
  .main { padding: 18px 14px; }
  .row2, .row3, .grade-form { grid-template-columns: 1fr; }
  .top-name { display: none; }
  .search input { width: 100%; }
  .lesson-nav { margin-left: 0; }
  .quiz-timer-bar { top: 0; }
  .att-row { flex-direction: column; align-items: flex-start; }

  /* v1.17 mobile pass — rows that were built wide and never checked on a phone.
     Each of these is a flex row of title + pills + two or three buttons, with no wrap,
     so on a narrow screen the buttons ran off the edge. */
  .enroll-head, .bank-sum, .mod-row, .q-row { flex-wrap: wrap; }
  .snap-grid { grid-template-columns: 1fr; }        /* Last activity / Next up side by side was far too cramped */
  .grid.cards { grid-template-columns: 1fr; }       /* minmax(300px) left a sliver of overflow at 360px */
  .card { padding: 16px 14px; }
  .page-actions { gap: 8px; }
  .page-actions .btn, .page-actions .btn-primary { flex: 1 1 auto; }
  .pdf-pages { max-height: 70vh; padding: 8px; gap: 8px; }
  .bank-filters { gap: 6px; }
  .chip { padding: 4px 11px; font-size: 11px; }
  .modal, .modal-wide { width: calc(100vw - 24px); max-width: none; padding: 18px 16px; }
  .copy-tree, .assign-student-list { max-height: 44vh; }
  .lesson-h1 { font-size: 22px; }
  .side-nav a.sub { padding-left: 26px; }
}
