/* Brand tokens from the spec (Brand and Color). */
:root {
  --bg: #FFFFFF;
  --surface: #FFF4DF;
  --surface-2: #FBEFD8;
  --text: #2A1F24;
  --muted: #6B5A61;
  --line: #EBDDC6;
  --primary: #D92D5C;
  --primary-text: #FFFFFF;
  --secondary: #20B3A5;
  --secondary-text: #2A1F24;
  --link: #157A71;
  --chip: #F3A6C2;
  --chip-text: #2A1F24;
  --warn: #F2A900;
  --danger: #B3203F;
  --ok: #157A71;
  --shadow: 0 10px 30px -18px rgba(42, 31, 36, .45);
  --radius: 16px;
  --toast-link: #F3A6C2;
  --display: "Bricolage Grotesque", "Figtree", system-ui, sans-serif;
  --body: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1C1719; --surface: #2A2226; --surface-2: #33292E; --text: #FFF4DF; --muted: #C9B9AE; --line: #43373C;
    --link: #20B3A5; --chip: rgba(243, 166, 194, .22); --chip-text: #FFF4DF; --danger: #FF6B8B; --ok: #20B3A5;
    --shadow: 0 10px 30px -18px rgba(0, 0, 0, .8); --toast-link: #157A71; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #1C1719; --surface: #2A2226; --surface-2: #33292E; --text: #FFF4DF; --muted: #C9B9AE; --line: #43373C;
  --link: #20B3A5; --chip: rgba(243, 166, 194, .22); --chip-text: #FFF4DF; --danger: #FF6B8B; --ok: #20B3A5;
  --shadow: 0 10px 30px -18px rgba(0, 0, 0, .8); --toast-link: #157A71; color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 72px; scroll-padding-bottom: 160px; }
body {
  margin: 0; background: var(--bg); color: var(--text); font: 16px/1.5 var(--body);
  padding-bottom: calc(76px + env(safe-area-inset-bottom));
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--display); letter-spacing: -.01em; line-height: 1.15; margin: 0 0 .4em; }
.page-title { font-size: clamp(26px, 5vw, 34px); font-weight: 800; }
.h3, h3 { font-size: 18px; font-weight: 700; }
p { margin: 0 0 .75em; }
a { color: var(--link); }
img { max-width: 100%; display: block; }
.small { font-size: 14px; }
.muted { color: var(--muted); }
.center { text-align: center; }
.ok { color: var(--ok); font-weight: 600; }
.error { color: var(--danger); font-weight: 600; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 12px; top: 12px; z-index: 50; background: var(--bg); padding: 8px 12px; border-radius: 8px; }
:focus-visible { outline: 3px solid var(--link); outline-offset: 2px; }

/* shell */
.top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(8px + env(safe-area-inset-top)) 16px 8px; background: var(--bg); background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-family: var(--display); font-weight: 800; font-size: 19px; }
.brand img { border-radius: 8px; }
main { max-width: 1120px; margin: 0 auto; padding: 16px; outline: none; overflow-wrap: anywhere; }
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; justify-content: space-around; gap: 2px;
  padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); background: var(--bg); border-top: 1px solid var(--line); }
.tabs a { flex: 1; max-width: 120px; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 4px; min-height: 52px;
  color: var(--muted); text-decoration: none; font-size: 12px; font-weight: 600; border-radius: 12px; white-space: nowrap; }
.tabs a svg { width: 22px; height: 22px; }
.tabs a.on { color: var(--primary); background: var(--surface); background: color-mix(in srgb, var(--primary) 10%, transparent); }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 999px;
  border: 0; font: inherit; font-weight: 700; font-size: 15px; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn.primary { background: var(--primary); color: var(--primary-text); }
.btn.secondary { background: var(--secondary); color: var(--secondary-text); }
.btn.ghost { background: transparent; color: var(--text); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.danger.ghost { background: transparent; color: var(--danger); box-shadow: inset 0 0 0 1.5px currentColor; }
.btn.big { min-height: 56px; font-size: 16px; padding: 0 22px; }
.btn.sm { min-height: 36px; padding: 0 12px; font-size: 14px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.link { background: none; border: 0; padding: 4px 2px; color: var(--link); font: inherit; font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.link.sm { font-size: 13px; }
.icon-btn { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 999px; border: 0; background: transparent; color: var(--text); cursor: pointer; flex: none; }
.icon-btn svg { width: 22px; height: 22px; }
.icon-btn.sm { width: 32px; height: 32px; }
.icon-btn.sm svg { width: 16px; height: 16px; }
.icon-btn:hover, .btn.ghost:hover { background: var(--surface); }

.row { display: flex; gap: 10px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.row.between { justify-content: space-between; }
.row.center { justify-content: center; }
.stack { display: grid; gap: 10px; }

/* forms */
.card-panel { background: var(--surface); border-radius: var(--radius); padding: 18px; margin: 16px 0; }
.field { display: grid; gap: 6px; margin: 0 0 14px; font-weight: 600; font-size: 14px; }
.field > span:first-child { color: var(--text); }
.hint { font-weight: 400; color: var(--muted); font-size: 13px; }
input:not([type=checkbox]):not([type=radio]), select, textarea {
  width: 100%; min-height: 44px; padding: 10px 12px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--bg); color: var(--text); font: inherit; font-weight: 400; }
textarea { min-height: 64px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--link); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--link) 25%, transparent); }
.size-row input { width: 6.5em; min-width: 0; flex: 0 1 auto; text-align: center; }
.seg { border: 0; padding: 0; margin: 0 0 14px; display: flex; flex-wrap: wrap; gap: 8px; }
.seg legend { font-weight: 600; font-size: 14px; margin-bottom: 6px; padding: 0; width: 100%; }
.seg label { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border-radius: 999px; background: var(--bg); box-shadow: inset 0 0 0 1.5px var(--line); cursor: pointer; font-weight: 600; font-size: 14px; }
.seg label:has(input:checked) { box-shadow: inset 0 0 0 2px var(--primary); background: color-mix(in srgb, var(--primary) 8%, var(--bg)); }
.seg input { accent-color: var(--primary); }
.field-group { margin: 0 0 14px; background: var(--bg); border-radius: 12px; padding: 4px 14px; }
.field-group summary { cursor: pointer; font-weight: 600; font-size: 14px; min-height: 40px; display: flex; align-items: center; }
.field-group[open] { padding-bottom: 6px; }
.switch { display: flex; gap: 12px; align-items: flex-start; margin: 10px 0; cursor: pointer; font-weight: 600; }
.switch input { width: 22px; height: 22px; accent-color: var(--primary); margin-top: 2px; flex: none; }
.switch small { display: block; font-weight: 400; color: var(--muted); }
.sticky-actions { position: sticky; z-index: 5; bottom: calc(76px + env(safe-area-inset-bottom)); background: var(--surface); padding: 10px 0 8px; margin-top: 6px; box-shadow: 0 -10px 12px -10px rgba(0,0,0,.15); }

.tag-picker { display: grid; gap: 10px; margin-bottom: 8px; }
.tag-group { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tag-kids { display: contents; }
.tagchip { min-height: 36px; padding: 0 12px; border-radius: 999px; border: 0; background: var(--bg); color: var(--text); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; box-shadow: inset 0 0 0 1.5px var(--line); }
.tag-group > .tagchip:first-child { font-weight: 800; }
.tagchip[aria-pressed="true"] { background: var(--primary); color: #fff; box-shadow: none; }
.tagchip[aria-pressed="true"]::before { content: "✓ "; }

/* chips */
.chips { list-style: none; padding: 0; margin: 0 0 12px; display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 2px 6px 2px 10px; border-radius: 999px; background: var(--chip); color: var(--chip-text); font-size: 14px; font-weight: 600; border: 0; font-family: inherit; }
.chip svg { width: 14px; height: 14px; }
.chip.primary { box-shadow: inset 0 0 0 2px var(--primary); background: var(--bg); }
.chip.filter { background: var(--primary); color: #fff; cursor: pointer; padding-right: 10px; }
.chip.filter.out { background: var(--bg); color: var(--text); box-shadow: inset 0 0 0 2px var(--text); }
.chip.note { background: transparent; color: var(--muted); font-weight: 500; }
.chip.mini { min-height: 28px; font-size: 13px; padding: 2px 10px 2px 6px; }
.chip.saved { padding: 2px 4px 2px 12px; }
.badge { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; background: var(--primary); color: #fff; border-radius: 999px; padding: 2px 8px; }
.badge.soft { background: var(--chip); color: var(--chip-text); text-transform: none; letter-spacing: 0; font-size: 12px; }
.badge.used { background: var(--muted); margin-left: 6px; }
.dot { width: 16px; height: 16px; border-radius: 50%; flex: none; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .18); display: inline-block; }

/* gallery */
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.toolbar.sub { justify-content: flex-end; }
.toolbar.sub .count { margin-right: auto; color: var(--muted); font-size: 14px; font-weight: 600; }
.search { flex: 1; }
.compact select { min-height: 40px; padding: 6px 10px; font-size: 14px; }
.chips-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 8px; }
.chips-row:empty { display: none; }
.gallery { list-style: none; padding: 0; margin: 0; }
.gallery.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.gallery.masonry { columns: 150px; column-gap: 12px; }
.gallery.masonry li { break-inside: avoid; margin-bottom: 12px; }
.card { display: block; color: var(--text); text-decoration: none; border-radius: 14px; }
.card img { width: 100%; border-radius: 12px; background: var(--surface); box-shadow: var(--shadow); }
.gallery.grid .card img { aspect-ratio: 1 / 1; object-fit: cover; height: auto; }
.card .meta { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-weight: 700; font-size: 14px; }
.card .sub { display: block; color: var(--muted); font-size: 13px; line-height: 1.3; }
.card.used img { opacity: .45; }
.empty { text-align: center; padding: 40px 16px; }
.empty.hero img { margin: 0 auto 16px; border-radius: 22px; }
.empty.hero h2 { font-size: clamp(24px, 5vw, 32px); }
.empty.hero p { max-width: 520px; margin: 0 auto 20px; color: var(--muted); }
.working { padding: 20px 0; color: var(--muted); font-weight: 600; }
.working::before { content: ""; display: inline-block; width: 16px; height: 16px; margin-right: 10px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--primary); vertical-align: -3px; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* sheets */
.sheet-wrap { position: fixed; inset: 0; z-index: 40; background: rgba(28, 23, 25, .5); display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: var(--bg); width: 100%; max-width: 560px; max-height: 88vh; border-radius: 22px 22px 0 0; display: flex; flex-direction: column; box-shadow: 0 -10px 40px rgba(0, 0, 0, .25); }
.sheet.wide { max-width: 760px; }
@media (min-width: 720px) { .sheet-wrap { align-items: center; } .sheet { border-radius: 22px; } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 12px 4px 20px; }
.sheet-head h2 { margin: 0; font-size: 22px; }
.sheet-body { padding: 8px 20px calc(20px + env(safe-area-inset-bottom)); overflow: auto; }
.sheet-img { max-height: 260px; margin: 0 auto 8px; border-radius: 12px; cursor: crosshair; }

/* filter sheet */
.fs-sec { padding: 12px 0; border-bottom: 1px solid var(--line); }
.fs-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.fs-head h3 { margin: 0; }
.opts { display: flex; flex-wrap: wrap; gap: 6px; }
.opts.tree { display: grid; gap: 4px; }
.opt { display: inline-flex; align-items: center; gap: 2px; padding-left: calc(var(--d, 0) * 20px); }
.opt-main { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 12px; border-radius: 999px; border: 0; background: var(--surface); color: var(--text); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.opt-main .n { color: var(--muted); font-weight: 500; font-size: 13px; }
.opt-main.on { background: var(--primary); color: #fff; }
.opt-main.on .n { color: rgba(255, 255, 255, .85); }
.opt-ex { color: var(--muted); }
.opt-ex.on { color: var(--danger); }
.opt .struck { text-decoration: line-through; }
.opt.zero .opt-main { opacity: .45; }
.seg-btns { display: inline-flex; background: var(--surface); border-radius: 999px; padding: 3px; gap: 2px; }
.seg-btns button { border: 0; background: transparent; color: var(--text); font: inherit; font-size: 14px; font-weight: 600; min-height: 36px; padding: 0 12px; border-radius: 999px; cursor: pointer; }
.seg-btns.sm button { min-height: 30px; font-size: 13px; }
.seg-btns button.on { background: var(--bg); box-shadow: 0 1px 4px rgba(0, 0, 0, .15); color: var(--primary); }
.fs-foot { position: sticky; bottom: calc(-20px - env(safe-area-inset-bottom)); background: var(--bg); display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; padding: 14px 0 6px; }

/* add / item */
.photo-pick { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 8px 0 16px; }
.photo-pick p { flex-basis: 100%; margin: 0; }
.preview { display: grid; gap: 18px; grid-template-columns: minmax(0, 1fr); margin-bottom: 8px; }
@media (min-width: 720px) { .preview { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.preview img, .item-photo img, .tap-img { border-radius: 14px; cursor: crosshair; box-shadow: var(--shadow); }
.preview figure, .item-photo { margin: 0; }
.item-layout { display: grid; gap: 20px; }
@media (min-width: 820px) { .item-layout { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); align-items: start; } .item-photo { position: sticky; top: 80px; } }
.no-photo { aspect-ratio: 1; background: var(--surface); border-radius: 14px; display: grid; place-items: center; color: var(--muted); }
.back { display: inline-block; margin-bottom: 8px; font-weight: 700; text-decoration: none; }
.lifecycle { margin: 6px 0 16px; }
.color-chip .chip-label { margin-right: 2px; }

/* bulk */
.tips { background: var(--surface); border-radius: var(--radius); padding: 14px 18px 14px 36px; margin: 0 0 12px; }
.tips li { margin: 4px 0; }
.bulk-photo { margin: 0 0 12px; }
.bulk-photo img { border-radius: 14px; box-shadow: var(--shadow); width: 100%; }
.grid-status { border-radius: 14px; padding: 12px 16px; margin-bottom: 12px; background: var(--surface); border-left: 0; }
.grid-status.ok { box-shadow: inset 4px 0 0 var(--secondary); }
.grid-status.warn { box-shadow: inset 4px 0 0 var(--warn); }
.grid-status p { margin: 0 0 6px; }
.review { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); }
.review-card { display: grid; grid-template-columns: auto 76px minmax(0, 1fr); gap: 12px; align-items: start; padding: 12px; border-radius: 14px; background: var(--surface); }
.review-card.off { opacity: .6; }
.review-card.flagged { box-shadow: inset 0 0 0 2px var(--warn); }
.review-card img { width: 76px; height: 76px; object-fit: cover; border-radius: 10px; }
.review-card .inc { display: flex; flex-direction: column; align-items: center; gap: 4px; cursor: pointer; }
.review-card .inc input { width: 22px; height: 22px; accent-color: var(--primary); }
.review-card .num { font-family: var(--display); font-weight: 800; font-size: 18px; }
.rv-body { display: grid; gap: 8px; min-width: 0; }
.rv-body .size-row { flex-wrap: wrap; gap: 6px; }
.rv-body .size-row input { width: 4.2em; min-height: 40px; padding: 6px; }
.mini-colors { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.flag { display: flex; gap: 6px; align-items: flex-start; margin: 0; font-size: 13px; font-weight: 600; }
.flag svg { width: 16px; height: 16px; flex: none; color: #B07A00; margin-top: 2px; }
[data-theme="dark"] .flag svg { color: var(--warn); }
.count { font-weight: 600; color: var(--muted); margin: 8px 0; }

/* bins, tags, settings */
.tree-list { list-style: none; padding: 0; margin: 16px 0; }
.tree-list li { display: flex; align-items: center; gap: 4px; padding: 4px 4px 4px calc(8px + var(--d) * 22px); border-bottom: 1px solid var(--line); min-height: 52px; }
.tree-name { flex: 1; font-weight: 600; color: var(--text); text-decoration: none; }
.tree-list .n { color: var(--muted); font-size: 14px; min-width: 2em; text-align: right; margin-right: 6px; }
.plain { list-style: none; padding: 0; margin: 0; }
.plain li { display: flex; align-items: center; gap: 8px; padding: 6px 0; }

/* toast */
.toast { position: fixed; left: 16px; right: 16px; margin: 0 auto; width: fit-content; max-width: 560px; bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 60; background: var(--text); color: var(--bg);
  padding: 12px 18px; border-radius: 14px; font-weight: 600; font-size: 15px; display: flex; gap: 14px; align-items: center; justify-content: space-between; box-shadow: var(--shadow); }
.toast .link { color: var(--toast-link); white-space: nowrap; }

/* print: only the swatch sheet */
#print { display: none; }
@media print {
  body { padding: 0; background: #fff; color: #000; }
  .top, .tabs, main, .toast, .sheet-wrap { display: none !important; }
  #print { display: block; }
  #print h1 { font-size: 20pt; margin: 0 0 4pt; }
  .print-grid { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 10pt; }
  .print-grid li { break-inside: avoid; font-size: 10pt; display: grid; gap: 2pt; }
  .print-grid img { width: 100%; aspect-ratio: 1; object-fit: cover; border: 0.5pt solid #ccc; }
}
@media (min-width: 900px) {
  .gallery.grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; scroll-behavior: auto !important; } }

/* add hub */
.hub { list-style: none; padding: 0; margin: 8px 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); }
.hub-card { display: flex; gap: 16px; align-items: flex-start; padding: 18px; border-radius: var(--radius); background: var(--surface); color: var(--text); text-decoration: none; min-height: 96px; }
.hub-card:hover { box-shadow: inset 0 0 0 2px var(--primary); }
.hub-card strong { display: block; font-family: var(--display); font-size: 19px; margin-bottom: 2px; }
.hub-card .muted { display: block; }
.hub-icon { display: grid; place-items: center; width: 48px; height: 48px; flex: none; border-radius: 14px; background: var(--primary); color: #fff; }
.hub-icon svg { width: 24px; height: 24px; }
.hub li:nth-child(2) .hub-icon { background: var(--secondary); color: var(--secondary-text); }
.hub li:nth-child(3) .hub-icon { background: var(--chip); color: var(--chip-text); }

/* add from store */
.store-list { list-style: none; padding: 0; margin: 0 0 8px; display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr)); }
.store-card { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 12px; padding: 12px; border-radius: 14px; background: var(--surface); align-items: start; }
.store-card .thumb { width: 84px; height: 84px; border-radius: 10px; object-fit: cover; }
.store-card .thumb.ph { display: grid; place-items: center; background: var(--surface-2); color: var(--muted); }
.store-card .thumb.ph svg { width: 26px; height: 26px; }
.store-card.error { box-shadow: inset 0 0 0 2px var(--warn); }
.store-card .sc-body { display: grid; gap: 6px; min-width: 0; }
.store-card .sc-body p { margin: 0; }
.store-card .url { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.store-card .working { padding: 0; }
.sc-name { font-weight: 700; min-height: 40px; padding: 6px 10px; }
.sc-cut select { width: auto; min-height: 40px; padding: 6px 10px; flex: 1 1 140px; }
.qty-inline { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.qty-inline input { width: 4.2em; min-height: 40px; padding: 6px; text-align: center; }
.chip.tag-sug { cursor: pointer; padding-right: 8px; }
.cut-row { align-items: flex-end; gap: 10px; }
.cut-row .grow { flex: 1; }
.cut-row .qty input { width: 5.5em; }
.badge.order { background: var(--secondary); color: var(--secondary-text); }
.banner { display: flex; gap: 12px; align-items: center; width: 100%; text-align: left; border: 0; cursor: pointer; font: inherit; color: var(--text);
  background: color-mix(in srgb, var(--secondary) 16%, var(--bg)); border-radius: 14px; padding: 12px 14px; margin: 0 0 12px; }
.banner svg { width: 22px; height: 22px; flex: none; color: var(--link); }

/* keep compact inputs compact (beat the general full-width input rule) */
.qty-inline input[type="number"] { width: 4.2em; min-height: 40px; padding: 6px; text-align: center; }
.sc-cut { flex-wrap: nowrap; }
.sc-cut select.sc-cut-select, .sc-cut select { width: auto; min-width: 0; flex: 1 1 auto; }
.size-row input[name], .size-row input[data-sz] { flex: 0 1 6.5em; width: 6.5em; min-width: 0; }
.rv-body .size-row input[data-sz] { flex-basis: 4.2em; width: 4.2em; }
.badge { white-space: nowrap; display: inline-block; vertical-align: middle; }
.card img:not([src]) { visibility: hidden; }
.card:has(img:not([src])) { background: none; }
.card .ph-wrap { display: block; }
.row.wrap.sc-cut { flex-wrap: nowrap; }
.row.wrap.sc-cut select { flex: 1 1 0; width: auto; min-width: 0; }
.row.wrap.sc-cut .qty-inline { flex: none; }
/* form controls must never force their container wider than the phone */
input, select, textarea, button { min-width: 0; max-width: 100%; }
.sc-body > *, .rv-body > *, .field > * { min-width: 0; }
