/* accs123 styles. All values come from tokens.css. */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scrollbar-gutter: stable; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--fs-16);
  line-height: var(--lh-body);
  font-weight: var(--fw-regular);
  color: var(--text);
  background: var(--bg);
  position: relative;
  min-height: 100vh;
  overflow-x: clip;
  overflow-wrap: break-word; /* a long unbroken string wraps instead of pushing the page wider */
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
a:hover { color: var(--primary-text); }
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }

/* ---------- type scale: 12 / 14 / 16 / 20 / 24 / 32 / 40 / 56 ------------------------- */
h1, h2, h3, h4 { margin: 0 0 var(--s-3); font-weight: var(--fw-bold); font-style: normal; text-wrap: balance; }
h1 { font-size: var(--fs-32); line-height: var(--lh-tight); letter-spacing: var(--ls-heading); }
h2 { font-size: var(--fs-32); line-height: var(--lh-tight); letter-spacing: var(--ls-heading); }
h3 { font-size: var(--fs-20); line-height: var(--lh-heading); letter-spacing: var(--ls-tight); font-weight: var(--fw-semibold); }
h4 { font-size: var(--fs-14); line-height: var(--lh-dense); font-weight: var(--fw-semibold); }
.display { font-size: var(--fs-56); line-height: var(--lh-display); letter-spacing: var(--ls-display); }
.h2 { font-size: var(--fs-24); line-height: var(--lh-heading); letter-spacing: var(--ls-tight); }
.h3 { font-size: var(--fs-20); line-height: var(--lh-heading); letter-spacing: var(--ls-tight); font-weight: var(--fw-semibold); }
p { margin: 0 0 var(--s-4); text-wrap: pretty; }
::selection { background: color-mix(in srgb, var(--primary) 28%, transparent); }
.lead { font-size: var(--fs-20); line-height: var(--lh-body); color: var(--text-2); }
.muted { color: var(--muted); }
.small { font-size: var(--fs-14); line-height: var(--lh-dense); }
.mono { font-family: var(--font-mono); font-feature-settings: "zero" 0; }
.num { font-variant-numeric: tabular-nums; }
.amount-xl { font-size: var(--fs-32); line-height: var(--lh-tight); font-weight: var(--fw-bold); letter-spacing: var(--ls-heading); font-variant-numeric: tabular-nums; }
.amount-md { font-size: var(--fs-20); line-height: var(--lh-heading); font-weight: var(--fw-bold); font-variant-numeric: tabular-nums; }
.total-row { font-size: var(--fs-20); font-weight: var(--fw-bold); font-variant-numeric: tabular-nums; }
.error-code { font-family: var(--font-mono); font-size: var(--fs-56); line-height: var(--lh-display); font-weight: var(--fw-bold); letter-spacing: var(--ls-heading); color: var(--primary-text); }
.cap { text-transform: capitalize; }
.pos { color: var(--success); }
.neg { color: var(--danger); }
.text-danger { color: var(--danger); }
.pre-line { white-space: pre-line; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
.text-left { text-align: left; }

/* ---------- spacing utilities (4px scale) -------------------------------------------- */
.mt-1 { margin-top: var(--s-2); } .mt-2 { margin-top: var(--s-4); } .mt-3 { margin-top: var(--s-6); } .mt-4 { margin-top: var(--s-10); }
.mb-0 { margin-bottom: 0; } .mb-2 { margin-bottom: var(--s-4); } .mb-3 { margin-bottom: var(--s-6); }
.ml-auto { margin-left: auto; }
.hidden { display: none !important; }
.flex { display: flex; gap: var(--s-3); align-items: center; }
.between { justify-content: space-between; }
.justify-center { justify-content: center; }
.wrap { flex-wrap: wrap; }
.stack { display: grid; gap: var(--s-3); }
.list { margin: 0; padding-left: var(--s-5); }
.list li + li { margin-top: var(--s-1); }
.narrow { max-width: 880px; }
.form-card { max-width: 760px; }
.form-card-sm { max-width: 520px; }
.card-flush { padding: 0; overflow: hidden; }
.sticky-side { position: sticky; top: calc(var(--header-h) + var(--s-5)); }

@media (max-width: 1024px) {
  .display { font-size: var(--fs-40); }
}
@media (max-width: 760px) {
  h1, h2 { font-size: var(--fs-24); line-height: var(--lh-heading); letter-spacing: var(--ls-tight); }
  .display { font-size: var(--fs-32); line-height: var(--lh-tight); letter-spacing: var(--ls-heading); }
  .lead { font-size: var(--fs-16); }
  .error-code { font-size: var(--fs-40); }
}

/* ---------- focus and links ----------------------------------------------------------- */
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
:focus:not(:focus-visible) { outline: none; }
a, button, summary, label { -webkit-tap-highlight-color: transparent; }
p a:not(.btn), .help a, dd a:not(.btn), .table a:not(.btn) { color: var(--primary-text); text-decoration: underline; text-decoration-color: color-mix(in srgb, currentColor 40%, transparent); text-underline-offset: 3px; }
p a:not(.btn):hover, .help a:hover, dd a:not(.btn):hover, .table a:not(.btn):hover { text-decoration-color: currentColor; }

/* ---------- icons --------------------------------------------------------------------- */
.i { width: 20px; height: 20px; flex: none; }

/* ---------- layout primitives --------------------------------------------------------- */
.container { max-width: calc(var(--w-container) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }
.section { padding: var(--section) 0; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: var(--s-4); margin-bottom: var(--s-8); flex-wrap: wrap; }
.section-head h2 { margin-bottom: var(--s-2); }
.section-head p { margin: 0; max-width: 60ch; }
main { min-height: 60vh; }
.grid { display: grid; gap: var(--s-4); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.split { display: grid; grid-template-columns: 1fr 360px; gap: var(--s-6); align-items: start; }
.split-wide { grid-template-columns: 260px 1fr; }

/* ---------- header and navigation ----------------------------------------------------- */
.header { position: sticky; top: 0; z-index: 50; background: var(--bg); border-bottom: 1px solid var(--border); }
.header .container { display: flex; align-items: center; gap: var(--s-4); height: var(--header-h); }
.logo { display: inline-flex; align-items: center; gap: var(--s-2); min-height: var(--control-h); font-size: var(--fs-20); font-weight: var(--fw-bold); letter-spacing: var(--ls-tight); color: var(--text); }
.logo:hover { color: var(--text); }
.logo-mark { width: 32px; height: 32px; border-radius: var(--r-md); background: var(--primary); color: var(--on-primary); display: grid; place-items: center; font-family: var(--font-mono); font-size: var(--fs-16); font-weight: var(--fw-bold); line-height: 1; }
.nav { display: flex; gap: var(--s-1); margin-left: var(--s-4); }
.nav a { display: inline-flex; align-items: center; height: 40px; padding: 0 var(--s-3); border-radius: var(--r-md); font-size: var(--fs-14); font-weight: var(--fw-medium); color: var(--text-2); white-space: nowrap; transition: background-color var(--t-base) var(--ease), color var(--t-fast) var(--ease); }
.nav a:hover { color: var(--text); background: var(--sunken); }
.nav a.active { color: var(--primary-text); background: var(--primary-soft); }
.header-right { margin-left: auto; display: flex; align-items: center; gap: var(--s-2); }

.icon-btn { width: 40px; height: 40px; flex: none; border-radius: var(--r-md); border: 1px solid var(--border); background: var(--surface); color: var(--text-2); display: inline-grid; place-items: center; cursor: pointer; position: relative; transition: background-color var(--t-base) var(--ease), border-color var(--t-base) var(--ease), color var(--t-fast) var(--ease); }
.icon-btn:hover { color: var(--text); border-color: var(--border-strong); }
.icon-btn:active { background: var(--sunken); }
.icon-btn:disabled { background: var(--sunken); border-color: var(--border); color: var(--muted); cursor: not-allowed; }
.icon-btn .i { width: 18px; height: 18px; }
.badge-count { position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; padding: 0 var(--s-1); border-radius: var(--r-full); background: var(--primary); color: var(--on-primary); box-shadow: 0 0 0 2px var(--bg); display: grid; place-items: center; font-size: var(--fs-12); font-weight: var(--fw-bold); line-height: 1; font-variant-numeric: tabular-nums; }

.menu { position: relative; }
.menu-panel { position: absolute; right: 0; top: calc(100% + var(--s-2)); min-width: 220px; padding: var(--s-2); background: var(--raised); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--e3); z-index: 60; display: none; }
.menu.open .menu-panel { display: block; animation: pop var(--t-slow) var(--ease); }
.menu-panel a, .menu-panel button { display: flex; align-items: center; gap: var(--s-3); width: 100%; min-height: 40px; padding: 0 var(--s-3); border: 0; border-radius: var(--r-md); background: none; color: var(--text); font-size: var(--fs-14); font-weight: var(--fw-medium); text-align: left; cursor: pointer; white-space: nowrap; }
.menu-panel a:hover, .menu-panel button:hover { background: var(--sunken); color: var(--text); }
.menu-panel a.active { background: var(--primary-soft); color: var(--primary-text); }
.menu-panel .i { width: 18px; height: 18px; color: var(--muted); }
.menu-panel .sep { height: 1px; background: var(--border); margin: var(--s-2) 0; }
@keyframes pop { from { opacity: 0; transform: translateY(-4px); } }

.burger { display: none; }
.header .mobile-nav { display: none; height: auto; }
.mobile-nav a, .mobile-nav button { display: flex; align-items: center; gap: var(--s-3); width: 100%; min-height: var(--control-h); padding: 0; border: 0; border-bottom: 1px solid var(--border); background: none; color: var(--text); font-size: var(--fs-16); font-weight: var(--fw-medium); text-align: left; cursor: pointer; }
.mobile-nav > :last-child { border-bottom: 0; }
.mobile-nav .i { width: 18px; height: 18px; color: var(--muted); }
.theme-icon-dark, html[data-theme="dark"] .theme-icon-light { display: none; }
html[data-theme="dark"] .theme-icon-dark { display: inline-flex; }
.theme-icon-light { display: inline-flex; }

/* ---------- buttons: default, hover, focus-visible, active, disabled, loading ------------ */
.btn {
  --spin: var(--text);
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  height: var(--control-h); padding: 0 var(--s-5); flex: none;
  border: 1px solid var(--border-strong); border-radius: var(--r-md); background: var(--surface); color: var(--text);
  font-size: var(--fs-14); font-weight: var(--fw-semibold); line-height: 1; white-space: nowrap; cursor: pointer; user-select: none;
  transition: background-color var(--t-base) var(--ease), border-color var(--t-base) var(--ease), box-shadow var(--t-base) var(--ease), color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.btn:hover { background: var(--sunken); color: var(--text); }
.btn:active { transform: translateY(1px); }
.btn .i { width: 18px; height: 18px; }
.btn-primary { --spin: var(--on-primary); background: var(--primary); border-color: transparent; color: var(--on-primary); box-shadow: 0 1px 2px rgb(var(--ink) / 0.18), inset 0 1px 0 rgb(255 255 255 / 0.14); }
.btn-primary:hover { background: var(--primary-hover); color: var(--on-primary); box-shadow: var(--glow-ring); }
.btn-primary:active { background: var(--primary-active); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--sunken); color: var(--text); }
.btn-danger { --spin: var(--danger); background: var(--danger-soft); border-color: transparent; color: var(--danger); }
.btn-danger:hover { background: color-mix(in srgb, var(--danger) 14%, var(--surface)); color: var(--danger); }
.btn-success { --spin: var(--on-primary); background: var(--success-fill); border-color: transparent; color: var(--on-primary); }
.btn-success:hover { background: color-mix(in srgb, var(--success-fill) 88%, #000); color: var(--on-primary); }
.btn-sm { height: var(--control-h-sm); padding: 0 var(--s-3); }
.btn-lg { height: var(--control-h-lg); padding: 0 var(--s-6); font-size: var(--fs-16); }
.btn-block { width: 100%; }
.btn:disabled, .btn[aria-disabled="true"] { background: var(--sunken); border-color: var(--border); color: var(--muted); box-shadow: none; transform: none; cursor: not-allowed; }
.btn.is-loading { position: relative; color: transparent; pointer-events: none; }
.btn.is-loading > * { visibility: hidden; }
.btn.is-loading::after { content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%; border: 2px solid color-mix(in srgb, var(--spin) 30%, transparent); border-top-color: var(--spin); animation: spin 700ms linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- cards --------------------------------------------------------------------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: var(--s-5); box-shadow: var(--e1); }
.card.pad-lg { padding: var(--s-8); }
.card-raised { background: var(--raised); box-shadow: var(--e2); }
.card-hover, a.card { transition: box-shadow var(--t-base) var(--ease), border-color var(--t-base) var(--ease); }
/* hover and selected: the whole card glows */
.card-hover:hover, a.card:hover { border-color: var(--glow-border); box-shadow: var(--glow-ring); color: inherit; }

/* brand tiles */
.brand { display: inline-grid; place-items: center; flex: none; width: calc(var(--brand-size) * 2); height: calc(var(--brand-size) * 2); border-radius: var(--r-md); color: var(--brand); background: color-mix(in srgb, var(--brand) 12%, var(--surface)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--brand) 22%, transparent); }
.brand svg { width: var(--brand-size); height: var(--brand-size); }

/* ---------- badges -------------------------------------------------------------------- */
.badge { display: inline-flex; align-items: center; gap: var(--s-2); height: 24px; padding: 0 var(--s-3); border-radius: var(--r-full); background: var(--sunken); color: var(--muted); font-size: var(--fs-12); font-weight: var(--fw-semibold); line-height: 1; white-space: nowrap; font-variant-numeric: tabular-nums; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.badge.plain::before { display: none; }
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-info, .badge-accent { background: var(--primary-soft); color: var(--primary-text); }
.btn .badge { height: 20px; padding: 0 var(--s-2); }

/* ---------- forms --------------------------------------------------------------------- */
.field { display: grid; gap: var(--s-2); margin-bottom: var(--s-4); }
.field label, .label { font-size: var(--fs-14); font-weight: var(--fw-medium); color: var(--text-2); }
.input, .select, .textarea {
  width: 100%; height: var(--control-h); padding: 0 var(--s-3);
  border: 1px solid var(--border-strong); border-radius: var(--r-md); background: var(--surface); color: var(--text);
  font-size: var(--fs-16); line-height: var(--lh-dense);
  transition: border-color var(--t-base) var(--ease), background-color var(--t-base) var(--ease);
}
.input::placeholder, .textarea::placeholder { color: var(--muted); opacity: 1; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--text-2); }
.input:focus-visible, .select:focus-visible, .textarea:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; border-color: var(--focus); }
.input:disabled, .select:disabled, .textarea:disabled { background: var(--sunken); border-color: var(--border); color: var(--muted); cursor: not-allowed; }
.input[aria-invalid="true"] { border-color: var(--danger); }
.input[type="number"] { font-variant-numeric: tabular-nums; }
.textarea { height: auto; min-height: 120px; padding: var(--s-3); resize: vertical; font-family: var(--font-mono); font-size: var(--fs-14); }
.textarea.prose { font-family: var(--font-sans); font-size: var(--fs-16); }
.select { appearance: none; padding-right: var(--s-10); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23868EA0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right var(--s-3) center; background-size: 16px 16px; }
.check { display: inline-flex; align-items: center; gap: var(--s-2); min-height: var(--control-h-sm); font-size: var(--fs-14); cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 0; accent-color: var(--primary); }
.help { font-size: var(--fs-14); line-height: var(--lh-dense); color: var(--muted); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-4); }
.search { display: flex; gap: var(--s-2); }
.search .input { flex: 1; min-width: 0; }

.qty { display: inline-flex; align-items: stretch; flex: none; height: var(--control-h); border-radius: var(--r-md); background: var(--surface); outline: 1px solid var(--border-strong); outline-offset: -1px; overflow: hidden; }
.qty:focus-within { outline: 2px solid var(--focus); outline-offset: 1px; }
.qty button { width: 40px; flex: none; border: 0; background: transparent; color: var(--text-2); font-size: var(--fs-20); line-height: 1; cursor: pointer; transition: background-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease); }
.qty button:hover { background: var(--sunken); color: var(--text); }
.qty button:active { background: var(--border); }
.qty button:focus-visible { outline-offset: -2px; }
.qty input { width: 48px; flex: none; padding: 0; border: 0; background: transparent; color: var(--text); text-align: center; font-family: var(--font-mono); font-size: var(--fs-14); font-weight: var(--fw-semibold); outline: none; appearance: textfield; -moz-appearance: textfield; }
.qty input::-webkit-inner-spin-button, .qty input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

.drop { border: 1px dashed var(--border-strong); border-radius: var(--r-lg); padding: var(--s-4); text-align: center; color: var(--muted); font-size: var(--fs-14); }
.drop input[type="file"] { display: block; max-width: 100%; margin: var(--s-3) auto 0; font-size: var(--fs-14); color: var(--text-2); }
input[type="file"]::file-selector-button { height: var(--control-h-sm); margin-right: var(--s-3); padding: 0 var(--s-3); border: 1px solid var(--border-strong); border-radius: var(--r-md); background: var(--surface); color: var(--text); font-family: var(--font-sans); font-size: var(--fs-14); font-weight: var(--fw-semibold); cursor: pointer; }
input[type="file"]::file-selector-button:hover { background: var(--sunken); }

/* radio cards (payment method) */
.choice { display: grid; gap: var(--s-3); }
.choice label { display: grid; grid-template-columns: auto 1fr auto; gap: var(--s-4); align-items: center; min-height: 64px; padding: var(--s-4); border: 1px solid var(--border-strong); border-radius: var(--r-lg); background: var(--surface); cursor: pointer; transition: border-color var(--t-base) var(--ease), box-shadow var(--t-base) var(--ease), background-color var(--t-base) var(--ease); }
.choice label:hover { border-color: var(--glow-border); box-shadow: var(--glow-ring); }
.choice label:has(input:checked) { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary), var(--glow-ring); }
.choice label:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.choice label:has(input:disabled) { background: var(--sunken); border-color: var(--border); box-shadow: none; cursor: not-allowed; }
.choice label:has(input:disabled) .title { color: var(--muted); }
.choice input { width: 20px; height: 20px; margin: 0; accent-color: var(--primary); }
.choice .title { font-weight: var(--fw-semibold); }
.choice .i { width: 24px; height: 24px; color: var(--muted); }

/* ---------- flash messages ------------------------------------------------------------ */
.flashes { position: fixed; top: calc(var(--header-h) + var(--s-3)); right: var(--s-4); z-index: 80; display: grid; gap: var(--s-2); width: min(400px, calc(100vw - 2 * var(--s-4))); }
.flash { --tone: var(--primary); display: flex; align-items: flex-start; gap: var(--s-3); padding: var(--s-3) var(--s-4); border: 1px solid color-mix(in srgb, var(--tone) 35%, var(--border)); border-radius: var(--r-lg); background: var(--raised); box-shadow: var(--e3); font-size: var(--fs-14); line-height: var(--lh-dense); animation: flash-in var(--t-slow) var(--ease); }
.flash::before { content: ""; flex: none; width: 8px; height: 8px; margin-top: 6px; border-radius: 50%; background: var(--tone); }
.flash-success { --tone: var(--success-fill); }
.flash-error { --tone: var(--danger-fill); }
.flash button { flex: none; width: 28px; height: 28px; margin: -4px -8px -4px auto; border: 0; border-radius: var(--r-sm); background: none; color: var(--muted); font-size: var(--fs-20); line-height: 1; cursor: pointer; }
.flash button:hover { background: var(--sunken); color: var(--text); }
@keyframes flash-in { from { opacity: 0; transform: translateY(-6px); } }

/* ---------- tables -------------------------------------------------------------------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: var(--fs-14); line-height: var(--lh-dense); }
.table th { padding: var(--s-3) var(--s-4); border-bottom: 1px solid var(--border); text-align: left; font-size: var(--fs-12); font-weight: var(--fw-semibold); color: var(--muted); white-space: nowrap; }
.table td { padding: var(--s-3) var(--s-4); border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr td { transition: background-color var(--t-fast) var(--ease); }
/* row hover: the whole row lights up, top and bottom edges included */
.table tbody tr:hover td { background: var(--primary-soft); box-shadow: inset 0 1px 0 var(--glow-border), inset 0 -1px 0 var(--glow-border); }
.table td.actions { white-space: nowrap; text-align: right; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table td.mono, .table td .mono { white-space: nowrap; }
.table .small { font-size: var(--fs-12); }
.table td > .muted.small { white-space: nowrap; }
.table a:not(.btn) { font-weight: var(--fw-medium); }

/* ---------- tabs, pagination, definition lists, misc ----------------------------------- */
.tabs { display: flex; gap: var(--s-1); flex-wrap: wrap; width: fit-content; max-width: 100%; margin-bottom: var(--s-4); padding: var(--s-1); border-radius: var(--r-md); background: var(--sunken); }
.tabs a { display: inline-flex; align-items: center; height: 32px; padding: 0 var(--s-3); border-radius: var(--r-sm); font-size: var(--fs-14); font-weight: var(--fw-medium); color: var(--text-2); white-space: nowrap; transition: background-color var(--t-base) var(--ease), color var(--t-fast) var(--ease), box-shadow var(--t-base) var(--ease); }
.tabs a:hover { color: var(--text); }
.tabs a.active { background: var(--surface); color: var(--text); box-shadow: var(--e1), 0 0 0 1px var(--glow-border); }
.pagination { display: flex; gap: var(--s-1); justify-content: center; flex-wrap: wrap; margin-top: var(--s-5); }
.pagination a, .pagination span { display: inline-grid; place-items: center; min-width: var(--control-h-sm); height: var(--control-h-sm); padding: 0 var(--s-2); border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); color: var(--text-2); font-size: var(--fs-14); font-weight: var(--fw-medium); font-variant-numeric: tabular-nums; }
.pagination a:hover { border-color: var(--border-strong); color: var(--text); }
.pagination span.cur { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.kv { display: grid; grid-template-columns: minmax(120px, 180px) 1fr; gap: var(--s-3) var(--s-4); margin: 0; font-size: var(--fs-14); line-height: var(--lh-dense); }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.empty { display: grid; justify-items: center; gap: var(--s-3); padding: var(--s-12) var(--s-5); text-align: center; color: var(--muted); }
.empty .i { width: 48px; height: 48px; padding: 12px; border-radius: var(--r-lg); background: var(--sunken); color: var(--muted); }
.empty + .center { margin-top: calc(-1 * var(--s-6)); }
.code { font-family: var(--font-mono); font-size: var(--fs-14); padding: 2px var(--s-2); border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--sunken); overflow-wrap: anywhere; }
.preview { background: var(--code-bg); color: var(--code-text); border-radius: var(--r-lg); padding: var(--s-4); font-family: var(--font-mono); font-size: var(--fs-14); line-height: 1.7; overflow-x: auto; white-space: pre; }

/* ---------- side navigation (dashboards, catalog filter) ------------------------------- */
.side-nav { display: grid; gap: 2px; padding: var(--s-2); }
.side-nav a { display: flex; align-items: center; gap: var(--s-3); min-height: 40px; padding: 0 var(--s-3); border-radius: var(--r-md); font-size: var(--fs-14); font-weight: var(--fw-medium); color: var(--text-2); white-space: nowrap; transition: background-color var(--t-base) var(--ease), color var(--t-fast) var(--ease), box-shadow var(--t-base) var(--ease); }
.side-nav a .i { width: 18px; height: 18px; color: var(--muted); }
.side-nav a:hover { background: var(--sunken); color: var(--text); }
.side-nav a.active { background: var(--primary-soft); color: var(--primary-text); box-shadow: 0 0 0 1px var(--glow-border); }
.side-nav a.active .i { color: currentColor; }
.side-nav .group { padding: var(--s-4) var(--s-3) var(--s-1); font-size: var(--fs-12); font-weight: var(--fw-semibold); color: var(--muted); }
.side .who { padding: var(--s-4); border-bottom: 1px solid var(--border); font-size: var(--fs-14); line-height: var(--lh-dense); }
.side .who strong { display: block; overflow-wrap: anywhere; }

/* ---------- FAQ accordion ------------------------------------------------------------- */
.faq details { border-bottom: 1px solid var(--border); }
.faq details:last-child { border-bottom: 0; }
.faq summary { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); min-height: 56px; padding: var(--s-3) 0; cursor: pointer; list-style: none; font-weight: var(--fw-semibold); transition: color var(--t-fast) var(--ease); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary:hover { color: var(--primary-text); }
.faq summary::after { content: ""; flex: none; width: 9px; height: 9px; margin-right: var(--s-1); border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: translateY(-2px) rotate(45deg); transition: transform var(--t-base) var(--ease); }
.faq details[open] summary::after { transform: translateY(2px) rotate(-135deg); }
.faq details p { margin: 0 0 var(--s-4); max-width: 70ch; color: var(--text-2); }

/* ---------- footer -------------------------------------------------------------------- */
.footer { margin-top: var(--section); padding: var(--s-12) 0 var(--s-8); border-top: 1px solid var(--border); font-size: var(--fs-14); line-height: var(--lh-dense); }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: var(--s-8); }
.footer h4 { margin-bottom: var(--s-2); font-size: var(--fs-12); font-weight: var(--fw-semibold); color: var(--muted); }
.footer p { max-width: 38ch; }
.footer-grid a:not(.logo) { display: flex; align-items: center; gap: var(--s-2); min-height: 32px; color: var(--text-2); }
.footer-grid a:not(.logo):hover { color: var(--primary-text); }
.footer-grid a .i { width: 16px; height: 16px; }
.footer-bottom { display: flex; justify-content: space-between; gap: var(--s-3); flex-wrap: wrap; margin-top: var(--s-8); padding-top: var(--s-5); border-top: 1px solid var(--border); color: var(--muted); font-size: var(--fs-12); }
.tg { display: inline-flex; align-items: center; gap: var(--s-2); }
.tg .i { width: 16px; height: 16px; }

/* ---------- page layouts -------------------------------------------------------------- */
/* grid and flex children may shrink, so wide content scrolls inside its own box and never pushes the page */
.grid > *, .split > *, .stack > *, .dash > *, .form-row > *, .hero-grid > *, .product-layout > * { min-width: 0; }
main > .section:first-child { padding-top: var(--s-12); }
.container.narrow { max-width: calc(880px + 2 * var(--gutter)); }
.section-head h1 { margin-bottom: var(--s-2); }
.page-title { margin-bottom: var(--s-6); }

/* hero */
.hero { padding: var(--s-24) 0 var(--s-16); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s-16); align-items: center; }
.hero .lead { max-width: 52ch; margin-top: var(--s-5); margin-bottom: 0; }
.hero .search { max-width: 560px; margin-top: var(--s-8); }
.hero .search .input { height: var(--control-h-lg); padding: 0 var(--s-4); }
.hero-actions { display: flex; gap: var(--s-3); flex-wrap: wrap; margin-top: var(--s-8); }
.hero-stats { display: grid; grid-template-columns: repeat(4, auto); justify-content: start; gap: 0; margin: var(--s-10) 0 0; }
.hero-stats > div { padding: 0 var(--s-6); border-left: 1px solid var(--border); }
.hero-stats > div:first-child { padding-left: 0; border-left: 0; }
.hero-stats .value { font-family: var(--font-mono); font-size: var(--fs-24); line-height: var(--lh-heading); font-weight: var(--fw-bold); letter-spacing: var(--ls-tight); font-variant-numeric: tabular-nums; white-space: nowrap; }
.hero-stats .label { font-size: var(--fs-14); line-height: var(--lh-dense); color: var(--muted); }
.hero-visual { display: grid; gap: var(--s-4); }
.terminal { border: 1px solid var(--border); border-radius: var(--r-xl); background: var(--code-bg); color: var(--code-text); box-shadow: var(--e3); font-family: var(--font-mono); font-size: var(--fs-12); overflow: hidden; }
.terminal .bar { display: flex; align-items: center; gap: var(--s-2); padding: var(--s-3) var(--s-4); border-bottom: 1px solid rgb(255 255 255 / 0.08); color: var(--code-muted); }
.terminal .bar i { width: 10px; height: 10px; border-radius: 50%; background: rgb(255 255 255 / 0.16); display: inline-block; }
.terminal .bar span { margin-left: var(--s-2); }
.terminal pre { margin: 0; padding: var(--s-5); white-space: pre; overflow-x: auto; line-height: 1.8; }
.terminal .c { color: var(--code-muted); }
.terminal .k { color: #6FE0D4; }
.terminal .v { color: #A9C0FF; }
.feature { display: flex; align-items: flex-start; gap: var(--s-3); padding: var(--s-4); font-size: var(--fs-14); line-height: var(--lh-dense); }
.feature > .i { width: 40px; height: 40px; padding: 10px; border-radius: var(--r-md); background: var(--primary-soft); color: var(--primary-text); }
.feature strong { display: block; font-size: var(--fs-16); font-weight: var(--fw-semibold); line-height: var(--lh-heading); margin-bottom: 2px; }
@media (min-width: 1280px) { .terminal { font-size: var(--fs-14); } }

/* category cards */
.cat-card { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-4); min-height: 76px; }
.cat-card .name { font-weight: var(--fw-semibold); line-height: var(--lh-heading); }
.cat-card .count { display: flex; align-items: center; gap: var(--s-2); font-size: var(--fs-14); color: var(--muted); font-variant-numeric: tabular-nums; }
.cat-card .count::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent-fill); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-fill) 22%, transparent); }
.cat-card .arrow { margin-left: auto; color: var(--muted); opacity: 0; transform: translateX(-4px); transition: opacity var(--t-base) var(--ease), transform var(--t-base) var(--ease); }
.cat-card:hover .arrow, .cat-card:focus-visible .arrow { opacity: 1; transform: none; color: var(--primary-text); }

/* product rows: tile | title, format, facts | price | buy. Three text lines give every row the same rhythm. */
.prow { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto auto; gap: var(--s-2) var(--s-5); align-items: center; padding: var(--s-4) var(--s-5); background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--e1); transition: box-shadow var(--t-base) var(--ease), border-color var(--t-base) var(--ease); }
.prow:hover, .prow:focus-within { border-color: var(--glow-border); box-shadow: var(--glow-ring); }
.prow-main { display: grid; gap: var(--s-1); }
.prow-title { font-weight: var(--fw-semibold); line-height: var(--lh-heading); overflow-wrap: anywhere; }
.prow-format { display: flex; gap: var(--s-2); align-items: baseline; font-size: var(--fs-14); line-height: var(--lh-dense); color: var(--muted); min-width: 0; }
.prow-format .mono { font-size: var(--fs-12); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.prow-facts { display: flex; align-items: center; gap: var(--s-2) var(--s-3); flex-wrap: wrap; font-size: var(--fs-12); line-height: var(--lh-dense); color: var(--muted); margin-top: 2px; }
.prow-price { text-align: right; white-space: nowrap; font-size: var(--fs-20); line-height: var(--lh-heading); font-weight: var(--fw-bold); letter-spacing: var(--ls-tight); font-variant-numeric: tabular-nums; }
.prow-price span { display: block; font-size: var(--fs-12); font-weight: var(--fw-medium); letter-spacing: 0; color: var(--muted); }
.prow-buy, .prow-qty { display: flex; align-items: center; gap: var(--s-2); }

/* steps and call to action */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-4); }
.step { padding: var(--s-6); }
.step .n { width: 40px; height: 40px; margin-bottom: var(--s-5); border-radius: var(--r-md); display: grid; place-items: center; background: var(--primary-soft); color: var(--primary-text); font-family: var(--font-mono); font-weight: var(--fw-bold); }
.step h3 { margin-bottom: var(--s-2); }
.cta { display: grid; grid-template-columns: 1fr auto; gap: var(--s-8); align-items: center; padding: var(--s-12); border-radius: var(--r-xl); background: var(--inverse-bg); border-color: var(--inverse-bg); color: var(--inverse-text); box-shadow: var(--e2); }
.cta h2 { margin-bottom: var(--s-3); }
.cta p { max-width: 60ch; color: var(--inverse-muted); }
html[data-theme="dark"] .cta { border-color: var(--border); }

/* stats */
.stat { padding: var(--s-5); }
.stat .label { font-size: var(--fs-14); line-height: var(--lh-dense); font-weight: var(--fw-medium); color: var(--muted); }
.stat .value { font-size: var(--fs-32); line-height: var(--lh-tight); font-weight: var(--fw-bold); letter-spacing: var(--ls-heading); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.stat.accent .value { color: var(--primary-text); }
.stat { display: flex; flex-direction: column-reverse; justify-content: flex-end; gap: var(--s-1); }

/* product page */
.crumbs { display: flex; align-items: center; gap: var(--s-2); flex-wrap: wrap; margin-bottom: var(--s-6); font-size: var(--fs-14); color: var(--muted); }
.crumbs a { color: var(--text-2); }
.crumbs a:hover { color: var(--primary-text); }
.product-layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; grid-template-areas: "head buy" "body buy"; gap: var(--s-6) var(--s-8); align-items: start; }
.product-head { grid-area: head; }
.product-buy { grid-area: buy; }
.product-body { grid-area: body; display: grid; gap: var(--s-4); }
.product-title { display: flex; align-items: flex-start; gap: var(--s-4); margin-bottom: var(--s-4); }
.product-title h1 { margin: 0; overflow-wrap: anywhere; }

/* order status */
.status-hero { text-align: center; padding: var(--s-10) var(--s-8); }
.status-hero .icon { width: 56px; height: 56px; margin: 0 auto var(--s-5); border-radius: var(--r-lg); display: grid; place-items: center; }
.status-hero .icon .i { width: 28px; height: 28px; }
.status-hero p { max-width: 56ch; margin-left: auto; margin-right: auto; }
.status-delivered .icon { background: var(--success-soft); color: var(--success); }
.status-pending .icon { background: var(--warning-soft); color: var(--warning); }
.status-expired .icon { background: var(--danger-soft); color: var(--danger); }
.countdown { font-family: var(--font-mono); font-size: var(--fs-32); line-height: var(--lh-tight); font-weight: var(--fw-bold); font-variant-numeric: tabular-nums; }

/* auth and other centred cards */
.auth { max-width: calc(440px + 2 * var(--gutter)); }
.auth h1 { font-size: var(--fs-24); line-height: var(--lh-heading); letter-spacing: var(--ls-tight); margin-bottom: var(--s-2); }
.auth form { margin-top: var(--s-6); }

/* dashboards: denser type, quieter page */
.dash { display: grid; grid-template-columns: 232px minmax(0, 1fr); gap: var(--s-8); align-items: start; padding-top: var(--s-10); padding-bottom: 0; }
.side { position: sticky; top: calc(var(--header-h) + var(--s-5)); }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); flex-wrap: wrap; margin-bottom: var(--s-6); }
.page-head h1 { margin: 0; font-size: var(--fs-24); line-height: var(--lh-heading); letter-spacing: var(--ls-tight); }
.dash h3 { font-size: var(--fs-16); }
.dash .card > h3:first-child, .dash .card > .flex:first-child { margin-bottom: var(--s-4); }
.dash .card > .flex:first-child h3 { margin-bottom: 0; }
.cat-edit { padding: 0; }
.cat-edit summary { display: flex; align-items: center; gap: var(--s-3); min-height: 64px; padding: var(--s-3) var(--s-5); cursor: pointer; list-style: none; border-radius: var(--r-lg); }
.cat-edit summary::-webkit-details-marker { display: none; }
.cat-edit summary::after { content: ""; flex: none; width: 8px; height: 8px; margin-left: var(--s-2); border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: translateY(-2px) rotate(45deg); transition: transform var(--t-base) var(--ease); }
.cat-edit[open] summary::after { transform: translateY(2px) rotate(-135deg); }
.cat-edit[open] summary { border-bottom: 1px solid var(--border); border-radius: var(--r-lg) var(--r-lg) 0 0; }
.cat-edit .cat-edit-body { padding: var(--s-5); }

/* ---------- continuous page background ------------------------------------------------ */
/* One layer for the whole document: a dot matrix, two ruled guide lines with ticks on the content edges,
   and a slow tonal drift that repeats down the page. Dimmed behind the dashboards. */
.site-bg {
  --rule: color-mix(in srgb, var(--text) 8%, transparent);
  --dot: color-mix(in srgb, var(--text) 12%, transparent);
  --edge: max(var(--gutter), calc((100% - var(--w-container)) / 2 - var(--s-6)));
  position: absolute; inset: 0; z-index: -1; pointer-events: none; overflow: hidden;
}
.site-bg::before, .site-bg::after { content: ""; position: absolute; inset: 0; }
.site-bg::before {
  background:
    radial-gradient(circle at 1px 1px, var(--dot) 1px, transparent 1.5px) 0 0 / 24px 24px,
    repeating-linear-gradient(180deg,
      color-mix(in srgb, var(--primary) 8%, transparent) 0,
      transparent 560px,
      color-mix(in srgb, var(--accent-fill) 6%, transparent) 1240px,
      transparent 1860px,
      color-mix(in srgb, var(--primary) 8%, transparent) 2480px);
  -webkit-mask-image: linear-gradient(90deg, #000, rgb(0 0 0 / 0.45) 22%, rgb(0 0 0 / 0.45) 78%, #000);
  mask-image: linear-gradient(90deg, #000, rgb(0 0 0 / 0.45) 22%, rgb(0 0 0 / 0.45) 78%, #000);
}
.site-bg::after {
  background:
    linear-gradient(var(--rule), var(--rule)) calc(var(--edge)) 0 / 1px 100% no-repeat,
    linear-gradient(var(--rule), var(--rule)) calc(100% - var(--edge)) 0 / 1px 100% no-repeat,
    repeating-linear-gradient(180deg, var(--rule) 0 1px, transparent 1px 96px) calc(var(--edge) - 4px) 0 / 9px 100% no-repeat,
    repeating-linear-gradient(180deg, var(--rule) 0 1px, transparent 1px 96px) calc(100% - var(--edge) + 4px) 0 / 9px 100% no-repeat;
}
.is-app .site-bg { opacity: 0.55; }

/* ---------- responsive ---------------------------------------------------------------- */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(3, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .hero { padding: var(--s-16) 0 var(--s-12); }
  .hero-grid { grid-template-columns: 1fr; gap: var(--s-12); }
  .split, .split-wide, .dash { grid-template-columns: minmax(0, 1fr); }
  .product-layout { grid-template-columns: minmax(0, 1fr); grid-template-areas: "head" "buy" "body"; }
  .sticky-side, .side { position: static; }
  .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; }
  .footer-grid > :first-child { grid-column: 1 / -1; }
  /* side navigation becomes one scrolling row of chips */
  .side .who { display: flex; gap: var(--s-2); flex-wrap: wrap; padding: var(--s-3) var(--s-4); }
  .side-nav { display: flex; gap: var(--s-2); overflow-x: auto; padding: var(--s-3); scrollbar-width: thin; -webkit-overflow-scrolling: touch; }
  .side-nav a { flex: none; border: 1px solid var(--border); border-radius: var(--r-full); padding: 0 var(--s-4); background: var(--surface); }
  .side-nav a.active { border-color: var(--glow-border); }
  .side-nav .group { display: none; }
  .side-nav .ml-auto { margin-left: var(--s-1); }
}
@media (max-width: 960px) {
  .nav { display: none; }
  .burger { display: inline-grid; }
  .header .mobile-nav.open { display: grid; padding-top: var(--s-2); padding-bottom: var(--s-4); border-top: 1px solid var(--border); }
}
@media (max-width: 760px) {
  .hide-mobile { display: none !important; }
  .header .container { gap: var(--s-2); }
  .header-right { gap: var(--s-1); }
  /* touch targets: every control is at least 44px */
  .icon-btn { width: var(--control-h); height: var(--control-h); }
  .btn-sm, .pagination a, .pagination span { height: var(--control-h); min-width: var(--control-h); }
  .tabs { width: 100%; }
  .tabs a { flex: 1; justify-content: center; }
  .tabs a, .side-nav a, .menu-panel a, .menu-panel button, .check, .footer-grid a:not(.logo), .crumbs a { min-height: var(--control-h); height: auto; }
  .crumbs a { display: inline-flex; align-items: center; }
  .table a:not(.btn) { display: inline-flex; align-items: center; min-height: var(--control-h); }
  .qty button { width: var(--control-h); }
  .flash button { width: var(--control-h); height: var(--control-h); margin: -10px -12px -10px auto; }
  .flashes { left: var(--s-4); right: var(--s-4); width: auto; }
  .card.pad-lg { padding: var(--s-5); }
  main > .section:first-child { padding-top: var(--s-8); }

  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); gap: var(--s-3); }
  .grid-3:has(> .stat) { grid-template-columns: repeat(3, 1fr); gap: var(--s-2); }
  .stat { padding: var(--s-4); }
  .stat .value { font-size: var(--fs-24); line-height: var(--lh-heading); }
  .grid-3 > .stat .label { font-size: var(--fs-12); }
  .cta, .form-row, .kv, .steps { grid-template-columns: 1fr; }
  .cta { padding: var(--s-6); gap: var(--s-5); }
  .kv { gap: var(--s-1) 0; }
  .kv dd { margin-bottom: var(--s-2); }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: var(--s-6); }
  .footer-bottom { flex-direction: column; }

  .hero { padding: var(--s-10) 0 var(--s-8); }
  .hero .search { flex-wrap: wrap; }
  .hero .search .btn { flex: 1; }
  .hero-stats { grid-template-columns: 1fr 1fr; gap: var(--s-5) 0; margin-top: var(--s-8); }
  .hero-stats > div { padding: 0 var(--s-4); }
  .hero-stats > div:nth-child(odd) { padding-left: 0; border-left: 0; }
  .hero-actions .btn { flex: 1; }
  .terminal pre { padding: var(--s-4); }

  .cat-card { padding: var(--s-3); min-height: 64px; }
  .cat-card .arrow { display: none; }
  .cat-card .brand { --brand-size: 18px !important; }

  /* product rows stack: text, then price, then the buy controls across the full width */
  .prow { grid-template-columns: 44px minmax(0, 1fr); gap: var(--s-3); padding: var(--s-4); }
  .prow-title { display: flex; align-items: center; min-height: var(--control-h); }
  .prow-format { flex-wrap: wrap; }
  .prow-format .mono { white-space: normal; overflow-wrap: anywhere; }
  .prow-price { grid-column: 1 / -1; display: flex; align-items: baseline; gap: var(--s-2); text-align: left; }
  .prow-price span { display: inline; }
  .prow-buy, .prow-qty { grid-column: 1 / -1; }
  .prow-buy .btn-primary, .prow-buy > .btn { flex: 1; }
  .prow-cart { grid-template-columns: 44px minmax(0, 1fr) auto; }
  .prow-cart .prow-main { grid-column: 2 / -1; }
  .prow-cart .prow-qty { grid-column: 1 / 3; grid-row: 2; }
  .prow-cart .prow-price { grid-column: 3; grid-row: 2; align-self: center; }

  .product-title { gap: var(--s-3); }
  .status-hero { padding: var(--s-6) var(--s-4); }
  .status-hero .btn-lg { width: 100%; }
  .dash { padding-top: var(--s-6); gap: var(--s-5); }
  .page-head { margin-bottom: var(--s-4); }
  .site-bg::after { display: none; }
}

@media (max-width: 760px) {
  .prow > .btn { grid-column: 1 / -1; }
}

/* ---------- layout refinements --------------------------------------------------------- */
.product-buy .qty { display: flex; width: 100%; }
.product-buy .qty input { flex: 1; width: auto; }
.field .qty { justify-self: start; }
.product-buy .field .qty { justify-self: stretch; }
.cat-card .count { white-space: nowrap; }
.prow-cart .prow-price { min-width: 88px; }
.terminal pre { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 48px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 48px), transparent); }
@media (max-width: 760px) {
  .prow > .brand { align-self: start; margin-top: var(--s-1); }
  .crumbs > :nth-last-child(-n + 2) { display: none; }
  .crumbs { margin-bottom: var(--s-3); }
  .cat-card { gap: var(--s-2); }
  .cat-card .count { font-size: var(--fs-12); gap: var(--s-1); }
  .cat-card .count::before { box-shadow: none; }
}
.split > :last-child .kv { grid-template-columns: 1fr; gap: 2px 0; }
.split > :last-child .kv dd { margin-bottom: var(--s-3); }
.split > :last-child .kv dd:last-child { margin-bottom: 0; }
@media (max-width: 760px) {
  .table th, .table td { white-space: nowrap; }
  .cat-edit summary { padding: var(--s-3) var(--s-4); gap: var(--s-2); }
  .cat-edit summary .small { font-size: var(--fs-12); white-space: nowrap; }
  .cat-edit summary strong + .small { display: none; }
  .cat-edit .cat-edit-body { padding: var(--s-4); }
}

/* ---------- polish --------------------------------------------------------------------- */
[id] { scroll-margin-top: calc(var(--header-h) + var(--s-4)); }
.side-nav { scrollbar-width: thin; }
.error-card { padding: var(--s-12) var(--s-8); }
.error-card .error-code { margin-bottom: var(--s-4); }
.error-card p { max-width: 40ch; margin-left: auto; margin-right: auto; }
.flash { transition: opacity var(--t-slow) var(--ease); }

/* on touch screens a tap must not leave a card stuck in its hover glow */
@media (hover: none) {
  .prow:hover, .card-hover:hover, a.card:hover { border-color: var(--border); box-shadow: var(--e1); }
  .choice label:hover { border-color: var(--border-strong); box-shadow: none; }
  .choice label:has(input:checked) { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
  .btn-primary:hover { box-shadow: 0 1px 2px rgb(var(--ink) / 0.18), inset 0 1px 0 rgb(255 255 255 / 0.14); }
}

/* motion is decoration only: remove it for people who ask for less */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
  .btn:active { transform: none; }
  .btn.is-loading::after { animation: none; border-color: var(--spin); border-right-color: transparent; }
}

.table .mono { font-size: var(--fs-12); }
.product-body > *, .hero-visual > * { min-width: 0; }
@media (max-width: 760px) {
  .kv { grid-template-columns: minmax(0, 1fr); }
  .crumbs a { min-width: var(--control-h); }
  .dash .card a:not([class]), .card .flex.between > a.small { display: inline-flex; align-items: center; min-height: var(--control-h); }
  input[type="file"]::file-selector-button { height: var(--control-h); }
  .drop input[type="file"] { min-height: var(--control-h); }
}
