/* =========================================================
   DayOne Design System — verbatim from Claude Design prototype
   Loaded as a static file in Storybook to guarantee exact match.
   ========================================================= */

/* The two families, self-hosted from /fonts (apps/web/public/fonts). These are
   the exact variable files Google Fonts serves, split the same way: a latin and
   a latin-ext file per style, each claiming its own unicode-range, so the
   browser downloads latin-ext only for text that needs it. Self-hosted because
   both the build (next/font/google) and this stylesheet used to fetch them from
   Google, and the Jenkins machine in Hangzhou reaches fonts.googleapis.com but
   not always fonts.gstatic.com, which failed main's web build. OFL 1.1, as
   assets/fonts/OFL.txt records. */
@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("/fonts/plus-jakarta-sans-latin-ext.woff2") format("woff2");
  unicode-range:
    U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308,
    U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113,
    U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("/fonts/plus-jakarta-sans-latin.woff2") format("woff2");
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304,
    U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: italic;
  font-weight: 200 800;
  font-display: swap;
  src: url("/fonts/plus-jakarta-sans-italic-latin-ext.woff2") format("woff2");
  unicode-range:
    U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308,
    U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113,
    U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: italic;
  font-weight: 200 800;
  font-display: swap;
  src: url("/fonts/plus-jakarta-sans-italic-latin.woff2") format("woff2");
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304,
    U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("/fonts/jetbrains-mono-latin-ext.woff2") format("woff2");
  unicode-range:
    U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308,
    U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113,
    U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("/fonts/jetbrains-mono-latin.woff2") format("woff2");
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304,
    U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  font-family: var(--font-sans);
  font-size: var(--fs-16);
  line-height: var(--lh-normal);
  color: var(--fg-1);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  margin: 0;
}

::selection {
  background: var(--brand-200);
  color: var(--fg-1);
}

*:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  position: relative;
  align-items: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-size: 13.5px;
  font-weight: 500;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 8px 14px;
  cursor: pointer;
  background: transparent;
  color: var(--fg-1);
  transition: background var(--t) var(--ease), border-color var(--t) var(--ease), transform 60ms
    var(--ease);
  white-space: nowrap;
  text-decoration: none;
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.btn:active:not(:disabled) {
  transform: translateY(1px);
}

/* ---- The pending state (button-pending-state) ----
   Keyed on the attribute rather than on the component, so a raw `.btn` that
   sets aria-busy gets the affordance with no markup of its own. The wrapper
   generates no box, so an icon-and-label button keeps its `gap` in both
   states, and it is hidden by `visibility` so it keeps its space and the
   button keeps its idle width. The spinner is out of flow, centred over the
   hidden content, in the button's own foreground colour. Declared identically
   in app/components.css. */
/* An `.iconbtn` opts in with the `busy-spinner` class and its glyph wrapped in
   `.btn-content` (the orders row strip's download entry, order-shipment-
   documents); a busy `.iconbtn` without them keeps its glyph and no spinner. */
.btn-content {
  display: contents;
}
/* A pending button is not a refused one. `.btn:disabled` dims to 0.5 and
   `pending` sets `disabled`, so without this the spinner is drawn at half
   opacity inside a washed-out button -- on ghost and secondary the ring
   became almost invisible in the browser pass. The dim says "you may not",
   the spinner says "wait"; only the second is true here. */
.btn[aria-busy="true"]:disabled,
.iconbtn.busy-spinner[aria-busy="true"]:disabled {
  /* The spinner's containing block; `.btn` is positioned already. */
  position: relative;
  opacity: 1;
  cursor: progress;
}

.btn[aria-busy="true"] .btn-content,
.iconbtn.busy-spinner[aria-busy="true"] .btn-content {
  visibility: hidden;
}
.btn[aria-busy="true"]::after,
.iconbtn.busy-spinner[aria-busy="true"]::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 14px;
  height: 14px;
  border: 2px solid color-mix(in srgb, currentcolor 30%, transparent);
  border-top-color: currentcolor;
  border-radius: 999px;
  animation: dayone-spin 700ms linear infinite;
}

.btn.primary {
  background: var(--accent);
  color: var(--on-accent);
}
.btn.primary:hover:not(:disabled) {
  background: var(--accent-hover);
}

/* Shopify brand fill — the literal green is third-party brand colour, not a
   DayOne ramp value, so it stays out of the token files on purpose. */
.btn.shopify {
  background: #96bf48;
  border-color: #96bf48;
  color: #fff;
}
.btn.shopify:hover:not(:disabled) {
  background: #86ac40;
  border-color: #86ac40;
}

.btn.secondary {
  background: var(--bg-1);
  border-color: var(--border);
  color: var(--fg-1);
}
.btn.secondary:hover:not(:disabled) {
  background: var(--bg-2);
}

/* Filters button while filters are on. Same three declarations as
   .filter-chip, so the control and the chips it produced read as one set.
   Orders, tickets, invoices and inventory all already emit `active` on this
   button from their own activeFiltersCount; the class was inert until now. */
.btn.secondary.active {
  background: var(--accent-soft);
  border-color: color-mix(in oklch, var(--accent) 28%, transparent);
  color: var(--accent-press);
}
/* Load-bearing, not a nicety. `.btn.secondary:hover:not(:disabled)` above is
   four classes and the rule beside it is three, so without this the ordinary
   grey hover background outranks the tint and the control half-reverts under
   the pointer - accent border and accent text over a grey fill - for exactly
   as long as the reader is aiming at the control they are about to click.
   Deepening the tint rather than restoring it also keeps hover feedback. */
.btn.secondary.active:hover:not(:disabled) {
  background: color-mix(in oklch, var(--accent) 14%, var(--bg-1));
}

.btn.ghost:hover:not(:disabled) {
  background: var(--bg-2);
}

.btn.destructive {
  color: var(--danger);
  border-color: var(--danger-soft);
  background: var(--bg-1);
}
.btn.destructive:hover:not(:disabled) {
  background: var(--danger-soft);
}

/* The solid destructive fill, for an irreversible action that must not read
   as a secondary control (affiliate-remove-referer, TapD 1003379). */
.btn.danger {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}
.btn.danger:hover:not(:disabled) {
  background: color-mix(in oklch, var(--danger) 85%, black);
  border-color: color-mix(in oklch, var(--danger) 85%, black);
}

.btn.accent-outline {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--bg-1);
}
.btn.accent-outline:hover:not(:disabled) {
  background: var(--accent-soft);
}

.btn.sm {
  font-size: 12.5px;
  padding: 6px 10px;
  gap: 6px;
}
.btn.xs {
  font-size: 12px;
  padding: 4px 8px;
  gap: 5px;
  border-radius: 6px;
}
.btn.icononly {
  padding: 8px;
}

/* ---------- Badges ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--bg-2);
  color: var(--fg-2);
  white-space: nowrap;
}
.badge .bdot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.9;
  flex-shrink: 0;
}

.badge.muted {
  background: var(--bg-2);
  color: var(--fg-2);
}
/* UFPS-06 client-status tones (replace-ticket-vocabulary-ufps06):
   pending ← pendingDayone #FBBF24, client-pending ← pendingFinalClient
   #EC4899, neutral ← the muted grey for the Status unavailable fallback. */
.badge.pending {
  background: var(--pending-soft);
  color: var(--pending);
}
.badge.client-pending {
  background: var(--client-pending-soft);
  color: var(--client-pending);
}
.badge.neutral {
  background: var(--bg-2);
  color: var(--fg-2);
}
.badge.brand {
  background: var(--accent-soft);
  color: var(--accent-press);
}
.badge.success {
  background: var(--success-soft);
  color: var(--success);
}
.badge.warning {
  background: var(--warning-soft);
  color: var(--warning);
}
.badge.warning-solid {
  background: var(--warning);
  color: #fff;
}
.badge.danger {
  background: var(--danger-soft);
  color: var(--danger);
}
.badge.info {
  background: var(--info-soft);
  color: var(--info);
}
.badge.ink {
  background: var(--cream-900);
  color: var(--fg-inverse);
}
.badge.outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--fg-2);
}

.badge.lc-new {
  background: #eef2f6;
  color: #465a77;
}
.badge.lc-processing {
  background: #e8e4f5;
  color: #5b4691;
}
.badge.lc-intransit {
  background: #e7f0f1;
  color: #2e6468;
}
.badge.lc-ofd {
  background: #e0ece4;
  color: #2d6c4c;
}
.badge.lc-delivered {
  background: var(--success-soft);
  color: var(--success);
}
.badge.lc-returned {
  background: var(--warning-soft);
  color: var(--warning);
}
.badge.lc-cancelled {
  background: var(--bg-2);
  color: var(--fg-3);
  text-decoration: line-through;
}

/* ---------- Cards ---------- */
.card {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
}
.card.flat {
  padding: 0;
  overflow: hidden;
}
.card.tinted {
  background: var(--cream-50);
}
.card.section {
  padding: 14px 16px;
}

/* ---------- Ticket detail layout ---------- */
.detail-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}
.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 18px;
  align-items: start;
}
.detail-main {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.detail-rail {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.section-head {
  display: flex;
  align-items: center;
  gap: 7px;
  font-weight: 600;
  font-size: 13.5px;
  margin-bottom: 10px;
}
@media (max-width: 1023px) {
  .detail-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
/* A ticket comment's text. A comment the ERP's rich-text editor wrote carries
   paragraphs, lists and bold; the stored markup carries no class, so the
   rules are descendant rules, sized to the thread rather than to an article. */
.ticket-comment-body {
  font-size: 13.5px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.ticket-comment-body p,
.ticket-comment-body ul,
.ticket-comment-body ol {
  margin: 0 0 6px;
}
.ticket-comment-body > *:last-child {
  margin-bottom: 0;
}
.ticket-comment-body ul,
.ticket-comment-body ol {
  padding-left: 20px;
}
.ticket-comment-body ul {
  list-style: disc;
}
.ticket-comment-body ol {
  list-style: decimal;
}
.ticket-comment-body li > p {
  margin: 0;
}
.ticket-comment-body strong {
  font-weight: 700;
}
.ticket-comment-body a {
  color: var(--accent);
  text-decoration: underline;
}
/* Ticket attachments (ticket-create-attachments, TapD 1003808). The grid of
   thumbnails and file links under the Description card's text (design D11),
   and the New Ticket modal's file list, above its add control, with one state
   text and, for an image, a local preview per row (design D10). */
.ticket-attachments {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-start;
}
.ticket-attachment-thumb {
  display: block;
  width: 96px;
  height: 96px;
  object-fit: cover;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--cream-50);
}
.ticket-attachment-file {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  color: var(--fg-1);
  text-decoration: none;
  word-break: break-all;
}
.ticket-attachment-file:hover {
  border-color: var(--accent);
}
.attachment-list {
  list-style: none;
  margin: 0 0 8px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.attachment-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px 6px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
}
.attachment-row-preview {
  flex: none;
  width: 32px;
  height: 32px;
  object-fit: cover;
  border-radius: 4px;
  background: var(--cream-50);
}
.attachment-row-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.attachment-row-state {
  font-size: 12px;
  color: var(--fg-3);
}
.attachment-row-state.failed {
  color: var(--danger);
}
/* Ticket detail tile-and-title row: the tile sizes to the title block's
   height through the grid row (a flex item settles its width before the
   stretch, so aspect-ratio never transfers). Only the family tint stays
   inline (ticket-header-and-assignee-popover design contract). */
.detail-head-title {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: 12px;
}
.detail-head-tile {
  display: flex;
  align-items: center;
  justify-content: center;
  height: min(100%, 60px);
  aspect-ratio: 1;
  border-radius: 12px;
}
/* Trailing header field group — bottom-aligned like the prototype's
   (ticket-detail-remaining-ui D10; jsdom performs no layout, so this
   declaration is the assertable form of the alignment). */
.detail-head-fields {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}
/* Bottom alignment alone is insufficient: the assignee slot's shared .field
   carries margin-bottom: 14px INSIDE its box, lifting its control off the
   shared baseline. Zeroed here only — the margin is correct everywhere else. */
.detail-head-fields .field {
  margin-bottom: 0;
}
/* Badge row under the ticket detail title. */
.chip-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 10px;
}
/* Key/value rail row — the prototype's kvRow (Parties & source, Related records). */
.kv-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.kv-row:last-child {
  border-bottom: none;
}

/* ---------- Inputs ---------- */
.input {
  width: 100%;
  font-family: var(--font-sans);
  font-size: 14px;
  padding: 9px 12px;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--fg-1);
  /* Explicit, because the class is worn by more than <input>. A <button> wearing
     .input keeps the UA default text-align:center and reads as a different
     control from the <input> beside it in the same row. */
  text-align: left;
  outline: none;
  transition: border-color var(--t) var(--ease), background var(--t) var(--ease);
}
.input::placeholder {
  color: var(--fg-3);
}
/* :focus-within: a box wearing .input around its own text input (the
   searchable field) shows the focus the inner input holds. */
.input:focus,
.input:focus-within {
  border-color: var(--ring);
}
.input:disabled {
  background: var(--bg-2);
  color: var(--fg-3);
  cursor: not-allowed;
}
/* Mirrors components.css: a select-like box hovers as the secondary button
   does, except while focused. */
.select-box:hover:not(:focus-within):not(:disabled) {
  background: var(--bg-2);
}
/* Mirrors components.css's `.input.sm` (the prototype's compact toolbar input).
   It must live here too: this sheet is unlayered, so `.input`'s padding above
   beats the layered copy and the compact box would keep the full height. */
.input.sm {
  font-size: 12.5px;
  padding: 6px 8px;
  border-radius: 6px;
}
.search-wrap .input.sm {
  padding-left: 32px;
}

/* ---------- Login screen ---------- */
.login-screen {
  position: fixed;
  inset: 0;
  background: var(--cream-100);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  gap: 22px;
  overflow: auto;
  z-index: 100;
}
.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-2);
  padding: 28px 28px 22px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}
.login-brand {
  display: flex;
  justify-content: center;
  margin-bottom: 6px;
}
.login-logo {
  max-width: 260px;
  width: 100%;
  height: auto;
  display: block;
}
.login-sub {
  text-align: center;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 14.5px;
  color: var(--fg-2);
  margin-bottom: 22px;
}
.login-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.login-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.login-label {
  font-size: 12px;
  color: var(--fg-2);
  font-weight: 500;
  letter-spacing: 0.01em;
}
.login-input-wrap {
  position: relative;
}
.login-input {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--cream-50);
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--fg-1);
  transition: border-color var(--t) var(--ease), background var(--t) var(--ease);
}
.login-input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--bg-1);
  box-shadow: 0 0 0 3px color-mix(in oklch, var(--accent) 18%, transparent);
}
.login-input-wrap .login-input {
  padding-right: 38px;
}
.login-eye {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 0;
  color: var(--fg-3);
  cursor: pointer;
  border-radius: 6px;
}
.login-eye:hover {
  background: var(--bg-2);
  color: var(--fg-1);
}
.login-submit {
  margin-top: 4px;
  padding: 11px 14px;
  background: var(--accent);
  color: var(--on-accent);
  border: 0;
  border-radius: 8px;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--t) var(--ease);
}
.login-submit:hover:not(:disabled) {
  background: var(--accent-hover);
}
.login-submit:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}
/* In flight, not refused: mirrors .btn[aria-busy="true"]:disabled. */
.login-submit[aria-busy="true"]:disabled {
  cursor: progress;
}
.login-forgot {
  margin: 10px auto 0;
  font-size: 12.5px;
  color: var(--fg-2);
  text-decoration: none;
  background: none;
  border: 0;
  padding: 0;
  font-family: inherit;
  cursor: pointer;
}
.login-forgot:hover {
  color: var(--accent);
}
.login-remember {
  display: flex;
  align-items: center;
}
.login-remember-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary, #6b7280);
  user-select: none;
}
.login-remember-label > label {
  flex: 1;
  cursor: pointer;
}
.login-links {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
}
.login-links a,
.login-links button {
  color: var(--fg-2);
  text-decoration: none;
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  cursor: pointer;
}
.login-links a:hover,
.login-links button:hover {
  color: var(--accent);
}
.login-links-sep {
  color: var(--fg-3);
}

/* ================================================================
   Shell — Sidebar, TopBar
   ================================================================ */
html,
body {
  height: 100%;
  margin: 0;
}

/* The shell root (announcement-reader-surfaces, TapD 1003071): the one column
   that owns the viewport. Its first child is the announcement strip, spanning
   the full window width above everything; its second is the shell proper, which
   takes whatever height the strip left. So the sidebar and the top bar both
   start BELOW the strip and the whole application is displaced by the strip's
   height -- an overlay would have put chrome behind it. With no strip the
   column holds the shell alone and the geometry is what it always was. */
.shell-root {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  min-height: 100dvh;
}
.shell-root .shell {
  flex: 1;
  height: auto;
  min-height: 0;
}

.shell {
  display: grid;
  grid-template-columns: 248px 1fr;
  /* A fixed row: an implicit auto row grows to the rail sidebar, which is
     overflow: visible, and pushes the account footer out of the window. */
  grid-template-rows: minmax(0, 1fr);
  height: 100dvh;
  min-height: 100dvh;
}

/* ---------- Sidebar ---------- */
.sidebar {
  background: var(--cream-50);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}
.sb-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 18px 16px;
}
.sb-logo {
  max-width: 200px;
  width: 100%;
  height: auto;
  display: block;
}

/* The picker's margins make the wordmark-to-picker gap equal the picker-to-
   "Work" gap (20px here, 16 and 12 at the density steps), in both states. */
.sb-shopswitch {
  margin: 4px 12px 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: background var(--t) var(--ease), border-color var(--t) var(--ease);
}
.sb-shopswitch:hover {
  background: var(--bg-2);
}
.sb-shopswitch .sb-shoplogo {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--brand-500);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 13px;
}
.sb-shopswitch .sb-shopmeta {
  flex: 1;
  min-width: 0;
}
.sb-shopswitch .sb-shopname {
  font-size: 13px;
  color: var(--fg-1);
  font-weight: 500;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}
.sb-shopswitch .sb-shopdomain {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--fg-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sb-nav {
  padding: 4px 8px;
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex: 1;
  overflow-y: auto;
}
/* Rows clip their own overflow, so left shrinkable they squash to fit a short
   window instead of letting the nav scroll. */
.sb-nav > * {
  flex-shrink: 0;
}
.sb-section {
  padding: 14px 12px 4px;
  font-size: 11px;
  color: var(--fg-3);
  letter-spacing: 0.02em;
}
/* The first label's top padding is the base the picker's bottom margin is
   measured against; change one and re-measure the other. */
.sb-nav .sb-section:first-child {
  padding-top: 7px;
}
.sb-nav a,
.sb-nav-stub {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--fg-1);
  font-size: 13.5px;
  font-weight: 450;
  cursor: pointer;
  transition: background var(--t) var(--ease), color var(--t) var(--ease);
}

.sb-nav-stub {
  width: 100%;
  background: transparent;
  border: 0;
  font-family: var(--font-sans);
  text-align: left;
}
/* A SOON entry is greyed, icon and label, so it reads as unavailable before
   it is hovered. The badge keeps its own colours. */
.sb-nav-stub,
.sb-nav-stub .sb-icon {
  color: var(--fg-3);
}
.sb-nav a .sb-dot {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-3);
}
.sb-nav a:hover {
  background: var(--bg-2);
}
/* The app's link hover tints the icon only; the active link keeps its own colours. */
.sb-nav a:not(.active):hover .sb-icon {
  color: var(--accent);
}
.sb-nav a.active {
  background: var(--bg-2);
  color: var(--fg-1);
}
.sb-nav a.active .sb-icon {
  color: var(--accent);
}
.sb-nav a.active .sb-dot {
  color: var(--accent);
  font-weight: 500;
}
.sb-icon {
  color: var(--fg-2);
  flex-shrink: 0;
}

.sb-footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  padding: 8px 8px 10px;
  position: relative;
}
.sb-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  cursor: pointer;
  transition: background var(--t) var(--ease);
}
.sb-user:hover {
  background: var(--bg-2);
}
.sb-avatar {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: var(--brand-500);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 13px;
  flex-shrink: 0;
}
.sb-userinfo {
  flex: 1;
  min-width: 0;
}
.sb-username {
  font-size: 13px;
  color: var(--fg-1);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sb-userscope {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--fg-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Short windows: the sidebar gives up density, in three cumulative steps,
   rather than scroll its nav. Thresholds are viewport heights measured with
   the announcement strip showing; the nav keeps overflow-y: auto only as a
   last resort below the third step. */
@media (max-height: 920px) {
  .sb-brand {
    padding: 14px 18px 10px;
  }
  .sb-shopswitch {
    margin-top: 6px;
    margin-bottom: 10px;
  }
  .sb-nav a,
  .sb-nav-stub,
  .sb-nav-disabled {
    padding: 5px 10px;
  }
  .sb-section {
    padding: 10px 12px 3px;
  }
  .sb-nav .sb-section:first-child {
    padding-top: 1px;
  }
}
@media (max-height: 820px) {
  .sb-brand {
    padding: 10px 18px 8px;
  }
  .sb-logo {
    max-width: 150px;
  }
  .sb-shopswitch {
    margin-top: 4px;
    margin-bottom: 7px;
    padding: 5px 10px;
  }
  .sb-nav a,
  .sb-nav-stub,
  .sb-nav-disabled {
    padding: 3px 10px;
  }
  .sb-section {
    padding: 6px 12px 2px;
    font-size: 10.5px;
  }
  .sb-nav .sb-section:first-child {
    padding-top: 0;
  }
  .sb-footer {
    padding: 4px 8px 6px;
  }
  .sb-user {
    padding: 5px 10px;
  }
}
/* The smallest step drops the section labels to hairline dividers. The text
   stays in the DOM at zero size, so the grouping is still announced. */
@media (max-height: 700px) {
  .sb-nav a,
  .sb-nav-stub,
  .sb-nav-disabled {
    padding: 2px 10px;
    font-size: 13px;
  }
  .sb-section {
    font-size: 0;
    line-height: 0;
    padding: 0;
    margin: 5px 10px;
    border-top: 1px solid var(--border);
  }
  .sb-nav .sb-section:first-child {
    border-top: 0;
    margin: 2px 10px;
  }
}

/* ---------- Top bar ---------- */
.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--bg);
  overflow: hidden;
}
.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 28px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  flex-shrink: 0;
}
.tb-crumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  color: var(--fg-2);
  min-width: 0;
  /* When the bar runs out of room the crumbs clip inside their own box
     instead of painting under the date. */
  overflow: hidden;
}
.tb-crumbs .sep {
  color: var(--fg-3);
}
.tb-crumbs .here {
  color: var(--fg-1);
  font-weight: 500;
}
/* A crumb can carry a record's own title (a Help Center article), so each
   one stays on a single line and only the current crumb truncates, instead
   of wrapping the top bar and squeezing the date (one-topbar-breadcrumb). */
.tb-crumbs > span {
  white-space: nowrap;
  flex-shrink: 0;
}
.tb-crumbs > .here {
  flex-shrink: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.topbar > .tb-iconbtn {
  flex-shrink: 0;
}
.tb-spacer {
  flex: 1;
}
.tb-date {
  font-family: var(--font-sans);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  color: var(--fg-3);
  font-weight: 500;
  /* One line: a long current crumb truncates rather than squeezing this. */
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: default;
}
/* The hover calendar's anchor. The margin moved here from .tb-date so the
   popover's right edge lines up with the date text. */
.tb-date-wrap {
  position: relative;
  margin-right: 10px;
}
/* The breadcrumb's anchor, for the full-trail popover below. */
.tb-crumbs-wrap {
  position: relative;
  display: flex;
  min-width: 0;
}
/* The whole trail, shown on hover or tap only while an ellipsis cuts it.
   Read-only like the calendar: the pointer passes through. */
.tb-crumbs-pop {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  z-index: 80;
  pointer-events: none;
  width: max-content;
  max-width: min(360px, calc(100vw - 32px));
  padding: 8px 12px;
  font-size: 13px;
  line-height: 1.4;
  color: var(--fg-1);
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 9px;
  box-shadow: var(--shadow-2);
  overflow-wrap: anywhere;
}
.tb-cal-pop {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 80;
  /* A read-only preview: the pointer passes straight through to whatever
     lies beneath (a page control under the top bar stays clickable), and
     leaving the date closes it. */
  pointer-events: none;
}
/* Wherever the sidebar has collapsed into the hamburger, the date shrinks to
   an icon button beside search, and the breadcrumb becomes one line that ends
   in an ellipsis. */
@media (max-width: 767px) {
  /* Both popovers hang from the bar's edges here, not from their trigger,
     so neither runs off a 320px screen. */
  .topbar {
    position: relative;
    padding: 12px 16px;
    gap: 10px;
  }
  .tb-crumbs-wrap,
  .tb-date-wrap {
    position: static;
  }
  .tb-crumbs-pop {
    left: 16px;
    top: calc(100% + 6px);
  }
  .tb-cal-pop {
    right: 16px;
    top: calc(100% + 6px);
  }
  .tb-crumbs {
    display: block;
    white-space: nowrap;
    text-overflow: ellipsis;
  }
  .tb-crumbs .sep {
    margin: 0 6px;
  }
  .tb-date-wrap {
    margin-right: 0;
  }
  .tb-date {
    width: 34px;
    height: 34px;
    justify-content: center;
    gap: 0;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: var(--bg-1);
    color: var(--fg-2);
  }
  .tb-date svg {
    width: 16px;
    height: 16px;
  }
  .tb-date-text {
    display: none;
  }
}
.tb-iconbtn {
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--bg-1);
  color: var(--fg-2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background var(--t) var(--ease), color var(--t) var(--ease);
}
.tb-iconbtn:hover {
  background: var(--bg-2);
  color: var(--fg-1);
}
.tb-iconbtn.active {
  background: var(--bg-2);
  color: var(--fg-1);
  border-color: var(--fg-2);
}
/* The relative box the badge anchors against. Load-bearing, not decoration:
   without it .tb-notif-dot positions against the page instead of the bell. */
.tb-iconbtn.ring {
  position: relative;
}
.tb-notif-dot {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--brand-500);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  line-height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg-1);
  letter-spacing: 0;
}

/* ---------- Notifications popover ---------- */
/* Anchored against the inline `position: relative` wrapper around the bell
   (topbar.tsx), exactly as in the prototype's Shell.jsx:269. */
.notif-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 380px;
  max-height: 560px;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(20, 14, 4, 0.12), 0 2px 6px rgba(20, 14, 4, 0.06);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 80;
}
.notif-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 14px 10px;
}
/* The tabs and the per-entry icon are NOT rendered by this change: they belong
   to the deferred Notifications page. Their rules ship here so that change does
   not have to reopen either stylesheet. */
.notif-tabs {
  display: flex;
  gap: 4px;
  padding: 0 10px 8px;
  border-bottom: 1px solid var(--border);
}
.notif-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 8px;
  border: 0;
  background: transparent;
  color: var(--fg-2);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
}
.notif-tab:hover {
  background: var(--bg-2);
  color: var(--fg-1);
}
.notif-tab.active {
  background: var(--accent-soft);
  color: var(--accent-press);
}
.notif-count {
  min-width: 18px;
  height: 16px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--brand-500);
  color: #fff;
  font-size: 10.5px;
  font-weight: 600;
  line-height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.notif-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 4px 0;
}
.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 12px 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  position: relative;
}
.notif-item:last-child {
  border-bottom: 0;
}
.notif-item:hover {
  background: var(--bg-2);
}
.notif-item.read .notif-title {
  color: var(--fg-2);
  font-weight: 400;
}
.notif-icon {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.notif-icon.tone-warn {
  background: #fff4e5;
  color: #b45309;
}
.notif-icon.tone-danger {
  background: #fdecec;
  color: #b42318;
}
.notif-icon.tone-info {
  background: var(--accent-soft);
  color: var(--accent-press);
}
.notif-main {
  flex: 1;
  min-width: 0;
}
.notif-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--fg-1);
  line-height: 1.35;
}
.notif-sub {
  font-size: 12px;
  color: var(--fg-2);
  margin-top: 2px;
  line-height: 1.4;
}
.notif-age {
  font-size: 11px;
  color: var(--fg-3);
  margin-top: 4px;
}
.notif-unread-dot {
  position: absolute;
  top: 16px;
  right: 12px;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--brand-500);
}
.notif-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 40px 14px;
  color: var(--fg-2);
  font-size: 13px;
}
.notif-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-top: 1px solid var(--border);
  background: var(--bg);
}

/* ---------- Page scroll area ---------- */
.page-scroll {
  flex: 1;
  overflow-y: auto;
}

/* ---------- Mobile sidebar overlay ---------- */
.sb-mobile-close {
  display: none;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: 16px;
  right: 14px;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 0;
  background: transparent;
  color: var(--fg-2);
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  transition: background var(--t) var(--ease), color var(--t) var(--ease);
  z-index: 1;
}

.sb-mobile-close:hover {
  background: var(--bg-2);
  color: var(--fg-1);
}

.tb-hamburger {
  display: none;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--bg-1);
  color: var(--fg-2);
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  transition: background var(--t) var(--ease), color var(--t) var(--ease);
  margin-right: 4px;
}

.tb-hamburger:hover {
  background: var(--bg-2);
  color: var(--fg-1);
}

@media (max-width: 767px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 280px;
    z-index: 120;
    transform: translateX(-100%);
    transition: transform var(--t-slow) var(--ease);
    box-shadow: var(--shadow-2);
  }

  .sidebar--mobile-open {
    transform: translateX(0);
  }

  .sb-mobile-close {
    display: flex;
  }

  .sb-mobile-overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: var(--overlay-bg);
    z-index: 110;
    backdrop-filter: var(--overlay-blur);
    animation: var(--overlay-in);
    cursor: pointer;
    border: none;
    padding: 0;
  }

  .tb-hamburger {
    display: flex;
  }
}

@media (min-width: 768px) {
  .sb-mobile-close {
    display: none;
  }

  .sb-mobile-overlay {
    display: none;
  }

  .tb-hamburger {
    display: none;
  }
}

/* ---------- Footer user menu ---------- */
.sb-menu {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 8px;
  right: 8px;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(20, 14, 4, 0.1);
  overflow: hidden;
  z-index: 50;
}
.sb-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 14px;
  border: 0;
  background: transparent;
  color: var(--fg-1);
  font-size: 13.5px;
  text-align: left;
  cursor: pointer;
  transition: background var(--t) var(--ease);
}
.sb-menu-item:hover {
  background: var(--bg-2);
}
.sb-menu-item.danger {
  color: var(--danger);
}
.sb-menu-sep {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}

/* Store-switcher dropdown row: avatar + name + settings cog */
.sb-shoplogo--sm {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: var(--brand-500);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 11px;
  flex-shrink: 0;
}
.sb-store-row {
  position: relative;
}
.sb-store-row-name {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sb-store-cog {
  /* hidden by default — revealed on parent row hover */
  opacity: 0;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3px 5px;
  border-radius: 5px;
  border: 0;
  background: transparent;
  color: var(--fg-2);
  cursor: pointer;
  font-size: 14px;
  transition: opacity var(--t) var(--ease), background var(--t) var(--ease);
}
.sb-store-row:hover .sb-store-cog {
  opacity: 1;
  pointer-events: auto;
}
.sb-store-cog:hover {
  background: var(--bg-2);
  color: var(--fg-1);
}

/* ================================================================
   Orders / Data pages
   ================================================================ */

.page-pad {
  padding: 28px 28px 40px;
}
.page-hd {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 20px;
}
.page-hd-text {
  flex: 1;
  min-width: 0;
}
.page-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--fg-1);
  margin: 0 0 3px;
}
.page-sub {
  font-size: 13px;
  color: var(--fg-3);
  margin: 0;
}
.page-hd-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* ---------- Tabs ---------- */
.tabs-row {
  display: flex;
  align-items: stretch;
  gap: 0;
  border-bottom: 1px solid var(--border);
  padding: 0 4px;
  margin-bottom: 16px;
  overflow-x: auto;
  /* Load-bearing, not redundant: overflow-x != visible forces a used
     overflow-y of auto, and .tab's -1px margin-bottom makes content 1px
     taller than the box once the horizontal bar takes height — without this
     the strip grows a vertical scrollbar. See design.md Decision 10. */
  overflow-y: hidden;
  /* Scroll affordance. Two "cover" layers scroll WITH the content
     (background-attachment: local) and two "cue" layers stay pinned to the box
     (scroll). At rest the covers sit over the cues and nothing shows; scrolling
     slides a cover away and reveals the cue on that side. Self-conditional: a
     strip that does not overflow never uncovers either cue, so no JS and no
     per-component wiring is needed. */
  background: linear-gradient(to right, var(--bg) 30%, transparent) left center,
    linear-gradient(to left, var(--bg) 30%, transparent) right center,
    linear-gradient(to right, rgb(0 0 0 / 12%), transparent) left center,
    linear-gradient(to left, rgb(0 0 0 / 12%), transparent) right center;
  background-repeat: no-repeat;
  background-size: 40px 100%, 40px 100%, 24px 100%, 24px 100%;
  background-attachment: local, local, scroll, scroll;
}
/* Chromium/Safari get a slim persistent bar via the webkit pseudo-elements.
   The standard properties must NOT sit beside them: a non-auto scrollbar-width
   or scrollbar-color makes Chromium ignore ::-webkit-scrollbar entirely,
   leaving only an invisible-at-rest macOS overlay bar. They apply only where
   the pseudo-element is unknown (Firefox), guarded below. */
.tabs-row::-webkit-scrollbar {
  height: 13px;
}
/* 5px of visible thumb sitting under 8px of clear space, so the bar never runs
   flush into the active tab's underline — the two are collinear otherwise and
   read as one bar with an orange segment. The gap is a transparent top border
   on the thumb rather than padding on the strip: padding would apply on every
   strip including the ones that fit, lifting the underline off the bottom rule
   app-wide, whereas the border exists only where a scrollbar does.
   See design.md Decision 11. */
.tabs-row::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  /* Asymmetric on purpose; `999px` here renders a thumb sliced in half. A
     padding-box corner radius is the border-box radius minus that side's
     border width, and the border-box radius is itself clamped to half the
     13px bar — so a uniform 999px becomes 6.5px, the top corners compute
     6.5 - 8 -> 0 (square) and only the bottom two stay round. These values
     are derived from the 13px bar and its 8px border: vertically 10.5 top
     and 2.5 bottom sum to exactly 13, so nothing is clamped, and both ends
     land at 2.5px in the padding box — a true pill on the visible 5px.
     Horizontally 2.5 throughout, since there is no left or right border to
     subtract. Recompute all four if the bar height or inset changes. */
  border-radius: 2.5px / 10.5px 10.5px 2.5px 2.5px;
  border-top: 8px solid transparent;
  background-clip: padding-box;
}
.tabs-row::-webkit-scrollbar-track {
  background: transparent;
}
@supports not selector(::-webkit-scrollbar) {
  .tabs-row {
    scrollbar-width: thin;
    scrollbar-color: var(--border-strong) transparent;
  }
  /* The table's wrapper takes the same fallback. Neither engine on this path
     can express the thumb inset, so both keep the flush appearance there. */
  .dtable-scroll {
    scrollbar-width: thin;
    scrollbar-color: var(--border-strong) transparent;
  }
}

/* Preferred scroll affordance: mask the strip's own pixels so the tabs dissolve
   into the page rather than sitting under a shadow. Needs scroll-driven
   animations to know which end is scrollable; where those are missing the
   background-layer version above stays in force. Base values are 0 so that an
   inactive timeline — a strip that does not overflow — shows no fade at all. */
@property --tabs-fade-l {
  syntax: "<length>";
  inherits: false;
  initial-value: 0px;
}
@property --tabs-fade-r {
  syntax: "<length>";
  inherits: false;
  initial-value: 0px;
}
@supports (animation-timeline: scroll(self inline)) {
  .tabs-row {
    background: none;
    --tabs-fade-l: 0px;
    --tabs-fade-r: 0px;
    /* Prefixed twin is load-bearing, not legacy noise: Chromium 115-119 shipped
       scroll-driven animations before unprefixed mask-image (120), so those
       versions enter this block, take `background: none` above — killing the
       fallback — and would then drop an unprefixed-only mask, leaving an
       overflowing strip with no cue at all. */
    -webkit-mask-image: linear-gradient(
      to right,
      transparent 0,
      #000 var(--tabs-fade-l),
      #000 calc(100% - var(--tabs-fade-r)),
      transparent 100%
    );
    mask-image: linear-gradient(
      to right,
      transparent 0,
      #000 var(--tabs-fade-l),
      #000 calc(100% - var(--tabs-fade-r)),
      transparent 100%
    );
    animation: tabs-scroll-fade linear both;
    animation-timeline: scroll(self inline);
  }
  @keyframes tabs-scroll-fade {
    0% {
      --tabs-fade-l: 0px;
      --tabs-fade-r: 100px;
    }
    6% {
      --tabs-fade-l: 100px;
      --tabs-fade-r: 100px;
    }
    94% {
      --tabs-fade-l: 100px;
      --tabs-fade-r: 100px;
    }
    100% {
      --tabs-fade-l: 100px;
      --tabs-fade-r: 0px;
    }
  }
}
.tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  font-size: 13.5px;
  color: var(--fg-2);
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  margin-bottom: -1px;
  transition: color var(--t) var(--ease), border-color var(--t) var(--ease);
}
.tab:hover {
  color: var(--fg-1);
}
.tab.active {
  color: var(--fg-1);
  border-bottom-color: var(--accent);
  font-weight: 500;
}
/* 1px divider between adjacent tabs. Opt out with data-tabs-sep="off". */
.tabs-row .tab + .tab::before {
  content: "";
  position: absolute;
  left: 0;
  top: 25%;
  bottom: 25%;
  width: 1px;
  background: var(--border);
  transition: opacity var(--t) var(--ease);
}
.tabs-row[data-tabs-sep="off"] .tab + .tab::before {
  opacity: 0;
}
.tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--bg-2);
  color: var(--fg-2);
  font-size: 11px;
  font-family: var(--font-mono);
}
.tab.active .tab-count {
  background: var(--accent-soft);
  color: var(--accent-press);
}

/* Narrowed strip: a filter, a date range or a search is limiting the list, so
   every quantity on the strip is a slice rather than the whole store. The
   strip's own rule goes dashed accent, and every bubble takes the .filter-chip
   triple so the numbers read as belonging to the chips below the toolbar.
   The ring is an inset shadow, not a border: a real border would add 2px to
   every bubble and reflow the strip the moment a filter is applied. */
.tabs-row.is-narrowed {
  border-bottom-style: dashed;
  border-bottom-color: color-mix(in oklch, var(--accent) 55%, transparent);
}
.tabs-row.is-narrowed .tab-count {
  background: var(--accent-soft);
  color: var(--accent-press);
  box-shadow: inset 0 0 0 1px color-mix(in oklch, var(--accent) 28%, transparent);
}

/* Tabs row with trailing actions (TabStrip `actions`). The actions cell draws
   the strip's own rule, so the line runs unbroken under both. */
.tabs-bar {
  display: flex;
  align-items: stretch;
  margin-bottom: 16px;
}
.tabs-bar > .tabs-row {
  flex: 1;
  min-width: 0;
  margin-bottom: 0;
}
.tabs-bar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
  padding-left: 12px;
  /* Lifts the buttons onto the tab labels' centre: a page-level tab pads 17px
     under its label against 10px above it, so the labels sit above the
     strip's middle. */
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
/* A page that opens on its tabs centres its tab row between the top bar and
   the strip's rule, so a 32px action button has equal space above and below
   it (12.7px each, against 18.7px over 6.8px before). The page loses 7px on
   top and the tab gains 7px under its label, which leaves the rule, the
   toolbar and the table exactly where they were. Drawer and modal strips are
   not page-level and keep the plain .tab padding. */
.page-pad:has(> .tabs-bar:first-child),
.page-pad:has(> .tabs-row:first-child),
.page-pad:has(> style:first-child + .tabs-bar),
.page-pad:has(> style:first-child + .tabs-row) {
  padding-top: 9px;
}
.page-pad > .tabs-bar:first-child .tab,
.page-pad > .tabs-row:first-child > .tab,
.page-pad > style:first-child + .tabs-bar .tab,
.page-pad > style:first-child + .tabs-row > .tab {
  padding-bottom: 17px;
}
.tabs-bar:has(> .tabs-row.is-narrowed) > .tabs-bar-actions {
  border-bottom-style: dashed;
  border-bottom-color: color-mix(in oklch, var(--accent) 55%, transparent);
}

/* Buttons-only header row on a screen without tabs; as tall as the tabs row. */
.page-actions-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-height: 42px;
  margin-bottom: 16px;
}

/* Narrowed-view explainer, sitting beside the Filters control and rendered
   only while something is narrowing the list. The strip's dashed rule and its
   tinted bubbles say THAT the view is a slice; this says why the numbers moved.
   Its explanation is the shared .tooltip (shared-tooltip). */
.narrowed-info {
  position: relative;
  display: inline-flex;
}
.narrowed-info-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  padding: 0;
  border: 1px solid color-mix(in oklch, var(--accent) 45%, transparent);
  border-radius: 50%;
  background: transparent;
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  cursor: help;
  transition: background var(--t) var(--ease), border-color var(--t) var(--ease);
}
.narrowed-info-btn:hover,
.narrowed-info-btn:focus-visible {
  background: var(--accent-soft);
  border-color: var(--accent);
}

/* The Inventory Batch Search control (inventory-batch-query, design D7). Its
   tooltip, `Batch Search` or `SKU: <n> selected` with a Clear control, is the
   shared interactive .tooltip (shared-tooltip). */
.batch-search {
  position: relative;
  display: inline-flex;
}
/* The 20px glyph on 6px padding: a 34px square, near the toolbar's 32px
   .btn.sm controls, in the secondary tone while idle. */
.batch-search .btn.icononly {
  padding: 6px;
}
.batch-search .btn.icononly:not(.active) {
  color: var(--fg-2);
}

/* The Quotations filter bar's hover tips (add-quotations-list-filters): the
   control's name while idle, else the applied value with a Clear link, in the
   shared interactive .tooltip (shared-tooltip). */
.filter-tip {
  position: relative;
  display: inline-flex;
}
/* The toolbar search boxes carry their own clear icon (.search-clear), so the
   native one is hidden. Mirrored in app/components.css. */
.search-wrap:has(.search-clear) input[type="search"]::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
  display: none;
}
/* The Quotations Title and SKU boxes keep their text clear of the clear icon;
   the SKU box in the Filters panel has no search icon, so it takes the
   compact input's own left padding. */
.search-wrap:has(.search-clear) .input.sm {
  padding-right: 30px;
}
.filter-section .search-wrap .input.sm {
  padding-left: var(--space-2);
}
.search-wrap .search-clear {
  position: absolute;
  right: 4px;
  top: 50%;
  translate: 0 -50%;
  width: 22px;
  height: 22px;
}

/* The dropshipping `?` in the Inventory stock span (dropshipping-stock-hint):
   the .narrowed-info-btn circle in neutral ink, since it sits in every
   dropshipping row and must not compete with the orange filter control. Its
   hint is the shared .tooltip (shared-tooltip). */
.stock-hint-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  background: transparent;
  color: var(--fg-3);
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  cursor: help;
  transition: background var(--t) var(--ease), border-color var(--t) var(--ease), color var(--t)
    var(--ease);
}
.stock-hint-btn:hover,
.stock-hint-btn:focus-visible {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

/* ---------- Toolbar ---------- */
.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.search-wrap {
  position: relative;
  flex: 1;
  max-width: 320px;
}
.search-wrap .search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--fg-3);
  pointer-events: none;
  display: flex;
  align-items: center;
}
.search-wrap .input {
  padding-left: 34px;
}
.toolbar-count {
  font-size: 12px;
  color: var(--fg-3);
  margin-left: auto;
}
/* A pending Quotations filter write (list-toolbars-shared-date-range, D8b):
   the progress cursor and a dimmed look on every control, visual only; the
   controls that write carry aria-disabled. Mirrored in app/components.css. */
.toolbar[aria-busy="true"],
.toolbar[aria-busy="true"] * {
  cursor: progress;
}
.toolbar[aria-busy="true"] .btn,
.toolbar[aria-busy="true"] .input {
  opacity: 0.6;
}
.empty-state .btn[aria-disabled="true"] {
  cursor: progress;
  opacity: 0.6;
}

/* ---------- Data table ---------- */
/* The table's scroll container. Same affordance and same guards as `.tabs-row`
   (Decisions 8, 10 and 11 of the shared-tab-strip-navigation change): the
   scrollbar stays visible and non-overlay so a plain mouse can reach it, the
   standard properties are kept away from the webkit pseudo-element rules, and
   the y-axis is pinned so a visible horizontal bar cannot induce a vertical
   one. `auto`, not `scroll`, so a table that fits shows no bar at all. */
.dtable-scroll {
  overflow-x: auto;
  overflow-y: hidden;
}
.dtable-scroll::-webkit-scrollbar {
  height: 13px;
}
/* 5px of visible thumb under 8px of clear space — see design.md Decision 11.
   Here the space keeps the bar off the table's last row rather than off a tab
   underline; the mechanism, and the reason it is not padding, are identical. */
.dtable-scroll::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  /* Same derivation as `.tabs-row`'s thumb above — see the comment there
     before touching these numbers. */
  border-radius: 2.5px / 10.5px 10.5px 2.5px 2.5px;
  border-top: 8px solid transparent;
  background-clip: padding-box;
}
.dtable-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.dtable {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.dtable thead th {
  padding: 10px 12px;
  text-align: left;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--fg-3);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.dtable thead th:first-child {
  padding-left: 16px;
}
.dtable thead th:last-child {
  padding-right: 16px;
}
.dtable tbody tr {
  transition: background var(--t) var(--ease);
  border-bottom: 1px solid var(--border);
}
.dtable tbody tr:last-child {
  border-bottom: 0;
}
.dtable tbody tr:hover {
  background: var(--bg-2);
}
.dtable tbody tr.selected {
  background: color-mix(in oklch, var(--accent) 6%, transparent);
}
.dtable tbody td {
  padding: 11px 12px;
  color: var(--fg-1);
  vertical-align: middle;
}
.dtable tbody td:first-child {
  padding-left: 16px;
}
.dtable tbody td:last-child {
  padding-right: 16px;
}
/* Totals row. Ported from the prototype's styles/affiliates.css (~L35) when
   the Commission Report introduced the first tfoot in a .dtable; the board
   change deliberately skipped it because that screen has no totals row, which
   left these cells on the browser default of no padding. Edge padding follows
   the thead/tbody convention above rather than the prototype's flat 14px, so
   the totals line up with the columns they total. */
.dtable tfoot td {
  padding: 12px 12px;
  border-top: 2px solid var(--fg-1);
  font-weight: 700;
  font-size: 13px;
  color: var(--fg-1);
}
.dtable tfoot td:first-child {
  padding-left: 16px;
}
.dtable tfoot td:last-child {
  padding-right: 16px;
}
.dtable .td-mono {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--fg-2);
}
.dtable .td-dim {
  color: var(--fg-3);
  font-size: 12.5px;
}
.td-primary {
  font-weight: 500;
  color: var(--fg-1);
}

.td-ext-link {
  display: inline-flex;
  align-items: center;
  margin-left: 4px;
  color: var(--fg-3);
  text-decoration: none;
  opacity: 0.7;
  transition: opacity 0.15s;
}

.td-ext-link:hover {
  opacity: 1;
  color: var(--accent);
}
/* The shared Checkbox (components/ui/checkbox.tsx), drawn rather than native
   (shared-checkbox-range-selection, D7). */
.cb {
  appearance: none;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  margin: 0;
  border: 1.5px solid var(--border-strong);
  border-radius: 4px;
  background: var(--bg-1) center / 10px 10px no-repeat;
  cursor: pointer;
  vertical-align: middle;
  transition: background-color var(--t) var(--ease), border-color var(--t) var(--ease);
}
.cb:hover:not(:checked):not(:indeterminate) {
  border-color: var(--accent);
}
.cb:checked {
  background-color: var(--accent);
  border-color: var(--accent);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M1.8 5.2 4 7.3 8.2 2.8' fill='none' stroke='white' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.cb:indeterminate {
  background-color: var(--accent);
  border-color: var(--accent);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M2.2 5h5.6' stroke='white' stroke-width='1.7' stroke-linecap='round'/%3E%3C/svg%3E");
}
.cb:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ring) 35%, transparent);
}
.cb:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ---------- Row actions ---------- */
.row-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  opacity: 0;
  transition: opacity var(--t) var(--ease);
}
.dtable tbody tr:hover .row-actions {
  opacity: 1;
}
.row-action-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 0;
  background: transparent;
  color: var(--fg-2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--t) var(--ease), color var(--t) var(--ease);
}
.row-action-btn:hover {
  background: var(--bg-2);
  color: var(--fg-1);
}

/* Orders row: a kebab indicator at rest, swapped for the strip on row hover
   or on keyboard focus inside the strip (orders-row-icons-and-hover, D4).
   Hidden by opacity only, so the buttons stay in the tab order and tabbing
   into one reveals the strip. Inventory and the referrer explorer keep the
   row focus-within reveal (orders-row-hover-actions, D4). */
.order-row-actions {
  position: relative;
  display: flex;
  justify-content: flex-end;
  align-items: center;
}
.order-row-actions .row-actions {
  opacity: 0;
}
.order-row-actions .order-row-dots {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--fg-3);
  pointer-events: none;
  transition: opacity var(--t) var(--ease);
}
.dtable tbody tr:hover .order-row-actions .row-actions,
.dtable tbody tr .order-row-actions-overlay:has(:focus-visible) .row-actions,
.dtable
  tbody
  tr:focus-within:not(:focus)
  .order-row-actions:not(.order-row-actions-overlay)
  .row-actions {
  opacity: 1;
}
.dtable tbody tr:hover .order-row-actions .order-row-dots,
.dtable tbody tr .order-row-actions-overlay:has(:focus-visible) .order-row-dots,
.dtable
  tbody
  tr:focus-within:not(:focus)
  .order-row-actions:not(.order-row-actions-overlay)
  .order-row-dots {
  opacity: 0;
}
/* Gmail-style overlay (TapD 1003819): the strip takes no width in its pinned
   column and opens leftwards over the trailing cells, on a background that
   fades in from the left into the row's own colour. Only its buttons take
   clicks, so the fade and the gaps pass them to the cell beneath. These rules
   select through the Orders-only class, because Inventory and the referrer
   explorer share .order-row-actions and keep their inline strip. */
.order-row-actions-overlay {
  min-width: 28px;
}
.order-row-actions-overlay .row-actions {
  pointer-events: none;
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  padding-left: 24px;
  background: linear-gradient(to right, transparent, var(--bg-2) 20px);
}
.order-row-actions-overlay .row-actions > * {
  pointer-events: auto;
}
/* Strip buttons 30px with 18px icons in both densities; the indicator keeps
   its 28px (orders-row-icons-and-hover, D1). */
.order-row-actions-overlay .row-actions .iconbtn {
  width: 30px;
  height: 30px;
}
.order-row-actions-overlay .row-actions .iconbtn svg {
  width: 18px;
  height: 18px;
}
.dtable tbody tr.selected .order-row-actions-overlay .row-actions {
  background: linear-gradient(
    to right,
    transparent,
    color-mix(in oklch, var(--accent) 6%, var(--bg-1)) 20px
  );
}
/* Revealed by keyboard focus alone, the row keeps its resting colour. */
.dtable
  tbody
  tr:not(:hover):not(.selected)
  .order-row-actions-overlay:has(:focus-visible)
  .row-actions {
  background: linear-gradient(to right, transparent, var(--bg-1) 20px);
}

/* Compact density (TapD 1003818): Shopify-style list. Rows drop from 52px to
   38px (32px until TapD 1003926), columns hug their content so spare width collects before the last
   (actions) column, and horizontal padding drops to 6px between columns.
   The copy control shrinks to 20px (TapD 1003818); the row action strip
   sizes itself in both densities (orders-row-icons-and-hover, D1). */
.dtable.dtable-compact {
  font-size: 12px;
}
.dtable.dtable-compact thead th {
  padding: 7px 6px;
  font-size: 11px;
  width: 1px;
}
.dtable.dtable-compact tbody tr {
  height: 38px;
}
.dtable.dtable-compact tbody td {
  padding: 4px 6px;
  white-space: nowrap;
  width: 1px;
  /* Centres the ink, not the line box: digits and capitals have no
     descenders, so at this padding they otherwise sit 2px high. */
  /* biome-ignore lint/correctness/noUnknownProperty: text-box is Baseline 2025 (Chrome 133, Safari 18.2) and Biome 1.9.4 predates it; a browser without it keeps the 2px offset */
  text-box: trim-both cap alphabetic;
}
.dtable.dtable-compact thead th:first-child,
.dtable.dtable-compact tbody td:first-child {
  padding-left: 12px;
}
.dtable.dtable-compact thead th:last-child,
.dtable.dtable-compact tbody td:last-child {
  padding-right: 12px;
  width: auto;
}
.dtable.dtable-compact .badge {
  font-size: 11px;
  padding: 1px 7px;
}
.dtable.dtable-compact .row-action-btn {
  width: 20px;
  height: 20px;
}
/* A table's actions column pinned to the scroll container's right edge, opaque
   so scrolled content never shows through (inventory-row-shopify-link, D7).
   The selected rule comes after the hover rule, as the row rules do. */
.dtable .dtable-sticky-end {
  position: sticky;
  right: 0;
  z-index: 1;
  background: var(--bg-1);
  transition: background var(--t) var(--ease);
}
.dtable tbody tr:hover .dtable-sticky-end {
  background: var(--bg-2);
}
.dtable tbody tr.selected .dtable-sticky-end {
  background: color-mix(in oklch, var(--accent) 6%, var(--bg-1));
}

/* Leading columns pinned to the scroll container's left edge; each cell sets
   its own inline `left` offset (add-quotations-list). Same tints as the end pin. */
.dtable .dtable-sticky-start {
  position: sticky;
  z-index: 1;
  background: var(--bg-1);
  transition: background var(--t) var(--ease);
}
.dtable tbody tr:hover .dtable-sticky-start {
  background: var(--bg-2);
}
.dtable tbody tr.selected .dtable-sticky-start {
  background: color-mix(in oklch, var(--accent) 6%, var(--bg-1));
}
/* The last frozen cell of each row (list-columns-panel): a soft 1px line,
   lighter than the row borders. This is the fallback; where scroll-driven
   animations exist, the scroll fade's @supports block below hides it at rest
   and shows it, with the shadow, once the table scrolls sideways. */
.dtable .dtable-pin-edge {
  box-shadow: inset -1px 0 0 color-mix(in oklch, var(--border) 60%, transparent);
}

/* A column header's drag-to-resize edge (add-quotations-list). A class, not
   inline style, so no table module sets an inline absolute position. */
.dtable .dtable-resize-handle {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 6px;
  cursor: col-resize;
  touch-action: none;
}

/* Nothing at rest; a subtle grey line while hovered or dragged
   (shared-list-table, D6). */
.dtable .dtable-resize-handle:hover::after,
.dtable .dtable-resize-handle[data-resizing]::after {
  content: "";
  position: absolute;
  top: 6px;
  bottom: 6px;
  left: 2px;
  width: 2px;
  border-radius: 1px;
  background: var(--border-strong);
}

/* Scroll cue on every list (TapD 1003819, 1003963): a fade on the end edge
   only, attached to the .dtable-scroll wrapper itself so no list can opt out.
   Two mechanisms, chosen by whether the table pins an actions cell:
   (1) a pinned table draws the fade just left of its .dtable-sticky-end cell
       (a mask on the scroller would fade that pinned column too), following
       the row's hover and selected colour;
   (2) any other table masks the scroller, the .tabs-row mechanism, with a
       second solid layer keeping the 13px scrollbar band unfaded.
   Both run on a scroll timeline and rest at nothing, so a table that fits
   shows no cue. The start edge has no fade, by the developer's call.
   `animation` resets `animation-timeline`, so it is always written first.
   ponytail: no fallback where scroll-driven animations are missing (Firefox);
   those browsers keep the plain scrollbar as their only cue. */
@property --dtable-fade-end {
  syntax: "<length>";
  inherits: false;
  initial-value: 0px;
}
@supports (animation-timeline: scroll(self inline)) {
  .dtable-scroll .dtable-sticky-end::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    right: 100%;
    width: 75px;
    pointer-events: none;
    opacity: 0;
    background: linear-gradient(to right, transparent, var(--bg-1));
    animation: dtable-fade-end linear both;
    animation-timeline: scroll(nearest inline);
  }
  .dtable-scroll tbody tr:hover .dtable-sticky-end::before {
    background: linear-gradient(to right, transparent, var(--bg-2));
  }
  .dtable-scroll tbody tr.selected .dtable-sticky-end::before {
    background: linear-gradient(
      to right,
      transparent,
      color-mix(in oklch, var(--accent) 6%, var(--bg-1))
    );
  }
  @keyframes dtable-fade-end {
    0%,
    94% {
      opacity: 1;
    }
    100% {
      opacity: 0;
    }
  }
  .dtable-scroll:not(:has(.dtable-sticky-end)) {
    /* Prefixed twins: see the .tabs-row block for why they are load-bearing. */
    -webkit-mask-image: linear-gradient(
        to right,
        #000 calc(100% - var(--dtable-fade-end)),
        transparent 100%
      ), linear-gradient(#000, #000);
    mask-image: linear-gradient(
        to right,
        #000 calc(100% - var(--dtable-fade-end)),
        transparent 100%
      ), linear-gradient(#000, #000);
    -webkit-mask-size: 100% calc(100% - 13px), 100% 13px;
    mask-size: 100% calc(100% - 13px), 100% 13px;
    -webkit-mask-position: top, bottom;
    mask-position: top, bottom;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    animation: dtable-fade-mask linear both;
    animation-timeline: scroll(self inline);
  }
  @keyframes dtable-fade-mask {
    0%,
    94% {
      --dtable-fade-end: 75px;
    }
    100% {
      --dtable-fade-end: 0px;
    }
  }
  /* The pinned edge's line is invisible at rest and turns on with the shadow
     once the table has scrolled sideways. The transparent base also covers a
     table that never overflows: its inactive timeline drops the animation. */
  .dtable-scroll .dtable-pin-edge {
    box-shadow: inset -1px 0 0 transparent;
    animation: dtable-pin-line linear both;
    animation-timeline: scroll(nearest inline);
  }
  @keyframes dtable-pin-line {
    0% {
      box-shadow: inset -1px 0 0 transparent;
    }
    1%,
    100% {
      box-shadow: inset -1px 0 0 color-mix(in oklch, var(--border) 60%, transparent);
    }
  }
  /* The pinned edge's shadow shows once the table has scrolled sideways. */
  .dtable-scroll .dtable-pin-edge::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 100%;
    width: 8px;
    pointer-events: none;
    opacity: 0;
    background: linear-gradient(to right, rgba(20, 14, 4, 0.08), transparent);
    animation: dtable-pin-shadow linear both;
    animation-timeline: scroll(nearest inline);
  }
  @keyframes dtable-pin-shadow {
    0% {
      opacity: 0;
    }
    1%,
    100% {
      opacity: 1;
    }
  }
}

/* The Columns panel's Frozen columns row (list-columns-panel). */
.columns-sep {
  background: var(--bg-2);
  color: var(--fg-3);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ---------- Icon buttons ---------- */
.iconbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-1);
  color: var(--fg-2);
  cursor: pointer;
  padding: 0;
  transition: background var(--t) var(--ease), color var(--t) var(--ease), border-color var(--t)
    var(--ease);
}
.iconbtn:hover {
  background: var(--bg-2);
  color: var(--fg-1);
}
.iconbtn.small {
  width: 28px;
  height: 28px;
}

/* Row action tone variants */
.row-actions .iconbtn.tone-neutral {
  color: var(--fg-2);
  border-color: var(--border);
}
.row-actions .iconbtn.tone-neutral:hover {
  background: var(--bg-2);
  color: var(--fg-1);
}
.row-actions .iconbtn.tone-info {
  color: #2c56d6;
  border-color: color-mix(in oklch, #3b6cf5 35%, var(--border));
}
.row-actions .iconbtn.tone-info:hover {
  background: color-mix(in oklch, #3b6cf5 8%, var(--bg-1));
}
.row-actions .iconbtn.tone-warning {
  color: #8f5a00;
  border-color: color-mix(in oklch, #c47a00 40%, var(--border));
}
.row-actions .iconbtn.tone-warning:hover {
  background: var(--warning-soft);
}
.row-actions .iconbtn.tone-success {
  color: #1f6e39;
  border-color: color-mix(in oklch, #2a8a48 40%, var(--border));
}
.row-actions .iconbtn.tone-success:hover {
  background: var(--success-soft);
}
.row-actions .iconbtn.tone-danger {
  color: var(--danger);
  border-color: var(--danger-soft);
}
.row-actions .iconbtn.tone-danger:hover {
  background: var(--danger-soft);
}
.row-actions .iconbtn.tone-primary {
  color: var(--on-accent);
  background: var(--accent);
  border-color: var(--accent);
}
.row-actions .iconbtn.tone-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

/* ---------- Select-all-matching banner (top of a table card) ---------- */
.select-all-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  font-size: 13px;
  text-align: left;
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  color: var(--fg-2);
}

/* ---------- Bulk action bar ---------- */
.bulkbar-wrap {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(16px);
  z-index: 40;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.18s var(--ease), transform 0.18s var(--ease);
}
.bulkbar-wrap.visible {
  pointer-events: auto;
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.bulkbar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--cream-900);
  color: var(--fg-inverse);
  border-radius: 12px;
  padding: 10px 16px;
  box-shadow: 0 8px 32px rgba(20, 14, 4, 0.28);
  white-space: nowrap;
}
.bulkbar-count {
  font-size: 13px;
  font-weight: 500;
}
.bulkbar-sep {
  width: 1px;
  height: 20px;
  background: rgba(255, 255, 255, 0.15);
  margin: 0 4px;
}
.bulkbar .btn {
  background: rgba(255, 255, 255, 0.12);
  border-color: transparent;
  color: var(--fg-inverse);
}
.bulkbar .btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.22);
}

/* ---------- Empty state ---------- */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 64px 24px;
  gap: 10px;
  color: var(--fg-3);
  text-align: center;
}
.empty-state-icon {
  color: var(--fg-3);
  opacity: 0.5;
  margin-bottom: 4px;
}
.empty-state-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--fg-2);
}
.empty-state-sub {
  font-size: 13px;
  color: var(--fg-3);
}

/* ---------- Filter popover ---------- */
.filter-wrap {
  position: relative;
}
.filter-pop {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 40;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 8px 28px rgba(20, 14, 4, 0.14);
  width: 264px;
  /* The card and the scroll container are deliberately separate elements. The
     panel is bounded and clips, but never scrolls and is never masked, so its
     border and rounded corners always survive; .filter-pop-body inside it owns
     the overflow and the fade. Without the bound the panel grew to whatever
     its sections needed, ran off the bottom of the screen and made the PAGE
     scroll, putting the last dimension out of reach on a laptop viewport.
     60dvh is safe because the toolbar this hangs from always sits in the upper
     half of the viewport; dvh rather than vh so a mobile browser's retracting
     chrome cannot clip it. */
  display: flex;
  flex-direction: column;
  max-height: 60dvh;
  overflow: hidden;
}
.filter-pop-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 600;
  color: var(--fg-1);
  /* Outside the scroller, so the header stays put at any scroll position. It
     held Clear all until that control moved to the chips row, where it is
     reachable whether or not this panel is open (TapD 1003346). The rule
     underneath is what makes content read as passing BEHIND the header rather
     than being chopped off at it. */
  flex: none;
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--border);
}
.filter-pop-body {
  flex: 1 1 auto;
  overflow-y: auto;
  /* Stops the scroll chaining back to the page at either end — the same defect
     the height bound fixes, in a smaller form. */
  overscroll-behavior: contain;
  padding: 14px 16px 16px;
  scrollbar-width: thin;
}
/* The bottom-edge scroll cue, shared by the Filters panel body and any
   scroller that opts in with .scroll-fade-b (the Invite user modal's store
   and role lists, TapD 1003928). The opting-in element must carry no border
   or corners of its own, since the mask below fades the whole box. */
.filter-pop-body,
.scroll-fade-b {
  /* Fallback affordance, the two-layer background trick from .tabs-row on the
     block axis: a "cover" layer scrolls WITH the content
     (background-attachment: local) over a "cue" layer pinned to the box
     (scroll). At the top the cover sits below the fold so the cue shows;
     scrolled to the end the cover lands over the cue and it disappears.
     Self-conditional — content short enough not to overflow never uncovers the
     cue. Bottom edge only: the top edge is the header's rule.

     Sized to sit alongside the 100px mask above rather than to match it
     pixel-for-pixel. The two are different effects: the mask fades content to
     transparent, this paints a soft band BEHIND it, and 100px of shading would
     read as a grey smudge over the last rows rather than as depth. The cover
     stays taller than the cue so it still hides it completely at the end —
     keep that relationship if you retune either. */
  background-image: linear-gradient(to top, var(--bg-1) 60%, transparent),
    linear-gradient(to top, rgb(0 0 0 / 8%), transparent);
  background-repeat: no-repeat;
  background-position: bottom center, bottom center;
  background-size: 100% 72px, 100% 48px;
  background-attachment: local, scroll;
}

/* Preferred affordance: mask the scroller's own pixels so the last row
   dissolves rather than sitting under a grey wash — a background layer paints
   BEHIND content and can only dim text, never fade it. Masking is safe here
   and was not on .filter-pop itself, because this element carries no border,
   corners or shadow to lose. Base value 0 so an inactive timeline — content
   that does not overflow — shows no fade at all. */
@property --filter-pop-fade-b {
  syntax: "<length>";
  inherits: false;
  initial-value: 0px;
}
@supports (animation-timeline: scroll(self block)) {
  .filter-pop-body,
  .scroll-fade-b {
    background-image: none;
    --filter-pop-fade-b: 0px;
    /* Prefixed twin is load-bearing rather than legacy noise, for the same
       reason as .tabs-row: Chromium 115-119 shipped scroll-driven animations
       before unprefixed mask-image, so those versions enter this block, take
       the `background-image: none` above, and would otherwise be left with an
       overflowing panel and no cue at all. */
    -webkit-mask-image: linear-gradient(
      to bottom,
      #000 calc(100% - var(--filter-pop-fade-b)),
      transparent 100%
    );
    mask-image: linear-gradient(
      to bottom,
      #000 calc(100% - var(--filter-pop-fade-b)),
      transparent 100%
    );
    animation: filter-pop-scroll-fade linear both;
    animation-timeline: scroll(self block);
  }
  @keyframes filter-pop-scroll-fade {
    0% {
      --filter-pop-fade-b: 100px;
    }
    92% {
      --filter-pop-fade-b: 100px;
    }
    100% {
      --filter-pop-fade-b: 0px;
    }
  }
}
.filter-section {
  margin-bottom: 14px;
}
.filter-section:last-child {
  margin-bottom: 0;
}
.filter-section-label {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--fg-3);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.filter-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  font-size: 13px;
  color: var(--fg-1);
  cursor: pointer;
  text-align: left;
  user-select: none;
}
/* A checkbox option is a div pairing the Checkbox with a sibling label
   (shared-checkbox-range-selection, D9): only the label text toggles. */
div.filter-option {
  cursor: default;
}
.filter-option > label {
  flex: 1;
  cursor: pointer;
}
/* Filter radios are drawn by the app (date-field-polish D3): a round white
   control that fills with the accent and a white centre dot when selected, and
   a round halo instead of the global rectangular outline on keyboard focus.
   The filter checkboxes take the shared Checkbox's .cb rule. Declared
   identically in app/components.css. */
.filter-option input[type="radio"] {
  appearance: none;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  margin: 0;
  display: grid;
  place-content: center;
  border: 1.5px solid var(--border-strong);
  border-radius: 50%;
  background: var(--bg-1);
  cursor: pointer;
}
.filter-option input[type="radio"]:checked {
  background: var(--accent);
  border-color: var(--accent);
}
.filter-option input[type="radio"]:checked::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--on-accent);
}
.filter-option input[type="radio"]:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ring) 35%, transparent);
}
/* Active row of the country picker's keyboard-driven listbox
   (searchable-country-picker). Paint only — the marker travels on every
   arrow keypress, so nothing here may move the text: the padding-inline is
   cancelled by an equal negative margin-inline, and font, height and block
   padding are untouched. */
.filter-option.is-active {
  background: var(--bg-2);
  border-radius: 8px;
  padding-inline: 8px;
  margin-inline: -8px;
}

/* ---------- Filter chips ---------- */
.filter-chips {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 6px 3px 10px;
  background: var(--accent-soft);
  color: var(--accent-press);
  border: 1px solid color-mix(in oklch, var(--accent) 28%, transparent);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
}
.filter-chip-x {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--accent-press);
  cursor: pointer;
  opacity: 0.7;
  transition: opacity var(--t) var(--ease);
}
.filter-chip-x:hover {
  opacity: 1;
}

/* ---------- Pagination ---------- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.pagination-info {
  font-size: 12px;
  color: var(--fg-3);
}
.pagination-controls {
  display: flex;
  align-items: center;
  gap: 4px;
}
.pag-btn {
  min-width: 28px;
  height: 28px;
  border-radius: 7px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--fg-2);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  font-family: var(--font-sans);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  transition: background var(--t) var(--ease);
}
.pag-btn:hover:not(:disabled) {
  background: var(--bg-2);
  color: var(--fg-1);
}
.pag-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
}
/* Prev / Next: secondary buttons with a chevron and a word. Kept in sync
   with components.css. */
.btn.pag-step {
  gap: 4px;
}
.pag-btn:disabled {
  opacity: 0.35;
  cursor: default;
}
/* Non-interactive elision stand-in between page-number runs — never a
   .pag-btn, never focusable. Kept in sync with components.css. */
.pag-ellipsis {
  height: 28px;
  padding: 0 2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--fg-3);
  user-select: none;
}
/* The pager's `Page [input] Go` group at the end of .pagination-controls.
   Kept in sync with components.css. */
.pag-jump {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 8px;
  font-size: 12px;
  color: var(--fg-3);
}
.pag-jump .input {
  width: 56px;
  height: 30px;
}

/* ---------- Row action dropdown ---------- */
.row-pop {
  /* No position/offsets here: placement is inline fixed viewport coordinates
     from the shared TablePopover (top layer), so the menu escapes the table's
     clipping ancestors. z-index kept for the no-popover-API fallback. */
  margin: 0;
  padding: 0;
  color: inherit;
  z-index: 40;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 6px 24px rgba(20, 14, 4, 0.12);
  min-width: 180px;
  overflow: hidden;
}
.row-pop-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 9px 14px;
  border: 0;
  background: transparent;
  color: var(--fg-1);
  font-size: 13px;
  font-family: var(--font-sans);
  text-align: left;
  cursor: pointer;
  transition: background var(--t) var(--ease);
}
.row-pop-item:hover {
  background: var(--bg-2);
}
.row-pop-item.danger {
  color: var(--danger);
}

/* ---------- Identity reveal ---------- */
.identity-pop {
  /* Placement is inline fixed viewport coordinates from the shared
     TablePopover, as with .row-pop. Not .row-pop itself: that is a menu
     container, with entry padding and a min-width sized for menu items.
     The width bound and wrap keep a long address inside the viewport rather
     than cropping it a second time — so no nowrap in this rule, ever. */
  margin: 0;
  padding: 12px 16px;
  z-index: 40;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 6px 24px rgba(20, 14, 4, 0.12);
  max-width: 320px;
  overflow-wrap: anywhere;
}

/* Trailing variant: hangs to the RIGHT of its positioned ancestor rather than
   the left. The base rule was written for an actions cell at the end of a row,
   where leftward is the only direction with space. On the invoices list the
   confirmation sits beside the bill number in the second column, so leftward
   would put it over the checkbox. Out of flow either way, so the column keeps
   its width while the confirmation stands. */
.row-copied-label.trailing {
  right: auto;
  left: 100%;
  margin-right: 0;
  margin-left: 6px;
}

/* Below variant: hangs UNDER its positioned ancestor. The inline shape sits in
   a line of content with something immediately beside it — measured on the
   order detail header, a right-hanging label covers the status badge for the
   whole confirmation window, and the same happens at the help centre article
   actions row and in the affiliate report's next column — while the space
   beneath the line is free. Declared here beside the base rule it modifies:
   components.css declares no part of this class, and splitting the two across
   the stylesheets would put them in different cascade layers, this sheet being
   linked unlayered. */
.row-copied-label.below {
  top: 100%;
  right: auto;
  left: 0;
  transform: translateY(4px);
  margin-right: 0;
}

.row-copied-label {
  position: absolute;
  top: 50%;
  right: 100%;
  transform: translateY(-50%);
  margin-right: 6px;
  /* Above the row's later positioned layers: with `auto` the next cell's badge
     dot (`opacity` forms a layer) painted through the label. Below the row
     popovers (40). */
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--success-bg, #d1fae5);
  color: var(--success-fg, #065f46);
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
  pointer-events: none;
}

.pagination-size {
  display: flex;
  align-items: center;
  gap: 6px;
}
.dtable tbody tr {
  height: 52px;
}

.badge-xs {
  font-size: 10px;
  padding: 1px 5px;
}
.badge.tone-warning {
  background: #fef3c7;
  color: #92400e;
}
.badge.tone-danger {
  background: #fee2e2;
  color: #991b1b;
}
.badge.tone-info {
  background: var(--accent-soft);
  color: var(--accent-press);
}

/* ================================================================
   Ticket badges (status cell flags)
   ================================================================ */
.ticket-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 500;
  line-height: 1;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--danger-soft);
  color: var(--danger);
  border: 1px solid rgba(176, 65, 43, 0.12);
  white-space: nowrap;
}
.ticket-badge.ok {
  background: var(--success-soft);
  color: var(--success);
  border-color: rgba(63, 125, 91, 0.15);
}
.ticket-badge.warn {
  background: var(--warning-soft);
  color: var(--warning);
  border-color: rgba(185, 128, 26, 0.15);
}
.ticket-badge.info {
  background: var(--info-soft);
  color: var(--info);
  border-color: rgba(82, 104, 141, 0.15);
}

/* ---- Help Center article editor ----
   Paired fields in two columns, the body spanning both, and the actions as a
   footer row at the trailing edge. Collapses to one column on the same
   breakpoint the detail grid uses. Kept in sync with components.css. */
.article-editor-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0 var(--space-5);
}
.article-editor-wide {
  grid-column: 1 / -1;
}
.article-editor-footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-2);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border);
}
@media (max-width: 1023px) {
  .article-editor-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ---- Rich-text editor ----
   Toolbar and writing surface read as one bordered control; the surface opens
   at a writable height and grows with the document rather than scrolling
   inside it. Kept in sync with components.css. */
.rich-text-editor {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-1);
  overflow: hidden;
}
.rich-text-toolbar {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2);
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
}
.rich-text-controls {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
}
/* The view control keeps the trailing edge however many rows the formatting
   controls wrap to. */
.rich-text-view-toggle {
  margin-left: auto;
}
.rich-text-surface {
  min-height: 320px;
  height: auto;
  padding: var(--space-3) var(--space-4);
  font-size: 14px;
  line-height: var(--lh-relaxed);
  color: var(--fg-1);
  outline: none;
}
/* The document's HTML, shown in place of the surface. Same box, monospaced,
   and growable by the same handle a long body needs. */
.rich-text-source {
  display: block;
  width: 100%;
  min-height: 320px;
  padding: var(--space-3) var(--space-4);
  border: 0;
  background: var(--bg-1);
  color: var(--fg-1);
  font-family: var(--font-mono);
  font-size: var(--fs-13);
  line-height: var(--lh-relaxed);
  resize: vertical;
  outline: none;
}

/* ---- Rich-text writing surface: the authored document ----
   Load-bearing, not decoration. The editor core is headless and ships no CSS,
   Tailwind's Preflight resets heading sizes and list markers away, and the
   base reset zeroes every margin — so without these rules a heading, a list
   and a paragraph all render identically and every toolbar control looks
   inert. One rule per shape the toolbar can produce, so what an author sees
   while writing is the shape they chose. Kept in sync with components.css. */
.rich-text-surface > *:first-child {
  margin-top: 0;
}
.rich-text-surface p {
  margin: 0 0 var(--space-4);
  font-size: var(--fs-15);
  line-height: var(--lh-relaxed);
}
.rich-text-surface h2 {
  margin: var(--space-6) 0 var(--space-3);
  font-size: var(--fs-20);
  font-weight: 600;
  line-height: var(--lh-snug);
  letter-spacing: var(--tracking-tight);
}
.rich-text-surface h3 {
  margin: var(--space-5) 0 var(--space-2);
  font-size: var(--fs-16);
  font-weight: 600;
  line-height: var(--lh-snug);
}
.rich-text-surface strong {
  font-weight: 700;
}
.rich-text-surface em {
  font-style: italic;
}
.rich-text-surface a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.rich-text-surface ul,
.rich-text-surface ol {
  margin: 0 0 var(--space-4);
  padding-left: var(--space-6);
  font-size: var(--fs-15);
  line-height: var(--lh-relaxed);
}
.rich-text-surface ul {
  list-style: disc;
}
.rich-text-surface ol {
  list-style: decimal;
}
.rich-text-surface li {
  margin: 0 0 var(--space-1);
}
/* A list item holds a paragraph, so its own spacing would double the gap. */
.rich-text-surface li > p {
  margin: 0;
}
.rich-text-surface pre {
  margin: 0 0 var(--space-5);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  background: var(--bg-inverse);
  color: var(--fg-inverse);
  font-family: var(--font-mono);
  font-size: var(--fs-13);
  line-height: var(--lh-relaxed);
  overflow-x: auto;
}
.rich-text-surface pre code {
  font: inherit;
  color: inherit;
  background: none;
}
/* The callout family — one tinted block per tone, distinguishable at a glance
   from each other and from body copy. */
.rich-text-surface .callout {
  margin: 0 0 var(--space-5);
  padding: var(--space-3) var(--space-4);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  font-size: var(--fs-14);
  line-height: var(--lh-normal);
  color: var(--fg-1);
}
.rich-text-surface .callout-info {
  background: var(--info-soft);
  border-color: rgba(37, 99, 235, 0.25);
}
.rich-text-surface .callout-warn {
  background: var(--warning-soft);
  border-color: rgba(232, 149, 0, 0.3);
}
.rich-text-surface .callout-tip {
  background: var(--success-soft);
  border-color: rgba(21, 163, 74, 0.25);
}
/* An image is a block no wider than the writing surface, its proportions kept
   (help-center-article-images, design D8). */
.rich-text-surface img {
  display: block;
  max-width: 100%;
  height: auto;
}

/* ================================================================
   HELP CENTER READER (help-center-reader) — ported from the
   prototype's helpcenter stylesheet.

   Retokenized rather than transcribed: the prototype's raw accent
   pair is the brand ramp restated, so these rules read
   --accent and --accent-soft; its hard-coded greys read the neutral
   ramp; its px type and spacing read the --fs-* / --space-* scales.
   What stayed literal is what is genuinely not a ramp value — the
   hero's lighting gradient, and the translucent whites that sit ON the
   accent, which live in the token files beside --hc-hero-fg-soft.

   Three things here are load-bearing rather than decorative. The
   category grid's columns live entirely in .hc-category-grid, so
   without it the grid is a vertical list. The article layout's two
   columns live in .hc-article-layout, so without it the table of
   contents stacks above the body instead of sitting beside it. And the
   .callout family is what distinguishes an author's warning from an
   ordinary paragraph: those three class values are on the rich-text
   allowlist, the editor emits them, and until now nothing in any
   stylesheet drew them — so a warning an author deliberately marked
   rendered byte-identically to body copy.
   ================================================================ */

/* ---- Page roots ----
   Every root also carries .page-pad, the app-wide page gutter, exactly as
   the prototype puts `page-pad` on its own three roots. That is where the
   28px side inset comes from — including the hero's, which the prototype
   draws as a margin on the hero itself. */
.hc-home,
.hc-article {
  display: flex;
  flex-direction: column;
  gap: var(--space-10);
}
/* Capped and centred, as the prototype caps its article page. Without a
   measure the page sits flush left and the furniture below the body runs
   to the viewport edge. */
.hc-article {
  max-width: var(--hc-page-measure);
  margin: 0 auto;
}
/* The home and the category page take the prototype's OUTER cap, the one it
   applies through `--page-max` to every `page-pad` root. The app-wide gutter
   alone does not compose the page: past roughly 1728px the prototype's column
   stops growing and centres, while an uncapped root keeps widening with the
   shell — 2256px of content behind a 28px gutter at 2560px, which is the
   edge-to-edge reading this closes. The article page keeps its own tighter
   cap above. */
.hc-home,
.hc-category {
  max-width: var(--hc-shell-measure);
  margin: 0 auto;
}
/* The category page keeps the prototype's own rhythm rather than the 40px
   column above: 22px under the back control (not a --space-* step), 24px under the head, and 16px between the controls and the
   list (which .hc-category-articles owns). */
.hc-category {
  display: flex;
  flex-direction: column;
}
.hc-category > .hc-back-link {
  margin-bottom: 22px;
}
.hc-category > .hc-category-head {
  margin-bottom: var(--space-6);
}

/* ---- Section heads ----
   The prototype's title-plus-subtitle pair, above the category grid and
   above the recent list. */
.hc-section-head {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}
.hc-section-head h2 {
  font-family: var(--font-display);
  /* 22px and 13.5px sit between --fs-20/--fs-24 and --fs-13/--fs-14; the
     scale carries no half-step, so these are the prototype's own values. */
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--fg-1);
  margin: 0;
}
.hc-section-head .page-sub {
  margin: 0;
  font-size: 13.5px;
  color: var(--fg-2);
}

/* ---- Section wrappers ----
   Declared rather than dropped: the markup emits all four, and without a
   rule the category controls sit flush against the first article row,
   since the controls box and the list both carry margin: 0. */
.hc-categories,
.hc-recent,
.hc-related,
.hc-category-articles {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.hc-related > h2 {
  font-family: var(--font-display);
  font-size: var(--fs-16);
  font-weight: 500;
  margin: 0;
}

/* ---- Hero ----
   A centred column on the accent, as the prototype draws it. Its
   children are direct rather than wrapped in an inner element, because
   the hero's own subheading is addressed by a CHILD combinator (see
   below) and an inner wrapper would break that rule rather than the
   descendant leak it was written to close. */
.hc-hero {
  background: var(--hc-hero-bg);
  border: 0;
  border-radius: var(--radius-lg);
  /* The prototype's own 56/28/42 — none of the three is a --space-* step. */
  padding: 56px 28px 42px;
  color: var(--hc-hero-fg);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
/* The prototype's two light sources — a highlight top-right, a shadow
   bottom-left. A lighting effect over the accent rather than a ramp colour,
   which is why it sits in the token files beside the hero's own gradient. */
.hc-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: var(--hc-hero-glow);
}
/* Above the lighting layer. Sets position only, so it cannot compete
   with the measures the rules below give individual children. */
.hc-hero > * {
  position: relative;
}
.hc-hero h1 {
  font-family: var(--font-display);
  font-size: var(--fs-48);
  line-height: var(--lh-tight);
  letter-spacing: var(--tracking-tight);
  font-weight: 500;
  color: var(--hc-hero-fg);
  margin: 0 0 var(--space-3);
}
/* DIRECT children only. The hero's own subheading is the one paragraph this
   is for; the search panel nested below is a LIGHT surface, and its `color`
   sets only what its children INHERIT — a rule matching them directly beats
   that inherited value, so a descendant selector here painted the result
   count and the nothing-matched sentence white on white, and handed them the
   hero's centring margins besides. */
.hc-hero > .page-sub {
  color: var(--hc-hero-fg-soft);
  margin: 0 auto var(--space-6);
  max-width: 560px;
  /* 15.5px/1.5 is between --fs-15/--fs-16 and --lh-normal/--lh-relaxed. */
  font-size: 15.5px;
  line-height: 1.5;
}
.hc-eyebrow {
  /* 10.5px is below the bottom of the --fs-* scale. */
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--hc-hero-fg-soft);
  margin: 0 0 14px;
}
/* The Admin Partners screen's banner (partners-card-redesign, D1): the same hero,
   tightened so the cards stay near the top of the page. 28px is no --space-*
   step; --fs-30 is the step nearest the 28px the heading wants. */
.hc-hero.partners-hero {
  padding: 28px 28px var(--space-6);
  margin-bottom: var(--space-5);
}
.hc-hero.partners-hero h1 {
  font-size: var(--fs-30);
  margin-bottom: var(--space-2);
}
.hc-hero.partners-hero > .page-sub {
  margin-bottom: 0;
}
/* Scoped to the Partners tab: the shared section layout has no phone rule and
   serves other screens, which keep theirs. */
@media (max-width: 720px) {
  .settings-layout:has(.partners-admin) {
    flex-direction: column;
    gap: 1rem;
  }
  .settings-layout:has(.partners-admin) .settings-nav {
    width: 100%;
  }
}

/* ---- Search, inside the hero ---- */
.hc-search {
  width: 100%;
  max-width: 620px;
  margin: 0 auto;
  text-align: left;
}
.hc-search-field {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  background: var(--bg-1);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  box-shadow: var(--shadow-2);
}
.hc-search-field .input {
  flex: 1;
  min-width: 0;
  border: 0;
  padding: 0;
  background: transparent;
  font-size: var(--fs-15);
}
.hc-search-field .input:focus {
  border-color: transparent;
  box-shadow: none;
}
.hc-search-results {
  margin-top: var(--space-3);
  background: var(--bg-1);
  color: var(--fg-1);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  box-shadow: var(--shadow-2);
  text-align: left;
}
/* The colour is restated rather than inherited from .page-sub: this rule
   comes later in the sheet and would otherwise decide it by accident. */
.hc-search-label {
  font-size: var(--fs-12);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-3);
  margin: 0 0 var(--space-2);
}
.hc-search-results ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}
.hc-search-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2);
  margin: 0 calc(var(--space-2) * -1);
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--fg-1);
  transition: background var(--t) var(--ease);
}
.hc-search-row:hover {
  background: var(--bg-2);
}
.hc-search-icon {
  flex-shrink: 0;
  color: var(--fg-3);
}
.hc-search-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.hc-search-title {
  font-size: var(--fs-14);
  font-weight: 500;
  color: var(--fg-1);
}
.hc-search-sub {
  font-size: var(--fs-12);
  color: var(--fg-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hc-search-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-5) var(--space-4);
  text-align: center;
}

/* ---- Entry tiles, on the hero ---- */
/* Three equal tracks, as the prototype declares them. Only ONE tile renders
   (design D14), and auto-fit collapsed the two empty tracks and let that tile
   fill the whole 720px hero measure instead of a third of it. */
.hc-tiles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  /* 10px and 28px are not --space-* steps. */
  gap: 10px;
  width: 100%;
  max-width: 720px;
  margin-top: 28px;
}
/* The tile is a BUTTON since help-center-feedback-loop — it opens the
   create-ticket form in place rather than navigating — so it carries the font
   and pointer an anchor got for free from the UA. */
.hc-tile {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--hc-hero-tile);
  border: 1px solid var(--hc-hero-hairline);
  border-radius: var(--radius-md);
  color: var(--hc-hero-fg);
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: background var(--t) var(--ease), border-color var(--t) var(--ease);
}
.hc-tile:hover:not(:disabled) {
  background: var(--hc-hero-tile-hover);
  border-color: var(--hc-hero-fg-soft);
}
/* Mirrors .btn:disabled. The other three callers of this control use
   .btn variants and grey out for free; the tile carries no such rule. */
.hc-tile:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
/* The disabled contact affordance's reason line is a GRID CHILD of .hc-tiles,
   so without a column span it takes a track of its own beside the tile and
   reads as a second tile. It is also a GRANDchild of .hc-hero, so it misses
   the deliberate `.hc-hero > .page-sub` rule and would paint --fg-3 grey on
   the hero's orange. */
.hc-tiles > .page-sub {
  grid-column: 1 / -1;
  color: var(--hc-hero-fg-soft);
}
.hc-tile-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--radius);
  background: var(--hc-hero-tile-hover);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.hc-tile-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.hc-tile-label {
  font-size: var(--fs-13);
  font-weight: 500;
  color: var(--hc-hero-fg);
}
.hc-tile-sub {
  font-size: var(--fs-12);
  color: var(--hc-hero-fg-soft);
}

/* ---- Category grid ---- */
.hc-category-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
  list-style: none;
  margin: 0;
  padding: 0;
}
.hc-category-tile {
  display: flex;
  flex-direction: column;
  height: 100%;
  /* .card pads 20px; the prototype's tile pads 18px, which is not a
     --space-* step. */
  padding: 18px;
  text-decoration: none;
  color: var(--fg-1);
  transition: border-color var(--t) var(--ease), transform var(--t) var(--ease);
}
.hc-category-tile:hover {
  border-color: var(--fg-2);
  box-shadow: var(--shadow-2);
  transform: translateY(-1px);
}
.hc-category-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-3);
}
.hc-category-name {
  /* 14.5px sits between --fs-14 and --fs-15. */
  font-size: 14.5px;
  font-weight: 500;
  color: var(--fg-1);
  margin-bottom: var(--space-1);
}
.hc-category-count {
  font-family: var(--font-mono);
  font-size: var(--fs-12);
  color: var(--fg-3);
}

/* ---- Article lists (recent, category rows, related) ----
   The prototype's row: a leading glyph, the title and summary, and the
   updated date held right. The glyph and the text share a wrapper so
   every DIRECT child of the row carries real text — the same rule the
   category header follows for an absent description. */
.hc-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  /* The prototype's 2px between rows — below the bottom of --space-*. */
  gap: 2px;
}
.hc-list > li {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  /* 14px is not a --space-* step. */
  padding: 14px;
  border-bottom: 1px solid var(--border);
  transition: background var(--t) var(--ease);
  /* The containing block the row's stretched link resolves against. */
  position: relative;
}
.hc-list > li:last-child {
  border-bottom: 0;
}
.hc-list > li:hover {
  background: var(--bg-2);
}
/* The whole row is the hit area, as the prototype's row is — its row IS the
   control. Here the control stays a real anchor, because this repo's
   accessibility lint rejects a click handler on a div and a row-wide anchor
   wrapping the summary and the date would read the whole row as its own
   accessible name. So the title's own anchor grows a covering layer: the hit
   area becomes the row, the accessible name stays the title. */
.hc-list-body > a::after {
  content: "";
  position: absolute;
  inset: 0;
}
/* Keyboard focus travels with the hit area: the ring is drawn on the ROW,
   not around the title text inside it, so what is focused and what is
   clickable are the same rectangle. Inset, because the rows share edges and
   an outset ring would sit on the neighbour above. */
.hc-list-body > a:focus-visible {
  outline: none;
}
.hc-list > li:has(.hc-list-body > a:focus-visible) {
  background: var(--bg-2);
  outline: 2px solid var(--ring);
  outline-offset: -2px;
  border-radius: var(--radius-sm);
}
.hc-list-big > li {
  padding: var(--space-4) 14px;
}
.hc-list-main {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
}
.hc-list-icon {
  flex-shrink: 0;
  margin-top: 2px;
  color: var(--fg-3);
}
.hc-list-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}
.hc-list-body > a {
  font-size: var(--fs-14);
  font-weight: 500;
  color: var(--fg-1);
  text-decoration: none;
}
.hc-list-body > a:hover {
  color: var(--accent);
}
.hc-list-body .page-sub {
  margin: 0;
  font-size: var(--fs-13);
  line-height: var(--lh-normal);
  color: var(--fg-2);
}
.hc-list-meta {
  flex-shrink: 0;
  margin: 0;
  font-family: var(--font-mono);
  font-size: var(--fs-12);
  color: var(--fg-3);
}
.hc-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
}
.hc-tag {
  font-family: var(--font-mono);
  /* 10.5px is below the bottom of the --fs-* scale. */
  font-size: 10.5px;
  color: var(--fg-3);
  background: var(--bg-2);
  padding: 2px 7px;
  border-radius: var(--radius-sm);
}

/* ---- The home's list-beside-banner column ---- */
.hc-two-col {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: var(--space-8);
  align-items: start;
}
.hc-two-col > .hc-banner {
  grid-column: 2;
}
@media (max-width: 1100px) {
  .hc-two-col {
    grid-template-columns: minmax(0, 1fr);
  }
  .hc-two-col > .hc-banner {
    grid-column: 1;
  }
}

/* ---- Back control ---- The same shape as the invoice detail's back
   link, declared here so it does not depend on another page's inline
   style (one-topbar-breadcrumb, design D6). */
.hc-back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-13);
  color: var(--fg-2);
  text-decoration: none;
  white-space: nowrap;
  align-self: flex-start;
}

/* ---- Category header and controls ---- */
.hc-category-head {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}
.hc-category-icon-lg {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.hc-category-header h1 {
  font-family: var(--font-display);
  /* Declared, not inherited: the base reset zeroes h1 to the body weight, so
     a rule that sets only a size renders the page title at 400. 32px is not
     an --fs-* step (--fs-30 / --fs-36 bracket it). */
  font-size: 32px;
  font-weight: 800;
  letter-spacing: var(--tracking-tight);
  margin: 0 0 var(--space-1);
}
.hc-category-header .page-sub {
  margin: 0;
  max-width: var(--hc-measure);
  font-size: var(--fs-14);
}
.hc-category-controls {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
  padding: var(--space-3);
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.hc-category-search {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex: 0 1 300px;
  padding: 0 var(--space-3);
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.hc-category-search .input {
  border: 0;
  padding: var(--space-2) 0;
  background: transparent;
  font-size: var(--fs-13);
}
.hc-category-search .input:focus {
  border-color: transparent;
  box-shadow: none;
}
.hc-sort {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: var(--space-1);
  border: 0;
  margin-block: 0;
  padding: 0;
  min-inline-size: 0;
}
.hc-sort .field-label {
  margin: 0;
  padding: 0;
}
.hc-sort-btn {
  padding: var(--space-2) var(--space-3);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  font-family: var(--font-sans);
  font-size: var(--fs-12);
  font-weight: 500;
  color: var(--fg-2);
  cursor: pointer;
  transition: background var(--t) var(--ease), color var(--t) var(--ease);
}
.hc-sort-btn:hover {
  background: var(--bg-3);
  color: var(--fg-1);
}
.hc-sort-btn[aria-pressed="true"] {
  background: var(--bg-1);
  border-color: var(--border);
  color: var(--fg-1);
}

/* ---- The category page's one empty state ---- */
.hc-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-12) var(--space-5);
  text-align: center;
  color: var(--fg-3);
}
.hc-empty .page-sub {
  margin: 0;
  font-size: var(--fs-14);
  color: var(--fg-2);
}

/* ---- Article page ---- */
.hc-article-head {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.hc-article-head h1 {
  font-family: var(--font-display);
  /* Same omission as the category title: without a weight the base reset
     renders it at 400. 38px is not an --fs-* step. */
  font-size: 38px;
  font-weight: 500;
  line-height: var(--lh-snug);
  letter-spacing: var(--tracking-tight);
  margin: 0;
  max-width: var(--hc-measure);
  text-wrap: pretty;
}
.hc-article-meta {
  display: flex;
  align-items: center;
  /* Neither 10px nor 12.5px is a scale step. */
  gap: 10px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: var(--fg-3);
}
.hc-article-category {
  background: var(--accent-soft);
  color: var(--accent-press);
  font-family: var(--font-sans);
  font-weight: 500;
}
.hc-article-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}
.hc-article-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: var(--space-12);
  align-items: start;
}
.hc-article-layout.no-toc {
  grid-template-columns: minmax(0, 1fr);
}
/* The reading measure lives HERE rather than on .hc-article-body. In the
   prototype the body element IS the column, so the helpfulness widget, the
   related list and the contact banner all sit inside its 720px measure; here
   the sanitized body needs a container of its own, so the furniture below it
   would otherwise render the full column width — some 200px wider than every
   paragraph above it. */
.hc-article-main {
  min-width: 0;
  max-width: var(--hc-measure);
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
}
.hc-toc {
  position: sticky;
  top: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding-left: var(--space-3);
  border-left: 2px solid var(--border);
}
.hc-toc .field-label {
  margin: 0;
}
.hc-toc ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.hc-toc a {
  font-size: var(--fs-13);
  color: var(--fg-2);
  text-decoration: none;
  line-height: var(--lh-normal);
}
.hc-toc a:hover {
  color: var(--accent);
}
@media (max-width: 900px) {
  .hc-article-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .hc-toc {
    display: none;
  }
}

/* ---- The rendered article body ----
   Element selectors, because the sanitized markup carries no classes of
   its own beyond the code language marker and the callout tones. The
   reading measure is not restated here: .hc-article-main above carries it
   for the body and the furniture below it alike. */
.hc-article-body p {
  font-size: var(--fs-15);
  line-height: var(--lh-relaxed);
  color: var(--fg-1);
  margin: 0 0 var(--space-4);
  text-wrap: pretty;
}
.hc-article-body h2,
.hc-article-body h3 {
  font-family: var(--font-sans);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--fg-1);
  margin: var(--space-8) 0 var(--space-3);
  scroll-margin-top: var(--space-5);
}
.hc-article-body > :first-child {
  margin-top: 0;
}
.hc-article-body h2 {
  font-size: var(--fs-20);
}
.hc-article-body h3 {
  font-size: var(--fs-16);
}
.hc-article-body ul,
.hc-article-body ol {
  margin: 0 0 var(--space-4);
  padding-left: 22px;
  font-size: var(--fs-15);
  line-height: var(--lh-relaxed);
  color: var(--fg-1);
}
.hc-article-body li {
  margin-bottom: var(--space-1);
}
.hc-article-body a {
  color: var(--accent);
  text-decoration: underline;
}
.hc-article-body pre {
  background: var(--hc-code-bg);
  color: var(--hc-code-fg);
  padding: var(--space-4);
  border-radius: var(--radius-md);
  overflow-x: auto;
  margin: 0 0 var(--space-5);
}
.hc-article-body pre code {
  font-family: var(--font-mono);
  font-size: var(--fs-13);
  line-height: var(--lh-relaxed);
  background: transparent;
  color: inherit;
  padding: 0;
}
.hc-article-body code {
  font-family: var(--font-mono);
  font-size: var(--fs-13);
  background: var(--bg-2);
  padding: 2px 5px;
  border-radius: var(--radius-sm);
}
/* An image is a block no wider than the article, its proportions kept, on
   every viewport (help-center-article-images, design D8). */
.hc-article-body img {
  display: block;
  max-width: 100%;
  height: auto;
}
.hc-article-body > :last-child {
  margin-bottom: 0;
}

/* ---- Callouts ----
   The three tones the rich-text allowlist permits. Without these a
   warning renders exactly like body copy, which silently discards the
   distinction the author drew. */
.callout {
  border: 1px solid var(--border);
  border-left-width: 3px;
  border-radius: var(--radius);
  padding: var(--space-3) var(--space-4);
  margin: 0 0 var(--space-5);
  font-size: var(--fs-14);
  line-height: var(--lh-normal);
  color: var(--fg-1);
  background: var(--bg-2);
}
.callout > :last-child {
  margin-bottom: 0;
}
.callout-info {
  background: var(--info-soft);
  border-color: var(--info);
}
.callout-warn {
  background: var(--warning-soft);
  border-color: var(--warning);
}
.callout-tip {
  background: var(--success-soft);
  border-color: var(--success);
}

/* ---- Feedback and the contact banner ---- */
.hc-helpfulness {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
  padding: var(--space-4) var(--space-5);
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.hc-helpfulness p {
  margin: 0;
  font-size: var(--fs-14);
  font-weight: 500;
}
.hc-helpfulness .inline-error {
  flex-basis: 100%;
}
.hc-helpfulness-comment {
  flex-basis: 100%;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.hc-helpfulness-comment-actions {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}
.hc-helpfulness-more {
  margin-left: auto;
  padding: 0;
  border: none;
  background: none;
  color: var(--accent-hover);
  font-size: var(--fs-13);
  text-decoration: underline;
}
.hc-feedback-preview {
  display: block;
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
}
.hc-feedback-full {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.hc-banner {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex-wrap: wrap;
  padding: var(--space-4) var(--space-5);
  background: var(--accent-soft);
  border-color: var(--accent);
}
.hc-banner-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: var(--accent);
  color: var(--on-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.hc-banner-body {
  flex: 1;
  min-width: 0;
}
.hc-banner h2 {
  margin: 0;
  font-size: var(--fs-16);
  font-weight: 500;
}
.hc-banner .page-sub {
  margin: var(--space-1) 0 0;
}
.hc-banner .btn {
  flex-shrink: 0;
}

/* ---- Global Configuration panel ---- */
/* The "(optional)" hint beside a field label. Mirrors app/components.css; the
   New Ticket modal stopped using it when Related Order became required, which
   left the panel as its one user. */
.modal-optional {
  font-weight: 400;
  color: var(--fg-3);
  font-size: 12px;
}

/* ONE CARD for all thirteen destinations, with NO width cap of its own: it
   fills the column the System Configuration section gives it
   (help-center-support-email, ruling 9, design D42). The 620px cap this card
   used to carry was right for a single address field and is the specific thing
   the ruling calls terrible now that there are thirteen. */
.gc-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.gc-card .field {
  margin-bottom: 0;
}
.gc-warning {
  display: block;
  margin: 0;
  font-size: var(--fs-13);
  line-height: 1.5;
  color: var(--warning);
  background: var(--warning-soft);
  border-radius: 6px;
  padding: 9px 12px;
}
.gc-notice {
  display: block;
  font-size: var(--fs-13);
  line-height: 1.5;
  color: var(--success);
  background: var(--success-soft);
  border-radius: 6px;
  padding: 9px 12px;
}
.gc-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}
.gc-last-test {
  margin: 0;
}
/* The changed marker (design D40). It carries TEXT, so the colour here is the
   second channel and never the only one. */
.gc-changed {
  margin: 0;
  font-size: var(--fs-13);
  font-weight: 600;
  line-height: 1.5;
  color: var(--warning);
}
/* The save confirmation's list of changes (design D41). */
.gc-changes {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin: 0 0 var(--space-3);
  padding-left: 18px;
  font-size: var(--fs-13);
  line-height: 1.5;
}
/* TWO TOPIC DESTINATIONS PER ROW, folding to one at the breakpoint this
   repository's other two-column content grids fold at (design D42). The tracks
   are minmax(0, 1fr) rather than 1fr so a long stored address cannot force one
   column wider than its share, and the count is two rather than "as many as
   fit" because an intrinsic auto-fit rule gives three or four on a wide
   monitor. The DEFAULT destination is not one of these cells — it spans the
   card above them, since the grid's first cell would present it as the first
   topic (design D30/D42). */
.gc-destination-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-4);
}
/* Each destination is its own fieldset so its legend names it, which is what
   makes one destination's error, its test control and its changed marker belong
   to something a reader can name. */
.gc-destination {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
}
.gc-destination-name {
  padding: 0;
  font-size: var(--fs-13);
  font-weight: 600;
  color: var(--fg-1);
}
@media (max-width: 1023px) {
  .gc-destination-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
/* ---- Help Center contact page ----
   The field-to-field measure is DECLARED here, once, on the form's own column
   (help-center-support-email, design D24). The .modal-* family it replaces has
   no such rule at all, which is why the spacing looked wrong and nothing could
   be pointed at. The fields' own bottom margin is zeroed inside the column so
   exactly one rule owns the measure, and the application-wide .field class is
   left alone: retuning it would be a global visual change made from inside a
   support-email story. */
.hc-contact {
  max-width: var(--hc-page-measure);
  margin: 0 auto;
  /* The page's own vertical rhythm, which nothing declared before: the base
     reset zeroes every margin, so the heading block and the
     card sat flush against one another at 0px. The step is the article page's
     own root gap — .hc-article, the page this form is reached from — rather
     than a measure invented for this screen. */
  display: flex;
  flex-direction: column;
  gap: var(--space-10);
}
.hc-contact-head {
  /* Title and subtitle are one block, spaced as every other page head in the
     application spaces them (.page-title's 3px, .hc-category-header h1's
     --space-1), so the pair reads as a unit against the page gap above it. */
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}
.hc-contact-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}
.hc-contact-fields {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.hc-contact-fields .field {
  margin-bottom: 0;
}
.hc-contact-footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-2);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border);
}
/* The confirmation of the one action this page performs, carrying the same
   treatment the Global Configuration panel's success notice carries: an
   announced live region, the success colour and its soft ground. */
.hc-contact-sent {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--fs-13);
  line-height: 1.5;
  color: var(--success);
  background: var(--success-soft);
  border-radius: 6px;
  padding: 9px 12px;
}

/* ================================================================
   Affiliate Panel (affiliate-panel-board-screen). KPI metric cards
   ported from prototype src/HomeStyles.jsx; aff-* widget classes
   from prototype styles/affiliates.css. The calendar/preset/day
   classes were ported by affiliate-board-date-range-filter (below).
   Deliberately NOT ported: the search-icon class — its control is
   descoped (design contract). .sparkline was ported later by
   affiliate-widgets-real-data, and .delta and .mc-prefix by
   commission-usd-total.
   .dtable tfoot td WAS also skipped here and has since been ported
   above by the Commission Report, which introduced the first tfoot
   in a .dtable. The metric card here is not interactive, so the
   prototype's cursor:pointer and hover lift are dropped.
   ================================================================ */
.metric-row {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}
.metric-row.cols-3 {
  grid-template-columns: repeat(3, 1fr);
}
@media (max-width: 700px) {
  .metric-row.cols-3 {
    grid-template-columns: 1fr;
  }
}
.metric-card {
  text-align: left;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  font-family: inherit;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.mc-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.mc-kicker {
  font-family: var(--font-sans);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-3);
  font-weight: 600;
}
.mc-value-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
}
.mc-value {
  font-family: var(--font-sans);
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--accent);
  font-feature-settings: "tnum" on;
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
}
.mc-unit {
  font-family: var(--font-sans);
  font-size: 14px;
  color: #5c5c5c;
  font-weight: 500;
  margin-left: 3px;
}
/* .mc-prefix and .delta: ported from prototype src/HomeStyles.jsx by
   commission-usd-total, for the Commission and Shipped orders cards. */
.mc-prefix {
  font-size: 13px;
  font-weight: 600;
  color: var(--fg-2);
  margin-right: 1px;
}
.delta {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 999px;
}
.delta.up {
  color: var(--success);
  background: rgba(42, 140, 84, 0.1);
}
.delta.down {
  color: var(--danger);
  background: var(--danger-soft);
}
.delta.neutral {
  color: var(--fg-3);
  background: var(--cream-100);
}
/* The Commission card's per-currency breakdown (commission-usd-total,
   design D4), revealed on pointer hover only, styled after the shared
   .tooltip card. visibility, not display, so the reveal can transition. */
.mc-breakdown {
  position: relative;
}
.mc-breakdown-pop {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 30;
  width: 260px;
  padding: 12px 14px;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 8px 28px rgba(20, 14, 4, 0.14);
  color: var(--fg-2);
  font-size: 12.5px;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--t) var(--ease), visibility var(--t) var(--ease);
}
.mc-breakdown:hover .mc-breakdown-pop {
  opacity: 1;
  visibility: visible;
}
.mc-breakdown-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 3px 0;
  font-variant-numeric: tabular-nums;
}
.mc-breakdown-row > :first-child {
  color: var(--fg-3);
}
.mc-breakdown-total {
  font-weight: 600;
  color: var(--fg-1);
  padding-bottom: 8px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.mc-breakdown-total > :first-child {
  color: inherit;
}
.mc-breakdown-total > :last-child {
  color: var(--accent);
}
.mc-hint-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
}
.mc-hint {
  font-size: 12px;
  color: #5c5c5c;
  line-height: 1.3;
}

.aff-card-title {
  font-family: var(--font-display);
  font-size: 16px;
  margin: 0;
}
.aff-grid2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.aff-grid3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
@media (max-width: 1280px) {
  .aff-grid3 {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 980px) {
  .aff-grid2 {
    grid-template-columns: 1fr;
  }
}
.aff-chart-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 6px;
  padding: 42px 16px;
  color: var(--fg-3);
}
.aff-bar-row {
  display: grid;
  grid-template-columns: 30px 1fr 58px;
  align-items: center;
  gap: 10px;
}
.aff-bar {
  height: 8px;
  border-radius: 99px;
  background: var(--cream-100);
  overflow: hidden;
}
.aff-bar i {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: 99px;
}
.aff-legend {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  min-width: 0;
}
.aff-legend-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
}
.aff-dot {
  width: 9px;
  height: 9px;
  border-radius: 3px;
  flex: none;
}
.aff-rank-row {
  display: grid;
  grid-template-columns: 24px 1fr 58px 84px;
  gap: 10px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.aff-rank-row:last-child {
  border-bottom: none;
}
.aff-rank-head {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--fg-3);
  cursor: default;
  padding: 4px 0 8px;
}
.aff-rank-num {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent);
  font-weight: 600;
}

/* The date-range calendar (affiliate-board-date-range-filter, design
   contract) — ported from prototype styles/affiliates.css, and declared
   IDENTICALLY in app/components.css (this file is unlayered and outranks
   it wherever the two disagree, so the two copies must not disagree). The
   prototype's .aff-day.dim is deliberately not ported: a future day is
   DISABLED rather than dimmed — a mechanism, not an appearance — so its
   styling hangs off :disabled. .aff-cal-pop gains left/margin/color the
   prototype lacks: the popover is a native non-modal <dialog>, whose UA
   stylesheet would otherwise centre it (inset auto-margins) and force
   CanvasText. */
.aff-cal-pop {
  position: absolute;
  right: 0;
  left: auto;
  margin: 0;
  color: inherit;
  top: calc(100% + 6px);
  z-index: 60;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-2);
  padding: 14px;
  display: flex;
  gap: 14px;
}
/* Mirrors components.css: in the Affiliate Payment toolbar the trigger is the
   first control, so the popover opens rightwards instead of under the sidebar. */
.aa-toolbar .aff-cal-pop {
  left: 0;
  right: auto;
}
.aff-presets {
  display: flex;
  flex-direction: column;
  gap: 2px;
  /* Wide enough that no preset label wraps ("Older than 30 days"). */
  min-width: 152px;
  border-right: 1px solid var(--border);
  padding-right: 12px;
}
.aff-preset {
  text-align: left;
  padding: 7px 10px;
  border-radius: 7px;
  font-size: 13px;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--fg-2);
  font-family: inherit;
}
.aff-preset:hover {
  background: var(--bg-2);
}
.aff-preset.active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}
/* The Custom marker (date-range-custom-hint): reached by picking two days, so it
   reads as unavailable while another row is marked; its hint is the shared
   .tooltip, opened below the row from its left edge. */
.aff-preset-tip {
  display: flex;
  flex-direction: column;
}
.aff-preset-custom[aria-disabled="true"] {
  color: var(--fg-3);
  opacity: 0.45;
  cursor: not-allowed;
}
.aff-preset-custom[aria-disabled="true"]:hover {
  background: none;
}
.cal {
  width: 232px;
}
.cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.cal-title {
  font-size: 13px;
  font-weight: 600;
}
.cal-dow,
.cal-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}
.cal-dow span {
  font-size: 10.5px;
  color: var(--fg-3);
  text-align: center;
  padding: 4px 0;
}
.cal-day {
  height: 29px;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  cursor: pointer;
  border-radius: 7px;
  color: var(--fg-1);
  font-family: inherit;
}
.cal-day:hover {
  background: var(--bg-2);
}
.cal-day:disabled {
  color: var(--fg-3);
  opacity: 0.45;
  cursor: default;
  background: none;
}
.cal-day.inrange {
  background: var(--accent-soft);
  border-radius: 0;
}
/* Today in the shared calendar: a quiet ring, under .edge's solid fill
   when today is also the chosen day. */
.cal-day.today {
  box-shadow: inset 0 0 0 1px var(--border-strong);
}
/* The previewed range endpoint (design D17): a SOFTER reading of
   .cal-day.edge — the accent as a ring and text on the .inrange wash
   rather than as a solid fill — sitting visibly between the two. No
   opacity: .cal-day:disabled already dims with it and the two would
   compound. Declared BEFORE .edge so source order can never let a
   preview class win over a committed edge, and IDENTICALLY in
   app/components.css. */
.cal-day.preview-edge {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
  box-shadow: inset 0 0 0 1px var(--accent);
}
.cal-day.edge {
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
}
/* The shared single-date picker (shared-date-picker, design D2). The field
   wears .input; its ring follows :focus-within, since focus sits on a button
   inside it. The calendar card is the TablePopover element, and the native
   <dialog> inside it is reset so its UA box (absolute, centred, bordered,
   CanvasText) adds nothing. Declared identically in app/components.css. */
.date-field {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  font-size: 13px;
}
/* :focus-within does not reach the field from the top-layer calendar, so the
   open state carries the ring explicitly. */
.date-field:focus-within,
.date-field.is-open {
  border-color: var(--ring);
}
/* The From/To rows: a fixed label column, so both fields start at the same x
   and share one width. */
.filter-date-row {
  display: grid;
  grid-template-columns: 34px 1fr;
  align-items: center;
  gap: 8px;
  padding: 3px 0;
  font-size: 13px;
  color: var(--fg-1);
}
.date-field.is-disabled {
  background: var(--bg-2);
  color: var(--fg-3);
}
.date-field-btn {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  border: none;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.date-field-btn.is-empty {
  color: var(--fg-3);
}
.date-field-btn:disabled {
  cursor: not-allowed;
}
/* One focus ring on the field: the trigger draws none of its own inside it
   (date-field-polish D2). */
.date-field-btn:focus-visible {
  outline: none;
}
.cal-pop {
  margin: 0;
  padding: 12px;
  color: var(--fg-1);
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-2);
}
.cal-pop dialog {
  position: static;
  margin: 0;
  padding: 0;
  border: none;
  background: none;
  color: inherit;
}
.cal-foot {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}
/* A card inside an element carrying aria-busy (the roles list while it
   is busy) is dimmed, so its previous contents are never presented as
   current. Declared identically in app/components.css. */
[aria-busy="true"] .card {
  opacity: 0.45;
}

/* The Affiliate Report and Affiliate Payment pending wrappers show their
   loading placeholders instead of dimmed figures, so a card inside one
   is never dimmed (affiliate-range-skeletons). Declared identically in
   app/components.css. */
.report-pending[aria-busy="true"] .card {
  opacity: 1;
}

/* Affiliate Panel widgets on real data (affiliate-widgets-real-data):
   the empty-state badge from prototype styles/affiliates.css and the
   KPI sparkline from prototype src/HomeStyles.jsx. */
.aff-empty-badge {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  background: var(--cream-100);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--fg-3);
  margin-bottom: 4px;
}
.sparkline {
  width: 72px;
  height: 22px;
  flex-shrink: 0;
}
.spark-line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.spark-area {
  display: none;
}

/* The announcement authoring form (announcement-authoring-form, design D9):
   its own two classes, deliberately not the article editor's — borrowing a
   neighbour's class name is how a stylesheet becomes impossible to change. */
.announcement-editor-footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-2);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border);
}
.announcement-editor-check {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* ---------- Status custom dropdown ----------
   Mirrored from app/components.css so both stylesheets declare the same
   component vocabulary (announcement-lifecycle-transitions, TapD 1003069,
   design D6). The announcement editor's State field and the Help Center
   article editor's State field are both built from these classes; until now
   they were declared in the bundled stylesheet only, so the statically linked
   one rendered them untoned. */
.status-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: var(--fs-13);
  font-weight: 500;
  color: var(--fg-1);
  cursor: pointer;
  min-width: 160px;
  justify-content: space-between;
  transition: border-color var(--t) var(--ease), background var(--t) var(--ease);
}
.status-trigger:hover {
  background: var(--bg-2);
  border-color: var(--border-strong);
}
.status-trigger[aria-expanded="true"] {
  border-color: var(--ring);
}
.status-trigger:disabled {
  background: var(--bg-2);
  color: var(--fg-3);
  cursor: not-allowed;
}
.status-trigger:disabled:hover {
  background: var(--bg-2);
  border-color: var(--border);
}

.status-dropdown-panel {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 100%;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-2);
  z-index: 50;
  /* It sits on a [popover] element: cancel the UA margin, padding and colour. */
  margin: 0;
  padding: 0;
  color: inherit;
  max-height: 280px;
  overflow-y: auto;
}

/* The shared Select's sizes (shared-select, TapD 1004138). */
.status-trigger.sm {
  height: 28px;
  min-width: 0;
  padding: 0 8px 0 9px;
  gap: 6px;
  font-size: 12px;
  border-radius: 6px;
}
.status-dropdown-panel.sm .status-option {
  font-size: 12px;
  padding: 6px 10px;
}
.status-trigger.md {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  font-size: 14px;
  font-weight: 400;
  border-radius: 8px;
}
.select-placeholder {
  color: var(--fg-3);
}

/* Rendered as <button role="option" aria-selected> elements (the shared Select) */
.status-option {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  background: none;
  border: 0;
  font-family: inherit;
  text-align: left;
  padding: 8px 10px;
  cursor: pointer;
  font-size: var(--fs-13);
  color: var(--fg-1);
  justify-content: space-between;
  transition: background var(--t-fast) var(--ease);
}
.status-option:hover {
  background: var(--bg-2);
}
.status-option[aria-selected="true"] {
  background: var(--accent-soft);
}
.status-option-left {
  display: flex;
  align-items: center;
  gap: 8px;
}
.status-option-check {
  color: var(--accent);
  flex-shrink: 0;
  opacity: 0;
}
.status-option[aria-selected="true"] .status-option-check {
  opacity: 1;
}

/* The Announcements tab's row-action group and its order caption
   (announcement-display-order, TapD 1003070, design D6).

   Deliberately NOT the shared .row-actions. That class is declared in both
   stylesheets but not identically - design.css carries the flex box, the gap
   and a hover reveal that components.css does not - so adopting it would mean
   inheriting that drift, and its opacity-0-until-hover would hide the
   always-visible Open control this panel already ships. */
.announcement-row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
}
.announcement-order-note {
  margin: 0 0 var(--space-3);
}

/* The State field's width (announcement-lifecycle-transitions, TapD 1003069,
   design D6). The status dropdown's option panel takes its width from the
   field, and the announcement form is one full-width column rather than the
   article editor's grid, so without a bound the control would run the width of
   the card and the panel with it. */
.announcement-state-field {
  max-width: 260px;
}

/* Announcement strip (announcement-reader-surfaces, TapD 1003071-1003075,
   design D4): the reader-facing banner. It is the shell root's FIRST child --
   above the sidebar and the top bar, spanning the whole window -- and it is a
   flow element with no fixed or absolute positioning, so the application below
   is DISPLACED by exactly the strip's own height and nothing sits behind it.
   That is also why the component renders nothing at all when there is nothing
   to announce, rather than an empty bar that would cost every page its padding
   forever. The ground is the corporate orange: --brand-600, the ramp
   token the Help Center hero gradient's own first stop already takes, and the
   ink on it is --on-accent. Not --accent: that is --brand-500, a
   lighter orange and the wrong one for this surface.

   Three children, always: the lead group, the body, the tail group. The two
   groups reserve the SAME width -- one custom property read twice -- so the
   body is centred against the BAR and not against the space the controls leave
   over. Reserving it is the whole point: an announcement with no arrows and one
   with two arrows and a close read as centred in the same place, and the text
   never slides sideways as controls come and go. The slot is the widest the
   tail can be: two 28px controls, the two 12px gaps beside them, and a
   two-digit "10 of 12" position, rounded up. */
.announcement-strip {
  --announcement-end-slot: 136px;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 32px;
  padding: 0 28px;
  width: 100%;
  background: var(--brand-600);
  color: var(--on-accent);
  flex-shrink: 0;
  position: relative;
}
/* A lone announcement has no arrows and no position, so the ends hold only the
   close (28px) and the message takes the rest. :where keeps this at the base
   rule's specificity, so the phone override below still wins by order. */
.announcement-strip:where(:not(:has(.announcement-strip-step))) {
  --announcement-end-slot: 28px;
}
/* The two end groups. Identical apart from which end they pack against: same
   basis, same grow, same shrink, same floor, so they are the same width at
   every viewport and the middle is therefore the bar's middle. The floor is
   what keeps them equal when the body is long enough to squeeze them -- without
   it the lead would collapse to one arrow while the tail held three controls,
   and the body would sit off-centre by half the difference. */
.announcement-strip-lead {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  flex: 1 1 var(--announcement-end-slot);
  min-width: var(--announcement-end-slot);
}
.announcement-strip-tail {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex: 1 1 var(--announcement-end-slot);
  min-width: var(--announcement-end-slot);
}
/* The body wraps on a narrow viewport and never pushes the page sideways: it is
   the flex item that gives, so the arrows and the close stay reachable. It is
   centred horizontally by the equal end groups and vertically by the strip's
   own align-items, and its own text is centred inside it so a wrapped second
   line is centred too. The entry animation is opacity ALONE -- no transform and
   no size -- so it cannot move the body off centre mid-flight and cannot make
   the bar's height jump. It plays on the node the component mounts for each
   announcement, so stepping restarts it rather than queueing it. */
/* The message column: the clamped body plus, when it is cut short, the full
   text. It stretches to the bar's full height so the pointer never crosses a
   gap on its way down into the popover, and it centres the body inside it. */
.announcement-strip-message {
  flex: 0 1 auto;
  min-width: 0;
  align-self: stretch;
  display: flex;
  align-items: center;
  justify-content: center;
}
/* One line on a desktop, cut with an ellipsis; the full text is the popover
   below. The clamp counts lines across the body's own paragraphs too. */
.announcement-strip-body {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
  overflow: hidden;
  min-width: 0;
  text-align: center;
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--on-accent);
  overflow-wrap: anywhere;
  animation: announcement-step-in var(--t) var(--ease) both;
}
/* A phone's tap-to-read: the bar grows to the whole message for a few seconds,
   painted OVER the page rather than pushing it down (the component cancels the
   extra height with a negative bottom margin). */
.announcement-strip-expanded {
  z-index: 60;
}
.announcement-strip-expanded .announcement-strip-body {
  -webkit-line-clamp: unset;
}
/* A desktop's full message, on hover or focus of a cut-short body. Hung from
   the bar's centre; the transparent top padding bridges the pointer across. */
.announcement-strip-popover {
  display: none;
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 80;
  width: max-content;
  max-width: min(640px, calc(100% - 32px));
  padding-top: 10px;
}
.announcement-strip-popover-body {
  padding: 8px 12px;
  background: var(--bg-1);
  color: var(--fg-1);
  border: 1px solid var(--border);
  border-radius: 9px;
  box-shadow: var(--shadow-2);
  font-size: 13px;
  line-height: 1.4;
  text-align: left;
  overflow-wrap: anywhere;
}
.announcement-strip-popover-body a {
  color: var(--accent);
  text-decoration: underline;
}
@media (min-width: 768px) {
  .announcement-strip-message[data-truncated]:hover .announcement-strip-popover,
  .announcement-strip-message[data-truncated]:has(:focus-visible) .announcement-strip-popover {
    display: block;
  }
}
@keyframes announcement-step-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
/* A reader who has asked for reduced motion gets the change instantly. The
   repo declares no reduced-motion convention of its own, so this is the first
   one and it is scoped to the surface that introduced the motion rather than
   dropped over the whole application inside a story about announcements. */
@media (prefers-reduced-motion: reduce) {
  .announcement-strip-body {
    animation: none;
  }
}
/* One control: an arrow or the close, and the close takes exactly the arrows'
   treatment. Borderless and groundless -- a white glyph sitting directly on the
   orange, dimmed at rest so that hover and keyboard focus can each brighten it
   (announcement-strip-polish). Sized to a comfortable target and never
   shrinking, so the strip cannot squeeze a control out of reach. */
.announcement-strip-nav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--on-accent);
  opacity: 0.75;
  cursor: pointer;
}
.announcement-strip-nav:hover {
  opacity: 1;
}
.announcement-strip-nav:focus-visible {
  opacity: 1;
  outline: 2px solid var(--on-accent);
  outline-offset: 2px;
}
.announcement-strip-position {
  flex-shrink: 0;
  font-size: 12.5px;
  color: var(--on-accent);
  font-variant-numeric: tabular-nums;
}
/* The position indicator at or below the cap: one dot per visible announcement,
   the displayed one at full strength. Purely indicative, never a control, and
   hidden from assistive technology -- the numeric statement, taken out of flow
   by its modifier below, is what a screen reader hears in both states. */
.announcement-strip-dots {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.announcement-strip-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--on-accent);
  opacity: 0.45;
  flex-shrink: 0;
}
.announcement-strip-dot-current {
  background: var(--on-accent);
  opacity: 1;
}
/* Hides the numeric statement while the dot row renders: out of flow, so the
   tail owes it no width, and never display none, because the hidden statement
   is the one place the position still reaches a reader who cannot see the
   dots. Same pattern the organizations table uses for its hidden heading. */
.announcement-strip-position-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
/* Below the shell's own mobile breakpoint the bar is too narrow to reserve the
   same slot at both ends: two 136px ends out of a 375px bar leave the
   announcement a couple of characters wide and grow the strip into a wall of
   orange. A phone therefore drops the reservation -- the ends shrink to the
   controls they hold and the body takes the width that is actually there. The
   announcement is still centred in what remains, and the strip is still the
   first thing in the layout; what a phone gives up is the guarantee that the
   centre does not shift when a control appears, which is a guarantee worth
   paying for at 375px only if the announcement is still readable, and it is
   not. This is the same breakpoint at which the sidebar becomes a drawer. */
@media (max-width: 767px) {
  .announcement-strip {
    --announcement-end-slot: 0px;
    padding: 6px 12px;
    /* Sideways drags are the strip's own swipe; vertical ones still scroll. */
    touch-action: pan-y;
  }
  .announcement-strip-lead,
  .announcement-strip-tail {
    flex: 0 0 auto;
    min-width: 0;
  }
  .announcement-strip-message {
    flex: 1 1 auto;
  }
  /* Up to three lines on a phone, a size smaller, and a tap on a cut-short
     body opens it. */
  .announcement-strip-body {
    -webkit-line-clamp: 3;
    font-size: 12.5px;
    line-height: 1.35;
  }
  .announcement-strip-message[data-truncated] {
    cursor: pointer;
  }
  /* No step arrows on a phone: the room goes to the text, the dots still show
     the position and the strip still advances on its own. */
  .announcement-strip-step {
    display: none;
  }
}

/* The announcement log (announcement-reader-surfaces, TapD 1003079-1003082):
   the reader's record of everything ever published, in the account area. Its
   empty line reuses .page-sub and its failure reuses .inline-error -- the
   reader-facing treatments the Help Center listings already use, rather than a
   third one. */
.announcement-log {
  display: flex;
  flex-direction: column;
  gap: 12px;
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
}
.announcement-log-entry {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  padding: 14px 16px;
}
/* The entry's date and its marker, together, so a screen reader reads them as
   this entry's own rather than as decoration out of context. */
.announcement-log-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 8px;
  font-size: 12.5px;
  color: var(--fg-2);
}
.announcement-log-marker {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--ok-soft, var(--bg-2));
  color: var(--fg-2);
  font-size: 12px;
}
.announcement-log-body {
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--fg);
  overflow-wrap: anywhere;
}
/* A link in an announcement has to LOOK like a link (TapD 1003075). In the log
   it takes the treatment the Help Center article body already gives one. In the
   strip it cannot: the accent IS the strip's ground there, so the link carries
   the strip's own ink and keeps the underline that marks it. Descendant rules
   and not classes: the anchor comes from the stored markup and carries none. */
.announcement-strip-body a {
  color: var(--on-accent);
  text-decoration: underline;
}
.announcement-log-body a {
  color: var(--accent);
  text-decoration: underline;
}
/* A Modal Announcement's entry in the log (modal-announcement, design D12):
   its title heads the entry, its body takes .hc-article-body, and its images
   are held to the entry's width with their proportions kept, as the dialog
   holds them. */
.announcement-log-title {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 600;
  color: var(--fg);
}
.announcement-log-body img {
  display: block;
  max-width: 100%;
  height: auto;
}
/* The Modal Announcement's body region inside its dialog
   (modal-announcement, design D5): it scrolls within the dialog when the body
   is taller than the viewport allows, and holds every image to its own width
   with its proportions kept. */
.announcement-modal-body {
  max-height: 60vh;
  overflow-y: auto;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--fg);
  overflow-wrap: anywhere;
}
.announcement-modal-body img {
  display: block;
  max-width: 100%;
  height: auto;
}
/* =========================================================
   Toasts — DayOne DS v2 (toast-system-and-dev-playground)
   White card, hairline border, a 3px tone rail on the left and the tone's
   glyph on a filled tone square. Top-right stack, newest first, four visible.

   Ported from the prototype's styles/toasts.css. Mirrored between
   app/components.css and public/design.css: design.css is linked statically
   and carries no cascade layer, so it outranks the bundled layer and a rule
   present in only one of the two files is one that does not reliably apply.
   ========================================================= */
.toast-stack {
  position: fixed;
  top: 64px;
  right: 20px;
  /* BELOW .modal-backdrop (200), deliberately. Everything outside the modal's
     portal is inert while a dialog is open, so a toast painting OVER one would
     be visible and unclickable. */
  z-index: 190;
  display: flex;
  flex-direction: column;
  gap: 10px;
  /* An explicit width, not only a maximum: a fixed-position flex column is
     shrink-to-fit, so the stack would otherwise track its widest card and a
     lone short toast would render narrower than its neighbours. */
  width: 380px;
  max-width: calc(100vw - 32px);
  pointer-events: none;
}
.toast-stack > * {
  pointer-events: auto;
  flex: none;
}
.toast-stack.expanded {
  max-height: calc(100vh - 84px);
  overflow-y: auto;
  padding: 0 4px 0 2px;
  scrollbar-width: thin;
}
.toast-stack.expanded .toast-more {
  position: sticky;
  bottom: 0;
  z-index: 2;
}

/* The card is scoped by the attribute the host always emits, never by a bare
   `.toast`: three screens still render the pre-host status pill as
   `class="toast"`, and THIS file carries no cascade layer, so a bare card rule
   here would outrank the layered rule in app/components.css that defends them
   whatever its specificity — the pills would lose their position, their dark
   ground and their radius. The lab's frozen specimens carry the attribute too,
   since ToastCard emits it unconditionally and `id` is required on a
   ToastEntry. */
.toast[data-toast-id] {
  position: relative;
  display: grid;
  grid-template-columns: 30px 1fr auto;
  gap: 12px;
  align-items: start;
  overflow: hidden;
  padding: 14px 12px 15px 17px;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-2);
  animation: toast-in 240ms var(--ease) both;
}
.toast[data-toast-id]:has(.toast-timer) {
  padding-bottom: 18px;
}
/* The exit takes its duration from --toast-exit-ms, which the host writes on
   the stack from the exported TOAST_EXIT_MS — one number, so the animation and
   the removal timer cannot drift apart. */
.toast.out {
  animation: toast-out var(--toast-exit-ms) var(--ease) both;
}
/* The playground's specimen cards: no entrance, and nothing dismisses them. */
.toast.frozen {
  animation: none;
  box-shadow: var(--shadow-1);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translate3d(28px, -4px, 0) scale(0.97);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes toast-out {
  from {
    opacity: 1;
    /* Set inline at dismiss time from the card's live matrix, so dismissing
       during the entrance continues the slide instead of teleporting first. */
    transform: translate3d(var(--toast-from-x, 0px), 0, 0);
  }
  to {
    opacity: 0;
    transform: translate3d(20px, 0, 0) scale(0.98);
  }
}
/* The override's selector list mirrors the selectors it overrides, one for
   one. A media query adds no specificity, so a bare `.toast` here (0,1,0) is
   outranked by the card rule and by the pill rule, both of which carry an
   attribute selector — measured in the browser as a card still animating for
   240ms while the reduced-motion query matched. Ties are won by source order
   and this block is last, so matching their specificity is enough. */
@media (prefers-reduced-motion: reduce) {
  .toast[data-toast-id],
  .toast.out,
  .toast:not([data-toast-id]) {
    animation-duration: 1ms;
  }
}

/* left rail — echoes the DS numbered-card border */
.toast-rail {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--toast-tone);
}

/* icon container — the DS signature filled square, white glyph */
.toast-icon {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--toast-tone);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.toast-spin {
  width: 15px;
  height: 15px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  animation: dayone-spin 700ms linear infinite;
}
@keyframes dayone-spin {
  to {
    transform: rotate(360deg);
  }
}
/* The button spinner's ring still renders, static: a busy affordance the
   viewer's preference damps rather than removes (button-pending-state D5).
   It sits with the keyframe it turns off rather than with the rule that
   declares it, so it wins on source order. Declared identically in the
   other stylesheet. */
@media (prefers-reduced-motion: reduce) {
  .btn[aria-busy="true"]::after,
  .iconbtn.busy-spinner[aria-busy="true"]::after {
    animation: none;
  }
}

.toast-body {
  min-width: 0;
  padding-top: 1px;
}
.toast-title {
  font-size: var(--fs-14);
  font-weight: 700;
  line-height: 1.3;
  color: var(--fg-1);
  letter-spacing: -0.01em;
}
.toast-msg {
  font-size: var(--fs-13);
  line-height: 1.45;
  color: var(--fg-2);
  margin-top: 3px;
  text-wrap: pretty;
}
/* A titleless message is the card's OWN line, not a subordinate one. */
.toast-msg.solo {
  font-size: var(--fs-14);
  font-weight: 600;
  color: var(--fg-1);
  margin-top: 0;
  line-height: 1.35;
}
.toast-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-3);
  margin-top: 6px;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.toast-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 9px;
}
.toast-act {
  appearance: none;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
  font-size: var(--fs-13);
  font-weight: 700;
  color: var(--toast-tone);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: opacity var(--t-fast) var(--ease);
}
.toast-act:hover {
  opacity: 0.7;
}
.toast-act.quiet {
  color: var(--fg-2);
  font-weight: 600;
}

.toast-x {
  appearance: none;
  background: none;
  border: 0;
  padding: 4px;
  margin: -3px -2px 0 0;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--fg-3);
  display: flex;
  flex: none;
  transition: color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.toast-x:hover {
  color: var(--fg-1);
  background: var(--bg-2);
}

/* the remaining-time indicator */
.toast-timer {
  position: absolute;
  left: 17px;
  right: 12px;
  bottom: 7px;
  height: 2px;
  border-radius: 999px;
  background: var(--bg-2);
  overflow: hidden;
}
.toast-timer > i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--toast-tone);
  opacity: 0.75;
  transform-origin: left center;
  animation: toast-timer linear both;
}
/* Paused by the STACK's state, not by the card's own :hover: the hold is taken
   on the stack, so a pointer resting on one card holds every timer and every
   indicator has to stop with them. */
.toast-stack.paused .toast-timer > i {
  animation-play-state: paused;
}
@keyframes toast-timer {
  from {
    transform: scaleX(1);
  }
  to {
    transform: scaleX(0);
  }
}

/* tones — each sets the one variable the rail, the square, the action label
   and the indicator all read */
.toast.t-success {
  --toast-tone: var(--success);
}
.toast.t-error {
  --toast-tone: var(--danger);
}
.toast.t-warning {
  --toast-tone: var(--warning);
}
.toast.t-info {
  --toast-tone: var(--info);
}
.toast.t-brand {
  --toast-tone: var(--accent);
}
.toast.t-neutral {
  --toast-tone: var(--cream-900);
}
.toast.t-loading {
  --toast-tone: var(--cream-500);
}

/* the overflow control */
.toast-more {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px 8px 12px;
  background: var(--cream-900);
  color: var(--fg-inverse);
  border-radius: var(--radius);
  font-size: var(--fs-12);
  font-weight: 600;
  box-shadow: var(--shadow-2);
  animation: toast-in 200ms var(--ease) both;
}
.toast-more button {
  appearance: none;
  background: none;
  border: 0;
  color: var(--brand-300);
  font: inherit;
  cursor: pointer;
  padding: 0;
}
.toast-more button:hover {
  color: #fff;
}
.toast-more .tm-open {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #fff;
}
.toast-more .tm-open:hover {
  color: var(--brand-300);
}

/* Too narrow for the fixed width: the stack yields to the viewport and renders
   within the gutters rather than overflowing it. */
@media (max-width: 640px) {
  .toast-stack {
    left: 12px;
    right: 12px;
    width: auto;
  }
}

/* ---------- Search overlay (prototype styles/app.css:1250-1460, TapD 1003427) ---------- */
.search-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 80px 24px 32px;
  z-index: 200;
  animation: var(--overlay-in);
}
@keyframes overlay-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
.search-backdrop {
  position: absolute;
  inset: 0;
  background: var(--overlay-bg);
  backdrop-filter: var(--overlay-blur);
}
.search-shell {
  position: relative;
  width: 100%;
  max-width: 720px;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--panel-shadow);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 140px);
  overflow: hidden;
  animation: var(--panel-in);
}

.search-hero {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-1);
}
.search-ico {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--accent-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.search-input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font-family: var(--font-sans);
  font-size: 17px;
  color: var(--fg-1);
}
.search-input::placeholder {
  color: var(--fg-3);
}
.search-clear {
  width: 26px;
  height: 26px;
  border: 0;
  background: transparent;
  color: var(--fg-2);
  border-radius: 999px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.search-clear:hover {
  background: var(--bg-2);
  color: var(--fg-1);
}

.search-body {
  flex: 1;
  overflow: auto;
  padding: 10px 8px 16px;
}
.search-section {
  padding: 8px 8px 4px;
}
.search-section + .search-section {
  border-top: 1px solid var(--border);
  margin-top: 6px;
  padding-top: 14px;
}
.search-section-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px 8px;
  font-size: 11.5px;
  color: var(--fg-3);
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.search-clear-all {
  margin-left: auto;
  background: transparent;
  border: 0;
  color: var(--fg-3);
  font-size: 11px;
  cursor: pointer;
  text-transform: none;
  letter-spacing: 0;
}
.search-clear-all:hover {
  color: var(--accent);
}

.search-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 0;
  background: transparent;
  border-radius: 10px;
  cursor: pointer;
  text-align: left;
  transition: background var(--t) var(--ease);
}
.search-row:hover {
  background: var(--bg-2);
}
.search-row-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--bg-2);
  color: var(--fg-2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.search-row-main {
  flex: 1;
  min-width: 0;
}
.search-row-title {
  font-size: 13.5px;
  color: var(--fg-1);
  font-weight: 500;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}
.search-row-sub {
  font-size: 12px;
  color: var(--fg-2);
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}
.search-row-kind {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--fg-3);
  padding: 2px 7px;
  background: var(--bg-2);
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.search-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 8px 6px;
}
.search-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  background: var(--bg-1);
  color: var(--fg-1);
  border-radius: 999px;
  font-size: 12.5px;
  cursor: pointer;
  transition: background var(--t) var(--ease), border-color var(--t) var(--ease);
}
.search-chip:hover {
  background: var(--bg-2);
  border-color: var(--border-strong);
}

.search-jump {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 2px 8px 8px;
}
.search-jump-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  background: var(--bg-1);
  border-radius: 10px;
  color: var(--fg-1);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--t) var(--ease), border-color var(--t) var(--ease);
}
.search-jump-item:hover {
  background: var(--bg-2);
  border-color: var(--accent);
  color: var(--accent);
}

.search-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 26px 14px;
  color: var(--fg-3);
  font-size: 13px;
}
.search-empty.small {
  padding: 14px 14px;
  font-size: 12.5px;
}

@media (max-width: 640px) {
  .search-overlay {
    padding-top: 56px;
  }
  .search-jump {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Orders table items disclosure (prototype .items-toggle, order-detail-corrections).
   Two departures from the prototype: no border in any state, and the chevron
   takes the cell text colour; it turns half a turn while the panel is open. */
.items-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  /* One line whatever the column's width: wrapped, it lifted Expanded rows
     on the All Stores view to 77px (TapD 1003927 review, design D10). */
  white-space: nowrap;
  padding: 4px 8px;
  margin: -4px -8px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: inherit;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: background var(--t) var(--ease);
}
.items-toggle:hover,
.items-toggle[aria-expanded="true"] {
  background: var(--bg-2);
}
.items-toggle svg {
  color: inherit;
  transition: transform var(--t) var(--ease);
}
.items-toggle[aria-expanded="true"] svg {
  transform: rotate(180deg);
}
/* The items panel shell: wider than .filter-pop's 264px, which clips the item
   row's line-total column. The floor was the prototype's 300px until long
   names wrapped to eight lines at 1280px; 420px keeps them to about three. It
   grows with the viewport up to a cap so wide screens wrap long names less. */
.items-pop {
  width: clamp(420px, 32vw, 520px);
  white-space: normal;
}

/* Orders Billing cell (orders-billing-no-column, design D2): the `+N` count
   after the first bill number, and the panel listing every bill. The panel
   sits inside its nowrap cell, so it resets white-space. */
.billing-more {
  margin-left: 6px;
  padding: 0 6px;
  border: 0;
  border-radius: 999px;
  background: var(--bg-2);
  color: var(--fg-2);
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  line-height: 18px;
  cursor: pointer;
}
.billing-more:hover,
.billing-more[aria-expanded="true"] {
  background: var(--accent-soft);
  color: var(--accent-press);
}
.billing-pop {
  min-width: 180px;
  white-space: normal;
}
.billing-pop .filter-pop-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 14px;
}
.billing-pop-all {
  margin-top: 2px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

/* Orders list activity panel (orders-list-activity, design D6): mirrored from
   components.css, since this unlayered .items-pop width would otherwise win. */
.activity-pop {
  width: 380px;
  max-height: min(520px, 100vh - 140px);
  /* Rendered inside the monospace order-number cell; ids keep .mono. */
  font-family: var(--font-sans);
}
.act-sec-hd {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 6px;
  border: 0;
  background: transparent;
  padding: 9px 0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-3);
  cursor: pointer;
  text-align: left;
}
.act-sec-hd[disabled] {
  cursor: default;
}
.activity-pop .filter-pop-body {
  padding-top: 10px;
}

/* ---------- Quotations image search (add-quotations-image-search-panel) ----------
   The filter bar's paste-image trigger and its paste panel, copied from the
   legacy portal's QuotationImageSearchTrigger. The trigger takes .filter-tip;
   its tooltip, the shared .tooltip, shows the image as .image-search-thumb;
   the panel is a .filter-pop card holding one dashed paste area. */
.image-search-thumb {
  display: block;
  width: 96px;
  height: 96px;
  border-radius: var(--radius-sm);
  object-fit: cover;
}
.image-search-pop {
  padding: 8px;
}
.image-search-paste {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 116px;
  padding: 16px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--fg-2);
  background: var(--bg-1);
  cursor: pointer;
  text-align: center;
  transition: border-color var(--t) var(--ease), background-color var(--t) var(--ease);
}
.image-search-paste:hover,
.image-search-paste:focus-visible {
  border-color: var(--accent);
  background: var(--accent-soft);
  outline: none;
}
.image-search-paste.active {
  min-height: 148px;
  padding: 8px;
  border-style: solid;
}
.image-search-paste img {
  width: 100%;
  height: 132px;
  border-radius: var(--radius-sm);
  object-fit: cover;
}
.image-search-paste-icon {
  display: flex;
  margin-bottom: 8px;
  color: var(--accent);
}
.image-search-paste-main {
  color: var(--fg-1);
  font-size: 13px;
  font-weight: 500;
  line-height: 20px;
}
.image-search-paste-sub {
  margin-top: 2px;
  font-size: 12px;
  line-height: 18px;
  white-space: nowrap;
}
.image-search-paste-sub.float,
.image-search-paste-clear {
  position: absolute;
  color: #fff;
  background: var(--overlay-bg);
}
.image-search-paste-sub.float {
  right: 8px;
  bottom: 8px;
  left: 8px;
  margin: 0;
  padding: 4px 6px;
  border-radius: var(--radius-sm);
}
.image-search-paste-clear {
  top: 12px;
  right: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
}

/* ---------- Quotations image search loading (add-quotations-image-search-panel-loading) ----------
   The results region under the filter bar: while the newest image search is
   in flight its card dims ([aria-busy="true"] .card) and a spinner overlay
   covers the rows or the empty state. */
.quotations-results {
  position: relative;
}
.quotations-results-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--fg-2);
  cursor: progress;
}
.quotations-results-spin {
  width: 16px;
  height: 16px;
  border: 2px solid color-mix(in srgb, currentcolor 30%, transparent);
  border-top-color: currentcolor;
  border-radius: 999px;
  animation: dayone-spin 700ms linear infinite;
}
@media (prefers-reduced-motion: reduce) {
  .quotations-results-spin {
    animation: none;
  }
}

/* ---------- Quotations Store section (add-quotations-store-filter) ----------
   The Filters panel's Store section: its empty search reading and the
   50-store limit note. */
.store-filter-empty {
  margin: 0;
  padding: 16px 0;
  text-align: center;
  font-size: 13px;
  color: var(--fg-3);
}
.store-filter-limit {
  font-size: 12px;
  color: var(--danger);
}

/* ---------- Quotations COGS breakdown (add-quotations-cogs-breakdown) ----------
   The legacy COGS cell, popover and drawer: a rate pill opening a 280px
   hover card and a 600px drawer with the summary, the Country Details table
   and the calculation. */
.cogs-cell-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 7px 10px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--fg-1);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
  cursor: pointer;
}
.cogs-cell-pill svg {
  flex-shrink: 0;
  color: var(--warning);
}
.cogs-cell-pill:hover,
.cogs-cell-pill:focus-visible,
.cogs-cell-pill[data-active="true"] {
  background: var(--bg-1);
  border-color: var(--warning);
  outline: none;
}
.cogs-cell-pill:disabled {
  cursor: default;
}
/* Compact rows are 38px; the pill's own 36px would hold one at 45px
   (quotations-table-polish D5). */
.dtable.dtable-compact .cogs-cell-pill {
  padding: 2px 8px;
  font-size: 12px;
  border-radius: 8px;
}
.cogs-pop {
  margin: 0;
  z-index: 40;
  width: 280px;
  padding: 13px 14px;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 10px 28px rgba(22, 27, 36, 0.12);
  color: var(--fg-1);
  font-size: 12px;
}
.cogs-pop-state {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 96px;
  color: var(--fg-2);
}
.cogs-pop-spin,
.cogs-drawer-spin {
  width: 16px;
  height: 16px;
  border: 2px solid color-mix(in srgb, currentcolor 30%, transparent);
  border-top-color: currentcolor;
  border-radius: 999px;
  animation: dayone-spin 700ms linear infinite;
}
.cogs-drawer-spin {
  width: 32px;
  height: 32px;
  border-width: 3px;
}
.cogs-pop-hd {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  padding-bottom: 8px;
  font-size: 13px;
}
.cogs-pop-rate {
  padding: 4px 9px;
  color: var(--success);
  background: var(--success-soft);
  border-radius: 999px;
  font-size: 12px;
}
.cogs-pop-countries {
  border-top: 1px solid var(--border);
}
.cogs-pop-country {
  display: grid;
  grid-template-columns: 1fr minmax(46px, max-content) minmax(46px, max-content);
  align-items: center;
  column-gap: 8px;
  min-height: 29px;
  border-bottom: 1px solid var(--border);
}
.cogs-pop-country span:not(:first-child) {
  text-align: right;
}
.cogs-pop-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 9px;
  padding: 0;
  color: var(--warning);
  font: inherit;
  background: transparent;
  border: 0;
  cursor: pointer;
}
.cogs-drawer-hd {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px;
  border-bottom: 1px solid var(--border);
}
.cogs-drawer-heading {
  min-width: 0;
}
.cogs-drawer-heading .modal-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cogs-drawer-heading p {
  margin: 4px 0 0;
  color: var(--fg-2);
  font-size: 12px;
  line-height: 17px;
}
.cogs-drawer-hd .modal-close {
  border-radius: 50%;
}
.cogs-drawer-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px 20px 24px;
  overflow: auto;
}
.cogs-drawer-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 320px;
  color: var(--fg-2);
}
.cogs-summary {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.cogs-summary > div {
  padding: 13px 14px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.cogs-summary span,
.cogs-summary strong {
  display: block;
}
.cogs-summary span {
  color: var(--fg-2);
  font-size: 12px;
}
.cogs-summary strong {
  margin-top: 7px;
  font-size: 22px;
  font-weight: 650;
  line-height: 27px;
}
.cogs-drawer-section h3,
.cogs-calculation h3 {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 650;
}
.cogs-country-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 12px;
  color: var(--fg-2);
}
.cogs-country-table th,
.cogs-country-table td {
  padding: 8px 10px;
  text-align: left;
}
.cogs-country-table th:last-child,
.cogs-country-table td:last-child {
  text-align: right;
}
.cogs-country-table th {
  font-weight: 600;
  background: var(--bg-2);
}
.cogs-country-table td {
  border-top: 1px solid var(--border);
}
.cogs-country-table td.cogs-country-empty {
  padding: 40px 10px;
  text-align: center;
}
.cogs-country-code,
.cogs-country-label {
  display: block;
}
.cogs-share-track {
  display: block;
  width: 98px;
  height: 4px;
  margin-top: 5px;
  overflow: hidden;
  background: var(--border);
  border-radius: 999px;
}
.cogs-share-bar {
  display: block;
  height: 100%;
  background: var(--warning);
  border-radius: inherit;
}
.cogs-calculation {
  padding: 13px 14px;
  background: var(--bg-2);
  border-radius: 10px;
}
.cogs-calculation h3 {
  margin-bottom: 6px;
  font-size: 12px;
}
.cogs-calculation p {
  margin: 0;
  color: var(--fg-2);
  font-size: 12px;
  line-height: 19px;
}
@media (prefers-reduced-motion: reduce) {
  .cogs-pop-spin,
  .cogs-drawer-spin {
    animation: none;
  }
}

/* Inventory stock overview (inventory-stock-overview): the
   expanded row's two sections, their compact tables, and the signed movement
   quantities. One column under 1024px, two from there; `width: 0` with
   `min-width: 100%` keeps the panel from widening its full-width cell, so a
   wide section table scrolls in its own .stock-overview-scroll instead.
   Inside the list's scroller the panel is also held to the scroller's
   visible width (less the cell's 16px sides) and pinned to its left edge, so
   a table wider than the screen, scrolled to the row's chevron, still shows
   both sections. On a table that fits, both widths are the cell's. */
.stock-overview {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
  padding: 4px 0;
  width: 0;
  min-width: 100%;
}
.stock-overview > * {
  min-width: 0;
}
.stock-overview-scroll {
  overflow-x: auto;
}
.dtable-scroll:has(.stock-overview) {
  container-type: inline-size;
}
.dtable-scroll .stock-overview {
  position: sticky;
  left: 16px;
  min-width: min(100%, calc(100cqi - 32px));
}
@media (min-width: 1024px) {
  .stock-overview {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}
.stock-overview-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
.stock-overview-table th {
  text-align: left;
  font-weight: 500;
  color: var(--fg-2);
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
}
.stock-overview-table td {
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
}
/* Below 768px the stock overview stacks each table row as a bordered card and
   never scrolls sideways; from 768px both tables keep their layout. */
@media (max-width: 767px) {
  .so-wh-table thead,
  .so-mv-table thead {
    display: none;
  }
  table.so-wh-table,
  .so-wh-table tbody,
  table.so-mv-table,
  .so-mv-table tbody {
    display: block;
  }
  .so-wh-table tbody tr.so-wh-row,
  .so-mv-table tbody tr.so-mv-row {
    display: grid;
    /* The Inventory table's `.dtable tbody tr` height reaches these nested rows. */
    height: auto;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 8px;
  }
  .so-wh-table tbody tr.so-wh-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px 12px;
  }
  .so-mv-table tbody tr.so-mv-row {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "date qty"
      "method method"
      "warehouse warehouse"
      "reference reference";
    gap: 4px 12px;
  }
  .so-wh-table tbody tr.so-wh-row > td,
  .so-mv-table tbody tr.so-mv-row > td {
    display: block;
    min-width: 0;
    /* The Compact density's `.dtable.dtable-compact tbody td` width and nowrap reach these nested cells. */
    width: auto;
    white-space: normal;
    padding: 0;
    border: 0;
  }
  /* Outranks the Compact density's first/last-cell edge padding. */
  .dtable.dtable-compact .so-wh-table tbody tr.so-wh-row > td,
  .dtable.dtable-compact .so-mv-table tbody tr.so-mv-row > td {
    padding: 0;
  }
  .so-wh-table td.so-wh-name {
    grid-column: 1 / 3;
    overflow-wrap: anywhere;
  }
  .so-wh-table td.so-wh-status {
    grid-column: 3;
    justify-self: end;
    text-align: right;
  }
  .so-wh-table td.so-wh-figure::before {
    content: attr(data-label);
    display: block;
    font-family: var(--font-sans);
    font-size: var(--fs-12);
    color: var(--fg-3);
  }
  /* Each figure spans two rows of the card's grid, label in the first and
     figure in the second, so all figures of a line sit on one row however
     their labels wrap. */
  .so-wh-table tbody tr.so-wh-row > td.so-wh-figure {
    display: grid;
    grid-row: span 2;
    grid-template-rows: subgrid;
    row-gap: 0;
  }
  /* The figure, or a loading card's bar, sits in one line of text, so a
     loading card is as tall as the answered card that replaces it. */
  .so-wh-table tbody tr.so-wh-row > td.so-wh-figure > .so-wh-value {
    display: block;
  }
  /* Compact trims the label's top and the figure's bottom the way the
     density trims its other cells. */
  .dtable.dtable-compact .so-wh-table tbody tr.so-wh-row > td.so-wh-figure::before {
    /* biome-ignore lint/correctness/noUnknownProperty: text-box is Baseline 2025 (Chrome 133, Safari 18.2) and Biome 1.9.4 predates it */
    text-box: trim-start cap alphabetic;
  }
  .dtable.dtable-compact .so-wh-table tbody tr.so-wh-row > td.so-wh-figure > .so-wh-value {
    /* biome-ignore lint/correctness/noUnknownProperty: text-box is Baseline 2025 (Chrome 133, Safari 18.2) and Biome 1.9.4 predates it */
    text-box: trim-end cap alphabetic;
  }
  .so-mv-table td.so-mv-date {
    grid-area: date;
  }
  .so-mv-table td.so-mv-qty {
    grid-area: qty;
    justify-self: end;
    text-align: right;
  }
  .so-mv-table td.so-mv-method {
    grid-area: method;
    overflow-wrap: anywhere;
  }
  .so-mv-table td.so-mv-warehouse {
    grid-area: warehouse;
    overflow-wrap: anywhere;
  }
  .so-mv-table td.so-mv-reference {
    grid-area: reference;
    overflow-wrap: anywhere;
  }
}
@media (prefers-reduced-motion: reduce) {
  .stock-overview .aa-figskel {
    animation: none;
  }
}
.mv-in {
  color: var(--success);
}
.mv-out {
  color: var(--danger);
}

/* ---------- Sidebar icon rail (sidebar-icon-rail, TapD 1003815) ----------
   Collapsed, the shell's first column narrows to a 77px rail while the
   wordmark cross-fades to the DayOne mark, every label fades out (it stays in
   the DOM, clipped by its row, so assistive technology still reads it), the
   icons slide to the rail's centre line, section labels shrink to hairlines,
   and one fixed tooltip names the hovered entry. Nothing pops: every change
   is a transition on the shared --t / --t-slow / --ease tokens. The toggle is a small circle sitting ON the
   intersection of the sidebar's right border and the account footer's top
   border, in both states, and slides with the border. Phones keep the drawer, which is always the full sidebar. */
.shell {
  position: relative;
  transition: grid-template-columns var(--t-slow) var(--ease);
}
.shell-collapse {
  position: absolute;
  /* Centred on the account footer's top border (68.6px above the shell's
     foot), which moves with the short-window step below. Whole pixels keep the
     ring crisp on 1x screens; the half pixel left over is invisible. */
  bottom: 57px;
  left: 248px;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  margin-left: -12px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-1);
  color: var(--fg-2);
  box-shadow: 0 1px 3px rgba(20, 14, 4, 0.12);
  cursor: pointer;
  transition: left var(--t-slow) var(--ease), color var(--t) var(--ease), border-color var(--t)
    var(--ease), background var(--t) var(--ease);
}
.shell-collapse:hover,
.shell-collapse:focus-visible {
  color: var(--accent);
  border-color: var(--accent);
}
.sb-brand .sb-mark {
  display: none;
}
/* The identity reveal opens above the account chip; capped so its corner never
   covers the collapse toggle on the footer line (8px + 220px < 235px). */
.sb-footer .identity-pop {
  max-width: 220px;
}
/* The no-store placeholder takes the pointer only so the rail can name it. */
.sb-shopswitch[aria-disabled="true"]:hover {
  background: var(--bg-1);
}

/* The account menu scales up out of the avatar chip and back into it. The
   exit length is SB_MENU_EXIT_MS in sidebar.tsx, which unmounts it after. */
.sb-menu {
  transform-origin: bottom left;
  animation: sb-menu-in var(--t) var(--ease) both;
}
.sb-menu.closing {
  animation: sb-menu-out 120ms ease-in both;
}
@keyframes sb-menu-in {
  from {
    opacity: 0;
    transform: translateY(6px) scale(0.97);
  }
}
@keyframes sb-menu-out {
  to {
    opacity: 0;
    transform: translateY(6px) scale(0.97);
  }
}
/* The shared hover hint (components/ui/tooltip.tsx, shared-tooltip). A manual
   popover in the top layer: inset, margin and overflow undo the browser's own
   [popover] defaults, or left/top alone would land it centred. */
.tooltip {
  position: fixed;
  inset: auto;
  margin: 0;
  overflow: visible;
  width: max-content;
  max-width: 280px;
  padding: 10px 12px;
  background: var(--bg-1);
  color: var(--fg-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 8px 28px rgba(20, 14, 4, 0.14);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.45;
  text-align: left;
  text-transform: none;
  letter-spacing: normal;
  white-space: pre-line;
  pointer-events: none;
}
.tooltip.tooltip-interactive {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}
/* After the rule above: an author display outranks the browser's
   [popover]:not(:popover-open) rule, so a persistent tip at rest is hidden here. */
.tooltip:not([data-open]) {
  display: none;
}
/* The Orders overlay strip lets its children take pointer events; never its tip. */
.row-actions > .tooltip {
  pointer-events: none;
}
@media (max-height: 820px) {
  .shell-collapse {
    bottom: 43px;
  }
}
@media (max-width: 767px) {
  .shell-collapse {
    display: none;
  }
}
@media (min-width: 768px) {
  /* 77px: the picker keeps its expanded 52px height as a square, with 12px
     margins either side, plus the sidebar's 1px border. */
  .shell.shell--rail {
    grid-template-columns: 77px 1fr;
  }
  .shell--rail .shell-collapse {
    left: 77px;
  }
  /* Both states share these, so collapsing and expanding are the same motion
     run backwards: rows never wrap while the column is mid-width, and what a
     row cannot fit is clipped by the row itself. */
  .sb-brand {
    position: relative;
    overflow: hidden;
  }
  /* The wordmark keeps its own width in the rail (clipped, faded), so the brand
     row keeps its height and the mark stays on its centre. */
  .sb-brand .sb-logo {
    width: 212px;
    flex-shrink: 0;
  }
  .sb-shopswitch .sb-shoplogo {
    flex-shrink: 0;
  }
  .sb-brand > img {
    transition: opacity var(--t) var(--ease);
  }
  .sb-brand .sb-mark {
    display: block;
    position: absolute;
    left: 24px;
    top: 50%;
    width: 28px;
    height: 28px;
    margin-top: -12px; /* the brand padding is 2px heavier on top */
    border-radius: 8px;
    opacity: 0;
  }
  .sb-nav a,
  .sb-nav-stub,
  .sb-nav-disabled,
  .sb-shopswitch,
  .sb-user {
    white-space: nowrap;
    overflow: hidden;
  }
  .sb-nav a,
  .sb-nav-stub,
  .sb-nav-disabled {
    transition: background var(--t) var(--ease), color var(--t) var(--ease), padding var(--t-slow)
      var(--ease);
  }
  .sb-shopswitch {
    transition: background var(--t) var(--ease), border-color var(--t) var(--ease), padding
      var(--t-slow) var(--ease), margin var(--t-slow) var(--ease);
  }
  /* The rail moves the avatar onto its centre line with padding, so it slides
     with the icons above it. */
  .sb-user {
    transition: background var(--t) var(--ease), padding var(--t-slow) var(--ease);
  }
  .sb-nav a > *,
  .sb-nav-stub > *,
  .sb-nav-disabled > *,
  .sb-shopswitch > *,
  .sb-user > * {
    transition: opacity var(--t) var(--ease);
  }
  .sb-section {
    transition: font-size var(--t-slow) var(--ease), padding var(--t-slow) var(--ease), margin
      var(--t-slow) var(--ease), box-shadow var(--t) var(--ease);
  }

  .sidebar--rail {
    overflow: visible;
  }
  .sidebar--rail .sb-logo {
    opacity: 0;
  }
  .sidebar--rail .sb-brand .sb-mark {
    opacity: 1;
  }
  /* Icon centres land on the rail's 38px centre line: nav padding 8 + 21.5 +
     half the 17px glyph, margin 12 + border 1 + 12 + half the 26px store logo,
     the mark's 24 + 14, and footer 8 + 15 + half the 30px avatar. */
  .sidebar--rail .sb-nav a,
  .sidebar--rail .sb-nav-stub,
  .sidebar--rail .sb-nav-disabled {
    padding-left: 21.5px;
    padding-right: 0;
  }
  .sidebar--rail .sb-user {
    padding-left: 15px;
  }
  /* The picker keeps its expanded padding top and bottom, and the faded store
     name still sets the row's 34px content height, so a 12px left padding makes
     a 52px square with the logo 13px from every edge. */
  .sidebar--rail .sb-shopswitch {
    padding: 8px 0 8px 12px;
  }
  .sidebar--rail .sb-nav a > :not(.sb-icon),
  .sidebar--rail .sb-nav-stub > :not(.sb-icon),
  .sidebar--rail .sb-nav-disabled > :not(.sb-icon),
  .sidebar--rail .sb-shopswitch > :not(.sb-shoplogo),
  .sidebar--rail .sb-user > :not(.sb-avatar) {
    opacity: 0;
  }
  /* A hairline drawn as an inset shadow, so it takes no height of its own. */
  .sidebar--rail .sb-section {
    font-size: 0;
    line-height: 0;
    padding: 0;
    min-height: 1px;
    margin: 7px 10px;
    box-shadow: inset 0 1px 0 var(--border);
    border-top: 0;
  }
  /* The first hairline stands in for the "Work" label, and its margins keep
     Home on the same line in both states (the density steps below re-measure). */
  .sidebar--rail .sb-nav .sb-section:first-child {
    margin: 13px 10px;
    padding: 0;
  }
  /* A classic scrollbar would take its width out of the 77px rail and pull the
     icons off its centre line; the nav still scrolls by wheel, touch and keyboard. */
  .sidebar--rail .sb-nav {
    scrollbar-width: none;
  }
  /* The rail's menu clears the toggle on the footer line, which it would
     otherwise clip: 13px puts its bottom above the circle at every height. */
  .sidebar--rail .sb-menu {
    right: auto;
    bottom: calc(100% + 13px);
    width: 220px;
  }
}
/* Home stays on its line at each density step: the first hairline's margins
   absorb the "Work" label's height. Below 820px the picker is 46px tall, so the
   rail square is 46px and its wider margins keep it on the centre line. */
@media (min-width: 768px) and (max-height: 920px) {
  .sidebar--rail .sb-nav .sb-section:first-child {
    margin: 9px 10px 10px;
  }
}
@media (min-width: 768px) and (max-height: 820px) {
  .sidebar--rail .sb-shopswitch {
    padding: 5px 0 5px 9px;
    margin-left: 15px;
    margin-right: 15px;
  }
  .sidebar--rail .sb-nav .sb-section:first-child {
    margin: 8px 10px;
  }
}
/* The expanded sidebar drops its first label here, so the rail drops the first
   hairline with it. */
@media (min-width: 768px) and (max-height: 700px) {
  .sidebar--rail .sb-nav .sb-section:first-child {
    margin: 2px 10px;
    min-height: 0;
    box-shadow: none;
  }
}

/* Last in the section on purpose: it must come after every transition and
   animation it shortens, which it beats only by order at equal specificity. */
@media (prefers-reduced-motion: reduce) {
  .sb-menu,
  .sb-menu.closing {
    animation-duration: 1ms;
  }
  .shell,
  .shell-collapse,
  .sb-nav a,
  .sb-nav-stub,
  .sb-nav-disabled,
  .sb-shopswitch,
  .sb-section,
  .sb-user,
  .sb-brand > img,
  .sb-nav a > *,
  .sb-nav-stub > *,
  .sb-nav-disabled > *,
  .sb-shopswitch > *,
  .sb-user > * {
    transition-duration: 1ms;
  }
}

/* Client API documentation page (client-api-documentation): its section and
   endpoint headings, which preflight would otherwise render as body text.
   The .hc-article-body heading treatment, one step down so a section heading
   stays below the page's 20px .page-title. */
.api-docs h2,
.api-docs h3 {
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--fg-1);
  margin: 0 0 var(--space-3);
}
.api-docs h2 {
  font-size: var(--fs-18);
}
.api-docs h3 {
  font-size: var(--fs-16);
}
/* Inventory details page (inventory-details-page, canvas D1 "Order details
   twin"): the order details page's sticky sub-navbar and two-column body —
   a main column and a 300px right-hand column from 900px, one column below,
   ordered header, photo, Stock Overview, By warehouse, Stock movements,
   Purchase orders, Product details. Every table scrolls inside its card. */
.invd-sub-navbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 16px;
  margin: -24px -16px 24px -16px;
  background: var(--bg-1);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.invd-back-row {
  flex-basis: 100%;
  display: flex;
  align-items: center;
}
.invd-back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-13);
  color: var(--fg-2);
  text-decoration: none;
  white-space: nowrap;
}
.invd-title {
  flex: 1 1 240px;
  min-width: 0;
}
.invd-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.invd-sku {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 600;
  color: var(--fg-1);
  overflow-wrap: anywhere;
}
.invd-meta {
  margin-top: 2px;
  font-size: 11.5px;
  color: var(--fg-3);
  font-family: var(--font-mono);
  overflow-wrap: anywhere;
}
.invd-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: flex-start;
  width: 100%;
}
.invd-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}
.invd-main,
.invd-aside {
  display: contents;
}
.invd-photo {
  order: -1;
}
.invd-details {
  order: 1;
}
.invd-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}
.invd-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.invd-card-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}
.invd-card-sub,
.invd-view-text {
  margin: 0;
  font-size: var(--fs-13);
  color: var(--fg-2);
}
.invd-card-count {
  margin-left: auto;
  font-size: var(--fs-13);
  color: var(--fg-3);
}
.invd-tiles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
/* Every tile fills its row's height, content top-aligned, so a one-line note
   does not leave its tile shorter and lower than the neighbours. Only the
   operators between tiles sit centred. */
.invd-tile-slot {
  display: flex;
  align-items: stretch;
  gap: 6px;
  min-width: 0;
}
.invd-op {
  display: none;
  align-self: center;
}
.invd-tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  min-width: 0;
  padding: 12px 14px;
  text-align: left;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--fg-1);
  font: inherit;
  cursor: pointer;
}
.invd-tile.is-selected {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.invd-tile-label {
  font-size: var(--fs-13);
  color: var(--fg-2);
}
.invd-tile.is-selected .invd-tile-label {
  color: var(--accent);
}
.invd-tile-value {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 600;
}
.invd-tile-note {
  font-size: var(--fs-12);
  color: var(--fg-3);
}
.invd-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 4px 2px 10px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: var(--fs-12);
}
.invd-chip-clear {
  display: inline-flex;
  align-items: center;
  padding: 2px;
  border: 0;
  background: none;
  color: inherit;
  cursor: pointer;
}
.invd-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.invd-segmented {
  display: inline-flex;
  gap: 4px;
}
.invd-select {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-13);
  color: var(--fg-2);
}
.invd-select .status-trigger {
  max-width: 220px;
}
.invd-table-scroll {
  overflow-x: auto;
  max-width: 100%;
}
.invd-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-13);
}
.invd-table th {
  text-align: left;
  font-weight: 500;
  color: var(--fg-2);
  padding: 8px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
/* A last-week header of By warehouse may break before its `(last week)`, which
   stays on one line, so the table fits its card at desktop widths. */
.invd-table th.invd-th-wrap {
  white-space: normal;
}
.invd-th-keep {
  white-space: nowrap;
}
.invd-table td {
  padding: 8px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.invd-sub-line {
  display: block;
  font-size: var(--fs-12);
  color: var(--fg-3);
}
/* Below 768px the Inventory details By warehouse and Stock movements cards
   stack each table row as a bordered card and never scroll sideways; from
   768px both keep their table layout. */
@media (max-width: 767px) {
  .invd-wh-table thead,
  .invd-mv-table thead {
    display: none;
  }
  table.invd-wh-table,
  .invd-wh-table tbody,
  table.invd-mv-table,
  .invd-mv-table tbody {
    display: block;
  }
  .invd-wh-table tbody tr.invd-wh-row,
  .invd-mv-table tbody tr.invd-mv-row {
    display: grid;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 8px;
  }
  .invd-wh-table tbody tr.invd-wh-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 12px;
  }
  .invd-mv-table tbody tr.invd-mv-row {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "date qty"
      "movement movement"
      "warehouse warehouse"
      "reference reference";
    gap: 4px 12px;
  }
  .invd-wh-table tbody tr.invd-wh-row > td,
  .invd-mv-table tbody tr.invd-mv-row > td {
    display: block;
    min-width: 0;
    padding: 0;
    border: 0;
  }
  .invd-wh-table td.invd-wh-name {
    grid-column: 1 / -1;
    overflow-wrap: anywhere;
  }
  .invd-wh-table td.invd-wh-figure::before {
    content: attr(data-label);
    display: block;
    font-family: var(--font-sans);
    font-size: var(--fs-12);
    color: var(--fg-3);
  }
  /* Each figure spans two rows of the card's grid, label in the first and
     figure in the second, so all figures of a line sit on one row however
     their labels wrap. */
  .invd-wh-table tbody tr.invd-wh-row > td.invd-wh-figure {
    display: grid;
    grid-row: span 2;
    grid-template-rows: subgrid;
    row-gap: 0;
  }
  .invd-mv-table td.invd-mv-date {
    grid-area: date;
  }
  .invd-mv-table td.invd-mv-qty {
    grid-area: qty;
    justify-self: end;
    text-align: right;
  }
  .invd-mv-table td.invd-mv-movement {
    grid-area: movement;
    overflow-wrap: anywhere;
  }
  .invd-mv-table td.invd-mv-warehouse {
    grid-area: warehouse;
    overflow-wrap: anywhere;
  }
  .invd-mv-table td.invd-mv-reference {
    grid-area: reference;
    overflow-wrap: anywhere;
  }
}
.invd-pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: var(--fs-13);
  color: var(--fg-2);
}
.invd-pager-controls {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.invd-equation {
  margin: 0;
  font-family: var(--font-mono);
  font-size: var(--fs-13);
}
.invd-lines {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 4px;
  font-size: var(--fs-13);
}
.invd-empty {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  font-size: var(--fs-13);
  color: var(--fg-2);
}
.invd-empty p {
  margin: 0;
}
.invd-empty-title {
  font-weight: 600;
  color: var(--fg-1);
}
.invd-failure {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-13);
}
.invd-placeholder {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.invd-skel {
  height: 14px;
  border-radius: var(--radius-sm);
  background: var(--bg-2);
}
.invd-skel-photo {
  height: 220px;
}
.invd-photo-img,
.invd-photo-empty {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 10px;
  object-fit: cover;
}
.invd-photo-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-2);
  color: var(--fg-3);
  font-size: var(--fs-13);
}
.invd-product-name {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.invd-dl {
  margin: 0;
  display: grid;
  gap: 8px;
  font-size: var(--fs-13);
}
.invd-dl-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.invd-dl dt {
  color: var(--fg-3);
}
.invd-dl dd {
  margin: 0;
  text-align: right;
  overflow-wrap: anywhere;
}
@media (min-width: 900px) {
  .invd-sub-navbar {
    margin: -24px -24px 24px -24px;
    padding: 10px 24px;
  }
  .invd-actions {
    width: auto;
  }
  .invd-grid {
    grid-template-columns: minmax(0, 1fr) 300px;
  }
  .invd-main,
  .invd-aside {
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 0;
  }
  .invd-tiles {
    display: flex;
  }
  .invd-tile-slot {
    flex: 1 1 0;
  }
  .invd-op {
    display: inline;
    color: var(--fg-3);
    font-family: var(--font-mono);
  }
}
