:root {
  --ink: #1a241c;
  --moss: #2f5d3f;
  --leaf: #3f7a52;
  --gold: #c4a35a;
  --cream: #f4efe4;
  --paper: #fbf8f1;
  --line: #d9d0bf;
  --muted: #6b6458;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: Outfit, system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
}
h1, h2, .brand {
  font-family: Fraunces, Georgia, serif;
  font-weight: 700;
}
a { color: var(--moss); }
.bare { background: radial-gradient(1200px 600px at 10% -10%, #e7f0e4, var(--cream)); }
.door {
  max-width: 28rem;
  margin: 0 auto;
  padding: 12vh 1.4rem 3rem;
}
.door.slim { padding-top: 18vh; }
.eyebrow {
  letter-spacing: .16em;
  text-transform: uppercase;
  font-size: 11px;
  color: var(--moss);
  margin: 0 0 .6rem;
}
.door h1 { font-size: 3rem; margin: 0 0 .4rem; letter-spacing: -0.03em; }
.lede { font-size: 1.15rem; color: var(--muted); margin: 0 0 1.6rem; }
.lede-sm { color: var(--muted); font-size: .95rem; }
.door-form label, .compose label {
  display: flex;
  flex-direction: column;
  gap: .4rem;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 1rem;
}
input, select, textarea {
  font: inherit;
  padding: .85rem 1rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}
.btn-hero {
  width: 100%;
  border: 0;
  background: var(--moss);
  color: #fff;
  font: inherit;
  font-weight: 700;
  font-size: 1.05rem;
  padding: .95rem 1rem;
  border-radius: 999px;
  cursor: pointer;
}
.btn-hero:disabled { opacity: .45; }
.btn-hero.ghost-hero {
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
}
.choice-pair { display: flex; flex-direction: column; gap: .7rem; }
.name-hits { display: flex; flex-direction: column; gap: .65rem; margin-top: .4rem; }
.name-hit {
  width: 100%;
  min-height: 4.1rem;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 18px;
  font: inherit;
  font-size: 1.25rem;
  font-weight: 700;
  text-align: left;
  padding: 1rem 1.1rem;
  cursor: pointer;
  line-height: 1.2;
}
.name-hit:hover, .name-hit:focus { border-color: var(--moss); background: #eef6f0; }
.name-hit small { display: block; margin-top: .2rem; font-size: 13px; font-weight: 600; color: var(--muted); }
.last4-label { margin: 1rem 0 1.1rem; }
#last4 {
  display: block;
  width: 100%;
  margin-top: .45rem;
  text-align: center;
  font-size: 2.4rem;
  font-weight: 700;
  letter-spacing: .35em;
  padding: 1rem .4rem;
}
.err { color: #9b2c2c; font-weight: 600; }
.hint { color: var(--muted); }
.foot { margin-top: 2.5rem; font-size: 13px; }
.desk-line {
  margin: 1.6rem 0 0;
  color: var(--muted);
  font-size: .95rem;
  line-height: 1.4;
}
.desk-card h1 { font-size: 2.2rem; }
.desk-card p { font-size: 1.15rem; margin: .4rem 0 0; color: var(--ink); }
.nojs-join { display: none; }
.format-set {
  border: 0;
  padding: 0;
  margin: 0 0 1.1rem;
}
.format-set legend { font-weight: 700; margin-bottom: .5rem; }
.radio-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: .55rem;
  font-size: 1.05rem;
  margin: .4rem 0;
}
.desk-hint {
  margin: .35rem 0 .55rem;
  color: var(--muted);
  font-size: 13px;
}
.find-wrap { display: block; max-width: 16rem; margin: 0 0 .7rem; }
.desk-find {
  width: 100%;
  padding: .5rem .75rem;
  font-size: 15px;
}
.done-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 1.4rem;
}
.done-card a.join {
  display: block;
  text-align: center;
  margin-top: 1rem;
  text-decoration: none;
}
.class-night .lede-sm { margin: 0 0 .35rem; }
.class-night h1 { font-size: 2.4rem; line-height: 1.15; }
.zoom-url {
  margin: .85rem 0 0;
  font-weight: 700;
  font-size: 1.05rem;
  word-break: break-all;
}
.app { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.app.nav-hidden { grid-template-columns: 0 1fr; }
.app.nav-hidden .nav { overflow: hidden; padding: 0; border: 0; visibility: hidden; }
.nav-top { display: flex; align-items: flex-start; justify-content: space-between; gap: .4rem; }
.nav-hide, .nav-show {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  border-radius: 999px;
  padding: .28rem .65rem;
  cursor: pointer;
}
.nav-hide { background: #2a3a2e; color: #efe7d6; border-color: #3d5342; }
.nav-show { display: none; margin: 0 0 .8rem; }
.app.nav-hidden .nav-show { display: inline-flex; }
.nav {
  background: var(--ink);
  color: #efe7d6;
  padding: 1.4rem 1rem;
  display: flex;
  flex-direction: column;
  gap: .35rem;
}
.brand { font-size: 1.4rem; color: #fff; margin-bottom: 1rem; }
.nav a {
  color: #efe7d6;
  text-decoration: none;
  padding: .55rem .7rem;
  border-radius: 10px;
}
.nav a.on, .nav a:hover { background: #2a3a2e; }
.nav a.muted { opacity: .65; margin-top: auto; }
.main { padding: 1.6rem 1.8rem 3rem; }
.page-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-end;
  margin-bottom: 1.2rem;
}
.page-head h1 { margin: 0; font-size: 1.9rem; }
.stats { display: flex; gap: 1rem; flex-wrap: wrap; }
.stats div {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: .6rem .85rem;
  min-width: 7rem;
}
.stats strong { display: block; font-size: 1.3rem; }
.filters, .view-as { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0 0 1rem; }
.chip, .view-as a {
  text-decoration: none;
  color: var(--ink);
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: .35rem .75rem;
  font-size: 13px;
  font-weight: 600;
}
.chip.is-on, .view-as a.is-on { background: var(--moss); color: #fff; border-color: var(--moss); }
button.chip { font: inherit; cursor: pointer; }
.view-as { font-size: 13px; color: var(--muted); align-items: center; }
.dash-grid {
  display: grid;
  grid-template-columns: 1.4fr .9fr;
  gap: 1rem;
  align-items: start;
}
.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 1.1rem 1.2rem 1.3rem;
  margin-bottom: 1rem;
}
.card h2 { margin: 0 0 .8rem; font-size: 1.25rem; }
.count { font-family: Outfit, sans-serif; font-size: 14px; color: var(--muted); }
.roster { width: 100%; border-collapse: collapse; font-size: 14px; }
.roster th { text-align: left; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.roster td, .roster th { padding: .45rem 0; border-bottom: 1px solid var(--line); }
.compose textarea { width: 100%; min-height: 8rem; margin-bottom: .8rem; }
.flash {
  background: #e7f0e4;
  border: 1px solid #b7d0be;
  padding: .7rem 1rem;
  border-radius: 12px;
  margin-bottom: 1rem;
}
.inline-form { display: flex; gap: .6rem; }
.inline-form select { flex: 1; }
.inline-form .btn-hero { width: auto; padding: .85rem 1.2rem; }
.desk-search { display: block; max-width: 22rem; margin: 0 0 1rem; font-size: 13px; font-weight: 600; }
.desk-search input { width: 100%; margin-top: .35rem; }
.desk-flash {
  background: #e7f0e4;
  border: 1px solid #b7d0be;
  padding: .7rem 1rem;
  border-radius: 12px;
  margin-bottom: 1rem;
}
.desk-live li { grid-template-columns: 1fr auto auto; }
.row-actions { display: flex; gap: .3rem; }
.act {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: .28rem .65rem;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.act[data-act="zoom"] { color: #1d4ed8; }
.act[data-act="tag"] { color: var(--moss); }
.desk-row.is-in .act { opacity: .85; }
.board { padding: 1.2rem 1.4rem 2rem; }
.board-top {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 1rem;
}
.board-top > div:first-child { min-width: 0; flex: 1; }
.board-top h1 {
  font-family: Fraunces, Georgia, serif;
  font-size: clamp(1.35rem, 2.4vw, 2rem);
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.02em;
  line-height: 1.2;
  max-width: 44rem;
}
.night-wrap { display: block; margin-top: .35rem; }
.night-pick {
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  border: 0;
  background: transparent;
  padding: 0 1.1rem 0 0;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8'><path d='M1 1l5 5 5-5' fill='none' stroke='%236b6458' stroke-width='1.6'/></svg>");
  background-repeat: no-repeat;
  background-position: right .15rem center;
}
.night-pick:focus { outline: none; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}
.tally { color: var(--muted); font-size: 1.05rem; margin: .35rem 0 0; }
.tally strong { color: var(--moss); font-size: 1.4rem; }
.print-dock {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .55rem .85rem;
  margin-top: .65rem;
}
.print-dock #tagWait { font-weight: 700; color: var(--moss); }
.qr-wrap {
  flex: 0 0 220px;
  text-align: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: .65rem .65rem .55rem;
}
.qr-wrap p { margin: .4rem 0 0; font-size: 12px; letter-spacing: .02em; color: var(--muted); }
.qr-wrap .qr-url { font-size: 11px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--ink); word-break: break-all; }
.qr-wrap .print-qr { width: 100%; margin-top: .55rem; }
.quiet-check {
  display: flex;
  align-items: center;
  gap: .35rem;
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
}
.quiet-check input { margin: 0; }
.print-next, .print-qr {
  border: 0;
  background: var(--moss);
  color: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  border-radius: 999px;
  padding: .4rem .85rem;
  cursor: pointer;
}
.print-qr {
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
}
.print-frame {
  position: absolute;
  width: 0;
  height: 0;
  border: 0;
  visibility: hidden;
}
#qr { width: 188px; height: 188px; margin: 0 auto; }
#qr img, #qr canvas { width: 188px !important; height: 188px !important; }
.board-sections { display: flex; flex-direction: column; gap: 1.1rem; }
.board .group-pane { margin: 0; }
.board .group-cols { margin-top: .45rem; }
.board .group-col { min-height: 5.5rem; }
.board .g-live { display: flex; flex-direction: column; gap: .28rem; }
.board .g-live li,
.board-sec.is-in .g-live li {
  display: grid;
  grid-template-columns: 1fr auto;
  min-width: 0;
}
.main .board { padding: 0; }
.board-sec[hidden] { display: none; }
.board-sec.is-wait { border-top: 1px solid var(--line); padding-top: .55rem; }
.board-sec.is-wait > summary {
  list-style: none;
  cursor: pointer;
}
.board-sec.is-wait > summary::-webkit-details-marker { display: none; }
.board-sec.is-wait > summary h2 { margin: 0; }
.board-sec.is-wait > summary h2::before {
  content: '▸ ';
  font-size: .85em;
  color: var(--muted);
}
.board-sec.is-wait[open] > summary h2::before { content: '▾ '; }
.board-sec.is-wait .live { margin-top: .45rem; }
.board-sec h2 {
  font-size: 1.05rem;
  margin: 0 0 .35rem;
  display: flex;
  align-items: baseline;
  gap: .5rem;
}
.sec-count { font-family: Outfit, sans-serif; font-size: 12px; font-weight: 600; color: var(--muted); }
.live {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: .3rem;
}
.live li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: .3rem;
  align-items: center;
  padding: .32rem .5rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 13px;
  transition: background .3s, border-color .3s;
}
.board-sec.is-in .live {
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: .25rem;
}
.board-sec.is-in .live li { padding: .22rem .42rem; font-size: 13px; }
.live li.role-pl,
.g-card.role-pl {
  background: #e7f3ea;
  border-color: #3f7a52;
}
.live li.role-pm,
.g-card.role-pm {
  background: #f6f0df;
  border-color: #c4a35a;
}
.live li.role-student,
.g-card.role-student {
  background: #e7eef6;
  border-color: #4a6d8c;
}
.live li.is-in.role-pl { background: #d8eadc; }
.live li.is-in.role-pm { background: #f3e8c8; }
.live li.is-in.role-student { background: #d7e4f2; }
.live .nm, .g-card .nm { font-weight: 600; }
.live .rl,
.g-card .rl {
  font-size: 11px;
  letter-spacing: .08em;
  font-weight: 700;
  color: var(--muted);
  min-width: 1.4rem;
  text-align: right;
}
.live li.role-pl .rl, .g-card.role-pl .rl { color: var(--moss); }
.live li.role-pm .rl, .g-card.role-pm .rl { color: #8a6d28; }
.live li.role-student .rl, .g-card.role-student .rl { color: #3d5c78; }
.group-wrap { display: flex; flex-direction: column; gap: .55rem; }
.group-block h3 {
  margin: 0 0 .25rem;
  font-size: .92rem;
  display: flex;
  align-items: baseline;
  gap: .4rem;
}
.groups-link {
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: .4rem .85rem;
}
.board.is-staff .live li { cursor: pointer; }
.name-menu {
  position: fixed;
  z-index: 20;
  display: flex;
  flex-direction: column;
  min-width: 8.5rem;
  padding: .3rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 10px 28px rgba(26, 36, 28, .12);
}
.name-menu[hidden] { display: none; }
.name-menu button {
  border: 0;
  background: transparent;
  text-align: left;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: .5rem .7rem;
  border-radius: 8px;
  cursor: pointer;
  color: var(--ink);
}
.name-menu button:hover { background: #f3eee3; }
.name-menu button[data-act="undo"] { color: var(--muted); font-weight: 500; }
.name-menu-groups {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem;
  padding: .35rem .4rem .2rem;
  border-top: 1px solid var(--line);
  margin-top: .2rem;
}
.name-menu-groups[hidden] { display: none; }
.name-menu-groups p {
  flex: 1 1 100%;
  margin: 0 0 .15rem;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
}
.name-menu-groups button {
  padding: .28rem .5rem;
  font-size: 12px;
}
.board.is-staff .g-card { cursor: grab; }
.board.is-staff .g-card.is-drag { cursor: grabbing; }
.board.is-staff .g-card.is-week .nm::after {
  content: ' this week';
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .02em;
  color: var(--muted);
}
.board-note {
  position: fixed;
  left: 50%;
  bottom: 1.1rem;
  transform: translateX(-50%);
  margin: 0;
  background: var(--ink);
  color: #efe7d6;
  padding: .55rem .9rem;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  z-index: 21;
  max-width: calc(100% - 2rem);
}
.board-note[hidden] { display: none; }
.desk-live { grid-template-columns: 1fr; max-width: 42rem; }
.desk-live li { grid-template-columns: minmax(0, 1fr) auto auto; }
.print-dock { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; }
.group-desk { display: flex; flex-direction: column; gap: 1.4rem; }
.group-pane {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1rem 1.1rem 1.15rem;
}
.group-pane-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .55rem .7rem;
  margin-bottom: .35rem;
}
.group-pane-top h2 { margin: 0; margin-right: auto; }
.group-pane-top label {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: 13px;
  font-weight: 600;
}
.group-n { width: 4.4rem; padding: .45rem .55rem; }
.group-pane-top .btn-hero { width: auto; padding: .45rem .9rem; font-size: 13px; }
.group-math { margin: 0 0 .7rem; }
.group-cols {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: .55rem;
}
.group-col {
  min-height: 8rem;
  border: 1px dashed var(--line);
  border-radius: 12px;
  padding: .5rem;
  background: #fbf8f1;
}
.group-col.is-over { border-color: var(--moss); background: #eef5ee; }
.group-col h3 {
  margin: 0 0 .4rem;
  font-size: .92rem;
  display: flex;
  justify-content: space-between;
  gap: .4rem;
}
.g-live { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .28rem; }
.g-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: .3rem;
  align-items: center;
  padding: .28rem .42rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 13px;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: element;
}
.g-card * { pointer-events: none; }
.g-card.is-drag { opacity: .45; }
.g-card.is-pick { outline: 2px solid var(--moss); outline-offset: 1px; }
.contact-card { overflow-x: auto; }
.contact-table { width: 100%; }
.contact-table th:nth-child(1), .contact-table td:nth-child(1) { min-width: 9rem; }
.contact-phone, .contact-email { font-size: 13px; font-weight: 500; }
.contact-email { word-break: break-all; }
.contact-table select {
  width: 100%;
  max-width: 13rem;
  padding: .4rem .55rem;
  border-radius: 10px;
}
.contact-row.role-pl { background: #f3f8f4; }
.contact-row.role-pm { background: #faf6ec; }
.contact-row.role-student { background: #f4f7fb; }
.contact-filters { margin-bottom: .6rem; }
.nm-link { color: inherit; text-decoration: none; }
.nm-link:hover { text-decoration: underline; }
.person-back { margin: 0 0 .6rem; }
.person-line { margin: .2rem 0; }
.person-desk .contact-table label {
  display: flex;
  flex-direction: column;
  gap: .3rem;
  font-size: 12px;
  font-weight: 600;
}
.class-cards { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .45rem; }
.class-card {
  display: flex;
  flex-direction: column;
  gap: .15rem;
  padding: .55rem .7rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}
.class-card.is-in { border-color: #8fbf9a; background: #f3f8f4; }
.class-card.is-out { opacity: .88; }
.class-meta, .class-role { font-size: 13px; color: var(--muted); font-weight: 600; }
.class-card.timing-current.is-in { border-color: var(--leaf); }
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .app.nav-hidden { grid-template-columns: 1fr; }
  .board .group-cols { grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); }
  .dash-grid { grid-template-columns: 1fr; }
  .nav { flex-direction: row; flex-wrap: wrap; }
  .desk-live li { grid-template-columns: minmax(0, 1fr) auto; }
  .row-actions { grid-column: 1 / -1; justify-content: flex-end; }
}
