:root {
  color-scheme: light;
  --ink:#192b4a; --navy:#263e70; --brand:#324f88; --muted:#52617a;
  --line:#d9e1eb; --soft:#f3f6fa; --paper:#fff; --canvas:#f8fafd;
  --radius:12px; --math:#2f5693; --reading:#196653; --saxon:#925618;
  font:100%/1.5 "Times New Roman",Times,"Liberation Serif",serif;
  background:var(--canvas); color:var(--ink);
}
*,*::before,*::after {box-sizing:border-box}
body {margin:0}
button,select,input,textarea,option,dialog {font-family:inherit}
button,select,input,textarea {font:inherit}
button,select {color:inherit;cursor:pointer}
button {background:none;border:0}
a {color:var(--brand);text-underline-offset:.18em}
a:hover {color:#153566}
h1,h2,h3,h4,p {margin:0}
input,select,textarea {accent-color:var(--brand)}
button:disabled,select:disabled,input:disabled {opacity:.48;cursor:not-allowed}
:focus-visible {outline:3px solid #3974b8;outline-offset:3px}
[hidden] {display:none!important}
.icon {display:inline-block;width:1.125rem;height:1.125rem;flex:none;fill:none;stroke:currentColor;stroke-linecap:round;stroke-linejoin:round;stroke-width:1.7}
.skip {position:fixed;left:.55rem;top:-7rem;background:white;padding:.65rem 1rem;z-index:20}
.skip:focus {top:.55rem}
.masthead {border-top:4px solid var(--navy);border-bottom:1px solid var(--line);background:var(--paper)}
.mast-inner,.page {max-width:100rem;width:calc(100% - clamp(2rem,7vw,7.2rem));margin-inline:auto}
.mast-inner,.brand,.school-year,.view-actions,.period-nav,.period-buttons,.button,.legend-item,.page-foot,.page-foot a {display:flex;align-items:center}
.mast-inner {min-height:5.1rem;justify-content:space-between;gap:1rem}
.brand {gap:1.35rem}
.brand img {display:block;width:8.9rem;height:3.86rem;object-fit:contain}
.brand-divider {height:1.65rem;width:1px;background:#cdd7e4}
.brand-dept {font-size:.925rem;color:#465570;font-weight:550;letter-spacing:.005em}
.school-year {gap:.48rem;color:#455777;font-size:.89rem;font-weight:600;font-variant-numeric:tabular-nums}
.school-year .icon {width:1.05rem;height:1.05rem}
.page {padding:2.2rem 0 1.5rem}
.intro {display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:1.5rem;margin:0 0 1.5rem}
.intro-actions {display:flex;flex-wrap:wrap;gap:.55rem;align-items:center}
h1 {font-size:clamp(2.4rem,3.5vw,3.6rem);letter-spacing:-.028em;line-height:1.07;font-weight:700;color:#1c3156}
.intro p {font-size:1.1rem;color:var(--muted);margin:.52rem 0 0;line-height:1.45}
.button {justify-content:center;gap:.58rem;border:1px solid transparent;border-radius:7px;padding:.65rem 1rem;font-size:1rem;line-height:1.3;font-weight:650;min-height:2.65rem}
.button.primary {background:var(--navy);color:white}
.button.primary:hover:not(:disabled) {background:#1b315a}
.button.secondary {background:white;border-color:#bdcadb;color:var(--ink)}
.button.secondary:hover:not(:disabled) {background:var(--soft)}
.button.manage {flex:none}
.filters {display:flex;align-items:flex-end;justify-content:space-between;gap:1.4rem;background:#eef3f9;border:1px solid #d9e3ef;border-radius:var(--radius);padding:1rem 1.2rem;margin-bottom:1.42rem}
.control-label {display:block;font-size:.77rem;line-height:1.3;font-weight:700;letter-spacing:.045em;color:#4d607b;margin-bottom:.4rem}
.grade-field {min-width:0}
.grade-options {display:inline-flex;gap:.25rem;flex-wrap:wrap}
.grade-options button {background:transparent;border:1px solid transparent;padding:.46rem .9rem;font-size:1rem;min-height:2.25rem;font-weight:600;line-height:1.15;border-radius:6px;color:#425371}
.grade-options button:hover {background:#e0e9f4;color:#1b365f}
.grade-options button[aria-pressed=true],.grade-options button.active {background:var(--navy);border-color:var(--navy);color:white}
.grade-short {display:none}
.subject-field {margin-left:auto;flex:none}
.select-wrap {position:relative}
select {border:1px solid #bac8d9;border-radius:6px;background:white;min-height:2.35rem}
.select-wrap select {width:12.5rem;appearance:none;padding:.43rem 2.35rem .43rem .78rem;font-size:1rem;font-weight:400;color:#354867}
.select-chevron {position:absolute;right:.65rem;top:50%;transform:translateY(-50%);pointer-events:none;width:1rem}
#notice:not(:empty) {background:#fff6df;border:1px solid #dccca2;color:#675021;border-radius:8px;padding:.75rem 1rem;margin-bottom:1rem;font-size:.95rem}
.planner {display:grid;grid-template-columns:minmax(0,1fr) minmax(16.25rem,22%);gap:1.12rem;align-items:start;outline:0}
.calendar-panel,.day-detail,.overflow-panel {background:white;border:1px solid var(--line);border-radius:var(--radius);min-width:0}
.calendar-panel,.day-detail {overflow:hidden}
.calendar-toolbar {display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:.65rem;padding:.9rem 1rem .9rem 1.17rem;min-height:4.2rem}
.period-nav {gap:.5rem;min-width:0;flex-wrap:wrap}
.period-picker {position:relative;display:inline-flex;gap:.28rem;align-items:center;border-radius:4px}
.period-picker:focus-within {outline:3px solid #3974b8;outline-offset:4px}
.period-picker .icon {width:.95rem;color:#63758f}
.period-picker select {position:absolute;inset:0;width:100%;height:100%;opacity:0;border:0}
#period-label {font-size:clamp(1.28rem,1.8vw,1.7rem);font-weight:700;letter-spacing:-.018em;line-height:1.18}
.period-buttons {gap:1px;margin:0 .05rem}
.icon-button {display:inline-flex;align-items:center;justify-content:center;width:2rem;height:2rem;border-radius:5px;color:#4b5b74}
.icon-button:hover:not(:disabled),.today-button:hover:not(:disabled) {background:var(--soft);color:#183969}
.icon-button .icon {width:1.1rem;height:1.1rem}
.today-button {padding:.28rem .62rem;min-height:1.95rem;border:1px solid #ccd7e4;border-radius:5px;font-size:.82rem;font-weight:600;color:#465875}
.view-actions {gap:.62rem}
.view-switch {display:inline-flex;background:#eef2f7;border:1px solid #dfe7ef;border-radius:6px;padding:2px;gap:1px}
.view-switch button {display:flex;align-items:center;justify-content:center;gap:.35rem;border-radius:4px;border:1px solid transparent;padding:.27rem .52rem;font-size:.8rem;color:#56657a;font-weight:570;line-height:1.3;min-height:1.8rem}
.view-switch button .icon {width:.87rem;height:.87rem}
.view-switch button[aria-pressed=true],.view-switch button.active {background:#fff;border-color:#d1dae6;box-shadow:0 1px 2px #1b345314;color:var(--navy);font-weight:650}
.print-button {border-left:1px solid #dce4ed;border-radius:0;padding-left:.55rem;width:2.05rem}
.weekdays,.calendar-grid {display:grid;grid-template-columns:repeat(5,minmax(0,1fr))}
.weekdays {background:#f3f6fa;border-top:1px solid var(--line);border-bottom:1px solid var(--line)}
.weekdays span {padding:.52rem .72rem;font-size:.81rem;text-transform:uppercase;font-weight:700;letter-spacing:.09em;color:#56657b}
.calendar-grid {background:#fff}
.day,.outside-empty {position:relative;display:flex;flex-direction:column;gap:.35rem;min-width:0;min-height:7rem;padding:.46rem .46rem .55rem;text-align:left;border:0;border-right:1px solid var(--line);border-bottom:1px solid var(--line);background:#fff;font-family:inherit;color:var(--ink)}
.day:nth-child(5n),.outside-empty:nth-child(5n) {border-right:0}
.day:hover:not(:disabled) {background-color:#f2f6fb}
.day:focus-visible {outline-offset:-3px;z-index:2}
.day.selected,.day[aria-pressed=true] {background:#eef4fd;z-index:1;box-shadow:inset 0 0 0 2px #48699e}
.day-number {display:inline-flex;align-items:center;justify-content:center;align-self:flex-start;height:1.5rem;min-width:1.5rem;padding:0 .2rem;border-radius:50%;font-size:1rem;font-variant-numeric:tabular-nums;font-weight:650;line-height:1}
.day.today .day-number {color:white;background:var(--navy)}
.day-lines {display:flex;flex-direction:column;align-items:stretch;gap:.2rem;min-width:0;width:100%}
.math {--subject-color:var(--math);--subject-mark:#6289c0;--subject-fill:#eaf0fa}
.reading {--subject-color:var(--reading);--subject-mark:#528d7e;--subject-fill:#e9f4ee}
.saxon {--subject-color:var(--saxon);--subject-mark:#be8c4b;--subject-fill:#fbf0df}
.general,.events,.assessments {--subject-color:#586278;--subject-mark:#8290a6;--subject-fill:#eff1f5}
.lesson {display:block;padding:.12rem .35rem .13rem .4rem;border-left:2px solid var(--subject-mark,#8596ae);border-radius:2px;background:var(--subject-fill,#eef1f6);color:var(--subject-color,#495a73);font-size:.9rem;line-height:1.32;font-weight:400;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.lesson-icon {width:1rem;height:1rem;color:var(--subject-color,var(--muted))}
.day-flag {font-size:.75rem;line-height:1.4;color:#536479;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.day.outside,.outside-empty {background:#f6f8fa;color:#8a97a9}
.day.outside .lesson {opacity:.66}
.day.closed {background-color:#f6f7f9;background-image:repeating-linear-gradient(135deg,transparent,transparent 5px,#60718a09 5px,#60718a09 6px)}
.day.closed .day-number {color:#64718a}
.day.closed.selected {background-color:#edf3fa}
.closed-label {display:block;font-size:.9rem;font-weight:400;line-height:1.35;color:#57667b;padding:.14rem .2rem;overflow-wrap:anywhere}
.calendar-grid.week .day,.calendar-grid.week .outside-empty {min-height:16rem}
.calendar-grid.week .lesson,.calendar-grid.week .day-flag {white-space:normal;overflow-wrap:anywhere}
.calendar-grid.week .lesson {margin-bottom:.14rem;padding:.34rem .42rem}
.legend {display:flex;align-items:center;flex-wrap:wrap;gap:.5rem 1.15rem;padding:.78rem 1rem;min-height:2.8rem}
.legend-item {gap:.4rem;font-size:.85rem;color:#506078;font-weight:550}
.legend-item i {width:.62rem;height:.62rem;border-radius:2px;background:var(--subject-mark,#7888a0)}
.closed-key i {border:1px solid #a2aebd;background:repeating-linear-gradient(135deg,#f3f5f7,#f3f5f7 2px,#abb5c3 2px,#abb5c3 3px)}
.day-detail {position:sticky;top:1rem}
.detail-head {position:relative;isolation:isolate;overflow:hidden;background:#263e70;color:white;padding:1.1rem 1.2rem 1.15rem}
.detail-head::after {content:"";position:absolute;inset:0;z-index:-1;pointer-events:none;background:repeating-radial-gradient(ellipse at 120% -70%,transparent 0 15px,#c4d9fc16 15px 16px,transparent 16px 30px);mask-image:linear-gradient(95deg,transparent 24%,black 100%)}
.rail-kicker {font-size:.77rem;font-weight:650;letter-spacing:.105em;text-transform:uppercase;color:#e5edff}
.detail-head h2 {font-size:clamp(1.65rem,2.1vw,2.12rem);font-weight:700;letter-spacing:-.018em;line-height:1.16;margin:.38rem 0 .22rem}
.rail-meta {font-size:.86rem;color:#e0e9fb}
.detail-body {padding:.15rem 1.15rem .4rem}
.detail-group {padding:1rem 0;border-bottom:1px solid #e4eaf1}
.detail-group:last-child {border-bottom:0}
.detail-group h3 {display:flex;align-items:center;gap:.44rem;font-size:.94rem;font-weight:700;color:var(--subject-color,var(--ink));line-height:1.4;margin:0 0 .35rem}
.detail-group:is(.math,.reading,.saxon,.general) h3::before {content:"";width:.56rem;height:.56rem;border-radius:2px;background:var(--subject-mark)}
.detail-group p,.detail-group li {font-size:1.04rem;color:#34435b;line-height:1.5;overflow-wrap:anywhere}
.detail-group p+p {margin-top:.23rem}
.detail-group ul {padding-left:1.1rem;margin:.26rem 0 0}
.rail-note,.dialog-note,.closed-panel {background:var(--soft);border-radius:7px;color:#4a5a72;font-size:.85rem;line-height:1.5;padding:.7rem .8rem;margin:.75rem 0}
.rail-note p+p,.dialog-note p+p {margin-top:.4rem}
.rail-actions {display:flex;gap:.5rem;flex-wrap:wrap;padding:.85rem 0;border-top:1px solid var(--line)}
.rail-actions .button {min-height:2.35rem;font-size:.83rem;width:100%}
.text-button {padding:.18rem 0;color:var(--brand);font-weight:600;font-size:.88rem;text-decoration:underline;text-underline-offset:.18em}
.text-button:hover:not(:disabled) {color:#172f58}
.overflow-panel {margin-top:1rem;padding:1rem 1.15rem}
.overflow-panel summary {cursor:pointer;color:var(--ink);font-weight:650}
.overflow-panel ul {padding-left:1.2rem}
.overflow-panel li+li {margin-top:.35rem}
.page-foot {justify-content:space-between;gap:1rem;margin:1.2rem .1rem 0;padding:.65rem 0;color:#68768a;font-size:.8rem}
.foot-divider {display:inline-block;padding:0 .36rem;color:#97a4b5}
.page-foot .text-button {font-size:.8rem;color:#4e6280}
dialog {width:min(36rem,calc(100% - 2rem));margin:auto;max-height:min(88vh,55rem);overflow:auto;border:1px solid #c3cfde;border-radius:12px;padding:0;color:var(--ink);background:#fff;box-shadow:0 20px 70px #152e522b}
dialog::backdrop {background:#0f223961}
.dialog-head {display:flex;align-items:center;justify-content:space-between;gap:1rem;padding:1.15rem 1.35rem;border-bottom:1px solid var(--line)}
.dialog-head h2,dialog>h2 {font-size:1.35rem;font-weight:700;letter-spacing:-.013em}
.dialog-body {padding:1.2rem 1.35rem}
.dialog-body p {font-size:1.04rem}
.dialog-body p+p {margin-top:.55rem}
.dialog-body h3 {font-size:1.05rem;margin:1.1rem 0 .45rem}
.dialog-body a {font-weight:600}
.dialog-body ul {margin:.6rem 0;padding-left:1.3rem}
.dialog-actions {display:flex;align-items:center;justify-content:flex-end;gap:.6rem;flex-wrap:wrap;padding:1rem 1.35rem;border-top:1px solid var(--line);background:#f8fafc}
.field {display:flex;flex-direction:column;min-width:0;gap:.32rem;margin-bottom:.85rem}
.field label, label.field, .form-row label {font-size:.86rem;color:#394c69;font-weight:650}
.dialog-body input:not([type=radio]):not([type=checkbox]),.dialog-body select,.dialog-body textarea {width:100%;min-height:2.6rem;border:1px solid #b5c4d7;border-radius:6px;background:white;padding:.45rem .62rem;font-size:1rem;color:var(--ink)}
.dialog-body textarea {resize:vertical}
.form-row {display:flex;gap:.75rem;align-items:flex-start}
.form-row>* {flex:1;min-width:0}
.change-list {list-style:none!important;padding:0!important;margin:0}
.change-list>li,.change-list>div {padding:.6rem 0;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;gap:1rem;flex-wrap:wrap}
.change-list small {display:block;color:var(--muted)}
@media(min-width:1450px) {
  .day,.outside-empty {min-height:7.75rem}
  .grade-options button {padding-inline:1.08rem}
}
@media(max-width:1180px) {
  .mast-inner,.page {width:calc(100% - 3rem)}
  .planner {grid-template-columns:minmax(0,1fr) 16rem;gap:.88rem}
  .calendar-toolbar {padding:.85rem .75rem;gap:.45rem}
  .view-switch button .icon {display:none}
  .grade-options {gap:.12rem}
  .grade-options button {padding-inline:.66rem}
  .select-wrap select {width:10.3rem}
  .legend {gap:.4rem .85rem}
}
@media(max-width:960px) {
  .mast-inner,.page {width:calc(100% - 2rem)}
  .planner {grid-template-columns:minmax(0,1fr) 14.3rem;gap:.65rem}
  .period-nav,.view-actions {gap:.32rem}
  .period-buttons .icon-button {width:1.65rem}
  .grade-options button {padding-inline:.53rem}
  .filters {padding:.82rem .9rem;gap:.6rem}
  .day,.outside-empty {padding:.38rem .3rem;min-height:6.9rem}
  .detail-head {padding:1rem .95rem}
  .detail-body {padding-inline:.9rem}
  .print-button {display:none}
}
@media(max-width:780px) {
  .mast-inner {min-height:4.4rem}
  .brand {gap:.82rem}
  .brand img {width:7.4rem;height:3.2rem}
  .brand-dept,.school-year {font-size:.79rem}
  .page {padding-top:1.5rem}
  .intro {margin-bottom:1.05rem}
  .intro p {font-size:.94rem}
  .planner {grid-template-columns:minmax(0,1fr)}
  .day-detail {position:static;scroll-margin-top:.65rem}
  .detail-group {padding:.75rem 0}
  .day,.outside-empty {min-height:6.6rem}
  .detail-head {padding:.85rem 1rem}
  .detail-body {padding:.12rem 1rem .4rem}
  .detail-head h2 {font-size:1.7rem}
  .select-wrap select {width:8.7rem}
  .grade-prefix {display:none}
  .grade-options button {padding-inline:.65rem;min-width:2.15rem}
  .weekdays span {padding:.43rem .48rem}
  .filters {margin-bottom:1rem}
  .print-button {display:inline-flex}
}
@media(max-width:580px) {
  .mast-inner,.page {width:calc(100% - 1.25rem)}
  .mast-inner {min-height:3.75rem}
  .brand img {width:6.45rem;height:2.8rem}
  .brand-dept,.brand-divider,.year-word {display:none}
  .school-year {font-size:.84rem}
  .intro {display:block}
  h1 {font-size:2.4rem}
  .intro p {max-width:29rem}
  .intro-actions {margin-top:.85rem}
  .intro-actions .button {min-height:2.35rem;padding:.48rem .7rem}
  .filters {display:flex;align-items:stretch;flex-direction:column;gap:.7rem;padding:.75rem}
  .grade-field,.subject-field {width:100%;margin:0}
  .grade-options {display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:.16rem}
  .grade-options button {padding:.35rem .15rem;min-width:0;min-height:2.05rem}
  .grade-long {display:none}.grade-short {display:inline}
  .control-label {font-size:.76rem;margin-bottom:.3rem}
  .subject-field {display:flex;align-items:center;gap:.6rem}
  .subject-field .control-label {margin:0}
  .select-wrap {flex:1}
  .select-wrap select {width:100%;min-height:2.1rem;font-size:.87rem}
  .calendar-toolbar {padding:.7rem .6rem;gap:.5rem}
  #period-label {font-size:1.19rem}
  .period-nav {gap:.17rem}
  .period-buttons {gap:0}.period-buttons .icon-button {width:1.45rem;height:1.8rem}
  .today-button {font-size:.76rem;min-height:1.65rem;padding:.15rem .38rem}
  .view-switch button {min-height:1.5rem;font-size:.71rem;padding:.13rem .33rem}
  .print-button {display:none}
  .weekdays span {font-size:.68rem;letter-spacing:.05em}
  .day,.outside-empty {min-height:5.7rem;padding:.25rem .15rem .3rem;gap:.2rem}
  .day-number {min-width:1.34rem;height:1.34rem;font-size:.82rem}
  .day-lines {gap:.19rem}
  .lesson {font-size:.81rem;padding:.06rem .14rem .08rem .18rem}
  .day-flag,.closed-label {font-size:.79rem}
  .closed-label {padding:.1rem}
  .legend {padding:.55rem .55rem;gap:.25rem .65rem}
  .legend-item {font-size:.69rem;gap:.23rem}
  .legend-item i {width:.46rem;height:.46rem}
  .calendar-grid.week .day,.calendar-grid.week .outside-empty {min-height:11rem}
  .calendar-grid.week .lesson {padding:.12rem .19rem}
  .page-foot {flex-wrap:wrap}
  .dialog-head,.dialog-body,.dialog-actions {padding:1rem}
}
@media(prefers-reduced-motion:no-preference) {
  button {transition:background-color .12s,border-color .12s,color .12s}
}
@page {size:landscape;margin:9mm}
@media print {
  :root {font-size:11px;background:white;color:#152439}
  * {-webkit-print-color-adjust:exact;print-color-adjust:exact}
  .masthead {border-top-width:2px}.mast-inner,.page {width:100%;max-width:none}
  .mast-inner {min-height:3.8rem}.brand img {width:7rem;height:3rem}
  .brand-dept,.brand-divider,.year-word {display:inline}
  .page {padding:.6rem 0}
  .intro {display:block;margin:0 0 .35rem}
  .intro h1 {font-size:1.78rem;line-height:1.12}
  .intro-actions,.intro p {display:none!important}
  .filters {display:flex;flex-direction:row;justify-content:flex-start;align-items:center;gap:1rem;background:transparent;border:0;padding:0;margin:0 0 .5rem}
  .grade-field,.subject-field {width:auto;display:flex;align-items:center;gap:.35rem;margin:0}
  .control-label {margin:0}
  .grade-options {display:flex}.grade-options button {display:none}.grade-options button[aria-pressed=true],.grade-options button.active {display:inline;background:none;color:#263e70;padding:0;border:0;min-height:0}
  .grade-long,.grade-prefix {display:inline}.grade-short {display:none}
  .select-wrap {display:block;flex:none}.select-wrap select {width:auto;min-height:0;padding:0;border:0;background:none}.select-chevron {display:none}
  .planner {display:block}
  .calendar-panel {border-radius:0}
  .calendar-toolbar {min-height:0;padding:.45rem .65rem}
  .period-picker .icon,.period-picker select,.view-actions,.period-buttons,.today-button,.day-detail,.overflow-panel,#notice,dialog,.page-foot,.skip {display:none!important}
  .day,.outside-empty {min-height:4.5rem;gap:.14rem;padding:.2rem .35rem;break-inside:avoid}
  .day-lines {gap:.13rem}.lesson {white-space:normal;font-size:.91rem;padding:.04rem .3rem}
  .day.selected,.day[aria-pressed=true] {background:#fff;box-shadow:none}
  .day-number {height:1.18rem;min-width:1.18rem}.weekdays span {padding:.25rem .6rem}
  .legend {min-height:0;padding:.3rem .65rem}.calendar-grid.week .day {min-height:13rem}
}
.sr-only {position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;clip-path:inset(50%);border:0}
.program-name,.lesson-explanation {font-size:.89rem;line-height:1.35;color:#596b82}
.program-name {margin:-.13rem 0 .38rem}
.detail-group p abbr {text-decoration:none;font-variant-numeric:tabular-nums}
.lesson-explanation {margin:.12rem 0 .22rem}
.closed-panel h3 {font-size:1rem;margin-bottom:.2rem;color:var(--ink)}
.dialog-close {display:inline-flex;align-items:center;justify-content:center;flex:none;width:2rem;height:2rem;border-radius:6px;color:#526780;font-size:1.5rem;font-weight:400;line-height:1}
.dialog-close:hover {background:var(--soft)}
.dialog-note:empty,.form-error:empty {display:none}
.form-error {font-size:.875rem;color:#963f3f;font-weight:600;margin:.6rem 0}
label.field:has(.optional) {display:block}
label.field .optional {font-size:.78rem;font-weight:400;color:var(--muted)}
label.field:has(.optional) input {display:block;margin-top:.35rem}
#day-form .dialog-actions {padding:.8rem 0;background:none}
.change-row>div {display:flex;flex-direction:column;gap:.08rem}
.change-row strong {font-size:.9rem}
.change-row span {font-size:.83rem;color:var(--muted)}
.source-list li+li {margin-top:.35rem}
#overflow:has(>.overflow-panel) {padding:0;border:0;background:transparent}
#overflow>.overflow-panel {margin:0}
.overflow-panel details[open]>p,.overflow-panel details[open]>section {margin-top:.6rem;font-size:.9rem}
.overflow-panel details[open]>section {border-top:1px solid var(--line);padding-top:.6rem}
.overflow-panel h3 {font-size:.95rem;margin-bottom:.3rem}
.calendar-panel:not(:has(.lesson.general)) .legend-item.general,
body:has(#subject option[value=saxon]:disabled) .legend-item.saxon {display:none}
body:has(#subject option[value=math]:checked) .legend-item:is(.reading,.saxon,.general),
body:has(#subject option[value=reading]:checked) .legend-item:is(.math,.saxon,.general),
body:has(#subject option[value=saxon]:checked) .legend-item:is(.math,.reading,.general),
body:has(#subject option[value=general]:checked) .legend-item:is(.math,.reading,.saxon) {display:none}
@media(max-width:390px) {
  .calendar-toolbar {align-items:flex-start}
  .form-row {display:block}
  .change-row>div {flex:1}
}

dialog:has(.reference-section) {width:min(46rem,calc(100% - 2rem))}
.reference-section {margin:1.2rem 0;min-width:0}
.reference-section:first-child {margin-top:0}
.reference-section:last-child {margin-bottom:0}
.reference-section h3 {font-size:1.22rem;margin:0 0 .45rem;line-height:1.3}
.reference-section p,.reference-section li {font-size:1.04rem;line-height:1.5}
.reference-table {width:100%;border-collapse:collapse;border:1px solid var(--line);font-size:1rem;line-height:1.4}
.reference-table caption {caption-side:top;text-align:left;font-weight:700;margin-bottom:.4rem}
.reference-table th,.reference-table td {padding:.45rem .65rem;border-bottom:1px solid var(--line);text-align:left;vertical-align:top;overflow-wrap:anywhere}
.reference-table thead th {font-weight:700;color:var(--ink);background:var(--soft);border-bottom:1px solid #c1cde0}
.reference-table tbody th {color:var(--ink);font-weight:700}
.reference-table td:first-child,.reference-table tbody th:first-child {min-width:6.2rem}
@media(max-width:580px) {
  .reference-table {font-size:.96rem}
  .reference-table th,.reference-table td {padding:.34rem .36rem}
  .reference-table td:first-child,.reference-table tbody th:first-child {min-width:4.5rem}
}
