/* ───────────────────────────────────────────────────────────────────────────
   KitBase: the shared kit styles for the three member portals
   (Vision Portal, Bible School, Volunteers Portal). Rulebook: docs/KIT.md.

   Loaded in each site's page head AFTER the theme and that site's brand file.
   It adds only `k-` classes and `--k-` values, so it changes nothing on a
   screen that does not use them.

   Rules for this file:
     * every size, gap, corner, shadow and colour is a theme value (`var(--…)`);
       no typed colour or size except in the `--k-` defaults just below;
     * nothing here names a portal. A portal differs only through its brand file
       (KJSColor_VisionBlue, KJSColor_BibleGreen, KJSColor_Volunteers);
     * two screen widths only: 600px and 900px.
   ─────────────────────────────────────────────────────────────────────────── */

/* Kit-only values. `:where` keeps these at zero weight, so a brand file's
   `:root` wins whatever the load order. */
:where(:root) {
    /* status colours: the same in every portal */
    --k-ok:        #1f6b3b;
    --k-ok-soft:   #e3f1e6;
    --k-warn:      #8a4b08;
    --k-warn-soft: #fdf0cf;
    --k-bad:       #b3261e;
    --k-bad-soft:  #f7e0dd;
    /* the brand's second colour; each brand file sets its own three */
    --k-second:      var(--gold, #c39a44);
    --k-second-soft: var(--card-2);
    --k-second-ink:  var(--ink);
    /* how heavy the page title is; a brand file may set it to suit its heading font */
    --k-h1-weight: 500;
    /* how wide a page's content may grow; a site sets it to line up with its header */
    --k-page-max: 70rem;
    --k-touch: 2.75rem;   /* smallest touch target */
    /* room a fixed bottom bar takes from the page; the site that has one sets it */
    --k-nav-clear: 0px;
}

/* kit parts keep their size whether or not they sit in a k-page */
.k-card, .k-choice, .k-input, .k-btn, .k-list, .k-row, .k-banner, .k-tile { box-sizing: border-box; }

/* ── page ─────────────────────────────────────────────────────────────── */
.k-page {
    box-sizing: border-box;
    width: 100%;
    max-width: var(--k-page-max);
    margin: 0 auto;
    padding: var(--s-5) var(--s-4) calc(var(--s-8) + var(--k-nav-clear) + env(safe-area-inset-bottom, 0px));
    display: flex;
    flex-direction: column;
    gap: var(--s-6);
    color: var(--ink);
    font-family: var(--font-ui);
    font-size: var(--fs-body);
    line-height: var(--lh-normal);
}
.k-page *, .k-page *::before, .k-page *::after { box-sizing: border-box; }
.k-page--narrow { max-width: 42rem; }
/* Arriving softly: once a page's data is in, what it brings fades in under the title. */
.k-page--arrive > :not(.k-h1) { animation: k-arrive var(--motion-duration-exit, 220ms) ease-out both; }
@keyframes k-arrive { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .k-page--arrive > :not(.k-h1) { animation: none; } }
.k-section { display: flex; flex-direction: column; gap: var(--s-3); }
.k-stack   { display: flex; flex-direction: column; gap: var(--s-4); }
.k-cols    { display: flex; flex-direction: column; gap: var(--s-4); }
.k-between { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); }
.k-between > :first-child { flex: 1; min-width: 0; }

/* A landing page brings its parts in one after another, each rising a little. k-page--wait
   holds them unseen until the page can be seen; k-page--rise plays it. */
.k-page--wait > :not(.k-h1) { opacity: 0; }
.k-page--rise > :not(.k-h1) { animation: k-rise var(--motion-duration-entrance, 400ms) var(--motion-ease-out, cubic-bezier(0.16, 1, 0.3, 1)) both; }
.k-page--rise > :nth-child(3) { animation-delay: 70ms; }
.k-page--rise > :nth-child(4) { animation-delay: 140ms; }
.k-page--rise > :nth-child(n + 5) { animation-delay: 210ms; }
@keyframes k-rise { from { opacity: 0; transform: translateY(var(--s-3)); } }
@media (prefers-reduced-motion: reduce) { .k-page--rise > :not(.k-h1) { animation: none; } }
/* columns whose cards share one height; a stack whose cards share the room */
.k-cols--fill { align-items: stretch; }
.k-stack--fill > * { flex: 1 1 auto; }
/* a row of buttons at the foot of a form or card */
.k-actions { display: flex; flex-wrap: wrap; gap: var(--s-3); }

/* ── text ─────────────────────────────────────────────────────────────── */
/* The theme forces h1 and h2 sizes; the repeated class out-weighs it. */
.k-h1.k-h1.k-h1.k-h1.k-h1 {
    font-family: var(--font-display);
    font-size: var(--fs-display) !important;
    font-weight: var(--k-h1-weight) !important;
    letter-spacing: var(--k-h1-tracking, normal);
    line-height: var(--lh-tight) !important;
    margin: 0;
    color: var(--ink);
    text-wrap: balance;
}
.k-h1::after {
    content: "";
    display: block;
    width: 2.75rem;
    height: 0.25rem;
    border-radius: var(--r-pill);
    background: var(--k-h1-line, var(--k-second));
    margin-top: var(--s-3);
}
.k-h2.k-h2 {
    font-family: var(--k-heading-font, var(--font-ui));
    font-size: var(--fs-h2) !important;
    font-weight: 700;
    line-height: var(--lh-snug);
    margin: 0;
    color: var(--ink-2);
}
.k-eyebrow {
    font-size: var(--fs-micro);
    letter-spacing: var(--tracking-eyebrow);
    text-transform: uppercase;
    font-weight: 700;
    color: var(--ink-3);
    margin: 0;
}
.k-sub  { color: var(--ink-3); font-size: var(--fs-body-sm); margin: var(--s-2) 0 0; }
.k-meta { color: var(--ink-3); font-size: var(--fs-body-sm); margin: 0; }
.k-text { color: var(--ink-2); font-size: var(--fs-body); margin: 0; }

/* ── card ─────────────────────────────────────────────────────────────── */
.k-card {
    background: var(--card);
    border: 1px solid var(--rule-2);
    border-radius: var(--radius-lg);
    padding: var(--s-5);
    display: flex;
    flex-direction: column;
    gap: var(--s-3);
}
/* Every plain card and list carries the same soft shadow, in all three portals (Giovani,
   2026-12-03). The tinted cards (soft, quiet, warn, bad) are flat: their colour sets them apart.
   A card that can be tapped is told apart by its chevron and by answering the touch. */
.k-card, .k-list { box-shadow: var(--shadow); }
.k-card--soft, .k-card--quiet, .k-card--warn, .k-card--bad { box-shadow: none; }
.k-card .k-card, .k-card .k-list, .k-list .k-list, .k-dialog__body .k-card, .k-dialog__body .k-list { box-shadow: none; }
.k-card--soft  { background: var(--accent-soft); border-color: transparent; }
.k-card--quiet { background: var(--paper-2); border-color: transparent; }
/* something the member has to put right */
.k-card--warn  { background: var(--k-warn-soft); border-color: transparent; }
.k-card--warn .k-eyebrow { color: var(--k-warn); }
.k-card--bad   { background: var(--k-bad-soft); border-color: transparent; }
/* The hero's two soft circles are painted as backgrounds, so they need no extra elements. */
.k-card--hero {
    color: var(--accent-ink);
    border-color: transparent;
    overflow: hidden;
    padding: var(--s-6);
    background:
        radial-gradient(circle at calc(100% - 2.5rem) -2rem, color-mix(in srgb, var(--card) 9%, transparent) 0 5.5rem, transparent 5.6rem),
        radial-gradient(circle at calc(100% - 6rem) calc(100% + 2rem), color-mix(in srgb, var(--k-second) 30%, transparent) 0 4.5rem, transparent 4.6rem),
        var(--accent);
}
/* A card that can be tapped: on a <button> or an <a>. It is the only card with a shadow,
   it always carries a chevron on the right, and it answers the touch. */
.k-card--link {
    position: relative;
    width: 100%;
    padding-right: calc(var(--s-5) + var(--s-6));
    box-shadow: var(--shadow);
    color: var(--ink);
    font: inherit;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
    transition: border-color var(--motion-duration-feedback, 120ms), transform var(--motion-duration-feedback, 120ms), box-shadow var(--motion-duration-feedback, 120ms);
    -webkit-tap-highlight-color: transparent;
}
.k-card--link::after {
    content: "";
    position: absolute;
    right: var(--s-5);
    top: 50%;
    width: 0.55rem;
    height: 0.55rem;
    border-top: 2.5px solid var(--accent);
    border-right: 2.5px solid var(--accent);
    transform: translateY(-50%) rotate(45deg);
}
.k-card--link:hover  { border-color: var(--accent); color: var(--ink); text-decoration: none; }
.k-card--link:active { border-color: var(--accent); box-shadow: none; transform: scale(0.985); }
.k-card--link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.k-card--soft.k-card--link { box-shadow: none; }
.k-card--hero.k-card--link, .k-card--hero.k-card--link:hover { color: var(--accent-ink); }
.k-card--hero.k-card--link::after { border-color: var(--accent-ink); }
.k-card--hero.k-card--link:hover  { border-color: transparent; filter: brightness(1.06); }
@media (prefers-reduced-motion: reduce) { .k-card--link { transition: none; } .k-card--link:active { transform: none; } }
.k-card--hero .k-eyebrow,
.k-card--hero .k-text,
.k-card--hero .k-meta { color: inherit; opacity: 0.9; }
/* repeated so it out-weighs the theme's forced h1 and h2 sizes whatever tag carries it */
.k-card__title.k-card__title.k-card__title.k-card__title.k-card__title {
    font-family: var(--k-heading-font, var(--font-ui));
    font-size: var(--fs-h2) !important;
    font-weight: 700;
    line-height: var(--lh-snug);
    margin: 0;
    color: inherit;
}
.k-card--hero .k-card__title.k-card__title.k-card__title.k-card__title.k-card__title { font-size: var(--fs-h1) !important; line-height: var(--lh-snug) !important; }

/* ── button ───────────────────────────────────────────────────────────── */
.k-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--s-2);
    min-height: var(--k-touch);
    padding: 0 var(--s-5);
    border-radius: var(--r-pill);
    border: 1.5px solid transparent;
    background: transparent;
    color: var(--ink);
    font-family: var(--font-ui);
    font-size: var(--fs-body-sm);
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.k-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.k-btn[disabled], .k-btn[aria-disabled="true"] { opacity: 0.5; cursor: default; }
.k-btn--primary { background: var(--accent); color: var(--accent-ink); }
.k-btn--primary:hover { background: var(--accent-2); }
.k-btn--ghost   { border-color: var(--rule-2); background: var(--card); }
.k-btn--ghost:hover { background: var(--card-2); }
.k-btn--outline { border-color: var(--accent); color: var(--accent-2); }
.k-btn--light   { background: var(--card); color: var(--accent-2); }
.k-btn--danger  { background: var(--k-bad); color: var(--card); }
.k-btn--text    { padding: 0; color: var(--accent-2); }
.k-btn--block   { width: 100%; }
.k-btn--sm      { min-height: 2.25rem; padding: 0 var(--s-4); }
/* a round button that holds only an icon */
.k-btn--icon    { flex: none; width: var(--k-touch); padding: 0; }
/* an icon inside a kit part takes the part's colour */
.k-btn, .k-row__tile, .k-tile__mark, .k-pill, .k-banner { --slds-c-icon-color-foreground-default: currentColor; --sds-c-icon-color-foreground-default: currentColor; }

/* ── pill ─────────────────────────────────────────────────────────────── */
.k-pill {
    display: inline-flex;
    align-items: center;
    gap: var(--s-1);
    padding: 0.2rem 0.6rem;
    border-radius: var(--r-pill);
    font-size: var(--fs-pill);
    font-weight: 700;
    line-height: var(--lh-snug);
    white-space: nowrap;
    background: var(--paper-2);
    color: var(--ink-2);
}
.k-stack > .k-pill { align-self: flex-start; }
.k-pill--info   { background: var(--accent-soft); color: var(--accent-2); }
.k-pill--ok     { background: var(--k-ok-soft); color: var(--k-ok); }
.k-pill--warn   { background: var(--k-warn-soft); color: var(--k-warn); }
.k-pill--bad    { background: var(--k-bad-soft); color: var(--k-bad); }
.k-pill--solid  { background: var(--accent); color: var(--accent-ink); }
.k-pill--second { background: var(--k-second-soft); color: var(--k-second-ink); }
/* on a soft card the info pill would vanish into the card, so it takes the card colour */
.k-card--soft .k-pill--info { background: var(--card); }

/* ── list and row ─────────────────────────────────────────────────────── */
.k-list {
    background: var(--card);
    border: 1px solid var(--rule-2);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin: 0;
    padding: 0;
    list-style: none;
}
.k-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap; /* a row whose end is too wide for a phone drops it to a second line */
    gap: var(--s-3);
    width: 100%;
    min-height: 3.5rem;
    padding: var(--s-3) var(--s-4);
    border: 0;
    border-top: 1px solid var(--rule);
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: left;
    text-decoration: none;
}
.k-row:first-child { border-top: 0; }
/* when each row sits in its own list item, the line between rows is drawn on the item */
.k-list > li:not(.k-row) + li { border-top: 1px solid var(--rule); }
.k-row[aria-disabled="true"] .k-row__title { color: var(--ink-3); }
button.k-row:disabled { opacity: 0.5; cursor: not-allowed; }
button.k-row, a.k-row { cursor: pointer; }
button.k-row:hover, a.k-row:hover { background: var(--card-2); }
button.k-row:focus-visible, a.k-row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.k-row__tile {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: var(--radius);
    background: var(--accent-soft);
    color: var(--accent-2);
    display: grid;
    place-items: center;
    flex: none;
}
.k-row__tile--second { background: var(--k-second-soft); color: var(--k-second-ink); }
.k-row__tile--warn   { background: var(--k-warn-soft); color: var(--k-warn); }
.k-row__tile--bad    { background: var(--k-bad-soft); color: var(--k-bad); }
.k-row__tile--ok     { background: var(--k-ok-soft); color: var(--k-ok); }
.k-row__body  { flex: 1 1 7rem; min-width: 0; }
.k-row__title { display: block; font-family: var(--k-heading-font, inherit); font-weight: 600; margin: 0; color: var(--ink); overflow-wrap: anywhere; }
.k-row__meta  { display: block; color: var(--ink-3); font-size: var(--fs-body-sm); margin: 0; overflow-wrap: anywhere; }
.k-row__end   { display: flex; align-items: center; gap: var(--s-2); color: var(--ink-3); flex: none; margin-left: auto; }
.k-avatar {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: var(--accent-soft);
    color: var(--accent-2);
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: var(--fs-body-sm);
    flex: none;
}
.k-avatar--lg { width: 3.5rem; height: 3.5rem; font-size: var(--fs-h2); }

/* ── progress and steps ───────────────────────────────────────────────── */
.k-progress {
    flex: 1;
    height: 0.5rem;
    border-radius: var(--r-pill);
    background: var(--rule);
    overflow: hidden;
}
.k-progress > i { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.k-card--hero .k-btn--outline { color: var(--accent-ink); border-color: currentColor; }
.k-card--hero .k-progress { background: color-mix(in srgb, var(--card) 28%, transparent); }
.k-card--hero .k-progress > i { background: var(--card); }
.k-dot {
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: var(--fs-micro);
    font-weight: 700;
    background: var(--paper-2);
    color: var(--ink-3);
    flex: none;
}
.k-dot--done { background: var(--accent); color: var(--accent-ink); }
.k-dot--now  { background: var(--k-second); color: var(--k-second-ink); }
.k-flow {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    gap: var(--s-2);
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: var(--fs-micro);
    font-weight: 600;
    color: var(--ink-3);
}
.k-flow > li::before {
    content: "";
    display: block;
    height: 0.375rem;
    border-radius: var(--r-pill);
    background: var(--rule);
    margin-bottom: var(--s-1);
}
.k-flow > li.is-done::before { background: var(--accent); }
.k-flow > li.is-now::before  { background: var(--k-second); }
.k-flow > li.is-now { color: var(--ink); font-weight: 700; }

/* Step bars for a hero: one bar per step, the done ones light, the current one in the second
   colour. The names under the bars show from 900px; on a phone say the step in one line. */
.k-bars {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    gap: var(--s-2);
    list-style: none;
    margin: 0;
    padding: 0;
}
.k-bars > li { display: flex; flex-direction: column; gap: var(--s-1); min-width: 0; }
.k-bars > li::before {
    content: "";
    height: 0.4375rem;
    border-radius: var(--r-pill);
    background: color-mix(in srgb, var(--card) 28%, transparent);
}
.k-bars > li.is-done::before { background: var(--card); }
.k-bars > li.is-now::before  { background: var(--k-second); }
.k-bars__label { display: none; font-size: var(--fs-micro); line-height: var(--lh-snug); overflow-wrap: break-word; opacity: 0.8; }
.k-bars > li.is-now .k-bars__label { font-weight: 700; opacity: 1; }

/* Link tiles: a small grid of ways out to other places. */
.k-tiles { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-3); }
.k-tile {
    position: relative;
    display: flex;
    align-items: center;
    gap: var(--s-3);
    min-height: 4.25rem;
    padding: var(--s-3) var(--s-8) var(--s-3) var(--s-3);
    border: 1px solid var(--rule-2);
    border-radius: var(--radius-lg);
    background: var(--card);
    box-shadow: var(--shadow);
    color: var(--ink);
    text-decoration: none;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.k-tile::after {
    content: "";
    position: absolute;
    right: var(--s-3);
    top: 50%;
    width: 0.5rem;
    height: 0.5rem;
    border-top: 2.5px solid var(--accent);
    border-right: 2.5px solid var(--accent);
    transform: translateY(-50%) rotate(45deg);
}
.k-tile:hover { border-color: var(--accent); color: var(--ink); text-decoration: none; }
.k-tile:active { border-color: var(--accent); box-shadow: none; }
.k-tile:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.k-tile__mark {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: var(--accent-soft);
    color: var(--accent-2);
    display: grid;
    place-items: center;
    overflow: hidden;
    flex: none;
}
.k-tile__mark--second { background: var(--k-second-soft); color: var(--k-second-ink); }

/* Calendar pieces: a date tile, a time column, a strip of days. */
.k-date {
    width: 3rem;
    padding: var(--s-1) 0;
    border-radius: var(--radius);
    background: var(--accent-soft);
    color: var(--accent-2);
    text-align: center;
    line-height: var(--lh-tight);
    flex: none;
}
.k-date > b { display: block; font-size: var(--fs-h2); }
.k-date > span { display: block; font-size: var(--fs-micro); font-weight: 700; text-transform: uppercase; letter-spacing: var(--tracking-pill); }
.k-time { width: 3.25rem; flex: none; text-align: right; font-weight: 700; line-height: var(--lh-tight); color: var(--ink); }
.k-time > span { display: block; font-size: var(--fs-micro); font-weight: 500; color: var(--ink-3); }
.k-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: var(--s-1); }
.k-day {
    min-height: var(--k-touch);
    padding: var(--s-1) 0;
    border: 1.5px solid var(--rule-2);
    border-radius: var(--radius);
    background: var(--card);
    color: var(--ink-3);
    font: inherit;
    font-size: var(--fs-micro);
    font-weight: 600;
    line-height: var(--lh-tight);
    text-align: center;
    cursor: pointer;
}
.k-day > b { display: block; font-size: var(--fs-body); color: var(--ink); }
.k-day[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.k-day[aria-pressed="true"] > b { color: inherit; }
.k-day[disabled] { opacity: 0.45; cursor: default; }

/* A path of stops, top to bottom: a k-dot, then what the stop is. */
.k-rail { display: flex; flex-direction: column; gap: var(--s-3); list-style: none; margin: 0; padding: 0; }
.k-rail > li { display: flex; align-items: flex-start; gap: var(--s-3); }
.k-rail > li > :last-child { flex: 1; min-width: 0; }

/* A figure that carries the page: a percentage, a count. */
.k-figure { font-family: var(--font-display); font-size: var(--fs-h1); font-weight: 600; line-height: var(--lh-tight); color: var(--ink); }

/* Helpers: read by screen readers only; a quiet box of long text that scrolls. */
.k-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.k-scroll {
    max-height: 11rem;
    overflow-y: auto;
    padding: var(--s-3);
    border: 1px solid var(--rule-2);
    border-radius: var(--radius);
    background: var(--paper-2);
    color: var(--ink-2);
    font-size: var(--fs-body-sm);
    white-space: pre-wrap;
}

/* ── form ─────────────────────────────────────────────────────────────── */
.k-fields { display: grid; grid-template-columns: 1fr; gap: var(--s-3); }
.k-field  { display: flex; flex-direction: column; gap: var(--s-1); }
.k-label  { font-size: var(--fs-body-sm); font-weight: 600; color: var(--ink-2); }
.k-help   { font-size: var(--fs-body-sm); color: var(--ink-3); margin: 0; }
.k-error  { font-size: var(--fs-body-sm); color: var(--k-bad); font-weight: 600; margin: 0; }
.k-input {
    width: 100%;
    min-height: var(--k-touch);
    padding: 0 var(--s-3);
    border: 1.5px solid var(--rule-2);
    border-radius: var(--radius);
    background: var(--card);
    color: var(--ink);
    font: inherit;
}
textarea.k-input { padding: var(--s-3); min-height: 6rem; }
.k-input::placeholder { color: var(--ink-3); }
.k-input:disabled { opacity: 0.7; background: var(--paper); }
.k-input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.k-input[aria-invalid="true"] { border-color: var(--k-bad); }
.k-seg {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    gap: var(--s-1);
    padding: var(--s-1);
    border-radius: var(--radius);
    background: var(--paper-2);
}
.k-seg > button {
    min-height: 2.25rem;
    border: 0;
    border-radius: calc(var(--radius) - var(--s-1));
    background: transparent;
    color: var(--ink-2);
    font: inherit;
    font-size: var(--fs-body-sm);
    font-weight: 600;
    cursor: pointer;
}
.k-seg > button[aria-pressed="true"],
.k-seg > button[aria-checked="true"],
.k-seg > button[aria-selected="true"] { background: var(--card); color: var(--accent-2); box-shadow: var(--shadow); }
.k-chips { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.k-chip {
    display: inline-flex;
    align-items: center;
    min-height: 2.25rem;
    padding: 0 var(--s-4);
    border: 1.5px solid var(--rule-2);
    border-radius: var(--r-pill);
    background: var(--card);
    color: var(--ink-2);
    font: inherit;
    font-size: var(--fs-body-sm);
    font-weight: 600;
    cursor: pointer;
}
.k-chip[aria-pressed="true"],
.k-chip[aria-checked="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.k-chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.k-choice {
    display: flex;
    align-items: flex-start;
    gap: var(--s-3);
    width: 100%;
    padding: var(--s-4);
    border: 1.5px solid var(--rule-2);
    border-radius: var(--radius-lg);
    background: var(--card);
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}
.k-choice::before {
    content: "";
    width: 1.25rem;
    height: 1.25rem;
    margin-top: 0.125rem;
    border: 2px solid var(--rule-2);
    border-radius: 50%;
    flex: none;
    box-sizing: border-box;
}
.k-choice[aria-checked="true"] { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 0.5px var(--accent); }
.k-choice[aria-checked="true"]::before { border: 0.375rem solid var(--accent); }
.k-choice[aria-disabled="true"],
.k-choice:disabled { opacity: 0.6; cursor: default; }
/* a choice built on a real radio or tick box: the control shows, the drawn ring does not */
.k-choice:has(> input)::before { content: none; }
.k-choice:has(> input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.k-choice > input { flex: none; width: 1.25rem; height: 1.25rem; margin: 0.125rem 0 0; accent-color: var(--accent); }
.k-choice:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.k-banner {
    display: flex;
    align-items: center;
    gap: var(--s-3);
    padding: var(--s-3) var(--s-4);
    border-radius: var(--radius);
    background: var(--accent-soft);
    color: var(--accent-2);
    font-size: var(--fs-body-sm);
    font-weight: 600;
}
.k-banner--ok   { background: var(--k-ok-soft); color: var(--k-ok); }
.k-banner--warn { background: var(--k-warn-soft); color: var(--k-warn); }
.k-banner--bad  { background: var(--k-bad-soft); color: var(--k-bad); }

/* Label and value pairs: a person's details, an answer to a question. */
.k-pairs { display: flex; flex-direction: column; gap: var(--s-2); padding-top: var(--s-3); border-top: 1px solid var(--rule); }
.k-pair  { display: flex; align-items: baseline; gap: var(--s-3); }
.k-pair__key   { flex: 0 0 38%; color: var(--ink-3); font-size: var(--fs-body-sm); }
.k-pair__value { min-width: 0; overflow-wrap: anywhere; color: var(--ink); }
a.k-pair__value { color: var(--accent-2); font-weight: 600; text-decoration: underline; }

/* ── states ───────────────────────────────────────────────────────────── */
.k-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--s-3);
    padding: var(--s-8) var(--s-5);
    border: 1.5px dashed var(--rule-2);
    border-radius: var(--radius-lg);
    color: var(--ink-3);
    text-align: center;
}
.k-skel {
    display: block;
    height: 1rem;
    border-radius: var(--radius);
    background: var(--rule);
    animation: k-skel 1.2s ease-in-out infinite alternate;
}
.k-skel--title { height: 1.75rem; width: 60%; }
.k-skel--short { width: 40%; }
.k-skel--card  { height: 7rem; border-radius: var(--radius-lg); }
@keyframes k-skel { from { opacity: 1; } to { opacity: 0.45; } }
@media (prefers-reduced-motion: reduce) { .k-skel { animation: none; } }

/* ── the two screen widths ────────────────────────────────────────────── */
@media (max-width: 899px) { .k-from-900 { display: none !important; } }
@media (min-width: 600px) {
    .k-fields { grid-template-columns: 1fr 1fr; }
    /* auto-fill, not auto-fit: the columns are the same width in every section of a page,
       however many tiles a section has (Leader page, 2026-12-03) */
    .k-tiles { grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); }
}
@media (min-width: 900px) {
    .k-page { padding: var(--s-8) var(--s-6) calc(var(--s-8) + var(--k-nav-clear)); }
    .k-cols { display: grid; grid-template-columns: 1.25fr 1fr; align-items: start; gap: var(--s-5); }
    .k-cols--even { grid-template-columns: 1fr 1fr; }
    .k-cols--fill { align-items: stretch; }
    .k-bars__label { display: block; }
    .k-to-900 { display: none !important; }
}

/* ---- Added 2026-12-02 (approved from the "Kit Additions Mock-up") ---- */

/* Dialog parts: the title, the content and the buttons of every pop-up. They go inside
   c-vision-dialog. Buttons stack on a phone, main action first; from 600px they sit in a row
   with the main action on the right. */
.k-dialog__head { padding: var(--s-5) var(--s-14) var(--s-4) var(--s-5); border-bottom: 1px solid var(--rule); }
/* the old theme forces a pop-up title's size and weight; these out-weigh it */
.k-dialog__title.k-dialog__title { margin: 0; font-family: var(--font-display); font-size: var(--fs-h2) !important; font-weight: 600 !important; color: var(--ink); }
.k-dialog__body { display: flex; flex: 1 1 auto; flex-direction: column; gap: var(--s-4); min-height: 0; padding: var(--s-5); overflow-y: auto; }
/* What is in the body keeps its own height, so a long list makes the body scroll instead of
   being squeezed and cut off (a k-list clips its corners, so it would shrink to fit). */
.k-dialog__body > * { flex-shrink: 0; }
.k-dialog__foot.k-dialog__foot { display: flex; flex-flow: column nowrap; align-items: stretch; justify-content: flex-start; gap: var(--s-2); padding: var(--s-4) var(--s-5); border-top: 1px solid var(--rule); }
@media (min-width: 600px) {
    .k-dialog__foot.k-dialog__foot { flex-direction: row-reverse; }
    .k-dialog__foot > .k-btn { flex: 1 1 0; }
}

/* Number tiles that filter: up to three counts; a tile is a button, pressed = the list below
   is filtered by it. */
.k-figs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-2); }
.k-fig {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--s-1);
    min-height: 5.25rem;
    padding: var(--s-3) var(--s-2);
    border: 1.5px solid var(--rule-2);
    border-radius: var(--radius-lg);
    background: var(--card);
    color: var(--ink-2);
    font: inherit;
    font-size: var(--fs-body-sm);
    text-align: center;
    cursor: pointer;
}
.k-fig > b { font-family: var(--font-display); font-size: var(--fs-h1); font-weight: 600; line-height: var(--lh-tight); color: var(--ink); }
.k-fig--bad > b { color: var(--k-bad); }
.k-fig--warn > b { color: var(--k-warn); }
.k-fig[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.k-fig:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* A segment on a real choice field: a label holding a radio, so the answer travels with the
   form. k-seg--ok and k-seg--bad colour the chosen side for present and absent. */
.k-seg > label {
    display: grid;
    place-items: center;
    min-height: 2.25rem;
    padding: 0 var(--s-3);
    border-radius: calc(var(--radius) - var(--s-1));
    color: var(--ink-2);
    font-size: var(--fs-body-sm);
    font-weight: 600;
    text-align: center;
    cursor: pointer;
}
.k-seg > label > input { position: absolute; opacity: 0; pointer-events: none; }
.k-seg > label:has(input:checked) { background: var(--card); color: var(--accent-2); box-shadow: var(--shadow); }
.k-seg > label:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 1px; }
.k-seg--ok > label:has(input:checked) { background: var(--k-ok-soft); color: var(--k-ok); }
.k-seg--bad > label:has(input:checked) { background: var(--k-bad-soft); color: var(--k-bad); }

/* A short field for a count, at the end of a row. */
.k-input--count { flex: none; width: 4.5rem; font-weight: 700; font-variant-numeric: tabular-nums; text-align: center; }
.k-input--count { -moz-appearance: textfield; appearance: textfield; }
.k-input--count::-webkit-inner-spin-button,
.k-input--count::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

/* Table: from 900px only (put it in k-list k-from-900), with a card list below 900px. */
.k-table { width: 100%; border-collapse: collapse; }
.k-table th,
.k-table td { padding: var(--s-3) var(--s-4); border-top: 1px solid var(--rule); font-size: var(--fs-body-sm); text-align: left; }
.k-table thead th { border-top: 0; background: var(--paper-2); font-weight: 700; color: var(--ink-2); }
.k-table .k-table__num { text-align: right; font-variant-numeric: tabular-nums; }

/* Suggestions under a field: k-suggest goes round the field, k-options holds k-row buttons
   and floats over what follows. */
.k-suggest { position: relative; }
.k-options {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 30;
    margin: var(--s-1) 0 0;
    padding: 0;
    overflow: hidden;
    list-style: none;
    background: var(--card);
    border: 1px solid var(--rule-2);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
}
.k-options .k-row:first-child,
.k-options > li:first-child > .k-row { border-top: 0; }
.k-options .k-row[aria-selected="true"] { background: var(--accent-soft); }

/* ---- The shared frame (approved 2026-12-02 from "Shared Portal Frame") ----
   One header, one navigation and one page spacing for the three portals. A portal supplies its
   logo, its name and its list of tabs; everything else is drawn here. */

/* Icons: one outline set, drawn as a mask so they take the text colour. */
.k-ic { display: inline-block; flex: none; width: 1.375rem; height: 1.375rem; background-color: currentColor; -webkit-mask: center / contain no-repeat; mask: center / contain no-repeat; }
.k-ic--sm { width: 1rem; height: 1rem; }
.k-ic--home { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22black%22 stroke-width=%221.8%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M3 11l9-7 9 7%22/%3E%3Cpath d=%22M5 10v10h14V10%22/%3E%3Cpath d=%22M10 20v-6h4v6%22/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22black%22 stroke-width=%221.8%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M3 11l9-7 9 7%22/%3E%3Cpath d=%22M5 10v10h14V10%22/%3E%3Cpath d=%22M10 20v-6h4v6%22/%3E%3C/svg%3E"); }
.k-ic--net { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22black%22 stroke-width=%221.8%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Ccircle cx=%2212%22 cy=%225%22 r=%222.2%22/%3E%3Ccircle cx=%225%22 cy=%2219%22 r=%222.2%22/%3E%3Ccircle cx=%2219%22 cy=%2219%22 r=%222.2%22/%3E%3Cpath d=%22M12 7.2V12M5 16.8V12h14v4.8%22/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22black%22 stroke-width=%221.8%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Ccircle cx=%2212%22 cy=%225%22 r=%222.2%22/%3E%3Ccircle cx=%225%22 cy=%2219%22 r=%222.2%22/%3E%3Ccircle cx=%2219%22 cy=%2219%22 r=%222.2%22/%3E%3Cpath d=%22M12 7.2V12M5 16.8V12h14v4.8%22/%3E%3C/svg%3E"); }
.k-ic--star { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22black%22 stroke-width=%221.8%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M12 3.5l2.6 5.4 5.9.8-4.3 4.1 1 5.9L12 16.9 6.8 19.7l1-5.9L3.5 9.7l5.9-.8z%22/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22black%22 stroke-width=%221.8%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M12 3.5l2.6 5.4 5.9.8-4.3 4.1 1 5.9L12 16.9 6.8 19.7l1-5.9L3.5 9.7l5.9-.8z%22/%3E%3C/svg%3E"); }
.k-ic--people { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22black%22 stroke-width=%221.8%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Ccircle cx=%229%22 cy=%228%22 r=%223%22/%3E%3Cpath d=%22M3 20c0-3.3 2.7-6 6-6s6 2.7 6 6%22/%3E%3Ccircle cx=%2217%22 cy=%229%22 r=%222.3%22/%3E%3Cpath d=%22M16 14.2c2.8.2 5 2.6 5 5.8%22/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22black%22 stroke-width=%221.8%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Ccircle cx=%229%22 cy=%228%22 r=%223%22/%3E%3Cpath d=%22M3 20c0-3.3 2.7-6 6-6s6 2.7 6 6%22/%3E%3Ccircle cx=%2217%22 cy=%229%22 r=%222.3%22/%3E%3Cpath d=%22M16 14.2c2.8.2 5 2.6 5 5.8%22/%3E%3C/svg%3E"); }
.k-ic--calendar { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22black%22 stroke-width=%221.8%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Crect x=%224%22 y=%225%22 width=%2216%22 height=%2215%22 rx=%222.5%22/%3E%3Cpath d=%22M4 10h16M8 3v4M16 3v4%22/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22black%22 stroke-width=%221.8%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Crect x=%224%22 y=%225%22 width=%2216%22 height=%2215%22 rx=%222.5%22/%3E%3Cpath d=%22M4 10h16M8 3v4M16 3v4%22/%3E%3C/svg%3E"); }
.k-ic--clock { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22black%22 stroke-width=%221.8%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Ccircle cx=%2212%22 cy=%2212%22 r=%228.5%22/%3E%3Cpath d=%22M12 7v5l3.2 2%22/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22black%22 stroke-width=%221.8%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Ccircle cx=%2212%22 cy=%2212%22 r=%228.5%22/%3E%3Cpath d=%22M12 7v5l3.2 2%22/%3E%3C/svg%3E"); }
.k-ic--leave { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22black%22 stroke-width=%221.8%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M14 4h5a1 1 0 011 1v14a1 1 0 01-1 1h-5%22/%3E%3Cpath d=%22M10 8l-4 4 4 4M6 12h10%22/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22black%22 stroke-width=%221.8%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M14 4h5a1 1 0 011 1v14a1 1 0 01-1 1h-5%22/%3E%3Cpath d=%22M10 8l-4 4 4 4M6 12h10%22/%3E%3C/svg%3E"); }
.k-ic--pen { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22black%22 stroke-width=%221.8%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M4 20h4L19 9l-4-4L4 16z%22/%3E%3Cpath d=%22M13.5 6.5l4 4%22/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22black%22 stroke-width=%221.8%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M4 20h4L19 9l-4-4L4 16z%22/%3E%3Cpath d=%22M13.5 6.5l4 4%22/%3E%3C/svg%3E"); }
.k-ic--steps { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22black%22 stroke-width=%221.8%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M4 6l1.5 1.5L8 5M4 12l1.5 1.5L8 11M4 18l1.5 1.5L8 17M11 6h9M11 12h9M11 18h9%22/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22black%22 stroke-width=%221.8%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M4 6l1.5 1.5L8 5M4 12l1.5 1.5L8 11M4 18l1.5 1.5L8 17M11 6h9M11 12h9M11 18h9%22/%3E%3C/svg%3E"); }
.k-ic--heart { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22black%22 stroke-width=%221.8%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M12 20s-7-4.4-7-10a4 4 0 017-2.6A4 4 0 0119 10c0 5.6-7 10-7 10z%22/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22black%22 stroke-width=%221.8%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M12 20s-7-4.4-7-10a4 4 0 017-2.6A4 4 0 0119 10c0 5.6-7 10-7 10z%22/%3E%3C/svg%3E"); }
.k-ic--user { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22black%22 stroke-width=%221.8%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Ccircle cx=%2212%22 cy=%228.5%22 r=%223.5%22/%3E%3Cpath d=%22M5 20c0-3.9 3.1-7 7-7s7 3.1 7 7%22/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22black%22 stroke-width=%221.8%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Ccircle cx=%2212%22 cy=%228.5%22 r=%223.5%22/%3E%3Cpath d=%22M5 20c0-3.9 3.1-7 7-7s7 3.1 7 7%22/%3E%3C/svg%3E"); }
.k-ic--plus { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22black%22 stroke-width=%221.8%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M12 5v14M5 12h14%22/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22black%22 stroke-width=%221.8%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M12 5v14M5 12h14%22/%3E%3C/svg%3E"); }
.k-ic--book { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22black%22 stroke-width=%221.8%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M4 5.5A2.5 2.5 0 016.5 3H20v15H6.5A2.5 2.5 0 004 20.5z%22/%3E%3Cpath d=%22M4 20.5A2.5 2.5 0 006.5 23H20%22/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22black%22 stroke-width=%221.8%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M4 5.5A2.5 2.5 0 016.5 3H20v15H6.5A2.5 2.5 0 004 20.5z%22/%3E%3Cpath d=%22M4 20.5A2.5 2.5 0 006.5 23H20%22/%3E%3C/svg%3E"); }
.k-ic--back { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22black%22 stroke-width=%221.8%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M15 5l-7 7 7 7%22/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22black%22 stroke-width=%221.8%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M15 5l-7 7 7 7%22/%3E%3C/svg%3E"); }
.k-ic--give { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22black%22 stroke-width=%221.8%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Crect x=%224.5%22 y=%2210.5%22 width=%2215%22 height=%229.5%22 rx=%221.5%22/%3E%3Cpath d=%22M3.5 7.5h17v3h-17zM12 7.5V20M12 7.5c-1.6-4-6.2-3.2-4.8 0M12 7.5c1.6-4 6.2-3.2 4.8 0%22/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22black%22 stroke-width=%221.8%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Crect x=%224.5%22 y=%2210.5%22 width=%2215%22 height=%229.5%22 rx=%221.5%22/%3E%3Cpath d=%22M3.5 7.5h17v3h-17zM12 7.5V20M12 7.5c-1.6-4-6.2-3.2-4.8 0M12 7.5c1.6-4 6.2-3.2 4.8 0%22/%3E%3C/svg%3E"); }
.k-ic--pray { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22black%22 stroke-width=%221.8%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M12 4.5v9.5M12 4.5c-1.1 0-1.8.8-1.8 1.8v4.3L6.6 14a2 2 0 00-.6 1.4V20h4.5l1.5-2.2M12 4.5c1.1 0 1.8.8 1.8 1.8v4.3l3.6 3.4a2 2 0 01.6 1.4V20h-4.5L12 17.8%22/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22black%22 stroke-width=%221.8%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M12 4.5v9.5M12 4.5c-1.1 0-1.8.8-1.8 1.8v4.3L6.6 14a2 2 0 00-.6 1.4V20h4.5l1.5-2.2M12 4.5c1.1 0 1.8.8 1.8 1.8v4.3l3.6 3.4a2 2 0 01.6 1.4V20h-4.5L12 17.8%22/%3E%3C/svg%3E"); }
.k-ic--chat { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22black%22 stroke-width=%221.8%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M5 5h14a1.5 1.5 0 011.5 1.5v8A1.5 1.5 0 0119 16h-6l-4.5 3.5V16H5a1.5 1.5 0 01-1.5-1.5v-8A1.5 1.5 0 015 5z%22/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22black%22 stroke-width=%221.8%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M5 5h14a1.5 1.5 0 011.5 1.5v8A1.5 1.5 0 0119 16h-6l-4.5 3.5V16H5a1.5 1.5 0 01-1.5-1.5v-8A1.5 1.5 0 015 5z%22/%3E%3C/svg%3E"); }

/* Header: solid, 3.5rem, stays at the top. Brand on the left, the profile button on the right;
   from 900px the tabs sit in it. */
.k-top {
    position: sticky;
    top: 0;
    z-index: 40;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    gap: var(--s-4);
    height: calc(3.5rem + env(safe-area-inset-top, 0px));
    padding: env(safe-area-inset-top, 0px) var(--s-4) 0;
    background: var(--card);
    border-bottom: 1px solid var(--rule);
    color: var(--ink);
    font-family: var(--font-ui);
}
.k-top__brand { display: flex; align-items: center; gap: var(--s-2); min-width: 0; border: 0; background: transparent; padding: 0; color: var(--accent-2); font: inherit; text-decoration: none; cursor: pointer; }
.k-top__mark { flex: none; width: 2rem; height: 2rem; border-radius: 50%; object-fit: contain; }
/* the portal's name takes the brand colour unless the brand file sets --k-top-name */
.k-top__name { color: var(--k-top-name, var(--accent-2)); font-family: var(--font-display); font-size: var(--fs-h2); font-weight: 600; line-height: var(--lh-tight); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.k-top__tabs { display: none; align-items: center; gap: var(--s-1); margin-left: var(--s-4); }
.k-top__tab { display: inline-flex; align-items: center; min-height: 2.25rem; padding: 0 var(--s-3); border: 0; border-radius: var(--r-pill); background: transparent; color: var(--ink-2); font: inherit; font-size: var(--fs-body-sm); font-weight: 600; text-decoration: none; cursor: pointer; }
.k-top__tab:hover { color: var(--accent-2); }
.k-top__tab[aria-current="page"] { background: var(--accent-soft); color: var(--accent-2); }
.k-top__end { display: flex; align-items: center; gap: var(--s-2); margin-left: auto; }
.k-top__me { display: grid; place-items: center; width: var(--k-touch); height: var(--k-touch); border: 0; border-radius: 50%; background: transparent; color: var(--ink-2); cursor: pointer; }
.k-top__me:hover { background: var(--paper-2); }
.k-top :focus-visible, .k-nav :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Navigation: a bar at the bottom of a phone, 3.875rem, four or five tabs. The current tab
   (aria-current="page") takes the brand colour and a soft pill behind its icon. */
.k-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    box-sizing: border-box;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    height: calc(3.875rem + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: var(--card);
    border-top: 1px solid var(--rule);
    font-family: var(--font-ui);
}
.k-nav__tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.125rem; min-width: 0; border: 0; background: transparent; padding: 0; color: var(--ink-3); font: inherit; font-size: var(--fs-micro); font-weight: 600; line-height: var(--lh-tight); text-decoration: none; cursor: pointer; }
.k-nav__ic { display: grid; place-items: center; width: 3.25rem; height: 1.75rem; border-radius: var(--r-pill); }
.k-nav__tab[aria-current="page"] { color: var(--accent-2); }
.k-nav__tab[aria-current="page"] .k-nav__ic { background: var(--accent-soft); }
/* the one round action a portal may float above the bar (Vision: Quick Capture) */
.k-nav__add { position: fixed; right: var(--s-4); bottom: calc(3.875rem + var(--s-4) + env(safe-area-inset-bottom, 0px)); z-index: 41; display: grid; place-items: center; width: 3.5rem; height: 3.5rem; border: 0; border-radius: 50%; background: var(--accent); color: var(--accent-ink); box-shadow: var(--shadow-lg); cursor: pointer; }
.k-nav__add:active { transform: scale(0.96); }
@media (max-width: 899px) {
    /* the page keeps clear of the bar on every portal */
    :where(:root) { --k-nav-clear: 3.875rem; }
}
@media (min-width: 900px) {
    .k-nav, .k-nav__add { display: none; }
    /* the header's content lines up with the page below it, however wide the window */
    .k-top { padding-left: max(var(--s-6), calc((100% - var(--k-page-max)) / 2 + var(--s-6))); padding-right: max(var(--s-6), calc((100% - var(--k-page-max)) / 2 + var(--s-6))); }
    .k-top__tabs { display: flex; }
}
@media (prefers-reduced-motion: reduce) { .k-nav__add:active { transform: none; } }

.k-top__me[aria-expanded="true"] { background: var(--paper-2); }
/* a portal whose brand is an image wordmark uses it in place of the mark and the name */
.k-top__logo { display: block; width: auto; max-width: 100%; height: var(--s-8); object-fit: contain; }
/* tabs that are links keep the tab colours in every link state */
a.k-top__tab, a.k-top__tab:visited, a.k-top__tab:focus, a.k-top__tab:active { color: var(--ink-2); text-decoration: none; }
a.k-top__tab:hover { color: var(--accent-2); text-decoration: none; }
a.k-nav__tab, a.k-nav__tab:visited, a.k-nav__tab:hover, a.k-nav__tab:focus, a.k-nav__tab:active { color: var(--ink-3); text-decoration: none; }
/* the current tab: "page" on the tab's own page, "location" on a page under it */
.k-top__tab[aria-current="location"], a.k-top__tab[aria-current="page"], a.k-top__tab[aria-current="location"] { background: var(--accent-soft); color: var(--accent-2); }
.k-nav__tab[aria-current="location"], a.k-nav__tab[aria-current="page"], a.k-nav__tab[aria-current="location"] { color: var(--accent-2); }
.k-nav__tab[aria-current="location"] .k-nav__ic { background: var(--accent-soft); }
.k-top__add { margin-left: var(--s-2); }

/* ---- Touch response (approved 2026-12-03, "Portal Feel and Fonts") ----
   Whatever a finger lands on reacts within one frame. The phone's own tap flash is off across
   the kit, so each tappable part carries its own pressed look. A tab also takes it from
   .is-down, which its bar sets on touch so the tab lights up before the page changes. */
.k-nav__tab:active, .k-nav__tab.is-down { color: var(--accent-2); }
.k-nav__tab:active .k-nav__ic, .k-nav__tab.is-down .k-nav__ic { background: var(--accent-soft); }
a.k-nav__tab:active, a.k-nav__tab.is-down { color: var(--accent-2); }
.k-top__tab:active, .k-top__tab.is-down, a.k-top__tab:active, a.k-top__tab.is-down { background: var(--accent-soft); color: var(--accent-2); }
button.k-row:active, a.k-row:active, .k-row.is-down { background: var(--accent-soft); }
.k-tile:active, .k-tile.is-down { background: var(--accent-soft); }
.k-card--link.is-down { border-color: var(--accent); box-shadow: none; transform: scale(0.985); }
.k-card--hero.k-card--link:active, .k-card--hero.k-card--link.is-down { filter: brightness(0.94); }
.k-btn:active:not(:disabled) { transform: scale(0.97); }
.k-chip:active, .k-fig:active, .k-choice:active, .k-day:active:not(:disabled) { background: var(--accent-soft); }
.k-top__me:active { background: var(--paper-2); }
@media (prefers-reduced-motion: reduce) { .k-btn:active:not(:disabled), .k-card--link.is-down { transform: none; } }

/* The stand-in for a page that is on its way: its title and placeholders, shown the moment a
   link is tapped and lifted when the page itself has drawn. It fades in over the old page, so
   the screen is never empty between two pages. */
.k-cover {
    position: fixed;
    inset: calc(3.5rem + env(safe-area-inset-top, 0px)) 0 0 0;
    z-index: 30;
    overflow: hidden;
    background: var(--paper);
    animation: k-arrive var(--motion-duration-feedback, 120ms) ease-out both;
}
.k-cover > .k-page { padding-top: var(--s-5); }
@media (prefers-reduced-motion: reduce) { .k-cover { animation: none; } }

/* ── Dark mode (approved 2026-12-03, docs/KIT.md) ───────────────────────────
   Every kit part takes its colours from values, so dark mode is a second set of
   values and restyles no part. Dark applies only when the page carries
   data-theme="dark", which KitAppearance sets from the member's choice in Settings:
   Dark, or Match my device on a dark device. With no choice the page is light
   (Giovani, 2026-12-03). Each brand file sets its own brand shades the same way. */
:root[data-theme="dark"] {
    color-scheme: dark;
    /* the page itself: its ground where a long page scrolls on, and the text that takes the
       page's own colour */
    background-color: #1b1814;
    color: #f3ecdf;
    /* warm charcoal surfaces and warm off-white ink: the cream portals, at night */
    --paper: #1b1814; --paper-2: #14120f; --card: #26221c; --card-2: #302a22;
    --rule: #3a342b; --rule-2: #4d4539; --ring-track: #3a342b;
    --ink: #f3ecdf; --ink-2: #d8cebc; --ink-3: #a99d89; --ink-4: #7d7262;
    --shadow: 0 1px 0 rgba(0,0,0,0.35), 0 8px 18px -8px rgba(0,0,0,0.7);
    --shadow-lg: 0 2px 0 rgba(0,0,0,0.35), 0 30px 50px -20px rgba(0,0,0,0.8);
    --k-ok: #84d6a0; --k-ok-soft: #18331f;
    --k-warn: #f1c46c; --k-warn-soft: #3c2e10;
    --k-bad: #ff9f96; --k-bad-soft: #45201c;
    --dxp-g-root-contrast: #f3ecdf;
    /* the dim behind a sheet or dialog is dark, not the (now light) ink */
    --k-veil-ink: #000000;
    /* a dark stand-in panel (the class video before Start) stays dark, with light words */
    --k-poster: #0f0d0b; --k-poster-ink: #f3ecdf;
    --vision-dialog-backdrop: color-mix(in srgb, #000000 55%, transparent);
    /* the older screens' status and link values, on dark */
    --lw-green: #84d6a0; --lw-green-soft: #18331f;
    --lw-amber: #f1c46c; --lw-amber-soft: #3c2e10;
    --lw-red: #ff9f96; --lw-red-soft: #45201c;
    --color-success-text: #84d6a0; --color-success-background: #18331f; --color-success-border: #2f5a3b;
    --color-warning-text: #f1c46c; --color-warning-border: #6b5420; --warn-soft: #3c2e10;
    --color-error-text: #ff9f96; --color-error-background: #45201c; --color-error-border: #7a3a34;
    --color-purple-text: #d9b8ff; --color-purple-background: #2c2140;
    --color-link: #8fc8f1; --color-link-hover: #b5dbf6;
}
/* the page ground: the same dot texture, on charcoal */
:root[data-theme="dark"] body::before {
    background-color: #1b1814;
    background-image:
        radial-gradient(rgba(255, 240, 210, 0.035) 1px, transparent 1.6px),
        radial-gradient(rgba(255, 240, 210, 0.02) 1px, transparent 1.6px);
}
/* the brand card keeps its light inner parts (button, progress, pill) */
:root[data-theme="dark"] .k-card--hero { --card: #fffdf7; --accent-2: var(--k-hero-ink, #0a588f); }
/* a tappable card's arrow takes the lighter brand shade, which reads on dark */
:root[data-theme="dark"] .k-card--link:not(.k-card--hero)::after { border-color: var(--accent-2); }
/* the page under the fixed ground, where a long page scrolls past it */
:root[data-theme="dark"] body { background-color: #1b1814; }
:root[data-theme="dark"] .slds-form-element__label { color: var(--ink-2); }
/* a pressed or hovered brand button stays the brand colour (the lighter shade is for text) */
:root[data-theme="dark"] .k-btn--primary:hover, :root[data-theme="dark"] .btn--primary:hover, :root[data-theme="dark"] .lw-mini:hover,
:root[data-theme="dark"] .topnav__cta:hover, :root[data-theme="dark"] .mission-card--hero:hover { background: var(--accent); border-color: var(--accent); filter: brightness(1.12); }
/* the platform's own form fields, where a screen still uses them */
:root[data-theme="dark"] .slds-input, :root[data-theme="dark"] .slds-textarea, :root[data-theme="dark"] .slds-select, :root[data-theme="dark"] .slds-combobox__input,
:root[data-theme="dark"] .slds-listbox, :root[data-theme="dark"] .slds-dropdown, :root[data-theme="dark"] .slds-datepicker {
    background-color: var(--card-2); color: var(--ink); border-color: var(--rule-2);
}
:root[data-theme="dark"] .slds-input::placeholder, :root[data-theme="dark"] .slds-textarea::placeholder { color: var(--ink-3); }
:root[data-theme="dark"] .slds-listbox__option, :root[data-theme="dark"] .slds-form-element__help { color: var(--ink-2); }
:root[data-theme="dark"] .skip-to-main { color: var(--accent-2); }
/* the Bible School wordmark is drawn in deep green: lifted so it reads on dark */
:root[data-theme="dark"] .vmc-logo, :root[data-theme="dark"] .brand__logo { filter: brightness(2.1) saturate(0.75); }
/* the King Jesus mark is a blue disc with a see-through dove: the dove stays white */
/* white only behind the inside of the disc, so no white shows around its edge */
:root[data-theme="dark"] .k-top__mark { background: radial-gradient(circle closest-side, #ffffff 72%, transparent 74%); }
