/* The look of the River Tech guides.
 *
 * One stylesheet for /parents/, /students/, /teachers/ and /admin/. It started
 * inlined in the parent guide, copied from 404.html's self-contained pattern -
 * which is right for a 404, because a 404 is exactly when a stylesheet path is
 * likely to be wrong too. A guide is reached from a working link on a working
 * page, so that reasoning does not carry, and four copies of four hundred lines
 * is how three of them quietly drift from the fourth.
 *
 * Palette and tokens are the portal's own, so a guide reads as part of the site.
 * Dark is the default; the light block only redefines tokens, and is guarded so
 * an explicit data-theme="dark" still wins.
 *
 * The .ui-* classes at the bottom are the portal rebuilt in CSS. Every "here is
 * what you will see" block in a guide is drawn with them and captioned with
 * invented names, because a screenshot of the working portal carries a real
 * family's name and this repo is served verbatim to anyone who asks for it.
 */

/* The palette is the portal's own so a guide reads as part of the site. Every
   screen in a guide is drawn in CSS rather than screenshotted: a screenshot of
   the working portal carries a real family's name, and this repo is served
   verbatim to anyone who asks for it. Every name in a mock-up is invented. */
:root {
  /* The portal's own palette, so this reads as part of the site. */
  --bg: #0f1216;
  --card: #151a21;
  --surface: #0b1017;
  --text: #e6edf3;
  --muted: #97a2b0;
  --accent: #6aa9ff;
  --accent-2: #8bffb0;
  --warning: #ffd36a;
  --danger: #ff6a6a;
  --border: #2a3140;
  --border-soft: #1a2330;
  --code-bg: rgba(0,0,0,.3);
  --shadow: 0 10px 30px rgba(0,0,0,.35);
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f6f8fa;
    --card: #ffffff;
    --surface: #f0f3f6;
    --text: #1c2128;
    --muted: #57606a;
    --accent: #0969da;
    --accent-2: #1a7f37;
    --warning: #9a6700;
    --danger: #cf222e;
    --border: #d0d7de;
    --border-soft: #e3e8ee;
    --code-bg: rgba(0,0,0,.05);
    --shadow: 0 8px 24px rgba(31,35,40,.08);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 86px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); }
a:hover { text-decoration: none; }
code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .88em;
  background: var(--code-bg);
  border: 1px solid var(--border-soft);
  border-radius: 5px;
  padding: 1px 5px;
  word-break: break-word;
}

/* ---------------------------------------------------------- page chrome */
.topbar {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
@supports not (backdrop-filter: blur(8px)) { .topbar { background: var(--bg); } }
.topbar-inner {
  max-width: 1140px; margin: 0 auto;
  padding: 12px 20px;
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
}
.mark { font-weight: 700; letter-spacing: -.01em; font-size: 15px; }
.mark span { color: var(--muted); font-weight: 500; }
/* min-width:0 lets the nav shrink below its content width so the pills
   wrap instead of widening the bar. Cheap insurance: a flex item defaults
   to refusing to shrink past its content, and one extra link would do it. */
.topbar nav {
  margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap;
  flex: 1 1 auto; min-width: 0; justify-content: flex-end;
}
.topbar nav a {
  font-size: 13px; text-decoration: none; color: var(--text);
  border: 1px solid var(--border); border-radius: 999px; padding: 5px 12px;
}
.topbar nav a:hover { border-color: var(--accent); }
.topbar nav a.go { background: var(--accent); border-color: var(--accent); color: #0b1017; font-weight: 600; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .topbar nav a.go { color: #fff; }
}

.wrap { max-width: 1140px; margin: 0 auto; padding: 0 20px 80px; }

/* ------------------------------------------------------------------ hero */
.hero { padding: 44px 0 30px; border-bottom: 1px solid var(--border); }
.eyebrow {
  text-transform: uppercase; letter-spacing: .12em; font-size: 12px;
  color: var(--muted); font-weight: 600; margin-bottom: 10px;
}
h1 {
  margin: 0 0 14px; font-size: clamp(28px, 4.4vw, 40px);
  line-height: 1.15; letter-spacing: -.02em; text-wrap: balance;
}
.lede { font-size: 18px; color: var(--muted); max-width: 62ch; margin: 0 0 22px; }
.hero-links { display: flex; flex-wrap: wrap; gap: 10px; }
.pill {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--border); border-radius: 10px;
  padding: 10px 14px; text-decoration: none; color: var(--text);
  background: var(--card); font-size: 14px;
}
.pill:hover { border-color: var(--accent); }
.pill b { font-weight: 600; }
.pill small { color: var(--muted); }

/* ----------------------------------------------------------- the columns */
.cols { display: grid; grid-template-columns: 236px minmax(0, 1fr); gap: 44px; padding-top: 34px; }
/* minmax(0, 1fr) rather than a bare 1fr. A grid track's default minimum is
   auto, so any wide child that is NOT inside its own scroll container
   would stretch the track past the viewport. The tables here are safe -
   .tablewrap scrolls - but the next wide thing added might not be. */
@media (max-width: 900px) { .cols { grid-template-columns: minmax(0, 1fr); gap: 26px; } }
.toc, .body { min-width: 0; }

.toc { position: sticky; top: 74px; align-self: start; font-size: 14px; }
@media (max-width: 900px) {
  .toc { position: static; border: 1px solid var(--border); border-radius: 12px; padding: 16px 18px; background: var(--card); }
}
.toc h2 {
  font-size: 11px; text-transform: uppercase; letter-spacing: .12em;
  color: var(--muted); margin: 0 0 12px; font-weight: 600;
}
.toc ol { list-style: none; margin: 0 0 20px; padding: 0; }
.toc li { margin: 0; }
.toc a {
  display: block; padding: 5px 0 5px 12px; color: var(--muted);
  text-decoration: none; border-left: 2px solid var(--border-soft); line-height: 1.4;
}
.toc a:hover { color: var(--text); border-left-color: var(--accent); }
.toc a.head { color: var(--text); font-weight: 600; margin-top: 12px; }

/* ------------------------------------------------------------- main body */
.body > section { padding-top: 14px; margin-bottom: 52px; }
h2.sec {
  font-size: clamp(22px, 3vw, 28px); letter-spacing: -.015em;
  margin: 0 0 6px; text-wrap: balance;
}
.sec-note { color: var(--muted); margin: 0 0 24px; max-width: 64ch; }
h3 { font-size: 18px; margin: 34px 0 10px; letter-spacing: -.01em; }
h4 { font-size: 15px; margin: 22px 0 8px; }
p { margin: 0 0 14px; max-width: 68ch; }
ul, ol { max-width: 68ch; }
li { margin-bottom: 6px; }

/* ------------------------------------------------------------ the steps */
ol.steps { counter-reset: step; list-style: none; margin: 0; padding: 0; max-width: none; }
ol.steps > li {
  counter-increment: step;
  position: relative;
  padding: 0 0 34px 56px;
  margin: 0;
}
ol.steps > li::before {
  content: counter(step);
  position: absolute; left: 0; top: 0;
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent); color: #0b1017;
  font-weight: 700; font-size: 15px;
  font-variant-numeric: tabular-nums;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) ol.steps > li::before { color: #fff; }
}
/* The rule that joins one step to the next. It stops at the last step. */
ol.steps > li::after {
  content: ""; position: absolute; left: 16px; top: 40px; bottom: 6px;
  width: 2px; background: var(--border);
}
ol.steps > li:last-child::after { display: none; }
ol.steps > li > h3 { margin: 4px 0 8px; font-size: 19px; }
@media (max-width: 560px) {
  ol.steps > li { padding-left: 44px; }
  ol.steps > li::before { width: 28px; height: 28px; font-size: 13px; }
  ol.steps > li::after { left: 13px; top: 34px; }
}

/* --------------------------------------------------------- the callouts */
.note {
  border: 1px solid var(--border); border-left: 3px solid var(--accent);
  background: var(--card); border-radius: 0 10px 10px 0;
  padding: 14px 16px; margin: 18px 0; font-size: 15px;
}
.note.warn { border-left-color: var(--warning); }
.note.good { border-left-color: var(--accent-2); }
.note > :last-child { margin-bottom: 0; }
/* Only the LEAD-IN is a block. `.note b` matched every bold in the
   callout, so an inline <b>Save Preferences</b> halfway through a sentence
   broke onto its own line and took the rest of the sentence with it. */
.note > b:first-child { display: block; margin-bottom: 4px; }

/* ------------------------------------------------------------ the cards */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 16px; margin: 20px 0; }
.rcard {
  border: 1px solid var(--border); border-radius: 12px; padding: 18px 20px;
  background: var(--card);
}
.rcard h4 { margin: 0 0 8px; font-size: 16px; }
.rcard p { font-size: 14px; color: var(--muted); margin: 0; }

/* ---------------------------------------------------------- the tables */
.tablewrap { overflow-x: auto; margin: 18px 0; border: 1px solid var(--border); border-radius: 12px; }
table { border-collapse: collapse; width: 100%; font-size: 14.5px; min-width: 460px; }
th, td { text-align: left; padding: 11px 16px; border-bottom: 1px solid var(--border-soft); vertical-align: top; }
thead th { background: var(--surface); font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
tbody tr:last-child td { border-bottom: 0; }

/* ================================================== the portal mock-ups */
/* A screen the parent will actually see, rebuilt in CSS. */
.shot {
  border: 1px solid var(--border); border-radius: 12px; overflow: hidden;
  background: var(--card); box-shadow: var(--shadow); margin: 20px 0 8px;
}
.shot-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 12px; background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.dots { display: flex; gap: 5px; }
.dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--border); display: block; }
.shot-url {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11.5px; color: var(--muted);
  background: var(--bg); border: 1px solid var(--border-soft);
  border-radius: 6px; padding: 3px 10px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.shot-body { padding: 18px; background: var(--bg); }
.caption { font-size: 13px; color: var(--muted); margin: 0 0 24px; max-width: 68ch; }
.caption b { color: var(--text); font-weight: 600; }

/* the pieces the portal is made of */
.ui-h { font-size: 15px; font-weight: 700; margin: 0 0 10px; }
.ui-sub { font-size: 12.5px; color: var(--muted); margin: 0 0 12px; }
.ui-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 10px; padding: 14px 16px;
}
.ui-grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; }
.ui-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  border-radius: 8px; padding: 8px 14px; font-size: 13px; font-weight: 500;
  width: 100%; text-align: center;
}
.ui-btn.primary {
  background: linear-gradient(135deg, #6aa9ff, #8bffb0);
  border-color: transparent; color: #0b0f14; font-weight: 600;
}
.ui-btn.link { background: transparent; border: 0; color: var(--accent); font-size: 13px; padding: 4px; }
.ui-btn + .ui-btn { margin-top: 8px; }
.ui-btnrow { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; }
.ui-btnrow .ui-btn + .ui-btn { margin-top: 0; }

.ui-field { margin-bottom: 12px; }
.ui-field label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.ui-input {
  border: 1px solid var(--border); background: var(--surface);
  border-radius: 7px; padding: 8px 10px; font-size: 13px; color: var(--muted);
  min-height: 34px; display: flex; align-items: center;
}
.ui-input.mono { font-family: ui-monospace, Menlo, Consolas, monospace; letter-spacing: 3px; font-size: 15px; }
.ui-hint { font-size: 11px; color: var(--muted); margin-top: 4px; }

.ui-tabs { display: flex; gap: 6px; margin-bottom: 14px; }
.ui-tab {
  flex: 1; text-align: center; padding: 7px 10px; font-size: 12.5px;
  border: 1px solid var(--border); border-radius: 8px; color: var(--muted);
  background: var(--surface);
}
.ui-tab.on { color: var(--text); border-color: var(--accent); background: var(--card); font-weight: 600; }

.ui-nav { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.ui-navitem {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; padding: 7px 12px; border-radius: 8px;
  border: 1px solid var(--border-soft); color: var(--muted); background: var(--surface);
  white-space: nowrap;
}
.ui-navitem.on { color: var(--text); background: var(--card); border-color: var(--accent); font-weight: 600; }

.ui-list { border: 1px solid var(--border-soft); border-radius: 8px; overflow: hidden; }
.ui-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-bottom: 1px solid var(--border-soft);
  background: var(--card);
}
.ui-row:last-child { border-bottom: 0; }
.ui-row-main { flex: 1; min-width: 0; }
.ui-row-title { font-size: 13.5px; font-weight: 600; }
.ui-row-meta { font-size: 11.5px; color: var(--muted); }
.ui-row-right { font-size: 12px; color: var(--muted); white-space: nowrap; }

.ui-badge {
  display: inline-block; border-radius: 999px; padding: 2px 9px;
  font-size: 11px; font-weight: 600; white-space: nowrap;
}
.b-ok { background: rgba(139,255,176,.14); color: var(--accent-2); }
.b-warn { background: rgba(255,211,106,.14); color: var(--warning); }
.b-bad { background: rgba(255,106,106,.14); color: var(--danger); }
.b-info { background: rgba(106,169,255,.14); color: var(--accent); }

.ui-stat { display: flex; align-items: center; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border-soft); }
.ui-stat:last-child { border-bottom: 0; }
.ui-stat-n { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }

.ui-modal { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--card); }
.ui-modal-head {
  padding: 11px 16px; border-bottom: 1px solid var(--border);
  font-weight: 700; font-size: 14px; background: var(--surface);
  display: flex; justify-content: space-between; align-items: center;
}
.ui-modal-head span:last-child { color: var(--muted); font-weight: 400; }
.ui-modal-body { padding: 16px; }

.ui-gpa {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff; border-radius: 10px; padding: 16px;
}
.ui-gpa-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.ui-gpa-big { background: rgba(255,255,255,.16); border-radius: 8px; padding: 10px 18px; text-align: center; }
.ui-gpa-big b { display: block; font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; }
.ui-gpa-big small { font-size: 10.5px; opacity: .85; }
.ui-q { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.ui-q div {
  background: rgba(0,0,0,.18); border-radius: 6px; padding: 8px 4px; text-align: center;
}
.ui-q small { display: block; font-size: 10px; opacity: .8; }
.ui-q b { font-size: 17px; font-variant-numeric: tabular-nums; }

.ui-check { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--border-soft); border-radius: 8px; background: var(--card); margin-bottom: 8px; }
.ui-box {
  flex: none; width: 16px; height: 16px; border-radius: 4px; margin-top: 3px;
  border: 1px solid var(--border); background: var(--surface);
  display: grid; place-items: center; font-size: 11px; color: #0b0f14;
}
.ui-box.on { background: var(--accent-2); border-color: var(--accent-2); }
.ui-check-title { font-size: 13px; font-weight: 600; }
.ui-check-desc { font-size: 11.5px; color: var(--muted); }

.ui-swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.ui-sw { width: 62px; text-align: center; font-size: 10.5px; color: var(--muted); }
.ui-sw i { display: block; height: 34px; border-radius: 7px; border: 1px solid var(--border); margin-bottom: 4px; }
.ui-sw.on i { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(106,169,255,.28); }

/* ---------------------------------------------------------- the footer */
footer {
  border-top: 1px solid var(--border); margin-top: 40px;
  padding: 26px 20px 40px; font-size: 12px; line-height: 1.6; color: var(--muted);
}
footer .finner { max-width: 1140px; margin: 0 auto; }
footer p { max-width: none; }
footer a { color: inherit; }
.backtop { display: inline-block; margin-bottom: 18px; font-size: 13px; }

/* ---------------------------------------------------------- per-role accent */
/* Four guides, one design. The accent is the only thing that moves, so a reader
   who has three of them open can tell at a glance which one they are in, and a
   reader who has one still sees a page that belongs to rivertech.me.

   Both themes are set for each role rather than only the dark one: an accent
   picked against #0f1216 is usually unreadable on #f6f8fa, and the light block
   below is what the OS default actually shows most people.

   The .ui-* mock-ups deliberately do NOT follow this. They are drawings of the
   real portal, and the real portal's buttons are the blue-green gradient
   whoever is looking at them. */
body[data-guide="students"] { --accent: #5fd08a; --link: #8fe3b0; }
body[data-guide="teachers"] { --accent: #f0a35a; --link: #f6c08a; }
body[data-guide="admin"]    { --accent: #c79bf0; --link: #d9bcf6; }

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) body[data-guide="students"] { --accent: #1a7f37; --link: #1a7f37; }
  :root:not([data-theme="dark"]) body[data-guide="teachers"] { --accent: #8a5200; --link: #8a5200; }
  :root:not([data-theme="dark"]) body[data-guide="admin"]    { --accent: #6b21a8; --link: #6b21a8; }
}

/* The guide hub. Four cards, nothing else. */
.hub { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 18px; margin: 30px 0 10px; }
.hub a {
  display: block; text-decoration: none; color: var(--text);
  background: var(--card); border: 1px solid var(--border);
  border-left: 3px solid var(--hub-accent, var(--accent));
  border-radius: 0 12px 12px 0; padding: 20px 22px;
}
.hub a:hover { border-color: var(--hub-accent, var(--accent)); border-left-color: var(--hub-accent, var(--accent)); }
.hub .hub-eyebrow {
  font-size: 11px; text-transform: uppercase; letter-spacing: .12em;
  color: var(--hub-accent, var(--accent)); font-weight: 700; margin-bottom: 8px;
}
.hub h3 { margin: 0 0 8px; font-size: 19px; letter-spacing: -.01em; }
.hub p { margin: 0; font-size: 14px; color: var(--muted); max-width: none; }

/* ------------------------------------------- mock-up pieces for staff screens */
/* The staff side of the portal is mostly tables and grids, so these three sit
   beside the .ui-* pieces above. Same rule applies: they are drawings, and the
   names inside them are invented. */
.ui-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.ui-table th {
  text-align: left; padding: 7px 10px; background: var(--surface);
  color: var(--muted); font-size: 10.5px; text-transform: uppercase;
  letter-spacing: .07em; font-weight: 600; border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.ui-table td { padding: 8px 10px; border-bottom: 1px solid var(--border-soft); vertical-align: middle; }
.ui-table tr:last-child td { border-bottom: 0; }
.ui-table .num { font-variant-numeric: tabular-nums; text-align: right; }
.ui-scroll { overflow-x: auto; border: 1px solid var(--border-soft); border-radius: 8px; background: var(--card); }
.ui-scroll .ui-table { min-width: 420px; }

/* A dashboard counter. */
.ui-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.ui-tile {
  background: var(--card); border: 1px solid var(--border-soft);
  border-radius: 9px; padding: 12px 14px;
}
.ui-tile b { display: block; font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.2; }
.ui-tile span { font-size: 11px; color: var(--muted); }

/* Filter pills, as the portal draws them above a list. */
.ui-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.ui-pill {
  font-size: 11.5px; padding: 4px 11px; border-radius: 999px;
  border: 1px solid var(--border); color: var(--muted); background: var(--surface);
}
.ui-pill.on { color: var(--text); border-color: var(--accent); background: var(--card); font-weight: 600; }

/* A register cell: one letter, one colour, as compact as the real one. */
.ui-mark {
  display: inline-grid; place-items: center; width: 24px; height: 24px;
  border-radius: 6px; font-size: 11px; font-weight: 700;
}
.m-p { background: rgba(139,255,176,.16); color: var(--accent-2); }
.m-a { background: rgba(255,106,106,.16); color: var(--danger); }
.m-l { background: rgba(255,211,106,.16); color: var(--warning); }
.m-e { background: rgba(106,169,255,.16); color: var(--accent); }
