@font-face {
  font-family: Onest;
  src: url("/static/fonts/Onest.ttf") format("truetype");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}
:root {
  color-scheme: light;
  --bg: #f7f8fa;
  --paper: #fff;
  --fg: #202733;
  --muted: #677181;
  --muted-strong: #536071;
  --line: #e6e9ef;
  --line-strong: #cbd2dd;
  --accent: #345ddb;
  --accent-fg: #fff;
  --accent-soft: #edf2ff;
  --ok: #26705c;
  --ok-soft: #edf7f1;
  --warn: #865d1b;
  --warn-soft: #fff7e6;
  --danger: #b34545;
  --danger-soft: #fff0ef;
  --focus: #345ddb;
  --radius: 12px;
}
* {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font:
    15px/1.55 Onest,
    system-ui,
    sans-serif;
}
a {
  color: var(--accent);
  text-decoration: none;
}
button,
input,
textarea,
select {
  font: inherit;
}
button,
a,
summary,
input,
textarea,
select {
  -webkit-tap-highlight-color: transparent;
}
button,
a,
summary {
  touch-action: manipulation;
}
button {
  cursor: pointer;
}
button:disabled {
  opacity: 0.55;
  cursor: wait;
}
h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}
h1 {
  font-size: 36px;
  letter-spacing: -1.3px;
  line-height: 1.22;
  margin: 0;
  font-weight: 650;
}
h2 {
  font-size: 20px;
  letter-spacing: -0.45px;
  font-weight: 600;
}
h3 {
  font-size: 16px;
  font-weight: 600;
}
p {
  margin: 0.5rem 0 1rem;
}
button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 44px;
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: var(--accent);
  color: white;
  padding: 10px 18px;
  font-weight: 550;
  font-size: 14px;
  transition: background 0.15s;
}
button:hover,
.button:hover {
  background: #284dc3;
}
button.ghost,
.text-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 12px;
  color: var(--muted-strong);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
}
.text-button:hover,
button.ghost:hover {
  background: #f0f2f6;
  color: var(--fg);
}
.icon {
  height: 20px;
  width: 20px;
  stroke-width: 1.75;
  flex-shrink: 0;
}
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 9px;
  color: var(--muted);
  cursor: pointer;
}
.icon-button:hover {
  background: #edf0f5;
  color: var(--fg);
}
input,
textarea,
select {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: white;
  color: var(--fg);
  font-size: 16px;
}
textarea {
  resize: vertical;
  line-height: 1.6;
}
input[type="checkbox"],
input[type="radio"] {
  width: 20px;
  min-height: 20px;
}
label {
  display: block;
  font-size: 13px;
  color: var(--muted-strong);
}
label input,
label textarea,
label select {
  margin-top: 6px;
}
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}
main:focus,
.subject:focus {
  outline: none;
}
[hidden] {
  display: none !important;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.skip {
  position: fixed;
  left: -9999px;
  top: 10px;
  z-index: 99;
  padding: 12px 20px;
  background: var(--fg);
  color: white;
  border-radius: 8px;
}
.skip:focus {
  left: 12px;
}
.js-only {
  display: none !important;
}
.enhanced .js-only {
  display: revert !important;
}
.fine,
.lede {
  color: var(--muted);
  font-size: 13px;
}
.lede {
  font-size: 16px;
}
.eyebrow {
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 10px;
  font-weight: 500;
}
.inline {
  display: inline-flex;
  margin: 0;
}
.stack {
  display: grid;
  gap: 12px;
}
.card,
.join {
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: var(--radius);
  padding: 24px;
}
.join {
  max-width: 480px;
  display: grid;
  gap: 12px;
}
.flash {
  background: var(--accent-soft);
  border: 1px solid #d7e1fd;
  color: #284aaf;
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 14px;
  margin: 16px 0;
}
.flash[data-kind="bad"],
.flash[data-kind="queued"] {
  background: var(--warn-soft);
  border-color: #ead8b2;
  color: var(--warn);
}
/* A persistent, deliberately small set of destinations. */
.top {
  position: fixed;
  inset: 0 auto 0 0;
  width: 224px;
  border-right: 1px solid var(--line);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  padding: 32px 18px 18px;
  z-index: 10;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 0 12px;
  min-height: 48px;
  color: var(--fg);
  font-size: 24px;
  line-height: 1.15;
  font-weight: 650;
  letter-spacing: -1px;
}
.brand > span:not(.brand-symbol) { margin-left: 11px; }
.brand-symbol {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 38px;
  border-radius: 10px;
  background: var(--accent);
  color: white;
}
.brand-symbol .icon {
  width: 22px;
  height: 22px;
}
.brand-caption {
  display: block;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.1px;
  font-weight: 400;
  margin-top: 6px;
}
.class-label {
  font-size: 10px;
  letter-spacing: 1px;
  color: var(--muted);
  margin: 45px 14px 20px;
}
.class-label > span {
  display: block;
  margin-top: 8px;
  color: var(--fg);
  font-size: 18px;
  letter-spacing: 0;
  font-weight: 600;
}
.topnav {
  display: grid;
  gap: 6px;
}
.topnav > a {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 46px;
  padding: 11px 14px;
  border-radius: 9px;
  color: var(--muted-strong);
  font-size: 14px;
  font-weight: 500;
}
.topnav > a:hover {
  background: #edf0f5;
}
.topnav > a[aria-current] {
  background: #e9eefb;
  color: #2e54c4;
}
.sidebar-bottom {
  margin-top: auto;
  padding-top: 48px;
}
.utility-menu > summary {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 46px;
  padding: 10px 14px;
  list-style: none;
  cursor: pointer;
  color: var(--muted-strong);
  font-size: 14px;
}
.utility-menu > summary .icon:last-child {
  margin-left: auto;
  width: 15px;
}
.utility-menu[open] > summary .icon:last-child {
  transform: rotate(-90deg);
}
.utility-menu nav {
  padding: 0 10px 12px;
}
.utility-menu nav a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 6px 8px;
  font-size: 12px;
  color: var(--muted-strong);
  border-radius: 6px;
}
.utility-menu nav a:hover {
  background: #edf0f5;
}
.profile {
  border-top: 1px solid var(--line);
  margin-top: 16px;
  padding: 20px 0 0 10px;
  display: flex;
  gap: 9px;
  align-items: center;
}
.avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #e9e6df;
  color: #696254;
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 600;
}
.profile-name {
  font-size: 12px;
  overflow: hidden;
  overflow-wrap: anywhere;
  flex: 1;
}
.profile-name small {
  display: block;
  color: var(--muted);
  font-size: 10px;
  margin-top: 2px;
}
.profile .icon-button {
  min-width: 34px;
  width: 34px;
}
.profile .icon {
  width: 17px;
}
.workspace main {
  margin-left: 224px;
  max-width: 1344px;
  padding: 38px 64px 64px;
  min-height: 100vh;
  background: var(--paper);
}
.welcome .top {
  position: relative;
  inset: auto;
  width: auto;
  border: 0;
  max-width: 1100px;
  margin: auto;
  background: transparent;
  padding: 28px;
}
.welcome main {
  max-width: 1100px;
  margin: auto;
  padding: 0 28px 60px;
}
.workspace-context {
  display: flex;
  align-items: center;
  gap: 13px;
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 36px;
}
.context-divider {
  color: #c2c9d3;
}
.day-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 32px;
}
.day-sub {
  margin: 10px 0 0;
  font-size: 13px;
  color: var(--muted);
}
.view-switch {
  display: flex;
  align-items: center;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  gap: 3px;
  flex-shrink: 0;
}
.view-switch > a {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 7px 13px;
  border-radius: 7px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}
.view-switch > a[aria-current] {
  background: white;
  color: var(--fg);
  box-shadow: 0 1px 4px #20273312;
}
/* The calendar is navigation, not seven outlined form buttons. */
.calendar {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 14px 0 18px;
  margin-bottom: 32px;
}
.calendar-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0 0 14px;
  padding: 0 4px;
}
.calendar-toolbar > strong {
  font-size: 13px;
  font-weight: 500;
}
.calendar-controls {
  display: flex;
  gap: 4px;
  align-items: center;
}
.calendar-controls > .text-button {
  margin-right: 8px;
}
.calendar-controls > .icon-button {
  width: 36px;
  min-width: 36px;
}
.date-picker {
  position: relative;
  overflow: hidden;
}
.date-picker input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  margin: 0;
  padding: 0;
  cursor: pointer;
}
.date-picker:focus-within {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}
.date-picker input::-webkit-calendar-picker-indicator {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}
.week {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}
.week-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 106px;
  border-radius: 12px;
  color: var(--muted);
  transition: background 0.15s;
}
.week-day .dow {
  font-size: 12px;
}
.week-day .num {
  font-size: 30px;
  font-weight: 450;
  line-height: 1.2;
  letter-spacing: -1px;
  font-variant-numeric: tabular-nums;
}
.week-day .day-hint {
  font-size: 9px;
  color: var(--muted);
  letter-spacing: 0.05px;
}
.week-day[data-lessons="1"] .num {
  font-weight: 650;
  color: var(--accent);
}
.week-day[data-lessons="1"] .dow {
  color: var(--fg);
  font-weight: 500;
}
.week-day[data-today="1"]:not([aria-current]) .num {
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-underline-offset: 7px;
  text-decoration-thickness: 2px;
}
.week-day:hover {
  background: var(--bg);
}
.week-day[aria-current] {
  background: var(--accent-soft);
  color: var(--accent);
}
.week-day[aria-current] .num {
  color: var(--accent);
  font-weight: 650;
}
.week-day[aria-current] .dow,
.week-day[aria-current] .day-hint {
  color: #3658b3;
}
.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin: 0 0 26px;
}
.section-heading h2 {
  margin: 0 0 4px;
}
.section-heading .fine {
  font-size: 12px;
}
.section-heading > .text-button {
  font-size: 12px;
}
.section-heading > .text-button .icon {
  width: 16px;
  height: 16px;
}
.sheet-labels {
  display: grid;
  grid-template-columns: 108px 220px minmax(0, 1fr);
  gap: 0 20px;
  padding: 0 134px 12px 0;
  border-bottom: 1px solid var(--line);
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}
.sheet-labels > span:first-child {
  padding-left: 30px;
}
.lesson {
  position: relative;
  display: grid;
  grid-template-columns: 108px 220px minmax(0, 1fr) 100px 34px;
  column-gap: 20px;
  align-items: start;
  min-height: 100px;
  padding: 26px 0;
  border-bottom: 1px solid var(--line);
}
.lesson-when {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-top: 2px;
}
.slot {
  color: #7a8392;
  font-size: 10px;
  width: 14px;
  font-variant-numeric: tabular-nums;
}
.time {
  font-size: 13px;
  color: var(--muted-strong);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.subject {
  font-size: 15px;
  font-weight: 550;
  line-height: 1.5;
  letter-spacing: -0.2px;
  margin: 0;
}
.group {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-top: 4px;
}
.flag {
  display: inline-flex;
  border-radius: 5px;
  background: var(--bg);
  color: var(--muted);
  font-size: 10px;
  padding: 2px 6px;
  margin-top: 5px;
}
.flag.warning {
  color: var(--warn);
  background: var(--warn-soft);
}
.homework-preview {
  font-size: 14px;
  line-height: 1.65;
  padding-top: 1px;
  min-width: 0;
}
.homework-text {
  margin: 0;
  list-style: none;
  padding: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.homework-text > li + li {
  margin-top: 8px;
}
.homework-empty {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}
.attention-note {
  display: block;
  color: var(--warn);
  font-size: 11px;
  margin-top: 7px;
}
.lesson.canceled .subject {
  text-decoration: line-through;
  color: var(--muted);
}
details > summary::-webkit-details-marker {
  display: none;
}
details.more,
details.evidence {
  display: contents;
}
details.more > summary,
details.evidence > summary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  margin-top: -9px;
  padding: 8px;
  border-radius: 8px;
  cursor: pointer;
  list-style: none;
  color: var(--muted);
  font-size: 12px;
}
details.more > summary .icon {
  height: 16px;
  width: 16px;
}
details.evidence > summary {
  width: 34px;
  padding: 7px;
}
details.more > summary:hover,
details.evidence > summary:hover,
details.more[open] > summary,
details.evidence[open] > summary {
  background: var(--accent-soft);
  color: var(--accent);
}
.pane {
  grid-column: 2/-1;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 22px;
  background: #fafbfe;
  margin-top: 22px;
  min-width: 0;
}
.pane h3 {
  margin: 0;
}
.editor-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: -6px -6px 12px 0;
}
.homework-form {
  display: grid;
  gap: 8px;
}
.homework-form label {
  font-size: 12px;
}
.existing-homework {
  margin-bottom: 12px;
}
.editor-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-top: 10px;
}
.editor-footer .fine {
  font-size: 11px;
}
.editor-status-options {
  display: flex;
  gap: 8px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
  margin-top: 18px;
  flex-wrap: wrap;
}
.editor-status-options button {
  background: transparent;
  color: var(--muted-strong);
  font-weight: 400;
  font-size: 12px;
  border: 1px solid var(--line);
  padding: 8px 12px;
}
.editor-status-options button:hover {
  background: white;
  border-color: var(--line-strong);
}
.evidence-pane {
  font-size: 13px;
}
.entries {
  list-style: none;
  margin: 14px 0;
  padding: 0;
}
.entry {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.entry-text {
  display: block;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.entry-meta {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-top: 5px;
}
.line-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 6px;
}
.line-actions button,
.quick button,
.actions-inner button,
.pane .inline button {
  background: transparent;
  color: var(--muted-strong);
  border: 1px solid var(--line);
  font-size: 12px;
  font-weight: 400;
  min-height: 44px;
  padding: 6px 12px;
}
.line-actions button:hover,
.quick button:hover,
.actions-inner button:hover {
  background: var(--paper);
  border-color: var(--line-strong);
}
.pane summary {
  min-height: 44px;
  cursor: pointer;
  display: flex;
  align-items: center;
  font-size: 12px;
  color: var(--muted-strong);
}
.pane .report form,
.actions-inner {
  display: grid;
  gap: 12px;
  padding: 16px;
  background: white;
  border-radius: 8px;
}
.quick {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.official,
.held,
.claims {
  padding: 12px 16px;
  border-left: 2px solid var(--line-strong);
  margin: 14px 0;
  font-size: 12px;
}
.off-basis,
.off-state,
.off-line {
  color: var(--muted);
  font-size: 11px;
}
.off-hw {
  font-size: 13px;
}
.conflicts,
.disputed {
  color: var(--warn);
  font-size: 12px;
}
.removed ul,
.held ul {
  list-style: none;
  padding-left: 0;
}
.gone {
  text-decoration: line-through;
}
.day-record {
  margin-top: 32px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
  color: var(--muted);
  font-size: 12px;
}
.day-record > summary {
  cursor: pointer;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
}
.day-record > summary:before {
  content: "›";
  font-size: 17px;
}
.day-record[open] > summary:before {
  transform: rotate(90deg);
}
.day-record p a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.coverage {
  line-height: 1.8;
}
.day-notice {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--warn);
  background: var(--warn-soft);
  padding: 12px 16px;
  border-radius: 9px;
  font-size: 12px;
  margin-top: 20px;
}
.empty-day {
  padding: 50px 20px 60px;
  text-align: center;
  color: var(--muted);
}
.empty-day > .icon {
  width: 34px;
  height: 34px;
  color: #8d9bc2;
  margin-bottom: 8px;
}
.empty-day h3 {
  color: var(--fg);
  margin: 12px 0 8px;
  font-size: 18px;
}
.empty-day p {
  font-size: 13px;
  line-height: 1.9;
}
.empty-day .text-button {
  color: var(--accent);
  font-size: 12px;
}
/* A draft editor for a complete day's timetable. */
.edit-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  background: var(--accent-soft);
  padding: 14px 18px;
  border-radius: 10px;
  margin-bottom: 18px;
}
.edit-toolbar p {
  font-size: 12px;
  color: #3b568b;
  margin: 0;
}
.edit-toolbar .edit-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.edit-toolbar button {
  font-size: 12px;
}
.edit-rows {
  list-style: none;
  padding: 0;
  margin: 0;
}
.edit-row {
  display: grid;
  grid-template-columns: 30px 25px 96px minmax(130px, 1fr) 94px 106px;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.edit-row input {
  min-width: 0;
  font-size: 14px;
}
.edit-row .edit-number {
  font-size: 11px;
  color: var(--muted);
}
.drag-handle {
  cursor: grab;
  min-width: 30px;
  width: 30px;
  color: var(--muted);
}
.drag-handle:active {
  cursor: grabbing;
}
.edit-row.dragging {
  opacity: 0.4;
}
.edit-row.drop-before {
  border-top: 2px solid var(--accent);
}
.edit-row .row-tools {
  display: flex;
  gap: 0;
}
.row-tools .icon-button {
  width: 34px;
  min-width: 34px;
}
.row-tools .icon {
  width: 16px;
}
.row-tools .delete-lesson {
  color: var(--danger);
}
.edit-row.deleted {
  opacity: 0.55;
}
.edit-row.deleted input {
  text-decoration: line-through;
}
.edit-row.deleted .row-tools {
  grid-column: 6;
}
.editor-note {
  font-size: 12px;
  color: var(--muted);
  margin-top: 20px;
}
.editor-error {
  color: var(--danger);
  font-size: 13px;
}
.add-lesson {
  margin: 16px 0;
  color: var(--accent);
}
/* A weekly reference in the same workspace, including during holidays. */
.weekly-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  margin-top: 40px;
}
.weekly-day {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 24px;
}
.weekly-day header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}
.weekly-day h2 {
  font-size: 15px;
  margin: 0;
  letter-spacing: -0.2px;
}
.weekly-day-number {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 9px;
  font-size: 12px;
}
.weekly-day ol {
  list-style: none;
  padding: 0;
  margin: 0;
}
.weekly-day li {
  display: flex;
  gap: 20px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  font-size: 13px;
}
.weekly-day time {
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}
.weekly-day small {
  display: block;
  color: var(--muted);
}
.weekly-note {
  font-size: 12px;
  color: var(--muted);
  margin-top: 28px;
}
/* Supporting routes retain their controls and inherit the same system. */
main > h1 {
  margin: 24px 0;
}
main > h2 {
  margin-top: 32px;
}
.history,
.patterns,
.review-list,
.witnesses {
  list-style: none;
  padding: 0;
}
.history > li,
.patterns > li,
.review-list > li,
.witnesses > li {
  border-bottom: 1px solid var(--line);
  padding: 18px 0;
  font-size: 14px;
}
.history .inline {
  margin: 8px;
}
.dead {
  color: var(--muted);
}
.seq {
  font-size: 11px;
  color: var(--muted);
}
.stack label {
  display: block;
}
.pending {
  border: 1px solid var(--line);
  padding: 20px;
  border-radius: 10px;
}
.block {
  margin: 28px 0;
}
.table-wrap {
  overflow: auto;
}
table {
  border-collapse: collapse;
  width: 100%;
}
th,
td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}
.choices {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.error {
  padding: 30px;
}
.review-list .cands {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
pre {
  overflow: auto;
}
code {
  overflow-wrap: anywhere;
}
.report-card {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-bottom: 20px;
}
@media (min-width: 1568px) {
  .workspace main {
    max-width: calc(100% - 224px);
    padding-left: max(64px, calc((100vw - 224px - 1080px) / 2));
    padding-right: max(64px, calc((100vw - 224px - 1080px) / 2));
  }
}
@media (max-width: 1250px) {
  .workspace main {
    padding: 32px 36px 56px;
  }
  .lesson {
    grid-template-columns: 90px 180px minmax(0, 1fr) 88px 30px;
    column-gap: 14px;
  }
  .sheet-labels {
    grid-template-columns: 90px 180px minmax(0, 1fr);
    gap: 14px;
    padding-right: 146px;
  }
  h1 {
    font-size: 31px;
  }
  .view-switch > a {
    font-size: 11px;
    padding: 7px 10px;
  }
  .week-day .day-hint {
    font-size: 8px;
  }
}
@media (max-width: 1000px) {
  .top {
    width: 184px;
    padding-left: 12px;
    padding-right: 12px;
  }
  .workspace main {
    margin-left: 184px;
    padding: 30px 28px 50px;
  }
  .brand {
    font-size: 22px;
    padding: 0 8px;
  }
  .brand-caption {
    font-size: 9px;
  }
  .profile {
    padding-left: 2px;
  }
  .day-header {
    align-items: start;
    flex-direction: column;
    gap: 20px;
  }
  .lesson {
    grid-template-columns: 72px minmax(140px, 1fr) 88px 30px;
    column-gap: 12px;
  }
  .lesson-heading {
    padding-right: 8px;
  }
  .homework-preview {
    grid-column: 2/3;
    grid-row: 2;
    padding-top: 10px;
  }
  .lesson-when {
    gap: 10px;
  }
  .lesson > .more > summary {
    grid-column: 3;
    grid-row: 1;
  }
  .lesson > .evidence > summary {
    grid-column: 4;
    grid-row: 1;
  }
  .sheet-labels {
    grid-template-columns: 72px 1fr;
    gap: 12px;
  }
  .sheet-labels > span:last-child {
    display: none;
  }
  .pane {
    grid-column: 1/-1;
  }
  .edit-row {
    grid-template-columns: 24px 18px 88px minmax(90px, 1fr) 102px;
    gap: 6px;
  }
  .edit-row .group-field {
    grid-column: 4;
    grid-row: 2;
  }
  .edit-row .row-tools {
    grid-column: 5;
    grid-row: 1;
  }
  .weekly-grid {
    gap: 16px;
  }
  .weekly-day {
    padding: 18px;
  }
  .weekly-day li {
    gap: 12px;
  }
}
@media (max-width: 700px), (max-width:1000px) and (pointer:coarse) {
  .top {
    position: relative;
    inset: auto;
    width: auto;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .brand {
    font-size: 21px;
    padding: 0;
    flex: 1;
  }
  .brand-caption {
    display: none;
  }
  .brand-symbol {
    width: 32px;
    height: 34px;
  }
  .class-label {
    margin: 0;
    font-size: 0;
  }
  .class-label > span {
    font-size: 14px;
    margin: 0;
  }
  .topnav {
    display: flex;
    order: 3;
    flex-basis: 100%;
    gap: 8px;
  }
  .topnav > a {
    padding: 8px 12px;
    min-height: 44px;
    font-size: 13px;
  }
  .sidebar-bottom {
    margin: 0;
    padding: 0;
  }
  .profile {
    display: none;
  }
  .utility-menu {
    position: relative;
  }
  .utility-menu > summary {
    padding: 4px;
    min-width: 44px;
    font-size: 0;
    gap: 0;
    justify-content: center;
  }
  .utility-menu > summary .icon:last-child {
    display: none;
  }
  .utility-menu nav {
    position: absolute;
    z-index: 15;
    background: white;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 10px;
    width: 230px;
    right: 0;
    top: 44px;
    box-shadow: 0 10px 30px #20273315;
  }
  .workspace main {
    margin: 0;
    padding: 24px 20px 48px;
  }
  .workspace-context {
    display: none;
  }
  .day-header {
    margin: 0 0 24px;
    gap: 18px;
  }
  h1 {
    font-size: 28px;
    letter-spacing: -0.8px;
  }
  .day-sub {
    font-size: 12px;
  }
  .view-switch > a {
    min-height: 44px;
    font-size: 12px;
  }
  .calendar {
    margin-bottom: 26px;
    padding-top: 8px;
  }
  .calendar-toolbar {
    padding: 0;
    margin-bottom: 12px;
  }
  .calendar-toolbar > strong {
    font-size: 12px;
  }
  .calendar-controls {
    gap: 0;
  }
  .calendar-controls > .text-button {
    font-size: 12px;
    padding: 8px;
    margin: 0;
  }
  .calendar-controls > .icon-button {
    min-width: 32px;
    width: 32px;
  }
  .calendar-controls .icon {
    width: 16px;
  }
  .week {
    gap: 3px;
  }
  .week-day {
    min-height: 88px;
    border-radius: 9px;
    gap: 7px;
  }
  .week-day .num {
    font-size: 25px;
  }
  .week-day .dow {
    font-size: 10px;
  }
  .week-day .day-hint {
    display: none;
  }
  .section-heading {
    align-items: start;
    gap: 8px;
    margin-bottom: 20px;
  }
  .section-heading h2 {
    font-size: 17px;
  }
  .section-heading .fine {
    font-size: 10px;
  }
  .section-heading > .text-button {
    font-size: 11px;
    padding: 6px;
    max-width: 120px;
    white-space: normal;
    line-height: 1.4;
    text-align: left;
  }
  .section-heading > .text-button .icon {
    flex-shrink: 0;
  }
  .sheet-labels {
    display: none;
  }
  .lesson {
    grid-template-columns: 55px minmax(0, 1fr) 40px 30px;
    column-gap: 8px;
    padding: 22px 0;
    min-height: 110px;
  }
  .lesson-when {
    flex-direction: column;
    align-items: start;
    gap: 4px;
    padding-top: 0;
  }
  .slot {
    font-size: 10px;
  }
  .time {
    font-size: 11px;
  }
  .subject {
    font-size: 14px;
  }
  .homework-preview {
    font-size: 13px;
    line-height: 1.6;
    padding-top: 8px;
  }
  .homework-empty {
    font-size: 12px;
  }
  details.more > summary {
    padding: 8px;
    min-height: 44px;
  }
  details.more > summary > span {
    display: none;
  }
  .lesson > .more > summary {
    grid-column: 3;
  }
  .lesson > .evidence > summary {
    grid-column: 4;
  }
  .pane {
    padding: 16px;
    margin-top: 20px;
  }
  .editor-footer {
    align-items: start;
    flex-direction: column;
    gap: 12px;
  }
  .editor-footer button {
    align-self: end;
  }
  .editor-status-options {
    gap: 6px;
  }
  .editor-status-options button {
    font-size: 11px;
  }
  .empty-day {
    padding: 36px 0;
  }
  .empty-day p {
    font-size: 12px;
  }
  .empty-day .text-button {
    font-size: 11px;
  }
  .weekly-grid {
    grid-template-columns: 1fr;
    margin-top: 26px;
  }
  .weekly-note {
    font-size: 12px;
  }
  .edit-toolbar {
    align-items: start;
    flex-direction: column;
    padding: 12px;
  }
  .edit-toolbar .edit-actions {
    align-self: end;
  }
  .edit-row {
    grid-template-columns: 24px 20px 88px 1fr;
    gap: 6px;
  }
  .edit-row .subject-field {
    grid-column: 3/-1;
    grid-row: 2;
  }
  .edit-row .group-field {
    grid-column: 3;
    grid-row: 3;
  }
  .edit-row .row-tools {
    grid-column: 4;
    grid-row: 1;
    justify-content: end;
  }
  .edit-row .drag-handle {
    grid-column: 1;
    grid-row: 1/4;
  }
  .edit-row .edit-number {
    grid-column: 2;
    grid-row: 1/4;
  }
  .edit-row .time-field {
    grid-column: 3;
    grid-row: 1;
  }
  .edit-row.deleted .row-tools {
    grid-column: 4;
  }
  .day-notice {
    flex-wrap: wrap;
  }
  .welcome main {
    padding: 0 20px 40px;
  }
  .welcome .top {
    padding: 20px;
  }
  .onboarding {
    margin-top: 24px !important;
  }
  .card {
    padding: 20px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *:before,
  *:after {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
}
@media (min-width: 1001px) {
  details.more > summary {
    grid-column: 4;
    grid-row: 1;
  }
  details.evidence > summary {
    grid-column: 5;
    grid-row: 1;
  }
  .pane {
    grid-row: 2;
  }
}
@media (max-width: 1000px) {
  .pane {
    grid-row: 3;
  }
}
@media (min-width: 1001px) {
  .workspace-context {
    margin-bottom: 24px;
  }
  .day-header {
    margin-bottom: 24px;
  }
  .calendar {
    margin-bottom: 24px;
  }
  .week-day {
    min-height: 88px;
  }
  .section-heading {
    margin-bottom: 18px;
  }
  .lesson {
    min-height: 84px;
    padding-top: 22px;
    padding-bottom: 22px;
  }
}
.day-content:has(.empty-day) .sheet-labels {
  display: none;
}
@media (min-width: 1250px) {
  .weekly-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
  }
  .weekly-day {
    padding: 18px 14px;
  }
  .weekly-day header {
    gap: 8px;
  }
  .weekly-day h2 {
    font-size: 12px;
  }
  .weekly-day-number {
    width: 28px;
    height: 30px;
    flex-shrink: 0;
  }
  .weekly-day li {
    gap: 10px;
    font-size: 12px;
  }
  .weekly-day li span {
    min-width: 0;
    overflow-wrap: anywhere;
  }
  .weekly-day time {
    font-size: 11px;
  }
}
/* Expanded panels own their layout. Native details content must never inherit a lesson column. */
.lesson > details.more,
.lesson > details.evidence {
  display: block;
  grid-column: 1/-1;
  min-width: 0;
}
.lesson > details.more > summary,
.lesson > details.evidence > summary {
  position: absolute;
  top: 13px;
  margin: 0;
  grid-column: auto;
  grid-row: auto;
}
.lesson > details.more > summary {
  right: 54px;
  width: 100px;
}
.lesson > details.evidence > summary {
  right: 0;
  width: 34px;
}
.lesson > details > .pane {
  display: block;
  grid-column: auto;
  grid-row: auto;
  width: auto;
  max-width: 960px;
  min-width: 0;
  margin: 20px 0 0 128px;
  padding: 24px;
  background: #fafbfe;
  box-shadow: 0 4px 18px #20273304;
}
.lesson > details > .pane .editor-heading {
  align-items: start;
  margin: 0 0 22px;
  gap: 20px;
}
.editor-heading > div {
  min-width: 0;
}
.editor-heading h3 {
  font-size: 17px;
  letter-spacing: -0.3px;
  line-height: 1.4;
}
.editor-heading p {
  margin: 5px 0 0;
  color: var(--muted-strong);
  font-size: 12px;
}
.editor-heading p span {
  color: var(--muted);
}
.editor-heading > .icon-button {
  margin: -9px -9px 0 0;
  flex-shrink: 0;
}
.homework-form {
  gap: 9px;
}
.homework-form textarea {
  display: block;
  min-width: 0;
  min-height: 112px;
  background: white;
  line-height: 1.65;
}
.homework-form .existing-homework {
  margin-bottom: 8px;
}
.homework-form label {
  color: var(--muted-strong);
  font-size: 12px;
}
.editor-sharing {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  color: var(--muted);
}
.editor-sharing .icon {
  width: 15px;
  height: 15px;
}
.editor-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}
.editor-footer {
  gap: 16px;
  align-items: center;
  margin-top: 8px;
}
.editor-footer button {
  font-size: 12px;
}
.editor-status-options {
  align-items: center;
  gap: 8px;
  padding-top: 16px;
  margin-top: 20px;
}
.editor-status-options > span {
  color: var(--muted);
  font-size: 11px;
  margin-right: 8px;
}
.editor-status-options button {
  background: white;
  border: 1px solid var(--line);
}
.lesson-info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 20px;
}
.info-section {
  min-width: 0;
  background: white;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 18px;
}
.info-section-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.info-section h4,
.lesson-edit-form h4 {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  font-weight: 550;
}
.source-status {
  background: var(--bg);
  border-radius: 5px;
  padding: 3px 7px;
  color: var(--muted-strong);
  font-size: 10px;
  white-space: normal;
}
.source-card.official {
  margin: 0;
  padding: 18px;
  border: 1px solid var(--line);
  font-size: 13px;
}
.source-explanation {
  font-size: 12px;
  color: var(--muted-strong);
  margin: 14px 0 0;
  line-height: 1.8;
}
.source-updated {
  color: var(--muted);
  font-size: 10px;
  margin: 14px 0 0;
}
.info-warning {
  padding: 10px 12px;
  background: var(--warn-soft);
  border-radius: 7px;
  color: var(--warn);
  font-size: 11px;
  line-height: 1.7;
  margin: 14px 0;
}
.source-card .off-hw {
  margin-top: 14px;
  font-size: 13px;
  line-height: 1.7;
  white-space: pre-wrap;
}
.source-audit {
  margin-top: 14px;
  padding-top: 6px;
  border-top: 1px solid var(--line);
}
.audit-content {
  min-width: 0;
}
.audit-content .fine {
  font-size: 10px;
  overflow-wrap: anywhere;
}
.source-readings {
  list-style: none;
  padding: 0;
  margin: 10px 0;
}
.source-readings li {
  display: grid;
  gap: 3px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  font-size: 11px;
  overflow-wrap: anywhere;
}
.source-readings li time,
.source-readings small {
  font-size: 10px;
  color: var(--muted);
}
.info-section .entries {
  margin: 8px 0 0;
}
.info-section .entry:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}
.info-section .entry-text {
  font-size: 13px;
  line-height: 1.7;
}
.info-section .entry-meta {
  font-size: 10px;
  line-height: 1.7;
}
.info-section .line-actions {
  gap: 8px;
  margin-top: 8px;
}
.info-section .line-actions button {
  font-size: 11px;
  padding: 6px 10px;
}
.info-section .line-actions .rm button {
  color: var(--danger);
  border-color: transparent;
}
.info-section details.report {
  min-width: 0;
  flex: 1;
}
.info-section details.report > summary {
  justify-content: start;
  font-size: 11px;
}
.info-section details.report[open] {
  flex-basis: 100%;
}
.info-section details.report form {
  border: 1px solid var(--line);
  min-width: 0;
  padding: 14px;
}
.info-section .claim {
  font-size: 11px;
}
.info-section .claims,
.info-section .dissent {
  margin: 12px 0;
  padding: 10px 12px;
  background: var(--bg);
  border: 0;
  border-radius: 7px;
}
.lesson-actions,
.cancel-lesson,
.timetable-audit {
  border-top: 1px solid var(--line);
}
.lesson-actions > summary,
.cancel-lesson > summary,
.timetable-audit > summary {
  gap: 8px;
  font-size: 12px;
}
.lesson-actions > summary .icon,
.cancel-lesson > summary .icon {
  width: 15px;
  height: 15px;
}
.cancel-lesson > summary {
  color: var(--danger);
}
.lesson-tools {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  padding: 8px 0 18px;
}
.lesson-edit-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 112px;
  gap: 12px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 16px;
  min-width: 0;
}
.lesson-edit-form h4 {
  grid-column: 1/-1;
}
.lesson-edit-form label {
  min-width: 0;
}
.lesson-edit-form input {
  font-size: 13px;
  min-width: 0;
}
.lesson-edit-form button {
  grid-column: 1/-1;
  justify-self: end;
}
.lesson-cancel-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: end;
  padding: 10px 0 16px;
}
.lesson-cancel-form p {
  grid-column: 1/-1;
  font-size: 11px;
  margin: 0;
}
.danger-button {
  color: var(--danger) !important;
}
.info-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
  margin-top: 8px;
}
.info-footer .hist {
  font-size: 12px;
  padding-left: 0;
}
.info-footer .hist .icon {
  width: 16px;
  height: 16px;
}
.info-footer > span {
  color: var(--muted);
  font-size: 10px;
  text-align: right;
}
.slot,
.edit-number {
  color: var(--accent) !important;
  font-weight: 550;
}
.edit-toolbar {
  flex-wrap: wrap;
}
.edit-toolbar .edit-actions {
  margin-left: auto;
  flex-wrap: wrap;
  justify-content: end;
}
.save-recurring {
  background: white;
  color: var(--accent);
  border: 1px solid #cbd7fb;
}
.save-recurring:hover {
  background: #f7f9ff;
}
.recurrence-hint {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 11px;
}
@media (max-width: 1250px) and (min-width: 1001px) {
  .lesson > details > .pane {
    margin-left: 104px;
  }
  .lesson > details.more > summary {
    right: 44px;
    width: 88px;
  }
  .lesson-edit-form {
    grid-template-columns: minmax(0, 1fr);
  }
  .lesson-edit-form h4,
  .lesson-edit-form button {
    grid-column: 1;
  }
}
@media (max-width: 1000px) {
  .lesson > details > .pane {
    margin-left: 0;
  }
  .lesson > details.more > summary {
    right: 42px;
    width: 88px;
    top: 17px;
  }
  .lesson > details.evidence > summary {
    top: 17px;
  }
  .lesson-info-grid,
  .lesson-tools {
    grid-template-columns: 1fr;
  }
  .editor-footer {
    flex-wrap: wrap;
  }
}
@media (max-width: 700px), (max-width:1000px) and (pointer:coarse) {
  .lesson > details.more > summary {
    right: 38px;
    width: 40px;
    top: 15px;
  }
  .lesson > details.evidence > summary {
    top: 15px;
  }
  .lesson > details > .pane {
    padding: 18px;
    margin-top: 18px;
  }
  .editor-heading h3 {
    font-size: 16px;
  }
  .editor-footer {
    align-items: start;
    gap: 12px;
  }
  .editor-actions {
    width: 100%;
    justify-content: end;
  }
  .editor-status-options > span {
    flex-basis: 100%;
  }
  .editor-status-options {
    gap: 6px;
  }
  .info-section,
  .source-card.official {
    padding: 14px;
  }
  .info-footer {
    align-items: start;
    flex-direction: column;
    gap: 2px;
  }
  .info-footer > span {
    text-align: left;
  }
  .lesson-edit-form {
    grid-template-columns: minmax(0, 1fr);
  }
  .lesson-edit-form h4,
  .lesson-edit-form button {
    grid-column: 1;
  }
  .lesson-cancel-form {
    grid-template-columns: 1fr;
  }
  .lesson-cancel-form button {
    justify-self: end;
  }
  .lesson-cancel-form p {
    grid-column: 1;
  }
  .edit-toolbar .edit-actions {
    margin-left: 0;
    align-self: stretch;
    gap: 6px;
  }
  .save-recurring {
    font-size: 11px !important;
  }
  .homework-form textarea {
    font-size: 16px;
  }
  .editor-footer button {
    padding: 8px 12px;
  }
}
.homework-form .additional-homework {
  border-top: 1px solid var(--line);
  margin-top: 6px;
  padding-top: 4px;
}
.homework-form .additional-homework > summary {
  gap: 7px;
  color: var(--accent);
  font-size: 12px;
}
.homework-form .additional-homework > summary .icon {
  width: 15px;
  height: 15px;
}
.homework-form .additional-homework[open] > summary {
  margin-bottom: 6px;
}
/* Compact inline editing: the panel shares the exact edges of its lesson row. */
.lesson > details > .pane {
  width:100%;max-width:none;margin:12px 0 0;padding:12px 14px;
  border-radius:8px;box-shadow:none;background:#fafbfe;
}
.lesson > details > .pane.homework-pane { padding:10px; }
.compact-homework.homework-form {
  display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:start;gap:10px;
}
.compact-homework.homework-form textarea {
  margin:0;min-height:64px;max-height:260px;padding:8px 10px;font-size:14px;line-height:1.6;
}
.compact-editor-actions { display:flex;align-items:center;gap:6px; }
.compact-editor-actions button {
  min-height:36px;padding:7px 12px;font-size:12px;border-radius:7px;
}
.homework-text { margin:0; }
.lesson-facts { display:flex;flex-wrap:wrap;gap:8px 28px;margin:0;font-size:12px; }
.lesson-facts > div { display:flex;gap:8px;min-width:0; }
.lesson-facts dt { color:var(--muted);flex-shrink:0; }
.lesson-facts dd { margin:0;overflow-wrap:anywhere; }
.lesson-facts dd span { color:var(--muted);font-size:11px; }
.compact-info-footer { display:flex;align-items:center;justify-content:space-between;gap:16px;margin-top:10px; }
.compact-info-footer p { color:var(--muted);font-size:11px;margin:0; }
.compact-info-footer a.hist { display:inline-flex;align-items:center;gap:4px;min-height:32px;font-size:11px;white-space:nowrap; }
.compact-info-footer .icon { width:14px;height:14px; }
.info-difference { margin:8px 0 0;font-size:12px;color:var(--muted-strong); }
.moderation-audit { font-size:12px;margin-top:8px; }
@media(max-width:700px), (max-width:1000px) and (pointer:coarse){
  .lesson > details > .pane { margin:10px 0 0;padding:10px; }
  .compact-homework.homework-form { grid-template-columns:minmax(0,1fr);gap:8px; }
  .compact-homework.homework-form textarea { font-size:16px; }
  .compact-editor-actions { justify-content:end; }
  .compact-editor-actions button { min-height:44px; }
  .lesson-facts { display:grid;gap:7px; }
  .compact-info-footer { align-items:start;flex-direction:column;gap:3px; }
}
@media(max-width:700px), (max-width:1000px) and (pointer:coarse){.compact-info-footer a.hist{min-height:44px}}

/* Secondary assertion below the compact editor actions. */
.homework-pane .homework-none { display:flex;justify-content:flex-end;margin:4px 0 0; }
.homework-pane .homework-none button { min-height:32px;padding:4px 10px;border:0;font-size:12px;color:var(--muted-strong); }
@media(max-width:700px), (max-width:1000px) and (pointer:coarse){.homework-pane .homework-none button{min-height:44px;}}
/* Phone layout. Desktop geometry above remains unchanged. */
.mobile-week-link { display:none; }
@media(max-width:700px), (max-width:1000px) and (pointer:coarse) {
  html { scroll-padding-top:68px;scroll-padding-bottom:90px; }
  .workspace .top { position:sticky;top:0;z-index:45;flex-wrap:nowrap;min-height:56px;gap:12px;padding:6px 16px;background:#fff; }
  .workspace .brand { min-height:44px; }
  .workspace .class-label > span { font-size:13px; }
  .workspace .topnav { position:fixed;left:0;right:0;bottom:0;inset:auto 0 0;z-index:40;display:flex;justify-content:center;align-items:center;gap:8px;padding:5px 16px calc(5px + env(safe-area-inset-bottom,0px));min-height:64px;background:#fff;border-top:1px solid var(--line); }
  .workspace .topnav > a { flex:1;max-width:180px;min-height:52px;display:flex;flex-direction:column;justify-content:center;gap:3px;padding:5px 10px;font-size:11px;border-radius:9px; }
  .workspace .topnav .icon { width:20px;height:20px; }
  .workspace.mobile-keyboard-open .topnav { transform:translateY(110%);visibility:hidden; }
  .workspace main { padding:14px 16px calc(86px + env(safe-area-inset-bottom,0px));min-height:calc(100vh - 56px);min-height:calc(100dvh - 56px); }
  .workspace .utility-menu nav { max-height:calc(100dvh - 140px);overflow:auto; }
  .day-header { margin-bottom:10px;gap:10px; }
  .day-header h1 { font-size:22px;line-height:1.3;letter-spacing:-.65px; }
  .day-header .eyebrow,.day-header .day-sub { display:none; }
  .dated-header .view-switch { display:none; }
  .day-header .view-switch { padding:2px;border:0;background:transparent; }
  .day-header .view-switch a[aria-current] { display:none; }
  .calendar { margin-bottom:4px;padding:0 0 8px;border-top:0; }
  .calendar-toolbar { margin:0 0 3px;gap:8px; }
  .calendar-toolbar > strong { display:none; }
  .mobile-week-link { display:inline-flex;align-items:center;gap:6px;min-height:44px;color:var(--muted-strong);font-size:12px; }
  .mobile-week-link .icon { width:15px;height:15px; }
  .calendar-controls { gap:0; }
  .calendar-controls > .icon-button { width:44px;min-width:44px;min-height:44px;padding:10px; }
  .calendar-controls > .text-button { min-height:44px;padding:8px;font-size:12px; }
  .week { gap:2px; }
  .week-day { min-height:60px;gap:3px;padding:6px 0;border-radius:8px; }
  .week-day .num { font-size:22px; }
  .week-day .dow { font-size:10px; }
  .week-day[data-today='1']:not([aria-current]) .num { text-underline-offset:4px; }
  .day-content .section-heading { align-items:center;gap:8px;margin:0;min-height:44px; }
  .section-heading h2 { font-size:14px;margin:0; }
  .section-heading .fine { display:none; }
  .section-heading > [data-edit-timetable] { min-width:44px;width:44px;max-width:44px;min-height:44px;padding:10px;font-size:0;white-space:nowrap; }
  .section-heading > [data-edit-timetable] .icon { width:17px;height:17px; }
  .lesson { grid-template-columns:40px minmax(0,1fr);column-gap:10px;min-height:84px;padding:12px 0; }
  .lesson-when { grid-column:1;grid-row:1/3;gap:3px;padding-top:2px; }
  .lesson-heading { grid-column:2/-1;grid-row:1;padding-right:86px; }
  .subject { font-size:14px;line-height:1.45; }
  .slot { font-size:10px; }
  .time { font-size:10px; }
  .homework-preview { grid-column:2/-1;grid-row:2;font-size:13px;line-height:1.5;padding:4px 0 0; }
  .homework-empty { font-size:12px;line-height:1.5; }
  .attention-note { font-size:10px;line-height:1.5;margin-top:4px; }
  .lesson > details.more > summary { top:5px;right:44px;width:44px;min-height:44px;padding:10px; }
  .lesson > details.evidence > summary { top:5px;right:0;width:44px;min-height:44px;padding:10px; }
  .lesson > details > .pane { margin-top:10px; }
  .day-record { margin-top:18px; }
  #timetable-editor { scroll-margin-top:68px; }
  .edit-toolbar { position:sticky;top:56px;z-index:20;display:block;padding:10px;margin:0 0 10px;border-radius:9px;background:var(--accent-soft); }
  .edit-toolbar > p,.recurrence-hint { display:none; }
  .edit-toolbar .edit-actions { display:grid;grid-template-columns:1fr 1fr;width:100%;gap:7px;margin:0; }
  .edit-toolbar button { min-height:44px;padding:9px 10px;font-size:12px; }
  .edit-toolbar .save-recurring { grid-column:1/-1;font-size:12px !important; }
  .edit-rows { gap:0; }
  .edit-row { position:relative;grid-template-columns:44px 104px minmax(0,1fr) 44px;gap:6px;padding:12px 0; }
  .edit-row input { min-width:0;width:100%;min-height:44px;padding:8px;font-size:16px; }
  .edit-row .subject-field { grid-column:2/-1;grid-row:1; }
  .edit-row .time-field { grid-column:2;grid-row:2;font-size:14px; }
  .edit-row .group-field { grid-column:3;grid-row:2;font-size:14px; }
  .edit-row .drag-handle { grid-column:1;grid-row:1/3;width:44px;height:94px;min-height:94px;touch-action:none;padding:19px 10px 0; }
  .edit-row .edit-number { position:absolute;top:16px;left:19px;width:auto;pointer-events:none; }
  .edit-row .row-tools { grid-column:4;grid-row:2;justify-content:end;gap:0; }
  .edit-row .row-tools > .icon-button:not(.delete-lesson) { display:none; }
  .edit-row .row-tools > button { width:44px;min-width:44px;min-height:44px;padding:10px; }
  .edit-row.deleted .time-field,.edit-row.deleted .group-field { display:none; }
  .edit-row.deleted .row-tools { grid-column:2/-1;grid-row:2; }
  .edit-row.deleted .row-tools > button { width:auto; }
  .editor-note { margin:12px 0;font-size:11px;line-height:1.6; }
  .edit-row.touch-dragging { z-index:25;pointer-events:none;background:#fff;border-radius:8px;box-shadow:0 6px 24px #20273325;opacity:.9; }
  .edit-row.drop-before { box-shadow:0 -3px 0 var(--accent); }
  .edit-row.drop-after { box-shadow:0 3px 0 var(--accent); }
  body.touch-reordering { user-select:none; }
  main.swipe-days { touch-action:pan-y pinch-zoom; }
  main.swipe-days.is-swiping { transform:translate3d(var(--swipe-offset,0px),0,0); }
  .day-changing .dated-header h1::after { content:'';display:inline-block;width:12px;height:12px;margin-left:10px;border:2px solid var(--line-strong);border-right-color:var(--accent);border-radius:50%;animation:mobile-spin .7s linear infinite; }
  .day-enter-next .day-content,.day-enter-next .dated-header { animation:mobile-enter-next .18s ease-out; }
  .day-enter-prev .day-content,.day-enter-prev .dated-header { animation:mobile-enter-prev .18s ease-out; }
  @keyframes mobile-spin { to{transform:rotate(360deg);} }
  @keyframes mobile-enter-next { from{opacity:.5;transform:translateX(12px);}to{opacity:1;transform:none;} }
  @keyframes mobile-enter-prev { from{opacity:.5;transform:translateX(-12px);}to{opacity:1;transform:none;} }
}
@media(max-width:700px) and (prefers-reduced-motion:reduce), (max-width:1000px) and (pointer:coarse) and (prefers-reduced-motion:reduce) {
  .day-enter-next .day-content,.day-enter-next .dated-header,.day-enter-prev .day-content,.day-enter-prev .dated-header,.day-changing .dated-header h1::after { animation:none; }
}
@media(max-width:700px), (max-width:1000px) and (pointer:coarse) {
  .workspace main { position:relative; }
  .dated-header h1 { padding-right:40px; }
  .day-content .section-heading { position:static;height:0;min-height:0;margin:0; }
  .day-content .section-heading > div { display:none; }
  .day-content .section-heading > [data-edit-timetable] { position:absolute;top:6px;right:12px; }
}
@media(max-height:500px) and (max-width:1000px) and (pointer:coarse) {
  .calendar .week { display:none; }
  .calendar { padding-bottom:0; }
}
.edit-time { display:contents; }
.edit-time-face { display:none; }
@media(max-width:700px), (max-width:1000px) and (pointer:coarse) {
  .edit-row .edit-number { grid-column:auto;grid-row:auto; }
  .edit-time { display:block;position:relative;grid-column:2;grid-row:2;min-width:0; }
  .edit-time .time-field { position:absolute;inset:0;opacity:0;width:100%;height:44px;min-height:44px;margin:0;cursor:pointer; }
  .edit-time-face { display:flex;align-items:center;justify-content:space-between;gap:6px;min-height:44px;padding:8px;border:1px solid var(--line-strong);border-radius:8px;background:#fff;color:var(--fg);font-size:14px;font-variant-numeric:tabular-nums; }
  .edit-time-face .icon { width:15px;height:15px; }
  .edit-time:focus-within .edit-time-face { outline:3px solid var(--focus);outline-offset:2px; }
  .edit-row.deleted .edit-time { display:none; }
}
@media(max-width:700px), (max-width:1000px) and (pointer:coarse) {
  .mobile-keyboard-open main.swipe-days,main.swipe-days:has(#timetable-editor:not([hidden]),details.more[open],details.evidence[open]) { touch-action:auto; }
}
@media(max-width:700px), (max-width:1000px) and (pointer:coarse) {
  body:not(.touch-reorder-ready) .edit-row .row-tools { grid-column:2/-1;grid-row:3; }
  body:not(.touch-reorder-ready) .edit-row .row-tools > .icon-button:not(.delete-lesson) { display:inline-flex; }
}
@media(max-width:700px), (max-width:1000px) and (pointer:coarse) {
  #timetable-editor { scroll-margin-top:0; }
  .edit-row .group-field,.edit-time .time-field { font-size:16px; }
}
