/* Stall Math: the site's own look, loaded after the kit's /studio/studio.css. Written to DESIGN.md.
   Dark by default: a warm walnut page with cool slate boards on it, chalk text, saddle tan for what you press, hay brass for the one
   number that matters. Every color is a token on :root (and the print block); nothing below uses a color of its own. */

:root {
  --ss-bg: #1c1815;                /* tack-room walnut: the page */
  --ss-surface: #282d2c;           /* feed-room slate: the slate, cards, the footer */
  --ss-ink: #efebe3;               /* chalk */
  --ss-muted: #bdb6aa;             /* chalk dust */
  --ss-line: #48433c;              /* worn edges */
  --ss-accent: #d4945a;            /* saddle tan: buttons, header stripe, rented stalls */
  --ss-accent-ink: #1c1815;
  --ss-accent-text-dark: #edb986;
  --sm-hay: #d9c27a;               /* hay brass: nameplates, the total's double underline, the pay-goal tick */
  --sm-dusk: #9db4c4;              /* dusk through the open top of a stall door (drawings only) */
  --sm-oak: #5b4632;               /* the slate's oak frame */
  --sm-plate-ink: #1c1815;         /* text on a hay-brass nameplate */
  --sm-paper: #ffffff;            /* the printed rate sheet's paper (the picture of it is on white) */
  --sm-err-ink: #f2b3a6;           /* error text */
  --sm-err-bg: #3a2220;            /* error ground */
}

/* ---------- small helpers ---------- */
.js .nojs { display: none; }
.sm-hide { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.ss-btn { cursor: pointer; }
button.ss-btn { font-family: var(--ss-font); }
.ss-btn[disabled] { pointer-events: none; }
[hidden] { display: none !important; }

/* ---------- header and nav ---------- */
.ss-header__in { row-gap: .15rem; }
.ss-nav { align-items: center; gap: .25rem 1.1rem; min-width: 0; }
.ss-nav a { padding: .55rem 0; }
.ss-nav a.nav-buy { background: var(--ss-accent); color: var(--ss-accent-ink); font-weight: 700; border-radius: 999px; padding: .4rem 1rem; border-bottom: 0; white-space: nowrap; }
.ss-nav a.nav-buy:hover { filter: brightness(1.08); }
.nav-tools { display: flex; flex-wrap: wrap; align-items: center; gap: .1rem 1.1rem; min-width: 0; }
@media (max-width: 43.75rem) {
  .ss-nav { flex: 1 1 100%; order: 3; flex-wrap: nowrap; gap: .75rem; }
  .nav-tools { flex-wrap: nowrap; overflow-x: auto; gap: 1.1rem; scrollbar-width: thin; padding-bottom: .1rem; }
  .nav-tools a { white-space: nowrap; flex: none; padding-block: .7rem; }
  .ss-nav a.nav-buy { flex: none; }
  .ss-product { font-size: 1.5rem; }
}

/* ---- the header menu (2026-12-04; assets/nav.js opens and closes it, tools/generate.mjs mainNav builds it from SITE_PAGES) ----
   The name and the studio badge on the first row, the nav (the Workbook pill and the menu) on the second, at every width. Only the public pages and the 404 page carry the menu
   (.ss-header__in--menu); the private download page keeps the plain nav and the header it always had.
   Without JavaScript the two kinds of button are hidden and the links run along the bar as plain links, each group's name before its pages.
   With it (html.nav-js, set in the head so nothing jumps): under 48rem one Menu button opens the whole list under the bar, from 48rem each group is a button that opens
   its own links. Every control is at least 44px tall. Palette variables only: no new color. */
.ss-header__in--menu { gap: .15rem 1rem; padding-block: .6rem; }
.ss-header__in--menu .ss-by { order: 2; }
.ss-header__in--menu .ss-nav { order: 3; flex: 1 1 100%; flex-wrap: wrap; gap: 0 .6rem; font-size: .95rem; }
.ss-header__in--menu .ss-nav a.nav-buy { display: inline-flex; align-items: center; min-height: 44px; padding-block: 0; line-height: 1.2; }
.nav-menu, .nav-group__list { list-style: none; margin: 0; padding: 0; }
.nav-menu { flex: 1 1 auto; display: flex; flex-wrap: wrap; align-items: center; gap: 0 .65rem; min-width: 0; }
.nav-group { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 0 .5rem; }
.nav-group__list { display: flex; flex-wrap: wrap; gap: 0 .65rem; }
.nav-group__label { color: var(--ss-muted); font-size: .85rem; font-weight: 600; }
.nav-menu a { display: inline-flex; align-items: center; min-height: 44px; padding-block: 0; border-bottom: 0; text-decoration: underline 2px transparent; text-underline-offset: .3em; }
.nav-menu a:hover, .nav-menu a[aria-current="page"] { text-decoration-color: var(--ss-accent); }
.nav-toggle, .nav-group__btn { display: none; align-items: center; justify-content: center; gap: .5rem; min-height: 44px; min-width: 44px; margin: 0; padding: 0 .75rem; border: 1px solid transparent; border-radius: var(--ss-radius); background: transparent; color: var(--ss-ink); font: inherit; font-size: inherit; cursor: pointer; }
.nav-toggle { border-color: var(--ss-muted); }
.nav-toggle:hover, .nav-group__btn:hover { border-color: var(--ss-accent); }
.nav-toggle__i { flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.nav-i-x, .nav-toggle[aria-expanded="true"] .nav-i-bars { display: none; }
.nav-toggle[aria-expanded="true"] .nav-i-x { display: inline; }
/* a small chevron after a group's name; it turns over while the list is open */
.nav-group__btn::after { content: ""; flex: none; width: .45em; height: .45em; margin: -.2em 0 0 .1rem; border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.nav-group__btn[aria-expanded="true"]::after { margin-top: .2em; transform: rotate(225deg); }
.nav-group--current > .nav-group__btn { text-decoration: underline 2px var(--ss-accent); text-underline-offset: .3em; }
.nav-js .nav-toggle, .nav-js .nav-group__btn { display: inline-flex; }
/* phones and small tablets: one Menu button, one list */
@media (max-width: 47.99rem) {
  .nav-js .nav-group__btn { display: none; }
  .nav-js .nav-toggle { margin-left: auto; }
  .nav-js .nav-menu { display: none; flex: 1 1 100%; flex-direction: column; align-items: stretch; flex-wrap: nowrap; gap: 0; margin: .15rem 0 .5rem; padding: 0 .85rem; background: var(--ss-bg); border: 1px solid var(--ss-line); border-radius: var(--ss-radius-lg); }
  .nav-js .ss-nav.is-open .nav-menu { display: flex; }
  .nav-js .nav-group { display: block; }
  .nav-js .nav-group--menu { padding-bottom: .25rem; border-bottom: 1px solid var(--ss-line); }
  .nav-js .nav-group__label { display: block; padding: .6rem 0 .1rem; }
  .nav-js .nav-group__list { display: block; }
  .nav-js .nav-menu a { display: flex; width: 100%; box-sizing: border-box; overflow-wrap: normal; }
  .nav-js .nav-menu a:focus-visible { outline-offset: -3px; }
  .nav-js .nav-menu a[aria-current="page"] { box-shadow: inset 4px 0 0 var(--ss-accent); padding-left: .8rem; text-decoration: none; font-weight: 700; }
}
/* the same rules without JavaScript: the list is the page's own links, so a link that is too long for a narrow phone breaks between words, never inside one */
.nav-menu a { overflow-wrap: normal; }
/* from 48rem: no Menu button; each group is a button that opens its own list under it */
@media (min-width: 48rem) {
  .nav-toggle { display: none !important; }
  .nav-js .nav-group__label { display: none; }
  .nav-js .nav-menu { gap: 0 .2rem; }
  .nav-js .nav-group--link a { padding-inline: .75rem; }   /* the same side room as a group button, so the plain links are spaced like the groups between them */
  .nav-js .nav-group__list { display: none; position: absolute; top: 100%; left: 0; z-index: 40; flex-direction: column; flex-wrap: nowrap; gap: 0; min-width: 15rem; max-width: calc(100vw - 2rem); padding: .35rem; background: var(--ss-surface); border: 1px solid var(--ss-line); border-radius: var(--ss-radius-lg); box-shadow: 0 10px 24px var(--ss-bg); }
  .nav-js .nav-group--end > .nav-group__list { left: auto; right: 0; }
  .nav-js .nav-group.is-open > .nav-group__list { display: flex; }
  .nav-js .nav-group__list a { display: flex; padding-inline: .75rem; border-radius: var(--ss-radius); }
  .nav-js .nav-group__list a:hover { background: var(--ss-accent-soft); }
  .nav-js .nav-group__list a:focus-visible { outline-offset: -3px; }
  .nav-js .nav-group__list a[aria-current="page"] { box-shadow: inset 4px 0 0 var(--ss-accent); font-weight: 700; text-decoration: none; }
}
/* a tablet: the pill and the menu have to share one row of about 720px, so the buttons give up some padding (still 44px tall) */
@media (min-width: 48rem) and (max-width: 63.99rem) { .nav-js .nav-group__btn { padding-inline: .45rem; gap: .35rem; } .nav-js .nav-group--link a { padding-inline: .45rem; } }
@media (prefers-reduced-motion: no-preference) { .nav-group__btn::after { transition: transform .15s ease-out; } }

/* ---------- headings and heroes ---------- */
.ss-main { padding-block: 1rem 3rem; overflow-x: clip; }
.ss-hero { padding-block: 1rem .75rem; }
.ss-hero h1 { font-weight: 600; font-size: clamp(2.4rem, 1.6rem + 3.2vw, 4.5rem); line-height: 1.02; letter-spacing: -.005em; max-width: 18ch; margin-bottom: .45em; }
.hero-tool h1 { font-size: clamp(2.2rem, 1.5rem + 2.6vw, 3.6rem); max-width: 24ch; }
.hero-home h1 { max-width: 20ch; }
.ss-section h2, .tool h2 { font-weight: 600; }
.ss-lede { margin-bottom: .5rem; }
.crumb { margin: .75rem 0 0; font-size: .875rem; color: var(--ss-muted); }
.crumb a { color: var(--ss-muted); }
.crumb a:hover { color: var(--ss-ink); }
@media (min-width: 40rem) { .ss-main { padding-block: 1.5rem 4rem; } .ss-hero { padding-block: 1.25rem 1rem; } }

/* ---------- the tool: form left, the slate right ---------- */
.tool { margin-top: .5rem; }
.tool > h2 { font-size: 1.5rem; margin: 0 0 .25rem; }
.tool__eg { margin: 0 0 1rem; font-size: .9rem; color: var(--ss-muted); }
.tool__body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.25rem; }
.tool__form { order: 1; min-width: 0; }
.tool__slate { order: 2; min-width: 0; }
.tool__words { order: 3; min-width: 0; }
.tool__table { order: 4; min-width: 0; }
.tool__h { font-size: 1.25rem; margin: 0 0 .5rem; }
.tool__note { margin: .25rem 0 0; font-size: .875rem; color: var(--ss-muted); }
@media (min-width: 56rem) {
  .tool__body { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); grid-template-areas: "form slate" "words slate" "table slate"; column-gap: 3rem; row-gap: 1.5rem; align-items: start; }
  .tool__form { grid-area: form; order: 0; }
  .tool__slate { grid-area: slate; order: 0; align-self: stretch; }
  .tool__words { grid-area: words; order: 0; }
  .tool__table { grid-area: table; order: 0; }
  .tool__slate .slate { position: sticky; top: 1rem; }
}

/* home: the short slate head is for phones only */
.home-top { display: flex; flex-direction: column; }
@media (min-width: 56rem) {
  .slate-head { display: none; }
}

/* ---------- the form ---------- */
.pfs { border: 0; padding: 0; margin: 0 0 1.25rem; min-width: 0; }
.pfs legend { padding: 0; margin: 0 0 .5rem; font-weight: 600; font-size: 1.05rem; }
.pfs__grid { display: grid; gap: .75rem 1rem; grid-template-columns: minmax(0, 1fr); }
.pfs__grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pfs__grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.pfs__grid--1 .pf { max-width: 26rem; }
.pfs__grid--3 { align-items: start; }
.pfs__grid--3 .pf > label { min-height: 2.6em; display: flex; align-items: flex-end; }
@media (max-width: 40rem) { .pfs__grid--2 .pf > label { min-height: 2.6em; display: flex; align-items: flex-end; } .pfs__grid--2 { align-items: start; } }
.pf { min-width: 0; }
.pf > label, .pf__lbl { display: block; font-size: .95rem; font-weight: 500; line-height: 1.3; margin-bottom: .35rem; }
.pf__in { display: flex; align-items: center; gap: .35rem; box-sizing: border-box; width: 100%; max-width: 15rem; min-height: 48px; padding-inline: .7rem; background: var(--ss-surface);
  border: 1px solid var(--ss-line); border-radius: var(--ss-radius); font-variant-numeric: tabular-nums; }
.pf__in:hover { border-color: var(--ss-muted); }
.pf__in:focus-within { border-color: var(--ss-accent); outline: 3px solid var(--ss-focus); outline-offset: 2px; }
.pf__in input { flex: 1 1 auto; min-width: 3rem; width: 100%; min-height: 44px; border: 0; background: transparent; padding: 0; border-radius: 0; font-variant-numeric: tabular-nums; text-align: right; }
.pf__in input:focus, .pf__in input:focus-visible { outline: none; }
.pf__u { flex: none; color: var(--ss-muted); font-size: .9rem; white-space: nowrap; }
.pf__u--r { font-size: .8rem; }
.pf__hint { display: block; margin-top: .3rem; font-size: .8rem; line-height: 1.35; color: var(--ss-muted); }
.pf__err { display: block; margin-top: .35rem; padding: .3rem .55rem; font-size: .85rem; line-height: 1.35; color: var(--sm-err-ink); background: var(--sm-err-bg); border-radius: var(--ss-radius); }
.pf.has-err .pf__in { border-color: var(--sm-err-ink); border-width: 2px; }
.pf.is-blank .pf__in { border-style: dashed; }
.pf--horses { margin-bottom: .5rem; max-width: 12rem; }
/* a box that is accepted but changes nothing for now (the share, while one side has no horses): dimmer box, the hint says why */
.pf.is-unused .pf__in { opacity: .6; border-style: dashed; }

/* three-way choice: radio inputs under a styled label */
.seg { display: flex; gap: 0; }
.seg__o { position: relative; flex: 1 1 0; min-width: 0; }
.seg__o input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; min-height: 0; }
.seg__o span { display: flex; align-items: center; justify-content: center; min-height: 48px; box-sizing: border-box; border: 1px solid var(--ss-line); background: var(--ss-surface);
  font-weight: 600; font-variant-numeric: tabular-nums; }
.seg__o:first-child span { border-radius: var(--ss-radius) 0 0 var(--ss-radius); }
.seg__o:last-child span { border-radius: 0 var(--ss-radius) var(--ss-radius) 0; }
.seg__o + .seg__o span { border-left-width: 0; }
.seg__o input:checked + span { background: var(--ss-accent); color: var(--ss-accent-ink); border-color: var(--ss-accent); }
.seg__o input:focus-visible + span { outline: 3px solid var(--ss-focus); outline-offset: 2px; position: relative; z-index: 1; }
.seg__o:hover input:not(:checked) + span { border-color: var(--ss-muted); }

/* the feed-room clipboard (hay page) */
.clipboard { position: relative; margin-top: .6rem; padding: 1.5rem 1.25rem 1rem; background: var(--ss-surface); border: 1px solid var(--ss-line); border-radius: var(--ss-radius-lg); }
.clip { position: absolute; top: -7px; left: 50%; width: 44px; height: 16px; margin-left: -22px; background: var(--sm-hay); border-radius: 5px; box-shadow: inset 0 0 0 2px var(--sm-plate-ink); }
.clipboard__h { font-size: 1.3rem; margin: 0 0 .75rem; }
.inv { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1.25fr) minmax(5.5rem, auto); gap: .5rem .6rem; align-items: end; padding: .75rem 0; border-top: 1px dotted var(--ss-muted); }
.inv .pf__in { max-width: none; }
.inv__at { display: flex; align-items: center; min-height: 48px; color: var(--ss-muted); }
.inv__total { display: flex; align-items: center; justify-content: flex-end; min-height: 48px; font-weight: 700; font-variant-numeric: tabular-nums; }
.inv--other { grid-template-columns: minmax(0, 1fr) minmax(5.5rem, auto); }
@media (max-width: 36rem) {
  .clipboard { padding-inline: .9rem; }
  .inv .pf__in { padding-inline: .5rem; gap: .25rem; }
  .inv { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .inv__at { display: none; }
  .inv__total { grid-column: 1 / -1; min-height: 0; }
  .inv--other { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- the slate: oak frame, chalk figure, column sum, stall row ---------- */
.slate, .slate-head { background: var(--ss-surface); border: 6px solid var(--sm-oak); border-radius: var(--ss-radius); padding: 1rem 1.15rem 1.15rem; box-sizing: border-box; }
.slate-head { margin: .35rem 0 1rem; padding-bottom: .9rem; }
.slate-head > :last-child, .slate > :last-child { margin-bottom: 0; }
.slate__label { margin: 0 0 .3rem; color: var(--ss-muted); font-size: .95rem; line-height: 1.35; }
.slate__round { margin: 0 0 .6rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.slate__rule { border: 0; border-top: 1px solid var(--ss-line); margin: .75rem 0 .6rem; }
.slate__empty { margin: .25rem 0 0; font-size: 1.15rem; color: var(--ss-muted); }
.slate__warn { margin: .6rem 0 0; color: var(--sm-hay); font-size: .95rem; }
.slate__warn--lead { margin: 0 0 .6rem; }
.slate__plain { margin: 0 0 .6rem; font-size: 1.15rem; line-height: 1.35; }
.slate__fig { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .25rem 1rem; }
.slate__count { font-size: 1.05rem; padding-bottom: .5rem; max-width: 12rem; line-height: 1.3; }
.slate__count strong { display: block; font-weight: 700; font-size: 1.1rem; }
.slate__take { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: .1rem .75rem; margin: .9rem 0 0; font-weight: 600; line-height: 1.35; }
.slate__take strong { font-variant-numeric: tabular-nums; font-size: 1.2rem; font-weight: 700; margin-left: auto; }
.slate__gap { margin: .15rem 0 0; color: var(--ss-muted); font-size: .95rem; font-variant-numeric: tabular-nums; }
.slate__note { margin: .6rem 0 0; color: var(--ss-muted); font-size: .95rem; }
.slate__diff { margin: 1rem 0 .1rem; padding-top: .75rem; border-top: 1px solid var(--ss-line); font-size: 1.1rem; }
.slate__diff strong { font-family: var(--ss-display); font-weight: 700; font-size: 2.2rem; line-height: 1; font-variant-numeric: tabular-nums; }
.slate__day { display: flex; align-items: center; gap: .6rem; margin: .9rem 0 0; font-weight: 600; }
.slate__year { margin: .4rem 0 0; color: var(--ss-muted); font-variant-numeric: tabular-nums; }
.slate__link { margin: 1rem 0 0; }

/* the chalk figure: Barlow Condensed 700, a small top-aligned $, underlined cents */
.chalk { display: inline-flex; align-items: flex-start; font-family: var(--ss-display); font-weight: 700; font-size: clamp(3.6rem, 2.3rem + 5.2vw, 7rem); line-height: .9; color: var(--ss-ink);
  font-variant-numeric: tabular-nums; letter-spacing: 0; white-space: nowrap; }
.chalk__d { font-size: .5em; line-height: 1; margin-right: .05em; }
.chalk__c { font-size: .42em; line-height: 1; margin-left: .06em; text-decoration: underline; text-decoration-thickness: .06em; text-underline-offset: .1em; }
.chalk__p { font-size: .5em; line-height: 1; margin-left: .04em; }
.chalk--small { font-size: 2.8rem; }
.chalk--dash { color: var(--ss-muted); }
.chalk--plate { font-size: 2.6rem; color: var(--sm-plate-ink); }
.chalk-rule { display: block; width: min(100%, 15rem); height: auto; aspect-ratio: 240 / 14; margin: .35rem 0 .75rem; }
.chalk-rule path { fill: none; stroke: var(--sm-hay); stroke-linecap: round; }
.chalk-rule__a { stroke-width: 3; }
.chalk-rule__b { stroke-width: 2; }

/* the column sum: label left, amount right, a tick under each whose width is the part's share */
.sum { list-style: none; margin: 0; padding: 0; }
.sum__row { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: .75rem; align-items: baseline; padding: .3rem 0 .4rem; }
.sum__k { font-weight: 500; line-height: 1.3; }
.sum__v { font-weight: 500; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.sum__tick { grid-column: 1 / -1; display: block; height: 6px; margin-top: .25rem; width: var(--w, 0%); min-width: 2px; max-width: 100%; background: var(--ss-muted); border-radius: 1px; }
.sum__row--pay .sum__tick { background: var(--sm-hay); }
.sum__total { display: flex; justify-content: space-between; align-items: baseline; gap: .75rem; margin: .45rem 0 0; padding-top: .5rem; border-top: 2px solid var(--ss-ink); font-weight: 700; }
.sum__total .sum__v { font-weight: 700; font-size: 1.15rem; }
@media (min-width: 40rem) {
  .sum__k { display: flex; align-items: baseline; }
  .sum__k::after { content: ""; flex: 1 1 0; min-width: 1rem; margin: 0 .5rem; border-bottom: 1px dotted var(--ss-muted); transform: translateY(-.25em); }
}

/* the stall row: one door per stall, ten to a row */
.stalls { margin-top: 1rem; }
.stalls__rows { display: grid; gap: 6px; }
.stalls__row { display: flex; align-items: flex-end; gap: 4px; }
.stalls__n { margin: .5rem 0 0; font-size: .95rem; color: var(--ss-muted); font-variant-numeric: tabular-nums; }
.door { flex: none; width: 18px; height: 26px; overflow: visible; }
.door path, .door rect { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.door__frame, .door__bars, .door__rail { stroke: var(--ss-muted); stroke-width: 1.7; }
.door--on .door__frame, .door--on .door__bars, .door--on .door__rail, .door--part .door__frame, .door--part .door__bars, .door--part .door__rail { stroke: var(--ss-ink); stroke-width: 1.5; }
.door .door__panel { fill: var(--ss-accent); stroke: none; }
.door .door__x { stroke: var(--ss-bg); stroke-width: 1.4; }
.slate--breakEven .door { width: 26px; height: 37px; }
.mk { display: block; flex: none; align-self: stretch; }
.mk--cover { width: 3px; margin-inline: 1px; background: var(--sm-hay); border-radius: 1px; }
.mk--goal { width: 0; margin-inline: 1px; border-left: 3px dashed var(--sm-hay); }
.stallbar { position: relative; height: 14px; border: 2px solid var(--ss-muted); border-radius: 3px; }
.stallbar b { display: block; height: 100%; background: var(--ss-accent); }
.stallbar .mk { position: absolute; top: -6px; bottom: -6px; margin: 0; }
.legend { list-style: none; margin: .9rem 0 0; padding: 0; display: grid; gap: .3rem; font-size: .9rem; line-height: 1.35; color: var(--ss-muted); }
.legend li { display: flex; align-items: center; gap: .55rem; }
.legend .mk { height: 1.1em; align-self: center; flex: none; margin: 0 7px 0 0; }
.legend__on { display: block; flex: none; width: 10px; height: 14px; margin: 0; background: var(--ss-accent); border-radius: 1px; }
@media (max-width: 40rem) { .slate--breakEven .door { width: 24px; height: 34px; } }

/* the phone head of the stall and pasture page: two small plates side by side */
.plates--mini { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; margin-top: .25rem; }
.nameplate--mini { padding: .7rem .4rem .6rem; }
.nameplate--mini .nameplate__k { font-size: .9rem; margin-bottom: .1rem; }
.slate-head .chalk--plate { font-size: 2.4rem; }

/* brass nameplates: the stall and pasture boards, the aisle */
.plates { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; margin-top: .5rem; }
.nameplate { position: relative; margin: 0; padding: 1rem .5rem .8rem; text-align: center; color: var(--sm-plate-ink); background: var(--sm-hay); border-radius: 10px; min-width: 0; }
.nameplate::before { content: ""; position: absolute; inset: 5px; border: 2px solid var(--sm-plate-ink); border-radius: 6px; pointer-events: none; opacity: .55; }
.nameplate .mark { display: block; width: 52px; height: 52px; margin: 0 auto .15rem; }
.nameplate__k { font-weight: 700; font-size: 1rem; margin-bottom: .25rem; }
.nameplate__u { display: block; font-weight: 600; font-size: .85rem; }
/* a side with no horses: smaller type in two short lines, with the plate's own padding either side */
.nameplate__u--none { max-width: 7.5rem; margin: .1rem auto 0; padding-inline: .25rem; font-size: .75rem; line-height: 1.25; text-wrap: balance; }
.mark { color: var(--ss-ink); }
.mark path { fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.mark .m-rail { fill: currentColor; stroke: none; }
.mark .m-panel { fill: var(--ss-accent); stroke: none; }
.mark .m-x { stroke: var(--ss-bg); stroke-width: 3; }
.mark--empty .m-panel { fill: none; stroke: currentColor; stroke-width: 3; }
.nameplate .mark { color: var(--sm-plate-ink); }
.nameplate .m-panel { fill: color-mix(in srgb, var(--sm-plate-ink) 22%, transparent); }
.nameplate .m-x { stroke: var(--sm-plate-ink); }
@media (max-width: 36rem) {
  .plates:not(.plates--mini) { grid-template-columns: minmax(0, 1fr); }
  .chalk--plate { font-size: 3.4rem; }
  .slate-head .chalk--plate { font-size: 2.4rem; }
}
@media (min-width: 36.01rem) and (max-width: 55.99rem) { .chalk--plate { font-size: 3.6rem; } }

/* the aisle: a rail with brass nameplates hanging on it, each showing its own example number */
.aisle-wrap h2 { margin-bottom: .4rem; }
.aisle { margin-top: 1.25rem; }
.aisle__rail { list-style: none; margin: 0; padding: 0; position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.aisle__rail::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: var(--ss-muted); border-radius: 2px; }
.plate { position: relative; padding-top: 16px; min-width: 0; }
.plate::before, .plate::after { content: ""; position: absolute; top: 2px; width: 3px; height: 20px; background: var(--ss-muted); border-radius: 1px; }
.plate::before { left: 22px; }
.plate::after { right: 22px; }
.plate__a { position: relative; display: flex; flex-direction: column; gap: .3rem; box-sizing: border-box; height: 100%; padding: 1.1rem 1rem .9rem; color: var(--sm-plate-ink); background: var(--sm-hay);
  border-radius: 10px; text-decoration: none; }
.plate__a::before { content: ""; position: absolute; inset: 6px; border: 2px solid var(--sm-plate-ink); border-radius: 6px; opacity: .55; pointer-events: none; }
.plate__q { font-weight: 600; font-size: 1rem; line-height: 1.3; }
.plate__n { font-family: var(--ss-display); font-weight: 700; font-size: 2.4rem; line-height: 1; font-variant-numeric: tabular-nums; margin-top: auto; padding-top: .3rem; }
.plate__u { font-size: .85rem; line-height: 1.3; }
.plate__go { margin-top: .2rem; font-size: .9rem; font-weight: 700; text-decoration: underline; text-underline-offset: .2em; }
.plate--here .plate__go { align-self: flex-start; justify-self: start; text-decoration: none; background: var(--sm-plate-ink); color: var(--sm-hay); padding: .1rem .6rem; border-radius: 999px; font-size: .85rem; }
a.plate__a:focus-visible { outline: 3px solid var(--ss-focus); outline-offset: 3px; }
@media (prefers-reduced-motion: no-preference) {
  a.plate__a { transition: transform .12s ease-out; }
  a.plate__a:hover, a.plate__a:focus-visible { transform: translateY(2px); }
}
@media (max-width: 55.99rem) { .aisle__rail { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 0; } .plate { padding-bottom: .5rem; } }
@media (max-width: 36rem) {
  .aisle__rail { grid-template-columns: minmax(0, 1fr); }
  .plate__a { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "q n" "u n" "go go"; column-gap: 1rem; align-items: center; }
  .plate__q { grid-area: q; }
  .plate__n { grid-area: n; margin: 0; padding: 0; text-align: right; }
  .plate__u { grid-area: u; }
  .plate__go { grid-area: go; }
}

/* ---------- the words, the table ---------- */
.words { line-height: 1.55; }
.words .sm-line { margin: 0 0 .5rem; }
.words .sm-lines { margin: 0 0 .5rem; padding-left: 1.15rem; }
.words .sm-lines .sm-line { margin-bottom: .45rem; }
.words .sm-big { font-family: var(--ss-display); font-size: 1.5rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.words .sm-k { color: var(--ss-muted); }
.words .sm-answer { margin-bottom: .75rem; }
.tool__words .sm-sub, .tool__words .sm-parts, .tool--sides .tool__words .sm-note, .tool--sides .tool__words .sm-warnings { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.words .sm-note { color: var(--ss-muted); font-size: .9rem; }
.words .sm-warnings { list-style: none; padding: 0; margin: .5rem 0; color: var(--sm-hay); }
.tool__table .sm-share-note { margin: 0; color: var(--ss-muted); font-size: .95rem; }
.words .sm-empty { color: var(--ss-muted); }
.sm-neg { color: var(--ss-muted); }
.sm-table { width: 100%; background: var(--ss-surface); border: 1px solid var(--ss-line); border-radius: var(--ss-radius); border-collapse: separate; border-spacing: 0; font-variant-numeric: tabular-nums; font-size: .95rem; }
.sm-table caption { caption-side: top; text-align: left; font-weight: 600; margin-bottom: .5rem; }
.sm-table th, .sm-table td { padding: .4rem .75rem; border-bottom: 1px solid var(--ss-line); text-align: right; font-weight: 500; }
/* the kit sets overflow-wrap: anywhere on the page, which lets a header column shrink to one letter; break-word keeps whole words together */
.sm-table th { overflow-wrap: break-word; }
.sm-table thead th { font-size: .85rem; color: var(--ss-muted); font-weight: 600; vertical-align: bottom; line-height: 1.25; }
.sm-table th:first-child, .sm-table td:first-child { text-align: left; white-space: nowrap; }
.sm-table td { white-space: nowrap; }
.sm-table tbody tr:last-child th, .sm-table tbody tr:last-child td { border-bottom: 0; }
.sm-table tbody th { font-weight: 600; }
@media (max-width: 24rem) { .sm-table { font-size: .9rem; } .sm-table th, .sm-table td { padding-inline: .45rem; } }

/* ---------- pages below the tool ---------- */
.ss-section { padding-block: 1.5rem; }
.ss-section > h2 { margin-bottom: .6rem; }
.how { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; max-width: 56rem; margin: 1rem 0 0; }
.how dt { margin-top: 1rem; font-weight: 700; }
.how dd { margin: .2rem 0 0; color: var(--ss-muted); max-width: var(--ss-read); font-variant-numeric: tabular-nums; }
@media (min-width: 48rem) {
  .how { grid-template-columns: 15rem minmax(0, 1fr); column-gap: 2rem; }
  .how dt { padding-top: .6rem; border-top: 1px solid var(--ss-line); margin: 0; }
  .how dd { padding: .6rem 0 .8rem; border-top: 1px solid var(--ss-line); margin: 0; }
}
.trio { display: grid; gap: 0 2.5rem; grid-template-columns: minmax(0, 1fr); }
.trio .ss-read { max-width: none; }
.trio h2 { font-size: 1.5rem; }
@media (min-width: 56rem) { .trio { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.gather .ss-lede { margin-bottom: .75rem; }
.sheet-icon { flex: none; width: 20px; height: 24px; }
.sheet-icon path { fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }
.dl-actions { margin: 1rem 0 .75rem; }

/* the workbook: the buy box, the two bands */
.sm-buy { border-radius: var(--ss-radius-lg); }
.sm-buy h3 { margin: 0 0 .25rem; font-size: 1.5rem; }
.sm-buy .ss-badge { margin-bottom: .6rem; }
.sm-buy__row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem 1.25rem; }
.sm-buy__row .ss-buy__price { margin-bottom: .15rem; }
.sm-buy__row .ss-actions { margin: 0; }
.sm-buy__what { margin: 0; color: var(--ss-muted); }
.sm-buy__inside { margin-top: .5rem; }
.sm-buy .ss-actions { margin: 1rem 0 0; }
.sm-buy--compact { padding: 1rem 1.15rem .85rem; }
.offer { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.5rem; border-top: 4px solid var(--ss-accent); margin-top: 2rem; padding-top: 1.5rem; }
.offer__text { min-width: 0; }
.offer__text h2 { margin-bottom: .5rem; }
.offer__pics { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; min-width: 0; margin: 0; align-items: start; }
.offer__pics figure { margin: 0; min-width: 0; }
.offer__pics a { display: block; }
.offer__pics img, .tabs img { display: block; width: 100%; height: auto; background: var(--ss-surface); border: 1px solid var(--ss-line); border-radius: 4px; }
/* both pictures sit in the same frame, so their tops and their captions line up whatever each one's own shape */
.offer__pics img { aspect-ratio: 16 / 10; object-fit: contain; }
.offer__pics figcaption, .tabs figcaption { margin-top: .3rem; font-size: .8rem; color: var(--ss-muted); }
@media (min-width: 36rem) { .offer__pics { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 56rem) {
  /* the text and the buy box get about 400 px; the two pictures stack beside them, so the column is about as tall as the text and box */
  .offer { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 2.5rem; align-items: start; }
  .offer__pics { grid-template-columns: minmax(0, 1fr); max-width: 32rem; }
}
.wb-band { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem 2rem; padding: 1.25rem; background: var(--ss-surface); border: 1px solid var(--ss-line); border-left: 4px solid var(--ss-accent); border-radius: var(--ss-radius-lg); }
.wb-band__text { flex: 1 1 24rem; min-width: 0; }
.wb-band p { margin: 0 0 .5rem; }
.wb-band__lead { font-weight: 500; }
.wb-band__price strong { font-family: var(--ss-display); font-size: 1.5rem; font-weight: 700; }
.wb-band__price span { color: var(--ss-muted); margin-left: .35rem; }
.wb-band__fine { font-size: .85rem; color: var(--ss-muted); margin-bottom: 0; }
.wb-band .ss-actions { margin: 0; }
.wb-bandwrap { padding-block: 1rem; }

.hero-wb { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-areas: "text" "buy" "pic" "doubts"; gap: 1.5rem; padding-block: 1rem .5rem; align-items: start; }
.hero-wb__text { grid-area: text; }
.hero-wb > .sm-buy { grid-area: buy; min-width: 0; }
.hero-wb > .doubts { grid-area: doubts; }
.hero-wb__pic { grid-area: pic; margin: 0; min-width: 0; }
@media (min-width: 56rem) {
  .hero-wb { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); grid-template-areas: "text text" "buy pic" "buy doubts"; gap: 1.5rem 2.5rem; }
}
.doubts dt { font-weight: 700; margin-top: .75rem; }
.doubts dd { margin: .15rem 0 0; color: var(--ss-muted); }
.hero-wb__pic figcaption { margin-top: .4rem; font-size: .85rem; color: var(--ss-muted); }
/* the clipboard: a slate board in an oak frame, a brass clip, and the real rate sheet clipped to it */
.cbpic { position: relative; padding: 1.9rem 1.1rem 1.1rem; background: var(--ss-surface); border: 6px solid var(--sm-oak); border-radius: var(--ss-radius); }
.cbpic .clip { top: -12px; width: 72px; height: 22px; margin-left: -36px; border-radius: 7px; }
/* the printed sheet is the picture on white paper, with a margin of paper under its last line (the picture is trimmed at that line) */
.cbpic__sheet { background: var(--sm-paper); padding-bottom: 1.1rem; border-radius: 2px; }
.cbpic img { display: block; width: 100%; height: auto; border-radius: 2px 2px 0 0; }
.tabs { list-style: none; margin: 1rem 0 0; padding: 0; display: grid; gap: 0; }
.tabs li { display: flex; flex-direction: column; gap: .75rem; padding: 1rem 0; border-top: 1px solid var(--ss-line); }
.tabs figure { margin: 0; flex: none; }
.tabs__t { flex: 1 1 0; min-width: 0; }
.tabs__t strong { display: block; font-family: var(--ss-display); font-size: 1.4rem; font-weight: 700; line-height: 1.15; margin-bottom: .2rem; }
.tabs__t span { color: var(--ss-muted); }
@media (min-width: 40rem) { .tabs li { flex-direction: row; gap: 1.5rem; } .tabs figure { flex-basis: 15rem; } }
.forgrid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; }
@media (min-width: 40rem) { .forgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.slatecard { background: var(--ss-surface); border: 1px solid var(--ss-line); border-radius: var(--ss-radius-lg); padding: 1.25rem 1.5rem; }
.slatecard h2 { font-size: 1.5rem; }
.slatecard ul { margin: 0; padding-left: 1.2rem; }
.slatecard li { margin-bottom: .4rem; }
.shots { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); }

/* 404 */
.nf { display: flex; flex-wrap: wrap; align-items: center; gap: 1.25rem 2rem; padding-block: 1.5rem; }
.nf__pic { flex: none; width: 160px; }
.nf-front { display: block; width: 160px; height: auto; }
.nf-dusk { fill: var(--sm-dusk); opacity: .3; }
.nf-bars { fill: none; stroke: var(--ss-ink); stroke-width: 3; stroke-linecap: round; }
.nf-rail { fill: var(--ss-ink); }
.nf-panel { fill: none; stroke: var(--ss-muted); stroke-width: 2.5; }
.nf-post, .nf-lintel { fill: var(--sm-oak); stroke: var(--ss-muted); stroke-width: 1.5; }
.nf-plate { fill: var(--sm-hay); }
.nf-floor { fill: none; stroke: var(--ss-muted); stroke-width: 2; stroke-linecap: round; }
.nf__text { flex: 1 1 18rem; }

/* ---------- motion: only the answer to what was typed, and never when reduced motion is asked for ---------- */
@keyframes sm-fade { from { opacity: .35; } to { opacity: 1; } }
@media (prefers-reduced-motion: no-preference) {
  .sm-changed { animation: sm-fade .18s ease-out; }
  .door .sm-changed, .door.sm-changed { animation: sm-fade .18s ease-out backwards; animation-delay: calc(min(var(--i, 0), 15) * 20ms); }
  .sum__tick { transition: width .2s ease-out; }
}
@media (prefers-reduced-motion: reduce) { .sm-changed, .door .sm-changed { animation: none; } }

/* ---------- printing: light, the picture parts and the buying parts left off ---------- */
@media print {
  .no-print, .ss-nav, .slate-head, .wb-band, .offer, .aisle-wrap { display: none !important; }
  .slate, .clipboard, .nameplate, .slatecard { background: #fff; color: #000; border-color: #000; }
  .chalk, .words, .sum__v, .sum__k { color: #000; }
  .sum__tick { background: #000; }
  .nameplate { background: #fff; }
  .nameplate::before { border-color: #000; }
  .chalk-rule path { stroke: #000; }
  .pf__in { background: #fff; border-color: #000; }
  .pf__in input { color: #000; }
}

/* no product pictures yet: the offer text takes the row */
.offer:not(:has(.offer__pics)) { grid-template-columns: minmax(0, 1fr); }
.offer:not(:has(.offer__pics)) .offer__text { max-width: 38rem; }

/* ---------- the hay split (2026-12-04): one row for each boarder, then the table of what each pays ---------- */
.pfs__note { margin: 0 0 .6rem; font-size: .875rem; color: var(--ss-muted); max-width: 44rem; }
.split-head, .split-row { display: grid; grid-template-columns: 1.4rem minmax(0, 1fr) minmax(0, 1.15fr) minmax(0, 1.3fr); gap: .35rem .5rem; align-items: start; }
.split-head span { text-align: right; padding-right: .5rem; }
.split-head { padding-bottom: .3rem; font-size: .8rem; line-height: 1.25; font-weight: 600; color: var(--ss-muted); align-items: end; }
.split-row { padding: .3rem 0; border-top: 1px dotted var(--ss-line); max-width: 36rem; }
.split-head { max-width: 36rem; }
.split-n { display: flex; align-items: center; min-height: 48px; color: var(--ss-muted); font-variant-numeric: tabular-nums; }
.split-row .pf__in { max-width: none; padding-inline: .5rem; }
.split-row .pf__in input { min-width: 0; }
.split-row .pf__err { font-size: .75rem; padding: .25rem .35rem; overflow-wrap: anywhere; }
.tool__table--split { overflow-x: auto; }
.tool__table--split:focus-visible { outline: 3px solid var(--ss-focus); outline-offset: 2px; }
.sm-table--split { min-width: 100%; }
@media (max-width: 30rem) { .sm-table--split { font-size: .85rem; } .sm-table--split th, .sm-table--split td { padding-inline: .3rem; } .sm-table--split thead th { font-size: .78rem; } }
.sm-table .sm-na { color: var(--ss-muted); }
.sm-table tfoot th, .sm-table tfoot td { border-top: 2px solid var(--ss-line); border-bottom: 0; font-weight: 700; }
.slate--haySplit .sum__v { white-space: nowrap; }
/* the home page's two more free pages, under the four plates */
.aisle-more { margin-top: 1rem; }
.aisle-more p { margin: 0 0 .25rem; }
.aisle-more ul { margin: 0; padding-left: 1.2rem; }
