/* Layout: periodic-table tiles for subjects; full-width subject-colour bands on inner pages; lists, not card grids, for resources. */
:root {
  --bg: #F4F6F9;        /* cool paper */
  --surface: #FFFFFF;
  --ink: #0F1726;       /* deep navy ink */
  --muted: #4A5568;
  --line: #D9DEE6;
  --chip: #E9EDF3;
  --hover: #EEF2F7;
  --focus: #0F1726;
  --logo-bg: #0F1726;
  --logo-fg: #FFFFFF;
  --on-colour: #FFFFFF;
  --section: #0F1726;
  --font-display: "Schibsted Grotesk", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Schibsted Grotesk", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --step--1: 0.8125rem;
  --step-0: 1rem;
  --step-1: 1.25rem;
  --step-2: 1.6rem;
  --step-3: clamp(2rem, 1.4rem + 2.6vw, 3rem);
  --step-4: clamp(2.4rem, 1.5rem + 4vw, 4.25rem);
  --r: 6px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0B111C; --surface: #121A28; --ink: #E9EDF4; --muted: #A4AEC0; --line: #263247;
    --chip: #1B2536; --hover: #172131; --focus: #FFFFFF; --logo-bg: #E9EDF4; --logo-fg: #0B111C; --section: #1D2A42;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0B111C; --surface: #121A28; --ink: #E9EDF4; --muted: #A4AEC0; --line: #263247;
  --chip: #1B2536; --hover: #172131; --focus: #FFFFFF; --logo-bg: #E9EDF4; --logo-fg: #0B111C; --section: #1D2A42;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  background: var(--bg); color: var(--ink);
  font-family: var(--font-body); font-size: var(--step-0); line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px);
  z-index: 10; background: var(--surface);
}
a { color: inherit; }
h1, h2, h3 { font-family: var(--font-display); margin: 0; text-wrap: balance; letter-spacing: -0.02em; line-height: 1.1; }
p { margin: 0; }
ol, ul { list-style: none; margin: 0; padding: 0; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ic { width: 1.1em; height: 1.1em; flex: none; }

.wrap {
  width: 100%; max-width: 1120px; margin-inline: auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
@media (min-width: 720px) {
  .wrap { padding-left: max(32px, env(safe-area-inset-left, 0px)); padding-right: max(32px, env(safe-area-inset-right, 0px)); }
}

.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--bg); padding: 8px 12px; z-index: 20; }
.skip:focus { left: 16px; }

/* Header */
.topbar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5;
  background: var(--surface); border-bottom: 1px solid var(--line);
}
.topbar-in { display: flex; align-items: center; justify-content: space-between; gap: 8px 24px; flex-wrap: wrap; padding-block: 10px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 700; font-size: 1.05rem; letter-spacing: -0.01em; }
.logo {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 4px;
  background: var(--logo-bg); color: var(--logo-fg);
  font-family: var(--font-display); font-weight: 800; font-size: 0.95rem; letter-spacing: -0.03em;
}
.logo.sm { width: 26px; height: 26px; font-size: 0.75rem; }
#nav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; max-width: 100%; }
#nav::-webkit-scrollbar { display: none; }
#nav a {
  display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
  padding: 8px 12px; border-radius: var(--r); text-decoration: none;
  font-weight: 500; font-size: 0.95rem; color: var(--muted);
}
#nav a:hover { background: var(--hover); color: var(--ink); }
#nav a[aria-current] { color: var(--ink); background: var(--chip); font-weight: 600; }
@media (max-width: 560px) {
  .topbar-in { padding-bottom: 6px; }
  #nav { width: 100%; margin-inline: -12px; width: calc(100% + 24px); padding-inline: 4px; }
}
@media (max-width: 420px) {
  #nav { gap: 0; }
  #nav a { padding: 8px 9px; font-size: 0.92rem; }
  #nav a.nav-teach { margin-right: 2px; }
}

main { flex: 1; outline: none; }

/* Home intro */
.intro { display: flex; flex-direction: column; gap: 10px; padding-block: 14px 6px; }
@media (min-width: 900px) { .intro { padding-block: 22px 10px; } }
.home-tools { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.home-tools > * { min-width: 0; }
@media (min-width: 900px) { .home-tools { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 12px; } .home-tools > * { max-width: none; } }
.eyebrow, .band-eyebrow { font-family: var(--font-mono); font-size: var(--step--1); letter-spacing: 0.02em; }
.eyebrow { color: var(--muted); }
.intro h1 { font-size: var(--step-4); font-weight: 800; letter-spacing: -0.035em; line-height: 1.02; max-width: 13ch; }
.lede { font-size: 1.125rem; color: var(--muted); max-width: 52ch; }
.intro .lede { font-size: 0.92rem; max-width: none; }
.jump { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.jump a {
  display: flex; flex-direction: column; gap: 2px; padding: 12px 16px; min-width: 9.5rem;
  border: 1.5px solid var(--ink); border-radius: var(--r); text-decoration: none;
}
.jump a:hover { background: var(--ink); color: var(--bg); }
.jump strong { font-size: 1.05rem; }
.jump span { font-family: var(--font-mono); font-size: 0.75rem; }

/* Element tiles */
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
@media (min-width: 640px) { .tiles { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; } }
.el {
  position: relative; display: flex; flex-direction: column; justify-content: flex-end; gap: 8px;
  aspect-ratio: 1 / 1; max-width: 100%; padding: 10px 11px; min-width: 0;
  background: var(--c); color: var(--on-colour); text-decoration: none; border-radius: var(--r);
  transition: transform .18s ease, box-shadow .18s ease;
}
@media (min-width: 640px) { .el { padding: 14px 16px; } }
.el:hover { transform: translateY(-3px); box-shadow: 0 10px 0 -4px color-mix(in srgb, var(--c) 35%, transparent); }
.el-sym { margin-top: auto; font-family: var(--font-display); font-weight: 700; font-size: clamp(2.2rem, 10vw, 3.75rem); line-height: 1; letter-spacing: -0.04em; }
.el-foot { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.el-name { font-weight: 600; font-size: 0.9rem; line-height: 1.2; }
.el-count { font-family: var(--font-mono); font-size: 0.7rem; }

/* Generic block */
.block { padding-block: 8px 40px; display: flex; flex-direction: column; gap: 18px; }
.block-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px;
  border-top: 2px solid var(--ink); padding-top: 14px; }
.block-head h2 { font-size: var(--step-1); font-weight: 700; letter-spacing: -0.01em; }
.block-head h2 a { text-decoration: none; }
.block-head h2 a:hover { text-decoration: underline; text-underline-offset: 4px; }
.block-head p { color: var(--muted); font-size: 0.95rem; }

.band + .block { padding-top: 18px; }

/* Resource list */
.res-list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.res-list li + li { border-top: 1px solid var(--line); }
.res {
  display: grid; grid-template-columns: 1fr auto; grid-template-areas: "type end" "body end";
  gap: 6px 16px; align-items: center; padding: 16px 18px; text-decoration: none;
}
@media (min-width: 720px) {
  .res { grid-template-columns: 9.5rem 1fr auto; grid-template-areas: "type body end"; padding: 18px 22px; }
}
.res:hover { background: var(--hover); }
.res-type { grid-area: type; font-family: var(--font-mono); font-size: 0.75rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.res-body { grid-area: body; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.res-title { font-weight: 700; font-size: 1.1rem; letter-spacing: -0.01em; }
.res-desc { color: var(--muted); font-size: 0.95rem; }
.where { display: inline-flex; align-items: center; gap: 7px; font-size: 0.85rem; font-weight: 500; margin-top: 4px; }
.where i { width: 8px; height: 8px; border-radius: 2px; background: var(--c); }
.res-end { grid-area: end; display: flex; color: var(--muted); }
.res:hover .res-end { color: var(--ink); }
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px; border-radius: 4px;
  background: var(--chip); color: var(--ink); font-size: 0.8rem; font-weight: 600; white-space: nowrap;
}
.badge .ic { width: 0.9em; height: 0.9em; }

/* Level ladder (home) */
.ladder { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
@media (min-width: 820px) { .ladder { grid-template-columns: repeat(var(--n, 6), minmax(0, 1fr)); } }
.ladder li { background: var(--surface); padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.stage { font-family: var(--font-mono); font-size: 0.75rem; color: var(--muted); }
.ladder-name { font-weight: 700; line-height: 1.2; }

/* Subject band */
.band { background: var(--c); color: var(--on-colour); }
.band-in { padding-block: 14px 18px; display: flex; flex-direction: column; gap: 12px; }
@media (min-width: 720px) { .band-in { padding-block: 18px 24px; gap: 14px; } }
.band-title { display: flex; align-items: center; gap: 14px; }
.band-title > div { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.band h1 { font-size: clamp(1.6rem, 1.2rem + 1.8vw, 2.4rem); font-weight: 800; letter-spacing: -0.03em; }
.band p { font-size: 0.95rem; }
.band .band-eyebrow { font-size: var(--step--1); }
.band-section .band-title > div { max-width: 60ch; }
.el-mini {
  flex: none; display: grid; place-items: center; width: 64px; height: 64px; border-radius: var(--r);
  border: 2px solid currentColor; font-family: var(--font-display); font-weight: 700; font-size: 1.5rem; letter-spacing: -0.04em;
  width: 52px; height: 52px;
}
@media (min-width: 720px) { .el-mini { width: 64px; height: 64px; font-size: 1.85rem; } }
.band :focus-visible { outline-color: var(--on-colour); }

.crumbs ol { display: flex; flex-wrap: wrap; gap: 4px; font-size: 0.875rem; }
.crumbs li { display: inline-flex; align-items: center; gap: 4px; min-width: 0; }
.crumbs li + li::before { content: "/"; opacity: 0.6; margin-right: 2px; }
.crumbs a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.crumbs a:hover { text-decoration-thickness: 2px; }
.crumbs [aria-current] { font-weight: 600; }

/* Tabs inside band */
.tabs { margin-inline: -4px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs-in { display: flex; gap: 6px; padding: 4px; width: max-content; }
.tabs a {
  white-space: nowrap; padding: 8px 14px; border-radius: var(--r); text-decoration: none; font-weight: 600; font-size: 0.92rem;
  border: 1.5px solid color-mix(in srgb, var(--on-colour) 55%, transparent);
}
.tabs a:hover { border-color: var(--on-colour); }
.tabs a[aria-current] { background: var(--on-colour); color: var(--c); border-color: var(--on-colour); }

/* Level rows (subject page) */
.levels { display: grid; gap: 10px; }
@media (min-width: 720px) { .levels { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.level {
  display: grid; grid-template-columns: 1fr auto; grid-template-areas: "stage arrow" "name arrow" "count arrow";
  gap: 2px 12px; align-items: center; padding: 16px 18px; text-decoration: none;
  background: var(--surface); border: 1px solid var(--line); border-left: 5px solid var(--c); border-radius: var(--r);
  transition: background .15s;
}
.level:hover { background: var(--hover); }
.level .stage { grid-area: stage; }
.level-name { grid-area: name; font-weight: 700; font-size: var(--step-1); letter-spacing: -0.01em; }
.level-count { grid-area: count; font-size: 0.9rem; color: var(--muted); }
.level .ic { grid-area: arrow; color: var(--muted); }
.level:hover .ic { color: var(--ink); transform: translateX(2px); }
.level.empty { border-left-color: var(--line); }
.level.empty .level-name { color: var(--muted); }

.empty-state { padding: 32px 22px; border: 1.5px dashed var(--line); border-radius: var(--r); display: flex; flex-direction: column; gap: 6px; }
.empty-title { font-weight: 700; font-size: var(--step-1); }
.empty-state p:not(.empty-title) { color: var(--muted); }

/* Resource viewer */
.viewer-head { padding-block: 22px 18px; display: flex; flex-direction: column; gap: 12px; }
.viewer-head .crumbs { color: var(--muted); }
.viewer-head .crumbs [aria-current] { color: var(--ink); }
.viewer-title { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 20px; }
.viewer-title h1 { font-size: var(--step-2); font-weight: 800; }
.back, .btn { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 0.95rem; text-decoration: none; }
.back { color: var(--muted); }
.back:hover { color: var(--ink); }
.frame {
  display: block; width: 100%; height: 78vh; min-height: 520px; margin-bottom: 48px;
  border: 1px solid var(--line); border-radius: var(--r); background: var(--surface);
}
.notice {
  margin-bottom: 48px; padding: 36px 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  display: flex; flex-direction: column; align-items: flex-start; gap: 10px; max-width: 640px;
}
.notice-ic { display: grid; place-items: center; width: 44px; height: 44px; border-radius: var(--r); background: var(--chip); }
.notice-ic .ic { width: 1.3em; height: 1.3em; }
.notice h2 { font-size: var(--step-2); font-weight: 800; }
.notice p { color: var(--muted); max-width: 46ch; }
.btn { margin-top: 8px; padding: 10px 16px; border-radius: var(--r); background: var(--ink); color: var(--bg); }

/* Footer */
.foot { border-top: 1px solid var(--line); background: var(--surface); }
.foot-in { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 24px; padding-block: 22px; color: var(--muted); font-size: 0.875rem; }
.foot-brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 700; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* Course areas (N5, Higher, AH level pages) */
.areas { display: grid; gap: 12px; }
@media (min-width: 760px) { .areas { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.area {
  display: flex; flex-direction: column; gap: 12px; padding: 18px; min-width: 0;
  background: var(--surface); border: 1px solid var(--line); border-top: 5px solid var(--c); border-radius: var(--r);
}
.area-head { display: flex; align-items: baseline; gap: 12px; }
.area-num { font-family: var(--font-mono); font-size: 0.8rem; color: var(--muted); }
.area h3 { font-size: var(--step-1); font-weight: 700; letter-spacing: -0.01em; }
.area-topics { color: var(--muted); font-size: 0.92rem; }
.slots { display: grid; gap: 8px; margin-top: auto; }
@media (min-width: 480px) { .slots { grid-template-columns: 1fr 1fr; } }
.slot {
  display: grid; grid-template-columns: 1fr auto; grid-template-areas: "k end" "v end"; gap: 2px 10px; align-items: center;
  padding: 10px 12px; border-radius: var(--r); text-decoration: none; border: 1.5px solid var(--c); min-width: 0;
}
a.slot:hover { background: var(--hover); }
.slot > .ic, .slot > .badge { grid-area: end; }
.slot-k { grid-area: k; font-family: var(--font-mono); font-size: 0.72rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.slot-v { grid-area: v; font-weight: 600; font-size: 0.95rem; min-width: 0; }
.slot.empty { border: 1.5px dashed var(--line); }
.slot.empty .slot-v { color: var(--muted); font-weight: 500; }
.area-rel { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 0.85rem; }
.area-rel span { font-family: var(--font-mono); font-size: 0.72rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; margin-right: 2px; }
.area-rel a { padding: 3px 9px; border-radius: 4px; background: var(--chip); text-decoration: none; font-weight: 600; }
.area-rel a:hover { background: var(--hover); text-decoration: underline; }
.area-skills .slots, .area-whole .slots { grid-template-columns: 1fr; }
.slot-wide { grid-column: 1 / -1; }
.block-empty { padding: 18px 20px; border: 1.5px dashed var(--line); border-radius: var(--r); color: var(--muted); }

/* Search */
.topbar-end { display: flex; align-items: center; gap: 8px; min-width: 0; }
.search-btn {
  display: inline-flex; align-items: center; gap: 8px; flex: none; padding: 7px 10px 7px 12px; border-radius: var(--r);
  border: 1.5px solid var(--line); text-decoration: none; color: var(--muted); font-weight: 500; font-size: 0.95rem;
}
.search-btn:hover { border-color: var(--ink); color: var(--ink); }
.search-btn kbd {
  font-family: var(--font-mono); font-size: 0.72rem; padding: 1px 6px; border-radius: 4px; background: var(--chip); color: var(--muted);
}
@media (max-width: 720px) { .search-btn kbd { display: none; } }
@media (max-width: 560px) {
  .topbar-end { display: contents; }
  .search-btn span { display: none; }
  .search-btn { padding: 8px; }
}
.home-search, .big-search {
  display: flex; align-items: center; gap: 10px; width: 100%; max-width: 640px;
  background: var(--surface); border: 1.5px solid var(--ink); border-radius: var(--r); padding: 6px 6px 6px 14px;
}
.home-search:focus-within, .big-search:focus-within { box-shadow: 0 0 0 3px color-mix(in srgb, var(--ink) 18%, transparent); }
.home-search .ic, .big-search .ic { width: 1.25em; height: 1.25em; color: var(--muted); }
.home-search input, .big-search input {
  flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink);
  font: inherit; font-size: 1.05rem; padding: 8px 0;
}
.home-search input::-webkit-search-cancel-button { display: none; }
.home-search button {
  flex: none; font: inherit; font-weight: 600; font-size: 0.95rem; padding: 9px 16px; border: 0; border-radius: 4px;
  background: var(--ink); color: var(--bg); cursor: pointer;
}
.join {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; width: 100%; max-width: 640px;
  padding: 6px 6px 6px 14px; border: 1px solid var(--line); border-left: 5px solid var(--ink); border-radius: var(--r); background: var(--surface);
}
.join label { display: flex; flex-direction: column; gap: 0; flex: none; min-width: 0; line-height: 1.2; }
.join label strong { font-size: 0.95rem; white-space: nowrap; }
.join label span { font-size: 0.78rem; color: var(--muted); white-space: nowrap; }
.join-row { display: flex; gap: 6px; flex: 1 1 150px; min-width: 0; }
.join input {
  flex: 1; min-width: 0; font-family: var(--font-mono); font-size: 1.05rem; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 9px 12px; border: 1.5px solid var(--line); border-radius: 4px; background: var(--bg); color: var(--ink);
}
.join input::placeholder { letter-spacing: 0.02em; text-transform: none; color: var(--muted); }
.join input:focus { outline: 0; border-color: var(--ink); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ink) 18%, transparent); }
.join button {
  flex: none; font: inherit; font-weight: 600; font-size: 0.95rem; padding: 9px 16px; border: 0; border-radius: 4px;
  background: var(--ink); color: var(--bg); cursor: pointer;
}
.join-msg { flex-basis: 100%; margin: 0; font-size: 0.88rem; color: #B42318; }
.join-msg:empty { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .join-msg { color: #FDA29B; } }
:root[data-theme="dark"] .join-msg { color: #FDA29B; }
.home-try { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: -6px; font-size: 0.88rem; }
.home-try span { font-family: var(--font-mono); font-size: 0.72rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; margin-right: 2px; }
.home-try a { padding: 3px 9px; border-radius: 4px; background: var(--chip); text-decoration: none; font-weight: 600; }
.home-try a:hover { background: var(--hover); text-decoration: underline; }

.search-page { padding-block: 28px 56px; display: flex; flex-direction: column; gap: 14px; }
@media (min-width: 720px) { .search-page { padding-top: 44px; } }
.big-search { max-width: none; padding: 8px 10px 8px 16px; }
.big-search input { font-size: 1.3rem; font-weight: 500; }
.search-filters { display: flex; flex-wrap: wrap; gap: 6px; }
.search-filters:empty { display: none; }
.search-filters button {
  display: inline-flex; align-items: center; gap: 7px; font: inherit; font-weight: 600; font-size: 0.9rem; cursor: pointer;
  padding: 6px 11px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink);
}
.search-filters button span { font-family: var(--font-mono); font-size: 0.72rem; color: var(--muted); }
.search-filters button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.search-filters button[aria-pressed="true"] span { color: inherit; opacity: .75; }
.search-count { color: var(--muted); font-size: 0.9rem; min-height: 1.4em; }
.search-empty { padding: 26px 22px; border: 1.5px dashed var(--line); border-radius: var(--r); display: flex; flex-direction: column; gap: 6px; }
.search-empty p:not(.empty-title) { color: var(--muted); }
.search-empty a { color: var(--ink); font-weight: 600; }
.hit mark { background: color-mix(in srgb, #F5C542 45%, transparent); color: inherit; border-radius: 2px; padding: 0 1px; }
.hit:focus-visible { outline-offset: -3px; }
.hit-k { display: inline-flex; align-items: center; gap: 6px; }
.hit-k::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--line); flex: none; }
.hit-simulation { color: #1F4FD1; } .hit-simulation::before { background: #1F4FD1; }
.hit-experiment { color: #1E7A4C; } .hit-experiment::before { background: #1E7A4C; }
.hit-lesson::before { background: var(--ink); }
.hit-practice::before { background: #B93D0C; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .hit-simulation { color: #8FB0FF; } :root:not([data-theme="light"]) .hit-experiment { color: #7FD3A6; } }
:root[data-theme="dark"] .hit-simulation { color: #8FB0FF; } :root[data-theme="dark"] .hit-experiment { color: #7FD3A6; }
.search-results .res-desc { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.jumped { display: inline-flex; align-items: center; gap: 8px; align-self: flex-start; font-size: 0.88rem; font-weight: 600;
  padding: 4px 10px 4px 4px; border-radius: 999px; background: var(--chip); }
.jumped span { font-family: var(--font-mono); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.06em; padding: 2px 8px; border-radius: 999px; background: var(--surface); color: var(--muted); }

/* Flagged questions */
html:root { --kwf-rule: var(--line); --kwf-paper: var(--bg); --kwf-card: var(--surface); --kwf-text: var(--ink); --kwf-muted: var(--muted); }
.flag-link .ic { width: 18px; height: 18px; }
.flag-n { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: #C8312B; color: #fff; font: 700 0.72rem/1 var(--font-mono); }
.flag-n[data-n="0"] { display: none; }
:root[data-theme="dark"] .flag-n { background: #FF8A7A; color: #1a0a08; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .flag-n { background: #FF8A7A; color: #1a0a08; } }
@media (max-width: 560px) { .flag-link { position: relative; } .flag-n { position: absolute; top: -7px; right: -7px; min-width: 18px; height: 18px; font-size: 0.66rem; padding: 0 4px; } }
.flagged-page { padding-block: 28px 56px; max-width: 820px; }
@media (min-width: 720px) { .flagged-page { padding-top: 44px; } }
.flagged-head h1 { font-size: var(--step-3); line-height: 1.05; letter-spacing: -0.03em; margin: 0 0 10px; }
.flagged-head .lede { color: var(--muted); max-width: 60ch; margin: 0 0 14px; }
.flagged-tools { display: flex; gap: 8px; margin-bottom: 18px; }
.flagged-tools[hidden] { display: none; }
.btn-line { border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 999px; padding: 8px 16px; font: 600 0.9rem/1 var(--font-body); cursor: pointer; }
.btn-line:hover { border-color: var(--ink); }
.flagged-list .kwf-group h3 { margin-left: 0; }

/* Featured exam practice card (level pages) */
.exam-block { padding-bottom: 0; }
/* level page: quick jump to course areas, Skill Gym, Starters and Revision */
.quick-jump { display: flex; flex-wrap: wrap; gap: 8px; padding-block: 14px 4px; }
@media (max-width: 480px) { .quick-jump { gap: 6px; } .quick-jump a, .quick-jump button { padding: 0 12px; min-height: 36px; font-size: 0.85rem; } }
.quick-jump a, .quick-jump button { flex: none; display: inline-flex; align-items: center; min-height: 38px; padding: 0 15px; border-radius: 999px;
  border: 1.5px solid color-mix(in srgb, var(--c) 45%, var(--line)); background: var(--surface); color: var(--ink);
  font: 600 0.9rem/1 var(--font-body); text-decoration: none; cursor: pointer; white-space: nowrap; }
.quick-jump a:hover, .quick-jump button:hover { background: color-mix(in srgb, var(--c) 10%, var(--surface)); border-color: var(--c); }
.quick-jump a:focus-visible, .quick-jump button:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
#kw-areas, #kw-revision { scroll-margin-top: 124px; }
.exam-feature { display: grid; gap: 8px; padding: 22px 24px; border-radius: 14px; text-decoration: none; color: var(--on-colour);
  background: linear-gradient(135deg, var(--c), color-mix(in srgb, var(--c) 70%, #0F1726)); box-shadow: 0 6px 22px color-mix(in srgb, var(--c) 30%, transparent); }
.exam-feature:hover { transform: translateY(-1px); box-shadow: 0 10px 28px color-mix(in srgb, var(--c) 40%, transparent); }
.exam-feature:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.exam-kicker { font: 600 0.72rem var(--font-mono); text-transform: uppercase; letter-spacing: 0.08em; opacity: 0.85; }
.exam-title { font: 800 var(--step-2, 1.7rem)/1.1 var(--font-display); letter-spacing: -0.015em; }
.exam-desc { max-width: 62ch; opacity: 0.92; line-height: 1.5; }
.exam-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.exam-chips span { font: 500 0.8rem var(--font-mono); padding: 4px 10px; border-radius: 999px; background: rgba(255,255,255,0.16); border: 1px solid rgba(255,255,255,0.3); }
.exam-go { display: inline-flex; align-items: center; gap: 8px; justify-self: start; margin-top: 6px; font-weight: 700; padding: 9px 16px; border-radius: 999px; background: #fff; color: #0F1726; }
.exam-go svg { width: 16px; height: 16px; }
@media (max-width: 560px) { .exam-feature { padding: 18px; } }

/* Report a problem (assets/report.js) */
.viewer-acts { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 6px 18px; }
.report-link { display: inline-flex; align-items: center; gap: 7px; padding: 0; border: 0; background: none; color: var(--muted); font: inherit; font-weight: 600; font-size: 0.95rem; cursor: pointer; }
.report-link:hover { color: var(--ink); }
.report-link .ic { width: 16px; height: 16px; }
.foot .report-link { font-weight: 500; font-size: inherit; }
.foot-terms { color: inherit; text-underline-offset: 2px; margin-left: 4px; white-space: nowrap; }
.foot-terms:hover { color: var(--ink); }

/* Teachers page and the "For teachers" strip on level pages */
#nav a.nav-teach { margin-right: 4px; border: 1.5px solid var(--line); }
#nav a.nav-teach[aria-current] { border-color: var(--ink); }
.teach-note { color: var(--muted); font-size: 0.92rem; margin-top: 10px; }
.teach-note a { color: var(--ink); font-weight: 600; }
.teach-starters { display: grid; gap: 12px; }
.teach-starters .areas { margin: 0; }
.teach-starters .area-num { font-weight: 700; }
.teach-starters .slots { grid-template-columns: 1fr; }
@media (min-width: 760px) { .teach-starters .areas { grid-template-columns: repeat(3, minmax(0, 1fr)); } .teach-starters .join { max-width: 560px; } }
.teach-maker { display: flex; align-items: center; gap: 14px; max-width: 640px; padding: 12px 14px; border: 1px solid var(--line); border-left: 5px solid var(--c); border-radius: var(--r); background: var(--surface); color: var(--ink); text-decoration: none; }
.teach-maker:hover { background: var(--hover, var(--surface)); border-color: var(--c); }
.teach-maker .el-sym { display: inline-grid; place-items: center; width: 44px; height: 44px; flex: none; border-radius: 4px; background: var(--c); color: #fff; font-weight: 700; font-size: 1.05rem; }
.teach-maker > span:nth-child(2) { display: flex; flex-direction: column; flex: 1; min-width: 0; line-height: 1.3; }
.teach-maker strong { font-size: 1.05rem; }
.teach-maker > span:nth-child(2) span { font-size: 0.85rem; color: var(--muted); }
.teach-maker svg { width: 20px; height: 20px; flex: none; }
.teach-level + .teach-level { margin-top: 22px; }
.teach-h3 { font-size: var(--step-1); font-weight: 700; }
.teach-h3 a { text-decoration: none; }
.teach-h3 a:hover { text-decoration: underline; text-underline-offset: 4px; }
.teach-level .areas { margin-top: 10px; }
.teach-level .slots { grid-template-columns: 1fr; }
.res-soon { opacity: .7; cursor: default; }
.teach-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; padding-block: 10px 2px; font-size: 0.88rem; }
.teach-strip > span { font-family: var(--font-mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin-right: 2px; }
.teach-strip a { padding: 4px 10px; border-radius: 4px; background: var(--chip); text-decoration: none; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.teach-strip a:hover { background: var(--hover); text-decoration: underline; }
.teach-strip .teach-all { background: transparent; color: var(--muted); }

/* ---------- Line art (assets/art.js): icons on tiles, bands, course areas, level rows and resource rows ---------- */
.kwa { fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.kwa .f { fill: currentColor; stroke: none; }
/* element tiles: a drawing in the top corner, a soft light sheen */
.el { overflow: hidden; background: linear-gradient(155deg, rgba(255,255,255,.16), rgba(255,255,255,0) 55%), var(--c); }
.el-art { position: absolute; top: 9%; right: 9%; width: 38%; height: auto; aspect-ratio: 1; stroke-width: 2.3; opacity: .95; transition: transform .25s ease; }
.el:hover .el-art { transform: rotate(-6deg) scale(1.06); }
.el::after { content: ""; position: absolute; right: -18%; bottom: -18%; width: 62%; aspect-ratio: 1; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.13); pointer-events: none; }
/* bands: a big faint drawing on the right, cropped by the band */
.band { position: relative; overflow: hidden; }
.band-in { position: relative; z-index: 1; }
.band-art { position: absolute; z-index: 0; right: max(-30px, calc((100vw - 1120px) / 2 - 10px)); top: 50%; width: 230px; height: 230px;
  transform: translateY(-50%) rotate(-8deg); stroke-width: 1.5; opacity: .16; pointer-events: none; }
@media (max-width: 719px) { .band-art { width: 150px; height: 150px; right: -36px; opacity: .13; } }
/* home: small drawing beside each section heading */
.block-head h2 { display: inline-flex; align-items: center; gap: 10px; }
.h-art { width: 26px; height: 26px; stroke-width: 3; }
/* course-area cards */
.area { position: relative; }
.area-head { align-items: center; }
.area-art { width: 46px; height: 46px; padding: 8px; margin-left: auto; border-radius: 10px; stroke-width: 3;
  color: var(--c); background: color-mix(in srgb, var(--c) 11%, var(--surface)); }
/* subject page: level rows get a small "how far up" meter */
.level { grid-template-columns: auto 1fr auto; grid-template-areas: "meter stage arrow" "meter name arrow" "meter count arrow"; }
.level-meter { grid-area: meter; display: flex; align-items: flex-end; gap: 3px; height: 34px; margin-right: 6px; }
.level-meter i { width: 6px; border-radius: 2px; background: color-mix(in srgb, var(--c) 22%, var(--surface)); }
.level-meter i.on { background: var(--c); }
.level.empty .level-meter i.on { background: var(--line); }
/* resource rows: type icon */
.res-type { display: inline-flex; align-items: center; gap: 7px; }
.res-art { width: 22px; height: 22px; stroke-width: 3.2; color: var(--ink); opacity: .75; }
.res:hover .res-art { opacity: 1; }
/* exam feature: a large stopwatch drawn in the corner */
.exam-feature { position: relative; overflow: hidden; }
.exam-feature > span { position: relative; z-index: 1; }
.exam-art { position: absolute; right: -22px; bottom: -30px; width: 190px; height: 190px; stroke-width: 1.6; opacity: .16; transform: rotate(10deg); }
@media (max-width: 560px) { .exam-art { width: 130px; height: 130px; } }
/* dark mode: subject colours are dark, so lift the drawings that sit on the page (not on coloured tiles) */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .area-art { color: color-mix(in srgb, var(--c) 45%, #fff); background: color-mix(in srgb, var(--c) 30%, var(--surface)); }
  :root:not([data-theme="light"]) .level-meter i.on { background: color-mix(in srgb, var(--c) 60%, #fff); }
  :root:not([data-theme="light"]) .level-meter i { background: color-mix(in srgb, var(--c) 30%, var(--surface)); }
}
:root[data-theme="dark"] .area-art { color: color-mix(in srgb, var(--c) 45%, #fff); background: color-mix(in srgb, var(--c) 30%, var(--surface)); }
:root[data-theme="dark"] .level-meter i.on { background: color-mix(in srgb, var(--c) 60%, #fff); }
:root[data-theme="dark"] .level-meter i { background: color-mix(in srgb, var(--c) 30%, var(--surface)); }
@media print { .band-art, .exam-art, .el-art, .el::after { display: none; } }
@media (max-width: 639px) { .el-art { width: 30%; top: 8%; right: 8%; } .el::after { display: none; } }
/* Sims page (#sims) */
.sims-ctl { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.sims-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.sims-chips button { font: inherit; font-size: var(--step--1); font-weight: 600; min-height: 36px; padding: 4px 13px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; }
.sims-chips button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.sims-q { display: flex; align-items: center; gap: 6px; flex: 1; min-width: 220px; max-width: 420px; border: 1.5px solid var(--line); background: var(--surface); border-radius: 999px; padding: 0 12px; min-height: 40px; }
.sims-q input { border: 0; background: transparent; color: var(--ink); font: inherit; outline: 0; width: 100%; min-height: 36px; }
.sims-q:focus-within { border-color: var(--ink); }
.sims-lev { font-size: var(--step-1); margin: 22px 0 8px; }
.sims-units { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.sims-unit { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 10px 14px 12px; }
.sims-unit h4 { margin: 0 0 6px; font-size: var(--step--1); font-family: var(--font-mono); font-weight: 500; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.sims-unit ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.sims-unit a { color: var(--ink); text-decoration: none; display: block; padding: 3px 0; font-weight: 500; }
.sims-unit a:hover { text-decoration: underline; }
.sims-filters { padding-bottom: 0; } .sims-filters .sims-ctl { margin-bottom: 10px; }
/* Sims page: stand-alone sim cards with a snapshot of the sim */
.sim-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.sim-card { display: flex; flex-direction: column; border-radius: 14px; overflow: hidden; background: var(--surface, #fff); border: 1px solid var(--line, #E3E7EE); color: inherit; text-decoration: none; transition: transform .2s ease, box-shadow .2s ease; }
.sim-card:hover, .sim-card:focus-visible { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(15, 23, 38, .14); }
.sim-pic { position: relative; display: block; aspect-ratio: 16 / 9; background: #0B1020; overflow: hidden; }
.sim-pic img { width: 100%; height: 100%; object-fit: cover; display: block; transform-origin: 50% 50%; animation: simdrift 14s ease-in-out infinite alternate; }
.sim-card:nth-child(2n) .sim-pic img { animation-duration: 17s; animation-direction: alternate-reverse; }
.sim-card:hover .sim-pic img { animation-play-state: paused; transform: scale(1.06); }
@keyframes simdrift { from { transform: scale(1.02) translate(0, 0); } to { transform: scale(1.12) translate(-2%, -1.5%); } }
@media (prefers-reduced-motion: reduce) { .sim-pic img { animation: none; } }
.sim-sym { position: absolute; left: 10px; top: 10px; min-width: 34px; height: 34px; padding: 0 6px; border-radius: 8px; background: var(--c); color: #fff; font-weight: 700; font-size: .95rem; display: grid; place-items: center; box-shadow: 0 2px 6px rgba(0, 0, 0, .3); }
.sim-foot { display: grid; gap: 3px; padding: 10px 14px 13px; border-top: 3px solid var(--c); }
.sim-name { font-weight: 650; font-size: 1rem; }
.sim-desc { font-size: .82rem; color: var(--muted, #5B6575); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sims-tabs { display: flex; width: fit-content; gap: 2px; padding: 4px; margin-bottom: 14px; border-radius: 999px; background: var(--line); }
.sims-tabs button { font: inherit; font-weight: 600; min-height: 40px; padding: 6px 20px; border: 0; border-radius: 999px; background: transparent; color: var(--ink); cursor: pointer; }
.sims-tabs button[aria-selected="true"] { background: var(--surface); box-shadow: 0 1px 3px rgba(15, 23, 38, .18); }
.sims-home { font: inherit; font-size: var(--step--1); font-weight: 600; min-height: 36px; padding: 4px 13px; border-radius: 999px; border: 1.5px solid #16A34A; background: var(--surface); color: var(--ink); cursor: pointer; }
.sims-home[aria-pressed="true"] { background: #16A34A; color: #fff; }
.sims-unit li { padding: 2px 0 6px; }
.sims-unit .sims-ways { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 2px; }
.sims-unit .sims-ways a { display: inline-block; padding: 2px 9px; border-radius: 999px; border: 1px solid var(--line); font-size: .74rem; font-weight: 600; color: var(--muted); }
.sims-unit .sims-ways a:hover { color: var(--ink); border-color: var(--ink); text-decoration: none; }
.sims-badge { display: inline-block; font-size: .7rem; font-weight: 650; padding: 1px 7px; border-radius: 999px; background: rgba(22, 163, 74, .14); color: #15803D; vertical-align: 1px; }
:root[data-theme="dark"] .sims-badge { color: #86EFAC; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .sims-badge { color: #86EFAC; } }
/* Printing: logo, kwantum.uk and page numbers in the page margin (Chrome/Edge). Logo slot: same mark as PRINT_MARK in assets/kwbar.js */
@media print {
  @page {
    @bottom-left { content: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2064%2064%22%20width%3D%2211%22%20height%3D%2211%22%3E%3Crect%20x%3D%222%22%20y%3D%222%22%20width%3D%2260%22%20height%3D%2260%22%20rx%3D%223%22%20fill%3D%22%230F1726%22%2F%3E%3Cpath%20d%3D%22M5.346289062499999%2045.5V20.1875H11.691992187499999V29.978515625L21.3248046875%2020.1875H28.9888671875L19.7603515625%2029.50390625L29.8326171875%2045.5H22.6080078125L15.471289062499999%2033.7578125L11.691992187499999%2037.607421875V45.5Z%20M33.358789062499994%2045.5%2028.981835937499998%2026.515625H35.345117187499994L37.858789062499994%2041.685546875H37.436914062499994L40.759179687499994%2026.515625H49.003320312499994L52.255273437499994%2041.703125H51.763085937499994L54.382226562499994%2026.515625H60.341210937499994L55.946679687499994%2045.5H47.421289062499994L44.169335937499994%2028.51953125H45.224023437499994L41.884179687499994%2045.5Z%22%20fill%3D%22%23FFFFFF%22%2F%3E%3C%2Fsvg%3E") "  kwantum.uk"; font: 700 8pt/1 Helvetica, Arial, sans-serif; color: #0F1726; vertical-align: middle; }
    @bottom-right { content: "Kwantum Education \00B7  page " counter(page) " of " counter(pages); font: 400 8pt/1 Helvetica, Arial, sans-serif; color: #555; vertical-align: middle; }
  }
}

/* Learning support: "My way" tile is a button that opens the settings panel (assets/kwmyway.js) */
button.el.el-btn { border: 0; font: inherit; text-align: left; cursor: pointer; width: 100%; }
.mw-top { display: inline-flex; align-items: center; gap: 6px; }
.mw-top svg { width: 18px; height: 18px; }

/* home: featured sims row (element tiles with sim snapshot behind) */
.fs-row { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(118px, 1fr); gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 2px 2px 10px; scrollbar-width: thin; }
.fs-tile { position: relative; display: flex; flex-direction: column; justify-content: flex-end; aspect-ratio: 1 / 1; min-width: 118px; border-radius: 14px; overflow: hidden; padding: 10px; color: #fff; text-decoration: none; scroll-snap-align: start; background: var(--c); isolation: isolate; transition: transform .2s ease, box-shadow .2s ease; }
.fs-tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; opacity: .9; transition: transform .4s ease; }
.fs-tile::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(160deg, color-mix(in srgb, var(--c) 55%, transparent) 0%, color-mix(in srgb, var(--c) 88%, #000) 78%); }
.fs-tile:hover, .fs-tile:focus-visible { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(15, 23, 38, .22); }
.fs-tile:hover img { transform: scale(1.08); }
.fs-n { position: absolute; top: 8px; right: 10px; font-size: .72rem; font-weight: 600; opacity: .85; }
.fs-sym { font-size: clamp(1.9rem, 3.2vw, 2.4rem); font-weight: 700; line-height: 1; letter-spacing: -0.02em; text-shadow: 0 1px 6px rgba(0, 0, 0, .35); }
.fs-name { margin-top: 6px; font-size: .78rem; font-weight: 600; line-height: 1.2; text-shadow: 0 1px 4px rgba(0, 0, 0, .4); }
.fs-more { background: linear-gradient(150deg, #5B4FC4, #3A2F8F); color: #fff; }
.fs-more::before { display: none; }
.fs-more .fs-sym { font-size: 2.6rem; font-weight: 500; }
@media (prefers-reduced-motion: reduce) { .fs-tile, .fs-tile img { transition: none; } }
@media (max-width: 900px) { .fs-row { grid-auto-columns: minmax(84px, 1fr); gap: 8px; } .fs-tile { min-width: 84px; padding: 8px; border-radius: 12px; } .fs-sym { font-size: 1.7rem; } .fs-name { font-size: .7rem; } .fs-n { top: 6px; right: 8px; } }
@media (max-width: 520px) { .fs-row { grid-auto-columns: 104px; } }
.fs-tool { background: linear-gradient(150deg, color-mix(in srgb, var(--c) 82%, #fff), var(--c)); }
.fs-tool::before { display: none; }
.fs-art { position: absolute; top: 9%; right: 9%; width: 36%; height: auto; aspect-ratio: 1; stroke-width: 2.3; opacity: .95; color: #fff; }
.fs-tool .fs-n { display: none; }

button.search-btn { background: transparent; font-family: inherit; cursor: pointer; line-height: inherit; }
@media (max-width: 560px) { .topbar-end .mw-top { display: none; } }
@media (max-width: 639px) { .tiles-sup .el-count { display: none; } .tiles-sup .el-sym { font-size: clamp(1.9rem, 9vw, 3rem); } }

/* Teachers page tiles: two per row on phones so the symbol, name and description all fit */
@media (max-width: 639px) {
  .tiles-teach { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tiles-teach .el { aspect-ratio: auto; min-height: 150px; }
  .tiles-teach .el-sym { font-size: clamp(2rem, 11vw, 2.8rem); }
  .tiles-teach .el-art { width: 26%; }
}
/* Translate this page button (assets/kwtranslate.js) */
.tr-top { display: inline-flex; align-items: center; gap: 6px; }
.tr-top svg { width: 18px; height: 18px; }
@media (max-width: 1100px) { .topbar-end .tr-top span { display: none; } .topbar-end .tr-top { padding: 8px; } }
@media (max-width: 560px) { .topbar-in { column-gap: 8px; } .topbar-in > .brand { margin-right: auto; } }
@media (max-width: 370px) { .topbar-in > .brand #site-name { font-size: 0.95rem; } }

/* level page: "Ways in" (replaces the quick-jump chips; each route says what it is for) */
.ways { padding-block: 14px 4px; }
.ways-h { margin: 0 0 8px; font: 500 0.72rem/1.2 var(--font-mono, monospace); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.ways-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.way { display: grid; gap: 3px; align-content: start; text-align: left; padding: 11px 14px 12px; border-radius: 12px;
  border: 1.5px solid color-mix(in srgb, var(--c) 35%, var(--line)); border-left: 4px solid var(--c); background: var(--surface); color: var(--ink);
  font: inherit; text-decoration: none; cursor: pointer; }
.way b { font-weight: 700; font-size: 0.95rem; }
.way span { font-size: 0.82rem; line-height: 1.35; color: var(--muted); }
.way:hover { background: color-mix(in srgb, var(--c) 8%, var(--surface)); border-color: var(--c); }
.way:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
@media (max-width: 480px) { .ways-grid { grid-template-columns: 1fr 1fr; gap: 6px; } .way { padding: 9px 10px 10px; } .way b { font-size: 0.88rem; } .way span { font-size: 0.76rem; } }

/* course area cards: extras fold behind "More for this topic" (Notes and Practice stay on show) */
.area-more { margin-top: 0; border-top: 1px solid var(--line); padding-top: 8px; }
.area-more summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; min-height: 36px; font-weight: 600; font-size: 0.9rem; color: var(--ink); }
.area-more summary::-webkit-details-marker { display: none; }
.area-more summary::after { content: ""; width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); margin: -4px 0 0 auto; transition: transform .15s; }
.area-more[open] summary::after { transform: rotate(-135deg); margin-top: 4px; }
.area-more summary span { font: 500 0.72rem/1 var(--font-mono); padding: 3px 7px; border-radius: 999px; background: var(--chip); color: var(--muted); }
.area-more summary:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.area-more-in { display: grid; gap: 8px; padding: 6px 0 2px; }

/* Top bar on two lines (Tim 2026-11-30: Sims and Support were pushed off the end of the line):
   line 1 = logo + tools, line 2 = the subject links, always all visible */
.topbar-end { display: contents; }
.topbar-in { column-gap: 8px; row-gap: 6px; padding-bottom: 6px; }
.topbar-in > .brand { margin-right: auto; }
#nav { order: 99; flex: 1 0 100%; margin-inline: -12px; width: calc(100% + 24px); max-width: none; padding-inline: 4px; flex-wrap: wrap; overflow: visible; }
@media (max-width: 1024px) {
  .topbar-end .flag-link span, .topbar-end .mw-top span, .topbar-end .qr-top span { display: none; }
  .topbar-end .flag-link, .topbar-end .mw-top, .topbar-end .qr-top { padding: 8px; }
}
.topbar-in { justify-content: flex-start; }
@media (max-width: 560px) {
  .topbar-end .kwp-chip { padding: 3px !important; }
  .topbar-end .kwp-chip .n { display: none; }
  #nav { gap: 0; justify-content: space-between; }
  #nav a { padding: 7px 5px; font-size: 0.86rem; }
  #nav a.nav-teach { margin-right: 2px; padding-inline: 7px; }
  .topbar-in { column-gap: 4px; }
  .topbar-in > .brand { gap: 8px; }
  .topbar-in > .brand #site-name { font-size: 0.95rem; }
}
@media (max-width: 380px) { #nav a { padding: 7px 3px; font-size: 0.8rem; } .topbar-in > .brand #site-name { font-size: 0.88rem; } .topbar-in > .brand .logo { width: 30px; height: 30px; } }
#nav .nav-short { display: none; }
@media (max-width: 480px) { #nav .nav-long { display: none; } #nav .nav-short { display: inline; } }
@media (max-width: 760px) {
  .topbar-end .search-btn span { display: none; }
  .topbar-end .search-btn { padding: 8px; }
  .topbar-end .kwp-chip { padding: 3px !important; }
  .topbar-end .kwp-chip .n { display: none; }
}

/* Home page: six big section tiles (Tim 2026-12-01) */
.hub-block { padding-top: 6px; }
.hubs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 760px) { .hubs { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; } }
.hub { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; gap: 6px; min-width: 0;
  aspect-ratio: 1 / 1; padding: 12px 13px; border-radius: var(--r); color: var(--on-colour, #fff); text-decoration: none;
  background: linear-gradient(155deg, rgba(255,255,255,.16), rgba(255,255,255,0) 55%), var(--c);
  transition: transform .18s ease, box-shadow .18s ease; }
@media (min-width: 760px) { .hub { aspect-ratio: auto; min-height: 250px; padding: 44px 20px 18px; } }
@media (min-width: 1100px) { .hub { min-height: 272px; } }
.hub:hover { transform: translateY(-3px); box-shadow: 0 12px 0 -5px color-mix(in srgb, var(--c) 35%, transparent); }
.hub:focus-visible { outline: 3px solid var(--focus, #000); outline-offset: 3px; }
.hub::after { content: ""; position: absolute; right: -18%; bottom: -22%; width: 60%; aspect-ratio: 1; border-radius: 50%; border: 2px solid rgba(255,255,255,.13); pointer-events: none; }
.hub-art { position: absolute; top: 10%; right: 8%; width: 34%; max-width: 120px; height: auto; aspect-ratio: 1; stroke-width: 2.2; opacity: .95; transition: transform .25s ease; }
.hub:hover .hub-art { transform: rotate(-6deg) scale(1.06); }
.hub-n { position: absolute; top: 10px; left: 13px; font-family: var(--font-mono); font-size: .75rem; opacity: .85; }
@media (min-width: 760px) { .hub-n { top: 14px; left: 20px; } }
.hub-sym { margin-top: auto; font-family: var(--font-display); font-weight: 700; font-size: clamp(2.6rem, 12vw, 5rem); line-height: 1; letter-spacing: -0.04em; }
.hub-foot { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.hub-name { font-weight: 700; font-size: clamp(1rem, 4.2vw, 1.3rem); line-height: 1.15; }
.hub-range { font-family: var(--font-mono); font-size: .72rem; opacity: .9; }
.hub-what { display: none; font-size: .85rem; line-height: 1.3; opacity: .92; }
@media (min-width: 760px) { .hub-what { display: block; } }
@media (prefers-reduced-motion: reduce) { .hub, .hub-art { transition: none; } .hub:hover, .hub:hover .hub-art { transform: none; } }
/* Carry on: last course or two this person opened */
.carry { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-block: 8px 4px; }
.carry-k { font-weight: 600; font-size: .85rem; color: var(--muted); margin-right: 2px; }
.carry-a { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 4px 12px 4px 4px; border-radius: 999px; max-width: 100%;
  border: 1px solid var(--line, rgba(0,0,0,.12)); background: var(--chip, #F1F3F6); color: var(--ink); text-decoration: none; font-weight: 600; font-size: .9rem; }
.carry-a:hover { background: var(--hover, #E8EBF0); }
.carry-sym { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 999px; background: var(--c); color: #fff; font-family: var(--font-display); font-weight: 700; font-size: .85rem; flex: none; }
.carry-n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.carry-a .ic { width: 1em; height: 1em; color: var(--muted); }
