/* ============================================================
   HGS Maths — global stylesheet
   Shared by every page. Component sections are labelled.
   ============================================================ */

/* ── Typography ───────────────────────────────────────────
   Uses the platform UI face (SF Pro on macOS/iOS, Segoe UI on Windows, Roboto
   on Android), matching /pp. It is hinted for the screen it renders on, so
   small text stays crisp, and costs nothing to fetch — no web-font downloads
   and no font swap. Headings keep their uppercase styling for the HGS look. */
:root {
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --font-head: var(--font-sans);
}

:root {
  --yellow: #F8D60A;   /* exact yellow sampled from the HGS Maths logo */
  --dark:   #1a1d21;
  --mid:    #343A40;
  --red:    #E8645A;
  --white:  #FFFFFF;
  --grey:   #f2f2f0;
  --blue:   #2A66B9;
  --green:  #2e9e60;
  --card-r: 8px;
  --nav-h:  50px;
  --max-w:  1200px;
  --pad-x:  24px;
  /* Surfaces & muted text — kept as variables so new components theme
     correctly and the dark block only has to override in one place. */
  --border:      #e0e0e0;   /* card & section borders */
  --border-soft: #e6e6e6;   /* lighter internal dividers */
  --muted:       #6b6b6b;   /* muted meta text / small labels — passes WCAG AA on white & --grey */
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--white);
  color: var(--mid);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a       { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
img     { display: block; max-width: 100%; height: auto; }

/* Accessibility: skip link */
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 1000;
  background: var(--dark); color: var(--yellow);
  padding: 10px 16px; font-weight: 600;
}
.skip-link:focus { left: 8px; top: 8px; text-decoration: none; }

/* Visible to screen readers only — used to keep the heading outline complete
   (e.g. a section label between an h1 and the h3 resource cards) without
   changing the visual design. */
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }

/* ── HEADER ───────────────────────────────────────────── */
.site-header { background: var(--dark); }
.header-inner { max-width: var(--max-w); margin: 0 auto; padding: 30px var(--pad-x) 32px; }
.site-logo img { height: 62px; width: auto; }

/* ── NAV ──────────────────────────────────────────────── */
.site-nav {
  background: var(--yellow); position: sticky; top: 0;
  z-index: 200; box-shadow: 0 2px 10px rgba(0,0,0,0.2); line-height: 0;
}
.nav-inner {
  max-width: var(--max-w); margin: 0 auto; padding: 0 var(--pad-x);
  display: flex; align-items: stretch; height: var(--nav-h);
}
.nav-link {
  display: inline-flex; align-items: center; padding: 0 15px; height: 100%;
  font-family: var(--font-sans); font-size: 14px; line-height: normal;
  font-weight: 600; color: var(--dark); letter-spacing: 0; text-transform: uppercase;
  white-space: nowrap; border: none; margin: 0; flex-shrink: 0;
  cursor: pointer; background: transparent; transition: background .15s, color .15s;
}
.nav-link:hover {
  background: var(--dark); color: var(--yellow); text-decoration: none;
}
.nav-drfrost { margin-left: auto; border-left: 1px solid rgba(0,0,0,0.15); }

.nav-hamburger {
  display: none; margin-left: auto; background: none; border: none;
  cursor: pointer; padding: 0 16px; height: var(--nav-h);
  align-items: center; flex-direction: column; justify-content: center; gap: 5px;
}
.nav-hamburger .bar {
  display: block; width: 22px; height: 2px; background: var(--dark);
  border-radius: 2px; transition: transform .25s, opacity .2s; transform-origin: center;
}
.nav-hamburger.is-open .bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger.is-open .bar:nth-child(2) { opacity: 0; }
.nav-hamburger.is-open .bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.nav-mobile { display: none; background: var(--dark); border-top: 3px solid var(--yellow); }
.nav-mobile.is-open {
  display: block;
  max-height: calc(100vh - var(--nav-h));
  max-height: calc(100dvh - var(--nav-h));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.nav-mobile a {
  display: block; padding: 17px 24px;
  font-family: var(--font-sans); font-size: 16px; font-weight: 600;
  color: rgba(255,255,255,0.85); letter-spacing: 0; text-transform: none;
  border-bottom: 1px solid rgba(255,255,255,0.07); transition: background .14s, color .14s;
}
.nav-mobile a:hover { background: var(--yellow); color: var(--dark); text-decoration: none; }
/* Top-level mobile items share one height (matching the Year 11/12/13 toggles) */
.nav-mobile > a, .m-toggle { display: flex; align-items: center; min-height: 58px; box-sizing: border-box; padding-top: 0; padding-bottom: 0; }
.m-toggle { justify-content: space-between; }

/* Mobile accordion groups (Year 11/12/13) */
.m-group { border-bottom: 1px solid rgba(255,255,255,0.07); }
.m-toggle {
  display: flex; align-items: center; justify-content: space-between; width: 100%;
  padding: 17px 24px; background: none; border: none; cursor: pointer; text-align: left;
  font-family: var(--font-sans); font-size: 16px; font-weight: 600;
  color: rgba(255,255,255,0.85); transition: background .14s, color .14s;
}
.m-toggle:hover { background: var(--yellow); color: var(--dark); }
.m-caret { font-size: 12px; transition: transform .2s; }
.m-group.open .m-caret { transform: rotate(180deg); }
.m-sub { display: none; background: rgba(0,0,0,0.25); }
.m-group.open .m-sub { display: block; }
.m-sub a { padding-left: 40px; font-size: 15px; color: rgba(255,255,255,0.75); }
.m-sub a.ind { padding-left: 56px; font-size: 14px; color: rgba(255,255,255,0.55); }

/* Dropdowns (Year 11/12/13) */
.nav-dropdown { position: relative; display: inline-flex; align-items: stretch; align-self: stretch; }
.nav-dropdown-panel {
  display: none; position: absolute; top: var(--nav-h); left: 0;
  background: var(--dark); min-width: 240px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.3); z-index: 300;
}
.nav-dropdown:hover .nav-dropdown-panel,
.nav-dropdown:focus-within .nav-dropdown-panel,
.nav-dropdown.open  .nav-dropdown-panel { display: block; }
.nav-dropdown-panel .dd-item { position: relative; border-bottom: 1px solid rgba(255,255,255,0.07); }
.nav-dropdown-panel .dd-item:last-child { border-bottom: none; }
.nav-dropdown-panel .dd-link {
  display: flex; align-items: center; justify-content: space-between; padding: 12px 18px;
  font-family: var(--font-sans); font-size: 13px; font-weight: 600;
  color: rgba(255,255,255,0.85); letter-spacing: 0; text-transform: none;
  transition: background .14s, color .14s; line-height: normal;
  text-decoration: none; cursor: pointer; background: transparent; border: none; width: 100%; text-align: left;
}
.nav-dropdown-panel .dd-link:hover,
.nav-dropdown-panel .dd-item:hover > .dd-link,
.nav-dropdown-panel .dd-item.open > .dd-link {
  background: var(--yellow); color: var(--dark); text-decoration: none;
}
.nav-dropdown-panel .dd-link .dd-arrow { font-size: 10px; opacity: .7; }
.dd-sub {
  display: none; position: absolute; top: 0; left: 100%;
  background: var(--dark); min-width: 200px;
  box-shadow: 4px 4px 20px rgba(0,0,0,0.3); z-index: 400;
}
.dd-item:hover .dd-sub, .dd-item:focus-within .dd-sub, .dd-item.open .dd-sub { display: block; }
.dd-sub a {
  display: block; padding: 11px 18px;
  font-family: var(--font-sans); font-size: 13px; font-weight: 600;
  color: rgba(255,255,255,0.85); letter-spacing: 0; text-transform: none;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  transition: background .14s, color .14s; line-height: normal; text-decoration: none;
}
.dd-sub a:last-child { border-bottom: none; }
.dd-sub a:hover { background: var(--yellow); color: var(--dark); text-decoration: none; }
.nav-dropdown-toggle::after { content: ' ▾'; font-size: 10px; }

@media (max-width: 880px) {
  .nav-year-link, .nav-home-link, .nav-drfrost { display: none !important; }
  .nav-hamburger { display: flex; }
  .header-inner { text-align: center; }
  .site-logo { display: block; }
  .site-logo img { margin: 0 auto; }
}

/* ── ANNOUNCEMENTS GRID (home) ────────────────────────── */
#announcements { background: var(--grey); padding: 44px 0 52px; flex-shrink: 0; }
.section-heading {
  font-family: var(--font-head); font-size: 26px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1px; color: var(--dark);
  text-align: center; margin-bottom: 32px;
}
.section-heading span { border-bottom: 3px solid var(--yellow); padding-bottom: 3px; }
.section-heading a { color: inherit; }
.section-heading a:hover { text-decoration: none; opacity: .7; }
.ann-grid {
  max-width: var(--max-w); margin: 0 auto; padding: 0 var(--pad-x);
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px;
}
.ann-card {
  background: var(--white); border-radius: var(--card-r);
  border-top: 4px solid var(--yellow); box-shadow: 0 2px 10px rgba(0,0,0,0.07);
  padding: 24px 20px 20px;
}
.ann-card-icon {
  width: 38px; height: 38px; background: var(--yellow); border-radius: 50%;
  display: flex; align-items: center; justify-content: center; margin: 0 auto 14px;
}
.ann-card-icon svg { width: 18px; height: 18px; }
.ann-card h3 {
  font-family: var(--font-head); font-size: 16px; font-weight: 700;
  text-align: center; color: var(--dark); margin-bottom: 16px;
}
.ann-link { display: block; text-align: center; font-size: 15px; color: var(--blue); margin-bottom: 8px; }
.ann-link:last-child { margin-bottom: 0; }
.ann-link:hover { text-decoration: underline; color: var(--dark); }
.lb-trigger {
  display: block; cursor: zoom-in; border-radius: 4px; overflow: hidden;
  margin-bottom: 6px;
}
.lb-trigger img { width: 100%; height: auto; display: block; }
.lb-hint { font-size: 11px; color: var(--muted); text-align: center; letter-spacing: .3px; }
@media (max-width: 700px) { .ann-grid { grid-template-columns: 1fr; } }
@media (min-width: 701px) and (max-width: 900px) { .ann-grid { grid-template-columns: repeat(2, 1fr); } }

/* ── LIGHTBOX ─────────────────────────────────────────── */
#lb-overlay {
  display: none; position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,0.9); align-items: center; justify-content: center;
  padding: 20px; cursor: zoom-out;
}
#lb-overlay.open { display: flex; }
#lb-overlay img {
  max-width: 92vw; max-height: 92vh; border-radius: 6px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.6); cursor: default; animation: lbIn .2s ease;
}
@keyframes lbIn { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: scale(1); } }
#lb-close {
  position: fixed; top: 16px; right: 20px;
  background: rgba(255,255,255,0.12); border: 1px solid rgba(255,255,255,0.25);
  border-radius: 50%; width: 38px; height: 38px;
  color: white; font-size: 20px; line-height: 38px; text-align: center;
  cursor: pointer; transition: background .15s;
}
#lb-close:hover { background: var(--yellow); color: var(--dark); }

/* ── MAIN CONTENT ─────────────────────────────────────── */
.site-content { flex: 1; padding: 48px var(--pad-x) 64px; }
.content-inner { max-width: var(--max-w); margin: 0 auto; }

.page-heading, .panel-heading {
  font-family: var(--font-head); font-weight: 700; color: var(--dark);
  border-bottom: 3px solid var(--yellow);
}
.page-heading { font-size: 30px; margin-bottom: 28px; padding-bottom: 10px; }
.panel-heading { font-size: 26px; margin-bottom: 24px; padding-bottom: 10px; }

/* Home: year-group grid */
.yg-section { margin-bottom: 48px; }
.yg-heading { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); margin-bottom: 14px; }
.year-grid { display: grid; grid-template-columns: repeat(7,1fr); gap: 10px; }
.yg-card {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: var(--grey); border-radius: var(--card-r); padding: 18px 8px; gap: 5px;
  text-decoration: none; border-top: 3px solid transparent;
  transition: background .18s, border-color .18s, transform .15s;
}
.yg-card:hover { background: var(--dark); border-top-color: var(--yellow); transform: translateY(-3px); text-decoration: none; }
.yg-card:hover .yg-num, .yg-card:hover .yg-label { color: var(--yellow); }
.yg-num { font-family: var(--font-head); font-size: 26px; font-weight: 700; color: var(--dark); line-height: 1; transition: color .18s; }
.yg-label { font-size: 10px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; transition: color .18s; }

/* Home: about + stats */
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; }
.about-heading {
  font-family: var(--font-head); font-size: 22px; font-weight: 700;
  color: var(--dark); margin-bottom: 16px; padding-bottom: 8px; border-bottom: 3px solid var(--yellow);
}
.about-block p { font-size: 16px; color: var(--mid); line-height: 1.75; margin-bottom: 12px; }
.about-tagline { font-size: 16px !important; font-weight: 600; color: var(--dark) !important; margin-bottom: 16px !important; line-height: 1.5 !important; }
.about-block p:last-child { margin-bottom: 0; }
.about-block a { color: var(--blue); }
.about-stats { background: var(--dark); border-radius: var(--card-r); padding: 28px 28px 24px; margin-top: 64px; }
.about-stats .about-heading { color: var(--yellow); border-bottom-color: rgba(255,255,255,0.15); }
.stats-row { display: grid; grid-template-columns: 1fr 1fr; align-items: stretch; }
.stat-block { min-width: 0; }
.stat-block:nth-child(even) { border-left: 1px solid rgba(255,255,255,0.1); padding-left: 24px; }
.stat-block:nth-child(odd) { padding-right: 24px; }
.stat-block:nth-child(n+3) { border-top: 1px solid rgba(255,255,255,0.1); margin-top: 20px; padding-top: 20px; }
.stat-qual { font-family: var(--font-head); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: rgba(255,255,255,0.85); display: block; margin-bottom: 10px; }
.stat-item { display: flex; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.stat-pct { font-family: var(--font-head); font-size: 26px; font-weight: 700; color: var(--yellow); line-height: 1; min-width: 72px; }
.stat-desc { font-size: 15px; color: rgba(255,255,255,0.9); white-space: nowrap; }
@media (max-width: 900px) { .about-grid { grid-template-columns: 1fr; } .about-stats { margin-top: 0; } }
@media (max-width: 480px) {
  .stats-row { grid-template-columns: 1fr; }
  .stat-block:nth-child(odd) { padding-right: 0; }
  .stat-block:nth-child(even) { border-left: 0; padding-left: 0; }
  .stat-block + .stat-block { border-top: 1px solid rgba(255,255,255,0.1); margin-top: 20px; padding-top: 20px; }
}
@media (max-width: 700px) { .year-grid { grid-template-columns: repeat(4,1fr); } }
@media (max-width: 400px) { .stat-pct { font-size: 22px; } }

/* ── RESOURCE GRID (year pages) ───────────────────────── */
.resource-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-break { grid-column: 1 / -1; }
.res-card {
  background: var(--white); border: 1px solid var(--border); border-top: 4px solid var(--yellow);
  border-radius: var(--card-r); box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  padding: 20px 18px 18px; display: flex; gap: 14px; align-items: flex-start;
  align-self: start; /* size to content so short cards don't stretch to match tall ones */
  transition: box-shadow .2s, transform .2s;
}
.res-card:hover { box-shadow: 0 6px 20px rgba(0,0,0,0.1); transform: translateY(-2px); }
.res-icon { flex-shrink: 0; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; }
.res-icon img { width: 44px; height: 44px; object-fit: contain; border-radius: 10px; }
.res-icon svg { width: 44px; height: 44px; }
.res-body { flex: 1; min-width: 0; }
.res-card h3 { font-family: var(--font-head); font-size: 15px; font-weight: 700; color: var(--dark); margin-bottom: 10px; letter-spacing: .2px; }
.res-card ul { list-style: none; padding: 0; margin: 0; }
.res-card ul li { margin-bottom: 6px; font-size: 15px; }
.res-card ul li:last-child { margin-bottom: 0; }
.res-card ul li a { color: var(--blue); }
.res-card ul li a:hover { text-decoration: underline; color: var(--dark); }
/* A grouped sub-section within a card (e.g. supporting videos under a booklet) */
.res-subbox { margin-top: 12px; padding-top: 11px; border-top: 1px solid var(--border-soft); }
.res-subbox h4 { font-family: var(--font-head); font-size: 13px; font-weight: 700; color: var(--dark); margin: 0 0 7px; letter-spacing: .2px; }
.res-subbox ul { list-style: none; padding: 0; margin: 0; }
.res-subbox ul li { margin-bottom: 6px; font-size: 15px; }
.res-subbox ul li:last-child { margin-bottom: 0; }
.res-subbox ul li a { color: var(--blue); }
.res-subbox ul li a:hover { text-decoration: underline; color: var(--dark); }

/* Calculator tutorial videos (Year 12) — replace the old animated GIFs */
.calc-video {
  width: 100%; height: auto; display: block;
  border-radius: 6px; background: #000; margin-top: 4px;
}

.section-label {
  grid-column: 1 / -1; font-family: var(--font-head); font-size: 13px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1px; color: var(--dark); margin-bottom: 0;
  padding-bottom: 8px; padding-top: 16px; border-top: 1px solid var(--border);
}

/* ── MAKE 24 GAME (home) ──────────────────────────────── */
.game24 { margin-top: 44px; padding-top: 40px; border-top: 1px solid var(--border); }
.game24-heading {
  font-family: var(--font-head); font-size: 24px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1px; color: var(--dark);
  border-bottom: 3px solid var(--yellow); padding-bottom: 10px; margin-bottom: 18px;
}
.game24-intro { color: var(--mid); margin-bottom: 22px; line-height: 1.6; }
.game24-intro code {
  background: #e9e9e6; border-radius: 4px; padding: 1px 6px;
  font-family: var(--font-sans); font-size: 0.95em;
}
.game24-cards { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 22px; }
.g24-card {
  font-family: var(--font-head); font-weight: 700; font-size: 30px;
  width: 64px; height: 80px; display: flex; align-items: center; justify-content: center;
  background: var(--dark); color: var(--yellow); border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.18);
}
.game24-cards.solved .g24-card { background: var(--green); color: #fff; }
.game24-play { background: var(--grey); border-radius: 12px; padding: 20px 22px; }
.game24-row { display: flex; flex-wrap: wrap; gap: 10px; }
.game24-input {
  flex: 1 1 220px; min-width: 0; border: 1px solid #ccc; border-radius: 7px;
  padding: 11px 13px; font-size: 16px; font-family: var(--font-sans);
}
.game24-input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(42,102,185,0.15); }
.game24-btn {
  border: none; border-radius: 7px; padding: 11px 18px; cursor: pointer;
  font-family: var(--font-head); font-weight: 700; text-transform: uppercase;
  letter-spacing: .5px; font-size: 14px; background: var(--blue); color: #fff; transition: background .15s, color .15s;
}
.game24-btn:hover { background: #1c4a86; }
.game24-btn-ghost { background: transparent; color: #5f5e5a; border: 1px solid #b4b2a9; }
.game24-btn-ghost:hover { background: var(--dark); color: #fff; border-color: var(--dark); }
.game24-msg { margin: 14px 0 0; font-weight: 600; min-height: 1.2em; }
.game24-msg.ok { color: var(--green); }
.game24-msg.warn { color: var(--red); }
/* Below 1000px: input takes its own full-width row, all three buttons drop beneath it */
@media (max-width: 1000px) { .game24-input { flex-basis: 100%; } }
@media (max-width: 480px) { .game24-btn { flex: 1 1 auto; } }
/* No redundant divider when the label is the first thing under the heading */
.resource-grid > .section-label:first-child { border-top: none; padding-top: 0; }

/* ── PIRATE GAME SQUARE CHOOSER ─────────────────────────
   Sized to sit on one screen — the whole board and its controls
   should be visible without scrolling on a classroom projector. */
.pirate-main { padding-top: 22px; padding-bottom: 22px; }
.pirate-page .page-heading { font-size: 26px; margin-bottom: 14px; padding-bottom: 8px; }
/* Columns are capped rather than fluid so the panel sits next to the
   board instead of drifting to the far edge on a wide screen. */
.pirate-layout {
  display: grid; grid-template-columns: minmax(0, 470px) minmax(0, 400px);
  justify-content: start; gap: 48px; align-items: stretch; margin-top: 18px;
}
.pirate-grid {
  display: grid; grid-template-columns: 24px repeat(7, minmax(0, 1fr));
  gap: 5px; max-width: 470px;
}
.pg-head {
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-head); font-weight: 700; font-size: 13px;
  letter-spacing: 1px; color: var(--muted);
}
.pg-cell {
  aspect-ratio: 1 / 1; width: 100%;
  background: var(--white); border: 1px solid var(--border); border-radius: 6px;
  cursor: pointer; font-family: var(--font-head); font-weight: 700;
  font-size: clamp(13px, 1.7vw, 18px); color: var(--muted);
  transition: background .15s, color .15s, border-color .15s;
}
.pg-cell:hover:not(.used) { background: var(--grey); border-color: var(--dark); }
.pg-cell:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.pg-cell.rolling { background: var(--grey); border-color: var(--dark); }
.pg-cell.used { background: var(--dark); border-color: var(--dark); color: var(--yellow); cursor: default; }
.pg-cell.latest { background: var(--yellow); border-color: var(--yellow); color: var(--dark); }

/* Flex column so the chosen-squares list absorbs the spare height and the
   panel ends level with the bottom of the board. */
.pirate-panel {
  background: var(--grey); border-radius: 12px; padding: 16px 18px;
  display: flex; flex-direction: column;
}
.pirate-label {
  font-family: var(--font-head); font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1px; color: var(--muted);
}
.pirate-last {
  font-family: var(--font-head); font-size: 42px; font-weight: 700;
  line-height: 1.1; color: var(--dark); margin-bottom: 12px;
}
.pirate-btn {
  border: none; border-radius: 7px; padding: 11px 18px; cursor: pointer;
  font-family: var(--font-head); font-weight: 700; text-transform: uppercase;
  letter-spacing: .5px; font-size: 14px; background: var(--blue); color: #fff;
  transition: background .15s, color .15s;
}
.pirate-btn:hover:not(:disabled) { background: #1c4a86; }
.pirate-btn:disabled { opacity: .45; cursor: default; }
.pirate-btn-big { width: 100%; padding: 12px 18px; font-size: 15px; }
.pirate-btn-ghost {
  flex: 1 1 auto; background: transparent; color: #5f5e5a; border: 1px solid #b4b2a9;
  padding: 11px 10px; font-size: 13px; white-space: nowrap;
}
/* Soft grey fill rather than solid black: at full width a black slab
   shouts louder than the blue primary sitting above it. */
.pirate-btn-ghost:hover:not(:disabled) { background: #e6e6e2; color: var(--dark); border-color: #8f8d84; }
.pirate-hint { font-size: 13px; color: var(--muted); margin: 8px 0 12px; line-height: 1.45; }
.pirate-actions { display: flex; gap: 8px; }
.pirate-msg { margin-top: 12px; font-weight: 600; font-size: 13px; min-height: 1.2em; line-height: 1.45; }
.pirate-msg.ok { color: var(--green); }
.pirate-msg.warn { color: var(--red); }
.pirate-count { font-size: 13px; color: var(--muted); margin-top: 4px; }
.pirate-sub {
  font-family: var(--font-head); font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1px; color: var(--dark);
  margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border);
}
.pirate-used {
  list-style: none; display: flex; flex-wrap: wrap; align-content: flex-start; gap: 5px;
  margin-top: 8px; flex: 1 1 auto; min-height: 0; overflow-y: auto;
}
.pirate-used li {
  font-family: var(--font-head); font-weight: 700; font-size: 13px;
  background: var(--white); border: 1px solid var(--border); border-radius: 5px;
  padding: 3px 8px; color: var(--mid);
}
.pirate-used li:first-child { background: var(--dark); border-color: var(--dark); color: var(--yellow); }
/* Tool links sit in the panel's top-right corner, level with the label */
.pirate-panel-top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.pirate-tool-links { display: flex; gap: 14px; font-size: 13px; font-weight: 600; white-space: nowrap; }

@media (max-width: 860px) {
  .pirate-layout { grid-template-columns: 1fr; }
  .pirate-grid { max-width: none; }
  .pirate-last { font-size: 44px; }
  .pirate-used { flex: 0 1 auto; max-height: 132px; }
}

/* ── PIRATE GAME GRID GENERATOR ─────────────────────────
   Just the controls: the grids themselves are built server-side
   as a PDF (pirate-game/generator/pdf.php) and open in a new tab. */
.pgen-controls {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px;
  background: var(--grey); border-radius: 12px; padding: 16px 18px;
}
.pgen-field { display: flex; flex-direction: column; gap: 5px; }
.pgen-field label {
  font-family: var(--font-head); font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1px; color: var(--muted);
}
.pgen-field input {
  width: 110px; border: 1px solid #ccc; border-radius: 7px;
  padding: 10px 12px; font-size: 16px; font-family: var(--font-sans);
}
.pgen-field input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(42,102,185,0.15); }
.pgen-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.pgen-note { flex: 1 0 100%; font-size: 13px; color: var(--muted); line-height: 1.5; }

/* ── PIRATE GAME WAGER QUESTION ─────────────────────────
   Sized for the room: the question is the biggest thing on
   the page and the answer only appears when asked for. */
.wager-card {
  background: var(--grey); border-radius: 12px; padding: 28px 26px; text-align: center;
}
.wager-label {
  font-family: var(--font-head); font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1px; color: var(--muted);
}
.wager-q {
  font-family: var(--font-head); font-size: clamp(38px, 6vw, 62px); font-weight: 700;
  color: var(--dark); line-height: 1.15; margin-top: 8px; min-height: 1.15em;
}
.wager-a {
  font-family: var(--font-head); font-size: clamp(26px, 4vw, 40px); font-weight: 700;
  color: var(--green); min-height: 1.2em; margin-top: 14px;
  padding-top: 14px; border-top: 1px solid var(--border);
  opacity: 0; transition: opacity .12s;
}
.wager-a.is-shown { opacity: 1; }
/* One button per line, each spanning the card above them */
.wager-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.wager-btn { width: 100%; padding: 14px 18px; font-size: 15px; }

/* ── YEAR TABS (current + previous years) ─────────────── */
.page-tabs { display: flex; gap: 6px; margin-bottom: 28px; padding-bottom: 12px; flex-wrap: wrap; border-bottom: 2px solid var(--grey); }
.page-tab {
  font-family: var(--font-sans); font-size: 14px; font-weight: 600; text-transform: uppercase; letter-spacing: 0;
  padding: 9px 20px; background: var(--grey); color: var(--mid); border: none; border-radius: 5px;
  cursor: pointer; outline: none; transition: background .15s, color .15s;
}
.page-tab:hover { background: var(--mid); color: var(--white); }
.page-tab.active { background: var(--dark); color: var(--yellow); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── PAST/PRACTICE PAPERS (sets) ──────────────────────── */
.breadcrumb { font-size: 13px; color: var(--muted); margin-bottom: 20px; }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--blue); }
.set-nav { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 32px; padding-bottom: 24px; border-bottom: 1px solid var(--border); }
.set-nav a {
  font-family: var(--font-sans); font-size: 13px; font-weight: 600;
  padding: 7px 14px; background: var(--grey); color: var(--dark); border-radius: 5px;
  transition: background .15s, color .15s;
}
.set-nav a:hover { background: var(--dark); color: var(--yellow); text-decoration: none; }
.set-section { margin-bottom: 40px; scroll-margin-top: 70px; }
.set-section + .set-section { border-top: 1px solid var(--border); padding-top: 32px; }
.set-heading {
  font-family: var(--font-head); margin-bottom: 16px;
}
.set-heading .set-num, .set-heading {
  font-size: 20px; font-weight: 700; color: var(--dark); text-transform: none;
}
.paper-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; }
.paper-card {
  background: var(--white); border: 1px solid var(--border); border-top: 4px solid var(--yellow);
  border-radius: var(--card-r); box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  padding: 18px 16px; display: flex; gap: 12px; align-items: flex-start;
  transition: box-shadow .2s, transform .2s;
}
.paper-card:hover { box-shadow: 0 6px 20px rgba(0,0,0,0.1); transform: translateY(-2px); }
.paper-icon { flex-shrink: 0; width: 38px; height: 38px; display: flex; align-items: center; justify-content: center; }
.paper-icon img { width: 38px; height: 38px; object-fit: contain; border-radius: 9px; }
.paper-icon svg { width: 38px; height: 38px; }
.paper-body { flex: 1; min-width: 0; }
.paper-body h3 { font-family: var(--font-head); font-size: 14px; font-weight: 700; color: var(--dark); margin-bottom: 8px; line-height: 1.3; }
.paper-body ul { list-style: none; padding: 0; margin: 0; }
.paper-body ul li { margin-bottom: 5px; font-size: 15px; }
.paper-body ul li:last-child { margin-bottom: 0; }
.paper-body ul li a { color: var(--blue); }
.paper-body ul li a:hover { text-decoration: underline; color: var(--dark); }

/* ── SUBJECT CHOICE (Year 12/13 landing) ──────────────── */
.choice-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; max-width: 760px; }
.choice-card {
  display: flex; flex-direction: column; gap: 6px; padding: 32px 28px;
  background: var(--grey); border-radius: var(--card-r); border-top: 4px solid var(--yellow);
  text-decoration: none; transition: background .18s, transform .15s, border-color .18s;
}
.choice-card:hover { background: var(--dark); transform: translateY(-3px); text-decoration: none; }
.choice-card:hover .choice-title, .choice-card:hover .choice-sub { color: var(--yellow); }
.choice-title { font-family: var(--font-head); font-size: 22px; font-weight: 700; color: var(--dark); }
.choice-sub { font-size: 13px; color: var(--muted); }
@media (max-width: 560px) { .choice-grid { grid-template-columns: 1fr; } }

/* ── STAFF ────────────────────────────────────────────── */
#login-screen { flex: 1; display: flex; align-items: center; justify-content: center; padding: 40px var(--pad-x); background: var(--grey); }
.login-box {
  background: var(--white); border-radius: var(--card-r); border-top: 4px solid var(--yellow);
  box-shadow: 0 4px 20px rgba(0,0,0,0.1); padding: 36px 32px 32px; width: 100%; max-width: 380px;
}
.login-box h1 { font-family: var(--font-head); font-size: 22px; font-weight: 700; color: var(--dark); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 6px; }
.login-box p { font-size: 14px; color: var(--muted); margin-bottom: 24px; }
.login-box label { display: block; font-size: 13px; font-weight: 600; color: var(--mid); margin-bottom: 6px; }
.login-box input[type="password"],
.login-box input[type="text"] {
  display: block; width: 100%; border: 1px solid #ddd; border-radius: 5px;
  padding: 10px 12px; font-size: 15px; font-family: inherit; color: var(--mid);
  outline: none; transition: border-color .15s; margin-bottom: 18px;
}
.login-box input[type="password"]:focus,
.login-box input[type="text"]:focus { border-color: var(--yellow); }
.login-btn {
  width: 100%; padding: 11px; background: var(--dark); color: var(--yellow);
  font-family: var(--font-head); font-size: 15px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px;
  border: none; border-radius: 5px; cursor: pointer; transition: background .18s;
}
.login-btn:hover { background: var(--yellow); color: var(--dark); }
.login-error {
  margin-top: 14px; background: rgba(232,100,90,0.1); border: 1px solid rgba(232,100,90,0.3);
  border-radius: 5px; padding: 10px 12px; color: var(--red); font-size: 13px; text-align: center;
}
.staff-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.logout-btn {
  font-family: var(--font-head); font-size: 13px; font-weight: 500; text-transform: uppercase; letter-spacing: .5px;
  padding: 6px 16px; background: transparent; color: var(--mid); border: 1px solid #ccc;
  border-radius: 4px; cursor: pointer; transition: all .15s; text-decoration: none;
}
.logout-btn:hover { background: var(--dark); color: white; border-color: var(--dark); text-decoration: none; }
.staff-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 28px; }
/* Full-width spacer to separate the first row of staff cards from the rest */
.staff-break { grid-column: 1 / -1; height: 16px; }
.staff-card { background: var(--white); border: 1px solid var(--border); border-top: 4px solid var(--yellow); border-radius: var(--card-r); box-shadow: 0 2px 8px rgba(0,0,0,0.06); padding: 22px 20px; }
.staff-card h2 { font-family: var(--font-head); font-size: 16px; font-weight: 700; color: var(--dark); margin-bottom: 14px; text-transform: uppercase; letter-spacing: .3px; }
.staff-card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.staff-card-head h2 { margin-bottom: 0; }
.staff-icon { flex-shrink: 0; width: 36px; height: 36px; }
.staff-icon svg { width: 36px; height: 36px; }
.staff-card ul { list-style: none; padding: 0; }
.staff-card ul li { margin-bottom: 8px; font-size: 14px; }
.staff-card ul li a { color: var(--blue); }
.staff-card code { background: var(--grey); padding: 1px 5px; border-radius: 3px; font-size: 12px; }
.notice { background: #fffbe6; border: 1px solid #f0d000; border-left: 4px solid var(--yellow); border-radius: 5px; padding: 14px 16px; font-size: 14px; color: #7a6000; margin-bottom: 24px; }
.notice strong { color: var(--mid); }
@media (max-width: 860px) { .staff-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 540px) { .staff-grid { grid-template-columns: 1fr; } .login-box { padding: 28px 20px 24px; } }

/* ── PROSE (legal / text pages) ───────────────────────────
   Shares the element with .content-inner, so it inherits the
   standard 1200px width — matching the year-group pages. */
.prose .updated { font-size: 13px; color: var(--muted); margin: -16px 0 28px; }
.prose h2 {
  font-family: var(--font-head); font-size: 19px; font-weight: 700; color: var(--dark);
  margin: 30px 0 10px; letter-spacing: .2px;
}
.prose h2:first-of-type { margin-top: 0; }
.prose p { margin-bottom: 14px; }
.prose ul { margin: 0 0 14px 22px; }
.prose li { margin-bottom: 7px; }

/* ── 404 ──────────────────────────────────────────────── */
.notfound img { display: block; margin: 0 0 24px; }
.notfound .home-link { display: inline-block; margin-top: 8px; font-weight: 600; }

/* ── FOOTER ───────────────────────────────────────────── */
.site-footer {
  background: var(--dark); border-top: 3px solid var(--yellow);
  color: rgba(255,255,255,0.7); font-size: 12px; text-align: center;
  padding: 20px var(--pad-x); flex-shrink: 0;
}
.site-footer a { color: inherit; }
.site-footer a:hover { color: var(--yellow); text-decoration: none; }
.site-footer .copy { margin-top: 5px; }

/* ── BACK TO TOP ──────────────────────────────────────── */
#back-to-top {
  position: fixed; bottom: 28px; right: 24px; width: 42px; height: 42px;
  background: var(--dark); border: 2px solid var(--yellow); border-radius: 50%; cursor: pointer;
  display: flex; align-items: center; justify-content: center; z-index: 500;
  opacity: 0; pointer-events: none; transform: translateY(10px);
  transition: opacity .25s, transform .25s, background .18s;
}
#back-to-top.visible { opacity: 1; pointer-events: auto; transform: translateY(0); }
#back-to-top:hover { background: var(--yellow); }
#back-to-top:hover svg { fill: var(--dark); }
#back-to-top svg { fill: var(--white); width: 16px; height: 16px; transition: fill .18s; }

/* ── RESPONSIVE GRIDS ─────────────────────────────────── */
@media (max-width: 900px) { .resource-grid { grid-template-columns: repeat(2, 1fr); } .paper-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) {
  .resource-grid { grid-template-columns: 1fr; }
  .paper-grid { grid-template-columns: 1fr; }
  .page-heading { font-size: 24px; }
  .page-tab { font-size: 13px; padding: 8px 14px; }
}

/* ── "NEW" BADGE (mark recently added resources) ──────────
   Usage: <h3>Unit 21 <span class="badge-new">New</span></h3> */
.badge-new {
  display: inline-block; vertical-align: middle;
  font-family: var(--font-head); font-size: 9px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .5px;
  color: var(--dark); background: var(--yellow);
  padding: 2px 6px; border-radius: 3px; margin-left: 6px;
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ── DARK THEME (auto: follows the device setting) ──────
   The masthead, yellow nav, results panel, footer and back-to-top
   are already dark by design, so they're left untouched. This block
   re-skins the light surfaces (page, cards, inputs) and text. */
@media (prefers-color-scheme: dark) {
  html { color-scheme: dark; }
  body { background: #14171a; color: #c9ced4; }

  /* Light surfaces → dark surfaces */
  #announcements { background: #181b1f; }
  .ann-card, .res-card, .paper-card, .staff-card, .login-box {
    background: #21262d; border-color: #2f353d; box-shadow: none;
  }
  .ann-card { border: 1px solid #2f353d; border-top: 4px solid var(--yellow); }
  .res-card:hover, .paper-card:hover { box-shadow: 0 6px 20px rgba(0,0,0,0.45); }
  #login-screen { background: #14171a; }
  .yg-card, .choice-card { background: #21262d; }
  .game24-play { background: #1b1f24; border: 1px solid #2f353d; }
  .about-stats { background: #1b1f24; border: 1px solid #2f353d; }
  .game24-intro code, .staff-card code { background: #2a2f36; }
  .page-tab, .set-nav a { background: #262c33; }
  .page-tabs { border-bottom-color: #2f353d; }
  .set-nav, .set-section + .set-section, .section-label, .game24 { border-color: #2f353d; }

  /* Headings & strong text → light */
  .section-heading, .page-heading, .panel-heading, .ann-card h3,
  .about-heading, .res-card h3, .set-heading, .set-heading .set-num,
  .paper-body h3, .choice-title, .staff-card h2, .prose h2,
  .login-box h1, .game24-heading, .yg-num, .page-tab, .set-nav a,
  .section-label { color: #e7e9ec; }

  /* Body / muted text → light grey */
  .about-block p { color: #c9ced4; }
  /* Tagline sets color with !important, so the override must too */
  .about-tagline { color: #e7e9ec !important; }
  .yg-heading, .yg-label, .choice-sub, .lb-hint, .breadcrumb,
  .breadcrumb a, .prose .updated, .login-box p, .game24-intro { color: #9aa3ad; }

  /* Links → lighter blue, and fix hovers that darkened to near-black */
  a, .about-block a, .ann-link, .res-card ul li a,
  .paper-body ul li a, .staff-card ul li a, .breadcrumb a:hover { color: #6fa8ff; }
  .game24-btn-ghost { color: #b4b2a9; border-color: #5f5e5a; }
  .game24-btn-ghost:hover { background: #2f353d; color: #fff; border-color: #4a515a; }
  .ann-link:hover, .res-card ul li a:hover, .paper-body ul li a:hover { color: #cfe0ff; }
  .res-subbox { border-top-color: #2f353d; }
  .res-subbox h4 { color: #e7e9ec; }
  .res-subbox ul li a { color: #6fa8ff; }
  .res-subbox ul li a:hover { color: #cfe0ff; }

  /* Form controls */
  .game24-input,
  .login-box input[type="password"],
  .login-box input[type="text"] {
    background: #14171a; border-color: #3a4048; color: #e7e9ec;
  }
  .game24-input::placeholder { color: #6b727b; }
  .login-box label { color: #c9ced4; }   /* was dark-on-dark on the dark login box */
  .logout-btn { color: #c9ced4; border-color: #3a4048; }
  /* Solid yellow CTA — the dark-on-dark fill blended into the card at rest */
  .login-btn { background: var(--yellow); color: var(--dark); }
  .login-btn:hover { background: #e6c200; }

  /* Pirate game square chooser */
  .pirate-panel { background: #1b1f24; border: 1px solid #2f353d; }
  .pg-cell { background: #21262d; border-color: #3a4048; color: #9aa3ad; }
  .pg-cell:hover:not(.used) { background: #2a3038; border-color: #6b727b; }
  .pg-cell.rolling { background: #2a3038; border-color: #6b727b; }
  .pg-cell.used { background: #0e1114; border-color: #3a4048; color: var(--yellow); }
  .pg-cell.latest { background: var(--yellow); border-color: var(--yellow); color: var(--dark); }
  .pirate-hint, .pirate-count, .pg-head, .pirate-label { color: #9aa3ad; }
  .pirate-last, .pirate-sub { color: #e7e9ec; }
  .pirate-sub { border-top-color: #2f353d; }
  .pirate-btn-ghost { color: #b4b2a9; border-color: #5f5e5a; }
  .pirate-btn-ghost:hover:not(:disabled) { background: #2f353d; color: #fff; border-color: #4a515a; }
  .pirate-used li { background: #21262d; border-color: #3a4048; color: #c9ced4; }
  .pirate-used li:first-child { background: #0e1114; border-color: #3a4048; color: var(--yellow); }

  /* Grid generator — the sheets stay paper-white (they are printed),
     only the controls around them follow the dark theme. */
  .pgen-controls { background: #1b1f24; border: 1px solid #2f353d; }
  .pgen-field label, .pgen-note { color: #9aa3ad; }
  .pgen-field input { background: #14171a; border-color: #3a4048; color: #e7e9ec; }

  /* Wager question */
  .wager-card { background: #1b1f24; border: 1px solid #2f353d; }
  .wager-label { color: #9aa3ad; }
  .wager-q { color: #e7e9ec; }
  .wager-a { border-top-color: #2f353d; }

  /* Staff notice block */
  .notice { background: #2b2410; border-color: #5a4a14; border-left-color: var(--yellow); color: #e7c14d; }
  .notice strong { color: #e7e9ec; }
}

/* ── PRINT ────────────────────────────────────────────── */
@media print {
  .site-header, .site-nav, .nav-mobile, #back-to-top, .skip-link,
  .page-tabs, .set-nav, .lb-hint, #lb-overlay { display: none !important; }
  body { color: #000; font-size: 12pt; line-height: 1.5; }
  .site-content { padding: 0; }
  .tab-panel { display: block !important; }   /* show all years when printing */
  .res-card, .paper-card, .ann-card {
    box-shadow: none !important; border: 1px solid #ccc !important;
    break-inside: avoid; transform: none !important;
  }
  a { color: #000; text-decoration: underline; }
  .site-footer { background: none; color: #000; border: none; }
  .site-footer a { color: #000; }
  @page { margin: 1.5cm; }
}


/* ── Staff accounts (staff/accounts.php) ───────────────────
   Plain and dense: this is a list a head of department reads once a term, not a
   thing to spend attention on. */
.acc-intro { max-width: none; color: var(--muted); font-size: 14px; margin-bottom: 20px; }
.acc-notice, .acc-error {
  max-width: 60ch; padding: 10px 14px; border-radius: 6px; font-size: 14px; margin-bottom: 16px;
}
.acc-notice { background: #e8f5ee; color: #15633c; border: 1px solid #b6e0c7; }
.acc-error  { background: #fdeaea; color: #8a2222; border: 1px solid #f1bcbc; }
.acc-table { width: 100%; border-collapse: collapse; font-size: 14px; margin-bottom: 30px; }
.acc-table th, .acc-table td { text-align: left; padding: 9px 10px; border-bottom: 1px solid #e6e6e6; vertical-align: middle; }
.acc-table th { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.acc-table code { font-size: 13px; color: var(--mid); }
.acc-off td { opacity: .55; }
.acc-tag {
  display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 10px;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  background: var(--dark); color: var(--yellow);
}
.acc-tag-student { background: #2b5fa8; color: #fff; }
.acc-tag-off     { background: #999; color: #fff; }
.acc-actions { white-space: nowrap; }
.acc-inline { display: inline-flex; gap: 5px; margin-right: 8px; }
.acc-inline input[type="password"] {
  width: 130px; padding: 5px 8px; font-size: 13px; font-family: inherit;
  border: 1px solid #ddd; border-radius: 4px;
}
.acc-inline button, .acc-add button {
  padding: 5px 12px; font-size: 13px; font-weight: 600; font-family: inherit;
  border: 1px solid #ccc; border-radius: 4px; background: #fff; color: var(--mid); cursor: pointer;
}
.acc-inline button:hover, .acc-add button:hover { background: #f2f2f2; }
.acc-h2 { font-family: var(--font-head); font-size: 17px; margin-bottom: 12px; }
.acc-add { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; max-width: 900px; }
.acc-add label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 600; color: var(--mid); }
.acc-add input[type="text"], .acc-add input[type="password"], .acc-add select {
  padding: 8px 10px; font-size: 14px; font-family: inherit;
  border: 1px solid #ddd; border-radius: 5px; min-width: 170px;
}
.acc-add .acc-check { flex-direction: row; align-items: center; gap: 7px; font-weight: 500; }
.acc-add button { padding: 9px 20px; background: var(--dark); color: var(--yellow); border-color: var(--dark); }

@media (prefers-color-scheme: dark) {
  .acc-table th, .acc-table td { border-color: #2a2f36; }
  .acc-inline input[type="password"],
  .acc-add input[type="text"], .acc-add input[type="password"], .acc-add select {
    background: #14171a; border-color: #3a4048; color: #e7e9ec;
  }
  .acc-inline button, .acc-add button { background: #1c2025; border-color: #3a4048; color: #e7e9ec; }
  .acc-add button { background: var(--dark); color: var(--yellow); }
}
.staff-who { display: inline-flex; align-items: center; gap: 12px; font-size: 13px; color: var(--muted); font-weight: 500; }
.acc-pw { max-width: 420px; flex-direction: column; align-items: stretch; }
.acc-pw label { width: 100%; }
.acc-pw input { width: 100%; }
