/* =========================================================
   KDEC public pages: the home page (index.php) and the form page (form/, serve/).
   Loaded after brand/kdec.css: every colour, radius, shadow and easing is one of its --k-* tokens.

   kp-*  shared pieces (top bar, buttons, footer, icons)
   kh-*  the home page
   kf-*  the form page

   Two worlds. Navy for covers and notices: the home page, the form's cover, and its closed, sent and
   not-found screens. Paper for the work itself: the form steps are white cards on the light backdrop.
   Motion: transform and opacity only, 140-260ms, nothing under prefers-reduced-motion.
   ========================================================= */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body.kp {
    margin: 0; min-height: 100vh; min-height: 100dvh;
    display: flex; flex-direction: column;
    font: 400 1rem/1.75 var(--k-font);
    color: var(--k-on-navy); background: var(--k-navy-900);
    -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
/* these pages load only this file and brand/kdec.css, so a plain element reset is safe (and easy to override) */
h1, h2, h3, p, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
.kp img { max-width: 100%; }
.kp [hidden] { display: none !important; }
.kp :focus-visible { outline: 2px solid var(--k-gold-light); outline-offset: 2px; }

/* icons: one inline sprite per page, drawn with the current text colour */
.ki-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ki {
    flex: none; width: 1.25em; height: 1.25em;
    fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round;
}

.kp-skip {
    position: absolute; inset-inline-start: 12px; top: 12px; z-index: 20;
    padding: 10px 16px; border-radius: var(--k-r);
    background: var(--k-surface); color: var(--k-navy); font-weight: 600; text-decoration: none;
    transform: translateY(-200%);
}
.kp-skip:focus { transform: none; }

/* ---------- top bar ---------- */
.kp-top {
    width: 100%; max-width: 1160px; margin: 0 auto; padding: 18px 24px;
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.kp-brand { display: inline-flex; align-items: center; min-height: 44px; border-radius: var(--k-r-sm); }
.kp-logo { display: block; height: 44px; width: auto; }
.kp-toplink {
    display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px;
    border-radius: var(--k-r); color: var(--k-on-navy-2);
    font-size: .95rem; font-weight: 500; text-decoration: none; white-space: nowrap;
}
.kp-toplink:hover { color: var(--k-on-navy); }

/* ---------- buttons: 10px corners, never pills ---------- */
.kp-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .6rem;
    min-height: 50px; padding: 0 1.4rem;
    border: 1px solid transparent; border-radius: var(--k-r);
    font: 600 1rem/1 var(--k-font); white-space: nowrap; text-decoration: none;
    cursor: pointer; user-select: none; -webkit-tap-highlight-color: transparent;
    transition: transform 160ms var(--k-ease), opacity 160ms var(--k-ease);
}
.kp-btn:active { transform: scale(.97); }
.kp-btn:disabled, .kp-btn[aria-disabled="true"] { cursor: default; opacity: .65; }
.kp-btn:disabled:active { transform: none; }
.kp-btn-lg { min-height: 56px; padding: 0 1.7rem; font-size: 1.08rem; }
.kp-btn-sm { min-height: 44px; padding: 0 .95rem; font-size: .92rem; gap: .45rem; }
.kp-btn-navy { background: var(--k-navy); color: var(--k-surface); }
.kp-btn-navy:hover { background: var(--k-navy-700); }
.kp-btn-gold { background: var(--k-gold-grad); color: var(--k-on-gold); box-shadow: var(--k-shadow); }
.kp-btn-white { background: var(--k-surface); color: var(--k-navy); }
.kp-btn-line { background: var(--k-surface); color: var(--k-navy); border-color: var(--k-line-strong); }
.kp-btn-line:hover { border-color: var(--k-navy-300); background: var(--k-navy-50); }
.kp-btn-danger { background: var(--k-surface); color: var(--k-danger); border-color: var(--k-line-strong); }
.kp-btn-danger:hover { background: var(--k-danger-bg); }
.kp-btn-onnavy { background: transparent; color: var(--k-on-navy); border-color: var(--k-navy-300); }
.kp-btn-onnavy:hover { background: var(--k-on-navy-line); }
.kp-btn .ki { width: 1.2em; height: 1.2em; }
.is-paper .kp-btn:focus-visible { outline-color: var(--k-gold); }

.kp-linkbtn {
    display: inline-flex; align-items: center; min-height: 44px; padding: 0 6px;
    border: 0; border-radius: var(--k-r-sm); background: none;
    color: var(--k-navy); font: inherit; font-weight: 600;
    text-decoration: underline; text-underline-offset: 4px; cursor: pointer;
}

.kp-spin {
    flex: none; width: 18px; height: 18px; border-radius: 50%;
    border: 2px solid currentColor; border-inline-end-color: transparent;
    animation: kp-spin .7s linear infinite;
}
@keyframes kp-spin { to { transform: rotate(360deg); } }

/* ---------- footer ---------- */
.kp-foot {
    margin-top: auto; padding: 22px 24px 26px;
    display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px 28px;
    color: var(--k-on-navy-2); text-align: center;
}
.kp-foot p { font: 500 .78rem/1.4 var(--k-font-display); letter-spacing: .14em; text-transform: uppercase; }
.is-paper .kp-foot { color: var(--k-muted); }

/* entrances: a fade and an 8px rise, once */
@keyframes kp-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* =========================================================
   HOME
   ========================================================= */
.kh-nav { display: flex; align-items: center; gap: 2px; margin-inline-end: -12px; }
.kh-mark { display: block; height: 38px; width: auto; }

.kh-main {
    flex: 1; width: 100%; max-width: 1160px; margin: 0 auto; padding: 20px 24px 48px;
    display: flex; flex-direction: column; justify-content: center;
}
.kh-hero {
    display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
    gap: 72px; align-items: center;
}
.kh-lockup { justify-self: center; display: block; width: min(100%, 400px); height: auto; }

.kh-status {
    display: inline-flex; align-items: center; gap: .55rem; padding: .28rem .85rem;
    border: 1px solid var(--k-on-navy-line); border-radius: 999px; background: var(--k-on-navy-line);
    font-size: .86rem; font-weight: 500; line-height: 1.6;
}
.kh-status i { width: .5rem; height: .5rem; border-radius: 50%; background: var(--k-gold-light); }
.kh-status.is-closed i { background: var(--k-navy-300); }

.kh-hero h1 {
    margin-top: 18px; max-width: 16em;
    font: 700 clamp(1.9rem, 1.15rem + 3vw, 3.1rem)/1.32 var(--k-font-display); text-wrap: balance;
}
.kh-hero .k-rule { margin-top: 18px; }
.kh-intro { margin-top: 22px; max-width: 60ch; color: var(--k-on-navy-2); }
.kh-intro p + p { margin-top: .85em; }
.kh-intro p:first-child { color: var(--k-on-navy); font-size: 1.1rem; }
.kh-note {
    margin-top: 22px; max-width: 60ch; padding-inline-start: 14px;
    border-inline-start: 3px solid var(--k-gold); font-weight: 500;
}
.kh-cta { margin-top: 30px; display: flex; flex-wrap: wrap; align-items: center; gap: 14px 18px; }

.kh-doors { margin-top: 56px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.kh-door {
    display: flex; align-items: center; gap: 16px; padding: 18px 22px; min-height: 92px;
    border: 1px solid var(--k-on-navy-line); border-radius: var(--k-r-lg);
    background: var(--k-navy-900);
    background: color-mix(in srgb, var(--k-navy-700) 26%, var(--k-navy-900));
    color: inherit; text-decoration: none;
    transition: transform 180ms var(--k-ease);
}
.kh-door:active { transform: scale(.98); }
.kh-door div { flex: 1; min-width: 0; }
.kh-door b { display: block; font: 600 1.12rem/1.5 var(--k-font-display); }
.kh-door span { display: block; margin-top: 2px; color: var(--k-on-navy-2); font-size: .93rem; line-height: 1.6; }
.kh-door .ki { width: 22px; height: 22px; color: var(--k-gold-light); transition: transform 180ms var(--k-ease); }
@media (hover: hover) and (pointer: fine) {
    .kh-door:hover { transform: translateY(-2px); }
    .kh-door:hover .ki { transform: translateX(-4px); }
}

.kh-main > *, .kh-hero > div > * { animation: kp-rise 260ms var(--k-ease) both; }
.kh-hero > div > :nth-child(2) { animation-delay: 40ms; }
.kh-hero > div > :nth-child(3) { animation-delay: 80ms; }
.kh-hero > div > :nth-child(4) { animation-delay: 120ms; }
.kh-hero > div > :nth-child(n+5) { animation-delay: 160ms; }
.kh-hero { animation: none !important; }
.kh-doors { animation-delay: 200ms !important; }

@media (max-width: 900px) {
    .kh-main { justify-content: flex-start; padding-top: 8px; }
    .kh-hero { grid-template-columns: minmax(0, 1fr); gap: 28px; }
    .kh-lockup { order: -1; justify-self: start; width: 220px; }
    /* the full logo now sits right under the bar, so the small mark would only repeat it */
    .kh .kp-brand { display: none; }
    .kh-nav { margin-inline-start: -12px; }
    .kh-doors { margin-top: 40px; grid-template-columns: minmax(0, 1fr); gap: 12px; }
}
@media (max-width: 480px) {
    .kp-top { padding: 12px 18px; }
    .kh-main { padding-inline: 20px; }
    .kh-nav { margin-inline-start: -9px; }
    .kh-nav .kp-toplink { padding: 0 9px; font-size: .9rem; }
    .kh-cta .kp-btn { width: 100%; }
}

/* =========================================================
   FORM PAGE
   ========================================================= */
.kf .k-backdrop.is-dark, .kf-photo-bg { transition: opacity 240ms var(--k-ease); }
.kf.is-paper .k-backdrop.is-dark, .kf.is-paper .kf-photo-bg { opacity: 0; }
body.kf.is-paper { color: var(--k-ink); background: var(--k-bg); }

/* a background picture chosen by the admin for this form, under a navy veil */
.kf-photo-bg { position: fixed; inset: 0; z-index: -1; background: var(--k-navy-900) center / cover no-repeat; }
.kf-photo-bg::after {
    content: ""; position: absolute; inset: 0;
    background: var(--k-navy-900); opacity: .86;
}

.kf-logo-on-paper, .is-paper .kf-logo-on-navy { display: none; }
.is-paper .kf-logo-on-paper { display: block; }
.is-paper .kp-toplink { color: var(--k-ink-2); }
.is-paper .kp-toplink:hover { color: var(--k-navy); }
.is-paper :focus-visible { outline-color: var(--k-gold); }

.kf-main { flex: 1; width: 100%; display: flex; flex-direction: column; }
.kf-main > * { width: 100%; }
.kf-main > .kf-cover, .kf-main > .kf-state { margin-block: auto; }

/* ---------- cover ---------- */
.kf-cover {
    max-width: 1160px; margin: 0 auto; padding: 28px 24px 64px;
    display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr);
    grid-template-areas: "text brief" "text cta"; grid-template-rows: auto 1fr;
    column-gap: 72px; row-gap: 20px; align-items: start;
}
.kf-cover-text { grid-area: text; }
.kf-brief { grid-area: brief; }
.kf-cover-cta { grid-area: cta; }

.kf-banner { display: block; width: 100%; max-height: 240px; object-fit: cover; border-radius: var(--k-r-lg); margin-bottom: 24px; }
.kf-eyebrow { color: var(--k-gold-light); font-weight: 600; font-size: .95rem; }
.kf-eyebrow.is-latin {
    font: 600 .78rem/1.5 var(--k-font-display); letter-spacing: .18em; text-transform: uppercase; text-align: right;
}
.kf-cover h1 {
    margin-top: 14px; max-width: 15em;
    font: 700 clamp(1.9rem, 1.15rem + 3vw, 3.1rem)/1.32 var(--k-font-display); text-wrap: balance;
}
.kf-cover .k-rule { margin-top: 18px; }
.kf-intro { margin-top: 24px; max-width: 60ch; color: var(--k-on-navy-2); }
.kf-intro p + p { margin-top: .85em; }
.kf-intro p:first-child { color: var(--k-on-navy); font-size: 1.1rem; }
.kf-note {
    margin-top: 24px; max-width: 60ch; padding-inline-start: 14px;
    border-inline-start: 3px solid var(--k-gold); font-weight: 500;
}

.kf-brief {
    padding: 26px 26px 24px; border-radius: var(--k-r-xl);
    background: var(--k-surface); color: var(--k-ink); box-shadow: var(--k-shadow-lift);
}
.kf-brief h2 { font: 700 1rem/1.4 var(--k-font-display); color: var(--k-navy); margin-bottom: 14px; }
.kf-brief h2:not(:first-child) { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--k-line); }
.kf-points { display: grid; gap: 10px; }
.kf-points li { display: flex; align-items: flex-start; gap: 12px; color: var(--k-ink-2); font-size: .97rem; line-height: 1.65; }
.kf-points .k-bars { flex: none; margin-top: .28em; font-size: 1.05rem; }
.kf-outline { display: grid; gap: 8px; }
.kf-outline li { position: relative; display: flex; align-items: center; gap: 12px; font-weight: 500; line-height: 1.5; }
.kf-outline b {
    flex: none; display: grid; place-items: center; width: 30px; height: 30px;
    border: 1px solid var(--k-line-strong); border-radius: var(--k-r-sm); background: var(--k-surface);
    font: 700 .92rem/1 var(--k-font-display); color: var(--k-gold-ink);
}
/* the numbers stand on one line, like the bars of the mark */
.kf-outline li:not(:last-child)::after {
    content: ""; position: absolute; inset-inline-start: 14.5px; top: 100%; width: 1px; height: 8px; background: var(--k-line-strong);
}

.kf-resume { margin-bottom: 10px; color: var(--k-on-navy-2); font-size: .93rem; }
.kf-cover-buttons { display: flex; flex-wrap: wrap; gap: 12px; }
.kf-cover-buttons .kp-btn-gold { flex: 1 1 220px; }
.kf-cover-buttons .kp-btn-onnavy { flex: 0 1 auto; min-height: 56px; }
.kf-nojs { padding: 14px 16px; border: 1px solid var(--k-on-navy-line); border-radius: var(--k-r); background: var(--k-on-navy-line); }

.kf-cover-text > *, .kf-brief, .kf-cover-cta, .kf-state > * { animation: kp-rise 260ms var(--k-ease) both; }
.kf-cover-text > :nth-child(2), .kf-state > :nth-child(2) { animation-delay: 40ms; }
.kf-cover-text > :nth-child(3), .kf-state > :nth-child(3) { animation-delay: 80ms; }
.kf-cover-text > :nth-child(n+4), .kf-state > :nth-child(n+4) { animation-delay: 120ms; }
.kf-brief { animation-delay: 140ms; }
.kf-cover-cta { animation-delay: 180ms; }

/* ---------- notices on navy: closed, sent, not found ---------- */
.kf-state { max-width: 1160px; margin: 0 auto; padding: 24px 24px 12vh; }
.kf-state > * { max-width: 640px; }
.kf-state-ico {
    display: grid; place-items: center; width: 64px; height: 64px; margin-bottom: 26px;
    border: 1px solid var(--k-navy-300); border-radius: var(--k-r-lg); color: var(--k-gold-light);
}
.kf-state-ico .ki { width: 30px; height: 30px; }
.kf-state-ico.is-done { border: 0; background: var(--k-gold-grad); color: var(--k-on-gold); }
.kf-state-ico.is-done .ki { stroke-width: 2.4; }
.kf-state h1 { font: 700 clamp(1.7rem, 1.2rem + 2.2vw, 2.5rem)/1.35 var(--k-font-display); text-wrap: balance; outline: none; }
.kf-state p { margin-top: 14px; max-width: 56ch; color: var(--k-on-navy-2); font-size: 1.08rem; }
.kf-state-actions { margin-top: 30px; display: flex; flex-wrap: wrap; gap: 12px; }
.kf-state .kp-btn-white .ki { color: var(--k-ok); width: 1.35em; height: 1.35em; }

/* ---------- the form: paper ---------- */
.kf-form { --kf-pad: 16px; max-width: 780px; margin: 0 auto; padding: 6px var(--kf-pad) 56px; }

.kf-prog-wrap { margin: 0 4px 26px; }
.kf-prog-count { margin-bottom: 4px; color: var(--k-muted); font-size: .88rem; font-weight: 500; }
.kf-prog { display: flex; gap: 6px; }
.kf-prog li { flex: 1; min-width: 0; }
.kf-prog button {
    display: block; width: 100%; padding: 12px 0; border: 0; border-radius: var(--k-r-sm); background: none;
    color: var(--k-muted); font: 500 .84rem/1.45 var(--k-font); text-align: start; cursor: default;
    position: relative; -webkit-tap-highlight-color: transparent;
}
/* the bar is thin, the finger is not: a taller invisible hit area */
.kf-prog button::after { content: ""; position: absolute; inset: -8px 0; }
.kf-prog button:not(:disabled) { cursor: pointer; }
.kf-prog-bar { display: block; height: 4px; background: var(--k-line-strong); overflow: hidden; }
.kf-prog-bar i {
    display: block; height: 100%; background: var(--k-navy);
    transform: scaleX(0); transform-origin: 100% 50%;
    transition: transform 260ms var(--k-ease-inout);
}
.kf-prog .is-done i, .kf-prog .is-current i { transform: scaleX(1); }
.kf-prog .is-current i { background: var(--k-gold); }
.kf-prog-name { display: none; margin-top: 9px; padding-inline-end: 6px; }
.kf-prog-name b { margin-inline-end: .4em; font: 700 .84rem/1 var(--k-font-display); }
.kf-prog .is-done .kf-prog-name { color: var(--k-ink-2); }
.kf-prog .is-current .kf-prog-name { color: var(--k-navy); font-weight: 700; }
.kf-prog .is-current .kf-prog-name b { color: var(--k-gold-ink); }
@media (min-width: 720px) {
    .kf-prog-count { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
    .kf-prog-name { display: block; }
    .kf-prog button { padding: 4px 0 6px; }
}

.kf-step-head { margin: 0 4px 16px; }
.kf-step-head h2 {
    font: 700 clamp(1.45rem, 1.2rem + 1.1vw, 1.85rem)/1.35 var(--k-font-display); color: var(--k-navy); outline: none;
}
.kf-step-head h2:focus-visible, .kf-state h1:focus-visible { outline: none; }
.kf-step-head p { margin-top: 4px; color: var(--k-ink-2); }
.is-single .kf-step + .kf-step { margin-top: 36px; }
.kf-single-head { margin: 0 4px 28px; }
.kf-single-head h1 { font: 700 clamp(1.6rem, 1.2rem + 1.6vw, 2.1rem)/1.35 var(--k-font-display); color: var(--k-navy); }

@keyframes kf-step { from { opacity: 0; transform: translateX(var(--kf-dx, -14px)); } to { opacity: 1; transform: none; } }
.kf-step.is-entering { animation: kf-step 240ms var(--k-ease) both; }
.kf-form.is-entering { animation: kp-rise 240ms var(--k-ease) both; }
.kf-field.is-revealed { animation: kp-rise 220ms var(--k-ease) both; }

.kf-card {
    padding: 30px; border: 1px solid var(--k-line); border-radius: var(--k-r-xl);
    background: var(--k-surface); box-shadow: var(--k-shadow);
}
.kf-fields { display: grid; gap: 30px; }

/* one question */
.kf-field { min-width: 0; margin: 0; padding: 0; border: 0; }
.kf-label { display: block; width: 100%; padding: 0; font: 600 1.03rem/1.55 var(--k-font); color: var(--k-ink); }
.kf-req { margin-inline-start: .25em; color: var(--k-danger); }
.kf-optional { margin-inline-start: .55em; color: var(--k-muted); font-size: .82rem; font-weight: 400; }
.kf-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.kf-help { margin-top: 3px; color: var(--k-muted); font-size: .92rem; line-height: 1.6; }
.kf-control { margin-top: 12px; }

.kf-input {
    display: block; width: 100%; min-height: 52px; padding: 12px 14px;
    border: 1px solid var(--k-navy-300); border-radius: var(--k-r);
    background: var(--k-surface); color: var(--k-ink);
    font: 400 1rem/1.6 var(--k-font);
    appearance: none; -webkit-appearance: none;
}
.kf-input::placeholder { color: var(--k-muted); opacity: .85; }
.kf-input:hover { border-color: var(--k-navy-600); }
.kf-input:focus, .kf-input:focus-visible { outline: none; border-color: var(--k-navy); box-shadow: var(--k-ring), inset 0 0 0 1px var(--k-navy); }
.kf-input[dir="ltr"] { text-align: right; }
textarea.kf-input { min-height: 96px; resize: none; overflow: hidden; }
input[type="date"].kf-input { min-height: 52px; }
.kf-selectwrap { position: relative; }
.kf-selectwrap select { padding-inline-end: 44px; cursor: pointer; }
.kf-selectwrap::after {
    content: ""; position: absolute; inset-inline-end: 18px; top: 50%; width: 9px; height: 9px;
    border: solid var(--k-ink-2); border-width: 0 2px 2px 0;
    transform: translateY(-70%) rotate(45deg); pointer-events: none;
}

.has-error .kf-input { border-color: var(--k-danger); box-shadow: inset 0 0 0 1px var(--k-danger); }
.kf-err {
    display: flex; align-items: flex-start; gap: 7px; margin-top: 9px;
    color: var(--k-danger); font-size: .93rem; font-weight: 500; line-height: 1.55;
}
.kf-err .ki { width: 1.15em; height: 1.15em; margin-top: .18em; }
.kf-hint { margin-top: 9px; color: var(--k-warn); font-size: .92rem; line-height: 1.55; }

/* choices: tiles for radio / checkbox, cards with a description for "cards" */
.kf-opts { display: grid; gap: 8px; grid-template-columns: minmax(0, 1fr); }
.kf-opts[data-cols="2"], .kf-opts[data-cols="3"], .kf-opts[data-cols="4"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.kf-opt {
    position: relative; display: flex; align-items: center; gap: 11px;
    min-height: 52px; padding: 10px 14px;
    border: 1px solid var(--k-navy-300); border-radius: var(--k-r);
    background: var(--k-surface); color: var(--k-ink); line-height: 1.5;
    cursor: pointer; user-select: none; -webkit-tap-highlight-color: transparent;
    transition: transform 140ms var(--k-ease);
}
.kf-opt:active { transform: scale(.98); }
.kf-opt input { position: absolute; inset-inline-start: 18px; top: 50%; width: 1px; height: 1px; margin: 0; opacity: 0; pointer-events: none; }
.kf-opt.is-checked { border-color: var(--k-navy); box-shadow: inset 0 0 0 1px var(--k-navy); background: var(--k-navy-50); }
.kf-opt input:focus-visible + .kf-mark { outline: 2px solid var(--k-gold); outline-offset: 3px; }
.has-error .kf-opt:not(.is-checked) { border-color: var(--k-danger); }
@media (hover: hover) and (pointer: fine) {
    .kf-opt:not(.is-checked):hover { border-color: var(--k-navy-600); background: var(--k-surface-2); }
}

.kf-mark {
    flex: none; display: grid; place-items: center; width: 22px; height: 22px;
    border: 1.5px solid var(--k-muted); border-radius: 6px; background: var(--k-surface); color: var(--k-surface);
}
.kf-mark .ki { width: 14px; height: 14px; stroke-width: 3.2; opacity: 0; transform: scale(.8); transition: opacity 140ms var(--k-ease), transform 140ms var(--k-ease); }
.kf-mark.is-round { border-radius: 50%; }
.kf-mark.is-round::after {
    content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--k-surface);
    opacity: 0; transform: scale(.6); transition: opacity 140ms var(--k-ease), transform 140ms var(--k-ease);
}
.is-checked > .kf-mark { border-color: var(--k-navy); background: var(--k-navy); }
.is-checked > .kf-mark .ki, .is-checked > .kf-mark.is-round::after { opacity: 1; transform: none; }

.kf-cards { display: grid; gap: 10px; grid-template-columns: minmax(0, 1fr); }
.kf-cardopt { align-items: flex-start; gap: 13px; min-height: 78px; padding: 14px 16px; border-radius: var(--k-r-lg); }
.kf-cardopt .kf-mark { margin-top: 3px; }
.kf-cardopt b { display: block; font: 600 1.03rem/1.5 var(--k-font); }
.kf-cardopt small { display: block; margin-top: 2px; color: var(--k-ink-2); font-size: .91rem; line-height: 1.65; }
.kf-cardopt.is-checked b { color: var(--k-navy); }
.kf-count { margin-top: 10px; color: var(--k-muted); font-size: .9rem; }
.kf-count b { color: var(--k-navy); font-family: var(--k-font-display); }

.kf-scale { display: grid; grid-template-columns: repeat(auto-fit, minmax(48px, 1fr)); gap: 6px; }
.kf-scale .kf-opt { justify-content: center; padding: 0; font: 700 1.05rem/1 var(--k-font-display); }
.kf-scale .kf-opt.is-checked { background: var(--k-navy); color: var(--k-surface); }
.kf-scale .kf-opt input:focus-visible ~ span { outline: 2px solid var(--k-gold); outline-offset: 12px; }
.kf-scale-labels { display: flex; justify-content: space-between; gap: 12px; margin-top: 7px; color: var(--k-muted); font-size: .86rem; }

.kf-consent { align-items: flex-start; gap: 13px; padding: 16px; border-radius: var(--k-r-lg); line-height: 1.85; }
.kf-consent .kf-mark { margin-top: 5px; }

.kf-noteblock { display: flex; gap: 12px; padding: 15px 16px; border-radius: var(--k-r); background: var(--k-navy-50); color: var(--k-ink-2); }
.kf-noteblock .ki { margin-top: .22em; color: var(--k-navy-600); }
.kf-noteblock b { display: block; color: var(--k-ink); font-weight: 600; }
.kf-noteblock p { margin-top: 2px; font-size: .94rem; line-height: 1.7; }

/* the photo */
.kf-photo { position: relative; }
.kf-photo-input { position: absolute; inset-inline-start: 24px; top: 24px; width: 1px; height: 1px; opacity: 0; }
.kf-photo-drop {
    display: flex; align-items: center; gap: 16px; padding: 18px;
    border: 1.5px dashed var(--k-navy-300); border-radius: var(--k-r-lg);
    background: var(--k-surface-2); cursor: pointer; -webkit-tap-highlight-color: transparent;
    transition: transform 140ms var(--k-ease);
}
.kf-photo-drop:active { transform: scale(.99); }
.kf-photo-ico {
    flex: none; display: grid; place-items: center; width: 64px; height: 64px;
    border-radius: var(--k-r); background: var(--k-navy-50); color: var(--k-navy);
}
.kf-photo-ico .ki { width: 28px; height: 28px; stroke-width: 1.7; }
.kf-photo-t { display: block; color: var(--k-navy); font-weight: 600; line-height: 1.5; }
.kf-photo-s { display: block; margin-top: 3px; color: var(--k-muted); font-size: .9rem; line-height: 1.55; }
.kf-photo-s .kf-drag { display: none; }
@media (hover: hover) and (pointer: fine) {
    .kf-photo-s .kf-drag { display: inline; }
    .kf-photo-s .kf-touch { display: none; }
    .kf-photo-drop:hover { border-color: var(--k-navy-600); background: var(--k-navy-50); }
}
.kf-photo.is-over .kf-photo-drop { border-color: var(--k-navy); border-style: solid; background: var(--k-navy-50); }
.kf-photo-input:focus-visible ~ .kf-photo-drop, .kf-photo-input:focus-visible ~ .kf-photo-ready { outline: 2px solid var(--k-gold); outline-offset: 2px; }
.has-error .kf-photo-drop { border-color: var(--k-danger); }

.kf-photo-busy { display: flex; align-items: center; gap: 12px; min-height: 102px; padding: 18px; border: 1px solid var(--k-line-strong); border-radius: var(--k-r-lg); color: var(--k-ink-2); }
.kf-photo-busy .kp-spin { color: var(--k-navy); }
.kf-photo-ready { display: flex; align-items: center; gap: 16px; padding: 14px; border: 1px solid var(--k-navy-300); border-radius: var(--k-r-lg); background: var(--k-surface); }
.kf-photo-img { flex: none; width: 112px; height: 112px; object-fit: cover; border-radius: var(--k-r); background: var(--k-navy-50); }
.kf-photo-meta { flex: 1; min-width: 0; }
.kf-photo-meta strong { display: flex; align-items: center; gap: 6px; color: var(--k-ok); font-weight: 600; line-height: 1.5; }
.kf-photo-meta strong .ki { width: 1.1em; height: 1.1em; stroke-width: 2.6; }
.kf-photo-meta > span { display: block; margin-top: 2px; color: var(--k-muted); font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kf-photo-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }

/* honeypot: people never see it, bots fill it */
.kf-hp { position: absolute; inset-inline-start: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden; }

.kf-alert {
    display: flex; align-items: flex-start; gap: 10px; margin-top: 16px; padding: 13px 16px;
    border-radius: var(--k-r); background: var(--k-danger-bg); color: var(--k-danger); font-weight: 500; line-height: 1.6;
}
.kf-alert .ki { margin-top: .2em; }

/* ---------- the step's two actions ----------
   Next is the one gold thing on the screen: taller than every other control, with its arrow in a
   darker tile at the leading edge. On phones the pair rides the bottom of the screen (see the
   720px block below), so the way forward is always in reach on a long step. */
.kf-actions { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 20px; }
.kf-actions-prog { display: none; }
.kf-actions-end { height: 1px; }
.kf-back { min-height: 56px; }
.kf-next {
    position: relative; min-width: 232px; min-height: 56px; margin-inline-start: auto; padding-inline: 60px;
    font-size: 1.08rem; font-weight: 700;
    box-shadow: inset 0 1px 0 rgb(255 255 255 / .4), 0 1px 2px rgb(123 84 7 / .35), 0 16px 28px -16px rgb(170 112 10 / .9);
}
.kf-next-ico {
    position: absolute; inset-inline-end: 10px; top: 50%; width: 36px; height: 36px; margin-top: -18px;
    display: grid; place-items: center; border-radius: var(--k-r-sm);
    background: rgb(0 23 43 / .13); transition: transform 180ms var(--k-ease);
}
.kf-next .kf-next-ico .ki { width: 20px; height: 20px; stroke-width: 2.4; }
.kf-next:disabled { opacity: .8; }
@media (hover: hover) and (pointer: fine) {
    .kf-next:not(:disabled):hover .kf-next-ico { transform: translateX(-3px); }
}

.kf-draft {
    display: flex; flex-wrap: wrap; align-items: center; gap: 0 10px; margin: 18px 4px 0;
    color: var(--k-muted); font-size: .88rem; line-height: 1.6;
}
.kf-draft > span { display: inline-flex; align-items: center; gap: 6px; }
.kf-draft .ki { width: 1.1em; height: 1.1em; color: var(--k-ok); stroke-width: 2.4; }
.kf-draft .kp-linkbtn { font-size: .88rem; color: var(--k-ink-2); }

@media (min-width: 600px) {
    .kf-opts[data-cols="3"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .kf-opts[data-cols="4"] { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (min-width: 680px) {
    .kf-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
    .kf-cover { display: block; padding: 10px 20px 0; }
    .kf-brief { margin-top: 28px; padding: 22px 20px; border-radius: var(--k-r-lg); }
    /* one clear button, always in reach: it rides the bottom of the screen and settles at the end */
    .kf-cover-cta {
        position: sticky; bottom: 0; z-index: 2; margin: 28px -20px 0;
        padding: 12px 20px calc(12px + env(safe-area-inset-bottom));
        border-top: 1px solid var(--k-on-navy-line); background: var(--k-navy-950);
    }
    .kf-cover-buttons .kp-btn-gold { flex-basis: 100%; }
    .kf-cover-buttons .kp-btn-onnavy { flex: 1; min-height: 48px; background: var(--k-navy-950); }
}
/* phones: the actions become a bar that rides the bottom of the screen and settles at the end of
   the step. While it floats it has a surface, a shadow and the step progress along its top edge;
   at rest (.is-floating removed by assets/form.js) it is flat, like the desktop row. */
@media (max-width: 720px) {
    .kf-form { padding-bottom: 32px; }
    .kf-actions {
        position: sticky; bottom: 0; z-index: 6; gap: 10px;
        margin: 20px calc(-1 * var(--kf-pad)) 0;
        padding: 12px var(--kf-pad) calc(12px + env(safe-area-inset-bottom));
    }
    .kf-actions::before {
        content: ""; position: absolute; inset: 0; z-index: -1;
        border-top: 1px solid var(--k-line); background: var(--k-surface);
        box-shadow: 0 -12px 28px -16px rgb(0 34 61 / .34);
        opacity: 0; transition: opacity 200ms var(--k-ease);
    }
    @supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
        .kf-actions::before {
            background: rgb(255 255 255 / .9);
            -webkit-backdrop-filter: saturate(1.5) blur(12px); backdrop-filter: saturate(1.5) blur(12px);
        }
    }
    .kf-actions-prog {
        display: block; position: absolute; inset: 0 0 auto; height: 3px; overflow: hidden;
        background: var(--k-navy-100); opacity: 0; transition: opacity 200ms var(--k-ease);
    }
    .kf-actions-prog i {
        display: block; height: 100%; background: linear-gradient(270deg, var(--k-gold-light), var(--k-gold-deep));
        transform: scaleX(0); transform-origin: 100% 50%; transition: transform 260ms var(--k-ease-inout);
    }
    .kf-actions.is-floating::before, .kf-actions.is-floating .kf-actions-prog { opacity: 1; }
    .kf-actions .kf-next { flex: 1; min-width: 0; }
    .kf-actions .kf-back { flex: none; padding-inline: 1rem 1.15rem; }
    /* keep a focused question clear of the bar when the browser scrolls to it */
    html:has(.kf-actions.is-floating) { scroll-padding-bottom: 104px; }
}
@media (max-width: 560px) {
    .kp-logo { height: 38px; }
    .kf-form { --kf-pad: 12px; }
    .kf-card { padding: 22px 16px; border-radius: var(--k-r-lg); }
    .kf-fields { gap: 28px; }
    .kf-photo-drop { padding: 14px; gap: 14px; }
    .kf-photo-ico { width: 56px; height: 56px; }
    .kf-photo-ready { padding: 12px; gap: 12px; }
    .kf-photo-img { width: 96px; height: 96px; }
    .kf-state { padding-inline: 20px; }
    .kf-state-actions .kp-btn { flex: 1 1 100%; }
}

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