:root {
  --ink: #1f2328; --muted: #6b7178; --line: #eceef0; --bg: #f6f7f8; --card: #fff;
  --brand: #1f2328; --accent: #0a7c3e; --accent-soft: #e8f5ee; --warn: #b42318; --warn-soft: #fdf0ee;
  --wholesale: #6b3fa0; --wholesale-soft: #f3edfa; --radius: 12px;
  --field: #fff; --field-line: #d5d8dc; --subtle: #f6f7f8; --subtle-2: #e9ebed; --hover: #fafbfb; --tag: #eef0f2;
  --disabled: #e4e6e9; --accent-ink: #08672f; --clear-line: #f1c6c0; --toast: #1f2328;
  /* Shelf Finder: one colour per shelf, always shown with the shelf's name. */
  --sh0: #b4415a; --sh1: #b3477f; --sh2: #96602a; --sh3: #b2462b; --sh4: #5d6b2f; --sh5: #8f7410; --sh6: #7a4b3a; --sh7: #3f7a5a;
  --sh8: #2f6f8f; --sh9: #5a4a8f; --sh10: #6f6a62; --sh11: #1f2328; --sh12: #a2683f; --sh13: #8f5f6f; --sh14: #4a6f6f; --sh15: #6f7a3f;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; -webkit-text-size-adjust: 100%; }
/* 16px+ on every box stops iPhones zooming in when a box is tapped. */
button, input { font: inherit; font-size: 16px; color: inherit; }
button { -webkit-tap-highlight-color: transparent; }
input[type=number]::-webkit-inner-spin-button, input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type=number] { -moz-appearance: textfield; }

/* ---- Night mode ---- */
html[data-theme="dark"] {
  --ink: #e8eaed; --muted: #9aa1a9; --line: #2a2e33; --bg: #111315; --card: #1b1e22;
  --brand: #0b0d0f; --accent: #1f9d5a; --accent-soft: #15301f; --accent-ink: #7fd8a6; --warn: #ff8a7a; --warn-soft: #3a1d1a;
  --wholesale: #c9a8f0; --wholesale-soft: #2d2140;
  --field: #15181b; --field-line: #3a4047; --subtle: #23272c; --subtle-2: #2e3339; --hover: #202328; --tag: #2a2e33;
  --disabled: #2a2e33; --clear-line: #5a2b26; --toast: #2e3339;
  --sh0: #e0798e; --sh1: #e07fb2; --sh2: #d79a5c; --sh3: #e57f62; --sh4: #a5b86a; --sh5: #e0c24f; --sh6: #c48d77; --sh7: #78c29a;
  --sh8: #6fb4d6; --sh9: #a596de; --sh10: #b6b0a6; --sh11: #e8eaed; --sh12: #dba27a; --sh13: #d49aac; --sh14: #84bcbc; --sh15: #b5c27a;
  color-scheme: dark;
}
html[data-theme="dark"] .qo-product, html[data-theme="dark"] .qo-cart { box-shadow: none; border: 1px solid var(--line); }

/* ---- Header ---- */
.qo-top { position: sticky; top: 0; z-index: 5; display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; padding: 12px 16px; background: var(--brand); color: #fff; }
.qo-brand { margin: 0; font-size: 16px; font-weight: 700; white-space: nowrap; }
.qo-back { order: 9; color: #fff; text-decoration: none; font-size: 14px; padding: 7px 12px; border-radius: 8px; background: rgba(255,255,255,.12); white-space: nowrap; }
.qo-back:hover { background: rgba(255,255,255,.2); }
.qo-short { display: none; }
.qo-account { order: 9; display: inline-flex; align-items: center; gap: 6px; color: #fff; text-decoration: none; font-size: 14px; padding: 7px 12px; border-radius: 8px; background: rgba(255,255,255,.12); white-space: nowrap; }
.qo-account:hover { background: rgba(255,255,255,.2); }
.qo-account svg { flex: none; }
.qo-theme { order: 10; width: 36px; height: 36px; border: 0; border-radius: 8px; background: rgba(255,255,255,.12); color: #fff; font-size: 17px; line-height: 1; cursor: pointer; }
.qo-theme:hover { background: rgba(255,255,255,.2); }
.qo-sun, html[data-theme="dark"] .qo-moon { display: none; }
html[data-theme="dark"] .qo-sun { display: inline; }
.qo-brand a { color: inherit; text-decoration: none; }
.qo-brand span { font-weight: 400; opacity: .65; margin-left: 4px; }
.qo-mode { display: inline-flex; background: rgba(255,255,255,.12); border-radius: 9px; padding: 3px; }
.qo-mode button { border: 0; background: none; color: #fff; padding: 6px 14px; border-radius: 7px; cursor: pointer; font-size: 15px; }
.qo-mode button.on { background: #fff; color: #1f2328; font-weight: 600; }
#qo-search { flex: 1 1 260px; min-width: 0; padding: 11px 14px; border: 0; border-radius: 10px; font-size: 17px; background: var(--field); color: var(--ink); }
#qo-search:focus { outline: 3px solid rgba(255,255,255,.35); }

/* ---- Layout ---- */
.qo-main { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 18px; align-items: start; padding: 18px; max-width: 1280px; margin: 0 auto; }
.qo-hint { color: var(--muted); padding: 10px 4px; }

/* ---- Products ---- */
.qo-product { background: var(--card); border-radius: var(--radius); margin-bottom: 8px; box-shadow: 0 1px 2px rgba(16,24,40,.06); }
.qo-product h3 { margin: 0; font-size: 17px; font-weight: 650; letter-spacing: -.01em; }
/* Fragrance name with its price range; click to show the sizes. */
.qo-head { display: grid; grid-template-columns: minmax(0, 1fr) auto 22px; grid-template-areas: "name range chev"; align-items: center; gap: 2px 14px; width: 100%; padding: 14px 18px; border: 0; background: none; text-align: left; cursor: pointer; border-radius: var(--radius); }
.qo-head:hover { background: var(--hover); }
.qo-head h3 { grid-area: name; }
.qo-range { grid-area: range; color: var(--ink); font-weight: 600; font-size: 15px; white-space: nowrap; }
.qo-range small { margin-left: 4px; font-weight: 400; color: var(--muted); font-size: 13px; }
.qo-range .qo-sold { font-size: 12px; padding: 2px 8px; }
.qo-chev { grid-area: chev; display: block; width: 10px; height: 10px; justify-self: center; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg) translateY(-3px); transition: transform .2s; }
.qo-product.open .qo-chev { transform: rotate(-135deg) translateY(-3px); }
.qo-vars { display: none; padding: 0 18px 4px; border-top: 1px solid var(--line); }
.qo-product.open .qo-vars { display: block; }
.qo-var { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 6px 14px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.qo-var:first-of-type { border-top: 0; }
.qo-var.out .qo-info, .qo-var.out .qo-price { opacity: .45; }
.qo-info { min-width: 0; }
.qo-label { font-size: 15px; letter-spacing: .01em; }
.qo-tag { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 20px; font-size: 12px; font-weight: 600; background: var(--tag); color: var(--muted); vertical-align: 1px; }
.qo-tag.w { background: var(--wholesale-soft); color: var(--wholesale); }
.qo-price { font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.qo-buy { display: flex; gap: 8px; align-items: center; justify-content: flex-end; }
.qo-step { display: inline-flex; align-items: center; border: 1px solid var(--field-line); border-radius: 10px; overflow: hidden; background: var(--field); }
.qo-step button { width: 36px; height: 38px; border: 0; background: var(--subtle); cursor: pointer; font-size: 18px; line-height: 1; color: var(--ink); }
.qo-step button:active { background: var(--subtle-2); }
.qo-qty { width: 42px; height: 38px; border: 0; text-align: center; font-weight: 600; background: var(--field); color: var(--ink); }
.qo-add { height: 40px; padding: 0 18px; border: 0; border-radius: 10px; background: var(--accent); color: #fff; font-weight: 650; cursor: pointer; }
.qo-add:active { filter: brightness(.92); }
.qo-add:disabled { opacity: .6; }
.qo-sold { justify-self: end; padding: 4px 10px; border-radius: 20px; background: var(--warn-soft); color: var(--warn); font-weight: 600; font-size: 13px; }

/* ---- Cart ---- */
.qo-cart { position: sticky; top: 84px; background: var(--card); border-radius: var(--radius); padding: 16px; max-height: calc(100vh - 100px); overflow: auto; box-shadow: 0 1px 2px rgba(16,24,40,.06); }
.qo-cart h2 { margin: 0 0 6px; font-size: 19px; }
.qo-cart h2 span { font-size: 14px; font-weight: 400; color: var(--muted); margin-left: 6px; }
.qo-lines { list-style: none; margin: 0; padding: 0; }
.qo-lines li { display: grid; grid-template-columns: minmax(0, 1fr) auto 28px; grid-template-areas: "name total x" "qty qty qty"; gap: 6px 10px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.qo-line-name { grid-area: name; font-size: 15px; font-weight: 600; }
.qo-line-name small { display: block; font-weight: 400; color: var(--muted); font-size: 13px; }
.qo-line-total { grid-area: total; font-weight: 650; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.qo-remove { grid-area: x; border: 0; background: none; color: var(--muted); font-size: 22px; line-height: 1; cursor: pointer; padding: 0; }
.qo-line-qty { grid-area: qty; display: inline-flex; align-items: center; gap: 0; justify-self: start; border: 1px solid var(--field-line); border-radius: 10px; overflow: hidden; }
.qo-line-qty button { width: 36px; height: 34px; border: 0; background: var(--subtle); color: var(--ink); cursor: pointer; font-size: 17px; }
.qo-line-qty span { min-width: 38px; text-align: center; font-weight: 600; }
.qo-cart-actions { display: flex; gap: 8px; margin-top: 12px; }
.qo-cart-actions button { flex: 1; height: 40px; border-radius: 10px; cursor: pointer; font-size: 15px; font-weight: 600; }
.qo-share { color: var(--accent); border: 1px solid var(--accent); background: var(--accent-soft); }
.qo-clear { color: var(--warn); border: 1px solid var(--clear-line); background: var(--field); }
.qo-rules { list-style: none; margin: 12px 0 0; padding: 0; font-size: 14px; }
.qo-rules li { padding: 8px 12px; border-radius: 10px; margin-top: 6px; }
.qo-rules .met { background: var(--accent-soft); color: var(--accent-ink); }
.qo-rules .unmet { background: var(--warn-soft); color: var(--warn); }
.qo-subtotal { display: flex; justify-content: space-between; align-items: baseline; margin: 14px 0; font-size: 17px; }
.qo-subtotal b { font-size: 20px; }
.qo-checkout { display: block; text-align: center; padding: 14px; border-radius: 12px; background: var(--accent); color: #fff; font-weight: 700; font-size: 17px; text-decoration: none; }
.qo-checkout.disabled { background: var(--disabled); color: var(--muted); }

.qo-bar, .qo-backdrop { display: none; }
.qo-toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 16px); max-width: min(92vw, 520px); padding: 12px 18px; border-radius: 12px; background: var(--toast); color: #fff; font-size: 15px; opacity: 0; pointer-events: none; transition: .2s; z-index: 30; box-shadow: 0 8px 24px rgba(0,0,0,.18); }
.qo-toast.show { opacity: 1; transform: translate(-50%, 0); }
.qo-toast.bad { background: var(--warn); }

/* ---- Find your scent (from the Recommendation page) ---- */
.qo-find { order: 8; color: #fff; text-decoration: none; font-size: 14px; font-weight: 600; padding: 7px 12px; border-radius: 8px; background: rgba(255,255,255,.12); white-space: nowrap; }
.qo-find:hover { background: rgba(255,255,255,.2); }
.qo-hint a, .qo-rec-link a, .qo-rec-top a, .qo-rec-top button { color: var(--accent-ink); font-weight: 600; }
.qo-recs h2 { margin: 2px 0 14px; font-size: 21px; font-weight: 650; letter-spacing: -.01em; }
.qo-recs h2 span { display: block; margin-top: 2px; font-size: 15px; font-weight: 500; color: var(--muted); }
.qo-rec-top { display: flex; justify-content: space-between; align-items: center; margin: 2px 0 12px; font-size: 15px; }
.qo-rec-top a, .qo-rec-top button { border: 0; background: none; padding: 4px 0; cursor: pointer; text-decoration: none; font-size: 15px; }
.qo-rec-top a[href="#"] { color: var(--muted); font-weight: 500; }
.qo-rec-step { margin: 0; font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.qo-rec-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.qo-rec-card { display: block; text-align: left; padding: 14px; border: 1.5px solid var(--line); border-radius: var(--radius); background: var(--card); color: var(--ink); cursor: pointer; box-shadow: 0 1px 2px rgba(16,24,40,.06); }
.qo-rec-card:hover { border-color: var(--accent); }
.qo-rec-card.on { border-color: var(--accent); background: var(--accent-soft); }
.qo-rec-card b { display: block; font-size: 16px; margin-bottom: 3px; }
.qo-rec-card span { display: block; font-size: 13px; line-height: 1.4; color: var(--muted); }
.qo-rec-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: -4px 0 12px; }
.qo-rec-actions button { height: 36px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--field-line); background: var(--field); color: var(--ink); font-size: 14px; font-weight: 600; cursor: pointer; }
.qo-rec-actions span { margin-left: auto; color: var(--muted); font-size: 14px; }
.qo-rec-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.qo-rec-tabs button { padding: 6px 12px; border-radius: 20px; border: 1px solid var(--field-line); background: var(--field); color: var(--muted); font-size: 14px; cursor: pointer; }
.qo-rec-tabs button.on { background: var(--ink); border-color: var(--ink); color: var(--bg); font-weight: 600; }
.qo-rec-desc { margin: 0 0 12px; color: var(--muted); font-size: 14px; }
.qo-rec-link { text-align: center; margin: 22px 0 6px; font-size: 15px; }
.qo-rec-link a { text-decoration: none; }
.qo-name { grid-area: name; min-width: 0; }
.qo-stock { display: block; margin-top: 2px; font-size: 13px; color: var(--accent-ink); font-weight: 500; }
.qo-avail { display: block; margin-top: 1px; font-size: 13px; color: var(--muted); }
.qo-note { display: block; margin-top: 1px; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
html[data-theme="dark"] .qo-rec-card { box-shadow: none; }

/* ---- Wholesale deals ("Pick any 10") ---- */
.qo-deal { padding: 12px 0 14px; }
.qo-deal-step { margin: 4px 0 8px; font-size: 15px; font-weight: 650; }
.qo-deal-sub { margin: -4px 0 8px; font-size: 13px; color: var(--muted); }
.qo-deal-opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; margin-bottom: 14px; }
.qo-deal-opt { display: grid; gap: 2px; text-align: left; padding: 10px 12px; border: 1.5px solid var(--field-line); border-radius: 12px; background: var(--field); color: var(--ink); cursor: pointer; }
.qo-deal-opt b { font-size: 14px; }
.qo-deal-opt span { font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; }
.qo-deal-opt small { font-size: 12px; color: var(--muted); }
.qo-deal-opt.on { border-color: var(--accent); background: var(--accent-soft); }
.qo-deal-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.qo-deal-q { flex: 1 1 auto; min-width: 0; height: 42px; padding: 0 12px; border: 1px solid var(--field-line); border-radius: 10px; background: var(--field); color: var(--ink); font-size: 16px; }
.qo-deal-left { flex: none; font-size: 14px; font-weight: 650; color: var(--muted); font-variant-numeric: tabular-nums; }
.qo-deal-left.done { color: var(--accent-ink); }
.qo-deal-chosen { min-height: 0; margin: 0 0 8px; font-size: 13px; color: var(--muted); line-height: 1.45; }
.qo-deal-list { list-style: none; margin: 0 0 12px; padding: 0; max-height: 340px; overflow-y: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: 12px; }
.qo-deal-list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 7px 12px; border-top: 1px solid var(--line); }
.qo-deal-list li:first-child { border-top: 0; }
.qo-deal-list li.on { background: var(--accent-soft); }
.qo-deal-list li.off { opacity: .45; }
.qo-deal-list li.off .qo-deal-n::after { content: " (not enough for this size)"; font-size: 12px; color: var(--muted); }
.qo-deal-n { font-size: 15px; min-width: 0; overflow-wrap: anywhere; }
.qo-deal-ctl { display: inline-flex; align-items: center; gap: 8px; flex: none; }
.qo-deal-ctl b { min-width: 18px; text-align: center; font-variant-numeric: tabular-nums; }
.qo-deal-ctl button { width: 34px; height: 34px; border: 1px solid var(--field-line); border-radius: 50%; background: var(--subtle); color: var(--ink); font-size: 18px; line-height: 1; cursor: pointer; }
.qo-deal-ctl button:disabled { opacity: .3; cursor: default; }
.qo-deal-add { width: 100%; height: 46px; }
.qo-deal-add:disabled { background: var(--disabled); color: var(--muted); opacity: 1; cursor: default; }

/* ---- Shelf Finder ---- */
.qo-shelves { order: 8; color: #fff; text-decoration: none; font-size: 14px; font-weight: 600; padding: 7px 12px; border-radius: 8px; background: rgba(255,255,255,.12); white-space: nowrap; }
.qo-shelves:hover { background: rgba(255,255,255,.2); }
.qo-shelf h2 { margin: 0; font-size: 21px; font-weight: 650; letter-spacing: -.01em; }
.qo-shelf-bar { display: flex; gap: 8px; margin-bottom: 12px; }
#qo-shelf-q { flex: 1 1 auto; min-width: 0; height: 48px; padding: 0 14px; border: 1.5px solid var(--field-line); border-radius: 12px; background: var(--field); color: var(--ink); font-size: 17px; }
#qo-shelf-q:focus { outline: none; border-color: var(--accent); }
.qo-shelf-plus { flex: none; height: 48px; padding: 0 16px; border: 1.5px solid var(--accent); border-radius: 12px; background: var(--accent-soft); color: var(--accent-ink); font-weight: 650; cursor: pointer; }
.qo-shelf-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.qo-shelf-tile { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 13px 14px; border: 1px solid var(--line); border-left: 5px solid var(--c); border-radius: var(--radius); background: var(--card); color: var(--ink); text-align: left; cursor: pointer; }
.qo-shelf-tile b { font-size: 16px; }
.qo-shelf-tile span { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.qo-shelf-hit { display: grid; gap: 8px; padding: 13px 16px; margin-bottom: 8px; background: var(--card); border-radius: var(--radius); box-shadow: 0 1px 2px rgba(16,24,40,.06); }
.qo-shelf-hit h3 { margin: 0; font-size: 17px; font-weight: 650; overflow-wrap: anywhere; }
.qo-shelf-hit > div { display: flex; flex-wrap: wrap; gap: 6px; }
.qo-sbadge { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px 6px 9px; border-radius: 999px; border: 1.5px solid var(--c); background: var(--card); color: var(--c); font-size: 15px; font-weight: 650; cursor: pointer; }
.qo-sbadge::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--c); }
.qo-shelf-close { color: var(--muted); font-size: 14px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; }
.qo-shelf-close button { border: 1px solid var(--field-line); background: var(--field); color: var(--ink); border-radius: 20px; padding: 6px 12px; font-size: 14px; cursor: pointer; }
.qo-shelf-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 2px 0 10px; }
.qo-shelf-head h2 { color: var(--c); }
.qo-shelf-head h2 span { color: var(--muted); font-size: 15px; font-weight: 500; }
.qo-shelf-head button { border: 0; background: none; color: var(--accent-ink); font-weight: 600; cursor: pointer; padding: 4px 0; font-size: 15px; }
.qo-letters { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 10px; }
.qo-letters button { min-width: 34px; height: 34px; border: 1px solid var(--field-line); border-radius: 8px; background: var(--field); color: var(--ink); font-size: 14px; font-weight: 600; cursor: pointer; }
.qo-shelf-list { list-style: none; margin: 0; padding: 0; background: var(--card); border-radius: var(--radius); overflow: hidden; box-shadow: 0 1px 2px rgba(16,24,40,.06); }
.qo-shelf-list li { padding: 11px 16px; border-top: 1px solid var(--line); font-size: 16px; overflow-wrap: anywhere; scroll-margin-top: 140px; }
.qo-shelf-list li:first-child { border-top: 0; }
.qo-shelf-list li.flash { background: var(--accent-soft); }
@media (prefers-reduced-motion: no-preference) { .qo-shelf-list li { transition: background 1.2s; } }
.qo-shelf-add { display: grid; gap: 6px; margin: 0 0 14px; padding: 16px; background: var(--card); border: 1.5px solid var(--accent); border-radius: var(--radius); }
.qo-shelf-add h3 { margin: 0 0 4px; font-size: 17px; }
.qo-shelf-add label { font-size: 13px; font-weight: 600; color: var(--muted); margin-top: 4px; }
.qo-shelf-add input, .qo-shelf-add select { width: 100%; height: 44px; padding: 0 12px; border: 1px solid var(--field-line); border-radius: 10px; background: var(--field); color: var(--ink); font-size: 16px; }
.qo-shelf-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.qo-shelf-actions button { height: 42px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--field-line); background: var(--field); color: var(--ink); font-weight: 600; cursor: pointer; }
.qo-shelf-actions .qo-shelf-save { border: 0; background: var(--accent); color: #fff; }
.qo-shelf-actions .qo-shelf-save:disabled { opacity: .6; }
.qo-shelf-hit-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.qo-shelf-edit { flex: none; border: 1px solid var(--field-line); background: var(--field); color: var(--muted); border-radius: 8px; padding: 4px 10px; font-size: 13px; font-weight: 600; cursor: pointer; }
.qo-shelf-edit:hover { color: var(--ink); border-color: var(--ink); }
.qo-shelf-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.qo-shelf-list li span { min-width: 0; overflow-wrap: anywhere; }
.qo-shelf-was { margin: 0 0 4px; font-size: 14px; color: var(--muted); overflow-wrap: anywhere; }
.qo-shelf-was b { color: var(--ink); }
.qo-shelf-msg { margin: 6px 0 0; padding: 9px 12px; border-radius: 10px; font-size: 14px; }
.qo-shelf-msg.bad { background: var(--warn-soft); color: var(--warn); }

/* Shelf Finder panel: slides in from the right over half the screen; "Done" slides it away. */
.qo-panel { position: fixed; top: 0; right: 0; bottom: 0; z-index: 21; width: min(50vw, 720px); min-width: 420px; display: flex; flex-direction: column; background: var(--bg); box-shadow: -12px 0 40px rgba(0,0,0,.18); transform: translateX(105%); visibility: hidden; transition: transform .3s cubic-bezier(.2,.8,.2,1), visibility 0s linear .3s; }
body.shelves-open .qo-panel { transform: none; visibility: visible; transition: transform .3s cubic-bezier(.2,.8,.2,1), visibility 0s; }
.qo-panel-shade { position: fixed; inset: 0; z-index: 20; background: rgba(15,18,22,.45); opacity: 0; pointer-events: none; transition: opacity .3s; }
body.shelves-open .qo-panel-shade { opacity: 1; pointer-events: auto; }
body.shelves-open { overflow: hidden; }
.qo-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; padding-top: max(14px, env(safe-area-inset-top, 0px)); background: var(--brand); color: #fff; }
.qo-panel-head h2 { margin: 0; font-size: 18px; font-weight: 700; }
.qo-panel-done { border: 0; border-radius: 9px; padding: 9px 16px; background: #fff; color: #1f2328; font-size: 15px; font-weight: 700; cursor: pointer; }
.qo-panel-done:hover { filter: brightness(.94); }
.qo-panel-body { flex: 1 1 auto; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; padding: 16px 18px max(24px, env(safe-area-inset-bottom, 0px)); }
@media (prefers-reduced-motion: reduce) { .qo-panel, body.shelves-open .qo-panel, .qo-panel-shade { transition: none; } }

/* ---- Phones and small tablets ---- */
@media (max-width: 860px) {
  .qo-top { padding: 10px 12px 12px; gap: 8px; }
  .qo-brand { flex: 1; font-size: 15px; }
  .qo-back { order: 1; padding: 5px 10px; font-size: 13px; }
  .qo-account { order: 1; width: 32px; height: 32px; padding: 0; justify-content: center; }
  .qo-account span { display: none; }
  .qo-long { display: none; }
  .qo-short { display: inline; }
  .qo-theme { order: 2; width: 32px; height: 32px; font-size: 16px; }
  .qo-mode { order: 3; }
  .qo-find { order: 4; margin-left: auto; padding: 6px 11px; font-size: 14px; }
  .qo-shelves { order: 4; padding: 6px 11px; font-size: 14px; }
  .qo-shelf-tiles { grid-template-columns: 1fr 1fr; }
  .qo-panel { width: 62vw; min-width: 0; }
  .qo-panel-body { padding: 14px 14px max(24px, env(safe-area-inset-bottom, 0px)); }
  #qo-search { order: 5; }
  .qo-rec-cards { grid-template-columns: 1fr 1fr; gap: 8px; }
  .qo-rec-card { padding: 12px; }
  .qo-mode button { padding: 5px 9px; font-size: 14px; }
  #qo-search { flex-basis: 100%; }

  .qo-main { grid-template-columns: 1fr; padding: 12px 12px 96px; }
  /* Name with the price range underneath. */
  .qo-head { grid-template-columns: minmax(0, 1fr) 22px; grid-template-areas: "name chev" "range chev"; padding: 14px 16px; }
  .qo-head h3 { font-size: 16px; }
  .qo-head:hover { background: none; }
  .qo-vars { padding: 0 16px 4px; }


  /* Size with its price underneath on the left; quantity and Add on the right. */
  .qo-var { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "info buy" "price buy"; gap: 2px 10px; padding: 10px 0; }
  .qo-info { grid-area: info; }
  .qo-price { grid-area: price; text-align: left; font-size: 15px; }
  .qo-buy, .qo-sold { grid-area: buy; justify-self: end; }
  .qo-step button { width: 34px; }
  .qo-qty { width: 38px; }
  .qo-add { padding: 0 16px; }

  /* Cart slides up as a sheet, with the page dimmed behind it. */
  .qo-cart { position: fixed; left: 0; right: 0; bottom: 0; top: auto; max-height: 82vh; border-radius: 18px 18px 0 0; transform: translateY(105%); transition: transform .25s ease; z-index: 12; padding: 10px 16px 92px; box-shadow: 0 -8px 30px rgba(0,0,0,.18); }
  .qo-cart::before { content: ""; display: block; width: 40px; height: 5px; margin: 0 auto 10px; border-radius: 3px; background: var(--field-line); }
  body.cart-open .qo-cart { transform: none; }
  body.cart-open .qo-backdrop { display: block; position: fixed; inset: 0; background: rgba(15,18,22,.4); z-index: 11; }
  body.cart-open { overflow: hidden; }

  .qo-bar.show { display: flex; justify-content: space-between; align-items: center; position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 13; padding: 15px 18px; border: 0; border-radius: 14px; background: var(--accent); color: #fff; font-size: 16px; cursor: pointer; box-shadow: 0 6px 18px rgba(10,124,62,.35); }

  /* Messages at the top, where they don't cover the cart. */
  .qo-toast { top: 12px; bottom: auto; transform: translate(-50%, -16px); }
  .qo-toast.show { transform: translate(-50%, 0); }
}

/* Phones: nearly the full width, leaving a strip of Lite visible. */
@media (max-width: 600px) { .qo-panel { width: 92vw; } }
