.teacher-app {
  --teacher-accent: #1f6b4e;
  --bg: #f6f8f7;
  --card: #ffffff;
  --card2: #f5f7f6;
  min-height: 100vh;
}

.teacher-app *, .teacher-app .eyebrow { letter-spacing: 0; }
html[data-theme="dark"] .teacher-app { --bg: #151b19; --card: #1e2823; --card2: #24312b; }
.teacher-app .sec-h { font-size: 30px; line-height: 1.2; }
.teacher-app .sec-lead { font: 15px/1.65 var(--sans); margin-bottom: 12px; }
.teacher-app .btn.ghost { background: var(--card); color: var(--ink); }
.teacher-app .paper-vault summary { cursor: pointer; font-size: 14px; font-weight: 700; }
.teacher-app .paper-vault[open] summary { margin-bottom: 14px; }
.teacher-app .saved-paper-actions { display: flex; align-items: center; }
.teacher-app .teacher-quality-note { margin-top: 16px; padding: 12px 0; border-block: 1px solid var(--line2); color: var(--ink3); font-size: 12px; line-height: 1.6; }
.teacher-app .dpp-panel { border: 0; border-radius: 0; box-shadow: none; background: none; padding-left: 0; }
.teacher-app .dppgrid { align-items: start; grid-template-columns: minmax(280px, 360px) minmax(0, 1fr); }
.teacher-app .worksheet { border-radius: 4px; }
.teacher-app .paper-details select { width: 100%; min-width: 0; min-height: 40px; color: var(--ink); background: var(--card); border: 1px solid var(--line2); border-radius: 6px; margin-top: 5px; padding: 6px; font: 12px var(--sans); }
.teacher-app .paper-check { display: flex; align-items: center; gap: 10px; margin: 12px 0; font-size: 13px; }
.teacher-app .paper-check input { accent-color: var(--teacher-accent); width: 18px; height: 18px; }
.teacher-app .wq-review { display: flex; align-items: start; gap: 12px; margin-bottom: 10px; font: 11px/1.5 var(--sans); color: var(--ink3); }
.teacher-app .wq-review span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.teacher-app .worksheet .wq-review, .teacher-app .ws-disclaimer { color: #52635a; }
.teacher-app .wq-review button { flex: 0 0 auto; font: inherit; }
.teacher-app .paper-warning { color: #884b08; background: #fff5dc; padding: 12px; font-size: 13px; line-height: 1.6; }
.teacher-app .ws-disclaimer { margin-top: 8px; font: 10px var(--sans); color: var(--ink3); }
.teacher-app .dpp-preview { min-width: 0; }
.teacher-app .preview-actions { flex-wrap: wrap; }
.teacher-app :focus-visible { outline: 2px solid var(--teacher-accent); outline-offset: 3px; }
.teacher-app .dpp-preview-bar { flex-wrap: wrap; }
@media (max-width: 850px) {
  .teacher-app .dppgrid { grid-template-columns: minmax(0, 1fr); }
  .teacher-app .paper-vault-head { flex-wrap: wrap; }
  .teacher-app .paper-details { grid-template-columns: minmax(0, 1fr) minmax(100px, 0.7fr); }
  .teacher-app .sec-h { font-size: 25px; }
}
@media print {
  body.teacher-app { background: #fff !important; }
  .teacher-app .wq-review, .teacher-app .paper-warning { display: none !important; }
  .teacher-app .wq { break-inside: avoid; }
  .teacher-app .ws-sec-h, .teacher-app .ws-sec-rules { break-after: avoid; }
  .teacher-app .wq-opts, .teacher-app .wsol-mn { break-inside: avoid; }
  .teacher-app .wsol-mn { break-after: avoid; }
}

.teacher-app .teacher-nav .brand > span:last-child {
  display: flex;
  align-items: baseline;
  gap: 5px;
}

.teacher-app .teacher-nav .brand small {
  color: var(--ink3);
  font-family: var(--sans);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.teacher-app .teacher-workspace {
  min-height: calc(100vh - 150px);
}

.teacher-app .teacher-workspace .sec-lead {
  max-width: 900px;
}

.teacher-app .teacher-title-row,
.teacher-app .paper-vault-head,
.teacher-app .saved-paper,
.teacher-app .dpp-preview-bar,
.teacher-app .preview-actions,
.teacher-app .chapter-tools {
  display: flex;
  align-items: center;
}

.teacher-app .teacher-title-row {
  justify-content: space-between;
  gap: 28px;
}

.teacher-app .teacher-title-row > div {
  min-width: 0;
}

.teacher-app .paper-vault {
  margin: 28px 0 4px;
  padding: 18px 0;
  border-top: 1px solid var(--line2);
  border-bottom: 1px solid var(--line2);
}

.teacher-app .paper-vault-head {
  justify-content: space-between;
  gap: 18px;
}

.teacher-app .paper-vault-head .dlabel {
  margin-bottom: 3px;
}

.teacher-app .paper-vault-head p,
.teacher-app .paper-vault-empty {
  margin: 0;
  color: var(--ink3);
  font-size: 13px;
  line-height: 1.45;
}

.teacher-app .count-pill {
  flex: 0 0 auto;
  border: 1px solid var(--line2);
  border-radius: 999px;
  padding: 5px 10px;
  color: var(--teacher-accent);
  background: var(--card);
  font-size: 11px;
  font-weight: 800;
}

.teacher-app .paper-vault-empty {
  padding-top: 14px;
}

.teacher-app .paper-vault-list {
  margin-top: 12px;
  max-height: 208px;
  overflow-y: auto;
  border-top: 1px solid var(--line);
}

.teacher-app .saved-paper {
  justify-content: space-between;
  gap: 16px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}

.teacher-app .saved-paper > div:first-child {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.teacher-app .saved-paper b {
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.teacher-app .saved-paper span {
  margin-top: 2px;
  color: var(--ink3);
  font-size: 11px;
}

.teacher-app .saved-paper-actions,
.teacher-app .preview-actions,
.teacher-app .chapter-tools {
  gap: 8px;
}

.teacher-app .paper-delete {
  width: 30px;
  height: 30px;
  color: var(--ink3);
  font-size: 20px;
}

.teacher-app .paper-delete:hover {
  color: #a52a22;
}

.teacher-app .paper-details {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 132px;
  gap: 9px;
}

.teacher-app .paper-details label {
  color: var(--ink3);
  font-size: 11px;
  font-weight: 700;
}

.teacher-app .paper-details input,
.teacher-app .chapter-tools input {
  width: 100%;
  min-height: 39px;
  margin-top: 5px;
  border: 1px solid var(--line2);
  border-radius: 7px;
  outline: 0;
  background: var(--card2);
  color: var(--ink);
  padding: 8px 10px;
  font: inherit;
  font-size: 13px;
}

.teacher-app .paper-details input:focus,
.teacher-app .chapter-tools input:focus {
  border-color: var(--teacher-accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--teacher-accent) 12%, transparent);
}

.teacher-app .subject-chips.compact {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
}

.teacher-app .subject-chips.compact .subject-chip {
  min-width: 0;
  padding: 8px 5px;
  border-radius: 7px;
  font-size: 12px;
}

.teacher-app .subject-chips.compact .subject-chip.on {
  background: var(--teacher-accent);
  box-shadow: none;
}

.teacher-app .chapter-tools {
  align-items: flex-end;
  margin-bottom: 8px;
}

.teacher-app .chapter-tools input {
  flex: 1 1 150px;
  margin-top: 0;
}

.teacher-app .chapter-tools .text-button {
  flex: 0 0 auto;
  color: var(--teacher-accent);
  white-space: nowrap;
}

.teacher-app .chips-scroll {
  max-height: 220px;
  scrollbar-width: thin;
}

.teacher-app .filtered-out {
  display: none !important;
}

.teacher-app .selection-note {
  margin-top: 7px;
  color: var(--ink3);
  font-size: 11px;
  font-weight: 700;
}

.teacher-app .eligible-count {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: center;
  margin: 18px 0 2px;
  padding: 12px 0;
  border-top: 1px solid var(--line2);
  border-bottom: 1px solid var(--line2);
}

.teacher-app .eligible-count b {
  color: var(--teacher-accent);
  font-family: var(--serif);
  font-size: 25px;
  line-height: 1;
}

.teacher-app .eligible-count span {
  color: var(--ink3);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.3;
}

.teacher-app .dpp-preview-bar > div:first-child {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.teacher-app .dpp-preview-bar > div:first-child b,
.teacher-app .dpp-preview-bar > div:first-child span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.teacher-app .dpp-preview-bar > div:first-child span {
  margin-top: 2px;
  color: var(--ink3);
  font-size: 11px;
}

.teacher-app .mobile-cta,
.teacher-app .pal-switch {
  display: none;
}

@media (max-width: 560px) {
  .teacher-app {
    padding-bottom: 0;
  }

  .teacher-app .teacher-nav .brand small {
    display: none;
  }

  .teacher-app .teacher-nav .btn {
    display: none;
  }

  .teacher-app .teacher-title-row,
  .teacher-app .paper-vault-head,
  .teacher-app .saved-paper,
  .teacher-app .dpp-preview-bar {
    align-items: flex-start;
    flex-direction: column;
  }

  .teacher-app .teacher-title-row .btn,
  .teacher-app .preview-actions,
  .teacher-app .preview-actions .btn {
    width: 100%;
  }

  .teacher-app .paper-details {
    grid-template-columns: 1fr;
  }

  .teacher-app .subject-chips.compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .teacher-app .chapter-tools {
    align-items: stretch;
    flex-wrap: wrap;
  }

  .teacher-app .chapter-tools input {
    flex-basis: 100%;
  }
}
