/* Futures of Maths: design tokens */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("/static/fonts/inter-latin-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("/static/fonts/inter-latin-ext-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --bg: #f6f6fb;
  --surface: #ffffff;
  --surface-2: #eff0f7;
  --text: #12131a;
  --muted: #5c6070;
  --border: #e3e4ee;
  --accent: #4f46e5;
  --accent-strong: #3b3fb6;
  --accent-soft: #ecebff;
  --accent-text: #ffffff;
  --brand-gradient: linear-gradient(135deg, #5b5ef0 0%, #a046e0 100%);
  /* Agree/disagree use blue and orange (from the Okabe-Ito palette) rather
     than green and red, so they stay distinct with colour blindness. */
  --agree: #0b5fa5;
  --agree-soft: #e1edf9;
  --disagree: #b14f00;
  --disagree-soft: #fbeadb;
  --notice-bg: #e1edf9;
  --error: #a8430a;
  --shadow: 0 1px 2px rgb(16 18 40 / 0.04), 0 10px 30px -14px rgb(16 18 40 / 0.16);
  --radius: 18px;
  --radius-sm: 12px;
  --tabbar-h: 0px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1016;
    --surface: #161922;
    --surface-2: #1d212c;
    --text: #eceef5;
    --muted: #9aa0b4;
    --border: #272b38;
    --accent: #8b8cf8;
    --accent-strong: #a9aafb;
    --accent-soft: #24264a;
    --accent-text: #0e1016;
    --agree: #6db6ef;
    --agree-soft: #10283d;
    --disagree: #f0a356;
    --disagree-soft: #3a2510;
    --notice-bg: #10283d;
    --error: #f0a356;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 10px 30px -14px rgb(0 0 0 / 0.6);
  }
}

/* Tag colours: --tc-bg/--tc-fg for chips, --tc-solid for accents. Based on
   the Okabe-Ito colour-blind-safe palette; tags always show their name too,
   so colour is never the only way to tell them apart. */
.tc-none { --tc-bg: var(--surface-2); --tc-fg: var(--muted); --tc-solid: var(--muted); }
.tc-0 { --tc-bg: #dcebf7; --tc-fg: #005a8f; --tc-solid: #0072b2; }
.tc-1 { --tc-bg: #fcefd2; --tc-fg: #7a5300; --tc-solid: #e69f00; }
.tc-2 { --tc-bg: #d4f0e7; --tc-fg: #00664a; --tc-solid: #009e73; }
.tc-3 { --tc-bg: #fbe2d3; --tc-fg: #9a4300; --tc-solid: #d55e00; }
.tc-4 { --tc-bg: #f6e3ee; --tc-fg: #8a3d6c; --tc-solid: #cc79a7; }
.tc-5 { --tc-bg: #e0f1fb; --tc-fg: #1d6690; --tc-solid: #56b4e9; }
.tc-6 { --tc-bg: #f8f4c8; --tc-fg: #646000; --tc-solid: #e3d53a; }
.tc-7 { --tc-bg: #ececef; --tc-fg: #3f4250; --tc-solid: #6b6f80; }
.tc-8 { --tc-bg: #e9e2f5; --tc-fg: #4c3485; --tc-solid: #6a4fb0; }
.tc-9 { --tc-bg: #efe4da; --tc-fg: #6b4320; --tc-solid: #8c5a2b; }
@media (prefers-color-scheme: dark) {
  .tc-0 { --tc-bg: #10283d; --tc-fg: #7cc0f0; }
  .tc-1 { --tc-bg: #3a2c0c; --tc-fg: #f2c25a; }
  .tc-2 { --tc-bg: #0d3329; --tc-fg: #5fd1ae; }
  .tc-3 { --tc-bg: #3d1f0c; --tc-fg: #f7a066; }
  .tc-4 { --tc-bg: #3a1d2f; --tc-fg: #e8a6cb; }
  .tc-5 { --tc-bg: #0f2c3d; --tc-fg: #9ad3f5; }
  .tc-6 { --tc-bg: #34320c; --tc-fg: #ece27a; }
  .tc-7 { --tc-bg: #262833; --tc-fg: #c2c5d2; }
  .tc-8 { --tc-bg: #261d3d; --tc-fg: #bba7ea; }
  .tc-9 { --tc-bg: #33230f; --tc-fg: #dcb48a; }
}

/* Base */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16.5px/1.6 "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-wrap: break-word;
}
.wrap { max-width: 780px; margin: 0 auto; padding: 0 16px; }
.wrap.wide { max-width: 1140px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 8px; top: 8px; background: var(--surface); padding: 8px; z-index: 40; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
a { color: var(--accent); text-underline-offset: 3px; }
h1, h2, h3, h4 { letter-spacing: -0.015em; }
h1 { font-size: 2rem; line-height: 1.15; font-weight: 750; margin: 1.6rem 0 0.75rem; }
h2 { font-size: 1.2rem; line-height: 1.3; font-weight: 680; margin: 0 0 0.5rem; }
h3 { font-size: 1.05rem; font-weight: 650; margin: 1rem 0 0.4rem; }
h4 { font-size: 1rem; font-weight: 650; margin: 1rem 0 0.4rem; }
.lead { font-size: 1.12rem; color: var(--muted); }
.muted, .note { color: var(--muted); }
.small { font-size: 0.9rem; }
main { padding-bottom: 48px; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px; margin: 16px 0; box-shadow: var(--shadow);
}
.notice { background: var(--notice-bg); border-radius: var(--radius-sm); padding: 14px 18px; margin: 16px 0; }
.notice p { margin: 0.4rem 0; }
.error { color: var(--error); font-weight: 600; }
.crumbs { margin: 1.25rem 0 0; font-size: 0.9rem; color: var(--muted); }
.crumbs a { text-decoration: none; }

/* Hero */
.hero { padding: 28px 0 8px; }
.hero h1 {
  font-size: clamp(2rem, 6vw, 3rem); line-height: 1.05; letter-spacing: -0.03em; margin-top: 0.5rem;
  background: var(--brand-gradient); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.eyebrow { display: inline-block; font-size: 0.78rem; font-weight: 650; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }
.steps { counter-reset: step; list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 32px 1fr; gap: 12px; align-items: start; }
.steps li::before {
  content: counter(step); display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 0.9rem;
}

/* Header and navigation */
.site-header {
  position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.site-header .wrap { display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: center; justify-content: space-between; min-height: 60px; padding-top: 8px; padding-bottom: 8px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 720; letter-spacing: -0.02em; text-decoration: none; color: var(--text); font-size: 1.05rem; }
.logo { width: 30px; height: 30px; flex: none; }
.badge { font-size: 0.72rem; font-weight: 650; color: var(--muted); border: 1px solid var(--border); border-radius: 999px; padding: 1px 8px; letter-spacing: 0; }
nav.topnav, nav.tabs { display: flex; flex-wrap: wrap; gap: 2px; padding: 4px; border-radius: 999px; background: var(--surface-2); }
nav.topnav a, nav.tabs a {
  display: inline-flex; align-items: center; gap: 6px; text-decoration: none; color: var(--muted);
  padding: 7px 14px; border-radius: 999px; min-height: 36px; font-size: 0.92rem; font-weight: 550;
}
nav.topnav a:hover, nav.tabs a:hover { color: var(--text); }
nav.topnav a[aria-current], nav.tabs a[aria-current] { color: var(--text); background: var(--surface); box-shadow: 0 1px 3px rgb(16 18 40 / 0.12); }
.icon { width: 22px; height: 22px; flex: none; }
nav.tabs .icon { display: none; }

/* Phones: participant navigation becomes a bottom tab bar */
@media (max-width: 719px) {
  /* A backdrop filter would trap the fixed tab bar inside the header. */
  .site-header { position: static; backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--bg); }
  body.has-tabs { --tabbar-h: 66px; padding-bottom: calc(var(--tabbar-h) + var(--safe-bottom)); }
  nav.tabs {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 0; border-radius: 0; padding: 0 0 var(--safe-bottom);
    background: color-mix(in srgb, var(--surface) 88%, transparent);
    backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px);
    border-top: 1px solid var(--border);
  }
  nav.tabs a {
    flex-direction: column; justify-content: center; gap: 3px; border-radius: 0;
    height: var(--tabbar-h); padding: 6px 2px; font-size: 0.7rem; text-align: center;
  }
  nav.tabs a[aria-current] { background: transparent; box-shadow: none; color: var(--accent); }
  nav.tabs .icon { display: block; }
  h1 { font-size: 1.65rem; }
  .card { padding: 18px; border-radius: 16px; }
}

/* Footer and cookie notice */
.site-footer { border-top: 1px solid var(--border); padding: 22px 0 32px; font-size: 0.88rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.site-footer a { color: var(--muted); }
.site-footer .follow { display: inline-flex; align-items: center; gap: 6px; color: var(--accent); font-weight: 550; }
.site-footer .follow .icon { width: 1.1em; height: 1.1em; }
.cookie-banner {
  background: var(--accent-soft); border-bottom: 1px solid var(--border);
  padding: 10px 16px; display: flex; gap: 12px; align-items: center; justify-content: center; flex-wrap: wrap;
}
.cookie-banner p { margin: 0; max-width: 640px; font-size: 0.9rem; }
.cookie-banner button { min-height: 36px; padding: 6px 16px; }
/* Announcement banner, posted from the admin page */
.announcement { background: var(--notice-bg); border-bottom: 1px solid var(--border); }
.announcement-inner { display: flex; gap: 10px; align-items: flex-start; padding-top: 10px; padding-bottom: 10px; }
.announcement p { margin: 0; flex: 1; font-size: 0.92rem; overflow-wrap: anywhere; }
.announcement-close { flex: none; min-height: 32px; min-width: 32px; padding: 0 8px; font-size: 1.3rem; line-height: 1; background: transparent; color: var(--text); border: 1px solid var(--border); }
/* After the 20th answer: the optional questions about yourself */
.milestone { margin: 16px 0 0; padding: 14px 16px; border-radius: var(--radius-sm); background: var(--notice-bg); }
.milestone p { margin: 0 0 8px; }
.milestone p:last-child { margin: 0; }
.milestone-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.feed-end-about { margin-top: 8px; }

/* Front page */
.front-cta { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0 6px; }
.front-stats { margin: 20px 0; }
.front-links { padding-left: 1.2em; }
.front-links li { margin: 6px 0; }

/* Invite colleagues */
.invite h2 { margin-top: 0; }
.invite.compact { margin-top: 12px; }
.invite-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.invite-actions .button, .invite-actions button { display: inline-flex; align-items: center; gap: 8px; }
.invite-actions .icon { width: 18px; height: 18px; }
[data-invite-native], [data-invite-copy] { display: none !important; }
.can-share [data-invite-native], .can-copy [data-invite-copy] { display: inline-flex !important; }
.invite-server { margin: 0 0 12px; }
.invite-server label { display: block; font-weight: 550; margin-bottom: 6px; }
.invite-server input { flex: 1; min-width: 0; }
.invite-message { white-space: pre-line; margin: 8px 0 0; }
[hidden] { display: none !important; }

/* Buttons and inputs */
.button, button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font: inherit; font-weight: 620; cursor: pointer; text-decoration: none; letter-spacing: -0.005em;
  background: var(--accent); color: var(--accent-text); border: 1px solid transparent;
  padding: 10px 20px; border-radius: 12px; min-height: 46px; touch-action: manipulation;
  box-shadow: 0 1px 2px rgb(16 18 40 / 0.1), inset 0 1px 0 rgb(255 255 255 / 0.12);
  transition: transform 0.08s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}
.button:hover, button:hover { background: var(--accent-strong); }
.button:active, button:active { transform: translateY(1px); }
.button.primary-gradient { background: var(--brand-gradient); color: #fff; }
button.secondary, .button.secondary { background: var(--surface); color: var(--text); border-color: var(--border); box-shadow: none; }
button.secondary:hover, .button.secondary:hover { background: var(--surface-2); }
button.danger { background: var(--disagree); color: #fff; }
@media (prefers-color-scheme: dark) { button.danger { color: #0e1016; } }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 2px; }
input[type="email"], input[type="text"], input[type="search"], textarea, select, .pass-link {
  font: inherit; font-size: 16px; color: var(--text); background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 11px 14px; max-width: 100%; transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input[type="email"]:focus, input[type="text"]:focus, input[type="search"]:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); outline: none; }
textarea { width: 100%; resize: vertical; }
.pass-link { width: 100%; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.82rem; background: var(--surface-2); }
.inline-form label { display: block; margin-bottom: 6px; font-weight: 550; }
.inline-form input { width: min(100%, 360px); margin: 0 8px 8px 0; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.sticky-actions {
  position: sticky; bottom: calc(var(--tabbar-h) + var(--safe-bottom)); z-index: 5;
  background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  padding: 12px 0; margin-top: 8px;
}
@media (max-width: 479px) {
  .sticky-actions button { flex: 1 1 auto; }
}

/* Questions */
fieldset.question { border: 0; padding: 0; margin: 0 0 32px; min-width: 0; }
fieldset.question:last-child { margin-bottom: 0; }
fieldset.question legend { font-weight: 650; padding: 0; margin-bottom: 12px; font-size: 1.02rem; }
.choices { display: grid; gap: 8px; }
.choice {
  display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; cursor: pointer;
  border: 1px solid var(--border); border-radius: 12px; background: var(--surface); transition: border-color 0.15s ease, background-color 0.15s ease;
}
.choice:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); }
.choice:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.choice input { margin-top: 3px; flex: none; width: 20px; height: 20px; accent-color: var(--accent); }
.other { display: block; margin-top: 6px; font-size: 0.95rem; }
div.question { margin: 0 0 32px; }
.question-label { display: block; font-weight: 650; margin-bottom: 12px; font-size: 1.02rem; }
.question .muted.small { margin: -6px 0 10px; }
.question select { width: 100%; }
@media (min-width: 600px) { .choices.columns { grid-template-columns: 1fr 1fr; } }
.other-row { margin-top: 8px; }
.other-text { width: 100%; }
.other input { width: 100%; margin-top: 6px; }

/* 1–5 scales as large tap targets */
.scale { display: grid; grid-template-columns: repeat(5, minmax(44px, 1fr)); gap: 6px; max-width: 420px; }
.scale-end { font-size: 0.8rem; color: var(--muted); }
.scale-end:first-child { grid-column: 1 / 3; grid-row: 2; }
.scale-end:last-child { grid-column: 4 / 6; grid-row: 2; text-align: right; }
.scale-point { position: relative; grid-row: 1; }
.scale-point input { position: absolute; inset: 0; opacity: 0; margin: 0; width: 100%; height: 100%; cursor: pointer; }
.scale-point > span {
  display: flex; align-items: center; justify-content: center; height: 46px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--surface); font-weight: 650; color: var(--muted);
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
@media (hover: hover) {
  .scale-point:hover input:not(:checked) + span { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); color: var(--text); }
}
.scale-point input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--accent-text); box-shadow: 0 4px 14px -6px var(--accent); }
.scale-point input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 2px; }
.likert-row { padding: 14px 0; border-top: 1px solid var(--border); }
.likert-label { display: block; margin-bottom: 8px; }
@media (min-width: 720px) {
  .likert-row { display: grid; grid-template-columns: 1fr 360px; gap: 20px; align-items: center; }
  .likert-label { margin: 0; }
}

/* Survey overview */
.area-list { margin-top: 8px; }
.area {
  position: relative; display: flex; gap: 14px; align-items: flex-start; cursor: pointer; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 18px 18px 22px; margin: 12px 0;
  box-shadow: var(--shadow); transition: border-color 0.15s ease, opacity 0.15s ease;
}
.area::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--tc-solid); }
.area:not(:has(input:checked)) { opacity: 0.6; box-shadow: none; }
.area input { width: 22px; height: 22px; margin-top: 2px; flex: none; accent-color: var(--accent); }
.area-body { display: grid; gap: 4px; }
.area-title { font-weight: 680; font-size: 1.05rem; }
.area-intro { color: var(--muted); font-size: 0.95rem; }
.area-meta { font-size: 0.85rem; color: var(--muted); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 4px; }
.area-heading { display: flex; align-items: center; gap: 12px; }
.area-heading::before { content: ""; width: 12px; height: 12px; border-radius: 50%; background: var(--tc-solid); flex: none; }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; background: var(--surface-2); font-size: 0.78rem; font-weight: 600; }
.ok-pill { background: var(--agree-soft); color: var(--agree); }
.muted-pill { text-decoration: line-through; }
progress.progress { width: 100%; height: 6px; appearance: none; border: 0; border-radius: 3px; background: var(--surface-2); overflow: hidden; margin: 4px 0 8px; }
progress.progress::-webkit-progress-bar { background: var(--surface-2); }
progress.progress::-webkit-progress-value { background: var(--brand-gradient); border-radius: 3px; }
progress.progress::-moz-progress-bar { background: var(--brand-gradient); border-radius: 3px; }


/* Statements and tags */
.statement-card { position: relative; padding-top: 24px; }
.statement-card blockquote { font-size: 1.4rem; line-height: 1.35; font-weight: 600; letter-spacing: -0.015em; margin: 12px 0 22px; }
.chips { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: 0.78rem; font-weight: 620; padding: 3px 11px; border-radius: 999px; background: var(--tc-bg, var(--accent-soft)); color: var(--tc-fg, var(--accent)); }
.filter { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 10px; margin: 0 -2px; scrollbar-width: none; }
.filter::-webkit-scrollbar { display: none; }
.filter a {
  flex: none; text-decoration: none; color: var(--text); border: 1px solid var(--border); background: var(--surface);
  border-radius: 999px; padding: 6px 14px; font-size: 0.88rem; font-weight: 560; min-height: 36px; display: inline-flex; align-items: center; gap: 8px;
}
.filter a[class^="tc-"]::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--tc-solid); }
.filter a[aria-current] { background: var(--text); border-color: var(--text); color: var(--bg); }
@media (min-width: 720px) {
  .filter { flex-wrap: wrap; overflow: visible; }
}
.add-statement summary { cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; }
.add-statement summary::-webkit-details-marker { display: none; }
.add-statement summary::after {
  content: "+"; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent); font-size: 1.3rem; font-weight: 600; flex: none;
}
.add-statement[open] summary::after { content: "–"; }
.add-statement summary h2 { margin: 0; }
.tag-picker { border: 0; padding: 0; margin: 16px 0 0; min-width: 0; }
.tag-picker legend { font-weight: 650; padding: 0; margin-bottom: 10px; }
.chip-options { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-option { position: relative; }
.chip-option input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.chip-option span {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 6px 14px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface); font-size: 0.9rem; font-weight: 560;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.chip-option span::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--tc-solid); }
@media (hover: hover) {
  .chip-option:hover span { background: var(--tc-bg); }
}
.chip-option input:checked + span { background: var(--tc-fg); border-color: var(--tc-fg); color: var(--surface); }
.chip-option input:checked + span::before { content: "✓"; width: auto; height: auto; background: none; font-size: 0.85rem; }
.chip-option input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 2px; }
.new-tag { display: block; margin-top: 14px; font-size: 0.95rem; }
.new-tag input { display: block; width: min(100%, 360px); margin-top: 6px; }

/* Ranking */
.rank-list { padding-left: 0; list-style: none; }
.rank-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 12px 0; border-top: 1px solid var(--border); }
.rank-label { flex: 1 1 220px; }
.rank-buttons { display: none; gap: 6px; }
.rank-list.enhanced .rank-buttons { display: inline-flex; }
.rank-list.enhanced .rank-select { position: absolute; left: -9999px; }
.rank-list.enhanced li[data-ranked="0"] .rank-label { color: var(--muted); }
.rank-list.enhanced { counter-reset: rank; }
.rank-list.enhanced li[data-ranked="1"] .rank-label::before {
  content: counter(rank); counter-increment: rank; display: inline-grid; place-items: center; width: 26px; height: 26px; margin-right: 10px;
  border-radius: 50%; background: var(--brand-gradient); color: #fff; font-weight: 700; font-size: 0.82rem;
}
.rank-buttons button { min-width: 44px; min-height: 40px; padding: 6px 12px; background: var(--surface); color: var(--text); border-color: var(--border); box-shadow: none; }
.rank-buttons button:hover { background: var(--surface-2); }
.rank-list.enhanced li[data-ranked="0"] button[data-move="up"],
.rank-list.enhanced li[data-ranked="0"] button[data-move="down"] { display: none; }

/* Session and admin */
.danger-zone { border-color: color-mix(in srgb, var(--disagree) 50%, var(--border)); }
.mod-row { border-top: 1px solid var(--border); padding: 16px 0; }
.mod-row textarea { margin-bottom: 4px; }
.mod-row .actions { margin-top: 12px; }
.proposed-tag { margin-top: 12px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); }
.proposed-tag .choice { border: 0; background: none; padding: 0; }
.proposed-tag input[type="text"] { width: min(100%, 360px); margin-top: 6px; }
table { border-collapse: collapse; width: 100%; font-size: 0.9rem; display: block; overflow-x: auto; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-weight: 650; color: var(--muted); font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.04em; }
.prose h1 { margin-top: 0.5rem; }
.prose h2 { margin-top: 1.6rem; }

/* Verification forms */
.form-stack { display: grid; gap: 8px; }
.form-stack label { font-weight: 550; margin-top: 8px; }
.form-stack input[type="email"], .form-stack input[type="text"] { width: 100%; }
.form-stack .note { margin: 0; font-size: 0.9rem; }
.form-stack button { justify-self: start; margin-top: 8px; }
.form-stack label.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.form-stack label.check input { margin-top: 4px; flex: none; }
.button-row { display: flex; flex-wrap: wrap; gap: 10px; }
.callout { background: var(--notice-bg); border-radius: var(--radius-sm); padding: 12px 16px; margin: 16px 0; }
.callout p { margin: 0 0 8px; }
.callout.error { background: var(--disagree-soft); color: var(--error); font-weight: 550; }
.callout.error ul { margin: 0; padding-left: 20px; }
.small-details { margin-top: 12px; font-size: 0.92rem; }
.small-details summary { cursor: pointer; color: var(--accent); }

/* Statement ratings: five buttons from orange (strongly disagree) through
   grey to blue (strongly agree), with text labels and no numbers. Stacked on phones, in one row on wider screens. */
.important-box { margin: 0 0 16px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-2); }
.rating-buttons { display: grid; grid-template-columns: 1fr; gap: 8px; }
@media (min-width: 720px) { .rating-buttons { grid-template-columns: repeat(5, 1fr); } }
.rating-buttons button.rating {
  display: flex; align-items: center; justify-content: center; text-align: center;
  min-height: 48px; padding: 10px 14px; line-height: 1.2;
  background: color-mix(in srgb, var(--rc) 8%, var(--surface)); color: var(--text); border: 2px solid var(--rc); box-shadow: none;
}
@media (min-width: 720px) { .rating-buttons button.rating { font-size: 0.92rem; } }
.rating.r1 { --rc: var(--disagree); }
.rating.r2 { --rc: color-mix(in srgb, var(--disagree) 55%, var(--border)); }
.rating.r3 { --rc: color-mix(in srgb, var(--muted) 70%, var(--border)); }
.rating.r4 { --rc: color-mix(in srgb, var(--agree) 55%, var(--border)); }
.rating.r5 { --rc: var(--agree); }
@media (hover: hover) { .rating-buttons button.rating:hover { background: color-mix(in srgb, var(--rc) 20%, var(--surface)); } }
.skip-row { margin: 12px 0 0; }
.skip-row button { width: 100%; }
@media (min-width: 720px) { .skip-row button { width: auto; } }
.table-scroll { overflow-x: auto; }

/* Pass page: the survey button stays inactive until the saved-link box is ticked. */
.saved-check { display: flex; gap: 10px; align-items: flex-start; margin: 18px 0 8px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--surface-2); font-weight: 550; }
.saved-check input { margin-top: 4px; flex: none; width: 18px; height: 18px; }
a.button[aria-disabled="true"] { opacity: 0.45; pointer-events: none; box-shadow: none; }

/* Statement feed: participation figures, the answer/answered switch,
   pinned statements, compact cards and each statement's vote breakdown. */
/* Participation figures on "My session". */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 16px 0; }
.stats div { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; display: flex; flex-direction: column; line-height: 1.25; }
.stats strong { font-size: 1.35rem; font-weight: 750; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stats div > span { font-size: 0.8rem; color: var(--muted); }
.stats .of { font-size: 0.9rem; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.view-switch { display: inline-flex; gap: 2px; padding: 4px; border-radius: 999px; background: var(--surface-2); margin: 4px 0 4px; }
.view-switch a { text-decoration: none; color: var(--muted); font-weight: 600; font-size: 0.9rem; padding: 6px 14px; border-radius: 999px; min-height: 36px; display: inline-flex; align-items: center; }
.view-switch a[aria-current] { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.feed { margin-top: 20px; }
.feed > h2 { margin-bottom: 0; }
.statement-card:has(.pinned-label) { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }

/* One statement at a time: a short reassurance that answering is optional,
   the current statement, and "Next statement" once it is answered. */
.deck { margin-top: 12px; }
.deck .feed-item { margin-top: 0; }
.deck-slot[hidden] { display: none; }
.deck-intro {
  margin: 14px 0 0; padding: 14px 16px; border-radius: var(--radius-sm);
  background: var(--accent-soft); color: var(--text);
}
.deck-intro-title { margin: 0 0 10px; font-size: 0.95rem; }
.deck-help { margin: 10px 0 0; color: var(--muted); font-size: 0.82rem; }
.deck-points { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 8px; }
.deck-points a { color: inherit; text-decoration: none; }
.deck-points a strong { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.deck-points li { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; font-size: 0.8rem; line-height: 1.25; color: var(--muted); }
.deck-points strong { color: var(--text); }
.deck-points .icon {
  width: 30px; height: 30px; padding: 6px; border-radius: 50%;
  background: var(--surface); color: var(--accent); box-sizing: border-box;
}
@media (min-width: 560px) {
  .deck-points { grid-template-columns: repeat(4, 1fr); }
  .deck-points li { flex-direction: row; align-items: center; text-align: left; gap: 10px; }
}
.deck-next { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin: 4px 0 24px; }
.deck-next[hidden] { display: none; }
.deck-next[aria-busy] .button { opacity: 0.7; }
.deck-next .button { flex: 1 1 220px; justify-content: center; text-align: center; }
.deck-break { font-size: 0.9rem; color: var(--muted); flex: 1 1 200px; text-align: center; padding: 4px 0; }
.deck-back { display: inline-flex; align-items: center; gap: 6px; margin: 0 0 8px; padding: 4px 2px; min-height: 36px; }
.deck-next .button { position: relative; overflow: hidden; }
.deck-next-label { position: relative; }
.deck-next-fill { position: absolute; inset: 0; background: rgba(255, 255, 255, 0.24); transform: scaleX(0); transform-origin: left; }
.deck-next.counting .deck-next-fill { animation: deck-fill var(--auto-seconds, 5s) linear forwards; }
@keyframes deck-fill { to { transform: scaleX(1); } }
@media (prefers-reduced-motion: reduce) { .deck-next.counting .deck-next-fill { animation: none; } }
.deck-auto { flex: 1 1 100%; margin: 0; text-align: center; color: var(--muted); }
.deck-auto button.link-button { min-height: 0; padding: 2px 4px; font-size: inherit; }
.deck-post { flex: 1 1 100%; margin: 16px 0 0; text-align: center; color: var(--muted); }
.author-label { display: flex; align-items: center; gap: 6px; margin: -6px 0 10px; font-size: 0.8rem; font-weight: 650; color: var(--muted); }
.author-label .icon { width: 16px; height: 16px; }
.composer { margin-top: 32px; }
.compose-lead { margin: -4px 0 10px; }

/* Things to try when ORCID sign-in fails. */
ol.tips { padding-left: 1.3em; display: grid; gap: 8px; margin: 8px 0 12px; }
.tips-details > summary { font-weight: 650; cursor: pointer; }
.card.tips-details > summary { color: var(--accent); }
.tips-card h2 { margin-top: 0; }
.tips-card .button-row { margin-top: 12px; }
.pinned-label { display: flex; align-items: center; gap: 6px; margin: -6px 0 10px; font-size: 0.8rem; font-weight: 650; color: var(--accent); }
.pinned-label .icon { width: 16px; height: 16px; }
.feed-item { scroll-margin-top: 16px; }
.feed-item blockquote { font-size: 1.22rem; margin: 10px 0 16px; }
.feed-item .important-box { margin-bottom: 12px; font-size: 0.92rem; }
.feed-item .rating-buttons { grid-template-columns: repeat(5, 1fr); gap: 6px; }
.feed-item .rating-buttons button.rating { min-height: 54px; padding: 6px 2px; font-size: 0.74rem; font-weight: 600; hyphens: auto; }
@media (min-width: 480px) { .feed-item .rating-buttons button.rating { font-size: 0.85rem; padding: 8px 6px; } }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 10px 0 0; font-size: 0.88rem; color: var(--muted); }
.vote-count { font-variant-numeric: tabular-nums; }
button.link-button { background: none; border: 0; box-shadow: none; color: var(--accent); font-weight: 600; padding: 8px 4px; min-height: 40px; font-size: 0.9rem; }
button.link-button:hover { background: none; text-decoration: underline; }
.feed-item.answered { background: color-mix(in srgb, var(--surface-2) 45%, var(--surface)); }
.feed-item.answered:focus { outline: none; }
.feed-item.answered:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); }
.your-answer { margin: 0 0 10px; font-size: 0.95rem; }
.breakdown { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.breakdown li { display: grid; grid-template-columns: 1em 8.2em 1fr 2.8em; align-items: center; gap: 8px; font-size: 0.86rem; }
.breakdown .b-mark { color: var(--accent); font-weight: 800; text-align: center; }
.breakdown .b-label { white-space: nowrap; }
.breakdown li.mine .b-label { font-weight: 700; }
.result-foot { margin: 12px 0 0; }
.breakdown .b-bar { width: 100%; height: 10px; display: block; }
.breakdown .b-track { fill: var(--surface-2); }
.breakdown .b-fill { fill: var(--rc); }
.breakdown .b-pct { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); }
.breakdown li.mine .b-pct { color: var(--text); font-weight: 700; }
.feed-more { text-align: center; margin: 20px 0; }
.feed-more .button[aria-busy] { opacity: 0.7; }

/* Context sentence some statements have, shown above the statement. */
.statement-context { margin: 10px 0 -6px; font-size: 0.9rem; color: var(--muted); font-style: italic; }

/* Ranking questions: a card with its own colour and label, so it does not
   look like a statement. With JavaScript, participants tap options in
   order and the rank menus are hidden; without it, they use the menus. */
.rk-card { border: 1.5px solid color-mix(in srgb, var(--accent) 55%, var(--border)); background: linear-gradient(180deg, var(--accent-soft) 0, var(--surface) 120px); }
.rk-card.answered { background: linear-gradient(180deg, color-mix(in srgb, var(--accent-soft) 70%, var(--surface)) 0, color-mix(in srgb, var(--surface-2) 45%, var(--surface)) 120px); }
.rk-label { display: inline-flex; font-size: 0.76rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--accent-strong); background: var(--surface); border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border)); border-radius: 999px; padding: 4px 10px; margin: 0 0 10px; }
.rk-card h3 { font-size: 1.15rem; line-height: 1.35; letter-spacing: -0.01em; margin: 4px 0 6px; }
.rk-card h4 { font-size: 0.98rem; margin: 14px 0 2px; }
.rk-how { color: var(--muted); font-size: 0.9rem; margin: 0 0 12px; }
.rk-tip { background: var(--notice-bg); border-radius: var(--radius-sm); padding: 8px 12px; font-size: 0.88rem; margin: 0 0 12px; }
.rk-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.rk-item { display: grid; grid-template-columns: 1fr auto auto auto; align-items: center; gap: 4px 6px; padding: 4px 8px 4px 4px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.rk-item.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 7%, var(--surface)); }
.rk-pick { display: flex; align-items: center; justify-content: flex-start; gap: 12px; width: 100%; min-height: 52px; padding: 8px; text-align: left; background: none; color: var(--text); border: 0; box-shadow: none; font-weight: 600; font-size: 0.95rem; line-height: 1.3; }
.rk-pick:hover { background: none; }
.rk-badge { flex: none; width: 32px; height: 32px; border-radius: 50%; border: 2px dashed var(--border); display: grid; place-items: center; font-weight: 800; color: var(--muted); }
.rk-item.on .rk-badge { border: 0; background: var(--accent); color: var(--accent-text); }
.rk-move { display: flex; flex-direction: column; gap: 4px; width: 32px; }
.rk-move button { width: 32px; min-height: 26px; padding: 0; font-size: 0.75rem; border-radius: 8px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); box-shadow: none; }
.rk-move button:hover { background: var(--accent-soft); color: var(--accent); }
.rk-i { width: 30px; height: 30px; min-height: 30px; padding: 0; border-radius: 50%; display: grid; place-items: center; font: italic 700 0.95rem/1 Georgia, serif; color: var(--accent); background: var(--accent-soft); border: 0; box-shadow: none; }
.rk-i:hover, .rk-i[aria-expanded="true"] { background: var(--accent); color: var(--accent-text); }
.rk-desc { grid-column: 1 / -1; margin: -4px 8px 8px 52px; font-size: 0.87rem; color: var(--muted); line-height: 1.4; }
.rk-desc a { font-weight: 600; white-space: nowrap; }
.js .rk-desc:not(.open) { display: none; }
html:not(.js) .rk-i { display: none; }
.rk-select { grid-column: 1 / -1; margin: 0 8px 8px 52px; }
.rk-select select { min-height: 40px; }
.rk-nojs { display: inline; }
.js .rk-nojs, .js .rk-select { display: none; }
html:not(.js) .rk-pick { pointer-events: none; }
html:not(.js) .rk-badge { display: none; }
.rk-foot { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 12px; margin-top: 12px; }
.rk-count { font-weight: 700; font-size: 0.92rem; font-variant-numeric: tabular-nums; }
.rk-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.rk-results { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 10px; }
.rk-results li { display: grid; grid-template-columns: 26px 1fr auto; gap: 4px 10px; align-items: center; }
.rk-pos { font-weight: 800; color: var(--muted); text-align: center; }
.rk-name { font-weight: 600; font-size: 0.93rem; line-height: 1.3; }
.rk-yours { font-size: 0.74rem; font-weight: 700; color: var(--accent-strong); background: var(--accent-soft); border-radius: 999px; padding: 2px 8px; margin-left: 6px; white-space: nowrap; }
.rk-pct { font-variant-numeric: tabular-nums; font-size: 0.88rem; color: var(--muted); }
.rk-score { font-weight: 700; color: var(--text); }
.rk-score .rk-of { font-weight: 500; color: var(--muted); }
.rk-bar { grid-column: 2 / 4; width: 100%; height: 8px; display: block; }
.rk-bar .b-track { fill: var(--surface-2); }
.rk-bar .b-fill { fill: var(--accent); }
.rk-results li.mine .b-fill { fill: var(--agree); }
.rk-legend { margin: 4px 0 0; }
.feed-end { text-align: center; }

/* Composer: a post box at the top of the feed, and a floating button that
   jumps to it from anywhere in the feed. */
.composer { scroll-margin-top: 80px; }
.composer h2 { margin-bottom: 10px; }
.compose-form textarea { width: 100%; resize: vertical; font-size: 1.08rem; line-height: 1.45; min-height: 3.4em; }
.compose-form.active textarea { min-height: 6em; }
.js .compose-form:not(.active) .compose-extra { display: none; }
.compose-extra .tag-picker { margin-top: 12px; }
.compose-extra .chip-option span { min-height: 34px; padding: 4px 12px; font-size: 0.85rem; }
.compose-extra .new-tag { font-size: 0.88rem; }
.compose-extra .tag-picker legend { font-size: 0.88rem; margin-bottom: 8px; }
.compose-extra .tag-picker legend .muted { font-weight: 500; }
@media (max-width: 719px) {
  /* One scrolling row of topics on phones, so the Post button stays close. */
  .tag-picker.compact .chip-options { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -4px; padding: 2px 4px 4px; }
  .tag-picker.compact .chip-options::-webkit-scrollbar { display: none; }
  .tag-picker.compact .chip-option { flex: none; }
}
.compose-extra .new-tag { margin-top: 10px; }
.compose-bar { display: flex; align-items: center; gap: 14px; margin-top: 12px; flex-wrap: wrap; }
.compose-help { flex: 1 1 100%; order: 3; font-size: 0.85rem; color: var(--muted); }
.compose-help summary { cursor: pointer; }
.compose-help p { margin: 6px 0 0; }
.compose-bar .char-count { margin-left: auto; }
.char-count { font-size: 0.85rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.char-count.near { color: var(--error); font-weight: 650; }
.post-button { border-radius: 999px; padding: 8px 26px; min-height: 42px; background: var(--brand-gradient); color: #fff; }
.post-button:hover { background: var(--brand-gradient); filter: brightness(1.08); }

/* Similar statements, shown straight under the post box. The list sits
   outside the post form (its vote forms cannot be nested in it), so the form
   lets its parts take part in the composer's layout and the list is placed
   between the text box and the rest. */
.composer:has(.similar:not([hidden])) { display: flex; flex-direction: column; }
.composer:has(.similar:not([hidden])) .compose-form { display: contents; }
.composer:has(.similar:not([hidden])) :is(.compose-extra, .compose-bar, .my-pending) { order: 2; }
.similar { order: 1; margin-top: 12px; padding: 12px; border-radius: var(--radius-sm); background: var(--accent-soft); }
.similar-head { margin: 0 0 10px; font-size: 0.9rem; }
.similar-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.similar-item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.similar-item summary {
  cursor: pointer; list-style: none; display: flex; align-items: center; gap: 12px; padding: 10px 12px; min-height: 44px;
}
.similar-item summary::-webkit-details-marker { display: none; }
.similar-text { flex: 1; font-size: 0.95rem; font-weight: 560; line-height: 1.35; }
.similar-action {
  flex: none; font-size: 0.82rem; font-weight: 650; color: var(--accent); border: 1px solid currentColor;
  border-radius: 999px; padding: 4px 12px;
}
.similar-item[open] .similar-action { display: none; }
.similar-item .feed-item { margin: 0; padding: 0 12px 12px; border: 0; box-shadow: none; background: none; }
.similar-item .feed-item blockquote { display: none; }
.my-pending ul { margin: 8px 0 0; padding-left: 20px; color: var(--muted); }
.fab {
  position: fixed; right: 16px; bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 16px); z-index: 30;
  display: inline-flex; align-items: center; gap: 8px; padding: 0 20px 0 16px; height: 54px; border-radius: 999px;
  background: var(--brand-gradient); color: #fff; font-weight: 680; text-decoration: none;
  box-shadow: 0 8px 24px -6px rgb(79 70 229 / 0.55), 0 2px 6px rgb(16 18 40 / 0.18);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.fab .icon { width: 22px; height: 22px; }
/* On phones the button is a round icon, so it covers less of the question
   and the "Next statement" bar below it. */
@media (max-width: 719px) {
  .fab { width: 54px; padding: 0; justify-content: center; }
  .fab span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
.fab.hidden { opacity: 0; transform: translateY(12px) scale(0.95); pointer-events: none; }
@media (min-width: 720px) { .fab { right: max(24px, calc((100vw - 780px) / 2 - 190px)); bottom: 28px; } }
@media (prefers-reduced-motion: reduce) { .fab { transition: none; } }
.results-pending { margin: 0; padding: 10px 14px; border-radius: var(--radius-sm); background: var(--surface-2); font-size: 0.92rem; color: var(--muted); }

/* Karma on the My session page */
.karma-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 4px; }
.karma-points { margin: 0; }
.karma-points strong { font-size: 2.6rem; font-weight: 800; letter-spacing: -0.03em; background: var(--brand-gradient); -webkit-background-clip: text; background-clip: text; color: transparent; font-variant-numeric: tabular-nums; }
.karma-points span { color: var(--muted); font-weight: 600; margin-left: 4px; }
.karma-level { margin: 0; font-weight: 700; padding: 4px 14px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); }
.karma .badges { margin: 10px 0 14px; }
.karma .badges .chip::before { content: "★ "; }
.karma-table td:nth-child(2), .karma-table td:nth-child(3) { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.karma-table td:nth-child(3) { font-weight: 700; }
.karma-table { display: table; }
.karma-rules { padding-left: 20px; margin: 0 0 12px; }
.karma-rules li { margin: 4px 0; }

/* Personal link: copy row and how to save it */
.copy-row { display: flex; gap: 8px; align-items: stretch; margin: 12px 0; }
.copy-row .pass-link { flex: 1 1 auto; min-width: 0; font-size: 16px; }
.copy-row button { flex: none; }
.save-more { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 8px; }
button:disabled { opacity: 0.45; cursor: not-allowed; box-shadow: none; }
.save-ways { display: grid; gap: 10px; margin: 18px 0; }
.save-ways .card { margin: 0; }
.save-way summary { cursor: pointer; display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 12px; min-height: 28px; }
.save-way summary .muted { font-size: 0.9rem; }
.save-way-title { font-weight: 650; }
.save-way ol { margin: 12px 0 0; padding-left: 1.3em; }
.save-way li { margin: 6px 0; }
.key {
  display: inline-block; min-width: 1.6em; padding: 0 6px; text-align: center; white-space: nowrap;
  border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 6px; background: var(--surface-2); font-size: 0.9em;
}
ul.who { padding-left: 1.2em; }
ul.who li { margin: 8px 0; }
details.card > summary { cursor: pointer; font-weight: 650; }
.share-icon { width: 1em; height: 1em; vertical-align: -0.15em; }

/* Frequently asked questions */
.faq-toc ul { padding-left: 1.2em; }
.faq-toc li { margin: 6px 0; }
.faq section { scroll-margin-top: 80px; }
.feed-help { margin-top: -4px; }
.answered-search { display: flex; gap: 8px; margin: 12px 0 4px; }
.answered-search input { flex: 1; min-width: 0; }
.answered-count:empty { display: none; }
[data-answered-list][aria-busy="true"] { opacity: 0.6; transition: opacity 0.2s; }

/* Select-all-that-apply questions: a statement card with a label, a tick
   box per option and "None of these" set apart below them. */
.sel-label { display: inline-flex; font-size: 0.76rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); background: var(--surface-2); border-radius: 999px; padding: 4px 10px; margin: 0 0 2px; }
.sel-card fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.sel-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.sel-option {
  display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px; cursor: pointer; font-size: 0.95rem; line-height: 1.35;
  border: 1px solid var(--border); border-radius: 12px; background: var(--surface); transition: border-color 0.15s ease, background-color 0.15s ease;
}
.sel-option:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); }
.sel-option:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.sel-option input { margin-top: 1px; flex: none; width: 20px; height: 20px; accent-color: var(--accent); }
.sel-none-item { margin-top: 6px; padding-top: 10px; border-top: 1px dashed var(--border); }
.sel-none { font-style: italic; }
.sel-card .card-foot { flex-wrap: wrap; }
.sel-results { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 10px; }
.sel-results li { display: grid; grid-template-columns: 1em 1fr auto; gap: 4px 10px; align-items: center; }
.sel-results .b-mark { color: var(--accent); font-weight: 800; text-align: center; }
.sel-results .rk-name { font-weight: 500; }
.sel-results li.mine .rk-name, .sel-results li.mine .rk-pct { font-weight: 700; color: var(--text); }
.sel-results li.mine .b-fill { fill: var(--agree); }
.sel-results .sel-none-row .rk-name { font-style: italic; }

/* Browsers without color-mix() (Safari before 16.2, Chrome before 111,
   Firefox before 113, for example older iPads stuck on iOS 15): plain
   colours instead, so that the rating buttons keep their borders and the
   header and tab bar stay opaque. */
@supports not (color: color-mix(in srgb, red 50%, blue)) {
  .site-header, .sticky-actions { background: var(--bg); }
  @media (max-width: 719px) { nav.tabs { background: var(--surface); } }
  .rating.r2 { --rc: var(--disagree); }
  .rating.r3 { --rc: var(--muted); }
  .rating.r4 { --rc: var(--agree); }
  .rating-buttons button.rating { background: var(--surface); }
  @media (hover: hover) { .rating-buttons button.rating:hover { background: var(--surface-2); } }
  .feed-item.answered { background: var(--surface-2); }
  .rk-card { border: 1.5px solid var(--accent); }
  .rk-card.answered { background: var(--surface-2); }
  .rk-item.on { background: var(--accent-soft); }
  .danger-zone { border-color: var(--disagree); }
}

/* Very narrow phones (320px wide, or larger text): the five rating buttons
   shrink to fit instead of running past the edge of the card. */
@media (max-width: 359px) {
  .feed-item .rating-buttons { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
  .feed-item.card { padding: 14px; }
  .feed-item .rating-buttons button.rating { font-size: 0.68rem; padding: 4px 1px; }
}

/* Results reports (src/survey/reports.js, src/lib/charts.js). Likert
   colours run from orange (disagree) through grey to blue (agree), the
   site's colour-blind-safe pair; opinion groups use the remaining
   Okabe-Ito colours, always with a letter and a marker shape too. */
:root {
  --lk-1: #b14f00; --lk-2: #f2a55f; --lk-3: #c9cbd3; --lk-4: #7ab4e3; --lk-5: #0b5fa5;
  --g-0: #009e73; --g-1: #cc79a7; --g-2: #56b4e9; --g-3: #e69f00; --g-4: #0072b2; --g-5: #d55e00;
}
@media (prefers-color-scheme: dark) {
  :root { --lk-1: #f08a2c; --lk-2: #94602f; --lk-3: #4a4e5c; --lk-4: #2f6694; --lk-5: #6db6ef; }
}
.lk-1 { fill: var(--lk-1); } .lk-2 { fill: var(--lk-2); } .lk-3 { fill: var(--lk-3); } .lk-4 { fill: var(--lk-4); } .lk-5 { fill: var(--lk-5); }
.lk-key-1 { --lk: var(--lk-1); } .lk-key-2 { --lk: var(--lk-2); } .lk-key-3 { --lk: var(--lk-3); } .lk-key-4 { --lk: var(--lk-4); } .lk-key-5 { --lk: var(--lk-5); }
.g-0 { fill: var(--g-0); --g: var(--g-0); } .g-1 { fill: var(--g-1); --g: var(--g-1); } .g-2 { fill: var(--g-2); --g: var(--g-2); }
.g-3 { fill: var(--g-3); --g: var(--g-3); } .g-4 { fill: var(--g-4); --g: var(--g-4); } .g-5 { fill: var(--g-5); --g: var(--g-5); }

.report table { display: table; }
.report h2 { margin-top: 0; }
.report-section { padding-top: 28px; scroll-margin-top: 12px; }
.report-section > h2 { font-size: 1.5rem; border-top: 3px solid var(--accent); padding-top: 16px; }
.report-head h1 { margin: 4px 0 6px; }
.report-kicker { text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.8rem; font-weight: 650; color: var(--accent); margin: 18px 0 0; }
.report-date { color: var(--muted); margin: 0 0 12px; }
.embargo { background: var(--disagree-soft); border-left: 4px solid var(--disagree); border-radius: var(--radius-sm); padding: 10px 14px; }
.callout.warn { background: var(--disagree-soft); }
.report-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 14px 0; }
.downloads { font-size: 0.92rem; }
.downloads summary { cursor: pointer; color: var(--accent); }
.downloads ul { margin: 6px 0 0; padding-left: 20px; columns: 2; }
.report-tabs { margin: 8px 0 0; border-bottom: 1px solid var(--border); }
.report-tabs .toc-title { display: none; }
.report-tabs ol { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0 0 10px; margin: 0; }
.report-tabs a { display: inline-block; padding: 6px 13px; border-radius: 999px; background: var(--surface-2); font-size: 0.9rem; font-weight: 600; text-decoration: none; color: var(--text); }
.report-tabs a:hover { background: var(--accent-soft); }
.report-tabs a[aria-current] { background: var(--accent); color: #fff; }
@media (prefers-color-scheme: dark) { .report-tabs a[aria-current] { color: #0e1016; } }
@media screen { .report-section.tab-off { display: none; } }
.subnav ul { display: flex; flex-wrap: wrap; gap: 4px 16px; list-style: none; padding: 0; margin: 4px 0 8px; font-size: 0.9rem; }
.report-section > h3 { font-size: 1.25rem; margin-top: 32px; scroll-margin-top: 12px; }
.methods-text { max-width: 78ch; }
.methods-text h3 { font-size: 1.12rem; margin: 26px 0 6px; }
.methods-text h3:first-child { margin-top: 8px; }
.tab-next { margin: 28px 0 0; text-align: right; font-weight: 650; }
.report-contact { margin: -6px 0 12px; font-size: 0.92rem; color: var(--muted); }
.key-findings { border-left: 4px solid var(--accent); }
.key-findings ul { margin: 6px 0 0; padding-left: 20px; display: grid; gap: 6px; }
.st-num { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 750; font-size: 0.8rem; margin-right: 6px; }
.st-note { margin: 4px 0 0; font-size: 0.86rem; font-weight: 650; }
.scatter { display: block; width: 100%; height: auto; }
.sc-grid { stroke: var(--border); }
.sc-dot { fill: var(--muted); fill-opacity: 0.45; }
.sc-dot:hover { fill: var(--text); fill-opacity: 1; }
.sc-hl circle { fill: var(--accent); }
.sc-hl text { fill: #fff; font-size: 11px; font-weight: 750; pointer-events: none; }
@media (prefers-color-scheme: dark) { .st-num, .sc-hl text { color: #0e1016; fill: #0e1016; } }
.st-card .author-label { margin: 6px 0 2px; }
.fig-foot { margin: 12px 0 0; font-size: 0.74rem; color: var(--muted); text-align: right; }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin: 12px 0; }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; display: flex; flex-direction: column; gap: 2px; box-shadow: var(--shadow); }
.tile-num { font-size: 2rem; font-weight: 750; letter-spacing: -0.02em; color: var(--accent); line-height: 1.1; }
.tile-label { font-weight: 650; }
.tile-sub { font-size: 0.84rem; color: var(--muted); }

.lk-bar { display: block; width: 100%; height: 18px; border-radius: 5px; overflow: hidden; margin: 10px 0 6px; }
.lk-legend { list-style: none; padding: 0; margin: 0 0 6px; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 0.8rem; color: var(--muted); }
.lk-legend strong { color: var(--text); font-weight: 650; }
.lk-swatch { display: inline-block; width: 10px; height: 10px; border-radius: 2px; background: var(--lk); margin-right: 5px; vertical-align: -1px; }
.tri-bar { display: block; width: 100%; height: 10px; border-radius: 3px; overflow: hidden; }
.h-bar { display: block; width: 100%; height: 9px; }
.h-bar .b-track { fill: var(--surface-2); }
.h-bar .b-fill, .h-bar .b-accent { fill: var(--accent); }
.h-bar .b-agree { fill: var(--agree); }
.h-bar .b-g-0 { fill: var(--g-0); } .h-bar .b-g-1 { fill: var(--g-1); } .h-bar .b-g-2 { fill: var(--g-2); }
.h-bar .b-g-3 { fill: var(--g-3); } .h-bar .b-g-4 { fill: var(--g-4); } .h-bar .b-g-5 { fill: var(--g-5); }

.g-chip { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.g-mark { width: 13px; height: 13px; flex: none; }

.st-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.st-card { min-width: 0; }
.st-list > .card { margin: 0; }
.st-card blockquote { margin: 8px 0 4px; font-size: 1.05rem; font-weight: 560; line-height: 1.45; }
.st-card.below { opacity: 0.62; }
.st-head { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.st-context { margin: 8px 0 0; }
.st-meta { font-size: 0.84rem; color: var(--muted); margin: 4px 0 0; }
.below-note { color: var(--muted); font-style: italic; margin: 6px 0 0; }
.grp-rows { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 6px; }
.grp-rows li { display: grid; grid-template-columns: minmax(90px, 0.9fr) 2fr minmax(150px, 1.2fr); gap: 10px; align-items: center; font-size: 0.84rem; }
.grp-rows li.hl { font-weight: 650; }
.grp-name { overflow: hidden; text-overflow: ellipsis; }
.grp-pct { white-space: nowrap; }
.c-agree { color: var(--agree); }
.c-disagree { color: var(--disagree); }

.group-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.group-cards > .card { margin: 0; border-top: 5px solid var(--g); }
.g-card-0 { --g: var(--g-0); } .g-card-1 { --g: var(--g-1); } .g-card-2 { --g: var(--g-2); } .g-card-3 { --g: var(--g-3); } .g-card-4 { --g: var(--g-4); } .g-card-5 { --g: var(--g-5); }
.group-card .group-name { display: flex; font-size: 1.05rem; gap: 8px; align-items: center; margin: 0 0 8px; }
.group-share { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; align-items: center; font-size: 0.86rem; color: var(--muted); }
.characteristics p { margin: 8px 0; }
.distinct { padding-left: 0; list-style: none; display: grid; gap: 8px; font-size: 0.92rem; }
.dir-agree, .dir-disagree { display: inline-block; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; padding: 1px 7px; border-radius: 999px; margin-right: 4px; }
.dir-agree { background: var(--agree-soft); color: var(--agree); }
.dir-disagree { background: var(--disagree-soft); color: var(--disagree); }
.group-top summary { cursor: pointer; font-weight: 650; }
.group-top .st-list { margin-top: 12px; }

.op-map { display: block; width: 100%; height: auto; }
.map-bg { fill: var(--surface-2); }
.map-axis { stroke: var(--border); stroke-width: 1; }
.map-dots > * { fill-opacity: 0.8; }
.map-st path { stroke: var(--muted); stroke-width: 1.2; opacity: 0.55; }
.map-st:hover path { stroke: var(--text); opacity: 1; stroke-width: 2; }
.map-label circle { fill: var(--surface); stroke: var(--text); stroke-width: 1.5; }
.map-label text { font-weight: 750; font-size: 14px; fill: var(--text); }
.map-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 0.9rem; margin: 10px 0; }
.map-key-st { color: var(--muted); }
.map-hit { fill: transparent; cursor: pointer; }
.map-st { cursor: pointer; outline: none; }
.map-st.on path, .map-st:focus-visible path { stroke: var(--accent); opacity: 1; stroke-width: 3; }
.map-pick { min-height: 1.5em; margin: 6px 0 10px; padding: 8px 12px; border-left: 3px solid var(--accent); background: var(--surface-2); font-size: 0.95rem; }
.map-pick[hidden] { display: none; }

:root { --k-contested: #3f4250; }
@media (prefers-color-scheme: dark) { :root { --k-contested: #e2e4ec; } }
.kind-legend { list-style: none; padding: 0; margin: 8px 0 12px; display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 0.9rem; }
.kind-legend li { display: inline-flex; align-items: center; gap: 6px; }
.kind-swatch { display: inline-block; width: 12px; height: 12px; border-radius: 2px; flex: none; }
span.kind-swatch.k-agree { background: var(--lk-5); } span.kind-swatch.k-reject { background: var(--lk-1); }
span.kind-swatch.k-contested { background: var(--k-contested); } span.kind-swatch.k-mixed { background: var(--lk-3); }
rect.k-agree { fill: var(--lk-5); } rect.k-reject { fill: var(--lk-1); } rect.k-contested { fill: var(--k-contested); } rect.k-mixed { fill: var(--lk-3); }
.kind-rows { list-style: none; padding: 0; margin: 8px 0; display: grid; gap: 8px; }
.kind-rows li { display: grid; grid-template-columns: minmax(120px, 1.2fr) 2fr minmax(150px, auto); gap: 10px; align-items: center; font-size: 0.9rem; }
.kind-bar svg { display: block; width: 100%; height: 16px; border-radius: 3px; }
.kind-nums { white-space: nowrap; font-size: 0.85rem; display: flex; gap: 8px; justify-content: flex-end; }
.kind-num { display: inline-flex; align-items: center; gap: 3px; }
@media (max-width: 600px) {
  .kind-rows li { grid-template-columns: 1fr; gap: 3px; }
  .kind-nums { justify-content: flex-start; }
}

.hist { display: block; width: 100%; height: auto; }
.hist-bar { fill: var(--accent); }
.chart-num { font-size: 12px; font-weight: 650; fill: var(--text); }
.chart-label { font-size: 11px; fill: var(--muted); }
.chart-name { font-size: 12px; fill: var(--text); }

.hbar-list, .rank-list { list-style: none; padding: 0; margin: 8px 0; display: grid; gap: 8px; }
.hbar-list li, .rank-list li { display: grid; grid-template-columns: minmax(130px, 1.3fr) 2fr minmax(90px, auto); gap: 10px; align-items: center; font-size: 0.9rem; }
.rank-list li { grid-template-columns: 26px minmax(130px, 1.3fr) 1.6fr minmax(140px, auto); }
.hb-num { white-space: nowrap; text-align: right; }
.hb-hidden { grid-column: 2 / 4; }
.sel-table td.bar-cell { min-width: 160px; }
.pct-num { display: inline-block; min-width: 3em; font-weight: 650; }
.sel-table .bar-cell .h-bar { display: inline-block; width: calc(100% - 3.5em); vertical-align: middle; }
td.num, th.num { text-align: right; white-space: nowrap; }
.checks tr.chosen td { font-weight: 650; background: var(--accent-soft); }
.demo-table th:not(:first-child) { text-align: right; }
.demo-table td.over { background: var(--accent-soft); font-weight: 650; }
.demo-table td.under { background: var(--surface-2); font-weight: 650; }
.flag { font-size: 0.75rem; }
.flag.over { color: var(--accent); }
.flag.under { color: var(--muted); }
.hidden-cell { color: var(--muted); }

.report-filter { position: sticky; top: 0; z-index: 2; display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; background: var(--bg); padding: 10px 0; }
.report-filter[hidden] { display: none; }
.rf-search { flex: 1 1 240px; }
.rf-search input { width: 100%; }
.rf-count { margin: 0; flex-basis: 100%; }

.report-admin fieldset { border: 1px solid var(--border); border-radius: var(--radius-sm); margin: 12px 0; padding: 12px 14px; }
.report-admin label { display: block; margin: 8px 0; font-weight: 600; }
.report-admin input[type=text], .report-admin textarea { width: 100%; font-weight: 400; }
.report-admin .choice { font-weight: 400; }
.status-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 16px; }
.status-form p { flex-basis: 100%; margin: 0; }
.report-settings label { display: block; margin: 10px 0; }
.report-settings input[type=number] { width: 5.5em; }
.pre { white-space: pre-line; }
form.inline { display: inline; }
.report-list { list-style: none; padding: 0; }
.report-list .card { margin: 10px 0; }

@media (max-width: 640px) {
  .grp-rows li { grid-template-columns: 1fr; gap: 3px; }
  .hbar-list li { grid-template-columns: 1fr auto; }
  .hbar-list li .h-bar { grid-column: 1 / 3; grid-row: 2; }
  .rank-list li { grid-template-columns: 26px 1fr auto; }
  .rank-list li .h-bar { grid-column: 2 / 4; grid-row: 2; }
  .tile-num { font-size: 1.6rem; }
}

body.standalone { padding: 0 16px; }
@page { size: A4; margin: 14mm 13mm; }
@media print {
  .no-print, .site-header, .site-footer, .cookie-banner, .announcement, .report-filter, .skip { display: none !important; }
  body { background: #fff; font-size: 9.5pt; }
  .wrap { max-width: none; padding: 0; }
  .card, .tile { box-shadow: none; break-inside: avoid; }
  .long-card { break-inside: auto; }
  .report-section { break-before: page; padding-top: 0; }
  #overview { break-before: auto; }
  /* Each subsection of a tab starts a page, unless it opens the tab. */
  .report-section > h3 { break-before: page; margin-top: 0; }
  .report-section > h2 + h3, .report-section > h2 + .lead + h3, .report-section > .subnav + h3 { break-before: auto; }
  /* Keep headings and their introductions with what follows. */
  h2, h3, h4, h5, .report-section > h3 + p, .report-section > h4 + p, .lead { break-after: avoid; }
  .card h3, .card h4 { break-after: avoid; }
  .card li, .demo-table tr, .checks tr { break-inside: avoid; }
  .st-list { display: block; }
  .st-list > .card { margin: 0 0 8px; }
  .op-map { max-height: 16cm; width: auto; max-width: 100%; margin: 0 auto; }
  .group-cards { display: block; }
  .group-cards > .card { margin: 0 0 10px; }
  .tiles { grid-template-columns: repeat(3, 1fr); }
  .hist { max-height: 4.2cm; width: auto; max-width: 100%; }
  /* Compact statement cards, so a page holds five without group rows and
     three with them. */
  .card { padding: 10px 14px; margin: 0 0 8px; }
  .st-card blockquote { margin: 4px 0 6px; }
  .st-card .st-head, .st-card .author-label { margin: 0 0 2px; }
  .st-meta { margin: 2px 0 0; }
  .grp-rows { margin: 6px 0 0; gap: 2px; }
  .fig-foot { margin-top: 4px; }
  /* The report's date and size are on the first page; repeating them under
     every statement would push cards onto the next page. */
  .st-card .fig-foot { display: none; }
  .tile { padding: 8px 12px; }
  .tile-num { font-size: 1.5rem; }
  .tiles { gap: 8px; margin: 8px 0; }
  .table-scroll { overflow: visible; }
  .keep-together { break-inside: avoid; }
  .rank-list { break-inside: avoid; }
  .rank-groups tr { break-inside: avoid; }
  .rank-card .fig-foot { break-before: avoid; }
  .lk-legend { font-size: 0.75rem; margin-bottom: 2px; }
  .report-section > h3 + p { margin-bottom: 6px; }
  .st-card.below { opacity: 1; }
  .report-tabs { border: 0; break-after: page; }
  .report-tabs .toc-title { display: block; font-size: 1.3rem; border: 0; }
  .report-tabs ol { display: block; list-style: decimal; padding-left: 24px; }
  .report-tabs li { margin: 4px 0; }
  .report-tabs a, .report-tabs a[aria-current] { display: inline; padding: 0; background: none; font-size: 1rem; font-weight: 400; color: inherit; }
  .st-card.below { opacity: 1; }
}
