/* TradeOps UI design system (M6). Layered over vendored Bootstrap 5.3 —
   tokens + component tuning only, no build step (rule 8). All assets are
   self-hosted: mainland-China access must never depend on a CDN. */

:root {
  --to-bg: #f4f6f8;
  --to-surface: #ffffff;
  --to-border: #e4e8ee;
  --to-border-strong: #d3dae3;
  --to-border-heavy: #bcc7d4;
  --to-ink: #16212e;
  --to-body: #3c4757;
  --to-muted: #78849a;
  --to-navy: #182a44;
  --to-accent: #2456e0;
  --to-accent-ink: #1b44b4;
  --to-accent-soft: #e9effc;
  --to-green: #0f8a63;
  --to-green-soft: #e3f5ee;
  --to-red: #c0392f;
  --to-red-soft: #fdeae8;
  --to-amber: #96690a;
  --to-amber-soft: #fdf1dc;
  --to-tile: #f6f7f9;
  --to-radius: 12px;
  --to-shadow: 0 1px 2px rgba(22, 33, 46, 0.05), 0 1px 3px rgba(22, 33, 46, 0.04);
}

/* ---------- base ---------- */

body {
  background: var(--to-bg);
  color: var(--to-body);
  /* System stack with Chinese fallbacks (PingFang/YaHei): supplier names are
     中文 and nothing may load from a webfont CDN. */
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", sans-serif;
  font-size: 0.9375rem;
}

h1, h2, h3, h4, h5, h6 { color: var(--to-ink); }

.bi {
  width: 1em;
  height: 1em;
  vertical-align: -0.125em;
  flex-shrink: 0;
}

/* Amount columns line up digit-for-digit. */
.num { font-variant-numeric: tabular-nums; }

a { color: var(--to-accent); text-decoration: none; }
a:hover { color: var(--to-accent-ink); }

/* ---------- Bootstrap tuning ---------- */

.btn { border-radius: 8px; font-weight: 500; }
.btn-primary {
  --bs-btn-bg: var(--to-accent);
  --bs-btn-border-color: var(--to-accent);
  --bs-btn-hover-bg: var(--to-accent-ink);
  --bs-btn-hover-border-color: var(--to-accent-ink);
  --bs-btn-active-bg: var(--to-accent-ink);
  --bs-btn-active-border-color: var(--to-accent-ink);
  --bs-btn-disabled-bg: var(--to-accent);
  --bs-btn-disabled-border-color: var(--to-accent);
}
.btn-outline-secondary {
  --bs-btn-color: var(--to-body);
  --bs-btn-border-color: var(--to-border-strong);
  --bs-btn-hover-bg: var(--to-bg);
  --bs-btn-hover-color: var(--to-ink);
  --bs-btn-hover-border-color: var(--to-border-strong);
  --bs-btn-active-bg: var(--to-bg);
  --bs-btn-active-color: var(--to-ink);
  --bs-btn-active-border-color: var(--to-border-strong);
}

.form-control, .form-select {
  border-radius: 8px;
  border-color: var(--to-border-strong);
  color: var(--to-ink);
}
.form-control:focus, .form-select:focus {
  border-color: var(--to-accent);
  box-shadow: 0 0 0 0.2rem rgba(36, 86, 224, 0.12);
}
.form-label { font-weight: 500; color: var(--to-ink); margin-bottom: 0.25rem; }

.alert { border-radius: var(--to-radius); }

/* ---------- chrome ---------- */

.to-nav {
  background: var(--to-surface);
  border-bottom: 1px solid var(--to-border);
}
.to-brand {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--to-navy) !important;
  letter-spacing: -0.01em;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.to-brand .bi { color: var(--to-accent); font-size: 1.25rem; }
.to-nav .nav-link { color: var(--to-body); font-weight: 500; }
.to-nav .nav-link:hover { color: var(--to-ink); }
.to-nav .nav-link.active { color: var(--to-accent-ink); }

/* Flash messages float over the content so they are seen from any scroll
   position (scroll-restore.js lands saves mid-page); 1080 = Bootstrap's
   toast layer. */
.to-flash {
  position: fixed;
  top: .75rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1080;
  width: min(38rem, calc(100vw - 1.5rem));
}
.to-flash .alert { box-shadow: 0 .5rem 1.5rem rgba(15, 23, 42, .18); }

/* ---------- surfaces ---------- */

.to-card {
  background: var(--to-surface);
  border: 1px solid var(--to-border);
  border-radius: var(--to-radius);
  box-shadow: var(--to-shadow);
}

/* Overline metadata label: WHAT the value below is, without shouting. */
.to-label {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--to-muted);
}

.text-muted, .to-muted { color: var(--to-muted) !important; }

/* A sub-panel inside a card: a tinted, borderless tile reads calmer than a
   box inside a box. Replaces the ad-hoc `border rounded p-3` wrappers; the
   doc-card and balance-box surfaces share the same look. */
.to-tile {
  background: var(--to-tile);
  border-radius: 10px;
  padding: 0.9rem 1rem;
}
.to-tile > :last-child { margin-bottom: 0; }

/* A row of tool disclosures (catalog pick, JSON fills): closed ones sit
   side by side; the open one takes the full width of the row. */
.to-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.5rem;
}
.to-tools > details[open] { flex: 1 1 100%; }

/* Section heading inside a card: short text, optional icon, the "?" mark,
   and room for a right-aligned action (ms-auto on that child). */
.to-h {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin: 0 0 0.6rem;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--to-ink);
}
.to-h .bi { color: var(--to-muted); }
.to-h .to-help { margin-left: 0; }
.to-h + .to-h { margin-top: 1.25rem; }

/* Card footer row (the workspace's stage transition): hugs the card's
   bottom edge so it reads as part of the card, not another box. */
.to-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 1.5rem -1.5rem -1.5rem;
  padding: 0.85rem 1.5rem;
  border-top: 1px solid var(--to-border);
  background: #fbfcfd;
  border-radius: 0 0 var(--to-radius) var(--to-radius);
}

/* The footer's exit checklist (ui/partials/stage_checklist.html): one
   line per condition, wrapping; the icon carries the verdict, done items
   recede so the open ones read first. */
.to-foot-main { flex: 1 1 20rem; min-width: 0; }
.stage-checklist {
  display: flex;
  flex-wrap: wrap;
  column-gap: 1.1rem;
  row-gap: 0.2rem;
}
.stage-checklist li {
  display: inline-flex;
  align-items: flex-start;
  gap: 0.3rem;
  max-width: 100%;
}
.stage-checklist li .bi { width: 0.85em; height: 0.85em; flex: none; margin-top: 0.3em; }
.stage-checklist li.done { color: var(--to-muted); }
.stage-checklist li.done .bi { color: var(--bs-success); }
.stage-checklist li.open .bi { color: var(--bs-warning-text-emphasis); }

/* ---------- help marks ---------- */
/* The "?" beside a heading or label ({% help %}): explanations live one
   click away in a popover instead of as paragraphs on the screen.
   Bootstrap's focus-trigger popover, wired in help-popovers.js. */
.to-help {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.05rem;
  height: 1.05rem;
  margin-left: 0.3rem;
  border: 1px solid var(--to-border-heavy);
  border-radius: 50%;
  color: var(--to-muted);
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1;
  vertical-align: middle;
  text-decoration: none;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  flex-shrink: 0;
}
.to-help:hover,
.to-help:focus-visible {
  color: var(--to-accent-ink);
  border-color: var(--to-accent);
  background: var(--to-accent-soft);
  outline: none;
}
.form-label .to-help, label .to-help { margin-left: 0.2rem; }
.popover {
  --bs-popover-max-width: 22rem;
  --bs-popover-font-size: 0.82rem;
  --bs-popover-border-color: var(--to-border-strong);
  --bs-popover-border-radius: 10px;
  --bs-popover-body-color: var(--to-body);
  --bs-popover-header-bg: var(--to-bg);
  --bs-popover-header-color: var(--to-ink);
  --bs-popover-header-font-size: 0.82rem;
  box-shadow: 0 0.5rem 1.5rem rgba(15, 23, 42, 0.12);
}
.popover-header { font-weight: 600; }
.popover-body p:last-child, .popover-body ul:last-child { margin-bottom: 0; }

/* ---------- pipeline stages ---------- */
/* One hue per stage, progressing sourcing→blue, commitment→violet,
   logistics→warm, finalization→green, closed→gray. --sb/--sf are read by
   .stage-badge and the workspace stepper so both surfaces always agree. */

.stage-inquiry          { --sb: #edf1f7; --sf: #52627c; }
.stage-supplier_quoting { --sb: #e8effc; --sf: #2b5cd9; }
.stage-client_quotation { --sb: #e9ecfd; --sf: #4553d0; }
.stage-contracting      { --sb: #f0eafd; --sf: #6b46c8; }
.stage-payment          { --sb: #f9e9f6; --sf: #a63d8f; }
.stage-production       { --sb: #fdf1dc; --sf: #96690a; }
.stage-booking          { --sb: #fdeadd; --sf: #b05e18; }
.stage-in_transit       { --sb: #e0f3fa; --sf: #177296; }
.stage-doc_finalization { --sb: #e0f5f0; --sf: #0f7d64; }
.stage-customs_handover { --sb: #e4f6e4; --sf: #2e7d32; }
.stage-closed           { --sb: #eceff3; --sf: #68738a; }

.stage-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.26rem 0.68rem;
  border-radius: 999px;
  background: var(--sb);
  color: var(--sf);
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
}
.stage-badge::before {
  content: "";
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 50%;
  background: currentColor;
}

/* ---------- dashboard ---------- */

/* The find bar: a search box that stops growing before it swallows the row,
   and the stage filter — the pipeline as clickable stage badges, each in
   its own hue (the section headings' .stage-badge), the chosen one filled
   solid so the row itself says what the board is showing. */
.orders-search-box { flex: 1 1 18rem; max-width: 30rem; }
.stage-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}
.stage-filter .stage-badge { text-decoration: none; }
.stage-filter .stage-badge:hover { box-shadow: 0 0 0 2px var(--sb), 0 0 0 3px var(--sf); }
.stage-filter .stage-badge.active { background: var(--sf); color: #fff; }
.stage-filter .stage-badge .num { font-weight: 500; opacity: 0.75; }
.stage-all { --sb: var(--to-surface); --sf: var(--to-ink); border: 1px solid var(--to-border); }
.stage-all.active { border-color: var(--sf); }

.stage-section + .stage-section { margin-top: 1.75rem; }
.stage-section-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.6rem;
}
.stage-count { color: var(--to-muted); font-size: 0.82rem; font-weight: 500; }

/* One order = one clickable row-card. Grid keeps the five facts aligned
   across every card so the eye scans columns, not prose. */
.order-card {
  display: grid;
  grid-template-columns: minmax(220px, 1.35fr) minmax(140px, 1fr) minmax(160px, 1fr) minmax(180px, 1.2fr) minmax(120px, 0.8fr);
  gap: 1rem;
  align-items: center;
  padding: 0.9rem 1.15rem;
  color: inherit;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.order-card + .order-card { margin-top: 0.6rem; }
.order-card:hover {
  border-color: var(--to-accent);
  box-shadow: 0 2px 8px rgba(36, 86, 224, 0.10);
  color: inherit;
}
.order-ref { font-weight: 650; color: var(--to-ink); }
.order-client { color: var(--to-muted); font-size: 0.85rem; }

.blocking-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 0.4rem;
  padding: 0.22rem 0.6rem;
  border-radius: 8px;
  background: var(--to-amber-soft);
  color: var(--to-amber);
  font-size: 0.82rem;
  font-weight: 500;
}
.blocking-chip .bi { align-self: center; }

.internal-label-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.18rem 0.55rem;
  border-radius: 8px;
  background: var(--to-accent-soft);
  color: var(--to-accent-ink);
  font-size: 0.82rem;
  font-weight: 500;
  max-width: 100%;
}

/* ---------- product picture crop ---------- */

.product-picture-editor { max-width: 20rem; }
.product-picture-editor.compact { max-width: 13rem; margin-top: .35rem; }
.product-picture-crop {
  width: 10rem;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--bs-border-color);
  border-radius: .5rem;
  background: var(--bs-tertiary-bg);
  color: var(--to-muted);
  font-size: .75rem;
}
.product-picture-editor.compact .product-picture-crop { width: 5.5rem; }
.product-picture-crop img { width: 100%; height: 100%; object-fit: cover; }
.product-picture-editor summary { cursor: pointer; }
.product-crop-dialog {
  width: min(64rem, calc(100vw - 2rem));
  max-width: none;
  max-height: calc(100vh - 2rem);
  padding: 0;
  overflow: auto;
  border: 0;
  border-radius: .75rem;
  background: var(--bs-body-bg);
  color: var(--bs-body-color);
  box-shadow: 0 1rem 3rem rgba(0, 0, 0, .3);
}
.product-crop-dialog::backdrop { background: rgba(18, 25, 39, .75); }
.product-crop-dialog-content { padding: 1rem; }
.product-crop-stage-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: min(62vh, 44rem);
  padding: .35rem;
  overflow: hidden;
  border-radius: .5rem;
  background: #182033;
}
.product-crop-stage {
  position: relative;
  flex: 0 0 auto;
  overflow: hidden;
  line-height: 0;
  touch-action: none;
}
.product-crop-stage img {
  display: block;
  width: 100%;
  height: 100%;
  user-select: none;
  pointer-events: none;
}
.product-crop-box {
  position: absolute;
  border: 2px solid #fff;
  box-shadow: 0 0 0 9999px rgba(18, 25, 39, .66);
  cursor: move;
  touch-action: none;
}
.product-crop-box:focus-visible {
  outline: 3px solid var(--to-accent);
  outline-offset: -5px;
}
.product-crop-handle {
  position: absolute;
  width: 1rem;
  height: 1rem;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--to-accent);
}
.product-crop-handle[data-crop-handle="nw"] { top: -.5rem; left: -.5rem; cursor: nwse-resize; }
.product-crop-handle[data-crop-handle="ne"] { top: -.5rem; right: -.5rem; cursor: nesw-resize; }
.product-crop-handle[data-crop-handle="sw"] { bottom: -.5rem; left: -.5rem; cursor: nesw-resize; }
.product-crop-handle[data-crop-handle="se"] { right: -.5rem; bottom: -.5rem; cursor: nwse-resize; }
.internal-label-chip .bi { flex: 0 0 auto; }

.margin-pos { color: var(--to-green); font-weight: 650; }
.margin-neg { color: var(--to-red); font-weight: 650; }
.margin-unknown { color: var(--to-muted); font-size: 0.82rem; font-style: italic; }

/* Operations margin history — server-rendered bars, no JS/build (rule 8). */
.mg-bars {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
}
.mg-bar-col {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
}
.mg-bar-track {
  width: 100%;
  height: 120px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.mg-bar {
  width: 68%;
  min-height: 2px;
  border-radius: 5px 5px 0 0;
  background: var(--to-accent);
}
.mg-bar.is-neg { background: var(--to-red); }
.mg-bar.is-zero { background: var(--to-border-strong); }
.mg-bar-col.is-current .mg-bar { outline: 2px solid var(--to-accent-ink); outline-offset: 1px; }
.mg-bar-label { font-size: 0.7rem; color: var(--to-muted); white-space: nowrap; }
.mg-bar-count { font-size: 0.68rem; color: var(--to-muted); }

@media (max-width: 991px) {
  .order-card { grid-template-columns: 1fr 1fr; }
}

/* ---------- workspace stepper ---------- */
/* The §4 pipeline as navigation: dots on a line, one per stage. past =
   filled navy, current = accent with a soft ring, future = hollow. The
   viewed-but-not-current stage gets a gray ring so "where am I looking"
   and "where is the order" stay distinguishable. */

.to-stepper {
  display: flex;
  overflow-x: auto;
  padding-top: 0.25rem;
}
.to-step {
  /* Grow but never shrink below the label: narrow screens scroll the
     stepper instead of overlapping stage names. */
  flex: 1 0 76px;
  position: relative;
  text-align: center;
  padding-top: 20px;
  color: var(--to-muted);
}
.to-step::before {
  content: "";
  position: absolute;
  top: 8px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--to-border-strong);
}
.to-step:first-child::before { left: 50%; }
.to-step:last-child::before { right: 50%; }
.to-step-dot {
  position: absolute;
  top: 3px;
  left: 50%;
  transform: translateX(-50%);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--to-surface);
  border: 2px solid var(--to-border-strong);
  z-index: 1;
}
.to-step-label {
  font-size: 0.72rem;
  font-weight: 500;
  display: block;
  padding: 2px 4px 0;
  white-space: nowrap;
}
.to-step.past { color: var(--to-body); }
.to-step.past::before { background: var(--to-navy); }
.to-step.past .to-step-dot { background: var(--to-navy); border-color: var(--to-navy); }
.to-step.current { color: var(--to-accent-ink); }
.to-step.current .to-step-label { font-weight: 650; }
.to-step.current::before {
  background: linear-gradient(to right, var(--to-navy) 50%, var(--to-border-strong) 50%);
}
.to-step.current .to-step-dot {
  background: var(--to-accent);
  border-color: var(--to-accent);
  box-shadow: 0 0 0 4px var(--to-accent-soft);
}
.to-step.viewed:not(.current) .to-step-dot { box-shadow: 0 0 0 4px #e3e7ed; }
.to-step:hover { color: var(--to-ink); }

.note-meta { font-size: 0.72rem; }

/* ---------- quotation editor ---------- */

.q-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.24rem 0.6rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  background: var(--qb, #eceff3);
  color: var(--qf, #68738a);
}
.qstatus-draft    { --qb: #eceff3; --qf: #68738a; }
.qstatus-sent     { --qb: #e8effc; --qf: #2b5cd9; }
.qstatus-accepted { --qb: #e3f5ee; --qf: #0f8a63; }
.qstatus-partial  { --qb: #e0f5f0; --qf: #0f7d64; }
.qstatus-rejected { --qb: #fdeae8; --qf: #c0392f; }
.qstatus-expired  { --qb: #fdf1dc; --qf: #96690a; }

.qlines thead th {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--to-muted);
  border-bottom-color: var(--to-border);
}
.qlines td { border-bottom-color: var(--to-border); }
/* Product rows stack several fields vertically (client quotation above all);
   the boundary between rows must outweigh the field borders inside them, or
   adjacent rows blur together. tbody only — the totals foot keeps its
   hairline. */
.qlines tbody td {
  border-bottom: 2px solid var(--to-border-heavy);
  padding-top: 0.55rem;
  padding-bottom: 0.55rem;
}
.qlines input { display: inline-block; }
.qlines input.is-invalid {
  border-color: var(--to-amber);
  background-image: none;
}

/* Hide number-input spinners: these are money fields, not counters. */
.qlines input::-webkit-outer-spin-button,
.qlines input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.qlines input[type="number"] { -moz-appearance: textfield; appearance: textfield; }

/* ---------- contracting / payment panels ---------- */

.supplier-chain {
  border-top: 1px solid var(--to-border);
  padding-top: 0.85rem;
}
.balance-box {
  border-radius: 10px;
  padding: 0.8rem 1rem;
  background: var(--to-tile);
}
.balance-box.settled { background: var(--to-green-soft); }

/* Proof photos on the payments table: recognisable, not archival size. */
.proof-thumb {
  display: block;
  height: 40px;
  width: auto;
  max-width: 80px;
  object-fit: cover;
}
/* A non-picture proof (PDF, Word, Excel): a small tile in the thumbnail's
   place — the icon and the file's extension, the name on hover. */
.proof-file {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  height: 40px;
  padding: 0 0.5rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--to-muted);
  background: var(--bs-body-bg);
}
.proof-file .bi { width: 0.95em; height: 0.95em; }

/* ---------- documents card ---------- */

.doc-card {
  border-radius: 10px;
  padding: 0.9rem 1rem;
  background: var(--to-tile);
}
.doc-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  padding: 0.45rem 0;
}
.doc-row + .doc-row { border-top: 1px solid var(--to-border); }
.stale-box {
  background: var(--to-amber-soft);
  color: var(--to-amber);
  border-radius: 8px;
  padding: 0.65rem 0.8rem;
  margin-top: 0.35rem;
}
.stale-box ul { color: var(--to-body); }
.btn-warning {
  --bs-btn-bg: #f4c04a;
  --bs-btn-border-color: #f4c04a;
  --bs-btn-hover-bg: #e8b13a;
  --bs-btn-hover-border-color: #e8b13a;
  --bs-btn-color: #4a3603;
  --bs-btn-hover-color: #4a3603;
  --bs-btn-active-bg: #e8b13a;
  --bs-btn-active-border-color: #e8b13a;
}

/* ---------- login ---------- */

.login-wrap {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
}
.login-card { width: 100%; max-width: 400px; padding: 2.25rem 2rem; }

/* ---------- empty states ---------- */

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--to-muted);
}
.empty-state .bi { font-size: 2rem; margin-bottom: 0.75rem; opacity: 0.5; }

/* ---------- databases menu ---------- */

/* Every table in one dropdown is a long list — cap it and let it scroll rather
   than run off the bottom of the screen. */
.to-db-menu {
  max-height: 70vh;
  overflow-y: auto;
}

/* ---------- drag-to-reorder (product lines) ---------- */

.drag-handle {
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  font-size: 1.1rem;
  line-height: 1;
  padding: 0.15rem 0.25rem;
  display: inline-block;
}
.drag-handle:active { cursor: grabbing; }

/* ---------- catalog multi-pick ---------- */

/* The summary renders as a button; the disclosure triangle would double it. */
.catalog-pick > summary { list-style: none; }
.catalog-pick > summary::-webkit-details-marker { display: none; }
.catalog-pick-list {
  max-height: 16rem;
  overflow-y: auto;
}
.catalog-pick-item {
  padding: 0.3rem 0.25rem;
  border-bottom: 1px solid var(--bs-border-color);
  cursor: pointer;
}
/* The filter hides items via the hidden attribute; the item's .d-flex is
   display:flex !important, which outranks the browser's plain [hidden] rule. */
.catalog-pick-item[hidden] { display: none !important; }
.catalog-pick-item:last-child { border-bottom: 0; }
.catalog-pick-qty { width: 6.5rem; }
