/* Shared styling for the Bootstrap pages: the home and subject hubs, account pages and the privacy
   notice. Colours and fonts come from the standard theme (css/theme.css, light and dark), and
   Bootstrap's own colour variables are pointed at the same tokens, so its cards, forms, tables and
   navbar follow light/dark with everything else. Per-page colour (hero gradient, lead tint, active
   tag-filter colour) is keyed off a data-page attribute on <body>. */

/* ---- Bootstrap, in the site's colours (both modes) ---- */
[data-bs-theme] {
  --bs-body-bg: var(--paper);
  --bs-body-color: var(--ink);
  --bs-emphasis-color: var(--ink);
  --bs-heading-color: var(--ink);
  --bs-secondary-color: var(--muted);
  --bs-secondary-bg: var(--panel-2);
  --bs-tertiary-bg: var(--panel-2);
  --bs-border-color: var(--line);
  --bs-border-color-translucent: var(--line);
  --bs-link-color: var(--accent);
  --bs-link-color-rgb: var(--bs-primary-rgb);
  --bs-link-hover-color: var(--accent-deep);
  --bs-font-sans-serif: var(--font-body);
  --bs-font-monospace: var(--font-mono);
  --bs-focus-ring-color: color-mix(in srgb, var(--focus) 35%, transparent);
}
body { background: var(--paper); color: var(--ink); font-family: var(--font-body); }
.navbar-brand, h1, h2, h3, h4, .display-5 { font-family: var(--font-display); }
a { color: var(--accent); }
a:hover { color: var(--accent-deep); }
.text-muted, .form-text { color: var(--muted) !important; }
.card { --bs-card-bg: var(--panel); --bs-card-border-color: var(--line); --bs-card-color: var(--ink); }
.form-control, .form-select { background-color: var(--panel); color: var(--ink); border-color: var(--line-strong); }
.form-control:focus, .form-select:focus { background-color: var(--panel); color: var(--ink); border-color: var(--accent); box-shadow: 0 0 0 .2rem var(--bs-focus-ring-color); }
.form-control[readonly] { background-color: var(--panel-2); }
.form-control::placeholder { color: var(--muted); }
.form-check-input { background-color: var(--panel); border-color: var(--line-strong); }
.form-check-input:checked { background-color: var(--accent); border-color: var(--accent); }
.table { --bs-table-bg: transparent; --bs-table-color: var(--ink); --bs-table-border-color: var(--line); --bs-table-striped-bg: var(--panel-2); }
.list-group { --bs-list-group-bg: var(--panel); --bs-list-group-color: var(--ink); --bs-list-group-border-color: var(--line); --bs-list-group-action-hover-bg: var(--panel-2); --bs-list-group-action-hover-color: var(--ink); }
.btn-primary { --bs-btn-bg: var(--accent); --bs-btn-border-color: var(--accent); --bs-btn-color: var(--on-accent);
               --bs-btn-hover-bg: var(--accent-deep); --bs-btn-hover-border-color: var(--accent-deep); --bs-btn-hover-color: var(--paper);
               --bs-btn-active-bg: var(--accent-deep); --bs-btn-active-border-color: var(--accent-deep); --bs-btn-disabled-bg: var(--accent); --bs-btn-disabled-border-color: var(--accent); }
.btn-outline-primary { --bs-btn-color: var(--accent); --bs-btn-border-color: var(--accent); --bs-btn-hover-bg: var(--accent); --bs-btn-hover-border-color: var(--accent); --bs-btn-hover-color: var(--on-accent);
                       --bs-btn-active-bg: var(--accent); --bs-btn-active-border-color: var(--accent); --bs-btn-active-color: var(--on-accent); }
.btn-outline-secondary { --bs-btn-color: var(--ink-soft); --bs-btn-border-color: var(--line-strong); --bs-btn-hover-bg: var(--panel-2); --bs-btn-hover-border-color: var(--ink-soft); --bs-btn-hover-color: var(--ink); }
.alert-light { --bs-alert-bg: var(--panel); --bs-alert-color: var(--ink-soft); --bs-alert-border-color: var(--line); }
.badge.text-bg-light { background-color: var(--panel-2) !important; color: var(--ink-soft) !important; }

/* ---- navbar ---- */
.site-nav { position: sticky; top: 0; z-index: 1020; background: var(--panel); border-color: var(--line) !important; }
.site-nav .nav-link { color: var(--ink-soft) !important; }
.site-nav .nav-link:hover { color: var(--accent) !important; }
.navbar-brand img { height: 60px; width: auto; }
@media (max-width: 575.98px) { .navbar-brand img { height: 44px; } }

/* ---- colour utilities (icons and link colours on the hub pages) ----
   Icon tiles carry white glyphs, so they use the fixed brand colours in both modes.
   Text colours use the theme's accents, which lighten in dark mode so they stay readable. */
.bg-accent { background: var(--brand-blue) !important; }
.bg-accent-deep { background: var(--brand-navy) !important; }
.bg-accent-b { background: var(--brand-orange) !important; }
.bg-accent-b-deep { background: var(--brand-green) !important; }
.text-accent { color: var(--accent) !important; }
.text-accent-deep { color: var(--accent-deep) !important; }
.text-accent-b { color: var(--accent-b) !important; }
.text-accent-b-deep { color: var(--ok) !important; }

/* ---- hero band: fixed brand gradients with white text, the same in both modes ---- */
.hero { color: #fff; }
body[data-page="home"] .hero { background: linear-gradient(135deg, var(--brand-navy) 0%, #123a66 55%, var(--brand-green) 100%); }
body[data-page="home"] .hero .lead { color: #dbe6f2; }
body[data-page="cs"] .hero { background: linear-gradient(135deg, var(--brand-navy) 0%, #123a66 100%); }
body[data-page="cs"] .hero .lead { color: #dbe6f2; }
body[data-page="econ"] .hero { background: linear-gradient(135deg, var(--brand-green) 0%, #2c6b2e 100%); }
body[data-page="econ"] .hero .lead { color: #e3f0e3; }
body[data-page="it"] .hero { background: linear-gradient(135deg, var(--brand-blue) 0%, var(--brand-navy) 100%); }
body[data-page="it"] .hero .lead { color: #dbe6f2; }
body[data-page="business"] .hero { background: linear-gradient(135deg, var(--brand-navy) 0%, var(--brand-orange) 100%); }
body[data-page="business"] .hero .lead { color: #f2e3d5; }
body[data-page="accounting"] .hero { background: linear-gradient(135deg, var(--brand-orange) 0%, #a85f1c 100%); }
body[data-page="accounting"] .hero .lead { color: #fbe9d9; }
body[data-page="psych"] .hero { background: linear-gradient(135deg, #3b2f86 0%, #5a3f9e 100%); }
body[data-page="psych"] .hero .lead { color: #e6e1f7; }
body[data-page="tok"] .hero { background: linear-gradient(135deg, #0f4c5c 0%, #1f7a8c 100%); }
body[data-page="tok"] .hero .lead { color: #dff1f4; }
body[data-page="thinking"] .hero { background: linear-gradient(135deg, #8a4b08 0%, #c2710c 100%); }
body[data-page="thinking"] .hero .lead { color: #fbecd6; }
body[data-page="ef"] .hero { background: linear-gradient(135deg, #6b2142 0%, #a3395f 100%); }
body[data-page="ef"] .hero .lead { color: #f6dfe8; }
body[data-page="research"] .hero { background: linear-gradient(135deg, #1e3a5f 0%, #3d5a80 100%); }
body[data-page="research"] .hero .lead { color: #dde6f1; }
body[data-page="bio"] .hero { background: linear-gradient(135deg, #0f4c4a 0%, #1f7a5c 100%); }
body[data-page="bio"] .hero .lead { color: #dcf1ea; }
.hero h1 { color: #fff; }

/* ---- subject and resource cards ---- */
.resource-card {
  border: 1px solid var(--line);
  border-radius: .75rem;
  transition: transform .15s ease, box-shadow .15s ease;
  height: 100%;
}
.resource-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow), 0 .75rem 1.5rem rgba(11, 42, 82, .12);
}
.resource-card.coming-soon { opacity: .75; }
.resource-card.coming-soon:hover { transform: none; box-shadow: none; }
.resource-icon, .feature-icon {
  display: flex; align-items: center; justify-content: center; color: #fff; flex: none;
}
.resource-icon { width: 52px; height: 52px; border-radius: .6rem; font-size: 1.5rem; }
.feature-icon { width: 44px; height: 44px; border-radius: 50%; font-size: 1.2rem; }
section.band { background: var(--panel); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.badge-subject { font-size: .7rem; letter-spacing: .04em; text-transform: uppercase; }

/* ---- tag filter bar (subject hubs) ---- */
.tag-filter { border: 1px solid var(--line-strong); background: var(--panel); color: var(--ink-soft); font-size: .8rem; }
.tag-badge { font-size: .65rem; letter-spacing: .03em; font-weight: 600; background: var(--panel-2); color: var(--ink-soft); }
body[data-page="cs"] .tag-filter.active,
body[data-page="cs"] .tag-filter:hover { background: var(--brand-blue); color: #fff; border-color: var(--brand-blue); }
body[data-page="econ"] .tag-filter.active,
body[data-page="econ"] .tag-filter:hover { background: var(--brand-green); color: #fff; border-color: var(--brand-green); }

footer { color: var(--muted); }
footer a { color: var(--ink-soft); }


/* ---- home page: hero ---- */
.home-hero { padding: clamp(2.5rem, 7vw, 5rem) 0; }
.home-hero .hero-hello { font-weight: 600; letter-spacing: .04em; color: #ffd27a; margin-bottom: .5rem; }
.home-hero .hero-accent { color: #ffd27a; }
.home-hero .lead { margin: 1rem auto 1.25rem; }


/* ---- a subject page with no resources yet ---- */
.coming-soon-panel { border: 1px dashed var(--line-strong); border-radius: .9rem; background: var(--panel); }
.coming-soon-panel a { color: var(--accent); }
.coming-soon-icon { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; font-size: 2rem; background: var(--accent-tint); }
body[data-page="chem"] .hero { background: linear-gradient(135deg, #5a1a4a 0%, #9c3470 100%); }
body[data-page="chem"] .hero .lead { color: #f6e0ec; }
body[data-page="physics"] .hero { background: linear-gradient(135deg, #0b1f45 0%, #1f5a8f 100%); }
body[data-page="physics"] .hero .lead { color: #dbe8f5; }

body[data-page="maths"] .hero { background: linear-gradient(135deg, #6b1a28 0%, #b0364a 100%); }
body[data-page="maths"] .hero .lead { color: #f8e1e5; }

/* ---- card grids (home page subjects, subject page resources): toolbar, filters and sort ----
   Filters are grouped by facet. Desktop shows them as toggle chips; phones get a Filters button that
   opens a dialog with the same options as checkboxes (js/tile-grid.js keeps the two in step). */
.grid-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem 1.5rem; margin-bottom: .75rem; }
.grid-controls { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem; }
.grid-controls[hidden] { display: none; }
.grid-filters { display: flex; flex-direction: column; gap: .5rem; }
.grid-facet { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.grid-facet-label { font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); min-width: 3.5rem; }
.grid-filter { border: 1px solid var(--line-strong); background: var(--panel); color: var(--ink-soft); border-radius: 999px;
  padding: .3rem .8rem; font: 600 .82rem/1.2 var(--font-body); cursor: pointer; transition: background .15s, color .15s, border-color .15s; }
.grid-filter:hover { border-color: var(--accent); color: var(--ink); }
.grid-filter[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.grid-filter[aria-pressed="true"]::before { content: "\2713\00a0"; }
.grid-filter:focus-visible, .grid-filter-toggle:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.grid-filter-toggle { display: none; align-items: center; gap: .45rem; border: 1px solid var(--line-strong); background: var(--panel);
  color: var(--ink); border-radius: 999px; padding: .4rem .9rem; font: 600 .9rem/1 var(--font-body); cursor: pointer; }
.grid-filter-toggle svg { width: 16px; height: 16px; }
.grid-filter-toggle .grid-filter-count { min-width: 1.35rem; height: 1.35rem; border-radius: 999px; display: inline-grid; place-items: center;
  background: var(--accent); color: var(--on-accent); font-size: .75rem; }
.grid-filter-toggle .grid-filter-count:empty { display: none; }
.grid-syllabus { flex-basis: 100%; min-width: 0; display: flex; align-items: center; gap: .4rem; margin: 0; }
.grid-syllabus select { width: auto; min-width: 0; max-width: min(36rem, 100%); }
.grid-switch { flex-basis: 100%; display: inline-flex; align-items: center; gap: .5rem; margin: 0; font-weight: 600; cursor: pointer; }
.grid-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.grid-switch-track { position: relative; width: 2.6rem; height: 1.5rem; border-radius: 999px; background: var(--line-strong); transition: background .15s; flex: none; }
.grid-switch-track::after { content: ""; position: absolute; top: .2rem; left: .2rem; width: 1.1rem; height: 1.1rem; border-radius: 50%; background: var(--paper); box-shadow: var(--shadow); transition: transform .15s; }
.grid-switch input:checked + .grid-switch-track { background: var(--accent); }
.grid-switch input:checked + .grid-switch-track::after { transform: translateX(1.1rem); }
.grid-switch input:focus-visible + .grid-switch-track { outline: 2px solid var(--focus); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .grid-switch-track, .grid-switch-track::after { transition: none; } }
.grid-facet[hidden], .grid-syllabus[hidden] { display: none; }
.grid-sort { display: flex; align-items: center; gap: .5rem; margin: 0; font-size: .85rem; color: var(--ink-soft); }
.grid-sort select { width: auto; }
.grid-status { min-height: 1.25rem; margin: 0 0 .5rem; }

.filter-dialog { border: 1px solid var(--line); border-radius: 1rem; padding: 0; width: min(28rem, calc(100vw - 32px)); max-height: 85vh;
  background: var(--panel); color: var(--ink); box-shadow: 0 1.5rem 3rem rgba(0, 0, 0, .3); }
.filter-dialog::backdrop { background: rgba(8, 15, 25, .55); }
.filter-dialog-head, .filter-dialog-foot { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .9rem 1.1rem; }
.filter-dialog-head { border-bottom: 1px solid var(--line); }
.filter-dialog-head h2 { font-size: 1.1rem; margin: 0; }
.filter-dialog-body { padding: .5rem 1.1rem; overflow-y: auto; max-height: calc(85vh - 8rem); }
.filter-dialog fieldset { margin: .6rem 0 .9rem; }
.filter-dialog legend { font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: .35rem; }
.filter-dialog label { display: flex; align-items: center; gap: .6rem; padding: .45rem 0; font-size: 1rem; cursor: pointer; }
.filter-dialog input[type="checkbox"] { width: 1.2rem; height: 1.2rem; accent-color: var(--accent); }
.filter-dialog-foot { border-top: 1px solid var(--line); }
.filter-dialog .close-x { border: 0; background: none; color: var(--ink-soft); font-size: 1.6rem; line-height: 1; padding: 0 .25rem; cursor: pointer; }

/* ---- tiles: a still that plays on hover, then the name, a line of detail and a short description ---- */
.tile-grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.tile { display: flex; flex-direction: column; overflow: hidden; border-radius: .9rem; border: 1px solid var(--line);
  background: var(--panel); color: var(--ink); text-decoration: none; transition: transform .18s ease, box-shadow .18s ease, border-color .18s; }
.tile[hidden] { display: none; }
.tile:hover, .tile:focus-visible { color: var(--ink); transform: translateY(-4px); border-color: var(--accent);
  box-shadow: var(--shadow), 0 .75rem 1.5rem rgba(11, 42, 82, .14); }
.tile:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.tile-media { aspect-ratio: 16 / 9; background: var(--brand-navy); overflow: hidden; }
.tile-media video, .tile-media img { display: block; width: 100%; height: 100%; object-fit: cover; }
.tile-media video { transition: transform 4s ease; }
.tile.is-playing .tile-media video { transform: scale(1.04); }
.tile-body { padding: 1rem 1.1rem 1.2rem; display: flex; flex-direction: column; gap: .2rem; }
.tile-title { font-family: var(--font-display); font-size: 1.2rem; font-weight: 700; margin: 0; }
.tile-meta { font-size: .8rem; font-weight: 600; color: var(--accent); }
.tile-blurb { margin: .4rem 0 0; color: var(--ink-soft); font-size: .95rem; line-height: 1.45; }

/* nothing there yet: only the picture fades; the words switch to the muted tokens (still 4.5:1) */
.tile.is-empty .tile-media { opacity: .45; filter: grayscale(.6); transition: opacity .2s, filter .2s; }
.tile.is-empty .tile-title { color: var(--ink-soft); }
.tile.is-empty .tile-meta, .tile.is-empty .tile-blurb { color: var(--muted); }
.tile.is-empty:hover .tile-media, .tile.is-empty:focus-visible .tile-media { opacity: 1; filter: none; }

/* Phones: a near-full-width box, a square still on the left and the words on the right; the
   filters move into the dialog behind the Filters button. */
@media (max-width: 575.98px) {
  .grid-filters { display: none; }
  .grid-filter-toggle { display: inline-flex; }
  .grid-syllabus select { flex: 1; max-width: none; }
  .grid-toolbar { gap: .6rem; }
  .grid-controls { width: 100%; justify-content: space-between; }
  .tile-grid { grid-template-columns: 1fr; gap: .7rem; }
  .tile { flex-direction: row; align-items: stretch; }
  .tile:hover { transform: none; }
  .tile-media { flex: 0 0 auto; width: 104px; aspect-ratio: 1 / 1; align-self: stretch; min-height: 104px; }
  .tile-body { padding: .65rem .85rem; justify-content: center; }
  .tile-title { font-size: 1.02rem; }
  .tile-meta { font-size: .75rem; }
  .tile-blurb { font-size: .85rem; margin-top: .15rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
}
@media (prefers-reduced-motion: reduce) { .tile, .tile-media video { transition: none; } .tile:hover { transform: none; } }

/* jump links (#subjects…) stop below the sticky header instead of underneath it */
html { scroll-padding-top: 96px; }
@media (max-width: 575.98px) { html { scroll-padding-top: 76px; } }

/* ---- card badges: diagonal ribbons on the still (top left: Required, work set and not done;
   top right: Seen, Played, Favourite) and, on games they've played, trophies for their class,
   school and world boards (bottom right); they use fixed colours with a dark outline. The kind
   of resource is an icon beside the card's name. ---- */
.tile-media { position: relative; overflow: hidden; }
.tile-title { display: flex; align-items: center; gap: .5rem; }
.tile-kind { flex: none; width: 26px; height: 26px; border-radius: 50%; display: inline-grid; place-items: center;
  background: #13202B; color: #fff; }
.tile-kind svg { width: 15px; height: 15px; }
.tile-ribbon-required { right: auto; left: -34px; transform: rotate(-45deg); background: #B42318; }
.tile-kind-game { color: #FFD66B; } .tile-kind-visualisation { color: #7FD4FF; } .tile-kind-interactive { color: #8FE39A; }
/* a testing or custom resource (ResourceAccess): seen only by those it is shared with */
.tile-flag-inline { padding: 1px 8px; border-radius: 999px; font: 700 .68rem/1.5 var(--font-display); letter-spacing: .04em; text-transform: uppercase; background: var(--warn-tint); color: var(--warn); border: 1px solid var(--warn); }
.access-row { padding: 10px 0; border-top: 1px solid var(--line); }
.access-students { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 2px 12px; margin-top: 6px; }
.visibility-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 7px 0; border-top: 1px solid var(--line); }
.visibility-row .visibility-select { width: auto; min-width: 230px; flex: none; }
.visibility-row.is-hidden .visibility-name a { color: var(--muted); text-decoration: line-through; }
@media (max-width: 575.98px) { .visibility-row { flex-direction: column; align-items: stretch; } .visibility-row .visibility-select { min-width: 0; } }
.catalogue-access { margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line-strong); }
.tile-flag { position: absolute; left: 10px; bottom: 10px; padding: 2px 9px; border-radius: 999px; font: 700 .7rem/1.5 var(--font-display); letter-spacing: .04em; text-transform: uppercase; background: var(--warn-tint); color: var(--warn); border: 1px solid var(--warn); pointer-events: none; }
.tile-ribbon { position: absolute; top: 14px; right: -34px; width: 130px; transform: rotate(45deg); text-align: center; pointer-events: none;
  padding: 3px 0; font: 700 .7rem/1.2 var(--font-body); letter-spacing: .06em; text-transform: uppercase; color: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .3); }
.tile-ribbon-seen { background: #1A67AD; } .tile-ribbon-played { background: #2E7D32; } .tile-ribbon-favourite { background: #C2410C; }
.tile-trophies { position: absolute; right: 8px; bottom: 8px; display: flex; gap: 4px; }
.trophy { position: relative; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(10, 20, 35, .72); box-shadow: 0 1px 4px rgba(0, 0, 0, .35); }
.trophy svg { width: 20px; height: 20px; }
.trophy-label { position: absolute; bottom: -2px; right: -2px; min-width: 13px; height: 13px; border-radius: 7px; background: #fff; color: #13202B;
  font: 700 9px/13px var(--font-body); text-align: center; }
.trophy-gold { color: #F2C14E; } .trophy-silver { color: #D5DCE3; } .trophy-bronze { color: #D08A4E; } .trophy-none { color: #7D8B99; }
@media (max-width: 575.98px) {
  .tile-kind { width: 21px; height: 21px; } .tile-kind svg { width: 12px; height: 12px; }
  .tile-ribbon { top: 9px; right: -38px; width: 118px; font-size: .56rem; padding: 2px 0; }
  .tile-ribbon-required { right: auto; left: -38px; }
  .tile-trophies { right: 4px; bottom: 4px; gap: 2px; } .trophy { width: 21px; height: 21px; } .trophy svg { width: 13px; height: 13px; }
  .trophy-label { display: none; }
}

/* ---- a subject banner's video (banner_video(), js/banner-video.js): laptops and desktops only, darkened
   most behind the text on the left; smaller screens keep the gradient above ---- */
.hero.has-banner-video { position: relative; overflow: hidden; isolation: isolate; }
.hero .banner-video, .hero .banner-shade { display: none; }
@media (min-width: 901px) {
  .hero.banner-video-on .banner-video { display: block; position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
  .hero.banner-video-on .banner-shade { display: block; position: absolute; inset: 0; z-index: -1;
    background: linear-gradient(90deg, rgba(6, 12, 22, .86) 0%, rgba(6, 12, 22, .7) 45%, rgba(6, 12, 22, .3) 100%); }
  .hero.banner-video-on .lead { color: #e6edf5; }
}

/* ---- the home page: subjects that aren't the person's, dimmed and after the rest (index.php) ---- */
.tile.is-offsyllabus { opacity: .5; filter: saturate(.4); }
.tile.is-offsyllabus:hover, .tile.is-offsyllabus:focus-visible { opacity: .85; filter: none; }
@media (prefers-reduced-motion: no-preference) { .tile.is-offsyllabus { transition: opacity .15s, filter .15s; } }


/* ---- account pages (/sign-in, /sign-up, /account, /verify, /admin…), /credits and the privacy notice ---- */

.account-card { max-width: 460px; border: 1px solid var(--line); border-radius: 12px; }
.account-card-wide { max-width: 560px; }
.account-wide { max-width: 760px; }
.account-admin { max-width: 1100px; }
.account-card a:not(.btn), .account-wide a:not(.btn), .privacy a { color: var(--accent); }

[data-page="account"] .account-link { white-space: nowrap; }

.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: .85rem; margin: 18px 0; }
.divider::before, .divider::after { content: ""; flex: 1; border-top: 1px solid var(--line); }

.sso-btn, #passkeyBtn { display: flex; align-items: center; justify-content: center; gap: 10px; font-weight: 600; }
.sso-mark { width: 18px; height: 18px; flex: none; background: center / contain no-repeat; }
.sso-google { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'%3E%3Cpath fill='%23FFC107' d='M43.6 20.5H42V20H24v8h11.3C33.7 32.7 29.2 36 24 36c-6.6 0-12-5.4-12-12s5.4-12 12-12c3.1 0 5.8 1.2 7.9 3.1l5.7-5.7C34 6.1 29.3 4 24 4 13 4 4 13 4 24s9 20 20 20 20-9 20-20c0-1.3-.1-2.4-.4-3.5z'/%3E%3Cpath fill='%23FF3D00' d='M6.3 14.7l6.6 4.8C14.7 15.1 19 12 24 12c3.1 0 5.8 1.2 7.9 3.1l5.7-5.7C34 6.1 29.3 4 24 4 16.3 4 9.7 8.3 6.3 14.7z'/%3E%3Cpath fill='%234CAF50' d='M24 44c5.2 0 9.9-2 13.4-5.2l-6.2-5.2C29.2 35.1 26.7 36 24 36c-5.2 0-9.6-3.3-11.3-8l-6.5 5C9.5 39.6 16.2 44 24 44z'/%3E%3Cpath fill='%231976D2' d='M43.6 20.5H42V20H24v8h11.3c-.8 2.2-2.2 4.2-4.1 5.6l6.2 5.2C37 39.2 44 34 44 24c0-1.3-.1-2.4-.4-3.5z'/%3E%3C/svg%3E"); }
.sso-microsoft { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 23 23'%3E%3Cpath fill='%23f35325' d='M1 1h10v10H1z'/%3E%3Cpath fill='%2381bc06' d='M12 1h10v10H12z'/%3E%3Cpath fill='%2305a6f0' d='M1 12h10v10H1z'/%3E%3Cpath fill='%23ffba08' d='M12 12h10v10H12z'/%3E%3C/svg%3E"); }
.sso-passkey { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231f2933' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='9' cy='7' r='4'/%3E%3Cpath d='M2 21v-1a6 6 0 0 1 9.5-4.9'/%3E%3Ccircle cx='17.5' cy='14.5' r='2.5'/%3E%3Cpath d='M17.5 17v5M17.5 19.5h2'/%3E%3C/svg%3E"); }

.code-input { font-family: var(--font-mono); letter-spacing: .4em; text-align: center; font-size: 1.6rem; }

.type-choices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.type-choice { position: relative; display: block; cursor: pointer; }
.type-choice input { position: absolute; opacity: 0; inset: 0; }
.type-choice span { display: flex; flex-direction: column; gap: 2px; height: 100%; padding: 12px; border: 1.5px solid var(--line-strong); border-radius: 10px; background: var(--panel); transition: border-color .15s, background .15s; }
.type-choice small { color: var(--muted); font-size: .78rem; line-height: 1.3; }
.type-choice input:checked + span { border-color: var(--accent); background: var(--accent-tint); box-shadow: 0 0 0 1px var(--accent); }
.type-choice input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 520px) { .type-choices { grid-template-columns: 1fr; } }

.optional-password summary { cursor: pointer; }

.method { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.method-sub { padding-left: 18px; border-top: 1px dashed var(--line); }
form.method-sub { border-top: 0; }

/* site admin's tables, plans and codes; support */
.admin-table td, .admin-table th { padding-left: 10px; padding-right: 10px; }
.plan-control { min-width: 220px; }
.plan-control .form-select, .plan-control .form-control { width: auto; display: inline-block; }
.code-months { width: 70px; }
.code-ends { width: 150px; }
.code-input { max-width: 260px; }
.faq { border: 1px solid var(--line); border-radius: 10px; background: var(--paper); }
.faq-item { padding: 10px 16px; border-top: 1px solid var(--line); }
.faq-item:first-child { border-top: 0; }
.faq-item summary { cursor: pointer; font-weight: 600; }
.faq-item p { margin: 8px 0 2px; color: var(--ink-soft); }
.support-message { white-space: normal; }
/* /pricing */
.pricing { max-width: 1180px; }
.pricing-lead { max-width: 820px; font-size: 1.1rem; }
.pricing-plan { border: 1px solid var(--line); }
.pricing-plan.is-featured { border: 2px solid var(--accent); box-shadow: var(--shadow); }
.pricing-price { font: 800 2rem/1.1 var(--font-display); color: var(--ink); }
.pricing-per { font-size: 1rem; font-weight: 600; color: var(--muted); }
.pricing-list { padding-left: 1.1rem; margin: 0; font-size: .92rem; }
.pricing-list li { margin-bottom: 6px; }
.pricing-launch { display: inline-block; padding: 3px 12px; border-radius: 999px; font: 700 .78rem/1.5 var(--font-display); letter-spacing: .06em; text-transform: uppercase; background: var(--accent-tint); color: var(--accent-deep); border: 1px solid var(--accent); }
.pricing-currencies { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 4px; }
.pricing-currencies a { padding: 2px 9px; border-radius: 999px; border: 1px solid var(--line-strong); font: 600 .8rem/1.5 var(--font-mono); text-decoration: none; color: var(--ink); }
.pricing-currencies a[aria-current] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.pricing-notes { max-width: 760px; }
.pricing-notes p { margin-bottom: 6px; }
.pricing-addon { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 10px 0; border-top: 1px solid var(--line); }
.subscribe-choice { display: block; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; cursor: pointer; }
.subscribe-choice:has(input:checked) { border-color: var(--accent); background: var(--accent-tint); }
.subscribe-quantity, .buy-quantity { max-width: 8rem; }
.subscribe-who { display: block; font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--accent); }
.subscribe-next { cursor: default; }
.pricing-addon-price { text-align: right; max-width: 45%; }
/* includes/plans.php: who it's for (a sliding switch of three radios), each audience's plans, and the add-ons by tick
   box; CSS alone shows what's chosen (js/hub.js keeps the choice in the address) */
.plan-switch { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); max-width: 720px; margin: 0 auto; padding: 4px;
  border-radius: 999px; background: var(--panel); border: 1px solid var(--line-strong); }
.plan-switch-input { position: absolute; opacity: 0; pointer-events: none; }
.plan-switch-option { position: relative; z-index: 1; margin: 0; padding: 10px 8px; text-align: center; border-radius: 999px; cursor: pointer;
  font: 700 .95rem/1.2 var(--font-display); color: var(--ink-soft); transition: color .2s; }
.plan-switch-thumb { position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc((100% - 8px) / 3); border-radius: 999px;
  background: var(--accent); box-shadow: var(--shadow); transition: transform .25s ease; }
.plan-switch-input:checked + .plan-switch-option { color: var(--on-accent); }
.plan-switch-input:focus-visible + .plan-switch-option { outline: 3px solid var(--focus); outline-offset: 2px; }
.plan-switch:has(.plan-switch-input[value="teacher"]:checked) .plan-switch-thumb { transform: translateX(100%); }
.plan-switch:has(.plan-switch-input[value="school"]:checked) .plan-switch-thumb { transform: translateX(200%); }
@media (prefers-reduced-motion: reduce) { .plan-switch-thumb, .plan-switch-option { transition: none; } }
.plan-panel { display: none; }
.plans:has(.plan-switch-input[value="student"]:checked) [data-plan-panel="student"],
.plans:has(.plan-switch-input[value="teacher"]:checked) [data-plan-panel="teacher"],
.plans:has(.plan-switch-input[value="school"]:checked) [data-plan-panel="school"] { display: block; }
.pricing-plan { display: flex; flex-direction: column; }
.pricing-plan.is-highlighted { outline: 3px solid var(--accent); outline-offset: 3px; }
.plan-addons .pricing-addon { display: none; }
.plan-addons:has(#addon-for-student:checked) [data-addon-for~="student"],
.plan-addons:has(#addon-for-teacher:checked) [data-addon-for~="teacher"],
.plan-addons:has(#addon-for-school:checked) [data-addon-for~="school"] { display: flex; }
.plan-addons:has(.plan-addon-filter input:checked) .plan-addons-none { display: none; }
.plan-addon-filter { border: 0; margin: 0; padding: 0; }
.plan-country { margin-top: .5rem; }
.plan-country-choose summary { display: inline; cursor: pointer; color: var(--accent-deep); text-decoration: underline; }
.plan-country-choose .form-select { max-width: 16rem; }
.country-select { max-width: 20rem; }
.home-plans { padding-top: 3rem; padding-bottom: 3rem; border-top: 1px solid var(--line); }
.product-row.is-off { opacity: .6; }
/* a page as wide as the window (account_page 'wide': the books) */
.account-full { padding-left: clamp(16px, 2.5vw, 40px); padding-right: clamp(16px, 2.5vw, 40px); }
/* site admin's sections (admin_sections()) */
.admin-sections { display: grid; gap: 10px; }
.admin-section { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.admin-section-name { min-width: 6.5rem; font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.account-menu-item.is-heading { font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding-top: 10px; padding-bottom: 2px; }
/* the books: Financial, the periods, the tables that open */
.books-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; font-size: .9rem; margin-bottom: 6px; }
.books-crumbs strong { margin-right: 6px; }
.books-crumb { padding: 2px 10px; border-radius: 999px; text-decoration: none; }
.books-crumb.is-on { background: var(--accent-tint); color: var(--accent-deep); font-weight: 600; }
.books-periods { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-bottom: 16px; }
.books-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.books-pill { padding: 4px 14px; border: 1px solid var(--line-strong); border-radius: 999px; text-decoration: none; color: var(--ink); font-size: .9rem; white-space: nowrap; }
.books-pill:hover { border-color: var(--accent); }
.books-pill.is-on { border-color: var(--accent); background: var(--accent); color: var(--on-accent); }
.books-custom { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.books-custom .form-control { width: auto; }
.books-switch { text-decoration: none; }
.books-switch.is-on { font-weight: 700; text-decoration: underline; }
.books-acc { width: 100%; }
.books-acc thead th { white-space: nowrap; }
.books-acc .books-filters th { padding-top: 0; font-weight: 400; }
.books-acc .books-filters input { min-width: 5rem; }
.books-col-date { width: 9rem; }
.books-col-amount { width: 11rem; }
.books-row { cursor: pointer; }
.books-row:hover > td { background: var(--panel-2); }
.books-toggle { border: 0; background: none; padding: 0; color: inherit; font: inherit; text-align: left; white-space: nowrap; }
.books-toggle::before { content: "▸"; display: inline-block; width: 1em; color: var(--muted); transition: transform .15s; }
.books-toggle[aria-expanded="true"]::before { transform: rotate(90deg); }
.books-item.is-open > .books-row > td { background: var(--accent-tint); border-bottom-color: transparent; }
.books-detail > td { background: var(--panel-2); padding: 12px 16px 16px 2.2rem; }
.books-dl { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 10px 24px; margin: 0 0 8px; }
.books-dl dt { font-size: .75rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.books-dl dd { margin: 0; }
.books-detail-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(14rem, 1fr); gap: 16px 32px; }
.books-pdf { display: inline-flex; align-items: center; gap: 4px; }
.books-pdf svg { width: 1.15em; height: 1.15em; fill: none; stroke: var(--bad); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.books-dialog { border: 1px solid var(--line); border-radius: 1rem; padding: 0; width: min(56rem, calc(100vw - 32px)); max-height: calc(100vh - 32px); background: var(--panel); color: var(--ink); }
.books-dialog::backdrop { background: rgba(8, 15, 25, .55); }
.books-dialog form { display: flex; flex-direction: column; max-height: calc(100vh - 34px); }
.books-dialog-head, .books-dialog-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; }
.books-dialog-head { border-bottom: 1px solid var(--line); }
.books-dialog-foot { border-top: 1px solid var(--line); justify-content: flex-end; }
.books-dialog-body { padding: 16px 20px; overflow-y: auto; }
.books-statement-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.books-downloads { display: flex; gap: 6px; }
@media (max-width: 720px) {
  .books-detail-grid { grid-template-columns: 1fr; }
  .books-detail > td { padding-left: 12px; }
  .books-col-amount, .books-col-date { width: auto; }
  .books-acc .books-filters input { min-width: 3rem; padding-left: 4px; padding-right: 4px; }
  .books-toggle { white-space: normal; }
}
.books-totals .card { height: 100%; }
.books-totals strong { display: block; }
.books-table td, .books-table th { white-space: normal; }
.books-bank td:last-child { min-width: 14rem; max-width: 24rem; }
.books-bank select { max-width: 100%; }
.books-gst .books-box { width: 3rem; color: var(--muted); }
.books-fs { max-width: 46rem; }
.books-fs-head td { font-weight: 600; padding-top: 12px; border-bottom: 0; }
.books-fs-sum { border-top: 1px solid var(--ink); }
.books-fs-total td { border-top: 2px solid var(--ink); border-bottom: 3px double var(--ink); }
.books-print-head { display: none; }
@media print {
  .books-noprint, .site-nav, header, footer, #alert, .nav-tabs, .books-periods, .books-crumbs, .books .h3 { display: none !important; }
  .books-print-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-bottom: 10px; margin-bottom: 18px; border-bottom: 2px solid var(--accent); font-size: .85rem; text-align: right; }
  .books-print-head img { height: 48px; width: auto; }
  .books-statement + .books-statement { page-break-before: always; }
  .books-statement { border: 0; box-shadow: none; page-break-inside: avoid; }
  .books-statement a { color: inherit; text-decoration: none; }
}
.privacy { max-width: 760px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 32px; }
.privacy li { margin-bottom: 6px; }
@media (max-width: 560px) { .privacy { padding: 20px; } }

/* Schools, classes and admin */
.join-code { font-family: var(--font-mono); font-size: 2rem; font-weight: 700; letter-spacing: .15em; color: var(--accent-deep); }
.code-small { font-family: var(--font-mono); letter-spacing: .15em; }
.checks { list-style: none; padding-left: 0; }
.checks li { margin: 2px 0; }
.checks .ok { color: var(--ok); }
.checks .bad { color: var(--bad); }
.checks .unknown { color: var(--warn); }

/* the passkey icon is drawn in dark ink; lighten it in dark mode */
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .sso-passkey { filter: invert(1); } }
:root[data-theme="dark"] .sso-passkey { filter: invert(1); }

/* Themes (/appearance) */
.appearance { max-width: 980px; }
.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.theme-card { display: flex; flex-direction: column; border: 1.5px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--panel); }
.theme-card.is-current { border-color: var(--ok); box-shadow: 0 0 0 1px var(--ok); }
.theme-card .swatch { display: flex; height: 54px; }
.theme-card .swatch span { flex: 1; }
.theme-card .swatch span:nth-child(1) { background: var(--s1); flex: 2; }
.theme-card .swatch span:nth-child(2) { background: var(--s2); }
.theme-card .swatch span:nth-child(3) { background: var(--s3); }
.theme-card-body { padding: 10px 12px 4px; display: flex; flex-direction: column; gap: 2px; flex: 1; }
.theme-card-body small { color: var(--muted); line-height: 1.3; }
.theme-card-actions { display: flex; justify-content: space-between; align-items: center; padding: 6px 12px 10px; }
.custom-logo-thumb { height: 36px; max-width: 110px; object-fit: contain; }
.custom-logo-preview { height: 60px; max-width: 220px; object-fit: contain; background: var(--panel-2); border-radius: 8px; padding: 6px; }
.colour-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.colour-field { display: flex; align-items: center; gap: 8px; font-size: .85rem; }
.colour-field input[type="color"] { width: 42px; height: 32px; border: 1px solid var(--line-strong); border-radius: 6px; background: none; padding: 2px; cursor: pointer; }
.colour-field input:disabled { opacity: .35; cursor: not-allowed; }
/* the editor's preview uses the chosen colours (falls back to the page's own) */
.theme-preview { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--tp-paper, var(--paper)); color: var(--tp-ink, var(--ink)); font-family: var(--tp-body), var(--font-body); }
.theme-preview .tp-head { display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: var(--tp-panel, var(--panel)); border-bottom: 1px solid color-mix(in srgb, var(--tp-ink, var(--ink)) 14%, transparent); }
.theme-preview .tp-logo { font-weight: 700; color: var(--tp-accent, var(--accent)); }
.theme-preview .tp-school { height: 32px; max-width: 120px; object-fit: contain; }
.theme-preview .tp-body { padding: 16px; }
.theme-preview .tp-h { font-family: var(--tp-display), var(--font-display); color: var(--tp-ink, var(--ink)); margin: 0 0 6px; }
.theme-preview .tp-muted { opacity: .75; }
.theme-preview .tp-card { background: var(--tp-panel, var(--panel)); border-radius: 10px; padding: 12px; margin: 10px 0; display: flex; gap: 14px; align-items: center; }
.theme-preview .tp-code { font-family: var(--tp-mono), var(--font-mono); color: var(--tp-accent_b, var(--accent-b)); }
.theme-preview .tp-link { color: var(--tp-accent, var(--accent)); font-weight: 600; }
.theme-preview .tp-buttons { display: flex; gap: 8px; }
.theme-preview .tp-btn { padding: 6px 14px; border-radius: 8px; background: var(--tp-accent, var(--accent)); color: #fff; font-weight: 600; }
.theme-preview .tp-btn.b { background: var(--tp-accent_b, var(--accent-b)); }

/* /catalogue */
.catalogue-item { border-top: 1px solid var(--line); padding: .5rem 0; }
.catalogue-item summary { cursor: pointer; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.catalogue-item summary .catalogue-move { margin-left: auto; }
.catalogue-item[open] > summary { margin-bottom: .75rem; }
.catalogue-new summary { color: var(--accent); }

/* a class's pages: tabs, activity, assignments, gradebook */
.class-nav .nav-link { font-weight: 600; }
.activity-table th, .activity-table td, .gradebook-table th, .gradebook-table td { white-space: nowrap; padding: .45rem .6rem; }
.activity-table thead th, .gradebook-table thead th { vertical-align: bottom; font-size: .85rem; }
.activity-table tfoot, .gradebook-table tfoot { border-top: 2px solid var(--line-strong); }
.gradebook-table .gb-cell { min-width: 6.5rem; }
.gradebook-table .gb-done { background: var(--ok-tint); color: var(--ink); font-weight: 600; }
.gradebook-table .gb-late { background: var(--bad-tint); }
.assignment-item { border-top: 1px solid var(--line); padding: .6rem 0; }
.assignment-item:first-child { border-top: 0; }
.assignment-item summary { cursor: pointer; display: flex; flex-wrap: wrap; align-items: baseline; gap: .5rem; }
.assignment-item[open] > summary { margin-bottom: .5rem; }
.assignment-item .assignment-form { border-top: 1px dashed var(--line); padding-top: .75rem; margin-top: .25rem; }
/* only the chosen resource's boxes: hidden must win over Bootstrap's d-flex (display:flex !important), or every
   resource's goals showed at once */
.assignment-form [hidden] { display: none !important; }
.work-item { align-items: flex-start; }
.work-done a { color: var(--ok); }

/* /assignments: the resource search, the challenges to pick (searchable, chosen ones as chips), the modes table */
.assignment-items legend { font-size: .875rem; float: none; width: auto; }
.resource-picker { position: relative; }
.resource-picker-list { position: absolute; z-index: 20; left: 0; right: 0; top: 100%; margin: 2px 0 0; padding: 4px 0; list-style: none;
  max-height: 320px; overflow-y: auto; background: var(--panel); border: 1px solid var(--line-strong); border-radius: 8px; box-shadow: var(--shadow); }
.resource-picker-group { padding: 6px 12px 2px; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.resource-picker-option { display: flex; justify-content: space-between; gap: 12px; padding: 6px 12px; cursor: pointer; }
.resource-picker-option:hover, .resource-picker-option.is-active { background: var(--accent-tint); }
.resource-picker-kind { font-size: .8rem; color: var(--muted); white-space: nowrap; }
.resource-picker-none { padding: 6px 12px; font-size: .875rem; color: var(--muted); }
.item-picker-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.item-chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 6px 2px 10px; font-size: .8rem; border-radius: 999px;
  border: 1px solid var(--accent); background: var(--accent-tint); color: var(--ink); }
.item-chip-x { font-weight: 700; color: var(--accent-deep); }
.item-picker-bar { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.item-picker-bar input { flex: 1 1 200px; min-width: 0; }
.item-picker-list { max-height: 300px; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; padding: 4px 0; }
.item-picker-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 4px 10px; font-size: .875rem; cursor: pointer; }
.item-picker-row:hover { background: var(--panel-2); }
.item-picker-row .form-check-input { margin: 0; flex: none; }
.item-picker-label { flex: 1 1 200px; }
.item-picker-marks { font-size: .8rem; color: var(--muted); white-space: nowrap; }
.assignment-grid { width: auto; }
.assignment-grid caption { caption-side: top; color: var(--ink-soft); }
.assignment-summary { padding: 8px 12px; border-left: 3px solid var(--accent); background: var(--panel-2); border-radius: 4px; }

/* ---- /credits ---- */
.credits { max-width: 1040px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 32px; }
.credits a { color: var(--accent); }
.credits-table { font-size: .9rem; }
.credits-table th { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); white-space: nowrap; }
.credits-table td:first-child, .credits-table td:last-child { white-space: nowrap; }
.credits-list { padding-left: 1.1rem; }
.credits-list li { margin-bottom: .6rem; }
.credits-attr { display: block; font-size: .875rem; color: var(--ink-soft); }
@media (max-width: 640px) { .credits { padding: 20px 16px; } }

/* ---- the syllabus pickers on /school and /classes (syllabus_form()), and on /catalogue ---- */
.syllabus-subject { border: 1px solid var(--line); border-radius: 8px; padding: 6px 12px; margin-bottom: 8px; background: var(--paper); }
.syllabus-subject > summary { cursor: pointer; padding: 4px 0; }
.syllabus-boards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 4px 18px; padding: 6px 0 4px; }
.syllabus-board { margin: 0; }
.syllabus-board legend { font: 600 11px/1.3 var(--font-display); text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 4px 0 2px; float: none; width: auto; }
.syllabus-board .form-check { margin-bottom: 2px; min-height: 28px; }
.catalogue-syllabi { margin: 2px 0 4px; }
.catalogue-fit { display: inline-flex; align-items: center; gap: 4px; margin-right: 10px; }
.catalogue-fit .form-check-inline { margin-right: 0; }
.catalogue-beyond { width: 16rem; max-width: 60vw; font-size: 12px; padding: 1px 6px; }
.catalogue-fit:not(:has(input[name="syllabi"]:checked)) .catalogue-beyond { display: none; }
.catalogue-syllabus { padding: 6px 0; border-bottom: 1px solid var(--line); }

/* ---- small helpers for the account pages' forms (instead of style="…") ---- */
.coming-soon-text { max-width: 36rem; }
.input-num { width: 5.5em; }
.input-16 { width: 16rem; }
.input-file { max-width: 320px; }

/* /school: the school's own address and sign-in (school.php) */
.host-input { max-width: 520px; }
.school-host { align-items: flex-start; }
.dns-records { max-width: 640px; }
.dns-records code { overflow-wrap: anywhere; }
.sso-form { padding: 12px 0; }

/* /analytics (site admin): the daily page views chart, drawn as SVG bars by analytics.php */
.analytics-chart { display: block; width: 100%; height: 160px; }
.analytics-bar-visitor { fill: var(--viz-1); }
.analytics-bar-signed { fill: var(--viz-2); }
.analytics-key { display: inline-block; width: .8em; height: .8em; border-radius: 2px; vertical-align: -1px; margin-right: 4px; }
.analytics-key-visitor { background: var(--viz-1); }
.analytics-key-signed { background: var(--viz-2); }
