/* ---- tokens: warm classroom, group-color identity ----------------- */
:root {
  --paper: #fbf7f0;      /* warm classroom paper */
  --ink: #2b2b33;
  --soft: #6d6a63;
  --line: #e5ddcf;
  --card: #ffffff;
  --accent: #4c9fd8;     /* chalk blue */
  --teacher: #fff3c9;    /* teacher-table highlight */
  --g1: #e85d5d; --g2: #f09a3e; --g3: #efc94c; --g4: #58b368;
  --g5: #4c9fd8; --g6: #9b6bc3; --g7: #e57fb0; --g8: #6bbcb4;
  --disp: "Fraunces", Georgia, serif;
  --body: "Nunito", system-ui, sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  line-height: 1.55;
}
a { color: var(--accent); text-underline-offset: 3px; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid var(--accent); outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---- header / hero ------------------------------------------------ */
.top {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 18px clamp(16px, 5vw, 56px);
  border-bottom: 2px solid var(--line);
}
.wordmark { font-family: var(--disp); font-weight: 650; font-size: 19px; }
.top nav { display: flex; gap: 20px; }
.top nav a { color: var(--soft); text-decoration: none; font-weight: 700; font-size: 14px; }
.top nav a:hover { color: var(--ink); }

.hero { padding: clamp(36px, 7vw, 80px) clamp(16px, 5vw, 56px) 6px; max-width: 900px; }
.eyebrow {
  font-weight: 800; font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--accent); margin: 0 0 10px;
}
.hero h1 {
  font-family: var(--disp); font-weight: 650;
  font-size: clamp(34px, 6vw, 62px); line-height: 1.04; letter-spacing: -0.01em;
  margin: 0 0 16px;
}
.lede { color: var(--soft); font-size: clamp(16px, 2vw, 18px); max-width: 58ch; margin: 0; }

/* ---- builder ------------------------------------------------------- */
.builder {
  display: grid;
  grid-template-columns: minmax(300px, 420px) minmax(340px, 1fr);
  gap: clamp(24px, 4vw, 48px);
  padding: clamp(24px, 4vw, 56px) clamp(16px, 5vw, 56px);
  align-items: start;
}
@media (max-width: 900px) { .builder { grid-template-columns: 1fr; } }

fieldset {
  border: 2px solid var(--line); border-radius: 14px;
  background: var(--card); padding: 16px 16px 14px; margin: 0 0 18px;
}
legend { font-family: var(--disp); font-weight: 650; font-size: 16px; padding: 0 8px; }
.tip { color: var(--soft); font-size: 13px; margin: 2px 0 10px; }
.tip.center { text-align: center; margin-top: 10px; }

.rowline { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.chip {
  width: 22px; height: 22px; border-radius: 7px; flex: none;
  border: 2px solid rgba(0,0,0,0.12);
}
.rowline input[type="text"] {
  flex: 1; border: 2px solid var(--line); border-radius: 9px;
  font: 700 15px var(--body); color: var(--ink);
  padding: 8px 10px; background: #fffdf9;
}
.rowline .del {
  border: none; background: none; color: var(--soft);
  font-size: 16px; cursor: pointer; padding: 4px 6px; border-radius: 6px;
}
.rowline .del:hover { color: var(--g1); background: #f6eee2; }

.timing label { display: block; font-weight: 700; font-size: 14px; margin-bottom: 12px; }
.timing input, .timing select {
  display: block; width: 100%; margin-top: 5px;
  border: 2px solid var(--line); border-radius: 9px;
  font: 700 15px var(--body); color: var(--ink);
  padding: 8px 10px; background: #fffdf9;
}

button { font: 800 14px var(--body); border-radius: 10px; cursor: pointer; padding: 10px 16px; }
button.solid { background: var(--accent); border: 2px solid var(--accent); color: #fff; }
button.solid:hover { filter: brightness(1.07); }
button.solid.alt { background: var(--g4); border-color: var(--g4); }
button.ghost { background: none; border: 2px dashed var(--line); color: var(--soft); }
button.ghost:hover { color: var(--ink); border-color: var(--soft); }
.err { background: #fdeaea; border: 2px solid var(--g1); border-radius: 10px; padding: 10px 14px; font-weight: 700; }

/* ---- the board: signature element --------------------------------- */
.boardwrap { position: sticky; top: 20px; }
@media (max-width: 900px) { .boardwrap { position: static; } }
.boardframe {
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: 18px;
  padding: 20px;
  box-shadow: 0 10px 30px rgba(90, 70, 30, 0.10);
}
.boardtitle { font-family: var(--disp); font-weight: 650; font-size: 20px; margin-bottom: 12px; }

table.board { border-collapse: collapse; width: 100%; }
.board th, .board td {
  border: 2px solid var(--line);
  padding: 7px 9px;
  font-size: 13px;
  text-align: center;
}
.board th.slot { text-align: left; font-size: 12px; color: var(--soft); white-space: nowrap; }
.board thead th {
  color: #fff; font-weight: 800; font-size: 13px;
  border-color: rgba(0,0,0,0.1);
}
.board td.teacher { background: var(--teacher); font-weight: 800; }
.board .dayrow td {
  background: var(--ink); color: var(--paper);
  font-weight: 800; font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase;
  text-align: left; padding: 5px 9px;
}
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; justify-content: center; }

/* ---- group cards ---------------------------------------------------- */
.cardsection { padding: 0 clamp(16px, 5vw, 56px) 24px; display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.gcard {
  background: var(--card); border: 2px solid var(--line); border-radius: 16px; overflow: hidden;
  break-inside: avoid;
}
.gcard header {
  color: #fff; font-family: var(--disp); font-weight: 650; font-size: 20px;
  padding: 12px 16px;
}
.gcard table { border-collapse: collapse; width: 100%; }
.gcard th, .gcard td { border-top: 2px solid var(--line); padding: 7px 14px; font-size: 13px; text-align: left; }
.gcard th { color: var(--soft); font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; border-top: none; }
.gcard td.st { font-weight: 800; }

/* ---- faq / footer --------------------------------------------------- */
.faq { padding: clamp(24px, 4vw, 56px) clamp(16px, 5vw, 56px); max-width: 820px; }
.faq h2 { font-family: var(--disp); font-weight: 650; font-size: clamp(24px, 3.4vw, 32px); margin: 0 0 8px; }
.faq dt { font-weight: 800; margin-top: 18px; }
.faq dd { margin: 5px 0 0; color: var(--soft); }
footer {
  border-top: 2px solid var(--line);
  padding: 26px clamp(16px, 5vw, 56px) 42px;
  color: var(--soft); font-size: 13px; max-width: 860px;
}

/* ---- print ----------------------------------------------------------- */
@media print {
  .top, .hero, .controls, .actions, .faq, footer, .tip { display: none !important; }
  body { background: #fff; }
  @page { margin: 10mm; }

  body.print-board .cardsection { display: none !important; }
  body.print-board .builder { display: block; padding: 0; }
  body.print-board .boardframe { border: none; box-shadow: none; padding: 0; }

  body.print-cards .builder { display: none !important; }
  body.print-cards .cardsection { display: block; padding: 0; }
  body.print-cards .gcard { page-break-after: always; border: 3px solid #333; }
  .board th, .board td, .gcard th, .gcard td { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
