:root {
  --navy: #17324d;
  --red: #d94a3a;
  --blue: #2f6f91;
  --yellow: #f2d95c;
  --paper: #f7f8f3;
  --white: #fff;
  --pencil: #66717b;
  --line: #c8d0d5;
  --soft-blue: #e8f2f6;
  --soft-yellow: #fff8ce;
  --display: "BIZ UDPGothic", "Yu Gothic", sans-serif;
  --body: "Noto Sans JP", "Hiragino Kaku Gothic ProN", sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Consolas, monospace;
  color-scheme: light;
}

* { box-sizing: border-box; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--navy);
  font-family: var(--body);
  line-height: 1.75;
}
a { color: var(--blue); text-underline-offset: .2em; }
a:hover { text-decoration-thickness: 2px; }
button, input, select { font: inherit; }
:focus-visible { outline: 4px solid var(--yellow); outline-offset: 3px; }

.skip-link { position: absolute; left: 1rem; top: -5rem; z-index: 99; background: var(--navy); color: white; padding: .7rem 1rem; }
.skip-link:focus { top: 1rem; }
.site-header { background: var(--white); border-bottom: 3px solid var(--navy); }
.header-inner { max-width: 1180px; margin: auto; min-height: 76px; padding: .7rem 1.25rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.brand { display: inline-flex; align-items: center; gap: .7rem; color: var(--navy); text-decoration: none; font-family: var(--display); font-weight: 800; }
.brand-mark { display: grid; place-items: center; width: 42px; height: 42px; border: 3px solid var(--navy); border-radius: 50%; background: var(--yellow); font-family: var(--mono); font-size: .77rem; transform: rotate(-4deg); }
.site-nav { display: flex; gap: 1rem; flex-wrap: wrap; }
.site-nav a { color: var(--navy); font-weight: 700; text-decoration: none; padding: .35rem .2rem; }
.site-nav a[aria-current="page"] { border-bottom: 3px solid var(--red); }

.container { max-width: 1180px; margin: auto; padding: 0 1.25rem; }
.hero { border-bottom: 1px solid var(--line); background-color: var(--white); background-image: linear-gradient(#e6eaec 1px, transparent 1px), linear-gradient(90deg, #e6eaec 1px, transparent 1px); background-size: 24px 24px; }
.hero-inner { min-height: 500px; display: grid; grid-template-columns: 1.18fr .82fr; align-items: center; gap: clamp(2rem, 6vw, 6rem); padding-top: 4.5rem; padding-bottom: 4.5rem; }
.eyebrow { margin: 0 0 .7rem; color: var(--red); font-family: var(--mono); font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
h1, h2, h3 { font-family: var(--display); line-height: 1.35; }
h1 { max-width: 13ch; margin: 0; font-size: clamp(2.4rem, 6vw, 5.7rem); letter-spacing: -.06em; }
.lead { max-width: 42rem; font-size: clamp(1.05rem, 2vw, 1.3rem); }
.actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1.8rem; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: .65rem 1.15rem; border: 2px solid var(--navy); background: var(--navy); color: white; font-weight: 800; text-decoration: none; box-shadow: 4px 4px 0 var(--yellow); cursor: pointer; }
.button.secondary { background: white; color: var(--navy); box-shadow: none; }
.button.print { background: var(--red); border-color: var(--red); box-shadow: none; }
.desk-note { position: relative; padding: 2rem; border: 1px solid #d6c76f; background: var(--soft-yellow); box-shadow: 12px 14px 0 rgba(23,50,77,.12); transform: rotate(1.3deg); }
.desk-note::before { content: "授業前チェック"; position: absolute; top: -1rem; left: 1.2rem; padding: .2rem .7rem; background: var(--red); color: white; font-family: var(--mono); font-size: .8rem; transform: rotate(-3deg); }
.checklist { padding: 0; list-style: none; }
.checklist li { display: grid; grid-template-columns: 1.5rem 1fr; gap: .5rem; margin: .65rem 0; }
.checklist li::before { content: "□"; font-weight: 900; }

.section { padding: clamp(3.5rem, 8vw, 7rem) 0; }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 1rem; margin-bottom: 2rem; }
.section-head h2, .page-title { margin: 0; font-size: clamp(2rem, 4vw, 3.5rem); letter-spacing: -.04em; }
.section-kicker { font-family: var(--mono); color: var(--red); font-weight: 800; }
.material-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.material-card { position: relative; display: flex; flex-direction: column; min-height: 100%; padding: 1.35rem; border: 1px solid var(--line); border-top: 8px solid var(--blue); background: white; }
.material-card h3 { margin: .8rem 0 .4rem; font-size: 1.35rem; }
.material-card p { margin-top: .25rem; }
.material-card .card-link { margin-top: auto; font-weight: 800; }
.meta-row { display: flex; flex-wrap: wrap; gap: .4rem; }
.tag { display: inline-block; padding: .16rem .55rem; border: 1px solid currentColor; font-size: .78rem; font-weight: 800; line-height: 1.5; }
.tag.time { background: var(--yellow); color: var(--navy); border-color: var(--navy); font-family: var(--mono); }
.lesson-clock { display: flex; height: 12px; margin: .7rem 0 1rem; border: 1px solid var(--navy); }
.lesson-clock span:nth-child(1) { flex: 5; background: var(--yellow); }
.lesson-clock span:nth-child(2) { flex: 18; background: var(--blue); }
.lesson-clock span:nth-child(3) { flex: 12; background: #86b8a5; }
.lesson-clock span:nth-child(4) { flex: 10; background: var(--red); }
.clock-key { margin: -.5rem 0 .5rem; color: var(--pencil); font-family: var(--mono); font-size: .7rem; }

.catalog-layout { display: grid; grid-template-columns: 280px 1fr; gap: 2.5rem; padding-top: 3rem; padding-bottom: 6rem; }
.filters { align-self: start; position: sticky; top: 1rem; padding: 1.25rem; border: 2px solid var(--navy); background: white; }
.filters h2 { margin-top: 0; font-size: 1.2rem; }
.field { display: grid; gap: .35rem; margin: 1rem 0; }
.field label, .field legend { font-weight: 800; }
.field input, .field select { width: 100%; min-height: 46px; padding: .55rem; border: 1px solid var(--pencil); background: white; color: var(--navy); }
.result-status { margin: 0 0 1rem; font-weight: 800; }
.empty-state { display: none; padding: 2rem; border: 2px dashed var(--line); background: white; text-align: center; }

.page-hero { padding: 3.5rem 0 2.8rem; border-bottom: 1px solid var(--line); background: white; }
.page-hero .page-title { max-width: 20ch; }
.breadcrumb { margin-bottom: 1rem; color: var(--pencil); font-size: .9rem; }
.breadcrumb ol { display: flex; flex-wrap: wrap; gap: .4rem; list-style: none; padding: 0; }
.breadcrumb li + li::before { content: "/"; margin-right: .4rem; }
.lesson-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 3rem; padding-top: 3rem; padding-bottom: 6rem; }
.lesson-content h2 { margin-top: 3rem; padding-bottom: .45rem; border-bottom: 3px solid var(--navy); }
.lesson-content h3 { margin-top: 2rem; }
.lesson-aside { align-self: start; position: sticky; top: 1rem; padding: 1rem; border: 1px solid var(--line); background: white; }
.lesson-aside ul { padding-left: 1.3rem; }
.facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: .7rem; margin: 1.5rem 0; }
.fact { padding: .8rem; border-left: 5px solid var(--yellow); background: white; }
.fact dt { color: var(--pencil); font-size: .78rem; font-weight: 800; }
.fact dd { margin: .2rem 0 0; font-weight: 800; }
.timeline { list-style: none; padding: 0; }
.timeline li { display: grid; grid-template-columns: 5.5rem 1fr; gap: 1rem; padding: 1rem 0; border-bottom: 1px solid var(--line); }
.timeline time { font-family: var(--mono); font-weight: 900; color: var(--red); }
.callout { padding: 1.2rem; border-left: 7px solid var(--red); background: #fff1ee; }
.source-box { padding: 1.2rem; border: 1px solid var(--line); background: var(--soft-blue); }
.resource-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.resource-item { display: block; padding: 1rem; border: 2px solid var(--navy); background: white; color: var(--navy); text-decoration: none; }
.resource-item strong { display: block; }
table { width: 100%; border-collapse: collapse; background: white; }
th, td { padding: .8rem; border: 1px solid var(--line); text-align: left; vertical-align: top; }
th { background: var(--soft-blue); }

.print-sheet { max-width: 920px; margin: 2rem auto; padding: 2.2rem; border: 1px solid var(--line); background: white; }
.print-toolbar { position: sticky; top: 0; z-index: 3; display: flex; justify-content: center; gap: 1rem; padding: .7rem; background: rgba(247,248,243,.95); }
.answer-lines { min-height: 7rem; background: repeating-linear-gradient(transparent, transparent 2rem, var(--line) 2rem, var(--line) calc(2rem + 1px)); }
.slide { min-height: 620px; display: grid; align-content: center; padding: 4rem; border-bottom: 12px solid var(--yellow); page-break-after: always; }
.slide h2 { font-size: clamp(2rem, 6vw, 4.2rem); }
.card-cut-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .8rem; }
.cut-card { min-height: 170px; padding: 1rem; border: 2px dashed var(--navy); page-break-inside: avoid; }
.footer { border-top: 3px solid var(--navy); background: white; }
.footer-inner { display: grid; grid-template-columns: 1fr auto; gap: 2rem; padding-top: 2rem; padding-bottom: 2rem; }
.small { color: var(--pencil); font-size: .86rem; }

/* 教師・生徒用の非公開画面 */
.auth-body, .dashboard-body, .student-auth-body, .student-dashboard-body { min-height: 100vh; background-color: #edf1f2; background-image: linear-gradient(#dce3e6 1px, transparent 1px), linear-gradient(90deg, #dce3e6 1px, transparent 1px); background-size: 24px 24px; }
.auth-shell { width: min(1180px, calc(100% - 2rem)); margin: 0 auto; padding: clamp(2.5rem, 7vw, 6rem) 0; }
.auth-intro { max-width: 820px; margin-bottom: 2rem; }
.auth-intro h1 { max-width: 14ch; font-size: clamp(2.4rem, 6vw, 5rem); }
.auth-intro > p:last-child { max-width: 48rem; font-size: 1.1rem; }
.auth-card { width: min(620px, 100%); padding: clamp(1.25rem, 4vw, 2.5rem); border: 3px solid var(--navy); background: white; box-shadow: 12px 12px 0 var(--yellow); }
.auth-card h2 { margin-top: 0; font-size: 1.7rem; }
.auth-card .field input { border-width: 2px; }
.form-status { min-height: 1.75rem; font-weight: 800; color: var(--red); }
.auth-note, .privacy-slip { margin-top: 2rem; padding: 1rem; border-left: 6px solid var(--blue); background: var(--soft-blue); }
.setup-list { display: grid; gap: .7rem; padding-left: 1.4rem; }
.student-card { box-shadow: 12px 12px 0 #86b8a5; }

.teacher-login-body { min-height: 100vh; background: #f5f7f9; color: #24384b; }
.teacher-login-body .site-header { border-bottom: 1px solid #d9e0e5; }
.teacher-login-body .header-inner { min-height: 64px; }
.teacher-login-body .brand-mark { width: 36px; height: 36px; border-width: 2px; background: #eef4f7; transform: none; }
.simple-auth-shell { display: grid; place-items: start center; width: min(100% - 2rem, 1120px); min-height: calc(100vh - 65px); margin: 0 auto; padding: clamp(3rem, 10vh, 6rem) 0; }
.teacher-login-card { width: min(440px, 100%); padding: 1.75rem; border: 1px solid #d1dbe1; border-radius: 12px; box-shadow: none; }
.teacher-login-card h1 { max-width: none; margin: 0 0 1.5rem; font-size: 1.65rem; letter-spacing: -.02em; }
.teacher-login-card .button { width: 100%; min-height: 46px; border: 1px solid #274c68; border-radius: 8px; box-shadow: none; }
.teacher-login-card .form-status { margin-bottom: 0; }

.student-session-bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 2rem; padding: 1rem 1.25rem; border: 2px solid var(--navy); background: white; }
.student-session-bar > div { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; }
.student-session-bar span { color: var(--pencil); }
.status-dot { width: .8rem; height: .8rem; border-radius: 50%; background: #2f8a65; box-shadow: 0 0 0 4px #dff4eb; }

.dashboard-body { background: #f5f7f9; background-image: none; color: #24384b; }
.dashboard-body .site-header { border-bottom: 1px solid #d9e0e5; }
.dashboard-body .header-inner { min-height: 64px; }
.dashboard-body .brand-mark { width: 36px; height: 36px; border-width: 2px; background: #eef4f7; transform: none; }
.dashboard-body .button { min-height: 42px; border: 1px solid #274c68; border-radius: 8px; box-shadow: none; font-weight: 700; }
.dashboard-body :focus-visible { outline: 3px solid #f0c94b; outline-offset: 2px; }
.dashboard-shell { width: min(1120px, calc(100% - 2rem)); margin: 0 auto; padding: 2rem 0 5rem; }
.teacher-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; margin-bottom: 1.5rem; }
.dashboard-title h1 { max-width: none; margin: 0; font-size: clamp(1.7rem, 4vw, 2.2rem); letter-spacing: -.03em; }
.dashboard-title p, .dashboard-heading p, .setting-title-row p { margin: .25rem 0 0; color: #657582; font-size: .9rem; }
.teacher-account { display: flex; align-items: center; gap: .75rem; }
.teacher-account > span:not(.status-dot) { display: grid; line-height: 1.45; }
.teacher-account small { color: #657582; }
.new-class-panel { margin-bottom: 2.5rem; padding: 1.4rem; border: 1px solid #d6dfe5; border-radius: 12px; background: white; }
.new-class-panel h2 { margin: 0; font-size: 1.2rem; }
.new-class-form { display: grid; grid-template-columns: minmax(240px, 1fr) auto; align-items: end; gap: .75rem; margin-top: 1rem; }
.new-class-form .field { margin: 0; }
.new-class-form .form-status { grid-column: 1 / -1; margin: 0; }
.dashboard-heading { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.dashboard-heading h2 { margin: 0; font-size: 1.35rem; }
.classroom-list { display: grid; gap: 1.5rem; }
.classroom-card { overflow: hidden; border: 1px solid #ccd7de; border-radius: 14px; background: white; }
.classroom-card > header { display: flex; justify-content: space-between; gap: 1rem; padding: 1.25rem 1.5rem; border-bottom: 1px solid #dce3e8; background: #f9fbfc; }
.classroom-card h3 { margin: 0; font-size: 1.35rem; }
.classroom-card header p { margin: 0; }
.access-lamp { align-self: start; min-width: 72px; padding: .25rem .55rem; border: 1px solid #b8c3ca; border-radius: 999px; background: #edf0f2; color: #53616b; font-size: .75rem; font-weight: 700; text-align: center; }
.access-lamp.open { background: #bdebd8; color: #174f3c; }
.classroom-head-actions { display: flex; align-items: center; gap: .75rem; }
.classroom-head-actions button { border: 0; background: transparent; color: #a33d35; text-decoration: underline; text-underline-offset: .2em; cursor: pointer; }
.classroom-controls { position: relative; padding: 0 1.5rem; }
.classroom-controls::before { position: absolute; top: 2.5rem; bottom: 0; left: 2.62rem; width: 1px; background: #cbd8df; content: ""; }
.setting-section { position: relative; display: grid; grid-template-columns: 2.3rem minmax(0, 1fr); gap: 1rem; padding: 1.5rem 0; border-bottom: 1px solid #e2e7ea; }
.setting-number { z-index: 1; display: grid; place-items: center; align-self: start; width: 2.3rem; height: 2.3rem; border-radius: 50%; background: #274c68; color: white; font-weight: 800; line-height: 1; }
.setting-content { min-width: 0; }
.setting-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.setting-title-row h4, .setting-title-row h5 { margin: 0; font-size: 1.08rem; }
.help-button { flex: 0 0 auto; display: grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 1px solid #8093a0; border-radius: 50%; background: white; color: #274c68; font-weight: 800; line-height: 1; cursor: pointer; }
.help-button[aria-expanded="true"] { background: #274c68; color: white; }
.setting-help[hidden] { display: none; }
.setting-help { margin: 1rem 0; padding: 1rem 1.1rem; border: 1px solid #c9dce7; border-radius: 10px; background: #f2f8fb; color: #344d5f; }
.setting-help h3, .setting-help h5 { margin: 0 0 .35rem; font-size: 1rem; }
.setting-help p { margin: .35rem 0; }
.help-example { display: grid; gap: .2rem; margin-top: .8rem; padding: .75rem .9rem; border-left: 3px solid #5683a0; background: white; }
.help-example strong { color: #274c68; }
.help-example span::before { content: "・"; }
.help-note { margin-top: .8rem !important; font-weight: 700; }
.help-flow { display: flex; align-items: stretch; gap: .5rem; margin: .9rem 0; }
.help-flow span { flex: 1; display: grid; place-items: center; min-height: 62px; padding: .55rem; border: 1px solid #b9ccd7; border-radius: 8px; background: white; text-align: center; }
.help-flow b { align-self: center; color: #66808f; }
.help-flow small { display: block; color: #657582; }
.material-checks { display: grid; gap: 0; margin: 1rem 0; border-top: 1px solid #e1e7ea; }
.material-checks label { display: grid; grid-template-columns: 1.25rem 1fr; gap: .6rem; padding: .65rem .25rem; border-bottom: 1px solid #e1e7ea; font-size: .88rem; cursor: pointer; }
.material-checks input { width: 1.05rem; height: 1.05rem; margin-top: .25rem; }
.inline-form, .access-controls { display: flex; gap: .55rem; align-items: end; flex-wrap: wrap; }
.inline-form label { display: grid; gap: .2rem; font-weight: 800; }
.access-controls label { display: grid; gap: .2rem; color: #435765; font-size: .88rem; font-weight: 700; }
.inline-form input, .access-controls select, .credential-output input { min-height: 42px; padding: .45rem; border: 1px solid var(--pencil); background: white; }
.student-table-wrap { max-height: 320px; overflow: auto; margin-top: 1rem; }
.student-table { font-size: .82rem; }
.student-table th, .student-table td { padding: .55rem; }
.student-table button, .credential-output button { padding: .3rem .5rem; border: 1px solid var(--navy); background: white; color: var(--navy); cursor: pointer; }
.empty-guidance { margin: .75rem 0 0; color: #657582; }
.credential-output { margin: 0 1.5rem 1.25rem 4.8rem; padding: 1rem; border: 1px solid #d39b8f; border-radius: 10px; background: #fff7f5; }
.credential-output strong { display: block; font-family: var(--display); font-size: 1.15rem; }
.credential-output pre { overflow: auto; padding: 1rem; background: white; border: 1px solid var(--line); font-size: .85rem; }
.credential-output input { width: min(100%, 650px); margin-right: .4rem; }
.card-status { min-height: 1.5rem; margin: 0 1.5rem 1rem 4.8rem; color: var(--red); font-weight: 800; }
.dashboard-empty { margin: 0; }

.student-session-bar { border-left: 10px solid #86b8a5; }
.student-material-zone { padding: clamp(1.25rem, 4vw, 2.5rem); border: 2px solid var(--navy); background: var(--paper); }
.student-material-zone > h2 { margin-top: 0; font-size: clamp(1.8rem, 4vw, 3rem); }

/* 授業中の生徒状態 */
.classroom-live-panel { padding: 1.5rem; border-bottom: 0; background: #f9fbfc; }
.live-panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 1.5rem; margin-bottom: 1rem; }
.live-panel-heading > div:first-child { flex: 1; min-width: 0; }
.live-panel-heading h4 { margin: 0; font-family: var(--display); font-size: 1.08rem; }
.live-connection { display: block; margin-bottom: .45rem; color: var(--pencil); font-family: var(--mono); font-size: .72rem; font-weight: 900; text-align: right; }
.live-connection[data-state="connected"] { color: #216a50; }
.live-connection[data-state="disconnected"] { color: var(--red); }
.live-summary { display: flex; gap: .45rem; justify-content: flex-end; }
.live-summary span { min-width: 96px; padding: .35rem .55rem; border: 1px solid var(--line); border-radius: 6px; background: white; font-size: .75rem; text-align: center; }
.live-summary span.attention { border-color: var(--red); background: #fff1ee; color: #9b2e24; }
.live-summary strong { font-family: var(--mono); font-size: 1.1rem; }
.live-student-list { display: grid; gap: .55rem; }
.live-student-row { display: grid; grid-template-columns: minmax(220px, .8fr) minmax(360px, 1.2fr); align-items: center; gap: 1rem; padding: .75rem; border: 1px solid var(--line); border-left: 5px solid #aeb8bd; border-radius: 7px; background: white; }
.live-student-row.active, .live-student-row.ready { border-left-color: #2f8a65; }
.live-student-row.away { border-left-color: var(--red); background: #fff4f1; }
.live-student-row.idle { border-left-color: #d29b1f; background: #fff9dc; }
.live-student-state { display: flex; align-items: center; gap: .7rem; min-width: 0; }
.live-state-lamp { flex: 0 0 auto; width: 14px; height: 14px; border: 2px solid var(--navy); border-radius: 50%; background: #aeb8bd; box-shadow: 0 0 0 4px #eef1f2; }
.active .live-state-lamp, .ready .live-state-lamp { background: #48b184; box-shadow: 0 0 0 4px #dff4eb; }
.away .live-state-lamp { background: var(--red); box-shadow: 0 0 0 4px #f9d9d4; }
.idle .live-state-lamp { background: var(--yellow); box-shadow: 0 0 0 4px #fff3b0; }
.live-student-state div { display: grid; min-width: 0; }
.live-student-state span { color: var(--red); font-size: .8rem; font-weight: 900; }
.live-student-state small { overflow: hidden; color: var(--pencil); text-overflow: ellipsis; white-space: nowrap; }
.live-student-actions { display: flex; align-items: center; justify-content: flex-end; gap: .4rem; flex-wrap: wrap; }
.live-student-actions button, .live-student-actions select, .student-viewer-toolbar button { min-height: 36px; padding: .35rem .55rem; border: 1px solid var(--navy); background: white; color: var(--navy); font-size: .78rem; font-weight: 800; cursor: pointer; }
.live-student-actions button:last-child { border-color: var(--red); color: var(--red); }
.live-student-actions button:disabled, .live-student-actions select:disabled { cursor: not-allowed; opacity: .45; }
.live-empty { margin: 0; padding: 1rem; border: 1px dashed var(--line); border-radius: 7px; background: white; text-align: center; }
.status-guide { display: grid; gap: .55rem; margin: .8rem 0; padding: 0; list-style: none; }
.status-guide li { display: flex; align-items: center; gap: .65rem; }
.status-guide i { flex: 0 0 auto; width: 13px; height: 13px; border-radius: 50%; background: #aeb8bd; }
.status-guide .guide-green { background: #48a67f; }
.status-guide .guide-yellow { background: #e0ad2f; }
.status-guide .guide-red { background: #d65c50; }
.status-guide .guide-gray { background: #aeb8bd; }

.student-zone-heading { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; }
.student-zone-heading h2 { margin: 0; font-size: clamp(1.8rem, 4vw, 3rem); }
.student-zone-heading .eyebrow { margin-bottom: .2rem; font-size: .72rem; }
.student-live-lamp { padding: .25rem .55rem; border: 1px solid var(--navy); background: #dfe4e7; font-family: var(--mono); font-size: .7rem; font-weight: 900; }
.student-live-lamp.connected { background: #bdebd8; color: #174f3c; }
.student-live-lamp.connecting { background: var(--soft-yellow); }
.student-live-lamp.disconnected { background: #fff1ee; color: var(--red); }
.student-material-open { margin-top: auto; padding: 0; border: 0; background: transparent; color: var(--blue); font: inherit; font-weight: 800; text-align: left; text-decoration: underline; text-underline-offset: .2em; cursor: pointer; }
.student-viewer { margin-top: 1.5rem; border: 3px solid var(--navy); background: white; box-shadow: 8px 8px 0 var(--yellow); }
.student-viewer[hidden], .student-live-alert[hidden] { display: none; }
.student-viewer-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .75rem; border-bottom: 2px solid var(--navy); background: var(--soft-yellow); }
.student-viewer-toolbar > div { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.student-viewer iframe { display: block; width: 100%; height: min(74vh, 900px); border: 0; background: white; }
.student-viewer:fullscreen { width: 100vw; height: 100vh; border: 0; box-shadow: none; }
.student-viewer:fullscreen iframe { height: calc(100vh - 62px); }
.student-live-alert { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 1rem; background: rgba(23, 50, 77, .78); }
.student-live-alert > div { width: min(520px, 100%); padding: 2rem; border: 4px solid var(--navy); background: white; box-shadow: 12px 12px 0 var(--yellow); }
.student-live-alert h2 { margin-top: .2rem; font-size: clamp(1.8rem, 5vw, 3rem); }


@media (max-width: 900px) {
  .hero-inner, .catalog-layout, .lesson-layout { grid-template-columns: 1fr; }
  .material-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-inner { min-height: auto; }
  .filters, .lesson-aside { position: static; }
  .facts { grid-template-columns: repeat(2, 1fr); }
  .live-student-row { grid-template-columns: 1fr; }
  .live-student-actions { justify-content: flex-start; }
}
@media (max-width: 640px) {
  .header-inner, .section-head, .footer-inner { align-items: flex-start; flex-direction: column; }
  .site-nav { gap: .7rem; }
  .material-grid, .resource-list, .card-cut-grid { grid-template-columns: 1fr; }
  .hero-inner { padding-top: 3rem; padding-bottom: 3rem; }
  h1 { font-size: 2.7rem; }
  .facts { grid-template-columns: 1fr 1fr; }
  .timeline li { grid-template-columns: 1fr; gap: 0; }
  .print-sheet { margin: 0; padding: 1rem; border: 0; }
  .teacher-toolbar, .student-session-bar, .dashboard-heading { align-items: stretch; flex-direction: column; }
  .teacher-account { align-items: flex-start; flex-wrap: wrap; }
  .teacher-account .button { width: 100%; }
  .new-class-form { grid-template-columns: 1fr; }
  .new-class-form .form-status { grid-column: auto; }
  .classroom-card > header, .classroom-head-actions { align-items: flex-start; flex-direction: column; }
  .classroom-controls { padding: 0 1rem; }
  .classroom-controls::before { left: 2.12rem; }
  .setting-section { grid-template-columns: 2.25rem minmax(0, 1fr); gap: .7rem; }
  .setting-title-row { gap: .6rem; }
  .help-flow { display: grid; grid-template-columns: 1fr; }
  .help-flow b { justify-self: center; transform: rotate(90deg); }
  .credential-output, .card-status { margin-left: 1rem; margin-right: 1rem; }
  .auth-shell { width: min(100% - 1rem, 1180px); }
  .live-panel-heading, .student-zone-heading, .student-viewer-toolbar { align-items: stretch; flex-direction: column; }
  .live-connection { text-align: left; }
  .live-summary { justify-content: flex-start; }
  .live-student-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .live-student-actions select { grid-column: 1 / -1; width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
@media print {
  @page { size: A4; margin: 14mm; }
  body { background: white; color: #111; font-size: 10.5pt; }
  .site-header, .footer, .print-toolbar, .lesson-aside, .no-print { display: none !important; }
  .print-sheet, .lesson-layout { max-width: none; margin: 0; padding: 0; border: 0; display: block; }
  a { color: inherit; text-decoration: none; }
  .slide { min-height: 0; height: 180mm; border: 1px solid #777; }
  .cut-card { min-height: 58mm; }
  .dashboard-body * { visibility: hidden; }
  .dashboard-body .credential-output:not([hidden]), .dashboard-body .credential-output:not([hidden]) * { visibility: visible; }
  .dashboard-body .credential-output:not([hidden]) { position: absolute; inset: 0; margin: 0; border: 0; background: white; }
}
