/*
 * RSA Guides — colour bands. Phone first: every section is a full-width
 * band, and each guide owns a colour (SASSA green, K53 road-sign yellow,
 * UIF blue, Sports red). Archivo for headings, Atkinson Hyperlegible (built
 * for low-vision readers) for everything else, JetBrains Mono for labels.
 * Taps are at least 48px.
 */

:root {
    --ink: #0c1715;
    --ink-2: #4a5856;
    --ink-3: #5b6866;
    --rule: #e1e7e6;
    --rule-2: #dde4e3;
    --field: #0c1715;
    --surface: #ffffff;
    --ground: #f3f6f6;
    --night: #0c1715;
    --night-2: #1b2a27;
    --night-rule: #2a3735;
    --night-text: #c3cecb;

    --sassa: #087f5b;
    --sassa-ink: #04402e;
    --sassa-on: #e3f7ee;
    --sassa-soft: #c9f0de;
    --sassa-wash: #e7f4ee;
    --sassa-line: #cfe6da;

    --k53: #f2b705;
    --k53-ink: #1a1400;
    --k53-deep: #3a2e00;
    --k53-text: #5c5233;
    --k53-link: #6b5200;
    --k53-wash: #fff6d6;
    --k53-cream: #fffbea;
    --k53-line: #efe1a8;
    --k53-edge: #e9d78f;

    --uif: #1d5bd6;
    --uif-ink: #0f3a8f;
    --uif-on: #e2ebfc;
    --uif-soft: #dbe6fc;
    --uif-wash: #e6eefc;
    --uif-line: #c9d8f6;

    --sport: #d23a2c;
    --sport-ink: #7a1810;
    --sport-link: #b02a1e;
    --sport-on: #fde3e0;
    --sport-wash: #fce9e7;
    --sport-line: #f4cdc8;

    --warn-wash: #fff6d6;
    --warn-ink: #3a2e00;
    --bad: #d23a2c;
    --bad-ink: #7a1810;
    --bad-wash: #fce9e7;

    /* The section theme. body[data-section] swaps these. */
    --band: var(--night);
    --band-text: #fff;
    --band-muted: var(--night-text);
    --band-soft: var(--night-text);
    --wash: var(--ground);
    --line: var(--rule-2);
    --accent: var(--sassa);
    --accent-ink: var(--sassa-ink);
    --heading: var(--ink);
    --btn: var(--sassa);
    --btn-text: #fff;

    /* Older names still used across templates. */
    --accent-wash: var(--sassa-wash);
    --good: var(--sassa);
    --good-wash: var(--sassa-wash);
    --gold: var(--k53);
    --gold-wash: var(--k53-wash);
    --gold-ink: var(--k53-deep);
    --blue: var(--uif);
    --blue-wash: var(--uif-wash);
    --surface-2: var(--ground);
    --rule-soft: var(--rule);

    --font-body: "Atkinson Hyperlegible", system-ui, sans-serif;
    --font-display: "Archivo", system-ui, sans-serif;
    --font-mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
    --radius: 12px;
    --radius-sm: 10px;
    --wrap: 720px;
}

body[data-section="sassa"] {
    --band: var(--sassa); --band-muted: var(--sassa-on); --band-soft: var(--sassa-soft);
    --wash: var(--sassa-wash); --line: var(--sassa-line);
    --accent: var(--sassa); --accent-ink: var(--sassa-ink); --heading: var(--sassa-ink);
    --btn: var(--sassa); --btn-text: #fff;
}

body[data-section="k53"] {
    --band: var(--k53); --band-text: var(--k53-ink); --band-muted: var(--k53-ink); --band-soft: var(--k53-ink);
    --wash: var(--k53-wash); --line: var(--k53-line);
    --accent: var(--k53-link); --accent-ink: var(--k53-ink); --heading: var(--k53-deep);
    --btn: var(--k53-ink); --btn-text: var(--k53);
}

body[data-section="uif"] {
    --band: var(--uif); --band-muted: var(--uif-on); --band-soft: var(--uif-soft);
    --wash: var(--uif-wash); --line: var(--uif-line);
    --accent: var(--uif); --accent-ink: var(--uif-ink); --heading: var(--uif-ink);
    --btn: var(--uif); --btn-text: #fff;
}

body[data-section="sport"] {
    --band: var(--sport); --band-muted: var(--sport-on); --band-soft: var(--sport-on);
    --wash: var(--sport-wash); --line: var(--sport-line);
    --accent: var(--sport-link); --accent-ink: var(--sport-ink); --heading: var(--sport-ink);
    --btn: var(--sport); --btn-text: #fff;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--surface);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.5;
}

a { color: var(--accent); }
a:hover { color: var(--accent-ink); }

h1, h2, h3 {
    font-family: var(--font-display);
    letter-spacing: -0.01em;
    line-height: 1.15;
    text-wrap: balance;
}

h1 {
    font-size: clamp(1.75rem, 1.3rem + 2vw, 2.4rem);
    font-weight: 900;
    letter-spacing: -0.02em;
    line-height: 1.08;
    margin: 0 0 10px;
}

h2 { font-size: 1.3rem; font-weight: 800; margin: 1.75rem 0 0.75rem; line-height: 1.2; }
h3 { font-size: 1.1rem; font-weight: 800; }

img { max-width: 100%; }

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

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.wrap {
    max-width: var(--wrap);
    margin: 0 auto;
    padding: 0 16px;
}

.mono-label {
    font: 700 0.8125rem/1.2 var(--font-mono);
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

/* ---- site chrome ---- */

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: var(--night);
    color: #fff;
}

.site-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 64px;
    padding-top: 10px;
    padding-bottom: 10px;
}

.site-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    color: #fff;
    text-decoration: none;
    font: 900 1.1875rem/1 var(--font-display);
}

.site-logo:hover { color: #fff; }

.logo-bars { display: flex; gap: 2px; }
.logo-bars span { width: 6px; height: 20px; }
.logo-bars span:nth-child(1) { background: var(--sassa); }
.logo-bars span:nth-child(2) { background: var(--k53); }
.logo-bars span:nth-child(3) { background: var(--uif); }
.logo-bars span:nth-child(4) { background: var(--sport); }

.header-actions { display: flex; align-items: center; gap: 8px; }

.header-pop > summary,
.install-app {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-height: 44px;
    padding: 0 12px;
    border-radius: 8px;
    font: 700 0.875rem/1 var(--font-body);
    cursor: pointer;
    user-select: none;
}

.header-pop > summary { list-style: none; }
.header-pop > summary::-webkit-details-marker { display: none; }

.header-pop-outline > summary,
.install-app {
    background: none;
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    padding: 0 10px;
}

.header-pop-solid > summary { background: #fff; color: var(--ink); border: 0; }

.header-pop .when-open { display: none; }
.header-pop[open] .when-open { display: inline; }
.header-pop[open] .when-closed { display: none; }

.header-panel {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    background: var(--night);
    border-top: 1px solid var(--night-rule);
    box-shadow: 0 16px 24px rgba(12, 23, 21, 0.25);
}

.header-panel .wrap { padding-top: 12px; padding-bottom: 18px; }

.menu-links { display: flex; flex-direction: column; gap: 8px; }

.menu-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 56px;
    padding: 0 16px;
    border-radius: var(--radius-sm);
    color: #fff;
    text-decoration: none;
    font: 800 1.125rem/1.2 var(--font-display);
}

.menu-link:hover { color: #fff; filter: brightness(1.08); }
.menu-link-sassa { background: var(--sassa); }
.menu-link-k53 { background: var(--k53); color: var(--k53-ink); }
.menu-link-k53:hover { color: var(--k53-ink); }
.menu-link-uif { background: var(--uif); }
.menu-link-sport { background: var(--sport); }
.menu-link[aria-current="page"]::after { content: "•"; font-size: 1.5rem; }

.menu-extra {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 18px;
    margin-top: 14px;
    font-weight: 700;
}

.menu-extra a { color: #fff; min-height: 44px; display: inline-flex; align-items: center; }

.lang-links { display: flex; flex-wrap: wrap; gap: 8px; }

.lang-link {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 14px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    text-decoration: none;
    font-weight: 700;
}

.lang-link:hover { color: #fff; background: rgba(255, 255, 255, 0.18); }
.lang-link[aria-current="true"] { background: #fff; color: var(--ink); }

.site-main { display: block; min-height: 50vh; }

.page-body { padding-top: 24px; padding-bottom: 40px; }

.site-footer {
    background: var(--night);
    color: var(--night-text);
    font-size: 0.875rem;
    line-height: 1.5;
}

.site-footer .wrap { padding-top: 22px; padding-bottom: 28px; }

.footer-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 16px;
    margin-bottom: 16px;
}

.footer-nav a { color: #fff; }
.footer-nav a:hover { color: var(--sassa-soft); }

.footer-note {
    margin: 0 0 10px;
    padding-top: 14px;
    border-top: 1px solid var(--night-rule);
}

.footer-copy { margin: 0; font: 500 0.75rem var(--font-mono); color: #8b9997; }

/* ---- bands ---- */

.band { padding: 24px 0; }
.band > .wrap > :first-child { margin-top: 0; }
.band > .wrap > :last-child { margin-bottom: 0; }

.band-color { background: var(--band); color: var(--band-text); }
.band-color a:not([class]) { color: var(--band-text); }
.band-wash { background: var(--wash); border-top: 1px solid var(--line); }
.band-white { background: var(--surface); }
.band-ground { background: var(--ground); }
.band-night { background: var(--night); color: #fff; }

.band-sassa { --band: var(--sassa); --band-text: #fff; --band-muted: var(--sassa-on); --band-soft: var(--sassa-soft); --wash: var(--sassa-wash); --line: var(--sassa-line); --accent: var(--sassa); --accent-ink: var(--sassa-ink); --heading: var(--sassa-ink); --btn: var(--sassa); --btn-text: #fff; }
.band-k53 { --band: var(--k53); --band-text: var(--k53-ink); --band-muted: var(--k53-ink); --band-soft: var(--k53-ink); --wash: var(--k53-wash); --line: var(--k53-line); --accent: var(--k53-link); --accent-ink: var(--k53-ink); --heading: var(--k53-deep); --btn: var(--k53-ink); --btn-text: var(--k53); }
.band-uif { --band: var(--uif); --band-text: #fff; --band-muted: var(--uif-on); --band-soft: var(--uif-soft); --wash: var(--uif-wash); --line: var(--uif-line); --accent: var(--uif); --accent-ink: var(--uif-ink); --heading: var(--uif-ink); --btn: var(--uif); --btn-text: #fff; }
.band-sport { --band: var(--sport); --band-text: #fff; --band-muted: var(--sport-on); --band-soft: var(--sport-on); --wash: var(--sport-wash); --line: var(--sport-line); --accent: var(--sport-link); --accent-ink: var(--sport-ink); --heading: var(--sport-ink); --btn: var(--sport); --btn-text: #fff; }

/* The coloured head every inner page opens with. */
.band-head { background: var(--band); color: var(--band-text); padding: 22px 0 24px; }
.band-head h1 { margin: 0 0 8px; }
.band-head .lede, .band-head p { color: var(--band-muted); }
.band-head a:not([class]) { color: var(--band-text); }
.band-head .eyebrow { color: var(--band-soft); }
.band-head > .wrap > :last-child { margin-bottom: 0; }

.band-hero h1 { font-size: clamp(2rem, 1.6rem + 2vw, 2.6rem); }
.band-hero .lede { margin-bottom: 18px; }

.band-stripe { height: 6px; background: var(--band); }

.lede { font-size: 1.0625rem; line-height: 1.5; color: var(--ink-2); max-width: 60ch; margin: 0 0 1.25rem; }

.band-title { margin: 0 0 14px; font: 800 1.3125rem/1.2 var(--font-display); }
.band-sub { margin: -10px 0 12px; font-size: 0.9375rem; color: var(--ink-2); }

.sec-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.sec-head h2 { margin: 0; font: 900 1.375rem/1.1 var(--font-display); color: var(--heading); }
.sec-head a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 700; color: var(--accent); }

/* ---- breadcrumbs ---- */

.breadcrumbs ol {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin: 0 0 10px;
    padding: 0;
    list-style: none;
    font-size: 0.875rem;
    font-weight: 700;
}

.breadcrumbs li + li::before { content: "/"; margin-right: 0.25rem; opacity: 0.7; }
.breadcrumbs [aria-current="page"] { opacity: 0.85; }
.band-head .breadcrumbs { color: var(--band-soft); }
.band-head .breadcrumbs a { color: inherit; }

/* ---- cards, buttons, links ---- */

.card {
    background: var(--surface);
    color: var(--ink);
    border-radius: var(--radius);
    padding: 16px;
}

.card a:not([class]) { color: var(--accent); }

.card-eyebrow {
    display: block;
    margin: 0 0 8px;
    font: 700 0.8125rem/1.2 var(--font-mono);
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--accent);
}

.card-big { margin: 0 0 6px; font: 900 1.75rem/1.05 var(--font-display); letter-spacing: -0.01em; }
.card-sub { margin: 0 0 14px; font-size: 0.9375rem; color: var(--ink-2); }
.card > :last-child { margin-bottom: 0; }

.card-solid { background: var(--band); color: var(--band-text); }
.card-solid .card-eyebrow { color: var(--band-soft); }

.btn, .button-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 50px;
    padding: 0 20px;
    border: 0;
    border-radius: var(--radius-sm);
    background: var(--btn);
    color: var(--btn-text);
    text-decoration: none;
    font: 700 1rem/1.2 var(--font-body);
    text-align: center;
    cursor: pointer;
}

.btn:hover, .button-link:hover { color: var(--btn-text); filter: brightness(1.1); }

.btn-block { display: flex; width: 100%; }

.btn-outline, .button-outline {
    background: transparent;
    color: var(--accent);
    border: 2px solid currentColor;
}

.btn-outline:hover, .button-outline:hover { color: var(--accent-ink); filter: none; background: var(--wash); }

.btn-on-band { background: transparent; color: var(--band-text); border: 2px solid var(--band-text); }
.btn-on-band:hover { color: var(--band-text); background: rgba(255, 255, 255, 0.1); }

.button-dark { background: var(--ink); color: #fff; }
.button-dark:hover { color: #fff; }

.button-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 1rem 0; }

.link-cards { display: flex; flex-direction: column; gap: 8px; }

.link-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 54px;
    padding: 12px 16px;
    background: var(--surface);
    border-radius: var(--radius-sm);
    color: var(--ink);
    text-decoration: none;
    font: 700 1rem/1.3 var(--font-body);
}

.link-card::after { content: "→"; color: var(--accent); flex: none; }
.link-card:hover { color: var(--ink); box-shadow: inset 0 0 0 2px var(--accent); }
.link-card-solid { background: var(--btn); color: var(--btn-text); }
.link-card-solid::after { color: inherit; }
.link-card-solid:hover { color: var(--btn-text); box-shadow: none; filter: brightness(1.1); }
.link-card-bordered { border: 1px solid var(--line); }

.link-card small {
    display: block;
    margin-top: 4px;
    font-weight: 400;
    font-size: 0.875rem;
    color: var(--ink-2);
}

.text-link { display: inline-flex; align-items: center; min-height: 44px; margin-top: 4px; font-weight: 700; color: var(--accent); }

.todo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.todo-tile {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 8px;
    min-height: 92px;
    padding: 14px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: var(--ink);
    text-decoration: none;
    font: 700 1rem/1.3 var(--font-body);
}

.todo-tile::after { content: "→"; color: var(--accent); }
.todo-tile:hover { color: var(--ink); border-color: var(--accent); }

.amount-table {
    display: grid;
    grid-template-columns: 1fr auto;
    margin: 0;
    border-bottom: 1px solid var(--rule);
}

.amount-table dt, .amount-table dd { margin: 0; padding: 13px 0; border-top: 1px solid var(--rule); }
.amount-table dd { font: 700 1rem var(--font-mono); text-align: right; padding-left: 12px; }
.amount-table dt small { display: block; color: var(--ink-2); font-size: 0.875rem; }

.step-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 14px;
    counter-reset: step;
}

.step-list li {
    display: grid;
    grid-template-columns: 36px 1fr;
    gap: 12px;
    align-items: start;
    line-height: 1.5;
    counter-increment: step;
}

.step-list li::before {
    content: counter(step);
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent-ink);
    color: #fff;
    font: 800 0.9375rem/1 var(--font-display);
}

body[data-section="uif"] .step-list li::before, .band-uif .step-list li::before { background: var(--uif); }
.step-list li > span { padding-top: 6px; }

.check-list { margin: 0; padding: 0; list-style: none; border-bottom: 1px solid var(--rule); }

.check-list li {
    display: flex;
    gap: 12px;
    align-items: center;
    min-height: 50px;
    padding: 10px 0;
    border-top: 1px solid var(--rule);
    line-height: 1.4;
}

.check-list li::before {
    content: "";
    flex: none;
    width: 24px;
    height: 24px;
    border: 2px solid var(--accent);
    border-radius: 6px;
}

body[data-section="k53"] .check-list li::before { border-color: var(--k53-ink); }

.feature-card { display: flex; gap: 14px; align-items: flex-start; }
.feature-icon {
    flex: none;
    display: grid;
    place-items: center;
    width: 56px;
    height: 56px;
    border-radius: var(--radius);
    background: var(--wash);
    color: var(--accent-ink);
}

.feature-card h2 { margin: 0 0 6px; font-size: 1.3125rem; }
.feature-card p { margin: 0 0 4px; color: var(--ink-2); }

/* ---- home ---- */

.home-intro { background: var(--night); color: #fff; padding: 22px 0 20px; }
.home-intro h1 { margin: 0 0 18px; font-size: clamp(1.875rem, 1.5rem + 2vw, 2.5rem); }

.tile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.home-tile {
    aspect-ratio: 1 / 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 14px;
    border-radius: 14px;
    color: #fff;
    text-decoration: none;
}

.home-tile:hover { color: #fff; filter: brightness(1.08); }
.home-tile-eyebrow { font: 500 0.75rem var(--font-mono); letter-spacing: 0.04em; text-transform: uppercase; opacity: 0.9; }
.home-tile-name { font: 900 1.375rem/1.05 var(--font-display); }
.home-tile-sassa { background: var(--sassa); }
.home-tile-k53 { background: var(--k53); color: var(--k53-ink); }
.home-tile-k53:hover { color: var(--k53-ink); }
.home-tile-uif { background: var(--uif); }
.home-tile-sport { background: var(--sport); }

.home-band { padding: 22px 0; background: var(--wash); }

.quiz-promo {
    display: grid;
    grid-template-columns: 96px 1fr;
    gap: 12px;
    align-items: center;
    margin-bottom: 8px;
    padding: 10px;
    background: var(--surface);
    border-radius: var(--radius);
    color: var(--ink);
    text-decoration: none;
}

.quiz-promo:hover { color: var(--ink); box-shadow: inset 0 0 0 2px var(--k53-edge); }

.quiz-promo-thumb {
    display: grid;
    place-items: center;
    height: 96px;
    border-radius: 8px;
    background: var(--k53-cream);
    padding: 8px;
}

.quiz-promo-thumb img { max-height: 80px; width: auto; }
.quiz-promo strong { display: block; margin-bottom: 6px; font-size: 1rem; line-height: 1.3; }
.quiz-promo span span { font-size: 0.875rem; color: var(--k53-text); }

.match-card {
    display: block;
    padding: 14px 16px;
    background: var(--surface);
    border-radius: var(--radius);
    color: var(--ink);
    text-decoration: none;
}

.match-card:hover { color: var(--ink); box-shadow: inset 0 0 0 2px var(--sport-line); }
.match-card-meta { display: block; margin-bottom: 8px; font: 500 0.75rem var(--font-mono); color: var(--ink-2); text-transform: uppercase; }
.match-card-teams { display: block; font: 700 1rem/1.5 var(--font-body); }
.match-card .chance { margin-top: 10px; }

/* ---- K53 hub ---- */

.stage-bar { display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; margin: 0 0 14px; }
.stage-bar span { height: 8px; border-radius: 4px; background: #ece3c2; }
.stage-bar span:first-child { background: var(--k53); }

.test-cards { display: flex; flex-direction: column; gap: 10px; }

.test-card {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 12px;
    min-height: 72px;
    padding: 12px 16px;
    border: 2px solid var(--k53-edge);
    border-radius: var(--radius);
    background: var(--k53-cream);
    color: var(--ink);
    text-decoration: none;
}

.test-card:hover { color: var(--ink); border-color: var(--k53-ink); }
.test-card::after { content: "→"; font: 800 1.125rem var(--font-display); }
.test-card strong { display: block; margin-bottom: 4px; font-size: 1.0625rem; }
.test-card span span, .test-card-text small { font-size: 0.875rem; color: var(--k53-text); }

.test-card-dark { display: block; border: 0; background: var(--k53-ink); color: #fff; }
.test-card-dark::after { content: none; }
.test-card-dark strong { color: var(--k53); }
.test-card-dark p { margin: 0 0 12px; font-size: 0.875rem; color: #d9d0b0; }
.test-card-dark label { display: block; margin-bottom: 6px; font-weight: 700; font-size: 0.9375rem; }
.test-card-dark select { width: 100%; margin-bottom: 10px; }
.test-card-dark .btn { background: var(--k53); color: var(--k53-ink); }

.sign-type-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.sign-type-tile {
    display: block;
    padding: 10px;
    background: var(--surface);
    border-radius: var(--radius);
    color: var(--ink);
    text-decoration: none;
    font-weight: 700;
}

.sign-type-tile:hover { color: var(--ink); box-shadow: inset 0 0 0 2px var(--k53-edge); }

.sign-type-thumb {
    display: grid;
    place-items: center;
    height: 80px;
    margin-bottom: 8px;
    border-radius: 8px;
    background: var(--k53-cream);
    padding: 8px;
}

.sign-type-thumb img { max-height: 64px; width: auto; }

/* ---- articles ---- */

.article-head { padding: 20px 0 18px; }
.article-head h1 { font-size: clamp(1.75rem, 1.4rem + 1.6vw, 2.2rem); line-height: 1.12; }
.article-head .breadcrumbs { color: var(--ink-2); font-weight: 400; }
.article-meta { margin: 0; font: 500 0.75rem/1.4 var(--font-mono); color: var(--ink-3); text-transform: uppercase; }

.short-answer {
    margin: 0 0 22px;
    border: 3px solid var(--band);
    border-radius: var(--radius);
    overflow: hidden;
}

.short-answer-label { margin: 0; padding: 12px 16px; background: var(--band); color: var(--band-text); font-weight: 700; }
.short-answer p:last-child { margin: 0; padding: 16px; font-size: 1.0625rem; line-height: 1.5; }

.toc { margin: 0 0 22px; padding: 14px 16px; background: var(--ground); border-radius: var(--radius-sm); }
.toc ol { margin: 0; padding: 0; list-style: none; }
.toc li { line-height: 1.4; }
.toc a { display: inline-flex; min-height: 36px; align-items: center; }

.sassa-article-body { font-size: 1.0625rem; line-height: 1.6; padding-bottom: 8px; }
.sassa-article-body h2 { margin: 2rem 0 0.75rem; font-size: 1.3125rem; scroll-margin-top: 80px; }
.sassa-article-body h3 { margin: 1.5rem 0 0.5rem; }
.sassa-article-body p { margin: 0 0 1rem; }

.sassa-list { padding-left: 1.3rem; }
.sassa-list li { margin-bottom: 0.6rem; }

.sassa-steps {
    margin: 0 0 1.25rem;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 14px;
    counter-reset: step;
}

.sassa-steps li {
    position: relative;
    min-height: 36px;
    padding: 6px 0 0 48px;
    counter-increment: step;
}

.sassa-steps li::before {
    content: counter(step);
    position: absolute;
    left: 0;
    top: 0;
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent-ink);
    color: #fff;
    font: 800 0.9375rem/1 var(--font-display);
}

body[data-section="uif"] .sassa-steps li::before { background: var(--uif); }

.callout { margin: 1.25rem 0; padding: 14px 16px; border-radius: var(--radius-sm); background: var(--ground); line-height: 1.5; }
.callout p { margin: 0; }
.callout-warning, .sassa-callout-warning { background: var(--warn-wash); color: var(--warn-ink); }
.sassa-callout-info { background: var(--wash); }
.sassa-callout-good { background: var(--sassa-wash); color: var(--sassa-ink); }

.sassa-links { list-style: none; padding: 0; margin: 1rem 0; border-bottom: 1px solid var(--rule); }
.sassa-links li { border-top: 1px solid var(--rule); }
.sassa-links a { display: flex; align-items: center; min-height: 52px; font-weight: 700; color: var(--accent); }

.related-band .card-eyebrow { color: var(--band-soft); margin-bottom: 12px; }

.article-list { display: flex; flex-direction: column; gap: 8px; }

.article-row {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 54px;
    padding: 14px 16px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--ink);
}

.article-row:hover { color: var(--ink); border-color: var(--accent); }
.article-row-text { display: flex; flex-direction: column; gap: 4px; flex: 1 1 auto; }
.article-row-title { font-weight: 700; font-size: 1rem; line-height: 1.3; color: var(--ink); text-decoration: none; }
.article-row-summary { margin: 0; color: var(--ink-2); font-size: 0.9375rem; }
.article-row svg { flex-shrink: 0; color: var(--accent); }
.article-row-icon { font-size: 1.25rem; }
.article-row-arrow { color: var(--accent); }

.category-title { margin: 1.75rem 0 0.75rem; font-size: 1.3125rem; }
.category-title:first-child { margin-top: 0; }

.jump-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 1rem; }

.jump-chip, .filter-chip {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 16px;
    background: var(--surface);
    border: 1.5px solid var(--line);
    border-radius: 999px;
    text-decoration: none;
    font-weight: 700;
    color: var(--ink);
}

.jump-chip:hover, .filter-chip:hover { border-color: var(--accent); color: var(--ink); }
.filter-chip.active { background: var(--ink); color: #fff; border-color: var(--ink); }

.cta-band {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 20px;
    margin: 1.5rem 0;
    background: var(--wash);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.cta-band-text { flex: 1 1 320px; }
.cta-band h2 { margin: 0 0 6px; }
.cta-band p { margin: 0; }

.related { margin-top: 2rem; padding-top: 1.25rem; border-top: 1px solid var(--rule); }

/* ---- shared bits ---- */

.eyebrow {
    margin: 0 0 6px;
    font: 700 0.8125rem/1.3 var(--font-mono);
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--ink-2);
}

.code {
    font-family: var(--font-mono);
    font-size: 0.85em;
    background: var(--ground);
    padding: 0.05em 0.4em;
    border-radius: 4px;
}

.rule-line { color: var(--ink-2); font-size: 0.9375rem; }
.source-note { color: var(--ink-2); font-size: 0.875rem; }

.chip {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.875rem;
    font-weight: 700;
    background: var(--ground);
    color: var(--ink);
}

.chip-good { background: var(--sassa-wash); color: var(--sassa-ink); }
.chip-bad { background: var(--bad-wash); color: var(--bad-ink); }
.chip-route { background: var(--uif-wash); color: var(--uif-ink); }
.chip-gold { background: var(--k53); color: var(--k53-ink); }

.scroller { overflow-x: auto; margin: 0 0 1.25rem; }

table { border-collapse: collapse; width: 100%; background: var(--surface); font-size: 0.9375rem; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--rule); vertical-align: top; }
th { font-weight: 700; background: var(--ground); }

/* ---- forms ---- */

input[type="search"], input[type="number"], input[type="text"], input[type="email"], select, textarea {
    font: inherit;
    min-height: 50px;
    padding: 10px 14px;
    border: 2px solid var(--field);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--ink);
}

input[type="radio"], input[type="checkbox"] { width: 22px; height: 22px; accent-color: var(--accent); }

.pagination { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; margin: 1.5rem 0; }

/* ---- signs ---- */

.sign-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 10px;
    margin: 1rem 0;
}

.sign-grid-compact { grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); }

.sign-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 14px 8px;
    border: 1px solid var(--rule);
    border-radius: var(--radius);
    background: var(--surface);
    text-decoration: none;
    color: inherit;
    text-align: center;
}

.sign-card:hover { border-color: var(--k53-edge); color: inherit; box-shadow: inset 0 0 0 1px var(--k53-edge); }

.sign-thumb {
    position: relative;
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sign-thumb img { max-width: 100%; max-height: 100%; image-rendering: -webkit-optimize-contrast; }
.sign-thumb-large { width: 132px; height: 132px; }

.sign-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 0.75rem;
    font-weight: 700;
    text-align: center;
    padding: 4px;
    background: var(--ground);
    color: var(--ink-2);
}

.sign-shape-triangle .sign-fallback { clip-path: polygon(50% 6%, 95% 92%, 5% 92%); border: 2px solid var(--bad); padding-top: 1.2rem; }
.sign-shape-circle .sign-fallback { border-radius: 50%; border: 3px solid var(--uif); }
.sign-shape-rectangle .sign-fallback { border-radius: 6px; border: 2px solid var(--sassa); }
.sign-shape-marking .sign-fallback { border-radius: 2px; border: 2px dashed var(--ink-2); }
.sign-shape-signal .sign-fallback { border-radius: 6px; border: 2px solid var(--k53-deep); }

.sign-card-code { font-family: var(--font-mono); font-size: 0.8125rem; font-weight: 500; }
.sign-card-name { font-size: 0.875rem; color: var(--ink-2); line-height: 1.3; }

.sign-detail {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    flex-wrap: wrap;
    margin: 0 0 1.5rem;
    padding: 20px;
    background: var(--k53-cream);
    border: 2px solid var(--k53-edge);
    border-radius: var(--radius);
}

.sign-detail h1 { margin-top: 0; }

.fact-list dt { font-weight: 700; margin-top: 0.75rem; }
.fact-list dd { margin: 0.2rem 0 0; color: var(--ink-2); }

.clause-list, .control-list { list-style: none; padding: 0; margin: 0; }
.clause-list li { padding: 12px 0; border-bottom: 1px solid var(--rule); }
.control-list li { padding: 8px 0; display: flex; gap: 10px; align-items: baseline; border-bottom: 1px solid var(--rule); }

.diagram-image { display: block; max-width: 100%; height: auto; margin: 0 0 1rem; border: 1px solid var(--rule); border-radius: var(--radius); background: #fff; }

.control-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    width: 2em;
    height: 2em;
    border-radius: 8px;
    background: var(--k53);
    color: var(--k53-ink);
    font-weight: 700;
    font-size: 0.875rem;
}

/* ---- learning path ---- */

.stage-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }

.stage-card {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    padding: 16px;
    border: 2px solid var(--k53-edge);
    border-radius: var(--radius);
    background: var(--k53-cream);
    text-decoration: none;
    color: inherit;
}

.stage-card:hover { border-color: var(--k53-ink); color: inherit; }

.stage-num {
    display: grid;
    place-items: center;
    flex: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--k53-ink);
    color: var(--k53);
    font: 900 1.25rem/1 var(--font-display);
}

.stage-card h3 { margin: 0 0 0.25rem; font-size: 1.125rem; }
.stage-card p { margin: 0.15rem 0; }

.topic-block {
    margin: 0 0 1rem;
    padding: 18px;
    background: var(--surface);
    border: 1px solid var(--rule);
    border-radius: var(--radius);
}

.topic-block h2 { margin-top: 0; }
.teaching-points { padding-left: 1.2rem; }
.teaching-points li { margin-bottom: 0.6rem; }

.pass-panel { padding: 20px; margin: 0; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); }
.pass-panel h2 { margin: 0 0 14px; }
.pass-panel > p { margin: 14px 0 0; color: var(--ink-2); }

.pass-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); gap: 10px; }
.pass-stat { display: flex; flex-direction: column; gap: 2px; padding: 14px; background: var(--k53-cream); border-radius: var(--radius-sm); }
.pass-stat-num { font: 900 2rem/1.1 var(--font-display); }
.pass-stat-num small { font-size: 1.125rem; color: var(--ink-2); }
.pass-stat-label { font-weight: 700; }

/* ---- quiz ---- */

.quiz-page { background: var(--k53-cream); padding-bottom: 32px; }

.quiz-bar { background: var(--k53); color: var(--k53-ink); }
.quiz-bar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; }
.quiz-bar a { display: inline-flex; align-items: center; min-height: 44px; color: var(--k53-ink); text-decoration: none; font-weight: 700; }
.quiz-bar-title { font: 800 1rem/1.2 var(--font-display); text-align: center; }
.quiz-bar-count { font: 500 0.875rem var(--font-mono); white-space: nowrap; }

.progress-track { height: 8px; background: #f8e3a1; overflow: hidden; }
.progress-fill { height: 100%; background: var(--k53-ink); }

.quiz-figure {
    display: grid;
    place-items: center;
    min-height: 200px;
    margin: 22px 0 0;
    padding: 16px;
    border: 2px solid var(--k53-edge);
    border-radius: 14px;
    background: #fff;
}

.quiz-figure .sign-thumb-large { width: 168px; height: 168px; }

.quiz-prompt { margin: 20px 0 4px; font: 800 1.4375rem/1.25 var(--font-display); }
.quiz-hint { margin: 0 0 12px; font-size: 0.9375rem; color: var(--k53-text); }

.quiz-options { display: flex; flex-direction: column; gap: 10px; margin: 0 0 18px; padding: 0; border: 0; }

.quiz-option {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 58px;
    padding: 12px 16px;
    border: 2px solid #e2cf86;
    border-radius: var(--radius);
    background: #fff;
    color: var(--k53-ink);
    font: 700 1.0625rem/1.35 var(--font-body);
    cursor: pointer;
}

.quiz-option:hover { border-color: var(--k53-ink); }
.quiz-option input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.quiz-option:has(input:focus-visible) { outline: 3px solid var(--uif); outline-offset: 2px; }
.quiz-option:has(input:checked) { background: var(--k53-ink); border-color: var(--k53-ink); color: #fff; }
.quiz-option:has(input:checked) .quiz-option-label { background: var(--k53); color: var(--k53-ink); }

.quiz-option-label {
    display: grid;
    place-items: center;
    flex: none;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--k53-wash);
    font: 800 0.9375rem/1 var(--font-display);
}

.quiz-option-text { flex: 1 1 auto; }

.quiz-submit { width: 100%; min-height: 54px; background: var(--k53-ink); color: var(--k53); font-size: 1.0625rem; border-radius: var(--radius); }
.quiz-submit:hover { color: var(--k53); }

.feedback { margin: 0 0 16px; padding: 14px 16px; border-radius: var(--radius); font: 800 1.125rem/1.35 var(--font-display); }
.feedback-good { background: var(--sassa); color: #fff; }
.feedback-bad { background: var(--sport); color: #fff; }

.score-list { margin: 0 0 16px; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.score-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center; padding: 14px 16px; background: #fff; border: 2px solid var(--k53-edge); border-radius: var(--radius); }
.score-row strong { font-size: 1.0625rem; }
.score-num { font: 900 1.5rem/1 var(--font-display); }
.score-row small { color: var(--k53-text); }

.review-jump { display: flex; flex-wrap: wrap; gap: 6px; margin: 18px 0; }

.review-dot {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    font: 700 0.875rem var(--font-mono);
    text-decoration: none;
    color: #fff;
    background: var(--ink-2);
}

.review-dot:hover { color: #fff; }
.review-dot-good { background: var(--sassa); }
.review-dot-bad { background: var(--sport); }
.review-dot-current { outline: 3px solid var(--k53-ink); outline-offset: 2px; }

.review-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-weight: 700; }

.review-option { cursor: default; }
.review-option-correct { background: var(--sassa); border-color: var(--sassa); color: #fff; }
.review-option-correct .quiz-option-label { background: #fff; color: var(--sassa-ink); }
.review-option-chosen-wrong { background: var(--sport); border-color: var(--sport); color: #fff; }
.review-option-chosen-wrong .quiz-option-label { background: #fff; color: var(--sport-ink); }
.review-option .rule-line { color: inherit; font-weight: 400; }

.review-explain { margin: 0 0 16px; padding: 14px 16px; border: 2px solid var(--ink); border-radius: var(--radius); background: #fff; }

.review-nav { display: flex; justify-content: space-between; gap: 10px; margin-top: 1rem; }

/* ---- SASSA eligibility tools ---- */

.elig-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin: 0 0 1.5rem;
    padding: 20px 16px;
    background: var(--wash);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.elig-field { display: flex; flex-direction: column; gap: 8px; border: none; padding: 0; margin: 0; font-weight: 700; }
.elig-field input[type="number"] { font-weight: 400; max-width: 240px; }
fieldset.elig-field legend { font-weight: 700; padding: 0; margin-bottom: 8px; }

fieldset.elig-field label {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 48px;
    margin: 0 10px 8px 0;
    padding: 0 16px;
    background: var(--surface);
    border: 2px solid var(--line);
    border-radius: var(--radius-sm);
    font-weight: 700;
}

fieldset.elig-field label:has(input:checked) { border-color: var(--accent); }

.elig-form .button-link { align-self: flex-start; }

.elig-result { margin: 0 0 1.5rem; padding: 18px 16px; border-radius: var(--radius); }
.elig-result-good { background: var(--sassa-wash); border: 3px solid var(--sassa); }
.elig-result-bad { background: var(--warn-wash); border: 3px solid var(--k53); }
.elig-result-headline { margin-top: 0; font: 900 1.375rem/1.2 var(--font-display); }

.elig-checklist { list-style: none; padding: 0; margin: 0.75rem 0; }
.elig-checklist li { display: flex; gap: 8px; align-items: flex-start; padding: 6px 0; }
.elig-checklist svg { flex-shrink: 0; margin-top: 3px; }
.elig-check-pass svg { color: var(--sassa); }
.elig-check-fail svg { color: var(--sport); }

/* ---- sports ---- */

.sports-search { display: flex; flex-direction: column; gap: 6px; margin: 0; }
.sports-search label { font-weight: 700; }
.sports-search-row { display: flex; gap: 8px; }
.sports-search input[type="search"] { flex: 1 1 auto; min-width: 0; border-color: transparent; }
.band-head .sports-search label { color: var(--band-text); }

.sport-tile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.sport-tile {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    min-height: 96px;
    padding: 14px;
    border-radius: var(--radius);
    background: var(--sport-wash);
    color: var(--ink);
    text-decoration: none;
}

.sport-tile:hover { color: var(--ink); box-shadow: inset 0 0 0 2px var(--sport-line); }
.sport-tile strong { font: 900 1.25rem/1 var(--font-display); color: var(--sport-ink); }
.sport-tile span { font-size: 0.875rem; color: var(--ink-2); }

.big-match { background: var(--surface); border-radius: var(--radius); padding: 16px; }
.big-match-title { margin: 0 0 12px; font: 900 1.375rem/1.2 var(--font-display); }
.big-match .chance { margin-bottom: 14px; }

.sport-tabs { display: flex; gap: 4px; overflow-x: auto; margin: 14px -16px 0; padding: 0 16px; scrollbar-width: none; }
.sport-tabs::-webkit-scrollbar { display: none; }

.sport-tab {
    flex: none;
    display: inline-flex;
    align-items: center;
    min-height: 48px;
    padding: 0 14px;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    color: var(--band-text);
    text-decoration: none;
    font-weight: 700;
}

.sport-tab:hover { color: var(--band-text); background: rgba(255, 255, 255, 0.12); }
.sport-tab[aria-current="page"] { background: var(--ground); color: var(--ink); }

.band-head-tabs { padding-bottom: 0; }

.fixtures-body { background: var(--ground); }

.day-title { margin: 22px 0 10px; font: 700 0.8125rem var(--font-mono); text-transform: uppercase; letter-spacing: 0.02em; color: var(--ink-2); }
.day-title:first-child { margin-top: 0; }

.event-list { display: flex; flex-direction: column; gap: 10px; margin: 0 0 1rem; }

.event-row {
    display: block;
    padding: 16px;
    border: 1px solid var(--rule-2);
    border-radius: var(--radius);
    background: var(--surface);
    text-decoration: none;
    color: inherit;
}

.event-row:hover { border-color: var(--sport); color: inherit; }

.event-row-top { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: start; margin-bottom: 12px; }
.event-row-teams { display: flex; flex-direction: column; gap: 6px; font: 700 1.0625rem/1.3 var(--font-body); }
.event-row-time { font: 500 0.875rem var(--font-mono); color: var(--ink-2); text-align: right; }
.event-row-league { display: block; margin-top: 4px; font-size: 0.875rem; color: var(--ink-2); }
.event-row-status { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; margin-top: 6px; }
.event-row .rule-line { display: block; margin-top: 6px; font-size: 0.875rem; }

.result-list { background: var(--surface); border: 1px solid var(--rule-2); border-radius: var(--radius); }

.result-row {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 10px;
    align-items: center;
    min-height: 54px;
    padding: 8px 14px;
    border-bottom: 1px solid var(--rule);
    font-size: 0.9375rem;
    color: var(--ink);
    text-decoration: none;
}

.result-row:last-child { border-bottom: 0; }
.result-row:hover { color: var(--ink); background: var(--ground); }
.result-row strong { font: 800 1.0625rem var(--font-display); white-space: nowrap; }
.result-row span:last-child { text-align: right; }

.chance { display: flex; flex-direction: column; gap: 6px; }
.chance-bar { display: flex; height: 10px; border-radius: 5px; overflow: hidden; order: 0; }
.chance-labels { order: 1; display: flex; justify-content: space-between; gap: 8px; font: 500 0.75rem var(--font-mono); color: var(--ink-2); }
.chance-labels strong { font-weight: 700; color: var(--ink); }
.chance-labels span:last-child { text-align: right; }
.chance-seg { flex-basis: 0; min-width: 4px; }
.chance-seg-home { background: var(--sport); }
.chance-seg-draw { background: #b9c4c2; }
.chance-seg-away { background: var(--ink); }
.chance-large .chance-bar { height: 16px; }
.chance-large .chance-labels { font-size: 0.875rem; }

.odds-row { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---- contact form ---- */

.contact-form input, .contact-form textarea {
    display: block;
    width: 100%;
    margin-top: 0.4rem;
    font-weight: 400;
}

.contact-form textarea { min-height: 9rem; resize: vertical; }
.field-error { margin: 0.25rem 0 0; color: var(--sport-link); font-weight: 700; }

/* The honeypot: off-screen for people, still in the form for bots. */
.hp-field { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* ---- app (PWA): install button, offline banner, save-for-offline card ---- */

.install-app[hidden], .offline-banner[hidden], .offline-save[hidden] { display: none; }

.offline-banner { padding: 10px 16px; background: var(--k53); color: var(--k53-ink); font-weight: 700; text-align: center; }

.offline-save {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 14px 20px;
    padding: 18px 16px;
    margin: 0;
    background: var(--surface);
    border: 2px solid var(--k53-edge);
    border-radius: var(--radius);
}

.offline-save > div:first-child { flex: 1 1 280px; }
.offline-save h2 { margin: 0 0 6px; }
.offline-save p { margin: 0; color: var(--ink-2); }
.offline-save progress { width: 100%; height: 10px; margin-top: 12px; accent-color: var(--k53-ink); }
.offline-save-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.offline-save-actions .button-link[hidden] { display: none; }

/* ---- comments ---- */

.comments { margin-top: 2rem; padding-top: 1.25rem; border-top: 1px solid var(--rule); }
.band .comments { margin-top: 0; padding-top: 0; border-top: 0; }
.comments > h2 { margin-top: 0; }

.comment-list, .comment-replies { list-style: none; margin: 0; padding: 0; }
.comment-list { display: flex; flex-direction: column; gap: 10px; margin: 1rem 0; }
.comment-replies { display: flex; flex-direction: column; gap: 8px; margin: 8px 0 0 16px; padding-left: 12px; border-left: 3px solid var(--rule); }

.comment-card { padding: 14px 16px; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-sm); }
.comment-staff { background: var(--sassa-wash); border-color: var(--sassa); }
.comment-card p { margin: 6px 0; overflow-wrap: anywhere; }
.comment-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.comment-meta time { color: var(--ink-2); font-size: 0.875rem; }
.comment-reply { display: inline-flex; align-items: center; min-height: 44px; font-weight: 700; font-size: 0.9375rem; }

.comment-form h3 { margin: 0; font-size: 1.25rem; }
.comment-form .rule-line { margin: 0; font-weight: 400; }
.captcha-field[hidden] { display: none; }
.captcha-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.captcha-row img { height: 56px; width: auto; border: 1px solid var(--rule); border-radius: 8px; background: #fff; }
.captcha-field input[type="text"] { max-width: 200px; text-transform: uppercase; letter-spacing: 0.15em; }

/* ---- UIF calculator ---- */

.quick-estimate label { display: block; margin-bottom: 8px; font-weight: 700; font-size: 0.9375rem; }

.money-input {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 54px;
    margin-bottom: 12px;
    padding: 0 14px;
    border: 2px solid var(--ink);
    border-radius: var(--radius-sm);
    font: 700 1.125rem var(--font-mono);
}

.money-input input { flex: 1; min-width: 0; min-height: 0; padding: 0; border: 0; outline: 0; background: transparent; font: inherit; }
.money-input:focus-within { outline: 3px solid var(--uif); outline-offset: 2px; }

.estimate-out { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding-top: 12px; border-top: 1px solid var(--rule); }
.estimate-out span { font-size: 0.9375rem; color: var(--ink-2); }
.estimate-out output { font: 900 1.75rem var(--font-display); color: var(--uif); }
.quick-estimate .btn { margin-top: 12px; }
.quick-estimate .source-note { margin: 10px 0 0; }

.uif-calc-card { background: var(--surface); border: 1px solid var(--uif-line); border-radius: var(--radius); overflow: hidden; margin: 0 0 1.75rem; }
.embedded-calculator .uif-calc-card { margin: 0 0 1.75rem; }
.uif-calc-header { background: var(--uif); color: #fff; padding: 18px 16px; }
.uif-calc-badge { display: inline-block; margin-bottom: 8px; font: 700 0.75rem var(--font-mono); text-transform: uppercase; color: var(--uif-soft); }
.uif-calc-title { margin: 0 0 4px; font: 900 1.375rem/1.2 var(--font-display); color: #fff; }
.uif-calc-subtitle { margin: 0; font-size: 0.9375rem; color: var(--uif-on); }
.uif-calc-body { padding: 18px 16px; display: flex; flex-direction: column; gap: 20px; }
.uif-toggle-wrap { display: flex; flex-direction: column; gap: 8px; }
.uif-toggle-label, .uif-field-label { font: 700 0.8125rem var(--font-mono); text-transform: uppercase; color: var(--ink-2); }

.uif-pill-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; background: var(--uif-wash); padding: 5px; border-radius: var(--radius-sm); }
.uif-pill-btn { min-height: 44px; border: none; background: transparent; border-radius: 8px; font: 700 0.9375rem var(--font-body); color: var(--uif-ink); cursor: pointer; }
.uif-pill-btn.active { background: var(--uif); color: #fff; }

.uif-field { display: flex; flex-direction: column; gap: 8px; }
.uif-field-header { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.uif-field-display { font: 900 1.375rem var(--font-display); color: var(--uif); }
.uif-field-subdisplay { font: 800 1.125rem var(--font-display); color: var(--ink); }
.uif-range-row { display: flex; align-items: center; gap: 12px; }
.uif-range-slider { flex: 1; min-width: 0; height: 8px; accent-color: var(--uif); cursor: pointer; }
.uif-number-input { width: 120px; min-height: 48px; text-align: right; font-weight: 700; }
.uif-ceiling-alert { background: var(--warn-wash); color: var(--warn-ink); padding: 10px 14px; border-radius: var(--radius-sm); font-size: 0.875rem; line-height: 1.4; }
.uif-ceiling-alert[hidden], .uif-maternity-notice[hidden] { display: none; }
.uif-slider-ticks { display: flex; justify-content: space-between; font: 500 0.75rem var(--font-mono); color: var(--ink-2); }
.uif-maternity-notice { background: var(--uif-wash); padding: 12px 14px; border-radius: var(--radius-sm); font-size: 0.875rem; line-height: 1.4; color: var(--uif-ink); }
.uif-maternity-notice p { margin: 0; }

.uif-results-card { background: var(--night); color: #fff; padding: 18px; border-radius: var(--radius-sm); display: flex; flex-direction: column; gap: 16px; }
.uif-results-primary { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 12px; padding-bottom: 14px; border-bottom: 1px solid var(--night-rule); }
.uif-res-label { display: block; margin-bottom: 4px; font: 500 0.75rem var(--font-mono); text-transform: uppercase; color: var(--night-text); }
.uif-payout-hero { font: 900 2.125rem/1.1 var(--font-display); color: #9fc0ff; }
.uif-irr-badge { text-align: right; }
.uif-irr-value { font: 900 1.375rem var(--font-display); color: #fff; }
.uif-stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.uif-stat-box { background: rgba(255, 255, 255, 0.07); border: 1px solid rgba(255, 255, 255, 0.1); padding: 10px; border-radius: 8px; text-align: center; }
.uif-stat-label { display: block; margin-bottom: 2px; font: 500 0.6875rem var(--font-mono); color: var(--night-text); text-transform: uppercase; }
.uif-stat-val { font-weight: 700; color: #fff; }
.uif-stat-val.highlight { color: #9fc0ff; }
.uif-actions { display: flex; flex-direction: column; gap: 10px; }

.uif-btn-wa, .uif-btn-next {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 50px;
    padding: 0 18px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    text-decoration: none;
    text-align: center;
}

.uif-btn-wa { background: #25d366; color: #072e15; }
.uif-btn-wa:hover { background: #1eb956; color: #051b0d; }
.uif-btn-next { background: #fff; color: var(--ink); }
.uif-btn-next:hover { color: var(--uif-ink); }

.badge-ceiling { display: inline-block; margin-left: 6px; padding: 2px 6px; border-radius: 4px; background: var(--warn-wash); color: var(--warn-ink); font-size: 0.6875rem; font-weight: 700; vertical-align: middle; }
.table-footnote { margin-top: 8px; font-size: 0.875rem; color: var(--ink-2); }
.calc-explanation { margin-top: 2rem; }

@media (max-width: 400px) {
    .uif-stats-grid { grid-template-columns: 1fr; }
}

/* ---- wider screens: the bands stay full width, grids open up ---- */

@media (min-width: 720px) {
    .tile-grid { grid-template-columns: repeat(4, 1fr); }
    .todo-grid, .sport-tile-grid { grid-template-columns: repeat(4, 1fr); }
    .sign-type-grid { grid-template-columns: repeat(4, 1fr); }
    .home-tile { aspect-ratio: 4 / 5; }
    .band { padding: 32px 0; }
    .band-head { padding: 32px 0 34px; }
    .band-head-tabs { padding-bottom: 0; }
    .footer-nav { grid-template-columns: repeat(3, 1fr); }
}

/* The save-for-offline band only shows once pwa.js reveals its card. */
.offline-save-band:has(.offline-save[hidden]) { display: none; }

/* White cards inside a coloured head keep normal ink. */
.band-head .card p, .band-head .card label { color: var(--ink); }
.band-head .card .card-sub, .band-head .card .source-note, .band-head .card .estimate-out span { color: var(--ink-2); }
.band-head .card-solid p { color: var(--band-text); }

.cat-section + .cat-section { margin-top: 24px; }
.category-title:first-child { margin-top: 0; }
.band-head .sports-search .button-link { background: var(--night); color: #fff; }
.elig-form .callout { margin: 0; }
.quiz-figure .sign-thumb img { width: 100%; height: 100%; object-fit: contain; }
