:root {
  --ink: #1d2927;
  --ink-soft: #536460;
  --surface: #ffffff;
  --canvas: #f3f6f4;
  --line: #dce4e1;
  --line-strong: #c6d2ce;
  --brand: #17766f;
  --brand-dark: #105d58;
  --brand-soft: #e0f0ed;
  --accent: #c96935;
  --accent-soft: #fae9df;
  --danger: #b33d48;
  --danger-soft: #f8e4e6;
  --success: #347451;
  --success-soft: #e1f0e7;
  --warning: #966117;
  --warning-soft: #f7ecd6;
  --sidebar: #202b29;
  --shadow: 0 12px 35px rgba(20, 44, 38, .12);
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  color: var(--ink);
  background: var(--canvas);
  letter-spacing: 0;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--canvas); }
body { margin: 0; min-height: 100vh; background: var(--canvas); }
button, input, select, textarea { font: inherit; letter-spacing: 0; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
input, select, textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  padding: 9px 11px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; line-height: 1.6; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(23, 118, 111, .13); }
label { display: grid; gap: 7px; color: #344440; font-size: 13px; font-weight: 700; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { letter-spacing: 0; }
.hidden { display: none !important; }
.muted { color: var(--ink-soft); }
.eyebrow { color: var(--brand); font-weight: 800; font-size: 12px; margin-bottom: 7px; }

.primary, .secondary, .text-button {
  min-height: 40px;
  border-radius: 6px;
  border: 1px solid transparent;
  padding: 8px 15px;
  font-weight: 750;
  white-space: nowrap;
}
.primary { background: var(--brand); color: #fff; border-color: var(--brand); }
.primary:hover { background: var(--brand-dark); }
.secondary { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.secondary:hover { background: #eef3f1; }
.text-button { color: var(--brand); background: transparent; padding-inline: 4px; }
.text-button:hover { color: var(--brand-dark); text-decoration: underline; }
.small { min-height: 34px; padding: 5px 10px; font-size: 12px; }
.wide { width: 100%; }
.icon-button {
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 21px;
  line-height: 1;
}
.icon-button:hover { color: var(--ink); background: #edf2f0; }

/* Login */
.login-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(380px, .7fr);
  background: #eef3f1;
}
.login-brand {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 9vh max(7vw, 50px);
  background: var(--sidebar);
  color: #fff;
  position: relative;
  overflow: hidden;
}
.login-brand img { margin-bottom: 34px; }
.login-brand .eyebrow { color: #8fd0c7; }
.login-brand h1 { font-size: 42px; line-height: 1.18; max-width: 600px; margin-bottom: 20px; }
.login-brand > p:not(.eyebrow) { color: #becbc8; line-height: 1.8; max-width: 570px; font-size: 16px; }
.login-facts { display: flex; gap: 46px; margin: 54px 0 0; }
.login-facts div { display: grid; gap: 5px; }
.login-facts dt { font-size: 26px; font-weight: 800; color: #fff; }
.login-facts dd { margin: 0; color: #9fb0ac; font-size: 13px; }
.login-panel { align-self: center; width: min(420px, calc(100% - 48px)); margin: 24px auto; padding: 38px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); }
.login-panel-head { display: flex; align-items: center; gap: 8px; color: var(--success); font-size: 12px; margin-bottom: 28px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #42a66e; box-shadow: 0 0 0 4px var(--success-soft); }
.login-panel h2 { font-size: 25px; margin-bottom: 8px; }
.login-panel > .muted { font-size: 14px; margin-bottom: 26px; }
.stack-form { display: grid; gap: 17px; }
.stack-form .primary { margin-top: 6px; }
.quick-accounts { border-top: 1px solid var(--line); margin-top: 26px; padding-top: 19px; }
.quick-accounts p { margin-bottom: 10px; color: var(--ink-soft); font-size: 12px; }
.quick-accounts div { display: flex; flex-wrap: wrap; gap: 7px; }
.quick-accounts button { border: 1px solid var(--line); background: #f6f8f7; color: var(--ink-soft); border-radius: 4px; padding: 5px 9px; font-size: 12px; }
.quick-accounts button:hover { border-color: var(--brand); color: var(--brand); }
.form-error { min-height: 18px; margin: 12px 0 0; color: var(--danger); font-size: 13px; line-height: 1.5; }

/* App shell */
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 230px minmax(0, 1fr); }
.sidebar { background: var(--sidebar); color: #e7eeec; padding: 21px 14px; display: flex; flex-direction: column; min-height: 100vh; position: sticky; top: 0; height: 100vh; z-index: 30; }
.brand-lockup { display: flex; align-items: center; gap: 11px; padding: 0 9px 25px; border-bottom: 1px solid rgba(255,255,255,.1); }
.brand-lockup img { border-radius: 7px; }
.brand-lockup strong, .brand-lockup span { display: block; }
.brand-lockup strong { font-size: 14px; }
.brand-lockup span { margin-top: 3px; font-size: 11px; color: #91a5a0; }
.sidebar nav { display: grid; gap: 5px; padding-top: 20px; }
.nav-item { min-height: 44px; border: 0; border-radius: 6px; background: transparent; color: #b7c5c2; display: grid; grid-template-columns: 28px 1fr; align-items: center; text-align: left; padding: 8px 12px; font-weight: 700; font-size: 13px; }
.nav-item span { width: 23px; height: 23px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.12); border-radius: 5px; font-size: 12px; }
.nav-item b { font: inherit; }
.nav-item:hover { color: #fff; background: rgba(255,255,255,.06); }
.nav-item.active { background: var(--brand); color: #fff; }
.sidebar-foot { margin-top: auto; padding: 18px 9px 0; border-top: 1px solid rgba(255,255,255,.1); display: grid; gap: 10px; }
.sidebar-foot span { color: #7f9690; font-size: 10px; }
.sidebar-foot button { border: 0; padding: 0; background: transparent; color: #d0dad7; text-align: left; font-size: 12px; }
.workspace { min-width: 0; }
.topbar { height: 74px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.96); display: flex; align-items: center; gap: 20px; padding: 0 28px; position: sticky; top: 0; z-index: 20; }
.page-heading { min-width: 150px; margin-right: auto; }
.page-heading p { font-size: 10px; color: var(--ink-soft); margin-bottom: 3px; }
.page-heading h1 { font-size: 18px; margin: 0; }
.topbar-controls { display: flex; align-items: center; gap: 13px; flex: 0 0 auto; }
.compact-select { display: flex; align-items: center; gap: 7px; flex: 0 0 auto; font-size: 11px; color: var(--ink-soft); white-space: nowrap; }
.compact-select select { min-width: 130px; min-height: 36px; padding-block: 5px; font-size: 12px; }
.teacher-date-control { min-width: 166px; }
.teacher-date-control input { width: 136px; min-height: 36px; padding-block: 5px; font-size: 12px; }
.user-chip { display: flex; align-items: center; gap: 9px; padding-left: 13px; border-left: 1px solid var(--line); }
.user-chip > span { width: 35px; height: 35px; display: grid; place-items: center; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 800; }
.user-chip strong, .user-chip small { display: block; }
.user-chip strong { font-size: 12px; }
.user-chip small { color: var(--ink-soft); font-size: 10px; margin-top: 2px; }
.mobile-menu { display: none; }
.notification-button { width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--ink-soft); position: relative; }
.notification-button > span { display: grid; place-items: center; width: 18px; height: 18px; border: 1px solid var(--line-strong); border-radius: 50%; margin: auto; font-size: 10px; font-weight: 800; }
.notification-button b { position: absolute; right: -5px; top: -6px; min-width: 17px; height: 17px; padding-inline: 4px; border-radius: 9px; background: var(--danger); color: #fff; font-size: 9px; line-height: 17px; }
main { padding: 28px; max-width: 1600px; margin: 0 auto; }
.view { display: none; }
.view.active { display: block; }
.section-toolbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 22px; }
.section-toolbar h2 { font-size: 21px; margin-bottom: 6px; }
.section-toolbar p { margin: 0; font-size: 12px; }

/* Dashboard */
.metric-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 24px; }
.metric { min-height: 112px; padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 7px; position: relative; overflow: hidden; }
.metric::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--brand); }
.metric:nth-child(2)::after { background: var(--accent); }
.metric:nth-child(3)::after { background: #4e6fa8; }
.metric:nth-child(4)::after { background: var(--warning); }
.metric:nth-child(5)::after { background: var(--success); }
.metric span { display: block; color: var(--ink-soft); font-size: 11px; margin-bottom: 14px; }
.metric strong { display: block; font-size: 26px; line-height: 1; }
.metric small { display: block; margin-top: 9px; color: #778682; font-size: 10px; }
.split-layout { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 18px; }
.data-section, .attention-panel, .task-panel { background: var(--surface); border: 1px solid var(--line); border-radius: 7px; }
.section-heading { min-height: 67px; padding: 15px 18px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.section-heading h3 { font-size: 14px; margin-bottom: 4px; }
.section-heading p { margin: 0; color: var(--ink-soft); font-size: 10px; }
.schedule-list { min-height: 260px; }
.schedule-row { display: grid; grid-template-columns: 90px 1fr 150px 90px; gap: 12px; align-items: center; padding: 14px 18px; border-bottom: 1px solid #edf1ef; font-size: 12px; }
.schedule-row:last-child { border-bottom: 0; }
.schedule-time { font-weight: 800; color: var(--brand); }
.schedule-student strong, .schedule-student span { display: block; }
.schedule-student span { color: var(--ink-soft); font-size: 10px; margin-top: 4px; }
.attention-panel { padding: 18px; }
.attention-panel h3 { font-size: 14px; padding-bottom: 14px; margin-bottom: 0; border-bottom: 1px solid var(--line); }
.attention-panel ul { list-style: none; padding: 0; margin: 0; }
.attention-panel li { padding: 15px 2px; border-bottom: 1px solid #edf1ef; font-size: 12px; line-height: 1.55; color: var(--ink-soft); }
.attention-panel li strong { color: var(--ink); }
.personal-heading { align-items: center; }
.personal-heading h2 { font-size: 25px; margin-bottom: 8px; }
.personal-metrics .metric { min-height: 108px; }
.personal-task-list { min-height: 260px; padding: 7px 18px 14px; }
.personal-task-row { display: grid; grid-template-columns: 29px minmax(0, 1fr) auto; align-items: center; gap: 11px; min-height: 62px; border-bottom: 1px solid #edf1ef; }
.personal-task-row:last-child { border-bottom: 0; }
.personal-task-row .task-sequence { width: 24px; height: 24px; }
.personal-task-row strong, .personal-task-row small { display: block; }
.personal-task-row strong { font-size: 12px; }
.personal-task-row small { color: var(--ink-soft); font-size: 10px; margin-top: 4px; }
.personal-task-row.completed .task-sequence { color: #fff; background: var(--success); border-color: var(--success); }
.personal-side-panel { min-height: 300px; }
.personal-side-card { padding: 20px 2px 6px; }
.personal-side-card strong, .personal-side-card span { display: block; }
.personal-side-card strong { font-size: 18px; color: var(--brand); }
.personal-side-card span { color: var(--ink-soft); font-size: 11px; line-height: 1.65; margin-top: 8px; }
.child-summary-list { display: grid; gap: 10px; padding-top: 13px; }
.child-summary { padding: 12px; border: 1px solid var(--line); border-radius: 6px; background: #fbfcfb; }
.child-summary-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.child-summary strong { font-size: 13px; }
.child-summary p { margin: 7px 0 0; font-size: 10px; color: var(--ink-soft); line-height: 1.5; }
.child-summary .progress-track { margin-top: 10px; }
.personal-side-panel .section-heading { margin: 0 -2px; padding-inline: 2px; }

/* Data views */
.filter-bar { min-height: 58px; border: 1px solid var(--line); border-bottom: 0; background: var(--surface); padding: 9px 12px; display: flex; align-items: center; justify-content: space-between; gap: 15px; border-radius: 7px 7px 0 0; }
.filter-bar > label:not(.search-field) { display: flex; align-items: center; gap: 10px; }
.filter-bar input[type="date"] { width: 160px; min-height: 36px; }
.search-field { width: min(420px, 100%); display: grid; grid-template-columns: 22px 1fr; align-items: center; color: var(--ink-soft); font-size: 18px; }
.search-field input { border: 0; min-height: 37px; box-shadow: none; padding-left: 2px; }
.result-count { color: var(--ink-soft); font-size: 11px; white-space: nowrap; }
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 0 0 7px 7px; background: var(--surface); }
.section-toolbar + .table-wrap { border-radius: 7px; }
table { width: 100%; border-collapse: collapse; min-width: 850px; }
th { height: 41px; background: #f0f4f2; border-bottom: 1px solid var(--line); color: #52635f; text-align: left; font-size: 10px; padding: 9px 14px; white-space: nowrap; }
td { min-height: 54px; padding: 12px 14px; border-bottom: 1px solid #edf1ef; font-size: 12px; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #f9fbfa; }
.student-cell { display: flex; align-items: center; gap: 10px; }
.avatar { flex: 0 0 auto; width: 32px; height: 32px; border-radius: 6px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); font-weight: 800; }
.student-cell strong, .student-cell small { display: block; }
.student-cell small { color: var(--ink-soft); margin-top: 3px; font-size: 10px; }
.badge { display: inline-flex; align-items: center; justify-content: center; min-height: 24px; padding: 3px 8px; border-radius: 4px; background: #eef2f1; color: #53645f; font-size: 10px; font-weight: 750; white-space: nowrap; }
.badge.active, .badge.completed, .badge.qualified, .badge.passed { background: var(--success-soft); color: var(--success); }
.badge.lead, .badge.pending, .badge.booked { background: var(--warning-soft); color: var(--warning); }
.badge.checked_in, .badge.in_progress, .badge.submitted { background: var(--brand-soft); color: var(--brand); }
.badge.needs_revision, .badge.failed, .badge.overdue, .badge.absent { background: var(--danger-soft); color: var(--danger); }
.badge.cancelled, .badge.paused { color: #6d7976; background: #e9edec; }
.row-actions { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.row-action { min-height: 29px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); color: var(--brand); padding: 4px 8px; font-size: 10px; white-space: nowrap; }
.row-action:hover { border-color: var(--brand); }
.row-action.danger { color: var(--danger); }
.empty-row { text-align: center; padding: 40px; color: var(--ink-soft); }
.mobile-list { display: none; }
.summary-strip { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--surface); border: 1px solid var(--line); border-radius: 7px 7px 0 0; border-bottom: 0; }
.summary-strip > div { padding: 14px 18px; border-right: 1px solid var(--line); }
.summary-strip > div:last-child { border-right: 0; }
.summary-strip span, .summary-strip strong { display: block; }
.summary-strip span { color: var(--ink-soft); font-size: 10px; margin-bottom: 6px; }
.summary-strip strong { font-size: 17px; }
.legend { display: flex; gap: 16px; color: var(--ink-soft); font-size: 10px; }
.legend span { display: flex; align-items: center; gap: 5px; }
.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.dot.booked { background: var(--warning); }
.dot.present { background: var(--brand); }
.dot.done { background: var(--success); }

/* Learning */
.learning-layout { display: grid; grid-template-columns: 330px minmax(0, 1fr); gap: 16px; align-items: start; }
.plan-list { display: grid; gap: 8px; }
.plan-item { width: 100%; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--ink); padding: 14px; text-align: left; }
.plan-item:hover, .plan-item.active { border-color: var(--brand); box-shadow: inset 3px 0 var(--brand); }
.plan-item-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.plan-item strong { font-size: 13px; }
.plan-item p { margin: 8px 0 0; color: var(--ink-soft); font-size: 10px; }
.progress-track { width: 100%; height: 5px; border: 0; border-radius: 3px; background: #e8eeec; margin-top: 12px; overflow: hidden; appearance: none; }
.progress-track::-webkit-progress-bar { background: #e8eeec; }
.progress-track::-webkit-progress-value { background: var(--brand); }
.progress-track::-moz-progress-bar { background: var(--brand); }
.task-panel { min-height: 430px; }
.task-panel-head { padding: 17px 20px; border-bottom: 1px solid var(--line); }
.task-panel-head h3 { margin-bottom: 6px; font-size: 15px; }
.task-panel-head p { margin: 0; color: var(--ink-soft); font-size: 11px; }
.task-list { padding: 8px 20px 20px; }
.task-row { display: grid; grid-template-columns: 34px minmax(0, 1fr) 110px 82px; align-items: center; gap: 12px; min-height: 64px; border-bottom: 1px solid #edf1ef; }
.task-sequence { width: 25px; height: 25px; border-radius: 50%; border: 1px solid var(--line-strong); display: grid; place-items: center; color: var(--ink-soft); font-size: 10px; font-weight: 800; }
.task-row.completed .task-sequence { background: var(--success); color: #fff; border-color: var(--success); }
.task-name strong, .task-name span { display: block; }
.task-name strong { font-size: 12px; }
.task-name span { color: var(--ink-soft); font-size: 10px; margin-top: 5px; }
.task-name small { display: block; margin-top: 4px; color: var(--ink-soft); font-size: 9px; }
.task-row-actions { display: flex; justify-content: flex-end; gap: 5px; }
.empty-state { min-height: 260px; display: grid; place-content: center; text-align: center; padding: 30px; color: var(--ink-soft); }
.empty-state strong { color: var(--ink); font-size: 14px; }
.empty-state p { margin: 7px 0 0; font-size: 11px; }

/* Teacher workspace */
.teacher-home-heading { align-items: center; }
.teacher-home-heading h2 { font-size: 25px; margin-bottom: 7px; }
.teacher-heading-actions { display: flex; gap: 8px; }
.teacher-metric-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 9px; margin-bottom: 18px; }
.teacher-metric { min-height: 96px; padding: 14px 13px; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; }
.teacher-metric span, .teacher-metric small, .teacher-metric strong { display: block; }
.teacher-metric span { color: var(--ink-soft); font-size: 10px; min-height: 27px; line-height: 1.4; }
.teacher-metric strong { font-size: 23px; margin-top: 4px; }
.teacher-metric small { color: #75847f; font-size: 9px; margin-top: 6px; }
.teacher-metric.attention { border-color: #e8c997; background: #fffdf8; }
.teacher-metric.critical { border-color: #e2afb4; background: #fffafb; }
.teacher-home-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.teacher-timeline-section { min-height: 475px; }
.teacher-timeline { padding: 8px 18px 18px; }
.timeline-row { display: grid; grid-template-columns: 70px 4px 110px minmax(0, 1fr) auto; gap: 11px; align-items: center; min-height: 63px; border-bottom: 1px solid #edf1ef; }
.timeline-row:last-child { border-bottom: 0; }
.timeline-row time { font-weight: 800; font-size: 12px; }
.timeline-line { width: 4px; height: 31px; border-radius: 2px; background: var(--brand); }
.timeline-row.small_class .timeline-line { background: var(--accent); }
.timeline-row.weekly_test .timeline-line, .timeline-row.evening_study .timeline-line { background: #4e6fa8; }
.timeline-row.parent_contact .timeline-line { background: var(--danger); }
.timeline-kind { color: var(--ink-soft); font-size: 10px; }
.timeline-person strong, .timeline-person span { display: block; }
.timeline-person strong { font-size: 12px; }
.timeline-person span { color: var(--ink-soft); font-size: 10px; margin-top: 4px; }
.teacher-right-rail { display: grid; gap: 14px; }
.teacher-right-rail .attention-panel { padding: 15px 17px; }
.rail-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; border-bottom: 1px solid var(--line); }
.rail-heading h3 { border: 0; padding-bottom: 13px; }
.rail-heading .text-button { font-size: 10px; }
.focus-row { display: grid; grid-template-columns: 30px 1fr auto; gap: 9px; align-items: center; padding: 12px 0; border-bottom: 1px solid #edf1ef; }
.focus-row:last-child { border-bottom: 0; }
.focus-severity { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 5px; color: var(--warning); background: var(--warning-soft); font-size: 11px; font-weight: 800; }
.focus-row.critical .focus-severity { color: var(--danger); background: var(--danger-soft); }
.focus-row strong, .focus-row small { display: block; }
.focus-row strong { font-size: 11px; }
.focus-row small { color: var(--ink-soft); font-size: 9px; margin-top: 4px; }
.todo-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid #edf1ef; font-size: 11px; }
.todo-row:last-child { border-bottom: 0; }
.todo-row b { min-width: 25px; height: 24px; display: grid; place-items: center; border-radius: 4px; background: var(--brand-soft); color: var(--brand); }

/* Student learning mode */
.student-status-strip { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 7px; background: var(--surface); margin-bottom: 14px; }
.student-status-item { min-height: 65px; padding: 12px 14px; border-right: 1px solid var(--line); }
.student-status-item:last-child { border-right: 0; }
.student-status-item span, .student-status-item strong { display: block; }
.student-status-item span { color: var(--ink-soft); font-size: 9px; margin-bottom: 5px; }
.student-status-item strong { font-size: 12px; overflow-wrap: anywhere; }
.student-learning-layout { display: grid; grid-template-columns: 285px minmax(390px, 1fr) 275px; gap: 12px; align-items: stretch; min-height: calc(100vh - 183px); }
.student-task-column, .student-current-column, .student-session-column { background: var(--surface); border: 1px solid var(--line); border-radius: 7px; min-width: 0; }
.student-column-heading { min-height: 76px; padding: 14px 16px; display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; border-bottom: 1px solid var(--line); }
.student-column-heading .eyebrow { margin-bottom: 3px; }
.student-column-heading h2 { font-size: 16px; margin: 0; }
.student-column-heading > span { color: var(--ink-soft); font-size: 9px; }
.student-flow-list { padding: 7px 12px 14px; }
.student-flow-item { width: 100%; border: 0; border-bottom: 1px solid #edf1ef; background: transparent; color: var(--ink); display: grid; grid-template-columns: 26px minmax(0, 1fr) 18px; gap: 8px; align-items: center; min-height: 57px; padding: 7px 3px; text-align: left; }
.student-flow-item:last-child { border-bottom: 0; }
.student-flow-item.active { background: #eef8f5; box-shadow: inset 3px 0 var(--brand); padding-left: 8px; }
.student-flow-item.locked { color: #94a09d; cursor: not-allowed; }
.flow-number { width: 23px; height: 23px; border: 1px solid var(--line-strong); border-radius: 50%; display: grid; place-items: center; font-size: 9px; font-weight: 800; }
.student-flow-item.completed .flow-number { color: #fff; background: var(--success); border-color: var(--success); }
.flow-copy strong, .flow-copy small { display: block; }
.flow-copy strong { font-size: 11px; }
.flow-copy small { margin-top: 4px; color: var(--ink-soft); font-size: 9px; }
.flow-lock { color: #8c9996; font-size: 12px; }
.student-current-column { display: flex; flex-direction: column; }
.current-task-head { padding: 20px; border-bottom: 1px solid var(--line); }
.current-task-head h2 { font-size: 21px; margin-bottom: 8px; }
.current-task-head p { margin: 0; color: var(--ink-soft); font-size: 11px; line-height: 1.6; }
.current-task-body { flex: 1; padding: 22px; }
.current-task-body h3 { font-size: 13px; margin: 20px 0 10px; }
.current-task-body h3:first-child { margin-top: 0; }
.knowledge-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.knowledge-chips span { padding: 6px 9px; border-radius: 4px; background: #eef3f1; color: #40514d; font-size: 10px; }
.current-task-standard { border-left: 3px solid var(--brand); background: var(--brand-soft); padding: 12px; color: #305b56; font-size: 11px; line-height: 1.65; }
.current-task-actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 16px 22px; border-top: 1px solid var(--line); }
.locked-task-message { min-height: 340px; display: grid; place-content: center; text-align: center; color: var(--ink-soft); padding: 28px; }
.locked-task-message strong { color: var(--ink); font-size: 16px; }
.locked-task-message p { font-size: 11px; line-height: 1.6; max-width: 310px; margin: 8px auto 0; }
.student-session-column { padding: 18px; display: grid; align-content: start; gap: 18px; }
.student-session-column section { padding-bottom: 17px; border-bottom: 1px solid var(--line); }
.student-session-column h3 { font-size: 12px; margin-bottom: 10px; }
.student-session-column p { color: var(--ink-soft); font-size: 10px; line-height: 1.55; margin: 7px 0 0; }
.study-timer { font-family: Consolas, monospace; font-size: 25px; font-weight: 800; color: var(--brand); }
.progress-track.large { height: 8px; margin-top: 0; }
.note-checklist { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.note-checklist li { color: var(--ink-soft); font-size: 10px; line-height: 1.5; padding-left: 17px; position: relative; }
.note-checklist li::before { content: "□"; position: absolute; left: 0; color: var(--brand); }
.help-button { min-height: 42px; border: 1px solid #e2b5a2; border-radius: 6px; color: #9a4b28; background: #fff8f4; font-weight: 750; font-size: 11px; }

/* Teacher tools and student modules */
.student-filter-panel { display: grid; grid-template-columns: minmax(220px, 1.6fr) repeat(5, minmax(105px, .7fr)) auto auto auto; gap: 8px; align-items: center; padding: 10px; border: 1px solid var(--line); border-bottom: 0; border-radius: 7px 7px 0 0; background: var(--surface); }
.student-filter-panel select { min-height: 36px; padding: 5px 8px; font-size: 10px; }
.filter-check { display: flex; align-items: center; gap: 6px; white-space: nowrap; font-size: 10px; }
.filter-check input { width: 15px; min-height: 15px; height: 15px; accent-color: var(--brand); }
.monitor-summary { margin-bottom: 14px; color: var(--ink-soft); font-size: 11px; }
.seat-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.seat { aspect-ratio: 1.25; min-height: 138px; padding: 13px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); position: relative; }
.seat.empty { display: grid; place-content: center; text-align: center; color: #8a9894; background: #f7f9f8; }
.seat.warning { border-color: #e4bd7d; background: #fffbf3; }
.seat.critical { border-color: #d98e96; background: #fff7f8; }
.seat-no { position: absolute; right: 9px; top: 8px; color: #8a9894; font-size: 9px; }
.seat strong, .seat small { display: block; }
.seat strong { font-size: 12px; margin-bottom: 5px; }
.seat small { color: var(--ink-soft); font-size: 9px; line-height: 1.55; }
.seat-state { display: inline-flex; margin-top: 10px; padding: 4px 6px; border-radius: 4px; background: var(--brand-soft); color: var(--brand); font-size: 9px; font-weight: 800; }
.seat.warning .seat-state { background: var(--warning-soft); color: var(--warning); }
.seat.critical .seat-state { background: var(--danger-soft); color: var(--danger); }
.review-tabs { display: flex; align-items: center; gap: 3px; margin-bottom: 13px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.review-tabs button { min-height: 38px; padding: 7px 14px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--ink-soft); font-size: 11px; white-space: nowrap; }
.review-tabs button.active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 800; }
.review-queue, .assignment-list { display: grid; gap: 9px; }
.review-card, .assignment-card { display: grid; grid-template-columns: 180px minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 15px 17px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.review-person strong, .review-person small, .review-content strong, .review-content small { display: block; }
.review-person strong, .review-content strong { font-size: 12px; }
.review-person small, .review-content small { color: var(--ink-soft); font-size: 9px; margin-top: 5px; line-height: 1.5; }
.review-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 5px; max-width: 330px; }
.review-actions button { min-height: 30px; border: 1px solid var(--line); border-radius: 4px; background: #fff; color: var(--brand); font-size: 9px; padding: 4px 7px; }
.review-actions button.return { color: var(--danger); }
.assessment-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 15px; }
.assessment-stat { padding: 15px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.assessment-stat span, .assessment-stat strong { display: block; }
.assessment-stat span { color: var(--ink-soft); font-size: 10px; }
.assessment-stat strong { font-size: 21px; margin-top: 8px; }
.assessment-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.assessment-list { min-height: 300px; padding: 8px 17px 17px; }
.assessment-row { padding: 13px 0; border-bottom: 1px solid #edf1ef; display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 10px; }
.assessment-row strong, .assessment-row small { display: block; }
.assessment-row strong { font-size: 11px; }
.assessment-row small { color: var(--ink-soft); font-size: 9px; margin-top: 5px; line-height: 1.5; }
.feedback-empty { min-height: 430px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); }
.student-course-layout { display: grid; grid-template-columns: 292px minmax(0, 1fr); gap: 12px; align-items: start; }
.course-list, .course-stage, .course-notes-panel { border: 1px solid var(--line); border-radius: 7px; background: var(--surface); min-height: 520px; }
.course-list { padding: 0; overflow: hidden; }
.course-library-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 15px 14px; border-bottom: 1px solid var(--line); }
.course-library-title strong { font-size: 13px; }
.course-library-title span { color: var(--ink-soft); font-size: 10px; }
.course-library-page { min-height: 480px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); overflow: hidden; }
.student-course-library-page { min-height: 420px; display: grid; gap: 13px; }
.course-library-actions { display: flex; align-items: center; gap: 8px; }
.course-library-summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 54px; padding: 0 18px; border: 1px solid var(--line); border-radius: 7px 7px 0 0; background: var(--surface); }
.course-library-summary strong { font-size: 15px; }
.course-library-summary span { color: var(--ink-soft); font-size: 11px; }
.student-course-card-list { display: grid; gap: 13px; }
.student-course-card { padding: 19px 21px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); box-shadow: 0 4px 14px rgba(20,44,38,.035); }
.student-course-card-main { display: grid; grid-template-columns: 120px minmax(0,1fr) auto; align-items: start; gap: 24px; }
.student-course-play-tile { width: 120px; height: 108px; display: grid; place-items: center; border-radius: 6px; background: #f0f3f3; color: #416b83; font-size: 34px; }
.student-course-copy { min-width: 0; }
.student-course-copy h3 { margin: 2px 0 7px; font-size: 19px; line-height: 1.45; overflow-wrap: anywhere; }
.student-course-meta { color: var(--ink-soft); font-size: 12px; line-height: 1.6; }
.student-course-description { margin: 12px 0 19px; color: #49615b; font-size: 13px; line-height: 1.7; }
.student-course-progress { height: 6px; width: 100%; border: 0; border-radius: 3px; background: #edf1f0; appearance: none; }
.student-course-progress::-webkit-progress-bar { background: #edf1f0; border-radius: 3px; }
.student-course-progress::-webkit-progress-value { background: var(--brand); border-radius: 3px; }
.student-course-progress::-moz-progress-bar { background: var(--brand); border-radius: 3px; }
.student-course-progress-caption { margin-top: 7px; color: var(--ink-soft); font-size: 11px; }
.student-course-view-button { min-height: 42px; padding: 9px 17px; border-radius: 6px; border: 1px solid var(--accent); background: var(--accent); color: #fff; font-weight: 800; font-size: 13px; white-space: nowrap; }
.student-course-view-button:hover { background: #ae572b; border-color: #ae572b; }
.student-course-directory { margin-top: 17px; padding-top: 15px; border-top: 1px solid var(--line); }
.student-course-directory-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 11px; }
.student-course-directory-head strong { font-size: 13px; }
.student-course-directory-head span { color: var(--ink-soft); font-size: 10px; }
.student-course-chapter + .student-course-chapter { margin-top: 14px; }
.student-course-chapter h4 { margin: 0 0 6px; color: var(--ink-soft); font-size: 10px; }
.student-course-directory-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px 20px; }
.student-course-directory-item { display: grid; grid-template-columns: 24px minmax(0,1fr) auto; gap: 8px; align-items: center; min-height: 38px; padding: 7px 9px; border-bottom: 1px dashed #e8eeec; color: #40534e; }
.student-course-directory-item span:first-child { width: 21px; height: 21px; display: grid; place-items: center; border: 1px solid var(--line-strong); border-radius: 50%; font-size: 9px; }
.student-course-directory-item strong { min-width: 0; font-size: 11px; overflow-wrap: anywhere; }
.student-course-directory-item span:last-child { color: var(--ink-soft); font-size: 9px; white-space: nowrap; }
.fnnas-embed-shell { min-height: 720px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); overflow: hidden; }
.fnnas-embed-toolbar { min-height: 58px; padding: 11px 15px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); background: #f8faf9; }
.fnnas-embed-toolbar strong, .fnnas-embed-toolbar small { display: block; }
.fnnas-embed-toolbar strong { font-size: 13px; }
.fnnas-embed-toolbar small { color: var(--ink-soft); font-size: 10px; margin-top: 4px; }
#fnnas-course-frame { display: block; width: 100%; height: 660px; border: 0; background: #f3f6f4; }
.fnnas-embed-fallback { min-height: 660px; display: grid; place-content: center; text-align: center; padding: 30px; background: #f7f9f8; }
.fnnas-embed-fallback strong { font-size: 17px; }
.fnnas-embed-fallback p { max-width: 430px; color: var(--ink-soft); font-size: 11px; line-height: 1.7; margin: 9px auto 15px; }
.fnnas-embed-fallback .primary { display: inline-flex; width: max-content; margin: 0 auto; text-decoration: none; }
.course-library-main { display: grid; grid-template-columns: minmax(0, 1fr) 270px; gap: 12px; align-items: start; min-width: 0; }
.course-tree-subject { border-bottom: 1px solid #edf1ef; }
.course-tree-subject:last-child { border-bottom: 0; }
.course-tree-subject > summary { display: flex; align-items: center; gap: 8px; padding: 13px 14px 9px; color: var(--brand); font-size: 12px; font-weight: 850; cursor: pointer; list-style: none; }
.course-tree-subject > summary::-webkit-details-marker { display: none; }
.course-tree-subject > summary::before { content: "▾"; color: var(--ink-soft); font-size: 10px; }
.course-tree-subject:not([open]) > summary::before { content: "▸"; }
.course-tree-grade { margin: 0 9px 9px; border: 1px solid var(--line); border-radius: 5px; overflow: hidden; }
.course-tree-grade > summary { padding: 9px 10px; background: #f4f7f6; color: var(--ink); font-size: 10px; font-weight: 800; cursor: pointer; list-style: none; }
.course-tree-grade > summary::-webkit-details-marker { display: none; }
.course-tree-course { border-top: 1px solid var(--line); }
.course-tree-course > summary { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 9px 10px 7px 18px; cursor: pointer; list-style: none; }
.course-tree-course > summary::-webkit-details-marker { display: none; }
.course-tree-course > summary strong { min-width: 0; color: #38504a; font-size: 10px; overflow-wrap: anywhere; }
.course-tree-course > summary span { flex: 0 0 auto; color: var(--ink-soft); font-size: 9px; }
.course-tree-course[open] > summary { background: #fbfcfb; }
.course-tree-lessons { padding: 0 7px 8px 28px; }
.course-tree-lesson { width: 100%; display: flex; align-items: center; gap: 7px; padding: 7px 5px; border: 0; border-bottom: 1px dashed #edf1ef; background: transparent; color: var(--ink-soft); text-align: left; cursor: pointer; }
.course-tree-lesson:last-child { border-bottom: 0; }
.course-tree-lesson:hover, .course-tree-lesson.active { color: var(--brand); background: var(--brand-soft); }
.course-tree-lesson strong { min-width: 0; flex: 1; font-size: 9px; overflow-wrap: anywhere; }
.course-tree-lesson span { flex: 0 0 auto; font-size: 9px; }
.course-list-item { width: 100%; border: 0; border-bottom: 1px solid var(--line); background: transparent; text-align: left; padding: 13px 10px; color: var(--ink); }
.course-list-item.active { background: var(--brand-soft); }
.course-list-item strong, .course-list-item small { display: block; }
.course-list-item strong { font-size: 11px; }
.course-list-item small { color: var(--ink-soft); font-size: 9px; margin-top: 5px; }
.course-stage { overflow: hidden; }
.video-stage { aspect-ratio: 16/9; display: grid; place-content: center; position: relative; background: #15201e; color: #dce7e4; text-align: center; padding: 30px; }
.video-stage strong { font-size: 16px; }
.video-stage p { color: #aebcb8; font-size: 10px; margin: 8px 0 0; }
.dynamic-watermark { position: absolute; right: 14px; top: 14px; color: rgba(255,255,255,.42); font-size: 10px; }
.course-controls { padding: 18px; }
.course-controls h3 { font-size: 15px; margin-bottom: 8px; }
.course-controls p { color: var(--ink-soft); font-size: 10px; line-height: 1.7; }
.course-notes-panel { min-height: 520px; padding: 17px; }
.course-notes-panel h3 { font-size: 13px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.study-page { min-height: 520px; }
.study-workspace { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 14px; align-items: start; }
.study-player-panel, .study-side-panel { border: 1px solid var(--line); border-radius: 7px; background: var(--surface); min-width: 0; overflow: hidden; }
.study-player-panel .video-stage { aspect-ratio: 16 / 9; }
.study-player-panel .video-stage video { width: 100%; height: 100%; object-fit: contain; background: #15201e; }
.study-player-info { padding: 18px 20px 22px; }
.study-player-info h2 { font-size: 20px; margin: 7px 0; }
.study-player-info p, .study-side-panel p { color: var(--ink-soft); font-size: 11px; line-height: 1.7; }
.study-side-panel { padding: 18px; }
.study-side-panel section { padding-bottom: 15px; margin-bottom: 15px; border-bottom: 1px solid var(--line); }
.study-side-panel h3 { font-size: 12px; margin-bottom: 8px; }
.study-side-panel .note-checklist { margin-top: 0; }
.external-course-link { display: inline-flex; margin-top: 12px; padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: 5px; color: var(--brand); text-decoration: none; font-size: 11px; }
.home-learning-badge { padding: 6px 9px; border: 1px solid #b9d9d3; border-radius: 4px; color: var(--brand); background: var(--brand-soft); font-size: 10px; font-weight: 800; }
.assignment-card { grid-template-columns: minmax(0, 1fr) 160px auto; }
.assignment-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.assignment-meta span { color: var(--ink-soft); font-size: 9px; }
.progress-dashboard { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.progress-card { min-height: 145px; padding: 17px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); }
.progress-card h3 { font-size: 12px; color: var(--ink-soft); margin-bottom: 13px; }
.progress-card strong { font-size: 25px; }
.progress-card p { margin: 9px 0 0; color: var(--ink-soft); font-size: 10px; line-height: 1.6; }
.progress-card.wide { grid-column: span 2; }
.score-trend { display: grid; gap: 9px; margin-top: 12px; }
.score-trend-row { display: grid; grid-template-columns: 75px 1fr 28px; gap: 9px; align-items: center; font-size: 9px; color: var(--ink-soft); }
.score-trend-row progress { width: 100%; height: 8px; accent-color: var(--brand); }
.score-trend-row strong { color: var(--ink); font-size: 10px; }
.profile-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 14px; }
.media-source-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 14px; align-items: start; }
.media-source-status { position: sticky; top: 92px; }
.media-error-state { margin-top: 15px; padding: 12px; border: 1px solid #e4b0b5; border-radius: 6px; background: var(--danger-soft); }
.media-error-state strong { color: var(--danger); font-size: 11px; }
.media-error-state p { margin: 6px 0 0; color: #774048; font-size: 10px; line-height: 1.6; overflow-wrap: anywhere; }
.profile-panel { padding: 19px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); }
.profile-panel h3 { font-size: 14px; padding-bottom: 13px; border-bottom: 1px solid var(--line); }
.profile-row { display: flex; justify-content: space-between; gap: 15px; padding: 11px 0; border-bottom: 1px solid #edf1ef; font-size: 11px; }
.profile-row span { color: var(--ink-soft); }
.upload-dropzone { min-height: 135px; border: 1px dashed var(--brand); border-radius: 6px; background: var(--brand-soft); display: grid; place-content: center; text-align: center; padding: 20px; cursor: pointer; margin-bottom: 14px; }
.upload-dropzone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.upload-dropzone span { color: var(--brand); font-size: 13px; }
.upload-dropzone small { color: var(--ink-soft); font-size: 9px; margin-top: 7px; }
.submission-preview { width: 100%; max-height: 330px; object-fit: contain; border: 1px solid var(--line); margin-bottom: 14px; }
.quiz-timer { min-width: 76px; padding: 8px 10px; border-radius: 5px; color: var(--danger); background: var(--danger-soft); font-family: Consolas, monospace; font-size: 17px; text-align: center; font-weight: 800; }
.quiz-progress { display: grid; grid-template-columns: 40px 1fr; gap: 10px; align-items: center; margin-bottom: 18px; color: var(--ink-soft); font-size: 10px; }
.quiz-progress progress { width: 100%; height: 7px; accent-color: var(--brand); }
.quiz-questions { display: grid; gap: 13px; max-height: 55vh; overflow: auto; padding-right: 5px; }
.quiz-question { border: 1px solid var(--line); border-radius: 6px; padding: 14px; }
.quiz-question h3 { font-size: 12px; line-height: 1.6; margin-bottom: 11px; }
.quiz-options { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.quiz-option { display: flex; align-items: center; grid-template-columns: none; flex-direction: row; gap: 7px; padding: 8px; border: 1px solid var(--line); border-radius: 5px; font-weight: 400; }
.quiz-option input { width: 15px; min-height: 15px; }
.mobile-bottom-nav { display: none; }

/* Dialogs */
dialog { width: min(650px, calc(100vw - 28px)); max-height: calc(100vh - 32px); padding: 0; border: 0; border-radius: 8px; color: var(--ink); box-shadow: 0 24px 70px rgba(12, 34, 28, .25); }
dialog::backdrop { background: rgba(19, 31, 28, .55); backdrop-filter: blur(2px); }
.wide-dialog { width: min(900px, calc(100vw - 28px)); }
.dialog-form { padding: 22px; }
.dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; padding-bottom: 17px; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.dialog-head .eyebrow { margin-bottom: 4px; }
.dialog-head h2 { margin: 0; font-size: 20px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.form-grid.single { grid-template-columns: 1fr; }
.span-2 { grid-column: 1 / -1; }
.check-row { display: flex; grid-template-columns: none; flex-direction: row; align-items: center; gap: 9px; min-height: 32px; }
.check-row input { width: 17px; min-height: 17px; height: 17px; accent-color: var(--brand); }
.dialog-actions { display: flex; align-items: center; justify-content: flex-end; gap: 9px; padding-top: 17px; margin-top: 6px; border-top: 1px solid var(--line); }
.detail-overview { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 20px; }
.detail-overview div { border: 1px solid var(--line); border-radius: 6px; padding: 12px; }
.detail-overview span, .detail-overview strong { display: block; }
.detail-overview span { color: var(--ink-soft); font-size: 10px; margin-bottom: 7px; }
.detail-overview strong { font-size: 12px; overflow-wrap: anywhere; }
.detail-section { border-top: 1px solid var(--line); padding-top: 16px; margin-top: 16px; }
.detail-section h3 { font-size: 14px; margin-bottom: 12px; }
.timeline { display: grid; gap: 9px; }
.timeline-item { border-left: 3px solid var(--brand-soft); padding: 5px 0 5px 12px; }
.timeline-item strong { font-size: 12px; }
.timeline-item p { font-size: 11px; color: var(--ink-soft); line-height: 1.6; margin: 5px 0 0; }
.task-builder { border: 1px solid var(--line); border-radius: 6px; margin: 18px 0 0; padding: 15px; }
.task-builder legend { font-weight: 800; font-size: 12px; padding: 0 5px; }
.task-builder-row { padding: 9px; margin-bottom: 9px; border: 1px solid var(--line); border-radius: 6px; background: #fafcfb; }
.task-builder-main { display: grid; grid-template-columns: 120px 135px minmax(0, 1fr) 75px 34px; gap: 7px; }
.task-builder-details { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; margin-top: 7px; }
.task-builder-row input, .task-builder-row select { min-height: 34px; font-size: 10px; }
.plan-lesson-picker { margin-top: 18px; padding: 15px; border: 1px solid var(--line); border-radius: 6px; }
.plan-lesson-picker legend { padding: 0 5px; font-size: 12px; font-weight: 800; }
.lesson-picker-toolbar { display: grid; grid-template-columns: minmax(220px,1fr) 180px; gap: 8px; }
.lesson-picker-toolbar label { display: grid; gap: 5px; color: var(--ink-soft); font-size: 10px; }
.lesson-picker-toolbar input, .lesson-picker-toolbar select { width: 100%; min-height: 34px; }
.plan-lesson-results { max-height: 250px; overflow: auto; margin-top: 10px; border-block: 1px solid var(--line); }
.plan-lesson-results > p { margin: 0; padding: 18px; color: var(--ink-soft); text-align: center; }
.plan-lesson-chapter { border-bottom: 1px solid var(--line); }
.plan-lesson-chapter > header { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 5px; background: #f5f8f7; }
.plan-lesson-chapter-toggle { display: flex; align-items: center; gap: 6px; min-width: 0; padding: 4px 0; border: 0; background: transparent; color: var(--ink); text-align: left; cursor: pointer; }
.plan-lesson-chapter-toggle > span { width: 15px; color: var(--brand); font-size: 14px; }
.plan-lesson-chapter-toggle strong { min-width: 0; overflow-wrap: anywhere; font-size: 10px; }
.plan-lesson-chapter-toggle small { color: var(--ink-soft); font-size: 9px; white-space: nowrap; }
.plan-lesson-select-all { display: flex; align-items: center; gap: 4px; flex: 0 0 auto; color: var(--ink-soft); font-size: 9px; cursor: pointer; }
.plan-lesson-select-all input { width: 15px; height: 15px; }
.plan-lesson-load-more { display: block; width: 100%; margin: 8px 0; }
.plan-lesson-option { display: grid; grid-template-columns: 18px minmax(0,1fr); gap: 8px; align-items: start; padding: 9px 5px; border-bottom: 1px solid #edf1ef; cursor: pointer; }
.plan-lesson-option:last-child { border-bottom: 0; }
.plan-lesson-option input { width: 16px; height: 16px; margin-top: 2px; }
.plan-lesson-option strong, .plan-lesson-option small { display: block; overflow-wrap: anywhere; }
.plan-lesson-option strong { color: var(--ink); font-size: 10px; }
.plan-lesson-option small { margin-top: 3px; color: var(--ink-soft); font-size: 9px; }
.lesson-picker-actions { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding-top: 10px; color: var(--ink-soft); font-size: 10px; }
.current-task-lesson { display: grid; gap: 3px; padding: 10px 12px; border-left: 3px solid var(--brand); background: #f3f8f6; }
.current-task-lesson strong { color: var(--ink); }
.current-task-lesson span { color: var(--ink-soft); font-size: 9px; }
.current-task-instructions { white-space: pre-wrap; color: #354a45; }
.seat progress { width: 100%; height: 5px; accent-color: var(--brand); }
.remove-task { border: 1px solid var(--line); border-radius: 5px; color: var(--danger); background: var(--surface); }
.receipt { padding: 25px 34px; border: 1px solid var(--line); }
.receipt-header { text-align: center; padding-bottom: 18px; border-bottom: 2px solid var(--ink); }
.receipt-header h2 { margin-bottom: 6px; font-size: 23px; }
.receipt-header p { color: var(--ink-soft); margin: 0; font-size: 11px; }
.receipt-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0; margin: 20px 0; border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.receipt-grid div { min-height: 57px; padding: 10px 12px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.receipt-grid span, .receipt-grid strong { display: block; }
.receipt-grid span { color: var(--ink-soft); font-size: 10px; margin-bottom: 5px; }
.receipt-grid strong { font-size: 13px; }
.receipt-rules { font-size: 11px; line-height: 1.75; color: #3f504c; }
.receipt-sign { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-top: 30px; }
.receipt-sign div { border-bottom: 1px solid var(--ink-soft); padding-bottom: 6px; color: var(--ink-soft); font-size: 11px; }
.student-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 22px; }
.student-detail-grid .span-detail { grid-column: 1 / -1; }
.task-timeline { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 18px; }
.report-draft { width: min(850px, 100%); margin: 0 auto; padding: 30px; }
.report-draft header { border-bottom: 2px solid var(--ink); padding-bottom: 18px; }
.report-draft header h2 { font-size: 23px; margin-bottom: 8px; }
.report-draft header p { color: var(--ink-soft); font-size: 11px; margin: 0; }
.report-grid { display: grid; grid-template-columns: repeat(4, 1fr); margin: 20px 0; border: 1px solid var(--line); }
.report-grid div { padding: 13px; border-right: 1px solid var(--line); }
.report-grid div:last-child { border-right: 0; }
.report-grid span, .report-grid strong { display: block; }
.report-grid span { color: var(--ink-soft); font-size: 9px; margin-bottom: 6px; }
.report-grid strong { font-size: 15px; }
.report-draft section h3 { font-size: 12px; margin: 18px 0 7px; }
.report-draft section p { color: var(--ink-soft); font-size: 11px; line-height: 1.7; }
.report-draft footer { display: flex; justify-content: flex-end; gap: 8px; margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); }
.profile-actions { display: grid; gap: 8px; }
.small-text { font-size: 15px !important; line-height: 1.5; }
.quiz-result-panel { padding: 13px; margin-bottom: 18px; border-radius: 6px; border: 1px solid #b8dcc7; background: var(--success-soft); }
.quiz-result-panel.failed { border-color: #e1adb2; background: var(--danger-soft); }
.quiz-result-panel strong { font-size: 13px; }
.quiz-result-panel p { margin: 6px 0 0; color: var(--ink-soft); font-size: 10px; line-height: 1.6; }
.empty-state.compact { min-height: 120px; }

.toast-region { position: fixed; right: 20px; bottom: 20px; z-index: 100; display: grid; gap: 8px; width: min(360px, calc(100vw - 40px)); }
.toast { background: #263330; color: #fff; border-radius: 6px; padding: 13px 15px; box-shadow: var(--shadow); font-size: 12px; animation: toast-in .2s ease-out; }
.toast.error { background: #8d3039; }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } }

@media (max-width: 1180px) {
  .metric-grid { grid-template-columns: repeat(3, 1fr); }
  .teacher-metric-grid { grid-template-columns: repeat(4, 1fr); }
  .student-learning-layout { grid-template-columns: 260px minmax(0, 1fr); }
  .student-session-column { grid-column: 1 / -1; grid-template-columns: repeat(3, 1fr) auto; }
  .student-session-column section { border-bottom: 0; border-right: 1px solid var(--line); padding: 0 16px 0 0; }
  .student-filter-panel { grid-template-columns: minmax(220px, 1.4fr) repeat(3, 1fr); }
  .seat-grid { grid-template-columns: repeat(4, 1fr); }
  .compact-select > span { display: none; }
  .compact-select select { min-width: 115px; }
  .user-chip div { display: none; }
}

@media (max-width: 900px) {
  .login-screen { grid-template-columns: 1fr; }
  .login-brand { min-height: 280px; padding: 42px max(6vw, 28px); justify-content: flex-start; }
  .login-brand img { width: 45px; height: 45px; margin-bottom: 20px; }
  .login-brand h1 { font-size: 30px; margin-bottom: 12px; }
  .login-brand > p:not(.eyebrow) { margin-bottom: 0; }
  .login-facts { display: none; }
  .login-panel { margin-block: 34px; }
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; width: 230px; transform: translateX(-102%); transition: transform .2s ease; box-shadow: var(--shadow); }
  .sidebar.open { transform: translateX(0); }
  .mobile-menu { display: block; }
  .topbar { padding-inline: 18px; }
  .split-layout { grid-template-columns: 1fr; }
  .teacher-home-layout { grid-template-columns: 1fr; }
  .teacher-right-rail { grid-template-columns: 1fr 1fr; }
  .student-course-layout { grid-template-columns: 250px minmax(0, 1fr); }
  .course-library-main { grid-template-columns: minmax(0, 1fr); }
  .student-course-card-main { grid-template-columns: 86px minmax(0,1fr) auto; gap: 13px; }
  .student-course-play-tile { width: 86px; height: 82px; font-size: 28px; }
  .student-course-copy h3 { font-size: 16px; }
  .student-course-description { font-size: 11px; margin: 8px 0 12px; }
  .student-course-directory-list { grid-template-columns: 1fr; }
  .student-course-card { padding: 14px; }
  .course-notes-panel { min-height: 0; }
  .study-workspace { grid-template-columns: 1fr; }
  .assessment-layout { grid-template-columns: 1fr; }
  .profile-layout { grid-template-columns: 1fr; }
  .media-source-layout { grid-template-columns: 1fr; }
  .media-source-status { position: static; }
  .learning-layout { grid-template-columns: 1fr; }
  .plan-list { grid-template-columns: repeat(2, 1fr); }
  .detail-overview { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 680px) {
  main { padding: 19px 14px 88px; }
  .topbar { height: auto; min-height: 67px; padding: 10px 13px; gap: 10px; flex-wrap: wrap; }
  .page-heading { min-width: 0; }
  .page-heading p { display: none; }
  .topbar-controls { width: 100%; order: 2; display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
  .role-teacher .topbar-controls { grid-template-columns: 1fr 1fr 38px; }
  .role-teacher .teacher-date-control { grid-column: 1; grid-row: 1; }
  .role-teacher .store-control { grid-column: 2; grid-row: 1; }
  .role-teacher .identity-control { grid-column: 1 / 3; grid-row: 2; }
  .role-teacher .notification-button { grid-column: 3; grid-row: 1; }
  .role-teacher .mobile-menu, .role-student .mobile-menu, .role-parent .mobile-menu { display: none; }
  .role-teacher .sidebar, .role-student .sidebar, .role-parent .sidebar { display: none; }
  .compact-select select { width: 100%; min-width: 0; }
  .user-chip { display: none; }
  .section-toolbar { align-items: flex-start; }
  .section-toolbar h2 { font-size: 18px; }
  .section-toolbar p { line-height: 1.5; }
  .section-toolbar > button { min-height: 36px; padding-inline: 10px; font-size: 11px; }
  .personal-heading { align-items: flex-start; }
  .personal-heading h2 { font-size: 20px; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .metric { min-height: 94px; padding: 14px; }
  .metric strong { font-size: 22px; }
  .metric:last-child { grid-column: 1 / -1; }
  .schedule-row { grid-template-columns: 73px 1fr 68px; padding: 12px; }
  .schedule-row > :nth-child(3) { display: none; }
  .table-wrap { display: none; }
  .mobile-list { display: grid; gap: 8px; }
  .mobile-card { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 13px; }
  .mobile-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 11px; }
  .mobile-card-head strong { font-size: 13px; }
  .mobile-card-head p { color: var(--ink-soft); font-size: 10px; margin: 4px 0 0; }
  .mobile-card-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; padding-top: 10px; border-top: 1px solid var(--line); }
  .mobile-card-grid span { color: var(--ink-soft); font-size: 9px; display: block; margin-bottom: 4px; }
  .mobile-card-grid strong { font-size: 11px; overflow-wrap: anywhere; }
  .mobile-card .row-actions { justify-content: flex-start; margin-top: 12px; }
  .filter-bar { border-radius: 7px; border-bottom: 1px solid var(--line); margin-bottom: 8px; flex-wrap: wrap; }
  .legend { width: 100%; }
  .summary-strip { border-bottom: 1px solid var(--line); border-radius: 7px; margin-bottom: 8px; }
  .summary-strip > div { padding: 11px; }
  .summary-strip strong { font-size: 13px; }
  .plan-list { grid-template-columns: 1fr; }
  .task-list { padding-inline: 13px; }
  .task-row { grid-template-columns: 28px minmax(0, 1fr) 72px; gap: 8px; }
  .task-row > :nth-child(3) { display: none; }
  .personal-task-list { padding-inline: 12px; }
  .personal-task-row { grid-template-columns: 25px minmax(0, 1fr) auto; gap: 8px; }
  .personal-side-panel { min-height: 0; }
  .teacher-home-heading { display: block; }
  .teacher-home-heading h2 { font-size: 20px; line-height: 1.4; }
  .teacher-heading-actions { margin-top: 13px; }
  .teacher-metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
  .teacher-metric { min-height: 87px; }
  .teacher-metric:last-child { grid-column: 1 / -1; }
  .teacher-home-layout { grid-template-columns: 1fr; }
  .teacher-timeline-section { min-height: 0; }
  .teacher-right-rail { grid-template-columns: 1fr; }
  .timeline-row { grid-template-columns: 51px 3px 78px minmax(0, 1fr); gap: 7px; }
  .timeline-row > :last-child { display: none; }
  .teacher-timeline { padding-inline: 12px; }
  .student-status-strip { grid-template-columns: repeat(2, 1fr); }
  .student-status-item { border-bottom: 1px solid var(--line); }
  .student-status-item:nth-child(2n) { border-right: 0; }
  .student-status-item:last-child { grid-column: 1 / -1; border-bottom: 0; }
  .student-learning-layout { display: flex; flex-direction: column; min-height: 0; scroll-margin-bottom: 90px; }
  .student-current-column { order: -1; }
  .student-task-column { order: 0; }
  .student-session-column { order: 1; }
  .student-current-column .current-task-head { padding: 14px; }
  .student-current-column .current-task-head h2 { font-size: 18px; margin-bottom: 5px; }
  .student-current-column .current-task-body { padding: 14px; }
  .student-current-column .current-task-body h3 { margin: 12px 0 7px; }
  .student-current-column .current-task-body h3:first-child { margin-top: 0; }
  .student-current-column .current-task-actions { padding: 12px 14px; }
  .student-task-column, .student-current-column, .student-session-column { min-height: 0; }
  .student-flow-list { max-height: 320px; overflow: auto; }
  .student-session-column { display: grid; grid-template-columns: 1fr 1fr; }
  .student-session-column section { border-right: 0; border-bottom: 1px solid var(--line); padding: 0 0 13px; }
  .student-session-column .help-button { grid-column: 1 / -1; }
  .student-filter-panel { grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--line); border-radius: 7px; margin-bottom: 8px; }
  .student-filter-panel .search-field { grid-column: 1 / -1; }
  .student-filter-panel .result-count { text-align: right; }
  .seat-grid { grid-template-columns: repeat(2, 1fr); }
  .seat { min-height: 128px; }
  .review-card, .assignment-card { grid-template-columns: 1fr; gap: 11px; }
  .review-actions { justify-content: flex-start; max-width: none; }
  .assessment-stats { grid-template-columns: repeat(2, 1fr); }
  .student-course-layout { grid-template-columns: 1fr; }
  .course-list, .course-stage, .course-notes-panel { min-height: 0; }
  .course-list { max-height: 360px; overflow: auto; }
  .course-library-main { grid-template-columns: 1fr; }
  .course-library-actions { align-items: stretch; flex-direction: column; }
  .student-course-card-main { grid-template-columns: 1fr; gap: 10px; }
  .student-course-play-tile { width: 100%; height: 70px; }
  .student-course-view-button { width: 100%; }
  .study-player-info { padding: 14px; }
  .study-player-info h2 { font-size: 18px; }
  .study-side-panel { padding: 14px; }
  .fnnas-embed-shell { min-height: 620px; }
  #fnnas-course-frame, .fnnas-embed-fallback { height: 560px; min-height: 560px; }
  .progress-dashboard { grid-template-columns: 1fr 1fr; }
  .progress-card.wide { grid-column: 1 / -1; }
  .quiz-options { grid-template-columns: 1fr; }
  .mobile-bottom-nav { position: fixed; z-index: 45; left: 0; right: 0; bottom: 0; height: 68px; padding: 6px max(8px, env(safe-area-inset-left)) max(6px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: #fff; display: grid; grid-template-columns: repeat(5, 1fr); box-shadow: 0 -6px 24px rgba(20,44,38,.12); }
  .mobile-bottom-nav button { border: 0; background: transparent; color: var(--ink-soft); display: grid; place-items: center; align-content: center; gap: 3px; min-width: 0; padding: 3px; font-size: 9px; }
  .mobile-bottom-nav button span { width: 23px; height: 23px; display: grid; place-items: center; border-radius: 5px; font-size: 11px; }
  .mobile-bottom-nav button.active { color: var(--brand); font-weight: 800; }
  .mobile-bottom-nav button.active span { background: var(--brand-soft); }
  .form-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: 1; }
  dialog { width: calc(100vw - 16px); max-height: calc(100vh - 16px); }
  .dialog-form { padding: 16px; }
  .task-builder-main { grid-template-columns: 1fr 1fr 58px 34px; }
  .task-builder-main [data-task-title] { grid-column: 1 / 4; grid-row: 2; }
  .task-builder-main .remove-task { grid-column: 4; grid-row: 1 / 3; }
  .task-builder-details { grid-template-columns: 1fr; }
  .lesson-picker-toolbar { grid-template-columns: 1fr; }
  .detail-overview { grid-template-columns: 1fr 1fr; }
  .student-detail-grid, .task-timeline { grid-template-columns: 1fr; }
  .student-detail-grid .span-detail { grid-column: 1; }
  .report-draft { padding: 18px; }
  .report-grid { grid-template-columns: 1fr 1fr; }
  .report-grid div:nth-child(2) { border-right: 0; }
  .report-grid div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .receipt { padding: 18px 14px; }
  .receipt-grid { grid-template-columns: 1fr; }
}

/* Hierarchical course library and direct lesson playback */
.course-library-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 13px 16px; border: 1px solid var(--line); border-bottom: 0; border-radius: 7px 7px 0 0; background: var(--surface); }
.course-library-navigation { display: flex; align-items: center; gap: 12px; min-width: 0; }
.course-library-navigation > button { flex: 0 0 auto; min-height: 34px; }
.course-breadcrumb { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; min-width: 0; color: var(--ink-soft); font-size: 12px; }
.course-breadcrumb button { border: 0; padding: 0; background: transparent; color: var(--brand); font: inherit; cursor: pointer; }
.course-breadcrumb span { color: #a7b3af; }
.course-library-search { display: flex; align-items: center; gap: 8px; flex: 0 1 260px; color: var(--ink-soft); font-size: 10px; white-space: nowrap; }
.course-library-search input { min-width: 0; width: 100%; min-height: 34px; padding: 7px 10px; border: 1px solid var(--line-strong); border-radius: 5px; background: #fff; color: var(--ink); }
.course-library-node-list { display: grid; gap: 8px; padding: 14px 16px; border: 1px solid var(--line); border-top: 0; background: #f8faf9; }
.library-node { width: 100%; min-height: 66px; display: grid; grid-template-columns: 38px minmax(0,1fr) auto; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--ink); text-align: left; }
button.library-node { cursor: pointer; }
button.library-node:hover { border-color: var(--accent); background: #fffaf7; }
.library-node-icon { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 5px; background: var(--brand-soft); color: var(--brand); font-size: 17px; }
.library-node-content { min-width: 0; }
.library-node-content h3, .library-node-content strong, .library-node-content p, .library-node-content small { display: block; min-width: 0; margin: 0; overflow-wrap: anywhere; }
.library-node-content h3, .library-node-content strong { font-size: 14px; line-height: 1.45; }
.library-node-content p, .library-node-content small { margin-top: 4px; color: var(--ink-soft); font-size: 10px; line-height: 1.5; }
.library-node-content progress { width: min(260px, 100%); height: 5px; margin-top: 7px; accent-color: var(--brand); }
.library-node-chevron { color: var(--ink-soft); font-size: 24px; line-height: 1; }
.library-node-action { min-height: 34px; padding: 6px 11px; border: 1px solid var(--accent); border-radius: 5px; background: var(--accent); color: #fff; font-size: 11px; cursor: pointer; white-space: nowrap; }
.library-node-action:disabled { border-color: var(--line); background: #eef1f0; color: var(--ink-soft); cursor: not-allowed; }
.course-library-pagination { display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 52px; padding: 8px 16px; color: var(--ink-soft); font-size: 10px; }
.course-library-pagination:empty { display: none; }
.study-layout { display: grid; grid-template-columns: minmax(0,1fr) 310px; gap: 16px; align-items: start; }
.study-main { display: grid; gap: 14px; min-width: 0; }
.study-video-card { overflow: hidden; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); }
.study-video-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 17px 20px 14px; }
.study-video-heading h2 { margin: 6px 0 0; font-size: 20px; line-height: 1.35; overflow-wrap: anywhere; }
.study-media-status { flex: 0 0 auto; color: var(--ink-soft); font-size: 10px; }
.study-media-status.ready { color: var(--brand); }
.study-media-status.error { color: var(--danger); }
.study-video-stage { width: 100%; aspect-ratio: 16 / 9; height: auto; display: block; position: relative; padding: 0; background: #000; }
.study-video-stage video { width: 100%; height: 100%; display: block; object-fit: contain; background: #000; }
.study-video-status { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); padding: 8px 12px; border-radius: 4px; background: rgba(0,0,0,.62); color: #fff; font-size: 11px; pointer-events: none; }
.study-video-status.ready { display: none; }
.study-video-error { position: absolute; inset: 0; display: grid; place-content: center; gap: 8px; padding: 24px; color: #fff; text-align: center; background: #171c1b; }
.study-video-error strong { font-size: 15px; }
.study-video-error p { max-width: 440px; margin: 0; color: #c2cfcb; font-size: 11px; line-height: 1.6; }
.study-retry-inline { position: absolute; inset: auto 0 18px; display: flex; justify-content: center; }
.study-video-caption { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 13px 20px 17px; }
.study-video-caption p { margin: 0; color: var(--ink-soft); font-size: 11px; line-height: 1.7; }
.study-nav-actions { display: flex; gap: 7px; flex: 0 0 auto; }
.study-learning-panels { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.study-learning-panels details { border: 1px solid var(--line); border-radius: 7px; background: var(--surface); }
.study-learning-panels summary, .study-outline > summary { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 14px 16px; color: var(--ink); font-size: 13px; font-weight: 800; cursor: pointer; list-style: none; }
.study-learning-panels summary::-webkit-details-marker, .study-outline > summary::-webkit-details-marker { display: none; }
.study-panel-body { padding: 0 16px 16px; color: var(--ink-soft); font-size: 11px; line-height: 1.7; }
.study-ai-notes { grid-column: 1 / -1; }
.study-ai-notes > .study-panel-body { padding: 0 22px 24px; font-size: 12px; line-height: 1.75; }
.study-ai-warning { margin-bottom: 12px; padding: 10px 12px; border-left: 3px solid var(--danger); background: var(--danger-soft); color: #774048; }
.study-ai-source-status { display: flex; flex-wrap: wrap; gap: 7px; margin: 12px 0; }
.study-ai-source-status span, .study-ai-evidence span { padding: 5px 8px; border: 1px solid var(--line); border-radius: 4px; background: #f7f9f8; color: var(--ink-soft); font-size: 9px; }
.study-ai-cache-note { margin: 10px 0 0; color: var(--ink-soft); font-size: 9px; }
.study-ai-generating { min-height: 130px; display: grid; align-content: center; gap: 8px; }
.study-ai-generating strong { color: var(--ink); font-size: 14px; }
.study-ai-generating p { margin: 0; }
.study-ai-generating progress { width: 100%; height: 5px; accent-color: var(--brand); }
.study-ai-result-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.study-ai-result-head span { color: var(--brand); font-size: 9px; font-weight: 800; }
.study-ai-result-head h3 { margin: 4px 0 2px; color: var(--ink); font-size: 17px; }
.study-ai-result-head p { margin: 0; }
.study-ai-export-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.study-ai-export-actions button { min-height: 30px; padding: 5px 8px; border: 1px solid var(--line-strong); border-radius: 4px; background: #fff; color: var(--ink); font-size: 9px; cursor: pointer; }
.study-ai-run-time { display: grid; justify-items: end; gap: 2px; color: var(--ink-soft); font-size: 9px; }
.study-ai-run-time strong { color: var(--ink); font-size: 10px; font-weight: 700; }
.study-ai-evidence { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 5px; }
.study-ai-channel-status { display: flex; flex-wrap: wrap; gap: 7px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.study-ai-channel-status span { padding: 5px 8px; border: 1px solid var(--line); border-radius: 4px; background: #f7f9f8; color: var(--ink-soft); font-size: 9px; }
.study-ai-coverage { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.study-ai-coverage > div { display: grid; gap: 2px; min-width: 130px; }
.study-ai-coverage strong { color: var(--ink); font-size: 11px; }
.study-ai-coverage.complete strong { color: var(--brand); }
.study-ai-coverage.partial strong { color: #8a5a19; }
.study-ai-coverage.limited strong { color: var(--danger); }
.study-ai-coverage span, .study-ai-coverage li { color: var(--ink-soft); font-size: 9px; }
.study-ai-coverage ul { margin: 0; padding-left: 18px; }
.study-ai-goals, .study-ai-map, .study-ai-review, .study-ai-mainline { padding: 18px 0; border-bottom: 1px solid var(--line); }
.study-ai-goals h4, .study-ai-map h4, .study-ai-review h3, .study-ai-mainline h3 { margin: 0 0 8px; color: var(--ink); font-size: 14px; }
.study-ai-mainline li, .study-ai-review li { margin: 5px 0; color: #354a45; font-size: 12px; }
.study-ai-summary { margin: 0; padding: 14px 0; border-bottom: 1px solid var(--line); color: #354a45; font-size: 12px; line-height: 1.8; }
.study-ai-note-content { padding-top: 20px; }
.study-ai-note-content > h3, .study-ai-examples > h3 { margin: 0; color: var(--ink); font-size: 15px; }
.study-ai-points { display: block; }
.study-ai-point { padding: 22px 0; border-bottom: 1px solid var(--line); break-inside: avoid; }
.study-ai-point header { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; }
.study-ai-point header span { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 4px; background: var(--brand-soft); color: var(--brand); font-size: 10px; font-weight: 850; }
.study-ai-point h4 { margin: 0; color: var(--ink); font-size: 16px; }
.study-ai-point header small { margin-left: auto; color: var(--ink-soft); font-size: 9px; }
.study-ai-point p { margin: 6px 0 0; color: #354a45; font-size: 12px; }
.study-ai-point section { margin-top: 13px; }
.study-ai-point section > strong { display: block; color: var(--ink); font-size: 11px; }
.study-ai-point ul, .study-ai-goals ul, .study-ai-map ul, .study-ai-review ul { margin: 5px 0 0; padding-left: 18px; }
.study-ai-formulas { font-family: ui-monospace, Consolas, monospace; color: #223e38; }
.study-ai-elements { display: grid; gap: 5px; margin: 6px 0 0; }
.study-ai-elements div { display: grid; grid-template-columns: minmax(70px,auto) minmax(0,1fr); gap: 8px; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.study-ai-elements dt { color: var(--ink); font-weight: 800; }
.study-ai-elements dd { margin: 0; }
.study-ai-formula-list { display: grid; gap: 7px; margin-top: 6px; }
.study-ai-formula-list > div { padding: 9px 10px; border-left: 3px solid var(--brand); background: #f4f8f7; }
.study-ai-formula-list code { display: block; color: #173f37; font-size: 13px; white-space: normal; overflow-wrap: anywhere; }
.study-ai-formula-list p { margin: 4px 0 0; color: var(--ink-soft); font-size: 9px; }
.study-ai-steps { display: grid; gap: 8px; margin: 7px 0 0; padding-left: 24px; }
.study-ai-steps li { padding-left: 3px; }
.study-ai-steps p { margin: 0; }
.study-ai-steps small { display: block; margin-top: 3px; color: var(--ink-soft); font-size: 9px; }
.study-ai-pitfalls { color: #874828; }
.teaching-chapter { width: min(100%,980px); margin: 0 auto; }
.teaching-chapter > header { padding: 16px 0 10px; border-bottom: 2px solid #263932; }
.teaching-chapter > header span { color: var(--brand); font-size: 9px; font-weight: 800; }
.teaching-chapter > header h3 { margin: 3px 0 0; color: var(--ink); font-size: 19px; }
.teaching-section { border-bottom: 1px solid var(--line); }
.teaching-section > h4 { margin: 18px 0 8px; color: var(--ink); font-size: 16px; }
.teaching-component { padding: 9px 11px; border-left: 3px solid var(--brand); background: #f5f8f7; }
.component-formula { background: #f1f6f4; }
.component-method { border-left-color: #546963; background: #f6f7f7; }
.component-condition { border-left-color: #8a6b35; background: #faf8f2; }
.component-error { border-left-color: #a24d42; background: #fcf5f4; }
.component-mnemonic { border: 1px solid var(--line-strong); border-left-width: 4px; background: #fff; font-weight: 700; }
.component-experiment { border-left-color: #496a86; background: #f4f7fa; }
.component-error > div { display: grid; gap: 3px; padding: 6px 0; border-bottom: 1px dashed #e6cfcb; }
.component-error > div:last-child { border-bottom: 0; }
.component-error b { color: #843f37; }
.component-error span { color: #5d504e; font-size: 10px; }
.study-ai-replay-links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.study-ai-replay-links button { padding: 2px 0; border: 0; border-bottom: 1px solid var(--brand); background: transparent; color: var(--brand); font-size: 9px; cursor: pointer; }
.study-ai-evidence-list { display: grid; gap: 7px; }
.study-ai-evidence-item { min-width: 0; padding: 8px 0 0; border-top: 1px dashed var(--line); }
.study-ai-evidence-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; }
.study-ai-evidence-meta > span { padding: 3px 6px; border-radius: 3px; background: #f1f4f3; color: var(--ink-soft); font-size: 8px; }
.study-ai-evidence-meta .verification-verified { background: #e6f3ee; color: #226349; }
.study-ai-evidence-meta .verification-partially_supported { background: #fff3d8; color: #805418; }
.study-ai-evidence-meta .verification-unverified, .study-ai-evidence-meta .verification-conflict { background: var(--danger-soft); color: #81434b; }
.study-ai-time, .study-ai-source-figure button, .geometry-source-figure button, .study-ai-unresolved button { padding: 3px 6px; border: 1px solid var(--brand); border-radius: 3px; background: #fff; color: var(--brand); font-size: 9px; font-weight: 800; cursor: pointer; }
.study-ai-time.unavailable { border-color: var(--line); color: var(--ink-soft); cursor: default; }
.study-ai-evidence-item blockquote { margin: 7px 0 0; padding-left: 9px; border-left: 2px solid var(--line-strong); color: #40534e; font-size: 10px; }
.study-ai-evidence-item > p { margin: 5px 0 0; color: var(--ink-soft); font-size: 9px; }
.study-ai-evidence-details { margin-top: 14px; border-top: 1px dashed var(--line); }
.study-ai-evidence-details > summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 0 5px; color: var(--brand); font-size: 10px; font-weight: 800; cursor: pointer; }
.study-ai-evidence-details > summary small { color: var(--ink-soft); font-size: 8px; font-weight: 500; }
.study-ai-source-figure, .geometry-source-figure { margin: 10px 0 0; overflow: hidden; border: 1px solid var(--line); border-radius: 5px; background: #080a09; break-inside: avoid; }
.study-ai-source-figure img, .geometry-source-figure img { display: block; width: auto; max-width: 100%; min-width: min(760px,100%); max-height: 720px; height: auto; object-fit: contain; margin: 0 auto; background: #000; }
.study-ai-source-figure figcaption, .geometry-source-figure figcaption { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 8px; background: #fff; color: var(--ink-soft); font-size: 8px; }
.study-ai-unresolved { padding-top: 16px; border-top: 1px solid var(--line); }
.study-ai-unresolved h3 { margin: 0 0 8px; color: var(--ink); font-size: 13px; }
.study-ai-unresolved > div { display: grid; grid-template-columns: auto minmax(90px,auto) minmax(0,1fr); gap: 7px; align-items: start; padding: 7px 0; border-bottom: 1px dashed var(--line); }
.study-ai-unresolved p { margin: 0; color: var(--ink-soft); }
.study-ai-relations { padding: 18px 0; border-bottom: 1px solid var(--line); }
.study-ai-relations h3 { margin: 0 0 8px; color: var(--ink); font-size: 14px; }
.study-ai-chapter { width: min(100%,980px); margin: 0 auto; padding: 24px 0; border-bottom: 2px solid var(--line); }
.study-ai-chapter > header { display: grid; grid-template-columns: 34px minmax(0,1fr); gap: 10px; align-items: start; margin-bottom: 6px; }
.study-ai-chapter > header > span { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 4px; background: var(--brand); color: #fff; font-size: 10px; font-weight: 850; }
.study-ai-chapter > header h3 { margin: 0; color: var(--ink); font-size: 18px; }
.study-ai-chapter > header button { margin-top: 5px; padding: 0; border: 0; background: transparent; color: var(--brand); font-size: 9px; cursor: pointer; }
.study-ai-chapter.pending { padding: 18px 0; }
.study-ai-chapter.pending > header > span { background: #a76a22; }
.study-ai-chapter.pending > p { margin: 8px 0 0 44px; color: var(--ink-soft); }
.study-ai-chapter-relations { margin: 14px 0 2px 44px; padding: 10px 12px; border-left: 3px solid var(--brand); background: #f4f8f7; }
.study-ai-chapter-relations > strong { color: var(--ink); font-size: 10px; }
.study-ai-retry-parts { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; padding: 12px; border: 1px solid #e3c38c; background: #fff8e9; }
.study-ai-retry-parts p { margin: 0; color: #735225; }
.study-ai-examples { padding-top: 22px; }
.study-ai-example { padding: 22px 0; border-bottom: 2px solid var(--line); break-inside: avoid; }
.study-ai-example-figure { width: min(100%, 760px); margin: 12px auto 14px; text-align: center; break-inside: avoid; }
.study-ai-example-figure img { display: block; width: 100%; max-height: 560px; object-fit: contain; background: #fff; border: 1px solid var(--line); }
.study-ai-example-figure figcaption { margin-top: 4px; color: var(--ink-soft); font-size: 11px; }
.study-ai-example > header { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.study-ai-example > header span { color: var(--brand); font-size: 10px; font-weight: 800; }
.study-ai-example > header h4 { margin: 0; color: var(--ink); font-size: 16px; }
.study-ai-example > section { margin-top: 14px; }
.study-ai-example > section > strong { display: block; margin-bottom: 5px; color: var(--ink); font-size: 11px; }
.study-ai-example > section > p { margin: 0; color: #354a45; font-size: 12px; }
.study-ai-events, .study-ai-quality { margin-top: 18px; border-top: 1px solid var(--line); }
.study-ai-events > summary, .study-ai-quality > summary { display: flex; justify-content: space-between; gap: 12px; padding: 14px 0; color: var(--ink); font-size: 12px; font-weight: 800; cursor: pointer; }
.study-ai-events > summary small, .study-ai-quality > summary small { color: var(--ink-soft); font-size: 9px; font-weight: 500; }
.study-ai-events article { display: grid; grid-template-columns: auto minmax(0,1fr) auto; gap: 10px; align-items: start; padding: 9px 0; border-bottom: 1px dashed var(--line); }
.study-ai-events article button { padding: 3px 6px; border: 1px solid var(--brand); border-radius: 3px; background: #fff; color: var(--brand); font-size: 9px; cursor: pointer; }
.study-ai-events article strong { color: var(--ink); font-size: 10px; }
.study-ai-events article p { margin: 3px 0 0; color: var(--ink-soft); font-size: 10px; }
.study-ai-events article > span { font-size: 8px; }
.study-ai-quality-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.study-ai-quality-grid > div { display: grid; gap: 3px; padding: 10px; background: #fff; }
.study-ai-quality-grid span { color: var(--ink-soft); font-size: 9px; }
.study-ai-quality-grid strong { color: var(--ink); font-size: 15px; }
.study-ai-quality-grid small { color: var(--brand); font-size: 8px; }
.study-ai-quality-grid .failed small { color: var(--danger); }
.study-ai-quality-issues { padding: 12px 0; color: var(--ink-soft); }
.study-ai-quality-issues > strong { color: var(--ink); font-size: 10px; }
.study-ai-map > div { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px 18px; }
.study-ai-map > div > div { padding: 8px 0; border-bottom: 1px dashed var(--line); }
.study-ai-scanner { position: fixed; left: -10000px; top: 0; width: 560px; height: 315px; opacity: .01; pointer-events: none; }
.geometry-models { padding-top: 18px; }
.geometry-models > h3 { margin: 0 0 10px; color: var(--ink); font-size: 14px; }
.geometry-models > div { display: grid; grid-template-columns: 1fr; gap: 12px; }
.geometry-model { padding: 12px; border: 1px solid var(--line); border-radius: 6px; background: #fbfcfc; }
.geometry-model header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.geometry-model header h4 { margin: 0; color: var(--ink); font-size: 12px; }
.geometry-model header span { color: var(--brand); font-size: 9px; }
.geometry-model svg { width: 100%; aspect-ratio: 8 / 5; display: block; margin: 8px 0; border: 1px solid #e5ecea; background: #fff; }
.geometry-source-figure { background: #000; }
.geometry-model > .geometry-source-figure + svg { margin-top: 8px; }
.geometry-segment { stroke: #315e55; stroke-width: 2; fill: none; stroke-dasharray: 600; stroke-dashoffset: 600; animation: geometry-draw 2.4s ease forwards; }
.geometry-segment.dashed { stroke-dasharray: 7 5; stroke-dashoffset: 0; }
.geometry-segment.highlight { stroke: var(--accent); stroke-width: 3; }
.geometry-circle { stroke: #315e55; stroke-width: 2; fill: none; stroke-dasharray: 540; stroke-dashoffset: 540; animation: geometry-draw 2.4s .25s ease forwards; }
.geometry-point { fill: var(--accent); transform-box: fill-box; transform-origin: center; animation: geometry-pulse 1.8s 1.2s ease-in-out infinite; }
.geometry-point-group text, .geometry-line-label { fill: #243d37; font-size: 11px; font-weight: 700; }
.geometry-model ol { margin: 8px 0 0; padding-left: 20px; color: var(--ink-soft); font-size: 9px; }
.geometry-model > p { margin: 8px 0 0; }
@keyframes geometry-draw { to { stroke-dashoffset: 0; } }
@keyframes geometry-pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.7); } }
@media (prefers-reduced-motion: reduce) { .geometry-segment, .geometry-circle, .geometry-point { animation: none; stroke-dashoffset: 0; } }
.study-outline { min-width: 0; max-height: calc(100vh - 150px); overflow: auto; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); }
.study-outline > summary { border-bottom: 1px solid var(--line); }
.study-outline > summary small { color: var(--ink-soft); font-size: 10px; font-weight: 500; }
.study-outline-list { padding: 7px; }
.study-outline-item { width: 100%; display: grid; grid-template-columns: 17px minmax(0,1fr) auto; gap: 6px; align-items: center; padding: 9px 8px; border: 0; border-bottom: 1px dashed #e8eeec; background: transparent; color: var(--ink-soft); text-align: left; cursor: pointer; }
.study-outline-item:hover, .study-outline-item.active { background: var(--brand-soft); color: var(--brand); }
.study-outline-item strong { min-width: 0; font-size: 10px; overflow-wrap: anywhere; }
.study-outline-item small { font-size: 9px; white-space: nowrap; }
.course-mapping-panel { margin-top: 14px; }
.course-mapping-list { display: grid; gap: 8px; padding: 12px 16px 16px; }
.course-mapping-row { display: grid; grid-template-columns: minmax(180px,1fr) 100px 100px minmax(130px,190px) auto; gap: 8px; align-items: center; padding: 10px; border-bottom: 1px solid var(--line); }
.course-mapping-row strong, .course-mapping-row small { display: block; min-width: 0; overflow-wrap: anywhere; }
.course-mapping-row strong { font-size: 11px; }
.course-mapping-row small { margin-top: 4px; color: var(--ink-soft); font-size: 9px; }
.course-mapping-row select, .course-mapping-row input { width: 100%; min-height: 32px; padding: 5px 7px; border: 1px solid var(--line-strong); border-radius: 4px; background: #fff; color: var(--ink); font-size: 10px; }
.course-mapping-resolved { grid-template-columns: minmax(0,1fr) auto; }
.course-mapping-resolved > span { color: var(--brand); font-size: 10px; font-weight: 800; }

@media (max-width: 680px) {
  .course-library-toolbar { display: grid; gap: 10px; padding: 11px 12px; }
  .course-library-navigation { align-items: flex-start; flex-direction: column; }
  .course-library-search { width: 100%; flex-basis: auto; }
  .course-library-node-list { padding: 10px 11px; }
  .library-node { grid-template-columns: 32px minmax(0,1fr) auto; gap: 9px; min-height: 60px; padding: 10px; }
  .library-node-icon { width: 32px; height: 32px; font-size: 14px; }
  .library-node-content h3, .library-node-content strong { font-size: 12px; }
  .library-node-action { padding-inline: 8px; font-size: 10px; }
  .study-layout { grid-template-columns: 1fr; gap: 10px; }
  .study-video-heading { padding: 14px; }
  .study-video-heading h2 { font-size: 17px; }
  .study-video-caption { display: grid; gap: 10px; padding: 12px 14px 15px; }
  .study-nav-actions { justify-content: space-between; }
  .study-nav-actions button { flex: 1; }
  .study-learning-panels { grid-template-columns: 1fr; }
  .study-ai-notes { grid-column: 1; }
  .study-ai-points, .study-ai-map > div { grid-template-columns: 1fr; }
  .geometry-models > div { grid-template-columns: 1fr; }
  .study-ai-result-head { display: grid; }
  .study-ai-export-actions { justify-content: flex-start; }
  .study-ai-run-time { justify-items: start; }
  .study-ai-evidence { justify-content: flex-start; }
  .study-ai-coverage { display: grid; gap: 8px; }
  .study-ai-source-figure figcaption { align-items: flex-start; flex-direction: column; }
  .study-ai-unresolved > div { grid-template-columns: auto minmax(0,1fr); }
  .study-ai-unresolved p { grid-column: 1 / -1; }
  .study-ai-chapter { padding: 18px 0; }
  .study-ai-chapter > header h3 { font-size: 15px; }
  .study-ai-chapter-relations { margin-left: 0; }
  .study-ai-retry-parts { align-items: stretch; flex-direction: column; }
  .study-ai-quality-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .study-ai-events article { grid-template-columns: auto minmax(0,1fr); }
  .study-ai-events article > span { grid-column: 2; }
  .study-outline { order: 2; max-height: none; }
  .study-outline:not([open]) > summary { border-bottom: 0; }
  .course-mapping-row { grid-template-columns: 1fr 1fr; }
  .course-mapping-row > :first-child { grid-column: 1 / -1; }
  .course-mapping-row > :last-child { grid-column: 1 / -1; }
}

@media print {
  body * { visibility: hidden !important; }
  .study-ai-point, .study-ai-example, .study-ai-source-figure, .geometry-source-figure, .teaching-section { break-inside: auto; }
  #receipt-dialog[open], #receipt-dialog[open] * { visibility: visible !important; }
  #receipt-dialog[open] { position: absolute; inset: 0; width: 100%; max-height: none; box-shadow: none; }
  #receipt-dialog[open] .dialog-form { padding: 0; }
  .receipt { border: 0; }
  .no-print { display: none !important; }
  body.print-ai-notes #study-ai-note-panel, body.print-ai-notes #study-ai-note-panel * { visibility: visible !important; }
  body.print-ai-notes #study-ai-note-panel { position: absolute; inset: 0; width: 180mm; margin: 0 auto; padding: 0; color: #111; background: #fff; }
  body.print-ai-notes .study-ai-export-actions, body.print-ai-notes .study-ai-cache-note, body.print-ai-notes .study-ai-run-time { display: none !important; }
  body.print-ai-notes .study-ai-point, body.print-ai-notes .study-ai-example, body.print-ai-notes .geometry-model, body.print-ai-notes .teaching-section { break-inside: auto; }
  body.print-ai-notes .study-ai-point { padding: 11px 0; }
  body.print-ai-notes .study-ai-example { padding: 13px 0; }
  body.print-ai-notes .teaching-chapter > header { break-after: avoid; }
  body.print-ai-notes .study-ai-example-figure { break-inside: avoid; }
  body.print-ai-notes .teaching-component { border-color: #444; background: #f7f7f7 !important; }
}

@page { size: A4; margin: 14mm; }
