:root {
  --bg: #edf1f7;
  --panel: #ffffff;
  --text-main: #111827;
  --text-soft: #6b7280;
  --line: #e5e7eb;
  --line-strong: #d1d5db;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.05), 0 3px 10px rgba(0, 0, 0, 0.06);

  --idle-bg: #f9fafb;
  --idle-border: #d1d5db;
  --reading-bg: #fef3c7;
  --reading-border: #f59e0b;
  --success-bg: #dcfce7;
  --success-border: #16a34a;

  --danger: #dc2626;
  --brand: #1e3a5f;
  --brand-soft: #2563eb;
  --brand-bright: #3b82f6;
  --brand-tint: rgba(30, 58, 95, 0.08);
  --brand-tint-strong: rgba(30, 58, 95, 0.11);
  --warm: #d97706;
  --success: #16a34a;
  --gold: #ca8a04;
}

body[data-theme="forest"] {
  --bg: #eaf1ec;
  --brand: #1b4332;
  --brand-soft: #2d6a4f;
  --brand-bright: #40916c;
  --brand-tint: rgba(27, 67, 50, 0.08);
  --brand-tint-strong: rgba(27, 67, 50, 0.12);
}

body[data-theme="burgundy"] {
  --bg: #f5edf0;
  --brand: #701a3a;
  --brand-soft: #9d2450;
  --brand-bright: #c0426f;
  --brand-tint: rgba(112, 26, 58, 0.08);
  --brand-tint-strong: rgba(112, 26, 58, 0.12);
}

body[data-theme="teal"] {
  --bg: #e9f2f1;
  --brand: #115e59;
  --brand-soft: #0d9488;
  --brand-bright: #14b8a6;
  --brand-tint: rgba(17, 94, 89, 0.08);
  --brand-tint-strong: rgba(17, 94, 89, 0.12);
}

body[data-theme="violet"] {
  --bg: #f0eef7;
  --brand: #4c1d95;
  --brand-soft: #6d28d9;
  --brand-bright: #8b5cf6;
  --brand-tint: rgba(76, 29, 149, 0.08);
  --brand-tint-strong: rgba(76, 29, 149, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

body {
  display: grid;
  place-items: center;
  font-family: "SUIT Variable", "Pretendard Variable", "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  color: var(--text-main);
  background: var(--bg);
}

.stage {
  position: relative;
  width: min(100vw, calc(100vh * 16 / 9));
  height: min(100vh, calc(100vw * 9 / 16));
  margin: 0 auto;
  padding: clamp(14px, 1.5vw, 24px);
  display: grid;
  grid-template-rows: minmax(96px, 0.25fr) minmax(160px, 0.42fr) minmax(0, 2.85fr);
  gap: clamp(8px, 0.8vw, 12px);
}

.panel {
  min-height: 0;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--brand);
}

.teacher-entry {
  position: absolute;
  top: clamp(16px, 1.6vw, 24px);
  right: clamp(16px, 1.6vw, 24px);
  z-index: 3;
  min-width: 90px;
  min-height: 40px;
  opacity: 0.7;
}

.hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(420px, 0.82fr);
  gap: clamp(8px, 0.8vw, 14px);
  padding: clamp(12px, 1vw, 16px);
}

.hero-copy,
.hero-steps,
.board-panel,
.info-ribbon,
.info-panel {
  min-height: 0;
}

.hero-copy {
  display: grid;
  align-content: center;
  overflow: hidden;
  gap: 4px;
  padding: 4px 0 4px clamp(6px, 0.45vw, 10px);
}

.hero-topline,
.section-head,
.board-head,
.settings-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.eyebrow,
.board-label,
.settings-label,
.section-chip,
.hero-date {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 800;
}

.eyebrow,
.board-label,
.settings-label {
  background: var(--brand-tint);
  color: var(--brand);
}

.section-chip,
.hero-date {
  background: var(--brand-tint);
  color: var(--brand-soft);
}

.section-chip.accent {
  background: rgba(220, 38, 38, 0.09);
  color: var(--danger);
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  margin-top: 0;
  font-size: clamp(1.42rem, 1.72vw, 1.86rem);
  line-height: 1.14;
  letter-spacing: -0.035em;
}

h2,
.settings-head h2 {
  font-size: clamp(1.28rem, 1.65vw, 1.6rem);
  line-height: 1.18;
  letter-spacing: -0.03em;
}

h3 {
  font-size: 1.06rem;
  letter-spacing: -0.02em;
}

.summary-copy {
  margin-top: 0;
  max-width: none;
  overflow: hidden;
  color: var(--text-soft);
  font-size: clamp(0.82rem, 0.82vw, 0.9rem);
  line-height: 1.32;
  padding-left: 1px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.hero-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: 1fr;
  gap: 5px;
  align-content: center;
}

.step-card {
  position: relative;
  min-width: 0;
  padding: 7px 8px 7px 33px;
  border-radius: 10px;
  background: var(--idle-bg);
  border: 1px solid var(--line);
}

.step-number {
  position: absolute;
  top: 7px;
  left: 8px;
  display: grid;
  place-items: center;
  width: 19px;
  height: 19px;
  border-radius: 6px;
  background: var(--brand);
  color: #fff;
  font-weight: 900;
  font-size: 0.72rem;
}

.step-card strong {
  display: block;
  overflow: hidden;
  font-size: 0.76rem;
  line-height: 1.14;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.step-card p {
  margin-top: 2px;
  color: var(--text-soft);
  font-size: 0.66rem;
  line-height: 1.14;
}

.info-ribbon {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(0, 0.82fr);
  gap: clamp(8px, 0.75vw, 12px);
}

.info-ribbon.single-panel {
  grid-template-columns: minmax(0, 1fr);
}

.info-ribbon .panel[hidden] {
  display: none;
}

.stage.info-row-hidden {
  grid-template-rows: minmax(96px, 0.25fr) minmax(0, 3.27fr);
}

.stage.info-row-hidden .info-ribbon {
  display: none;
}

.schedule-focus-panel,
.schedule-panel {
  display: grid;
  grid-template-rows: auto 1fr;
}

.info-panel,
.board-panel {
  padding: clamp(9px, 0.75vw, 12px);
}

.info-panel .section-head h2 {
  font-size: clamp(0.94rem, 1vw, 1.04rem);
}

.info-panel .section-chip {
  min-height: 22px;
  padding: 3px 8px;
  font-size: 0.7rem;
}

.schedule-focus-head {
  align-items: center;
}

.important-panel {
  display: grid;
  grid-template-rows: auto 1fr;
}

.important-panel .panel-copy {
  min-height: 0;
  overflow: hidden;
  line-height: 1.4;
  font-weight: 600;
  color: var(--text-main);
  display: grid;
  grid-auto-flow: column;
  column-gap: clamp(18px, 1.8vw, 32px);
  row-gap: 2px;
  align-content: start;
}

.important-panel .notice-item {
  min-width: 0;
}

.panel-copy,
.helper-copy {
  white-space: pre-line;
  line-height: 1.6;
}

.panel-copy,
.helper-copy {
  margin-top: 6px;
  color: var(--text-soft);
  font-size: 0.82rem;
}

.schedule-list {
  min-height: 0;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  align-content: start;
}

.schedule-list.is-long {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
}

.schedule-list.is-very-long {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
}

.schedule-item {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--idle-bg);
  border: 1px solid var(--line);
}

.schedule-subject {
  min-width: 0;
  overflow: hidden;
  font-size: 0.86rem;
  font-weight: 800;
  line-height: 1.15;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.schedule-period {
  flex: 0 0 24px;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: var(--brand);
  color: #fff;
  font-weight: 800;
  font-size: 0.76rem;
}

.schedule-empty {
  grid-column: 1 / -1;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--idle-bg);
  color: var(--text-soft);
  font-size: 0.82rem;
  line-height: 1.24;
}

.schedule-list.is-very-long .schedule-item,
.schedule-list.is-long .schedule-item {
  padding: 7px 9px;
  gap: 6px;
}

.schedule-list.is-long .schedule-subject,
.schedule-list.is-very-long .schedule-subject {
  font-size: 0.76rem;
}

.schedule-list.is-long .schedule-period,
.schedule-list.is-very-long .schedule-period {
  flex-basis: 20px;
  width: 20px;
  height: 20px;
  font-size: 0.66rem;
  border-radius: 5px;
}

.board-panel {
  display: grid;
  grid-template-rows: auto 1fr;
}

.board-head {
  align-items: center;
}

.board-head h2 {
  margin-top: 2px;
  font-size: clamp(0.98rem, 1.08vw, 1.12rem);
  line-height: 1.12;
}

.board-label {
  min-height: 24px;
  padding: 3px 8px;
  font-size: 0.72rem;
}

.board-note {
  max-width: 18rem;
  color: var(--text-soft);
  text-align: right;
  font-size: 0.72rem;
  line-height: 1.28;
}

.student-grid {
  min-height: 0;
  margin-top: 8px;
  display: grid;
  grid-template-columns: repeat(var(--student-columns, 5), minmax(0, 1fr));
  grid-template-rows: repeat(var(--student-rows, 4), minmax(0, 1fr));
  gap: clamp(8px, 0.9vw, 14px);
}

.student-card {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 12px 14px 10px;
  border: 2px solid var(--idle-border);
  border-radius: 14px;
  background: var(--idle-bg);
  color: var(--text-main);
  text-align: left;
  font: inherit;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 100ms ease;
}

.student-card.is-reading {
  background: var(--reading-bg);
  border-color: var(--reading-border);
  border-width: 3px;
}

.student-card.is-success {
  background: var(--success-bg);
  border-color: var(--success-border);
  border-width: 3px;
}

.student-card-top,
.student-card-bottom {
  position: relative;
  z-index: 1;
}

.student-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.student-card-top > div {
  min-width: 0;
}

.student-card-bottom {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  margin-top: 4px;
  min-height: 1.55em;
  padding-bottom: 2px;
}

.student-number {
  font-size: clamp(2.45rem, 3.25vw, 3.7rem);
  font-weight: 900;
  letter-spacing: -0.06em;
  line-height: 0.9;
}

.student-display-name {
  display: block;
  margin-top: 4px;
  max-width: 100%;
  overflow: hidden;
  color: var(--brand-soft);
  font-size: clamp(0.82rem, 0.88vw, 0.92rem);
  font-weight: 800;
  line-height: 1.16;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.state-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.06);
  color: var(--text-soft);
  font-size: 0.72rem;
  font-weight: 800;
}

.student-card.is-reading .state-badge {
  background: rgba(245, 158, 11, 0.18);
  color: #92400e;
}

.student-card.is-success .state-badge {
  background: rgba(22, 163, 74, 0.15);
  color: var(--success);
}

.state-title {
  display: block;
  font-size: clamp(0.84rem, 0.92vw, 0.96rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.3;
  white-space: nowrap;
  color: var(--text-soft);
}

.student-card.is-reading .state-title {
  color: #92400e;
}

.student-card.is-success .state-title {
  color: var(--success);
}

.state-copy {
  display: none;
}

.approval-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 0;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 6px;
  background: rgba(22, 163, 74, 0.12);
  color: var(--success);
  font-size: 0.68rem;
  font-weight: 800;
}

.student-grid.is-dense .student-card {
  padding: 10px 11px 9px;
  border-radius: 12px;
}

.student-grid.is-dense .student-number {
  font-size: clamp(1.7rem, 2.15vw, 2.35rem);
}

.student-grid.is-dense .student-display-name,
.student-grid.is-dense .state-copy {
  font-size: 0.72rem;
}

.student-grid.is-dense .state-title {
  font-size: 0.8rem;
  line-height: 1.28;
}

.student-grid.is-very-dense {
  gap: clamp(5px, 0.55vw, 9px);
}

.student-grid.is-very-dense .student-card {
  padding: 6px 8px 5px;
  border-radius: 10px;
  border-width: 1.5px;
}

.student-grid.is-very-dense .student-card.is-reading,
.student-grid.is-very-dense .student-card.is-success {
  border-width: 2px;
}

.student-grid.is-very-dense .student-number {
  font-size: clamp(1.2rem, 1.55vw, 1.7rem);
}

.student-grid.is-very-dense .student-display-name {
  margin-top: 2px;
  font-size: 0.62rem;
}

.student-grid.is-very-dense .state-badge {
  min-width: 36px;
  min-height: 18px;
  font-size: 0.6rem;
}

.student-grid.is-very-dense .student-card-bottom {
  margin-top: 2px;
  min-height: 1.1em;
  padding-bottom: 0;
}

.student-grid.is-very-dense .state-title {
  font-size: 0.7rem;
  line-height: 1.15;
}

.student-grid.is-very-dense .approval-chip {
  min-height: 16px;
  padding: 0 6px;
  font-size: 0.58rem;
}

.action-button,
.ghost-button,
.inline-button {
  border: 0;
  font: inherit;
  cursor: pointer;
  transition: transform 100ms ease, opacity 100ms ease;
}

.action-button {
  min-height: 48px;
  border-radius: 10px;
  background: var(--brand);
  color: #fff;
  font-weight: 800;
}

.action-button.secondary {
  background: #64748b;
}

.action-button.danger {
  background: var(--danger);
}

.action-button:disabled {
  opacity: 0.38;
  cursor: not-allowed;
  transform: none;
}

.ghost-button {
  min-width: 88px;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 9px;
  background: var(--brand-tint);
  color: var(--brand);
  font-weight: 800;
  border: 1px solid var(--brand-tint-strong);
}

.inline-button {
  min-height: 32px;
  padding: 0 12px;
  border-radius: 8px;
  background: var(--brand-tint);
  color: var(--brand);
  font-weight: 700;
  border: 0;
}

.inline-button:disabled {
  opacity: 0.38;
  cursor: not-allowed;
  transform: none;
}

.action-button:hover,
.action-button:focus-visible,
.ghost-button:hover,
.ghost-button:focus-visible,
.inline-button:hover,
.inline-button:focus-visible,
.student-card:hover,
.student-card:focus-visible {
  transform: translateY(-1px);
}

.notice {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 60;
  max-width: min(90vw, 700px);
  padding: 16px 24px;
  border-radius: 12px;
  background: var(--text-main);
  color: #fff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  transform: translateX(-50%);
  text-align: center;
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.5;
}

.notice.is-warning {
  top: 50%;
  bottom: auto;
  width: min(86vw, 720px);
  padding: 28px;
  background: #7c2d12;
  transform: translate(-50%, -50%);
  font-size: clamp(1.15rem, 2vw, 1.7rem);
}

.notice.is-success {
  background: #14532d;
}

.notice[hidden],
.overlay[hidden] {
  display: none;
}

.overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.48);
  backdrop-filter: blur(4px);
}

#adminPromptOverlay {
  z-index: 70;
}

.settings-dialog {
  width: min(1180px, calc(100vw - 48px));
  max-height: min(92vh, 980px);
  overflow: auto;
  padding: 24px;
  border-radius: 18px;
  background: #f8fafc;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18);
}

.password-dialog {
  width: min(460px, calc(100vw - 32px));
  padding: 24px;
  border-radius: 16px;
  background: #f8fafc;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18);
}

.password-message {
  margin-top: 14px;
  font-size: 0.94rem;
  line-height: 1.5;
}

.delete-dialog {
  width: min(560px, calc(100vw - 32px));
  max-height: min(88vh, 760px);
  display: flex;
  flex-direction: column;
}

.delete-quick {
  margin-top: 14px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.delete-date-list {
  flex: 1;
  min-height: 0;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
  align-content: start;
  overflow: auto;
}

.delete-date-item,
.delete-empty {
  border-radius: 10px;
  background: var(--panel);
  border: 1px solid var(--line);
}

.delete-empty {
  padding: 12px 14px;
  color: var(--text-soft);
  font-size: 0.84rem;
}

.delete-date-label {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  cursor: pointer;
}

.delete-date-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  flex: none;
  accent-color: var(--danger);
}

.delete-date-text strong {
  display: block;
  font-size: 0.96rem;
  letter-spacing: -0.02em;
}

.delete-date-summary {
  display: block;
  margin-top: 2px;
  color: var(--text-soft);
  font-size: 0.78rem;
}

.delete-today-chip {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--brand-tint-strong);
  color: var(--brand);
  font-size: 0.7rem;
  font-weight: 800;
  vertical-align: 2px;
}

.password-form {
  margin-top: 18px;
  display: grid;
  gap: 16px;
}

.teacher-dashboard {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.teacher-panel {
  padding: 16px;
}

.teacher-reading-panel {
  grid-column: 1 / -1;
}

.teacher-stats-panel {
  grid-column: 1 / -1;
}

.stats-head {
  flex-wrap: wrap;
  gap: 8px;
}

.stats-range {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.stats-range-button.is-active {
  background: var(--brand);
  color: #fff;
}

.stats-controls {
  display: flex;
  gap: 8px 18px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.stats-chart {
  margin-top: 12px;
  padding: 12px;
  border-radius: 10px;
  background: var(--panel);
  border: 1px solid var(--line);
}

.stats-chart.is-daily {
  display: flex;
  gap: 10px;
  height: 210px;
  padding: 24px 12px 8px 8px;
}

.heat-wrap {
  overflow-x: auto;
}

.heat-grid {
  display: grid;
  grid-template-columns: minmax(64px, auto) repeat(var(--heat-cols), minmax(16px, 64px));
  gap: 2px;
  justify-content: start;
}

.heat-date {
  padding-bottom: 2px;
  color: var(--text-soft);
  font-size: 0.66rem;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
}

.heat-date.is-today {
  color: var(--text-main);
  font-weight: 800;
}

.heat-row-label {
  padding-right: 6px;
  color: var(--text-soft);
  font-size: 0.72rem;
  line-height: 18px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.heat-cell {
  height: 18px;
  border-radius: 3px;
}

.heat-cell.is-success,
.heat-swatch.is-success {
  background: var(--brand);
}

.heat-cell.is-partial,
.heat-swatch.is-partial {
  background: var(--reading-border);
}

.heat-cell.is-none,
.heat-swatch.is-none {
  background: var(--idle-bg);
  border: 1px solid var(--line);
}

.heat-legend {
  margin-top: 10px;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  color: var(--text-soft);
  font-size: 0.74rem;
}

.heat-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.heat-swatch {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 3px;
}

.stu-list {
  display: grid;
  gap: 6px;
}

.stu-row {
  display: grid;
  grid-template-columns: minmax(72px, auto) 1fr 44px;
  align-items: center;
  gap: 10px;
}

.stu-label {
  color: var(--text-soft);
  font-size: 0.78rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stu-track {
  height: 14px;
  border-radius: 4px;
  background: var(--idle-bg);
  border: 1px solid var(--line);
  overflow: hidden;
}

.stu-bar {
  height: 100%;
  background: var(--brand);
}

.stu-value {
  color: var(--text-soft);
  font-size: 0.74rem;
  font-weight: 800;
  text-align: right;
}

.stats-axis {
  flex: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding-bottom: 20px;
  color: var(--text-soft);
  font-size: 0.7rem;
  text-align: right;
  min-width: 34px;
}

.stats-plot {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: stretch;
  gap: 6px;
}

.stats-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stats-track {
  position: relative;
  flex: 1;
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  border-bottom: 1px solid var(--line);
}

.stats-value {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  margin-bottom: 2px;
  color: var(--text-soft);
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 16px;
  pointer-events: none;
}

.stats-bar {
  width: min(100%, 34px);
  border-radius: 4px 4px 0 0;
  background: var(--brand);
}

.stats-bar.is-zero {
  height: 2px !important;
  border-radius: 1px;
  background: var(--line);
}

.stats-x-label {
  margin-top: 4px;
  min-height: 16px;
  color: var(--text-soft);
  font-size: 0.7rem;
  line-height: 16px;
  white-space: nowrap;
  overflow: hidden;
  max-width: 100%;
}

.stats-col.is-today .stats-x-label {
  color: var(--text-main);
  font-weight: 800;
}

.teacher-helper-copy {
  margin-top: 10px;
  font-size: 0.82rem;
}

.status-strip {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.status-card {
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--idle-bg);
  border: 1px solid var(--line);
}

.status-label {
  display: block;
  color: var(--text-soft);
  font-size: 0.84rem;
}

.status-card strong {
  display: block;
  margin-top: 4px;
  font-size: clamp(1.06rem, 1.25vw, 1.26rem);
  letter-spacing: -0.03em;
}

.reading-list {
  min-height: 0;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
  align-content: start;
}

.reading-item,
.reading-empty {
  border-radius: 10px;
  background: var(--panel);
  border: 1px solid var(--line);
}

.reading-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
}

.reading-student {
  min-width: 0;
}

.reading-student strong {
  display: block;
  font-size: 0.96rem;
  letter-spacing: -0.02em;
}

.reading-student span {
  display: block;
  margin-top: 2px;
  color: var(--text-soft);
  font-size: 0.78rem;
  line-height: 1.3;
}

.reading-empty {
  padding: 12px 14px;
  color: var(--text-soft);
  font-size: 0.84rem;
  line-height: 1.45;
}

.reading-cancel-button {
  min-height: 32px;
  padding: 0 12px;
  border-radius: 8px;
  background: var(--danger);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 800;
  white-space: nowrap;
  border: 0;
}

.action-strip {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.teacher-approval-panel {
  grid-column: 1 / -1;
}

.approval-strip {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "copy copy"
    "metrics button";
  gap: 12px;
  align-items: end;
}

.approval-copy {
  grid-area: copy;
  max-width: 44rem;
}

.approval-label {
  color: var(--brand-soft);
  font-size: 0.84rem;
  font-weight: 800;
}

.approval-copy strong {
  display: block;
  margin-top: 4px;
  font-size: 1.12rem;
  letter-spacing: -0.03em;
}

.approval-status-text {
  margin-top: 4px;
  color: var(--text-soft);
  font-size: 0.88rem;
  line-height: 1.45;
}

.approval-metrics {
  grid-area: metrics;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  justify-self: start;
}

.approval-metric {
  min-width: 88px;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--idle-bg);
  border: 1px solid var(--line);
  text-align: center;
}

.approval-metric span {
  display: block;
  color: var(--text-soft);
  font-size: 0.78rem;
}

.approval-metric strong {
  display: block;
  margin-top: 2px;
  font-size: 0.98rem;
}

.approval-button {
  grid-area: button;
  min-width: 240px;
  justify-self: end;
}

.settings-form {
  margin-top: 18px;
  display: grid;
  gap: 14px;
}

.settings-section {
  padding: 16px;
  border-radius: 12px;
  background: var(--panel);
  border: 1px solid var(--line);
}

.settings-title-row {
  margin-bottom: 12px;
}

.settings-title-row p {
  margin-top: 4px;
  color: var(--text-soft);
  font-size: 0.86rem;
  line-height: 1.5;
}

.weekday-fields,
.api-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.weekday-fields .field:first-child {
  grid-column: 1 / span 2;
}

.field {
  display: grid;
  gap: 6px;
}

.field span,
.toggle-field span {
  font-size: 0.86rem;
  font-weight: 700;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: #fff;
  color: var(--text-main);
  font: inherit;
  padding: 10px 12px;
}

.field input[readonly] {
  background: var(--idle-bg);
  color: var(--text-soft);
}

.field textarea {
  resize: vertical;
}

.field select {
  min-height: 44px;
}

.field-span-2 {
  grid-column: 1 / span 2;
}

.toggle-field {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.toggle-field input {
  width: 18px;
  height: 18px;
}

.settings-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

code {
  padding: 0.1em 0.3em;
  border-radius: 5px;
  background: var(--brand-tint);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.9em;
}

@media (max-width: 1600px) {
  .hero-panel {
    grid-template-columns: 1.12fr 0.88fr;
  }

  .approval-strip {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .student-grid {
    gap: 10px;
  }

  .student-card {
    padding: 11px 12px 9px;
  }

  .student-display-name {
    font-size: 0.8rem;
  }

  .state-copy {
    font-size: 0.84rem;
  }
}

@media (max-width: 1280px) {
  .hero-panel {
    grid-template-columns: 1.08fr 0.92fr;
  }

  .teacher-dashboard {
    grid-template-columns: 1fr;
  }

  .teacher-approval-panel {
    grid-column: auto;
  }

  .approval-strip {
    grid-template-columns: 1fr;
    grid-template-areas:
      "copy"
      "metrics"
      "button";
  }

  .approval-button {
    min-width: 0;
    width: 100%;
  }

  .hero-steps {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-rows: 1fr;
  }

  .info-ribbon {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  }

  h1 {
    font-size: clamp(1.28rem, 1.5vw, 1.56rem);
  }

  .summary-copy {
    font-size: 0.78rem;
  }
}

@media (max-aspect-ratio: 16/9) {
  .stage {
    width: 100vw;
    height: calc(100vw * 9 / 16);
  }
}

@media (min-aspect-ratio: 16/9) {
  .stage {
    width: calc(100vh * 16 / 9);
    height: 100vh;
  }
}
