/* © 2026 William C. Chesher. All Rights Reserved. */
/* teacher - Mission Control's desk: the class bar, the crews with presence and what needs you, the crew drawer, term end, the printed records */

/* The desk builds on launch.css's tokens and never redefines them: graphite, ignition orange as the one
   accent, hairline rules, Barlow Condensed for display, JetBrains Mono for anything a machine says. One
   moving thing at a time; motion runs left to right; everything holds still under reduced motion. */

.desk-page { position: relative; z-index: 1; max-width: 1440px; margin: 0 auto; padding: 0 max(16px, 2vw); display: grid; gap: var(--space-5); }
.desk-page[hidden] { display: none; }

/* ---- the class bar: sticky, the room's four hands on one line ---------------------------------------- */
.class-bar { position: sticky; top: 0; z-index: 20; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-3) var(--space-5); align-items: end;
  margin: 0 calc(-1 * max(16px, 2vw)); padding: var(--space-4) max(16px, 2vw) var(--space-3);
  background: var(--glass); -webkit-backdrop-filter: blur(var(--blur-glass)) saturate(1.2); backdrop-filter: blur(var(--blur-glass)) saturate(1.2);
  border-bottom: 1px solid var(--hairline); }
.class-bar::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; pointer-events: none;
  background: linear-gradient(90deg, transparent, var(--accent-line) 30%, var(--accent-line) 70%, transparent); opacity: .7; }
/* On a short screen the bar scrolls away rather than eat the room; the drawer then sits at the top. */
@media (max-height: 899px) { .class-bar { position: relative; } .crew-drawer { --class-bar-height: 0px; } }
.class-name { display: grid; gap: var(--space-1); min-width: 0; }
.class-name .display-l { font-size: clamp(28px, 3vw, 38px); overflow-wrap: anywhere; }
.class-name .eyebrow { color: var(--accent); }
.class-meta { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); align-items: center; }
.class-tools { display: flex; flex-wrap: wrap; gap: var(--space-2); justify-content: flex-end; align-items: center; }
.class-controls { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: var(--space-3) var(--space-5); align-items: flex-start; }
.class-control { display: grid; gap: var(--space-1); }
.class-control > .eyebrow { min-height: 1.3em; }
.class-control .hold-frame { gap: var(--space-1); }
.class-control .hold-note { font-size: 12px; max-width: 30ch; }
.class-control .reply { font-size: 13px; max-width: 34ch; }
.released-now { font-family: var(--font-mono); font-size: 13px; letter-spacing: .08em; color: var(--text); }
.released-track { display: flex; gap: 3px; margin-top: 2px; }
.released-track span { width: 18px; height: 3px; background: var(--hairline); }
.released-track span.is-open { background: var(--accent); }
.released-track span.is-cut { background: linear-gradient(90deg, var(--accent) 50%, var(--hairline) 50%); }
.floor-state { font-family: var(--font-mono); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--text-secondary); }
.floor-state.is-held { color: var(--text); }

/* ---- eyes up, as the desk shows it: the room is held -------------------------------------------------- */
.desk-page.is-eyes-up .class-bar { border-bottom-color: var(--accent-line); }
.eyes-banner { display: none; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-4); border: 1px solid var(--accent-line);
  background: radial-gradient(120% 140% at 0% 0%, var(--accent-wash), transparent 60%), var(--surface); }
.desk-page.is-eyes-up .eyes-banner { display: flex; animation: desk-enter-left var(--flow-ui, 240ms) var(--ease-machined) both; }
.eyes-banner .mark { flex: none; }
.eyes-banner p { margin: 0; font-family: var(--font-mono); letter-spacing: .2em; text-transform: uppercase; font-size: 13px; color: var(--text); }
.eyes-banner p + p { font-family: var(--font-body); font-size: 14px; letter-spacing: 0; text-transform: none; color: var(--text-secondary); }

/* ---- the room: crews on the left, the drawer on the right ---------------------------------------------- */
.desk-room { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-5); align-items: start; }
.desk-room.has-drawer { grid-template-columns: minmax(0, 1.5fr) minmax(340px, 1fr); }
@media (max-width: 1080px) { .desk-room.has-drawer { grid-template-columns: minmax(0, 1fr); } }

.crew-board { width: 100%; border-collapse: collapse; font-size: 14px; }
.crew-board th { font-family: var(--font-mono); font-size: 10px; font-weight: 500; letter-spacing: .2em; text-transform: uppercase; color: var(--text-muted);
  text-align: left; padding: 0 var(--space-3) var(--space-2); white-space: nowrap; }
.crew-board td { padding: var(--space-3); border-top: 1px solid var(--hairline); vertical-align: top; color: var(--text-secondary); }
.crew-board tbody tr { cursor: pointer; transition: background-color var(--flow-ui, 240ms) var(--ease-machined); }
.crew-board tbody tr:hover td { background: var(--veil-1); }
.crew-board tbody tr[aria-selected="true"] td { background: var(--veil-2); }
.crew-board tbody tr[aria-selected="true"] td:first-child { box-shadow: inset 2px 0 0 var(--accent); }
.crew-board tbody tr:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.crew-board .crew-code { font-family: var(--font-mono); font-size: 15px; letter-spacing: .18em; color: var(--text); white-space: nowrap; }
.crew-board .number { font-family: var(--font-mono); font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.crew-board th.number { text-align: right; }

.seat-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; }
.seat { display: flex; align-items: center; gap: var(--space-2); white-space: nowrap; color: var(--text); }
.seat .seat-chair { font-family: var(--font-mono); font-size: 10px; letter-spacing: .16em; color: var(--text-muted); min-width: 22px; }
.seat .seat-presence { font-size: 12px; color: var(--text-muted); }
.seat-empty { color: var(--text-muted); }

.where { display: grid; gap: 2px; }
.where .where-step { color: var(--text); }
.where .where-part { font-family: var(--font-mono); font-size: 11px; letter-spacing: .1em; color: var(--text-muted); }
.where .where-ending { font-size: 13px; color: var(--text-secondary); }

.needs-list { display: grid; gap: 4px; justify-items: start; }
.needs-tag { display: inline-block; white-space: nowrap; font-family: var(--font-mono); font-size: 11px; line-height: 1; letter-spacing: .12em; text-transform: uppercase;
  color: var(--text); border: 1px solid var(--edge); padding: 5px 7px; }
.needs-tag.is-ruling { border-color: var(--flare); box-shadow: 0 0 10px var(--flare-glow); }
.needs-tag.is-waiting { border-color: var(--accent-line); color: var(--text); }
.needs-none { color: var(--text-muted); }

/* ---- the crew drawer --------------------------------------------------------------------------------- */
.crew-drawer { position: sticky; top: calc(var(--class-bar-height, 180px) + var(--space-3)); max-height: calc(100vh - var(--class-bar-height, 180px) - var(--space-5)); overflow: auto;
  display: grid; gap: var(--space-4); align-content: start; border-left: 1px solid var(--hairline); padding: 0 0 var(--space-5) var(--space-5); }
.crew-drawer[hidden] { display: none; }
.crew-drawer.is-entering { animation: desk-enter-left var(--flow-ui, 240ms) var(--ease-machined) both; }
@media (max-width: 1080px) { .crew-drawer { position: static; max-height: none; border-left: 0; border-top: 1px solid var(--hairline); padding: var(--space-5) 0 0; } }
.drawer-head { display: flex; justify-content: space-between; align-items: start; gap: var(--space-3); }
.drawer-code { font-family: var(--font-mono); font-size: 40px; line-height: 1; letter-spacing: .22em; color: var(--text); margin: var(--space-1) 0 0; }
.drawer-band { display: grid; gap: var(--space-2); padding-top: var(--space-3); border-top: 1px solid var(--hairline); }
.drawer-band > .eyebrow { margin: 0; }
.member-row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); min-height: 32px; }
.member-row .who { display: flex; align-items: center; gap: var(--space-2); color: var(--text); }
.member-row .member-presence { font-size: 12px; color: var(--text-muted); }
.drawer-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }

.directive-form { display: grid; gap: var(--space-2); }
.directive-form .field-row { display: flex; gap: var(--space-2); align-items: center; flex-wrap: wrap; }
.directive-form select, .directive-form textarea { font: inherit; }
.directive-form textarea { min-height: 72px; resize: vertical; }
.directive-count { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); margin-left: auto; }
.directive-list { margin: 0; padding: 0; list-style: none; display: grid; gap: var(--space-2); }
.directive-list li { padding: var(--space-2) var(--space-3); border-left: 2px solid var(--accent-line); background: var(--veil-1); font-size: 14px; color: var(--text); }
.directive-list .meta { display: block; font-family: var(--font-mono); font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 2px; }

.ruling { display: grid; gap: var(--space-3); padding: var(--space-4); border: 1px solid var(--flare); box-shadow: inset 0 0 0 1px var(--flare-glow); }
.ruling .eyebrow { color: var(--text); }
.ruling p { margin: 0; font-size: 14px; color: var(--text-secondary); max-width: 46ch; }
.ruling-choices { display: flex; flex-wrap: wrap; gap: var(--space-3); }

.crew-log { margin: 0; padding: 0; list-style: none; display: grid; gap: 0; font-size: 14px; }
.crew-log li { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: var(--space-3); padding: 6px 0; border-top: 1px solid var(--hairline); color: var(--text-secondary); }
.crew-log li:first-child { border-top: 0; }
.crew-log time { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); padding-top: 2px; font-variant-numeric: tabular-nums; }
.crew-log li.is-fresh { animation: desk-land 900ms var(--ease-machined) both; }
.log-more { justify-self: start; }

/* ---- term end: the export above the purge ------------------------------------------------------------- */
.term-end { display: grid; gap: var(--space-5); max-width: 880px; }
.term-end[hidden] { display: none; }
.export-actions { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-3); }
.purge-page { border-top: 1px solid var(--hairline); }
.purge-page fieldset { border: 1px solid var(--edge); padding: var(--space-3) var(--space-4); margin: 0; display: grid; gap: var(--space-2); }
.purge-page legend { padding: 0 var(--space-2); }
.purge-page label.choice { display: flex; gap: var(--space-3); align-items: center; min-height: 44px; font-size: 15px; cursor: pointer; }
.purge-page input[type="radio"] { width: 18px; height: 18px; accent-color: var(--text); }
.back-link { justify-self: start; }

.desk-footer-links { display: flex; gap: var(--space-4); flex-wrap: wrap; }
.desk-footer-links a, .desk-footer-links button { color: var(--text-secondary); font-size: 13px; }

/* ---- motion (the house's: enter from the left, the accent lands then cools) ------------------------------ */
@keyframes desk-enter-left { from { opacity: 0; transform: translateX(-12px); } to { opacity: 1; transform: none; } }
@keyframes desk-land { 0% { color: var(--accent); } 100% { color: var(--text-secondary); } }
@media (prefers-reduced-motion: reduce) {
  .desk-page.is-eyes-up .eyes-banner, .crew-drawer.is-entering, .crew-log li.is-fresh { animation: none; }
  .crew-board tbody tr { transition: none; }
}

/* ---- the printed records: one page per crew ----------------------------------------------------------- */
.print-records { display: none; }
@media print {
  body.is-printing > *:not(.print-records) { display: none !important; }
  body.is-printing .print-records { display: block; color: #000; background: #fff; font-family: var(--font-body); font-size: 11pt; }
  .print-record { break-after: page; padding: 0; }
  .print-record:last-child { break-after: auto; }
  .print-record h1 { font-family: var(--font-display); font-size: 22pt; letter-spacing: .08em; text-transform: uppercase; margin: 0 0 4pt; }
  .print-record h2 { font-family: var(--font-mono); font-size: 9pt; letter-spacing: .2em; text-transform: uppercase; margin: 14pt 0 4pt; border-bottom: .5pt solid #000; padding-bottom: 2pt; }
  .print-record .meta { font-family: var(--font-mono); font-size: 9pt; letter-spacing: .08em; }
  .print-record ol, .print-record ul { margin: 0; padding-left: 16pt; }
  .print-record li { margin: 2pt 0; }
  .print-record .why { display: block; font-style: italic; }
  .print-record .by { font-family: var(--font-mono); font-size: 8pt; letter-spacing: .1em; text-transform: uppercase; }
}
