.module-nav { display: flex; gap: 8px; padding: 0 16px 16px; }
.module-nav button { min-width: 110px; padding: 10px 18px; border-radius: 10px; background: #F3F7F4; color: var(--green); border: 1px solid var(--line); font-weight: 650; }
.module-nav button[aria-pressed='true'] { background: var(--green); color: white; border-color: var(--green); }
.teaching-workspace { padding: 0 16px 32px; max-width: 1440px; margin: auto; }
.teaching-heading { margin: 6px 0 20px; }
.teaching-heading h2 { font-size: 26px; }
.teaching-top { margin-bottom: 16px; }
.teaching-top > .teaching-field { max-width: 420px; }
.teaching-class-strip { display: flex; gap: 8px; overflow-x: auto; padding: 4px 3px 12px; margin: 0 0 12px; scrollbar-width: thin; }
.teaching-class-strip:empty { display: none; }
.teaching-class-button, .teaching-class-label { background: var(--field-bg); color: var(--field-ink); border-radius: 10px; }
.teaching-class-button { flex-shrink: 0; min-height: 44px; min-width: 60px; padding: 8px 16px; border: 2px solid transparent; font-weight: 650; }
.teaching-class-button[aria-pressed='true'] { border-color: currentColor; box-shadow: 0 0 0 2px white; text-decoration: underline; text-underline-offset: 5px; }
.teaching-class-label { padding: 8px 12px; font-weight: 650; }
.teaching-workspace #teaching-class { background: var(--field-bg, white); color: var(--field-ink, var(--text)); border-color: var(--field-ink, var(--line)); }
.teaching-class-row { padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: white; }
.teaching-class-row[data-dragging='true'] { opacity: .35; }
.teaching-class-row button { min-width: 44px; min-height: 44px; }
.teaching-class-handle { touch-action: none; cursor: grab; font-size: 24px; }
.teaching-class-row > .teaching-class-label { flex-basis: 90px; }
.teaching-field { min-width: 0; margin-bottom: 16px; }
.teaching-workspace select { font: inherit; }
.teaching-workspace textarea { height: auto; min-height: 170px; resize: vertical; line-height: 1.7; caret-color: var(--green); }
.teaching-workspace ::selection { color: var(--text); background: var(--yellow); }
.teaching-workspace summary { min-height: 44px; cursor: pointer; padding: 10px 0; color: var(--green); font-weight: 600; }
.teaching-workspace h3 { font-size: 20px; }
.teaching-workspace h4 { margin: 12px 0 6px; font-size: 14px; }
.teaching-manage { padding: 0 16px; border: 1px solid var(--line); border-radius: 12px; background: white; }
.teaching-manager-section { padding: 12px 0 20px; }
.teaching-manager-section + .teaching-manager-section { border-top: 1px solid var(--line); padding-top: 24px; }
.teaching-settings-form { margin-top: 16px; }
.teaching-settings-form > button { margin: 0 8px 8px 0; }
.teaching-settings-list { display: grid; gap: 8px; }
.teaching-settings-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 12px 0; border-bottom: 1px solid var(--line); }
.teaching-settings-row > span { flex: 1 1 140px; overflow-wrap: anywhere; }
.teaching-settings-row > button { flex-shrink: 0; }
.teaching-palette { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.teaching-palette button { background: var(--field-bg); color: var(--field-ink); padding: 8px 12px; border: 2px solid transparent; border-radius: 10px; }
.teaching-palette button[aria-pressed='true'] { border-color: currentColor; font-weight: 750; text-decoration: underline; text-underline-offset: 4px; }
.teaching-workspace input[type='color'] { max-width: 160px; cursor: pointer; }
.teaching-notice { margin-bottom: 16px; }
.teaching-notice:has(.teaching-status:empty):has(.field-error:empty):has(button[hidden]):not(:has(button:not([hidden]))) { display: none; }
.teaching-notice p { margin: 4px 0 8px; }
.teaching-notice button { margin-right: 8px; }
.teaching-status { color: var(--green); font-size: 14px; }
.teaching-empty { padding: 28px 20px; background: white; border-radius: 16px; border: 1px solid var(--line); }
.teaching-empty button { margin-top: 16px; }
.teaching-layout { display: grid; gap: 24px; align-items: start; }
.teaching-compose { background: white; padding: 20px 16px; border: 1px solid var(--line); border-radius: 16px; min-width: 0; }
.teaching-section-heading { display: flex; align-items: center; gap: 8px; justify-content: space-between; margin-bottom: 16px; }
.teaching-compose > .field-note { margin: 0 0 16px; }
.teaching-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 12px; }
.teaching-tab { min-width: 70px; background: var(--field-bg); color: var(--field-ink); border: 2px solid transparent; border-radius: 10px; padding: 8px 12px; overflow-wrap: anywhere; }
.teaching-tab[aria-selected='true'] { border-color: currentColor; font-weight: 750; text-decoration: underline; text-underline-offset: 4px; }
.teaching-input-panel { padding: 14px; background: var(--field-bg); color: var(--field-ink); border-radius: 12px; }
.teaching-input-panel label { font-size: 14px; color: inherit; }
.teaching-count { text-align: right; font-size: 14px; margin: 8px 0 0; font-variant-numeric: tabular-nums; }
.teaching-input-panel + button { margin: 12px 0 16px; }
.teaching-compose > .primary { margin-top: 16px; }
.teaching-compose > .primary + button { margin-top: 12px; width: 100%; }
.teaching-historical p, .teaching-record-value p { white-space: pre-wrap; overflow-wrap: anywhere; margin: 8px 0 16px; font-size: 15px; }
.teaching-orphans { padding: 12px; margin: 8px 0; border: 1px solid #D8C585; border-radius: 12px; background: #FFF8E1; color: #705417; }
.teaching-orphans .field-note { color: inherit; }
.teaching-orphans h4 { margin-top: 0; }
.teaching-orphan { margin-top: 16px; }
.teaching-orphan p { white-space: pre-wrap; overflow-wrap: anywhere; }
.teaching-orphans button { margin: 0 8px 8px 0; }
.teaching-history { min-width: 0; }
.teaching-history-filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.teaching-history-filters button[aria-pressed='true'] { border-color: var(--green); background: var(--tint); text-decoration: underline; text-underline-offset: 4px; }
.teaching-records { margin-top: 16px; max-height: 75dvh; overflow-y: auto; overscroll-behavior: contain; scrollbar-color: #8BAF98 #E9F5EC; scrollbar-width: thin; }
.teaching-record { padding: 20px 0; border-top: 1px solid #BDDDC8; }
.teaching-record time { font-weight: 700; font-size: 16px; font-variant-numeric: tabular-nums; }
.teaching-field-badge { display: inline-block; width: fit-content; padding: 4px 8px; border-radius: 6px; background: var(--field-bg); color: var(--field-ink); font-size: 14px; }
.teaching-record-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.teaching-history > button { width: 100%; margin-top: 12px; }
body[data-mini='true'] .module-nav, body[data-mini='true'] .teaching-workspace { display: none; }
@media (max-width: 600px) {
  .teaching-heading { margin: 0 0 12px; }
  .teaching-top { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: end; margin-bottom: 12px; }
  .teaching-top > .teaching-field { margin: 0; }
  .teaching-manage:not([open]) { padding: 0 10px; }
  .teaching-manage:not([open]) summary { font-size: 14px; white-space: nowrap; }
  .teaching-manage[open], .teaching-top:has(.teaching-manage[open]) > .teaching-field { grid-column: 1 / -1; }
  .teaching-compose { display: grid; grid-template-columns: minmax(0, 1fr) minmax(132px, 150px); gap: 0 12px; padding: 16px; }
  .teaching-compose > * { grid-column: 1 / -1; }
  .teaching-compose > .teaching-section-heading { grid-column: 1; grid-row: 1; align-self: center; flex-wrap: wrap; margin-bottom: 12px; }
  .teaching-section-heading h3 { font-size: 18px; }
  .teaching-compose > .teaching-field { grid-column: 2; grid-row: 1; margin: 0 0 12px; }
  .teaching-compose > .teaching-field label { font-size: 14px; margin-bottom: 4px; }
  .teaching-compose > .teaching-field input { height: 44px; padding: 8px; font-size: 14px; }
  .teaching-compose > .field-note { margin-bottom: 12px; }
  .teaching-compose > .field-note:empty { display: none; }
  .teaching-tabs { flex-wrap: nowrap; overflow-x: auto; margin: 0 0 10px; padding: 4px 4px 8px; scrollbar-color: #8BAF98 #E9F5EC; scrollbar-width: thin; }
  .teaching-tab { flex-shrink: 0; white-space: nowrap; }
}
@media (min-width: 820px) {
  .teaching-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; }
  .teaching-compose { padding: 24px; }
  .teaching-settings-form { max-width: 560px; }
}
@media (min-width: 1366px) {
  .teaching-workspace { padding-right: 32px; padding-left: 32px; }
  .teaching-layout { grid-template-columns: minmax(360px, .9fr) minmax(0, 1.1fr); gap: 40px; }
}
