:root {
  color-scheme: light;
  --paper: #f6f5ef;
  --ink: #252f2b;
  --muted: #626c65;
  --line: #d9ded5;
  --green: #215d49;
  --white: #fff;
  --red: #8a332d;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Trebuchet MS", Verdana, sans-serif;
  font-size: 15px;
  line-height: 1.55;
}
button,
input,
textarea {
  font: inherit;
}
button,
a,
input,
textarea {
  touch-action: manipulation;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}
[hidden] {
  display: none !important;
}
a {
  color: var(--green);
}
:focus-visible {
  outline: 3px solid #a65d20;
  outline-offset: 4px;
}
h1,
h2,
p {
  margin-top: 0;
}
h1 {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 400;
  font-size: clamp(34px, 4vw, 54px);
  line-height: 1.1;
  letter-spacing: -1.6px;
  margin-bottom: 24px;
}
h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 27px;
  font-weight: 400;
  line-height: 1.2;
}
small {
  font-size: 11px;
}
.layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: 100vh;
}
.sidebar {
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line);
  padding: 34px 26px;
  background: #ecefe7;
}
.brand {
  display: flex;
  gap: 13px;
  align-items: center;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.5px;
}
.brand small {
  display: block;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--muted);
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 43px;
  height: 43px;
  background: var(--green);
  color: white;
  font-family: Georgia, serif;
  font-weight: 400;
  font-size: 27px;
}
.sidebar-caption {
  font-size: 10px;
  letter-spacing: 1.5px;
  margin: 55px 0 15px;
  color: var(--muted);
}
nav {
  display: grid;
  gap: 8px;
}
nav button {
  border: 0;
  background: none;
  text-align: left;
  color: var(--muted);
  padding: 12px 10px;
}
nav button span {
  font-size: 11px;
  margin-right: 14px;
}
nav button[aria-current] {
  background: var(--green);
  color: white;
}
nav button:hover:not([aria-current]) {
  background: #dce4d9;
}
.sidebar-note {
  font-size: 12px;
  color: var(--muted);
  margin: 26px 0;
  max-width: 190px;
}
.account {
  border-top: 1px solid #cbd3c8;
  margin-top: auto;
  padding-top: 20px;
  display: grid;
  gap: 3px;
  overflow-wrap: anywhere;
}
.account span {
  font-size: 12px;
  color: var(--muted);
}
.sidebar-footer {
  font-size: 10px;
  color: var(--muted);
  margin-top: 28px;
}
main {
  padding: 0 6vw 40px;
  min-width: 0;
}
.topbar {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  border-bottom: 1px solid var(--line);
  padding: 28px 0;
  font-size: 10px;
  letter-spacing: 1.3px;
  color: var(--muted);
}
.restricted {
  color: var(--green);
}
.startup {
  margin-top: 60px;
  color: var(--muted);
}
.auth-view {
  max-width: 610px;
  padding: 65px 0 24px;
}
.eyebrow {
  color: var(--green);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.7px;
  margin-bottom: 17px;
}
.intro {
  color: var(--muted);
  max-width: 630px;
  font-size: 15px;
}
.auth-form {
  max-width: 400px;
  margin-top: 32px;
  display: grid;
  gap: 10px;
}
label {
  font-size: 12px;
  font-weight: 700;
}
input,
textarea {
  width: 100%;
  border: 1px solid #abb6ad;
  background: var(--white);
  border-radius: 3px;
  padding: 11px 12px;
  color: var(--ink);
}
.auth-form input {
  margin-bottom: 10px;
}
.primary,
.secondary {
  min-height: 43px;
  border-radius: 3px;
  padding: 10px 17px;
  transition: background 0.12s;
}
.primary {
  border: 1px solid var(--green);
  background: var(--green);
  color: var(--white);
}
.primary:hover:not(:disabled) {
  background: #174332;
}
.primary span {
  float: right;
  margin-left: 20px;
}
.secondary {
  background: transparent;
  border: 1px solid #b7c2b8;
  color: var(--ink);
}
.secondary:hover:not(:disabled) {
  background: #e6ebe1;
}
.text-button {
  border: 0;
  background: none;
  padding: 8px 0;
  font-size: 12px;
  color: var(--green);
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 4px;
}
.fine-print {
  font-size: 12px;
  color: var(--muted);
  margin: 18px 0;
  max-width: 650px;
}
.enrollment {
  border-left: 3px solid var(--green);
  background: #e9eee5;
  padding: 22px;
  max-width: 530px;
  margin: 24px 0;
}
.enrollment h2 {
  font-size: 22px;
}
.enrollment p {
  font-size: 13px;
}
.enrollment input {
  font-family: monospace;
  font-size: 13px;
  margin: 8px 0;
  letter-spacing: 1px;
}
.notice {
  margin: 24px 0 0;
  border-left: 3px solid var(--green);
  background: #e5ece1;
  padding: 13px 16px;
  overflow-wrap: anywhere;
}
.notice[data-error="true"] {
  border-color: var(--red);
  background: #f4e6e0;
  color: #6e2a25;
}
.page-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-top: 46px;
}
.page-heading h1 {
  font-size: 43px;
  margin-bottom: 10px;
}
.list-header {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  border-bottom: 1px solid var(--line);
  margin-top: 38px;
  padding: 15px 0;
  font-size: 11px;
  color: var(--muted);
}
#list-label {
  font-size: 10px;
  letter-spacing: 1.2px;
}
.table-wrap {
  overflow-x: auto;
}
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 13px;
}
th {
  text-align: left;
  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
  padding: 17px 13px;
  border-bottom: 1px solid var(--line);
}
td {
  padding: 20px 13px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
th:first-child,
td:first-child {
  padding-left: 0;
}
td:last-child {
  text-align: right;
}
#audit-table td:last-child {
  text-align: left;
}
td strong {
  display: block;
  font-size: 14px;
  font-weight: 700;
}
td small {
  display: block;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.status {
  display: inline-block;
  border-radius: 3px;
  padding: 4px 9px;
  font-size: 11px;
  white-space: nowrap;
  background: #e5e8e2;
  color: #4e5951;
}
.status-active {
  background: #dae9dc;
  color: #204e34;
}
.status-inactive {
  background: #f0e0d7;
  color: #793c2e;
}
.row-action {
  font-size: 12px;
  padding: 7px 12px;
  min-height: 36px;
  white-space: nowrap;
}
.reference {
  max-width: 260px;
  overflow-wrap: anywhere;
  font-size: 11px;
  color: var(--muted);
}
.empty-state {
  padding: 38px 0;
  color: var(--muted);
}
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin-top: 24px;
  font-size: 11px;
  color: var(--muted);
}
.pagination div {
  display: flex;
  gap: 8px;
}
.pagination button {
  min-height: 38px;
  font-size: 12px;
}
dialog {
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--paper);
  padding: 30px;
  max-width: 500px;
  width: calc(100% - 32px);
  color: var(--ink);
}
dialog::backdrop {
  background: rgb(22 35 27 / 0.55);
}
#dialog-student {
  font-weight: 700;
  overflow-wrap: anywhere;
}
#dialog-description {
  font-size: 13px;
  color: var(--muted);
}
.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
}
.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-link {
  position: absolute;
  top: -100px;
  left: 15px;
  background: white;
  padding: 12px;
  z-index: 10;
}
.skip-link:focus {
  top: 15px;
}
.sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100dvh;
  overflow-y: auto;
}
.catalog-form {
  max-width: 650px;
  border: 1px solid var(--line);
  padding: 24px;
  margin: 24px 0;
  display: grid;
  gap: 10px;
}
.catalog-form label {
  display: block;
}
.catalog-form .editor-actions {
  margin: 10px 0;
}
.catalog-form p {
  margin-bottom: 0;
}
@media (max-width: 620px) {
  nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .catalog-form {
    padding: 16px;
  }
}
.editor-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin: 20px 0;
}
.editor-actions button,
#add-chunk {
  min-height: 44px;
}
.chunk-editor {
  border: 1px solid var(--line);
  padding: 18px;
  margin: 18px 0;
  min-width: 0;
  display: grid;
  gap: 8px;
}
.chunk-editor legend {
  color: var(--green);
  padding: 0 8px;
}
.chunk-editor button {
  justify-self: start;
  margin-top: 12px;
}
#draft-editor > textarea {
  margin-top: 8px;
}
#draft-editor h3 {
  margin-top: 28px;
}
#edit-state {
  overflow-wrap: anywhere;
  color: var(--red);
}
@media (max-width: 620px) {
  .editor-actions {
    display: grid;
  }
  .editor-actions button {
    width: 100%;
  }
  .chunk-editor {
    padding: 12px;
  }
}
.lessons-list {
  display: grid;
}
.lesson-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
  padding: 22px 0;
}
.lesson-card h2 {
  font-size: 23px;
  margin: 0 0 6px;
  overflow-wrap: anywhere;
}
.lesson-card p {
  font-size: 12px;
  color: var(--muted);
  margin: 0;
  overflow-wrap: anywhere;
}
.lesson-card button {
  flex-shrink: 0;
  min-height: 44px;
}
#lesson-review {
  padding-bottom: 30px;
}
#lesson-review .eyebrow {
  margin-top: 30px;
}
#lesson-title {
  overflow-wrap: anywhere;
}
.version-controls {
  display: flex;
  gap: 12px;
  margin: 8px 0 20px;
  flex-wrap: wrap;
}
select {
  font: inherit;
  min-height: 44px;
  max-width: 100%;
  padding: 10px;
  border: 1px solid #abb6ad;
  background: white;
  color: var(--ink);
  border-radius: 3px;
}
.transcript {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: white;
  border: 1px solid var(--line);
  padding: 24px;
  margin-bottom: 24px;
  max-height: 65vh;
  overflow: auto;
}
#lesson-fragments {
  border-bottom: 1px solid var(--line);
  padding-bottom: 20px;
}
summary {
  cursor: pointer;
  min-height: 44px;
  padding: 10px 0;
  color: var(--green);
}
#lesson-chunks {
  padding-left: 24px;
}
#lesson-chunks li {
  padding: 14px 0;
  overflow-wrap: anywhere;
}
#lesson-chunks p {
  white-space: pre-wrap;
  margin: 6px 0;
}
.review-check {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  min-height: 44px;
  margin: 20px 0;
}
.review-check input {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}
#publish-form {
  padding-top: 10px;
}
#publish-lesson {
  min-height: 44px;
}
@media (max-width: 620px) {
  nav button span {
    display: none;
  }
  nav button {
    min-height: 44px;
  }
  .lesson-card {
    align-items: flex-start;
    gap: 12px;
  }
  .lesson-card h2 {
    font-size: 20px;
  }
  .transcript {
    padding: 16px;
    max-height: none;
  }
  #lesson-review .page-heading {
    flex-wrap: wrap;
    gap: 12px;
  }
  #lesson-review .page-heading button {
    min-height: 44px;
  }
  .version-controls {
    display: grid;
  }
  .version-controls select {
    width: 100%;
  }
  #publish-lesson {
    width: 100%;
  }
}
@media (max-width: 850px) {
  .layout {
    grid-template-columns: 200px minmax(0, 1fr);
  }
  .sidebar {
    padding: 25px 18px;
  }
  main {
    padding-right: 25px;
    padding-left: 25px;
  }
  .brand {
    font-size: 18px;
  }
  .brand small {
    font-size: 9px;
  }
  .auth-view {
    padding-top: 40px;
  }
}
@media (max-width: 620px) {
  .layout {
    display: block;
  }
  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 18px 20px;
  }
  .sidebar-caption,
  .sidebar-note,
  .sidebar-footer {
    display: none;
  }
  .brand {
    font-size: 19px;
  }
  .brand small {
    font-size: 10px;
  }
  nav {
    display: flex;
    margin-top: 18px;
    gap: 8px;
  }
  nav button {
    flex: 1;
    padding: 10px;
  }
  .account {
    margin-top: 15px;
    padding-top: 12px;
    grid-template-columns: 1fr auto;
    align-items: center;
  }
  .account span {
    grid-row: 2;
  }
  .account button {
    grid-column: 2;
    grid-row: 1/3;
  }
  main {
    padding: 0 20px 32px;
  }
  .topbar {
    padding: 18px 0;
    font-size: 9px;
  }
  .auth-view {
    padding-top: 32px;
  }
  .page-heading {
    margin-top: 30px;
  }
  .page-heading h1 {
    font-size: 35px;
  }
  h1 {
    letter-spacing: -1px;
  }
  .intro {
    font-size: 14px;
  }
  th,
  td {
    padding: 15px 9px;
  }
  #students-table {
    min-width: 510px;
  }
  #audit-table {
    min-width: 530px;
  }
  .pagination {
    align-items: flex-start;
  }
  .enrollment {
    padding: 17px;
  }
  .notice {
    font-size: 13px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}
@media (max-width: 620px) {
  .sidebar {
    position: static;
    height: auto;
    overflow-y: visible;
  }
}
@media (max-width: 620px) {
  nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.support-filters {
  display: flex;
  gap: 24px;
  align-items: center;
  flex-wrap: wrap;
  margin: 24px 0;
}
.support-filters label {
  display: block;
}
.support-filters select {
  display: block;
  margin-top: 8px;
}
.support-filters .review-check {
  display: flex;
}
#support-reason {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
#support-view button {
  min-height: 44px;
}
#support-view .lesson-card > div {
  min-width: 0;
}
#support-view .page-heading {
  flex-wrap: wrap;
}
@media (max-width: 620px) {
  #support-view .lesson-card {
    display: grid;
  }
  #support-view .lesson-card button {
    justify-self: start;
  }
  .support-filters {
    display: grid;
    gap: 8px;
  }
  .support-filters select {
    width: 100%;
  }
}
/* Literal CSV preview: bounded cards stay readable without horizontal tables. */
.import-row {
  padding: 1rem 0;
  border-bottom: 1px solid var(--line, #ddd9ce);
  overflow-wrap: anywhere;
}
.import-row h2 {
  font-size: 1.1rem;
}
