/* =====================================================================
   PayKeep design system, v2
   One stylesheet for every page. Sections:
   1 Fonts  2 Tokens  3 Base  4 Layout  5 Header & menu  6 Search
   7 Buttons & links  8 Fields & validation  9 Tags & notices
   10 Hero  11 Money planner (tabs, budget, savings)  12 Tool shelf
   13 Guides  14 Help band  15 Facts  16 Trust  17 Inner pages
   18 Footer  19 Motion, no-JS, print
   ===================================================================== */

/* ---------- 1. Fonts (self-hosted, latin subset, SIL OFL) ---------- */
@font-face { font-family: "Bricolage Grotesque"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/bricolage-grotesque-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Bricolage Grotesque"; font-style: normal; font-weight: 800; font-display: swap; src: url("../fonts/bricolage-grotesque-latin-800-normal.woff2") format("woff2"); }
@font-face { font-family: "Instrument Sans"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/instrument-sans-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Instrument Sans"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/instrument-sans-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Instrument Sans"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/instrument-sans-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/ibm-plex-mono-latin-600-normal.woff2") format("woff2"); }

/* ---------- 2. Tokens ---------- */
:root {
  /* colour */
  --pk-paper: #F7F5EF;        /* page */
  --pk-paper-deep: #EDE9DE;   /* sunken panels */
  --pk-surface: #FFFDF8;      /* raised surfaces */
  --pk-white: #FFFFFF;        /* input wells */
  --pk-ink: #0B1F1A;          /* text, strong borders, dark bands */
  --pk-ink-2: #1C3330;        /* tracks on dark */
  --pk-forest: #14513F;       /* links, primary hover, focus */
  --pk-forest-deep: #0E3D2F;
  --pk-muted: #4F5E57;        /* secondary text */
  --pk-line: #D9D4C7;         /* quiet borders */
  --pk-line-strong: #8C968F;  /* input borders (3:1 on white) */
  --pk-line-dark: #2A4440;    /* borders on ink */
  --pk-lime: #D4F26A;         /* accent: once per screen, always with ink text */
  --pk-on-dark: #D6E0DB;
  --pk-on-dark-muted: #A9BBB4;

  /* status */
  --pk-error: #A3321A;        /* text + border on light */
  --pk-error-bg: #FBEAE4;
  --pk-warn-on-dark: #FFB48A; /* negative figure on ink */
  --pk-ok: #14513F;
  --pk-ok-bg: #E4EFDF;

  /* budget categories (also differ in lightness) */
  --pk-cat-housing: #3D8B6E;
  --pk-cat-bills: #5B86E5;
  --pk-cat-food: #E3A43A;
  --pk-cat-transport: #C96A4F;
  --pk-cat-other: #B9A6E8;
  --pk-cat-savings: #FFFFFF;
  --pk-cat-left: #D4F26A;

  /* budget groups (tool pages) */
  --pk-g-home: #3D8B6E;
  --pk-g-everyday: #E3A43A;
  --pk-g-debt: #C96A4F;
  --pk-g-lifestyle: #B9A6E8;
  --pk-g-savings: #7FB8F0;
  --pk-g-left: #D4F26A;

  /* type */
  --pk-font-display: "Bricolage Grotesque", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  --pk-font-body: "Instrument Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --pk-font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --pk-t-display: clamp(2.75rem, 1.7rem + 4.2vw, 4.625rem);   /* 44 → 74 */
  --pk-t-h2: clamp(2rem, 1.45rem + 2.2vw, 3rem);             /* 32 → 48 */
  --pk-t-h3: clamp(1.25rem, 1.15rem + 0.4vw, 1.4375rem);     /* 20 → 23 */
  --pk-t-lede: clamp(1.125rem, 1.07rem + 0.25vw, 1.25rem);   /* 18 → 20 */
  --pk-t-body: clamp(1rem, 0.97rem + 0.12vw, 1.0625rem);     /* 16 → 17 */
  --pk-t-small: 0.9375rem;                                   /* 15 */
  --pk-t-micro: 0.8125rem;                                   /* 13 */

  /* space, 4px base */
  --pk-s1: 4px;  --pk-s2: 8px;  --pk-s3: 12px; --pk-s4: 16px; --pk-s5: 24px;
  --pk-s6: 32px; --pk-s7: 48px; --pk-s8: 64px; --pk-s9: 96px;
  --pk-gutter: clamp(16px, 4vw, 40px);
  --pk-max: 1240px;
  --pk-measure: 66ch;
  --pk-header-h: 72px;

  /* shape */
  --pk-r-sm: 8px;      /* tags, small wells */
  --pk-r-input: 10px;
  --pk-r-card: 16px;
  --pk-r-panel: 24px;
  --pk-offset: 10px;   /* the signature hard shadow, used once per page */
}

/* ---------- 3. Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--pk-header-h) + 16px); /* WCAG 2.4.11: sticky header never hides focus */
}
body {
  margin: 0;
  background: var(--pk-paper);
  color: var(--pk-ink);
  font-family: var(--pk-font-body);
  font-size: var(--pk-t-body);
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
h1, h2, h3, h4 { margin: 0; font-family: var(--pk-font-display); color: var(--pk-ink); text-wrap: balance; }
h1 { font-size: var(--pk-t-display); font-weight: 800; line-height: 0.94; letter-spacing: -0.05em; }
h2 { font-size: var(--pk-t-h2); font-weight: 800; line-height: 1.02; letter-spacing: -0.04em; }
h3 { font-size: var(--pk-t-h3); font-weight: 700; line-height: 1.2; letter-spacing: -0.02em; }
p, ul, ol, dl, dd, figure { margin: 0; }
p { text-wrap: pretty; }
a { color: var(--pk-forest); text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { color: var(--pk-forest-deep); text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--pk-forest); outline-offset: 3px; border-radius: 4px; }
.pk-dark :focus-visible, .pk-result :focus-visible, .pk-footer :focus-visible { outline-color: var(--pk-lime); }
button, input, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }

.pk-num { font-family: var(--pk-font-mono); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.pk-skip {
  position: absolute; left: var(--pk-s4); top: -200px; z-index: 100;
  background: var(--pk-ink); color: #fff; padding: 12px 18px; border-radius: var(--pk-r-sm); font-weight: 600;
}
.pk-skip:focus { top: var(--pk-s3); color: #fff; }
.pk-visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- 4. Layout ---------- */
.pk-wrap { max-width: var(--pk-max); margin-inline: auto; padding-inline: var(--pk-gutter); }
.pk-section { padding-block: clamp(64px, 9vw, 112px); }
.pk-section--flush-top { padding-top: 0; }
.pk-head { display: grid; gap: var(--pk-s4); max-width: 760px; margin-bottom: clamp(28px, 4vw, 48px); }
.pk-head p { font-size: var(--pk-t-lede); line-height: 1.55; color: var(--pk-muted); max-width: 58ch; }
.pk-head--row {
  max-width: none; grid-template-columns: minmax(0, 1fr); align-items: end;
}
@media (min-width: 900px) {
  .pk-head--row { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); column-gap: var(--pk-s7); }
  .pk-head--row p { justify-self: end; max-width: 42ch; }
}
.pk-lede { font-size: var(--pk-t-lede); line-height: 1.55; color: var(--pk-muted); max-width: 52ch; }
.pk-dark { background: var(--pk-ink); color: var(--pk-on-dark); }
.pk-dark h2, .pk-dark h3 { color: #fff; }
.pk-dark a { color: #fff; }
.pk-dark .pk-head p { color: var(--pk-on-dark); }

/* ---------- 5. Header & mobile menu ---------- */
.pk-header {
  position: sticky; top: 0; z-index: 40;
  background: var(--pk-paper);
  border-bottom: 1px solid transparent;
  transition: border-color 150ms ease;
}
.pk-header.is-scrolled { border-bottom-color: var(--pk-line); }
.pk-header__bar { display: flex; align-items: center; gap: var(--pk-s5); min-height: var(--pk-header-h); }
.pk-logo { display: inline-flex; align-items: center; gap: 10px; color: var(--pk-ink); text-decoration: none; flex-shrink: 0; min-height: 44px; }
.pk-logo:hover { color: var(--pk-ink); }
.pk-logo__word { font-family: var(--pk-font-display); font-weight: 800; font-size: 1.5rem; letter-spacing: -0.04em; }
.pk-nav { margin-left: auto; }
.pk-nav__list { display: flex; gap: clamp(12px, 1.5vw, 24px); list-style: none; margin: 0; padding: 0; }
.pk-nav__list a {
  display: inline-flex; align-items: center; min-height: 44px; white-space: nowrap;
  color: var(--pk-ink); text-decoration: none; font-weight: 500; font-size: var(--pk-t-small);
  box-shadow: inset 0 -2px 0 transparent; transition: box-shadow 150ms ease;
}
.pk-nav__list a:hover { box-shadow: inset 0 -2px 0 var(--pk-ink); color: var(--pk-ink); }
.pk-nav__list a[aria-current="page"], .pk-nav__list a[aria-current="true"] { box-shadow: inset 0 -2px 0 var(--pk-forest); }
.pk-header__actions { display: flex; align-items: center; gap: var(--pk-s2); }
.pk-icon-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-width: 44px; min-height: 44px; padding: 0 14px;
  border: 1px solid var(--pk-line); border-radius: 999px; background: var(--pk-surface);
  color: var(--pk-ink); font-weight: 500; font-size: var(--pk-t-small); cursor: pointer;
}
.pk-icon-btn:hover { border-color: var(--pk-ink); }
.pk-icon-btn--bare { padding: 0; }
.pk-menu-btn { display: none; }
@media (max-width: 1079px) {
  .pk-nav { display: none; }
  .pk-menu-btn { display: inline-flex; }
  .pk-header__actions { margin-left: auto; }
  .pk-search-btn { padding: 0; }
  .pk-search-btn__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}

.pk-sheet {
  margin: 0; padding: 0 var(--pk-gutter) var(--pk-s6);
  width: 100%; max-width: 100%; height: 100%; max-height: 100%;
  border: 0; background: var(--pk-paper); color: var(--pk-ink);
}
.pk-sheet[open] { display: flex; flex-direction: column; }
.pk-sheet::backdrop { background: var(--pk-paper); }
.pk-sheet__top { display: flex; align-items: center; justify-content: space-between; min-height: var(--pk-header-h); }
.pk-sheet__list { list-style: none; margin: var(--pk-s4) 0 0; padding: 0; border-top: 1.5px solid var(--pk-ink); }
.pk-sheet__list a {
  display: flex; align-items: center; min-height: 60px; border-bottom: 1px solid var(--pk-line);
  font-family: var(--pk-font-display); font-weight: 700; font-size: 1.5rem; letter-spacing: -0.025em;
  color: var(--pk-ink); text-decoration: none;
}
.pk-sheet__list a[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--pk-forest); text-underline-offset: 6px; text-decoration-thickness: 3px; }
.pk-sheet__foot { margin-top: auto; padding-top: var(--pk-s6); font-size: var(--pk-t-small); color: var(--pk-muted); }

/* ---------- 6. Search dialog ---------- */
.pk-search {
  width: min(640px, calc(100vw - 32px)); max-height: min(600px, calc(100dvh - 48px));
  margin: max(24px, 8vh) auto auto; padding: 0; overflow: hidden;
  border: 1.5px solid var(--pk-ink); border-radius: var(--pk-r-panel);
  background: var(--pk-surface); color: var(--pk-ink);
  box-shadow: 8px 8px 0 var(--pk-ink);
}
.pk-search[open] { display: flex; flex-direction: column; }
.pk-search::backdrop { background: rgba(11, 31, 26, 0.5); }
.pk-search__form { display: flex; align-items: center; gap: var(--pk-s3); padding: var(--pk-s3) var(--pk-s3) var(--pk-s3) var(--pk-s5); border-bottom: 1px solid var(--pk-line); }
.pk-search__input {
  flex: 1; min-width: 0; min-height: 48px; border: 0; background: transparent;
  font-size: 1.25rem; font-weight: 500;
}
.pk-search__input:focus { outline: none; }
.pk-search__input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
.pk-search__form:focus-within { box-shadow: inset 0 -2px 0 var(--pk-forest); }
.pk-search__body { overflow-y: auto; padding: var(--pk-s2); }
.pk-search__heading { padding: var(--pk-s3) var(--pk-s4) var(--pk-s1); font-size: var(--pk-t-micro); font-weight: 600; color: var(--pk-muted); }
.pk-search__results { list-style: none; margin: 0; padding: 0; }
.pk-search__results a {
  display: grid; gap: 2px; padding: 12px 16px; border-radius: 12px; text-decoration: none; color: var(--pk-ink);
}
.pk-search__results a:hover, .pk-search__results a:focus-visible { background: var(--pk-paper-deep); }
.pk-search__results a:focus-visible { outline-offset: -3px; }
.pk-search__title { font-weight: 600; }
.pk-search__title mark { background: var(--pk-lime); color: var(--pk-ink); border-radius: 3px; padding: 0 2px; }
.pk-search__meta { font-size: var(--pk-t-small); color: var(--pk-muted); }
.pk-search__state { padding: var(--pk-s5) var(--pk-s4); color: var(--pk-muted); display: grid; gap: var(--pk-s3); }
.pk-search__state strong { color: var(--pk-ink); }
.pk-search__suggest { display: flex; flex-wrap: wrap; gap: var(--pk-s2); }
.pk-chip {
  min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--pk-line);
  background: var(--pk-white); cursor: pointer; font-weight: 500; color: var(--pk-ink);
}
.pk-chip:hover { border-color: var(--pk-ink); }
.pk-search__foot { padding: var(--pk-s3) var(--pk-s5); border-top: 1px solid var(--pk-line); font-size: var(--pk-t-micro); color: var(--pk-muted); }
.pk-spinner {
  width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--pk-line); border-top-color: var(--pk-forest);
  animation: pk-spin 800ms linear infinite; display: inline-block; vertical-align: -3px; margin-right: 8px;
}
@keyframes pk-spin { to { transform: rotate(360deg); } }

/* ---------- 7. Buttons & links ---------- */
.pk-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 24px; border-radius: 999px; border: 1.5px solid var(--pk-ink);
  font-weight: 600; font-size: 1rem; text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color 150ms ease, color 150ms ease, border-color 150ms ease;
}
.pk-btn--primary { background: var(--pk-ink); color: #fff; }
.pk-btn--primary:hover { background: var(--pk-forest); border-color: var(--pk-forest); color: #fff; text-decoration: none; }
.pk-btn--secondary { background: transparent; color: var(--pk-ink); }
.pk-btn--secondary:hover { background: var(--pk-surface); color: var(--pk-ink); text-decoration: none; }
.pk-btn-row { display: flex; flex-wrap: wrap; gap: var(--pk-s3); }
.pk-link-strong { font-weight: 600; display: inline-flex; align-items: center; min-height: 44px; }
.pk-textbtn {
  background: none; border: 0; padding: 0 4px; min-height: 44px; cursor: pointer;
  font-weight: 600; color: var(--pk-forest); text-decoration: underline; text-underline-offset: 0.2em;
}
.pk-textbtn:hover { color: var(--pk-forest-deep); text-decoration-thickness: 2px; }

/* ---------- 8. Fields & validation ---------- */
.pk-field { display: grid; gap: 6px; min-width: 0; }
.pk-field > label { font-size: var(--pk-t-small); font-weight: 600; color: var(--pk-ink); }
.pk-field__opt { font-weight: 500; color: var(--pk-muted); }
.pk-field__hint { font-size: var(--pk-t-micro); line-height: 1.45; color: var(--pk-muted); }
.pk-field__error {
  display: flex; gap: 6px; align-items: flex-start;
  font-size: var(--pk-t-micro); line-height: 1.45; font-weight: 600; color: var(--pk-error);
}
.pk-field__error svg { flex-shrink: 0; margin-top: 2px; }

.pk-input {
  display: flex; align-items: center; gap: 6px; min-height: 48px; padding: 0 14px;
  border: 1.5px solid var(--pk-line-strong); border-radius: var(--pk-r-input); background: var(--pk-white);
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
.pk-input:hover { border-color: var(--pk-muted); }
.pk-input:focus-within { border-color: var(--pk-ink); box-shadow: 0 0 0 3px rgba(20, 81, 63, 0.28); }
.pk-input__affix { font-family: var(--pk-font-mono); font-weight: 500; color: var(--pk-muted); flex-shrink: 0; }
.pk-input input {
  flex: 1; min-width: 0; width: 100%; border: 0; background: transparent; outline: none;
  font-family: var(--pk-font-mono); font-variant-numeric: tabular-nums; font-size: 1.0625rem; font-weight: 500; padding: 11px 0;
}
.pk-input input::placeholder { color: #7C8781; opacity: 1; }
.pk-input--lg { min-height: 64px; border-color: var(--pk-ink); }
.pk-input--lg input, .pk-input--lg .pk-input__affix { font-size: 1.75rem; font-weight: 600; }
.pk-field.is-invalid .pk-input { border-color: var(--pk-error); background: var(--pk-error-bg); }
.pk-field.is-invalid .pk-input:focus-within { box-shadow: 0 0 0 3px rgba(163, 50, 26, 0.25); }

/* ---------- 9. Tags & notices ---------- */
.pk-tag {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px;
  font-size: var(--pk-t-micro); font-weight: 600; line-height: 1.5;
  border: 1px solid var(--pk-line); color: var(--pk-muted); background: transparent; white-space: nowrap;
}
.pk-tag--example { background: var(--pk-paper-deep); border-color: transparent; color: var(--pk-ink); }
.pk-tag--yours { border-color: var(--pk-forest); color: var(--pk-forest); }
.pk-tag--yours::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--pk-forest); }
.pk-notice {
  display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 10px; align-items: start;
  padding: 14px 16px; border-radius: 12px; font-size: var(--pk-t-small); line-height: 1.5;
}
.pk-notice svg { margin-top: 2px; }
.pk-notice--on-dark { background: var(--pk-ink-2); color: var(--pk-on-dark); }
.pk-notice--on-dark strong { color: #fff; }
.pk-notice--warn-dark { background: #3A2219; color: #FFE1D2; }
.pk-notice--warn-dark strong { color: #fff; }
.pk-notice--ok-dark { background: #213D20; color: #E6F5C8; }

/* ---------- 10. Hero ---------- */
.pk-hero { padding-block: clamp(24px, 5vw, 64px) clamp(64px, 9vw, 112px); }
.pk-hero__grid { display: grid; gap: clamp(40px, 6vw, 72px); grid-template-columns: minmax(0, 1fr); align-items: start; }
.pk-hero__copy { display: grid; gap: var(--pk-s5); align-content: start; }
.pk-hero__copy h1 { max-width: 12ch; }
.pk-hl {
  background: var(--pk-lime); color: inherit; padding: 0 0.1em; margin-inline: -0.02em; border-radius: 0.14em;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
.pk-hero__points { list-style: none; padding: var(--pk-s5) 0 0; margin-top: var(--pk-s2); border-top: 1px solid var(--pk-line); display: grid; gap: var(--pk-s3); font-size: var(--pk-t-small); }
.pk-hero__points li { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 12px; align-items: start; color: var(--pk-ink); }
.pk-hero__points svg { margin-top: 3px; }
@media (min-width: 1080px) {
  .pk-hero__grid { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
  .pk-hero__copy { padding-top: var(--pk-s7); }
}

/* ---------- 11. Money planner ---------- */
.pk-planner {
  background: var(--pk-surface); border: 1.5px solid var(--pk-ink); border-radius: var(--pk-r-panel);
  box-shadow: var(--pk-offset) var(--pk-offset) 0 var(--pk-ink);
  display: grid; overflow: hidden; min-width: 0;
}
.pk-planner__top {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--pk-s3);
  padding: var(--pk-s4) var(--pk-s5); border-bottom: 1px solid var(--pk-line);
}
.pk-planner__title { font-size: 1.125rem; letter-spacing: -0.015em; }

/* tabs */
.pk-tabs { display: inline-flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--pk-paper-deep); }
.pk-tab {
  min-height: 40px; padding: 0 16px; border: 0; border-radius: 999px; background: transparent;
  font-weight: 600; font-size: var(--pk-t-small); color: var(--pk-muted); cursor: pointer;
}
.pk-tab:hover { color: var(--pk-ink); }
.pk-tab[aria-selected="true"] { background: var(--pk-ink); color: #fff; }
.pk-tab:focus-visible { outline-offset: 1px; }

.pk-panel { display: grid; gap: var(--pk-s5); padding: var(--pk-s5); scroll-margin-top: calc(var(--pk-header-h) + 72px); }
.pk-panel:focus-visible { outline-offset: -4px; }
@media (min-width: 760px) {
  .pk-panel { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
}
.pk-panel__inputs { display: grid; gap: var(--pk-s3); min-width: 0; }
.pk-panel__inputs > .pk-field:first-child { margin-bottom: var(--pk-s2); }
.pk-panel__group {
  font-size: var(--pk-t-small); font-weight: 600; color: var(--pk-muted);
  padding-top: var(--pk-s3); border-top: 1px solid var(--pk-line);
}
/* compact rows: label + hint on the left, amount on the right */
.pk-field--row { grid-template-columns: minmax(0, 1fr) 140px; column-gap: var(--pk-s3); row-gap: 2px; align-items: center; }
.pk-field--row > label { grid-column: 1; grid-row: 1; align-self: end; }
.pk-field--row > .pk-field__hint { grid-column: 1; grid-row: 2; align-self: start; }
.pk-field--row > .pk-input { grid-column: 2; grid-row: 1 / span 2; min-height: 46px; }
.pk-field--row > .pk-field__error { grid-column: 1 / -1; grid-row: 3; margin-top: 4px; }
@media (max-width: 400px) { .pk-field--row { grid-template-columns: minmax(0, 1fr) 124px; } }

.pk-panel__foot {
  grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--pk-s2) var(--pk-s4);
  margin: 0 calc(var(--pk-s5) * -1) calc(var(--pk-s5) * -1); padding: 4px var(--pk-s5);
  border-top: 1px solid var(--pk-line); background: var(--pk-paper-deep);
  font-size: var(--pk-t-micro); color: var(--pk-muted);
}
.pk-panel__actions { display: flex; gap: var(--pk-s3); }

/* result panel (ink) */
.pk-result {
  background: var(--pk-ink); color: var(--pk-on-dark); border-radius: var(--pk-r-card);
  padding: var(--pk-s5); display: grid; gap: var(--pk-s4); align-content: start; min-width: 0;
}
.pk-result h3, .pk-result strong { color: #fff; }
.pk-result a { color: #fff; }
.pk-result a:hover { color: var(--pk-lime); }
.pk-result__label { font-size: var(--pk-t-small); color: var(--pk-on-dark-muted); }
.pk-result__figure { font-size: clamp(2.5rem, 1.9rem + 2.6vw, 3.5rem); font-weight: 600; line-height: 1; color: var(--pk-lime); overflow-wrap: anywhere; }
.pk-result__figure--words { font-family: var(--pk-font-display); font-weight: 800; letter-spacing: -0.035em; font-size: clamp(2rem, 1.6rem + 1.8vw, 2.75rem); }
.pk-result__figure.is-negative { color: var(--pk-warn-on-dark); }
.pk-result__sub { font-size: var(--pk-t-small); color: var(--pk-on-dark); }
.pk-result__empty { display: grid; gap: var(--pk-s3); }
.pk-result__empty p { font-size: var(--pk-t-small); }
.pk-result__empty .pk-result__empty-title { font-family: var(--pk-font-display); font-weight: 700; font-size: 1.375rem; letter-spacing: -0.02em; color: #fff; line-height: 1.2; }

.pk-bar { display: flex; gap: 2px; height: 16px; border-radius: 999px; overflow: hidden; background: var(--pk-ink-2); }
.pk-bar > span { display: block; height: 100%; min-width: 0; transition: width 220ms ease; }
.pk-legend { list-style: none; padding: 0; display: grid; gap: 0; font-size: var(--pk-t-small); }
.pk-legend li { display: flex; justify-content: space-between; gap: var(--pk-s2); padding: 7px 0; border-top: 1px solid var(--pk-line-dark); }
.pk-legend__name { display: inline-flex; gap: 10px; align-items: center; }
.pk-legend__name i { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.pk-legend b { font-weight: 500; color: #fff; }

.pk-split { display: grid; gap: var(--pk-s3); padding-top: var(--pk-s4); border-top: 1px solid var(--pk-line-dark); }
.pk-split__title { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--pk-s2); font-size: var(--pk-t-small); color: #fff; font-weight: 600; }
.pk-split__title a { font-weight: 500; color: var(--pk-on-dark); }
.pk-split__row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px var(--pk-s3); align-items: center; font-size: var(--pk-t-small); }
.pk-split__val { color: #fff; }
.pk-split__val small { color: var(--pk-on-dark-muted); font-family: var(--pk-font-body); font-size: var(--pk-t-micro); letter-spacing: 0; }
.pk-split__track { grid-column: 1 / -1; position: relative; height: 8px; border-radius: 999px; background: var(--pk-ink-2); }
.pk-split__fill { position: absolute; inset: 0 auto 0 0; border-radius: 999px; background: var(--pk-on-dark); transition: width 220ms ease; }
.pk-split__mark { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--pk-lime); }

/* savings progress */
.pk-progress { display: grid; gap: 8px; }
.pk-progress__track { height: 12px; border-radius: 999px; background: var(--pk-ink-2); overflow: hidden; }
.pk-progress__fill { height: 100%; background: var(--pk-lime); border-radius: 999px; transition: width 220ms ease; }
.pk-progress__label { display: flex; justify-content: space-between; gap: var(--pk-s2); font-size: var(--pk-t-small); }
.pk-kv { display: grid; gap: 0; font-size: var(--pk-t-small); }
.pk-kv div { display: flex; justify-content: space-between; gap: var(--pk-s3); padding: 7px 0; border-top: 1px solid var(--pk-line-dark); }
.pk-kv dt { color: var(--pk-on-dark); }
.pk-kv dd { color: #fff; }
.pk-result__note { font-size: var(--pk-t-micro); line-height: 1.5; color: var(--pk-on-dark-muted); }

/* ---------- 12. Tool shelf (homepage) ---------- */
.pk-shelf { display: grid; grid-template-columns: minmax(0, 1fr); border-top: 1.5px solid var(--pk-ink); }
@media (min-width: 680px) { .pk-shelf { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1080px) { .pk-shelf { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.pk-shelf__cat { display: grid; grid-template-rows: auto auto auto 1fr auto; gap: var(--pk-s3); padding: var(--pk-s5) var(--pk-s5) var(--pk-s5) 0; border-bottom: 1px solid var(--pk-line); }
@media (min-width: 680px) {
  .pk-shelf__cat:nth-child(2n) { padding-left: var(--pk-s5); border-left: 1px solid var(--pk-line); }
}
@media (min-width: 1080px) {
  .pk-shelf__cat { border-bottom: 0; }
  .pk-shelf__cat:nth-child(n+2) { padding-left: var(--pk-s5); border-left: 1px solid var(--pk-line); }
}
.pk-shelf__icon { width: 40px; height: 40px; border-radius: 12px; background: var(--pk-paper-deep); color: var(--pk-forest); display: flex; align-items: center; justify-content: center; }
.pk-shelf__cat > p { color: var(--pk-muted); font-size: var(--pk-t-small); }
.pk-shelf__list { list-style: none; padding: 0; margin-top: var(--pk-s2); display: grid; align-content: start; }
.pk-shelf__list li { border-top: 1px solid var(--pk-line); }
.pk-shelf__tool { display: flex; justify-content: space-between; align-items: center; gap: var(--pk-s2); min-height: 52px; padding: 8px 0; font-weight: 600; font-size: var(--pk-t-small); }
a.pk-shelf__tool { color: var(--pk-ink); text-decoration: none; }
a.pk-shelf__tool:hover { color: var(--pk-forest); text-decoration: underline; text-underline-offset: 0.2em; }
a.pk-shelf__tool svg { flex-shrink: 0; color: var(--pk-forest); }
.pk-shelf__tool--soon { color: var(--pk-muted); font-weight: 500; }
.pk-shelf__more { font-size: var(--pk-t-small); font-weight: 600; display: inline-flex; align-items: center; min-height: 44px; }

.pk-paystrip {
  margin-top: var(--pk-s6); display: grid; gap: var(--pk-s4); align-items: center;
  grid-template-columns: minmax(0, 1fr); padding: var(--pk-s5); border-radius: var(--pk-r-card); background: var(--pk-paper-deep);
}
@media (min-width: 860px) { .pk-paystrip { grid-template-columns: minmax(0, 1fr) auto; } }
.pk-paystrip p { color: var(--pk-muted); font-size: var(--pk-t-small); max-width: 60ch; }
.pk-paystrip strong { color: var(--pk-ink); display: block; font-size: 1.0625rem; margin-bottom: 2px; }

/* ---------- 13. Guides (editorial) ---------- */
.pk-guides { display: grid; gap: clamp(32px, 5vw, 64px); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 980px) { .pk-guides { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); } }
.pk-lead { display: grid; gap: var(--pk-s5); align-content: start; }
.pk-lead__meta { font-size: var(--pk-t-small); color: var(--pk-muted); }
.pk-lead__meta strong { color: var(--pk-forest); font-weight: 600; }
.pk-lead h3 { font-size: clamp(1.875rem, 1.35rem + 2vw, 2.75rem); font-weight: 800; line-height: 1.02; letter-spacing: -0.04em; max-width: 18ch; }
.pk-lead__body { display: grid; gap: var(--pk-s4); max-width: var(--pk-measure); }
.pk-lead__body p:first-child { font-size: var(--pk-t-lede); line-height: 1.55; }
.pk-figure {
  display: grid; gap: var(--pk-s3); padding: var(--pk-s5); border-radius: var(--pk-r-card);
  border: 1px solid var(--pk-line); background: var(--pk-surface);
}
.pk-figure__row { display: grid; grid-template-columns: 112px minmax(0, 1fr) 64px; gap: var(--pk-s3); align-items: center; font-size: var(--pk-t-small); }
.pk-figure__bar { height: 26px; border-radius: 6px; }
.pk-figure__amt { text-align: right; }
.pk-figure figcaption { font-size: var(--pk-t-micro); color: var(--pk-muted); }
@media (max-width: 420px) { .pk-figure__row { grid-template-columns: 84px minmax(0, 1fr) 56px; } }
.pk-pull {
  font-family: var(--pk-font-display); font-weight: 700; font-size: clamp(1.25rem, 1.1rem + 0.6vw, 1.5rem);
  line-height: 1.25; letter-spacing: -0.02em; padding-left: var(--pk-s5); border-left: 3px solid var(--pk-lime);
  max-width: 34ch;
}

.pk-aside { display: grid; gap: var(--pk-s6); align-content: start; }
.pk-aside h3 { font-size: 1.125rem; }
.pk-upnext { list-style: none; padding: 0; border-top: 1.5px solid var(--pk-ink); }
.pk-upnext li { display: grid; gap: 4px; padding: var(--pk-s4) 0; border-bottom: 1px solid var(--pk-line); }
.pk-upnext__top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--pk-s2); }
.pk-upnext__cat { font-size: var(--pk-t-micro); font-weight: 600; color: var(--pk-forest); }
.pk-upnext h4 { font-size: 1.1875rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.25; }
.pk-upnext p { font-size: var(--pk-t-small); color: var(--pk-muted); }

.pk-jargon { display: grid; gap: 0; border-top: 1.5px solid var(--pk-ink); }
.pk-jargon div { padding: var(--pk-s4) 0; border-bottom: 1px solid var(--pk-line); display: grid; gap: 4px; }
.pk-jargon dt { font-weight: 700; font-family: var(--pk-font-display); font-size: 1.0625rem; letter-spacing: -0.01em; }
.pk-jargon dd { font-size: var(--pk-t-small); color: var(--pk-muted); }

/* ---------- 14. Help band ---------- */
.pk-help-grid { display: grid; grid-template-columns: minmax(0, 1fr); border-top: 1.5px solid var(--pk-line-dark); }
@media (min-width: 680px) { .pk-help-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--pk-s6); } }
@media (min-width: 1080px) { .pk-help-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.pk-help { display: grid; gap: 6px; align-content: start; padding: var(--pk-s5) 0; border-bottom: 1px solid var(--pk-line-dark); text-decoration: none; }
.pk-dark a.pk-help { color: var(--pk-on-dark); }
.pk-help__name { display: flex; align-items: center; gap: 8px; font-family: var(--pk-font-display); font-size: 1.25rem; font-weight: 700; letter-spacing: -0.02em; color: #fff; }
.pk-help__name svg { flex-shrink: 0; }
.pk-help__desc { font-size: var(--pk-t-small); line-height: 1.5; }
.pk-help__src { font-size: var(--pk-t-micro); color: var(--pk-on-dark-muted); }
a.pk-help:hover .pk-help__name { text-decoration: underline; text-decoration-color: var(--pk-lime); text-underline-offset: 0.2em; }
.pk-help-nations { margin-top: var(--pk-s5); font-size: var(--pk-t-small); }

/* ---------- 15. Facts ---------- */
.pk-facts { display: grid; gap: var(--pk-s5); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 860px) { .pk-facts { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--pk-s6); } }
.pk-fact { display: grid; gap: var(--pk-s3); align-content: start; padding-top: var(--pk-s4); border-top: 1.5px solid var(--pk-ink); }
.pk-fact .pk-fact__figure { color: var(--pk-ink); font-size: clamp(2.25rem, 1.8rem + 1.8vw, 3rem); font-weight: 600; line-height: 1; }
.pk-fact__figure small { font-family: var(--pk-font-body); font-size: 1rem; font-weight: 500; color: var(--pk-muted); letter-spacing: 0; }
.pk-fact p { font-size: var(--pk-t-small); color: var(--pk-muted); }
.pk-fact__src { font-size: var(--pk-t-micro); display: inline-flex; align-items: center; min-height: 32px; }

/* ---------- 16. Trust ---------- */
.pk-trust { display: grid; grid-template-columns: minmax(0, 1fr); border-radius: var(--pk-r-panel); overflow: hidden; border: 1px solid var(--pk-line); background: var(--pk-surface); }
@media (min-width: 980px) { .pk-trust { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); } }
.pk-trust__intro { display: grid; gap: var(--pk-s4); align-content: start; padding: clamp(24px, 4vw, 44px); background: var(--pk-paper-deep); }
.pk-trust__intro h2 { font-size: clamp(1.75rem, 1.3rem + 1.6vw, 2.375rem); }
.pk-trust__intro p { color: var(--pk-muted); }
.pk-trust__list { list-style: none; margin: 0; padding: clamp(8px, 2vw, 16px) clamp(24px, 4vw, 44px); }
.pk-trust__list li { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: var(--pk-s3); padding: 18px 0; border-bottom: 1px solid var(--pk-line); }
.pk-trust__list li:last-child { border-bottom: 0; }
.pk-trust__list strong { display: block; font-weight: 600; }
.pk-trust__list span { color: var(--pk-muted); font-size: var(--pk-t-small); }

/* ---------- 17. Inner pages ---------- */
.pk-page-hero { padding-block: clamp(24px, 4vw, 56px) clamp(32px, 5vw, 56px); border-bottom: 1px solid var(--pk-line); }
.pk-page-hero__inner { display: grid; gap: var(--pk-s4); max-width: 780px; }
.pk-crumbs { font-size: var(--pk-t-small); color: var(--pk-muted); }
.pk-crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; }
.pk-crumbs li + li::before { content: "/"; margin-right: 8px; color: var(--pk-line-strong); }
.pk-jump { display: flex; flex-wrap: wrap; gap: var(--pk-s2); margin-top: var(--pk-s2); }
.pk-jump a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; border-radius: 999px;
  border: 1px solid var(--pk-line); background: var(--pk-surface); color: var(--pk-ink); text-decoration: none; font-weight: 500; font-size: var(--pk-t-small);
}
.pk-jump a:hover { border-color: var(--pk-ink); color: var(--pk-ink); }
.pk-group { display: grid; gap: var(--pk-s5); grid-template-columns: minmax(0, 1fr); scroll-margin-top: calc(var(--pk-header-h) + 24px); }
@media (min-width: 980px) { .pk-group { grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: var(--pk-s7); } }
.pk-group + .pk-group { margin-top: clamp(48px, 6vw, 80px); }
.pk-group__head { display: grid; gap: var(--pk-s3); align-content: start; }
.pk-group__head p { color: var(--pk-muted); }

.pk-dir { list-style: none; padding: 0; border-top: 1.5px solid var(--pk-ink); }
.pk-dir li { border-bottom: 1px solid var(--pk-line); }
.pk-dir__item {
  display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: var(--pk-s4); align-items: center;
  min-height: 88px; padding: 18px 4px; color: var(--pk-ink); text-decoration: none;
}
a.pk-dir__item:hover { color: var(--pk-ink); }
a.pk-dir__item:hover .pk-dir__name { text-decoration: underline; text-underline-offset: 0.2em; }
a.pk-dir__item:hover .pk-dir__go { background: var(--pk-ink); color: #fff; border-color: var(--pk-ink); }
.pk-dir__icon { width: 44px; height: 44px; border-radius: 12px; background: var(--pk-paper-deep); color: var(--pk-forest); display: flex; align-items: center; justify-content: center; }
.pk-dir__name { display: block; font-family: var(--pk-font-display); font-weight: 700; font-size: 1.1875rem; letter-spacing: -0.02em; }
.pk-dir__desc { display: block; font-size: var(--pk-t-small); color: var(--pk-muted); line-height: 1.45; }
.pk-dir__go { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--pk-line); display: flex; align-items: center; justify-content: center; transition: background-color 150ms ease, color 150ms ease; }
.pk-dir__item--soon .pk-dir__name { color: var(--pk-muted); }
.pk-dir__item--soon .pk-dir__icon { background: transparent; border: 1px dashed var(--pk-line-strong); color: var(--pk-muted); }

/* ---------- 18. Footer ---------- */
.pk-footer { background: var(--pk-ink); color: var(--pk-on-dark); padding-block: clamp(56px, 7vw, 88px) var(--pk-s6); }
.pk-footer a { color: var(--pk-on-dark); text-decoration: none; }
.pk-footer a:hover { color: #fff; text-decoration: underline; }
.pk-footer__top { display: grid; gap: var(--pk-s7); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1080px) { .pk-footer__top { grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); } }
.pk-footer__brand { display: grid; gap: var(--pk-s4); align-content: start; max-width: 380px; }
.pk-footer__brand .pk-logo { color: #fff; }
.pk-footer__brand p { font-size: var(--pk-t-small); color: var(--pk-on-dark-muted); }
.pk-footer .pk-footer__sister { display: grid; gap: 4px; padding: var(--pk-s4); border: 1px solid var(--pk-line-dark); border-radius: var(--pk-r-card); font-size: var(--pk-t-small); }
.pk-footer .pk-footer__sister:hover { border-color: var(--pk-on-dark-muted); text-decoration: none; }
.pk-footer__sister strong { color: #fff; }
.pk-footer__cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--pk-s6) var(--pk-s5); }
@media (min-width: 680px) { .pk-footer__cols { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1080px) { .pk-footer__cols { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.pk-footer__col h2 { font-family: var(--pk-font-body); font-size: var(--pk-t-small); font-weight: 600; letter-spacing: 0; color: #fff; margin-bottom: var(--pk-s2); }
.pk-footer__col ul { list-style: none; padding: 0; display: grid; font-size: var(--pk-t-small); }
.pk-footer__col a { display: inline-flex; align-items: center; min-height: 36px; }
@media (max-width: 679px) { .pk-footer__col a { min-height: 44px; } }
.pk-footer__legal {
  display: grid; gap: var(--pk-s3); margin-top: var(--pk-s7); padding-top: var(--pk-s5);
  border-top: 1px solid var(--pk-line-dark); font-size: var(--pk-t-micro); line-height: 1.6; color: var(--pk-on-dark-muted);
}
.pk-footer__legal ul { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 0 var(--pk-s5); }
.pk-footer__legal a { color: var(--pk-on-dark-muted); display: inline-flex; min-height: 44px; align-items: center; }
.pk-footer__legal p { max-width: 90ch; }

/* ---------- 19. Motion, no-JS, print ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
@media (max-width: 639px) { :root { --pk-offset: 6px; } }

.no-js .pk-js-only { display: none !important; }
@media (max-width: 1079px) {
  .no-js .pk-header__bar { flex-wrap: wrap; }
  .no-js .pk-nav { display: block; order: 3; width: 100%; margin: 0 calc(var(--pk-gutter) * -1); padding: 0 var(--pk-gutter) var(--pk-s2); overflow-x: auto; }
}
.pk-noscript { margin: 0 var(--pk-s5) var(--pk-s5); padding: 14px 16px; border-radius: 12px; background: var(--pk-paper-deep); font-size: var(--pk-t-small); }

@media print {
  .pk-header, .pk-footer, .pk-dark, .pk-skip, .pk-panel__foot, .pk-tabs { display: none !important; }
  body { background: #fff; }
  .pk-planner { box-shadow: none; }
}

/* stack utility used inside result panels */
.pk-stack { display: grid; gap: var(--pk-s4); }

/* phone-only live summary: stays in view while the inputs scroll, then sits above the full result */
.pk-peek { display: none; }
@media (max-width: 759px) {
  .pk-peek {
    position: sticky; bottom: 12px; z-index: 5;
    display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px;
    min-height: 56px; padding: 10px 16px; border-radius: 14px;
    background: var(--pk-ink); color: var(--pk-on-dark); text-decoration: none; font-size: var(--pk-t-small);
    box-shadow: 0 0 0 3px var(--pk-surface);
  }
  .pk-peek:hover { color: var(--pk-on-dark); }
  .pk-peek b { color: var(--pk-lime); font-size: 1.125rem; font-weight: 600; }
  .pk-peek b.is-negative { color: var(--pk-warn-on-dark); }
  .pk-peek__go { margin-left: auto; color: #fff; font-weight: 600; text-decoration: underline; text-underline-offset: 0.2em; }
  .pk-peek:focus-visible { outline-color: var(--pk-forest); }
}
.pk-result:focus { outline: none; }
.pk-result:focus-visible { outline: 3px solid var(--pk-forest); outline-offset: 3px; }

/* =====================================================================
   20. Tool pages (budget planner and later calculators)
   ===================================================================== */
.pk-meta { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: var(--pk-s2) var(--pk-s5); font-size: var(--pk-t-small); color: var(--pk-muted); }
.pk-meta li { display: inline-flex; align-items: center; gap: 8px; }
.pk-meta svg { width: 18px; height: 18px; color: var(--pk-forest); }

.pk-section--tool { padding-block: clamp(24px, 4vw, 48px) clamp(64px, 9vw, 112px); }
.pk-app { display: grid; gap: clamp(24px, 4vw, 48px); grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 1080px) { .pk-app { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); } }
.pk-app__inputs { display: grid; gap: var(--pk-s5); min-width: 0; }
.pk-app__bar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--pk-s2) var(--pk-s4);
  padding: 4px 4px 4px 0; border-bottom: 1px solid var(--pk-line);
}
.pk-app__intro { color: var(--pk-muted); font-size: var(--pk-t-small); max-width: 62ch; }
.pk-app__result { min-width: 0; }
@media (min-width: 1080px) and (min-height: 940px) {
  .pk-app__result { position: sticky; top: calc(var(--pk-header-h) + 16px); }
}
.pk-app .pk-result { border-radius: var(--pk-r-panel); box-shadow: var(--pk-offset) var(--pk-offset) 0 var(--pk-lime); }
@media (max-width: 1079px) { .pk-app .pk-result { box-shadow: none; } }
.pk-result__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--pk-s3); }
.pk-result__title { font-size: 1.25rem; color: #fff; }

/* fieldsets */
.pk-fs { margin: 0; padding: 0; border: 0; min-width: 0; display: grid; gap: 0; }
.pk-fs > legend {
  float: left; width: 100%; padding: 0 0 var(--pk-s3); margin-bottom: 4px; border-bottom: 1.5px solid var(--pk-ink);
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--pk-s2);
}
.pk-fs > legend + * { clear: both; }
.pk-fs__title { display: inline-flex; align-items: center; gap: 10px; font-family: var(--pk-font-display); font-weight: 700; font-size: 1.375rem; letter-spacing: -0.02em; }
.pk-fs__total { font-size: var(--pk-t-small); color: var(--pk-muted); font-weight: 500; }
.pk-fs__hint { font-size: var(--pk-t-small); color: var(--pk-muted); padding: var(--pk-s3) 0 0; }
.pk-swatch { width: 12px; height: 12px; border-radius: 4px; flex-shrink: 0; box-shadow: inset 0 0 0 1px rgba(11, 31, 26, 0.3); }

/* one budget line: text left, amount + frequency right */
.pk-line {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px var(--pk-s4);
  padding: var(--pk-s4) 0; border-bottom: 1px solid var(--pk-line); align-items: center;
}
@media (min-width: 620px) { .pk-line { grid-template-columns: minmax(0, 1fr) minmax(0, 300px); } }
.pk-line__text { display: grid; gap: 2px; min-width: 0; }
.pk-line__text label { font-weight: 600; font-size: var(--pk-t-small); }
.pk-line__controls { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 148px); gap: 8px; }
.pk-line .pk-field__error { grid-column: 1 / -1; }
.pk-line .pk-input { min-height: 46px; }
.pk-line.is-invalid .pk-input { border-color: var(--pk-error); background: var(--pk-error-bg); }
.pk-select {
  min-height: 46px; width: 100%; padding: 0 34px 0 12px; border: 1.5px solid var(--pk-line-strong); border-radius: var(--pk-r-input);
  background: var(--pk-white) 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.5l5 5 5-5' fill='none' stroke='%230B1F1A' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 12px center;
  -webkit-appearance: none; appearance: none; font-size: var(--pk-t-small); font-weight: 500; color: var(--pk-ink); cursor: pointer;
}
.pk-select:hover { border-color: var(--pk-muted); }
.pk-select:focus-visible { outline: none; border-color: var(--pk-ink); box-shadow: 0 0 0 3px rgba(20, 81, 63, 0.28); }

/* monthly / annual switch on the ink result panel */
.pk-seg { margin: 0; padding: 4px; border: 0; display: inline-flex; gap: 4px; border-radius: 999px; background: var(--pk-ink-2); min-width: 0; }
.pk-seg input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.pk-seg label { display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px; border-radius: 999px; font-weight: 600; font-size: var(--pk-t-small); color: var(--pk-on-dark); cursor: pointer; }
.pk-seg label:hover { color: #fff; }
.pk-seg input:checked + label { background: var(--pk-lime); color: var(--pk-ink); }
.pk-seg input:focus-visible + label { outline: 3px solid var(--pk-lime); outline-offset: 2px; }
.pk-legend--2col { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--pk-s5); }
@media (max-width: 420px) { .pk-legend--2col { grid-template-columns: minmax(0, 1fr); } }

/* waterfall chart */
.pk-wf { display: grid; gap: var(--pk-s4); padding: clamp(20px, 3vw, 32px); border: 1px solid var(--pk-line); border-radius: var(--pk-r-panel); background: var(--pk-surface); }
.pk-wf__rows { display: grid; gap: 6px; }
.pk-wf__row { display: grid; grid-template-columns: 132px minmax(0, 1fr) 104px; gap: var(--pk-s3); align-items: center; min-height: 36px; font-size: var(--pk-t-small); }
.pk-wf__label { font-weight: 600; }
.pk-wf__track { position: relative; height: 28px; }
.pk-wf__zero { position: absolute; top: -4px; bottom: -4px; width: 1.5px; background: var(--pk-ink); }
.pk-wf__bar { position: absolute; top: 0; bottom: 0; border-radius: 4px; box-shadow: inset 0 0 0 1px rgba(11, 31, 26, 0.35); min-width: 2px; transition: left 220ms ease, width 220ms ease; }
.pk-wf__bar::before { content: ""; position: absolute; top: -6px; bottom: -6px; left: 0; border-left: 1px dashed var(--pk-line-strong); }
.pk-wf__row--total .pk-wf__bar::before { display: none; }
.pk-wf__amt { text-align: right; font-weight: 500; }
.pk-wf__row--total .pk-wf__label, .pk-wf__row--total .pk-wf__amt { font-weight: 700; }
.pk-wf__row--total + .pk-wf__row, .pk-wf__row--left { border-top: 1px solid var(--pk-line); padding-top: 6px; }
.pk-wf__amt.is-negative { color: var(--pk-error); }
.pk-wf figcaption, .pk-wf__empty { font-size: var(--pk-t-micro); color: var(--pk-muted); }
@media (max-width: 560px) { .pk-wf__row { grid-template-columns: 92px minmax(0, 1fr) 84px; gap: var(--pk-s2); } }

/* data tables */
.pk-table-wrap { overflow-x: auto; border: 1px solid var(--pk-line); border-radius: var(--pk-r-card); background: var(--pk-surface); }
.pk-table-wrap:focus-visible { outline-offset: 2px; }
.pk-table { width: 100%; min-width: 520px; border-collapse: collapse; font-size: var(--pk-t-small); }
.pk-table th, .pk-table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--pk-line); }
.pk-table thead th { font-size: var(--pk-t-micro); font-weight: 600; color: var(--pk-muted); background: var(--pk-paper-deep); }
.pk-table th:not(:first-child), .pk-table td:not(:first-child) { text-align: right; }
.pk-table td.pk-num, .pk-table th.pk-num { font-variant-numeric: tabular-nums; }
.pk-table__group th { background: var(--pk-paper); font-family: var(--pk-font-display); font-size: 1rem; font-weight: 700; letter-spacing: -0.01em; text-align: left !important; }
.pk-table__group i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 8px; vertical-align: 0; }
.pk-table__sub td, .pk-table__sub th { font-weight: 600; }
.pk-table__total th, .pk-table__total td { font-weight: 700; border-top: 1.5px solid var(--pk-ink); }
.pk-table__line th { font-weight: 400; padding-left: 34px; }
.pk-table tbody tr:last-child > * { border-bottom: 0; }
.pk-table--compact { min-width: 0; margin-block: var(--pk-s2); border: 1px solid var(--pk-line); border-radius: var(--pk-r-card); }
.pk-table--compact td:last-child, .pk-table--compact th:last-child { text-align: right; }

/* long-form explanation sections */
.pk-doc { display: grid; gap: var(--pk-s5) var(--pk-s7); grid-template-columns: minmax(0, 1fr); padding-top: clamp(32px, 4vw, 48px); border-top: 1.5px solid var(--pk-ink); }
@media (min-width: 980px) { .pk-doc { grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); } }
.pk-doc__side { display: grid; gap: var(--pk-s3); align-content: start; }
.pk-doc__side h2 { font-size: clamp(1.75rem, 1.4rem + 1.4vw, 2.25rem); }
.pk-doc__side p { color: var(--pk-muted); }
.pk-doc__body { display: grid; gap: var(--pk-s4); max-width: 72ch; align-content: start; }
.pk-doc__body h3 { font-size: 1.1875rem; margin-top: var(--pk-s3); }
.pk-doc__body h3:first-child { margin-top: 0; }
.pk-doc__body ul { padding-left: 1.2em; display: grid; gap: 6px; }
.pk-checklist { list-style: none; padding: 0 !important; gap: 0 !important; border-top: 1px solid var(--pk-line); }
.pk-checklist li { padding: var(--pk-s4) 0; border-bottom: 1px solid var(--pk-line); }
.pk-checklist strong { display: block; margin-bottom: 2px; }
.pk-faq { gap: 0; border-top: 1px solid var(--pk-line); }
.pk-faq details { border-bottom: 1px solid var(--pk-line); }
.pk-faq summary {
  list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: var(--pk-s4);
  min-height: 56px; padding: var(--pk-s3) 0; font-weight: 600;
}
.pk-faq summary::-webkit-details-marker { display: none; }
.pk-faq summary::after { content: "+"; font-family: var(--pk-font-mono); font-size: 1.375rem; color: var(--pk-forest); flex-shrink: 0; }
.pk-faq details[open] summary::after { content: "\2212"; }
.pk-faq details p { padding-bottom: var(--pk-s4); color: var(--pk-muted); max-width: 66ch; }
.pk-dir--grid { display: grid; grid-template-columns: minmax(0, 1fr); column-gap: var(--pk-s6); }
@media (min-width: 900px) { .pk-dir--grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

@media print {
  .pk-app__bar, .pk-peek, .pk-seg, .pk-faq, .pk-dir--grid, #next-title { display: none !important; }
  .pk-app { grid-template-columns: 1fr 1fr; }
  .pk-app .pk-result { box-shadow: none; }
  .pk-line { grid-template-columns: 1fr 220px; padding: 6px 0; break-inside: avoid; }
  .pk-field__hint { display: none; }
  .pk-section { padding-block: 16px; }
}
.pk-textbtn--link { display: inline-flex; align-items: center; }
/* keep focused fields clear of the phone summary bar (WCAG 2.4.11) */
@media (max-width: 759px) { html:has(.pk-peek) { scroll-padding-bottom: 96px; } }

/* =====================================================================
   21. Editorial: article pages, policy pages, placeholders
   ===================================================================== */
.pk-ph { background: #FFF1E0; color: #7A2E0B; outline: 1.5px dashed #C2551E; outline-offset: 1px; border-radius: 4px; padding: 0 4px; }
.pk-preview-banner { margin: 0; padding: 10px var(--pk-gutter); background: #FFF1E0; color: #7A2E0B; text-align: center; font-size: var(--pk-t-small); border-bottom: 1px solid #E8C9A8; }
.pk-policy { display: grid; gap: clamp(40px, 5vw, 64px); }
.pk-policy .pk-doc:first-child { border-top: 0; padding-top: 0; }
.pk-doc__body ol { padding-left: 1.3em; display: grid; gap: 6px; }

/* article header */
.pk-article__head { padding-block: clamp(24px, 4vw, 48px) clamp(28px, 4vw, 48px); border-bottom: 1px solid var(--pk-line); }
.pk-article__headinner { display: grid; gap: var(--pk-s4); max-width: 880px; }
.pk-article__kicker { display: flex; flex-wrap: wrap; align-items: center; gap: var(--pk-s3); font-weight: 600; font-size: var(--pk-t-small); }
.pk-article__kicker a { color: var(--pk-forest); text-decoration: none; }
.pk-article__kicker a:hover { text-decoration: underline; }
.pk-article h1 { font-size: clamp(2.375rem, 1.6rem + 3.2vw, 4rem); line-height: 0.98; letter-spacing: -0.045em; max-width: 18ch; }
.pk-article__standfirst { font-size: clamp(1.1875rem, 1.1rem + 0.45vw, 1.4375rem); line-height: 1.45; color: var(--pk-muted); max-width: 54ch; }
.pk-byline { display: flex; align-items: center; gap: var(--pk-s3); padding-top: var(--pk-s4); margin-top: var(--pk-s2); border-top: 1px solid var(--pk-line); }
.pk-byline__text { display: grid; gap: 2px; font-size: var(--pk-t-small); }
.pk-byline__text p { font-weight: 600; }
.pk-byline__meta { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 2px var(--pk-s4); color: var(--pk-muted); }
.pk-avatar { width: 44px; height: 44px; border-radius: 50%; background: var(--pk-ink); color: var(--pk-lime); display: inline-flex; align-items: center; justify-content: center; font-family: var(--pk-font-display); font-weight: 800; font-size: 0.9375rem; flex-shrink: 0; }
.pk-avatar--lg { width: 64px; height: 64px; font-size: 1.25rem; }

/* layout: contents rail + reading column */
.pk-article__layout { display: grid; gap: var(--pk-s6); grid-template-columns: minmax(0, 1fr); padding-block: clamp(32px, 5vw, 56px); }
@media (min-width: 1080px) {
  .pk-article__layout { grid-template-columns: 220px minmax(0, 720px); gap: 72px; }
  .pk-toc { position: sticky; top: calc(var(--pk-header-h) + 24px); align-self: start; }
}
.pk-toc { font-size: var(--pk-t-small); border-top: 1.5px solid var(--pk-ink); padding-top: var(--pk-s3); }
.pk-toc__title { font-weight: 600; margin-bottom: var(--pk-s2); }
.pk-toc ol { list-style: none; padding: 0; counter-reset: toc; display: grid; }
.pk-toc li { counter-increment: toc; }
.pk-toc a { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 4px; padding: 7px 0; color: var(--pk-muted); text-decoration: none; line-height: 1.35; min-height: 32px; }
.pk-toc a::before { content: counter(toc); font-family: var(--pk-font-mono); font-size: var(--pk-t-micro); padding-top: 1px; }
.pk-toc li:last-child a::before { content: ""; }
.pk-toc a:hover { color: var(--pk-ink); text-decoration: underline; }
@media (max-width: 1079px) { .pk-toc { background: var(--pk-surface); border: 1px solid var(--pk-line); border-radius: var(--pk-r-card); padding: var(--pk-s4) var(--pk-s5); } }

/* reading typography */
.pk-prose { font-size: clamp(1.0625rem, 1.03rem + 0.2vw, 1.1875rem); line-height: 1.72; min-width: 0; }
.pk-prose > * + * { margin-top: 1.1em; }
.pk-prose > h2 { font-size: clamp(1.625rem, 1.35rem + 1.1vw, 2.125rem); line-height: 1.12; letter-spacing: -0.03em; margin-top: 2em; scroll-margin-top: calc(var(--pk-header-h) + 24px); }
.pk-prose > h3 { font-size: 1.25rem; margin-top: 1.6em; }
.pk-prose ul, .pk-prose ol { padding-left: 1.3em; }
.pk-prose li + li { margin-top: 0.4em; }
.pk-prose a { text-decoration-thickness: 1px; }
.pk-cite { font-size: 0.7em; line-height: 0; vertical-align: super; margin-left: 2px; }
.pk-cite a { display: inline-block; min-width: 24px; min-height: 24px; line-height: 24px; text-align: center; padding: 0 4px; border-radius: 6px; background: var(--pk-paper-deep); color: var(--pk-forest); text-decoration: none; font-family: var(--pk-font-mono); font-weight: 600; }
.pk-cite a:hover { background: var(--pk-forest); color: #fff; }

.pk-disclosure { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: var(--pk-paper-deep); font-size: var(--pk-t-small); line-height: 1.5; color: var(--pk-ink); }
.pk-disclosure svg { flex-shrink: 0; margin-top: 2px; color: var(--pk-forest); }
.pk-keypoints { padding: var(--pk-s5); border: 1.5px solid var(--pk-ink); border-radius: var(--pk-r-card); background: var(--pk-surface); }
.pk-keypoints h2 { font-size: 1.125rem; letter-spacing: -0.01em; margin-bottom: var(--pk-s3); }
.pk-keypoints ul { list-style: none; padding: 0; display: grid; gap: var(--pk-s3); font-size: 1.0625rem; line-height: 1.55; }
.pk-keypoints li { display: grid; grid-template-columns: 14px minmax(0, 1fr); gap: 12px; margin: 0; }
.pk-keypoints li::before { content: ""; width: 10px; height: 10px; margin-top: 0.5em; border-radius: 3px; background: var(--pk-lime); box-shadow: inset 0 0 0 1.5px var(--pk-ink); }

.pk-toolcard { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: var(--pk-s3) var(--pk-s4); align-items: center; padding: var(--pk-s5); border-radius: var(--pk-r-card); background: var(--pk-ink); color: var(--pk-on-dark); font-size: var(--pk-t-small); line-height: 1.5; }
.pk-toolcard__icon { width: 44px; height: 44px; border-radius: 12px; background: var(--pk-lime); color: var(--pk-ink); display: flex; align-items: center; justify-content: center; }
.pk-toolcard__title { color: #fff; font-weight: 600; font-size: 1.0625rem; }
.pk-toolcard .pk-btn { grid-column: 1 / -1; justify-self: start; background: var(--pk-lime); color: var(--pk-ink); border-color: var(--pk-lime); }
.pk-toolcard .pk-btn:hover { background: #fff; border-color: #fff; color: var(--pk-ink); }
@media (min-width: 680px) { .pk-toolcard { grid-template-columns: 44px minmax(0, 1fr) auto; } .pk-toolcard .pk-btn { grid-column: auto; } }

.pk-callout { padding: var(--pk-s5); border-radius: var(--pk-r-card); font-size: var(--pk-t-small); line-height: 1.55; display: grid; gap: var(--pk-s3); }
.pk-callout__title { font-family: var(--pk-font-display); font-weight: 700; font-size: 1.125rem; letter-spacing: -0.01em; }
.pk-callout__note { font-size: var(--pk-t-micro); color: var(--pk-muted); }
.pk-callout--example { background: var(--pk-surface); border: 1px solid var(--pk-line); }
.pk-callout--warn { background: #FFF1E6; border: 1.5px solid #C2551E; color: #4A1C07; }
.pk-callout--warn a { color: #7A2E0B; }
.pk-table--inline { min-width: 0; border: 1px solid var(--pk-line); border-radius: 10px; }

.pk-ad { margin-block: 2em !important; }
.pk-ad__label { font-size: var(--pk-t-micro); color: var(--pk-muted); text-align: center; margin-bottom: 6px; }
.pk-ad__slot { min-height: 250px; display: grid; place-items: center; padding: var(--pk-s5); border: 1px dashed var(--pk-line-strong); border-radius: 12px; background: repeating-linear-gradient(45deg, transparent 0 10px, rgba(11,31,26,0.025) 10px 20px); color: var(--pk-muted); font-size: var(--pk-t-micro); text-align: center; line-height: 1.5; }
.pk-ad__slot span { max-width: 40ch; }

.pk-prose .pk-figure { margin-block: 1.6em; }
.pk-prose .pk-pull { margin: 1.6em 0; font-size: clamp(1.375rem, 1.2rem + 0.8vw, 1.75rem); line-height: 1.25; }
.pk-prose .pk-pull p { margin: 0; }

.pk-sources { padding-top: var(--pk-s5); border-top: 1.5px solid var(--pk-ink); margin-top: 2.5em !important; }
.pk-sources h2 { font-size: 1.25rem; }
.pk-sources ol { font-size: var(--pk-t-small); line-height: 1.55; margin-top: var(--pk-s3); }
.pk-sources li:target { background: #FFF6C9; border-radius: 4px; }
.pk-checked { padding: var(--pk-s5); border-radius: var(--pk-r-card); background: var(--pk-paper-deep); font-size: var(--pk-t-small); line-height: 1.5; display: grid; gap: var(--pk-s3); }
.pk-checked h2 { font-size: 1.125rem; }
.pk-checked dl { display: grid; gap: 0; }
.pk-checked dl div { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: var(--pk-s3); padding: 8px 0; border-top: 1px solid var(--pk-line); }
.pk-checked dt { color: var(--pk-muted); }
.pk-author { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: var(--pk-s4); align-items: start; font-size: var(--pk-t-small); line-height: 1.55; }
.pk-author__name { font-size: 1.125rem; margin-bottom: 4px; }
.pk-history { font-size: var(--pk-t-small); border-top: 1px solid var(--pk-line); border-bottom: 1px solid var(--pk-line); }
.pk-history summary { cursor: pointer; min-height: 48px; display: flex; align-items: center; font-weight: 600; }
.pk-history ul { padding: 0 0 var(--pk-s4) 1.2em; }
.pk-article__note { font-size: var(--pk-t-small); color: var(--pk-muted); }

.pk-related { background: var(--pk-paper-deep); }
.pk-related__title { font-size: clamp(1.625rem, 1.35rem + 1.1vw, 2.125rem); margin-bottom: var(--pk-s5); }
.pk-related__list { list-style: none; padding: 0; display: grid; gap: var(--pk-s4); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 860px) { .pk-related__list { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.pk-related__list a { display: grid; gap: 6px; height: 100%; padding: var(--pk-s5); border-radius: var(--pk-r-card); background: var(--pk-surface); border: 1px solid var(--pk-line); text-decoration: none; color: var(--pk-ink); }
.pk-related__list a:hover { border-color: var(--pk-ink); color: var(--pk-ink); }
.pk-related__list a:hover .pk-related__name { text-decoration: underline; }
.pk-related__kind { font-size: var(--pk-t-micro); font-weight: 600; color: var(--pk-forest); }
.pk-related__name { font-family: var(--pk-font-display); font-weight: 700; font-size: 1.25rem; letter-spacing: -0.02em; }
.pk-related__desc { font-size: var(--pk-t-small); color: var(--pk-muted); }

@media print {
  .pk-toc, .pk-ad, .pk-related, .pk-preview-banner, .pk-toolcard { display: none !important; }
  .pk-article__layout { grid-template-columns: 1fr; }
}

/* =====================================================================
   22. Emergency fund calculator
   ===================================================================== */
/* entry-mode switch on light backgrounds (radio buttons styled as a segmented control) */
.pk-mode { margin: var(--pk-s4) 0 4px; padding: 4px; border: 0; display: inline-flex; flex-wrap: wrap; gap: 4px; border-radius: 999px; background: var(--pk-paper-deep); justify-self: start; min-width: 0; }
.pk-mode input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.pk-mode label { display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px; border-radius: 999px; font-weight: 600; font-size: var(--pk-t-small); color: var(--pk-muted); cursor: pointer; }
.pk-mode label:hover { color: var(--pk-ink); }
.pk-mode input:checked + label { background: var(--pk-ink); color: #fff; }
.pk-mode input:focus-visible + label { outline: 3px solid var(--pk-forest); outline-offset: 2px; }

/* single fields inside a tool fieldset get the same rhythm as budget lines */
.pk-fs > .pk-field { padding: var(--pk-s4) 0; border-bottom: 1px solid var(--pk-line); }
.pk-fs [data-mode] > .pk-field { padding: var(--pk-s4) 0; border-bottom: 1px solid var(--pk-line); }
.pk-fs .pk-field--row { grid-template-columns: minmax(0, 1fr) minmax(0, 300px); }
@media (max-width: 619px) {
  .pk-fs .pk-field--row { grid-template-columns: minmax(0, 1fr); }
  .pk-fs .pk-field--row > .pk-input { grid-column: 1; grid-row: auto; }
  .pk-fs .pk-field--row > label, .pk-fs .pk-field--row > .pk-field__hint { grid-row: auto; }
}
.pk-chips { display: flex; flex-wrap: wrap; gap: var(--pk-s2); padding: var(--pk-s3) 0 var(--pk-s4); border-bottom: 1px solid var(--pk-line); }
.pk-chips .pk-chip[aria-pressed="true"] { background: var(--pk-ink); color: #fff; border-color: var(--pk-ink); }
.pk-chips .pk-chip { min-height: 44px; }

/* milestone chart */
.pk-ms__rows { list-style: none; padding: 0; display: grid; gap: 4px; }
.pk-ms__row { display: grid; grid-template-columns: 190px minmax(0, 1fr) 150px; gap: var(--pk-s3); align-items: center; min-height: 48px; padding: 6px 0; border-bottom: 1px solid var(--pk-line); font-size: var(--pk-t-small); }
.pk-ms__row:last-child { border-bottom: 0; }
.pk-ms__label { display: grid; gap: 0; }
.pk-ms__label .pk-num { color: var(--pk-muted); font-size: var(--pk-t-micro); }
.pk-ms__track { position: relative; height: 14px; border-radius: 999px; background: var(--pk-paper-deep); overflow: hidden; }
.pk-ms__bar { position: absolute; inset: 0 auto 0 0; border-radius: 999px; background: var(--pk-g-savings); box-shadow: inset 0 0 0 1px rgba(11, 31, 26, 0.3); transition: width 220ms ease; }
.pk-ms__row.is-done .pk-ms__bar { background: var(--pk-g-home); }
.pk-ms__row.is-target .pk-ms__bar { background: var(--pk-lime); }
.pk-ms__when { display: grid; text-align: right; }
.pk-ms__when small { color: var(--pk-muted); font-size: var(--pk-t-micro); }
.pk-ms__row.is-done .pk-ms__when b { color: var(--pk-forest); }
@media (max-width: 620px) {
  .pk-ms__row { grid-template-columns: minmax(0, 1fr) auto; row-gap: 6px; }
  .pk-ms__track { grid-column: 1 / -1; grid-row: 2; }
}
.pk-sources-inline { font-size: var(--pk-t-small); color: var(--pk-muted); padding-left: 1.2em; }
.pk-sources-inline li:target { background: #FFF6C9; border-radius: 4px; }
@media (min-width: 900px) { .pk-dir--grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* =====================================================================
   23. Deposit savings planner: comparison rows and line chart
   ===================================================================== */
.pk-cmp__rows { list-style: none; padding: 0; display: grid; gap: 6px; }
.pk-cmp__row {
  width: 100%; display: grid; grid-template-columns: 170px minmax(0, 1fr) 170px; gap: var(--pk-s3); align-items: center;
  min-height: 56px; padding: 8px 12px; border: 1px solid var(--pk-line); border-radius: 12px; background: var(--pk-white);
  font: inherit; font-size: var(--pk-t-small); color: var(--pk-ink); text-align: left; cursor: pointer;
}
.pk-cmp__row:hover { border-color: var(--pk-ink); }
.pk-cmp__row.is-selected { border: 1.5px solid var(--pk-ink); box-shadow: 4px 4px 0 var(--pk-ink); }
.pk-cmp__name { display: grid; }
.pk-cmp__name .pk-num { color: var(--pk-muted); font-size: var(--pk-t-micro); }
.pk-cmp__track { position: relative; height: 14px; border-radius: 999px; background: var(--pk-paper-deep); overflow: hidden; }
.pk-cmp__bar { position: absolute; inset: 0 auto 0 0; border-radius: 999px; background: var(--pk-g-savings); box-shadow: inset 0 0 0 1px rgba(11, 31, 26, 0.3); transition: width 220ms ease; }
.pk-cmp__row.is-selected .pk-cmp__bar { background: var(--pk-lime); }
.pk-cmp__row.is-done .pk-cmp__bar { background: var(--pk-g-home); }
.pk-cmp__bar.is-over { background: repeating-linear-gradient(135deg, var(--pk-line-strong) 0 6px, var(--pk-paper-deep) 6px 12px); }
.pk-cmp__when { display: grid; text-align: right; }
.pk-cmp__when small { color: var(--pk-muted); font-size: var(--pk-t-micro); }
.pk-cmp__note { font-size: var(--pk-t-micro); color: var(--pk-muted); }
@media (max-width: 620px) {
  .pk-cmp__row { grid-template-columns: minmax(0, 1fr) auto; row-gap: 6px; }
  .pk-cmp__track { grid-column: 1 / -1; grid-row: 2; }
}

.pk-chart__plot { position: relative; outline-offset: 4px; touch-action: pan-y; }
.pk-chart__plot svg { display: block; width: 100%; height: auto; overflow: visible; font-family: var(--pk-font-body); }
.pk-chart__grid { stroke: var(--pk-line); stroke-width: 1; }
.pk-chart__baseline { stroke: var(--pk-line-strong); stroke-width: 1; }
.pk-chart__axis { fill: var(--pk-muted); font-size: 12px; }
.pk-chart__ref { stroke: var(--pk-line-strong); stroke-width: 1; stroke-dasharray: 4 4; }
.pk-chart__ref.is-selected { stroke: var(--pk-ink); stroke-width: 1.5; stroke-dasharray: none; }
.pk-chart__reflabel { fill: var(--pk-muted); font-size: 12px; }
.pk-chart__reflabel.is-selected { fill: var(--pk-ink); font-weight: 600; }
.pk-chart__area { fill: var(--pk-forest); fill-opacity: 0.08; }
.pk-chart__line { fill: none; stroke: var(--pk-forest); stroke-width: 2; stroke-linejoin: round; }
.pk-chart__dot { fill: var(--pk-surface); stroke: var(--pk-forest); stroke-width: 2; }
.pk-chart__dot.is-selected { fill: var(--pk-lime); stroke: var(--pk-ink); }
.pk-chart__cross { stroke: var(--pk-ink); stroke-width: 1; }
.pk-chart__crossdot { fill: var(--pk-forest); stroke: var(--pk-surface); stroke-width: 2; }
.pk-chart__tip {
  position: absolute; z-index: 2; width: 190px; padding: 10px 12px; border-radius: 10px; pointer-events: none;
  background: var(--pk-ink); color: var(--pk-on-dark); font-size: var(--pk-t-micro); line-height: 1.45; display: grid; gap: 2px;
  box-shadow: 0 0 0 2px var(--pk-surface);
}
.pk-chart__tip b { color: #fff; font-size: var(--pk-t-small); }
.pk-chart__tip .pk-num { color: var(--pk-lime); font-size: var(--pk-t-small); }
.pk-chart figcaption { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; }
.pk-chart__key { display: inline-flex; align-items: center; gap: 6px; color: var(--pk-ink); }
.pk-chart__key i { display: inline-block; width: 22px; height: 0; }
.pk-chart__key-line { border-top: 2px solid var(--pk-forest); }
.pk-chart__key-dash { border-top: 1.5px dashed var(--pk-line-strong); }
.pk-chart__key-sel { border-top: 2px solid var(--pk-ink); }
@media print { .pk-chart__tip { display: none !important; } }

/* =====================================================================
   24. Stamp Duty calculator: question groups, band ladder
   ===================================================================== */
/* a yes/no or choice question: visible legend, hint, then a light segmented control */
.pk-q { margin: 0; padding: var(--pk-s4) 0; border: 0; border-bottom: 1px solid var(--pk-line); min-width: 0; display: grid; gap: 4px; }
.pk-q[hidden] { display: none; }
.pk-q__legend { float: left; width: 100%; padding: 0; font-size: var(--pk-t-small); font-weight: 600; color: var(--pk-ink); }
.pk-q__legend + * { clear: both; }
.pk-q .pk-mode { margin: var(--pk-s2) 0 0; }
.pk-kv .pk-kv__total { border-top: 1.5px solid var(--pk-on-dark-muted); }
.pk-kv .pk-kv__total dt, .pk-kv .pk-kv__total dd { color: #fff; font-weight: 700; }

.pk-bands__rows { list-style: none; padding: 0; display: grid; gap: 4px; }
.pk-bands__row { display: grid; grid-template-columns: 210px 64px minmax(0, 1fr) 120px; gap: var(--pk-s3); align-items: center; min-height: 48px; padding: 6px 0; border-bottom: 1px solid var(--pk-line); font-size: var(--pk-t-small); }
.pk-bands__row:last-child { border-bottom: 0; }
.pk-bands__label { display: grid; }
.pk-bands__label small { color: var(--pk-muted); font-size: var(--pk-t-micro); }
.pk-bands__rate { justify-self: start; padding: 2px 8px; border-radius: 8px; background: var(--pk-paper-deep); font-weight: 600; }
.pk-bands__track { position: relative; height: 14px; border-radius: 999px; background: var(--pk-paper-deep); overflow: hidden; }
.pk-bands__bar { position: absolute; inset: 0 auto 0 0; border-radius: 999px; background: var(--pk-g-home); box-shadow: inset 0 0 0 1px rgba(11, 31, 26, 0.3); transition: width 220ms ease; }
.pk-bands__row--extra .pk-bands__bar { background: var(--pk-g-debt); }
.pk-bands__tax { text-align: right; font-weight: 600; }
.pk-bands__row.is-unused { color: var(--pk-muted); }
.pk-bands__row.is-unused .pk-bands__tax { font-weight: 400; }
.pk-bands__row--total { border-top: 1.5px solid var(--pk-ink); border-bottom: 0; font-weight: 700; }
.pk-bands__row--total .pk-bands__tax { font-weight: 700; }
.pk-bands__table { margin-top: var(--pk-s5); }
.pk-table td small { display: block; color: var(--pk-muted); font-size: var(--pk-t-micro); font-weight: 400; }
.pk-table--compact caption { caption-side: top; text-align: left; padding: 10px 16px; font-weight: 600; font-size: var(--pk-t-small); background: var(--pk-paper-deep); border-radius: var(--pk-r-card) var(--pk-r-card) 0 0; }
[data-rates] .pk-table--compact { border-collapse: separate; border-spacing: 0; }
@media (max-width: 700px) {
  .pk-bands__row { grid-template-columns: minmax(0, 1fr) auto auto; row-gap: 6px; }
  .pk-bands__track { grid-column: 1 / -1; grid-row: 2; }
  .pk-bands__tax { min-width: 84px; }
}
@media print { .pk-q .pk-field__hint { display: none; } }
@media (max-width: 700px) { .pk-bands__spacer { display: none; } }
@media (max-width: 520px) {
  .pk-q .pk-mode--grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-radius: 22px; justify-self: stretch; }
  .pk-q .pk-mode--grid label { justify-content: center; }
}

/* =====================================================================
   25. Pension contribution calculator
   ===================================================================== */
@media (max-width: 520px) { .pk-q .pk-mode--3 { grid-template-columns: minmax(0, 1fr); } }
.pk-fs > [data-q] > .pk-field { padding: var(--pk-s4) 0; border-bottom: 1px solid var(--pk-line); }
.pk-bands__bar.is-you { background: var(--pk-g-savings); }
.pk-bands__bar.is-relief { background: var(--pk-lime); }
.pk-bands__bar.is-ni { background: var(--pk-g-everyday); }
.pk-bands__bar.is-employer { background: var(--pk-g-home); }
.pk-bands__bar.is-erni { background: var(--pk-g-lifestyle); }
.pk-figs { display: grid; gap: var(--pk-s3); grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.pk-figs[hidden] { display: none; }
.pk-figs div { display: grid; gap: 2px; padding: var(--pk-s3) var(--pk-s4); border-radius: 12px; background: var(--pk-paper-deep); }
.pk-figs dt { font-size: var(--pk-t-micro); color: var(--pk-muted); }
.pk-figs dd { font-size: 1.375rem; font-weight: 600; color: var(--pk-ink); }
.pk-figs div:first-child { background: var(--pk-ink); }
.pk-figs div:first-child dt { color: var(--pk-on-dark); }
.pk-figs div:first-child dd { color: var(--pk-lime); }

/* =====================================================================
   26. Pre-launch audit fixes
   ===================================================================== */
/* the skip link focuses <main> (tabindex=-1); it isn't interactive, so no ring around the whole page */
main:focus { outline: none; }
