:root {
  /* Tells the browser this page is intentionally dark-themed (matching
     the Digital Opus Tools hub brand — digitalopusadsolutions.com — so
     this product looks consistent once hosted alongside it), so Chrome/
     OS "auto dark/light mode" doesn't selectively re-color elements
     against the author's intent. Worksheet OUTPUT content (.sheet and
     everything inside it) intentionally stays light/white regardless —
     see the .sheet rule below — since a teacher printing a worksheet
     wants readable text on white paper, not a dark-mode PDF. */
  color-scheme: dark;
  --ink: #f4f7f4;
  --paper: #1b211b;
  --paper-hover: #222a22;
  --muted: #aab4aa;
  --line: #343e34;
  --accent: #8ab681;
  --accent-dark: #6e9a66;
  --bg: #111511;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--ink);
}

.app {
  display: grid;
  grid-template-columns: 300px 1fr;
  min-height: 100vh;
}

/* ---------- Resource picker (replaces the old flat dropdown) ---------- */
#picker-screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 60px 20px;
}

.picker-header { text-align: center; margin-bottom: 6px; }
.picker-header h1 { font-size: 26px; margin: 0 0 6px; }
.picker-header .sub { color: var(--muted); margin: 0 0 34px; }
.picker-header .back-btn { padding: 0 0 10px; }

#picker-screen .search-wrap { width: 100%; max-width: 420px; margin-bottom: 40px; }
#picker-screen .search-box {
  width: 100%;
  padding: 11px 16px;
  font-size: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  color: var(--ink);
  box-sizing: border-box;
}
#picker-screen .search-box:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(138, 182, 129, 0.45); }

#my-class-panel { width: 100%; max-width: 420px; margin-bottom: 24px; background: var(--paper); }
#my-class-panel summary { display: flex; align-items: baseline; gap: 6px; }
#my-class-summary-label { font-weight: 400; color: var(--muted); }

#picker-sections { width: 100%; max-width: 980px; }

.picker-section { width: 100%; margin-bottom: 36px; }
.picker-section h3 {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 14px;
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 6px;
}
.picker-section h3::before { content: "▾"; font-size: 10px; }
.picker-section.collapsed h3::before { content: "▸"; }
.picker-section.collapsed .picker-cards { display: none; }

.picker-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  width: 100%;
}

button.picker-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 24px 20px;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  transition: transform .15s, border-color .15s;
}
button.picker-card:hover,
button.picker-card:focus-visible {
  transform: translateY(-3px);
  border-color: var(--accent);
  outline: none;
}
button.picker-card:focus-visible { box-shadow: 0 0 0 3px rgba(138, 182, 129, 0.45); }
button.picker-card { position: relative; }
button.picker-card .picker-icon { font-size: 26px; }
button.picker-card h2 { font-size: 16px; margin: 0; }
button.picker-card p { font-size: 13px; color: var(--muted); margin: 0; line-height: 1.4; }

.picker-star {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 18px;
  line-height: 1;
  color: var(--line);
  cursor: pointer;
  user-select: none;
  padding: 2px;
}
.picker-star:hover,
.picker-star:focus-visible { color: var(--accent); outline: none; }
.picker-star:focus-visible { box-shadow: 0 0 0 3px rgba(138, 182, 129, 0.45); border-radius: 4px; }
.picker-star.is-favorite { color: #e0a72e; }

.no-results { color: var(--muted); font-size: 14px; text-align: center; margin-top: -14px; margin-bottom: 30px; }
.search-count { color: var(--muted); font-size: 13px; text-align: center; margin-top: -14px; margin-bottom: 30px; }

/* ---------- Group filter banner (focused single-category view) ---------- */
#picker-group-banner {
  width: 100%;
  max-width: 980px;
  margin-bottom: 24px;
}
#picker-group-banner .back-btn {
  padding: 0 0 4px;
}
#picker-group-banner h2 {
  font-size: 22px;
  margin: 0;
}

/* ---------- Favorites / recently used rows ---------- */
#picker-favorites, #picker-recent, #picker-packs { width: 100%; max-width: 980px; margin-bottom: 8px; }

#pack-screen { min-height: 100vh; display: flex; flex-direction: column; align-items: center; padding: 60px 20px; }
.pack-shared-fields { width: 100%; max-width: 560px; margin-bottom: 30px; }
.pack-shared-fields .field { margin-bottom: 14px; }
.pack-shared-fields label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
.pack-shared-fields input, .pack-shared-fields textarea {
  width: 100%; padding: 8px 10px; font: inherit; font-size: 14px;
  border: 1px solid var(--line); border-radius: 6px; background: var(--paper); color: var(--ink);
}
.pack-steps { width: 100%; max-width: 560px; display: flex; flex-direction: column; gap: 10px; }
.pack-step {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 18px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper);
}
.pack-step-label { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.pack-step-icon { font-size: 18px; }
.picker-cards-recent { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.picker-cards-recent .picker-card { padding: 14px 16px; flex-direction: row; align-items: center; gap: 10px; }
.picker-cards-recent .picker-icon { font-size: 18px; }
.picker-cards-recent h2 { font-size: 13px; }

.back-btn {
  width: auto;
  display: inline-block;
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  padding: 0 0 14px;
  cursor: pointer;
  text-align: left;
}
.back-btn:hover { color: var(--accent-dark); text-decoration: underline; }

/* ---------- Controls panel ---------- */
.controls {
  background: var(--paper);
  border-right: 1px solid var(--line);
  padding: 20px;
  overflow-y: auto;
  position: sticky;
  top: 0;
  align-self: start;
  max-height: 100vh;
}

.controls h1 {
  font-size: 18px;
  margin: 0 0 16px;
}

.field {
  margin-bottom: 14px;
}

.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 4px;
}

.field select,
.field input[type="text"],
.field input[type="number"] {
  width: 100%;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 14px;
  background: var(--paper);
  color: var(--ink);
}

.opts {
  border: 1px solid var(--line);
  border-radius: 8px;
  margin: 0 0 16px;
  padding: 10px 12px 14px;
}

.hidden { display: none !important; }

.opts legend {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  padding: 0 4px;
}

.check {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  margin: 6px 0;
  font-weight: 400;
  color: var(--ink);
}

.check input { margin: 0; }

hr {
  border: none;
  border-top: 1px solid var(--line);
  margin: 16px 0;
}

.btn {
  display: block;
  width: 100%;
  padding: 9px 10px;
  margin-bottom: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.btn:hover { background: var(--paper-hover); }

.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.btn.primary:hover { background: var(--accent-dark); }

/* ---------- Worksheet display ---------- */
.sheet-wrap {
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  align-items: center;
}

.sheet {
  /* Worksheet output always simulates white paper, independent of the
     site's dark chrome theme — every nested rule in this file that
     reads --ink/--paper/--muted/--line/--accent/--accent-dark (tables,
     certificates, tickets, etc.) inherits these light values through
     the CSS custom property cascade, so nothing else needs touching. */
  --ink: #1f2430;
  --paper: #ffffff;
  --muted: #6b7280;
  --line: #d8dce3;
  --accent: #2f6f4f;
  --accent-dark: #21503a;
  --bg: #eef1f5;
  background: var(--paper);
  color: var(--ink);
  width: 100%;
  max-width: 850px;
  padding: 40px 48px;
  border-radius: 4px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 8px 24px rgba(0,0,0,0.06);
}

.answerkey-only {
  border: 2px dashed var(--line);
}

.sheet-header h2 {
  margin: 0 0 10px;
  font-size: 24px;
}

.name-line {
  display: flex;
  gap: 28px;
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.problems {
  margin: 0;
  padding-left: 0;
  list-style: none;
  display: grid;
  gap: 14px 24px;
}

.problems.cols-1 { grid-template-columns: 1fr; }
.problems.cols-2 { grid-template-columns: 1fr 1fr; }
.problems.cols-3 { grid-template-columns: 1fr 1fr 1fr; }

.problem {
  font-size: 16px;
  display: flex;
  gap: 8px;
  align-items: baseline;
}

.problem .num {
  color: var(--muted);
  font-weight: 600;
  min-width: 22px;
}

.problem .answer {
  color: var(--accent-dark);
  font-weight: 700;
  margin-left: 6px;
}

.problem .answer.hidden-answer { display: none; }
.show-answers-onscreen .problem .answer.hidden-answer { display: inline; }

.geo-figure {
  font-size: 13px;
  color: var(--muted);
  display: block;
}

/* ---------- Walkthroughs ---------- */
.walkthrough-only {
  border: 2px dashed var(--line);
}

.walkthrough-list {
  margin: 0;
  padding-left: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.wt-item {
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
}

.wt-item:last-child { border-bottom: none; }

.wt-q {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 6px;
  display: flex;
  gap: 8px;
}

.wt-q .num { color: var(--muted); min-width: 22px; }

.wt-steps {
  margin: 4px 0 6px 30px;
  padding-left: 18px;
  font-size: 13px;
  color: var(--ink);
  line-height: 1.5;
}

.wt-steps li { margin-bottom: 2px; }

.wt-answer {
  margin-left: 30px;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-dark);
}

/* ---------- Quick check tickets ---------- */
.field textarea {
  width: 100%;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
  background: var(--paper);
  color: var(--ink);
  resize: vertical;
}

.ticket-grid {
  display: grid;
  gap: 16px;
}

.ticket-grid.cols-1 { grid-template-columns: 1fr; }
.ticket-grid.cols-2 { grid-template-columns: 1fr 1fr; }
.ticket-grid.cols-4 { grid-template-columns: 1fr 1fr; grid-auto-rows: 1fr; }

.ticket {
  border: 2px dashed var(--line);
  border-radius: 8px;
  padding: 14px 16px;
}

.ticket h3 { margin: 0 0 8px; font-size: 14px; }
.ticket .name-line { font-size: 11px; margin-bottom: 10px; gap: 14px; }
.ticket ol { margin: 0; padding-left: 18px; font-size: 13px; }
.ticket ol li { margin-bottom: 10px; }

/* ---------- Rubric table ---------- */
.rubric-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.rubric-table th, .rubric-table td {
  border: 1px solid var(--line);
  padding: 10px;
  text-align: left;
  vertical-align: top;
}

.rubric-table th { background: var(--bg); font-weight: 700; }
.rubric-table td:first-child { font-weight: 600; width: 22%; }
.rubric-table td:not(:first-child) { height: 60px; }

/* ---------- Certificate ---------- */
.certificate {
  border: 10px double var(--accent);
  border-radius: 6px;
  padding: 60px 50px;
  text-align: center;
}

.certificate .cert-title {
  font-size: 32px;
  font-weight: 700;
  color: var(--accent-dark);
  margin: 0 0 8px;
  letter-spacing: 0.03em;
}

.certificate .cert-sub { color: var(--muted); font-size: 14px; margin-bottom: 36px; }
.certificate .cert-presented { font-size: 15px; color: var(--muted); }
.certificate .cert-name {
  font-size: 40px;
  font-weight: 700;
  margin: 12px 0 24px;
  border-bottom: 2px solid var(--line);
  display: inline-block;
  padding: 0 20px 8px;
}
.certificate .cert-achievement { font-size: 16px; max-width: 500px; margin: 0 auto 40px; line-height: 1.5; }
.certificate .cert-footer { display: flex; justify-content: space-around; margin-top: 30px; }
.certificate .cert-footer div { border-top: 1px solid var(--ink); padding-top: 6px; font-size: 12px; color: var(--muted); width: 160px; }

/* ---------- Study guide ---------- */
.study-list { display: flex; flex-direction: column; gap: 10px; }
.study-item { display: grid; grid-template-columns: 160px 1fr; gap: 12px; border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.study-item .term { font-weight: 700; }
.study-item .notes { color: var(--ink); }
.study-item .blank-line { border-bottom: 1px solid var(--ink); min-width: 120px; }

/* ---------- Classroom signs ---------- */
.sign-sheet { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 500px; }
.sign-main { font-size: 72px; font-weight: 800; text-align: center; color: var(--accent-dark); line-height: 1.15; }
.sign-sub { font-size: 22px; text-align: center; color: var(--muted); margin-top: 16px; }

/* ---------- Name tags ---------- */
.nametag-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.nametag-card {
  border: 2px dashed var(--line);
  border-radius: 12px;
  padding: 24px 16px;
  text-align: center;
  min-height: 140px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.nametag-name { font-size: 26px; font-weight: 700; color: var(--accent-dark); }
.nametag-sub { font-size: 13px; color: var(--muted); margin-top: 6px; }

/* ---------- Hall passes ---------- */
.hallpass-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.hallpass-card { border: 2px dashed var(--line); border-radius: 10px; padding: 16px; }
.hallpass-title { font-weight: 700; font-size: 16px; color: var(--accent-dark); }
.hallpass-type { font-size: 14px; margin: 4px 0 12px; color: var(--muted); font-weight: 600; }
.hallpass-field { font-size: 13px; margin-bottom: 10px; }

/* ---------- Behavior chart ---------- */
.behavior-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.behavior-table th, .behavior-table td { border: 1px solid var(--line); padding: 10px; text-align: center; }
.behavior-table th { background: var(--bg); font-weight: 700; }
.behavior-table td:first-child { text-align: left; font-weight: 600; }
.behavior-table td:not(:first-child) { height: 36px; }

/* ---------- Reward chart ---------- */
.reward-chart { text-align: center; padding: 60px 0; }
.reward-name { font-size: 26px; font-weight: 700; color: var(--accent-dark); margin-bottom: 24px; }
.reward-boxes { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.reward-box { width: 50px; height: 50px; border: 2px solid var(--ink); border-radius: 8px; }

/* ---------- Desk labels ---------- */
.desk-label-stack { display: flex; flex-direction: column; gap: 14px; }
.desk-label {
  border: 2px dashed var(--line);
  border-radius: 8px;
  padding: 12px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.desk-label-name { font-size: 22px; font-weight: 700; color: var(--accent-dark); }
.desk-label-sub { font-size: 13px; color: var(--muted); }

/* ---------- Bulletin board letters ---------- */
.bulletin-letter {
  font-size: 380px;
  font-weight: 800;
  text-align: center;
  line-height: 1;
  padding: 80px 0;
  color: var(--ink);
}

/* ---------- Attendance sheet ---------- */
.attendance-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.attendance-table th, .attendance-table td { border: 1px solid var(--line); padding: 5px; text-align: center; }
.attendance-table th { background: var(--bg); font-weight: 700; }
.attendance-table td:first-child, .attendance-table th:first-child { text-align: left; font-weight: 600; min-width: 110px; }
.attendance-table td:not(:first-child) { height: 24px; width: 20px; }

/* ---------- Seating chart ---------- */
.seating-grid {
  display: grid;
  gap: 14px;
  margin-top: 10px;
}

.desk-box {
  border: 2px solid var(--line);
  border-radius: 8px;
  padding: 16px 8px;
  text-align: center;
  font-weight: 700;
  font-size: 14px;
  color: var(--accent-dark);
  background: var(--bg);
}

.group-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin-top: 10px;
}

.group-box {
  border: 2px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  background: var(--bg);
}

.group-box h3 {
  margin: 0 0 8px;
  font-size: 14px;
  color: var(--accent-dark);
}

.group-box ul {
  margin: 0;
  padding-left: 18px;
  font-size: 13px;
}

/* ---------- Live tools (Random Picker, Timer) — dark app chrome, not
   the white-paper .sheet look every printable tool uses, since these
   never print. ---------- */
.live-panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 40px;
  max-width: 480px;
  width: 100%;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.rp-display {
  font-size: 32px;
  font-weight: 800;
  color: var(--ink);
  min-height: 44px;
}

.rp-status {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

.tm-display {
  font-size: 56px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

.tm-display.tm-done {
  color: #e05252;
}

.cs-panel { width: 100%; max-width: 1000px; }
.cs-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; width: 100%; justify-items: center; }
@media (max-width: 900px) {
  .cs-grid { grid-template-columns: 1fr; }
}

.tm-controls {
  display: flex;
  gap: 10px;
}

/* ---------- Exit ticket styles (3-2-1 / rating / single question) ---------- */
.blank-line { border-bottom: 1px solid var(--ink); min-height: 20px; margin-bottom: 8px; }

.ticket-321 { display: flex; flex-direction: column; gap: 12px; font-size: 12px; }
.ticket-321-row { display: flex; flex-direction: column; gap: 4px; }
.ticket-321-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  margin-right: 6px;
}

.ticket-rating-label { font-size: 12px; font-weight: 600; margin: 10px 0 6px; }
.rating-row { display: flex; gap: 10px; margin-bottom: 10px; }
.rating-circle {
  width: 26px; height: 26px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}

.ticket-single-question { font-size: 15px; font-weight: 600; margin: 10px 0; }
.ticket-single .blank-line { min-height: 26px; }

/* ---------- Rubric expansions ---------- */
.rubric-points { font-size: 11px; font-weight: 400; color: var(--muted); margin-top: 2px; }
.rubric-descriptor { font-size: 12px; line-height: 1.4; height: auto !important; }
.rubric-total { text-align: right; font-size: 13px; font-weight: 700; margin-top: 12px; }

/* ---------- Study guide: Cornell notes ---------- */
.cornell-header, .cornell-row {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 14px;
}
.cornell-header { font-size: 12px; font-weight: 700; color: var(--muted); border-bottom: 2px solid var(--ink); padding-bottom: 6px; margin-bottom: 8px; }
.cornell-body { display: flex; flex-direction: column; gap: 10px; }
.cornell-row { border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.cornell-cue { font-weight: 700; font-size: 13px; color: var(--accent-dark); }
.cornell-notes { font-size: 13px; }
.cornell-summary { margin-top: 20px; }
.cornell-summary-label { font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 6px; }
.fill-box { border: 1px solid var(--line); border-radius: 6px; min-height: 70px; }

/* ---------- Study guide: spaced repetition ---------- */
.spaced-schedule { display: flex; flex-direction: column; gap: 8px; margin: 14px 0; }
.spaced-row { display: flex; align-items: center; gap: 12px; font-size: 14px; }
.checklist-box { width: 18px; height: 18px; min-width: 18px; border: 2px solid var(--ink); border-radius: 4px; display: inline-block; }
.spaced-day { font-weight: 700; min-width: 60px; }
.spaced-date { color: var(--muted); }
.study-list-heading { font-size: 14px; margin: 18px 0 10px; }

/* ---------- Quiz Builder — printable worksheet/answer key ---------- */
.mcq-list { display: flex; flex-direction: column; gap: 20px; }
.mcq-question { font-weight: 700; margin: 0 0 8px; }
.mcq-options { display: flex; flex-direction: column; gap: 6px; margin-left: 4px; }
.mcq-option { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.mcq-answer { margin: 0; color: var(--accent-dark); }

/* ---------- Quiz Builder — live "Take This Quiz" mode, dark app chrome
   (not .sheet's white-paper look, since this never prints). ---------- */
.qb-quiz-panel {
  background: var(--paper); border: 1px solid var(--line); border-radius: 12px;
  padding: 30px; max-width: 520px; width: 100%; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 14px;
}
.qb-quiz-question { font-size: 17px; font-weight: 700; color: var(--ink); margin: 0; }
.qb-quiz-options { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.qb-quiz-option { padding: 10px 14px; text-align: left; font-size: 14px; }
.qb-quiz-option.qb-correct { border-color: var(--accent); color: var(--accent-dark); font-weight: 700; }
.qb-quiz-option.qb-wrong { border-color: #e05252; color: #e05252; }

/* ---------- Core Competency self-assessment ---------- */
.cc-grade { font-size: 14px; color: var(--muted); margin: -4px 0 8px; }
.cc-competency { border-bottom: 1px solid var(--line); padding: 16px 0; }
.cc-competency:last-of-type { border-bottom: none; }
.cc-competency h3 { margin: 0 0 4px; font-size: 18px; color: var(--accent-dark); }
.cc-facets { font-size: 12px; color: var(--muted); margin: 0 0 10px; font-style: italic; }
.cc-prompt { font-size: 14px; margin: 0 0 10px; }
.cc-rating-row { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.cc-rating-option {
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
}
.cc-write-lines { margin-top: 6px; }
.cc-disclaimer { margin-top: 18px; font-style: italic; }

/* ---------- Field trip permission form ---------- */
.ft-details p { margin: 4px 0; font-size: 14px; }
.ft-subhead { font-size: 15px; margin: 16px 0 6px; }
.ft-list { margin: 0 0 10px; padding-left: 20px; font-size: 14px; }
.ft-notes { font-size: 13px; color: var(--muted); margin: 10px 0; }
.ft-permission { margin-top: 20px; border-top: 1px solid var(--line); padding-top: 16px; }
.ft-permission > p:first-child { font-size: 14px; margin: 0 0 14px; }
.ft-field-row { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; font-size: 13px; }
.ft-field-row span { white-space: nowrap; font-weight: 600; }
.ft-field-row .blank-line { flex: 1; min-height: 20px; margin-bottom: 0; }
.ft-field-row .blank-line.short { flex: 0 0 100px; }

/* ---------- Substitute teacher day plan ---------- */
.sp-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-bottom: 14px; }
.sp-table th, .sp-table td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; }
.sp-table th { background: var(--bg); font-weight: 700; }
.sp-time { font-weight: 600; white-space: nowrap; width: 90px; }
.sp-subhead { font-size: 15px; margin: 16px 0 6px; }
.sp-notes-list { margin: 0 0 14px; padding-left: 20px; font-size: 13px; }
.sp-contacts td:first-child { font-weight: 600; width: 40%; }

/* ---------- Class newsletter ---------- */
.nl-header { text-align: center; border-bottom: 2px solid var(--accent); padding-bottom: 12px; margin-bottom: 20px; }
.nl-issue { color: var(--muted); font-size: 13px; margin: 4px 0 0; }
.nl-section { margin-bottom: 16px; }
.nl-section h3 { font-size: 16px; color: var(--accent-dark); margin: 0 0 4px; }
.nl-section p { font-size: 14px; margin: 0; line-height: 1.5; }
.nl-subhead { font-size: 15px; margin: 16px 0 8px; }
.nl-dates { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.nl-date-row { display: flex; gap: 12px; font-size: 13px; }
.nl-date { font-weight: 700; min-width: 70px; }
.nl-footer { font-size: 12px; color: var(--muted); font-style: italic; margin-top: 16px; border-top: 1px solid var(--line); padding-top: 10px; }

/* ---------- Report card comment bank ---------- */
.rcb-subject { font-size: 14px; color: var(--muted); margin: 4px 0 0; }
.rcb-skill-block { margin-bottom: 18px; border-bottom: 1px solid var(--line); padding-bottom: 14px; }
.rcb-skill-block:last-of-type { border-bottom: none; }
.rcb-skill-block h3 { font-size: 16px; color: var(--accent-dark); margin: 0 0 8px; text-transform: capitalize; }
.rcb-row { display: grid; grid-template-columns: 130px 1fr; gap: 10px; margin-bottom: 8px; font-size: 13px; align-items: baseline; }
.rcb-tier { font-weight: 700; }
.rcb-comment { line-height: 1.5; }
.rcb-disclaimer { margin-top: 16px; font-style: italic; }

/* ---------- Unit / lesson plan ---------- */
.up-meta { font-size: 14px; color: var(--muted); margin: 4px 0 0; }
.up-subhead { font-size: 15px; color: var(--accent-dark); margin: 16px 0 6px; }
.up-bigidea { font-size: 14px; line-height: 1.5; }
.up-list { margin: 0 0 6px; padding-left: 20px; font-size: 14px; line-height: 1.6; }
.up-disclaimer { margin-top: 18px; font-style: italic; }

/* ---------- IEP / learning plan ---------- */
.ip-meta { font-size: 14px; color: var(--muted); margin: 4px 0 0; }
.ip-subhead { font-size: 15px; color: var(--accent-dark); margin: 16px 0 6px; }
.ip-list { margin: 0 0 6px; padding-left: 20px; font-size: 14px; line-height: 1.6; }
.ip-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-bottom: 10px; }
.ip-table th, .ip-table td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; }
.ip-table th { background: var(--bg); font-weight: 700; }
.ip-review { font-size: 13px; margin-top: 12px; }
.ip-disclaimer { margin-top: 18px; font-style: italic; }

/* ---------- Parent communication letter ---------- */
.pl-lang-label { font-size: 13px; color: var(--muted); margin: 4px 0 0; }
.pl-draft-banner {
  background: #fff4e5;
  border: 1px solid #f0b95c;
  color: #7a4a00;
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 16px;
}
.pl-letter-body { font-size: 15px; line-height: 1.8; }
.pl-letter-body[dir="rtl"] { text-align: right; font-size: 16px; }

/* ---------- Parent-teacher conference prep ---------- */
.cp-meta { font-size: 14px; color: var(--muted); margin: 4px 0 0; }
.cp-subhead { font-size: 15px; color: var(--accent-dark); margin: 16px 0 6px; }
.cp-list { margin: 0 0 6px; padding-left: 20px; font-size: 14px; line-height: 1.6; }
.cp-notes-box { border: 1px solid var(--line); border-radius: 6px; min-height: 140px; margin-top: 6px; }

/* ---------- Mobile / small screens ---------- */
@media (max-width: 768px) {
  .app {
    grid-template-columns: 1fr;
  }

  .controls {
    border-right: none;
    border-bottom: 1px solid var(--line);
    position: static;
    overflow-y: visible;
    max-height: none;
  }

  .sheet-wrap {
    padding: 16px;
    gap: 16px;
  }

  #picker-screen {
    padding: 32px 16px;
  }

  .nametag-grid,
  .hallpass-grid,
  .ticket-grid.cols-2,
  .ticket-grid.cols-4,
  .problems.cols-2,
  .problems.cols-3 {
    grid-template-columns: 1fr;
  }

  .study-item,
  .rcb-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

/* ---------- Print ---------- */
@media print {
  .no-print { display: none !important; }

  .app {
    display: block;
  }

  .sheet-wrap {
    padding: 0;
    gap: 0;
  }

  .sheet {
    box-shadow: none;
    border-radius: 0;
    max-width: 100%;
    width: 100%;
    padding: 0;
    page-break-after: always;
  }

  body.printing-worksheet .answerkey-only,
  body.printing-worksheet .walkthrough-only { display: none; }
  body.printing-answers .sheet:not(.answerkey-only) { display: none; }
  body.printing-answers .answerkey-only { border: none; }
  body.printing-walkthroughs .sheet:not(.walkthrough-only) { display: none; }
  body.printing-walkthroughs .walkthrough-only { border: none; }
}
