/*
 * KOROTANA shared primitives and global states — DNA V6 Appendix M step 3.
 *
 * Only what the global states (Section 57) and the later steps consume:
 * focus, buttons, inputs and inline errors (57.4), toasts (57.5), skeletons
 * (57.8), badges, accordion, breadcrumb (55.7), notice, empty state (57.7),
 * the 404 and maintenance pages (57.1, 57.2). Nothing page-specific.
 *
 * RULES THIS FILE OBEYS
 *   - Tokens only (6.3). No colour, size or duration is written here; every
 *     value is a --k-* token from tokens.css. The suite fails on a hex. The
 *     one documented exception (6.3 "page-specific values require a documented
 *     reason"): icon wells, the count badge, the skeleton line and the link
 *     underline offset are sized in em so they scale with the text they
 *     annotate at every T-level and at 200% zoom; a pixel token there would
 *     break the FONTS §08 rule that a state must not shift geometry.
 *   - Colour never carries status alone (02): every status treatment pairs a
 *     token with an icon and text.
 *   - Keyboard-operable and visibly focusable (08): one focus ring rule for
 *     every interactive primitive.
 *   - Functional at 200% zoom (08): no fixed heights on text containers, no
 *     overflow:hidden on text, min-heights only.
 *   - No spinners on primary surfaces (57.8): loading is a label change plus
 *     aria-busy; skeletons reserve geometry.
 *   - No global text-transform (FONTS §06).
 *   - Every primitive is typed through a T-level class (FONTS §04), never a size.
 *
 * Loaded site-wide, before components.css, which depends on it.
 */

/* ==========================================================================
   Accessible-name carrier for icon-only controls, and the skip link (60.8:
   "Skip-to-content link as first focusable element").
   ========================================================================== */
.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.k-skip {
  position: absolute;
  left: var(--k-space-3);
  top: var(--k-space-3);
  z-index: var(--k-z-toast);
  padding: var(--k-space-2) var(--k-space-4);
  background: var(--k-surface-dark);
  color: var(--k-on-surface-dark);
  transform: translateY(-200%);
  transition: transform var(--k-motion-instant) var(--k-ease-calm);
}
.k-skip:focus-visible { transform: none; }

/* Every primitive that combines a width with padding or a border sizes from
   its border box, or it overflows its container at 200% zoom (08). Measured
   at 375px under zoom: content-box inputs reached 402px, toasts 390px.

   .k-pdp__cta is not a primitive, and it is here anyway because it is the
   clearest case of the rule the list states: `width: 100%` plus v4.0 §05's
   12px/14px padding plus a 1px border (product.css). Under the content-box
   default for <button> its border box ran 30px wider than its container and
   27px taller than the height .k-pdp declared for it — and it ran a DIFFERENT
   amount taller in Firefox, whose forms.css already sizes buttons from the
   border box, so the two engines disagreed about a value 08 gates on real
   iPhone Safari and Android Chrome. Declared here rather than in product.css
   so there is one box-sizing decision in the build, not two. */
.k-btn, .k-field__input, .k-field__toggle, .k-notice, .k-toast, .k-toasts,
.k-badge, .k-accordion__trigger, .k-empty, .k-state, .k-state__search, .k-skip,
.k-pdp__cta {
  box-sizing: border-box;
}

/* ==========================================================================
   Focus — 08 "keyboard-operable, visibly focusable"
   ========================================================================== */
.k-btn:focus-visible,
.k-link:focus-visible,
.k-field__input:focus-visible,
.k-field__toggle:focus-visible,
.k-accordion__trigger:focus-visible,
.k-toast__close:focus-visible,
.k-crumbs a:focus-visible,
.k-size:focus-visible,
.k-empty a:focus-visible,
.k-state a:focus-visible,
.is-focus {
  outline: var(--k-focus-ring) solid var(--k-ink);
  outline-offset: var(--k-focus-offset);
}
/* On the dark surface the ring is Snow, or it is invisible (08 "visibly focusable"). */
.k-btn--primary:focus-visible,
.k-ref__frame--dark :focus-visible {
  outline-color: var(--k-snow);
}
/* THE TOAST IS GLASS NOW (J-37, RC-136), so its ring is Ink. It was Snow for
   the dark toast, and a Snow ring on a near-white surface is no ring at all —
   Dismiss and Undo would have been focusable and invisible (08, SC 2.4.7). The
   Run 38 review found it. */
.k-toast :focus-visible,
.k-toast .is-focus {
  outline: var(--k-focus-ring) solid var(--k-ink);
  outline-offset: var(--k-focus-offset);
}
/* The primary button sits on the page: its ring is Ink, offset outside the Ink fill. */
.k-btn--primary:focus-visible { outline-color: var(--k-ink); outline-offset: var(--k-focus-offset); }

/* ==========================================================================
   Buttons
   --------------------------------------------------------------------------
   Two variants. No text-transform (FONTS §06); type is T6 by class. Loading
   swaps the label for "Processing…" and sets aria-busy — no spinner (57.8).
   ========================================================================== */
.k-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--k-space-2);
  min-height: var(--k-touch-min);
  min-width: var(--k-touch-min);
  padding: var(--k-space-3) var(--k-space-5);
  border: var(--k-hairline) solid transparent;
  border-radius: var(--k-radius-none);
  font-family: var(--k-t6-family);
  font-size: var(--k-t6-size);
  line-height: var(--k-t6-lh);
  letter-spacing: var(--k-t6-track);
  font-weight: var(--k-t6-weight);
  text-transform: var(--k-t6-transform);
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--k-motion-instant) var(--k-ease-calm),
              color var(--k-motion-instant) var(--k-ease-calm),
              border-color var(--k-motion-instant) var(--k-ease-calm);
}
.k-btn--primary { background: var(--k-ink); color: var(--k-snow); border-color: var(--k-ink); }
.k-btn--primary:hover, .k-btn--primary.is-hover { background: var(--k-graphite); border-color: var(--k-graphite); }
.k-btn--primary:active, .k-btn--primary.is-active { background: var(--k-ink); border-color: var(--k-ink); }
.k-btn--secondary { background: transparent; color: var(--k-ink); border-color: var(--k-ink); }
.k-btn--secondary:hover, .k-btn--secondary.is-hover { background: var(--k-ink); color: var(--k-snow); }
.k-btn--secondary:active, .k-btn--secondary.is-active { background: var(--k-graphite); border-color: var(--k-graphite); color: var(--k-snow); }
.k-btn:disabled, .k-btn.is-disabled {
  background: var(--k-surface-sunken);
  color: var(--k-graphite);
  border-color: var(--k-mist);
  cursor: not-allowed;
}
/* Loading: the label stays in flow and in the accessibility tree (it keeps the
   control's name and its geometry — FONTS §08 "Skeleton or pending state must
   reserve the final text geometry"); it is made transparent and the
   "Processing…" text is laid over it, aria-hidden. Never a spinner (57.8). */
.k-btn { position: relative; }
.k-btn__loading { display: none; }
.k-btn.is-loading, .k-btn[aria-busy="true"] { pointer-events: none; }
.k-btn.is-loading .k-btn__label, .k-btn[aria-busy="true"] .k-btn__label { color: transparent; }
.k-btn.is-loading .k-btn__loading, .k-btn[aria-busy="true"] .k-btn__loading {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  inset: 0;
}

/* ==========================================================================
   Text link
   ========================================================================== */
.k-link {
  color: var(--k-ink);
  text-decoration: underline;
  text-decoration-thickness: var(--k-hairline);
  text-underline-offset: 0.15em;
  transition: color var(--k-motion-instant) var(--k-ease-calm);
}
.k-link:hover, .k-link.is-hover { color: var(--k-graphite); }
.k-link.is-disabled, .k-link[aria-disabled="true"] { color: var(--k-graphite); pointer-events: none; text-decoration: none; }
/* A standalone link (not in running text) reserves the 44px target (08). */
.k-link--standalone {
  display: inline-flex;
  align-items: center;
  min-height: var(--k-touch-min);
  min-width: var(--k-touch-min);
}

/* ==========================================================================
   Fields and inline errors — 57.4
   --------------------------------------------------------------------------
   "Beneath the field; error colour token at AA; icon + text; aria-describedby
   and aria-invalid; focus moves to the first invalid field on submit."
   forms.js applies aria-invalid, wires aria-describedby and moves focus.
   ========================================================================== */
.k-field { display: flex; flex-direction: column; gap: var(--k-space-2); max-width: var(--k-measure); }
.k-field__label { color: var(--k-ink); }
.k-field__input {
  width: 100%;
  min-height: var(--k-touch-min);
  padding: var(--k-space-2) var(--k-space-3);
  min-width: 0;
  color: var(--k-ink);
  background: var(--k-surface-raised);
  border: var(--k-hairline) solid var(--k-border-control); /* WCAG 1.4.11: a control boundary at 3:1 */
  border-radius: var(--k-radius-none);
  transition: border-color var(--k-motion-instant) var(--k-ease-calm), box-shadow var(--k-motion-instant) var(--k-ease-calm);
}
.k-field__input:hover, .k-field__input.is-hover { border-color: var(--k-ink); }
.k-field__input:disabled, .k-field__input.is-disabled { background: var(--k-surface-sunken); color: var(--k-graphite); cursor: not-allowed; }
.k-field__input::placeholder { color: var(--k-graphite); opacity: 1; }
.k-field__hint { color: var(--k-graphite); }
.k-field.is-error .k-field__input,
.k-field__input[aria-invalid="true"] { border-color: var(--k-status-error); box-shadow: inset 0 0 0 var(--k-hairline) var(--k-status-error); } /* no width change, no reflow (FONTS §08) */
.k-field__error {
  display: none;
  align-items: flex-start;
  gap: var(--k-space-2);
  margin: 0;
  color: var(--k-status-error);
}
.k-field.is-error .k-field__error { display: flex; }
.k-field__error-icon {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25em;
  height: 1.25em;
  border-radius: var(--k-radius-round);
  background: var(--k-status-error);
  color: var(--k-snow);
  /* v4.0 §03 has no 600 weight; the three glyph icons in this sheet take the
     nearest approved role weight, Medium 500. */
  font-weight: var(--kr-medium-weight);
}
/* Password show/hide (21.4) — a real button, labelled, inside the field row. */
.k-field__row { position: relative; display: flex; align-items: stretch; }
.k-field__row .k-field__input { flex: 1 1 auto; }
.k-field__toggle {
  flex: none;
  min-width: var(--k-touch-min);
  border: var(--k-hairline) solid var(--k-border-control);
  border-left: 0;
  background: var(--k-surface-raised);
  color: var(--k-ink);
  cursor: pointer;
}
.k-field__toggle[aria-pressed="true"] { background: var(--k-ink); color: var(--k-snow); }

/* ==========================================================================
   Notice (inline, blocking or informational) and toast — 57.5
   --------------------------------------------------------------------------
   Toast: "above the dock on mobile and top-centre on desktop; dismissible;
   auto-dismiss 6 seconds except for errors, which persist until dismissed;
   role=status or role=alert as appropriate." toast.js owns roles and timing.
   ========================================================================== */
.k-notice {
  display: flex;
  align-items: flex-start;
  gap: var(--k-space-3);
  padding: var(--k-space-3) var(--k-space-4);
  border: var(--k-hairline) solid var(--k-stone);
  background: var(--k-surface-raised);
  color: var(--k-ink);
  max-width: var(--k-measure);
}
.k-notice p { margin: 0; }
.k-notice__icon {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5em;
  height: 1.5em;
  border-radius: var(--k-radius-round);
  font-weight: var(--kr-medium-weight);
  background: var(--k-ink);
  color: var(--k-snow);
}
.k-notice--error   { background: var(--k-status-error-surface);   border-color: var(--k-status-error); }
.k-notice--error   .k-notice__icon { background: var(--k-status-error); }
.k-notice--success { background: var(--k-status-success-surface); border-color: var(--k-status-success); }
.k-notice--success .k-notice__icon { background: var(--k-status-success); }
.k-notice--warning { background: var(--k-status-warning-surface); border-color: var(--k-status-warning); }
.k-notice--warning .k-notice__icon { background: var(--k-status-warning); }
.k-notice--info    { background: var(--k-status-info-surface);    border-color: var(--k-status-info); }
.k-notice--info    .k-notice__icon { background: var(--k-status-info); }

.k-toasts {
  position: fixed;
  left: var(--k-gutter-mobile);
  right: var(--k-gutter-mobile);
  bottom: calc(var(--k-dock-h) + var(--k-dock-bottom) + var(--k-space-3) + env(safe-area-inset-bottom));
  z-index: var(--k-z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--k-space-2);
  pointer-events: none;
}
.k-toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: var(--k-space-3);
  padding: var(--k-space-3) var(--k-space-4);
  /*
   * GLASS, AND THEREFORE INK — J-37, RC-136. The toast was the one dark
   * floating surface on the site; "every overlay" is glass and there is one
   * glass, so it is the light one (tokens.css) and its words are Ink. The
   * status stays where 02 requires it — the icon and the words — and in the
   * left bar, whose four status colours clear 3:1 on glass over black at 80%
   * (the neutral bar is Ink now: a Snow bar on a near-white surface was not
   * a bar). A hairline closes the other three sides, as the dock's does.
   */
  color: var(--k-ink);
  border: var(--k-glass-hairline);
  border-left: var(--k-space-1) solid var(--k-ink);
  max-width: var(--k-measure);
  margin: 0 auto;
  width: 100%;
}
.k-toast p { margin: 0; flex: 1 1 auto; }
.k-toast--error   { border-left-color: var(--k-status-error); }
.k-toast--success { border-left-color: var(--k-status-success); }
.k-toast--warning { border-left-color: var(--k-status-warning); }
.k-toast--info    { border-left-color: var(--k-status-info); }
.k-toast__icon { flex: none; font-weight: var(--kr-medium-weight); }
.k-toast .k-link, .k-toast__undo { color: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; min-height: var(--k-touch-min); }
/* A toast emitted outside the region by a pre-V6 script (components.js /
   wishlist.js .k-toast--live) is positioned exactly like the region until
   those surfaces are rebuilt at steps 5–8. */
.k-toast--live {
  position: fixed;
  left: var(--k-gutter-mobile);
  right: var(--k-gutter-mobile);
  bottom: calc(var(--k-dock-h) + var(--k-dock-bottom) + var(--k-space-3) + env(safe-area-inset-bottom));
  z-index: var(--k-z-toast);
  width: auto;
}
.k-toast__close {
  flex: none;
  min-width: var(--k-touch-min);
  min-height: var(--k-touch-min);
  margin: calc(var(--k-space-3) * -1) calc(var(--k-space-4) * -1) calc(var(--k-space-3) * -1) 0;
  background: none;
  border: 0;
  color: inherit;
  cursor: pointer;
}
@media (min-width: 768px) {
  .k-toasts,
  .k-toast--live {
    left: 50%;
    right: auto;
    bottom: auto;
    top: var(--k-space-4);
    transform: translateX(-50%);
    width: min(100% - var(--k-gutter-desktop) * 2, var(--k-measure));
  }
}

/* ==========================================================================
   Price and sale state — 7.7 "Sale state shows original price struck through
   plus reduced price"; FONTS §08 Sale "Old/new price relationship,
   strike-through and hierarchy are part of typography".
   ========================================================================== */
.k-price { white-space: nowrap; }
.k-price__was { text-decoration: line-through; color: var(--k-graphite); }
.k-price__now { color: var(--k-ink); }

/* ==========================================================================
   Skeletons — 57.8
   --------------------------------------------------------------------------
   "Skeletons for collection cards, PDP gallery frames and order cards using
   neutral surface tokens; no spinners on primary surfaces; reduced motion
   removes shimmer." Geometry is reserved by aspect-ratio or line count; the
   shimmer is a background-position loop that reduced motion stops.
   ========================================================================== */
.k-skeleton {
  position: relative;
  overflow: hidden;
  background: var(--k-surface-skeleton);
  background-image: linear-gradient(90deg, transparent 0%, var(--k-surface-skeleton-shine) 50%, transparent 100%);
  background-size: 200% 100%;
  animation: k-shimmer var(--k-motion-reveal) linear infinite;
}
@keyframes k-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
/*
 * .k-skeleton--card RESERVES THE BASE CARD'S SHAPE, AND UNTIL RUN 52 IT
 * RESERVED THE PDP'S. It read --k-ratio-frame, the PDP gallery frame, which has
 * never been any card's shape, so this box advertised 0.722789 and matched the
 * card it stands for at neither width. The stale "F-01 may re-measure" comment
 * is what is left of the guess.
 *
 * THE BASE CARD, NOT THE COLLECTION, AND THE DIFFERENCE MATTERS. collection.css
 * holds two card rules. The base one — .k-pcard__frame / .k-pcard__empty, 1:1
 * with a 4:5 override from 768 (F-01 measured; the switch placed at 768 because
 * the reference's own boundary was never measured) — "governs every card surface
 * except the collection": the 50.5 wishlist, the 57.6 search results, the 51.5
 * Vault listing and the 24 rail. The collection has its own .k-col-scoped rule at
 * 4:5 for EVERY width, from owner ruling J-41.1 (1 October 2026, RC-150), which is
 * the ruling that removed 1:1 from it: "the same shape at 375 as at 1440".
 *
 * So these two regimes are the BASE card's. A generic card skeleton on the
 * component reference sheet is what this is, and the base card is what it stands
 * for. Do NOT carry this pair onto .k-col when token-ising it — that reinstates
 * the regime J-41.1 retired.
 *
 * It surfaces only on patterns/v6-components.php, the internal component
 * reference sheet — no customer route renders it — so this was a reference
 * sheet mislabelling a card, not a layout shift anybody saw. J-49 is what
 * forced the issue: one token cannot be both the PDP frame and the card
 * skeleton once the two differ, and left alone this box would have followed
 * the PDP to 3:4 and been wrong by a different margin.
 *
 * The literals mirror collection.css, which stays the source of truth for the
 * card; token-ising the pair is registered as a follow-up rather than done
 * here, because it would mean editing the collection's own sheet in a run
 * whose remit is the PDP frame. Recorded in resolved-conflicts.md RC-200.
 */
.k-skeleton--card  { aspect-ratio: 1 / 1; }                       /* the BASE card below 768 (F-01) */
@media (min-width: 768px) { .k-skeleton--card { aspect-ratio: 4 / 5; } }  /* and from 768 */
.k-skeleton--frame { aspect-ratio: var(--k-ratio-frame); }        /* PDP gallery/detail/flat outer frame, 3:4 since J-49 */
.k-skeleton--hero-mobile  { aspect-ratio: var(--k-ratio-hero-mobile); }
.k-skeleton--hero-desktop { aspect-ratio: var(--k-ratio-hero-desktop); }
.k-skeleton--text  { height: 1em; width: 100%; }
.k-skeleton--line  { height: 1em; width: 60%; }
.k-skeleton--order { min-height: calc(var(--k-touch-min) * 2); }  /* order card (22.2) */
@media (prefers-reduced-motion: reduce) { .k-skeleton { animation: none; background-image: none; } }

/* ==========================================================================
   Badges — dock/wishlist count (10, 41.6) and Section 46 state labels
   --------------------------------------------------------------------------
   Text is always present; colour is never the only carrier (02).
   ========================================================================== */
.k-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--k-space-1);
  padding: var(--k-space-1) var(--k-space-2);
  border: var(--k-hairline) solid var(--k-ink);
  background: var(--k-surface-raised);
  color: var(--k-ink);
  font-family: var(--k-t8-family);
  font-size: var(--k-t8-size);
  line-height: var(--k-t8-lh);
  letter-spacing: var(--k-t8-track);
  white-space: nowrap;
}
.k-badge--solid   { background: var(--k-ink); color: var(--k-snow); }
.k-badge--error   { border-color: var(--k-status-error);   color: var(--k-status-error);   background: var(--k-status-error-surface); }
.k-badge--success { border-color: var(--k-status-success); color: var(--k-status-success); background: var(--k-status-success-surface); }
.k-badge--warning { border-color: var(--k-status-warning); color: var(--k-status-warning); background: var(--k-status-warning-surface); }
.k-badge--info    { border-color: var(--k-status-info);    color: var(--k-status-info);    background: var(--k-status-info-surface); }
/* Count badge: visible text capped "9+" (10), true count in a visually hidden span. */
.k-badge--count {
  min-width: 1.5em;
  height: 1.5em;
  padding: 0 var(--k-space-1);
  justify-content: center;
  border-radius: var(--k-radius-pill);
  background: var(--k-ink);
  color: var(--k-snow);
  border-color: var(--k-ink);
}

/* ==========================================================================
   Accordion — the disclosure primitive Section 20.1 consumes at step 8
   ========================================================================== */
.k-accordion { border-top: var(--k-border-hairline); max-width: var(--k-measure); }
.k-accordion__item { border-bottom: var(--k-border-hairline); }
.k-accordion__trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--k-space-4);
  width: 100%;
  min-height: var(--k-touch-min);
  padding: var(--k-space-4) 0;
  background: none;
  border: 0;
  color: var(--k-ink);
  text-align: left;
  cursor: pointer;
}
.k-accordion__trigger:hover, .k-accordion__trigger.is-hover { color: var(--k-graphite); }
.k-accordion__trigger:disabled { color: var(--k-graphite); cursor: not-allowed; }
.k-accordion__chevron { flex: none; width: var(--k-icon); height: var(--k-icon); transition: transform var(--k-motion-quick) var(--k-ease-calm); }
.k-accordion__trigger[aria-expanded="true"] .k-accordion__chevron { transform: rotate(180deg); }
.k-accordion__panel { padding: 0 0 var(--k-space-5); color: var(--k-graphite); }
.k-accordion__panel[hidden] { display: none; }

/* ==========================================================================
   Breadcrumb — 55.7
   --------------------------------------------------------------------------
   "Rendered above the heading in the copy zone; BreadcrumbList schema
   matches." The schema is emitted by the Core Plugin from the same trail.
   ========================================================================== */
.k-crumbs { margin: 0 0 var(--k-space-4); }
.k-crumbs ol { display: flex; flex-wrap: wrap; gap: var(--k-space-2); list-style: none; margin: 0; padding: 0; }
.k-crumbs li { display: inline-flex; align-items: center; gap: var(--k-space-2); color: var(--k-graphite); }
.k-crumbs__sep { color: var(--k-graphite); }
.k-crumbs a { color: var(--k-ink); text-decoration: none; min-height: var(--k-touch-min); display: inline-flex; align-items: center; }
.k-crumbs a:hover { text-decoration: underline; }
.k-crumbs [aria-current="page"] { color: var(--k-graphite); }

/* ==========================================================================
   Empty states — 57.7
   ========================================================================== */
.k-empty {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--k-space-4);
  padding: var(--k-space-7) var(--k-gutter-mobile);
  max-width: var(--k-measure);
}
.k-empty__title { margin: 0; }
.k-empty__links { display: flex; flex-wrap: wrap; gap: var(--k-space-3); }

/* ==========================================================================
   Global state pages — 57.1 (404) and 57.2 (maintenance)
   --------------------------------------------------------------------------
   Wordmark, one line, links. Maintenance has no navigation at all.
   ========================================================================== */
.k-state {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--k-space-5);
  padding: var(--k-space-8) var(--k-gutter-mobile) calc(var(--k-page-pad-bottom) + var(--k-space-8));
  background: var(--k-surface-page);
  color: var(--k-ink);
  text-align: center;
}
/*
 * THE INK SITS INSIDE ITS OWN BOX — Run 38 CP3b, RC-138. The owner's report:
 * the crown is cut off on the right in the dock. Measured, it was: ten
 * consecutive rows ending at one column in his capture, fifteen at 390@3x on
 * staging, where the same ball drawn unclipped peaks over six.
 *
 * THE CAUSE, OF THE FOUR THE BRIEF NAMED, WAS THE FIRST. The drawings' viewBox
 * is the ink plus a half-unit bleed (assets/brand/MANIFEST.json) — 0.02px at
 * the dock's 51px — and an inline <svg> clips to its viewport by user-agent
 * default (`svg:not(:root) { overflow: hidden }`). The antialiased edge
 * reaches ~0.6px past the geometry, so the viewport cropped it, on whichever
 * side the sub-pixel phase put the edge. NOT an ancestor's overflow (every
 * ancestor computes visible), NOT the 2.64px optical translate (removing it
 * left the fifteen rows exactly as they were), NOT the sizing path (38.52 x 51
 * in both engines, with or without a declared width). Both marks did it: the
 * wordmark lost its right edge at every desktop width at 1x and its left at
 * 2x.
 *
 * THE REPAIR IS TO THE CAUSE. Nothing scales the mark down and nothing nudges
 * it — either would move the cut rather than remove it. overflow: visible lets
 * the renderer paint the edge it draws; the padding gives that edge room INSIDE
 * the element's own box, on all four sides, so the ink never touches the box
 * and nothing is left for a clip to take. content-box is written out because
 * it is what keeps the height tokens meaning the DRAWING: --k-dock-home-h is
 * still 51px of crowned-K (J-15's 75%) and --k-wordmark-h-* still 18/22px of
 * wordmark (40.5, 40.8); the box grows by the margin around them.
 *
 * `svg.` ONLY: the load-failure placeholder is text, has no viewport and no
 * clip, and its box is decided by the flex rules in chrome.css.
 *
 * HERE, NOT IN chrome.css — found by the Run 38 review. The pre-launch front
 * door, the maintenance page and the 404/global states are standalone
 * documents that load tokens, fonts and primitives (inc/states.php) and never
 * chrome.css, and each shows the wordmark at 18/22px (.k-state__wordmark, below).
 * Written in chrome.css, the repair missed the one page every anonymous
 * visitor sees pre-launch.
 */
svg.k-mark {
  box-sizing: content-box;
  overflow: visible;
  padding: var(--k-mark-raster-margin);
}

.k-state__wordmark { display: inline-flex; text-decoration: none; color: inherit; }
.k-state__wordmark svg { height: var(--k-wordmark-h-mobile); width: auto; }
.k-state__title { margin: 0; }
/* The front door's second line (K-27, Run 91): body type, inherited; no margin of its own, the column's gap spaces it. */
.k-state__body { margin: 0; max-width: var(--k-measure); }
.k-state__links { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--k-space-3); }
.k-state__search { width: 100%; max-width: var(--k-measure); display: flex; flex-wrap: wrap; gap: var(--k-space-2); }
.k-state__search .k-field { flex: 1 1 12rem; min-width: 0; }
@media (min-width: 768px) {
  .k-state { padding-left: var(--k-gutter-desktop); padding-right: var(--k-gutter-desktop); }
  .k-state__wordmark svg { height: var(--k-wordmark-h-desktop); }
}

/* ==========================================================================
   Body ground and base type (6.3 surface; FONTS §04 body = T7)
   ========================================================================== */
body {
  background: var(--k-surface-page);
  color: var(--k-ink);
  font-family: var(--k-t7-family);
  font-size: var(--k-t7-size);
  line-height: var(--k-t7-lh);
  margin: 0;
}
