:root {
  --teacher-accent: #176b55;
  --teacher-danger: #b42318;
  --teacher-warning: #b54708;
}

.teacher-body { margin: 0; min-height: 100vh; color: var(--text); background: var(--bg); font-family: system-ui, sans-serif; }
.teacher-shell { width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding: 28px 0 64px; }
.teacher-login { width: min(420px, calc(100% - 32px)); margin: 12vh auto 0; padding: 28px; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; box-shadow: 0 18px 50px rgb(0 0 0 / 8%); }
.teacher-login h1, .teacher-title { margin: 0 0 8px; }
.teacher-muted { color: var(--muted-text, #667085); }
.teacher-error { color: var(--teacher-danger); min-height: 1.4em; }
.teacher-header, .teacher-actions, .teacher-tabs, .teacher-progress, .teacher-record-actions, .teacher-create-grid, .teacher-row-actions, .teacher-pagination { display: flex; align-items: center; gap: 10px; }
.teacher-header { justify-content: space-between; margin-bottom: 22px; }
.teacher-actions { flex-wrap: wrap; }
.teacher-tabs { margin: 18px 0; flex-wrap: wrap; }
.teacher-progress { flex-wrap: wrap; margin: 12px 0 20px; }
.teacher-progress span, .teacher-status { padding: 6px 10px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); font-size: 14px; }
.teacher-status.is-stale { color: var(--teacher-warning); border-color: #f5c27b; background: #fff8eb; }
.teacher-status.is-published { color: var(--teacher-accent); border-color: #9fd5c7; background: #effaf6; }
.teacher-card { padding: 20px; margin-bottom: 18px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; }
.teacher-card h2, .teacher-card h3 { margin-top: 0; }
.teacher-form label { display: grid; gap: 6px; margin-bottom: 14px; font-weight: 600; }
.teacher-form input, .teacher-form textarea, .teacher-form select { box-sizing: border-box; width: 100%; padding: 10px 12px; color: var(--text); background: var(--bg); border: 1px solid var(--border); border-radius: 9px; font: inherit; }
.teacher-form textarea { min-height: 150px; resize: vertical; font-family: ui-monospace, monospace; font-size: 13px; }
.teacher-create-grid { align-items: start; }
.teacher-create-grid > * { flex: 1 1 220px; }
.teacher-button { min-height: 40px; padding: 8px 14px; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 9px; cursor: pointer; font: inherit; font-weight: 650; }
.teacher-button:hover { border-color: var(--teacher-accent); }
.teacher-button.primary { color: white; background: var(--teacher-accent); border-color: var(--teacher-accent); }
.teacher-button.danger { color: var(--teacher-danger); }
.teacher-button.is-active { color: white; background: #344054; border-color: #344054; }
.teacher-button:disabled { cursor: not-allowed; opacity: .48; }
.teacher-class-group { margin-top: 24px; }
.teacher-class-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.teacher-class-card { display: grid; gap: 6px; padding: 18px; color: var(--text); text-align: left; background: var(--bg); border: 1px solid var(--border); border-radius: 12px; cursor: pointer; font: inherit; }
.teacher-class-card:hover { border-color: var(--teacher-accent); }
.teacher-class-card strong { font-size: 18px; }
.teacher-class-detail { margin-top: 18px; }
.teacher-draft-row { display: grid; grid-template-columns: 150px minmax(140px, 1fr) minmax(150px, auto) auto; gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--border); }
.teacher-lesson-table { display: grid; }
.teacher-lesson-head { padding: 0 0 10px; color: var(--muted-text, #667085); font-size: 13px; }
.teacher-lesson-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(105px, 1fr)); gap: 10px; align-items: center; padding: 12px 0; border-top: 1px solid var(--border); }
.teacher-row-actions { justify-content: flex-end; flex-wrap: wrap; }
.teacher-row-actions .teacher-button { min-height: 34px; padding: 6px 9px; font-size: 13px; }
.teacher-pagination { justify-content: center; margin-top: 16px; flex-wrap: wrap; }
.teacher-record-list { display: grid; gap: 12px; }
.teacher-record-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; padding: 14px; border: 1px solid var(--border); border-radius: 12px; }
.teacher-language { min-width: 0; }
.teacher-language strong, .teacher-language small { display: block; overflow-wrap: anywhere; }
.teacher-language small { margin-top: 5px; color: var(--muted-text, #667085); }
.teacher-record-actions { margin-top: 10px; flex-wrap: wrap; }
.teacher-recording { color: var(--teacher-danger); font-weight: 700; }
.teacher-share-result { width: min(100%, 720px); }
.teacher-preview .lesson-page { width: 100%; }
.teacher-not-recorded { color: var(--teacher-warning); font-size: 14px; font-weight: 650; }

@media (max-width: 760px) {
  .teacher-shell { width: min(100% - 20px, 1180px); padding-top: 16px; }
  .teacher-header { align-items: flex-start; }
  .teacher-draft-row { grid-template-columns: 1fr auto; }
  .teacher-draft-row > :nth-child(3) { grid-column: 1 / -1; }
  .teacher-record-row { grid-template-columns: 1fr; }
  .teacher-actions { align-items: stretch; }
  .teacher-lesson-head { display: none; }
  .teacher-lesson-row { grid-template-columns: 1fr 1fr; }
  .teacher-row-actions { grid-column: 1 / -1; justify-content: flex-start; }
}
