/* ============================================================
   Design system. Light, quiet, content first.
   Paper-white ground, layered by elevation and hairlines.
   Goldenrod appears only on what is active or focused.
   Electric blue carries information. Green means approved.
   ============================================================ */

@layer tokens, base, layout, components, utilities;

@layer tokens {
  :root {
    /* ground: warm paper, layered by elevation */
    --g-0: #ffffff;
    --g-1: #fbfbfc;
    --g-2: #f5f6f8;
    --g-3: #eef0f3;
    --g-4: #e4e7ec;

    /* ink */
    --ink-1: #14171c;
    --ink-2: #4a515c;
    --ink-3: #656c77;   /* 5.30:1 on white, 4.64:1 on the darkest grey; was #727a87 at 4.33:1 */
    --ink-4: #9aa2af;

    /* accents, used sparingly. Darkened from the dark theme so each
       one clears 4.5:1 on white. */
    --gold: #92670a;
    --gold-strong: #7c5708;
    --gold-soft: #6d4d07;
    --gold-dim: rgba(218, 165, 32, 0.14);
    --gold-line: rgba(146, 103, 10, 0.34);
    --gold-fill: #daa520;

    --blue: #0a62d0;
    --blue-dim: rgba(10, 98, 208, 0.07);
    --blue-line: rgba(10, 98, 208, 0.24);

    --green: #0f7a43;
    --green-dim: rgba(15, 122, 67, 0.08);
    --green-line: rgba(15, 122, 67, 0.26);

    --red: #c0291f;
    --red-dim: rgba(192, 41, 31, 0.06);
    --red-line: rgba(192, 41, 31, 0.24);

    --hair: rgba(16, 20, 28, 0.09);
    --hair-2: rgba(16, 20, 28, 0.16);

    /* type */
    --display: "Inter Tight", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

    /* rhythm */
    --r-sm: 8px;
    --r-md: 12px;
    --r-lg: 18px;
    --r-xl: 26px;

    --pad: clamp(18px, 4vw, 34px);
    --gut: clamp(16px, 3vw, 28px);
    --max: 1180px;

    /* motion */
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
    --quick: 160ms var(--ease);
    --calm: 320ms var(--ease);

    /* light-theme shadows: tighter and far softer than on dark */
    --shadow-1: 0 1px 2px rgba(16, 20, 28, 0.05);
    --shadow-2: 0 1px 2px rgba(16, 20, 28, 0.04), 0 8px 24px -12px rgba(16, 20, 28, 0.1);
    --shadow-3: 0 2px 4px rgba(16, 20, 28, 0.04), 0 20px 48px -20px rgba(16, 20, 28, 0.16);
  }
}

@layer base {
  *, *::before, *::after { box-sizing: border-box; }

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

  body {
    margin: 0;
    background: var(--g-1);
    color: var(--ink-1);
    font: 400 15.5px/1.6 var(--body);
    font-feature-settings: "cv11", "ss01";
    letter-spacing: -0.006em;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;

    /* The footer sits at the end of the viewport on a short page and at the
       end of the content on a long one. <main> takes the slack, so the footer
       never floats mid-screen with blank space under it. dvh, not vh, or
       mobile browser chrome pushes the footer below the fold. */
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
  }
  body > main { flex: 1 0 auto; }
  body > .sitefoot { flex: 0 0 auto; }

  /* One wide, very soft wash from the top.
     Absolute, not fixed: fixed pinned it to the viewport, so the warm corner
     of it stayed on screen the whole way down the landing page and laid a
     gold cast beside "Who can apply" and "What you can apply for" however far
     you scrolled. Anchored to the top of the document instead, it belongs to
     the hero and has ended well before those containers. */
  body::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 62vh;
    background:
      radial-gradient(70% 100% at 50% 0%, rgba(10, 98, 208, 0.045), transparent 70%),
      radial-gradient(42% 78% at 80% 2%, rgba(218, 165, 32, 0.09), transparent 72%);
    pointer-events: none;
    z-index: 0;
  }

  h1, h2, h3, h4 {
    font-family: var(--display);
    font-weight: 500;
    letter-spacing: -0.028em;
    line-height: 1.12;
    margin: 0;
    text-wrap: balance;
    color: var(--ink-1);
  }
  h1 { font-size: clamp(27px, 4.4vw, 44px); font-weight: 300; }
  h2 { font-size: clamp(20px, 2.6vw, 27px); }
  h3 { font-size: 16.5px; letter-spacing: -0.018em; }

  p { margin: 0 0 1em; max-width: 68ch; text-wrap: pretty; }
  p:last-child { margin-bottom: 0; }

  a { color: var(--blue); text-decoration: none; transition: color var(--quick); }
  a:hover { color: #084da4; text-decoration: underline; }

  :focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 2px;
    border-radius: 4px;
  }

  ::selection { background: rgba(218, 165, 32, 0.28); color: var(--ink-1); }

  /* money and counts: tabular, so figures never jitter */
  .tnum, .money-fig, td.num { font-variant-numeric: tabular-nums; }

  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
      animation-duration: 0.01ms !important;
      animation-iteration-count: 1 !important;
      transition-duration: 0.01ms !important;
      scroll-behavior: auto !important;
    }
  }
}

@layer layout {
  .wrap {
    width: 100%;
    max-width: var(--max);
    margin-inline: auto;
    padding-inline: var(--gut);
    position: relative;
    z-index: 1;
  }
  .wrap-narrow { max-width: 560px; }
  .wrap-mid { max-width: 840px; }

  .stack > * + * { margin-top: var(--flow, 18px); }
  .stack-sm { --flow: 10px; }
  .stack-lg { --flow: 30px; }

  .row { display: flex; gap: 12px; align-items: center; }
  .row-between { display: flex; gap: 16px; align-items: center; justify-content: space-between; }
  .row-wrap { flex-wrap: wrap; }
  .spacer { flex: 1; }

  .grid-2 { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
  .grid-3 { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }

  section.band { padding-block: clamp(34px, 6vw, 72px); position: relative; z-index: 1; }
  section.band + section.band { padding-top: 0; }
}

@layer components {
  /* ---------- top bar ---------- */
  .topbar {
    position: sticky;
    top: 0;
    z-index: 60;
    background: color-mix(in oklab, var(--g-0) 80%, transparent);
    backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid var(--hair);
  }
  .topbar .inner {
    display: flex;
    align-items: center;
    gap: 18px;
    height: 58px;
  }
  .mark {
    color: var(--ink-1);
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    line-height: 0;
  }
  .mark:hover { text-decoration: none; color: var(--ink-1); }
  .mark .brandlogo {
    display: block;
    width: 176px;
    height: 58px;
    object-fit: contain;
    object-position: left center;
    transform: scale(1.08);
    transform-origin: left center;
  }
  .navlinks { display: flex; gap: 4px; align-items: center; }
  .navlinks a {
    color: var(--ink-2);
    font-size: 13.5px;
    padding: 7px 11px;
    border-radius: var(--r-sm);
    transition: background var(--quick), color var(--quick);
  }
  .navlinks a:hover { background: var(--g-2); color: var(--ink-1); text-decoration: none; }
  .navlinks a[aria-current] { color: var(--gold-soft); background: var(--gold-dim); }

  /* ---------- surfaces ---------- */
  .card {
    background: var(--g-0);
    border: 1px solid var(--hair);
    border-radius: var(--r-lg);
    padding: var(--pad);
    box-shadow: var(--shadow-2);
  }
  .card-flat { background: var(--g-1); box-shadow: none; }
  .card-tight { padding: 18px; }

  .hair { height: 1px; background: var(--hair); border: 0; margin-block: 22px; }

  .eyebrow {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink-3);
  }
  .eyebrow.gold { color: var(--gold); }
  .soft { color: var(--ink-2); }
  .dim { color: var(--ink-3); }
  .small { font-size: 13px; }
  .tiny { font-size: 12px; }

  /* ---------- buttons ---------- */
  .btn {
    --bg: var(--g-0);
    --bd: var(--hair-2);
    --fg: var(--ink-1);
    appearance: none;
    font: 500 14px/1 var(--body);
    letter-spacing: -0.01em;
    color: var(--fg);
    background: var(--bg);
    border: 1px solid var(--bd);
    border-radius: 10px;
    padding: 11px 17px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: var(--shadow-1);
    transition: background var(--quick), border-color var(--quick), transform var(--quick), box-shadow var(--quick);
  }
  .btn:hover { background: var(--g-2); border-color: var(--hair-2); text-decoration: none; }
  .btn:active { transform: translateY(1px); box-shadow: none; }
  .btn:disabled, .btn[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; transform: none; }

  /* the one gold fill in the system: the primary action */
  .btn-primary {
    --bg: linear-gradient(180deg, #e0b23c, var(--gold-fill));
    --bd: #b3861a;
    --fg: #241a02;
    font-weight: 600;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.4) inset, 0 2px 8px -2px rgba(146, 103, 10, 0.4);
  }
  .btn-primary:hover {
    --bg: linear-gradient(180deg, #e8be5a, #d2a01f);
    border-color: #9c7415;
  }
  .btn-ghost { --bg: transparent; --bd: var(--hair-2); --fg: var(--ink-2); box-shadow: none; }
  .btn-ghost:hover { --fg: var(--ink-1); background: var(--g-2); }
  .btn-ok { --bg: var(--green-dim); --bd: var(--green-line); --fg: var(--green); }
  .btn-ok:hover { background: rgba(15, 122, 67, 0.14); }
  .btn-bad { --bg: var(--red-dim); --bd: var(--red-line); --fg: var(--red); }
  .btn-bad:hover { background: rgba(192, 41, 31, 0.12); }
  .btn-sm { padding: 8px 13px; font-size: 13px; }
  .btn-block { width: 100%; justify-content: center; }

  /* ---------- pills ---------- */
  .pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: 0.02em;
    padding: 4px 10px;
    border-radius: 100px;
    border: 1px solid var(--hair-2);
    background: var(--g-2);
    color: var(--ink-2);
    white-space: nowrap;
  }
  .pill::before {
    content: "";
    width: 5px; height: 5px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.9;
  }
  .pill-open { color: var(--gold-soft); border-color: var(--gold-line); background: var(--gold-dim); }
  .pill-review { color: var(--blue); border-color: var(--blue-line); background: var(--blue-dim); }
  .pill-approved { color: var(--green); border-color: var(--green-line); background: var(--green-dim); }
  .pill-changes, .pill-redo { color: var(--red); border-color: var(--red-line); background: var(--red-dim); }
  .pill-declined { color: var(--red); border-color: var(--red-line); background: var(--red-dim); }
  .pill-locked { color: var(--ink-4); }
  .pill-plain::before { display: none; }

  /* ---------- notices ---------- */
  .notice {
    border: 1px solid var(--blue-line);
    background: var(--blue-dim);
    border-radius: var(--r-md);
    padding: 14px 16px;
    font-size: 14px;
    color: var(--ink-1);
  }
  .notice-warn { border-color: var(--gold-line); background: var(--gold-dim); }
  .notice-bad { border-color: var(--red-line); background: var(--red-dim); }
  .notice-ok { border-color: var(--green-line); background: var(--green-dim); }
  .notice p { max-width: none; }

  /* ---------- forms ---------- */
  .field { display: grid; gap: 7px; }
  .field.wide { grid-column: 1 / -1; }
  label { font-size: 13.5px; font-weight: 500; color: var(--ink-2); }
  label .req { color: var(--gold); margin-left: 2px; }
  .hint { font-size: 12.5px; color: var(--ink-3); }

  input[type="text"], input[type="email"], input[type="password"], input[type="tel"],
  input[type="url"], input[type="date"], input[type="number"], input[type="search"],
  select, textarea {
    appearance: none;
    width: 100%;
    font: 400 14.5px/1.5 var(--body);
    color: var(--ink-1);
    background: var(--g-0);
    border: 1px solid var(--hair-2);
    border-radius: 10px;
    padding: 11px 13px;
    box-shadow: 0 1px 2px rgba(16, 20, 28, 0.03) inset;
    transition: border-color var(--quick), background var(--quick), box-shadow var(--quick);
  }
  textarea { min-height: 96px; resize: vertical; line-height: 1.6; }
  input:hover, select:hover, textarea:hover { border-color: rgba(16, 20, 28, 0.26); }
  input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--gold);
    background: var(--g-0);
    box-shadow: 0 0 0 3px var(--gold-dim);
  }
  input::placeholder, textarea::placeholder { color: var(--ink-4); }
  select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' stroke='%23727a87' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 13px center;
    padding-right: 34px;
  }
  input[type="file"] {
    font-size: 13px;
    color: var(--ink-3);
    padding: 9px;
    background: var(--g-1);
    border: 1px dashed var(--hair-2);
    border-radius: 10px;
    width: 100%;
    box-shadow: none;
  }
  input[type="file"]::file-selector-button {
    font: 500 13px var(--body);
    color: var(--ink-1);
    background: var(--g-0);
    border: 1px solid var(--hair-2);
    border-radius: 7px;
    padding: 7px 12px;
    margin-right: 11px;
    cursor: pointer;
  }
  input[type="file"]::file-selector-button:hover { background: var(--g-2); }

  fieldset {
    border: 0;
    border-top: 1px solid var(--hair);
    margin: 0;
    padding: 26px 0 0;
  }
  fieldset:first-of-type { border-top: 0; padding-top: 0; }
  legend {
    font-family: var(--display);
    font-size: 17px;
    font-weight: 500;
    letter-spacing: -0.02em;
    padding: 0 0 2px;
    color: var(--ink-1);
  }

  .check {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 11px;
    align-items: start;
    padding: 13px 15px;
    background: var(--g-1);
    border: 1px solid var(--hair);
    border-radius: var(--r-md);
  }
  .check input[type="checkbox"] {
    appearance: none;
    width: 19px; height: 19px;
    margin: 1px 0 0;
    border: 1px solid var(--hair-2);
    border-radius: 5px;
    background: var(--g-0);
    cursor: pointer;
    position: relative;
    flex: none;
    transition: background var(--quick), border-color var(--quick);
  }
  .check input[type="checkbox"]:checked {
    background: var(--gold-fill);
    border-color: #b3861a;
  }
  .check input[type="checkbox"]:checked::after {
    content: "";
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='19' height='19' viewBox='0 0 19 19'%3E%3Cpath d='M4.5 9.8 7.8 13l6.7-7' stroke='%23241a02' stroke-width='2.2' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/contain no-repeat;
  }
  .check label { color: var(--ink-1); font-weight: 400; cursor: pointer; }

  /* flagged by a reviewer */
  .flagged {
    position: relative;
    padding-left: 15px;
  }
  .flagged::before {
    content: "";
    position: absolute;
    left: 0; top: 2px; bottom: 2px;
    width: 2px;
    border-radius: 2px;
    background: var(--gold-fill);
  }
  .flagnote {
    font-size: 12.5px;
    color: var(--gold-soft);
  }

  /* ---------- the amount ---------- */
  .amount-hero {
    display: flex;
    align-items: baseline;
    gap: 4px;
    font-family: var(--display);
    font-weight: 300;
    letter-spacing: -0.045em;
    line-height: 0.95;
  }
  .amount-hero .cur {
    font-size: clamp(26px, 3.6vw, 40px);
    color: var(--gold);
    transform: translateY(-0.12em);
  }
  .amount-hero .fig {
    font-size: clamp(46px, 9vw, 92px);
    font-variant-numeric: tabular-nums;
    color: var(--ink-1);
  }
  .amount-hero.won .cur { color: var(--green); }
  .amount-hero.won .fig { color: var(--green); }

  /* slim sticky bar once the hero scrolls away */
  .amount-bar {
    position: fixed;
    /* The top bar wraps on a phone, so its height is not a constant. The real
       height is measured at runtime into --topbar-h; 58px is only the fallback
       for the single-line desktop bar before the script runs. */
    top: var(--topbar-h, 58px);
    left: 0; right: 0;
    z-index: 55;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px var(--gut);
    background: color-mix(in oklab, var(--g-0) 92%, transparent);
    backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid var(--gold-line);
    box-shadow: var(--shadow-1);
    font-family: var(--display);
    transform: translateY(-110%);
    transition: transform var(--calm);
  }
  .amount-bar.show { transform: none; }
  .amount-bar .cur { color: var(--gold); font-size: 15px; }
  .amount-bar .fig { font-size: 17px; font-weight: 500; font-variant-numeric: tabular-nums; }
  .amount-bar .lab { font: 400 12px var(--body); color: var(--ink-3); letter-spacing: 0.04em; text-transform: uppercase; }
  .amount-bar.won { border-bottom-color: var(--green-line); }
  .amount-bar.won .cur { color: var(--green); }

  /* ---------- slider ---------- */
  .slider-wrap { display: grid; gap: 14px; }
  input[type="range"] {
    appearance: none;
    width: 100%;
    height: 26px;
    background: transparent;
    cursor: pointer;
    box-shadow: none;
    padding: 0;
    border: 0;
  }
  input[type="range"]::-webkit-slider-runnable-track {
    height: 5px;
    border-radius: 100px;
    background: linear-gradient(90deg, var(--gold-fill) 0 var(--pct, 0%), var(--g-4) var(--pct, 0%) 100%);
  }
  input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 22px; height: 22px;
    margin-top: -8.5px;
    border-radius: 50%;
    background: var(--g-0);
    border: 1px solid rgba(16, 20, 28, 0.2);
    box-shadow: 0 1px 4px rgba(16, 20, 28, 0.22), 0 0 0 0 var(--gold-dim);
    transition: box-shadow var(--quick), transform var(--quick);
  }
  input[type="range"]:hover::-webkit-slider-thumb { transform: scale(1.06); }
  input[type="range"]:focus-visible::-webkit-slider-thumb { box-shadow: 0 1px 4px rgba(16,20,28,.22), 0 0 0 6px var(--gold-dim); }
  input[type="range"]::-moz-range-track { height: 5px; border-radius: 100px; background: var(--g-4); }
  input[type="range"]::-moz-range-progress { height: 5px; border-radius: 100px; background: var(--gold-fill); }
  input[type="range"]::-moz-range-thumb {
    width: 21px; height: 21px;
    border-radius: 50%;
    background: var(--g-0);
    border: 1px solid rgba(16, 20, 28, 0.2);
    box-shadow: 0 1px 4px rgba(16, 20, 28, 0.22);
  }

  .cap-track { position: relative; height: 15px; margin-top: -6px; }
  .cap-mark {
    position: absolute;
    top: 0;
    transform: translateX(-50%);
    font-size: 11px;
    color: var(--ink-3);
    white-space: nowrap;
  }
  .cap-mark::before {
    content: "";
    display: block;
    width: 1px; height: 7px;
    margin: -9px auto 2px;
    background: var(--hair-2);
  }
  .ends { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-4); }

  /* over the usual limit */
  .overbox {
    border: 1px solid var(--gold-line);
    background: var(--gold-dim);
    border-radius: var(--r-md);
    padding: 17px;
    display: grid;
    gap: 13px;
  }
  .overbox.acked { border-color: var(--hair-2); background: var(--g-2); }
  .over-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
  .over-big {
    font-family: var(--display);
    font-size: 29px;
    font-weight: 300;
    letter-spacing: -0.03em;
    color: var(--gold-soft);
    font-variant-numeric: tabular-nums;
  }
  .over-track { display: flex; height: 7px; border-radius: 100px; overflow: hidden; background: var(--g-4); }
  .over-track .within { background: var(--green); }
  .over-track .beyond { background: var(--gold-fill); }
  .over-labels { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-3); }

  /* ---------- steps ---------- */
  .steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
  .steps button, .steps .steps-link {
    width: 100%;
    display: grid;
    grid-template-columns: 26px 1fr;
    gap: 12px;
    align-items: start;
    text-align: left;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--r-md);
    padding: 11px 12px;
    color: inherit;
    font: inherit;
    cursor: pointer;
    transition: background var(--quick), border-color var(--quick);
  }
  .steps button:hover { background: var(--g-2); }
  .steps a:hover { text-decoration: none; }
  .steps a:hover .steps-inner { background: var(--g-2); }
  .steps button[aria-current] { background: var(--g-2); border-color: var(--gold-line); }
  .steps .n {
    width: 26px; height: 26px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 12.5px;
    font-weight: 600;
    background: var(--g-2);
    color: var(--ink-3);
    border: 1px solid var(--hair-2);
    font-variant-numeric: tabular-nums;
  }
  .steps button[aria-current] .n { background: var(--gold-fill); color: #241a02; border-color: #b3861a; }
  .steps .is-approved .n { background: var(--green-dim); color: var(--green); border-color: var(--green-line); }
  .steps .t { font-size: 14px; font-weight: 500; display: block; }
  .steps .meta { font-size: 12px; color: var(--ink-3); margin-top: 2px; display: block; }

  /* ---------- pickers ---------- */
  .chips { display: flex; flex-wrap: wrap; gap: 7px; }
  .chip {
    font: 500 13px var(--body);
    color: var(--ink-2);
    background: var(--g-0);
    border: 1px solid var(--hair);
    border-radius: 100px;
    padding: 8px 14px;
    cursor: pointer;
    display: inline-block;
    text-decoration: none;
    box-shadow: var(--shadow-1);
    transition: background var(--quick), border-color var(--quick), color var(--quick);
  }
  .chip:hover { background: var(--g-2); color: var(--ink-1); text-decoration: none; }
  .chip[aria-pressed="true"] {
    color: var(--gold-soft);
    border-color: var(--gold-line);
    background: var(--gold-dim);
    font-weight: 600;
  }

  .pickcards { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(235px, 1fr)); }
  .pickcard {
    text-align: left;
    background: var(--g-0);
    border: 1px solid var(--hair);
    border-radius: var(--r-md);
    padding: 15px;
    cursor: pointer;
    display: grid;
    gap: 5px;
    align-content: start;
    color: inherit;
    font: inherit;
    text-decoration: none;
    box-shadow: var(--shadow-1);
    transition: background var(--quick), border-color var(--quick), transform var(--quick), box-shadow var(--quick);
  }
  .pickcard:hover {
    background: var(--g-0);
    transform: translateY(-1px);
    box-shadow: var(--shadow-2);
    text-decoration: none;
  }
  .pickcard[aria-pressed="true"] {
    border-color: var(--gold-line);
    background: var(--gold-dim);
    box-shadow: var(--shadow-1);
  }
  .pickcard[aria-pressed="true"] h3 { color: var(--gold-soft); }
  .pickcard:disabled, .pickcard.is-disabled, .pickcard[aria-disabled="true"] {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    background: var(--g-2);
  }
  .pickcard .who { font-size: 12.5px; color: var(--ink-3); line-height: 1.5; }
  .pickcard h3 { color: var(--ink-1); }

  /* ---------- documents ---------- */
  .doc {
    display: grid;
    gap: 10px;
    grid-template-columns: 1fr auto;
    align-items: start;
    padding: 15px;
    background: var(--g-1);
    border: 1px solid var(--hair);
    border-radius: var(--r-md);
  }
  .doc + .doc { margin-top: 9px; }
  .doc .file { grid-column: 1 / -1; }
  .doc .have { grid-column: 1 / -1; font-size: 12.5px; color: var(--green); }

  /* ---------- budget ---------- */
  .brow { display: grid; grid-template-columns: 1fr 150px 38px; gap: 9px; align-items: center; }
  .brow + .brow { margin-top: 8px; }
  .brow .rm {
    width: 38px; height: 38px;
    display: grid; place-items: center;
    padding: 0;
    color: var(--ink-3);
    background: var(--g-0);
    border: 1px solid var(--hair);
    border-radius: 9px;
    cursor: pointer;
    transition: color var(--quick), border-color var(--quick), background var(--quick);
  }
  .brow .rm:hover { color: var(--red); border-color: var(--red-line); background: var(--red-dim); }
  .btotal {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    margin-top: 15px;
    padding-top: 14px;
    border-top: 1px solid var(--hair);
    font-size: 14px;
  }
  .btotal .fig { font-family: var(--display); font-size: 19px; font-variant-numeric: tabular-nums; }
  .ok-text { color: var(--green); }
  .warn-text { color: var(--gold-soft); }
  .bad-text { color: var(--red); }

  /* ---------- answers ---------- */
  .answers {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 1px;
    background: var(--hair);
    border: 1px solid var(--hair);
    border-radius: var(--r-md);
    overflow: hidden;
  }
  .answers li {
    display: grid;
    gap: 3px 14px;
    grid-template-columns: minmax(170px, 34%) 1fr;
    padding: 12px 15px;
    background: var(--g-0);
    font-size: 14px;
  }
  .answers .q { color: var(--ink-3); font-size: 13px; }
  .answers .v { color: var(--ink-1); overflow-wrap: anywhere; }
  .answers .v .none { color: var(--ink-4); font-style: italic; }
  .answers li.flagrow { background: var(--gold-dim); }
  .answers .flagbox { grid-column: 2; display: flex; gap: 7px; align-items: center; font-size: 12px; color: var(--ink-3); }

  /* ---------- tables ---------- */
  table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
  table.data th, table.data td { text-align: left; padding: 11px 13px; border-bottom: 1px solid var(--hair); vertical-align: top; }
  table.data th { font-size: 12px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-3); }
  table.data tbody tr { transition: background var(--quick); }
  table.data tbody tr:hover { background: var(--g-1); }
  table.data td.num { text-align: right; }

  /* ---------- log ---------- */
  .log { list-style: none; margin: 0; padding: 0; display: grid; gap: 13px; }
  .log li { display: grid; gap: 2px; font-size: 13px; padding-left: 14px; position: relative; }
  .log li::before {
    content: "";
    position: absolute;
    left: 0; top: 6px;
    width: 5px; height: 5px;
    border-radius: 50%;
    background: var(--ink-4);
  }
  .log b { color: var(--ink-1); font-weight: 600; }
  .log .t { color: var(--ink-4); font-size: 11.5px; }

  /* ---------- stat tiles ---------- */
  .tiles { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
  .tile {
    background: var(--g-0);
    border: 1px solid var(--hair);
    border-radius: var(--r-md);
    padding: 16px 17px;
    display: grid;
    gap: 5px;
    box-shadow: var(--shadow-1);
  }
  .tile .fig {
    font-family: var(--display);
    font-size: 30px;
    font-weight: 300;
    letter-spacing: -0.03em;
    font-variant-numeric: tabular-nums;
    line-height: 1;
    color: var(--ink-1);
  }
  .tile.hi { border-color: var(--gold-line); background: var(--gold-dim); }
  .tile.hi .fig { color: var(--gold-soft); }

  /* ---------- two-column work layout ---------- */
  .work { display: grid; gap: var(--gut); grid-template-columns: 290px 1fr; align-items: start; }
  .work aside { position: sticky; top: 76px; display: grid; gap: 14px; }
  @media (max-width: 900px) {
    .work { grid-template-columns: 1fr; }
    .work aside { position: static; }
  }

  /* ---------- the stages, as a rail on a phone ----------
     Stacked, the three stages are a 500px wall between the applicant and the
     form they came to fill in: the work starts below the fold on every visit.
     Laid along one scrolling line they stay a way of moving between stages
     and of seeing which is which, while giving the screen back to the form.
     The same list and the same links; only the direction changes. */
  @media (max-width: 760px) {
    .steps {
      grid-auto-flow: column;
      grid-auto-columns: minmax(190px, 78%);
      overflow-x: auto;
      overscroll-behavior-x: contain;
      scroll-snap-type: x mandatory;
      -webkit-overflow-scrolling: touch;
      /* room for the cards' own shadow, and a hint of the next one */
      padding: 2px 2px 10px;
      margin-inline: -2px;
      scrollbar-width: none;
    }
    .steps::-webkit-scrollbar { display: none; }
    .steps > li { scroll-snap-align: start; }

    /* Each stage becomes a card in its own right, so the row reads as a set
       of tabs rather than as a sentence running off the edge. */
    .steps .steps-inner {
      height: 100%;
      border: 1px solid var(--hair-2) !important;
      background: var(--g-0);
      box-sizing: border-box;
    }
    /* The field list ("Who is applying, amount, identity check") is what makes
       these cards tall, and clamped to a narrow card it breaks mid-word. The
       stage's name and its status say which stage this is and where it stands,
       which is all the rail is for; the full list is on the stage itself, under
       the same heading. */
    .steps .meta { display: none; }

    /* The stage being filled in is the one to find at a glance. */
    .steps .steps-link[aria-current] .steps-inner,
    .steps .is-current .steps-inner {
      border-color: var(--gold-line) !important;
      background: var(--g-2);
    }
  }

  /* ---------- hero ---------- */
  .hero h1 { max-width: 20ch; }
  .hero .lede { font-size: clamp(15.5px, 1.9vw, 18.5px); color: var(--ink-2); max-width: 54ch; }

  /* ---------- details rollups ---------- */
  details > summary { cursor: pointer; }
  details > summary:hover { color: var(--blue); }
}

@layer utilities {
  .center { text-align: center; }
  .mt-0 { margin-top: 0; }
  .mb-0 { margin-bottom: 0; }
  .nowrap { white-space: nowrap; }
  .hidden { display: none !important; }
  .sr {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
  }
  .reveal { animation: rise var(--calm) both; }
  @keyframes rise {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: none; }
  }
}

/* ============================================================
   Loading, feedback and the sound toggle.
   Appended in the components layer so it sits with the rest of
   the component styles rather than overriding utilities.
   ============================================================ */
@layer components {

  /* ---------- top progress bar ---------- */
  .loadbar {
    position: fixed;
    inset: 0 auto auto 0;
    width: 100%;
    height: 2px;
    z-index: 90;
    opacity: 0;
    pointer-events: none;
  }
  .loadbar.run { opacity: 1; }
  .loadbar::before {
    content: "";
    display: block;
    height: 100%;
    width: var(--p, 0%);
    background: linear-gradient(90deg, var(--gold-strong), var(--gold-fill) 55%, var(--blue));
    box-shadow: 0 0 10px rgba(218, 165, 32, .5);
    transition: width .5s cubic-bezier(.22, 1, .36, 1);
  }
  .loadbar.done::before { transition: width .18s ease-out; }

  /* ---------- the veil over a leaving page ---------- */
  .loadveil {
    position: fixed;
    inset: 0;
    z-index: 85;
    background: var(--g-0);
    opacity: 0;
    pointer-events: none;
    transition: opacity .22s ease;
  }
  .loadveil.show { opacity: .45; pointer-events: auto; }

  /* ---------- the submit loader ----------
     The spinner is not in a panel. It sits on the page itself over a dimming
     scrim, so what you were looking at stays recognisable underneath while it
     works. No wording: a spinner already says "working", and a label that
     claims more than it knows is worse than none. */
  .loadover {
    position: fixed;
    inset: 0;
    z-index: 95;
    display: grid;
    place-items: center;
    padding: 24px;
    /* an ash scrim: enough to mute the page, not enough to hide it */
    background: color-mix(in srgb, var(--ink-1) 26%, transparent);
    backdrop-filter: saturate(.85) blur(2.5px);
    -webkit-backdrop-filter: saturate(.85) blur(2.5px);
    opacity: 0;
    visibility: hidden;
    transition: opacity .2s ease, visibility .2s ease;
  }
  .loadover.show { opacity: 1; visibility: visible; }
  html.is-loading { overflow: hidden; }

  /* The ring is lifted off the scrim by its own soft halo rather than a card,
     so it reads as floating on the page. */
  .loadover .loadring {
    width: 54px;
    height: 54px;
    filter: drop-shadow(0 2px 10px rgba(16, 20, 28, .28));
    transform: scale(.9);
    transition: transform .26s cubic-bezier(.22, 1, .36, 1);
  }
  .loadover.show .loadring { transform: none; }

  /* ---------- the ring ---------- */
  .loadring {
    display: inline-grid;
    place-items: center;
    width: 42px;
    height: 42px;
    position: relative;
  }
  .loadring span {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid transparent;
    border-top-color: var(--gold-fill);
    animation: spin 1s linear infinite;
  }
  .loadring span:nth-child(2) {
    inset: 6px;
    border-top-color: var(--blue);
    animation-duration: 1.45s;
    animation-direction: reverse;
  }
  .loadring span:nth-child(3) {
    inset: 12px;
    border-top-color: var(--ink-4);
    animation-duration: 1.9s;
  }
  @keyframes spin { to { transform: rotate(360deg); } }

  /* ---------- an element that is itself working ---------- */
  .is-busy {
    position: relative;
    pointer-events: none;
    opacity: .72;
  }
  .is-busy::after {
    content: "";
    position: absolute;
    top: 50%; right: 11px;
    width: 13px; height: 13px;
    margin-top: -6.5px;
    border-radius: 50%;
    border: 2px solid var(--hair-2);
    border-top-color: var(--gold-strong);
    animation: spin .7s linear infinite;
  }

  /* ---------- brief acknowledgement of a press ---------- */
  .pulse { animation: pulsehit .26s ease; }
  @keyframes pulsehit {
    0%   { transform: scale(1); }
    42%  { transform: scale(.97); }
    100% { transform: scale(1); }
  }

  /* a field that was just set */
  .just-set { animation: setglow .42s ease; }
  @keyframes setglow {
    from { box-shadow: 0 0 0 3px rgba(218, 165, 32, .22); border-radius: 10px; }
    to   { box-shadow: 0 0 0 3px rgba(218, 165, 32, 0); border-radius: 10px; }
  }

  /* Where the page moved itself to after a pick, on a phone. The section is
     named for a moment so the eye knows the view was carried there on purpose
     and did not simply fall somewhere. advance.js removes the class. */
  .advanced { animation: advanceland 1.4s ease; }
  @keyframes advanceland {
    0%   { box-shadow: -12px 0 0 -9px var(--gold-fill); }
    22%  { box-shadow: -12px 0 0 -9px var(--gold-fill); }
    100% { box-shadow: -12px 0 0 -9px rgba(218, 165, 32, 0); }
  }

  /* a number field refusing a letter */
  .shake { animation: shakeit .2s ease; }
  @keyframes shakeit {
    0%, 100% { transform: translateX(0); }
    25%      { transform: translateX(-3px); }
    75%      { transform: translateX(3px); }
  }

  /* ---------- the sound toggle ---------- */
  .sndbtn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 11px;
    border: 1px solid var(--hair);
    border-radius: 999px;
    background: var(--g-0);
    color: var(--ink-3);
    font: 500 12px/1 "Inter", sans-serif;
    cursor: pointer;
    transition: color .16s ease, border-color .16s ease, background .16s ease;
  }
  .sndbtn:hover { color: var(--ink-1); border-color: var(--hair-2); }
  .sndbtn .sndwave {
    display: inline-flex;
    align-items: flex-end;
    gap: 2px;
    height: 11px;
  }
  .sndbtn .sndwave i {
    width: 2px;
    height: 3px;
    border-radius: 1px;
    background: currentColor;
    transition: height .18s ease;
  }
  .sndbtn.is-on {
    color: var(--gold-strong);
    border-color: color-mix(in srgb, var(--gold-strong) 34%, var(--hair));
    background: color-mix(in srgb, var(--gold-fill) 7%, var(--g-0));
  }
  .sndbtn.is-on .sndwave i:nth-child(1) { height: 5px; animation: eq .9s ease-in-out infinite; }
  .sndbtn.is-on .sndwave i:nth-child(2) { height: 10px; animation: eq .9s ease-in-out .15s infinite; }
  .sndbtn.is-on .sndwave i:nth-child(3) { height: 7px; animation: eq .9s ease-in-out .3s infinite; }
  @keyframes eq {
    0%, 100% { transform: scaleY(.55); }
    50%      { transform: scaleY(1); }
  }

  @media (prefers-reduced-motion: reduce) {
    .loadring span,
    .sndbtn.is-on .sndwave i { animation: none; }
    .loadbar::before { transition: none; }
    .pulse, .just-set, .shake, .advanced { animation: none; }
  }
}

/* ============================================================
   Grant applicants: the list of profiles and one profile's
   submission history.
   ============================================================ */
@layer components {

  .plist { display: grid; gap: 10px; }

  .prow {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1.6fr) auto;
    gap: 16px;
    align-items: center;
    padding: 15px 17px;
    background: var(--g-0);
    border: 1px solid var(--hair);
    border-radius: 14px;
    transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
  }
  .prow:hover {
    border-color: var(--hair-2);
    box-shadow: 0 1px 2px rgba(16, 20, 28, .04), 0 10px 26px -16px rgba(16, 20, 28, .16);
  }

  .pid { display: flex; align-items: center; gap: 13px; min-width: 0; }

  .pav {
    flex: none;
    display: grid;
    place-items: center;
    width: 38px; height: 38px;
    border-radius: 11px;
    background: linear-gradient(145deg, var(--g-3), var(--g-2));
    border: 1px solid var(--hair);
    font: 600 12.5px/1 "Inter", sans-serif;
    letter-spacing: .04em;
    color: var(--gold-strong);
  }
  .pav-lg { width: 52px; height: 52px; border-radius: 15px; font-size: 16px; }

  .pmail {
    font: 500 14.5px/1.3 "Inter", sans-serif;
    color: var(--ink-1);
    overflow-wrap: anywhere;
  }

  .pstats { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; }

  .pstat { display: inline-flex; align-items: baseline; gap: 5px; }
  .pstat .n {
    font: 600 15px/1 "Inter Tight", sans-serif;
    color: var(--ink-1);
    font-variant-numeric: tabular-nums;
  }
  .pstat .l { font-size: 12px; color: var(--ink-3); }

  /* ---------- one stage's submissions ---------- */
  .vblock {
    border: 1px solid var(--hair);
    border-radius: 13px;
    padding: 12px 15px;
    background: var(--g-1);
  }
  .vblock + .vblock { margin-top: 9px; }
  .vblock > summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 9px;
    cursor: pointer;
    list-style: none;
  }
  .vblock > summary::-webkit-details-marker { display: none; }
  .vblock > summary::after {
    content: "";
    margin-left: auto;
    width: 7px; height: 7px;
    border-right: 1.5px solid var(--ink-4);
    border-bottom: 1.5px solid var(--ink-4);
    transform: rotate(45deg);
    transition: transform .18s ease;
  }
  .vblock[open] > summary::after { transform: rotate(-135deg); }

  .vnum {
    font: 600 10.5px/1 "Inter", sans-serif;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--ink-4);
  }
  .vtitle { font: 500 14.5px/1.3 "Inter Tight", sans-serif; color: var(--ink-1); }

  .vlist { display: grid; gap: 6px; margin: 11px 0 4px; }
  .vrow {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 8px 11px;
    background: var(--g-0);
    border: 1px solid var(--hair);
    border-radius: 9px;
  }

  @media (max-width: 760px) {
    .prow { grid-template-columns: 1fr; gap: 12px; }
    .prow > a.btn { justify-self: start; }
  }
}

/* ============================================================
   Top bar on narrow screens.

   The bar is a flex row: brand, left links, spacer, right links.
   With three left links plus "Sign out" on the admin side, the
   content exceeds a phone viewport. A flex item will not shrink
   below its content width without min-width:0, so the overflow
   pushed the right-hand links off screen instead of wrapping,
   and the fixed 58px height left no room to wrap into.
   ============================================================ */
@layer components {

  .topbar .inner {
    flex-wrap: wrap;
    /* a floor rather than a fixed height, so a wrapped bar can grow */
    height: auto;
    min-height: 58px;
    row-gap: 0;
    padding-block: 7px;
  }

  /* let the groups shrink and wrap internally instead of overflowing */
  .topbar .navlinks { flex-wrap: wrap; min-width: 0; }
  .topbar .mark { min-width: 0; }

  /* The account group stays on the right once the bar wraps.
     Without this it drops onto the second line and starts from the left,
     directly under the brand, with the whole width empty beside it. The
     auto margin eats that space, so the group keeps the right edge on one
     line and on two. */
  .topbar .navlinks[aria-label="Account"] {
    margin-left: auto;
    justify-content: flex-end;
  }

  /* the brand may ellipsise; the links must stay readable */
  .topbar .mark {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .topbar .navlinks a { white-space: nowrap; }

  @media (max-width: 720px) {
    .topbar .inner { gap: 10px; }
    .topbar .navlinks a { font-size: 13px; padding: 7px 9px; }
    /* the spacer would otherwise force a wrap between the two groups */
    .topbar .spacer { flex-basis: 0; min-width: 0; }
  }

  @media (max-width: 520px) {
    /* stack: brand on its own line, then the links together */
    .topbar .inner { gap: 6px 10px; padding-block: 9px; }
    .topbar .mark { flex: 1 0 100%; }
    .topbar .mark .brandlogo { width: 164px; height: 54px; }
    .topbar .spacer { display: none; }
    .topbar .navlinks { gap: 2px; }
    .topbar .navlinks a { font-size: 12.5px; padding: 6px 8px; }
  }

  /* ---------- tap targets ---------- */
  /* A pointer that is not fine is a finger: the small controls need to
     reach the 44px that a fingertip actually needs. */
  @media (pointer: coarse) {
    .navlinks a,
    .btn-sm,
    .sndbtn { min-height: 44px; display: inline-flex; align-items: center; }
    .brow .rm { min-width: 44px; min-height: 44px; }
    .check input[type="checkbox"] { width: 22px; height: 22px; }
  }

  /* ---------- long unbroken strings ---------- */
  /* Email addresses, reference codes and uploaded filenames have no spaces
     to break at, so they would otherwise widen their container. */
  .pmail,
  .answers .v,
  .vrow,
  .doc .have,
  .log li { overflow-wrap: anywhere; }

  /* ---------- iOS zoom ---------- */
  /* Safari zooms the page when a focused input's text is under 16px. */
  @media (max-width: 760px) {
    input, select, textarea { font-size: 16px; }
  }

  /* ---------- budget rows on a phone ---------- */
  @media (max-width: 520px) {
    .brow {
      grid-template-columns: 1fr auto;
      grid-template-areas: "item remove" "cost remove";
      gap: 7px 9px;
    }
    .brow > input:first-child { grid-area: item; }
    .brow > input:nth-child(2) { grid-area: cost; }
    .brow .rm { grid-area: remove; align-self: center; }
  }
}

/* ============================================================
   Fixes from the responsive and accessibility audit.
   ============================================================ */
@layer components {

  /* ---------- answers: the densest screen in the product ----------
     minmax(170px, 34%) made 170px a FLOOR, not a preference. Inside a card
     inside the page gutters there is about 258px at 360px, so the question
     column refused to drop below 170px and left roughly 74px for the answer
     itself - a one-or-two-characters-per-line ribbon. minmax(0, 34%) lets the
     track shrink, and below 620px the pair stacks instead. */
  /* A floor that is a preference, not a hard minimum: min() yields the smaller
     of 170px and 42% of the track, so in a wide card the question column gets
     its comfortable 170px, and in the narrow review sidebar it gives way
     instead of forcing a three-line wrap. Below 620px the pair stacks. */
  .answers li { grid-template-columns: minmax(min(170px, 42%), 34%) minmax(0, 1fr); }

  @media (max-width: 620px) {
    .answers li { grid-template-columns: minmax(0, 1fr); gap: 4px; }
    /* the question carries the weight when it is above rather than beside */
    .answers .q { font-weight: 500; color: var(--ink-2); }
    /* the flag control was pinned to column 2, which no longer exists */
    .answers .flagbox { grid-column: 1; }
  }

  /* ---------- the flag checkboxes on the review screen ----------
     These inputs are not inside .check, so the custom checkbox styling never
     reached them and they fell back to the browser's own ~13px box. */
  .answers .flagbox input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    flex: none;
    width: 19px; height: 19px;
    border: 1px solid var(--hair-2);
    border-radius: 5px;
    background: var(--g-0);
    cursor: pointer;
    position: relative;
    transition: background var(--quick), border-color var(--quick);
  }
  .answers .flagbox input[type="checkbox"]:hover { border-color: var(--gold); }
  .answers .flagbox input[type="checkbox"]:checked {
    background: var(--gold-fill);
    border-color: #b3861a;
  }
  .answers .flagbox input[type="checkbox"]:checked::after {
    content: "";
    position: absolute;
    left: 5px; top: 2px;
    width: 6px; height: 10px;
    border-right: 2px solid #241a02;
    border-bottom: 2px solid #241a02;
    transform: rotate(45deg);
  }
  .answers .flagbox label { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; }

  /* ---------- the brand mark ----------
     .inner can wrap, but flexbox only wraps once shrinking is exhausted, and
     min-width:0 let the mark shrink towards nothing first. With a longer site
     name it ellipsised down to a dot while the links stayed on one line. Give
     it its own row across the whole band where it cannot fit beside them. */
  @media (max-width: 900px) {
    .topbar .mark { flex: 1 0 100%; }
    .topbar .spacer { display: none; }
  }

  /* ---------- tap targets ---------- */
  /* The primary submit and the 11 category chips were the two controls the
     first pass missed, and they carry most of the tapping. */
  @media (pointer: coarse) {
    .btn { min-height: 44px; }
    .chip { min-height: 44px; display: inline-flex; align-items: center; }
    .answers .flagbox label { min-height: 44px; }
    /* the amount slider is the most important control on stage 1 */
    input[type="range"] { height: 44px; }
  }

  /* ---------- long strings that still had no break ---------- */
  /* The list view handled emails; the profile heading did not. */
  .pid h1, .pid .pmail { overflow-wrap: anywhere; }
  /* .row-between gives its children no shrink floor, and it is used widely. */
  .row-between > * { min-width: 0; }

  /* ---------- the loading card at 320px ---------- */
  /* 86vw against a container already inset by 24px each side overflowed. */
  .loadover .loadring { width: 48px; height: 48px; }

  /* ---------- the version rollup chevron ---------- */
  /* As the last flex item it wrapped onto whatever line was last, so it could
     end up alone on a row below the title it belongs to. Pin it instead. */
  .vblock > summary { position: relative; padding-right: 24px; }
  .vblock > summary::after { position: absolute; right: 3px; top: 8px; margin-left: 0; }

  /* ---------- the cap marker on the slider ---------- */
  /* Absolutely positioned, centred on its own width and nowrap, so a cap near
     either end of the range overhung the card. */
  .cap-mark { max-width: 92%; white-space: normal; text-align: center; }

  /* ---------- contrast ----------
     --ink-4 is 2.57:1 on white, which is fine for a decorative rule but not
     for text. These six places carry real information - "Locked", "Not given",
     the slider bounds, a timestamp, a stage number - so they move to --ink-3.
     --ink-3 itself was 4.33:1, just under the 4.5:1 it needed, so it is
     darkened a little at the token. */
  .pill-locked,
  .ends,
  .answers .v .none,
  .log .t,
  .vnum { color: var(--ink-3); }
  input::placeholder, textarea::placeholder { color: var(--ink-3); }
}


@layer components {
  /* ---------- skip link ----------
     Hidden with the .sr utility until focused, then a real visible control in
     the top-left. Needs to escape .sr's clip and 1px box when it appears. */
  .skip:focus-visible,
  .skip:focus {
    position: fixed;
    top: 10px; left: 10px;
    z-index: 100;
    width: auto; height: auto;
    margin: 0;
    padding: 11px 16px;
    overflow: visible;
    clip: auto;
    clip-path: none;
    background: var(--g-0);
    color: var(--ink-1);
    border: 1px solid var(--gold);
    border-radius: 10px;
    box-shadow: 0 10px 28px -12px rgba(16, 20, 28, .3);
    font: 500 14px/1 "Inter", sans-serif;
    text-decoration: none;
  }
  /* the landmark takes focus from the skip link without showing a ring */
  main:focus { outline: none; }
}

@layer components {
  /* A step card's heading is an h2 because it sits beside the other sections,
     not inside one. Its size is the old h3's, so nothing moves visually. */
  .h-step {
    font: 500 16.5px/1.35 "Inter Tight", sans-serif;
    letter-spacing: -0.01em;
    margin: 0;
    color: var(--ink-1);
  }
}

@layer components {
  /* ---------- applicant row identity block ----------
     .stack spaces block children with a top margin, but <strong> and <span>
     are inline, so the email and its metadata ran together on one line and
     the margin had no effect. Make the two parts blocks. */
  .pid .pmail,
  .pid .pmail + .tiny { display: block; }
  .pid .tiny { line-height: 1.45; }
}

@layer components {
  /* ---------- a section revealed by the previous choice ----------
     Each pick on "What are you applying for?" is a real navigation, so the
     next section arrives with the new document. Without this it appeared as
     a hard flash; it now settles in, and the one you clicked is not animated
     away under your cursor. */
  .step-in {
    animation: stepIn .34s cubic-bezier(.22, 1, .36, 1) both;
  }
  @keyframes stepIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: none; }
  }

  /* ---------- the page outline, drawn while a choice is loading ----------
     A thin rule traced around the viewport. It replaces the full scrim for
     picks, which only swap one section: dimming the whole page for that read
     as heavier than the change actually was. */
  .pageline {
    position: fixed;
    inset: 0;
    z-index: 96;
    pointer-events: none;
    opacity: 0;
    transition: opacity .18s ease;
  }
  .pageline.show { opacity: 1; }
  .pageline span {
    position: absolute;
    background: var(--gold-fill);
    box-shadow: 0 0 9px rgba(218, 165, 32, .55);
  }
  /* top and bottom run left to right; the sides run top to bottom */
  .pageline .e-t, .pageline .e-b { height: 2px; width: 100%; transform-origin: left center; }
  .pageline .e-l, .pageline .e-r { width: 2px; height: 100%; transform-origin: center top; }
  .pageline .e-t { top: 0; left: 0; }
  .pageline .e-r { top: 0; right: 0; }
  .pageline .e-b { bottom: 0; left: 0; }
  .pageline .e-l { top: 0; left: 0; }
  .pageline.show span { animation: traceEdge 1.1s ease-in-out infinite; }
  .pageline.show .e-r { animation-delay: .1s; }
  .pageline.show .e-b { animation-delay: .2s; }
  .pageline.show .e-l { animation-delay: .3s; }
  @keyframes traceEdge {
    0%   { transform: scale(0); opacity: 0; }
    35%  { transform: scale(1); opacity: 1; }
    100% { transform: scale(1); opacity: 0; }
  }
  .pageline .e-l, .pageline .e-r { animation-name: traceEdgeV; }
  @keyframes traceEdgeV {
    0%   { transform: scaleY(0); opacity: 0; }
    35%  { transform: scaleY(1); opacity: 1; }
    100% { transform: scaleY(1); opacity: 0; }
  }

  /* the card being chosen holds a soft lift while the next page loads */
  .pickcard.is-picking, .chip.is-picking {
    border-color: var(--gold-line);
    box-shadow: 0 0 0 3px var(--gold-dim);
    transform: translateY(-1px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .step-in { animation: none; }
  .pageline.show span { animation: none; opacity: .9; }
}
@layer components {
  /* ---------- a field the submission missed ----------
     The list of problems at the top of the page says what is wrong; this says
     where. Both are needed on a long form: the list alone left the applicant
     scrolling to find which of forty boxes was the empty one. */
  .field.missed > label,
  .check.missed label {
    color: var(--red);
  }
  .field.missed input,
  .field.missed select,
  .field.missed textarea {
    border-color: var(--red);
    background: var(--red-dim);
  }
  .field.missed input:focus,
  .field.missed select:focus,
  .field.missed textarea:focus {
    border-color: var(--red);
    box-shadow: 0 0 0 3px var(--red-line);
  }
  .check.missed {
    border-color: var(--red);
    background: var(--red-dim);
  }
  .check.missed input[type="checkbox"] {
    outline: 2px solid var(--red);
    outline-offset: 2px;
  }
  /* a quiet marker, so the outline is not the only signal */
  .field.missed > label::after,
  .check.missed label::after {
    content: " needs an answer";
    font-size: 11.5px;
    font-weight: 500;
    color: var(--red);
    opacity: .8;
  }
}
@layer components {
}
@layer components {
  /* a required document with nothing chosen */
  .doc.missed {
    border-color: var(--red);
    background: var(--red-dim);
  }
  .doc.missed h3 { color: var(--red); }
  .doc.missed .file {
    border-color: var(--red);
    background: color-mix(in srgb, var(--red) 4%, #fff);
  }
  .doc.missed .missnote { color: var(--red); }
}
@layer components {
  /* ---------- a landing-page pane ----------
     A panel that sits slightly above the page rather than flat on it. The
     effect is deliberately shallow: enough to separate the table from the
     background, not enough to make the text work for its legibility. Solid
     rather than glass, for the reason given on the background below. */
  .pane {
    position: relative;
    /* A faint grey edge, not the white one the glass panels use: on an opaque
       white pane a white border has nothing to sit against and the container
       loses its outline. */
    border: 1px solid rgba(16, 20, 28, .07);
    border-radius: 20px;
    padding: 26px 26px 22px;
    /* Opaque, not the glass used elsewhere. The page's warm wash
       (body::before) sits at the top right of the viewport, and a translucent
       pane let it through as a gold cast across that corner of "Who can apply"
       and "What you can apply for". These two read as plain reference tables,
       so they stay neutral: an opaque fill a shade off the page colour blocks
       the wash and still reads as a raised surface against it. The wash itself
       is untouched, so the hero above keeps it. */
    background: #fff;
    box-shadow:
      0 1px 2px rgba(16, 20, 28, .04),
      0 18px 42px -26px rgba(16, 20, 28, .3),
      inset 0 1px 0 rgba(255, 255, 255, .9);
  }
  /* Keep these landing-page containers visually neutral. */
  .pane::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    background: none;
  }
  .pane > * { position: relative; }

  /* Solid, like the pane around it. A translucent table let the page's warm
     wash through from behind, which is what tinted the top right of these two
     containers gold. */
  .tablewrap {
    overflow-x: auto;
    border-radius: 14px;
    border: 1px solid rgba(16, 20, 28, .07);
    background: #fff;
  }

  /* ---------- the reference tables ---------- */
  .data-glass { margin: 0; background: transparent; }
  .data-glass thead th {
    /* Not sticky: these tables are short, and a sticky header floated over
       the help button in the corner. */
    background: var(--g-1);
    font: 500 11px/1 "Inter", sans-serif;
    letter-spacing: .09em;
    text-transform: uppercase;
    color: var(--ink-3);
    padding: 13px 15px;
    border-bottom: 1px solid rgba(16, 20, 28, .09);
    white-space: nowrap;
  }
  .data-glass td {
    padding: 13px 15px;
    border-bottom: 1px solid rgba(16, 20, 28, .055);
    vertical-align: top;
  }
  .data-glass tbody tr:last-child td { border-bottom: 0; }
  .data-glass tbody tr { transition: background .16s ease; }
  /* A neutral hover, not the gold one: these two containers are meant to read
     as plain reference tables. */
  .data-glass tbody tr:hover { background: var(--g-1); }
  .data-glass .num { text-align: right; }

  /* ---------- the funding purposes ---------- */
  .purposes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(215px, 100%), 1fr));
    gap: 1px;
    background: rgba(16, 20, 28, .07);
    border: 1px solid rgba(16, 20, 28, .07);
    border-radius: 14px;
    overflow: hidden;
  }
  .purpose {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 12px 14px;
    /* Solid, and a neutral hover: see .tablewrap above. */
    background: #fff;
    transition: background .16s ease;
  }
  .purpose:hover { background: var(--g-1); }
  .pnum {
    font: 500 11px/1 "Inter", sans-serif;
    color: var(--gold-fill);
    letter-spacing: .04em;
    flex: none;
  }
  .pname {
    font-size: 13.5px;
    color: var(--ink-2);
    line-height: 1.35;
  }

  @media (max-width: 620px) {
    .pane { padding: 20px 16px 18px; border-radius: 16px; }
    .data-glass thead th, .data-glass td { padding: 11px 12px; }
  }
}

@media (prefers-reduced-motion: reduce) {
  .data-glass tbody tr, .purpose { transition: none; }
}

@layer utilities {
  /* ---------- the bot trap ----------
     Hidden from people without being hidden from a bot that reads the markup.
     Not display:none, which some bots skip; it is pushed out of the viewport
     and taken out of the layout, and never focusable. */
  .hp {
    position: absolute !important;
    left: -9999px !important;
    top: auto !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
  }
}
@layer components {
  /* ---------- pages of applicants ---------- */
  .pager {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    padding-top: 6px;
  }
  .pagerbtns { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
  .pbtn {
    display: inline-grid;
    place-items: center;
    min-width: 34px;
    height: 34px;
    padding: 0 10px;
    border: 1px solid var(--hair);
    border-radius: 9px;
    background: var(--g-0);
    font: 500 13px/1 "Inter", sans-serif;
    color: var(--ink-2);
    text-decoration: none;
    transition: border-color .15s ease, background .15s ease, color .15s ease;
  }
  a.pbtn:hover { border-color: var(--gold-line); background: var(--gold-dim); color: var(--ink-1); }
  .pbtn.is-here {
    border-color: var(--gold-line);
    background: var(--gold-dim);
    color: var(--ink-1);
    font-weight: 600;
  }
  .pbtn.is-off { opacity: .4; cursor: default; }
  .pgap { padding: 0 2px; color: var(--ink-4); font-size: 13px; }

  .prow .pcontact { display: block; }

  @media (max-width: 560px) {
    .pager { justify-content: center; }
    .pagerbtns { justify-content: center; }
  }
}

@media (prefers-reduced-motion: reduce) {
  .pbtn { transition: none; }
}

@layer base {
  hr {
    border: 0;
    border-top: 1px solid var(--hair);
    margin: 4px 0;
  }
}

@layer components {
  /* ---------- the floating help button ----------
     Bottom right on every page. The label sits beside the icon on a wide
     screen and above it on a narrow one, where horizontal room is scarcer
     than vertical. */
  .helpdock {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 80;
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    /* kept clear of the iOS home indicator */
    padding-bottom: env(safe-area-inset-bottom, 0);
  }
  .helplabel {
    font: 500 13px/1 "Inter", sans-serif;
    color: var(--ink-2);
    background: var(--g-0);
    border: 1px solid var(--hair);
    border-radius: 999px;
    padding: 8px 13px;
    white-space: nowrap;
    box-shadow: 0 1px 2px rgba(16, 20, 28, .05), 0 8px 22px -14px rgba(16, 20, 28, .3);
    transition: border-color .18s ease, color .18s ease, transform .18s ease;
  }
  /* The Telegram mark itself, floating. The image carries its own circle and
     colour, so nothing is drawn behind it; the shadow is cast on the mark. */
  .helpicon {
    display: block;
    width: 58px;
    height: 58px;
    filter: drop-shadow(0 2px 6px rgba(30, 150, 200, .34))
            drop-shadow(0 12px 24px rgba(16, 20, 28, .22));
    /* the shake: a short burst, then a long rest, so it catches the eye
       without ever becoming the thing you are waiting to stop */
    animation: helpShake 5.2s ease-in-out 2.5s infinite;
    transform-origin: 50% 55%;
    transition: transform .18s ease, filter .18s ease;
  }

  @keyframes helpShake {
    0%, 62%, 100% { transform: rotate(0); }
    64%  { transform: rotate(-13deg) scale(1.04); }
    67%  { transform: rotate(10deg)  scale(1.04); }
    70%  { transform: rotate(-8deg)  scale(1.03); }
    73%  { transform: rotate(6deg)   scale(1.02); }
    76%  { transform: rotate(-3deg); }
    79%  { transform: rotate(0); }
  }

  /* it has your attention now, so it stops moving */
  .helpdock:hover .helpicon,
  .helpdock:focus-visible .helpicon {
    animation-play-state: paused;
    transform: scale(1.08);
    filter: drop-shadow(0 3px 9px rgba(30, 150, 200, .42))
            drop-shadow(0 18px 30px rgba(16, 20, 28, .26));
  }
  .helpdock:hover .helplabel,
  .helpdock:focus-visible .helplabel {
    border-color: #37aee2;
    color: var(--ink-1);
    transform: translateX(-2px);
  }
  .helpdock:focus-visible {
    outline: 2px solid var(--blue);
    outline-offset: 4px;
    border-radius: 999px;
  }

  @media (max-width: 620px) {
    .helpdock {
      right: 14px;
      bottom: 14px;
      flex-direction: column;
      align-items: center;
      gap: 6px;
    }
    .helplabel { font-size: 11.5px; padding: 5px 10px; }
    .helpicon { width: 52px; height: 52px; }
  }
}

@media (prefers-reduced-motion: reduce) {
  .helpicon { animation: none; }
  .helplabel, .helpicon { transition: none; }
}

@layer components {
  /* ---------- the wait for the final decision ----------
     Reached once every stage is approved. There is nothing to do here, so the
     screen is quiet on purpose: it shows the work already done, and marks time
     passing without implying progress that is not being made. */
  .waitroom {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .72);
    border-radius: 22px;
    padding: 40px 32px 30px;
    background:
      linear-gradient(168deg,
        rgba(255, 255, 255, .9) 0%,
        rgba(255, 253, 248, .72) 52%,
        rgba(252, 248, 238, .78) 100%);
    backdrop-filter: blur(16px) saturate(1.2);
    -webkit-backdrop-filter: blur(16px) saturate(1.2);
    box-shadow:
      0 1px 2px rgba(16, 20, 28, .04),
      0 26px 56px -32px rgba(16, 20, 28, .34),
      inset 0 1px 0 rgba(255, 255, 255, .95);
    text-align: center;
  }
  /* a slow warm bloom behind the mark */
  .waitglow {
    position: absolute;
    inset: -40% 10% auto;
    height: 300px;
    pointer-events: none;
    background: radial-gradient(50% 50% at 50% 50%, rgba(218, 165, 32, .17), transparent 70%);
    animation: waitBloom 7s ease-in-out infinite;
  }
  @keyframes waitBloom {
    0%, 100% { opacity: .55; transform: scale(1); }
    50%      { opacity: 1;   transform: scale(1.12); }
  }
  .waitroom > *:not(.waitglow) { position: relative; }

  .waithead-wrap { display: grid; justify-items: center; gap: 9px; }
  .waithead {
    font: 200 clamp(25px, 3.6vw, 36px)/1.14 "Inter Tight", sans-serif;
    letter-spacing: -.03em;
    margin: 0;
    color: var(--ink-1);
  }
  .waithead em {
    font-style: italic;
    font-weight: 300;
    /* A flat colour, not a gradient: background-clip:text paints across the
       union of every line box, and this heading wraps onto two lines, so a
       gradient stop part-way along faded the end of the first line to almost
       nothing and read as the text being cut off. */
    color: #b8860b;
  }
  .waitlede {
    color: var(--ink-3);
    font-size: 14.5px;
    line-height: 1.6;
    max-width: 46ch;
    margin: 2px auto 0;
    text-wrap: pretty;
  }

  .waitmark {
    position: relative;
    width: 76px;
    height: 76px;
    display: grid;
    place-items: center;
    margin-bottom: 2px;
  }
  .waitmark span {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 1.5px solid var(--gold-line);
    animation: waitPulse 3s cubic-bezier(.22, 1, .36, 1) infinite;
  }
  .waitmark span:nth-child(2) { animation-delay: 1s; }
  .waitmark span:nth-child(3) { animation-delay: 2s; }
  @keyframes waitPulse {
    0%   { transform: scale(.38); opacity: 0; }
    26%  { opacity: 1; }
    100% { transform: scale(1); opacity: 0; }
  }
  .waitmark::after {
    content: "";
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--gold-fill);
    box-shadow: 0 0 0 6px var(--gold-dim);
  }

  /* ---------- the journey, finished ---------- */
  .waitrail {
    list-style: none;
    margin: 28px 0 0;
    padding: 0;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 0;
    flex-wrap: wrap;
  }
  .wstep {
    display: grid;
    justify-items: center;
    gap: 7px;
    padding: 0 6px;
    position: relative;
    flex: 0 1 132px;
    min-width: 94px;
  }
  /* the line joining one step to the next */
  .wstep + .wstep::before {
    content: "";
    position: absolute;
    left: calc(-50% + 13px);
    top: 11px;
    width: calc(100% - 26px);
    height: 1.5px;
    background: var(--gold-line);
  }
  .wstep.is-now::before {
    background: repeating-linear-gradient(90deg,
      var(--gold-line) 0 4px, transparent 4px 8px);
  }
  .wdot {
    display: grid;
    place-items: center;
    width: 23px;
    height: 23px;
    border-radius: 50%;
    font-size: 11px;
    font-weight: 600;
    background: var(--gold-fill);
    color: #fff;
    border: 2px solid var(--g-0);
    box-shadow: 0 0 0 1.5px var(--gold-line);
  }
  .wdot-live {
    background: var(--g-0);
    box-shadow: 0 0 0 1.5px var(--gold-line);
    position: relative;
  }
  .wdot-live::after {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--gold-fill);
    animation: liveBeat 1.6s ease-in-out infinite;
  }
  @keyframes liveBeat {
    0%, 100% { transform: scale(.72); opacity: .55; }
    50%      { transform: scale(1);   opacity: 1; }
  }
  .wlabel {
    font-size: 11.5px;
    line-height: 1.35;
    color: var(--ink-3);
    max-width: 15ch;
  }
  .wstep.is-now .wlabel { color: var(--ink-1); font-weight: 500; }

  /* ---------- the three facts ---------- */
  .waitfacts {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin: 28px 0 0;
    padding-top: 22px;
    border-top: 1px solid var(--hair);
  }
  .waitfacts > div { display: grid; gap: 5px; justify-items: center; }
  .waitfacts dt {
    font: 500 10.5px/1 "Inter", sans-serif;
    letter-spacing: .09em;
    text-transform: uppercase;
    color: var(--ink-4);
  }
  .waitfacts dd {
    margin: 0;
    font: 400 19px/1.2 "Inter Tight", sans-serif;
    color: var(--ink-1);
  }
  .waitfacts .of { color: var(--ink-4); font-size: 14px; }
  .fact-money { color: var(--gold-strong); font-weight: 500; }
  .fact-ref { font-size: 15px; letter-spacing: .02em; color: var(--ink-2); }

  .waitnote {
    margin: 22px auto 0;
    max-width: 54ch;
    font-size: 12.5px;
    line-height: 1.65;
    color: var(--ink-4);
  }
  .waitwarn { display: block; margin-top: 3px; color: var(--ink-3); }

  @media (max-width: 620px) {
    .waitroom { padding: 30px 18px 24px; border-radius: 18px; }
    .waitfacts { grid-template-columns: 1fr; gap: 0; }
    .waitfacts > div + div { padding-top: 15px; margin-top: 15px; border-top: 1px solid var(--hair); }
    .waitrail { gap: 4px 0; }
    .wstep { flex-basis: 50%; min-width: 0; }
    .wstep + .wstep::before { display: none; }
  }
}

@media (prefers-reduced-motion: reduce) {
  .waitmark span { animation: none; opacity: .5; }
  .waitglow, .wdot-live::after { animation: none; }
}

@layer components {
  /* The purposes are an odd count, so the last row would otherwise end in a
     dead cell where the grid background shows through. The grid paints the
     same colour as a cell instead, which closes the gap without moving any
     item out of its reading order. */
  .purposes { background: #fff; }
  .purposes { gap: 1px; }
  .purpose { box-shadow: 0 0 0 .5px rgba(16, 20, 28, .07); }
}

@layer components {
  /* ---------- keeping clear of the help button ----------
     The button is fixed, so the end of the page needs room beneath it or the
     last row sits under it with nowhere to scroll. Mid-page overlap is
     handled in JS instead: the button steps aside while you scroll and
     returns when you stop. */
  section.band:last-of-type { padding-bottom: 104px; }
}

@layer components {
  /* The button steps aside while the page is scrolling, so it never sits on
     top of the row you are reading, and comes back once you settle. */
  .helpdock {
    transition: opacity .22s ease, transform .22s cubic-bezier(.22, 1, .36, 1);
  }
  .helpdock.is-away {
    opacity: 0;
    transform: translateY(14px) scale(.9);
    pointer-events: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .helpdock { transition: opacity .15s ease; }
  .helpdock.is-away { transform: none; }
}

@layer components {
  /* ---------- back to the top ----------
     Sits above the help button in the same corner. The offset is a variable
     so the button lands correctly whether or not a help link is configured:
     the script sets it from the help button's real height, or to nothing
     when there is none. */
  .topdock {
    position: fixed;
    right: 22px;
    bottom: calc(22px + var(--helpdock-h, 0px));
    z-index: 79;
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 1px solid var(--hair);
    border-radius: 50%;
    background: color-mix(in oklab, var(--g-0) 86%, transparent);
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    color: var(--ink-2);
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(16, 20, 28, .05), 0 10px 24px -14px rgba(16, 20, 28, .4);
    /* it fades in rather than appearing, since it arrives mid-scroll */
    opacity: 0;
    transform: translateY(10px) scale(.92);
    pointer-events: none;
    transition: opacity .2s ease, transform .24s cubic-bezier(.22, 1, .36, 1),
                border-color .16s ease, color .16s ease;
  }
  /* [hidden] keeps it out of the tab order until there is scroll to undo */
  .topdock[hidden] { display: none; }
  .topdock.is-up {
    opacity: 1;
    transform: none;
    pointer-events: auto;
  }
  .topdock:hover {
    border-color: var(--gold-line);
    color: var(--ink-1);
  }
  .topdock:focus-visible {
    outline: 2px solid var(--blue);
    outline-offset: 3px;
  }
  .topdock:active { transform: translateY(1px); }
  .topdock svg { display: block; }

  @media (max-width: 620px) {
    .topdock {
      right: 14px;
      bottom: calc(14px + var(--helpdock-h, 0px));
      width: 38px;
      height: 38px;
    }
  }
}

@media (prefers-reduced-motion: reduce) {
  .topdock { transition: opacity .15s ease; transform: none; }
  .topdock.is-up { transform: none; }
}

@layer components {
  /* ---------- the site footer ----------
     One quiet line closing every page. The top rule separates it from the
     content without boxing it in, and the padding keeps it clear of the
     floating buttons in the corner. */
  .sitefoot {
    border-top: 1px solid var(--hair);
    margin-top: 10px;
    padding: 22px 0 26px;
  }
  .sitefoot p {
    margin: 0;
    font-size: 12.5px;
    color: var(--ink-4);
  }

  /* The last band already reserves room for the help button; with a footer
     below it that room belongs here instead. */
  section.band:last-of-type { padding-bottom: clamp(34px, 6vw, 72px); }
  .sitefoot { padding-bottom: 104px; }

  @media (max-width: 620px) {
    .sitefoot { padding-top: 18px; padding-bottom: 112px; }
  }
}
