/* BASELA teacher console. Tokens follow mobile/src/constants/theme.ts. */

:root {
  /* The app's palette */
  --gutter: #0b0805;
  --parchment: #c09b66;
  --parchment-deep: #b18c59;
  --vellum: #dbbc97;
  --ink: #241a10;
  --ink-soft: #4a3520;
  --gold: #e8c87a;
  --gold-deep: #a9803a;

  /* Derived for long working sessions */
  --gutter-2: #15100a;      /* sidebar */
  --gutter-3: #231a10;      /* hover / current on dark */
  --paper: #ebdac6;         /* vellum lightened: the working sheet */
  --paper-2: #f6ecdd;       /* fields, tracks */
  --paper-3: #dfc9ac;       /* table heads, quiet fills */
  --line: rgba(36, 26, 16, 0.14);
  --edge: #8c6a3e;          /* field borders, 3:1 on paper */
  --ok: #2f5530;
  --mark: #9a6a14;          /* chart marks: one hue, 3:1+ on the vellum (validated) */
  --bad: #8a2a1c;
  --warn: #6a4a10;

  --serif: "Noto Serif", Georgia, "Times New Roman", serif;
  --sans: "Noto Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --r: 10px;
  --r-sm: 6px;
  --shadow: 0 1px 0 rgba(0, 0, 0, 0.35), 0 14px 30px -18px rgba(0, 0, 0, 0.85);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after { box-sizing: border-box; }

html { color-scheme: dark; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--gutter);
  color: var(--parchment);
  font: 400 0.9375rem/1.55 var(--sans);
  font-variant-numeric: tabular-nums;
}

::selection { background: var(--gold); color: var(--ink); }

h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.25; margin: 0; text-wrap: balance; }
p { margin: 0; }
a { color: inherit; text-underline-offset: 3px; text-decoration-thickness: 1px; }
button, input, select, textarea { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }

:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 3px; }
.sheet :focus-visible { outline-color: var(--ink); }

.icon { width: 1.15em; height: 1.15em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

.skip { position: absolute; left: 12px; top: -48px; z-index: 10; padding: 8px 14px; background: var(--gold); color: var(--ink); border-radius: var(--r-sm); font-weight: 600; }
.skip:focus { top: 12px; }

/* Scrollbars carry the palette too */
* { scrollbar-color: var(--gold-deep) transparent; scrollbar-width: thin; }

/* ── Shell ───────────────────────────────────────────────────────────── */

.shell { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }

.side {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 28px;
  padding: 26px 16px 20px;
  background: var(--gutter-2);
  border-right: 1px solid rgba(169, 128, 58, 0.28);
}

.brand { display: grid; gap: 2px; padding: 0 10px; text-decoration: none; }
.brand .wordmark { font: 700 1.6rem/1 var(--serif); letter-spacing: 0.16em; color: var(--gold); }
.brand .sub { font-size: 0.8125rem; color: var(--parchment); letter-spacing: 0.02em; }

.nav ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: var(--r-sm);
  color: var(--parchment); text-decoration: none; font-weight: 500;
  transition: background-color 160ms var(--ease), color 160ms var(--ease);
}
.nav a:hover { background: var(--gutter-3); color: var(--gold); }
.nav a[aria-current="page"] { background: var(--gutter-3); color: var(--gold); }
.nav a[aria-current="page"] .nav-label {
  /* the current page is stitched */
  border-bottom: 1.5px dashed var(--gold-deep); padding-bottom: 1px;
}

.who { margin-top: auto; display: grid; gap: 10px; padding: 14px 10px 0; border-top: 1.5px dashed rgba(169, 128, 58, 0.45); }
.who .name { color: var(--vellum); font-weight: 600; overflow-wrap: anywhere; }
.who .role { color: var(--parchment); font-size: 0.8125rem; text-transform: capitalize; }

.main { padding: 34px clamp(16px, 3.2vw, 44px) 64px; min-width: 0; outline: none; }
.main > * + * { margin-top: 20px; }

.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px 24px; margin-bottom: 4px; }
.page-head h1 { font-size: 1.75rem; color: var(--gold); letter-spacing: 0.01em; }
.page-head .lede { color: var(--parchment); margin-top: 4px; max-width: 62ch; }
.page-head .actions { display: flex; flex-wrap: wrap; gap: 10px; }
.crumb { display: inline-flex; align-items: center; gap: 6px; color: var(--parchment); text-decoration: none; font-size: 0.875rem; margin-bottom: 6px; }
.crumb:hover { color: var(--gold); }

/* ── Sheets (vellum on the gutter) ───────────────────────────────────── */

.sheet {
  color-scheme: light; /* native radios, checkboxes and menus drawn light on vellum */
  position: relative;  /* keeps visually-hidden labels inside tables from widening the page */
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--gold-deep);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  padding: 22px 24px;
  min-width: 0;
}
.sheet > * + * { margin-top: 14px; }
.sheet > .sheet-head + *, .sheet > h2 + * { margin-top: 20px; }
.sheet > .options { margin-top: 22px; }
.sheet h2 { font-size: 1.125rem; color: var(--ink); }
.sheet h3 { font-size: 1rem; color: var(--ink); }
.sheet .hint, .hint { color: var(--ink-soft); font-size: 0.875rem; }
.sheet-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 16px; }

/* A stitched seam between parts of one sheet */
.seam { border: 0; border-top: 1.5px dashed var(--gold-deep); margin: 20px 0; height: 0; }

.grid { display: grid; gap: 20px; grid-template-columns: repeat(12, minmax(0, 1fr)); }
.span-12 { grid-column: span 12; }
.span-7 { grid-column: span 7; }
.span-5 { grid-column: span 5; }
.split { display: grid; gap: 20px; grid-template-columns: 280px minmax(0, 1fr); align-items: start; }
.stack > * + * { margin-top: 16px; }

/* ── Controls ────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 8px 16px;
  border: 1px solid var(--ink); border-radius: var(--r-sm);
  background: var(--ink); color: var(--gold);
  font-weight: 600; font-size: 0.875rem; text-decoration: none; cursor: pointer;
  transition: background-color 160ms var(--ease), border-color 160ms var(--ease), color 160ms var(--ease);
}
.btn:hover { background: #3a2b1b; border-color: #3a2b1b; }
.btn.quiet { background: transparent; color: var(--ink); border-color: var(--edge); }
.btn.quiet:hover { background: var(--paper-3); }
.btn.danger { background: var(--bad); border-color: var(--bad); color: #fbeee4; }
.btn.danger:hover { background: #6f2015; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; }
.btn.small { min-height: 34px; padding: 5px 12px; }

/* on the dark ground */
.on-dark .btn { background: var(--gold); border-color: var(--gold); color: var(--ink); }
.on-dark .btn:hover { background: #f1d896; }
.on-dark .btn.quiet { background: transparent; color: var(--gold); border-color: var(--gold-deep); }
.on-dark .btn.quiet:hover { background: var(--gutter-3); }
.side .btn.quiet { background: transparent; color: var(--parchment); border-color: rgba(169, 128, 58, 0.55); justify-content: flex-start; }
.side .btn.quiet:hover { color: var(--gold); background: var(--gutter-3); }

.icon-btn {
  display: inline-grid; place-items: center; width: 36px; height: 36px;
  border: 1px solid transparent; border-radius: var(--r-sm);
  background: transparent; color: var(--ink-soft); cursor: pointer;
}
.icon-btn:hover { background: var(--paper-3); color: var(--ink); border-color: var(--edge); }
.icon-btn.danger:hover { color: var(--bad); }
.icon-btn:disabled { opacity: 0.35; cursor: not-allowed; background: transparent; border-color: transparent; }

.field { display: grid; gap: 6px; }
.field > span, .label { font-size: 0.8125rem; font-weight: 600; color: var(--ink-soft); }
.input, .select, .textarea {
  width: 100%; min-height: 40px; padding: 8px 11px;
  background: var(--paper-2); color: var(--ink);
  border: 1px solid var(--edge); border-radius: var(--r-sm);
  transition: border-color 160ms var(--ease), box-shadow 160ms var(--ease);
}
.textarea { min-height: 76px; resize: vertical; line-height: 1.5; }
.input::placeholder, .textarea::placeholder { color: #6e5a43; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(169, 128, 58, 0.4); }
.input[aria-invalid="true"] { border-color: var(--bad); }
.select { appearance: none; padding-right: 34px; background-image: linear-gradient(45deg, transparent 50%, var(--ink-soft) 50%), linear-gradient(135deg, var(--ink-soft) 50%, transparent 50%); background-position: calc(100% - 17px) 55%, calc(100% - 12px) 55%; background-size: 5px 5px; background-repeat: no-repeat; }
.check { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); font-weight: 500; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--ink); }

.row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.row > .field { flex: 1 1 180px; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.toolbar .grow { flex: 1 1 220px; }
.search { position: relative; }
.search .icon { position: absolute; left: 11px; top: 50%; translate: 0 -50%; color: var(--ink-soft); }
.search .input { padding-left: 36px; }

/* ── Messages ────────────────────────────────────────────────────────── */

.msg { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border-radius: var(--r-sm); font-size: 0.875rem; border: 1px solid; }
.msg .icon { margin-top: 2px; }
.msg.error { color: var(--bad); background: #f4ddd3; border-color: #c9907f; }
.msg.ok { color: var(--ok); background: #e2ead6; border-color: #9fb48d; }
.msg.info { color: var(--ink-soft); background: var(--paper-3); border-color: var(--edge); }
.msg .btn { margin-left: auto; }
.on-dark .msg.error, .msg.on-dark.error { background: #2a120c; color: #f2b7a8; border-color: #6d2a1d; }

.empty { padding: 26px 8px; text-align: center; color: var(--ink-soft); }
.empty strong { display: block; font-family: var(--serif); font-size: 1.05rem; color: var(--ink); margin-bottom: 4px; }

.skeleton { border-radius: var(--r); background: linear-gradient(90deg, #1b140c 0%, #251c12 50%, #1b140c 100%); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; min-height: 120px; }
@keyframes shimmer { to { background-position: -200% 0; } }

.tag { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 99px; font-size: 0.75rem; font-weight: 600; border: 1px solid var(--edge); color: var(--ink-soft); background: var(--paper-2); white-space: nowrap; }
.tag.ok { color: var(--ok); border-color: #8ea67c; background: #e6eddb; }
.tag.bad { color: var(--bad); border-color: #c9907f; background: #f5e2da; }
.tag.warn { color: var(--warn); border-color: #c6a467; background: #f4e6c8; }

/* ── Tables ──────────────────────────────────────────────────────────── */

.table-wrap { overflow-x: auto; margin-inline: -24px; padding-inline: 24px; }
table { width: 100%; min-width: 560px; border-collapse: collapse; font-size: 0.875rem; }
table.wide { min-width: 860px; }
th { text-align: left; font-weight: 600; font-size: 0.75rem; letter-spacing: 0.03em; color: var(--ink-soft); padding: 9px 10px; background: var(--paper-3); white-space: nowrap; }
th:first-child { border-radius: var(--r-sm) 0 0 var(--r-sm); }
th:last-child { border-radius: 0 var(--r-sm) var(--r-sm) 0; }
td { padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
tbody tr:hover td { background: rgba(169, 128, 58, 0.09); }
td.num, th.num { text-align: right; }
td .sub { display: block; color: var(--ink-soft); font-size: 0.8125rem; overflow-wrap: anywhere; }
td a { font-weight: 600; }
tr.editing td { background: var(--paper-3); }

.ticks { display: inline-flex; gap: 4px; }
.tick { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--edge); color: var(--edge); }
.tick.on { background: var(--ok); border-color: var(--ok); color: #eef3e6; }
.tick .icon { width: 13px; height: 13px; stroke-width: 2.4; }

/* ── Overview ────────────────────────────────────────────────────────── */

/* The class as a path through the course */
.path { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; }
.path li { position: relative; padding: 4px 10px 0 0; }
.path li::before { content: ""; position: absolute; left: 14px; right: 0; top: 13px; border-top: 1.5px dashed var(--gold-deep); }
.path li:last-child::before { display: none; }
.path .knot { position: relative; display: block; width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--ink); background: var(--c, var(--paper-2)); }
.path .count { display: block; margin-top: 10px; font: 600 1.75rem/1 var(--serif); color: var(--ink); }
.path .name { display: block; margin-top: 4px; font-size: 0.8125rem; color: var(--ink-soft); font-weight: 600; }
.thread { display: flex; height: 12px; border-radius: 99px; overflow: hidden; background: var(--paper-2); border: 1px solid var(--edge); }
.thread span { background: var(--c); min-width: 0; transition: flex-grow 300ms var(--ease); }
.thread span + span { border-left: 1px solid var(--paper); }

/* Pass rates as tape measures */
.rates { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.rate { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: baseline; }
.rate a, .rate .title { font-weight: 600; text-decoration: none; }
.rate a:hover { text-decoration: underline; }
.rate .pct { font: 600 1rem var(--serif); }
.rate .meta { grid-column: 1 / -1; color: var(--ink-soft); font-size: 0.8125rem; }
.tape {
  grid-column: 1 / -1; position: relative; height: 14px; border-radius: 3px;
  background: var(--paper-2); border: 1px solid var(--edge); overflow: hidden;
}
.tape > span { position: absolute; inset: 0 auto 0 0; width: var(--v, 0%); background: var(--mark); transition: width 400ms var(--ease); }
.tape.low > span { background: var(--bad); }
.tape::after {
  content: ""; position: absolute; inset: 0;
  background-image:
    repeating-linear-gradient(to right, transparent 0 calc(10% - 1px), rgba(36, 26, 16, 0.55) calc(10% - 1px) 10%),
    repeating-linear-gradient(to right, transparent 0 calc(5% - 1px), rgba(36, 26, 16, 0.28) calc(5% - 1px) 5%);
  background-size: 100% 100%, 100% 45%;
  background-repeat: no-repeat;
  pointer-events: none;
}
.pass-line { position: absolute; top: -3px; bottom: -3px; left: 60%; border-left: 2px solid var(--ink); z-index: 1; }

.days { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; align-items: end; height: 150px; }
.days li { display: grid; grid-template-rows: auto 1fr auto; gap: 4px; height: 100%; text-align: center; font-size: 0.8125rem; }
.days .bar { align-self: end; border-radius: 4px 4px 0 0; background: var(--mark); min-height: 2px; height: var(--h); }
.days .n { font-weight: 600; color: var(--ink); }
.days .d { color: var(--ink-soft); white-space: nowrap; font-size: 0.75rem; }

.people { list-style: none; margin: 0; padding: 0; }
.people li { display: flex; gap: 12px; align-items: baseline; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--line); }
.people li:last-child { border-bottom: 0; }
.people .why { color: var(--ink-soft); font-size: 0.8125rem; text-align: right; }

/* ── Timeline ────────────────────────────────────────────────────────── */

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px 20px; }
.facts dt { font-size: 0.75rem; font-weight: 600; color: var(--ink-soft); }
.facts dd { margin: 2px 0 0; font-weight: 600; overflow-wrap: anywhere; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline .day { font: 600 0.875rem var(--serif); color: var(--ink-soft); padding: 16px 0 6px; border-bottom: 1.5px dashed var(--gold-deep); }
.timeline .day:first-child { padding-top: 0; }
.event { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.event .mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--paper-3); color: var(--ink-soft); }
.event.pass .mark { background: #dfe8d3; color: var(--ok); }
.event.fail .mark { background: #f2dcd3; color: var(--bad); }
.event .what { font-weight: 600; }
.event .time { color: var(--ink-soft); font-size: 0.8125rem; white-space: nowrap; }
.missed { margin: 6px 0 0; padding-left: 18px; color: var(--ink-soft); font-size: 0.875rem; }
.missed li + li { margin-top: 2px; }

/* ── Editors ─────────────────────────────────────────────────────────── */

.picker { padding: 10px; }
.picker > * + * { margin-top: 0; }
.picker-select { display: none; }
.picker h2 { font-size: 0.8125rem; font-family: var(--sans); font-weight: 700; color: var(--ink-soft); padding: 12px 10px 6px; letter-spacing: 0.02em; }
.picker h2:first-child { padding-top: 4px; }
.picker ul { list-style: none; margin: 0; padding: 0; }
.picker a { display: flex; justify-content: space-between; gap: 10px; padding: 8px 10px; border-radius: var(--r-sm); text-decoration: none; color: var(--ink); }
.picker a:hover { background: var(--paper-3); }
.picker a[aria-current="page"] { background: var(--ink); color: var(--gold); }
.picker a[aria-current="page"] .count { color: var(--vellum); }
.picker .count { color: var(--ink-soft); font-size: 0.8125rem; white-space: nowrap; }

.tabs { display: flex; gap: 4px; border-bottom: 1.5px dashed var(--gold-deep); }
.tabs a { padding: 8px 14px; text-decoration: none; color: var(--parchment); font-weight: 600; border-radius: var(--r-sm) var(--r-sm) 0 0; }
.tabs a:hover { color: var(--gold); }
.tabs a[aria-current="page"] { color: var(--gold); background: var(--gutter-3); }

.savebar {
  position: sticky; bottom: 12px; z-index: 2;
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  padding: 12px 16px; border-radius: var(--r);
  background: var(--gutter-2); border: 1px solid var(--gold-deep); box-shadow: 0 12px 30px -10px rgba(0, 0, 0, 0.9);
}
.savebar .state { color: var(--parchment); font-size: 0.875rem; margin-right: auto; }
.savebar .state.dirty { color: var(--gold); }

.q-head { display: flex; align-items: center; gap: 10px; }
.q-head h3 { margin-right: auto; }
.q-head .tools { display: flex; gap: 2px; }
.options { border: 0; margin: 0; padding: 0; display: grid; gap: 8px; }
.options legend { padding: 0; margin-bottom: 10px; }
.opt { display: grid; grid-template-columns: auto auto minmax(0, 1fr); align-items: center; gap: 10px; }
.opt input[type="radio"] { width: 18px; height: 18px; accent-color: var(--ok); margin: 0; }
.opt .letter { font: 700 0.9375rem var(--serif); width: 1.2em; text-align: center; }
.opt.right .input { border-color: var(--ok); box-shadow: 0 0 0 1px var(--ok); background: #eef2e4; }

.slides { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 14px; }
.slide { display: grid; gap: 6px; margin: 0; }
.slide .frame { position: relative; aspect-ratio: 9 / 16; border-radius: var(--r-sm); overflow: hidden; background: var(--gutter); border: 1px solid var(--edge); }
.slide .frame img { width: 100%; height: 100%; object-fit: contain; }
.slide .num { position: absolute; left: 6px; top: 6px; padding: 0 7px; border-radius: 99px; background: rgba(11, 8, 5, 0.82); color: var(--gold); font-size: 0.75rem; font-weight: 700; }
.slide.current .frame { outline: 3px solid var(--ink); outline-offset: 2px; }
.slide .src { position: absolute; left: 6px; bottom: 6px; padding: 0 7px; border-radius: 99px; background: rgba(11, 8, 5, 0.82); color: var(--vellum); font-size: 0.6875rem; font-weight: 600; }
.slide figcaption { display: flex; justify-content: space-between; }
.slide .tools .icon-btn { width: 32px; height: 32px; }
.restore-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 10px; }
.restore-grid button { padding: 0; border: 1px solid var(--edge); border-radius: var(--r-sm); background: var(--gutter); overflow: hidden; cursor: pointer; position: relative; aspect-ratio: 9 / 16; }
.restore-grid button:hover { outline: 2px solid var(--ink); }
.restore-grid img { width: 100%; height: 100%; object-fit: contain; }
.restore-grid span { position: absolute; left: 4px; bottom: 4px; padding: 0 6px; border-radius: 99px; background: rgba(11, 8, 5, 0.82); color: var(--gold); font-size: 0.6875rem; font-weight: 700; }

details.more > summary { cursor: pointer; font-weight: 600; color: var(--ink); list-style: none; display: inline-flex; align-items: center; gap: 8px; }
details.more > summary::-webkit-details-marker { display: none; }
details.more[open] > summary { margin-bottom: 12px; }

.lesson-layout { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr) 300px; align-items: start; }
.phone { position: sticky; top: 24px; display: grid; gap: 10px; justify-items: center; }
.phone .device {
  width: 100%; max-width: 260px; aspect-ratio: 9 / 19.5; border-radius: 30px; padding: 10px;
  background: #050302; border: 1px solid var(--gold-deep); box-shadow: var(--shadow);
}
.phone .screen { width: 100%; height: 100%; border-radius: 22px; overflow: hidden; background: var(--gutter); display: grid; place-items: center; }
.phone .screen img { width: 100%; height: 100%; object-fit: contain; }
.phone .screen p { color: var(--parchment); padding: 20px; text-align: center; font-size: 0.875rem; }
.phone .controls { display: flex; align-items: center; gap: 10px; color: var(--parchment); font-size: 0.875rem; }
.phone .controls .icon-btn { color: var(--gold); }
.phone .controls .icon-btn:hover { background: var(--gutter-3); border-color: var(--gold-deep); color: var(--gold); }

.confirm { display: grid; gap: 10px; padding: 14px; border-radius: var(--r-sm); border: 1px dashed var(--bad); background: #f4e3db; }
.confirm p { color: var(--bad); font-weight: 600; font-size: 0.875rem; }

/* ── Sign-in ─────────────────────────────────────────────────────────── */

.signin { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.signin-card { width: min(420px, 100%); }
.signin-card .brand { padding: 0; margin-bottom: 22px; text-align: center; justify-items: center; }
.signin-card .brand .wordmark { font-size: 2.4rem; }
.signin-card .brand .sub { font-size: 0.9375rem; }
.signin-card form { display: grid; gap: 14px; }
.signin-card .btn { width: 100%; min-height: 44px; }
.signin-foot { margin-top: 18px; text-align: center; color: var(--parchment); font-size: 0.8125rem; }

.noscript { padding: 24px; color: var(--vellum); }

/* ── Small screens ───────────────────────────────────────────────────── */

@media (max-width: 1180px) {
  .lesson-layout { grid-template-columns: minmax(0, 1fr); }
  .phone { position: static; }
}

@media (max-width: 960px) {
  .span-7, .span-5 { grid-column: span 12; }
  .split { grid-template-columns: minmax(0, 1fr); }
  .picker { padding: 14px 16px; }
  .picker .picker-lists { display: none; }
  .picker .picker-select { display: grid; }
}

@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .side {
    position: sticky; top: 0; z-index: 5; height: auto;
    flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px 12px;
    padding: 12px 16px 0; border-right: 0; border-bottom: 1px solid rgba(169, 128, 58, 0.28);
  }
  .side .brand { padding: 0; }
  .side .brand .wordmark { font-size: 1.25rem; }
  .side .brand .sub { display: none; }
  .who { margin: 0 0 0 auto; padding: 0; border: 0; display: flex; align-items: center; gap: 10px; }
  .who .name, .who .role { display: none; }
  .who .btn { min-height: 36px; padding: 6px 12px; }
  .nav { order: 3; flex-basis: 100%; overflow-x: auto; }
  .nav ul { display: flex; justify-content: space-between; gap: 2px; width: 100%; min-width: max-content; }
  .nav a { padding: 10px 5px 12px; border-radius: 0; font-size: 0.8125rem; }
  .nav a .icon { display: none; }
  .nav a[aria-current="page"] { background: transparent; }
  .main { padding: 22px 16px 48px; }
  .page-head h1 { font-size: 1.5rem; }
  .sheet { padding: 18px 16px; }
  .table-wrap { margin-inline: -16px; padding-inline: 16px; }

  /* Tables become one card per row, so nothing hides off to the side. */
  table.cards { min-width: 0; }
  table.cards thead { display: none; }
  table.cards tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px 14px; padding: 14px 0; border-bottom: 1px solid var(--line); }
  table.cards td { display: block; padding: 0; border: 0; text-align: left; }
  table.cards td.full { grid-column: 1 / -1; }
  table.cards td[data-label]::before { content: attr(data-label); display: block; margin-bottom: 2px; font-size: 0.75rem; font-weight: 600; color: var(--ink-soft); }
  table.cards td.inline-label[data-label]::before { display: inline; margin-right: 4px; font-size: inherit; color: var(--ink); }
  table.cards tbody tr:hover td { background: none; }
  table.cards .toolbar { justify-content: flex-start !important; }
  table.cards tr.editing { display: block; padding: 0 0 14px; }
  table.cards tr.editing td { padding: 14px; border-radius: var(--r-sm); }

  .savebar { flex-wrap: nowrap; gap: 8px; padding: 8px 10px; bottom: 8px; }
  .savebar .state { font-size: 0.75rem; min-width: 0; }
  .savebar .btn { min-height: 38px; padding: 6px 10px; font-size: 0.8125rem; white-space: nowrap; }
  .savebar .btn .icon { display: none; }
  .path { grid-template-columns: repeat(5, minmax(56px, 1fr)); overflow-x: auto; }
  .path .count { font-size: 1.35rem; }
  .path .name { font-size: 0.75rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0ms !important; animation: none !important; }
}

/* ── Charts (Overview, Analytics) ───────────────────────────────────── */

.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; }
.filters .select { width: auto; min-width: 200px; }
.on-dark-check { color: var(--vellum); }
.on-dark-check input { accent-color: var(--gold); }

.tip {
  position: fixed; z-index: 20; max-width: 260px; pointer-events: none;
  padding: 6px 10px; border-radius: var(--r-sm);
  background: var(--ink); color: var(--paper); font-size: 0.8125rem; line-height: 1.4;
  box-shadow: 0 8px 20px -8px rgba(0, 0, 0, 0.6);
}

.facts.course dd { font: 600 1.125rem var(--serif); }

.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.feed li:last-child { border-bottom: 0; }
.feed .what { color: var(--ink-soft); font-size: 0.875rem; grid-column: 1; }
.feed .when { color: var(--ink-soft); font-size: 0.8125rem; grid-row: 1; grid-column: 2; white-space: nowrap; }

/* Column charts: one hue, bars from one baseline, 2px gaps, 4px rounded tops. */
.cols { display: flex; align-items: flex-end; gap: 2px; height: 120px; border-bottom: 1px solid var(--edge); position: relative; }
.cols .col { flex: 1 1 0; display: flex; align-items: flex-end; justify-content: center; height: 100%; min-width: 0; outline-offset: 1px; }
.cols .col > span { width: 100%; max-width: 24px; height: var(--h); min-height: 0; background: var(--mark); border-radius: 4px 4px 0 0; }
.cols .col.zero > span { height: 2px; background: var(--paper-3); border-radius: 1px; }
.cols .col:hover > span, .cols .col:focus-visible > span { background: var(--ink-soft); }
.cols .pass { position: absolute; top: -6px; bottom: 0; border-left: 1.5px solid var(--ink); }
.cols .pass span { position: absolute; top: -14px; left: 4px; font-size: 0.6875rem; font-weight: 700; color: var(--ink); white-space: nowrap; }
.axis { display: flex; justify-content: space-between; font-size: 0.75rem; color: var(--ink-soft); margin-top: 4px; }

.multiples { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 22px 28px; }
.multiple h3 { font-size: 0.9375rem; }
.multiple .meta { color: var(--ink-soft); font-size: 0.8125rem; margin: 2px 0 18px; }

.thin { display: block; height: 8px; border-radius: 99px; background: var(--paper-2); border: 1px solid var(--line); overflow: hidden; min-width: 80px; }
.thin > span { display: block; height: 100%; width: var(--v, 0%); background: var(--mark); border-radius: 99px; }

details.table-view > summary { cursor: pointer; font-size: 0.8125rem; font-weight: 600; color: var(--ink-soft); margin-top: 10px; }
details.table-view table { margin-top: 8px; }
