/* =====================================================================================================
   Talaria · design system v2  (student app and operator console)
   -----------------------------------------------------------------------------------------------------
   One palette, one scale. Every colour below is the platform's own (navy, blue, sky, yellow, orange,
   grey, ink, wash) plus the tints and the darker text shades they need to be READABLE: white text on
   #118DFF is 3.35:1 and fails; on --blue-700 it is 6.1:1. Contrast figures are against the surface the
   token is used on and are asserted by tests/test_ui.py.

   Rules this file keeps:
     - nothing under 12 px; body text 16 px; labels 12 px / 600.
     - every control at least 40 px tall (WCAG 2.2 AA asks for 24; 44 was too big for this app).
     - text on white is --ink, --ink-2 or --ink-3, never --grey (the grey is for lines and disabled).
     - the accent #118DFF is for icons, focus and large shapes; text and buttons use --blue-700 or --navy.
     - motion is 150 ms and switched off for people who ask for less.
   Self-contained: no font, no network, no library (the box has no internet).
   ===================================================================================================== */

:root {
  /* the platform palette */
  --navy: #0D2B8C;
  --blue: #118DFF;
  --sky: #00C2FF;
  --yellow: #FF9A00;
  --orange: #FF4D00;
  --grey: #BFC3C9;
  --ink: #0E1F45;
  --wash: #F4F7FB;
  --hair: #D6DDE8;
  /* tints and text shades derived from it, so that every pairing passes AA */
  --navy-900: #091D63;
  --blue-700: #0A5FC4;
  --blue-100: #DCEBFF;
  --blue-50: #EEF5FF;
  --yellow-100: #FFF1D6;
  --orange-700: #B93A00;
  --orange-100: #FFE6DB;
  --ok: #0F7B4F;
  --ok-100: #E3F4EC;
  --ink-2: #44527A;
  --ink-3: #5B688C;
  --white: #FFFFFF;

  --font: 'Montserrat', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --t-xs: 12px; --t-sm: 13px; --t-md: 15px; --t-lg: 17px; --t-xl: 20px; --t-2xl: 24px;
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 24px; --s-6: 32px;
  --r-sm: 4px; --r-md: 6px; --r-lg: 8px; --r-pill: 999px;
  --shadow-1: none;
  --shadow-2: 0 8px 24px rgba(14, 31, 69, .18);
  --tap: 40px;
  --nav-h: 56px;
  --head-h: 52px;
  --ease: 150ms ease;
}

/* ---- base ------------------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); font-size: var(--t-md); line-height: 1.5;
  color: var(--ink); background: var(--wash);
  min-height: 100dvh; display: flex; flex-direction: column;
}
:focus-visible { outline: 3px solid var(--sky); outline-offset: 2px; border-radius: 6px; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---- type -------------------------------------------------------------------------------------- */
h1 { font-size: var(--t-xl); line-height: 1.25; font-weight: 700; margin: 0 0 var(--s-2); }
h2, h2.ph { font-size: var(--t-xl); line-height: 1.25; font-weight: 700; margin: 0 0 var(--s-3); color: var(--ink); }
h3 { font-size: var(--t-lg); font-weight: 700; margin: 0 0 var(--s-2); }
p.lede, .lede { font-size: var(--t-sm); line-height: 1.55; color: var(--ink-2); margin: 0 0 var(--s-4); }
.note, .pnote { font-size: var(--t-xs); line-height: 1.55; color: var(--ink-3); margin: var(--s-3) 0 0; }
label, .dlab { display: block; font-size: var(--t-xs); font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--ink-2); margin: 0 0 var(--s-1); }

/* ---- controls --------------------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  width: 100%; min-height: 44px; padding: 0 var(--s-4); margin-top: var(--s-3);
  border: 2px solid transparent; border-radius: var(--r-md); background: var(--navy); color: var(--white);
  font-size: var(--t-sm); font-weight: 600; letter-spacing: 0; text-align: center;
  transition: background var(--ease), border-color var(--ease), transform var(--ease);
}
.btn:active { background-color: var(--blue-100); }
.btn.p:active { background: var(--navy-900); }
.btn.p { background: var(--navy); color: var(--white); }
.btn.p:hover { background: var(--navy-900); }
.btn.p:disabled { background: var(--hair); color: var(--ink-3); cursor: not-allowed; }
.btn.o { background: var(--white); color: var(--navy); border-color: var(--navy); }
.btn.o:hover { background: var(--blue-50); }
.btn .fa { color: currentColor; margin: 0; }
.btn b { font-weight: 700; }
input:not([type]), input[type=text], input[type=email], input[type=tel], input[type=number], input[type=password],
input[type=search], input[type=date], input[type=datetime-local], input[type=url], select, textarea {
  width: 100%; min-height: 42px; padding: 8px 12px; background: var(--white); color: var(--ink);
  border: 1.5px solid var(--grey); border-radius: var(--r-md); font-size: var(--t-md); font-weight: 500;
  letter-spacing: 0; text-transform: none; text-align: left;
}
input:focus, select:focus, textarea:focus { outline: 3px solid var(--sky); outline-offset: 0; border-color: var(--blue-700); }
textarea { line-height: 1.6; resize: vertical; min-height: 36dvh; }
::placeholder { color: var(--ink-3); opacity: 1; }
.err { background: var(--orange-100); color: var(--orange-700); border-radius: var(--r-md);
  padding: var(--s-3) var(--s-4); font-size: var(--t-sm); font-weight: 600; line-height: 1.5; margin-top: var(--s-3); }

/* ---- surfaces --------------------------------------------------------------------------------- */
.card, .row, .vbox {
  background: var(--white); border: 1px solid var(--hair); border-radius: var(--r-md);
  box-shadow: var(--shadow-1);
}
.card { padding: var(--s-4); margin-bottom: var(--s-3); }
.chip, .opt, .aday, .pt, .leg {
  display: inline-flex; align-items: center; justify-content: center; min-height: var(--tap);
  padding: 0 var(--s-4); border-radius: var(--r-md); font-size: var(--t-sm); font-weight: 700;
  background: var(--blue-50); color: var(--blue-700); border: 1.5px solid transparent; cursor: pointer;
  white-space: nowrap;
}
.chip.on, .opt.on, .aday.on, .pt.on, .leg.on { background: var(--navy); color: var(--white); }

/* =====================================================================================================
   STUDENT APP  (body.app-student)
   ===================================================================================================== */
body.app-student { padding: 0; }
.app-student header {
  position: sticky; top: 0; z-index: 30; min-height: var(--head-h);
  padding: env(safe-area-inset-top) var(--s-4) 0; background: var(--navy); color: var(--white);
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-3);
  box-shadow: 0 1px 0 rgba(255,255,255,.08);
}
.app-student header .brand { display: flex; align-items: center; gap: var(--s-2); min-width: 0; }
.app-student header .escola { height: 28px; width: auto; opacity: 1; }
.app-student header .mark { font-size: var(--t-xs); font-weight: 700; line-height: 1.2; color: var(--white); }
.app-student header .mark .d1 { color: var(--sky); }
.app-student header .side { display: flex; align-items: center; gap: var(--s-2); min-width: 0; }
.app-student header .who { font-size: var(--t-sm); font-weight: 600; color: var(--white); padding: 0;
  margin: 0; max-width: 40vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-student header .who { display: none; }
.app-student header .signout, .app-student header .help { display: none; }   /* they live in the More sheet */
.app-student header .glyph { display: block; width: 32px; height: 32px; flex: none; }
.app-student header .escola { display: none; }
.app-student header .mark { font-size: var(--t-sm); line-height: 1.15; }
.app-student header .mark .d1 { font-size: var(--t-xs); font-weight: 600; }

.app-student main { flex: 1; width: 100%; max-width: 640px; margin: 0 auto;
  padding: var(--s-4) var(--s-4) calc(var(--nav-h) + var(--s-5) + env(safe-area-inset-bottom)); }
.app-student .screen { display: none; }
.app-student .screen.on { display: block; animation: rise var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* every sub-screen starts with a real back control, 44 px, that stays under the thumb's reach */
.back {
  display: inline-flex; align-items: center; gap: var(--s-2); min-height: var(--tap);
  margin: 0 0 var(--s-2) calc(var(--s-3) * -1); padding: 0 var(--s-3);
  font-size: var(--t-md); font-weight: 700; color: var(--blue-700); border-radius: var(--r-md);
  cursor: pointer; text-decoration: none;
}
.back:hover { background: var(--blue-50); }
.back.bot { display: flex; margin: var(--s-6) 0 var(--s-2); border-top: 1px solid var(--hair); border-radius: 0; padding-top: var(--s-3); }

/* sign in */
#s-login { padding-top: var(--s-5); }
#s-login h1 { font-size: var(--t-2xl); }
#code { text-align: center; letter-spacing: .3em; font-size: var(--t-xl); font-weight: 700; text-transform: uppercase;
  min-height: 60px; }

/* offline notice */
#offline { display: none; position: sticky; top: var(--head-h); z-index: 29; background: var(--yellow);
  color: var(--ink); font-size: var(--t-sm); font-weight: 700; text-align: center; padding: var(--s-2) var(--s-4); }
#offline.on { display: block; }

/* ---- home ------------------------------------------------------------------------------------- */
.voyage { background: var(--navy); border-radius: var(--r-lg); padding: var(--s-4); margin: 0 0 var(--s-4); color: var(--white); }
.voyage .v { font-size: var(--t-xs); font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--blue-100); margin-bottom: var(--s-3); }
.voyage .legs { display: flex; gap: 0; }
.voyage .p { flex: 1; text-align: center; min-width: 0; position: relative; }
.voyage .p .d { width: 10px; height: 10px; border-radius: 50%; background: #4A6199; margin: 0 auto; position: relative; z-index: 1; }
.voyage .p::before { content: ""; position: absolute; top: 4px; left: -50%; right: 50%; height: 2px; background: #35508F; }
.voyage .p:first-child::before { display: none; }
.voyage .p.done .d { background: var(--sky); }
.voyage .p.done::before { background: var(--sky); }
.voyage .p.on .d { width: 14px; height: 14px; margin-top: -2px; background: var(--yellow); }
.voyage .p.on::before { background: var(--sky); }
.voyage .p .n { font-size: var(--t-xs); font-weight: 600; color: var(--blue-100); margin-top: var(--s-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.voyage .p.on .n { color: var(--yellow); font-weight: 700; }
.voyage .s { font-size: var(--t-sm); font-weight: 600; color: var(--white); margin-top: var(--s-4); line-height: 1.45;
  border-top: 1px solid rgba(255,255,255,.18); padding-top: var(--s-3); }

/* one chevron for everything that opens something */
.who-row::after, .group .li.more::after, #sheet .list button:not(.danger)::after, #opmore .list button::after {
  content: ""; flex: none; width: 10px; height: 14px; margin-left: auto; background: var(--ink-3);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 320 512'%3E%3Cpath d='M310.6 233.4c12.5 12.5 12.5 32.8 0 45.3l-192 192c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L242.7 256 73.4 86.6c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0l192 192z'/%3E%3C/svg%3E") center/contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 320 512'%3E%3Cpath d='M310.6 233.4c12.5 12.5 12.5 32.8 0 45.3l-192 192c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L242.7 256 73.4 86.6c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0l192 192z'/%3E%3C/svg%3E") center/contain no-repeat; }

.live { display: flex; align-items: center; gap: var(--s-3); width: 100%; min-height: 64px; margin: 0 0 var(--s-4);
  padding: var(--s-3) var(--s-4); background: var(--white); border: 1px solid var(--hair); border-left: 4px solid var(--yellow);
  border-radius: var(--r-md); color: var(--ink); text-align: left; }
.live .fa { color: var(--navy); width: 20px; height: 20px; flex: none; }
.live.news { border-left-color: var(--blue-700); }
.btn.small { min-height: var(--tap); width: auto; padding: 0 var(--s-4); margin-top: var(--s-3); }
.ptr.q { align-items: flex-start; flex-wrap: wrap; padding: var(--s-3); }
.ptr.q .pn { flex: 1 1 100%; font-size: var(--t-md); font-weight: 600; line-height: 1.4; }
.ptr.q .pss { font-weight: 500; }
.live b { display: block; font-size: var(--t-md); font-weight: 700; }
.live small { display: block; font-size: var(--t-sm); font-weight: 500; color: var(--ink-2); margin-top: 2px; }

#idlestate { display: flex; align-items: flex-start; gap: var(--s-3); margin: 0 0 var(--s-4); padding: var(--s-3) var(--s-4);
  background: var(--white); border: 1px solid var(--hair); border-radius: var(--r-md); }
#idlestate .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--grey); margin-top: 7px; flex: none; }
#idlestate b { display: block; font-size: var(--t-md); font-weight: 700; }
#idlestate span:not(.dot) { display: block; font-size: var(--t-sm); line-height: 1.5; color: var(--ink-2); margin-top: 2px; }

.who-row { display: flex; align-items: center; gap: var(--s-3); width: 100%; min-height: 64px; margin: 0 0 var(--s-4);
  padding: var(--s-2) var(--s-3); background: var(--white); border: 1px solid var(--hair); border-radius: var(--r-md);
  text-align: left; color: var(--ink); }
.who-row img { width: 40px; height: 48px; border-radius: var(--r-sm); object-fit: cover; object-position: top;
  background: var(--blue-50); flex: none; }
.who-row b { display: block; font-size: var(--t-md); font-weight: 700; line-height: 1.25; }
.who-row small { display: block; font-size: var(--t-xs); font-weight: 600; color: var(--ink-2); margin-top: 2px; }

.group { background: var(--white); border: 1px solid var(--hair); border-radius: var(--r-md); overflow: hidden; margin: 0 0 var(--s-4); }
.group .li { display: flex; align-items: flex-start; gap: var(--s-3); width: 100%; padding: var(--s-3) var(--s-4);
  min-height: 56px; background: none; border: 0; border-top: 1px solid var(--hair); text-align: left; }
.group .li:first-child { border-top: 0; }
.group .li .at { flex: 0 0 52px; font-size: var(--t-md); font-weight: 700; color: var(--blue-700); font-variant-numeric: tabular-nums; }
.group .li .tx { flex: 1; min-width: 0; }
.group .li .tx b { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
  font-size: var(--t-md); font-weight: 600; line-height: 1.35; }
.group .li .tx small { display: block; font-size: var(--t-xs); color: var(--ink-2); margin-top: 2px; }
.group .li.open { background: var(--yellow-100); box-shadow: inset 4px 0 0 var(--yellow); }
.group .li.more { align-items: center; min-height: 48px; font-size: var(--t-sm); font-weight: 700; color: var(--navy); background: var(--wash); }

.eyebrow { font-size: var(--t-xs); font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink-2); margin: var(--s-5) 0 var(--s-2); }
.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s-3); margin: 0 0 var(--s-4); }
.tiles .btn, .tile {
  flex-direction: column; justify-content: center; gap: var(--s-2); margin: 0; min-height: 92px;
  padding: var(--s-3); background: var(--white); color: var(--ink); border: 1px solid var(--hair);
  border-radius: var(--r-md); font-size: var(--t-sm); font-weight: 600; text-align: center;
}
.tiles .btn:hover { border-color: var(--navy); background: var(--blue-50); }
.tiles .btn .fa { width: 24px; height: 24px; color: var(--ink-2); }
.tiles .btn.wide { grid-column: 1 / -1; flex-direction: row; min-height: 56px; }

.trio { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-2); margin: var(--s-2) 0 var(--s-4); }
.trio .m { background: var(--white); border: 1px solid var(--hair); border-radius: var(--r-md); padding: var(--s-2);
  text-align: center; min-width: 0; cursor: pointer; box-shadow: var(--shadow-1); }
.trio .m.you { border: 2px solid var(--navy); }
.trio img { width: 100%; aspect-ratio: 3 / 4; border-radius: var(--r-sm); object-fit: cover; object-position: top;
  background: var(--blue-50); display: block; }
.trio .f { font-size: var(--t-sm); font-weight: 700; margin-top: var(--s-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trio .o { font-size: var(--t-xs); color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mine { display: inline-flex; align-items: center; min-height: var(--tap); font-size: var(--t-sm); font-weight: 700;
  color: var(--blue-700); cursor: pointer; }

/* ---- bottom navigation and the More sheet ----------------------------------------------------- */
#bnav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom); background: var(--white); border-top: 1px solid var(--hair);
  display: flex; justify-content: center; }
#bnav .inner { display: flex; width: 100%; max-width: 640px; }
#bnav button { flex: 1; min-width: 0; min-height: var(--nav-h); display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 3px; background: none; border: 0; color: var(--ink-2); font-size: var(--t-xs);
  font-weight: 700; padding: var(--s-2) 0; position: relative; }
#bnav button .fa { width: 22px; height: 22px; color: var(--ink-3); transition: color var(--ease); }
#bnav button[aria-current="page"] { color: var(--navy); }
#bnav button[aria-current="page"] .fa { color: var(--navy); }
#bnav button[aria-current="page"]::before { content: ""; position: absolute; top: -1px; left: 0; right: 0; height: 2px;
  background: var(--navy); }
body[data-screen="login"] #bnav, body[data-screen="setup"] #bnav, body[data-screen="write"] #bnav { display: none; }
body[data-screen="login"] main, body[data-screen="setup"] main, body[data-screen="write"] main { padding-bottom: var(--s-6); }

#sheet { position: fixed; inset: 0; z-index: 60; display: none; }
#sheet.on { display: block; }
#sheet .scrim { position: absolute; inset: 0; background: rgba(9, 29, 99, .5); }
#sheet .panel { position: absolute; left: 0; right: 0; bottom: 0; max-width: 640px; margin: 0 auto; background: var(--white);
  border-radius: var(--r-lg) var(--r-lg) 0 0; padding: var(--s-3) var(--s-4) calc(var(--s-5) + env(safe-area-inset-bottom));
  box-shadow: var(--shadow-2); animation: rise var(--ease) both; max-height: 86dvh; overflow: auto; }
#sheet .grab { width: 40px; height: 4px; border-radius: 2px; background: var(--grey); margin: 0 auto var(--s-4); }
#sheet h2 { font-size: var(--t-lg); }
#sheet .list { display: flex; flex-direction: column; margin-top: var(--s-3); }
#sheet .list button { display: flex; align-items: center; gap: var(--s-3); width: 100%; min-height: 52px; padding: 0 var(--s-2);
  background: none; border: 0; border-bottom: 1px solid var(--hair); font-size: var(--t-md); font-weight: 600; text-align: left; color: var(--ink); }
#sheet .list button .fa { width: 20px; height: 20px; color: var(--ink-2); flex: none; }
#sheet .gl { font-size: var(--t-xs); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2);
  padding: var(--s-4) var(--s-2) var(--s-1); }
#sheet .gl:first-child { padding-top: 0; }
#sheet .list button.danger { color: var(--orange-700); }
#sheet .list button.danger .fa { color: var(--orange-700); }

/* ---- lists ------------------------------------------------------------------------------------- */
.plist { max-width: none; }
.plist .r, .ptr, .lit, .docrow, .lbrow {
  display: flex; align-items: center; gap: var(--s-3); min-height: 64px; padding: var(--s-2) var(--s-3);
  background: var(--white); border: 1px solid var(--hair); border-radius: var(--r-md); margin: 0 0 var(--s-2);
  cursor: pointer; box-shadow: var(--shadow-1);
}
.plist .r.you { border: 2px solid var(--navy); }
.plist img, .plist .ini { width: 44px; height: 56px; border-radius: var(--r-sm); object-fit: cover; object-position: top;
  background: var(--blue-50); flex: none; }
.plist .t { flex: 1; min-width: 0; }
.plist .t b { display: block; font-size: var(--t-md); font-weight: 700; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plist .t span { display: block; font-size: var(--t-xs); color: var(--ink-2); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plist .t em { display: block; font-style: normal; font-size: var(--t-xs); color: var(--ink-2); margin-top: 2px; }
.plist .cc { font-weight: 700; color: var(--navy); }
.plist .dot, .lit .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--blue-700); flex: none; }
.plist .gh, .docgroup { position: sticky; top: var(--head-h); z-index: 5; font-size: var(--t-xs); font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--ink-2); margin: var(--s-4) 0 var(--s-2); padding: var(--s-1) 0; background: var(--wash); }
.ptabs { display: flex; gap: var(--s-2); margin: 0 0 var(--s-3); max-width: none; }
.ptabs .pt { flex: 1; }
.psearch { margin: 0 0 var(--s-3); max-width: none; font-size: var(--t-md); }
.ptr img, .ptr .no { width: 72px; height: 48px; border-radius: var(--r-sm); object-fit: cover; flex: none; background: var(--blue-100); }
.ptr .pn { flex: 1; font-size: var(--t-md); font-weight: 700; }
.ptr .pss { font-size: var(--t-xs); color: var(--ink-2); font-weight: 500; margin-top: 2px; }
.lit img { width: 56px; height: 56px; border-radius: var(--r-sm); object-fit: cover; flex: none; }
.lit .lb { flex: 1; min-width: 0; }
.lit .lt { font-size: var(--t-md); font-weight: 700; line-height: 1.3; }
.lit .ls { font-size: var(--t-xs); color: var(--ink-2); margin-top: 2px; }
.lit .done { color: var(--ok); font-weight: 700; font-size: var(--t-md); }
.docrow { justify-content: space-between; min-height: 56px; }
.docrow .doct { font-size: var(--t-md); font-weight: 600; color: var(--ink); }
.docrow .docm { font-size: var(--t-xs); color: var(--ink-2); white-space: nowrap; flex: none; }
.docrow.open .docm { color: var(--blue-700); font-weight: 700; }
.docrow.locked, .aidoc.locked { opacity: 1; background: var(--wash); }
.docrow.locked .doct, .aidoc.locked .aidoct { color: var(--ink-3); }

/* ---- programme ---------------------------------------------------------------------------------- */
.adays { display: flex; gap: var(--s-2); overflow-x: auto; margin: 0 calc(var(--s-4) * -1) var(--s-3); padding: var(--s-1) var(--s-4);
  scrollbar-width: none; position: sticky; top: var(--head-h); z-index: 6; background: var(--wash); }
.adays::-webkit-scrollbar { display: none; }
.aday { flex: none; }
.aitem { display: flex; gap: var(--s-3); padding: var(--s-3) var(--s-3); background: var(--white); border: 1px solid var(--hair);
  border-radius: var(--r-md); margin: 0 0 var(--s-2); }
.aitem .at { flex: 0 0 56px; font-size: var(--t-md); font-weight: 700; color: var(--blue-700); font-variant-numeric: tabular-nums; }
.aitem .ab { flex: 1; min-width: 0; }
.aitem .ti { font-size: var(--t-md); font-weight: 600; line-height: 1.35; }
.aitem .su { font-size: var(--t-xs); color: var(--ink-2); margin-top: 3px; }
.aitem .mv { font-size: var(--t-xs); font-weight: 700; color: var(--orange-700); margin-top: 3px; }
.prow .mvop { font-size: var(--t-xs); font-weight: 700; color: var(--orange-700); margin-top: 3px; }
.tchg { display: contents; }
.tchg > button { align-self: flex-start; min-height: 36px; box-sizing: border-box; }
.tchg .tform { flex: 1 0 100%; display: flex; flex-wrap: wrap; gap: var(--s-2); margin-top: 0; }
.tchg .tform[hidden] { display: none; }
.tchg .tform input { font: inherit; font-size: var(--t-sm); padding: 8px 10px; border: 1px solid var(--hair); border-radius: var(--r-md);
  background: var(--white); color: var(--ink); min-width: 0; max-width: 100%; }
.aitem.moved .at { color: var(--orange-700); }
.aitem.open { background: var(--yellow-100); border-color: var(--yellow); margin: 0 0 var(--s-2); padding: var(--s-3); }
.aitem.open .at { color: var(--orange-700); }
.aidocs { margin-top: var(--s-2); display: flex; flex-direction: column; border-top: 1px solid var(--row-line, var(--hair)); }
.aidoc { display: block; min-height: 0; padding: 7px 0; border: 0; border-bottom: 1px solid var(--row-line, var(--hair));
  border-radius: 0; background: none; color: inherit; text-decoration: none; }
.aidoc[hidden] { display: none; }
.aidoc .aidoct { position: relative; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
  padding-left: 22px; font-size: var(--t-sm); font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.aidoc .aidoct::before { content: ""; position: absolute; left: 2px; top: 2px; width: 13px; height: 15px; background: var(--blue-700);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 384 512'%3E%3Cpath d='M64 0C28.7 0 0 28.7 0 64v384c0 35.3 28.7 64 64 64h256c35.3 0 64-28.7 64-64V160H256c-17.7 0-32-14.3-32-32V0H64zm192 0v128h128L256 0z'/%3E%3C/svg%3E") center/contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 384 512'%3E%3Cpath d='M64 0C28.7 0 0 28.7 0 64v384c0 35.3 28.7 64 64 64h256c35.3 0 64-28.7 64-64V160H256c-17.7 0-32-14.3-32-32V0H64zm192 0v128h128L256 0z'/%3E%3C/svg%3E") center/contain no-repeat; }
.aidoc.locked .aidoct::before { background: var(--ink-3); }
.aidoc .aidocm { display: block; padding-left: 22px; margin-top: 1px; font-size: var(--t-xs); color: var(--ink-2); }
.aidocmore { align-self: flex-start; margin: 6px 0 0 22px; padding: 4px 0; border: 0; background: none; font: inherit;
  font-size: var(--t-xs); font-weight: 700; color: var(--blue-700); cursor: pointer; }

/* ---- writing ----------------------------------------------------------------------------------- */
.timer { display: flex; align-items: baseline; gap: var(--s-2); margin: 0 0 var(--s-3); }
.timer .clock { font-size: var(--t-2xl); font-weight: 700; line-height: 1; color: var(--navy);
  font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.timer .clock.low { color: var(--orange-700); }
.timer .clock.over { color: var(--orange-700); }
.timer .clock.crit { animation: pulse 1s steps(2, start) infinite; }
@keyframes pulse { 50% { opacity: .4; } }
.timer .u { font-size: var(--t-xs); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); }
.prompt { font-size: var(--t-lg); font-weight: 600; line-height: 1.45; margin: 0 0 var(--s-3); }
.seal { display: flex; gap: var(--s-3); align-items: flex-start; background: var(--blue-50); border: 1px solid var(--blue-100);
  border-radius: var(--r-md); padding: var(--s-3); margin: 0 0 var(--s-3); }
.seal .ic { width: 22px; height: 22px; border-radius: 50%; background: var(--navy); color: var(--white); font-size: var(--t-xs);
  font-weight: 700; font-style: italic; font-family: Georgia, serif; display: flex; align-items: center; justify-content: center; flex: none; }
.seal p { font-size: var(--t-sm); line-height: 1.5; color: var(--ink); margin: 0; }
.meta { display: flex; justify-content: space-between; align-items: center; margin: var(--s-2) 0 0; font-size: var(--t-xs); font-weight: 600; color: var(--ink-2); }
.meta .saved { color: var(--blue-700); }
#s-write #submit { position: sticky; bottom: calc(var(--s-3) + env(safe-area-inset-bottom)); z-index: 5; box-shadow: var(--shadow-2); }
.count { background: var(--navy); color: var(--white); border-radius: var(--r-md); padding: var(--s-4); margin: 0 0 var(--s-4);
  display: flex; align-items: baseline; gap: var(--s-2); }
.count .n { font-size: var(--t-2xl); font-weight: 700; line-height: 1; }
.count .l { font-size: var(--t-sm); color: var(--blue-100); }
.card p { font-size: var(--t-md); line-height: 1.65; color: var(--ink); margin: 0; }
.card .who { font-size: var(--t-xs); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); margin: 0 0 var(--s-2); }
.card.rev .who { color: var(--navy); }
.card .rd { width: 100%; min-height: 48px; margin-top: var(--s-3); background: var(--white); color: var(--navy);
  border: 2px solid var(--navy); border-radius: var(--r-md); font-size: var(--t-sm); font-weight: 700; }

/* ---- card of a person ------------------------------------------------------------------------- */
.pers { display: flex; gap: var(--s-4); align-items: flex-start; margin: 0 0 var(--s-4); }
.pers img, .pers .ini { width: 96px; height: 120px; border-radius: var(--r-md); object-fit: cover; object-position: top;
  background: var(--blue-50); flex: none; }
.pers .ini { display: flex; align-items: center; justify-content: center; font-size: var(--t-xl); font-weight: 700; color: var(--navy); }
.pers h1 { font-size: var(--t-xl); line-height: 1.2; margin: 0; }
.pers .ct { font-size: var(--t-sm); font-weight: 600; color: var(--blue-700); margin-top: var(--s-2); line-height: 1.4; }
.pers .sm { font-size: var(--t-sm); color: var(--ink-2); margin-top: var(--s-1); }
.pers .ab { color: var(--navy); font-weight: 600; }
.prows { display: grid; grid-template-columns: 1fr; gap: 0; }
.prow { border-top: 1px solid var(--hair); padding: var(--s-3) 0; }
.prow .l { font-size: var(--t-xs); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); margin-bottom: var(--s-1); }
.prow .l .fa { color: var(--ink-3); margin-right: var(--s-1); }
.prow .v { font-size: var(--t-md); line-height: 1.55; color: var(--ink); word-break: break-word; }
.prow .v a { color: var(--blue-700); }
.fld { margin: 0 0 var(--s-4); }
.fld .h { font-size: var(--t-xs); color: var(--ink-2); line-height: 1.5; margin-bottom: var(--s-1); }
.fld textarea { min-height: 132px; line-height: 1.55; resize: vertical; }
.fld input { min-height: 52px; }
.fld.key label { color: var(--orange-700); }

/* ---- ports, pieces, log, questionnaire --------------------------------------------------------- */
.pdw h3 { font-size: var(--t-xl); margin: 0 0 var(--s-1); }
.pdw .st { font-size: var(--t-sm); color: var(--ink-2); margin-bottom: var(--s-4); }
.pdw h4 { font-size: var(--t-xs); letter-spacing: .08em; text-transform: uppercase; color: var(--blue-700); margin: var(--s-5) 0 var(--s-2); }
.pdw li, .pdw p { font-size: var(--t-md); line-height: 1.6; }
.pdw .src, .pdw .cap { font-size: var(--t-xs); color: var(--ink-2); }
.fig { display: flex; flex-wrap: wrap; gap: var(--s-3); }
.fig div { flex: 1 1 42%; background: var(--white); border: 1px solid var(--hair); border-radius: var(--r-md); padding: var(--s-3); }
.fig .fv { font-size: var(--t-xl); font-weight: 700; color: var(--blue-700); line-height: 1.1; }
.fig .fu, .fig .fl { font-size: var(--t-xs); color: var(--ink-2); }
.rt .op { font-size: var(--t-sm); font-weight: 700; }
.rt .to { font-size: var(--t-sm); color: var(--ink-2); line-height: 1.5; }
.pcw p { font-size: var(--t-md); line-height: 1.7; text-align: left; hyphens: manual; }
.pcw h3 { font-size: var(--t-xl); }
.pcw .by, .pcw .cred, .pcw figcaption { font-size: var(--t-xs); color: var(--ink-2); }
.rx { display: flex; gap: var(--s-2); margin: var(--s-5) 0 0; }
.rx span { min-width: var(--tap); min-height: var(--tap); display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--r-md); background: var(--blue-50); font-size: var(--t-lg); cursor: pointer; }
.rx span.on { background: var(--blue-700); }
.lbcover { background: var(--navy); color: var(--white); border-radius: var(--r-lg); padding: var(--s-4); margin: 0 0 var(--s-4); }
.lbcover .t { font-size: var(--t-xs); letter-spacing: .14em; color: var(--blue-100); margin-bottom: var(--s-1); }
.lbrow .tt .n { font-size: var(--t-md); font-weight: 700; }
.lbrow .tt .s { font-size: var(--t-xs); color: var(--ink-2); margin-top: 2px; }
.lbst { font-size: var(--t-sm); font-weight: 700; white-space: nowrap; }
.lbst.info, .lbst.closed { color: var(--ink-2); font-weight: 600; }
.lbst.green { color: var(--ok); }
.lbst.red { color: var(--orange-700); }
.lbst.done { color: var(--navy); }
.fq { display: flex; gap: var(--s-3); padding: var(--s-3) 0; border-bottom: 1px solid var(--hair); align-items: center; }
.fq .fql { flex: 1; font-size: var(--t-md); }
.fq .fqn { font-size: var(--t-xs); color: var(--ink-2); flex: 0 0 56px; text-align: right; }
.fq button { min-height: var(--tap); min-width: 64px; padding: 0 var(--s-3); border-radius: var(--r-md); font-size: var(--t-sm);
  font-weight: 700; border: 2px solid var(--navy); }
.fq button.on { background: var(--navy); color: var(--white); }
.fq button.off { background: var(--white); color: var(--navy); }
.guide { max-width: 32em; margin: 0 auto; }
.guide .g-lede { font-size: var(--t-lg); line-height: 1.5; color: var(--ink); margin: 0 0 var(--s-5); }
.guide h3 { font-size: var(--t-xs); letter-spacing: .1em; text-transform: uppercase; color: var(--blue-700); margin: var(--s-5) 0 var(--s-1); }
.guide p { font-size: var(--t-md); line-height: 1.65; color: var(--ink); margin: 0 0 var(--s-3); }
.guide .g-foot { font-size: var(--t-sm); color: var(--ink-2); border-top: 1px solid var(--hair); padding-top: var(--s-4); }
.su-card { background: var(--white); border: 1px solid var(--hair); border-radius: var(--r-md); padding: var(--s-4); margin: 0 0 var(--s-3); }
.su-card b.sys { display: block; font-size: var(--t-xs); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); margin-bottom: var(--s-1); }
.su-card p, .su-then { font-size: var(--t-md); line-height: 1.6; color: var(--ink); margin: 0; }
#prep { font-size: var(--t-xs); color: var(--ink-2); margin-top: var(--s-4); min-height: 1em; }
.cd-legal, .cd-note, .cd-sub { font-size: var(--t-xs); color: var(--ink-2); }

/* every button on a student screen is a target worth hitting with a thumb */
.app-student .screen button:not(.btn) { min-height: var(--tap); }
.app-student .screen .btn.o.colophon { width: auto; margin: var(--s-4) auto 0; }

/* buttons that carry an inline look from before the system: the same navy, the same green */
.btn[style*="background:#0f4099"], .btn[style*="background:#0F7B4F"], .btn[style*="background:#0d2b8c"] { border: 2px solid transparent !important; }
.btn[style*="background:#0f4099"] { background: var(--navy) !important; }
.btn[style*="background:#0F7B4F"] { background: var(--ok) !important; }
.btn[style*="background:#fff"] { background: var(--white) !important; color: var(--navy) !important; border: 2px solid var(--hair) !important; }

/* long-tail guards for inline styles that predate the system: never below 12 px, never a pale grey */
[style*="font-size:9px"], [style*="font-size:10px"], [style*="font-size:10.5px"], [style*="font-size:11px"],
[style*="font-size:11.5px"] { font-size: var(--t-xs) !important; }
[style*="color:#8794a4"], [style*="color:#8794A4"], [style*="color:#8d97a6"], [style*="color:#7A879B"],
[style*="color:#7b8794"], [style*="color:#6B7789"], [style*="color:#6b7688"], [style*="color:#8794a4"] { color: var(--ink-2) !important; }

/* =====================================================================================================
   OPERATOR CONSOLE  (body.app-op)
   ===================================================================================================== */
body.app-op { padding: 0; }
.app-op header { position: sticky; top: 0; z-index: 50; min-height: var(--head-h); padding: env(safe-area-inset-top) var(--s-4) 0;
  background: var(--navy); color: var(--white); display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); }
.app-op header .brand { display: flex; align-items: center; gap: var(--s-2); }
.app-op header .mark { font-size: var(--t-sm); font-weight: 700; color: var(--white); }
.app-op header .d1 { color: var(--sky); } .app-op header .d2 { color: var(--blue-100); }
.app-op header .side { display: flex; align-items: center; gap: var(--s-2); }
.app-op header .who { font-size: var(--t-xs); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--blue-100); }
.app-op header .escola { height: 26px; width: auto; }
.app-op header button { min-height: var(--tap); min-width: var(--tap); border-radius: var(--r-md); }
.app-op header .help { width: var(--tap); height: var(--tap); padding: 0; border-radius: 50%; border: 1.5px solid rgba(255,255,255,.6); background: transparent;
  color: var(--white); font-weight: 700; }
.app-op main { flex: 1; width: 100%; max-width: 760px; margin: 0 auto; padding: var(--s-4) var(--s-4) calc(var(--nav-h) + var(--s-6) + env(safe-area-inset-bottom)); }
.app-op .gate { max-width: 420px; margin: var(--s-6) auto 0; background: var(--white); border: 1px solid var(--hair);
  border-radius: var(--r-lg); padding: var(--s-5); box-shadow: var(--shadow-1); }
.app-op .gate p { font-size: var(--t-sm); color: var(--ink-2); }
.app-op .gate input { text-align: center; letter-spacing: .2em; font-weight: 700; text-transform: uppercase; }

#coursebar { position: sticky; top: var(--head-h); z-index: 45; margin: 0 calc(var(--s-4) * -1) var(--s-3) !important;
  border-radius: 0 !important; padding: var(--s-2) var(--s-4) !important; background: var(--blue-50) !important;
  border-bottom: 1px solid var(--blue-100); }
#coursebar { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); font-size: var(--t-sm); color: var(--ink); }
#coursebar .cb-name { display: flex; flex-direction: column; min-width: 0; }
#coursebar .cb-name small { font-size: var(--t-xs); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); }
#coursebar .cb-name b { font-size: var(--t-md); color: var(--navy); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#coursebar button { min-height: var(--tap); padding: 0 var(--s-4); background: var(--white); color: var(--navy); border: 1.5px solid var(--navy);
  border-radius: var(--r-md); font-size: var(--t-sm); font-weight: 700; flex: none; }

/* navigation: a bottom bar on a phone, a left rail on a desk. The same ten tabs, grouped. */
.opnav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 55; display: flex; flex-wrap: nowrap; gap: 0; margin: 0;
  background: var(--white); border-top: 1px solid var(--hair); padding-bottom: env(safe-area-inset-bottom); }
.opnav .opt { flex: 1; min-width: 0; min-height: var(--nav-h); flex-direction: column; gap: 3px; border-radius: 0; padding: var(--s-2) 0;
  background: none; color: var(--ink-2); font-size: var(--t-xs); font-weight: 700; position: relative; }
.opnav .opt .fa { width: 22px; height: 22px; margin: 0; color: var(--ink-3); }
.opnav .opt.on { background: none; color: var(--navy); }
.opnav .opt.on .fa { color: var(--navy); }
.opnav .opt.on::before { content: ""; position: absolute; top: -1px; left: 0; right: 0; height: 2px; background: var(--navy); }
.opnav .opt.sec { display: none; }                         /* secondary tabs live in the More sheet on a phone */
.opnav .opt.more { display: flex; }
.opnav.more-open .opt.sec { display: flex; position: fixed; left: var(--s-4); right: var(--s-4); background: var(--white); }
#opmore { position: fixed; inset: 0; z-index: 54; display: none; }
#opmore.on { display: block; }
#opmore .scrim { position: absolute; inset: 0; background: rgba(9,29,99,.5); }
#opmore .panel { position: absolute; left: 0; right: 0; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom)); background: var(--white);
  border-radius: var(--r-lg) var(--r-lg) 0 0; padding: var(--s-4); box-shadow: var(--shadow-2); animation: rise var(--ease) both; }
#opmore .grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-2); }
#opmore .grid button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--s-1);
  min-height: 80px; background: var(--wash); border: 1px solid var(--hair); border-radius: var(--r-md); font-size: var(--t-sm); font-weight: 700; color: var(--ink); }
#opmore .grid button .fa { width: 24px; height: 24px; color: var(--ink-2); }
#opmore .grid button.on { background: var(--navy); color: var(--white); border-color: var(--navy); }
#opmore .grid button.on .fa { color: var(--white); }

.opnav .grp { display: none; }
.opnav .deskonly { display: none; }                      /* only the sidebar of a computer has these */
@media (min-width: 900px) {
  .app-op header { z-index: 60; }
  /* the content sits in the middle of what is left beside the sidebar */
  .app-op main { margin-left: max(232px, calc(232px + (100% - 232px - 880px) / 2)); margin-right: 0; width: min(880px, calc(100% - 232px)); max-width: none; padding-bottom: var(--s-6); }
  /* the sign-in and the course panel have no sidebar beside them: they sit in the middle of the window */
  .app-op main:has(> #app[style*="none"]) { margin-left: auto; width: 100%; }
  .app-op header { padding-left: 248px; justify-content: flex-end; }   /* the buttons on the right, as in the student app */
  .app-op header .brand { position: fixed; left: var(--s-4); top: 14px; z-index: 60; }
  .opnav { top: 0; bottom: 0; right: auto; width: 216px; flex-direction: column; padding: var(--head-h) var(--s-2) var(--s-4);
    border-top: 0; border-right: 1px solid var(--hair); box-shadow: none; overflow-y: auto; }
  .opnav .opt { flex: none; flex-direction: row; justify-content: flex-start; gap: var(--s-3); min-height: 48px; padding: 0 var(--s-3);
    border-radius: var(--r-md); font-size: var(--t-sm); }
  .opnav .opt.on { background: var(--blue-50); color: var(--navy); }
  .opnav .opt.on::before { display: none; }
  .opnav .opt.sec { display: flex; }
  .opnav .opt.more { display: none; }
  .opnav span.grp.deskonly { display: block; }
  .opnav .opt.deskonly { display: flex; }
  .opnav .grp { display: block; font-size: var(--t-xs); font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
    color: var(--ink-3); margin: var(--s-4) var(--s-3) var(--s-1); }
  #coursebar { margin: 0 0 var(--s-3) !important; border-radius: var(--r-md) !important; position: static; }
}

/* sections of the console */
.app-op main button:not(.rte-btn):not(.acts button) { min-height: var(--tap); min-width: var(--tap); }
.vbox small { color: var(--ink-2); }
.tally .n, .tally .l { background: none !important; border: 0 !important; padding: 0 !important; box-shadow: none !important; }
.app-op header .who { display: none; }
@media (min-width: 900px) { .app-op header .who { display: inline; } }
.row .nm b { white-space: normal; font-size: 15px; }
#pane-board > .vbtn, #pane-board [style*="flex-wrap:wrap"] .vbtn { flex: none; }
#pane-board [style*="flex-wrap:wrap"] { flex-wrap: nowrap !important; overflow-x: auto; margin-left: calc(var(--s-4) * -1) !important;
  margin-right: calc(var(--s-4) * -1) !important; padding: 0 var(--s-4); scrollbar-width: none; }
#pane-board [style*="flex-wrap:wrap"] .vbtn { white-space: nowrap; }
.dfh { font-size: var(--t-xs); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); margin: var(--s-4) 0 var(--s-2); }
.legs { display: flex; gap: var(--s-2); flex-wrap: wrap; margin: 0 0 var(--s-3); }
.legs button, .legs span.leg { flex: 1; min-height: var(--tap); padding: 0 var(--s-3); border: 1.5px solid var(--hair); background: var(--white);
  border-radius: var(--r-md); font-size: var(--t-sm); font-weight: 700; color: var(--ink-2); }
.legs button.on, .legs span.leg.on { background: var(--navy); color: var(--white); border-color: var(--navy); }
.tally { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s-2); margin: 0 0 var(--s-3); }
.tally > div { background: var(--white); border: 1px solid var(--hair); border-radius: var(--r-md); padding: var(--s-3) var(--s-2); text-align: center; }
.tally .n { font-size: var(--t-xl); font-weight: 700; line-height: 1.1; color: var(--ink); font-variant-numeric: tabular-nums; }
.tally .l { font-size: var(--t-xs); font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-2); margin-top: 2px; }
.tally .c .n { color: var(--ok); } .tally .a .n { color: var(--orange-700); } .tally .u .n { color: var(--navy); }
.filter { margin: 0 0 var(--s-3); }
.row { display: flex; align-items: center; gap: var(--s-2); padding: var(--s-2); margin: 0 0 var(--s-2); min-height: 64px; }
.row.yes, .row.no { background: var(--white); border-color: var(--hair); }
.row.yes { box-shadow: inset 4px 0 0 var(--ok); }
.row.no { box-shadow: inset 4px 0 0 var(--orange-700); }
.row .av { width: 40px; height: 52px; border-radius: var(--r-sm); object-fit: cover; object-position: top; background: var(--blue-50); flex: none; }
.row .nm { flex: 1; min-width: 0; }
.row .nm b { display: block; font-size: var(--t-md); font-weight: 700; line-height: 1.25; }
.row .nm span { display: block; font-size: var(--t-xs); color: var(--ink-2); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acts { display: flex; gap: 6px; flex: none; }
.acts button { width: 44px; height: 44px; padding: 0; border-radius: var(--r-md); border: 2px solid var(--grey); background: var(--white); color: var(--ink-2); }
.acts .y.on { background: var(--ok); border-color: var(--ok); color: var(--white); }
.acts .n.on { background: var(--orange-700); border-color: var(--orange-700); color: var(--white); }
.acts button .fa { width: 20px; height: 20px; }
.vbox .vrow2, .vbox .vrow { grid-template-columns: minmax(0, 1fr) !important; }
.vbox .vrow { grid-template-columns: 2.2em minmax(0, 1fr) minmax(0, 1fr) !important; }
.vbox .vrow2 > button { justify-self: start; }
@media (min-width: 560px) { .vbox .vrow2 { grid-template-columns: repeat(2, minmax(0, 1fr)) auto !important; } }
.vbox input { min-width: 0; }
/* clip, not hidden: hidden would make body a scroll container and break every sticky bar */
html, body { max-width: 100%; overflow-x: clip; }
.vbtn { display: inline-flex; align-items: center; justify-content: center; min-height: var(--tap); padding: 0 var(--s-4);
  border: 2px solid var(--navy); border-radius: var(--r-md); background: var(--navy); color: var(--white); font-size: var(--t-sm); font-weight: 700; }
.vbtn.g { background: var(--white); color: var(--navy); }
.vbox { padding: var(--s-4); margin: 0 0 var(--s-4); }
.vbox input, .din { min-height: 44px; }
.dgroup { position: sticky; top: calc(var(--head-h) + 56px); z-index: 4; font-size: var(--t-xs); font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--ink-2); margin: var(--s-4) 0 var(--s-2); padding: var(--s-2) 0; background: var(--wash); display: flex; align-items: center; gap: var(--s-2); flex-wrap: wrap; }
.tsel { min-height: var(--tap); max-width: 11em; font-size: var(--t-sm); font-weight: 600; color: var(--navy); }
.pit { display: flex; gap: var(--s-3); align-items: flex-start; padding: var(--s-3); background: var(--white); border: 1px solid var(--hair);
  border-radius: var(--r-md); margin: 0 0 var(--s-2); }
.pit .pt { flex: 0 0 52px; font-size: var(--t-md); font-weight: 700; color: var(--blue-700); background: none; min-height: 0; padding: 0; justify-content: flex-start; }
.pit .pb { flex: 1; font-size: var(--t-md); line-height: 1.35; min-width: 0; }
.pit .ps { font-size: var(--t-xs); color: var(--ink-2); margin-top: 3px; }
.pit.isopen { background: var(--yellow-100); border-color: var(--yellow); }
.pit.isclosed { opacity: .75; }
.pit button { min-height: var(--tap); padding: 0 var(--s-3); border: 2px solid var(--navy); border-radius: var(--r-md); background: var(--white);
  color: var(--navy); font-size: var(--t-sm); font-weight: 700; flex: none; }
.arr, .pv { background: var(--white); border: 1px solid var(--hair); border-radius: var(--r-md); padding: var(--s-3); margin: 0 0 var(--s-3); font-size: var(--t-sm); }
.pv .clash { background: var(--orange-100); color: var(--orange-700); border-radius: var(--r-sm); padding: var(--s-3); font-size: var(--t-sm); font-weight: 600; }
.pv .go { background: var(--ok); color: var(--white); min-height: 48px; }
.pv .no { background: var(--white); color: var(--ink); border: 1.5px solid var(--hair); min-height: 48px; }
.dcheck { display: flex; gap: var(--s-2); align-items: center; font-size: var(--t-sm); }
.dcheck input { width: 22px; height: 22px; min-height: 0; }
.fq .fqi { display: flex; align-items: center; justify-content: center; flex: 0 0 28px; color: var(--ink-2); }
.fq .fqi .fa { width: 20px; height: 20px; }
.rte-btn { min-width: var(--tap); min-height: var(--tap); }
.rte { border-radius: var(--r-md); }
.heat div { aspect-ratio: auto; }

/* =====================================================================================================
   PRINT (the guide and the closing file are the only things anybody prints from the app)
   ===================================================================================================== */
@media print {
  header, #bnav, .opnav, #sheet, #opmore, #offline, .back { display: none !important; }
  body { background: #fff; }
  main { max-width: none; padding: 0; margin: 0; }
}

/* =====================================================================================================
   ROUND 4: states with colour, switches, folds, checkpoints, the operator's question and text controls
   ===================================================================================================== */
.st { display: inline-flex; align-items: center; min-height: 24px; padding: 0 var(--s-2); border-radius: var(--r-sm);
  font-size: var(--t-xs); font-weight: 700; border: 1px solid transparent; white-space: nowrap; }
.st.run { background: var(--navy); color: var(--white); }
.st.late { background: var(--yellow-100); color: var(--ink); border-color: var(--yellow); }
.st.over, .st.new { background: var(--wash); color: var(--ink-2); border-color: var(--hair); }
.st.asked { background: var(--ok-100); color: var(--ok); }

.runbox { background: var(--white); border: 1px solid var(--hair); border-left: 6px solid var(--navy);
  border-radius: var(--r-lg); padding: var(--s-4); margin: 0 0 var(--s-4); }
.runbox.late { background: var(--yellow-100); border-left-color: var(--yellow); }
.runbox.over { background: var(--wash); border-left-color: var(--grey); }
.rb-head { display: flex; justify-content: space-between; align-items: center; gap: var(--s-2); flex-wrap: wrap; }
.rb-count { font-size: var(--t-sm); color: var(--ink-2); }
.rb-prompt { font-size: var(--t-lg); font-weight: 600; line-height: 1.4; margin: var(--s-3) 0; }
.rb-clock { display: flex; align-items: baseline; gap: var(--s-2); }
.rb-clock #wclock { font-size: var(--t-2xl); font-weight: 700; font-variant-numeric: tabular-nums; color: var(--navy); }
.rb-clock .u { font-size: var(--t-xs); font-weight: 700; color: var(--ink-2); text-transform: uppercase; letter-spacing: .06em; }
.rb-bar { height: 6px; background: var(--hair); border-radius: 3px; margin: var(--s-3) 0; overflow: hidden; }
.rb-bar div { height: 100%; background: var(--navy); }
.rb-help { font-size: var(--t-sm); line-height: 1.5; color: var(--ink-2); margin: 0 0 var(--s-3); }
.rb-row { display: flex; justify-content: space-between; align-items: center; gap: var(--s-3);
  padding: var(--s-3) 0; border-top: 1px solid var(--hair); }
.rb-row b { display: block; font-size: var(--t-md); }
.rb-row small { display: block; font-size: var(--t-xs); color: var(--ink-2); }
.rb-close p { font-size: var(--t-sm); margin: 0 0 var(--s-2); }
.rb-closebtn { margin-top: var(--s-1); }

button.sw { display: inline-flex; align-items: center; gap: var(--s-2); min-height: var(--tap); min-width: 108px;
  padding: 0 var(--s-4) 0 6px; border-radius: var(--r-pill); border: 2px solid var(--grey); background: var(--white);
  color: var(--ink-2); font-size: var(--t-sm); font-weight: 700; flex: none; }
button.sw .knob { width: 28px; height: 28px; border-radius: 50%; background: var(--grey); flex: none; }
button.sw.on { background: var(--ok); border-color: var(--ok); color: var(--white); flex-direction: row-reverse;
  padding: 0 6px 0 var(--s-4); }
button.sw.on .knob { background: var(--white); }
.fq { align-items: center; }
.fq .fql { flex: 1; min-width: 0; }
.fq .fql b { display: block; font-size: var(--t-md); font-weight: 600; }
.fq .fql small { display: block; font-size: var(--t-xs); color: var(--ink-2); margin-top: 2px; }
.fq.is-off .fql b, .fq.is-off .fqi { color: var(--ink-3); }

.qcard { background: var(--white); border: 1px solid var(--hair); border-radius: var(--r-lg);
  padding: var(--s-3) var(--s-4); margin: 0 0 var(--s-3); }
.qcard.running { border-color: var(--navy); box-shadow: inset 4px 0 0 var(--navy); }
.qmeta { display: flex; justify-content: space-between; align-items: center; gap: var(--s-2); margin: 0 0 var(--s-2); }
.qn { font-size: var(--t-xs); font-weight: 600; color: var(--ink-2); }
.qprompt { font-size: var(--t-md); line-height: 1.45; }
.qrules { font-size: var(--t-xs); color: var(--ink-2); margin-top: var(--s-2); }

details.fold { background: var(--white); border: 1px solid var(--hair); border-radius: var(--r-lg); margin: 0 0 var(--s-3); }
details.fold > summary { display: flex; flex-direction: column; gap: 2px; min-height: 56px; padding: var(--s-3) 44px var(--s-3) var(--s-4);
  cursor: pointer; list-style: none; position: relative; justify-content: center; }
details.fold > summary::-webkit-details-marker, .leg-d > summary::-webkit-details-marker { display: none; }
details.fold > summary::after, .leg-d > summary::after { content: ""; position: absolute; right: var(--s-4); top: 50%; width: 10px; height: 10px;
  border-right: 2px solid var(--ink-3); border-bottom: 2px solid var(--ink-3); transform: translateY(-70%) rotate(45deg); }
details[open] > summary::after { transform: translateY(-30%) rotate(-135deg); }
details.fold .t { font-size: var(--t-md); font-weight: 700; }
details.fold .s { font-size: var(--t-sm); color: var(--ink-2); line-height: 1.4; }
.fold-body { padding: 0 var(--s-4) var(--s-4); }
.leg-d { border: 1px solid var(--hair); border-radius: var(--r-md); margin: var(--s-2) 0; background: var(--wash); }
.leg-d > summary { display: flex; align-items: center; gap: var(--s-3); min-height: 60px; padding: var(--s-2) 40px var(--s-2) var(--s-3);
  cursor: pointer; list-style: none; position: relative; }
.leg-d .ln { width: 28px; height: 28px; border-radius: 50%; background: var(--navy); color: var(--white); display: flex;
  align-items: center; justify-content: center; font-weight: 700; font-size: var(--t-sm); flex: none; }
.leg-d .lt { flex: 1; min-width: 0; }
.leg-d .lt b { display: block; font-size: var(--t-md); }
.leg-d .lt small { display: block; font-size: var(--t-xs); color: var(--ink-2); line-height: 1.4; }
.leg-body { padding: var(--s-2) var(--s-3) var(--s-3); border-top: 1px solid var(--hair); }
.leg-acts { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-top: var(--s-3); }
.cprow { border-top: 1px solid var(--hair); padding: var(--s-3) 0; display: grid; gap: var(--s-2); }
.cpl b { display: block; font-size: var(--t-md); }
.cpl small { display: block; font-size: var(--t-xs); color: var(--ink-2); }
.cpw { display: flex; gap: var(--s-2); }
.cpw input { flex: 1; min-width: 0; }
.cpa { display: flex; gap: var(--s-2); flex-wrap: wrap; }
.cpadd { border-top: 1px solid var(--hair); padding-top: var(--s-3); display: grid; gap: var(--s-2); }

.legs.days { display: flex; flex-wrap: nowrap; gap: var(--s-2); overflow-x: auto; scrollbar-width: none; margin: 0 0 var(--s-3); }
.legs.days::-webkit-scrollbar { display: none; }
.legs.days span.leg { flex: 1 0 auto; min-width: 72px; display: flex; align-items: center; justify-content: center;
  text-align: center; margin: 0; padding: 0 var(--s-3); min-height: var(--tap); }

.pit.art { flex-direction: column; align-items: stretch; gap: var(--s-2); }
.pit.art .pt2 { font-size: var(--t-md); font-weight: 600; line-height: 1.35; margin-bottom: var(--s-1); }
.pit.art .ps { margin-top: var(--s-1); }
.pacts { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.pacts .vbtn { background: var(--navy); color: var(--white); }
.pacts .vbtn.g { background: var(--white); color: var(--navy); }
.pwait { display: flex; align-items: center; gap: var(--s-2); flex-wrap: wrap; font-size: var(--t-sm); font-weight: 600;
  text-transform: none; letter-spacing: 0; color: var(--ink); margin: 0; }
.pwait select { flex: 1; min-width: 12em; }
.pnote.ok { color: var(--ok); font-weight: 600; }
.ptr.q { align-items: flex-start; flex-wrap: wrap; padding: var(--s-3); }
.pit, .pit.isopen, .pit.isclosed { margin: 0 0 var(--s-2); }
.pit.isclosed { opacity: 1; background: var(--wash); }

/* =====================================================================================================
   ROUND 5: one button family, "add" bars at the top, rows with a mark and its time, cleaner management
   ===================================================================================================== */
.b { display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2); min-height: var(--tap);
  padding: 0 var(--s-4); border: 1.5px solid var(--grey); border-radius: var(--r-md); background: var(--white);
  color: var(--ink); font-size: var(--t-sm); font-weight: 700; line-height: 1.2; cursor: pointer; text-align: center;
  transition: background var(--ease), border-color var(--ease), color var(--ease); }
.b:hover { border-color: var(--blue-700); }
.b .fa { width: 16px; height: 16px; flex: none; }
.b.on, .b.arm, .b.blue { background: var(--blue-700); border-color: var(--blue-700); color: var(--white); }
.b.wide { width: 100%; }
.b.bad { color: var(--orange-700); }
.b.bad.arm { background: var(--orange-700); border-color: var(--orange-700); color: var(--white); }
.b.ic { width: var(--tap); padding: 0; }
.b:disabled { color: var(--ink-3); background: var(--wash); border-color: var(--hair); cursor: not-allowed; }
.b.quiet { border-color: transparent; background: none; color: var(--blue-700); padding: 0 var(--s-2); }

/* old button names now belong to the family: white, never a big coloured block */
.app-op .vbtn, .app-op .vbtn.g, .app-op .btn.o, .app-op .pacts .vbtn, .app-op .pacts .vbtn.g {
  background: var(--white); color: var(--ink); border: 1.5px solid var(--grey); }
.app-op .vbtn:hover, .app-op .btn.o:hover { border-color: var(--blue-700); background: var(--white); }
.app-op .vbtn.on, .app-op .vbtn.arm, .app-op .btn.o.arm, .app-op .btn.arm, .app-op .vbtn.blue {
  background: var(--blue-700); border-color: var(--blue-700); color: var(--white); }
.app-op .btn { width: auto; margin-top: 0; }
.app-op .gate .btn { width: 100%; margin-top: var(--s-3); }
.app-op .pv .go, .app-op .pv .no { background: var(--white); color: var(--ink); border: 1.5px solid var(--grey); min-height: var(--tap); }
.app-op .pv .go.arm { background: var(--blue-700); color: var(--white); border-color: var(--blue-700); }
.app-op button.sw.on { background: var(--blue-700); border-color: var(--blue-700); }

/* the bar that opens a form: always the first thing on the page */
.addbar { display: flex; gap: var(--s-2); flex-wrap: wrap; margin: 0 0 var(--s-3); }
.addbar .b { flex: 1 1 auto; }
.addbar .b.add.on { background: var(--blue-700); color: var(--white); border-color: var(--blue-700); }
.addform { background: var(--white); border: 1px solid var(--hair); border-radius: var(--r-lg); padding: var(--s-4);
  margin: 0 0 var(--s-4); }
.addform > .dfh:first-child { margin-top: 0; }
.addform .fr { display: flex; gap: var(--s-3); flex-wrap: wrap; }
.addform .fr > div { flex: 1 1 140px; min-width: 0; }
.addform .acts2 { display: flex; gap: var(--s-2); margin-top: var(--s-4); flex-wrap: wrap; }
.addform .sw-row, .qcard .runopts .sw-row { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3);
  padding: var(--s-3) 0; border-top: 1px solid var(--hair); }
.addform .sw-row b, .qcard .runopts .sw-row b { display: block; font-size: var(--t-sm); }
.addform .sw-row small, .qcard .runopts .sw-row small { display: block; font-size: var(--t-xs); color: var(--ink-2); }
.addform .din, .addform input, .addform select { margin-bottom: var(--s-2); }

/* the programme: a time, what, and a mark that turns blue with the moment it was made beneath it */
.prow { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: var(--s-2) var(--s-3); padding: var(--s-3);
  background: var(--white); border: 1px solid var(--hair); border-radius: var(--r-md); margin: 0 0 var(--s-2); }
.prow .pt { font-size: var(--t-md); font-weight: 700; color: var(--blue-700); font-variant-numeric: tabular-nums; }
.prow .pb { font-size: var(--t-md); line-height: 1.35; min-width: 0; }
.prow .pb .ps { font-size: var(--t-xs); color: var(--ink-2); margin-top: 2px; }
.prow .pm { grid-column: 2; display: flex; gap: var(--s-3); flex-wrap: wrap; align-items: flex-start; }
.prow .mk { display: flex; flex-direction: column; gap: 2px; }
.prow .mk .when { font-size: var(--t-xs); color: var(--ink-2); line-height: 1.3; max-width: 12em; }
.prow.running { background: var(--yellow-100); border-color: var(--yellow); }
.prow.done .pb { color: var(--ink-2); }
.prow.ev { border-left: 4px solid var(--navy); }
.prow.ev.cp { border-left-color: var(--yellow); }
.prow .tag { font-size: var(--t-xs); font-weight: 700; color: var(--ink-2); text-transform: uppercase; letter-spacing: .06em; }
.pgroup { font-size: var(--t-xs); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2);
  margin: var(--s-4) 0 var(--s-2); }

/* questions: colour says where each one stands */
.qlegend { display: flex; gap: var(--s-2); flex-wrap: wrap; margin: 0 0 var(--s-3); align-items: center; }
.qcard { border-left: 6px solid var(--hair); }
.qcard.run { border-left-color: var(--navy); background: var(--blue-50); }
.qcard.late { border-left-color: var(--yellow); background: var(--yellow-100); }
.qcard.over { border-left-color: var(--grey); background: var(--wash); }
.qcard .qtop { display: flex; justify-content: space-between; align-items: center; gap: var(--s-2); flex-wrap: wrap; }
.qcard .qclock { font-size: var(--t-lg); font-weight: 700; font-variant-numeric: tabular-nums; color: var(--navy); }
.qcard .qopts { display: flex; gap: var(--s-2); flex-wrap: wrap; margin: var(--s-3) 0 0; }
.qcard .qact { display: flex; gap: var(--s-2); flex-wrap: wrap; margin: var(--s-3) 0 0; }
.qcard .runopts { margin: var(--s-3) 0 0; padding: var(--s-1) var(--s-3); background: var(--white); border: 1px solid var(--hair);
  border-radius: var(--r-md); }
.qcard .runopts .sw-row:first-child { border-top: 0; }
.qcard .rb-bar { margin: var(--s-2) 0 0; }

/* teams */
.tcard { background: var(--white); border: 1px solid var(--hair); border-radius: var(--r-lg); margin: 0 0 var(--s-3); overflow: hidden; }
.tcard .th { display: flex; align-items: center; gap: var(--s-2); padding: var(--s-2) var(--s-3); background: var(--wash);
  border-bottom: 1px solid var(--hair); }
.tcard .th b { flex: 1; font-size: var(--t-md); min-width: 0; }
.tcard .th .n { font-size: var(--t-sm); font-weight: 700; color: var(--ink-2); }
.tcard .row { border: 0; border-top: 1px solid var(--hair); border-radius: 0; margin: 0; }
.tcard .th + .row { border-top: 0; }
.tcard .empty { padding: var(--s-3); font-size: var(--t-sm); color: var(--ink-2); }

/* cohort */
.prow2 { background: var(--white); border: 1px solid var(--hair); border-radius: var(--r-md); margin: 0 0 var(--s-2); }
.prow2 > .top { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-2) var(--s-3); min-height: 64px; cursor: pointer; }
.prow2 .av { width: 40px; height: 52px; border-radius: var(--r-sm); object-fit: cover; object-position: top; background: var(--blue-50); flex: none; }
.prow2 .nm { flex: 1; min-width: 0; }
.prow2 .nm b { display: block; font-size: var(--t-md); font-weight: 700; line-height: 1.25; }
.prow2 .nm span { display: block; font-size: var(--t-xs); color: var(--ink-2); margin-top: 2px; }
.prow2 .nm span.miss { color: var(--orange-700); font-weight: 600; }
.prow2 .cd { font-size: var(--t-sm); font-weight: 700; font-variant-numeric: tabular-nums; color: var(--navy); flex: none; }
.prow2 .cd.tmp { color: var(--orange-700); }
.prow2 > .det { border-top: 1px solid var(--hair); padding: var(--s-3); background: var(--wash); display: none; }
.prow2.open > .det { display: block; }
.det dl { display: grid; grid-template-columns: minmax(0, 12em) minmax(0, 1fr); gap: var(--s-1) var(--s-3); margin: 0 0 var(--s-3); }
.det dt { font-size: var(--t-xs); font-weight: 700; color: var(--ink-2); text-transform: uppercase; letter-spacing: .04em; }
.det dd { margin: 0; font-size: var(--t-sm); overflow-wrap: anywhere; }
.det dd.none { color: var(--ink-3); }
.det .sub { background: var(--white); border: 1px solid var(--hair); border-radius: var(--r-md); padding: var(--s-3); margin: 0 0 var(--s-3); }
.det .acts2 { display: flex; gap: var(--s-2); flex-wrap: wrap; }
@media (max-width: 480px) { .det dl { grid-template-columns: minmax(0, 1fr); } .det dt { margin-top: var(--s-2); } }

/* reactions on a letter */
.rx2 { display: flex; gap: var(--s-2); flex-wrap: wrap; margin: var(--s-3) 0 0; }
.rx2 .rxc { display: inline-flex; align-items: center; gap: var(--s-2); min-height: var(--tap); padding: 0 var(--s-3);
  border: 1.5px solid var(--grey); border-radius: var(--r-md); background: var(--white); color: var(--ink-2);
  font-size: var(--t-sm); font-weight: 700; }
.rx2 .rxc .fa { width: 20px; height: 20px; }
.rx2 .rxc.on { background: var(--blue-700); border-color: var(--blue-700); color: var(--white); }
.rxwho { font-size: var(--t-xs); color: var(--ink-2); margin: var(--s-1) 0 0; line-height: 1.5; }
.rxwho b { color: var(--ink); }

/* a picture in a form */
.picrow { display: flex; align-items: center; gap: var(--s-3); margin: 0 0 var(--s-3); flex-wrap: wrap; }
.picrow img { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; background: var(--blue-50); border: 1px solid var(--hair); }
.picrow img.wide { width: 120px; height: 64px; border-radius: var(--r-md); }
.picrow input[type=file] { flex: 1 1 200px; min-height: 0; border: 0; padding: 0; background: none; }
.rte-area img { max-width: 100%; height: auto; }

/* the More panel can be pulled down */
#opmore .panel .grab, #sheet .panel .grab { width: 44px; height: 5px; border-radius: 3px; background: var(--grey); margin: 0 auto var(--s-3); }
#opmore .panel .closeb { display: flex; width: 100%; margin-top: var(--s-3); }
#opmore .panel, #sheet .panel { touch-action: pan-y; }

/* analytics: the real screen under the taps */
.shot { position: relative; width: 360px; max-width: 100%; border: 2px solid var(--navy); border-radius: var(--r-lg);
  overflow: hidden; background: var(--white); flex: none; }
.shot img { display: block; width: 100%; height: auto; }
.shot canvas { position: absolute; left: 0; top: 0; width: 100%; height: 100%; pointer-events: none; }
.shot .hit { position: absolute; border: 1px solid rgba(10,95,196,.6); background: rgba(10,95,196,.07); }
.shot .hit span { position: absolute; right: 0; top: 0; background: var(--navy); color: var(--white); font-size: var(--t-xs);
  font-weight: 700; padding: 0 5px; border-radius: 0 0 0 4px; line-height: 18px; }
.showmore { display: flex; margin: 0 0 var(--s-3); }

.addbar.eq .b { flex: 1 1 0; min-width: 0; padding: 0 var(--s-2); }
.prow .pt { display: block; background: none; min-height: 0; padding: 0; border: 0; border-radius: 0; justify-content: flex-start;
  cursor: default; }

.qcard .qopts .b { min-height: var(--tap); padding: 0 var(--s-3); font-weight: 600; }
.qcard .qopts .b.opt.on { background: var(--blue-50); color: var(--blue-700); border-color: var(--blue-700); }
.qcard .qopts .b .fa { width: 14px; height: 14px; }

.filebtn { display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap; position: relative; margin: 0 0 var(--s-2); }
.filebtn .fname { font-size: var(--t-xs); color: var(--ink-2); overflow-wrap: anywhere; min-width: 0; flex: 1 1 120px; }
.picrow .filebtn { margin: 0; }

label.dcheck { text-transform: none; letter-spacing: 0; font-weight: 500; font-size: var(--t-sm); color: var(--ink); line-height: 1.5; }
label.dcheck b { font-weight: 700; }

/* =====================================================================================================
   ROUND 6: the system, quieter and denser. Same palette; smaller controls and type, hairlines instead of
   weight, and one rule for state:
       white  = not set          blue   = chosen / on
       orange = in progress      green  = done
   A control that holds a state shows it by colour alone (no tick), and goes back to white when it is undone.
   ===================================================================================================== */
:root {
  --btn: 38px;
  --line: #C9D0DB;
  --accent: #0A5FC4;
  --prog: #B85400;
  --prog-100: #FDEEDD;
  --ok-700: #0F7B4F;
}
body { font-size: var(--t-md); line-height: 1.45; }
h1, h2, h2.ph { font-size: var(--t-xl); letter-spacing: -.005em; margin: 0 0 var(--s-3); }
h3 { font-size: var(--t-lg); }
label, .dlab { text-transform: none; letter-spacing: 0; font-size: var(--t-xs); font-weight: 600; color: var(--ink-2);
  margin: 0 0 4px; }
.eyebrow, .dfh, .pgroup, .dgroup, .gl { font-size: var(--t-xs); font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--ink-2); }
.dfh { margin: var(--s-4) 0 var(--s-2); }
.addform > .dfh:first-child { font-size: var(--t-md); text-transform: none; letter-spacing: 0; color: var(--ink); margin: 0 0 var(--s-2); }
.note, .pnote { font-size: var(--t-xs); line-height: 1.5; }

/* inputs */
input:not([type]), input[type=text], input[type=email], input[type=tel], input[type=number], input[type=password],
input[type=search], input[type=date], input[type=datetime-local], input[type=time], input[type=url], select, textarea,
.din { min-height: 40px; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--r-md);
  font-size: var(--t-md); font-weight: 500; }
textarea, textarea.din { min-height: 96px; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }

/* the one button */
.b, .vbtn, .btn.o, .app-op .btn { min-height: var(--btn); padding: 0 14px; border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--white); color: var(--ink); font-size: var(--t-sm); font-weight: 600; line-height: 1.2; gap: 6px; }
.b:hover, .vbtn:hover { border-color: #8A97AE; background: #F8FAFD; }
.b:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.b.on, .b.arm, .b.blue, .vbtn.on, .vbtn.arm, .app-op .btn.arm {
  background: var(--accent); border-color: var(--accent); color: var(--white); }
.b.on:hover, .b.arm:hover { background: #084F9F; border-color: #084F9F; }
.b.prog.on { background: var(--prog); border-color: var(--prog); color: var(--white); }
.b.fin.on { background: var(--ok-700); border-color: var(--ok-700); color: var(--white); }
.b.bad { color: var(--orange-700); }
.b.bad:hover { border-color: var(--orange-700); }
.b.bad.arm { background: var(--orange-700); border-color: var(--orange-700); color: var(--white); }
.b.sm { min-height: 32px; padding: 0 10px; font-size: var(--t-xs); }
.b.ic { width: var(--btn); min-width: var(--btn); padding: 0; }
.b.quiet { border-color: transparent; background: none; color: var(--accent); }
.b.quiet:hover { background: var(--blue-50); border-color: transparent; }
.b .fa { width: 15px; height: 15px; }
.app-op main button:not(.rte-btn):not(.acts button):not(.b):not(.vbtn) { min-height: var(--btn); min-width: 0; }
.app-op main .b { min-width: 0; }
.rte-btn { min-width: 36px; min-height: 36px; }

/* on / off, as two buttons, the chosen one blue */
.seg { display: inline-flex; flex: none; border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; background: var(--white); }
.seg > button { min-height: 34px; min-width: 52px; padding: 0 12px; border: 0; background: var(--white); color: var(--ink-2);
  font-size: var(--t-sm); font-weight: 600; cursor: pointer; }
.seg > button + button { border-left: 1px solid var(--line); }
.seg > button.on { background: var(--accent); color: var(--white); }
.seg > button:hover:not(.on) { background: #F8FAFD; }
.seg > button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.sw-row { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); padding: var(--s-2) 0;
  border-top: 1px solid var(--hair); }
.sw-row b { display: block; font-size: var(--t-sm); font-weight: 600; }
.sw-row small { display: block; font-size: var(--t-xs); color: var(--ink-2); }

/* surfaces */
.card { padding: var(--s-3) var(--s-4); }
.addbar { gap: var(--s-2); margin: 0 0 var(--s-3); align-items: stretch; }
.addbar .b { flex: 1 1 0; min-width: 0; }
.addbar .b.add.on { background: var(--accent); border-color: var(--accent); color: var(--white); }
.addform { padding: var(--s-3) var(--s-4); border-radius: var(--r-lg); margin: 0 0 var(--s-3); }
.addform .acts2, .det .acts2 { display: flex; gap: var(--s-2); flex-wrap: wrap; margin-top: var(--s-3); }
.addform .fr > div { flex: 1 1 130px; }
/* a row of fields with the button level with the inputs, whatever the form */
.addform .frow { display: flex; gap: var(--s-3); align-items: flex-end; flex-wrap: wrap; }
.addform .frow > div { flex: 1 1 140px; min-width: 0; }
.addform .frow > .go { flex: 0 0 auto; }
.addform .frow .b { min-height: 40px; }
details.fold { border-radius: var(--r-lg); margin: 0 0 var(--s-2); }
details.fold > summary { min-height: 48px; padding: var(--s-2) 40px var(--s-2) var(--s-4); }
details.fold .t { font-size: var(--t-md); font-weight: 700; }
details.fold .s { font-size: var(--t-xs); color: var(--ink-2); }
.fold-body { padding: 0 var(--s-4) var(--s-3); }
.fold-sec { border-top: 1px solid var(--hair); padding-top: var(--s-3); margin-top: var(--s-3); }
.fold-sec:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
.fold-sec > h4 { margin: 0 0 var(--s-1); font-size: var(--t-sm); font-weight: 700; color: var(--ink); }

/* states of a thing: a word with a colour */
.st { min-height: 22px; border-radius: var(--r-sm); font-weight: 600; }
.st.run { background: var(--prog-100); color: var(--prog); border-color: #F0C79B; }
.st.late { background: var(--blue-50); color: var(--accent); border-color: var(--blue-100); }
.st.over { background: var(--ok-100); color: var(--ok-700); border-color: #B9E0CC; }
.st.new { background: var(--white); color: var(--ink-2); border-color: var(--hair); }
.st.asked { background: var(--wash); color: var(--ink-2); border-color: var(--hair); }
.src { display: inline-block; font-size: var(--t-xs); font-weight: 600; color: var(--ink-2); background: var(--wash);
  border: 1px solid var(--hair); border-radius: var(--r-sm); padding: 0 6px; line-height: 18px; margin-right: 6px; }
.src.cp { color: #6B4A00; background: var(--yellow-100); border-color: #F2D49A; }
.src.leg { color: var(--accent); background: var(--blue-50); border-color: var(--blue-100); }
.src.pk { color: var(--ink-2); }

/* the programme */
.prow { grid-template-columns: 46px minmax(0, 1fr); padding: 10px 12px; margin: 0 0 6px; border-radius: var(--r-md);
  border-left: 3px solid var(--hair); }
.prow .pt { font-size: var(--t-md); }
.prow .pb { font-size: var(--t-md); line-height: 1.3; }
.prow .pb .ps { font-size: var(--t-xs); }
.prow .pm { gap: var(--s-4); }
.prow .mk .when { font-size: var(--t-xs); color: var(--ink-2); max-width: 15em; line-height: 1.35; }
.prow.running, .prow.prog { background: var(--white); border-left-color: var(--prog); border-color: var(--hair); }
.prow.running { border-left-color: var(--prog); }
.prow.done { border-left-color: var(--ok-700); }
.prow.done .pb { color: var(--ink); }
.prow.ev { border-left: 3px solid var(--accent); }
.prow.ev.cp { border-left-color: var(--yellow); }
.prow.ev.done { border-left-color: var(--ok-700); }
.prow .tag { text-transform: none; letter-spacing: 0; }
.prow .see { font-size: var(--t-xs); color: var(--ink-3); margin-top: 2px; }
.legs.days span.leg, .legs button { min-height: 36px; border-radius: var(--r-md); border: 1px solid var(--line); font-weight: 600;
  color: var(--ink-2); background: var(--white); }
.legs.days span.leg.on, .legs button.on { background: var(--accent); border-color: var(--accent); color: var(--white); }
.leg-d > summary { min-height: 52px; }
.leg-d .ln { background: var(--accent); }
.cprow { display: flex; align-items: center; gap: var(--s-3); padding: 10px 0; border-top: 1px solid var(--hair); }
.cprow .cpl { flex: 1; min-width: 0; }
.cprow .cpl b { font-size: var(--t-md); }
.cprow.editing { display: grid; gap: var(--s-2); }
.cprow .cpa { display: flex; gap: var(--s-2); flex-wrap: wrap; flex: none; }

/* questions: orange running, blue time up but open, green done, white not run */
.qcard { padding: var(--s-3) var(--s-4); border-radius: var(--r-md); border-left: 3px solid var(--hair); }
.qcard.run { border-left-color: var(--prog); background: var(--white); }
.qcard.late { border-left-color: var(--accent); background: var(--white); }
.qcard.over { border-left-color: var(--ok-700); background: var(--white); }
.qcard .qclock { color: var(--prog); font-size: var(--t-lg); }
.qcard .qprompt { font-size: var(--t-md); }
.qcard .qopts { margin: var(--s-3) 0 0; }
.qcard .qopts .b { min-height: 34px; font-weight: 600; }
.qcard .qopts .b.on { background: var(--accent); border-color: var(--accent); color: var(--white); }
.qlegend { gap: 6px; }

/* teams, people */
.row { min-height: 52px; padding: 6px 10px; margin: 0 0 6px; border-radius: var(--r-md); }
.row .av, .prow2 .av { width: 36px; height: 46px; }
.row.yes { box-shadow: inset 3px 0 0 var(--ok-700); }
.row.no { box-shadow: inset 3px 0 0 var(--orange-700); }
.row .nm b, .prow2 .nm b { font-size: var(--t-md); font-weight: 600; }
.acts { gap: 6px; }
.acts button { width: 38px; height: 38px; border: 1px solid var(--line); border-radius: var(--r-md); }
.acts .y.on { background: var(--ok-700); border-color: var(--ok-700); }
.acts button.qr { width: auto; padding: 0 10px; font-size: var(--t-xs); font-weight: 700; color: var(--ink-2); }
.tcard { border-radius: var(--r-md); margin: 0 0 var(--s-2); }
.tcard .th { padding: 4px 8px 4px 12px; min-height: 44px; }
.tcard .th b { font-size: var(--t-md); }
.tcard .th input { flex: 1; min-width: 0; }
.tsel { min-height: 38px; font-size: var(--t-sm); font-weight: 600; color: var(--ink); max-width: 10em; padding: 4px 8px; }
.prow2 > .top { min-height: 56px; padding: 6px 10px; }
.tally { gap: 6px; }
.tally > div { padding: 8px 6px; }
.tally .n { font-size: var(--t-xl); }
.filter { margin: 0 0 var(--s-2); }

/* letters */
.pit { padding: var(--s-3); margin: 0 0 6px; border-radius: var(--r-md); }
.pit.art { gap: var(--s-2); }
.pit.art .pt2 { font-size: var(--t-md); font-weight: 600; }
.pit.isopen { background: var(--white); border-left: 3px solid var(--accent); }
.pacts { gap: var(--s-2); align-items: center; }
.pacts .b { min-height: 34px; }
.pacts .sp { flex: 1; }
.rx2 .rxc { min-height: 34px; border: 1px solid var(--line); font-weight: 600; }
.rx2 .rxc.on { background: var(--accent); border-color: var(--accent); }
.fq { padding: 8px 0; gap: var(--s-3); }

/* the sheets: a handle to drag, nothing to press */
#opmore .panel .grab, #sheet .panel .grab { width: 40px; height: 4px; border-radius: 2px; background: var(--grey); margin: 0 auto var(--s-3); }
.pullzone { padding: var(--s-2) 0 var(--s-2); margin: calc(var(--s-2) * -1) 0 0; cursor: grab; touch-action: none; }
#opmore .panel, #sheet .panel { will-change: transform; }
#opmore .grid button { min-height: 68px; border-radius: var(--r-md); font-weight: 600; }
#opmore .grid button.on { background: var(--accent); border-color: var(--accent); }

/* navigation, header */
.app-student header, .app-op header { min-height: var(--head-h); }
.opnav .opt, #bnav button { min-height: var(--nav-h); font-weight: 600; }
.opnav .opt.on::before, #bnav button[aria-current="page"]::before { background: var(--accent); }
.opnav .opt.on, #bnav button[aria-current="page"], #bnav button[aria-current="page"] .fa, .opnav .opt.on .fa { color: var(--accent); }
@media (min-width: 900px) { .opnav .opt { min-height: 40px; } .opnav .opt.on { background: var(--blue-50); color: var(--accent); } }
#coursebar { padding: 6px var(--s-4) !important; }
#coursebar .cb-name b { font-size: var(--t-md); color: var(--ink); }
#coursebar button { min-height: 34px; border: 1px solid var(--line); font-weight: 600; }

/* course picker: a course and its delete, side by side */
.cpick { display: flex; gap: var(--s-2); align-items: stretch; margin: 0 0 var(--s-2); }
.cpick > .b { flex: 1; justify-content: flex-start; text-align: left; padding: 8px 14px; min-height: 52px; flex-direction: column;
  align-items: flex-start; gap: 0; }
.cpick > .b small { font-weight: 500; color: var(--ink-2); }
.cpick > .b.cur { border-color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); }
.cpick > .b.bad { flex: none; width: var(--btn); padding: 0; min-height: 52px; justify-content: center; align-items: center; }
.cpick > .b.bad.arm { width: auto; padding: 0 12px; }

/* ---- student ----------------------------------------------------------------------------------------- */
.app-student main { padding-top: var(--s-3); }
.who-row { min-height: 52px; margin: 0 0 var(--s-3); padding: 6px var(--s-3); gap: var(--s-3); }
.who-row img { width: 34px; height: 42px; }
.who-row b { font-size: var(--t-md); }
.who-row small { font-size: var(--t-xs); font-weight: 500; }
.btn { min-height: 44px; font-size: var(--t-sm); }
.live { min-height: 56px; margin: 0 0 var(--s-3); padding: var(--s-2) var(--s-3); border-left-width: 3px; }
.live b { font-size: var(--t-md); }
.live small { font-size: var(--t-xs); }
.voyage { padding: var(--s-3); margin: 0 0 var(--s-3); }
.group { margin: 0 0 var(--s-3); }
.group .li { min-height: 48px; padding: var(--s-2) var(--s-3); }
.group .li .at { flex-basis: 46px; font-size: var(--t-md); }
.group .li .tx b { font-size: var(--t-md); }
.group .li.done { background: var(--white); }
.group .li.done .at { color: var(--ok-700); }
.group .li.done .tx b { color: var(--ink-2); font-weight: 500; }
.group .li.open { background: var(--prog-100); box-shadow: inset 3px 0 0 var(--prog); }
.group .li.open .at { color: var(--prog); }
.group .li .dn { font-size: var(--t-xs); font-weight: 600; color: var(--ok-700); }
.eyebrow { margin: var(--s-4) 0 var(--s-2); }
.tiles .btn, .tile { min-height: 76px; }
.plist .r, .ptr, .lit, .docrow, .lbrow { min-height: 56px; }
.plist img, .plist .ini { width: 38px; height: 48px; }
.pers img, .pers .ini { width: 84px; height: 104px; }
.aitem { padding: 10px 12px; }
.aitem .at { flex-basis: 48px; }
.aitem.open { background: var(--white); border-color: var(--hair); border-left: 3px solid var(--prog); }
.aitem.open .at { color: var(--prog); }
.aitem.done { border-left: 3px solid var(--ok-700); }
.pcw p { font-size: var(--t-md); line-height: 1.65; }
.pcw h3 { font-size: var(--t-xl); }
.rx2.student { margin: var(--s-4) 0 0; }
.chip, .opt, .aday, .pt, .leg { min-height: 36px; border-radius: var(--r-md); font-size: var(--t-sm); }
.chip.on, .opt.on, .aday.on, .pt.on, .leg.on { background: var(--accent); }
.back { min-height: 40px; }
.app-student .screen button:not(.btn) { min-height: 40px; }
.timer .clock { font-size: var(--t-2xl); }

.prow .mk { align-items: flex-start; }
.prow .mk .when { max-width: 12em; }
.prow .pm { align-items: flex-start; }

/* the family wins over the old per-section button rules (the letters' and the documents' own buttons) */
button.b, a.b { border: 1px solid var(--line); border-radius: var(--r-md); background: var(--white); color: var(--ink);
  font-size: var(--t-sm); font-weight: 600; }
button.b.on, button.b.arm, a.b.on { background: var(--accent); border-color: var(--accent); color: var(--white); }
button.b.prog.on { background: var(--prog); border-color: var(--prog); color: var(--white); }
button.b.fin.on { background: var(--ok-700); border-color: var(--ok-700); color: var(--white); }
button.b.bad { color: var(--orange-700); }
button.b.bad.arm { background: var(--orange-700); border-color: var(--orange-700); color: var(--white); }
button.b.quiet { border-color: transparent; background: none; color: var(--accent); }
button.b:disabled { color: var(--ink-3); background: var(--wash); border-color: var(--hair); }
.qcard .qopts .b.opt, .qcard .qopts .b.opt.on { font-weight: 600; }
.qcard .qopts .b.opt { background: var(--white); border-color: var(--line); color: var(--ink); }
.qcard .qopts .b.opt.on { background: var(--accent); border-color: var(--accent); color: var(--white); }
.pit.isopen, .pit.isclosed { border-color: var(--hair); }
.pit.isopen { border-left: 3px solid var(--accent); }
.pit button.b, .pacts button.b { min-height: 34px; padding: 0 12px; }
.rx2 .rxc { border: 1px solid var(--line); }
.rx2 .rxc.on { border-color: var(--accent); }

/* the forms that carry a button: fields on one row, the button on the next, the same in every one */
.addform .frow > .go { flex: 1 1 100%; }
.addform .frow > .go .b { min-width: 140px; }
.det dt { text-transform: none; letter-spacing: 0; font-size: var(--t-xs); font-weight: 600; }
.st.run { color: #8F3F00; }
#coursebar button { min-height: 36px; }

/* the operator's More panel is a list, as the students' is */
#opmore .list { display: flex; flex-direction: column; margin: var(--s-1) 0 0; max-height: 70dvh; overflow: auto; }
#opmore .list button { display: flex; align-items: center; gap: var(--s-3); width: 100%; min-height: 46px; padding: 0 var(--s-2);
  background: none; border: 0; border-bottom: 1px solid var(--hair); border-radius: 0; font-size: var(--t-md); font-weight: 600;
  text-align: left; color: var(--ink); }
#opmore .list button .fa { width: 20px; height: 20px; color: var(--ink-2); flex: none; }
#opmore .list button.on, #opmore .list button.on .fa { color: var(--accent); background: none; border-color: var(--hair); }
#opmore .gl { font-size: var(--t-xs); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2);
  padding: var(--s-3) var(--s-2) var(--s-1); }
#opmore .gl:first-child { padding-top: 0; }


/* ROUND 8 ------------------------------------------------------------------------------------------ */
/* the profile questions use the same On / Off pair as the rest: the old per-section button rules do not reach it */
.fq .seg > button, .fq .seg > button.on, .fq .seg > button.off { border: 0; border-radius: 0; min-height: 34px; min-width: 52px;
  padding: 0 12px; font-size: var(--t-sm); font-weight: 600; background: var(--white); color: var(--ink-2); }
.fq .seg > button + button { border-left: 1px solid var(--line); }
.fq .seg > button.on { background: var(--accent); color: var(--white); }
.fq .seg { margin-left: auto; }

/* Activity: every table shares one grid, so the numbers meet at the right edge in all of them */
table.actable { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: var(--t-sm); margin-bottom: var(--s-2); }
.actable th { background: var(--wash); font-size: var(--t-xs); font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--ink-2); padding: 6px 8px; text-align: left; border-bottom: 1px solid var(--hair); }
.actable td { padding: 8px; border-bottom: 1px solid var(--hair); overflow-wrap: anywhere; vertical-align: top; }
.actable .n { text-align: right; width: 76px; font-variant-numeric: tabular-nums; }
.actable th.n { text-align: right; }
.actable tr[hidden] { display: none; }

/* a person's card: the icon, the title, and under it the text they wrote */
.prows { display: block; }
.fcard { display: flex; gap: var(--s-3); padding: var(--s-3) 0; border-top: 1px solid var(--hair); align-items: flex-start; }
.fcard .ic { flex: none; width: 36px; height: 36px; border-radius: 50%; background: var(--blue-50); display: flex;
  align-items: center; justify-content: center; }
.fcard .ic .fa { width: 18px; height: 18px; color: var(--accent); }
.fcard .tx { flex: 1; min-width: 0; }
.fcard .ti { font-size: var(--t-md); font-weight: 700; line-height: 1.3; color: var(--ink); }
.fcard .va { font-size: var(--t-md); line-height: 1.55; color: var(--ink-2); margin-top: 2px; overflow-wrap: anywhere; }
.fcard .va a { color: var(--accent); }


/* ROUND 9 ------------------------------------------------------------------------------------------ */
/* one way in, on the student's phone and on the console: a card, the code, and the dark blue Enter */
.gate { max-width: 420px; margin: var(--s-6) auto 0; background: var(--white); border: 1px solid var(--hair);
  border-radius: var(--r-lg); padding: var(--s-5); }
.gate h1 { font-size: var(--t-xl); margin: 0 0 var(--s-2); }
.gate p { font-size: var(--t-sm); color: var(--ink-2); margin: 0 0 var(--s-4); line-height: 1.5; }
.gate input { text-align: center; letter-spacing: .2em; font-weight: 700; text-transform: uppercase; min-height: 48px; }
.btn.enter, .app-op .btn.enter, .app-student .btn.enter { display: flex; width: 100%; min-height: 48px; margin-top: var(--s-3);
  background: var(--navy); border: 1px solid var(--navy); color: var(--white); font-size: var(--t-md); font-weight: 700;
  border-radius: var(--r-md); }
.btn.enter:hover, .app-op .btn.enter:hover { background: var(--navy-900); border-color: var(--navy-900); }

/* the refresh in the student's bar */
.app-student header .hrefresh { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px;
  padding: 0; background: transparent; border: 0; color: var(--white); border-radius: 50%; cursor: pointer; }
.app-student header .hrefresh:hover { background: rgba(255,255,255,.14); }
.app-student header .hrefresh .fa { width: 20px; height: 20px; color: var(--white); }
.app-student header .hrefresh.spin .fa { animation: spin 600ms linear; }
@keyframes spin { to { transform: rotate(360deg); } }
body[data-screen="login"] .hrefresh, body[data-screen="setup"] .hrefresh { display: none; }

/* a checkpoint's texts */
.cplink { margin: var(--s-2) 0; }
.cptexts { max-height: 220px; overflow: auto; border: 1px solid var(--hair); border-radius: var(--r-md); background: var(--white); }
.cptext { display: flex; align-items: center; justify-content: space-between; gap: var(--s-2); padding: 4px 8px 4px 12px;
  border-top: 1px solid var(--hair); font-size: var(--t-sm); }
.cptext:first-child { border-top: 0; }
.cptext span { min-width: 0; overflow-wrap: anywhere; }
.cpadd2 { display: flex; gap: var(--s-2); margin-top: var(--s-2); }
.cpadd2 select { flex: 1; min-width: 0; }


/* ROUND 10 ----------------------------------------------------------------------------------------- */
/* the date and hour a text opens at, under its title */
.pwhen { font-size: var(--t-sm); color: var(--ink-2); margin-top: var(--s-1); }
.pwhen b { color: var(--ink); font-weight: 700; }

/* pictures: a drop target, the grid of what is kept, and the same inside a form */
.piclib { margin: var(--s-2) 0 var(--s-3); }
.picdrop { display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap; padding: var(--s-3);
  border: 1.5px dashed var(--grey); border-radius: var(--r-md); background: var(--white); }
.picdrop.drop, .picrow.drop, .rte-area.drop { border-color: var(--blue-700); background: var(--blue-50); }
.picrow.drop { outline: 2px dashed var(--blue-700); outline-offset: 2px; border-radius: var(--r-md); }
.picgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: var(--s-2); margin-top: var(--s-3); }
.picell { display: flex; flex-direction: column; gap: var(--s-1); min-width: 0; }
.picthumb { display: block; padding: 0; min-height: 0 !important; width: 100%; aspect-ratio: 1; overflow: hidden;
  border: 1px solid var(--hair); border-radius: var(--r-md); background: var(--blue-50); cursor: pointer; }
.picthumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pcap { font-size: var(--t-xs); color: var(--ink-2); overflow-wrap: anywhere; line-height: 1.3; }
.picell .b.sm { min-height: 32px; }
.piclib-host { margin: 0 0 var(--s-3); }
.picrow { position: relative; }
.piclib-host .picgrid { max-height: 340px; overflow: auto; padding-right: var(--s-1); }


/* ROUND 11 ----------------------------------------------------------------------------------------- */
/* a picture field: the thumbnail, the buttons and Remove on one line, whatever the width */
.picrow { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-3); }
.picrow > * { margin: 0; align-self: center; }
.picrow .filebtn { flex: 0 0 auto; }
.picrow .filebtn .fname:empty { display: none; }
.picrow .b, .picrow .filebtn .b { margin: 0; }

/* ROUND 12 ----------------------------------------------------------------------------------------- */
/* a session's two marks as one pair, with one line under it (the line no longer pushes Done down) */
.mkpair { display: flex; flex-direction: column; gap: var(--s-1); align-items: flex-start; min-width: 0; }
.mkpair .when { font-size: var(--t-xs); color: var(--ink-2); line-height: 1.35; }
.mkseg > button { min-width: 96px; }
.mkseg > button.prog.on { background: var(--prog); color: var(--white); }
.mkseg > button.fin.on { background: var(--ok-700); color: var(--white); }
.prow .pb .ps.posts { color: var(--ink-2); }

/* pictures: the trash can above each one */
.picell .picbar { display: flex; gap: var(--s-1); align-items: flex-start; }
.picell .picdl { display: inline-flex; align-items: center; justify-content: center; min-width: 36px; min-height: 36px !important; padding: 0 var(--s-2); text-decoration: none; }
.picell .picdel { align-self: flex-start; min-width: 36px; min-height: 36px !important; padding: 0 var(--s-2); }
.picell .picdel[data-armed] { white-space: normal; text-align: left; line-height: 1.2; padding: var(--s-1) var(--s-2); }

/* the text box: menus for style, size and colour, and the table panel */
.rte-sel { height: 36px; min-width: 0; max-width: 8.5em; padding: 0 var(--s-2); border: 1px solid var(--hair);
  border-radius: var(--r-sm); background: var(--white); color: var(--ink); font: inherit; font-size: var(--t-sm); font-weight: 600; }
.rte-btn:disabled, .rte-sel:disabled { opacity: .45; }
.rte-tbl { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3); padding: var(--s-2) var(--s-3);
  border-bottom: 1px solid var(--hair); background: var(--blue-50); font-size: var(--t-sm); font-weight: 600; }
.rte-tbl .rte-num { width: 4.2em; height: 36px; margin-left: var(--s-1); padding: 0 var(--s-2); border: 1px solid var(--hair);
  border-radius: var(--r-sm); font: inherit; background: var(--white); }
.rte-area h1 { font-size: 22px; margin: 12px 0 6px; }
.rte-area h2 { font-size: 19px; margin: 12px 0 6px; }
.rte-area h4 { font-size: 14.5px; margin: 8px 0 4px; }
.rte-area ul, .rte-area ol { margin: 0 0 8px; padding-left: 24px; }

/* a table, wherever the text is shown: the box, a letter, a port */
.rte-area table, .rich table { border-collapse: collapse; margin: var(--s-3) 0; max-width: 100%; }
.rte-area th, .rte-area td, .rich th, .rich td { border: 1px solid var(--hair); padding: 8px 10px; text-align: left; vertical-align: top;
  min-width: 3em; }
.rte-area th, .rich th { background: var(--blue-50); color: var(--ink); font-weight: 700; }
.rich table { display: block; overflow-x: auto; font-size: var(--t-sm); }

/* what the box can make, shown to students: headings, lists, a quote */
.pcw .rich h1 { font-size: var(--t-xl); margin: 1.2em 0 .4em; }
.pcw .rich h2 { font-size: var(--t-lg); margin: 1.1em 0 .4em; }
.pcw .rich h3 { font-size: var(--t-md); margin: 1em 0 .3em; }
.pcw .rich h4 { font-size: var(--t-md); margin: 1em 0 .3em; color: var(--ink-2); }
.rich ul, .rich ol { margin: 0 0 1em; padding-left: 1.4em; line-height: 1.6; }
.rich blockquote { margin: 1em 0; padding: 2px var(--s-3); border-left: 3px solid var(--hair); color: var(--ink-2); }
.rich p { overflow-wrap: anywhere; }

/* ROUND 13 ----------------------------------------------------------------------------------------- */
.rte-url { flex: 1 1 14em; min-width: 0; height: 36px; padding: 0 var(--s-2); border: 1px solid var(--hair);
  border-radius: var(--r-sm); font: inherit; background: var(--white); }
.rich a { color: var(--blue-700); text-decoration: underline; overflow-wrap: anywhere; }
.rich figure { margin: var(--s-3) 0; }
.rich figure img { width: 100%; border-radius: var(--r-md); display: block; }
.rich figcaption { font-size: var(--t-xs); color: var(--ink-2); margin-top: 6px; }
.rte-area a { color: var(--blue-700); text-decoration: underline; }
.rte-area figure { margin: 8px 0; }
.rte-area figcaption { font-size: 12px; color: var(--ink-2); }

.rte-grp { display: inline-flex; flex-wrap: nowrap; gap: 4px; align-items: center; }

/* ROUND 14 ----------------------------------------------------------------------------------------- */
/* justified text on a phone needs hyphens, or its lines open into gaps */
.rich p, .rte-area p { hyphens: auto; -webkit-hyphens: auto; overflow-wrap: break-word; }
.rich h3 { text-wrap: balance; }
.rich li a { display: inline-block; padding: 8px 0; min-width: 36px; line-height: 1.3; }
.rich li { margin: 0; }
.pcw .rich h3 { font-size: var(--t-lg); margin: 1.3em 0 .4em; }

/* ROUND 15 ----------------------------------------------------------------------------------------- */
/* The same colours, a calmer hand: softer edges, a hairline and a shadow instead of heavy borders, tighter headings,
   figures that line up, and a header and a bar with a little depth. Nothing here changes a colour of the platform. */
:root {
  --r-md: 8px; --r-lg: 12px;
  --hair: #DCE3EE;
  --shadow-1: 0 1px 2px rgba(14, 31, 69, .06), 0 0 0 1px rgba(14, 31, 69, .02);
  --shadow-2: 0 18px 44px rgba(9, 29, 99, .22), 0 2px 8px rgba(9, 29, 99, .10);
  --ok-bright: #3FD08E;
  --ink-soft: #66728F;          /* what has been done: lighter than the text, 4.8:1 on white */
}
body { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; font-variant-numeric: tabular-nums; }
h1, h2, h2.ph, h3 { letter-spacing: -.012em; }
.app-student header {
  background-color: var(--navy);
  background-image: linear-gradient(180deg, var(--navy) 0%, var(--navy-900) 100%);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .06), 0 6px 18px -10px rgba(9, 29, 99, .55);
}
.eyebrow { letter-spacing: .12em; color: var(--ink-3); margin-top: var(--s-5); }
.eyebrow .fa { width: 14px; height: 14px; color: var(--blue-700); vertical-align: -2px; }

/* surfaces: a hairline and a soft shadow */
.card, .group, .live, .who-row, #idlestate, .plist .r, .ptr, .lit, .docrow, .lbrow, .trio .m, .gate, .setcard {
  border-color: var(--hair); box-shadow: var(--shadow-1); border-radius: var(--r-lg);
}
.trio .m, .plist .r, .ptr, .lit, .docrow, .lbrow { border-radius: var(--r-md); }
.plist .r:active, .ptr:active, .lit:active, .docrow.open:active, .lbrow:active, .group .li:active { background: var(--blue-50); }
.plist img, .plist .ini, .trio img, .who-row img { border-radius: var(--r-md); }
.live { border-left-width: 3px; }

/* the bar at the bottom: a little glass */
#bnav { background: rgba(255, 255, 255, .94); -webkit-backdrop-filter: saturate(1.3) blur(10px); backdrop-filter: saturate(1.3) blur(10px);
  box-shadow: 0 -8px 24px -18px rgba(9, 29, 99, .5); border-top-color: var(--hair); }
#bnav button { letter-spacing: .01em; }
#bnav button[aria-current="page"]::before { height: 3px; border-radius: 0 0 3px 3px; left: 22%; right: 22%; }

/* buttons: the primary has a body to it */
.btn.p, .btn.enter, .b.on { box-shadow: 0 1px 0 rgba(255, 255, 255, .14) inset, 0 8px 16px -10px rgba(13, 43, 140, .7); }
.btn { border-radius: var(--r-md); }
.b { border-radius: var(--r-md); }
input:focus, select:focus, textarea:focus { box-shadow: 0 0 0 4px rgba(17, 141, 255, .16); }

/* Home: Areté under one heading, a row per text */
.news-h { margin-top: 0; }
.newsgrp { margin-bottom: var(--s-4); }
.group .li.post { align-items: center; min-height: 52px; font-size: var(--t-md); color: var(--ink); cursor: pointer; }
.group .li.post .tx b { font-weight: 600; }
.group .li.post .tx small { margin-top: 1px; }
.group .li.post::after {
  content: ""; flex: none; width: 10px; height: 14px; margin-left: auto; background: var(--ink-3);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 320 512'%3E%3Cpath d='M310.6 233.4c12.5 12.5 12.5 32.8 0 45.3l-192 192c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L242.7 256 73.4 86.6c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0l192 192z'/%3E%3C/svg%3E") center/contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 320 512'%3E%3Cpath d='M310.6 233.4c12.5 12.5 12.5 32.8 0 45.3l-192 192c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L242.7 256 73.4 86.6c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0l192 192z'/%3E%3C/svg%3E") center/contain no-repeat; }

/* what has been done on the programme: the time is green, the words are a lighter grey */
.group .li.done .tx b { color: var(--ink-soft); font-weight: 500; }
.group .li.done .tx small { color: var(--ink-soft); }
.aitem.done .ti, .aitem.done .su { color: var(--ink-soft); }

/* the voyage: the point of a port turns green once the berthing is done */
.voyage .p.ok .d { width: 14px; height: 14px; margin-top: -2px; background: var(--ok-bright); }   /* the size of the orange point, no halo */
.voyage .p.ok .n { color: var(--ok-bright); font-weight: 700; }                                      /* the port's name, green too */
.voyage { box-shadow: 0 14px 28px -20px rgba(9, 29, 99, .8); border-radius: var(--r-lg); }

/* what a text made you feel: the pictures alone, and how many */
.rx2 { gap: var(--s-2); }
.rx2 .rxc { min-width: 52px; min-height: 44px; justify-content: center; padding: 0 var(--s-3); gap: 6px; }
.rx2 .rxc .fa { width: 22px; height: 22px; }
.rx2 .rxc span { font-size: var(--t-sm); font-weight: 700; font-variant-numeric: tabular-nums; }

/* a question reads as written: its two lines stay two lines */
.prompt, #wprompt, .ptr.q .pn > div:first-child { white-space: pre-line; }

/* settings, and the cog on a person's own card */
.setcard { background: var(--white); border: 1px solid var(--hair); padding: var(--s-4); max-width: 460px; }
.setcard h3 { margin: 0 0 var(--s-2); }
.setcard label { margin-top: var(--s-3); }
.pers { position: relative; }
.cfgbtn { position: absolute; top: -11px; right: -10px; width: 44px; height: 44px; display: inline-flex; align-items: center;
  justify-content: center; background: transparent; border: 0; border-radius: 50%; color: var(--ink-2); cursor: pointer; }
.cfgbtn:hover { background: var(--blue-50); }
.cfgbtn .fa { width: 22px; height: 22px; color: var(--ink-2); }
#pass { text-transform: none; letter-spacing: .08em; margin-top: var(--s-2); }
.pwblur { filter: blur(5px); transition: filter var(--ease); }
.pwblur.shown, .pwblur:focus { filter: none; }

/* The More panel. On a phone: a sheet from the bottom edge with a handle and the title to pull by, that can also
   be pulled from anywhere on it when it is not scrolled. On a computer: a small panel above the button. */
#sheet .panel, #opmore .panel { border-radius: 18px 18px 0 0; overscroll-behavior: contain; touch-action: pan-y; }
#sheet .panel.fits, #opmore .panel.fits { touch-action: none; }
#sheet .shead { touch-action: none; cursor: grab; margin: calc(var(--s-3) * -1) calc(var(--s-4) * -1) 0; padding: var(--s-3) var(--s-4) var(--s-2); }
#sheet .shead:active { cursor: grabbing; }
#sheet .shead .pullzone { margin: 0; padding: var(--s-1) 0 var(--s-3); }
#sheet .shead h2 { margin: 0; }
#opmore .pullzone { touch-action: none; padding: var(--s-3) 0; margin: calc(var(--s-3) * -1) 0 0; }
#sheet .grab, #opmore .grab { width: 44px; height: 5px; border-radius: 3px; background: var(--grey); margin: 0 auto; }
#sheet .panel { transition: transform 160ms ease; }
#sheet .scrim, #opmore .scrim { transition: opacity 160ms ease; }

@media (hover: hover) and (pointer: fine) and (min-width: 820px) {
  #sheet.desk .scrim, #opmore.desk .scrim { background: transparent; }
  #sheet.desk .panel {
    left: auto; right: max(12px, calc((100vw - 640px) / 2 + 12px)); bottom: calc(var(--nav-h) + 10px + env(safe-area-inset-bottom));
    margin: 0; width: 340px; max-width: calc(100vw - 24px); border-radius: var(--r-lg); border: 1px solid var(--hair);
    padding: var(--s-4); box-shadow: var(--shadow-2); animation: pop 140ms ease both; }
  #sheet.desk .shead { cursor: default; margin: 0; padding: 0; }
  #sheet.desk .shead .pullzone { display: none; }
  #sheet.desk .list button:hover, #sheet.desk .list button:focus-visible { background: var(--blue-50); border-radius: var(--r-md); }
  #opmore.desk .panel {
    left: auto; right: 12px; margin: 0; width: 380px; max-width: calc(100vw - 24px); border-radius: var(--r-lg);
    border: 1px solid var(--hair); box-shadow: var(--shadow-2); animation: pop 140ms ease both; }
  #opmore.desk .pullzone { display: none; }
}
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }

/* ROUND 16 ----------------------------------------------------------------------------------------- */
.pwmask { flex: 1 1 9em; min-width: 0; letter-spacing: .3em; font-size: var(--t-md); color: var(--ink-2); padding: 0 var(--s-2); }

/* The way back: a quiet control, not a button. A chevron that steps left on hover, the label underlined with
   room under it, a ring for the keyboard, a press that dims. No filled background. */
.back { gap: 6px; color: var(--blue-700); font-weight: 600; letter-spacing: .005em; background: transparent; border-radius: var(--r-md);
  transition: color 120ms ease, opacity 120ms ease; -webkit-tap-highlight-color: transparent; }
.back .bk-ic { flex: none; width: 8px; height: 13px; background: currentColor; transition: transform 140ms ease;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 320 512'%3E%3Cpath d='M9.4 233.4c-12.5 12.5-12.5 32.8 0 45.3l192 192c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L77.3 256 246.6 86.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-192 192z'/%3E%3C/svg%3E") center/contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 320 512'%3E%3Cpath d='M9.4 233.4c-12.5 12.5-12.5 32.8 0 45.3l192 192c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L77.3 256 246.6 86.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-192 192z'/%3E%3C/svg%3E") center/contain no-repeat; }
.back:hover { background: transparent; color: var(--navy); }
.back:hover .bk-ic { transform: translateX(-3px); }
.back:hover .bk-lb { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.back:active { opacity: .6; }
.back:focus-visible { outline: 2px solid var(--blue-700); outline-offset: 2px; }

/* the console's More: the same handle, title and list as the students' */
#opmore .shead { touch-action: none; cursor: grab; margin: calc(var(--s-3) * -1) calc(var(--s-4) * -1) 0; padding: var(--s-3) var(--s-4) var(--s-2); }
#opmore .shead .pullzone { margin: 0; padding: var(--s-1) 0 var(--s-3); }
#opmore .shead h2 { margin: 0; }
@media (hover: hover) and (pointer: fine) and (min-width: 820px) {
  #opmore.desk .shead { cursor: default; margin: 0; padding: 0 0 var(--s-2); }
}

[hidden] { display: none !important; }

/* ROUND 18: the "Glass bridge" look, chosen on 12 October. The same colours. The navy field is the top of Home with the
   voyage on it, surfaces float with a deep soft shadow and no border, times are pills, the bottom bar floats. -------- */
:root {
  --r-card: 18px;
  --float: 0 12px 30px -14px rgba(9, 29, 99, .35), 0 1px 2px rgba(9, 29, 99, .06);
  --row-line: #EAEFF7;
}

/* surfaces: no border, a deep shadow, round */
.card, .group, .live, .who-row, #idlestate, .setcard, .gate {
  border: 0; border-radius: var(--r-card); box-shadow: var(--float);
}
.plist .r, .ptr, .lit, .docrow, .lbrow, .trio .m, .aitem { border-color: transparent; border-radius: 14px; box-shadow: var(--float); }
.live { border-left-width: 0; }
.group .li { border-top-color: var(--row-line); }
.setcard { border: 0; }
.who-row img, .plist img, .trio img { border-radius: 12px; }

/* Home: the voyage stays in its navy box (Valeria preferred it to the open navy field), with the point and the name of a
   berthed port in green. */
.app-student #nowbox .voyage { box-shadow: 0 14px 28px -20px rgba(9, 29, 99, .8); }

/* times are pills: blue to come, green done, orange now */
.group .li .at, .aitem .at {
  flex: 0 0 auto; align-self: center; min-width: 0; padding: 4px 10px; border-radius: 999px; font-size: var(--t-sm);
  background: var(--blue-50); color: var(--blue-700);
}
.group .li.done .at, .aitem.done .at { background: var(--ok-100); color: var(--ok); }
.group .li.open, .aitem.open { background: var(--white); box-shadow: inset 3px 0 0 var(--orange); }
.group .li.open .at, .aitem.open .at { background: var(--orange); color: var(--white); }
.aitem.open { border-color: transparent; }

/* pills for choices */
.chip, .opt, .aday, .pt, .leg { border-radius: 999px; }
.btn, .b { border-radius: 14px; }

/* the bottom bar floats */
#bnav {
  left: 50%; right: auto; transform: translateX(-50%); width: min(616px, calc(100% - 24px));
  bottom: calc(10px + env(safe-area-inset-bottom)); height: var(--nav-h); padding-bottom: 0; border: 0;
  border-radius: 22px; background: rgba(255, 255, 255, .95); box-shadow: 0 12px 30px -10px rgba(9, 29, 99, .5);
  -webkit-backdrop-filter: saturate(1.3) blur(10px); backdrop-filter: saturate(1.3) blur(10px);
}
#bnav .inner { max-width: none; }
#bnav button[aria-current="page"]::before { top: 0; left: 28%; right: 28%; height: 3px; border-radius: 0 0 3px 3px; }
.app-student main { padding-bottom: calc(var(--nav-h) + var(--s-6) + 14px + env(safe-area-inset-bottom)); }
@media (hover: hover) and (pointer: fine) and (min-width: 820px) {
  #sheet.desk .panel { bottom: calc(var(--nav-h) + 24px + env(safe-area-inset-bottom)); }
}

/* ROUND 20 ----------------------------------------------------------------------------------------------------------- */
/* A text read on the phone has no box around it, as a page of The Ports has none. */
.pcw { border: 0; box-shadow: none; background: none; border-radius: 0; }

/* Areté on Home: the heading is the first row of its box. */
.group.newsgrp .nh { display: flex; align-items: center; gap: var(--s-2); padding: var(--s-3) var(--s-4) var(--s-2);
  font-size: var(--t-xs); font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
.group.newsgrp .nh .fa { width: 14px; height: 14px; color: var(--blue-700); }
.group.newsgrp .li.post { border-top: 1px solid var(--row-line, var(--hair)); }

/* The question on Home: orange while it takes answers, so it is seen to be active. The bar below is as it was. */
.live.open { background: var(--orange-100); border: 2px solid var(--orange); border-left-width: 6px; }
.live.open .fa { color: var(--orange); }
.live.open b { color: var(--orange-700); }
.live.open small { color: var(--ink); }

/* ROUND 23 ----------------------------------------------------------------------------------------------------------- */
/* The same small label above the question and above Areté (chosen from the proposals). Nothing is repeated inside. */
.lab { display: flex; align-items: center; gap: var(--s-2); margin: var(--s-4) var(--s-1) var(--s-2);
  font-size: var(--t-xs); font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
.lab i { width: 9px; height: 9px; border-radius: 50%; background: var(--grey); display: inline-block; flex: none; }
.lab.q.on i { background: var(--orange); }              /* a question is open */
.lab.arete i { background: var(--blue-700); }
#s-idle .lab:first-child, #nowbox > .lab:first-child { margin-top: 0; }
.group.newsgrp .nh { display: none; }
.live.open b, .live b { font-weight: 700; font-size: var(--t-md); line-height: 1.35; }
.live small { font-weight: 500; font-size: var(--t-sm); color: var(--ink-2); margin-top: 3px; }
.live.open small { color: var(--orange-700); }

/* The notice sits under the header, in the flow, and stays under it when the page scrolls. */
#offline { position: sticky; top: var(--head-h); z-index: 29; margin: 0; }

/* ROUND 24: no icon at the left of the question's box, open or not (the label above says what it is). */
.live .fa { display: none; }
#idlestate .dot { display: none; }

/* the box asks everybody to move to another address: nothing else can be used while it is shown */
#maint { display: none; position: fixed; inset: 0; z-index: 2000; background: var(--navy); overflow: auto;
  padding: var(--s-6) var(--s-4); }
#maint.on { display: block; }
#maint .mv { max-width: 420px; margin: 0 auto; background: var(--white); color: var(--ink);
  border-radius: var(--r-lg); padding: var(--s-5); }
#maint h1 { font-size: var(--t-xl); margin: 0 0 var(--s-3); }
#maint p { margin: 0 0 var(--s-3); }
#maint .mvst { font-size: var(--t-sm); min-height: 1.4em; }
#maint .b { width: 100%; margin: 0 0 var(--s-2); }
#maint { z-index: 2100; }

/* round 37: the app is kept by the phone; this line says a newer one is ready */
#newver { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-2) var(--s-3); background: var(--blue-50, #EEF5FF);
  color: var(--ink); font-size: var(--t-sm); font-weight: 600; border-bottom: 1px solid var(--hair); }
#newver[hidden] { display: none; }
#newver span { flex: 1; min-width: 0; }
#newver .b { flex: none; width: auto; min-height: 36px; margin: 0; }

/* ROUND 38: the console in the same Glass bridge look as the students' app. Only the look changes: surfaces float with
   the deep soft shadow and no border, the header has its gradient and shadow, the bar at the bottom floats and is
   a little glass. Nothing is moved, hidden or resized in a way that changes what can be done. ------------------------- */
.app-op header {
  background-color: var(--navy);
  background-image: linear-gradient(180deg, var(--navy) 0%, var(--navy-900) 100%);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .06), 0 6px 18px -10px rgba(9, 29, 99, .55);
}

/* surfaces: no border, a deep soft shadow, round */
.app-op .gate, .app-op .vbox, .app-op .pv, .app-op .arr, .app-op details.fold, .app-op .setcard, .app-op .card,
.app-op .group, .app-op .rte, .app-op .heat {
  border: 0; border-radius: var(--r-card); box-shadow: var(--float);
}
.app-op .row, .app-op .drow, .app-op .prow, .app-op .tally div { border-radius: 14px; box-shadow: var(--float); }
.app-op .row:not(.yes):not(.no), .app-op .drow, .app-op .tally div { border-color: transparent; }
.app-op .prow:not(.prog):not(.done):not(.running) { border-color: transparent; }
.app-op .prow.prog, .app-op .prow.done, .app-op .prow.running { border-top-color: transparent; border-right-color: transparent;
  border-bottom-color: transparent; }
.app-op .rte-bar { border-radius: var(--r-card) var(--r-card) 0 0; }
.app-op .rte-raw { border-radius: 0 0 var(--r-card) var(--r-card); }
.app-op .rte { overflow: hidden; }
.app-op .av { border-radius: 12px; }

/* fields */
.app-op input, .app-op select, .app-op textarea, .app-op .din, .app-op .tsel { border-color: var(--line); border-radius: 12px; }
.app-op .vbox input, .app-op .arr input { border-radius: 10px; }

/* times and tabs are pills, as on Home */
.app-op .legs span.leg, .app-op .legs button { border-color: transparent; border-radius: 999px; box-shadow: var(--float); }
.app-op .legs span.leg.on, .app-op .legs button.on { box-shadow: 0 1px 0 rgba(255, 255, 255, .14) inset, 0 8px 16px -10px rgba(13, 43, 140, .7); }
.app-op .prow .pt { align-self: start; padding: 3px 7px; text-align: center; border-radius: 999px; background: var(--blue-50); color: var(--blue-700);
  font-size: var(--t-sm); justify-self: start; }
.app-op .prow.prog .pt { background: var(--orange); color: var(--white); }
.app-op .prow.done .pt { background: var(--ok-100); color: var(--ok); }
.app-op .prow { grid-template-columns: 54px minmax(0, 1fr); gap: var(--s-2) var(--s-2); }

/* the course bar under the header: a little glass */
#coursebar { background: rgba(255, 255, 255, .92) !important; -webkit-backdrop-filter: saturate(1.3) blur(10px);
  backdrop-filter: saturate(1.3) blur(10px); border-bottom: 0 !important; box-shadow: 0 8px 20px -16px rgba(9, 29, 99, .5); }
#coursebar button { border: 0; box-shadow: var(--float); border-radius: 14px; }

/* the tally and the filters keep their layout; the buttons of the family keep their one look (white, blue, orange, green) */
.app-op .b:not(.quiet):not(.on):not(.arm):not(.blue):not(:disabled) { box-shadow: var(--float); border-color: transparent; }
.app-op .b.on, .app-op .b.arm, .app-op .b.blue { box-shadow: 0 1px 0 rgba(255, 255, 255, .14) inset, 0 8px 16px -10px rgba(13, 43, 140, .7); }
.app-op .seg { border-color: transparent; box-shadow: var(--float); }

/* the bar at the bottom floats on a phone; on a desk the rail stays */
@media (max-width: 899px) {
  .opnav {
    left: 50%; right: auto; transform: translateX(-50%); width: min(616px, calc(100% - 24px));
    bottom: calc(10px + env(safe-area-inset-bottom)); padding-bottom: 0; border: 0; border-radius: 22px;
    background: rgba(255, 255, 255, .95); box-shadow: 0 12px 30px -10px rgba(9, 29, 99, .5);
    -webkit-backdrop-filter: saturate(1.3) blur(10px); backdrop-filter: saturate(1.3) blur(10px);
  }
  .opnav .opt.on::before { top: 0; left: 28%; right: 28%; height: 3px; border-radius: 0 0 3px 3px; }
  .opnav .opt { border-radius: 22px; }
  .app-op main { padding-bottom: calc(var(--nav-h) + var(--s-6) + 14px + env(safe-area-inset-bottom)); }
  #opmore .panel { bottom: calc(var(--nav-h) + 24px + env(safe-area-inset-bottom)); left: 12px; right: 12px;
    border-radius: var(--r-card); box-shadow: var(--shadow-2); }
}
#opmore .grid button { border-color: transparent; box-shadow: var(--float); border-radius: 14px; }
#opmore .grid button.on { box-shadow: 0 1px 0 rgba(255, 255, 255, .14) inset, 0 8px 16px -10px rgba(13, 43, 140, .7); }
.app-op .prow .pm { gap: var(--s-2); }

/* the open questions on Home are a list like Arete's, with the orange mark */
.group.qgrp { background: var(--orange-100); border-color: transparent; }
.group.qgrp .li.post { background: transparent; box-shadow: none; border-top-color: rgba(255,255,255,.7); }
.group.qgrp .li.post.open { background: transparent; box-shadow: none; }
.group.qgrp .li.post.open .tx small { color: var(--orange-700); font-weight: 600; }
.group.qgrp .li.post .tx b { font-weight: 700; }
.group.qgrp .li.post.nochev::after { display: none; }

/* ROUND 47: how many are left (questions to answer, Aret\u00e9 to read), in blue like the dot of an unread text */
.nbadge { background: var(--blue-700); color: #fff; font-size: 12px; font-weight: 700; line-height: 1; min-width: 18px;
  height: 18px; padding: 0 5px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; }
#bnav button .nbadge { position: absolute; top: 6px; left: calc(50% + 6px); }
#sheet .list button .nbadge { margin-left: auto; }
#sheet .list button.hasbadge::after { margin-left: 0; }       /* the number sits just before the arrow, not in the middle */
.ptr.q { position: relative; }
.ptr.q.todo .pn { padding-right: 22px; }
.qdot { position: absolute; top: 50%; right: var(--s-3); width: 10px; height: 10px; margin-top: -5px; border-radius: 50%;
  background: var(--orange); }
.lab .nbadge.inl { letter-spacing: 0; text-transform: none; margin-left: var(--s-2); padding: 0 8px; }
.labsub { margin: calc(var(--s-1) * -1) var(--s-1) var(--s-2); font-size: var(--t-xs); color: var(--ink-3); }
.lab .nbadge.inl.q { background: var(--orange); }
.group.aretegrp { background: var(--blue-100); border-color: transparent; }
.group.aretegrp .li.post { background: transparent; box-shadow: none; border-top-color: rgba(255,255,255,.7); }
.group.aretegrp .li.post .tx b { font-weight: 700; }
.leftline { margin: 0 var(--s-1) var(--s-3); font-size: var(--t-sm); font-weight: 700; color: var(--blue-700); }

/* ROUND 49: the answers of a question on its card in the console */
.qans { margin-top: var(--s-3); border-top: 1px solid var(--hair); padding-top: var(--s-2); }
.qans .qa { padding: var(--s-2) 0; border-top: 1px solid var(--hair); }
.qans .qa:first-of-type { border-top: 0; }
.qans .qatext { font-size: var(--t-md); line-height: 1.5; white-space: pre-wrap; margin-top: 2px; }

/* ROUND 51: the Questionnaire tab, one row per session */
.evrow { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-3); padding: var(--s-3) 0; border-top: 1px solid var(--hair); }
.evrow .evmeta { flex: 1 1 100%; }
.evrow .evmeta b { display: block; font-weight: 700; }
.evrow .evmeta small { display: block; color: var(--ink-2); font-size: var(--t-xs); }
.evrow .evlab { flex: 1 1 14em; min-width: 0; }
.evrow .evform { flex: 1 1 100%; display: flex; flex-wrap: wrap; gap: var(--s-2); }
.evrow .evform[hidden] { display: none; }
.evrow .evmeta { flex: 1 1 12em; }

/* ROUND 52: the course panel: On going check per course, and the zip to add one */
#picker { max-width: 640px; }
.cpick .ongo { display: flex; flex-direction: column; justify-content: center; flex: none; }
#addcourse { margin-top: var(--s-4); }

/* ROUND 64: the refresh of the console bar, like the student's */
.app-op header .hrefresh { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px;
  background: none; border: 0; border-radius: 50%; cursor: pointer; }
.app-op header .hrefresh:hover { background: rgba(255,255,255,.14); }
.app-op header .hrefresh .fa { width: 20px; height: 20px; color: var(--white); }
.app-op header .hrefresh.spin .fa { animation: spin 600ms linear; }

/* ROUND 60: the log book of each course, chosen on the course panel */
.cpick .lbsel { width: auto; min-width: 8.5em; margin: 0; }
.cpick { flex-wrap: wrap; }

/* ROUND 70: the student app on a computer: the bar is a sidebar on the left, as in the console, and the content sits in the
   middle of what is left beside it. A phone and a narrow window keep the bottom bar. */
@media (hover: hover) and (pointer: fine) and (min-width: 900px) {
  #bnav { left: 0; right: auto; top: var(--head-h); bottom: 0; transform: none; width: 216px; height: auto; border-radius: 0;
    border: 0; border-right: 1px solid var(--hair); box-shadow: none; background: var(--white);
    -webkit-backdrop-filter: none; backdrop-filter: none; justify-content: flex-start; padding: var(--s-4) var(--s-2); overflow-y: auto; }
  #bnav .inner { flex-direction: column; gap: 2px; width: 100%; }
  #bnav button { flex: none; flex-direction: row; justify-content: flex-start; gap: var(--s-3); min-height: 48px;
    padding: 0 var(--s-3); border-radius: var(--r-md); font-size: var(--t-sm); }
  #bnav button[aria-current="page"] { background: var(--blue-50); }
  #bnav button[aria-current="page"]::before { display: none; }
  #bnav button .nbadge { position: static; margin-left: auto; }
  .app-student main { margin-left: max(232px, calc(232px + (100% - 232px - 720px) / 2)); margin-right: 0;
    width: min(720px, calc(100% - 232px)); max-width: none; padding-bottom: var(--s-6); }
  body[data-screen="login"] main, body[data-screen="setup"] main, body[data-screen="write"] main {
    margin: 0 auto; width: 100%; max-width: 640px; }
  #sheet.desk .panel { left: 228px; right: auto; bottom: 16px; }
}

/* ROUND 71: the sidebar of the student app holds what More holds, and Settings sits in the middle */
#bnav .deskonly { display: none; }
@media (hover: hover) and (pointer: fine) and (min-width: 900px) {
  #bnav button[data-go="more"] { display: none; }
  #bnav .gl.deskonly { display: block; font-size: var(--t-xs); font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
    color: var(--ink-3); margin: var(--s-4) var(--s-3) var(--s-1); }
  #bnav button.deskonly { display: flex; }
  #bnav button.deskonly .fa { width: 22px; height: 22px; color: var(--ink-3); }
  #bnav button.deskonly.danger { color: var(--orange-700, #B54708); }
  #bnav button.deskonly .nbadge { position: static; margin-left: auto; }
  #s-settings { max-width: 520px; margin-left: auto; margin-right: auto; }
  #s-settings .setcard { max-width: none; }
}

/* ROUND 74: the picture in Settings is in the middle of its box */
#my-photo-img { margin-left: auto !important; margin-right: auto !important; }

/* ROUND 101: the place of a session on its own line, in stronger ink; the arrows of a person's card ------------ */
.group .li .tx small.wh, .aitem .su.wh { color: var(--ink); font-weight: 600; }
.pnav { display: flex; justify-content: space-between; gap: var(--s-3); margin: 0 0 var(--s-3); }
.pnav[hidden] { display: none; }
.pnav button { flex: 1; min-height: 44px; border: 1px solid var(--hair); background: var(--white); color: var(--ink);
  border-radius: var(--r-md); font: inherit; font-weight: 600; cursor: pointer; }
.pnav button:hover { background: var(--blue-50); }
