/*
 * Zoey Made — commerce.
 *
 * The store's accessibility corrections, and nothing else. WooCommerce owns commerce and
 * most of the store already inherits the design system through theme.json with no CSS at
 * all — that is the intended outcome and this file does not disturb it. What is here are
 * the places where WooCommerce's own presentation lands under the FOUND-011 baseline, each
 * one measured rather than assumed.
 *
 * Loaded only on commerce routes; see zoey_made_enqueue_commerce_style() in functions.php.
 * Every rule names the WooCommerce class it corrects and says what the measurement was, so
 * a rule that upstream later fixes can be recognised and deleted.
 *
 * One rule left this file in PRODUCT-006 and the deletion is worth recording, because the
 * rule was accepted rather than wrong. It raised the opacity of WooCommerce's *inactive
 * product tabs* from 0.65 to 0.8, correcting a measured 4.27:1 to 6.7:1. PRODUCT-003 took
 * over the product template and stopped rendering `woocommerce/product-details` — the tabs,
 * their three `href="#tab-…"` anchors and a review form for reviews this store does not use
 * — which left the correction fixing nothing on any shipped route, and it was kept only
 * until the story that owns the product's information architecture decided. PRODUCT-006 §72
 * is that decision and it does not bring the tabs back: the understanding band is a
 * description, a specification list, care and safety, and nothing in it is a tab. Verified
 * inert before removal — no theme file references the block, the database holds zero
 * `wp_template`, `wp_template_part` or `wp_block` posts, and none of `/`, `/shop/`, `/cart/`,
 * `/checkout/`, `/my-account/` or a product page emits `wc-tabs` markup at all. Restoring
 * the block would need this rule back with it; deleting it is what §72 asks, because a
 * correction to markup nothing renders is dead code that reads like a live guarantee.
 */

/*
 * The sort control — measured 19px tall, needs 24px.
 *
 * A native select left at the browser's default height. WCAG 2.2 asks 24px of any control
 * that is not inline text; this site asks for a comfortable 44px wherever a child might be
 * aiming at it. A minimum height and body-sized text give it that without replacing the
 * control, which stays the browser's own and keeps every keyboard and screen-reader
 * behaviour it has by default.
 *
 * The two width rules are not decoration. A select is as wide as its longest option —
 * "Sort by price: high to low" — and it sits in a flex row, where a flex item refuses to
 * shrink below its content by default. Growing the text made it wide enough to push the
 * shop page 9px past a 320px viewport, which is the horizontal scrolling §115 rules out.
 * min-inline-size: 0 lets the item shrink; the cap stops the select outgrowing it.
 */
.wc-block-catalog-sorting,
.woocommerce-ordering {
  min-inline-size: 0;
  max-inline-size: 100%;
}

.woocommerce-ordering select.orderby {
  max-inline-size: 100%;
  min-block-size: 44px;
  /*
   * And the same height a second way, because Safari does not honour the first: on a native
   * menulist WebKit ignores both `min-block-size` and `padding-block` — measured reporting
   * 18px and zero padding against this rule, and rendering the control 27px tall where
   * Chromium and Firefox give it 44. Above WCAG's 24×24 floor, below the 44 this project
   * asks of a control a child taps, on the one engine every iPhone uses. `block-size` is the
   * property WebKit honours, and it changes nothing in the other two. In `rem` so the control
   * grows with the reader's text — 88px at 200%, where a fixed 44 would clip the options.
   */
  block-size: 2.75rem;
  padding-block: var(--wp--preset--spacing--20);
  border-radius: var(--wp--custom--radius--small);
  font-size: var(--wp--preset--font-size--body);
}

/*
 * Show/hide password — measured 22×22 with no clear space around it, needs 24×24.
 *
 * It sits inside a 49px-tall field, so it can simply take the field's height: a bigger
 * target for the same glyph, which is what FOUND-011 §39 describes. The button is
 * WooCommerce's and keeps its own label and state.
 */
.woocommerce form .password-input .show-password-input {
  display: flex;
  align-items: center;
  justify-content: center;
  min-inline-size: 44px;
  min-block-size: 44px;
}

/*
 * Checkout labels — measured 13px, and the baseline puts anything under ~14px in the
 * exceptional category.
 *
 * WooCommerce's checkout blocks set 0.8125rem on the country and state labels, the
 * shipping and payment option names, the billing-address checkbox and the order note. None
 * of those is supporting metadata: they are the labels on the controls that decide what a
 * parent is buying and where it goes, on the one route the baseline says clarity outranks
 * everything else. body-small is the smallest step the type scale offers, and it is 14px.
 */
.wc-block-checkout .wc-blocks-components-select__label,
.wc-block-checkout .wc-block-components-checkbox__label,
.wc-block-checkout .wc-block-components-radio-control__label,
.wc-block-checkout .wc-block-components-radio-control__option,
.wc-block-checkout .wc-block-components-textarea,
.wc-block-checkout .wc-block-components-checkout-step__description {
  font-size: var(--wp--preset--font-size--body-small);
}

/*
 * The order summary — same floor, and for a stronger reason than the labels.
 *
 * WooCommerce sets 13px here and then derives the item metadata from it in em, which lands
 * around 11px. This is the panel that says what is being bought and what it costs, and the
 * baseline puts prices and product information outside what small text may be used for:
 * "supporting" describes where the text sits on the page, not whether someone needs to
 * read it. The metadata is floored on its own because it is em-derived and would otherwise
 * shrink again from the new parent.
 */
.wc-block-checkout .wc-block-components-product-name,
.wc-block-checkout .wc-block-components-product-metadata,
.wc-block-checkout .wc-block-components-product-metadata__description p,
.wc-block-checkout .wc-block-formatted-money-amount,
.wc-block-checkout .wc-block-components-totals-item__label,
.wc-block-checkout .wc-block-components-totals-item__value,
.wc-block-checkout .wc-block-checkout__shipping-option--free,
.wc-block-checkout .wc-block-checkout__guest-checkout-notice,
.wc-block-checkout .wc-block-components-address-form__address_2-toggle {
  font-size: var(--wp--preset--font-size--body-small);
}

/*
 * The cart line item on a phone — measured 17px of horizontal page scroll at 320px.
 *
 * WooCommerce already stacks this row on small screens: at its `is-mobile` width the row
 * stops being a table row and becomes a grid. The grid it asks for is
 * `80px 132px` plus two implicit tracks for the total, with 16px between each — 313px of
 * demand against the 280px a 320px viewport leaves after the site's gutters. The page
 * scrolled sideways and the line total was clipped mid-figure to "$24.".
 *
 * Nothing here compresses that composition further, because it cannot be compressed
 * honestly: the quantity stepper is already at the smallest it may be, and the price is
 * `white-space: nowrap` by WooCommerce's own rule. Instead the row keeps WooCommerce's
 * grid and is given one fewer column — image beside the product details, line total on a
 * second row beneath them. That is the stacking the row was already halfway to, finished.
 *
 * The selectors repeat WooCommerce's own `.wc-block-cart table.wc-block-cart-items
 * .wc-block-cart-items__row` chain and add `html body`, because the rules being replaced
 * carry four classes and an element and would otherwise win on specificity — this file's
 * standing rule, and the reason the cart type floor below is written the same way.
 *
 * 480px rather than the 353px where the overflow starts: the enlarged controls below need
 * the room too, and a phone is the whole range where they matter.
 */
@media (max-width: 480px) {
  html body .wc-block-cart table.wc-block-cart-items .wc-block-cart-items__row {
    grid-template-columns: 64px minmax(0, 1fr);
    column-gap: var(--wp--preset--spacing--30);
  }

  /* Spanning both rows keeps the thumbnail beside the whole line item, not just its top. */
  html body .wc-block-cart table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__image {
    grid-column: 1;
    grid-row: 1 / span 2;
    padding-inline-end: 0;
  }

  /*
   * Both of these name a column end as well as a start. WooCommerce sets
   * `grid-column-end: 4` on the product cell, which would otherwise keep generating the
   * implicit third and fourth tracks this rule exists to remove.
   */
  html body .wc-block-cart table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__product {
    grid-column: 2 / -1;
    grid-row: 1;
  }

  html body .wc-block-cart table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__total {
    grid-column: 2 / -1;
    grid-row: 2;
    justify-content: flex-start;
  }

  /*
   * The controls in that row — measured 30×25 on the stepper buttons and 24×24 on remove.
   *
   * Both clear the 24×24 WCAG 2.2 asks and both are under the ~44×44 this project asks for
   * anything a child might aim at. The stacked row is what makes the space available; on
   * the unstacked grid these sizes did not fit, which is why the two changes arrive
   * together rather than separately.
   */
  html body .wc-block-cart-item__quantity .wc-block-components-quantity-selector__button {
    min-inline-size: 44px;
    min-block-size: 44px;
  }

  html body .wc-block-cart-item__quantity .wc-block-cart-item__remove-link {
    min-inline-size: 44px;
    min-block-size: 44px;
  }

  /* Sized in content-box by WooCommerce, so the border-box is what has to be told. */
  html body .wc-block-cart-item__quantity .wc-block-components-quantity-selector__input {
    box-sizing: border-box;
  }
}

/*
 * The cart's own type floor — measured 13px, the same defect the checkout rules above
 * correct, on the route FOUND-011 did not reach.
 *
 * WooCommerce sets `var(--wp--preset--font-size--small, 14px)` on the product name, the
 * unit price and the quantity field. This theme declares no `small` step, so the variable
 * resolves against WordPress's default preset — 13px — and the 14px fallback written
 * beside it never applies. A product name and a price are the two things a parent is
 * reading here, and the baseline puts both outside what small text may be used for.
 *
 * Not inside the media query: the floor is a contract, not a phone layout.
 */
html body .wc-block-cart table.wc-block-cart-items .wc-block-cart-items__row .wc-block-components-product-name,
html body .wc-block-cart table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__prices,
html body .wc-block-cart .wc-block-components-quantity-selector input.wc-block-components-quantity-selector__input {
  font-size: var(--wp--preset--font-size--body-small);
}

/* --- SL-008 — the Cart wears the Shop visual system -------------------------------------- */

/*
 * Everything below this line is the Cart's **composition**: where the paper panel sits, what is
 * above it, where the two accents go, and what the empty branch looks like. The paper itself is
 * not here. `components/surface.css` declares the tint, the grain, the padding, the radius, the
 * forced-colors hairline and the print reset exactly once, and names the Cart's totals region as
 * one adopter of them — `SL-008`'s `D4`, written up at length in that file's header. The artwork
 * and the mask behind the two accents are `components/doodle.css`'s, and their size, placement and
 * inertness are `components/decoration.css`'s.
 *
 * That split is the whole design decision, so it is worth stating what the alternative was: a
 * `color-mix` and a grain `background-image` copied into this file. Two declarations of one
 * material are two materials, and the second one is the one nobody remembers to change.
 *
 * **Why CSS at all, when every other surface on this site is a PHP call.** The filled Cart is one
 * client-rendered React application. `SL-008`'s `G1` probe measured `.wc-block-cart__sidebar`
 * absent from the server response, 12 of 15 server-rendered scaffold nodes destroyed at hydration,
 * and a wrapper inside the filled branch destroyed again on the filled-to-empty transition. A host
 * block — which is how `SL-007` put a surface around the product's purchase region, and what the
 * Cart preflight proposed here — cannot survive on this route. A selector can.
 *
 * Nothing here styles a total, a price, a quantity, a coupon, a notice or the checkout anchor's
 * behaviour. The anchor's appearance is already this theme's pink on Ink through `theme.json`, and
 * `DESIGN-CONTRACT.md` is explicit that it stays WooCommerce's own navigation anchor; the measured
 * values are in the `SL-008` report rather than re-asserted as a rule here.
 */

/*
 * The ground, white.
 *
 * `DESIGN-CONTRACT.md` asks for a white page and a white item list, and this is **a change rather
 * than an inherited state** — the Cart preflight had it the other way round and `C2` corrects it.
 * Measured before: `body` computed `rgb(255, 249, 252)`, which is `surface-soft`, and both the item
 * region and the totals region are transparent and inherited it. So the item list was already the
 * same colour as the page and the page was not white.
 *
 * One declaration on the route's own body class, which WooCommerce sets. It is scoped to the Cart
 * deliberately: Checkout, Account and the catalogue are `AC-10` regression boundaries and keep the
 * ground they have. The item region needs no rule at all — it is transparent, and transparent over
 * white is white.
 */
body.woocommerce-cart {
  background-color: var(--wp--preset--color--surface);
}

/*
 * The totals panel's three children, lifted above the paper.
 *
 * This is the one piece of plumbing the adoption needs and it is worth saying why. A surface
 * rendered by `zoey_made_surface()` has a `__content` element that carries `position: relative`
 * and `z-index: 1`; WooCommerce's sidebar has no such element, and its children are ordinary
 * static blocks. In the painting order a positioned descendant at `z-index: 0` — which is what the
 * paper and the grain layers are — paints *after* in-flow inline content, so without this rule the
 * grain is drawn over every word in the panel. Measured as unreadable before it existed.
 *
 * `> *` rather than a list of WooCommerce's three class names: the summary, the payment options and
 * the submit container are the panel's children today, and a WooCommerce release that adds a fourth
 * should not have it painted under the paper.
 */
.woocommerce-cart .wc-block-cart__sidebar > * {
  position: relative;
  z-index: 1;
}

/*
 * The panel's own edges inside WooCommerce's two-column layout.
 *
 * WooCommerce's sidebar is a flex item with its own padding, which the adoption replaced with the
 * surface's. What it does not have is any separation from the item list beside it, because until
 * now there was no panel edge to separate — the two columns were both transparent. The gap is a
 * spacing token rather than a number, and it is the only geometry this file gives the panel:
 * `DESIGN-CONTRACT.md` calls the board's column proportions *"visual direction, not a mandated
 * fixed grid"*, so WooCommerce keeps deciding how wide its own columns are.
 */
/*
 * The two columns yield when the reader's text makes columns untenable.
 *
 * WooCommerce decides whether the cart is one column or two from the **width** of its own
 * sidebar-layout, through its `is-large` class. Width is the wrong question on its own: at 768px
 * the layout stays two columns, and with the root font at 32px that leaves the totals panel a
 * usable **151px** — six characters of the reader's text — for a heading, a coupon form, a row of
 * figures and a full-width action. Measured there: a three-line checkout label, 173px tall, with a
 * word hanging outside the button.
 *
 * A **container query in `em`** asks the question that actually matters, because `em` inside a
 * container query resolves against the container's own font size: *is this row wide enough for two
 * columns **at the text size the reader chose***. Below 38em it is not, and the row stacks — the
 * same thing WooCommerce does on a phone, at the width where the reason for it appears.
 *
 * At ordinary text nothing changes anywhere: the row measures 77.5em at 1440, 61em at 1024 and
 * 44em at 768, all above the threshold. At a 32px root it measures 38.75em, 30.75em and 22em, so
 * 1024 and 768 stack and 1440 stays two columns with room to spare. `SL-007`'s lesson again, in the
 * other direction: a container query sees a reader at 200% text, and a media query never does.
 *
 * `container-type: inline-size` on the row is safe here and was checked rather than assumed: the
 * row's width already comes from its parent, and the only absolutely positioned things in the cart
 * are this file's own accents and WooCommerce's sale badge, all of which want a nearer containing
 * block, not a further one. WooCommerce's snackbar notices are a **sibling** of this element, not a
 * descendant, so their positioning is untouched.
 *
 * **The container is the cart block, not the row.** An element cannot be styled by its own
 * container query — the thing being sized has to be a descendant — and the first version of this
 * rule put `container-type` on the row it then tried to turn into a column, so the query never
 * fired. That is the third time this package has met that trap; it is written out here as well as
 * in `surface.css` because the failure mode is silent both ways.
 */
.woocommerce-cart .wp-block-woocommerce-cart {
  container: zoey-cart-row / inline-size;
}

@container zoey-cart-row (max-width: 38em) {
  .woocommerce-cart .wc-block-cart {
    flex-direction: column;
  }

  /*
   * **WooCommerce's column widths have to go with the columns.** It sizes the two sides at `65%`
   * and `35%` of the row, and a percentage width survives a change of flex direction — so stacking
   * alone left the panel at 35% of a full-width column: 330px inside 944px at 1024, 247px inside
   * 707px at 768, with the checkout action squeezed to match. `auto` hands the width back to the
   * column, which is what the `stretch` rule below then fills.
   */
  .woocommerce-cart .wc-block-cart__main,
  .woocommerce-cart .wc-block-cart__sidebar {
    inline-size: 100%;
  }

  /* The gutter between two columns is not a gutter when there is one column. */
  .woocommerce-cart .wc-block-cart__main {
    padding-inline-end: 0;
  }
}

/*
 * The panel is as tall as its own contents, and that is one declaration.
 *
 * `.wc-block-cart` is a flex row and its `align-items` resolves to `normal`, which for a flex item
 * means **stretch** — so the paper matched the item list's height and a four-line cart left a
 * measured **330px of blank paper** below the checkout action. Nothing was wrong with the material;
 * the panel was simply being given a height by the row.
 *
 * `align-self: flex-start` takes the stretch off and nothing else: the panel keeps its own width,
 * WooCommerce keeps deciding what that width is, and the panel grows with its content — an expanded
 * coupon form, a shipping row, a real express-payment provider — because its height is now the sum
 * of its children rather than a copy of its neighbour's. Top-aligned, which is where the board has
 * it, and which is also what makes the item list and the totals read as two columns rather than one
 * block.
 */
.woocommerce-cart .wc-block-cart__sidebar {
  align-self: flex-start;
  margin-block-start: 0;
}

/*
 * **`align-self: flex-start` is kept in the stacked case too, and the width comes from `100%`
 * instead.** Worth recording, because the obvious alternative is wrong in a way that is easy to
 * miss.
 *
 * In a column flex container the cross axis is the *inline* axis, so `align-self: stretch` is what
 * gives a stacked item full width — and it also makes the item a stretched flex item, which is how
 * the panel ended up **1228px tall with its last child ending at 758px**: the trailing blank this
 * refinement exists to remove, reintroduced at the narrow widths while being fixed at the wide
 * ones. `inline-size: 100%` with `flex-start` kept gives the same full width and leaves the block
 * size as content, which is the property that actually matters here.
 */

/*
 * The checkout action does not disappear at desktop widths, and this one is WooCommerce's own
 * collision rather than anything this story did.
 *
 * WooCommerce promotes the action into a fixed bottom bar when its in-flow position is out of view,
 * by adding `--sticky` to the submit container from script. Its stylesheet then hides that same
 * container above a breakpoint:
 *
 *   @media (min-width: 783px) { .wc-block-cart .wc-block-cart__submit-container--sticky { display: none } }
 *
 * There is only **one** submit container, so when both conditions are true at once the Cart has no
 * checkout action at all. It happens for real: at **1024px with a 32px root** the enlarged text
 * pushes the action below the fold, the script promotes it, the media query hides it, and the
 * action is gone — `display: none`, 0×0, and still absent after scrolling. Measured on the
 * unchanged base as well, so it is pre-existing; it is corrected here because `AC-06` requires the
 * action to be visible and a Cart that can lose its checkout button is not shippable.
 *
 * `body.woocommerce-cart`, compounded rather than descended: WooCommerce puts that class **on the
 * body**, so `body .woocommerce-cart` asks for a descendant that does not exist and matches
 * nothing. The first version of this rule had the space in it and changed nothing at all — the
 * `position: static` it appeared to win was WooCommerce's own non-sticky base rule. Every other
 * rule in this section starts at `.woocommerce-cart` and so is unaffected; only the ones that need
 * `html body` for specificity have to compound it.
 *
 * The correction is the smallest one that works: at the widths where WooCommerce hides the bar,
 * show the container as the ordinary in-flow block it was before the promotion. Below 783px nothing
 * changes and WooCommerce's sticky bar behaves exactly as it does today — this rule cannot even
 * match there. No script is replaced, no observer is re-implemented, and the anchor, its
 * destination and its behaviour are untouched.
 */
@media (min-width: 783px) {
  html body.woocommerce-cart .wc-block-cart .wc-block-cart__submit-container--sticky {
    position: static;
    display: block;
    padding: 0;
    background: transparent;
    box-shadow: none;
  }
}

.woocommerce-cart .wc-block-cart__main {
  padding-inline-end: var(--wp--preset--spacing--50);
}

/*
 * The totals heading, restored — `K1`.
 *
 * WooCommerce renders this heading already, and renders it properly: its own
 * `cart-order-summary-heading-block` emits `<h2 class="wc-block-cart__totals-title">Cart totals</h2>`,
 * localized through WooCommerce's text domain. Then `wc-blocks-style` hides it:
 *
 *   .wc-block-cart .wc-block-components-sidebar .wc-block-cart__totals-title { display: none }
 *
 * `display: none` is not a visual choice — it takes the heading out of the **accessibility tree**
 * too, so until this rule existed the Cart's totals region had no heading for anybody, sighted or
 * not. The approved board shows one and two acceptance criteria assume one.
 *
 * **What is restored is WooCommerce's element**, which is the whole of `K1`'s instruction. This
 * rule changes `display` and gives the heading the panel's own rhythm. It does not supply the
 * words, does not change the tag, and emphatically does not reach the same appearance with
 * `content` on a pseudo-element — a heading generated in CSS cannot be translated and is not
 * reliably announced, so it is not a heading.
 *
 * `html body` and the full WooCommerce chain, because the declaration being overridden carries
 * three classes and would otherwise win on specificity. That is this file's standing habit and the
 * reason the cart line-item rules below are written the same way.
 *
 * The size is `theme.json`'s own `card-title` step rather than the `h2` default, because this is a
 * heading inside a panel and not a section heading on a page — the panel is 406px wide at 1440 and
 * a 32px section title in it reads as a second page title. Margin below only: the paper's own
 * padding is the space above, and `.zoey-surface__content > :first-child` makes that true for every
 * other surface in this theme by collapsing exactly this margin.
 */
html body .wc-block-cart .wc-block-components-sidebar .wc-block-cart__totals-title {
  display: block;
  margin-block: 0 var(--wp--preset--spacing--40);
  font-size: var(--wp--preset--font-size--card-title);
  /*
   * **1.3, not 1.2, and the difference is measurable rather than taste.** At a 32px root the
   * heading renders at 36px, and a 1.2 line box is 43.2px against 46px of actual glyph height — so
   * the ascenders and descenders overflowed their own line and the Cart's clipped-text check caught
   * it. Nothing was visually cut, because the overflow is visible, but a heading whose glyphs do not
   * fit its line box is one stylesheet change away from being cut. 1.3 contains them at both sizes.
   */
  line-height: 1.3;
}

/*
 * The two required accents — a yellow star at the top of the summary, a pink heart beside the
 * action.
 *
 * `content` and the two insets are all this file supplies; the artwork, the mask, the size step and
 * the inertness come from the two owners named in the header. Each one's colour is written onto the
 * pseudo-element itself rather than onto its host, because the mask paints with `currentColor` and
 * the host's `color` is the panel's text.
 *
 * **Where they are, and what they are kept clear of.** The star sits at the summary's trailing top
 * corner, which is beside the *Cart totals* heading rather than over it — the heading's text ends
 * well short of the column, and `SL-008`'s suite measures the gap against the glyph rectangles
 * rather than the element box, because a heading's box spans its column whether or not its words
 * reach the end of it. The heart sits at the submit container's leading edge below the action, in
 * the space the panel's own bottom padding already reserves, so it cannot reach the anchor's focus
 * ring. Both are inside the paper's padding, which is what keeps them off the panel's rounded
 * corners — `SL-007` put a star 1.1px inside a 28px radius once and it read as a smudge.
 *
 * Neither reserves space, because both are absolutely positioned: adding or removing an accent
 * cannot move a figure. That is what lets `AC-03`'s *"readable title/figures take priority"* be
 * answered by placement rather than by giving the panel a minimum height.
 */
/*
 * The star sits beside the heading, and the space it needs is **reserved on the heading** rather
 * than hoped for.
 *
 * `K1` requires clearance to be measured against the heading's glyphs, and a heading is the one
 * thing in this panel whose length is not ours — *Cart totals* is WooCommerce's string and a
 * translation may be half again as long. So the heading gives up `2.5rem` of its trailing edge: the
 * mark is `1.25rem` at its `small` step, which leaves `1.25rem` of air, and **both are `rem`**, so
 * the ratio holds at every text size instead of the mark catching the words up as they grow. That
 * is `SL-007`'s lesson stated as a rule — reserved space expressed in a unit that does not grow
 * faster than what it is protecting.
 *
 * The reservation is on the heading alone, so no figure, row or control below it loses width.
 */
html body .wc-block-cart .wc-block-components-sidebar .wc-block-cart__totals-title {
  padding-inline-end: 2.5rem;
}

.woocommerce-cart .wc-block-cart__sidebar > .wp-block-woocommerce-cart-order-summary-block::before {
  content: "";
  color: var(--wp--preset--color--zoey-yellow);
  inset-block-start: var(--wp--preset--spacing--10);
  inset-inline-end: 0;
}

.woocommerce-cart .wc-block-cart__submit::after {
  content: "";
  color: var(--wp--preset--color--zoey-pink);
  /*
   * Positioned from the **bottom edge of the action downwards**, rather than by an offset guessed
   * from the panel's own bottom. `inset-block-start: 100%` is the action's bottom whatever height
   * the action has taken, so a two-line checkout label at enlarged text moves the heart with it
   * instead of leaving it behind inside the button.
   */
  inset-block-start: 100%;
  inset-block-end: auto;
  margin-block-start: var(--wp--preset--spacing--40);
  inset-inline-start: 0;
}

/*
 * The band the heart sits in, and it is a margin rather than more panel padding.
 *
 * The panel's padding belongs to the material and is declared once, in `components/surface.css`;
 * widening it here for one mark would be a second owner for the one property that adoption was
 * supposed to keep single. So the space is the *action's* bottom margin instead — composition,
 * which is this file's job — and the heart hangs into it.
 *
 * **The band is `spacing--60`, and every length in it was measured rather than chosen.** Two
 * constraints squeeze it from both ends and the first two attempts each satisfied one of them:
 *
 *   above  the anchor's focus ring is 3px solid with an offset, so its outer edge sits about 5px
 *          below the anchor's box. `spacing--40` left 7px of clearance; `spacing--50` with the mark
 *          16px down left **-5px** and the ring was overlapped
 *   below  WooCommerce collapses this block to **zero height** when it promotes the action into its
 *          own fixed bar, and a mark anchored to `100%` of a zero-height box plus a 16px margin
 *          then landed **5px below the paper's edge** at 390 and 320. Measured, not predicted
 *
 * `spacing--60` for the band with the mark `spacing--40` into it satisfies both at once: **11px**
 * of clearance below the ring, and the mark ending well inside the paper whether or not the action
 * is still in the panel — the mark may hang past the band into the paper's own padding, which is
 * what gives it room without the band having to hold all of it.
 * Every length is a `rem` token, so the clearances hold as the reader's text grows instead of being
 * numbers that were true at 16px.
 */
.woocommerce-cart .wc-block-cart__submit {
  margin-block-end: var(--wp--preset--spacing--60);
}

/*
 * The submit container, which has to be a containing block for the heart above it.
 *
 * `position: relative` is already on it from the lift rule, so this is only the reminder that the
 * two depend on each other: an accent positioned against a static ancestor is an accent positioned
 * against the panel, and at some width that is on top of a word. The group mechanism exists for
 * exactly this reason on the surfaces this theme renders; here the host element is WooCommerce's
 * and the discipline has to be written down instead.
 */

/*
 * The checkout action at a reader's enlarged text — three declarations, and **two of the three fix
 * a defect this story introduced**.
 *
 * Measured at 320px with the root font at 32px, before this rule: the action was **288px wide
 * inside a 248px content box**, 131px tall, its label broken **inside words**, and `border-radius:
 * 999px` turned a two-line button into a tall oval. None of that is WooCommerce's doing.
 *
 * **`overflow-wrap` is the mid-word break, and it was inherited from this story's own adoption.**
 * `surface.css` sets `overflow-wrap: anywhere` on the surface's content box — deliberately, as a
 * floor against an unbreakable token widening a card — and the Cart's panel now *is* that content
 * box, so every descendant inherited it, the checkout label included. `anywhere` does two things:
 * it permits a break inside a word, and it makes those breaks count toward **min-content**. So the
 * button's minimum width collapsed to a fragment, the layout gave it that fragment, and the label
 * broke mid-word to fit.
 *
 * `break-word` keeps the safety net and drops the harm: a word is still broken when it genuinely
 * cannot fit, but intra-word opportunities no longer count toward min-content, so the button asks
 * for its longest *word* and the label wraps at spaces. `word-break: normal` and `hyphens: manual`
 * are restated beside it so nothing else in the cascade can reintroduce the break.
 *
 * **The width.** `inline-size: 100%` with `box-sizing: border-box` is what the design contract
 * already asks for — *"full width within totals"* — and it is what stops the content-sized
 * `inline-flex` box outgrowing the paper it sits on. The label's usable width is then the panel
 * minus WooCommerce's own horizontal padding, which is left alone: the padding is in `em`, so it is
 * the reader's text that grew, and shrinking it would be answering enlarged text by making the
 * target smaller.
 *
 * **The radius.** `theme.json`'s `radius--large` rather than WooCommerce's 999px pill. At ordinary
 * size this changes **nothing visible** — the action is 45px tall, a 999px radius clamps to 22.5px,
 * and 28px clamps to the same 22.5px — so the pill a reviewer approved is the pill they still get.
 * When the label takes two lines the same declaration gives a rounded rectangle that grew, instead
 * of a 131px oval. One value, correct at both sizes, rather than a second rule at a breakpoint.
 *
 * Not touched: the anchor, its `href`, its text, its font size, its colours, its focus ring, or any
 * behaviour. This rule sets wrapping, width and corner radius.
 */
.woocommerce-cart .wc-block-cart__submit-button {
  box-sizing: border-box;
  inline-size: 100%;
  max-inline-size: 100%;
  /*
   * **The horizontal padding stops growing before the label does.**
   *
   * WooCommerce sets it in `em` — 1.5em each side — so at a 32px root it is 48px each side, 96px
   * of chrome. Measured at 768px with a 32px root, that left the label a **53px** box for a 139px
   * word, and the word spilled out of the pink. The reader asked for bigger text, and the padding
   * took the width the text needed.
   *
   * `min( 1.5em, 10% )` keeps WooCommerce's value until it would cost the label more than a tenth
   * of the button on each side, and then stops. The percentage resolves against the containing
   * block, so it *is* "a share of the available width" rather than a number: at ordinary text the
   * `em` wins at every width from 320 to 1440 and nothing moves — except at 768, where it trims
   * 24px to 20px and the label fits on **one** line instead of two, which is the board's own
   * appearance restored rather than a new one.
   *
   * The block padding is untouched: vertical padding is what makes the target 45px tall, and
   * growing it with the text is correct.
   */
  padding-inline: min(1.5em, 10%);
  border-radius: var(--wp--custom--radius--large);
  word-break: normal;
  overflow-wrap: break-word;
  hyphens: manual;
}

/*
 * The label element inside the anchor, which is where the text actually lives and therefore where
 * the inherited `anywhere` would otherwise still apply. WooCommerce wraps the words in
 * `.wc-block-components-button__text`; a rule on the anchor alone leaves the inner element wearing
 * the surface's floor, which is exactly the bug.
 */
.woocommerce-cart .wc-block-cart__submit-button .wc-block-components-button__text {
  word-break: normal;
  overflow-wrap: break-word;
}

/*
 * Express payment, when there is any.
 *
 * `.wc-block-cart__payment-options` renders on this install as an empty box, because no express
 * provider is configured — and `DESIGN-CONTRACT.md` requires the panel to *accommodate* real
 * provider content rather than paint a picture of it. Two rules, and both are about not lying:
 *
 *   an empty slot collapses, so the panel does not reserve a band for nothing
 *   a filled slot gets the panel's own rhythm above the action, and no fixed height
 *
 * `:empty` is the honest test: it is true of the slot WooCommerce renders when nothing is
 * configured and false the moment a provider puts a button in it. `SL-008`'s evidence for the
 * filled case is a **labelled layout specimen injected in the browser**, never a configured
 * payment method — the report says so, and no provider integration is claimed.
 */
.woocommerce-cart .wc-block-cart__payment-options:empty {
  display: none;
}

.woocommerce-cart .wc-block-cart__payment-options:not(:empty) {
  margin-block-end: var(--wp--preset--spacing--40);
}

/*
 * Continue shopping.
 *
 * A secondary text link, after the cart and outside every repeated item row, rendered by
 * `zoey_made_cart_continue_shopping()` to the **configured** Shop page. Underlined, because it is a
 * text link in a region of controls and the one thing it must not be is a second button — the
 * design contract allows one primary action on this page and WooCommerce owns it.
 *
 * Hidden when the empty branch is showing. `:has()` rather than a server-side `is_empty()` check,
 * because the filled-to-empty transition happens in the browser with no request: a visitor who
 * removes their last item would otherwise be looking at *Continue shopping* underneath *Explore the
 * shop*. The selector asks the question the DOM can answer — is the empty branch the one React
 * rendered — and it re-answers it on every transition for free.
 */
.zoey-cart-continue {
  margin-block-start: var(--wp--preset--spacing--50);
}

.wp-block-woocommerce-cart:has(.wp-block-woocommerce-empty-cart-block) + .zoey-cart-continue {
  display: none;
}

/*
 * The link itself, and the hit area is not decoration.
 *
 * Measured at 135×22 in the first run, which is under the 44px this project asks of anything a
 * child might be aiming at — and a standalone navigation link is exactly that, whatever WCAG 2.2's
 * inline-text exemption would allow. `inline-flex` with a minimum block size grows the *target*
 * without growing the type or giving the link a box: it still reads as a sentence, and the
 * underline still sits where the words are rather than around a button.
 */
.zoey-cart-continue__link {
  display: inline-flex;
  align-items: center;
  min-block-size: 44px;
  color: var(--wp--preset--color--ink);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

/*
 * The empty branch.
 *
 * One message, one action, the approved bag and the two accents — and none of the recommendation
 * grid that used to be here. That grid is gone from the **content**, by `SL-008`'s `D3` migration,
 * rather than hidden by a rule: a second product-card family on a public route is what
 * `STORE-004`'s one-canonical-card rule rules out, and hiding it with CSS would have left it in the
 * document for a screen reader to read out.
 *
 * The group is the accent layer's containing block, which is why it is positioned. `overflow: clip`
 * is not needed here — `components/decoration.css` already clips the layer — and no height is set:
 * the branch is as tall as its own words at any text size.
 */
.zoey-cart-empty {
  position: relative;
  padding-block: var(--wp--preset--spacing--70);
  text-align: center;
}

/*
 * The accent layer, with **two classes** on purpose.
 *
 * `components/decoration.css` declares `inset: 0` on `.zoey-decoration-group` and is enqueued after
 * this file, so a single-class rule here loses on source order and the layer spans whatever it was
 * given rather than the inset box this asks for. `SL-006` paid for that twice in one hero. Inset by
 * a spacing token so the two marks sit inside the message's own block rather than against the
 * content column's edge.
 */
.zoey-decoration-group.zoey-cart-empty__accents {
  inset: var(--wp--preset--spacing--40) var(--wp--preset--spacing--30);
}

/*
 * The bag.
 *
 * `zoey_made_icon( 'shopping-bag' )` — the same vendored Lucide glyph the header's cart link has
 * carried since `STORE-008`, which is what `DESIGN-CONTRACT.md` means by *"an existing approved
 * shopping-bag icon"*. An **inline SVG with a real stroke**, not a mask, so unlike the two accents
 * it survives forced colors; it is decorative all the same and the renderer gives it `aria-hidden`,
 * because the heading beside it is what carries the meaning.
 *
 * Sized in `rem` so it grows with a reader's text, and in `ink-soft` so it reads as a quiet mark
 * above the message rather than competing with it.
 */
.zoey-cart-empty__bag {
  display: block;
  inline-size: 3rem;
  block-size: 3rem;
  margin: 0 auto var(--wp--preset--spacing--40);
  color: var(--wp--preset--color--ink-soft);
}

/*
 * The message and the action.
 *
 * Both are ordinary editable blocks and neither has its text here. The heading is capped at the
 * reading measure so a sentence of this length breaks where a sentence should, and the action is a
 * core button wearing `theme.json`'s own pink-on-Ink button styles — the same appearance
 * WooCommerce's checkout anchor already has, which is what keeps one visual language for a primary
 * action without this file restating a colour.
 */
.zoey-cart-empty .wp-block-heading {
  max-inline-size: 28rem;
  margin-inline: auto;
}

.zoey-cart-empty .wp-block-buttons {
  margin-block-start: var(--wp--preset--spacing--50);
}

/* --- Checkout (SL-009) ------------------------------------------------------------------- */

/*
 * Checkout's composition, its softer fields and where its two accents sit.
 *
 * The material is not here. The order summary's paper is one more selector on
 * `components/surface.css`'s own soft-paper rules, the star and the heart's artwork is
 * `components/doodle.css`'s, and their size and inertness is `components/decoration.css`'s — each
 * declared exactly once, in the file that already declared it. This file owns the ground, the
 * fields, the plumbing the adoption needs and the two insets. Material there, composition here;
 * the split `SL-008` established and `SL-009` keeps.
 *
 * **Everything below is scoped under `.zoey-checkout`, which is a body class this theme sets** in
 * `inc/shop/checkout.php` and which the **order-received page does not get** — verified on the real
 * endpoint, where the body carries `woocommerce-checkout` and `woocommerce-order-received` and not
 * this class. That is Product's explicit instruction: *exclude the receipt from all new styling,
 * including the white background, not just the loader.*
 *
 * `body.woocommerce-checkout` alone would have painted the receipt white, because `is_checkout()`
 * is true there and `wc_body_class()` gives it that class too. A
 * `:not(.woocommerce-order-received)` would have worked — the receipt does carry a class of its
 * own — but it is opt-out, and the selector that forgets it is the one that styles the receipt.
 * This is opt-in instead, from the same predicate the loader uses. See the file header there.
 *
 * Account, the catalogue, the Cart and every other route are untouched: none of them carries this
 * class.
 */

/*
 * The ground, white — the same change `SL-008`'s `C2` recorded for the Cart, and for the same
 * reason.
 *
 * Measured before: `body` computed `rgb(255, 249, 252)`, which is `surface-soft` from
 * `theme.json`. So a white Checkout is a change this story makes, not a state it inherits. The
 * form regions need no rule — they are transparent, and transparent over white is white, which is
 * what keeps `DESIGN-CONTRACT.md`'s *"white page/form regions"* to one declaration.
 */
body.zoey-checkout {
  background-color: var(--wp--preset--color--surface);
}

/*
 * The summary panel's children, lifted above the paper.
 *
 * The same plumbing the Cart needed and for the same painting reason: a surface rendered by
 * `zoey_made_surface()` has a `__content` element carrying `position: relative` and `z-index: 1`,
 * and WooCommerce's summary has no such element. The paper and the grain are positioned
 * descendants at `z-index: 0`, which paint *after* in-flow inline content — so without this the
 * grain is drawn over every word, every price and every control in the panel.
 *
 * `> *` rather than WooCommerce's two class names: the title and the content are its children
 * today, and a release that adds a third should not have it painted under the paper.
 */
.zoey-checkout .wp-block-woocommerce-checkout-totals-block > .wp-block-woocommerce-checkout-order-summary-block > * {
  position: relative;
  z-index: 1;
}

/*
 * WooCommerce's own panel edge is **deliberately not touched here**, and the reason is a cascade
 * fact worth recording because the obvious rule is wrong.
 *
 * At two-column widths WooCommerce draws the summary a `1px solid rgba(51, 47, 61, 0.2)` border at
 * `5px` radius, and drops both below its mobile breakpoint. The surface declares a border and
 * `--wp--custom--radius--large` on the same element, once, for every consumer of the material, and
 * only one of the two can win.
 *
 * The first version of this file reached for `border: revert` — and `revert` rolls a property back
 * to the **previous origin**, which from an author stylesheet means the user-agent's value, not
 * "whatever other author rule was next in line". It would have produced a `div`'s UA border, which
 * is none, and left the panel edgeless rather than handing it to the material.
 *
 * So the edge is settled where it belongs — on the adopter selector in `components/surface.css`,
 * which carries three classes and a child combinator and out-specifies WooCommerce's own rule. It
 * is **asserted** by the suite as a computed value rather than trusted, because a rule that wins
 * on specificity by one step is a rule worth a check: if a WooCommerce release raises its own
 * selector, the check fails instead of the panel quietly wearing two edges.
 */

/*
 * The heading, which is the two accents' host.
 *
 * `position: relative` and nothing else. The summary panel's own two pseudo-elements are spent on
 * the paper and the grain, so the star and the heart hang off the summary's **heading** — which is
 * also the more faithful reading of `DESIGN-CONTRACT.md`'s *"tiny existing yellow star and pink
 * heart near the summary heading"*, and it means both marks move with the heading when a reader
 * enlarges their text instead of staying where 16px put them.
 *
 * The heading is `display: flex` with the label at the start and the order total at the end. Both
 * marks are `position: absolute` and therefore **out of that flex flow** — they add no track, take
 * no space from the label or the figure, and cannot push either.
 *
 * Worth recording: this heading is **visible on Checkout**, unlike the Cart's, which WooCommerce
 * hid with `display: none` and `SL-008`'s `K1` had to restore. There is no `K1`-shaped defect here
 * and nothing is restored — measured `display: flex` on the unchanged base, at every width.
 */
.zoey-checkout .wp-block-woocommerce-checkout-totals-block .wc-block-components-checkout-order-summary__title {
  position: relative;
}

/*
 * Where the two marks go, and why both are in the band *above* the heading.
 *
 * `components/decoration.css` says how big a mark is and that it is inert; `components/doodle.css`
 * says what it is drawn with. This is the only thing left — `content`, a colour and two insets,
 * exactly the three properties `SL-008` left in this file for the Cart.
 *
 * The band above the heading is the summary panel's own top padding, which the material declares
 * and which holds no text, no figure, no control and no focus ring. That is the one place in this
 * panel where a decorative mark cannot collide with anything, and it is why **both** marks are
 * there rather than one above and one below: the heading is followed immediately by the first line
 * item, so a mark hung below it at `inset-block-start: 100%` would sit on a product name.
 *
 * `inset-block-end: 100%` is the heading's **top edge, upwards**, so a heading that wraps to two
 * lines at enlarged text carries both marks up with it instead of leaving them overlapping its
 * first line. The same reasoning as the Cart's heart, which anchors to `100%` of the action's box
 * so a two-line label moves it; this is that trick in the other direction.
 *
 * The star is at the inline end and the heart at the inline start, so neither is over the label's
 * first word or the total's last digit. Every length is a `rem` token, so the clearances hold as
 * the reader's text grows rather than being numbers that were true at 16px.
 */
.zoey-checkout .wp-block-woocommerce-checkout-totals-block .wc-block-components-checkout-order-summary__title::before {
  content: "";
  color: var(--wp--preset--color--zoey-yellow);
  inset-block-end: 100%;
  inset-inline-end: 0;
  margin-block-end: var(--wp--preset--spacing--20);
}

.zoey-checkout .wp-block-woocommerce-checkout-totals-block .wc-block-components-checkout-order-summary__title::after {
  content: "";
  color: var(--wp--preset--color--zoey-pink);
  inset-block-end: 100%;
  inset-inline-start: 0;
  margin-block-end: var(--wp--preset--spacing--20);
}

/*
 * Softer fields — `G1`, and the ruling is the interesting part of this rule.
 *
 * `DESIGN-CONTRACT.md` §3 asks for a *"thin muted lavender-gray border"* and warns, in terms, not
 * to pick Border Soft by its name without measuring it. The warning earned its place: `border-soft`
 * `#EDE7F0` measures **1.21:1** against the field's white ground, and a field border is
 * information required to identify a control, so WCAG 1.4.11's **3:1** applies to it.
 * `zoey-lavender` fails too, at 1.58:1.
 *
 * **`ink-soft` `#6D6878` is Product's ruling**: an existing token, no new one invented, a muted
 * lavender-leaning gray that measures **5.38:1** on white and **5.25:1** on the summary's paper —
 * and still materially softer than the `rgba(43, 45, 47, 0.8)` near-black WooCommerce draws today
 * at 7.36:1. "Softer" had to mean *softer and still visible*, which `border-soft` could not.
 *
 * The radius is `--wp--custom--radius--small`, a token rather than the board's illustrative 8px,
 * which §3 is explicit is *"not an approved new token or exact measurement"*.
 *
 * **Nothing here touches size, type or focus**, and that is deliberate rather than an omission:
 * the controls measure 50px tall with 16px input text on the unchanged base, which §3 asks be kept
 * generous and readable, and the focus ring is already `outline: #332F3D solid 3px` at a 2px
 * offset — the established Ink ring §3 asks for, and the thing it forbids replacing with a barely
 * darker border. Both are preserved by not being written about.
 *
 * `html body` and the repeated WooCommerce chain: the rules being replaced carry several classes
 * and would otherwise win on specificity. This file's standing rule, and the same shape as the
 * cart line-item and type-floor rules above.
 */
/*
 * The radius goes on **every** field, error state included: a corner is not a state signal, and a
 * field that changed shape when it became invalid would be saying something with geometry that the
 * error text already says in words.
 *
 * **`input[type]` is load-bearing, and it was measured rather than reasoned about.** WooCommerce
 * styles these fields with `.wc-block-components-form .wc-block-components-text-input
 * input[type=email]` and five more type variants — a selector whose attribute makes it
 * **(0, 3, 1)**. The first version of this rule was `html body.zoey-checkout
 * .wc-block-components-text-input input`, which is (0, 2, 3): three elements beat nothing, but two
 * classes lose to three, so the radius silently stayed WooCommerce's 4px while the border beside it
 * changed. The border rule below only won because `:not(.has-error)` happens to contribute a third
 * class — it won by accident, which is worth writing down.
 *
 * `[type]` restores the missing point by naming the same kind of thing WooCommerce named, rather
 * than by stacking another `html` or reaching for `!important`. Every one of these inputs carries a
 * `type`, so nothing is excluded. Confirmed with Chrome's own matched-styles rather than by
 * counting selectors on paper, because counting them on paper is how the first version shipped.
 */
html body.zoey-checkout .wc-block-components-text-input input[type],
html body.zoey-checkout .wc-block-components-textarea,
html body.zoey-checkout select.wc-blocks-components-select__select {
  border-radius: var(--wp--custom--radius--small);
}

/*
 * The border goes on every field **except an invalid one**, and `:not(.has-error)` is the whole
 * reason this is two rules instead of one.
 *
 * §3: *"Errors combine clear boundary treatment with native textual feedback and associations;
 * colour alone is insufficient."* WooCommerce signals an invalid field with
 * `.wc-block-components-text-input.has-error input { border-color: #cc1818 }` — two classes and an
 * element. The softer default here needs `html body` to beat WooCommerce's *ordinary* field rule,
 * and that specificity would have beaten its **error** rule too, leaving a red label beside a
 * calm lavender-gray box. Colour alone, which is exactly what §3 forbids.
 *
 * `revert` is not the fix either: from an author stylesheet it rolls back to the user agent, not to
 * WooCommerce's declaration. Excluding the state is. So an invalid field keeps WooCommerce's own
 * boundary untouched, and **this file owns no error colour at all** — which is right, because an
 * error colour is not a decision this story was given.
 */
html body.zoey-checkout .wc-block-components-text-input:not(.has-error) input[type],
html body.zoey-checkout .wc-block-components-textarea:not(.has-error),
html body.zoey-checkout select.wc-blocks-components-select__select {
  border: 1px solid var(--wp--preset--color--ink-soft);
}

/*
 * The focused field keeps a darker boundary under the ring.
 *
 * Stated rather than left to the cascade, because the softer default above would otherwise also be
 * the focused border and the ring would be doing all the work alone. §3 asks that focus stay
 * conspicuous; this is the boundary *underneath* the ring, and the ring itself —
 * `outline: #332F3D solid 3px` at a 2px offset, measured already correct on the unchanged base — is
 * untouched. An invalid focused field is excluded here too, for the reason above.
 */
html body.zoey-checkout .wc-block-components-text-input:not(.has-error) input[type]:focus,
html body.zoey-checkout .wc-block-components-textarea:not(.has-error):focus,
html body.zoey-checkout select.wc-blocks-components-select__select:focus {
  border-color: var(--wp--preset--color--ink);
}

/* --- Checkout — the order summary's text layout (SL-009 correction pass) ------------------ */

/*
 * Why there is a correction pass at all, recorded here because the next person to widen a
 * WooCommerce panel needs it more than they need the fix.
 *
 * `SL-009` shipped with 166 green checks and three real defects in it, and every check it had was
 * the *wrong kind*. They read `getComputedStyle()` — the paper's mix, the grain's opacity, each
 * accent's mask, each field's border and radius — and all of those were correct. What nothing
 * asked was whether a **word** or a **price** was still in one piece. At 768px the summary was
 * laying out `$32.00` down the column one glyph per line, and a suite that measures paint sees a
 * perfectly painted panel.
 *
 * The lesson is written into `scripts/dev/sl-009.mjs`'s header and into `docs/CSS-AND-ASSETS.md`:
 * **a correct computed style is not a readable page.** The checks that catch this measure
 * `Range.getClientRects()` on the glyphs themselves.
 *
 * ## What actually went wrong
 *
 * WooCommerce sizes the checkout sidebar in pixels — 406 / 309 / **231** at 1440 / 1024 / 768 —
 * and lays the summary row out as `display: flex` with **`overflow-wrap: anywhere`** inherited
 * through it. `anywhere`, unlike `break-word`, also lowers an element's *min-content* size, so a
 * flex column carrying it will shrink to roughly one character and break every word to get there.
 * In a 231px sidebar, minus this story's own padding, the product name was allotted **18px**.
 *
 * Three of the four rules below simply stop that happening. The fourth lets the row rearrange
 * when the three-across arrangement genuinely has no room, which is `SL-009`'s approved
 * *responsive summary-row arrangement* — chosen, as the ruling requires, from measured content
 * requirements rather than a device breakpoint. There is no media query and no container query
 * here: the flex algorithm decides, from the width it actually has.
 *
 * **A container query was considered and rejected.** It is the obvious tool and it is forbidden
 * here for a concrete reason: `container-type` makes an element answer *every* unnamed
 * `@container` query inside it, and WooCommerce's entire checkout layout is built from unnamed
 * queries. `SL-009`'s first implementation proved it — see `components/surface.css`'s
 * `container-type: normal` and the comment above it.
 *
 * **Both native summaries are covered.** Below ~640px WooCommerce renders a second summary inside
 * `.wc-block-checkout__actions`, and `G2` keeps that one native white. White is a *material*
 * ruling, not a licence to leave its text broken: measured at 320px with doubled text, the lower
 * summary fragmented six words and pushed two prices past its edge. So the material stays on the
 * one panel `G2` names, and readability applies to both. Neither instance is added, removed,
 * reordered or re-parented; the disclosure still opens and closes on WooCommerce's own state.
 */

/*
 * Prices never break inside a number.
 *
 * WooCommerce already sets `white-space: nowrap` on `.wc-block-components-formatted-money-amount`,
 * and for an ordinary price that is enough. A **sale** price is not that element: the markup is
 * `<del>$32.00</del>` and `<ins>$24.00</ins>` with the amount as their own text, carrying no
 * `nowrap` and inheriting `overflow-wrap: anywhere` like everything else in the row. Measured at
 * 768px: `$32.00` across four lines and `$24.00` across three.
 *
 * A number that wraps is not a formatting blemish, it is a price a parent can misread, which is
 * why this is stated for every element that can hold one rather than only for the two that were
 * caught failing.
 */
.zoey-checkout .wc-block-components-order-summary .wc-block-components-product-price__regular,
.zoey-checkout .wc-block-components-order-summary .wc-block-components-product-price__value,
.zoey-checkout .wc-block-components-order-summary .wc-block-components-formatted-money-amount,
.zoey-checkout .wc-block-components-totals-item__value,
.zoey-checkout .wc-block-components-totals-item__value .wc-block-components-formatted-money-amount {
  white-space: nowrap;
}

/*
 * Ordinary words stop breaking mid-word.
 *
 * `break-word` rather than WooCommerce's `anywhere`, and the difference between them is the whole
 * defect: both will break a word that cannot fit on a line, but only `anywhere` counts toward
 * **min-content**, which is what let the flex column collapse to a single character in the first
 * place. With `break-word` the column is sized to hold its longest word, so words break only when
 * one genuinely does not fit — which is still permitted, because the alternative is a word
 * hanging off the paper.
 *
 * Nothing is hidden, clipped, truncated or made smaller to achieve this, and the inherited value
 * is replaced rather than suppressed: a 149-character fixture title with a 69-character variation
 * value still lays out in full at 320px with doubled text.
 */
.zoey-checkout .wc-block-components-order-summary,
.zoey-checkout .wc-block-components-order-summary * {
  overflow-wrap: break-word;
}

/*
 * The row rearranges itself when three-across has no room.
 *
 * `flex-wrap: wrap` plus a flex basis on the description, and then the flex algorithm chooses:
 * where the thumbnail, the description and the line total all fit, nothing moves and the native
 * three-across arrangement is exactly what it always was — verified pixel-for-pixel at 1440 and
 * 1024 at ordinary text. Where they do not fit, the description takes its own full-width line and
 * the thumbnail sits above it, which is the arrangement the 768px sidebar needed.
 *
 * `8rem` is the measured content requirement, not a device width: it is the width at which the
 * summary's own type stops breaking its longest ordinary words, and being in `rem` it rises with
 * the reader's text — which is the point, because the sidebar's pixels do not.
 *
 * `min-width: 0` is load-bearing. A flex item's automatic minimum size is its min-content width,
 * and with `break-word` restored above that is now the longest word — which would make the row
 * refuse to shrink and push the whole summary past the paper, trading one defect for another.
 * Zero lets the item shrink and lets `break-word` do its job on the one word that cannot fit.
 *
 * `display: block` on the content: WooCommerce lays the rows out in a `display: table` whose
 * shrink-to-fit width is its min-content, so at a 32px root the table measured **265px** inside a
 * 199px panel and simply drew outside it. A block box takes the width it is given.
 */
.zoey-checkout .wc-block-components-order-summary__content {
  display: block;
}

.zoey-checkout .wc-block-components-order-summary-item {
  flex-wrap: wrap;
}

.zoey-checkout .wc-block-components-order-summary-item__description {
  flex: 1 1 8rem;
  min-width: 0;
}

.zoey-checkout .wc-block-components-order-summary-item__total-price {
  margin-inline-start: auto;
}

/*
 * The row's gutters move onto the things they separate, so they collapse when the row wraps.
 *
 * WooCommerce draws the gap between the thumbnail and the text as `padding-inline` on the
 * **description** — 24px at the start, 12px at the end. That is correct while the two sit side by
 * side and wrong the moment they do not: with the description on its own line, 36px of a 199px
 * column was indenting text away from a thumbnail that is no longer beside it, and at a 32px root
 * that was the difference between a product name fitting and breaking.
 *
 * Expressed as the thumbnail's own `margin-inline-end`, the same 24px gap appears in exactly the
 * case it is for and disappears in the case it is not — no query, no breakpoint, no second value.
 * The end gutter goes with it: the line total already carries `margin-inline-start: auto`, which
 * separates the two far more generously than 12px whenever they share a line.
 */
.zoey-checkout .wc-block-components-order-summary-item__description {
  padding-inline: 0;
}

.zoey-checkout .wc-block-components-order-summary-item__image {
  margin-inline-end: 24px;
}

/*
 * The country and state selects reserve room for their own floating label.
 *
 * The defect `SL-009`'s correction pass was asked to trace, and the cause is a mismatch inside
 * WooCommerce rather than anything this story did: the select's box is **pixels**
 * (`height: 50px`, `padding-block-start: 16px`, `font-size: 16px`) while the label floated above
 * its value is **rem** (`0.875rem`, so 14px at a 16px root and 28px at a 32px one). The reserved
 * space does not grow with the thing put in it.
 *
 * Measured glyph-to-glyph with `Range.getClientRects()`, not estimated from boxes: the label
 * overlapped the selected value by **4.8px at a 16px root and 18.6px at a 32px root**. The text
 * inputs beside them do not have this defect — WooCommerce raises *their* padding to 24px when
 * the label floats, and their label is px-locked — and they measure a 4.1px clearance. So this
 * rule is not a new idea, it is the treatment the fields next door already have.
 *
 * `1.4375rem` is 23px at a 16px root, which with the 25px line box and the 1px border this file
 * already draws comes to exactly **50px** — so the ordinary design Product accepted is unchanged
 * to the pixel. At a 32px root the padding becomes 46px, which is `G8`'s *"the ordinary 50px
 * measurement is a baseline, not a fixed-height requirement at every text size"* taken literally.
 *
 * **The control's height is no longer stated here.** `G8` gave it `height: auto; min-height: 50px`
 * so the box could grow for a label that scaled while the value did not. `G9` made the value scale
 * too, so the whole control is sized in `rem` by the typography rules below and grows by itself;
 * a second height declaration here would be a second owner of one value.
 */
html body.zoey-checkout select.wc-blocks-components-select__select {
  padding-block-start: 1.4375rem;
}

/*
 * The summary's own heading wraps rather than breaking its words.
 *
 * Found by the width sweep rather than by the five named viewports, which is the argument for
 * sweeping: at **760px with a 32px root** — a width nobody would have thought to list — the
 * heading row had just enough space to stay two-across and not enough to hold the word *summary*,
 * and broke it in half. Twenty pixels either side it was fine.
 *
 * The heading is a flex row of a label and the order total. `flex-wrap: wrap` lets the total take
 * its own line in exactly the case where keeping it alongside would cost the label its words, and
 * `break-word` replaces the `anywhere` inherited from WooCommerce's layout for the same reason it
 * is replaced inside the rows above: `anywhere` lets the label shrink to one character.
 *
 * The heading is also where the star and the heart hang, and they are anchored to its top edge
 * (`inset-block-end: 100%`), so a heading that becomes two lines carries both marks up with it
 * instead of leaving them over its first line. That was designed for enlarged text; this is the
 * case that exercises it.
 */
.zoey-checkout .wc-block-components-checkout-order-summary__title {
  flex-wrap: wrap;
}

.zoey-checkout .wc-block-components-checkout-order-summary__title,
.zoey-checkout .wc-block-components-checkout-order-summary__title * {
  overflow-wrap: break-word;
}

/* --- Checkout — field typography that follows the reader (SL-009 `G9`) -------------------- */

/*
 * A field's text grows with the text around it.
 *
 * `G8` fixed the *symptom* — a floating label that scaled sitting on a value that did not — and
 * recorded the cause as an inherited limitation: **WooCommerce sizes every checkout control's type
 * in pixels.** `G9` closes it. The ruling is narrow: the ordinary 16px appearance is the baseline
 * and is unchanged, and only the behaviour under text enlargement changes.
 *
 * ## What was and was not already relative
 *
 * Measured at a 16px root and again at 32px, on the real page, before anything was written:
 *
 * | | 16px root | 32px root | |
 * | --- | --- | --- | --- |
 * | order-note textarea | 14px | 28px | already relative |
 * | checkbox labels | 14px | 28px | already relative |
 * | Place Order | 16px | 32px | already relative |
 * | select's floating label | 14px | 28px | already relative |
 * | **every text input, its label and its placeholder** | 16px | **16px** | **frozen** |
 * | **every select's value** | 16px | **16px** | **frozen** |
 * | **the coupon input** | 16px | **16px** | **frozen** |
 *
 * Nineteen controls stayed at the size a 16px reader chose, on a page where the note beneath them,
 * the consent text beside them and the button under them all doubled. That is the whole defect.
 *
 * ## How it is fixed
 *
 * **Every px that governs a control's type or its box is restated in `rem`, at the value it
 * already had.** `1rem` *is* 16px at a 16px root — so the ordinary rendering is unchanged to the
 * pixel, which is asserted rather than asserted-to-be-obvious — and it is 32px at a 32px root,
 * which is the point. That is `G9`'s *"replace fixed typography with the existing relative
 * typography system, preserving the ordinary appearance"*: no new token, no new component, no
 * clamp, no cap.
 *
 * The conversions are mechanical and each is the measured value over 16:
 * `16px → 1rem`, `25px → 1.5625rem`, `22px → 1.375rem`, `50px → 3.125rem`, `24px → 1.5rem`,
 * `12px → 0.75rem`, `10px → 0.625rem`, `9px → 0.5625rem`, `8px → 0.5rem`, `11px → 0.6875rem`,
 * `6px → 0.375rem`, `23px → 1.4375rem`.
 *
 * **The height goes with the type.** `G9`: *"do not cap text size or force enlarged content into a
 * 50px box"*. `3.125rem` is exactly 50px for the reader who gets 16px type and exactly 100px for
 * the reader who gets 32px — the box and its contents scale together, so nothing is clipped and
 * nothing is squeezed. A `height: auto` was tried first and rejected: at an ordinary root it
 * computed 59px, which would have changed the design Product has already accepted.
 *
 * **The label's position is converted too, in both of its states.** WooCommerce rests the label
 * over the field (`top: 25px` with `translateY(-11px)`) and floats it above the value once the
 * field is active (`top: 6px` with `scale(0.82)`). Scaling the label's *type* without its
 * *geometry* would put a 32px label 25px down a 100px box — on top of the value. The `scale()` is
 * unitless and needs no conversion; the lengths do.
 *
 * **The placeholder takes the input's own size** rather than being given one, so it can never
 * drift from the value that replaces it.
 *
 * ## What is deliberately not changed
 *
 * The **focus ring** stays `G1`'s Ink `3px` at a `2px` offset. It is a ring, not type, `G1` ruled
 * it, and `G9` asks that focus rings be *preserved* and unclipped — which is checked, on the
 * rendered pixels, rather than assumed.
 *
 * The **border, radius and error treatment** are untouched: an invalid field still keeps
 * WooCommerce's own boundary, and it gets the same type as every other field, because an error is
 * not a reason to shrink what somebody is trying to read.
 *
 * **WooCommerce still owns the form.** Nothing here changes a name, a type, an `autocomplete`, a
 * required flag, an association, a value or a submission. Selection, autofill behaviour and the
 * native select's own popup are the browser's and are untouched.
 *
 * ## How it is verified
 *
 * **On the rendered pixels, not on a declared `font-size`.** An `<input>`'s value is not a text
 * node and has no client rect, so `Range.getClientRects()` — the instrument the correction pass
 * added — cannot see it at all. `scripts/dev/sl-009.mjs` screenshots each control and reads the
 * bands of ink inside it: the label is one band, the value is another, and the gap between them is
 * the clearance. That also answers "is it clipped", because ink touching the border is ink the
 * reader loses.
 */
html body.zoey-checkout .wc-block-components-text-input input[type] {
  font-size: 1rem;
  line-height: 1.5625rem;
  height: 3.125rem;
  padding: 1rem 0.75rem;
}

/*
 * The active box. WooCommerce swaps the padding when the label floats, which is what makes room
 * for it; both values are the ones it already used, in `rem`.
 */
html body.zoey-checkout .wc-block-components-text-input.is-active input[type] {
  padding: 1.5rem 0.5625rem 0.5rem;
}

/* The placeholder is the input's own type, never a size of its own. */
html body.zoey-checkout .wc-block-components-text-input input[type]::placeholder {
  font-size: inherit;
}

html body.zoey-checkout .wc-block-components-text-input label {
  font-size: 1rem;
  line-height: 1.375rem;
  top: 1.5625rem;
  left: 0.625rem;
  transform: translateY(-0.6875rem);
}

html body.zoey-checkout .wc-block-components-text-input.is-active label {
  top: 0.375rem;
  transform: scale(0.82);
}

/*
 * The select's value, which is the half of the control `G8` left behind.
 *
 * Its floating label was already `rem`-based and already doubled; only the chosen option stayed at
 * 16px. The two now scale together, which is also why `G8`'s `padding-block-start: 1.4375rem`
 * above still holds the label clear: both sides of that clearance move at the same rate.
 */
html body.zoey-checkout select.wc-blocks-components-select__select {
  font-size: 1rem;
  line-height: 1.5625rem;
  height: 3.125rem;
  padding-inline-start: 0.5625rem;
  padding-inline-end: 2.5rem;
}

/*
 * The dropdown affordance keeps its proportion to the value it sits beside, and keeps its room.
 *
 * `G9` asks that *"native select values and dropdown affordances remain usable"*. WooCommerce draws
 * its own chevron at a fixed 24px because the native one is turned off (`appearance: none`), so at
 * a 32px root it would have been a 24px mark against 32px type. The matching `padding-inline-end`
 * above is what keeps a long option — *United States (US)* at 32px — from running underneath it.
 */
html body.zoey-checkout .wc-blocks-components-select__container svg {
  width: 1.5rem;
  height: 1.5rem;
  right: 0.75rem;
}
