/* ==========================================================================
   KO-MYKO Sponsorship Center
   Design tokens taken from the KO-MYKO visual identity: charcoal grounds,
   gold/bronze accents, Cinzel display over Raleway body copy.
   Hand-written CSS - no build step, no runtime dependency.
   ========================================================================== */

/* ------------------------------------------------------------------ fonts */

@font-face {
    font-family: 'Cinzel';
    font-style: normal;
    font-weight: 400 900;
    font-display: swap;
    src: url('../fonts/cinzel-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+2000-206F, U+2122, U+2191, U+2193, U+2212;
}
@font-face {
    font-family: 'Cinzel';
    font-style: normal;
    font-weight: 400 900;
    font-display: swap;
    src: url('../fonts/cinzel-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: 'Raleway';
    font-style: normal;
    font-weight: 300 700;
    font-display: swap;
    src: url('../fonts/raleway-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+2000-206F, U+2122, U+2191, U+2193, U+2212;
}
@font-face {
    font-family: 'Raleway';
    font-style: normal;
    font-weight: 300 700;
    font-display: swap;
    src: url('../fonts/raleway-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+2C60-2C7F, U+A720-A7FF;
}

/* ----------------------------------------------------------------- tokens */

:root {
    --ko-gold:       #e8c87a;
    --ko-gold-soft:  #f3e3b8;

    /* Lifted from #bc8f4b: links and hairline text now clear AA comfortably
       instead of sitting just above the line. */
    --ko-gold-dim:   #d0a463;

    /* Body copy. ~11:1 on the page ground. */
    --ko-text:       #e0c9a6;

    /* Secondary/label text carries the SMALLEST type in the UI (labels, help
       text, table headers), so it was raised from #9a8055 (5.3:1) to ~7.6:1.
       Small text needs more headroom than the 4.5:1 minimum, not less. */
    --ko-muted:      #c0a77f;

    /* Kept for the rare case where text must recede without being read
       closely - never used for anything the user has to act on. */
    --ko-faint:      #9a8055;

    --ko-bg-0:       #0a0805;
    --ko-bg-1:       #171008;
    --ko-bg-floor:   #0d0a06;

    --ko-line:       rgba(188, 143, 70, .28);
    --ko-line-soft:  rgba(188, 143, 70, .16);

    --ko-ok:         #5ac878;
    --ko-danger:     #c0392b;
    --ko-danger-br:  #bf5329;
    --ko-err:        #e57368;
    --ko-info:       #3b78b5;
    --ko-amber:      #d4943a;

    --ko-on-gold:    #241a0c;
    --ko-input:      #f0e6d2;

    --ko-display: 'Cinzel', 'Libre Baskerville', Georgia, serif;
    --ko-body:    'Raleway', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

    --ko-r-card: 10px;
    --ko-r-btn:   6px;
    --ko-r-tile:  8px;
    --ko-r-pill: 20px;

    --ko-shadow-card: 0 14px 34px rgba(0, 0, 0, .45);
    --ko-shadow-lift: 0 18px 40px rgba(0, 0, 0, .55);
}

/* ------------------------------------------------------------------ reset */

*, *::before, *::after { box-sizing: border-box; }

body {
    margin: 0;
    /* KO-MYKO artwork at the top, sitting under the scrim defined below so
       page content always has a near-solid ground and stays readable. */
    background: var(--ko-bg-0) url("../img/body-bg.jpg") no-repeat top center;
    background-size: 100% auto;
    color: var(--ko-text);
    font-family: var(--ko-body);
    font-size: 14px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

h1, h2, h3, h4 {
    font-family: var(--ko-display);
    color: var(--ko-gold);
    margin: 0 0 14px;
    line-height: 1.15;
}
/* Type scale lifted from the KO-MYKO Power Up Store so this app reads as part
   of the same site: h1 40/800/3px, h2 17/700/1.5px uppercase, h3 15/700. */
h1 { font-size: 40px; font-weight: 800; letter-spacing: 3px;   color: var(--ko-gold-soft); }
h2 { font-size: 17px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; }
h3 { font-size: 15px; font-weight: 700; letter-spacing: .4px;  color: var(--ko-gold-soft); }
h4 { font-size: 16px; font-weight: 700; letter-spacing: 1.4px; text-transform: uppercase; }

a { color: var(--ko-gold-dim); text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--ko-gold); text-decoration: underline; }

p { margin: 0 0 14px; }
img { max-width: 100%; height: auto; }
hr { border: 0; border-top: 1px solid var(--ko-line-soft); margin: 26px 0; }

:focus-visible {
    outline: 2px solid var(--ko-gold);
    outline-offset: 2px;
    border-radius: 3px;
}

.ko-skip {
    position: absolute;
    left: -9999px;
    top: 0;
    background: var(--ko-bg-1);
    color: var(--ko-gold);
    padding: 10px 16px;
    z-index: 100;
}
.ko-skip:focus { left: 8px; top: 8px; }

.ko-visually-hidden {
    position: absolute; width: 1px; height: 1px;
    padding: 0; margin: -1px; overflow: hidden;
    clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* -------------------------------------------------------------- structure */

.ko-container { max-width: 1170px; margin: 0 auto; padding: 0 16px; width: 100%; }
.ko-main { flex: 1 0 auto; padding: 28px 0 60px; }
.ko-section { margin-bottom: 40px; }

.ko-section-title {
    font-family: var(--ko-display);
    font-weight: 800;
    font-size: 26px;
    letter-spacing: 2.4px;
    text-transform: uppercase;
    color: var(--ko-gold);
    display: flex;
    align-items: center;
    gap: 18px;
    margin: 0 0 24px;
    text-shadow: 0 2px 5px rgba(0, 0, 0, .9);
}
.ko-section-title::before,
.ko-section-title::after {
    content: "";
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--ko-line) 40%, var(--ko-line) 60%, transparent);
}
.ko-section-title { justify-content: center; text-align: center; }

/* ----------------------------------------------------------------- header */

.ko-header {
    background: linear-gradient(180deg, rgba(23, 16, 8, .96), rgba(10, 8, 5, .98));
    border-bottom: 1px solid var(--ko-line);
    box-shadow: 0 6px 20px rgba(0, 0, 0, .5);
    position: sticky;
    top: 0;
    z-index: 40;
}
.ko-header-inner {
    display: flex;
    align-items: center;
    gap: 18px;
    min-height: 62px;
    flex-wrap: wrap;
}

.ko-brand { display: flex; align-items: baseline; gap: 9px; margin-right: auto; }
.ko-brand:hover { text-decoration: none; }
.ko-brand-main {
    font-family: var(--ko-display);
    font-weight: 800;
    font-size: 22px;
    letter-spacing: 3px;
    color: var(--ko-gold-soft);
    text-shadow: 0 2px 6px rgba(0, 0, 0, .8);
    text-transform: uppercase;
}
.ko-brand-sub {
    font-size: 12px;
    letter-spacing: 1.8px;
    text-transform: uppercase;
    color: var(--ko-gold);
}

.ko-nav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ko-nav a {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .9px;
    text-transform: uppercase;
    color: var(--ko-text);
    padding: 8px 12px;
    border-radius: var(--ko-r-btn);
    transition: background .15s ease, color .15s ease;
}
.ko-nav a:hover, .ko-nav a:focus { color: var(--ko-gold-soft); background: rgba(232, 200, 122, .10); text-decoration: none; }
.ko-nav a.is-active { color: var(--ko-gold); background: rgba(232, 200, 122, .14); }

/* Language selector - deliberately in the header, never buried in settings. */
.ko-lang {
    display: flex;
    align-items: center;
    gap: 4px;
    padding-left: 12px;
    margin-left: 4px;
    border-left: 1px solid var(--ko-line-soft);
}
.ko-lang-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px;
    border-radius: var(--ko-r-pill);
    border: 1px solid var(--ko-line);
    background: rgba(10, 8, 5, .6);
    color: var(--ko-text);
    transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.ko-lang-pill:hover,
.ko-lang-pill:focus-visible {
    color: var(--ko-gold-soft);
    border-color: rgba(232, 200, 122, .7);
    background: rgba(232, 200, 122, .12);
    text-decoration: none;
}
.ko-lang-pill.is-active {
    background: rgba(58, 42, 16, .95);
    color: var(--ko-gold);
    border-color: var(--ko-gold);
}

/* Flag icon. A thin light rule keeps the dark blue of the Union Jack from
   disappearing into the header, and the inactive flags are held slightly back
   so the active language reads first. */
.ko-flag {
    width: 34px;
    height: 24px;
    flex: 0 0 auto;
    display: block;
    border-radius: 2px;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, .22);
    opacity: .82;
    transition: opacity .15s ease;
}
.ko-lang-pill:hover .ko-flag,
.ko-lang-pill.is-active .ko-flag { opacity: 1; }

.ko-lang-code { line-height: 1; }

/* The native language name is announced to screen readers and shown in the
   title tooltip; the flag plus code carries it visually. */
.ko-lang-full {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px; overflow: hidden;
    clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.ko-nav-toggle { display: none; }

/* ---------------------------------------------------------------- buttons */

.ko-btn {
    display: inline-block;
    font-family: var(--ko-display);
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    padding: 12px 28px;
    border-radius: var(--ko-r-btn);
    border: 1px solid transparent;
    cursor: pointer;
    text-align: center;
    transition: transform .18s ease, box-shadow .18s ease, background .18s ease, color .18s ease;
}
.ko-btn:hover, .ko-btn:focus { text-decoration: none; transform: translateY(-2px); }
.ko-btn:disabled, .ko-btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; transform: none; }

.ko-btn-primary {
    color: var(--ko-on-gold);
    background: linear-gradient(180deg, #e8c87a, #dfb44e);
    border-color: #d3a12f;
}
.ko-btn-primary:hover { color: var(--ko-on-gold); box-shadow: 0 0 26px rgba(232, 200, 122, .4); }

.ko-btn-ghost {
    color: var(--ko-gold-soft);
    background: rgba(10, 8, 5, .45);
    border-color: rgba(232, 200, 122, .45);
}
.ko-btn-ghost:hover { color: #fff; border-color: rgba(232, 200, 122, .85); box-shadow: 0 0 24px rgba(232, 200, 122, .22); }

.ko-btn-danger {
    color: #f4d3cb;
    background: rgba(191, 83, 41, .18);
    border-color: rgba(191, 83, 41, .6);
}
.ko-btn-danger:hover { color: #fff; border-color: var(--ko-danger-br); box-shadow: 0 0 20px rgba(191, 83, 41, .3); }

.ko-btn-sm { padding: 9px 18px; font-size: 13.5px; letter-spacing: 1px; }
/* Inside a table the action buttons sit in the narrowest column on the page. */
.ko-table .ko-btn-sm { padding: 8px 14px; font-size: 12.5px; letter-spacing: .8px; }
.ko-btn-block { display: block; width: 100%; }

/* ------------------------------------------------------------------ cards */

.ko-card {
    background: linear-gradient(180deg, rgba(23, 16, 8, .92), rgba(10, 8, 5, .94));
    border: 1px solid var(--ko-line-soft);
    border-radius: var(--ko-r-card);
    box-shadow: var(--ko-shadow-card);
    overflow: hidden;
    margin-bottom: 22px;
}
.ko-card-head {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    text-align: center;
    gap: 10px;
    padding: 13px 18px;
    background: rgba(0, 0, 0, .35);
    border-bottom: 1px solid var(--ko-line-soft);
}
.ko-card-head h2, .ko-card-head h3 {
    font-family: var(--ko-display);
    font-weight: 700;
    font-size: 17px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--ko-gold);
    margin: 0;
}
.ko-card-body { padding: 18px; }

/*
 * How many rows the card below holds.
 *
 * It was a bare .ko-field-help, which carries margin-top:6px for sitting under
 * an input - inside a flex card head that dropped the figure off the title's
 * baseline, so "Sent mail" and its "0" read as one broken phrase rather than a
 * heading and a count. This is the same figure set as a chip: aligned, framed,
 * and obviously a number about the list rather than a word in the title.
 */
.ko-card-head .ko-count {
    margin: 0;
    min-width: 26px;
    padding: 2px 9px;
    border-radius: 999px;
    font-family: var(--ko-display);
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: .6px;
    line-height: 1.6;
    color: var(--ko-muted);
    background: rgba(154, 128, 85, .14);
    border: 1px solid rgba(154, 128, 85, .4);
}

/* A filter row is not the card's subject, so its heading is smaller and quieter
   than the one above it - it labels the controls, it does not re-announce the
   list. */
.ko-filters-title {
    margin-top: 0;
    margin-bottom: 14px;
    font-family: var(--ko-display);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    color: var(--ko-muted);
}

.ko-card-body > :last-child { margin-bottom: 0; }

/* -------------------------------------------------------------- hero/lead */

.ko-hero {
    text-align: center;
    padding: 46px 16px 34px;
    border-bottom: 1px solid var(--ko-line-soft);
    margin-bottom: 34px;
}
.ko-hero-kicker {
    font-family: var(--ko-display);
    font-size: 13px;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--ko-muted);
    margin-bottom: 12px;
}
.ko-hero h1 {
    font-size: 40px;
    font-weight: 900;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--ko-gold-soft);
    text-shadow: 0 3px 18px rgba(0, 0, 0, .9);
    margin-bottom: 16px;
}
.ko-hero-lead {
    max-width: 720px;
    margin: 0 auto 24px;
    font-size: 16px;
    color: var(--ko-text);
}
.ko-hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* --------------------------------------------------------- package cards */

/* Package picker. The dropdown only appears once JS has taken over the
   panels (html.ko-has-picker); without JS every package stays visible. */
.ko-package-picker { display: none; max-width: 460px; margin: 0 auto 26px; text-align: center; }
.ko-has-picker .ko-package-picker { display: block; }
.ko-package-picker .ko-label { margin-bottom: 9px; }

.ko-package-select {
    width: 100%;
    background: rgba(0, 0, 0, .45);
    border: 1px solid var(--ko-line);
    border-radius: var(--ko-r-btn);
    color: var(--ko-gold-soft);
    font-family: var(--ko-display);
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 1.2px;
    padding: 12px 38px 12px 16px;
    text-align: center;
    text-align-last: center;
    cursor: pointer;
    appearance: none;
    background-image:
        linear-gradient(45deg, transparent 50%, var(--ko-gold) 50%),
        linear-gradient(135deg, var(--ko-gold) 50%, transparent 50%);
    background-position: calc(100% - 20px) calc(50% + 2px), calc(100% - 15px) calc(50% + 2px);
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.ko-package-select:focus {
    outline: none;
    border-color: var(--ko-gold);
    box-shadow: 0 0 0 3px rgba(232, 200, 122, .18);
}
.ko-package-select option {
    background: var(--ko-bg-1);
    color: var(--ko-input);
    font-family: var(--ko-display);
    font-weight: 700;
    font-size: 15px;
}

.ko-packages { display: grid; grid-template-columns: 1fr; gap: 22px; }
/* Two side by side only when JS is unavailable and both are shown at once. */
@media (min-width: 900px) {
    .ko-packages { grid-template-columns: 1fr 1fr; }
    .ko-has-picker .ko-packages { grid-template-columns: minmax(0, 720px); justify-content: center; }

    /* Three cards in two columns leave the third alone on its own row - KC, on
       the picker. It reads as a stray column stuck to the left unless it takes
       the whole row and sits on the page's centre line, at the width of the
       card beside it rather than stretched across both. */
    html:not(.ko-has-picker) .ko-packages > .ko-package:last-child:nth-child(odd) {
        grid-column: 1 / -1;
        justify-self: center;
        width: 100%;
        max-width: calc((100% - 22px) / 2);
    }
}
.ko-packages.is-empty { display: none; }

/* Everything inside a package card is centred. */
.ko-package,
.ko-package .ko-package-body,
.ko-package .ko-reward-group h4,
.ko-package .ko-eligibility-note,
.ko-package .ko-field-help { text-align: center; }
.ko-package .ko-reward-group h4 { justify-content: center; }
.ko-package details.ko-details > summary { text-align: center; }

.ko-package {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--ko-line);
    border-radius: var(--ko-r-card);
    background: linear-gradient(180deg, rgba(28, 20, 10, .95), rgba(10, 8, 5, .96));
    box-shadow: var(--ko-shadow-card);
    overflow: hidden;
    transition: box-shadow .18s ease, border-color .18s ease;
}

/* The cards are read side by side and compared line against line, so hover
   lights a card up without moving it - nothing inside them, the card itself,
   its buttons or its item icons, shifts under the pointer. */
.ko-package:hover {
    box-shadow: var(--ko-shadow-lift);
    border-color: rgba(232, 200, 122, .5);
}
.ko-package .ko-btn:hover,
.ko-package .ko-btn:focus { transform: none; }
.ko-package .ko-reward-icon:hover { transform: none; }
.ko-package-head {
    padding: 22px 22px 16px;
    background: linear-gradient(180deg, rgba(232, 200, 122, .10), transparent);
    border-bottom: 1px solid var(--ko-line-soft);
    text-align: center;
}
.ko-package-head h3 {
    font-size: 21px;
    font-weight: 900;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--ko-gold-soft);
    margin-bottom: 8px;
}
.ko-package-tagline { font-size: 16.5px; color: var(--ko-muted); margin: 0; }
.ko-package-body { padding: 18px 22px; flex: 1; }
/* The card's opening sentence is what the reader decides on, so it is set a
   step above the 14px body text the rest of the card inherits. */
.ko-package-body > p,
.ko-package-intro { font-size: 16px; }
.ko-package-foot { padding: 0 22px 22px; }

.ko-reward-group { margin-bottom: 16px; }
.ko-reward-group:last-child { margin-bottom: 0; }
.ko-reward-group h4 {
    font-size: 15.5px;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    color: var(--ko-muted);
    margin: 0 0 8px;
    padding-bottom: 5px;
    border-bottom: 1px solid var(--ko-line-soft);
}
.ko-rewards { list-style: none; margin: 0; padding: 0; }
.ko-rewards li {
    position: relative;
    padding: 4px 0 4px 22px;
    font-size: 15px;
    color: var(--ko-text);
}
.ko-rewards li::before {
    content: "\2713";
    position: absolute;
    left: 0;
    top: 4px;
    color: var(--ko-gold);
    font-weight: 700;
}

/* A reward group renders as one left-to-right strip of item artwork with the
   reward names read out beneath it - denser and easier to scan than one row
   per reward. */
.ko-reward-gallery {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 10px;
}

.ko-reward-icon {
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    border-radius: 6px;
    background: rgba(0, 0, 0, .45);
    border: 1px solid var(--ko-line-soft);
    object-fit: cover;
    image-rendering: -webkit-optimize-contrast;
    transition: border-color .15s ease, transform .15s ease;
}
.ko-reward-icon:hover {
    border-color: rgba(232, 200, 122, .6);
    transform: translateY(-2px);
}

.ko-reward-names {
    list-style: none;
    margin: 0;
    padding: 0;
    text-align: center;
    font-size: 14.5px;
    line-height: 1.6;
    color: var(--ko-text);
}
.ko-reward-names li { padding: 2px 0; }
/* A single-item group needs no list rhythm. */
.ko-reward-names li:only-child { padding: 0; }
.ko-reward-qty { color: var(--ko-gold-soft); font-weight: 700; }
.ko-reward-duration { color: var(--ko-muted); font-size: 12.5px; }

.ko-eligibility-note {
    margin: 0 0 18px;
    padding: 11px 14px;
    border: 1px solid rgba(212, 148, 58, .4);
    background: rgba(212, 148, 58, .12);
    border-radius: var(--ko-r-tile);
    color: #e3b878;
    font-size: 14.5px;
}

details.ko-details { margin-top: 14px; }
details.ko-details > summary {
    cursor: pointer;
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--ko-gold-dim);
    padding: 9px 0;
    list-style: none;
}
details.ko-details > summary::-webkit-details-marker { display: none; }
details.ko-details > summary::before { content: "\25B8  "; }
details.ko-details[open] > summary::before { content: "\25BE  "; }
details.ko-details > summary:hover { color: var(--ko-gold); }

/* ------------------------------------------------------------ steps list */

/* Each step is centred as a unit: the number sits inline before its text
   rather than hanging in a left gutter. */
.ko-steps { list-style: none; counter-reset: ko-step; margin: 0; padding: 0; }
.ko-steps li {
    counter-increment: ko-step;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 11px 0;
    border-bottom: 1px solid rgba(255, 255, 255, .04);
    font-size: 15.5px;
    text-align: center;
}
.ko-steps li:last-child { border-bottom: 0; }
.ko-steps li::before {
    content: counter(ko-step);
    flex: 0 0 30px;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--ko-display);
    font-weight: 700;
    font-size: 13px;
    color: var(--ko-gold);
    border: 1px solid var(--ko-line);
    border-radius: 50%;
    background: rgba(0, 0, 0, .4);
}

/* ---------------------------------------------------------------- modal */

.ko-modal { position: fixed; inset: 0; z-index: 80; display: flex; align-items: center; justify-content: center; padding: 20px; }
.ko-modal[hidden] { display: none; }
.ko-modal-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .78); backdrop-filter: blur(2px); }
.ko-modal-panel {
    position: relative;
    width: 100%;
    max-width: 460px;
    background: linear-gradient(180deg, rgba(28, 20, 10, .99), rgba(10, 8, 5, .99));
    border: 1px solid var(--ko-line);
    border-radius: var(--ko-r-card);
    box-shadow: var(--ko-shadow-lift);
    padding: 30px 28px 26px;
    text-align: center;
}
.ko-modal-title { margin-bottom: 10px; }
.ko-modal-lead { color: var(--ko-text); margin-bottom: 22px; }
.ko-modal-actions { display: flex; flex-direction: column; gap: 10px; }
.ko-modal-close {
    position: absolute;
    top: 8px; right: 12px;
    background: none;
    border: 0;
    color: var(--ko-muted);
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    padding: 4px 8px;
}
.ko-modal-close:hover { color: var(--ko-gold); }

/* ------------------------------------------------------------- callouts */

.ko-callout {
    border: 1px solid var(--ko-line);
    border-left: 3px solid var(--ko-gold);
    background: rgba(232, 200, 122, .07);
    border-radius: var(--ko-r-tile);
    padding: 14px 18px;
    margin: 0 0 22px;
    color: var(--ko-gold-soft);
    text-align: center;
}
.ko-callout strong { color: var(--ko-gold); }
/* Kept as a hook on markup that already carries it - callouts centre by
   default now. */
.ko-callout.is-centered { text-align: center; }
.ko-callout.is-warning {
    border-color: rgba(212, 148, 58, .5);
    border-left-color: var(--ko-amber);
    background: rgba(212, 148, 58, .10);
    color: #e3b878;
}
.ko-callout.is-success {
    border-color: rgba(90, 200, 120, .45);
    border-left-color: var(--ko-ok);
    background: rgba(90, 200, 120, .10);
    color: #b6e6c4;
}
.ko-callout.is-danger {
    border-color: rgba(191, 83, 41, .5);
    border-left-color: var(--ko-danger-br);
    background: rgba(191, 83, 41, .12);
    color: #f0c4b0;
}
.ko-no-guarantee {
    text-align: center;
    font-family: var(--ko-display);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 1.6px;
    text-transform: uppercase;
}

/* --------------------------------------------------------------- badges */

.ko-badge {
    display: inline-block;
    border-radius: 4px;
    padding: 3px 10px;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .6px;
    text-transform: uppercase;
    white-space: nowrap;
    border: 1px solid transparent;
}
.ko-badge.is-info    { color: #a9cdf0; background: rgba(59, 120, 181, .16); border-color: rgba(59, 120, 181, .5); }
.ko-badge.is-amber   { color: #e3b878; background: rgba(212, 148, 58, .16); border-color: rgba(212, 148, 58, .5); }
.ko-badge.is-ok      { color: #a9e8bd; background: rgba(90, 200, 120, .16); border-color: rgba(90, 200, 120, .5); }
.ko-badge.is-danger  { color: #f0b4a6; background: rgba(192, 57, 43, .18);  border-color: rgba(192, 57, 43, .55); }
.ko-badge.is-muted   { color: var(--ko-muted); background: rgba(154, 128, 85, .12); border-color: rgba(154, 128, 85, .4); }

/* A badge that is the headline answer on a page, not an annotation inside a
   table row, is set large enough to be read as one. */
.ko-badge.is-lg { font-size: 14px; padding: 5px 14px; letter-spacing: .9px; }

/* --------------------------------------------------------- decision card */

/* The card carrying approve and reject is marked out from the cards of
   evidence around it: this is the one you act in, the rest you read. */
.ko-decision-card { border-color: var(--ko-gold-dim); box-shadow: 0 0 0 1px rgba(232, 200, 122, .12), var(--ko-shadow-card); }
.ko-decision-heading { margin-bottom: 14px; }
.ko-decision-reject { margin-top: 18px; border-top: 1px solid var(--ko-line-soft); padding-top: 16px; }
details.ko-decision-reject > summary { color: #f0b4a6; }

/* Deletion is fenced off in red so it is never mistaken for one of the
   ordinary staff actions sitting above it. */
.ko-danger-card { border-color: rgba(192, 57, 43, .45); }
.ko-danger-card .ko-card-head { border-bottom-color: rgba(192, 57, 43, .3); }
.ko-danger-card .ko-card-head h3 { color: #f0b4a6; }

/* The fold under a danger heading is a control, so it is drawn as one: a bare
   line of uppercase text with a triangle in front of it read as a label that
   happened to be clickable, which is exactly what it must not read as. */
details.ko-details.is-danger-fold { margin-top: 0; }
details.ko-details.is-danger-fold > summary {
    display: block;
    text-align: center;
    color: #f0b4a6;
    font-weight: 700;
    padding: 10px 14px;
    border: 1px solid rgba(192, 57, 43, .45);
    border-radius: var(--ko-r-tile);
    background: rgba(192, 57, 43, .1);
}
details.ko-details.is-danger-fold > summary:hover {
    color: #f6cfc5;
    background: rgba(192, 57, 43, .2);
}
details.ko-details.is-danger-fold[open] > summary { margin-bottom: 14px; }

/* ------------------------------------------------------------ ESN codes */

/* A code is read character by character and typed into a game client, so it is
   set in a monospaced face where 0 and O, 1 and l cannot be confused, and it is
   selectable as one word. */
.ko-code-cell {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    letter-spacing: .5px;
    color: var(--ko-gold-soft);
    word-break: break-all;
}
.ko-code-input {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 13px;
    line-height: 1.7;
    white-space: pre;
    overflow-wrap: normal;
    overflow-x: auto;
}

/* Two stat cards, not four: the stash has exactly two numbers worth a tile. */
.ko-stats.is-pair { grid-template-columns: 1fr; }
@media (min-width: 560px) { .ko-stats.is-pair { grid-template-columns: 1fr 1fr; } }

/* Tabs that filter the card they sit in, rather than the page. */
.ko-tabs.is-inset {
    margin: 0;
    padding: 12px 18px 0;
    justify-content: flex-start;
    border-bottom: 1px solid var(--ko-line-soft);
}

/* A control that belongs to the line it sits on - "Return" beside a code - and
   must not break the row it is in. */
.ko-inline-form { display: inline; margin-left: 10px; }
.ko-btn-xs { padding: 3px 9px; font-size: 11px; letter-spacing: .6px; }

/* The category picker in the codes card: a filter, not a form field, so it sits
   on one line with its label instead of taking the full card width. The native
   select is restyled here too - left to itself it falls back to the browser's
   white default, which is the one bright box on a dark page. */
.ko-filter-row {
    display: flex;
    align-items: center;
    justify-content: center;
}
.ko-filter-row .ko-inline-form {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-left: 0;
}
.ko-filter-row label {
    font-size: 12px;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--ko-muted);
    font-weight: 600;
}
.ko-filter-row select {
    appearance: none;
    background-color: rgba(0, 0, 0, .35);
    background-image: linear-gradient(45deg, transparent 50%, var(--ko-muted) 50%), linear-gradient(135deg, var(--ko-muted) 50%, transparent 50%);
    background-position: calc(100% - 18px) calc(50% + 1px), calc(100% - 13px) calc(50% + 1px);
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
    border: 1px solid var(--ko-line);
    border-radius: var(--ko-r-btn);
    color: var(--ko-input);
    font-family: var(--ko-body);
    font-size: 14px;
    line-height: 1.5;
    /* Room for the arrow on the right, matched on the left so the chosen value
       stays optically centred in the box. */
    padding: 8px 32px;
    max-width: 100%;
    cursor: pointer;
    transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}
.ko-filter-row select:hover { border-color: rgba(188, 143, 70, .45); }
.ko-filter-row select:focus {
    outline: none;
    border-color: var(--ko-gold);
    box-shadow: 0 0 0 3px rgba(232, 200, 122, .18);
    background-color: rgba(0, 0, 0, .5);
}
.ko-filter-row select option { background: var(--ko-bg-1); color: var(--ko-input); }

/* A code that cannot be decrypted. Shown as a word, not as an empty cell - a
   blank reads as a code with nothing in it, which is a different problem. */
.ko-code-unreadable { color: var(--ko-muted); font-style: italic; letter-spacing: 0; }

/*
 * Editing a code.
 *
 * The form used to live in the row's last cell, inside a <details>. A cell is
 * the wrong shape for a form - four stacked fields in a column a fifth of the
 * table wide, with the row's own data stranded beside it in 500px of empty
 * space. It cannot be fixed by styling, because a <details> cannot contain a
 * <tr>, so the form could never leave that one cell.
 *
 * So the editor is its own row, spanning every column, directly under the code
 * it edits - the shape a table already has for "more about this line". It is
 * hidden until its id is the fragment in the URL, which is a toggle the browser
 * implements for us: no JavaScript, back button works, and a link can point at
 * one specific code's editor.
 */
.ko-row-edit-row { display: none; }
.ko-row-edit-row:target { display: table-row; }
.ko-row-edit-row > td {
    padding: 0;
    background: rgba(0, 0, 0, .3);
    border-top: 0;
}

.ko-row-edit-panel {
    padding: 16px 18px 18px;
    text-align: left;
    border-left: 3px solid var(--ko-gold-dim);
}

.ko-row-edit-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--ko-line-soft);
}
.ko-row-edit-title {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--ko-gold);
}
/* Which code is being edited, said in the panel as well as in the row - once
   the panel is open it is the only thing on screen you are looking at. */
.ko-row-edit-code {
    margin-left: 10px;
    padding: 2px 8px;
    border-radius: 4px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12.5px;
    letter-spacing: .5px;
    text-transform: none;
    color: var(--ko-text);
    background: rgba(188, 143, 70, .12);
    border: 1px solid rgba(188, 143, 70, .3);
}
.ko-row-edit-close {
    flex: 0 0 auto;
    font-size: 20px;
    line-height: 1;
    padding: 0 6px;
    color: var(--ko-muted);
}
.ko-row-edit-close:hover { color: var(--ko-gold); text-decoration: none; }

/* Four short answers across the width the panel now has, instead of down a
   column that never had room for them. */
.ko-row-edit-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0 20px;
}
@media (min-width: 620px)  { .ko-row-edit-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1100px) { .ko-row-edit-grid { grid-template-columns: repeat(4, 1fr); } }

.ko-row-edit-form { text-align: left; margin: 0; }
.ko-row-edit-form .ko-field { margin-bottom: 14px; }
.ko-row-edit-form label { font-size: 12px; }
.ko-row-edit-form .ko-field-help { text-align: left; font-size: 12px; margin: 6px 0 0; }
.ko-row-edit-form .ko-field-help.is-warning { color: #e3b878; }

.ko-row-edit-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* Removing is fenced off from editing inside the same panel: a red button
   directly under "Save changes" reads as the pair's cancel. */
.ko-row-edit-form.is-danger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid rgba(192, 57, 43, .3);
}

/* ------------------------------------------------------- code categories */

/* One category, one row: its name, what it has left and what has gone, and the
   two things that can be done to it. The sidebar centres definition lists, so a
   category cannot be one - the name belongs at the left margin where the eye
   scans the list, with the numbers at the right where they line up. */
.ko-cat-list { list-style: none; margin: 0; padding: 0; }
.ko-cat {
    padding: 10px 0;
    border-bottom: 1px solid var(--ko-line-soft);
    text-align: left;
}
.ko-cat:last-child { border-bottom: 0; }
.ko-cat-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.ko-cat-name {
    color: var(--ko-gold-soft);
    font-weight: 600;
    word-break: break-word;
    min-width: 0;
}
.ko-cat-counts { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.ko-cat-edit { margin-top: 2px; }

/* ----------------------------------------------------------- code picker */

/* Every available code on offer at once, grouped under its category. A
   sponsorship is routinely paid out of more than one kind, so making staff
   choose a category first would turn one pass into three. */
/*
 * The picker is a list of short lines, so it is held to a column rather than
 * run to the full width of the card. Stretched across a wide page the code was
 * pinned to the left margin and its batch note to the right, with a hand's
 * width of nothing between them - two columns to read instead of one line.
 */
.ko-code-pick {
    max-width: 640px;
    margin: 0 auto;
    border: 1px solid var(--ko-line);
    border-radius: var(--ko-r-tile);
    background: rgba(0, 0, 0, .22);
    padding: 8px;
}
.ko-code-pick-filter {
    width: 100%;
    margin-bottom: 8px;
    /* The search box is a control, not a heading: the uppercase gold styling
       .ko-field label imposes on everything in a field has no business here. */
    text-align: left;
    text-transform: none;
    letter-spacing: 0;
}
/* The list scrolls rather than growing: a stash of three hundred codes must not
   push the approve button off the end of the page. Its scrollbar is the page's
   own, not the browser's bright default against black. */
.ko-code-pick-list {
    max-height: 420px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(188, 143, 70, .38) rgba(0, 0, 0, .35);
}
.ko-code-pick-list::-webkit-scrollbar { width: 8px; }
.ko-code-pick-list::-webkit-scrollbar-track { background: rgba(0, 0, 0, .35); border-radius: 4px; }
.ko-code-pick-list::-webkit-scrollbar-thumb {
    background: rgba(188, 143, 70, .38);
    border-radius: 4px;
}
.ko-code-pick-group { margin-bottom: 10px; }
.ko-code-pick-group:last-child { margin-bottom: 0; }
.ko-code-pick-group[hidden] { display: none; }
/*
 * The kind of code, and how many of it are left.
 *
 * It sticks to the top of the scrolling list, because the heading is what
 * tells you which kind you are ticking and scrolling it away leaves a column
 * of codes that all look alike. The count goes in a chip rather than floating
 * as a bare numeral at the end of the line, where it read as part of the name.
 */
.ko-code-pick-head {
    position: sticky;
    top: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 9px 12px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1.1px;
    text-transform: uppercase;
    color: var(--ko-gold);
    background: linear-gradient(180deg, rgba(32, 22, 10, .98), rgba(24, 17, 8, .96));
    border-bottom: 1px solid rgba(188, 143, 70, .3);
}
.ko-code-pick-head span {
    flex: 0 0 auto;
    min-width: 24px;
    padding: 1px 8px;
    border-radius: 999px;
    font-size: 11.5px;
    letter-spacing: 0;
    color: var(--ko-muted);
    background: rgba(154, 128, 85, .14);
    border: 1px solid rgba(154, 128, 85, .4);
}

/* The whole row is the label, so the code itself is the click target - at this
   size a 13px checkbox on its own is not. Each row is a line in a list, left
   aligned, so it is qualified past .ko-field label, which would otherwise make
   every row a centred uppercase gold heading. */
/*
 * One code. The whole row is the label, so the code itself is the click target
 * - at this size a 13px checkbox alone is not. Qualified past .ko-field label,
 * which would otherwise make every row a centred uppercase gold heading.
 *
 * The code is pushed left and its batch note right, with the gap between them
 * doing the separating, so the two kinds of information never run together
 * into one grey line.
 */
.ko-code-pick-row,
.ko-field label.ko-code-pick-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 0;
    padding: 10px 12px;
    cursor: pointer;
    border-radius: 5px;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0;
    text-align: left;
    text-transform: none;
    color: var(--ko-text);
    border-bottom: 1px solid rgba(188, 143, 70, .07);
}
.ko-code-pick-group .ko-code-pick-row:last-child { border-bottom: 0; }
.ko-code-pick-row .ko-code-cell { flex: 0 1 auto; font-size: 15px; }
.ko-code-pick-row input[type="checkbox"] { flex: 0 0 auto; }
.ko-code-pick-row:hover { background: rgba(232, 200, 122, .08); }
/* The ticked row says so across its whole width, not just in the box. */
.ko-code-pick-row:has(input:checked) {
    background: rgba(188, 143, 70, .14);
    box-shadow: inset 3px 0 0 var(--ko-gold-dim);
}
.ko-code-pick-row[hidden] { display: none; }

/* The browser's own tick box is a bright system square on a black gold page.
   The native input is kept - it is the accessible control, and it still tabs,
   toggles and reports state - but its painting is replaced with the same tile
   the declaration checkboxes use, at the size of a list row. */
.ko-code-pick-row input,
.ko-field .ko-code-pick-row input {
    appearance: none;
    -webkit-appearance: none;
    position: relative;
    flex: 0 0 auto;
    width: 17px;
    height: 17px;
    margin: 0;
    border: 1px solid rgba(232, 200, 122, .55);
    border-radius: 5px;
    background: rgba(0, 0, 0, .45);
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
/* A clan takes exactly one code, so there the control is a radio - round, and
   marked with a dot rather than a tick. */
.ko-code-pick-row input[type="radio"] { border-radius: 50%; }
.ko-code-pick-row:hover input,
.ko-code-pick-row input:hover { border-color: var(--ko-gold); }
.ko-code-pick-row input:focus-visible {
    outline: none;
    border-color: var(--ko-gold);
    box-shadow: 0 0 0 3px rgba(232, 200, 122, .28);
}
.ko-code-pick-row input:checked,
.ko-field .ko-code-pick-row input:checked {
    background: linear-gradient(180deg, #f3dda6, var(--ko-gold-dim));
    border-color: var(--ko-gold);
}
/* The tick is drawn, not typed: two borders of an empty box, rotated. */
.ko-code-pick-row input[type="checkbox"]:checked::after {
    content: "";
    position: absolute;
    left: 5px;
    top: 1px;
    width: 4px;
    height: 9px;
    border: solid #1a1206;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}
.ko-code-pick-row input[type="radio"]:checked::after {
    content: "";
    position: absolute;
    inset: 4px;
    border-radius: 50%;
    background: #1a1206;
}
/* The batch note, set as a quiet tag at the end of the row rather than as more
   text in the same colour and size as the code - it answers "which batch", not
   "which code", and it must never be mistaken for part of the code itself. */
.ko-code-pick-note {
    flex: 0 0 auto;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .3px;
    color: var(--ko-muted);
    background: rgba(154, 128, 85, .1);
    border: 1px solid rgba(154, 128, 85, .28);
    text-align: right;
    word-break: break-word;
}
.ko-code-pick-count { display: block; margin-top: 4px; color: var(--ko-gold-soft); }
/* Over the allowance: the submit button is disabled with it, so the line has to
   read as the reason rather than as another tally. */
.ko-code-pick-count.is-over { color: var(--ko-err); font-weight: 700; }

/* ---------------------------------------------------------------- forms */

.ko-form { max-width: 100%; }
.ko-field-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0 22px;
}
@media (min-width: 768px) { .ko-field-grid { grid-template-columns: 1fr 1fr; } }
/* Three short answers about one thing - the clan's name, its leader and its
   size - read as a row rather than a stack, once there is room for three. */
@media (min-width: 900px) { .ko-field-grid.is-three { grid-template-columns: repeat(3, 1fr); } }

.ko-field { margin-bottom: 18px; min-width: 0; }
.ko-field.is-full { grid-column: 1 / -1; }

.ko-field label, .ko-label {
    display: block;
    text-align: center;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .6px;
    text-transform: uppercase;
    color: var(--ko-gold-soft);
    margin-bottom: 7px;
}
.ko-req { color: var(--ko-amber); }

/* Form controls.
   Scoped to .ko-form as well as .ko-field so that controls which sit outside a
   .ko-field wrapper - notably the clan roster rows - are styled too, instead of
   falling back to the browser's white default on a dark page. */
.ko-field input[type="text"],
.ko-field input[type="email"],
.ko-field input[type="password"],
.ko-field input[type="number"],
.ko-field input[type="url"],
.ko-field input[type="date"],
.ko-field input[type="search"],
.ko-field select,
.ko-field textarea,
.ko-form input[type="text"],
.ko-form input[type="email"],
.ko-form input[type="password"],
.ko-form input[type="number"],
.ko-form input[type="url"],
.ko-form input[type="date"],
.ko-form input[type="search"],
.ko-form select,
.ko-form textarea {
    width: 100%;
    background: rgba(0, 0, 0, .35);
    border: 1px solid var(--ko-line);
    border-radius: var(--ko-r-btn);
    color: var(--ko-input);
    padding: 10px 12px;
    font-size: 15px;
    font-family: var(--ko-body);
    line-height: 1.5;
    transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.ko-field textarea, .ko-form textarea {
    min-height: 110px;
    resize: vertical;
    /* A textarea long enough to scroll gets the page's own scrollbar, not the
       browser's bright default against black. */
    scrollbar-width: thin;
    scrollbar-color: rgba(188, 143, 70, .38) rgba(0, 0, 0, .35);
}
.ko-field textarea::-webkit-scrollbar, .ko-form textarea::-webkit-scrollbar { width: 8px; }
.ko-field textarea::-webkit-scrollbar-track, .ko-form textarea::-webkit-scrollbar-track { background: rgba(0, 0, 0, .35); }
.ko-field textarea::-webkit-scrollbar-thumb, .ko-form textarea::-webkit-scrollbar-thumb {
    background: rgba(188, 143, 70, .38);
    border-radius: 4px;
}
.ko-field select, .ko-form select {
    appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, var(--ko-muted) 50%), linear-gradient(135deg, var(--ko-muted) 50%, transparent 50%);
    background-position: calc(100% - 18px) calc(50% + 2px), calc(100% - 13px) calc(50% + 2px);
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
    /* The arrow sits in its own gutter on the right, so the chosen value is
       padded by the same amount on the left and stays optically centred. */
    padding-left: 34px;
    padding-right: 34px;
    text-align: center;
}
.ko-field select option, .ko-form select option { background: var(--ko-bg-1); color: var(--ko-input); }

/* Tick boxes are left out: this is the focused-text-field background, and on a
   checkbox or radio it paints over the gold fill that says the thing is ticked
   - so a box clicked and still holding focus looked unticked until the focus
   moved on. They carry their own focus ring where they are styled. */
.ko-field input:not([type="checkbox"]):not([type="radio"]):focus,
.ko-field select:focus, .ko-field textarea:focus,
.ko-form input:not([type="checkbox"]):not([type="radio"]):focus,
.ko-form select:focus, .ko-form textarea:focus {
    outline: none;
    border-color: var(--ko-gold);
    box-shadow: 0 0 0 3px rgba(232, 200, 122, .18);
    background: rgba(0, 0, 0, .5);
}
.ko-field input::placeholder, .ko-field textarea::placeholder,
.ko-form input::placeholder, .ko-form textarea::placeholder {
    color: rgba(154, 128, 85, .7);
    font-style: italic;
}
.ko-field.has-error input, .ko-field.has-error select, .ko-field.has-error textarea {
    border-color: var(--ko-danger-br);
}
.ko-field-help  { font-size: 15px; color: var(--ko-muted); margin-top: 6px; line-height: 1.5; text-align: center; }
.ko-field-error { font-size: 15px; color: var(--ko-err); margin-top: 6px; font-weight: 600; text-align: center; }

/* An amount is a short answer: alone in its card it is held to a column the
   width of the figure it takes, centred, rather than run across the card. Its
   help sentence keeps the full width to stay readable. */
.ko-kc-amount .ko-input-suffix { max-width: 300px; margin: 0 auto; }

.ko-input-suffix { display: flex; align-items: stretch; gap: 0; }
.ko-input-suffix input { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.ko-input-suffix span {
    display: flex;
    align-items: center;
    padding: 0 14px;
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--ko-muted);
    background: rgba(0, 0, 0, .5);
    border: 1px solid var(--ko-line);
    border-left: 0;
    border-radius: 0 var(--ko-r-btn) var(--ko-r-btn) 0;
    white-space: nowrap;
}

.ko-radio-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 600px) { .ko-radio-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 992px) { .ko-radio-grid.is-three { grid-template-columns: repeat(3, 1fr); } }

/* A closed question inside a questionnaire field reads on the same centre line
   as its own label, instead of hanging its two dots off the left edge. The
   child selector keeps this off the category picker, which is itself a
   .ko-field and wants the full row. */
.ko-field > .ko-radio-grid { max-width: 460px; margin: 0 auto; }
.ko-field > .ko-radio-grid .ko-radio { justify-content: center; }

.ko-radio {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 14px;
    border: 1px solid var(--ko-line-soft);
    border-radius: var(--ko-r-tile);
    background: rgba(0, 0, 0, .3);
    cursor: pointer;
    font-size: 14px;
    transition: border-color .15s ease, background .15s ease;
}
.ko-radio:hover { border-color: var(--ko-line); background: rgba(232, 200, 122, .06); }
.ko-radio input { accent-color: var(--ko-gold); flex-shrink: 0; }
.ko-radio.is-checked { border-color: var(--ko-gold); background: rgba(232, 200, 122, .12); }

.ko-form-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
    padding-top: 8px;
    border-top: 1px solid var(--ko-line-soft);
    margin-top: 22px;
}
/* Kept as a hook on the markup that already carries it; the whole application
   now reads down one centre line, so it no longer pushes to the end. */
.ko-form-actions.is-end { justify-content: center; }
/* An action that finishes the field above it rather than a whole form: no rule
   across the card to imply a section break that is not there. */
.ko-form-actions.is-plain { border-top: 0; padding-top: 0; margin-top: 20px; }

/* --------------------------------------------------- clan member list */

.ko-members { list-style: none; margin: 0 0 14px; padding: 0; }
.ko-member-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}
.ko-member-num {
    flex: 0 0 34px;
    font-family: var(--ko-display);
    font-size: 13px;
    font-weight: 700;
    color: var(--ko-muted);
    text-align: right;
}
.ko-member-row input { flex: 1; min-width: 0; }
.ko-member-remove {
    flex: 0 0 auto;
    background: rgba(191, 83, 41, .12);
    border: 1px solid rgba(191, 83, 41, .4);
    color: #f0c4b0;
    border-radius: var(--ko-r-btn);
    padding: 8px 11px;
    font-size: 12px;
    cursor: pointer;
    line-height: 1;
}
.ko-member-remove:hover { border-color: var(--ko-danger-br); color: #fff; }

.ko-member-counter {
    font-family: var(--ko-display);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    padding: 9px 14px;
    border-radius: var(--ko-r-tile);
    display: inline-block;
    margin-bottom: 12px;
}
.ko-member-counter.is-ok    { color: #a9e8bd; background: rgba(90, 200, 120, .14); border: 1px solid rgba(90, 200, 120, .45); }
.ko-member-counter.is-short { color: #e3b878; background: rgba(212, 148, 58, .14); border: 1px solid rgba(212, 148, 58, .45); }

/* The roster is fourteen short nicknames, not fourteen sentences. Run across
   the full width of the card each row reads as an empty bar; held to a column
   the width of the name it holds, and centred with the rest of the step, the
   list reads as one block. The counter and the add button ride the same
   centre line rather than hanging off the left edge above and below it. */
.ko-member-list { max-width: 520px; margin: 0 auto; }
.ko-member-add { display: block; margin-left: auto; margin-right: auto; }
.ko-member-counter { margin-left: auto; margin-right: auto; }
.ko-apply .ko-member-counter { display: table; }
.ko-apply .ko-eligibility-note { text-align: center; }

/* --------------------------------------------------------------- tables */

.ko-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(188, 143, 70, .38) rgba(0, 0, 0, .35);
}
.ko-table-wrap::-webkit-scrollbar { height: 8px; }
.ko-table-wrap::-webkit-scrollbar-track { background: rgba(0, 0, 0, .35); }
.ko-table-wrap::-webkit-scrollbar-thumb { background: rgba(188, 143, 70, .38); border-radius: 4px; }
.ko-table { width: 100%; border-collapse: collapse; min-width: 620px; }
.ko-table th {
    position: sticky;
    top: 0;
    background: var(--ko-bg-1);
    border-bottom: 1px solid var(--ko-line);
    padding: 11px 12px;
    font-family: var(--ko-display);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--ko-muted);
    text-align: center;
    /* A wide table used to be sized by its widest heading - "APPROVED WEEKLY
       KC" on one unbreakable line - which pushed the last columns past the edge
       of the card. Letting headings wrap lets the table fit the page instead. */
    white-space: normal;
}
.ko-table td {
    padding: 11px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, .04);
    font-size: 15px;
    vertical-align: middle;
    text-align: center;
}
/* Two things must never be broken across lines in a table cell: the label on a
   button, and a date - "VIEW" split into VIE/W, or 04/09/202 / 6, is not a
   narrower column, just an unreadable one. */
.ko-table .ko-btn,
.ko-table-nowrap { white-space: nowrap; }
.ko-table tbody tr:nth-child(odd) td { background: rgba(20, 15, 5, .5); }
.ko-table tbody tr:hover td { background: rgba(232, 200, 122, .06); }
.ko-table tbody tr:last-child td { border-bottom: 0; }
.ko-table .is-num { font-variant-numeric: tabular-nums; }

/* A ten-column admin table does not fit the 1170px reading column, and a table
   you have to scroll sideways cannot be scanned - the status of row 7 is on one
   screen and which sponsorship it belongs to is on another. Two things buy the
   room back.

   First, the card holding it steps outside the container: 50% over, then half
   its own width back, which centres it on the page whatever the container is.
   It is capped so the columns never stretch into a sparse band on a wide
   monitor, and left alone below 1200px, where the horizontal scroll is the
   honest answer. */
@media (min-width: 1200px) {
    .ko-card.is-wide {
        width: min(96vw, 1560px);
        margin-left: 50%;
        transform: translateX(-50%);
    }
}

/* Second, the cells themselves are tightened. Every column here is a date, a
   number, a badge or a short name, so the generous padding of a reading table
   is spent on gaps rather than on content. */
.ko-table.is-dense th,
.ko-table.is-dense td { padding: 9px 8px; }
.ko-table.is-dense td { font-size: 13.5px; }
.ko-table.is-dense th { font-size: 11px; letter-spacing: .8px; }
.ko-table.is-dense .ko-btn-sm { padding: 6px 10px; font-size: 11.5px; letter-spacing: .6px; }
.ko-table.is-dense .ko-badge { padding: 3px 7px; font-size: 10.5px; }

/* Shrink a column to its content. In auto table layout a 1% width collapses to
   the minimum the content needs, so index columns (#1, #2 ...) stop stealing
   half the table. */
.ko-table .ko-col-shrink { width: 1%; white-space: nowrap; }
.ko-table-ref { font-family: var(--ko-display); font-weight: 700; color: var(--ko-gold-soft); white-space: nowrap; }

/* ------------------------------------------------------------ stat cards */

.ko-stats { display: grid; grid-template-columns: 1fr; gap: 16px; margin-bottom: 30px; }
@media (min-width: 560px) { .ko-stats { grid-template-columns: 1fr 1fr; } }
@media (min-width: 992px) { .ko-stats { grid-template-columns: repeat(4, 1fr); } }

.ko-stat {
    border: 1px solid var(--ko-line-soft);
    border-radius: var(--ko-r-card);
    background: linear-gradient(180deg, rgba(23, 16, 8, .9), rgba(10, 8, 5, .95));
    padding: 18px;
    box-shadow: var(--ko-shadow-card);
    display: block;
}
.ko-stat:hover { text-decoration: none; border-color: var(--ko-line); }
.ko-stat-label {
    font-size: 12px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--ko-muted);
    margin-bottom: 8px;
}
.ko-stat-value {
    font-family: var(--ko-display);
    font-size: 30px;
    font-weight: 900;
    color: var(--ko-gold-soft);
    line-height: 1;
}
.ko-stat.is-amber .ko-stat-value { color: var(--ko-amber); }
.ko-stat.is-ok .ko-stat-value    { color: var(--ko-ok); }

/* -------------------------------------------------------- detail lists */

.ko-dl { margin: 0; }
.ko-dl-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 9px 0;
    border-bottom: 1px solid rgba(255, 255, 255, .04);
    font-size: 15px;
}
.ko-dl-row:last-child { border-bottom: 0; }
/* A history row is a timestamp and a status, both read as content rather than
   as a label naming a value, so the pair is set a notch above the body size. */
.ko-dl-row.is-history { font-size: 17px; }
.ko-dl-key { color: var(--ko-muted); flex: 0 0 auto; }
.ko-dl-val { color: var(--ko-gold-soft); text-align: right; word-break: break-word; min-width: 0; }
.ko-dl-val.is-plain { color: var(--ko-text); }

/* An answer and its question read as one centred block: the label directly
   over its value, in a column narrow enough that a one-word answer does not
   sit alone at the far left of a wide card. */
.ko-qa { margin-bottom: 16px; max-width: 640px; margin-left: auto; margin-right: auto; text-align: center; }
.ko-qa:last-child { margin-bottom: 0; }
.ko-qa-q {
    font-size: 13px;
    letter-spacing: .8px;
    text-transform: uppercase;
    color: var(--ko-muted);
    margin-bottom: 4px;
}
.ko-qa-a { color: var(--ko-text); white-space: pre-wrap; word-break: break-word; margin: 0; }

/* A message exactly as it was sent: the line breaks in a mail body carry its
   shape, so they are kept, while long unbroken strings still wrap instead of
   pushing the card sideways. Body text rather than monospace - it is a letter,
   not code. */
.ko-pre {
    color: var(--ko-text);
    white-space: pre-wrap;
    word-break: break-word;
    font-family: inherit;
    font-size: inherit;
    margin: 0;
}

/* ------------------------------------------------------- conversation */

.ko-msg {
    border: 1px solid var(--ko-line-soft);
    border-radius: var(--ko-r-card);
    padding: 14px 16px;
    margin-bottom: 14px;
    background: rgba(0, 0, 0, .28);
}
.ko-msg-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 8px;
    /* Author and timestamp are one line of the same text, so they are set at
       one size - the body's - rather than the timestamp reading as a footnote. */
    font-size: 15px;
}
.ko-msg-author { font-weight: 700; color: var(--ko-gold-soft); letter-spacing: .5px; }
.ko-msg-time { color: var(--ko-muted); }
.ko-msg-body { white-space: pre-wrap; word-break: break-word; margin: 0; color: var(--ko-text); }

.ko-msg.is-staff { border-left: 3px solid var(--ko-gold-dim); }
.ko-msg.is-applicant { border-left: 3px solid var(--ko-line); }

/* Internal notes look deliberately unlike anything the applicant can see. */
.ko-msg.is-internal {
    border: 1px dashed rgba(212, 148, 58, .6);
    border-left: 3px solid var(--ko-amber);
    background:
        repeating-linear-gradient(135deg, rgba(212, 148, 58, .05) 0 10px, transparent 10px 20px),
        rgba(212, 148, 58, .07);
}
.ko-msg.is-internal .ko-msg-author { color: var(--ko-amber); }

/* ----------------------------------------------------------- copy field */

.ko-copy { display: flex; align-items: center; gap: 10px; min-width: 0; margin-top: 4px; margin-bottom: 14px; }
.ko-copy:last-child { margin-bottom: 0; }
.ko-copy-val {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 14px;
    color: var(--ko-gold-soft);
    word-break: break-all;
    min-width: 0;
}
.ko-copy-btn {
    flex: 0 0 auto;
    background: rgba(232, 200, 122, .12);
    border: 1px solid rgba(232, 200, 122, .35);
    color: var(--ko-gold-soft);
    border-radius: 4px;
    padding: 4px 9px;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .8px;
    text-transform: uppercase;
    cursor: pointer;
}
.ko-copy-btn:hover { border-color: var(--ko-gold); color: #fff; }

/* --------------------------------------------------------------- flash */

.ko-flash { margin-bottom: 20px; }
.ko-flash-item {
    border-radius: var(--ko-r-tile);
    padding: 13px 17px;
    margin-bottom: 10px;
    font-size: 14px;
    border: 1px solid;
}
.ko-flash-item.is-success { color: #b6e6c4; background: rgba(90, 200, 120, .12); border-color: rgba(90, 200, 120, .45); }
.ko-flash-item.is-error   { color: #f0c4b0; background: rgba(191, 83, 41, .14);  border-color: rgba(191, 83, 41, .5); }
.ko-flash-item.is-info    { color: var(--ko-gold-soft); background: rgba(232, 200, 122, .10); border-color: var(--ko-line); }

/* The summary heading already says these are the problems, so each message is
   simply its own line - a bullet beside a single centred error only adds an
   orphaned marker off to the side. */
.ko-errors { margin-bottom: 20px; text-align: center; }
.ko-errors ul { list-style: none; margin: 8px 0 0; padding: 0; }
.ko-errors li { margin-bottom: 4px; }
.ko-errors li:last-child { margin-bottom: 0; }

/* --------------------------------------------------------------- misc */

.ko-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--ko-muted);
    font-size: 15.5px;
}
.ko-layout-split { display: grid; grid-template-columns: 1fr; gap: 22px; align-items: start; }
@media (min-width: 992px) {
    .ko-layout-split { grid-template-columns: minmax(0, 1fr) 340px; }
    /* Keep contact details and actions in view while reading a long
       application, instead of stranding them at the top of the page. */
    .ko-layout-split > aside {
        position: sticky;
        top: 78px;
        max-height: calc(100vh - 96px);
        overflow-y: auto;
        overscroll-behavior: contain;

        /* Chrome ignores the ::-webkit-scrollbar rules below as soon as a
           standard scrollbar property is set, so the colours have to be given
           here too - without them the column gets the UA's bright grey slab
           down the side of a dark page. */
        scrollbar-width: thin;
        scrollbar-color: rgba(188, 143, 70, .38) rgba(0, 0, 0, .35);
    }
    .ko-layout-split > aside::-webkit-scrollbar { width: 6px; }
    .ko-layout-split > aside::-webkit-scrollbar-track { background: rgba(0, 0, 0, .35); }
    .ko-layout-split > aside::-webkit-scrollbar-thumb {
        background: rgba(188, 143, 70, .38);
        border-radius: 3px;
    }
    .ko-layout-split > aside::-webkit-scrollbar-thumb:hover { background: rgba(212, 168, 90, .55); }
}

.ko-tabs { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.ko-tab {
    background: rgba(188, 143, 70, .08);
    border: 1px solid rgba(188, 143, 70, .22);
    color: var(--ko-muted);
    border-radius: 5px;
    padding: 7px 16px;
    font-size: 13.5px;
    font-weight: 700;
    letter-spacing: 1px;
    cursor: pointer;
}
.ko-tab:hover { background: rgba(188, 143, 70, .2); color: var(--ko-text); text-decoration: none; }
.ko-tab.is-active { background: rgba(188, 143, 70, .3); color: var(--ko-gold); border-color: rgba(188, 143, 70, .7); }

/*
 * A form broken into numbered steps.
 *
 * Used where a single form asks for several unrelated things - a recipient, a
 * set of codes, some words - and a plain stack of fields gives no sense of
 * where you are in it or how much is left. The number is the whole device: it
 * turns "another box" into "step 2 of 3".
 */
.ko-step .ko-card-head { justify-content: flex-start; gap: 12px; }
.ko-step-no {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    font-family: var(--ko-display);
    font-size: 13px;
    font-weight: 700;
    color: #1a1206;
    background: linear-gradient(180deg, var(--ko-gold), var(--ko-gold-dim));
}

/*
 * The reward email as it will arrive, rebuilt as it is typed.
 *
 * It was a folded-away sample of the fixed wording, which answered the wrong
 * question: what a sender wants to know is what THEIR message looks like in
 * it, and a static block of template never shows that. So it is open, it is
 * live, and it is styled as a piece of mail - a header line carrying the
 * subject, then the body - rather than as another form field.
 */
.ko-preview-live {
    margin-top: 22px;
    padding: 16px 18px 18px;
    border: 1px solid var(--ko-line-soft);
    border-left: 3px solid var(--ko-gold-dim);
    border-radius: var(--ko-r-tile);
    background: rgba(0, 0, 0, .28);
    text-align: left;
}
.ko-preview-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 8px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--ko-line-soft);
}
.ko-preview-title {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--ko-gold);
}
/* The subject line is part of what arrives, so it is shown with the body
   rather than left as the one thing the sender cannot see. */
.ko-preview-subject {
    font-size: 13px;
    color: var(--ko-muted);
    font-style: italic;
}
.ko-preview-live .ko-field-help { text-align: left; margin: 0 0 12px; }
.ko-preview-live .ko-pre {
    margin: 0;
    padding: 14px 16px;
    max-height: 420px;
    overflow: auto;
    font-size: 13.5px;
    line-height: 1.65;
    color: var(--ko-text);
    background: rgba(0, 0, 0, .35);
    border: 1px solid var(--ko-line-soft);
    border-radius: 6px;
}

/* The wording the system adds around a written message. Folded away by
   default: it is reference, not a decision, and it is the same every time. */
.ko-preview { margin-top: 18px; }
.ko-preview > summary {
    cursor: pointer;
    list-style: none;
    padding: 8px 0;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1.1px;
    text-transform: uppercase;
    color: var(--ko-gold-dim);
}
.ko-preview > summary::-webkit-details-marker { display: none; }
.ko-preview > summary::before { content: "+ "; }
.ko-preview[open] > summary::before { content: "- "; }
.ko-preview > summary:hover { color: var(--ko-gold); }
.ko-preview .ko-field-help { text-align: left; margin: 0 0 10px; }

/*
 * A filter panel that folds.
 *
 * A screenful of controls before the first row is a screenful you scroll past
 * on every visit but the rare one where you are changing them. As a <details>
 * it costs a click to open and nothing to ignore - and no JavaScript, so it
 * works on the first paint rather than after one.
 *
 * It is rendered open whenever a filter is actually set. That is the part that
 * matters: a folded panel quietly removing rows is exactly how a filtered list
 * gets mistaken for an empty one.
 */
.ko-filter-panel > summary {
    cursor: pointer;
    list-style: none;
}
.ko-filter-panel > summary::-webkit-details-marker { display: none; }

/* As a card head: the whole bar is the toggle, with a caret standing in for
   the disclosure triangle the browser would otherwise draw at the far left. */
.ko-filter-panel > summary.ko-card-head::after {
    content: "\25BE";
    color: var(--ko-gold-dim);
    transition: transform .15s ease;
}
.ko-filter-panel[open] > summary.ko-card-head::after { content: "\25B4"; }
.ko-filter-panel > summary.ko-card-head:hover { background: rgba(188, 143, 70, .08); }

/* Inset in a card that already has a head of its own. */
.ko-filter-panel.is-inset { margin: 0; padding: 0 18px 4px; }
.ko-filter-panel.is-inset > summary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 0;
    font-family: var(--ko-display);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    color: var(--ko-gold-dim);
}
.ko-filter-panel.is-inset > summary::after {
    content: "\25BE";
    letter-spacing: 0;
}
.ko-filter-panel.is-inset[open] > summary::after { content: "\25B4"; }
.ko-filter-panel.is-inset > summary:hover { color: var(--ko-gold); }

/* ------------------------------------------------------ staff section nav */

/*
 * The staff area's section bar.
 *
 * It used to be a .ko-tabs row, identical to the filter row that several pages
 * put immediately beneath it: two lines of the same gold pill, one changing
 * page and one narrowing a list, with nothing but the words to tell them
 * apart. This is the navigation, so it is the heavier of the two - enclosed in
 * its own bar, and with an active tab that is filled and underlined rather than
 * a shade darker than its neighbours.
 *
 * On a narrow screen it scrolls sideways instead of wrapping to three ragged
 * lines. The section you are in stays put at the left of that scroll because it
 * is the one thing you need to see without moving anything.
 */
.ko-adminnav {
    display: flex;
    align-items: stretch;
    gap: 4px;
    margin: 0 auto 22px;
    padding: 6px;
    max-width: max-content;
    background: rgba(0, 0, 0, .34);
    border: 1px solid var(--ko-line-soft);
    border-radius: 9px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .03);
    overflow-x: auto;
    scrollbar-width: thin;
}

.ko-adminnav-link {
    position: relative;
    flex: 0 0 auto;
    padding: 8px 15px 9px;
    border-radius: 6px;
    font-size: 13.5px;
    font-weight: 700;
    letter-spacing: .9px;
    white-space: nowrap;
    color: var(--ko-muted);
    border: 1px solid transparent;
    text-decoration: none;
}
.ko-adminnav-link:hover {
    background: rgba(188, 143, 70, .12);
    color: var(--ko-text);
    text-decoration: none;
}

/*
 * The open section, stated twice over - filled, and underscored. One signal is
 * a shade of gold against four other shades of gold; two is unmistakable, and
 * the underscore survives being read by somebody who cannot separate the
 * shades at all.
 */
.ko-adminnav-link.is-active {
    background: rgba(188, 143, 70, .26);
    border-color: rgba(188, 143, 70, .6);
    color: var(--ko-gold);
}
.ko-adminnav-link.is-active::after {
    content: "";
    position: absolute;
    left: 13px;
    right: 13px;
    bottom: 3px;
    height: 2px;
    border-radius: 2px;
    background: var(--ko-gold);
}

/* Staff pages to the left of it, the administrator's own to the right. */
.ko-adminnav-sep {
    flex: 0 0 auto;
    width: 1px;
    margin: 4px 7px;
    background: linear-gradient(180deg,
        rgba(188, 143, 70, 0), rgba(188, 143, 70, .45), rgba(188, 143, 70, 0));
}

@media (max-width: 560px) {
    .ko-adminnav { max-width: 100%; justify-content: flex-start; border-radius: 0; }
}

/* ------------------------------------------------------------- filter row */

/*
 * A row that narrows the list under it.
 *
 * It must not be mistaken for the section bar above it, and the first attempt
 * at that made it small and faint - which solved the confusion by making the
 * filters hard to read, a bad trade. Distinguish by shape and by wording
 * instead: the nav is an enclosed bar of square tabs, this is a labelled strip
 * of round ones, and the chosen filter is filled solid gold rather than tinted.
 * Solid-on-dark is the strongest contrast available here, so the one thing you
 * most need to know - which filter is on - is the most visible thing in the
 * row.
 */
.ko-filterbar {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px 14px;
    margin: 0 auto 22px;
    padding: 9px 16px;
    max-width: max-content;
    background: rgba(0, 0, 0, .22);
    border: 1px solid rgba(188, 143, 70, .16);
    border-radius: 999px;
}
.ko-filterbar-label {
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    color: var(--ko-gold-dim);
    white-space: nowrap;
}
.ko-filterbar-label::after { content: ":"; }

.ko-tabs.is-filter { margin-bottom: 0; gap: 7px; }
.ko-tabs.is-filter .ko-tab {
    padding: 7px 16px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: .5px;
    border-radius: 999px;
    color: var(--ko-text);
    background: rgba(188, 143, 70, .1);
    border-color: rgba(188, 143, 70, .35);
}
.ko-tabs.is-filter .ko-tab:hover {
    background: rgba(188, 143, 70, .24);
    border-color: rgba(188, 143, 70, .6);
    color: var(--ko-gold);
}

/*
 * The filter that is on, stated the loudest thing in the row: filled, dark
 * text on gold. Nothing else on these pages is drawn this way, so there is
 * never a question of which pill is the live one - and the dark-on-light
 * reversal reads at a glance even for someone who cannot separate the golds.
 */
.ko-tabs.is-filter .ko-tab.is-active {
    background: linear-gradient(180deg, var(--ko-gold), var(--ko-gold-dim));
    border-color: var(--ko-gold);
    color: #1a1206;
    box-shadow: 0 1px 10px rgba(188, 143, 70, .3);
}
.ko-tabs.is-filter .ko-tab.is-active:hover {
    color: #1a1206;
    text-decoration: none;
}

@media (max-width: 620px) {
    .ko-filterbar { max-width: 100%; border-radius: 14px; }
}


.ko-pagination { display: flex; gap: 6px; justify-content: center; margin-top: 22px; flex-wrap: wrap; }
.ko-pagination a, .ko-pagination span {
    padding: 7px 13px;
    border: 1px solid var(--ko-line-soft);
    border-radius: var(--ko-r-btn);
    font-size: 13px;
}
.ko-pagination .is-current { background: rgba(232, 200, 122, .16); color: var(--ko-gold); border-color: var(--ko-line); }

.ko-footer {
    flex-shrink: 0;
    border-top: 1px solid var(--ko-line-soft);
    background: rgba(0, 0, 0, .45);
    padding: 22px 0;
    text-align: center;
    font-size: 13px;
    color: var(--ko-muted);
}
.ko-footer p { margin: 0 0 6px; }
.ko-footer p:last-child { margin: 0; }

/* --------------------------------------------------------- error page */

.ko-error-page { text-align: center; padding: 70px 20px; }
.ko-error-code {
    font-family: var(--ko-display);
    font-size: 76px;
    font-weight: 900;
    color: var(--ko-gold-dim);
    line-height: 1;
    margin-bottom: 12px;
}

/* -------------------------------------------------------- responsive */

@media (max-width: 860px) {
    .ko-header-inner { min-height: 56px; padding: 8px 0; }
    .ko-nav-toggle {
        display: inline-block;
        background: rgba(10, 8, 5, .6);
        border: 1px solid var(--ko-line);
        color: var(--ko-gold);
        border-radius: var(--ko-r-btn);
        padding: 8px 13px;
        font-size: 12px;
        font-weight: 700;
        letter-spacing: 1.2px;
        text-transform: uppercase;
        cursor: pointer;
    }
    /* Nav collapses, but the language pills stay on the bar - the selector
       must remain reachable without opening a menu. */
    .ko-nav {
        display: none;
        order: 3;
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 2px;
        padding: 10px 0 4px;
        border-top: 1px solid var(--ko-line-soft);
        margin-top: 8px;
    }
    .ko-nav.is-open { display: flex; }
    .ko-nav a { padding: 11px 12px; }
    .ko-lang { order: 2; }
}

@media (max-width: 560px) {
    .ko-hero { padding: 34px 12px 26px; }
    .ko-hero h1 { font-size: 27px; letter-spacing: 2px; }
    .ko-hero-lead { font-size: 15px; }
    .ko-section-title { font-size: 19px; letter-spacing: 1.4px; gap: 12px; }
    .ko-btn { padding: 11px 20px; font-size: 13px; }
    .ko-brand-sub { display: none; }
    .ko-lang { padding-left: 0; margin-left: 0; border-left: 0; }
    .ko-lang-pill { padding: 5px 9px 5px 6px; font-size: 12px; gap: 5px; }
    .ko-flag { width: 19px; height: 13px; }
    .ko-card-body, .ko-package-body { padding: 15px; }
    .ko-dl-row { flex-direction: column; gap: 2px; }
    .ko-dl-val { text-align: left; }
    .ko-member-num { flex-basis: 26px; }
    .ko-error-code { font-size: 56px; }
}

@media (prefers-reduced-motion: reduce) {
    * { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
    .ko-btn:hover, .ko-package:hover { transform: none; }
}

@media print {
    .ko-header, .ko-footer, .ko-form-actions, .ko-nav-toggle { display: none; }
    body { background: #fff; color: #000; }
}

/* ------------------------------------------------- centred info sections */

/* The explainer reads as a centred statement rather than left-aligned body
   copy. */
.ko-steps-card .ko-card-body { text-align: center; }
.ko-duration-note { text-align: center; }

/* ---------------------------------------------------- background scrim */

/* Sits between the artwork and the page content: transparent at the very top
   so the image reads, then opaque enough that text never competes with it. */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        linear-gradient(180deg,
            rgba(10, 8, 5, .55) 0,
            rgba(10, 8, 5, .78) 220px,
            rgba(13, 10, 6, .93) 520px,
            var(--ko-bg-0) 780px);
}

/* ------------------------------------------------------- hidden elements */

/* An explicit `display` on an element beats the browser's built-in
   `[hidden] { display: none }`, which silently left hidden package panels on
   screen. This makes the attribute authoritative wherever it is used. */
[hidden] { display: none !important; }

/* Larger, per the KO-MYKO reading rhythm. */
.ko-package details.ko-details > summary { font-size: 14.5px; letter-spacing: 1.3px; }
.ko-package-picker .ko-label { font-size: 15px; letter-spacing: .8px; }

/* Statement copy in the info cards reads a step larger than body text. */
.ko-steps-card .ko-steps li { font-size: 16px; }
.ko-duration-note { font-size: 15px; }

/* Centred info cards are held to a comfortable measure rather than the full
   container width - centred text across 1170px is hard to track. */
.ko-steps-card,
.ko-section > .ko-no-guarantee { max-width: 780px; margin-left: auto; margin-right: auto; }
.ko-steps-card .ko-card-body { padding: 10px 22px; }

/* Flag-only language pills. */
.ko-lang { gap: 6px; }
.ko-lang-code { display: none; }
.ko-lang-pill .ko-flag { opacity: .7; }
.ko-lang-pill:hover .ko-flag { opacity: 1; }
.ko-lang-pill.is-active .ko-flag { opacity: 1; }
.ko-lang-pill.is-active { box-shadow: 0 0 0 1px var(--ko-gold), 0 0 14px rgba(232, 200, 122, .25); }

/* ------------------------------------------------------- back to top */

.ko-to-top {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 50;
    width: 44px;
    height: 44px;
    display: none;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid var(--ko-line);
    background: linear-gradient(180deg, rgba(23, 16, 8, .96), rgba(10, 8, 5, .98));
    color: var(--ko-gold);
    font-size: 19px;
    line-height: 1;
    cursor: pointer;
    box-shadow: var(--ko-shadow-card);
    transition: border-color .15s ease, color .15s ease, transform .15s ease;
}
.ko-to-top.is-visible { display: flex; }
.ko-to-top:hover { border-color: var(--ko-gold); color: var(--ko-gold-soft); transform: translateY(-2px); }
@media (max-width: 560px) { .ko-to-top { right: 12px; bottom: 12px; width: 40px; height: 40px; } }

/* A rectangular flag needs a rectangular frame - the pill radius clipped the
   corners awkwardly. Small matching radii instead. */
.ko-lang-pill { border-radius: 7px; padding: 4px; line-height: 0; }
.ko-lang-pill .ko-flag { border-radius: 3px; box-shadow: none; display: block; }
.ko-lang-pill.is-active { border-color: var(--ko-gold); }

/* Language selector, 5% tighter. */
.ko-lang-pill { padding: 3px; border-radius: 6px; }
.ko-lang-pill .ko-flag { width: 32px; height: 23px; }
.ko-lang { gap: 5px; }

/* The hero sits directly above the package chooser - no dead space between. */
.ko-hero { padding: 34px 16px 20px; margin-bottom: 18px; }
.ko-hero-lead { margin-bottom: 0; }

/* Reward names carry a gold checkmark again. The list stays centred as a
   block, but each line is marker + text so the markers align with each other
   rather than scattering. */
.ko-reward-names { display: inline-block; text-align: left; }
.ko-reward-names li { position: relative; padding: 2px 0 2px 22px; }
.ko-reward-names li::before {
    content: "\2713";
    position: absolute;
    left: 0;
    color: var(--ko-gold);
    font-weight: 700;
}
.ko-reward-group { text-align: center; }

/* Link back to the main KO-MYKO panel, framed like the language pills so the
   header reads as one control group. */
.ko-home-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 3px;
    border: 1px solid var(--ko-line);
    border-radius: 6px;
    background: rgba(10, 8, 5, .6);
    color: var(--ko-gold-dim);
    line-height: 0;
    transition: color .15s ease, border-color .15s ease, background .15s ease;
}
.ko-home-link:hover,
.ko-home-link:focus-visible {
    color: var(--ko-gold);
    border-color: rgba(232, 200, 122, .7);
    background: rgba(232, 200, 122, .12);
    text-decoration: none;
}
.ko-home-icon { width: 32px; height: 23px; display: block; }
@media (max-width: 560px) { .ko-home-icon { width: 28px; height: 21px; } }

/* Reward names: a bullet inline before each name, and every line centred on
   the same axis. Centring each list as a block made the left edges land in a
   different place per group, which read as ragged. */
.ko-reward-names {
    display: block;
    text-align: center;
    list-style: none;
    margin: 0;
    padding: 0;
}
.ko-reward-names li {
    position: static;
    padding: 3px 0;
    text-align: center;
}
.ko-reward-names li::before {
    content: "\2022";
    position: static;
    color: var(--ko-gold);
    font-weight: 700;
    margin-right: 9px;
}

/* Group headings carry their own accent so a long package reads as distinct
   sections rather than one uniform gold wall. The rule under each heading
   picks up the same hue. */
.ko-reward-group h4 { color: var(--group-accent, var(--ko-muted)); }
.ko-reward-group { border-top: 1px solid transparent; }
.ko-reward-group h4 { border-bottom-color: color-mix(in srgb, var(--group-accent, var(--ko-line)) 40%, transparent); }

.ko-reward-group[data-group="SCROLLS"]     { --group-accent: #8fc7e8; }  /* parchment blue  */
.ko-reward-group[data-group="COSPRE"]      { --group-accent: #d8a0e0; }  /* appearance mauve */
.ko-reward-group[data-group="DEFENSE"]     { --group-accent: #7fd3a6; }  /* defence green   */
.ko-reward-group[data-group="UTILITY"]     { --group-accent: #e8c87a; }  /* house gold      */
.ko-reward-group[data-group="PREMIUM"]     { --group-accent: #f0a868; }  /* premium amber   */
.ko-reward-group[data-group="CONSUMABLES"] { --group-accent: #e88a8a; }  /* potion red      */
.ko-reward-group[data-group="PACKAGE"]     { --group-accent: #b9e07f; }  /* bundle lime     */

/* ------------------------------------------------------ re-apply countdown */

.ko-reapply-card .ko-card-body { text-align: center; }
/* Label over value, like every status row above it - side by side, a 13px
   caption against a 24px display figure sat on one baseline and read as two
   unrelated pieces of text crammed into a pill. */
.ko-countdown {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 13px 30px;
    border: 1px solid var(--ko-line);
    border-radius: var(--ko-r-tile);
    background: rgba(0, 0, 0, .35);
}
.ko-countdown-label { font-size: 13px; letter-spacing: 1.4px; text-transform: uppercase; color: var(--ko-muted); }
.ko-countdown-value {
    font-family: var(--ko-display);
    font-size: 24px;
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: .5px;
    color: var(--ko-gold);
    font-variant-numeric: tabular-nums;
}

/* ------------------------------------------------------- password reveal */

.ko-password-wrap { position: relative; }
.ko-password-wrap input { padding-right: 44px; }
.ko-password-toggle {
    position: absolute;
    top: 0; right: 0;
    width: 40px; height: 100%;
    background: none;
    border: 0;
    color: var(--ko-muted);
    cursor: pointer;
    font-size: 15px;
    line-height: 1;
}
.ko-password-toggle:hover, .ko-password-toggle.is-shown { color: var(--ko-gold); }

.ko-auth { max-width: 720px; margin: 0 auto; }
.ko-auth-lead { color: var(--ko-text); margin-bottom: 20px; }

/* ------------------------------------------------------------ auth pages */

/* Everything on the account pages is centred on one axis: heading, lead,
   labels, fields and the alternate action underneath the button. */
.ko-auth { max-width: 640px; margin: 0 auto; text-align: center; }
.ko-auth .ko-section-title { justify-content: center; }
.ko-auth .ko-section-title.is-left::before { display: block; }
.ko-auth .ko-field label,
.ko-auth .ko-field-help,
.ko-auth .ko-field-error { text-align: center; }
.ko-auth .ko-callout { text-align: center; }
.ko-auth .ko-callout p:last-child { margin-bottom: 0; }
.ko-auth .ko-card-body { padding: 24px; }

.ko-form-actions.is-stacked {
    flex-direction: column;
    align-items: center;
    gap: 14px;
    justify-content: center;
}
.ko-form-actions.is-stacked .ko-btn { min-width: 240px; }

.ko-auth-alt { margin: 0; color: var(--ko-muted); font-size: 14px; }
.ko-auth-alt a { font-weight: 700; }

/* hCaptcha widget. The height is reserved up front: the challenge arrives from
   a third party and without it the submit button jumps down the moment it
   lands, which is the instant somebody is reaching for it. */
.ko-captcha { display: flex; justify-content: center; min-height: 78px; }
.ko-captcha .h-captcha { line-height: 0; }

/* ------------------------------------------------- auth page background */

/* Footage behind the account pages, as on the main site. It sits under the
   whole page with a scrim over it so the card and its labels stay legible. */
.ko-auth-bg {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}
.ko-auth-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(.75) saturate(.9);
}
.ko-auth-scrim {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(900px 520px at 50% 42%, rgba(10, 8, 5, .55), rgba(10, 8, 5, .88) 70%),
        linear-gradient(180deg, rgba(10, 8, 5, .78), rgba(10, 8, 5, .92));
}

/* A visitor who asked for reduced motion gets the still frame instead. */
@media (prefers-reduced-motion: reduce) {
    .ko-auth-video { display: none; }
    .ko-auth-bg {
        background: url("../img/auth-poster.jpg") center / cover no-repeat;
    }
}

/* The card lifts off the footage. */
.ko-auth .ko-card {
    border-color: var(--ko-line);
    box-shadow: 0 18px 50px rgba(0, 0, 0, .7);
    background: linear-gradient(180deg, rgba(23, 16, 8, .95), rgba(10, 8, 5, .97));
}
.ko-auth { padding: 18px 0 40px; }

/* ------------------------------------------------------- final polish */

/* Duration note: tighter box, three short lines. */
.ko-duration-note { padding: 12px 16px; }
.ko-duration-note p { margin: 0 0 4px; line-height: 1.5; }
.ko-duration-note p:last-child { margin-bottom: 0; }

/* "View full package contents" reads as its own control, set apart from the
   list above it so it is clear there is more to open. */
.ko-package details.ko-details {
    margin: 18px 0;
    padding-top: 16px;
    border-top: 1px solid var(--ko-line-soft);
}
.ko-package details.ko-details > summary {
    padding: 10px 14px;
    border: 1px solid var(--ko-line);
    border-radius: var(--ko-r-btn);
    background: rgba(232, 200, 122, .07);
    color: var(--ko-gold);
}
.ko-package details.ko-details > summary:hover {
    background: rgba(232, 200, 122, .14);
    border-color: rgba(232, 200, 122, .6);
}

/* Utility moves off gold so it is distinct from the house colour. */
.ko-reward-group[data-group="UTILITY"] { --group-accent: #7fc9c4; }

/* Reward names one step larger. */
.ko-reward-names { font-size: 15.5px; }

/* The package tagline gets its own tone, away from the label grey. */
.ko-package-tagline { color: var(--ko-gold-soft); font-style: italic; }

/* Eligibility line fully bold. */
.ko-eligibility-note { font-weight: 700; }

/* Modal lead lines sit close together. */
.ko-modal-lead { margin-bottom: 6px; }
.ko-modal-lead + .ko-modal-lead { margin-bottom: 20px; color: var(--ko-muted); }

/* The password notice sits centred under both password fields, plainly. */
.ko-password-note {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--ko-muted);
    font-size: 13.5px;
    line-height: 1.55;
    margin: 2px 0 4px;
}
.ko-password-note strong { color: var(--ko-gold-soft); display: block; }

/* --------------------------------------------------- sponsorship section */
/*
 * Status and applying are one page, and it reads top to bottom down a single
 * centre line: heading, lead, status, the one action, then history.
 */
.ko-page-lead {
    text-align: center;
    max-width: 640px;
    margin: 0 auto 22px;
    color: var(--ko-muted);
    font-size: 15.5px;
    line-height: 1.6;
}

/* The greeting names the person reading it, so it is set a step larger than a
   page lead and in the body text colour rather than the muted one. */
.ko-welcome { font-size: 17.5px; color: var(--ko-text); }

.ko-sponsorship-card .ko-card-head { justify-content: center; gap: 12px; }
.ko-sponsorship-card .ko-card-body { text-align: center; }
.ko-sponsorship-card .ko-callout   { text-align: center; margin-top: 18px; }

/* The applications card is the only heading on the page that sat left of
   centre; it reads with the sponsorship card above it. */
.ko-applications-card .ko-card-head { justify-content: center; }

/* Its empty state answers the same question as the status line above it, so it
   is written in the same colour rather than the fainter table-empty grey. */
.ko-applications-card .ko-empty { color: var(--ko-gold-soft); }

.ko-status-line {
    /* The same size as the empty-state lines it sits among, so the dashboard
       does not read at two different weights of "there is nothing here". */
    font-size: 15.5px;
    line-height: 1.6;
    color: var(--ko-gold-soft);
    margin: 0 auto 18px;
    max-width: 560px;
}

/*
 * Every row on this page reads down one centre line, so the status rows stack
 * their label over their value instead of running label-left / value-right.
 */
.ko-sponsorship-card .ko-dl {
    max-width: 460px;
    margin: 0 auto;
    text-align: center;
}
.ko-sponsorship-card .ko-dl-row {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    text-align: center;
}
.ko-sponsorship-card .ko-dl-row { font-size: 17px; }
/* Two rows that belong together read across, not down. They collapse back to
   one column where there is no room for two. */
.ko-dl-pair { display: grid; grid-template-columns: 1fr; }
@media (min-width: 480px) {
    .ko-dl-pair { grid-template-columns: 1fr 1fr; column-gap: 18px; }
    .ko-dl-pair .ko-dl-row:first-child { border-right: 1px solid rgba(255, 255, 255, .04); }
}
.ko-sponsorship-card .ko-dl-key {
    font-size: 14.5px;
    letter-spacing: 1.3px;
    text-transform: uppercase;
}
.ko-sponsorship-card .ko-dl-val { text-align: center; }

/* Button, then the countdown that says when it unlocks, then the note: one
   column down the centre, never a button with a pill beside it. */
.ko-apply-action {
    margin-top: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}
.ko-apply-action .ko-field-help { margin-top: 0; text-align: center; font-size: 15.5px; }

/* A disabled action is a span, not a button: there is nothing to submit. It is
   dimmed and inert so it reads as unavailable rather than broken. */
.ko-btn.is-disabled,
.ko-btn.is-disabled:hover {
    opacity: .45;
    cursor: not-allowed;
    filter: grayscale(70%);
    transform: none;
    box-shadow: none;
    pointer-events: none;
}

/* ------------------------------------------------------------- step bar */
/*
 * Back arrow left, subject centred, change action right. The subject is centred
 * against the bar itself (not against whatever the two controls leave over), so
 * it stays on the page's centre line even though the sides differ in width.
 */
.ko-step-bar {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 14px 64px;
    margin-bottom: 22px;
    background: linear-gradient(180deg, var(--ko-bg-1), var(--ko-bg-0));
    border: 1px solid var(--ko-line-soft);
    border-radius: var(--ko-r-card);
    text-align: center;
}

.ko-step-back {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 1px solid var(--ko-line);
    border-radius: 50%;
    color: var(--ko-gold);
    text-decoration: none;
    transition: background .18s ease, color .18s ease, border-color .18s ease;
}
.ko-step-back:hover {
    background: rgba(232, 200, 122, .12);
    border-color: var(--ko-gold-dim);
    color: var(--ko-gold-soft);
}
.ko-icon-back { width: 1.15em; height: 1.15em; display: inline-block; vertical-align: -0.2em; flex: none; }
.ko-step-back .ko-icon-back { width: 20px; height: 20px; }

.ko-step-subject { display: flex; flex-direction: column; gap: 3px; }
.ko-step-label {
    font-size: 12.5px;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    color: var(--ko-muted);
}
.ko-step-value {
    font-family: var(--ko-display);
    font-size: 18px;
    letter-spacing: 1px;
    color: var(--ko-gold);
}
.ko-step-meta { font-size: 13.5px; color: var(--ko-muted); }

.ko-step-edit { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); }
/* .ko-btn:hover lifts the button with translateY(-2px), which would replace the
   centring transform and drop the button half its height on hover -- out from
   under the pointer. The lift is folded into the centring instead. */
.ko-step-edit:hover, .ko-step-edit:focus { transform: translateY(calc(-50% - 2px)); }
@media (prefers-reduced-motion: reduce) {
    .ko-step-edit:hover, .ko-step-edit:focus { transform: translateY(-50%); }
}

/* Under 620px the absolute sides would collide with the name, so the bar
   stacks and the controls sit either side of the centred subject. */
@media (max-width: 620px) {
    .ko-step-bar { flex-direction: column; padding: 14px 16px; gap: 12px; }
    .ko-step-back, .ko-step-edit,
    .ko-step-edit:hover, .ko-step-edit:focus { position: static; transform: none; }
}

/* ------------------------------------------- in-card sponsored item list */
/*
 * Opening the contents must not change the card's width or push its footer
 * about, so the panel scrolls within a bounded height instead of growing
 * without limit. Both cards therefore stay the same size when one is open.
 */
.ko-items-details { margin-top: 16px; }

.ko-items-panel {
    margin-top: 12px;
    padding: 14px 12px;
    max-height: 460px;
    overflow-y: auto;
    overscroll-behavior: contain;
    background: rgba(10, 8, 5, .5);
    border: 1px solid var(--ko-line-soft);
    border-radius: var(--ko-r-tile);
    text-align: center;

    /* The default UA scrollbar is a bright grey slab against the dark card, so
       it is restyled to the panel's own gold-on-black palette. */
    scrollbar-width: thin;
    scrollbar-color: rgba(188, 143, 70, .38) rgba(0, 0, 0, .35);
}
.ko-items-panel::-webkit-scrollbar { width: 8px; }
.ko-items-panel::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, .35);
    border-radius: 4px;
}
.ko-items-panel::-webkit-scrollbar-thumb {
    background: rgba(188, 143, 70, .38);
    border-radius: 4px;
    border: 1px solid rgba(0, 0, 0, .35);
}
.ko-items-panel::-webkit-scrollbar-thumb:hover { background: rgba(208, 164, 99, .6); }
.ko-items-panel .ko-reward-group:last-child { margin-bottom: 0; }

/* The clan card lists two different things -- what the leader keeps, and what
   sits inside each package they hand out. A heading opens each part, and the
   contained contents are inset behind a rule so they visibly belong to the
   package named above rather than to the leader. */
.ko-contents-heading {
    margin: 18px 0 10px;
    font-family: var(--ko-display);
    font-size: 15px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--ko-gold-soft);
    text-align: center;
}
.ko-contents-heading:first-child { margin-top: 0; }

/* A contents heading introduces the group list under it, so it needs more air
   below it than a reward group's own h4 does - otherwise "Each PUS Sponsor
   Package contains" sits right on top of "PUS / Scrolls" and the two read as
   one stacked heading. */
.ko-contents-heading + .ko-reward-group { margin-top: 18px; }

.ko-contained-block {
    margin-top: 18px;
    padding: 14px 12px 4px;
    border-top: 1px solid var(--ko-line-soft);
    border-left: 2px solid rgba(188, 143, 70, .35);
    border-radius: var(--ko-r-tile);
    background: rgba(0, 0, 0, .22);
}

/* Closed, the cards share a row height so their apply buttons line up. Once a
   card's items are open, every card in the row takes its own height instead -
   otherwise the grid stretches the closed card beside it to match, leaving a
   tall empty gap above its button. */
.ko-packages > .ko-package { align-self: stretch; }
.ko-packages:has(details[open]) > .ko-package { align-self: start; }

/* A summary is a toggle, not text - double-clicking it should not select words. */
.ko-package details.ko-details > summary { user-select: none; -webkit-user-select: none; }

/* ------------------------------------------------- readability pass */

/* Flash and error banners are a page-level announcement, so they read on the
   page's centre line like everything else. */
.ko-flash-item { text-align: center; }

/* The submitted answers are the substance of an application - they were being
   set smaller than the body text they sit next to. */
.ko-qa-q { font-size: 14px; letter-spacing: .6px; color: var(--ko-gold-dim); }
.ko-qa-a { font-size: 15.5px; line-height: 1.65; }

/* Requested on the account pages: this line was undersized against the form. */
.ko-auth-lead { font-size: 16px; line-height: 1.6; }

/*
 * The footage behind the account pages was almost entirely covered. The card
 * carries its own near-opaque background, so the scrim only has to keep the
 * few lines OUTSIDE the card legible - it does not need to hide the video.
 */
.ko-auth-video { filter: brightness(1) saturate(1); }
.ko-auth-scrim {
    background:
        radial-gradient(900px 520px at 50% 42%, rgba(10, 8, 5, .22), rgba(10, 8, 5, .6) 70%),
        linear-gradient(180deg, rgba(10, 8, 5, .42), rgba(10, 8, 5, .6));
}


/* The way out of a step. The picker is the first screen of the flow and has no
   step bar to hang a back arrow on, so its exit is a plain labelled link -
   above the title on the way in, and repeated below a long card list. */
.ko-step-exit { margin-top: 18px; margin-bottom: 14px; text-align: center; }
.ko-step-exit.is-end { margin: 28px 0 24px; text-align: center; }

/* ------------------------------------------------ KC sponsorship entry bar */

/* KC is the one sponsorship type with a hard minimum, and an applicant who
   skims it wastes both their time and staff's. So the block is set apart on its
   own ground, centred on the page's reading line like every other statement
   card, and colour-coded: gold names the platform, bright text carries the
   number they must clear, amber marks what is not guaranteed, and red marks
   what is forbidden outright. */
.ko-kc-req {
    margin-top: 18px;
    padding: 18px 18px 14px;
    border: 1px solid var(--ko-line);
    border-radius: var(--ko-r-tile);
    background: rgba(0, 0, 0, .3);
    text-align: center;
}
.ko-kc-req .ko-contents-heading {
    color: var(--ko-gold);
    font-weight: 700;
    font-size: 17px;
}

/* The one line that decides whether the rest applies to the reader at all. */
.ko-kc-req-gate {
    margin: 0 0 14px;
    padding: 8px 12px;
    border-radius: var(--ko-r-tile);
    border: 1px solid rgba(212, 148, 58, .45);
    background: rgba(212, 148, 58, .1);
    font-size: 15px;
    line-height: 1.5;
    color: var(--ko-amber);
    font-weight: 700;
}

/* Alternatives, not a list to work down: each sits in its own tile so it reads
   as one complete way in. */
.ko-kc-req-list {
    list-style: none;
    margin: 0 0 16px;
    padding: 0;
    display: grid;
    gap: 8px;
}
.ko-kc-req-item {
    padding: 9px 12px;
    border-radius: var(--ko-r-tile);
    border: 1px solid var(--ko-line-soft);
    background: rgba(0, 0, 0, .28);
    font-size: 15px;
    line-height: 1.5;
}
.ko-kc-req-platform {
    display: block;
    font-family: var(--ko-display);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--ko-gold);
}
.ko-kc-req-reach {
    display: block;
    margin-top: 2px;
    color: var(--ko-text);
    font-weight: 700;
}

.ko-kc-req-also {
    margin: 0 0 10px;
    font-family: var(--ko-display);
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    color: var(--ko-gold-soft);
}

.ko-kc-req-terms {
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: 15px;
    line-height: 1.6;
    color: var(--ko-text);
}
.ko-kc-req-terms li { margin-bottom: 8px; }
.ko-kc-req-terms li:last-child { margin-bottom: 0; }
.ko-kc-req-terms .is-caution { color: var(--ko-amber); }
.ko-kc-req-terms .is-prohibited { color: var(--ko-err); font-weight: 700; }

/* The declaration is a separate act from reading the bar above it, so it is
   not left sitting against the bottom edge of the requirements block. */
.ko-kc-req + .ko-field { margin-top: 22px; }

.ko-package-intro { margin-top: 0; }

/* A declaration the applicant ticks: the box sits beside its sentence rather
   than above it, and the whole sentence is the hit target. It reads as a
   sentence, not as a field label, so the uppercase gold label styling that
   .ko-field label would otherwise impose is overridden here - which needs the
   same specificity, hence the qualified selector. */
.ko-check,
.ko-field label.ko-check {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 10px;
    max-width: 620px;
    margin: 0 auto;
    padding: 0 18px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.55;
    color: var(--ko-text);
    text-align: center;
    text-transform: none;
    letter-spacing: 0;
}

/* The browser's own checkbox is a white system square on a black gold page.
   The native input is kept - it is the accessible control, and it still tabs,
   toggles and reports state - but its painting is replaced with a tile that
   belongs to the theme: a dark well with a gold rule, filled gold and marked
   with a dark tick once it is ticked. */
.ko-check input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    position: relative;
    flex: 0 0 auto;
    width: 24px;
    height: 24px;
    margin: 0;
    border: 1px solid rgba(232, 200, 122, .55);
    border-radius: 8px;
    background: rgba(0, 0, 0, .45);
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.ko-check:hover input[type="checkbox"],
.ko-check input[type="checkbox"]:hover { border-color: var(--ko-gold); }
.ko-check input[type="checkbox"]:focus-visible {
    outline: none;
    border-color: var(--ko-gold);
    box-shadow: 0 0 0 3px rgba(232, 200, 122, .28);
}
.ko-check input[type="checkbox"]:checked {
    background: linear-gradient(180deg, #f3dda6, var(--ko-gold-dim));
    border-color: var(--ko-gold);
}
/* The tick is drawn, not typed: two borders of an empty box, rotated. */
.ko-check input[type="checkbox"]:checked::after {
    content: "";
    position: absolute;
    left: 8px;
    top: 3px;
    width: 6px;
    height: 12px;
    border: solid #1a1206;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* The KC declaration is a statement the applicant signs, not one option among
   several, so on the application flow it is framed as its own panel and the
   frame warms once it is signed. */
.ko-apply .ko-check {
    position: relative;
    align-items: center;
    padding: 16px 56px;
    border: 1px solid var(--ko-line);
    border-radius: var(--ko-r-tile);
    background: rgba(0, 0, 0, .28);
    transition: border-color .15s ease, background .15s ease;
}

/* The box is parked at the left edge of the panel and the sentence is centred
   in the panel itself, rather than the two travelling together as one centred
   pair - the declaration then reads on the same centre line as everything else
   in the step. The matching right-hand padding keeps that line true. */
.ko-apply .ko-check input[type="checkbox"] {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
}
.ko-apply .ko-check:hover { border-color: rgba(232, 200, 122, .45); }

/* The declaration prints no message of its own - the summary at the top of the
   page carries it - so the panel itself has to show it is the thing at fault. */
.ko-apply .ko-field.has-error .ko-check { border-color: var(--ko-danger-br); }
.ko-apply .ko-check:has(input:checked) {
    border-color: rgba(232, 200, 122, .55);
    background: rgba(212, 148, 58, .10);
}

/* ------------------------------------------- centred application headings */

/* Every card on the sponsorship flow is a titled block the reader scans down
   the middle of the page, so its heading and its card-level copy sit on the
   page's centre line - the same rhythm the section titles above them use. */
.ko-form .ko-card-head,
.ko-package .ko-card-head { justify-content: center; }
.ko-form .ko-card-head h2 { text-align: center; }
.ko-form .ko-card-body > p,
.ko-form .ko-card-body > .ko-field-help { text-align: center; }

/* A help line that opens a card belongs to the heading above it, so it sits up
   under it rather than floating midway between the heading and the field it
   introduces. */
.ko-form .ko-card-body > .ko-field-help:first-child { margin-top: -6px; margin-bottom: 16px; }

/* --------------------------------------------- centred application flow */

/* The three sponsorship steps are read straight down the middle of the page,
   so the flow sits in a narrower column than the full container and its copy -
   labels, help text and validation messages alike - is centred with it, rather
   than stretching a short sentence across 1170px. */
.ko-apply { max-width: 860px; margin: 0 auto; }
.ko-apply > p { text-align: center; }
.ko-apply .ko-field label,
.ko-apply .ko-label,
.ko-apply .ko-field-help,
.ko-apply .ko-field-error { text-align: center; }

/* The answers are read on that same centre line as the labels above them, so
   what the applicant types is centred in its box rather than starting at the
   left edge under a centred label. Checkboxes and radios are unaffected -
   text-align does not move a box, only the text of the controls that carry
   any.

   A textarea is the exception: it holds paragraphs, and a centred paragraph
   with a ragged left edge is markedly harder to read than a centred one-line
   answer, so those stay left-aligned. */
.ko-apply .ko-field input[type="text"],
.ko-apply .ko-field input[type="email"],
.ko-apply .ko-field input[type="number"],
.ko-apply .ko-field input[type="url"],
.ko-apply .ko-field input[type="date"],
.ko-apply .ko-field select,
.ko-apply .ko-form input[type="text"],
.ko-apply .ko-form input[type="email"],
.ko-apply .ko-form input[type="number"],
.ko-apply .ko-form input[type="url"],
.ko-apply .ko-form input[type="date"],
.ko-apply .ko-form select { text-align: center; }

.ko-apply .ko-field textarea,
.ko-apply .ko-form textarea { text-align: left; }

/* A written answer is a bigger ask than a one-line one, so the questions that
   open a textarea are labelled a size up from the fields around them. */
.ko-apply .ko-field.is-full label { font-size: 15px; }

/* Key/value review rows keep their two-column reading, just in a column narrow
   enough that the key and its value stay near each other. */
.ko-apply .ko-dl { max-width: 620px; margin: 0 auto; }

/* A question and its answer meet in the middle of the row instead of being
   pushed to opposite edges of it - a two-word answer used to sit a hand's
   width away from the label it belongs to, with nothing in between. */
.ko-apply .ko-dl-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 18px;
    justify-content: center;
}
.ko-apply .ko-dl-key { text-align: right; }
.ko-apply .ko-dl-val { text-align: left; }

/* On a narrow screen there is no middle to meet in: label over value, centred,
   the way every other stacked pair on a phone reads. */
@media (max-width: 560px) {
    .ko-apply .ko-dl-row { grid-template-columns: 1fr; row-gap: 2px; text-align: center; }
    .ko-apply .ko-dl-key,
    .ko-apply .ko-dl-val { text-align: center; }
}

/* ------------------------------------ centred review / conversation pages */

/*
 * The application review pages - staff-side and applicant-side - are read down
 * the middle of the page like the application flow itself, so their card
 * headings, copy, message thread and reply forms all sit on the centre line
 * rather than hugging the left edge of a wide card.
 */
.ko-layout-split .ko-card-head { justify-content: center; text-align: center; }
.ko-layout-split .ko-card-body { text-align: center; }
.ko-layout-split .ko-field label,
.ko-layout-split .ko-label,
.ko-layout-split .ko-field-help,
.ko-layout-split .ko-field-error { text-align: center; }
.ko-layout-split .ko-form-actions { justify-content: center; }

/* The message thread: author and timestamp sit together over the centred body
   instead of at opposite ends of the bubble. */
.ko-layout-split .ko-msg-head { justify-content: center; }
.ko-layout-split .ko-msg-body { text-align: center; }

/* Contact rows in the sidebar: the value and its copy button as one centred
   pair under their label. */
.ko-layout-split .ko-copy { justify-content: center; }

/* Status rows stack their label over their value and read down the centre,
   the way the dashboard's status card does. Side by side they had to wrap a
   long value against the right edge of a 340px column, which read as one run-on
   line ("Charactermarkonvoak") rather than a label and its answer. */
.ko-layout-split .ko-dl { max-width: 620px; margin: 0 auto; }
.ko-layout-split .ko-dl-row {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    text-align: center;
}
.ko-layout-split .ko-dl-key {
    font-size: 12.5px;
    letter-spacing: 1.3px;
    text-transform: uppercase;
}
.ko-layout-split .ko-dl-val { text-align: center; }

/* The status badge and the submission date read as one centred caption under
   the ticket's title, not as a left-hanging line above the cards. */
.ko-status-meta {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin: -6px 0 22px;
    color: var(--ko-muted);
    font-size: 15px;
}
/* The applicant's own ticket stacks the pair instead: the date is a caption
   and the status is the answer under it, which side by side they are not. The
   two are also sized apart - the date steps down to caption size and the badge
   steps up - because stacking alone left them equally loud and the answer did
   not read as the answer. */
.ko-status-meta.is-stacked { flex-direction: column; gap: 10px; }
.ko-status-meta.is-stacked .ko-status-date { font-size: 13.5px; letter-spacing: .4px; }
.ko-status-meta.is-stacked .ko-badge.is-lg { font-size: 16px; padding: 7px 20px; }
.ko-status-date { color: var(--ko-muted); }

/* ------------------------------------------------------- counter-offer */

/* The offer is the first thing on the applicant's page and the only thing on it
   that asks for a decision, so it is set apart from the record below it. */
.ko-offer-card { border-color: rgba(212, 148, 58, .55); }
.ko-offer-card .ko-card-head { background: rgba(212, 148, 58, .12); }
.ko-offer-actions {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    margin: 20px 0 12px;
}

/* ------------------------------------------------------- layout helpers */

/*
 * The Content-Security-Policy sets style-src 'self' with no 'unsafe-inline', so
 * a style="" attribute in a template is silently dropped by the browser - the
 * settings card stretched the full page width for exactly that reason. These
 * few classes carry what those attributes used to.
 */
.ko-spaced { margin-top: 16px; }
.ko-spaced-below { margin-bottom: 16px; }
.ko-subheading { margin-top: 24px; }
.ko-subheading.is-centered { text-align: center; }
.ko-table.is-compact { min-width: auto; }

/* The review lead sits a notch above body copy: it is the one instruction on
   the page, so it is read before the cards under it rather than with them. */
.ko-review-lead { font-size: 16px; }

/* The clan verdict is a single badge, centred on its own, with nothing beside
   it to pull the eye away. */
.ko-eligibility-verdict { text-align: center; padding: 4px 0 2px; }

.ko-card.is-narrow { max-width: 620px; margin-left: auto; margin-right: auto; }
.ko-narrow-centered { max-width: 640px; margin: 0 auto; text-align: center; }

/* A settings form is a short list of single values: the inputs are sized to
   what goes in them rather than stretched across the card. */
.ko-card.is-narrow .ko-input-suffix { max-width: 320px; margin: 0 auto; }

/* Internal comments sit at the top of the staff column and look unlike the
   applicant's thread, so there is never a doubt about who can read them. */
.ko-internal-card { border-color: rgba(212, 148, 58, .45); }
.ko-internal-card .ko-card-head { background: rgba(212, 148, 58, .10); }
.ko-internal-card .ko-card-head h3 { color: var(--ko-amber); }
.ko-msg-actions { margin-top: 10px; display: flex; justify-content: center; }

/* A field that closes a group: its answer is centred under the inputs it is
   derived from, and a rule separates it from what follows. */
.ko-field.is-group-end {
    text-align: center;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--ko-line-soft);
}
.ko-field.is-group-end .ko-copy { justify-content: center; }

/* The contact card is a short list of three labelled values: even spacing, and
   the first of them close under the heading rather than floating below it. */
/* Sidebar cards are small reference panels: their contents start right under
   the heading rather than a body-padding's distance below it. */
.ko-layout-split > aside .ko-card-body { padding: 14px; }
.ko-layout-split .ko-card-body > .ko-dl:first-child { margin-top: -2px; }
.ko-layout-split .ko-dl-row { padding: 7px 0; }
.ko-layout-split .ko-spaced { margin-top: 12px; }

/* The native date picker's indicator is near-black on a dark field. Inverting
   it makes the affordance visible without replacing the control. */
.ko-field input[type="date"]::-webkit-calendar-picker-indicator,
.ko-form input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(78%) sepia(28%) saturate(420%) hue-rotate(2deg) brightness(95%);
    cursor: pointer;
    opacity: .9;
}
.ko-field input[type="date"]::-webkit-calendar-picker-indicator:hover,
.ko-form input[type="date"]::-webkit-calendar-picker-indicator:hover { opacity: 1; }

/* The internal card is a sidebar utility, not a page section: an empty state
   costs one line, the note box is a couple of lines tall, and the gaps between
   them are sized for a 340px column rather than a full-width card. */
.ko-internal-card .ko-card-body { padding: 14px; }
.ko-internal-card .ko-empty { padding: 10px 0; font-size: 14.5px; }
.ko-internal-card .ko-spaced { margin-top: 12px; }
.ko-internal-card .ko-field { margin-bottom: 10px; }
.ko-internal-card .ko-field label { margin-bottom: 5px; }
.ko-internal-card textarea { min-height: 76px; }
.ko-internal-card .ko-msg { padding: 10px 12px; margin-bottom: 10px; }

/* ------------------------------------------------------------ clan roster */

/* A roster is a list of names, not a data table. Fourteen one-word nicknames
   strung down a full-width table left a column of air either side of them and
   read as a spreadsheet of nothing; as a grid of cards they sit together in the
   middle of the card and the clan looks like a group. The grid centres itself
   and sizes to its contents, so three members do not stretch across the page
   and twenty wrap instead of scrolling. */
.ko-roster {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
    gap: 10px;
    max-width: 720px;
    margin: 0 auto;
    padding: 16px 18px 20px;
}
.ko-roster-item {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    padding: 9px 12px;
    border: 1px solid var(--ko-line-soft);
    border-radius: 8px;
    background: rgba(188, 143, 70, .05);
}
/* The position is a token beside the name rather than a column of its own: it
   numbers the member without competing with what the member is called. */
.ko-roster-num {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    font-size: 11px;
    font-weight: 700;
    color: var(--ko-gold);
    background: rgba(212, 148, 58, .14);
    border: 1px solid rgba(212, 148, 58, .40);
}
/* A nickname that will not fit is clipped rather than widening every cell in
   the grid to match the longest one. */
.ko-roster-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--ko-gold-soft);
}
/* The count belongs with the heading, where "how many" is the question the
   roster is usually opened to answer. */
.ko-roster-count {
    display: block;
    text-align: center;
    color: var(--ko-muted);
    font-size: 13px;
    letter-spacing: .4px;
    margin: -2px 0 2px;
}
/* Inside a card body the roster has padding of its own; the body's would double
   it. */
.ko-card-body > .ko-roster { padding-left: 0; padding-right: 0; padding-bottom: 0; }

@media (max-width: 560px) {
    .ko-roster { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; padding: 12px; }
}

/* -------------------------------------------------------- granted ESN code */

/* The code is what the applicant came to the page for, so it is set apart from
   the rows of dates above it rather than being one more line in the list: a
   framed block, the code itself at a size that can be read off the screen and
   typed into the game without squinting, and the copy button beside it. */
.ko-code-grant {
    margin: 18px auto 4px;
    max-width: 420px;
    padding: 16px 18px;
    text-align: center;
    border: 1px solid rgba(212, 148, 58, .55);
    border-radius: 10px;
    background: rgba(212, 148, 58, .08);
}
.ko-code-grant-label {
    color: var(--ko-gold);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    margin-bottom: 10px;
}
/* One row per code: a clan takes a single code, an individual package may take
   several, and several must not run into each other. */
.ko-code-grant-row { justify-content: center; }
.ko-code-grant-row + .ko-code-grant-row { margin-top: 8px; }
.ko-code-grant .ko-copy-val {
    font-size: 18px;
    letter-spacing: 1.5px;
    color: var(--ko-gold-soft);
    /* The code is selectable text, so it can still be copied by hand when the
       clipboard API is unavailable. */
    user-select: all;
}
.ko-code-grant-help {
    margin-top: 10px;
    color: var(--ko-muted);
    font-size: 13px;
    line-height: 1.5;
}

@media (max-width: 480px) {
    .ko-code-grant .ko-copy-val { font-size: 16px; letter-spacing: 1px; }
}

/*
 * ESN code blocks on the application page.
 *
 * The section used to be one undivided run of controls - codes already handed
 * over, then a select, then a picker, then a button - and nothing in it said
 * which codes were the applicant's and which were still on the shelf. These
 * two blocks carry that distinction visually: a settled block for what has
 * been given, an active one for the form that gives more.
 *
 * The left edge does the work. Green reads as done and is not clickable;
 * gold reads as the thing to act on. The heading row holds a count, so the
 * answer to "how many has this person had" is legible without counting rows.
 */
.ko-codeblock {
    margin-top: 16px;
    border: 1px solid var(--ko-line-soft);
    border-left: 3px solid var(--ko-line);
    border-radius: 8px;
    overflow: hidden;
}

.ko-codeblock.is-given { border-left-color: var(--ko-ok); }
.ko-codeblock.is-give  { border-left-color: var(--ko-gold); }

.ko-codeblock-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, .025);
    border-bottom: 1px solid var(--ko-line-soft);
}

.ko-codeblock-head h4 {
    margin: 0;
    font-size: 15px;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--ko-gold-soft);
}

.ko-codeblock.is-given .ko-codeblock-head h4 { color: var(--ko-muted); }

.ko-codeblock-body { padding: 14px; }

/* The last help line in a block sits against the block's own padding, so it
   does not need the margin it would carry in open page flow. */
.ko-codeblock-body > .ko-field-help:last-child { margin-bottom: 0; }

/* When and by whom a code was handed over. Secondary to the code itself, on
   its own line so the code and its kind still read as one pair. */
.ko-code-meta {
    display: block;
    margin-top: 2px;
    font-size: 13px;
    color: var(--ko-faint);
}

/* ------------------------------------------------- counter-offer (staff) */

/* Sits between approve and reject, styled like them but in the offer amber. */
details.ko-details.ko-decision-offer > summary { color: #e8b86a; }
.ko-offer-requested { text-align: center; margin: 4px 0 14px; }

/* Two choices as cards: a title and a line saying what it means. */
.ko-offer-types .ko-radio { align-items: flex-start; text-align: left; }
.ko-offer-types .ko-radio > span { display: flex; flex-direction: column; gap: 3px; }
.ko-offer-types .ko-radio small { color: var(--ko-muted); font-size: 13px; line-height: 1.4; }
.ko-field > .ko-radio-grid.ko-offer-types { max-width: none; }
.ko-field > .ko-radio-grid.ko-offer-types .ko-radio { justify-content: flex-start; }

/* The amount only means something for a KC offer, so it steps aside when a
   package is chosen. */
.ko-offer-form:has(input[name="offer_type"]:checked:not([value="kc"])) .ko-offer-kc { display: none; }

/* Where the offer stands, at the top of the decision card. */
.ko-offer-state { display: flex; flex-direction: column; gap: 4px; text-align: center; margin-bottom: 18px; }

/* Admin dashboard: accepted offers waiting on staff. */
.ko-offer-alert {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
    gap: 12px 18px; text-align: center; margin-bottom: 22px;
}


/* ------------------------------------------------ decision: three answers */
/*
 * What was asked for, then three coloured choices - approve as requested,
 * reject with a counter-offer, reject outright - each opening its own panel
 * with a banner that says in words what pressing its button will do.
 */
.ko-submitted {
    text-align: center;
    border: 1px solid var(--ko-line);
    border-radius: var(--ko-r-tile);
    background: rgba(232, 200, 122, .05);
    padding: 16px 18px 12px;
    margin: 0 0 22px;
}
.ko-submitted-label {
    font-size: 12px;
    letter-spacing: 1.6px;
    text-transform: uppercase;
    color: var(--ko-muted);
    margin-bottom: 6px;
}
.ko-submitted-package { font-family: var(--ko-display); font-size: 19px; color: var(--ko-gold-soft); }
.ko-submitted-amount {
    display: inline-block;
    font-family: var(--ko-display);
    font-size: 26px;
    font-weight: 700;
    color: #9fd3ff;
    background: rgba(59, 120, 181, .18);
    border: 1px solid rgba(110, 170, 230, .55);
    border-radius: 999px;
    padding: 4px 22px;
    margin-top: 8px;
    text-shadow: 0 0 14px rgba(110, 170, 230, .45);
}
.ko-submitted-meta    { font-size: 13.5px; color: var(--ko-muted); margin-top: 6px; }
.ko-submitted .ko-details { margin-top: 10px; text-align: left; }

.ko-decide-input { position: absolute; opacity: 0; pointer-events: none; }

.ko-decide-tabs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}
.ko-decide-tab {
    --tone: var(--ko-gold);
    --tone-bg: rgba(232, 200, 122, .10);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    text-align: center;
    padding: 16px 12px 14px;
    border: 2px solid var(--ko-line);
    border-radius: var(--ko-r-tile);
    background: rgba(0, 0, 0, .25);
    color: var(--ko-text);
    cursor: pointer;
    opacity: .72;
    transition: border-color .15s, background .15s, opacity .15s, box-shadow .15s;
}
.ko-decide-tab:hover { opacity: 1; border-color: var(--tone); }
.ko-decide-tab strong {
    font-family: var(--ko-display);
    font-size: 15.5px;
    letter-spacing: .6px;
    text-transform: uppercase;
    color: var(--tone);
}
.ko-decide-tab small { font-size: 13px; line-height: 1.4; color: var(--ko-muted); }
.ko-decide-icon {
    width: 34px; height: 34px;
    padding: 6px;
    border-radius: 50%;
    color: var(--tone);
    background: var(--tone-bg);
    border: 1px solid var(--tone);
}
.ko-decide-tab.is-approve { --tone: var(--ko-ok);     --tone-bg: rgba(90, 200, 120, .14); }
.ko-decide-tab.is-offer   { --tone: var(--ko-amber);  --tone-bg: rgba(212, 148, 58, .16); }
.ko-decide-tab.is-reject  { --tone: var(--ko-err);    --tone-bg: rgba(229, 115, 104, .14); }

#ko-decide-approve:checked ~ .ko-decide-tabs .is-approve,
#ko-decide-offer:checked   ~ .ko-decide-tabs .is-offer,
#ko-decide-reject:checked  ~ .ko-decide-tabs .is-reject {
    opacity: 1;
    border-color: var(--tone);
    background: var(--tone-bg);
    box-shadow: 0 0 0 1px var(--tone), 0 0 22px var(--tone-bg);
}
#ko-decide-approve:focus-visible ~ .ko-decide-tabs .is-approve,
#ko-decide-offer:focus-visible   ~ .ko-decide-tabs .is-offer,
#ko-decide-reject:focus-visible  ~ .ko-decide-tabs .is-reject { outline: 2px solid var(--ko-gold-soft); outline-offset: 3px; }

.ko-decide-panel { display: none; }
#ko-decide-approve:checked ~ .ko-decide-panel.is-approve,
#ko-decide-offer:checked   ~ .ko-decide-panel.is-offer,
#ko-decide-reject:checked  ~ .ko-decide-panel.is-reject { display: block; }

.ko-decide-banner {
    border: 1px solid;
    border-left-width: 4px;
    border-radius: var(--ko-r-tile);
    padding: 12px 16px;
    margin: 0 0 18px;
    font-weight: 600;
    text-align: center;
}
.ko-decide-panel.is-approve .ko-decide-banner { border-color: rgba(90, 200, 120, .45); border-left-color: var(--ko-ok);    background: rgba(90, 200, 120, .10); color: #b6e6c4; }
.ko-decide-panel.is-offer   .ko-decide-banner { border-color: rgba(212, 148, 58, .5);  border-left-color: var(--ko-amber); background: rgba(212, 148, 58, .10); color: #e3b878; }
.ko-decide-panel.is-reject  .ko-decide-banner { border-color: rgba(191, 83, 41, .5);   border-left-color: var(--ko-danger-br); background: rgba(191, 83, 41, .12); color: #f0c4b0; }

.ko-btn-approve, .ko-btn-counter { color: #fff; }
.ko-btn-approve { background: #2f7d48; border-color: #3f9a5c; }
.ko-btn-approve:hover { color: #fff; border-color: var(--ko-ok); box-shadow: 0 0 20px rgba(90, 200, 120, .3); }
.ko-btn-counter { background: #9a6420; border-color: #b97a2c; }
.ko-btn-counter:hover { color: #fff; border-color: var(--ko-amber); box-shadow: 0 0 20px rgba(212, 148, 58, .3); }
