/*
 * EncodeLabel: the one stylesheet every page shares.
 * The look: black ink on white paper, like a label, with one bright accent,
 * square-ish corners and a quiet barcode / registration-mark motif.
 */

/* ==========================================================================
   PALETTE  (the brand step replaces ONLY this block: light, then dark)
   Every colour on the site comes from these names. Nothing below this block
   holds a colour of its own, except the label preview, which is always
   black on white because that is what comes out of the printer.
   ========================================================================== */
:root {
  --paper: #f5f6f8;        /* page background: a cool off-white, like label backing paper */
  --card: #ffffff;         /* boxes that sit on the page */
  --ink: #0b0d12;          /* text, and the bars in the logo */
  --muted: #565d6b;        /* quieter text */
  --line: #dde0e6;         /* hairlines, card borders */
  --field: #ffffff;        /* inside of inputs */
  --field-line: #848b99;   /* input and plain-button borders (3.4:1 on white) */
  --brand: #2d5bff;        /* Signal blue, the one accent: main buttons, the current tab, the waves in the logo */
  --brand-hover: #1f47e0;
  --brand-ink: #ffffff;    /* text on the accent (5.2:1) */
  --link: #1c40d6;         /* a shade deeper than the accent, so small text is easy to read (7:1) */
  --soft: #eef2ff;         /* tinted background: hover, chosen chip, info note */
  --ok: #0d6b43;       --ok-soft: #e0f3e9;
  --error: #b3231a;    --error-soft: #fdecea;
  --warn: #7a4a00;     --warn-soft: #fcf0d3;
  --focus: #2d5bff;        /* keyboard focus ring (always drawn with a 2px gap, so it shows around a blue button too) */
  --desk: #dfe2e8;         /* the "desk" a label sheet preview lies on */
  --desk-line: #cbd0d9;
  --backdrop: rgba(11, 13, 18, .5);   /* the dimmed page behind a pop-up */
  --shadow: 0 1px 2px rgba(11, 13, 18, .05), 0 6px 20px rgba(11, 13, 18, .05);
  --shadow-float: 0 2px 6px rgba(11, 13, 18, .1), 0 16px 44px rgba(11, 13, 18, .18);
  color-scheme: light;
}

/* The dark colours are kept, but the site no longer follows a phone's or a
   computer's Dark Mode: the owner found it too dark (October 2026), so every
   visitor gets the light look above. Dark is each person's own choice: the
   moon button in the top bar (.theme-toggle, further down) sends it to
   theme.php, which keeps it in the el_theme cookie; includes/header.php then
   prints data-theme="dark" on <html> and this block applies. The --paper
   below is also typed into header.php (the theme-color line): change both.
   "screen" on purpose: paper is always printed with the light colours. */
@media screen {
  :root[data-theme="dark"] {
    --paper: #0d0f14;
    --card: #171a21;
    --ink: #f2f4f7;
    --muted: #a3aab7;
    --line: #2b2f3a;
    --field: #101218;
    --field-line: #6b7383;
    --brand: #3d66ff;      /* Signal blue one step lighter so it does not sink into black; white text on it is 4.6:1, so go no lighter */
    --brand-hover: #2a55f0; /* deeper, not lighter: a lighter blue would drop white text below 4.5:1 */
    --brand-ink: #ffffff;
    --link: #9db5ff;
    --soft: #182149;
    --ok: #5ed3a0;       --ok-soft: #10301f;
    --error: #ff9087;    --error-soft: #3a1917;
    --warn: #f3c267;     --warn-soft: #3a2c0e;
    --focus: #9db5ff;
    --desk: #23262e;
    --desk-line: #353945;
    --backdrop: rgba(0, 0, 0, .62);
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25);
    --shadow-float: 0 2px 6px rgba(0, 0, 0, .4), 0 16px 44px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}
/* ========================= end of PALETTE ================================= */

/*
 * COMPONENT INDEX (copy-paste markup for each is in the builders' css.md)
 *
 *  Layout      .wrap  .narrow  .page-head  .section  .section-head  .stack  .row  .spread
 *              .grid (.grid-2 .grid-3 .grid-4 .grid-auto)  .lead  .small  .fine-print  .back  .more-link
 *  Buttons     .btn  + .btn-primary .btn-secondary .btn-ghost .btn-danger
 *              + .btn-small .btn-large .btn-icon .btn-block   .link-button  .button-row
 *  Boxes       .card (.card-link)  .alert (.alert-ok -error -warn -info)  .badge  .pill  .kicker
 *              .tiles/.tile  .empty-note  .marks (corner marks)  .bars (barcode strip)
 *  Forms       .field  .field-row  .hint  .error  .optional  .check  .switch  .segmented
 *              .chip/.chip-list  .dropzone  .stepper  .input-group  .form-actions  .form-foot  .hp
 *              every input type: text email tel password number url search date file range color
 *              checkbox radio, plus textarea and select
 *  Pieces      .tabs (.tab-list .tab .tab-panel)  .table-wrap + table  .step-list  .faq-list
 *              .legal (.legal-page .legal-toc .legal-table)  .toolbar  .status-line  .spinner
 *              .skeleton  .icon  .setting  .menu
 *  Tools       .tool (.tool-controls .tool-stage .tool-preview .tool-actions)  .tool-panel
 *              .sheet-preview (.sheet-paper)
 *  Pop-ups     .dialog (.dialog-head .dialog-body .dialog-actions; -small -medium -large -sheet)
 *              .toast  .cookie-banner  .feedback-button
 *  Helpers     .visually-hidden  .only-in-browser  .no-print  .print-only  .print-layer  .num  .mono
 *
 * Breakpoints (CSS variables don't work in media queries, so they are numbers here):
 *   560px   field rows stack, pop-ups become bottom sheets
 *   760px   the tool layout stacks: preview on top, controls, action bar at the bottom
 *   1120px  the header's links fold into the Menu button
 */

/* ---- Things that are not colours ---------------------------------------- */
:root {
  --radius: 8px;           /* cards, pop-ups: a label's corner, not a pill */
  --radius-small: 5px;     /* buttons, inputs, chips */
  --display: ui-sans-serif, system-ui, -apple-system, "Segoe UI Variable Display", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, "Cascadia Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --gutter: 20px;          /* space at the left and right edge of the page */
  --header-h: 60px;
  /* The label preview never changes with the theme. */
  --sheet: #ffffff;
  --sheet-ink: #000000;
  /* What sits on top of what. Pop-ups (<dialog>) are above all of these. */
  --z-sticky: 30;
  --z-header: 50;
  --z-float: 60;
  --z-banner: 70;
  --z-toast: 80;
}

/* ---- Base ---------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
/* "hidden" always wins, even over a button's own display. */
[hidden] { display: none !important; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scrollbar-gutter: stable; /* no sideways jump when a pop-up hides the scroll bar */
  scroll-padding-top: calc(var(--header-h) + 16px); /* #links don't land under the sticky header */
  scroll-padding-bottom: var(--banner-space, 0px); /* nor does a box reached with the Tab key hide under the cookie banner */
}
/* The page behind an open pop-up doesn't scroll. The strip kept free for the scroll bar
   (scrollbar-gutter, above) is dimmed like the rest of the page, so no bright stripe is
   left beside the pop-up on Windows. */
html:has(dialog[open]) { overflow: hidden; }
@media screen {
  html:has(dialog[open]) { background: linear-gradient(var(--backdrop), var(--backdrop)), var(--paper); }
}
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh; /* the visible height on phones, whose 100vh runs under the toolbar */
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font: 1rem/1.55 var(--body);
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}
main { flex: 1; min-width: 0; }
img, svg, canvas, video { max-width: 100%; }
img { height: auto; }
a { color: var(--link); text-underline-offset: .15em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
::selection { background: var(--brand); color: var(--brand-ink); }
hr { height: 1px; margin: 28px 0; border: 0; background: var(--line); }
code, kbd, samp, pre, .mono { font-family: var(--mono); font-size: .92em; }
code { padding: .1em .35em; border-radius: 3px; background: color-mix(in srgb, var(--ink) 7%, transparent); }
pre { overflow-x: auto; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius-small); background: var(--card); }
pre code { padding: 0; background: none; }
kbd { padding: .1em .4em; border: 1px solid var(--field-line); border-bottom-width: 2px; border-radius: 4px; background: var(--card); }

h1, h2, h3, h4 {
  margin: 0 0 .45em;
  font-family: var(--display);
  font-weight: 750;
  line-height: 1.15;
  letter-spacing: -.02em;
  text-wrap: balance;
}
h1 { font-size: clamp(1.75rem, 1.4rem + 1.6vw, 2.5rem); font-weight: 800; letter-spacing: -.03em; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.1rem; letter-spacing: -.01em; }
h4 { font-size: 1rem; letter-spacing: 0; }
p, ul, ol, dl { margin: 0 0 1em; }

.lead { max-width: 38em; color: var(--muted); font-size: 1.15rem; }
.small { font-size: .9rem; }
.muted { color: var(--muted); }
.center { text-align: center; }
.center .button-row, .center .form-actions { justify-content: center; }
pre.debug { margin-top: 20px; font-size: .8rem; text-align: left; white-space: pre-wrap; }
.fine-print { color: var(--muted); font-size: .85rem; }
.btn + .fine-print, .button-row + .fine-print, .form-actions + .fine-print { margin-top: 12px; }
.num { font-variant-numeric: tabular-nums; }
.back { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; color: var(--muted); font-size: .9rem; text-decoration: none; }
.back:hover { color: var(--ink); }
/* A link that stands on a line of its own is as tall as a button under a finger (44px), like
   .back: the link beside a section's heading, the one under a log-in style form, and any link
   given the class more-link ("See every barcode type"). Links inside a sentence are left alone. */
@media (pointer: coarse) {
  .section-head > a, .form-foot a, .more-link { display: inline-flex; align-items: center; min-height: 44px; }
}

.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}
/* Links to "Add to Home Screen" make no sense inside the installed app. */
@media (display-mode: standalone) { .only-in-browser { display: none !important; } }

.skip-link {
  position: absolute; top: 8px; left: -9999px; z-index: calc(var(--z-header) + 5);
  padding: 10px 16px; border-radius: var(--radius-small);
  background: var(--ink); color: var(--paper); font-weight: 600; text-decoration: none;
}
.skip-link:focus { left: 8px; }

/* ---- Icons --------------------------------------------------------------- */
/* Every icon is a 24-unit line drawing in the colour of the text beside it. */
.icon { flex: none; width: 1.25em; height: 1.25em; vertical-align: -.25em; }
/* <span data-icon="print"></span>: site.js draws the icon in; the space is kept so nothing jumps. */
[data-icon] { display: inline-flex; flex: none; width: 1.25em; height: 1.25em; vertical-align: -.25em; }
[data-icon] > svg { width: 100%; height: 100%; }

/* ---- Layout -------------------------------------------------------------- */
.wrap {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  /* max(): in landscape a phone's notch eats into the side of the page */
  padding-left: max(var(--gutter), env(safe-area-inset-left));
  padding-right: max(var(--gutter), env(safe-area-inset-right));
}
main.wrap { padding-top: 28px; padding-bottom: 56px; }
/* Tool pages ('wide' => true) use the whole window. */
.is-wide .wrap { max-width: 1680px; }
.is-wide main.wrap { padding-top: 16px; padding-bottom: 32px; }
.narrow { max-width: 460px; margin-left: auto; margin-right: auto; }
.narrow h1 { font-size: clamp(1.75rem, 1.5rem + 1vw, 2rem); } /* a full-size page heading shouts in a box this small */
.reading { max-width: 46rem; }

.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; margin: 0 0 24px; }
.page-head h1 { margin: 0; }
.page-head > div > :last-child { margin-bottom: 0; }
.page-head .lead { margin-top: 8px; }
.section { margin: 48px 0; }
.section:first-child { margin-top: 0; }
.section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 16px; margin: 0 0 16px; }
.section-head > * { margin: 0; }

.stack > * + * { margin-top: 16px; }
.stack > * { margin-bottom: 0; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.spread { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
.grid { display: grid; gap: 20px; }
.grid > * { min-width: 0; margin-bottom: 0; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
@media (max-width: 900px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 360px) {
  :root { --gutter: 14px; }
}

/* ---- The motif: a barcode strip and corner marks -------------------------- */
/* .bars is a decorative strip of bars in the text colour (aria-hidden in the page). */
.bars {
  display: inline-block; width: 96px; height: 18px; vertical-align: middle;
  background: repeating-linear-gradient(90deg,
    currentColor 0 2px, transparent 2px 4px, currentColor 4px 5px, transparent 5px 8px,
    currentColor 8px 11px, transparent 11px 12px, currentColor 12px 13px, transparent 13px 16px,
    currentColor 16px 18px, transparent 18px 19px, currentColor 19px 20px, transparent 20px 24px);
}
/* .marks draws four small corner marks just outside a box, like the trim marks on a printed sheet. */
.marks { position: relative; }
.marks::before {
  --m: var(--muted); --l: 10px; --t: 1px;
  content: ""; position: absolute; inset: -6px; pointer-events: none;
  background:
    linear-gradient(var(--m), var(--m)) top left / var(--l) var(--t) no-repeat,
    linear-gradient(var(--m), var(--m)) top left / var(--t) var(--l) no-repeat,
    linear-gradient(var(--m), var(--m)) top right / var(--l) var(--t) no-repeat,
    linear-gradient(var(--m), var(--m)) top right / var(--t) var(--l) no-repeat,
    linear-gradient(var(--m), var(--m)) bottom left / var(--l) var(--t) no-repeat,
    linear-gradient(var(--m), var(--m)) bottom left / var(--t) var(--l) no-repeat,
    linear-gradient(var(--m), var(--m)) bottom right / var(--l) var(--t) no-repeat,
    linear-gradient(var(--m), var(--m)) bottom right / var(--t) var(--l) no-repeat;
}

/* ---- Small labels: kicker, badge, pill ----------------------------------- */
/* The line above a heading, set like the small print on a label, after four tiny bars. */
.kicker {
  display: flex; align-items: center; gap: 8px; margin: 0 0 10px;
  color: var(--muted); font: 600 .75rem/1.3 var(--mono); letter-spacing: .12em; text-transform: uppercase;
}
.kicker::before {
  content: ""; flex: none; width: 13px; height: 11px;
  background: linear-gradient(90deg, var(--brand) 0 2px, transparent 2px 4px, var(--brand) 4px 5px, transparent 5px 7px, var(--brand) 7px 10px, transparent 10px 12px, var(--brand) 12px 13px);
}
.badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 6px;
  border: 1px solid currentColor; border-radius: 3px;
  color: var(--muted); font: 700 .68rem/1.4 var(--mono); letter-spacing: .06em; text-transform: uppercase; white-space: nowrap;
  vertical-align: .12em;
}
.badge-new { border-color: var(--brand); background: var(--brand); color: var(--brand-ink); }
.badge-ok { color: var(--ok); background: var(--ok-soft); }
.badge-warn { color: var(--warn); background: var(--warn-soft); }
.badge-error { color: var(--error); background: var(--error-soft); }
.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px;
  background: var(--soft); color: var(--ink); font-size: .85rem; font-weight: 500; white-space: nowrap;
}

/* ---- Buttons ------------------------------------------------------------- */
/* The same classes go on <a> and <button>. One .btn-primary per group of actions. */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 9px 16px;
  border: 1px solid var(--field-line); border-radius: var(--radius-small);
  background: var(--card); color: var(--ink);
  font: 600 .95rem/1.2 var(--body); text-align: center; text-decoration: none; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color .15s, border-color .15s, color .15s, transform .1s;
}
.btn:hover { border-color: var(--ink); background: color-mix(in srgb, var(--ink) 5%, var(--card)); }
.btn:active { transform: translateY(1px); }
.btn-primary { border-color: var(--brand); background: var(--brand); color: var(--brand-ink); }
.btn-primary:hover { border-color: var(--brand-hover); background: var(--brand-hover); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { border-color: transparent; background: color-mix(in srgb, var(--ink) 8%, transparent); }
.btn-danger { border-color: currentColor; background: transparent; color: var(--error); }
.btn-danger:hover { border-color: currentColor; background: var(--error-soft); }
.btn-small { min-height: 36px; padding: 6px 12px; font-size: .875rem; }
.btn-large { min-height: 52px; padding: 13px 24px; font-size: 1.05rem; }
.btn-icon { width: 44px; padding: 0; }
.btn-icon.btn-small { width: 36px; }
.btn-icon.btn-large { width: 52px; }
.btn-block { display: flex; width: 100%; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; transform: none; }
/* A button that stays down: Bold, "show outlines"... */
.btn[aria-pressed="true"] { border-color: var(--ink); background: var(--ink); color: var(--paper); }
/* Fingers need 44px even for the small ones. */
@media (pointer: coarse) {
  .btn-small { min-height: 44px; }
  .btn-icon.btn-small { width: 44px; }
}
.button-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.link-button {
  padding: 0; border: 0; background: none; color: var(--link);
  font: inherit; text-decoration: underline; text-underline-offset: .15em; cursor: pointer;
}
.link-button:hover { text-decoration-thickness: 2px; }
.link-button.danger { color: var(--error); }

.spinner {
  display: inline-block; flex: none; width: 1.1em; height: 1.1em; vertical-align: -.2em;
  border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
/* A grey block where something is still loading. */
.skeleton {
  display: block; min-height: 1em; border-radius: var(--radius-small);
  background: var(--line); /* for browsers a year or two old, which don't know color-mix() */
  background: linear-gradient(90deg, var(--line) 25%, color-mix(in srgb, var(--line) 50%, var(--card)) 50%, var(--line) 75%) 0 0 / 200% 100%;
  animation: skeleton 1.4s ease-in-out infinite;
}
@keyframes skeleton { to { background-position: -200% 0; } }

/* ---- Cards, alerts, tiles -------------------------------------------------- */
.card {
  margin-top: 0; margin-bottom: 24px; padding: 24px; /* left and right are left alone, so "card narrow" can centre itself */
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--card); box-shadow: var(--shadow);
}
.card > :last-child { margin-bottom: 0; }
.grid > .card { margin-bottom: 0; }
/* Buttons written straight into a paragraph keep a little air when they wrap onto two lines. */
p > .btn { margin: 3px 2px 3px 0; }
/* A whole card that is a link (home page tool cards, "My labels"). */
a.card, .card-link { display: block; color: var(--ink); text-decoration: none; transition: border-color .15s, transform .15s; }
a.card:hover, .card-link:hover { border-color: var(--ink); transform: translateY(-2px); }
@media (max-width: 560px) {
  .card { padding: 18px 16px; }
}

.alert {
  position: relative; margin: 0 0 20px; padding: 12px 14px 12px 16px;
  border-left: 4px solid var(--link); border-radius: var(--radius-small);
  background: var(--soft); color: var(--ink);
}
.alert > :last-child { margin-bottom: 0; }
.alert-ok { border-left-color: var(--ok); background: var(--ok-soft); }
.alert-error { border-left-color: var(--error); background: var(--error-soft); }
.alert-warn { border-left-color: var(--warn); background: var(--warn-soft); }
.alert-info { border-left-color: var(--link); background: var(--soft); }
/* site.js adds a ✕ to the message at the top of the page. */
.alert.has-close { padding-right: 52px; }
.alert-close {
  position: absolute; top: 2px; right: 2px; display: grid; place-items: center; width: 44px; height: 44px;
  border: 0; border-radius: var(--radius-small); background: none; color: inherit; cursor: pointer;
}
.alert-close:hover { background: color-mix(in srgb, var(--ink) 8%, transparent); }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin: 0 0 24px; padding: 0; list-style: none; }
.tile { margin: 0; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
.tile-value { display: block; font: 800 1.7rem/1.1 var(--display); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.tile-label { display: block; margin-top: 4px; color: var(--muted); font-size: .85rem; }
a.tile { color: var(--ink); text-decoration: none; transition: border-color .15s; }
a.tile:hover { border-color: var(--ink); }

.empty-note {
  margin: 0 0 24px; padding: 28px 20px; border: 1px dashed var(--field-line); border-radius: var(--radius);
  color: var(--muted); text-align: center;
}
.empty-note > :last-child { margin-bottom: 0; }
.empty-note .bars { display: block; margin: 0 auto 14px; opacity: .45; }

/* A label on the left, its control on the right (Account page). */
.setting { display: flex; align-items: center; justify-content: space-between; gap: 12px 24px; padding: 14px 0; border-top: 1px solid var(--line); }
.setting:first-child { border-top: 0; }
.setting > :first-child { min-width: 0; }
.setting p { margin: 0; }
/* "Show them" under Paper sizes and print adjustments: a 44 px touch target that keeps its open/closed triangle. */
.setting details > summary { width: fit-content; min-height: 44px; padding: 11px 0; cursor: pointer; }
@media (max-width: 560px) {
  .setting { flex-direction: column; align-items: stretch; }
}

/* ---- Forms ---------------------------------------------------------------- */
.field { margin: 0 0 16px; }
.field > label, .field-label { display: block; margin: 0 0 6px; font-size: .92rem; font-weight: 600; }
.optional { color: var(--muted); font-weight: 400; }
.hint { margin: 6px 0 0; color: var(--muted); font-size: .85rem; }
.error { margin: 6px 0 0; color: var(--error); font-size: .85rem; font-weight: 600; }
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
.field-row.thirds { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 560px) {
  .field-row { grid-template-columns: minmax(0, 1fr); }
  .field-row.thirds, .field-row.keep { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 20px; }
.form-foot { margin: 20px 0 0; color: var(--muted); font-size: .92rem; text-align: center; }
fieldset { min-width: 0; margin: 0 0 16px; padding: 0; border: 0; }
legend { margin: 0 0 6px; padding: 0; font-size: .92rem; font-weight: 600; }
/* The trap for robots: off screen rather than display:none, so they still fill it in. */
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* Every box you type in. :where() keeps this easy to override. */
:where(input:not([type="checkbox"], [type="radio"], [type="range"], [type="color"], [type="file"], [type="hidden"], [type="submit"], [type="button"], [type="reset"], [type="image"]), textarea, select) {
  display: block; width: 100%; min-height: 44px; margin: 0; padding: 9px 12px;
  border: 1px solid var(--field-line); border-radius: var(--radius-small);
  background-color: var(--field); color: var(--ink);
  font: inherit; font-size: max(16px, 1rem); /* 16px or more stops iPhones zooming in on the box */
  line-height: 1.4;
  -webkit-appearance: none; appearance: none;
}
textarea { min-height: 112px; resize: vertical; }
::placeholder { color: var(--muted); opacity: .9; } /* .9 keeps the example text at 5:1 on a white box; .8 was 4.1:1 */
select {
  padding-right: 36px; cursor: pointer;
  /* the little triangle, drawn from the theme's own colour */
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
  background-size: 5px 5px; background-repeat: no-repeat;
}
select[multiple], select[size]:not([size="1"]) { padding-right: 12px; background-image: none; }
:where(input, textarea, select):focus-visible {
  border-color: var(--focus);
  outline: 2px solid transparent; /* shows in Windows high-contrast mode, where the ring below is dropped */
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 28%, transparent);
}
:where(input, textarea, select):disabled { opacity: .55; cursor: not-allowed; }
.has-error :where(input, textarea, select), :where(input, textarea, select)[aria-invalid="true"] { border-color: var(--error); }
input[type="number"] { font-variant-numeric: tabular-nums; }
input[type="search"]::-webkit-search-decoration { -webkit-appearance: none; }

/* Checkboxes and radio buttons keep the browser's own drawing, in the accent colour. */
input[type="checkbox"], input[type="radio"] { flex: none; width: 20px; height: 20px; margin: 0; accent-color: var(--brand); cursor: pointer; }
.check { display: flex; align-items: flex-start; gap: 10px; min-height: 44px; padding: 10px 0; cursor: pointer; }
.check input { margin-top: 2px; }
.check + .btn { margin-top: 6px; } /* "Show password" straight above a button: the same gap as under a box */
.check-list { margin: 0 0 16px; padding: 0; list-style: none; }

input[type="range"] { display: block; width: 100%; min-height: 44px; margin: 0; accent-color: var(--brand); cursor: pointer; }
input[type="color"] {
  flex: none; width: 52px; height: 44px; padding: 4px;
  border: 1px solid var(--field-line); border-radius: var(--radius-small); background: var(--field); cursor: pointer;
}
input[type="file"] { max-width: 100%; color: var(--muted); font: inherit; font-size: .9rem; }
input[type="file"]::file-selector-button {
  min-height: 40px; margin: 0 12px 0 0; padding: 6px 14px;
  border: 1px solid var(--field-line); border-radius: var(--radius-small);
  background: var(--card); color: var(--ink); font: 600 .9rem/1.2 var(--body); cursor: pointer;
}
input[type="file"]::file-selector-button:hover { border-color: var(--ink); }

/* A box with a unit or a button fixed to its end: [ 2.625 | in ] */
.input-group { display: flex; align-items: stretch; }
.input-group > :where(input, select) { flex: 1; min-width: 0; }
.input-group > :not(:first-child) { border-top-left-radius: 0; border-bottom-left-radius: 0; margin-left: -1px; }
.input-group > :not(:last-child) { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.input-group > :focus-visible { position: relative; z-index: 1; }
.input-affix {
  display: inline-flex; align-items: center; padding: 0 12px;
  border: 1px solid var(--field-line); border-radius: var(--radius-small);
  background: color-mix(in srgb, var(--ink) 5%, var(--field)); color: var(--muted); font-size: .9rem; white-space: nowrap;
}

/* On/off switch: a real checkbox underneath, drawn as a square-cornered slider. */
.switch { position: relative; display: inline-flex; align-items: center; gap: 12px; min-height: 44px; cursor: pointer; }
.switch input { position: absolute; top: 50%; left: 0; width: 46px; height: 26px; margin: -13px 0 0; opacity: 0; cursor: pointer; }
.switch-track {
  position: relative; flex: none; width: 46px; height: 26px;
  border: 1px solid var(--field-line); border-radius: 4px; background: var(--field);
  transition: background-color .15s, border-color .15s;
}
.switch-track::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px;
  border-radius: 2px; background: var(--field-line); transition: transform .15s, background-color .15s;
}
.switch input:checked + .switch-track { border-color: var(--brand); background: var(--brand); }
.switch input:checked + .switch-track::after { background: var(--brand-ink); transform: translateX(20px); }
.switch input:focus-visible + .switch-track { outline: 3px solid var(--focus); outline-offset: 2px; }
.switch input:disabled + .switch-track { opacity: .5; }

/* Pick one of a few: [ in | mm ]. Radio buttons underneath (or buttons with aria-pressed). */
.segmented {
  display: inline-flex; max-width: 100%; padding: 3px; gap: 2px;
  border: 1px solid var(--field-line); border-radius: var(--radius-small); background: var(--field);
}
.segmented > label { position: relative; display: flex; flex: 1 1 auto; cursor: pointer; }
.segmented input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.segmented > label > span, .segmented > button {
  display: flex; flex: 1 1 auto; align-items: center; justify-content: center; gap: 6px;
  min-height: 36px; padding: 6px 14px; border: 0; border-radius: 3px;
  background: none; color: var(--ink); font: 500 .92rem/1.2 var(--body); white-space: nowrap; cursor: pointer;
  transition: background-color .15s, color .15s;
}
.segmented > label:hover > span, .segmented > button:hover { background: color-mix(in srgb, var(--ink) 8%, transparent); }
.segmented input:checked + span, .segmented > button[aria-pressed="true"] { background: var(--ink); color: var(--paper); font-weight: 600; }
.segmented input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.segmented.segmented-block { display: flex; }
@media (pointer: coarse) {
  .segmented > label > span, .segmented > button { min-height: 40px; }
}

/* Chips: small boxes you tick. Checkboxes or radios underneath, or buttons with aria-pressed. */
.chip-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; padding: 0; list-style: none; }
.chip { position: relative; display: inline-flex; cursor: pointer; }
.chip input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.chip > span, button.chip, a.chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 6px 12px;
  border: 1px solid var(--field-line); border-radius: var(--radius-small);
  background: var(--card); color: var(--ink); font: 500 .92rem/1.2 var(--body); text-decoration: none; cursor: pointer;
  transition: background-color .15s, border-color .15s;
}
.chip:hover > span, button.chip:hover, a.chip:hover { border-color: var(--ink); }
.chip input:checked + span, button.chip[aria-pressed="true"], a.chip[aria-current] {
  border-color: var(--brand); background: var(--soft); box-shadow: inset 0 0 0 1px var(--brand); font-weight: 600;
}
.chip input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.chip input:disabled + span { opacity: .5; cursor: not-allowed; }
@media (pointer: coarse) {
  .chip > span, button.chip, a.chip { min-height: 44px; }
}

/* Drop a file here. The ordinary file button inside it always works too. */
.dropzone {
  display: flex; flex-direction: column; align-items: center; gap: 6px; margin: 0 0 16px; padding: 24px 16px;
  border: 2px dashed var(--field-line); border-radius: var(--radius);
  background: var(--card); color: var(--muted); text-align: center; cursor: pointer;
  transition: background-color .15s, border-color .15s;
}
.dropzone strong { color: var(--ink); font-size: 1rem; }
.dropzone .icon, .dropzone [data-icon] { width: 28px; height: 28px; color: var(--ink); }
.dropzone input[type="file"] { margin-top: 8px; }
.dropzone:hover, .dropzone:focus-within { border-color: var(--ink); }
.dropzone.is-over { border-color: var(--brand); border-style: solid; background: var(--soft); }

/* A number with − and + buttons: [ − | 3 | + ] */
.stepper { display: inline-flex; align-items: stretch; }
.stepper > button {
  display: grid; place-items: center; flex: none; width: 44px; min-height: 44px; padding: 0;
  border: 1px solid var(--field-line); background: var(--card); color: var(--ink);
  font: 600 1.2rem/1 var(--body); cursor: pointer;
}
.stepper > button:first-child { border-radius: var(--radius-small) 0 0 var(--radius-small); }
.stepper > button:last-child { border-radius: 0 var(--radius-small) var(--radius-small) 0; }
.stepper > button:hover { background: color-mix(in srgb, var(--ink) 6%, var(--card)); }
.stepper > button:disabled { opacity: .5; cursor: not-allowed; }
.stepper > input {
  width: 4.5em; min-width: 0; margin: 0 -1px; border-radius: 0; text-align: center;
  -moz-appearance: textfield; appearance: textfield;
}
.stepper > input::-webkit-inner-spin-button, .stepper > input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.stepper > :focus-visible { position: relative; z-index: 1; }

/* The quiet line that says what just happened: "Check digit 2 added". Always role="status". */
.status-line { display: flex; align-items: baseline; gap: 8px; min-height: 1.5em; margin: 8px 0 0; color: var(--muted); font-size: .9rem; }
.status-line:empty::before { display: none; }
.status-line::before { content: ""; flex: none; align-self: center; width: 8px; height: 8px; border-radius: 1px; background: currentColor; }
.status-line.is-ok { color: var(--ok); }
.status-line.is-error { color: var(--error); font-weight: 600; }
.status-line.is-warn { color: var(--warn); }
.status-line.is-info { color: var(--muted); }
.status-line.is-busy::before {
  width: .9em; height: .9em; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%;
  background: none; animation: spin .7s linear infinite;
}
form[data-sending] [type="submit"] { cursor: progress; }

/* ---- Tabs ------------------------------------------------------------------ */
.tab-list {
  display: flex; gap: 2px; margin: 0; padding: 0; list-style: none;
  border-bottom: 1px solid var(--line);
  overflow-x: auto; scrollbar-width: none; /* many tabs scroll sideways inside the strip */
}
.tab-list::-webkit-scrollbar { display: none; }
.tab {
  display: inline-flex; flex: none; align-items: center; gap: 6px; min-height: 44px; padding: 8px 14px;
  border: 0; border-bottom: 3px solid transparent; border-radius: var(--radius-small) var(--radius-small) 0 0;
  background: none; color: var(--muted); font: 500 .95rem/1.2 var(--body); text-decoration: none; white-space: nowrap; cursor: pointer;
}
.tab:hover { color: var(--ink); background: color-mix(in srgb, var(--ink) 5%, transparent); }
.tab[aria-selected="true"], .tab[aria-current="page"] { border-bottom-color: var(--brand); color: var(--ink); font-weight: 650; }
.tab:focus-visible { outline-offset: -3px; }
.tab-panel { padding-top: 18px; }
.tab-panel > :last-child { margin-bottom: 0; }

/* ---- Tables ---------------------------------------------------------------- */
table { width: 100%; border-collapse: collapse; font-size: .93rem; }
th, td { padding: 9px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: var(--muted); font-size: .75rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; white-space: nowrap; }
tbody tr:last-child > * { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
/* A wide table scrolls sideways inside this box; the page itself never does.
   position: relative keeps everything in the table, even screen-reader-only labels, inside the scroll. */
.table-wrap {
  position: relative; overflow-x: auto; margin: 0 0 24px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--card);
  -webkit-overflow-scrolling: touch;
}
.table-wrap th { background: color-mix(in srgb, var(--ink) 3%, var(--card)); }

/* ---- Content pieces: steps, questions, policies ----------------------------- */
.step-list { display: grid; gap: 18px; margin: 0 0 24px; padding: 0; list-style: none; counter-reset: step; }
.step-list > li { position: relative; min-height: 32px; padding-left: 46px; counter-increment: step; }
.step-list > li::before {
  content: counter(step); position: absolute; top: 0; left: 0; display: grid; place-items: center; width: 32px; height: 32px;
  border-radius: var(--radius-small); background: var(--ink); color: var(--paper); font: 700 .9rem/1 var(--mono);
}
.step-list h3 { margin: 4px 0 4px; }
.step-list p { margin: 0; color: var(--muted); }
/* Side by side on wide screens. */
.step-list.step-row { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 24px; }
/* The same numbered square, for use on its own. */
.step-number {
  display: inline-grid; place-items: center; flex: none; width: 26px; height: 26px;
  border-radius: 4px; background: var(--ink); color: var(--paper); font: 700 .8rem/1 var(--mono);
}

.faq-list { margin: 0 0 24px; }
.faq-list > div, .faq-list > details { padding: 16px 0; border-top: 1px solid var(--line); }
.faq-list > :last-child { border-bottom: 1px solid var(--line); }
.faq-list dt, .faq-list summary { font-family: var(--display); font-size: 1.05rem; font-weight: 700; letter-spacing: -.01em; }
.faq-list dd { margin: 6px 0 0; color: var(--muted); }
.faq-list summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; margin: -10px 0; list-style: none; cursor: pointer; }
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after { content: "+"; flex: none; color: var(--muted); font: 400 1.5rem/1 var(--mono); }
.faq-list details[open] > summary::after { content: "\2212"; }
.faq-list details > :not(summary) { margin: 14px 0 0; color: var(--muted); }

.legal { max-width: 46rem; font-size: 1.03rem; }
.legal h2 { margin-top: 2em; }
.legal h3 { margin-top: 1.6em; }
.legal li { margin-bottom: .4em; }
.legal-summary { margin: 0 0 28px; padding: 18px 20px; border: 1px solid var(--line); border-left: 4px solid var(--ink); border-radius: var(--radius-small); background: var(--card); }
.legal-summary > :last-child { margin-bottom: 0; }
.legal .table-wrap { font-size: .93rem; }
.legal > :first-child { margin-top: 0; }
.legal-more { margin: 36px 0 0; color: var(--muted); }
/* A policy page (<div class="legal-page">): the text in a readable column with its list
   of sections (.legal-toc) beside it on wide screens, where it stays in view while you
   read, and above it on narrow ones. In the page the list comes first. */
.legal-page { display: grid; grid-template-columns: minmax(0, 46rem) minmax(200px, 260px); justify-content: space-between; align-items: start; gap: 24px 56px; }
.legal-page > .legal { grid-column: 1; grid-row: 1; }
.legal-toc {
  grid-column: 2; grid-row: 1; position: sticky; top: calc(var(--header-h) + 20px);
  max-height: calc(100dvh - var(--header-h) - 40px - var(--banner-space, 0px)); overflow-y: auto;
  padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); font-size: .9rem;
}
.legal-toc h2 { margin: 0 0 8px; color: var(--muted); font: 700 .72rem/1.4 var(--mono); letter-spacing: .1em; text-transform: uppercase; }
.legal-toc ol { margin: 0; padding-left: 1.6em; }
.legal-toc li { margin: 0; padding: 3px 0; break-inside: avoid; }
.legal-toc a { color: var(--ink); text-decoration: none; }
.legal-toc a:hover { text-decoration: underline; }
@media (pointer: coarse) { .legal-toc a { display: inline-block; padding: 7px 0; } }
@media (max-width: 980px) {
  .legal-page { grid-template-columns: minmax(0, 1fr); }
  .legal-page > .legal, .legal-toc { grid-column: 1; grid-row: auto; }
  .legal-toc { position: static; max-height: none; }
  .legal-toc ol { columns: 2 15em; column-gap: 32px; }
}
/* The cookie tables. Names never break in the middle; on a phone each row becomes a
   small block with the column's name before each value (data-label on the cell), so
   nothing has to scroll sideways. */
.legal-table code { white-space: nowrap; }
.legal-table td:first-child { font-weight: 600; }
.legal-table td:last-child { min-width: 9.5em; }
@media (max-width: 640px) {
  .legal-table, .legal-table tbody, .legal-table tr, .legal-table td { display: block; }
  .legal-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .legal-table tr { padding: 12px 14px; border-bottom: 1px solid var(--line); }
  .legal-table tbody tr:last-child { border-bottom: 0; }
  .legal-table td { padding: 2px 0; border: 0; }
  .legal-table td:first-child { padding-bottom: 6px; }
  .legal-table td[data-label]::before { content: attr(data-label) ": "; color: var(--muted); font-weight: 600; }
}

/* ---- Toolbar (the designer's row of small buttons) ------------------------- */
.toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 2px; padding: 4px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--card);
}
.toolbar .btn { border-color: transparent; background: transparent; }
.toolbar .btn:hover { border-color: transparent; background: color-mix(in srgb, var(--ink) 8%, transparent); }
.toolbar .btn[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.toolbar-sep { flex: none; align-self: stretch; width: 1px; margin: 6px 4px; background: var(--line); }
.toolbar-spacer { flex: 1; }
.toolbar-label { padding: 0 8px; color: var(--muted); font-size: .85rem; white-space: nowrap; }
/* One line that scrolls sideways, for phones. */
.toolbar.toolbar-scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.toolbar.toolbar-scroll::-webkit-scrollbar { display: none; }
.toolbar.toolbar-scroll > * { flex: none; }

/* ---- Menus that drop down (<details class="menu" data-menu>) ----------------- */
.menu { position: relative; }
.menu > summary { list-style: none; cursor: pointer; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-panel {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: var(--z-header);
  min-width: 220px; max-height: calc(100dvh - var(--header-h) - 24px); overflow-y: auto; overscroll-behavior: contain;
  padding: 6px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--card); box-shadow: var(--shadow-float);
}
.menu-panel ul { margin: 0; padding: 0; list-style: none; }
.menu-panel form { margin: 0; }
.menu-item {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 8px 12px;
  border: 0; border-radius: var(--radius-small); background: none; color: var(--ink);
  font: 500 1rem/1.2 var(--body); text-align: left; text-decoration: none; cursor: pointer;
}
.menu-item:hover { background: color-mix(in srgb, var(--ink) 7%, transparent); }
.menu-item[aria-current="page"] { background: var(--soft); font-weight: 650; box-shadow: inset 3px 0 0 var(--brand); }
.menu-item-strong { color: var(--link); font-weight: 650; }
.menu-sep { height: 1px; margin: 6px; background: var(--line); }
.menu-note { margin: 0; padding: 8px 12px 4px; color: var(--muted); font-size: .85rem; overflow: hidden; text-overflow: ellipsis; }

/* ---- Site header ------------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: var(--z-header);
  border-bottom: 1px solid var(--line);
  background: var(--paper);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.header-row { display: flex; align-items: center; gap: 8px; min-height: var(--header-h); }
.logo {
  display: inline-flex; flex: none; align-items: center; gap: 9px; min-height: 44px; margin-right: 10px;
  color: var(--ink); font: 800 1.2rem/1 var(--display); letter-spacing: -.03em; text-decoration: none;
}
.logo-mark { flex: none; width: 36px; height: 36px; } /* the mark is 12 modules wide: 36px is 3 whole pixels each, so the bars stay sharp (30px blurred them) */
.logo-word span { font-weight: 500; }
.site-nav { flex: 1; min-width: 0; }
.nav-list { display: flex; gap: 2px; margin: 0; padding: 0; list-style: none; }
.nav-list a, .nav-link {
  position: relative; display: inline-flex; align-items: center; min-height: 40px; padding: 0 10px;
  border-radius: var(--radius-small); color: var(--ink); font-size: .94rem; font-weight: 500; text-decoration: none; white-space: nowrap;
}
.nav-list a:hover, .nav-link:hover { background: color-mix(in srgb, var(--ink) 7%, transparent); }
/* The eight links sit a little closer together (8px, not 10px) to leave room for the dark mode button. */
.nav-list a { padding: 0 8px; }
.nav-list a[aria-current="page"] { font-weight: 700; }
/* The current page gets a short bar in the accent colour on the header's bottom edge. */
.nav-list a[aria-current="page"]::after {
  content: ""; position: absolute; left: 8px; right: 8px; bottom: calc((40px - var(--header-h)) / 2 - 1px); height: 3px; background: var(--brand);
}
.header-account { display: flex; flex: none; align-items: center; gap: 6px; margin-left: auto; }
.account-name { max-width: 7em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-menu { display: none; margin-left: auto; }
.nav-count {
  display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px;
  background: var(--brand); color: var(--brand-ink); font: 700 .72rem/1 var(--body); font-variant-numeric: tabular-nums;
}
/* The dark mode button: a moon while the site is light, a sun while it is dark (header.php
   draws it, theme.php remembers the choice, site.js switches without a reload). It is in the
   bar at every width: beside the account links on wide screens, beside Menu on narrow ones.
   A sun already says "dark is on", so it is not filled in like other buttons that stay down. */
.theme-form { flex: none; margin: 0 -4px; }
.theme-toggle .icon { width: 22px; height: 22px; }
.theme-toggle[aria-pressed="true"] { border-color: transparent; background: transparent; color: var(--ink); }
.theme-toggle[aria-pressed="true"]:hover { background: color-mix(in srgb, var(--ink) 8%, transparent); }
/* Under 1120px the eight links don't fit beside the account button: they fold into the Menu button. */
@media (max-width: 1119px) {
  .site-nav, .header-account { display: none; }
  .nav-menu { display: block; position: static; }
  .nav-menu > .menu-panel { top: calc(100% + 1px); right: max(8px, env(safe-area-inset-right)); left: max(8px, env(safe-area-inset-left)); }
  /* The dark mode button goes to the right with Menu. */
  .theme-form { margin: 0 0 0 auto; }
  .theme-form ~ .nav-menu { margin-left: 0; }
}
/* A phone's bar holds the logo, the dark mode button and Menu, and nothing more: an admin's
   count of new messages sits on the corner of the Menu button, and the narrowest phones
   get the word "Menu" without its three lines. */
@media (max-width: 400px) {
  .nav-menu > summary { position: relative; }
  .nav-menu > summary > .nav-count { position: absolute; top: -6px; right: -8px; }
}
@media (max-width: 340px) {
  .nav-menu > summary > .icon { display: none; }
}
/* On a tablet the menu is a panel under its button, not a sheet as wide as the screen. */
@media (min-width: 561px) and (max-width: 1119px) {
  .nav-menu > .menu-panel { right: max(var(--gutter), env(safe-area-inset-right)); left: auto; width: 300px; }
}
@media (max-width: 760px) {
  :root { --header-h: 56px; }
  /* On a phone a tool page needs every bit of height: the header scrolls away
     and the label preview sticks to the top instead. */
  .is-wide .site-header { position: relative; }
}

/* ---- Site footer --------------------------------------------------------------- */
.site-footer {
  margin-top: 24px; padding: 36px 0 calc(24px + env(safe-area-inset-bottom) + var(--banner-space, 0px));
  border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem;
}
.footer-grid { display: grid; grid-template-columns: minmax(220px, 1.5fr) repeat(3, minmax(0, 1fr)); gap: 28px 32px; }
.footer-brand p { max-width: 26em; margin: 8px 0 14px; }
.footer-brand .bars { opacity: .4; }
.footer-logo { color: var(--ink); font: 800 1.1rem/1 var(--display); letter-spacing: -.03em; text-decoration: none; }
.footer-logo span { font-weight: 500; }
.site-footer h2 { margin: 0 0 6px; color: var(--ink); font: 700 .72rem/1.4 var(--mono); letter-spacing: .1em; text-transform: uppercase; }
.site-footer ul { margin: 0; padding: 0; list-style: none; }
.site-footer li a, .site-footer li .link-button {
  display: inline-flex; align-items: center; min-height: 36px; color: var(--muted); text-align: left; text-decoration: none;
}
.site-footer li a:hover, .site-footer li .link-button:hover { color: var(--ink); text-decoration: underline; }
.footer-base { margin-top: 28px; font-size: .82rem; }
.footer-base p { margin: 0; padding-top: 18px; border-top: 1px solid var(--line); }
/* Room for the floating Feedback button, so it never sits on the last line. */
body:has(.feedback-button) .site-footer { padding-bottom: calc(88px + env(safe-area-inset-bottom) + var(--banner-space, 0px)); }
/* Fingers need 44px: on touch screens, and on any narrow window (a phone browser
   doesn't always say it has a touch screen). */
@media (pointer: coarse), (max-width: 760px) {
  .site-footer li a, .site-footer li .link-button { min-height: 44px; }
  .footer-logo { display: inline-flex; align-items: center; min-height: 44px; }
}
@media (max-width: 760px) {
  .footer-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 480px) {
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 16px; }
}

/* ---- Cookie banner ---------------------------------------------------------------- */
/* A small card in a bottom corner, not a wall: the page stays usable behind it. site.js
   measures it and sets --banner-space, so the tool action bar and the footer move up.
   Narrow and low on purpose (19 November 2026): the old card, 900px wide and 136px tall,
   covered the main button of the home page and of a barcode page on a laptop. This one
   is 500px wide and about 73px tall: three lines of words beside the two answers. Wider,
   the words would fit on two lines, but from the left-hand corner it would then cover a
   barcode page's print button on a 1280px screen. */
.cookie-banner {
  position: fixed; z-index: var(--z-banner);
  bottom: calc(12px + env(safe-area-inset-bottom)); left: max(12px, env(safe-area-inset-left));
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px;
  width: min(500px, calc(100% - 24px)); padding: 8px 10px;
  border: 1px solid var(--line); border-top: 3px solid var(--ink); border-radius: var(--radius);
  background: var(--card); color: var(--ink); box-shadow: var(--shadow-float);
}
/* site.js moves it to the right-hand corner (is-right) when it hides less of the page
   there: less area of the page's links, buttons and boxes, where a button (.btn) counts
   twice and a main button (.btn-primary) four times. It reads those weights from here. */
.cookie-banner.is-right { left: auto; right: max(12px, env(safe-area-inset-right)); }
.btn { --keep-clear: 2; }
.btn-primary { --keep-clear: 4; }
.cookie-text { flex: 1 1 180px; min-width: 0; font-size: .85rem; line-height: 1.3; }
.cookie-text p { margin: 0; }
/* The Cookie Policy link ends a sentence, so it is only a line of small text tall.
   Padding above and below gives a finger more to hit without moving a single word
   (padding on a word in a line takes up no room). The answer buttons come after the
   words, so where the two overlap a tap still lands on the button. */
.cookie-text a { padding: 10px 0; }
.cookie-text a:focus-visible { outline-offset: -8px; } /* the ring around the words, not around the padding */
.cookie-current { margin-top: 6px !important; font-weight: 650; }
.cookie-actions { display: flex; flex: 0 1 auto; flex-wrap: wrap; align-items: center; gap: 8px; }
/* Two answers of exactly the same weight: neither is pushed. Keep it that way. */
.cookie-actions .btn { flex: 1 1 0; padding: 0 8px; border-color: var(--ink); white-space: nowrap; }
.cookie-actions .link-button { min-height: 44px; padding: 0 6px; }
/* On a page that is mostly a form, site.js puts the question in the page, above the
   form, instead of floating over the form's button (class is-in-page), and moves the
   page's content down by its height (--banner-top). There it is as wide as the page's
   column (up to 900px) and centred, as before. */
.cookie-banner.is-in-page {
  position: absolute; top: calc(var(--header-h) + 12px); right: max(12px, env(safe-area-inset-right)); bottom: auto;
  width: auto; max-width: 900px; margin: 0 auto; box-shadow: var(--shadow);
  z-index: var(--z-sticky); /* part of the page now: it slides under the header and its menus as the page scrolls */
}
.has-cookie-top main.wrap { padding-top: calc(28px + var(--banner-top, 0px)); }
.has-cookie-top .is-wide main.wrap { padding-top: calc(16px + var(--banner-top, 0px)); }
@media (max-width: 760px), (max-height: 560px) {
  /* On a small screen: smaller words and two buttons, under 100px tall, so it covers as
     little as it can. "Small" is a phone, and also any window where a tool is one column with its
     preview pinned to the top and its buttons to the bottom (760px, see the tool layout) or that
     is very short. A desktop zoomed to 200% is both. */
  .cookie-banner {
    right: max(8px, env(safe-area-inset-right)); bottom: calc(8px + env(safe-area-inset-bottom)); left: max(8px, env(safe-area-inset-left));
    width: auto; gap: 4px 16px; padding: 6px 10px; border-top-width: 2px;
  }
  .cookie-banner.is-in-page { top: calc(var(--header-h) + 8px); right: max(8px, env(safe-area-inset-right)); }
  /* Over the page it is then not a floating card but a strip that sits flush against the bottom
     edge and both sides. A card left gaps a few pixels wide that the page showed through: beside it,
     under it, and between it and a tool's action bar. site.js sees that it touches the bottom edge and
     then leaves no gap above it either (--banner-space), so the action bar stands directly on it.
     The strip is as low as it can be: two lines of words with the policy link, and the two answers. */
  .cookie-banner:not(.is-in-page) {
    right: 0; bottom: 0; left: 0; max-width: none; margin: 0;
    padding: 6px max(12px, env(safe-area-inset-right)) calc(6px + env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
    border-width: 2px 0 0; border-radius: 0; box-shadow: none;
  }
  .cookie-text { flex-basis: 240px; font-size: .8rem; line-height: 1.25; }
  .cookie-current { margin-top: 3px !important; }
}
@media (max-width: 560px) {
  /* On a phone the words take the whole width and the two answers share the line under them.
     (On a wider small screen, words and answers sit side by side.) */
  .cookie-text { flex-basis: 100%; }
  .cookie-actions { flex: 1 1 100%; }
}

/* ---- Feedback button ------------------------------------------------------------- */
.feedback-button {
  position: fixed; z-index: var(--z-float);
  left: calc(16px + env(safe-area-inset-left)); bottom: calc(16px + env(safe-area-inset-bottom));
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 16px 8px 12px;
  border: 1px solid var(--ink); border-radius: var(--radius-small);
  background: var(--ink); color: var(--paper); box-shadow: var(--shadow-float);
  font: 600 .92rem/1.2 var(--body); text-decoration: none;
  transition: transform .15s;
}
.feedback-button:hover { transform: translateY(-2px); }
/* It would cover "Allow cookies" on phones, so it waits until the question is answered.
   (Also while the question sits up in the page on a form page: one thing at a time over a form.) */
.cookie-banner:not([hidden]) ~ .feedback-button { display: none; }
.feedback-sent { text-align: center; }
.feedback-sent .thanks-icon { width: 48px; height: 48px; margin: 4px auto 10px; color: var(--ok); }
.feedback-sent:focus { outline: none; }

/* ---- Pop-ups (<dialog class="dialog">) ---------------------------------------------- */
.dialog {
  width: min(560px, calc(100% - 32px)); max-width: none; max-height: min(88dvh, 860px); padding: 0;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--card); color: var(--ink); box-shadow: var(--shadow-float);
  overflow: hidden;
}
.dialog[open] { display: flex; flex-direction: column; }
.dialog::backdrop { background: var(--backdrop); }
.dialog:focus { outline: none; }
.dialog-small { width: min(420px, calc(100% - 32px)); }
.dialog-large { width: min(920px, calc(100% - 32px)); }
/* "sheet": docked to the bottom edge at every width (pickers, long lists). */
.dialog-sheet { width: min(760px, 100%); margin-bottom: 0; border-bottom: 0; border-radius: var(--radius) var(--radius) 0 0; }
.dialog-head { display: flex; flex: none; align-items: center; gap: 12px; padding: 10px 10px 10px 20px; border-bottom: 1px solid var(--line); }
.dialog-title { flex: 1; min-width: 0; margin: 0; font-size: 1.15rem; }
.dialog-close {
  display: grid; flex: none; place-items: center; width: 44px; height: 44px; padding: 0;
  border: 0; border-radius: var(--radius-small); background: none; color: var(--ink); cursor: pointer;
}
.dialog-close:hover { background: color-mix(in srgb, var(--ink) 8%, transparent); }
.dialog-body { flex: 1 1 auto; min-height: 0; padding: 18px 20px 20px; overflow-y: auto; overscroll-behavior: contain; }
.dialog-body > :last-child { margin-bottom: 0; }
.dialog-actions { display: flex; flex: none; flex-wrap: wrap; justify-content: flex-end; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--line); }
@media (prefers-reduced-motion: no-preference) {
  .dialog[open] { animation: dialog-in .18s ease-out; }
  .dialog[open]::backdrop { animation: fade-in .18s ease-out; }
}
@keyframes dialog-in { from { opacity: 0; transform: translateY(12px) scale(.985); } }
@keyframes sheet-up { from { transform: translateY(100%); } }
@keyframes fade-in { from { opacity: 0; } }
/* On a phone every pop-up is a sheet that slides up from the bottom edge. */
@media (max-width: 560px) {
  .dialog, .dialog-small, .dialog-large, .dialog-sheet {
    width: 100%; max-height: 92dvh; margin: auto 0 0; border-width: 1px 0 0; border-radius: var(--radius) var(--radius) 0 0;
  }
  .dialog-head { padding-left: 16px; }
  .dialog-body { padding: 16px 16px calc(18px + env(safe-area-inset-bottom)); }
  .dialog-body:not(:last-child) { padding-bottom: 18px; }
  .dialog-actions { padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); }
  .dialog-actions .btn { flex: 1 1 auto; }
}
@media (prefers-reduced-motion: no-preference) and (max-width: 560px) {
  .dialog[open] { animation: sheet-up .22s ease-out; }
}
@media (prefers-reduced-motion: no-preference) {
  .dialog-sheet[open] { animation: sheet-up .22s ease-out; }
}

/* The Add to Home Screen pop-up's numbered steps, each with a small picture of the button to tap. */
.home-steps { display: grid; gap: 12px; margin: 16px 0 0; padding: 0; list-style: none; }
.home-steps > li { display: flex; align-items: flex-start; gap: 12px; }
.home-step-icon {
  display: grid; flex: none; place-items: center; width: 42px; height: 42px;
  border: 1px solid var(--line); border-radius: var(--radius-small); background: var(--paper); color: var(--ink);
}
.home-steps p { margin: 0; }
.home-steps .hint { margin-top: 2px; }
.home-intro { display: flex; align-items: center; gap: 14px; }
.home-intro .logo-mark { width: 48px; height: 48px; }
.home-intro p { margin: 0; color: var(--muted); }

/* ---- Toasts: small messages that come and go ------------------------------------------- */
.toasts {
  position: fixed; z-index: var(--z-toast); left: 0; right: 0;
  bottom: calc(16px + env(safe-area-inset-bottom) + var(--banner-space, 0px));
  display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 0 12px;
  pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 10px; max-width: min(520px, 100%); padding: 6px 6px 6px 14px;
  border-left: 4px solid var(--muted); border-radius: var(--radius-small);
  background: var(--ink); color: var(--paper); box-shadow: var(--shadow-float);
  font-size: .93rem; pointer-events: auto;
}
.toast-text { flex: 1; min-width: 0; padding: 6px 0; }
.toast-ok { border-left-color: var(--ok); }
.toast-error { border-left-color: var(--error); }
.toast-warn { border-left-color: var(--warn); }
.toast-info { border-left-color: var(--brand); }
.toast-close {
  display: grid; flex: none; place-items: center; width: 36px; height: 36px; padding: 0;
  border: 0; border-radius: var(--radius-small); background: none; color: inherit; cursor: pointer;
}
.toast-close:hover { background: color-mix(in srgb, var(--paper) 16%, transparent); }
@media (pointer: coarse) { .toast-close { width: 44px; height: 44px; } }
@media (prefers-reduced-motion: no-preference) {
  .toast { animation: dialog-in .18s ease-out; }
}

/* ---- The label preview: white paper on a desk, in both themes ----------------------- */
/* The desk has a size of its own (set its height, or let .tool-stage stretch it); the paper
   inside is as large as fits. Tell it the sheet's shape with style="--ratio: 0.7727"
   (width divided by height); the default is US Letter upright. */
.sheet-preview {
  position: relative; display: grid; place-items: center; height: min(60vh, 560px); min-height: 140px; padding: 20px;
  border: 1px solid var(--desk-line); border-radius: var(--radius);
  /* a faint cutting-mat grid */
  background:
    linear-gradient(var(--desk-line) 1px, transparent 1px) 0 0 / 24px 24px,
    linear-gradient(90deg, var(--desk-line) 1px, transparent 1px) 0 0 / 24px 24px,
    var(--desk);
  overflow: hidden;
  container-type: size;
}
.sheet-paper {
  --ratio: .7727;
  position: relative; width: min(100%, 52vh * var(--ratio)); aspect-ratio: var(--ratio);
  border-radius: 1px;
  /* Labels are always black on white, even in dark mode: this is what the printer makes. */
  background: var(--sheet); color: var(--sheet-ink); color-scheme: light;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .06), 0 1px 3px rgba(0, 0, 0, .2), 0 10px 28px rgba(0, 0, 0, .16);
  overflow: hidden;
}
@supports (width: 1cqw) {
  .sheet-paper { width: min(100cqw, 100cqh * var(--ratio)); }
}
.sheet-paper > :where(svg, canvas, img) { display: block; width: 100%; height: 100%; }
/* Several pages, or one long one: the desk scrolls and the paper takes the desk's width. */
.sheet-preview.is-scroll { display: block; overflow: auto; overscroll-behavior: contain; container-type: normal; }
.sheet-preview.is-scroll > .sheet-paper { width: min(100%, 560px); margin: 0 auto 20px; }
.sheet-preview.is-scroll > .sheet-paper:last-child { margin-bottom: 0; }
/* A small note pinned to the desk: "Page 1 of 3". */
.sheet-note {
  position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%); margin: 0; padding: 3px 10px; border-radius: 999px;
  background: var(--card); color: var(--muted); box-shadow: var(--shadow); font-size: .8rem; white-space: nowrap;
}
.sheet-preview:has(> .sheet-note) { padding-bottom: 40px; } /* room for the note under the paper */
/* Buttons pinned to the desk's corner (zoom, next page). */
.sheet-tools { position: absolute; top: 8px; right: 8px; display: flex; gap: 4px; }
.sheet-tools .btn { box-shadow: var(--shadow); }

/* ---- The tool layout: controls beside a live preview --------------------------------- */
/* Wide screens: controls on the left scroll with the page; the stage on the right
   (preview above, action bar below) stays in view. Phones: preview pinned to the top,
   controls under it, action bar pinned to the bottom. Markup is in css.md. */
.tool { display: grid; grid-template-columns: minmax(280px, 400px) minmax(0, 1fr); gap: 20px; align-items: start; }
.tool-controls { min-width: 0; }
.tool-stage {
  position: sticky; top: calc(var(--header-h) + 16px);
  display: flex; flex-direction: column; gap: 12px; min-width: 0;
  /* As tall as the window under the header. site.js sets --tool-top when something sits above the
     tool (a heading, a message), so the action bar is in view from the start. */
  height: calc(100dvh - var(--tool-top, calc(var(--header-h) + 16px)) - 16px - var(--banner-space, 0px)); min-height: 240px;
}
.tool-preview { display: flex; flex: 1 1 auto; flex-direction: column; min-height: 0; }
.tool-preview > .sheet-preview { flex: 1 1 auto; height: auto; min-height: 0; }
.tool-preview > .status-line { flex: none; }
.tool-preview > .toolbar { flex: none; margin-bottom: 8px; }
.tool-actions {
  display: flex; flex: none; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px;
  padding: 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow);
}
.tool-actions-info { flex: 1 1 auto; min-width: 0; margin: 0; padding: 0 6px; color: var(--muted); font-size: .9rem; }
/* The designer's variant: the canvas is the main thing, on the left; properties on the right. */
.tool.tool-canvas { grid-template-columns: minmax(0, 1fr) minmax(260px, 340px); }
.tool.tool-canvas > .tool-stage { order: -1; }

/* A group of controls: "1 What goes on the label". Use <section> or <details open>. */
.tool-panel { margin: 0 0 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
.tool-panel-title, .tool-panel > summary {
  display: flex; align-items: center; gap: 10px; min-height: 48px; margin: 0; padding: 10px 14px;
  font: 700 1rem/1.2 var(--display); letter-spacing: -.01em;
}
.tool-panel > summary { list-style: none; cursor: pointer; }
.tool-panel > summary::-webkit-details-marker { display: none; }
.tool-panel > summary::after {
  content: ""; flex: none; width: 8px; height: 8px; margin: 0 4px 3px auto;
  border: solid var(--muted); border-width: 0 2px 2px 0; transform: rotate(45deg); transition: transform .15s;
}
.tool-panel[open] > summary::after { margin-bottom: -3px; transform: rotate(225deg); }
.tool-panel-body { padding: 4px 14px 14px; }
.tool-panel-body > :last-child { margin-bottom: 0; }

@media (max-width: 760px) {
  .tool, .tool.tool-canvas { display: flex; flex-direction: column; align-items: stretch; gap: 0; }
  .tool-stage { display: contents; } /* its two parts become rows of .tool, so each can stick on its own */
  .tool-preview {
    position: sticky; top: 0; z-index: var(--z-sticky); order: 1;
    margin: 0 calc(-1 * var(--gutter)); padding: 8px var(--gutter);
    border-bottom: 1px solid var(--line); background: var(--paper);
  }
  .tool-preview > .sheet-preview { flex: none; height: clamp(150px, 32dvh, 300px); padding: 12px; }
  .tool-preview > .sheet-preview:has(> .sheet-note) { padding-bottom: 38px; }
  .tool-preview > .status-line { margin-top: 6px; font-size: .85rem; }
  .tool-controls { order: 2; padding: 14px 0 16px; }
  .tool-actions {
    position: sticky; bottom: var(--banner-space, 0px); z-index: var(--z-sticky); order: 3;
    margin: 0 calc(-1 * var(--gutter)); padding: 10px var(--gutter) calc(10px + env(safe-area-inset-bottom));
    border-width: 1px 0 0; border-radius: 0; box-shadow: 0 -8px 24px rgba(0, 0, 0, .08);
  }
  /* The cookie banner is underneath the bar while it shows, so its own safe-area gap is enough. */
  .has-cookie-banner .tool-actions { padding-bottom: 10px; }
  .tool-actions-info { flex-basis: 100%; padding: 0; font-size: .82rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tool-actions .btn { flex: 1 1 0; }
  .tool-actions .btn-icon { flex: none; }
  /* Toasts appear above the action bar, not on it. */
  body:has(.tool-actions) .toasts { bottom: calc(96px + env(safe-area-inset-bottom) + var(--banner-space, 0px)); }
}

/* A wide but very short window (a phone held sideways): still two columns, but the header
   scrolls away, the preview sticks on its own and the action bar runs along the bottom. */
@media (min-width: 761px) and (max-height: 560px) {
  .is-wide .site-header { position: relative; }
  .tool-stage { display: contents; }
  .tool-controls { grid-column: 1; grid-row: 1; }
  .tool-preview {
    position: sticky; top: 8px; grid-column: 2; grid-row: 1;
    height: calc(100dvh - var(--tool-top, 8px) - 86px - var(--banner-space, 0px)); min-height: 130px;
  }
  .tool.tool-canvas > .tool-controls { grid-column: 2; }
  .tool.tool-canvas .tool-preview { grid-column: 1; }
  .tool-actions {
    position: sticky; bottom: calc(8px + var(--banner-space, 0px)); z-index: var(--z-sticky);
    grid-column: 1 / -1; grid-row: 2;
  }
}

/* ---- Less motion for people who ask for it -------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  /* A spinner that stands still says nothing, so it becomes three dots instead. */
  .spinner { width: auto; height: auto; border: 0; }
  .spinner::after { content: "\2026"; }
}

/* ---- Windows high-contrast mode -------------------------------------------------------- */
/* Backgrounds are dropped there, so "chosen" has to be said with the system's own colours. */
@media (forced-colors: active) {
  .btn, .chip > span, .segmented, .toast, .cookie-banner, .feedback-button, .dialog, .card { border: 1px solid ButtonText; }
  .segmented input:checked + span, .segmented > button[aria-pressed="true"],
  .chip input:checked + span, button.chip[aria-pressed="true"],
  .btn[aria-pressed="true"], .switch input:checked + .switch-track {
    forced-color-adjust: none; background: Highlight; color: HighlightText; border-color: Highlight;
  }
  .switch-track::after { forced-color-adjust: none; background: ButtonText; }
  .switch input:checked + .switch-track::after { background: HighlightText; }
  .tab[aria-selected="true"], .tab[aria-current="page"] { border-bottom-color: Highlight; }
  .nav-list a[aria-current="page"]::after, .kicker::before, .bars, .step-list > li::before, .step-number { forced-color-adjust: none; }
  .step-list > li::before, .step-number { background: ButtonText; color: ButtonFace; }
  .bars { color: ButtonText; }
  .sheet-paper { forced-color-adjust: none; } /* the label keeps its real black and white */
  .spinner, .status-line.is-busy::before { border-color: ButtonText; border-right-color: transparent; }
}

/* ---- Printing ------------------------------------------------------------------------------ */
/* .no-print never reaches paper. .print-only shows only on paper.
   .print-layer is the label sheet itself (a direct child of <body>, added by the print engine):
   while one is on the page, it is the ONLY thing that prints. */
.print-only, .print-layer { display: none; }
@media print {
  @page { margin: .6in; }
  html { scrollbar-gutter: auto; }
  body { display: block; min-height: 0; background: #fff; color: #000; }
  .site-header, .site-footer, .skip-link, .cookie-banner, .feedback-button, .toasts, .no-print, dialog { display: none !important; }
  main.wrap, .is-wide main.wrap { max-width: none; padding: 0; }
  .print-only { display: block; }
  .card, .tile, .table-wrap { box-shadow: none; }
  .table-wrap { overflow: visible; border: 0; }
  thead { display: table-header-group; } /* the column names again at the top of each page */
  tr, .card, .step-list > li { break-inside: avoid; }
  a { color: inherit; }

  body:has(> .print-layer) > :not(.print-layer),
  html.has-print-layer body > :not(.print-layer) { display: none !important; }
  body:has(> .print-layer), html.has-print-layer body { margin: 0; padding: 0; }
  .print-layer {
    display: block; margin: 0; padding: 0; background: #fff; color: #000;
    -webkit-print-color-adjust: exact; print-color-adjust: exact; /* keep filled bars and colours exactly */
  }
}
