/* Shared look for the tools on willberchtold.com.
   Paper and ink, one serif for words, a plain sans for controls and figures.
   No outside requests: fonts are whatever the device has.
   Class names and patterns are described in _kit/DESIGN.md. */

/* ---------- tokens ---------- */
:root {
  --paper: #fbfaf8;
  --card: #ffffff;
  --sunk: #f3f0eb;
  --ink: #191817;
  --ink-2: #3d3a37;
  --muted: #6b655f;
  --rule: #e2ded8;
  --rule-2: #cdc7bf;
  --edge: #8a847d;
  --mark: #9a3412;
  --good: #25603a;
  --over: #a3231a;
  --serif: "Newsreader", "Iowan Old Style", "Charter", "Georgia", serif;
  --sans: ui-sans-serif, -apple-system, "Segoe UI", system-ui, "Helvetica Neue", Arial, sans-serif;
  --radius: 3px;
  --tap: 2.75rem;            /* 44px touch target */
  --gutter: 1rem;
  --wrap: 80rem;
  --measure: 38rem;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #141312; --card: #1c1b19; --sunk: #0f0e0d; --ink: #ecebe7; --ink-2: #c9c5bf; --muted: #a09a93;
    --rule: #2c2a27; --rule-2: #3f3c38; --edge: #7b756e; --mark: #f0a07a; --good: #8fd0a3; --over: #f5a397;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #141312; --card: #1c1b19; --sunk: #0f0e0d; --ink: #ecebe7; --ink-2: #c9c5bf; --muted: #a09a93;
  --rule: #2c2a27; --rule-2: #3f3c38; --edge: #7b756e; --mark: #f0a07a; --good: #8fd0a3; --over: #f5a397;
  color-scheme: dark;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--serif); font-size: 1.0625rem; line-height: 1.5; font-optical-sizing: auto;
  font-variant-numeric: lining-nums; font-kerning: normal;
  padding: 0 max(var(--gutter), env(safe-area-inset-right, 0px)) 0 max(var(--gutter), env(safe-area-inset-left, 0px));
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}
@media (min-width: 48rem) { :root { --gutter: 2rem; } }
::selection { background: color-mix(in srgb, var(--mark) 22%, transparent); }
h1, h2, h3, h4, p, ul, ol, dl, dd, figure { margin: 0; }
h1, h2, h3, h4 { font-weight: 400; text-wrap: balance; }
p { text-wrap: pretty; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; text-decoration-line: underline; text-decoration-thickness: 1px; text-underline-offset: .18em; text-decoration-color: color-mix(in srgb, currentColor 40%, transparent); }
a:hover { text-decoration-color: var(--mark); }
:focus-visible { outline: 2px solid var(--mark); outline-offset: 2px; border-radius: 2px; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; margin: 0; }
svg { flex: none; }
@media (prefers-reduced-motion: no-preference) {
  a, .btn, .input { transition: background-color .15s, border-color .15s, text-decoration-color .15s, color .15s; }
}

.visually-hidden {
  position: absolute !important; 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;
}
.skip {
  position: absolute; left: var(--gutter); top: -4rem; z-index: 10; padding: .6rem .9rem;
  background: var(--ink); color: var(--paper); font-family: var(--sans); font-size: .9375rem; text-decoration: none; border-radius: var(--radius);
}
.skip:focus { top: .5rem; }

.wrap { max-width: var(--wrap); margin: 0 auto; }

/* Figures: anything that is a number someone will compare. */
.num, .fig { font-family: var(--sans); font-variant-numeric: tabular-nums lining-nums; font-feature-settings: "tnum" 1, "lnum" 1; }
.num { text-align: right; white-space: nowrap; }

/* A margin note: the small italic line that names a section. */
.note { font-style: italic; color: var(--muted); font-size: 1rem; }
.muted { color: var(--muted); }
.small { font-size: .9375rem; }

/* ---------- header strip ---------- */
.strip {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .25rem 1rem;
  padding: .625rem 0; border-bottom: 1px solid var(--rule);
}
.strip .back {
  display: inline-flex; align-items: center; gap: .4rem; min-height: var(--tap); padding-right: .5rem;
  font-style: italic; color: var(--ink-2); text-decoration: none;
}
.strip .back:hover { text-decoration: underline; text-decoration-color: var(--mark); }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0 .125rem; margin-left: -.625rem; }
@media (min-width: 48rem) { .actions { margin-left: 0; margin-right: -.625rem; } }

/* ---------- title block ---------- */
.title { padding: 1.75rem 0 1.5rem; }
.title h1 { font-size: clamp(2.1rem, 6vw, 3.1rem); line-height: 1.08; letter-spacing: -.018em; font-weight: 380; }
.title .lede { margin-top: .9rem; max-width: var(--measure); font-size: 1.1875rem; color: var(--ink-2); }
.privacy {
  margin-top: 1.1rem; max-width: var(--measure); padding-left: .9rem; border-left: 2px solid var(--mark);
  font-size: .9375rem; font-style: italic; color: var(--ink-2);
}

/* ---------- views: the tabs that switch between parts of a tool ----------
   <div class="views" role="tablist" aria-label="…"><button class="view-tab" role="tab" aria-selected="true" aria-controls="view-x" id="tab-x">…
   Panels: <section id="view-x" role="tabpanel" aria-labelledby="tab-x" tabindex="-1" hidden>. Left/right arrows move between tabs. */
.views { display: flex; flex-wrap: wrap; gap: 0 .25rem; margin: 0 0 1.75rem; border-bottom: 1px solid var(--ink); overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.views::-webkit-scrollbar { display: none; }
.view-tab {
  flex: none; min-height: 3rem; padding: .5rem .9rem; background: none; border: 0; border-bottom: 3px solid transparent; margin-bottom: -1px;
  font-family: var(--serif); font-size: 1.125rem; color: var(--ink-2); cursor: pointer; white-space: nowrap; -webkit-tap-highlight-color: transparent;
}
.view-tab:first-child { padding-left: .1rem; }
@media (max-width: 30rem) { .view-tab { padding: .5rem .6rem; font-size: 1.0625rem; } }
.view-tab:hover { color: var(--ink); border-bottom-color: var(--rule-2); }
.view-tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--mark); font-weight: 500; }
.view-tab:focus-visible { outline-offset: -3px; }
[role="tabpanel"]:focus { outline: none; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  min-height: var(--tap); padding: .5rem .95rem;
  font-family: var(--sans); font-size: .9375rem; font-weight: 500; line-height: 1.2; text-decoration: none;
  color: var(--ink); background: transparent; border: 1px solid var(--edge); border-radius: var(--radius);
  cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.btn:hover { background: var(--sunk); }
.btn:active { background: var(--rule); }
.btn.primary { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn.primary:hover { background: var(--ink-2); border-color: var(--ink-2); }
.btn.quiet { border-color: transparent; color: var(--ink-2); padding-left: .625rem; padding-right: .625rem; font-weight: 400; }
.btn.quiet:hover { color: var(--ink); background: var(--sunk); }
.btn.danger { color: var(--over); }
.btn.danger.primary { background: var(--over); border-color: var(--over); color: var(--paper); }
.btn.icon { width: var(--tap); padding: 0; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn.add { border-style: dashed; color: var(--ink-2); }
.btn.add:hover { border-style: solid; color: var(--ink); }

/* Theme toggle: Kit.initTheme sets data-mode="light|dark" on the button. */
.theme-btn .i-sun { display: none; }
.theme-btn[data-mode="dark"] .i-sun { display: block; }
.theme-btn[data-mode="dark"] .i-moon { display: none; }

/* ---------- form controls ---------- */
.field { display: grid; gap: .3rem; min-width: 0; align-content: start; }
.label, .field > label {
  font-family: var(--sans); font-size: .8125rem; font-weight: 500; line-height: 1.3; color: var(--ink-2); letter-spacing: .005em;
}
.hint { font-family: var(--sans); font-size: .8125rem; line-height: 1.35; color: var(--muted); }
.input {
  display: block; width: 100%; min-width: 0; height: var(--tap); padding: 0 .625rem;
  font-family: var(--sans); font-size: 1rem; line-height: 1.2; font-variant-numeric: tabular-nums lining-nums;
  color: var(--ink); background: var(--card); border: 1px solid var(--edge); border-radius: var(--radius);
  -webkit-appearance: none; appearance: none;
}
.input::placeholder { color: var(--muted); opacity: 1; }
.input:hover { border-color: var(--ink-2); }
.input:focus-visible { outline: 2px solid var(--mark); outline-offset: 1px; border-color: var(--ink); }
.input.num { text-align: right; }
.input[aria-invalid="true"] { border-color: var(--over); box-shadow: inset 0 0 0 1px var(--over); }
select.input {
  padding-right: 1.6rem; text-overflow: ellipsis; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - .8rem) 50%, calc(100% - .5rem) 50%; background-size: .3rem .3rem; background-repeat: no-repeat;
}
/* Date fields: iOS draws the value at the top of the box and Chrome adds its own calendar icon. Center the value
   like every other field and show the same small chevron as a menu, so a date reads as "tap to pick". */
input[type="date"].input {
  display: flex; align-items: center; text-align: left; padding-right: 1.6rem; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - .8rem) 50%, calc(100% - .5rem) 50%; background-size: .3rem .3rem; background-repeat: no-repeat;
}
input[type="date"].input::-webkit-date-and-time-value { margin: 0; text-align: left; line-height: 1.2; }
input[type="date"].input::-webkit-datetime-edit { padding: 0; line-height: 1.2; }
input[type="date"].input::-webkit-calendar-picker-indicator { margin: 0 -1.6rem 0 0; width: 1.6rem; height: 100%; opacity: 0; cursor: pointer; }
/* A text field with suggestions (list=...) gets the same chevron. */
input[list].input {
  padding-right: 1.6rem;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - .8rem) 50%, calc(100% - .5rem) 50%; background-size: .3rem .3rem; background-repeat: no-repeat;
}
input[list].input::-webkit-calendar-picker-indicator { opacity: 0; }
/* A $ in front or a % behind: <span class="affix has-pre"><span class="pre" aria-hidden="true">$</span><input class="input num"></span> */
.affix { position: relative; display: block; min-width: 0; }
.affix > .pre, .affix > .suf {
  position: absolute; top: 0; height: 100%; display: flex; align-items: center; pointer-events: none;
  font-family: var(--sans); font-size: .9375rem; color: var(--muted);
}
.affix > .pre { left: .6rem; }
.affix > .suf { right: .6rem; }
.affix.has-pre > .input { padding-left: 1.35rem; }
.affix.has-suf > .input { padding-right: 1.55rem; }
.field-msg { font-family: var(--sans); font-size: .875rem; line-height: 1.4; color: var(--ink-2); }
.field-msg.is-error { color: var(--over); }
.field-msg.is-error::before { content: ""; display: inline-block; width: .5rem; height: .5rem; margin-right: .45rem; border-radius: 50%; background: var(--over); }

/* ---------- sections and panels ---------- */
.sec { padding: 2.25rem 0; border-top: 1px solid var(--rule); }
.sec-head { margin-bottom: 1.25rem; }
.sec-head h2 { font-size: clamp(1.5rem, 3.4vw, 1.9rem); line-height: 1.15; letter-spacing: -.012em; }
.sec-head p { max-width: 42rem; color: var(--ink-2); margin-top: .4rem; }
.panel { background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); padding: 1.25rem; }

/* The result: the one number the page exists for, large and calm. */
.result { border-top: 2px solid var(--ink); padding-top: 1rem; }
.result .key-label { font-style: italic; color: var(--muted); font-size: 1rem; }
.result .key {
  display: block; margin-top: .1rem; font-family: var(--serif); font-size: clamp(2.75rem, 11vw, 3.6rem); line-height: 1.05;
  font-weight: 380; letter-spacing: -.02em; font-variant-numeric: lining-nums tabular-nums;
}
.result .key-sub { margin-top: .3rem; font-family: var(--sans); font-size: .875rem; color: var(--muted); font-variant-numeric: tabular-nums lining-nums; }
/* Label / figure pairs under the key number: <dl class="stats"><div><dt>..</dt><dd>..</dd></div></dl> */
.stats { margin-top: 1rem; }
.stats > div { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; padding: .6rem 0; border-top: 1px solid var(--rule); }
.stats dt { color: var(--ink-2); }
.stats dt small { display: block; font-family: var(--sans); font-size: .8125rem; color: var(--muted); }
.stats dd { font-family: var(--sans); font-size: 1.125rem; font-weight: 500; font-variant-numeric: tabular-nums lining-nums; white-space: nowrap; }
.stats .strong dd { font-size: 1.375rem; }

/* A verdict in words, with a small mark; never colour alone. */
.signal { display: flex; gap: .6rem; align-items: flex-start; margin-top: 1rem; padding: .75rem .9rem; border-radius: var(--radius); font-size: 1rem; line-height: 1.4; border: 1px solid var(--rule-2); background: var(--card); }
.signal svg { margin-top: .2rem; }
.signal.good { border-color: color-mix(in srgb, var(--good) 45%, var(--paper)); background: color-mix(in srgb, var(--good) 7%, var(--paper)); }
.signal.good svg { color: var(--good); }
.signal.over { border-color: color-mix(in srgb, var(--over) 45%, var(--paper)); background: color-mix(in srgb, var(--over) 7%, var(--paper)); }
.signal.over svg { color: var(--over); }
.signal.idle { color: var(--ink-2); }
.signal.idle svg { color: var(--muted); }
.good-text { color: var(--good); }
.over-text { color: var(--over); }

/* A message bar: sample-data note, "opened your file", undo. */
.notice {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .35rem 1rem;
  margin: 0 0 1.25rem; padding: .6rem .6rem .6rem 1rem; background: var(--sunk); border-radius: var(--radius);
  border-left: 2px solid var(--mark); color: var(--ink-2); font-size: 1rem;
}
.notice p { flex: 1 1 16rem; padding: .35rem 0; }
.notice .notice-actions { display: flex; flex-wrap: wrap; gap: .25rem; }
.notice.is-error { border-left-color: var(--over); }

/* ---------- tables ---------- */
/* Wide tables scroll inside their own labelled box:
   <div class="table-wrap" role="region" aria-label="…" tabindex="0"><table class="ledger">… */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--radius); }
.ledger { width: 100%; border-collapse: collapse; font-size: 1rem; }
.ledger caption { text-align: left; font-style: italic; color: var(--muted); padding-bottom: .5rem; }
.ledger th, .ledger td { padding: .65rem .75rem; text-align: left; vertical-align: middle; border-bottom: 1px solid var(--rule); }
.ledger th:first-child, .ledger td:first-child { padding-left: 0; }
.ledger th:last-child, .ledger td:last-child { padding-right: 0; }
.ledger thead th { font-family: var(--sans); font-size: .8125rem; font-weight: 500; color: var(--ink-2); vertical-align: bottom; border-bottom: 1px solid var(--ink); line-height: 1.3; }
.ledger tbody th { font-weight: 400; }
.ledger .num { text-align: right; }
.ledger tfoot th, .ledger tfoot td { border-bottom: 0; border-top: 1px solid var(--ink); font-weight: 500; }
.ledger .input { min-width: 4.5rem; }

/* Stacked cards on a phone. Each <td> needs data-label="Column name"; add ARIA table roles
   in the markup (role="table", "rowgroup", "row", "columnheader", "cell") so the meaning survives. */
@media (max-width: 43.99rem) {
  .ledger.stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); }
  .ledger.stack, .ledger.stack tbody, .ledger.stack tfoot, .ledger.stack tr, .ledger.stack th, .ledger.stack td { display: block; }
  .ledger.stack tr { padding: .9rem 0; border-bottom: 1px solid var(--rule); }
  .ledger.stack tbody tr:first-child { border-top: 1px solid var(--ink); }
  .ledger.stack th, .ledger.stack td { padding: .2rem 0; border: 0; }
  .ledger.stack tbody th { font-size: 1.1875rem; padding-bottom: .35rem; }
  .ledger.stack td { display: flex; align-items: center; justify-content: space-between; gap: 1rem; text-align: right; min-height: 1.9rem; }
  .ledger.stack td::before { content: attr(data-label); font-family: var(--sans); font-size: .8125rem; font-weight: 500; color: var(--ink-2); text-align: left; white-space: normal; }
  .ledger.stack td[data-label=""]::before, .ledger.stack td:not([data-label])::before { content: none; }
  .ledger.stack td .input { width: 6.5rem; flex: none; }
  .ledger.stack tfoot tr { border-bottom: 0; border-top: 1px solid var(--ink); }
  .ledger.stack tfoot th, .ledger.stack tfoot td { border-top: 0; }
}

/* ---------- how this is worked out ---------- */
.howto { border-top: 1px solid var(--rule); }
.howto > summary {
  display: flex; align-items: center; gap: .6rem; min-height: 3.5rem; padding: .75rem 0; cursor: pointer; list-style: none;
  font-size: 1.25rem; color: var(--ink);
}
.howto > summary::-webkit-details-marker { display: none; }
.howto > summary::before {
  content: ""; width: .5rem; height: .5rem; flex: none; margin: 0 .2rem; border-right: 1.5px solid var(--mark); border-bottom: 1.5px solid var(--mark); transform: rotate(-45deg);
}
.howto[open] > summary::before { transform: rotate(45deg); }
.howto > summary h2 { font-size: inherit; display: inline; }
.howto .howto-body { max-width: var(--measure); padding: 0 0 2rem; color: var(--ink-2); }
.howto .howto-body > * + * { margin-top: .9rem; }
.howto h3 { font-size: 1.125rem; font-weight: 500; color: var(--ink); margin-top: 1.5rem; }
.howto ol, .howto ul { padding-left: 1.25rem; }
.howto ol { list-style: decimal; }
.howto ul { list-style: disc; }
.howto li + li { margin-top: .35rem; }
.howto .worked { padding: 1rem 1.1rem; background: var(--sunk); border-radius: var(--radius); font-size: 1rem; }
.howto .worked p + p { margin-top: .5rem; }

/* ---------- confirm dialog ---------- */
.dialog {
  width: min(26rem, calc(100vw - 2rem)); padding: 1.5rem; border: 1px solid var(--rule-2); border-radius: 4px;
  background: var(--paper); color: var(--ink); box-shadow: 0 1rem 3rem rgba(0, 0, 0, .25);
}
.dialog::backdrop { background: rgba(20, 19, 18, .55); }
.dialog h2 { font-size: 1.5rem; line-height: 1.2; }
.dialog p { margin-top: .6rem; color: var(--ink-2); }
.dialog .dialog-actions { display: flex; flex-wrap: wrap-reverse; justify-content: flex-end; gap: .5rem; margin-top: 1.4rem; }
@media (max-width: 26rem) { .dialog .dialog-actions .btn { flex: 1 1 100%; } }

/* ---------- footer ---------- */
.foot {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 2rem; margin-top: 1rem; padding: 1.5rem 0 2.75rem;
  border-top: 1px solid var(--ink); font-size: 1rem; color: var(--ink-2);
}
.foot .by { color: var(--muted); font-style: italic; }
.foot a { display: inline-flex; align-items: center; min-height: var(--tap); }

/* ---------- custom version: what a version built for one business adds ----------
   Sits after the how-to and before the footer. Not a banner: a ruled note at the foot of the sheet.
   <section class="custom" aria-labelledby="h-custom">
     <p class="custom-kicker">Custom version</p>
     <h2 id="h-custom">Built around your kitchen</h2>
     <p class="custom-lede">One or two sentences.</p>
     <ul class="custom-list"><li><strong>Short name.</strong> One plain line.</li> … 5 to 7 items …</ul>
     <p class="custom-cta"><a href="…">Talk to me about a version for your business</a> <span>The first call is free.</span></p>
   </section>
   Phone: one column. From 40rem the list runs in two columns. From 68rem the words sit in a
   margin column on the left with the list beside them. Hidden in print. */
.custom {
  display: grid; grid-template-columns: minmax(0, 1fr); padding: 2rem 0 1.75rem; border-top: 1px solid var(--rule);
}
.custom-kicker { display: flex; align-items: center; gap: .6rem; font-style: italic; font-size: 1rem; color: var(--muted); }
.custom-kicker::before { content: ""; flex: none; width: 1.5rem; height: 2px; background: var(--mark); }
.custom h2 { margin-top: .5rem; font-size: clamp(1.5rem, 3.4vw, 1.9rem); line-height: 1.15; letter-spacing: -.012em; font-weight: 400; }
.custom-lede { margin-top: .6rem; max-width: var(--measure); color: var(--ink-2); }
.custom-list {
  display: grid; grid-template-columns: minmax(0, 1fr); column-gap: 2.5rem; align-content: start;
  margin: 1.5rem 0 0; padding: 0; list-style: none; border-bottom: 1px solid var(--rule);
  font-size: 1rem; line-height: 1.45; color: var(--ink-2);
}
.custom-list li { padding: .7rem 0; border-top: 1px solid var(--rule); }
.custom-list li:first-child { border-top-color: var(--ink); }
.custom-list strong { font-weight: 500; color: var(--ink); }
.custom-cta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 1rem; margin-top: 1rem; }
.custom-cta a { display: inline-block; padding: .6rem 0; font-size: 1.125rem; text-decoration-color: var(--mark); text-decoration-thickness: 2px; }
.custom-cta span { font-style: italic; font-size: 1rem; color: var(--muted); }
@media (min-width: 40rem) {
  .custom-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .custom-list li:nth-child(2) { border-top-color: var(--ink); }
  .custom-list li:last-child:nth-child(odd) { grid-column: 1 / -1; }
}
@media (min-width: 68rem) {
  .custom {
    grid-template-columns: 19rem minmax(0, 1fr); grid-template-rows: auto auto auto auto 1fr; column-gap: 3.5rem; padding: 2.5rem 0 2rem;
  }
  .custom > * { grid-column: 1; }
  .custom-list { grid-column: 2; grid-row: 1 / -1; align-self: start; margin-top: .35rem; }
  .custom-cta { display: block; margin-top: 1.25rem; }
  .custom-cta span { display: block; }
}
@media print { .custom { display: none !important; } }

/* ---------- "More" in the strip ----------
   <div class="more" id="more"><button class="btn quiet more-btn" id="act-more" aria-expanded="false" aria-controls="more-list">More</button>
     <div class="more-list" id="more-list">…the less-used .btn.quiet actions…</div></div>
   Wide screens: the More button is gone and the actions sit in the strip as before.
   Under 40rem, once the script has marked it [data-ready], they fold into a small list under More.
   Without the script nothing is hidden. */
.more, .more-list { display: contents; }
.more-btn { display: none; }
@media (max-width: 39.99rem) {
  .more[data-ready] { display: block; }
  .more[data-ready] .more-btn { display: inline-flex; }
  .more[data-ready] .more-btn::after {
    content: ""; width: .4rem; height: .4rem; margin: -.2rem .1rem 0 .1rem; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg);
  }
  .more[data-ready].is-open .more-btn { background: var(--sunk); color: var(--ink); }
  .more[data-ready] .more-list {
    display: none; position: absolute; top: 100%; right: 0; z-index: 20;  /* placed against .strip, so it can't run off a narrow screen */ min-width: 12rem; padding: .25rem;
    background: var(--card); border: 1px solid var(--rule-2); border-radius: var(--radius); box-shadow: 0 .5rem 1.5rem rgba(0, 0, 0, .18);
  }
  .more[data-ready].is-open .more-list { display: grid; }
  .more[data-ready] .more-list .btn { justify-content: flex-start; width: 100%; white-space: nowrap; }
  /* Room for Save, Open, Print and More on one row. */
  .actions:has(.more[data-ready]) > .btn.quiet, .more[data-ready] .more-btn { padding-left: .4rem; padding-right: .4rem; white-space: nowrap; }
  .actions:has(.more[data-ready]) { gap: 0; margin-left: -.4rem; }
  /* The theme button moves up beside the back link, so the row fits a 320px phone. */
  .strip:has(.more[data-ready]) { position: relative; }
  .strip:has(.more[data-ready]) .theme-btn { position: absolute; top: .625rem; right: -.4rem; }
}
@media (max-width: 22.49rem) {
  .actions:has(.more[data-ready]) > .btn.quiet, .more[data-ready] .more-btn { padding-left: .3rem; padding-right: .3rem; }
  .actions:has(.more[data-ready]) { margin-left: -.3rem; }
}

/* ---------- a notice that stays in view ----------
   Add .toast to the shared #notice so "Removed … Put it back" shows wherever the person is on a long page. */
.notice.toast {
  position: fixed; z-index: 30; left: var(--gutter); right: var(--gutter); bottom: max(1rem, env(safe-area-inset-bottom, 0px));
  max-width: 40rem; margin: 0 auto; background: var(--card); border: 1px solid var(--rule-2); border-left: 2px solid var(--mark);
  box-shadow: 0 .5rem 1.5rem rgba(0, 0, 0, .18);
}
.notice.toast.is-error { border-left-color: var(--over); }
html:has(.notice.toast:not([hidden])) { scroll-padding-bottom: 9rem; }

.print-only { display: none; }

/* ---------- print: a clean sheet, chrome gone ---------- */
@media print {
  :root, :root[data-theme="dark"], :root:not([data-theme="light"]) {
    --paper: #fff; --card: #fff; --sunk: #fff; --ink: #000; --ink-2: #222; --muted: #555; --rule: #bbb; --rule-2: #999; --edge: #999;
    --mark: #000; --good: #000; --over: #000; color-scheme: light;
  }
  @page { margin: 14mm; }
  html { font-size: 11px; }
  body { padding: 0; background: #fff; }
  .strip, .skip, .foot, .notice, .howto, .privacy, .views, .no-print, .btn, dialog { display: none !important; }
  .print-only { display: block; }
  .title { padding: 0 0 1rem; }
  .title h1 { font-size: 1.6rem; }
  .title .lede { display: none; }
  .sec { padding: 1rem 0; }
  .input { height: auto; min-height: 0; padding: 0; border: 0; background: none; box-shadow: none; }
  select.input { background-image: none; padding-right: 0; }
  .affix.has-pre > .input { padding-left: .75rem; }
  .affix.has-suf > .input { padding-right: .9rem; }
  .affix > .pre { left: 0; }
  .affix > .suf { right: 0; }
  .signal { border: 1px solid #999; background: none; }
  .table-wrap { overflow: visible; }
  .result, .ledger tr, .signal { break-inside: avoid; }
  a { text-decoration: none; }
}
