/*
 * Help pages, landing pages and the 404 page (public/). Plain CSS, no outside requests (strict
 * CSP). It follows the house style in docs/DESIGN_RULES.md: the same token names and values as
 * the app (src/ui/designs/bank.css), the same header, footer, buttons, cards and callouts. The
 * header and footer HTML come from src/sitechrome.ts. Light or dark follows the device (and the
 * theme button, public/theme.js), with or without JavaScript.
 */
:root {
  --paper: #eef1f5;
  --surface: #fcfcfd;
  --surface-2: #e8ecf2;
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #5b6578;
  --rule: #dde3eb;
  --rule-strong: #cbd3df;
  --brand: #2459e6;
  --brand-ink: #ffffff;
  --brand-hover: #1b4cc9;
  --brand-fill: #2459e6;
  --brand-fill-hover: #1b4cc9;
  --brand-soft: #e6edfe;
  --info-bg: #ebf1fe;
  --info-line: #c6d4fb;
  --gain: #0a7a45;
  --warn: #9a5800;
  --danger: #c0262d;
  --focus: #2560ee;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 6px 20px rgba(15, 23, 42, 0.06);
  --radius: 14px;
  --radius-lg: 20px;
  --font-sans:
    'Onest Variable', 'Onest', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  /* spacing scale, the same as the app's (docs/LAYOUT_GUIDE.md) */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --gutter: var(--space-4); /* page edges: 24px from 640px wide */
  --tap: 44px; /* button height to aim for (WCAG 2.2's minimum is 24px) */
  --measure: 70ch; /* longest comfortable line of text */
  --header-h: 68px;
  --sticky-h: 0px; /* how much of the top the sticky header covers (none on phones) */
  color-scheme: light;
}
@media (min-width: 640px) {
  :root {
    --gutter: var(--space-5);
  }
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --paper: #0b1220;
    --surface: #111a2e;
    --surface-2: #17223a;
    --ink: #e8edf7;
    --ink-2: #c3cbdb;
    --muted: #98a3ba;
    --rule: #222f4d;
    --rule-strong: #33436a;
    --brand: #7c9cff;
    --brand-ink: #0b1220;
    --brand-hover: #a2b8ff;
    --brand-fill: #3b63f5;
    --brand-fill-hover: #2f56e6;
    --brand-soft: #18264d;
    --info-bg: #132042;
    --info-line: #2c3f70;
    --gain: #5fd39a;
    --warn: #f5c16c;
    --danger: #ff8f8f;
    --focus: #a2b8ff;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.28);
    color-scheme: dark;
  }
}
:root[data-theme='dark'] {
  --paper: #0b1220;
  --surface: #111a2e;
  --surface-2: #17223a;
  --ink: #e8edf7;
  --ink-2: #c3cbdb;
  --muted: #98a3ba;
  --rule: #222f4d;
  --rule-strong: #33436a;
  --brand: #7c9cff;
  --brand-ink: #0b1220;
  --brand-hover: #a2b8ff;
  --brand-fill: #3b63f5;
  --brand-fill-hover: #2f56e6;
  --brand-soft: #18264d;
  --info-bg: #132042;
  --info-line: #2c3f70;
  --gain: #5fd39a;
  --warn: #f5c16c;
  --danger: #ff8f8f;
  --focus: #a2b8ff;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.28);
  color-scheme: dark;
}

@font-face {
  font-family: 'Onest Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(../fonts/onest-latin-wght-normal.woff2) format('woff2-variations');
}

* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.65;
  font-feature-settings: 'ss01' on;
  -webkit-text-size-adjust: 100%;
}
@media (min-width: 700px) {
  body {
    font-size: 18px;
  }
}
strong {
  font-weight: 650;
}
a {
  color: var(--brand);
  font-weight: 500;
}
/* list links: at least 24px tall to tap (WCAG 2.2 target size). The padding makes the link's box
   taller without being inline-block, which let a link drop to the next line away from the "(" or
   ")." around it. */
li a {
  padding-block: 2px;
}
/* one focus ring for everything, as in the app */
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 8px;
}

/* ---- header: the same as the app's (68px, sticky, stacked logo, nav pills, one small button) */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--rule);
}
/* sticky like the app's header, from 760px wide. On phones the links are on a second row, which
   would cover too much of the screen (and the focused element), so it scrolls away there. */
@media (min-width: 760px) {
  :root {
    --sticky-h: var(--header-h);
  }
  .site-header {
    position: sticky;
    top: 0;
    z-index: 30;
  }
}
html {
  scroll-padding-top: calc(var(--sticky-h) + var(--space-4));
}
.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.header-inner {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: var(--space-3);
  min-height: 68px;
  padding-top: 0;
  padding-bottom: 0;
}
/* One top bar (owner, 17 Nov 2026): the header is the app home page's, at every width and on every
   page: same place, same sizes (fixed px, so the wide-screen text growth doesn't touch it), same
   links. e2e/header.pw.ts measures every page against the app's home page. */
.site-header {
  font-size: 16px;
  line-height: 1.55;
}
@media (min-width: 1500px) {
  .header-inner {
    max-width: clamp(1120px, 70vw, 1800px);
  }
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  font-size: 17.28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  white-space: nowrap;
  text-decoration: none;
}
.brand:hover {
  color: var(--ink);
}
.brand svg {
  flex: none;
}
.brand-stack {
  display: inline-flex;
  flex-direction: column;
  font-weight: 800;
  font-size: 17.92px;
  line-height: 1;
  letter-spacing: -0.025em;
}
.header-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.navlink {
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--ink-2);
  font-size: 15.2px;
  font-weight: 500;
  line-height: 1.55;
  text-decoration: none;
}
.navlink:hover,
.navlink:focus-visible,
.navlink[aria-current='page'] {
  background: var(--surface-2);
  color: var(--ink);
}
.top-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
/* phones: as in the app, the links are left out of the top bar (the footer has them) */
@media (max-width: 720px) {
  .hide-sm {
    display: none !important;
  }
  .header-nav .navlink {
    display: none;
  }
}
@media (min-width: 721px) {
  .show-sm {
    display: none !important;
  }
}
/* the light/dark button: the build puts it in the header; both icons are there, and the one for
   the theme theme.js set before the page painted is shown */
.icon-btn {
  display: inline-grid;
  place-items: center;
  width: var(--tap);
  height: var(--tap);
  flex: none;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-2);
  cursor: pointer;
}
.icon-btn:hover,
.icon-btn:focus-visible {
  background: var(--surface-2);
}
.site-header .icon-btn .i-sun,
:root[data-theme='dark'] .site-header .icon-btn .i-moon {
  display: none;
}
:root[data-theme='dark'] .site-header .icon-btn .i-sun {
  display: block;
}
/* scripts off (theme.js marks <html class="js"> before the page paints): one plain readable column,
   with no empty side columns and no light/dark button that can't work */
html:not(.js) main.wrap.has-side {
  display: block;
  max-width: 792px;
}
html:not(.js) :is(main .side, main .g-left, .site-header .icon-btn) {
  display: none;
}
html {
  scrollbar-gutter: stable; /* no sideways jump between pages with and without a scrollbar */
}

/* ---- buttons: the app's three looks (primary, second, small) */
.btn,
.cta {
  display: inline-flex;
  /* if a label ever has more than one piece (text plus a span), the pieces stack in rows rather
     than squeezing side by side into narrow columns; labels should be plain text anyway
     (e2e/pages.pw.ts checks) */
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--tap);
  padding: 10px 18px;
  border: 1px solid var(--rule-strong);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.005em;
  line-height: 1.3;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
}
.btn:hover {
  background: var(--surface-2);
}
.btn-primary,
.cta {
  background: var(--brand-fill);
  border-color: var(--brand-fill);
  color: #fff;
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.1),
    0 4px 12px color-mix(in srgb, var(--brand-fill) 28%, transparent);
}
.btn-primary:hover,
.cta:hover {
  background: var(--brand-fill-hover);
  border-color: var(--brand-fill-hover);
  color: #fff;
}
:root[data-theme='dark'] .btn-primary,
:root[data-theme='dark'] .cta {
  box-shadow: none;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .btn-primary,
  :root:not([data-theme='light']) .cta {
    box-shadow: none;
  }
}
.btn-small {
  min-height: 34px;
  padding: 6px 12px;
  border-radius: 10px;
  font-size: 13.76px;
  line-height: 1.2;
}
@media (max-width: 640px) {
  .btn-small {
    min-height: var(--tap);
    padding-top: 9px;
    padding-bottom: 9px;
  }
}
/* one width whatever the label ("Open the app" or "Start"), the same as the app's, so nothing
   beside it moves */
.site-header .btn-small {
  min-width: 150px;
}
@media (max-width: 720px) {
  .site-header .btn-small {
    min-width: 80px;
  }
}
.cta {
  margin: var(--space-3) 0;
}

/* ---- page */
main {
  padding: var(--space-5) var(--gutter) var(--space-7);
}
/* one readable column on phones and tablets (and if guides.js doesn't run) */
main.wrap {
  max-width: 792px;
  padding-top: var(--space-6);
  padding-bottom: var(--space-8);
}
main.wrap.index {
  max-width: 1120px;
}
/* a guide with a top section: the band meets the header, so no space above it */
main.wrap.has-top {
  padding-top: 0;
}

/* ---- the top section: title, reading time and checked date on the left, the short answer card
   on the right (stacked on phones, and if guides.js doesn't run). The band behind it is the full
   window wide: a border-image with an outset, which never makes the page scroll sideways. */
.g-hero {
  display: grid;
  gap: var(--space-5);
  margin-bottom: var(--space-6);
  padding: var(--space-5) 0 var(--space-6);
  background-color: var(--surface);
  border-image: linear-gradient(to bottom, var(--surface) calc(100% - 1px), var(--rule) 0) fill 0 /
    0 / 0 100vw;
}
@media (min-width: 1000px) {
  .g-hero {
    grid-column: 1 / -1;
    grid-template-columns: minmax(0, 1fr) 400px;
    align-items: center;
    gap: var(--space-7);
    padding-top: var(--space-6);
  }
}
.g-crumb {
  display: flex;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
  color: var(--muted);
  font-size: 0.9rem;
}
.g-crumb a {
  color: var(--brand);
  font-weight: 600;
  text-decoration: none;
}
.g-crumb a:hover {
  text-decoration: underline;
}
.g-hero h1 {
  max-width: 24ch;
  margin: 0 0 var(--space-4);
  font-size: clamp(1.75rem, 1.4rem + 1.3vw, 2.4rem);
  font-weight: 740;
  line-height: 1.1;
  letter-spacing: -0.032em;
  text-wrap: balance;
}
.g-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-5);
  margin: 0;
  color: var(--ink-2);
  font-size: 0.95rem;
}
.g-meta span {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}
.g-meta svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: var(--brand);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
/* the short answer: a calm blue-tinted card (owner's decision, 16 Nov 2026: the solid blue was too
   bright). Tint, line and text all come from the tokens, so it follows light and dark. */
.g-answer {
  padding: var(--space-4) var(--space-5);
  border: 1px solid color-mix(in srgb, var(--brand) 35%, transparent);
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--brand-fill) 9%, var(--surface));
  color: var(--ink);
  box-shadow: var(--shadow);
}
.g-answer-title {
  margin: 0 0 var(--space-2);
  color: var(--brand);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.g-answer-body {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.5;
  text-wrap: pretty;
}
.g-answer-body strong {
  color: inherit;
  font-weight: 700;
}
.guide > :first-child {
  margin-top: 0;
}
/* a heading stops under the sticky header because of html scroll-padding-top above; a scroll-margin-top
   here as well would count twice and leave a gap */
h1,
h2,
h3 {
  font-weight: 700;
  letter-spacing: -0.022em;
}
h1 {
  font-size: clamp(1.75rem, 1.35rem + 1.4vw, 2.25rem);
  font-weight: 720;
  line-height: 1.12;
  letter-spacing: -0.03em;
  margin: var(--space-2) 0 var(--space-4);
}
h2 {
  font-size: clamp(1.25rem, 1.15rem + 0.45vw, 1.5rem);
  line-height: 1.22;
  margin: var(--space-7) 0 var(--space-3);
}
h3 {
  font-size: 1.08rem;
  font-weight: 650;
  letter-spacing: -0.012em;
  line-height: 1.3;
  margin: var(--space-5) 0 var(--space-2);
}
p {
  margin: 0 0 1.1em;
}
/* the small label above a title ("Guide") */
.lede:first-child,
.eyebrow {
  margin: 0 0 6px;
  color: var(--brand);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.lede {
  color: var(--ink-2);
  margin-bottom: var(--space-3);
}
.muted {
  color: var(--muted);
}
dt {
  margin-top: var(--space-3);
}
dd {
  margin: 2px 0 0;
}
main ul,
main ol {
  margin: 0 0 var(--space-5);
  padding-left: 1.4em;
}
main li + li {
  margin-top: var(--space-2);
}

/* ---- callouts: the app's look (tinted, 1px line, 14px corners, an icon) */
.answer,
.note,
.disclaimer {
  position: relative;
  margin: var(--space-5) 0 var(--space-6);
  padding: 16px 18px 16px 54px;
  border: 1px solid var(--info-line);
  border-radius: var(--radius);
  background: var(--info-bg);
}
.answer::before,
.note::before,
.disclaimer::before {
  content: '';
  position: absolute;
  top: 18px;
  left: 18px;
  width: 20px;
  height: 20px;
  background: var(--brand);
  /* the app's "info" icon, drawn in the text colour of a link so it follows light and dark */
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 16v-4M12 8h.01'/%3E%3C/svg%3E")
    center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 16v-4M12 8h.01'/%3E%3C/svg%3E")
    center / contain no-repeat;
}
/* the "not tax advice" box: a plain card-coloured box with a shadow, above the footer */
.disclaimer {
  margin-top: var(--space-8);
  background: var(--surface);
  border-color: var(--rule);
  box-shadow: var(--shadow-sm);
  color: var(--ink-2);
  font-size: 0.95rem;
}
.disclaimer p {
  margin-bottom: var(--space-3);
}
.disclaimer p:last-child {
  margin-bottom: 0;
}

/* ---- tables */
.table-scroll {
  overflow-x: auto;
}
.table-scroll,
main > table,
.guide > table {
  margin: var(--space-4) 0 var(--space-6);
}
table {
  border-collapse: collapse;
  width: 100%;
  background: var(--surface);
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums lining-nums;
}
th,
td {
  border: 1px solid var(--rule);
  padding: var(--space-3) var(--space-4);
  text-align: left;
  vertical-align: top;
}
th {
  background: var(--surface-2);
  color: var(--ink-2);
}
td.num {
  text-align: right;
  white-space: nowrap;
}
/* a table in a guide is a rounded card with lines between rows only */
.table-scroll {
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--surface);
}
.table-scroll table {
  background: transparent;
}
.table-scroll th,
.table-scroll td {
  border: 0;
  border-bottom: 1px solid var(--rule);
}
.table-scroll tr:last-child td {
  border-bottom: 0;
}
.table-scroll th {
  background: var(--surface-2);
  font-size: 0.85rem;
  font-weight: 650;
}
.table-scroll tbody tr:hover td {
  background: var(--brand-soft);
}

/* ---- button rows: the main choice is filled, the second is the app's second button */
.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  margin: var(--space-5) 0;
}
.actions > * {
  margin: 0;
}
.actions > a:not(.cta) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--tap);
  padding: 10px 18px;
  border: 1px solid var(--rule-strong);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
}
.actions > a:not(.cta):hover {
  background: var(--surface-2);
}

/* ---- wide screens: the guide in a card with a side panel, like the app's layout */
.side {
  display: none;
}
@media (min-width: 1000px) {
  main.wrap.has-side {
    max-width: 1120px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 0 var(--space-7);
    align-items: start;
  }
  .guide {
    background: var(--surface);
    border: 1px solid var(--rule);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: var(--space-7) var(--space-8);
    max-width: 800px;
  }
  .guide p,
  .guide li {
    max-width: var(--measure);
  }
  .side {
    display: block;
    position: sticky;
    top: calc(var(--header-h) + var(--space-5));
    max-height: calc(100vh - var(--header-h) - var(--space-6));
    overflow-y: auto;
  }
}
@media (min-width: 1200px) {
  main.wrap.has-side {
    grid-template-columns: minmax(0, 1fr) 320px;
  }
  .guide {
    max-width: none;
  }
}
.side-card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: var(--space-4);
  margin-bottom: var(--space-4);
}
@media (min-width: 1000px) {
  .side-card {
    padding: var(--space-5);
    margin-bottom: var(--space-5);
  }
  nav.side-card {
    padding-bottom: calc(var(--space-5) - var(--space-2));
  }
}
.side-title {
  margin: 0 0 var(--space-2);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ink-2);
}
:is(.side, .g-left) ol {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.95rem;
  line-height: 1.35;
}
:is(.side, .g-left) ol li + li {
  margin-top: 2px;
}
:is(.side, .g-left) ol a {
  display: block;
  padding: var(--space-2) var(--space-3);
  border-left: 3px solid transparent;
  border-radius: 0 6px 6px 0;
  color: var(--ink-2);
  font-weight: 400;
  text-decoration: none;
}
:is(.side, .g-left) ol a:hover {
  color: var(--ink);
  background: var(--surface-2);
}
:is(.side, .g-left) ol a[aria-current='true'] {
  color: var(--brand);
  border-left-color: var(--brand);
  background: var(--brand-soft);
  font-weight: 600;
}
.side-cta p {
  margin: 0 0 var(--space-1);
  font-size: 0.95rem;
  color: var(--ink-2);
}
.side-cta .btn {
  display: flex;
  margin: var(--space-3) 0 0;
  text-align: center;
}
.side-cta .btn:hover {
  background: var(--surface-2);
}
.side-also,
.side-example {
  display: block;
  margin-top: var(--space-3);
  font-size: 0.92rem;
  text-align: center;
}
.side-more {
  margin: 0;
  font-size: 0.95rem;
}
/* "All guides": a tinted card with a book icon, a title, a short line and an arrow (owner, 17 Nov:
   "make it more obvious how to get to all guides") */
.all-guides {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  box-sizing: border-box;
  /* roomy above and below the words (owner, 17 Nov), the side cards' room at the sides */
  padding: 20px var(--space-4);
  border: 1px solid color-mix(in srgb, var(--brand) 22%, transparent);
  border-radius: var(--radius-lg);
  background: var(--brand-soft);
  color: var(--ink);
  text-decoration: none;
  transition: border-color 0.15s ease;
}
.all-guides:hover {
  border-color: color-mix(in srgb, var(--brand) 50%, transparent);
  color: var(--ink);
}
.all-guides .ag-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--surface);
  color: var(--brand);
}
.all-guides .ag-text {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.all-guides .ag-title {
  font-size: 0.95rem;
  font-weight: 650;
  line-height: 1.25;
}
.all-guides .ag-sub {
  overflow: hidden;
  color: var(--ink-2);
  font-size: 0.85rem;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.all-guides .ag-arrow {
  flex: none;
  color: var(--brand);
  font-size: 1.15rem;
  transition: transform 0.15s ease;
}
.all-guides:hover .ag-arrow {
  transform: translateX(3px);
}
@media (prefers-reduced-motion: reduce) {
  .all-guides .ag-arrow {
    transition: none;
  }
}
/* the left column (wide screens only) holds the contents list */
.g-left {
  display: none;
}
.g-more ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.g-more li + li {
  margin-top: var(--space-1);
}
.g-more a {
  display: block;
  padding: 6px 0;
  font-size: 0.92rem;
  line-height: 1.4;
  text-decoration: none;
}
.g-more a:hover {
  text-decoration: underline;
}

/* ---- very wide screens: three columns from 1400px, bigger text from 1700px, wider again from
   2200px. The header and footer follow the same page widths. */
@media (min-width: 1400px) {
  body:has(main.has-top) .site-footer .wrap,
  main.wrap.has-side.has-top {
    max-width: 1560px;
  }
  main.wrap.has-side.has-top:has(> .g-left) {
    grid-template-columns: 250px minmax(0, 1fr) 300px;
    gap: 0 var(--space-6);
  }
  .g-hero {
    grid-template-columns: minmax(0, 1fr) 480px;
  }
  .g-left {
    display: block;
    position: sticky;
    top: calc(var(--header-h) + var(--space-5));
    max-height: calc(100vh - var(--header-h) - var(--space-6));
    overflow-y: auto;
  }
  .g-left .side-card {
    margin: 0;
  }
}
@media (min-width: 1700px) {
  body:has(main.has-top) {
    font-size: 19px;
  }
}
@media (min-width: 2200px) {
  body:has(main.has-top) {
    font-size: 20px;
  }
  body:has(main.has-top) .site-footer .wrap,
  main.wrap.has-side.has-top {
    max-width: 1760px;
  }
  main.wrap.has-side.has-top:has(> .g-left) {
    grid-template-columns: 280px minmax(0, 1fr) 340px;
  }
}

/* ---- the guide lists (guides/ and guides/shares/): a grid of cards on wider screens */
.guide-list {
  list-style: none;
  padding: 0;
  display: grid;
  gap: var(--space-3);
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
}
.guide-list li {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: var(--space-5);
}
.guide-list li a {
  text-decoration: none;
}
.guide-list li a:hover strong {
  text-decoration: underline;
}

/* ---- the two list pages (guides/ and guides/shares/, `main.guide-index`): jump links, "Start with
   these" cards, then a grid of cards per section. Same calm look as the guide pages' cards. */
main.guide-index .g-jump {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin: 0 0 var(--space-5);
}
main.guide-index .g-jump a {
  padding: 6px 14px;
  border: 1px solid color-mix(in srgb, var(--brand) 35%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--brand-fill) 9%, var(--surface));
  color: var(--brand);
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.4;
  text-decoration: none;
}
main.guide-index .g-jump a:hover {
  border-color: var(--brand);
}
main.guide-index .g-jump a:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}
main.guide-index h2 {
  margin-top: var(--space-6);
}
/* room below each grid, the same as above each heading, so text after the last grid (the closing
   line and button) doesn't sit against the cards */
main.guide-index .guide-list {
  margin: var(--space-3) 0 var(--space-6);
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-4);
}
@media (min-width: 700px) {
  main.guide-index .guide-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (min-width: 1100px) {
  main.guide-index .guide-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
main.guide-index .guide-list.featured {
  grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 1000px) {
  main.guide-index .guide-list.featured {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
main.guide-index .guide-list li {
  position: relative;
  padding: var(--space-4) var(--space-5);
  font-size: 0.95rem;
  line-height: 1.5;
}
main.guide-index .guide-list li br {
  display: none;
}
main.guide-index .guide-list li a strong {
  display: block;
  margin-bottom: var(--space-1);
  font-size: 1.05rem;
  line-height: 1.35;
}
main.guide-index .guide-list li a:hover strong {
  text-decoration: none;
}
/* the whole card is the link: the title's link is stretched over it */
main.guide-index .guide-list li a::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
}
main.guide-index .guide-list li a:focus-visible {
  outline: none;
}
main.guide-index .guide-list li:has(a:focus-visible) {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}
main.guide-index .guide-list.featured li {
  padding: var(--space-5);
  border-color: color-mix(in srgb, var(--brand) 35%, transparent);
  background: color-mix(in srgb, var(--brand-fill) 5%, var(--surface));
  font-size: 1rem;
}
main.guide-index .guide-list.featured li a strong {
  font-size: 1.2rem;
}
main.guide-index .guide-list li:hover {
  border-color: color-mix(in srgb, var(--brand) 60%, var(--rule));
}
@media (prefers-reduced-motion: no-preference) {
  main.guide-index .guide-list li {
    transition:
      opacity 520ms ease-out,
      transform 300ms cubic-bezier(0.2, 0.7, 0.2, 1),
      border-color 200ms ease,
      box-shadow 200ms ease;
  }
  main.guide-index .guide-list li:hover {
    transform: translateY(-2px);
  }
}
/* wide screens: the page, and with it the header and footer, widen so the cards use the room
   (the header and footer rules are the guide pages' own, above) */
@media (min-width: 1400px) {
  main.wrap.guide-index {
    max-width: 1560px;
  }
}
@media (min-width: 2200px) {
  main.wrap.guide-index {
    max-width: 1760px;
  }
}
@media print {
  main.guide-index .guide-list {
    display: block;
  }
  main.guide-index .guide-list li {
    margin: 0 0 var(--space-3);
    box-shadow: none;
    break-inside: avoid;
    transform: none !important;
  }
  main.guide-index .guide-list li a::after,
  main.guide-index .g-jump {
    display: none;
  }
}
/* ---- supported-platforms page: status groups of platform cards. Fixed columns (1 on phones,
   2 from 640px, 3 from 1100px); cards in a row share one height; every card has the same shape:
   name, status badge, numbered steps, then any note pinned to the bottom. */
.platform-group {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-1) var(--space-3);
  margin: var(--space-6) 0 var(--space-1);
  font-size: 1.15rem;
  scroll-margin-top: calc(var(--sticky-h) + var(--space-4));
}
.platform-group .count {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
}
.group-blurb {
  margin: 0 0 16px;
  color: var(--muted);
}
.platform-grid {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
}
@media (min-width: 640px) {
  .platform-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (min-width: 1100px) {
  .platform-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
.platform {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  min-width: 0;
  padding: var(--space-5);
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  font-size: 0.95rem;
  line-height: 1.5;
  scroll-margin-top: calc(var(--sticky-h) + var(--space-4));
}
/* the card the Import screen linked to */
.platform:target {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px var(--brand);
}
.platform-head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}
.platform-head h4 {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
/* the app's badge: a borderless pill. The dot is a shape cue; its colours pass 3:1 in both themes */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: 0.8125rem;
  font-weight: 600;
}
.badge::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
}
.badge-auto::before {
  background: var(--gain);
}
.badge-preset::before {
  background: var(--brand);
}
.badge-columns::before {
  background: var(--warn);
}
.badge-none::before {
  background: var(--danger);
}
.platform .steps {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 1.4em;
}
/* one step: no "1." in front */
.platform .steps li:only-child {
  margin-left: -1.4em;
  list-style: none;
}
.platform-note {
  margin: auto 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.9rem;
}
main.index > p,
main.index .note {
  max-width: 80ch;
}
main.index .answer {
  max-width: var(--measure);
}

/* ---- Boxes have the same space inside at the top and the bottom: the first and last thing in a
   box never adds its own margin on top of the box's padding (see docs/LAYOUT_GUIDE.md). */
:where(.answer, .note, .card, .side-card, .platform, .guide-list li, .guide, .disclaimer)
  > :first-child {
  margin-top: 0;
}
:where(.answer, .note, .card, .side-card, .platform, .guide-list li, .guide, .disclaimer)
  > :last-child {
  margin-bottom: 0;
}
/* the guide and platform lists keep their own tight card spacing */
main .guide-list li + li,
main .platform li + li {
  margin-top: 0;
}
main .platform .steps li + li {
  margin-top: var(--space-1);
}

/* ---- footer: the same as the app's (brand and blurb, two link columns, a legal strip) */
.site-footer {
  margin-top: var(--space-6);
  padding: 40px 0 44px;
  border-top: 1px solid var(--rule);
  background: var(--surface);
  color: var(--ink-2);
  font-size: 0.92rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) repeat(2, minmax(0, 1fr));
  gap: 28px;
}
@media (max-width: 760px) {
  .footer-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
.footer-blurb {
  max-width: 46ch;
  margin: 12px 0 0;
}
.footer-grid h2 {
  margin: 0 0 12px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.3;
  color: var(--ink);
}
.footer-grid ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.footer-grid li + li {
  margin-top: 7px;
}
.footer-grid a,
.footer-legal a {
  color: var(--ink-2);
  font-weight: 400;
  text-decoration: none;
}
.footer-legal a {
  text-decoration: underline;
}
.footer-grid a:hover,
.footer-legal a:hover {
  color: var(--brand);
  text-decoration: underline;
}
.footer-legal {
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.85rem;
}
.footer-legal p {
  margin: 0 0 6px;
}
.footer-legal .footer-operator {
  margin-top: 6px;
  margin-bottom: 0;
}

/* ---- motion: hover and focus changes fade over 120ms, only for people who haven't asked for
   less motion (docs/DESIGN_RULES.md). Nothing else on these pages moves. */
@media (prefers-reduced-motion: no-preference) {
  a,
  .btn,
  .cta,
  .icon-btn,
  .navlink,
  :is(.side, .g-left) ol a {
    transition:
      color 120ms ease-out,
      background-color 120ms ease-out,
      border-color 120ms ease-out,
      box-shadow 120ms ease-out;
  }
  .btn:active,
  .cta:active {
    transition-duration: 60ms;
    translate: 0 1px;
  }
}

/* ---- motion (src/guides/motion.ts adds the classes; all of it off with reduced motion) ---- */

/* the reading line along the top of the window: a still bar that grows as you read */
.g-progress {
  position: fixed;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--brand);
  transform: scaleX(0);
  transform-origin: 0 50%;
  z-index: 60;
  pointer-events: none;
}
@media print {
  .g-progress {
    display: none;
  }
}

/* the gliding scroll library needs these two rules */
html.lenis,
html.lenis body {
  height: auto;
}
.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}

@media (prefers-reduced-motion: no-preference) {
  /* one load moment: crumb, then title, details and the answer card rise in */
  .g-play .g-crumb,
  .g-play h1,
  .g-play .g-meta,
  .g-play .g-answer {
    animation: g-rise 560ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
  }
  .g-play h1 {
    animation-delay: 60ms;
  }
  .g-play .g-meta {
    animation-delay: 160ms;
  }
  .g-play .g-answer {
    animation-delay: 260ms;
  }
  @keyframes g-rise {
    from {
      opacity: 0;
      transform: translateY(14px);
    }
  }

  /* tables and notes below the fold ease in once as they come into view */
  .g-reveal {
    opacity: 0;
    transform: translateY(16px);
    transition:
      opacity 520ms ease-out,
      transform 520ms cubic-bezier(0.2, 0.7, 0.2, 1);
  }
  .g-reveal.g-in {
    opacity: 1;
    transform: none;
  }

  /* the contents list's highlight slides rather than snaps */
  main.has-top :is(.side, .g-left) ol a {
    transition:
      background-color 200ms ease,
      color 200ms ease,
      border-color 200ms ease;
  }
}

/* printing: nothing may wait invisible (also covers a browser that skips the beforeprint event) */
@media print {
  .g-reveal,
  .g-play .g-crumb,
  .g-play h1,
  .g-play .g-meta,
  .g-play .g-answer {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
    animation: none !important;
  }
}

/* ---- Moving between the help pages and the app fades instead of jumping (owner, 17 Nov 2026).
   Both kinds of page opt in (the app in bank-motion.css). The top bar has the same name on both
   and is the same on both, so it doesn't fade: it stays put while the page below cross-fades. */
@media screen and (prefers-reduced-motion: no-preference) {
  @view-transition {
    navigation: auto;
  }
  .site-header {
    view-transition-name: bank-top;
  }
  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation-duration: 200ms;
  }
  ::view-transition-group(bank-top),
  ::view-transition-old(bank-top),
  ::view-transition-new(bank-top) {
    animation: none;
  }
}
