/* 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; }
}

main { flex: 1; outline: none; }

/* Home intro */
.intro { display: flex; flex-direction: column; gap: 18px; padding-block: 40px 40px; }
@media (min-width: 900px) { .intro { padding-block: 72px 56px; } }
.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; }
.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 48px; 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: 28px; }

/* 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: 7rem 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: 22px 32px; display: flex; flex-direction: column; gap: 22px; }
@media (min-width: 720px) { .band-in { padding-block: 28px 40px; } }
.band-title { display: flex; align-items: center; gap: 18px; }
.band-title > div { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.band h1 { font-size: var(--step-3); font-weight: 800; letter-spacing: -0.03em; }
.band p { font-size: 1.05rem; }
.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.75rem; letter-spacing: -0.04em;
}
@media (min-width: 720px) { .el-mini { width: 84px; height: 84px; font-size: 2.3rem; } }
.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 16px; width: 100%; max-width: 640px;
  padding: 12px 12px 12px 16px; 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: 2px; flex: 1 1 160px; min-width: 0; }
.join label strong { font-size: 1.02rem; }
.join label span { font-size: 0.85rem; color: var(--muted); }
.join-row { display: flex; gap: 8px; flex: 1 1 240px; 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; }
