:root {
  --ink: #17202a;
  --muted: #5b6673;
  --paper: #f7f9fb;
  --surface: #ffffff;
  --line: #d9e0e7;
  --navy: #173a5e;
  --teal: #087f75;
  --amber: #b66a12;
  --red: #a43a42;
  --focus: #006fd6;
  --shadow: 0 10px 28px rgba(18, 35, 52, 0.08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: Inter, Aptos, "Segoe UI", Arial, sans-serif; line-height: 1.55; }
a { color: inherit; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid rgba(0,111,214,.35); outline-offset: 3px; }

.site-header { min-height: 66px; padding: 0 5vw; display: flex; align-items: center; justify-content: space-between; gap: 24px; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.course-mark { display: flex; align-items: baseline; gap: 10px; text-decoration: none; font-weight: 650; }
.course-code { color: var(--navy); font-size: 1.08rem; font-weight: 800; }
.top-nav { display: flex; gap: 22px; }
.top-nav a { color: var(--muted); text-decoration: none; font-size: .92rem; }
.top-nav a:hover { color: var(--navy); }

main { min-height: calc(100vh - 130px); }
.course-overview { min-height: 430px; padding: 70px 7vw 54px; display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(280px, .7fr); gap: 8vw; align-items: end; background: var(--surface); border-bottom: 1px solid var(--line); }
.eyebrow { margin: 0 0 7px; color: var(--teal); font-weight: 800; text-transform: uppercase; letter-spacing: .08em; font-size: .76rem; }
h1, h2, h3 { margin-top: 0; letter-spacing: 0; line-height: 1.14; }
h1 { margin-bottom: 18px; font-size: clamp(2.5rem, 5vw, 5rem); max-width: 930px; }
h2 { margin-bottom: 12px; font-size: clamp(1.7rem, 3vw, 2.65rem); }
h3 { font-size: 1.1rem; }
.lede { max-width: 800px; color: var(--muted); font-size: clamp(1.05rem, 1.8vw, 1.35rem); }
.course-facts { margin: 0; border-top: 3px solid var(--navy); }
.course-facts div { padding: 13px 0; display: grid; grid-template-columns: 1fr 1.2fr; gap: 16px; border-bottom: 1px solid var(--line); }
.course-facts dt { color: var(--muted); font-size: .84rem; }
.course-facts dd { margin: 0; font-weight: 700; }

.section { padding: 62px 7vw; }
.section-heading { margin-bottom: 30px; display: flex; justify-content: space-between; align-items: end; gap: 36px; }
.section-heading > p { max-width: 560px; color: var(--muted); }
.lecture-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 18px; }
.lecture-card { min-height: 355px; padding: 0 22px 21px; display: flex; flex-direction: column; text-decoration: none; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.lecture-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: #a9b8c7; }
.lecture-card img { width: calc(100% + 44px); height: 160px; margin: 0 -22px 18px; object-fit: cover; border-bottom: 1px solid var(--line); }
.lecture-number { color: var(--teal); font-size: .78rem; font-weight: 850; letter-spacing: .08em; }
.lecture-card h3 { margin: 5px 0 8px; }
.lecture-card p { margin: 0 0 18px; color: var(--muted); }
.card-action { margin-top: auto; color: var(--navy); font-weight: 750; }

.practice-band { padding: 54px 7vw 60px; color: #fff; background: #162d43; }
.practice-band .eyebrow { color: #67d3c7; }
.practice-steps { margin: 28px 0 34px; display: grid; grid-template-columns: repeat(3,1fr); border-top: 1px solid rgba(255,255,255,.22); }
.practice-steps div { padding: 22px 28px 10px 0; }
.practice-steps span { color: #67d3c7; font-variant-numeric: tabular-nums; }
.practice-steps h3 { margin: 5px 0; }
.practice-steps p { margin: 0; color: #c9d7e3; }

.button { min-height: 42px; padding: 9px 15px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid transparent; border-radius: 5px; text-decoration: none; font-weight: 750; cursor: pointer; }
.button-primary { color: #fff; background: var(--teal); }
.button-primary:hover { background: #066c64; }
.button-secondary { color: var(--navy); background: var(--surface); border-color: #b8c6d3; }
.button-secondary:hover { border-color: var(--navy); }
.button-danger { color: var(--red); background: transparent; border-color: #d7aeb1; }
.button-row { display: flex; flex-wrap: wrap; gap: 10px; }

.resources { background: var(--surface); }
.resource-list { border-top: 1px solid var(--line); }
.resource-list a { padding: 17px 0; display: grid; grid-template-columns: minmax(220px,.7fr) 1fr; gap: 24px; text-decoration: none; border-bottom: 1px solid var(--line); }
.resource-list span { color: var(--muted); }
.attendance-callout { padding: 44px 7vw; display: flex; align-items: center; justify-content: space-between; gap: 40px; color: #fff; background: #214d49; }
.attendance-callout h2 { margin-bottom: 8px; }
.attendance-callout p:not(.eyebrow) { max-width: 720px; margin: 0; color: #d5e7e4; }
.attendance-callout .eyebrow { color: #8be0d5; }
footer { min-height: 64px; padding: 0 5vw; display: flex; align-items: center; justify-content: space-between; color: var(--muted); background: var(--surface); border-top: 1px solid var(--line); font-size: .86rem; }

/* Attendance prototype */
.attendance-shell { width: min(1460px, 100%); margin: 0 auto; padding: 46px 5vw 72px; }
.attendance-heading { display: grid; grid-template-columns: minmax(0,1.4fr) minmax(300px,.6fr); gap: 64px; align-items: end; }
.attendance-heading h1 { margin-bottom: 10px; font-size: clamp(2.7rem,5vw,4.8rem); }
.attendance-heading .lede { margin-bottom: 0; }
.prototype-notice { padding: 18px 0; display: grid; gap: 4px; border-top: 3px solid var(--amber); border-bottom: 1px solid var(--line); }
.prototype-notice span { color: var(--muted); font-size: .9rem; }
.attendance-tabs { margin-top: 40px; display: flex; gap: 2px; border-bottom: 1px solid var(--line); }
.attendance-tab { padding: 13px 20px; color: var(--muted); background: transparent; border: 0; border-bottom: 3px solid transparent; cursor: pointer; font-weight: 800; }
.attendance-tab:hover { color: var(--navy); }
.attendance-tab.is-active { color: var(--navy); border-bottom-color: var(--teal); }
.attendance-panel { padding-top: 28px; }
.attendance-panel[hidden] { display: none; }
.attendance-layout { display: grid; grid-template-columns: minmax(0,1fr) 280px; gap: 32px; align-items: start; }
.attendance-workspace { display: grid; gap: 18px; }
.tool-section { padding: 25px; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; }
.tool-section-heading { margin-bottom: 10px; display: flex; align-items: center; justify-content: space-between; gap: 22px; }
.tool-section-heading > div:first-child { display: flex; align-items: center; gap: 12px; }
.tool-section-heading h2 { margin: 0; font-size: 1.3rem; }
.step-number { width: 30px; height: 30px; display: inline-grid; place-items: center; flex: 0 0 auto; color: #fff; background: var(--navy); border-radius: 50%; font-size: .82rem; font-weight: 850; }
.section-intro { margin: 0 0 19px 42px; color: var(--muted); font-size: .91rem; }
.status-chip { min-height: 28px; padding: 4px 9px; display: inline-flex; align-items: center; color: var(--muted); background: #eef2f5; border: 1px solid #d8e0e7; border-radius: 4px; font-size: .75rem; font-weight: 800; white-space: nowrap; }
.status-chip.is-ready { color: #075d48; background: #e5f5ef; border-color: #9ecfbe; }
.status-chip.is-live { color: #fff; background: var(--teal); border-color: var(--teal); }
.status-chip.is-error { color: #8a2530; background: #fbeaec; border-color: #dfafb4; }
.roster-controls, .session-controls { display: grid; grid-template-columns: minmax(150px,.8fr) minmax(180px,1fr) minmax(230px,1.35fr) auto; gap: 12px; align-items: end; }
.session-controls { grid-template-columns: minmax(200px,1.3fr) minmax(140px,.7fr) auto auto; }
.file-control input { padding: 6px; }
.file-control input::file-selector-button { height: 30px; margin-right: 8px; padding: 0 10px; color: var(--navy); background: #edf2f6; border: 1px solid #becbd6; border-radius: 3px; cursor: pointer; font-weight: 750; }
.form-status { min-height: 22px; margin: 13px 0 0; color: var(--muted); font-size: .86rem; }
.validation-summary { margin-top: 16px; padding: 12px 14px; display: flex; flex-wrap: wrap; gap: 10px 24px; background: #edf7f4; border-left: 3px solid var(--teal); font-size: .84rem; }
.validation-summary span { color: var(--muted); }
.table-scroll { overflow: auto; }
.roster-preview { max-height: 280px; margin-top: 16px; border: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; font-size: .88rem; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); background: #f2f5f7; font-size: .74rem; text-transform: uppercase; }
tbody tr:last-child td { border-bottom: 0; }
.live-session { margin-top: 18px; display: grid; grid-template-columns: minmax(210px,.55fr) minmax(430px,1.35fr) minmax(250px,.7fr); gap: 30px; align-items: center; padding: 28px; color: #fff; background: #173a5e; border-radius: 5px; }
.code-display { display: grid; }
.code-display span, .code-display small { color: #bcd0df; }
.code-display strong { margin: 3px 0; font: 800 2.8rem/1.1 Consolas, monospace; letter-spacing: .12em; }
.qr-display { display: grid; grid-template-columns: 300px minmax(140px,1fr); gap: 20px; align-items: center; }
.student-qr { width: 300px; height: 300px; padding: 10px; display: grid; place-items: center; background: #fff; }
.student-qr img, .student-qr canvas { width: 280px !important; height: 280px !important; }
.qr-display > div:last-child { display: grid; align-content: center; gap: 5px; }
.qr-display span { color: #bcd0df; font-size: .78rem; }
.qr-fallback { padding: 8px; color: var(--muted) !important; text-align: center; }
.light-text-button { margin: 3px 0 0; padding: 0; justify-self: start; color: #fff; font-size: .78rem; }
.session-facts { margin: 0; display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; }
.session-facts div { padding-left: 14px; border-left: 1px solid #52718c; }
.session-facts dt { color: #bcd0df; font-size: .75rem; }
.session-facts dd { margin: 3px 0 0; font-size: 1.08rem; font-weight: 800; }
.attendance-metrics { margin: 18px 0; display: grid; grid-template-columns: repeat(3,1fr); border-top: 2px solid var(--navy); border-bottom: 1px solid var(--line); }
.attendance-metrics div { padding: 14px 16px; display: flex; align-items: baseline; justify-content: space-between; gap: 12px; border-right: 1px solid var(--line); }
.attendance-metrics div:last-child { border-right: 0; }
.attendance-metrics span { color: var(--muted); font-size: .82rem; }
.attendance-metrics strong { font-size: 1.5rem; }
.attendance-results { max-height: 380px; border: 1px solid var(--line); }
.empty-table { height: 80px; color: var(--muted); text-align: center; }
.attendance-state { color: var(--muted); }
.attendance-state.is-present { color: #08705b; font-weight: 800; }
.flow-guide { padding: 24px; color: #fff; background: #162d43; position: sticky; top: 92px; }
.flow-guide .eyebrow { color: #67d3c7; }
.flow-guide h2 { font-size: 1.5rem; }
.flow-guide ol { margin: 0; padding: 0; list-style: none; counter-reset: flow; }
.flow-guide li { padding: 15px 0; display: grid; gap: 4px; border-top: 1px solid rgba(255,255,255,.14); counter-increment: flow; }
.flow-guide li strong::before { content: counter(flow) ". "; color: #67d3c7; }
.flow-guide li span { color: #c9d7e3; font-size: .85rem; }
.privacy-note { margin-top: 22px; padding-top: 16px; border-top: 3px solid #67d3c7; }
.privacy-note p { margin-bottom: 0; color: #c9d7e3; font-size: .85rem; }
.student-preview { min-height: 650px; display: grid; grid-template-columns: 390px minmax(300px,520px); gap: 70px; align-items: center; justify-content: center; }
.phone-frame { width: 390px; min-height: 690px; background: #fff; border: 10px solid #1d2730; border-radius: 38px; box-shadow: 0 24px 70px rgba(18,35,52,.18); overflow: hidden; }
.phone-status { height: 36px; padding: 0 18px; display: flex; align-items: center; justify-content: space-between; color: #fff; background: #1d2730; font-size: .72rem; font-weight: 800; }
.phone-content { padding: 34px 25px; }
.phone-content h2 { font-size: 1.7rem; }
.identity-state { margin: 22px 0; padding: 13px; display: flex; gap: 12px; align-items: center; background: #edf3f7; border-left: 3px solid var(--navy); }
.identity-mark { width: 35px; height: 35px; display: grid; place-items: center; flex: 0 0 auto; color: #fff; background: var(--navy); border-radius: 50%; font-size: .7rem; font-weight: 850; }
.identity-state p { margin: 2px 0 0; color: var(--muted); font-size: .75rem; }
.phone-content form { display: grid; gap: 15px; }
.student-submit { width: 100%; margin-top: 5px; }
.checkin-result { min-height: 72px; margin-top: 20px; padding: 13px; display: grid; gap: 3px; font-size: .88rem; }
.checkin-result:empty { padding: 0; }
.checkin-result.is-success { color: #075d48; background: #e5f5ef; border: 1px solid #9ecfbe; }
.checkin-result.is-error { color: #8a2530; background: #fbeaec; border: 1px solid #dfafb4; }
.text-button { margin: 18px auto 0; display: block; color: var(--navy); background: transparent; border: 0; cursor: pointer; text-decoration: underline; }
.student-only #instructor-tab, .student-only #return-instructor { display: none; }
.student-explanation p:not(.eyebrow) { color: var(--muted); }

/* Lecture pages */
.lecture-shell { display: grid; grid-template-columns: 230px minmax(0,1fr); }
.lecture-sidebar { min-height: calc(100vh - 66px); padding: 28px 20px; background: #13283b; color: #fff; position: sticky; top: 66px; align-self: start; }
.lecture-sidebar .back-link { color: #aac2d6; text-decoration: none; font-size: .85rem; }
.lecture-sidebar strong { margin: 24px 0 12px; display: block; font-size: 1.2rem; }
.lecture-sidebar nav { display: grid; }
.lecture-sidebar nav a { padding: 9px 0; color: #c6d5e1; text-decoration: none; border-bottom: 1px solid rgba(255,255,255,.09); font-size: .9rem; }
.lecture-sidebar nav a:hover { color: #fff; }
.lecture-content { min-width: 0; }
.lecture-hero { min-height: 360px; padding: 54px 6vw 34px; display: grid; grid-template-columns: minmax(0,1.25fr) minmax(300px,.75fr); gap: 48px; align-items: center; background: var(--surface); border-bottom: 1px solid var(--line); }
.lecture-hero h1 { font-size: clamp(2.2rem,4vw,4rem); }
.lecture-hero img { width: 100%; max-height: 300px; object-fit: contain; background: #fff; border: 1px solid var(--line); }
.lecture-main { padding: 46px 6vw 72px; }
.lecture-section { padding: 24px 0 42px; border-bottom: 1px solid var(--line); scroll-margin-top: 84px; }
.objectives { display: grid; grid-template-columns: repeat(2,1fr); gap: 10px 28px; }
.objectives li { padding: 5px 0; }
.concept-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.concept-list details { background: var(--surface); border: 1px solid var(--line); border-radius: 5px; }
.concept-list summary { padding: 15px 17px; cursor: pointer; font-weight: 750; }
.concept-list details p { margin: 0; padding: 0 17px 17px; color: var(--muted); }
.workflow { display: grid; grid-template-columns: repeat(4,1fr); border-top: 2px solid var(--navy); }
.workflow div { padding: 17px 18px 8px 0; }
.workflow span { color: var(--amber); font-weight: 850; }
.workflow p { color: var(--muted); }
.notebook-list { display: grid; gap: 10px; }
.notebook-item { padding: 15px 16px; display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 20px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 5px; }
.notebook-item p { margin: 3px 0 0; color: var(--muted); font-size: .9rem; }

.quiz-status { margin-bottom: 16px; display: flex; justify-content: space-between; color: var(--muted); font-size: .9rem; }
.quiz-question { padding: 22px; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; }
.quiz-question h3 { font-size: 1.2rem; }
.quiz-options { display: grid; gap: 9px; }
.quiz-option { width: 100%; padding: 12px 14px; color: var(--ink); text-align: left; background: #fff; border: 1px solid #cbd5df; border-radius: 5px; cursor: pointer; }
.quiz-option:hover { border-color: var(--navy); }
.quiz-option.correct { color: #075d48; background: #e5f5ef; border-color: #58a98f; }
.quiz-option.incorrect { color: #8a2530; background: #fbeaec; border-color: #cf7c85; }
.quiz-feedback { min-height: 28px; margin: 14px 0 0; font-weight: 650; }
.true-false-options { display: grid; grid-template-columns: repeat(2,minmax(120px,180px)); gap: 10px; }
.true-false-options .quiz-option { text-align: center; font-weight: 800; }

.generator-controls { padding: 18px; display: grid; grid-template-columns: 1fr 1fr auto; gap: 12px; align-items: end; background: var(--surface); border: 1px solid var(--line); border-radius: 6px 6px 0 0; }
label { display: grid; gap: 5px; color: var(--muted); font-size: .84rem; font-weight: 700; }
input, select { min-height: 42px; padding: 8px 10px; color: var(--ink); background: #fff; border: 1px solid #b8c6d3; border-radius: 4px; }
.problem-output { padding: 24px; background: #fff; border: 1px solid var(--line); border-top: 0; border-radius: 0 0 6px 6px; }
.problem-meta { display: flex; gap: 10px; color: var(--muted); font-size: .82rem; }
.problem-output h3 { margin: 8px 0 12px; font-size: 1.28rem; }
.problem-body { overflow-x: auto; }
.matrix { margin: 14px 0; display: inline-grid; gap: 5px; padding: 8px 14px; border-left: 2px solid var(--ink); border-right: 2px solid var(--ink); font: 600 1rem/1.2 "Cambria Math", Consolas, monospace; }
.matrix-row { display: grid; grid-template-columns: repeat(var(--cols), minmax(35px,auto)); gap: 13px; text-align: right; }
.solution { margin-top: 18px; padding-top: 16px; border-top: 2px solid var(--teal); }
.solution[hidden] { display: none; }
.solution h4 { margin: 0 0 8px; color: var(--teal); }
.solution ol { padding-left: 22px; }
.copy-note { min-height: 22px; color: var(--teal); font-size: .86rem; }
.manual-editor { margin: 22px 0 18px; padding: 20px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.manual-editor-heading { margin-bottom: 16px; display: flex; align-items: start; justify-content: space-between; gap: 24px; }
.manual-editor-heading h4 { margin: 0 0 4px; font-size: 1.05rem; }
.manual-editor-heading p { margin: 0; color: var(--muted); }
.input-mode { color: var(--teal); font-size: .78rem; font-weight: 800; text-transform: uppercase; }
.dimension-controls { display: grid; grid-template-columns: repeat(3,minmax(140px,200px)); gap: 12px; align-items: end; }
.matrix-editor-layout { margin-top: 18px; display: grid; grid-template-columns: minmax(0,1.2fr) minmax(380px,.8fr); gap: 22px; align-items: start; }
.matrix-editor-layout fieldset { min-width: 0; margin: 0; padding: 12px 0 0; border: 0; border-top: 2px solid var(--navy); }
.matrix-editor-layout legend { padding: 0 10px 0 0; color: var(--navy); font-size: .85rem; font-weight: 800; }
.matrix-editor-scroll { max-width: 100%; overflow-x: auto; padding: 6px 2px 10px; }
.editable-matrix { width: max-content; display: grid; grid-template-columns: repeat(var(--cols),70px); gap: 5px; }
.editable-matrix input { width: 70px; min-height: 37px; padding: 5px 6px; text-align: right; font: 600 .84rem/1.2 "Cambria Math", Consolas, monospace; }
.manual-actions { margin-top: 16px; display: flex; align-items: center; gap: 16px; }
.manual-actions p { margin: 0; color: var(--muted); font-size: .84rem; }
.bank-field-grid { display: grid; grid-template-columns: repeat(3,minmax(150px,1fr)); gap: 18px; align-items: start; }
.bank-field-grid > label { min-width: 0; }
.bank-matrix-field { min-width: 0; margin: 0; padding: 10px 0 0; border: 0; border-top: 2px solid var(--navy); grid-column: span 2; }
.bank-matrix-field legend { padding: 0 10px 0 0; color: var(--navy); font-size: .85rem; font-weight: 800; }
.bank-editor .editable-matrix { grid-template-columns: repeat(var(--cols),64px); }
.bank-editor .editable-matrix input { width: 64px; }
.padding-results { display: grid; gap: 26px; }
.padding-results section { min-width: 0; padding-top: 12px; border-top: 1px solid var(--line); }
.padding-results h5 { margin: 0 0 8px; font-size: 1rem; }
.padding-case-content { display: grid; grid-template-columns: minmax(220px,.4fr) minmax(0,1fr); gap: 28px; align-items: start; }
.padding-case-content p { margin: 5px 0; color: var(--muted); font-size: .86rem; }
.full-filter-output { min-width: 0; overflow-x: auto; }

@media (max-width: 1200px) {
  .attendance-layout { grid-template-columns: 1fr; }
  .flow-guide { position: static; }
  .live-session { grid-template-columns: minmax(210px,.55fr) minmax(430px,1.45fr); }
  .session-facts { grid-column: 1 / -1; }
}

@media (max-width: 920px) {
  .lecture-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .course-overview, .lecture-hero { grid-template-columns: 1fr; }
  .lecture-shell { display: block; }
  .lecture-sidebar { min-height: 0; position: static; }
  .lecture-sidebar nav { grid-template-columns: repeat(3,1fr); gap: 0 15px; }
  .workflow { grid-template-columns: repeat(2,1fr); }
  .matrix-editor-layout, .padding-case-content { grid-template-columns: 1fr; }
  .bank-field-grid { grid-template-columns: repeat(2,minmax(140px,1fr)); }
  .attendance-heading, .attendance-layout { grid-template-columns: 1fr; }
  .flow-guide { position: static; }
  .roster-controls { grid-template-columns: 1fr 1fr; }
  .session-controls { grid-template-columns: 1fr 1fr; }
  .live-session { grid-template-columns: 1fr 1fr; }
  .session-facts { grid-column: 1 / -1; }
  .qr-display { grid-template-columns: 240px 1fr; }
  .student-qr { width: 240px; height: 240px; }
  .student-qr img, .student-qr canvas { width: 220px !important; height: 220px !important; }
  .student-preview { grid-template-columns: 1fr; justify-items: center; gap: 36px; }
  .student-explanation { max-width: 580px; }
}
@media (max-width: 640px) {
  .site-header { padding: 12px 18px; align-items: flex-start; }
  .course-mark { display: grid; gap: 0; }
  .top-nav { display: none; }
  .course-overview, .section, .practice-band { padding-left: 20px; padding-right: 20px; }
  .lecture-grid, .concept-list, .objectives, .practice-steps, .workflow { grid-template-columns: 1fr; }
  .section-heading { display: block; }
  .lecture-card { min-height: 320px; }
  .lecture-sidebar nav { grid-template-columns: repeat(2,1fr); }
  .lecture-hero, .lecture-main { padding-left: 20px; padding-right: 20px; }
  .generator-controls { grid-template-columns: 1fr; }
  .true-false-options { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .dimension-controls { grid-template-columns: 1fr; }
  .bank-field-grid { grid-template-columns: 1fr; }
  .bank-matrix-field { grid-column: 1; }
  .manual-actions { align-items: flex-start; flex-direction: column; }
  .resource-list a, .notebook-item { grid-template-columns: 1fr; }
  .attendance-callout { align-items: flex-start; flex-direction: column; }
  .attendance-shell { padding: 30px 18px 52px; }
  .attendance-heading { gap: 28px; }
  .attendance-tabs { overflow-x: auto; }
  .attendance-tab { flex: 0 0 auto; }
  .tool-section { padding: 18px; }
  .tool-section-heading { align-items: flex-start; }
  .tool-section-heading > div:first-child { align-items: flex-start; }
  .tool-section-heading .button-row { justify-content: flex-end; }
  .section-intro { margin-left: 0; }
  .roster-controls, .session-controls, .live-session, .session-facts { grid-template-columns: 1fr; }
  .session-facts { grid-column: auto; }
  .qr-display { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .student-qr { width: 240px !important; height: 240px !important; }
  .student-qr img, .student-qr canvas { width: 220px !important; height: 220px !important; }
  .light-text-button { justify-self: center; }
  .validation-summary { display: grid; gap: 5px; }
  .session-facts div { padding: 8px 0 0; border-top: 1px solid #52718c; border-left: 0; }
  .attendance-metrics div { padding: 10px; align-items: flex-start; flex-direction: column; }
  .phone-frame { width: min(100%,390px); min-height: 640px; border-width: 7px; border-radius: 28px; }
  .phone-content { padding: 28px 20px; }
  footer { align-items: flex-start; flex-direction: column; justify-content: center; }
}
