/* Parsheet: count the shelf, get the order. This sheet is the whole look of the product.
   kit.css still loads first for the shared patterns (dialog, More, toast, stacked tables, print);
   everything it draws is restyled here. Nothing is fetched from anywhere: the type ships in fonts/.

   Made for someone on their feet with a phone in one hand: near-black on white, large type,
   big targets. One colour, and it only ever means "order this". */

@font-face {
  font-family: "Atkinson Hyperlegible Next"; font-style: normal; font-weight: 200 800; font-display: swap;
  src: url("fonts/AtkinsonHyperlegibleNext-Variable.woff2") format("woff2");
}
@font-face {
  font-family: "Atkinson Hyperlegible Next"; font-style: italic; font-weight: 200 800; font-display: swap;
  src: url("fonts/AtkinsonHyperlegibleNext-Variable-Italic.woff2") format("woff2");
}

/* ---------- tokens ----------
   Two tones and one accent. Flags and errors are said in words, weight and shape, not in a second colour,
   so the blue keeps its one meaning. */
:root {
  --paper: #FFFFFF;
  --card: #FFFFFF;
  --sunk: #F3F3F1;
  --sel: #E7E7E4;
  --ink: #0B0B0C;
  --ink-2: #303034;
  --muted: #5C5C61;
  --rule: #DCDCD8;
  --rule-2: #BDBDB8;
  --edge: #707075;
  --order: #1F3DF0;
  --on-order: #FFFFFF;
  --mark: var(--ink);
  --good: var(--ink);
  --over: var(--ink);
  --focus: var(--ink);
  --shadow: 0 .75rem 2.5rem rgba(11, 11, 12, .18);
  --sans: "Atkinson Hyperlegible Next", ui-sans-serif, system-ui, -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --serif: var(--sans);
  --radius: 10px;
  --radius-2: 16px;
  --tap: 3rem;
  --wrap: 72rem;
  --measure: 40rem;
  /* the scale */
  --t-xs: .875rem;
  --t-sm: 1rem;
  --t-base: 1.125rem;
  --t-md: 1.375rem;
  --t-lg: 1.75rem;
  --t-xl: 2.25rem;
  --t-key: clamp(3.25rem, 2.2rem + 5.5vw, 4.75rem);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0B0B0C; --card: #151517; --sunk: #1D1D20; --sel: #2A2A2E; --ink: #F6F6F3; --ink-2: #CFCFCB; --muted: #A3A39E;
    --rule: #2B2B2F; --rule-2: #45454A; --edge: #8E8E94; --order: #93A7FF; --on-order: #0B0B0C;
    --mark: var(--ink); --good: var(--ink); --over: var(--ink); --focus: var(--ink);
    --shadow: 0 0 0 1px #45454A, 0 1rem 3rem rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0B0B0C; --card: #151517; --sunk: #1D1D20; --sel: #2A2A2E; --ink: #F6F6F3; --ink-2: #CFCFCB; --muted: #A3A39E;
  --rule: #2B2B2F; --rule-2: #45454A; --edge: #8E8E94; --order: #93A7FF; --on-order: #0B0B0C;
    --mark: var(--ink); --good: var(--ink); --over: var(--ink); --focus: var(--ink);
  --shadow: 0 0 0 1px #45454A, 0 1rem 3rem rgba(0, 0, 0, .6);
  color-scheme: dark;
}
@media (min-width: 64rem) and (pointer: fine) { :root { --tap: 2.75rem; } }

/* ---------- base ---------- */
body {
  font-family: var(--sans); font-size: var(--t-base); line-height: 1.45; font-weight: 400;
  font-variant-numeric: tabular-nums lining-nums;   /* every figure on the page sits on the same grid */
  text-rendering: optimizeLegibility; -moz-osx-font-smoothing: grayscale;
}
h1, h2, h3, h4 { font-weight: 700; letter-spacing: -.012em; }
strong, b { font-weight: 700; }
a:hover { text-decoration-color: currentColor; }
::selection { background: color-mix(in srgb, var(--order) 26%, transparent); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.num, .fig { font-family: inherit; }
.skip { font-family: inherit; font-size: var(--t-sm); font-weight: 700; border-radius: var(--radius); }
.muted { color: var(--muted); }

/* ---------- top bar ---------- */
.strip { flex-wrap: nowrap; gap: 1rem; padding: .625rem 0; border-bottom: 0; }
.brand { display: flex; align-items: center; gap: .625rem; min-width: 0; min-height: var(--tap); }
.brand h1 { font-size: 1.5rem; font-weight: 800; line-height: 1; letter-spacing: -.02em; }
.mark { display: block; }
.mark-a { fill: var(--ink); }
.mark-b { fill: var(--order); }
.tagline { display: none; margin-left: .5rem; padding-left: 1.125rem; border-left: 2px solid var(--rule-2); font-size: var(--t-sm); line-height: 1.5rem; color: var(--muted); white-space: nowrap; }
@media (min-width: 60rem) { .tagline { display: block; } }
.actions { flex-wrap: nowrap; gap: 0 .125rem; margin: 0 -.5rem 0 0; }
@media (min-width: 40rem) { .actions { flex-wrap: wrap; justify-content: flex-end; } }

/* ---------- views: four big keys, the one you're on filled in ---------- */
.views { flex-wrap: nowrap; gap: .25rem; margin: .25rem 0 1.5rem; padding: .25rem; background: var(--sunk); border: 0; border-radius: 14px; }
.view-tab {
  flex: 1 1 auto; min-height: 3rem; margin: 0; padding: .5rem .625rem; border: 0; border-radius: 10px;
  font-family: inherit; font-size: var(--t-sm); font-weight: 700; color: var(--ink-2);
}
.view-tab:first-child { padding-left: .625rem; }
.view-tab:hover { color: var(--ink); background: var(--sel); border: 0; }
.view-tab[aria-selected="true"], .view-tab[aria-selected="true"]:hover { color: var(--paper); background: var(--ink); font-weight: 700; }
.view-tab:focus-visible { outline-offset: 2px; }
@media (max-width: 30rem) { .view-tab { padding: .5rem .5rem; font-size: var(--t-sm); } }
@media (min-width: 48rem) {
  .views { display: inline-flex; margin-bottom: 2rem; }
  .view-tab { flex: none; padding: .5rem 1.375rem; font-size: 1.0625rem; }
}

/* ---------- buttons ---------- */
.btn {
  gap: .5rem; padding: .5rem 1.125rem; font-family: inherit; font-size: var(--t-sm); font-weight: 700; line-height: 1.2;
  border: 2px solid var(--ink); border-radius: var(--radius); color: var(--ink);
}
.btn:hover { background: var(--sunk); }
.btn:active { background: var(--sel); }
.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); font-weight: 600; padding-left: .75rem; padding-right: .75rem; }
.btn.quiet:hover { border-color: transparent; color: var(--ink); background: var(--sunk); }
.btn.danger, .btn.quiet.danger:hover { color: var(--ink); }
.btn.danger.primary { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.btn.add { border: 2px dashed var(--edge); color: var(--ink); }
.btn.add:hover { border-style: solid; border-color: var(--ink); }
.btn[disabled] { opacity: 1; color: var(--muted); border-color: var(--rule-2); background: none; }
.btn.quiet[disabled] { border-color: transparent; }

/* ---------- form controls ---------- */
.field { gap: .375rem; }
.label, .field > label { font-family: inherit; font-size: var(--t-sm); font-weight: 700; letter-spacing: 0; color: var(--ink); }
.hint { font-family: inherit; font-size: var(--t-xs); line-height: 1.45; color: var(--muted); }
.input {
  padding: 0 .75rem; font-family: inherit; font-size: var(--t-base); font-variant-numeric: tabular-nums lining-nums;
  color: var(--ink); background: var(--card); border: 2px solid var(--edge); border-radius: var(--radius);
}
.input::placeholder { color: var(--muted); }
.input:hover { border-color: var(--ink); }
.input:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-color: var(--ink); border-radius: var(--radius); }
/* A wrong entry: a heavier, broken edge and a hatched ground, with the reason in words beside it. */
.input[aria-invalid="true"] {
  border: 3px dashed var(--ink); box-shadow: none;
  background-image: repeating-linear-gradient(135deg, var(--sel) 0 4px, transparent 4px 10px);
}
select.input {
  padding-right: 2rem;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%);
  background-position: calc(100% - 1.05rem) 52%, calc(100% - .7rem) 52%; background-size: .35rem .35rem;
}
input[type="date"].input { min-width: 10.5rem; text-align: left; }
.affix > .pre, .affix > .suf { font-family: inherit; font-size: var(--t-sm); color: var(--muted); }
.affix > .pre { left: .8rem; }
.affix > .suf { right: .8rem; }
.affix.has-pre > .input { padding-left: 1.6rem; }
.affix.has-suf > .input { padding-right: 1.8rem; }
.field-msg { font-family: inherit; font-size: var(--t-xs); color: var(--ink-2); }
.field-msg.is-error { color: var(--ink); font-weight: 700; }
.check { display: flex; align-items: center; gap: .75rem; min-height: var(--tap); font-size: var(--t-sm); font-weight: 600; color: var(--ink); cursor: pointer; }
.check input { width: 1.5rem; height: 1.5rem; flex: none; accent-color: var(--ink); }

/* ---------- section heads ---------- */
.sec-head { margin-bottom: 1.5rem; }
.sec-head h2 { font-size: var(--t-lg); line-height: 1.15; letter-spacing: -.018em; }
.sec-head p { max-width: 44rem; margin-top: .5rem; color: var(--ink-2); }
.keys-hint { margin-top: 1.25rem; max-width: 44rem; }
.empty { max-width: var(--measure); padding: 1rem 0 1.5rem; color: var(--ink-2); }
.empty .btn { margin-top: 1rem; }

/* ---------- notices ---------- */
.notice {
  gap: .375rem 1rem; margin: 0 0 1rem; padding: .5rem .5rem .5rem 1rem; background: var(--sunk); border: 0; border-radius: var(--radius-2);
  font-size: var(--t-sm); color: var(--ink-2);
}
.notice p { padding: .375rem 0; }
.notice .btn { min-height: 2.75rem; background: var(--paper); }
.notice .btn.quiet { background: none; }
.notice.is-error { box-shadow: inset 4px 0 0 var(--ink); font-weight: 600; color: var(--ink); }
.notice.toast {
  max-width: 40rem; padding: .625rem .625rem .625rem 1.125rem; background: var(--ink); color: var(--paper); border: 0; border-radius: var(--radius-2);
  box-shadow: var(--shadow); font-weight: 600;
}
.notice.toast.is-error { box-shadow: inset 6px 0 0 var(--paper), inset 10px 0 0 var(--ink), var(--shadow); padding-left: 1.5rem; }
.notice.toast .btn { background: none; color: var(--paper); border-color: var(--paper); }
.notice.toast .btn.quiet { border-color: transparent; }
.notice.toast .btn:hover { background: color-mix(in srgb, var(--paper) 16%, transparent); color: var(--paper); }
.notice.toast :focus-visible { outline-color: var(--paper); }

/* A verdict in words with a small mark. No second colour: "good" is plain, a flag is heavy with a bar. */
.signal { gap: .625rem; max-width: 34rem; margin-top: 1rem; padding: 0; border: 0; border-radius: 0; background: none; font-size: var(--t-sm); line-height: 1.45; color: var(--ink); }
.signal > span, .signal > div { min-width: 0; }
.signal svg { width: 1.125rem; height: 1.125rem; margin-top: .15rem; color: var(--ink); }
.signal.good, .signal.over, .signal.idle { border: 0; background: none; }
.signal.good { font-weight: 600; }
.signal.over { padding: .75rem 1rem .75rem .875rem; border-left: 4px solid var(--ink); background: var(--sunk); border-radius: 0 var(--radius) var(--radius) 0; font-weight: 700; }
.signal.idle, .signal.idle svg { color: var(--ink-2); }

/* ================= Count ================= */
/* Keep a focused box clear of the walk bar that stays at the top. */
html { scroll-padding-top: 7rem; }
/* The walk bar: how far through you are, and the order building behind. It stays at the top while the list scrolls. */
.walkbar {
  position: sticky; top: 0; z-index: 5; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: .375rem 1rem;
  margin: 0 0 1rem; padding: .5rem 0 .75rem; background: var(--paper); box-shadow: 0 1px 0 var(--rule);
}
@media (max-width: 47.99rem) { .walkbar { margin: 0 calc(-1 * var(--gutter)) 1rem; padding: .5rem var(--gutter) .75rem; } }
.progress-words { font-size: var(--t-md); font-weight: 700; line-height: 1.2; letter-spacing: -.012em; }
.bar { grid-column: 1 / -1; height: 6px; margin: 0; background: var(--rule); border-radius: 3px; overflow: hidden; }
.bar span { display: block; height: 100%; width: 0; background: var(--ink); border-radius: 3px; }
@media (prefers-reduced-motion: no-preference) { .bar span { transition: width .2s; } }
.sofar {
  display: grid; justify-items: end; gap: 0; min-height: var(--tap); margin: 0 -.5rem 0 0; padding: .125rem .5rem; text-align: right;
  font: inherit; color: var(--ink); background: none; border: 0; border-radius: var(--radius); cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.sofar:hover { background: var(--sunk); }
.sofar-l { font-size: var(--t-xs); line-height: 1.3; color: var(--muted); }
.sofar-n { display: inline-flex; align-items: center; gap: .25rem; font-size: var(--t-md); font-weight: 700; line-height: 1.2; letter-spacing: -.012em; }
@media (min-width: 48rem) {
  .walkbar { margin-bottom: 1.5rem; padding-top: .75rem; padding-bottom: 1rem; }
  .progress-words, .sofar-n { font-size: var(--t-lg); }
  .sofar-l { font-size: var(--t-sm); }
}

/* Whole list, or one at a time. */
.count-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: 1rem; }
.seg { display: inline-flex; gap: .25rem; padding: .25rem; background: var(--sunk); border-radius: 12px; }
.seg-btn {
  min-height: 2.75rem; padding: .375rem 1rem; font: inherit; font-size: var(--t-sm); font-weight: 700; color: var(--ink-2); background: none; border: 0; border-radius: 9px;
  cursor: pointer; white-space: nowrap; -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.seg-btn:hover { color: var(--ink); background: var(--sel); }
.seg-btn[aria-pressed="true"], .seg-btn[aria-pressed="true"]:hover { color: var(--ink); background: var(--paper); box-shadow: inset 0 0 0 2px var(--ink); }
@media (max-width: 30rem) {
  .seg { display: flex; flex: 1 1 100%; }
  .seg-btn { flex: 1 1 0; }
}
#count-next { margin: 0 -.75rem; }
#count-next svg { color: var(--ink-2); }
#count-body[data-mode="one"] #count-next { display: none; }

#count-stale { margin: 0 0 1.25rem; padding: .875rem 1rem; max-width: none; border-left: 4px solid var(--ink); background: var(--sunk); border-radius: 0 var(--radius) var(--radius) 0; color: var(--ink); }
.stale-body { display: grid; gap: .75rem; justify-items: start; }
.stale-body .btn { background: var(--paper); }

.areas-nav { margin-bottom: .25rem; }
.areas-nav ul { display: flex; flex-wrap: wrap; gap: .5rem; }
/* On a phone the areas run in one row you can swipe, so the first shelf is never far down the page. */
@media (max-width: 30rem) {
  .areas-nav { margin: 0 calc(-1 * var(--gutter)) .25rem; }
  .areas-nav ul { flex-wrap: nowrap; overflow-x: auto; padding: .25rem var(--gutter); scrollbar-width: none; -webkit-overflow-scrolling: touch; scroll-padding: 0 var(--gutter); }
  .areas-nav ul::-webkit-scrollbar { display: none; }
  .areas-nav li { flex: none; }
  .chip { white-space: nowrap; }
}
.chip {
  display: inline-flex; align-items: center; gap: .5rem; min-height: 2.75rem; padding: .25rem .875rem;
  border: 2px solid var(--rule-2); border-radius: 999px; text-decoration: none;
  font-family: inherit; font-size: var(--t-sm); font-weight: 700; color: var(--ink);
}
.chip:hover { background: var(--sunk); border-color: var(--ink); }
.chip .ct { font-size: var(--t-xs); font-weight: 400; color: var(--muted); }
.chip.is-done .ct { color: var(--ink-2); }
.chip.is-done .ct::before { content: ""; display: inline-block; width: .7rem; height: .4rem; margin: 0 .35rem .2rem 0; border-left: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); }
#count-body[data-mode="one"] .chip[aria-current="true"] { border-color: var(--ink); background: var(--sunk); }

/* The rows. A list, not a table: stacked on a phone, one line across when there's room. */
.count-box { container-type: inline-size; container-name: count; }
.count-head { display: none; }
.count-area { padding-top: 1.75rem; scroll-margin-top: 5.5rem; }
.area-h { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; padding-bottom: .5rem; border-bottom: 2px solid var(--ink); }
.area-h h3 { font-size: var(--t-lg); line-height: 1.15; letter-spacing: -.018em; }
.area-h h3:focus { outline: none; }
.area-h .ct { font-size: var(--t-xs); color: var(--muted); white-space: nowrap; }

.crow {
  display: grid; grid-template-columns: minmax(0, 1fr) 6.75rem; grid-template-areas: "name box" "status status" "since since";
  gap: .375rem 1rem; padding: 1rem 0 1.125rem; border-bottom: 1px solid var(--rule); scroll-margin-top: 5.5rem;
}
.crow .c-name { grid-area: name; align-self: center; min-width: 0; }
.crow .nm { display: block; font-size: var(--t-md); font-weight: 700; line-height: 1.2; letter-spacing: -.012em; cursor: pointer; }
.crow .meta { margin-top: .25rem; font-size: var(--t-xs); line-height: 1.4; color: var(--muted); }
.crow .c-box { grid-area: box; display: grid; grid-template-columns: minmax(0, 1fr); gap: .2rem; align-content: start; }
.count-input.input { height: 3.5rem; padding: 0 .75rem; font-size: var(--t-lg); font-weight: 700; text-align: right; border: 2px solid var(--ink); border-radius: 12px; }
.crow.is-open .count-input { border: 2px dashed var(--edge); }
.crow.is-open .count-input:hover, .crow.is-open .count-input:focus-visible { border-color: var(--ink); }
.crow.is-bad .count-input { border: 3px dashed var(--ink); }
.crow .unit { min-height: 1.2rem; font-size: var(--t-xs); color: var(--muted); text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.step { display: none; }

.c-status { grid-area: status; display: flex; align-items: flex-start; gap: .5rem; font-size: var(--t-sm); line-height: 1.5; color: var(--ink-2); }
.c-status svg { margin-top: .25rem; color: var(--ink-2); }
.c-status strong { font-weight: 700; color: var(--ink); }
.c-status.is-open, .c-status.is-open svg { color: var(--muted); }
.c-status.is-ok, .c-status.is-ok svg { color: var(--ink-2); }
.c-status.is-bad, .c-status.is-nopar { color: var(--ink); font-weight: 700; }
.c-status.is-bad svg, .c-status.is-nopar svg { color: var(--ink); stroke-width: 2.2; }
/* The one place the colour goes: what to order. The word "Order" is always in it. */
.c-status.is-order { align-items: center; }
.c-status.is-order svg { display: none; }
.c-status.is-order strong {
  display: inline-block; margin-right: .5rem; padding: .25rem .625rem; font-weight: 700; line-height: 1.3; white-space: nowrap;
  color: var(--on-order); background: var(--order); border-radius: 7px;
}
.c-since { grid-area: since; font-size: var(--t-xs); line-height: 1.4; color: var(--muted); }
.c-since:empty { display: none; }
.c-since.is-odd { padding: .5rem .75rem; border-left: 4px solid var(--ink); background: var(--sunk); border-radius: 0 8px 8px 0; font-weight: 700; color: var(--ink); }

@container count (min-width: 50rem) {
  .count-head, .crow {
    grid-template-columns: minmax(12rem, 1.15fr) 10.5rem minmax(13rem, 1.1fr) minmax(11rem, .9fr);
    grid-template-areas: "name box status since"; column-gap: 1.75rem;
  }
  .count-head { display: grid; padding: 1.25rem 0 0; font-size: var(--t-xs); font-weight: 700; color: var(--muted); }
  .count-area { padding-top: 1.5rem; }
  .crow { align-items: center; padding: .625rem 0; }
  .crow .nm { font-size: 1.25rem; }
  .crow .c-box { grid-template-columns: 6.25rem minmax(0, 1fr); align-items: center; gap: .5rem; }
  .crow .unit { text-align: left; min-height: 0; }
  .count-input.input { height: 3rem; font-size: var(--t-md); }
}

/* ---------- one at a time: the same rows, one showing, everything larger ---------- */
#count-body[data-mode="list"] .pager,
#count-body[data-mode="one"] .count-head,
#count-body[data-mode="one"] .count-area:not(.has-current),
#count-body[data-mode="one"] .crow:not(.is-current) { display: none; }
#count-body[data-mode="one"] .walkbar { position: static; }
#count-body[data-mode="one"] .count-box, #count-body[data-mode="one"] .pager { max-width: 34rem; }
#count-body[data-mode="one"] .count-area { padding-top: 1rem; }
#count-body[data-mode="one"] .area-h { border-bottom: 0; padding-bottom: 0; align-items: center; }
#count-body[data-mode="one"] .area-h h3 { font-size: var(--t-sm); font-weight: 700; letter-spacing: 0; color: var(--ink-2); }
#count-body[data-mode="one"] .crow {
  grid-template-columns: minmax(0, 1fr); grid-template-areas: "name" "box" "status" "since"; gap: .75rem;
  margin-top: .5rem; padding: 1.25rem 1.125rem 1.125rem; background: var(--card); border: 2px solid var(--ink); border-radius: var(--radius-2);
}
#count-body[data-mode="one"] .crow .c-name { min-height: 4.5rem; align-self: start; }
#count-body[data-mode="one"] .crow .nm { font-size: clamp(1.75rem, 1.3rem + 2.4vw, var(--t-xl)); line-height: 1.12; letter-spacing: -.022em; }
#count-body[data-mode="one"] .crow .meta { margin-top: .375rem; font-size: var(--t-sm); }
#count-body[data-mode="one"] .crow .c-box { grid-template-columns: 4rem minmax(0, 1fr) 4rem; gap: .375rem .625rem; align-items: stretch; }
#count-body[data-mode="one"] .count-input.input { height: 4.75rem; font-size: 3rem; text-align: center; letter-spacing: -.02em; border-width: 3px; border-radius: 14px; }
#count-body[data-mode="one"] .crow .unit { grid-column: 1 / -1; min-height: 1.4rem; font-size: var(--t-sm); text-align: center; }
#count-body[data-mode="one"] .step {
  display: inline-flex; align-items: center; justify-content: center; min-height: 4.75rem; padding: 0; color: var(--ink); background: var(--sunk); border: 0; border-radius: 14px;
  cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
#count-body[data-mode="one"] .step:hover { background: var(--sel); }
#count-body[data-mode="one"] .step:active { background: var(--rule-2); }
#count-body[data-mode="one"] .c-status { min-height: 2.75rem; align-items: flex-start; font-size: var(--t-base); }
#count-body[data-mode="one"] .c-status.is-order { display: block; }
#count-body[data-mode="one"] .c-status.is-order strong { font-size: var(--t-md); padding: .3rem .75rem; border-radius: 9px; margin-bottom: .25rem; }
#count-body[data-mode="one"] .c-since { min-height: 1.25rem; font-size: var(--t-sm); }
#count-body[data-mode="one"] .c-since:empty { display: block; }
:root[data-theme="dark"] #count-body[data-mode="one"] .crow { border-color: var(--rule-2); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) #count-body[data-mode="one"] .crow { border-color: var(--rule-2); } }

.pager { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1.4fr); align-items: center; gap: .75rem; margin-top: .875rem; }
.pager .btn { min-height: 3.75rem; font-size: var(--t-base); }
#one-skip { grid-column: 1 / -1; justify-self: center; min-height: var(--tap); font-size: var(--t-sm); }
.pager-pos { min-width: 4.5rem; font-size: var(--t-sm); font-weight: 700; color: var(--ink-2); text-align: center; white-space: nowrap; }

.count-foot { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-top: 2rem; padding-top: 1.25rem; border-top: 2px solid var(--ink); }
.count-date { max-width: 13rem; margin-top: 1.5rem; }
@media (max-width: 30rem) { .count-foot .btn.primary { flex: 1 1 100%; min-height: 3.5rem; font-size: var(--t-base); } }

/* ================= Order ================= */
.result { border-top: 0; padding-top: 0; }
.result .key-label { font-size: var(--t-sm); font-style: normal; font-weight: 700; color: var(--ink-2); }
.result .key {
  display: block; margin: .125rem 0 0 -.03em; font-family: inherit; font-size: var(--t-key); line-height: 1.05; font-weight: 700; letter-spacing: -.035em;
  text-align: left; color: var(--ink);
}
.result .key-sub { margin-top: .5rem; font-family: inherit; font-size: var(--t-sm); color: var(--ink-2); }
.stats { margin-top: 1.25rem; border-bottom: 1px solid var(--rule); }
.stats > div { gap: 1rem; padding: .75rem 0; border-top: 1px solid var(--rule); }
.stats dt { font-size: var(--t-base); font-weight: 600; color: var(--ink); }
.stats dt small { font-family: inherit; font-size: var(--t-xs); font-weight: 400; color: var(--muted); }
.stats dd { font-family: inherit; font-size: var(--t-md); font-weight: 700; letter-spacing: -.012em; }

.order-top { display: grid; gap: 1.75rem 3rem; margin-bottom: 2rem; align-items: start; }
@media (min-width: 56rem) { .order-top { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); } }
.order-how { margin-top: 1rem; max-width: 30rem; }
.order-note { margin-top: .625rem; font-size: var(--t-xs); color: var(--ink-2); }
.panel { background: var(--card); border: 2px solid var(--rule-2); border-radius: var(--radius-2); padding: 1.125rem; }
.order-opts { display: grid; gap: .75rem; background: var(--sunk); border-color: transparent; }
.order-opts .input { background: var(--paper); }
@media (min-width: 48rem) { .panel { padding: 1.5rem; } }

.vendors { display: grid; gap: 1.25rem; }
@media (min-width: 70rem) { .vendors { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; } }
.vendor { min-width: 0; container-type: inline-size; container-name: vendor; }
/* A narrow order: each line is the item, then what to order and what it costs side by side. */
@container vendor (max-width: 30rem) {
  .vendor .order-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); }
  .vendor .order-table, .vendor .order-table tbody, .vendor .order-table tfoot { display: block; }
  .vendor .order-table tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: .125rem 1rem; padding: .875rem 0; border-bottom: 1px solid var(--rule); }
  .vendor .order-table th, .vendor .order-table td { display: block; padding: 0; border: 0; min-width: 0; }
  .vendor .order-table tbody th { grid-column: 1 / -1; min-width: 0; font-size: var(--t-base); }
  .vendor .order-table tbody th small { display: inline; margin-left: .5rem; }
  .vendor .order-table tfoot tr { border-bottom: 0; border-top: 2px solid var(--ink); }
  .vendor .order-table tfoot th, .vendor .order-table tfoot td { border: 0; }
}
.vendor-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .25rem 1rem; padding-bottom: .75rem; border-bottom: 2px solid var(--ink); }
.vendor-head h3 { font-size: var(--t-lg); line-height: 1.15; letter-spacing: -.018em; }
.vendor-total { text-align: right; }
.vendor-total .num { font-size: var(--t-lg); font-weight: 700; letter-spacing: -.018em; }
.vendor-total small { display: block; font-size: var(--t-xs); color: var(--muted); }
.vendor > .hint { margin-top: .75rem; }
.order-table th small, .order-table td small { display: block; font-size: var(--t-xs); font-weight: 400; color: var(--muted); white-space: normal; }
.order-table td strong { font-weight: 700; white-space: nowrap; }
.order-table tbody th { min-width: 7rem; }
.vendor-send { display: grid; gap: 1rem; margin-top: 1.25rem; }
.vendor-acts { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
/* Sending the order is the same "order this", so it carries the same colour. */
.vendor-acts .btn { min-height: 3.25rem; }
.vendor-acts .btn.primary { padding-left: 1.5rem; padding-right: 1.5rem; background: var(--order); border-color: var(--order); color: var(--on-order); }
.vendor-acts .btn.primary:hover { background: color-mix(in srgb, var(--order) 86%, var(--ink)); border-color: transparent; }
.copy-msg { flex: 1 1 12rem; font-size: var(--t-xs); font-weight: 600; color: var(--ink); }
.long-note { flex-basis: 100%; margin: 0; }
.vendor-email { max-width: 24rem; }
.msg > summary {
  display: inline-flex; align-items: center; gap: .5rem; min-height: var(--tap); cursor: pointer; font-size: var(--t-sm); font-weight: 700; color: var(--ink);
  text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: .2em; list-style: none;
}
.msg > summary::-webkit-details-marker { display: none; }
.msg-text.input { height: auto; min-height: 7rem; padding: .875rem 1rem; font-size: var(--t-sm); line-height: 1.5; resize: vertical; background: var(--sunk); border-color: var(--rule-2); white-space: pre-wrap; }

/* ================= tables ================= */
.table-wrap { border-radius: 0; }
.ledger { font-size: var(--t-sm); }
.ledger th, .ledger td { padding: .75rem .75rem; border-bottom: 1px solid var(--rule); }
.ledger thead th { font-family: inherit; font-size: var(--t-xs); font-weight: 700; color: var(--muted); border-bottom: 1px solid var(--rule-2); padding-bottom: .5rem; }
.ledger tbody th { font-weight: 700; }
.ledger tfoot th, .ledger tfoot td { border-top: 2px solid var(--ink); font-weight: 700; }
.ledger caption { font-style: normal; }
@media (max-width: 43.99rem) {
  .ledger.stack tr { padding: 1rem 0; }
  .ledger.stack tbody tr:first-child { border-top: 2px solid var(--ink); }
  .ledger.stack tbody th { font-size: var(--t-md); font-weight: 700; }
  .ledger.stack td { min-height: 2.25rem; }
  .ledger.stack td::before { font-family: inherit; font-size: var(--t-sm); font-weight: 400; color: var(--ink-2); }
  .ledger.stack td .input { width: 7rem; }
}

/* ================= Items ================= */
.lines-foot { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-top: 2rem; padding: 1.25rem 0 0; border-top: 2px solid var(--ink); }
.items-box { container-type: inline-size; container-name: items; }
.area-block + .area-block { margin-top: 2.75rem; }
.area-head { display: flex; align-items: flex-end; justify-content: space-between; gap: .5rem; border-bottom: 2px solid var(--ink); }
.area-name-f { flex: 1 1 auto; max-width: 26rem; }
.area-name.input { height: 3.25rem; padding: 0 .125rem; font-family: inherit; font-size: var(--t-lg); font-weight: 700; letter-spacing: -.018em; background: transparent; border: 0; border-radius: 0; }
.area-name.input:hover { box-shadow: inset 0 -2px 0 var(--edge); }
.area-name.input:focus-visible { border-radius: 6px; }
.area-acts { display: flex; }
.area-acts .btn { color: var(--ink-2); }
.area-empty { padding: 1rem 0 0; }
.area-foot { padding-top: 1rem; }
.irow-head { display: none; }

.item { border-bottom: 1px solid var(--rule); }
.item.is-open { border-bottom: 0; }
.irow {
  display: grid; grid-template-columns: minmax(0, 1fr) 1.5rem; grid-template-areas: "nm chev" "meta chev"; gap: .2rem .75rem; align-items: center;
  width: 100%; min-height: 4rem; padding: .75rem 0; text-align: left; font: inherit; background: none; border: 0; cursor: pointer; color: var(--ink);
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.irow:hover .nm { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: .18em; }
.irow .c-nm { grid-area: nm; min-width: 0; }
.irow .nm { font-family: inherit; font-size: var(--t-md); font-weight: 700; line-height: 1.2; letter-spacing: -.012em; }
.irow .code { font-size: var(--t-xs); color: var(--muted); white-space: nowrap; }
.irow .meta { grid-area: meta; font-size: var(--t-xs); line-height: 1.4; color: var(--ink-2); }
.irow .col { display: none; font-family: inherit; font-size: var(--t-sm); color: var(--ink-2); min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.irow .chev { grid-area: chev; display: flex; justify-content: flex-end; color: var(--ink-2); }
.irow .chev svg { width: 1.25rem; height: 1.25rem; stroke-width: 2; }
.irow[aria-expanded="true"] .chev svg { transform: rotate(180deg); }
.irow.no-par .col-par { color: var(--ink); font-weight: 700; }

@container items (min-width: 52rem) {
  .irow-head, .irow {
    grid-template-columns: minmax(12rem, 1.5fr) 7rem minmax(7rem, .8fr) 6.5rem minmax(8rem, 1fr) 1.5rem;
    grid-template-areas: "nm par pack price vendor chev"; column-gap: 1.25rem;
  }
  .irow-head { display: grid; padding: 1rem 0 .5rem; border-bottom: 1px solid var(--rule-2); font-size: var(--t-xs); font-weight: 700; color: var(--muted); }
  .irow { min-height: 3.25rem; padding: .5rem 0; }
  .irow .nm { font-size: 1.25rem; }
  .irow .meta { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
  .irow .col { display: block; }
  .irow .col-par { grid-area: par; } .irow .col-pack { grid-area: pack; } .irow .col-price { grid-area: price; } .irow .col-vendor { grid-area: vendor; }
}

.editor { margin: 0 0 1.25rem; padding: 1.125rem; background: var(--sunk); border: 0; border-radius: var(--radius-2); }
.editor .input { background: var(--paper); }
.ed-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.125rem .75rem; }
.ed-grid .e-name, .ed-grid .e-code, .ed-grid .e-vendor, .ed-grid .e-area { grid-column: 1 / -1; }
.ed-grid .e-price { grid-column: 1 / -1; max-width: 12rem; }
@container items (min-width: 44rem) {
  .editor { padding: 1.5rem; }
  .ed-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 1.25rem 1rem; }
  .ed-grid .e-name { grid-column: span 4; } .ed-grid .e-code { grid-column: span 2; }
  .ed-grid .e-unit, .ed-grid .e-par { grid-column: span 3; }
  .ed-grid .e-pack, .ed-grid .e-size, .ed-grid .e-price { grid-column: span 2; max-width: none; }
  .ed-grid .e-vendor, .ed-grid .e-area { grid-column: span 3; }
}
.ed-acts { display: flex; flex-wrap: wrap; align-items: center; gap: .375rem .5rem; margin-top: 1.25rem; padding-top: 1.125rem; border-top: 1px solid var(--rule-2); }
.ed-acts .btn.primary { flex: 1 1 100%; }
@container items (min-width: 30rem) { .ed-acts .btn.primary { flex: none; min-width: 8rem; margin-right: auto; } }

.parhelp { margin-top: 1.25rem; border-top: 1px solid var(--rule-2); }
.parhelp > summary { display: flex; align-items: center; gap: .625rem; min-height: var(--tap); padding-top: .375rem; cursor: pointer; list-style: none; font-size: var(--t-base); font-weight: 700; }
.parhelp > summary::-webkit-details-marker { display: none; }
.parhelp > summary::before { content: ""; width: .5rem; height: .5rem; flex: none; margin: 0 .25rem; border-right: 2px solid var(--ink); border-bottom: 2px solid var(--ink); transform: rotate(-45deg); }
.parhelp[open] > summary::before { transform: rotate(45deg); }
.parhelp-body { padding: .5rem 0 .25rem; }
.ph-sug { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; margin-bottom: 1.25rem; padding: .75rem 1rem; background: var(--paper); border-left: 4px solid var(--ink); border-radius: 0 var(--radius) var(--radius) 0; font-size: var(--t-sm); color: var(--ink); }
.ph-grid { display: grid; gap: 1.75rem 2.5rem; }
@container items (min-width: 52rem) { .ph-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.ph-way { min-width: 0; margin: 0; padding: 0; border: 0; }
.ph-way legend { padding: 0; font-size: var(--t-base); font-weight: 700; }
.ph-way > .hint { margin-top: .25rem; max-width: 30rem; }
.ph-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; margin-top: .875rem; align-items: end; }
@container items (min-width: 30rem) { .ph-fields { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.ph-out { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .625rem 1rem; min-height: var(--tap); margin-top: .875rem; font-size: var(--t-sm); color: var(--ink-2); }
.ph-out .ph-line { display: block; }
.ph-out .ph-line strong { font-weight: 700; color: var(--ink); }

/* ================= Use and value ================= */
.use-top { display: grid; gap: 2rem 3rem; margin-bottom: 2.25rem; align-items: start; }
@media (min-width: 56rem) { .use-top { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.use-top .result .key { font-size: clamp(2.75rem, 2rem + 3.6vw, 3.75rem); }
.use-date { max-width: 13rem; margin-top: 1.25rem; }
#use-table tbody th span { display: block; font-size: var(--t-base); }
#use-table th small, #use-table td small { display: block; font-size: var(--t-xs); font-weight: 400; color: var(--muted); white-space: normal; }
#use-table td small:empty { display: none; }
#use-table tbody th { min-width: 11rem; }
#use-table td .input { width: 6rem; margin-left: auto; }
#use-table tr.is-odd .used { font-weight: 700; }
#use-table tr.is-odd .used small { font-weight: 700; color: var(--ink); }
#use-table tr.is-odd th { box-shadow: inset 4px 0 0 var(--ink); padding-left: 1rem; }
#use-table td.used small { max-width: 11rem; margin-left: auto; }
@media (max-width: 43.99rem) {
  #use-table.stack tbody th span { font-size: var(--t-md); }
  #use-table.stack td.used { flex-wrap: wrap; }
  #use-table.stack td.used small { flex: 1 1 100%; max-width: none; text-align: right; }
  #use-table.stack tr.is-odd th { padding-left: 1rem; }
}

/* ================= below the sheet ================= */
.howto { margin-top: 3.5rem; border-top: 2px solid var(--ink); border-bottom: 1px solid var(--rule-2); }
.howto > summary { gap: .75rem; min-height: 4rem; padding: .75rem 0; font-size: var(--t-md); font-weight: 700; border-radius: 6px; }
.howto > summary::before { width: .5rem; height: .5rem; margin: 0 .25rem 0 .125rem; border-width: 2px; border-color: var(--ink); }
.howto .howto-body { max-width: var(--measure); padding: .25rem 0 2.25rem; color: var(--ink-2); }
.howto h3 { font-size: var(--t-base); font-weight: 700; color: var(--ink); margin-top: 1.75rem; }
.howto .worked { padding: 1rem 1.125rem; background: var(--sunk); border-radius: var(--radius-2); font-size: var(--t-sm); }
.howto .worked .fig { font-weight: 700; color: var(--ink); }
.howto strong { color: var(--ink); }

/* Custom version: said in the same voice as the rest. Hidden in print (kit.css). */
.custom { margin-top: 3rem; padding: 1.5rem 1.125rem; background: var(--sunk); border: 0; border-radius: var(--radius-2); }
.custom-kicker { gap: 0; font-style: normal; font-size: var(--t-sm); font-weight: 700; color: var(--muted); }
.custom-kicker::before { content: none; }
.custom h2 { margin-top: .375rem; font-size: var(--t-lg); line-height: 1.15; font-weight: 700; letter-spacing: -.018em; }
.custom-lede { margin-top: .625rem; max-width: var(--measure); color: var(--ink-2); }
.custom-list { column-gap: 2.5rem; margin-top: 1.5rem; border-bottom: 1px solid var(--rule-2); font-size: var(--t-sm); line-height: 1.45; color: var(--ink-2); }
.custom-list li { padding: .875rem 0; border-top: 1px solid var(--rule-2); }
.custom-list li:first-child, .custom-list li:nth-child(2) { border-top-color: var(--rule-2); }
.custom-list strong { display: block; font-weight: 700; color: var(--ink); }
.custom-cta { align-items: center; gap: .625rem 1rem; margin-top: 1.5rem; }
.custom-cta a {
  display: inline-flex; align-items: center; min-height: 3.25rem; padding: .5rem 1.25rem; font-size: var(--t-sm); font-weight: 700; line-height: 1.3;
  color: var(--paper); background: var(--ink); border-radius: var(--radius); text-decoration: none;
}
.custom-cta a:hover { background: var(--ink-2); }
.custom-cta span { font-style: normal; font-size: var(--t-sm); color: var(--ink-2); }
@media (min-width: 48rem) { .custom { padding: 2.25rem; } }
@media (min-width: 68rem) {
  .custom { grid-template-columns: 20rem minmax(0, 1fr); column-gap: 4rem; padding: 2.5rem; }
  .custom-list { margin-top: 0; }
  .custom-cta span { margin-top: .75rem; }
}

/* ---------- foot: what it is, what stays on the device, and who made it ---------- */
.foot { display: block; margin-top: 3rem; padding: 1.5rem 0 2.5rem; border-top: 0; font-size: var(--t-xs); line-height: 1.55; color: var(--muted); }
.foot .about { display: grid; gap: .625rem; max-width: 44rem; }
.foot .privacy { margin: 0; padding: 0; max-width: none; border: 0; font-size: inherit; font-style: normal; color: inherit; }
.foot .by { margin-top: 1.75rem; font-style: normal; color: var(--muted); }
.foot a { display: inline; min-height: 0; }

/* ---------- dialog ---------- */
.dialog { width: min(28rem, calc(100vw - 2rem)); padding: 1.5rem; background: var(--card); border: 0; border-radius: 20px; box-shadow: var(--shadow); }
.dialog::backdrop { background: rgba(11, 11, 12, .6); }
.dialog h2 { font-size: var(--t-md); line-height: 1.25; }
.dialog p { margin-top: .625rem; font-size: var(--t-sm); color: var(--ink-2); }
.dialog .dialog-actions { margin-top: 1.5rem; }
.dialog .btn { min-height: 3.25rem; }

/* ---------- the File menu on a phone (kit.css "More") ---------- */
@media (max-width: 39.99rem) {
  .actions:has(.more[data-ready]) { gap: 0 .125rem; margin: 0 -.5rem 0 0; }
  .actions:has(.more[data-ready]) > .btn.quiet, .more[data-ready] .more-btn { padding-left: .75rem; padding-right: .75rem; }
  .more[data-ready] .more-btn { font-weight: 700; color: var(--ink); }
  .more[data-ready] .more-btn::after { width: .45rem; height: .45rem; margin: -.25rem .125rem 0 .25rem; border-width: 2px; }
  .more[data-ready].is-open .more-btn { background: var(--sunk); }
  .more[data-ready] .more-list { top: calc(100% - .25rem); min-width: 14rem; padding: .375rem; background: var(--card); border: 0; border-radius: var(--radius-2); box-shadow: var(--shadow); }
  .more[data-ready] .more-list .btn { min-height: 3rem; padding-left: .875rem; font-size: var(--t-base); font-weight: 600; color: var(--ink); }
  .strip:has(.more[data-ready]) .theme-btn { position: static; }
}

/* ---------- print: a plain sheet ---------- */
.print-head { margin: 0 0 1.25rem; padding-bottom: .5rem; border-bottom: 1px solid #000; }
.print-title { font-size: 1.25rem; font-weight: 700; letter-spacing: -.012em; }
.print-date { font-size: .875rem; }
.sheet-by { margin-bottom: 1rem; }
.sheet-table { margin-bottom: 1.5rem; }
.sheet-table caption { font-size: 1.3rem; font-weight: 700; color: var(--ink); padding-bottom: .2rem; }
.sheet-table th small { color: var(--muted); font-weight: 400; }
.sheet-table .boxcell { width: 6.5rem; text-align: right; }
.sheet-table .box { display: inline-block; width: 6rem; height: 2rem; border: 1px solid var(--ink); border-radius: 2px; vertical-align: middle; }
@media print {
  :root, :root[data-theme="dark"], :root:not([data-theme="light"]) {
    --paper: #fff; --card: #fff; --sunk: #fff; --sel: #fff; --ink: #000; --ink-2: #222; --muted: #555; --rule: #bbb; --rule-2: #999; --edge: #999;
    --order: #000; --on-order: #fff; --shadow: none; color-scheme: light;
  }
  html { font-size: 11px; }
  .input { height: auto; min-height: 0; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; }
  select.input { background-image: none; padding-right: 0; }
  .sec-head.visually-hidden { position: static !important; width: auto; height: auto; margin: 0 0 .75rem; clip: auto; clip-path: none; overflow: visible; white-space: normal; }
  .sec-head p, .empty, .keys-hint { display: none; }
  .sec-head { margin-bottom: .75rem; }
  .sec-head h2 { font-size: 1.5rem; }
  #view-count .sec-head { display: none; }
  #view-count .sheet-table tr, .vendor, .item { break-inside: avoid; }
  .sheet-table th, .sheet-table td { padding-top: .45rem; padding-bottom: .45rem; }
  .ledger tbody th { font-weight: 400; }
  .order-top { display: block; margin-bottom: 1rem; }
  .result .key, .use-top .result .key { font-size: 2.2rem; }
  .signal, .signal.over { padding: 0; border: 0; background: none; }
  .stats { border-bottom: 0; }
  .vendors { display: block; }
  .panel.vendor { border: 0; padding: 0; margin-bottom: 1.5rem; }
  .vendor-head { border-bottom-width: 1px; }
  .vendor-head h3, .vendor-total .num { font-size: 1.3rem; }
  .irow .chev { display: none; }
  .irow { min-height: 0; padding: .3rem 0; }
  .irow .nm { font-size: 1.1rem; }
  .editor, .irow-head { display: none; }
  .area-head { border-bottom-width: 1px; }
  .area-name.input { font-size: 1.3rem; height: auto; }
  .area-block + .area-block { margin-top: 1.25rem; }
  .use-top { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; margin-bottom: 1rem; }
  #use-table tr.is-odd th { box-shadow: none; padding-left: 0; }
  .howto, .custom, .foot { display: none !important; }
}

/* ---------- the way back to the tools list: small and quiet, above the product's own bar ---------- */
.to-tools {
  display: inline-flex; align-items: center; gap: .25rem; min-height: 1.75rem; margin-top: .5rem;
  font-size: .8125rem; font-weight: 500; line-height: 1; color: var(--muted); text-decoration: none;
}
.to-tools:hover { color: var(--ink); text-decoration: underline; text-underline-offset: .2em; }
.to-tools svg { flex: none; }
@media print { .to-tools { display: none; } }

/* Counting one at a time on a phone: the sample note shrinks so the number box is in reach without scrolling. */
@media (max-width: 30rem) {
  #main:has(#view-count:not([hidden]) #count-body[data-mode="one"]) #sample-note { gap: .125rem .5rem; margin-bottom: .75rem; padding: .375rem .375rem .375rem .75rem; font-size: var(--t-xs); line-height: 1.4; }
  #main:has(#view-count:not([hidden]) #count-body[data-mode="one"]) #sample-note p { flex-basis: 100%; padding: .25rem 0 0; }
  #main:has(#view-count:not([hidden]) #count-body[data-mode="one"]) #sample-note .notice-actions { flex-wrap: nowrap; gap: .25rem; }
  #main:has(#view-count:not([hidden]) #count-body[data-mode="one"]) #sample-note .btn { min-height: 2.75rem; padding: .25rem .75rem; font-size: var(--t-xs); }
}
