html, body { touch-action: manipulation; -webkit-text-size-adjust: 100%; }
:root {
  color-scheme: light;
  --bg: #f2f5f9;
  --surface: #ffffff;
  --surface-2: #f7f9fc;
  --surface-3: #e8eef6;
  --ink: #111827;
  --ink-soft: #536174;
  --line: #d8e0eb;
  --navy: #0b1220;
  --blue: #155eef;
  --blue-dark: #0d42ad;
  --green: #0d8a55;
  --green-soft: #e8f8f0;
  --amber: #bd6b00;
  --amber-soft: #fff3d8;
  --red: #c92a2a;
  --red-soft: #ffebeb;
  --shadow: 0 16px 45px rgba(22, 34, 54, .11);
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 13px;
  --control-radius: 16px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body { min-height: 100vh; margin: 0; background: var(--bg); color: var(--ink); -webkit-font-smoothing: antialiased; }
body.dark {
  color-scheme: dark;
  --bg: #08101d;
  --surface: #111b2b;
  --surface-2: #152236;
  --surface-3: #202f45;
  --ink: #f5f7fb;
  --ink-soft: #aab7ca;
  --line: #2b3a50;
  --navy: #050a12;
  --blue: #6b9cff;
  --blue-dark: #3d73dd;
  --green: #43c88d;
  --green-soft: #123a2c;
  --amber: #ffb342;
  --amber-soft: #3e2b0e;
  --red: #ff7272;
  --red-soft: #3d1b22;
  --shadow: 0 18px 48px rgba(0,0,0,.28);
}
button, input, select { font: inherit; }
button, a, label.file-method { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
img { max-width: 100%; }
.hidden { display: none !important; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px,1px,1px,1px); white-space: nowrap; }

.offline-bar { position: fixed; inset: 0 0 auto; z-index: 200; min-height: 32px; padding: 7px 16px; background: #8b2f14; color: #fff; text-align: center; font-size: 12px; font-weight: 900; letter-spacing: .08em; }
.offline-bar:not(.hidden) + .auth-shell, .offline-bar:not(.hidden) ~ .app-shell .topbar { margin-top: 32px; }

.brand-lockup { display: flex; align-items: center; gap: 13px; }
.brand-mark { width: 50px; height: 50px; border-radius: 15px; display: grid; place-items: center; overflow: hidden; background: transparent url("/icons/scout-192-v187.png") center/contain no-repeat; color: transparent; box-shadow: 0 10px 26px rgba(21,94,239,.36); }
.brand-mark span { display: none; }
.brand-name { font-size: 18px; line-height: 1; font-weight: 950; letter-spacing: .08em; }
.brand-version { margin-top: 5px; color: var(--blue); font-size: 11px; line-height: 1; font-weight: 900; letter-spacing: .14em; }
.brand-lockup.compact .brand-mark { width: 41px; height: 41px; border-radius: 12px; }
.brand-lockup.compact .brand-mark span { font-size: 23px; }
.brand-lockup.compact .brand-name { font-size: 15px; }
.brand-lockup.compact .brand-version { font-size: 10px; }

.auth-shell { min-height: 100vh; display: grid; place-items: center; padding: 28px 18px; background:
  radial-gradient(circle at 15% 10%, rgba(37,99,235,.19), transparent 34%),
  radial-gradient(circle at 88% 84%, rgba(13,138,85,.12), transparent 34%),
  var(--bg); }
.auth-card { width: min(100%, 470px); padding: 34px; border: 1px solid var(--line); border-radius: 28px; background: color-mix(in srgb, var(--surface) 94%, transparent); box-shadow: var(--shadow); }
.auth-brand { margin-bottom: 34px; }
.auth-copy h1 { margin: 0 0 10px; font-size: clamp(30px, 8vw, 44px); line-height: .98; letter-spacing: -.04em; }
.auth-copy p { margin: 0 0 28px; color: var(--ink-soft); font-size: 15px; line-height: 1.6; }
.stack-form { display: grid; gap: 16px; }
.stack-form label, .settings-grid label { display: grid; gap: 8px; }
.stack-form label > span, .settings-grid label > span { color: var(--ink-soft); font-size: 11px; font-weight: 900; letter-spacing: .09em; }
.stack-form input, .settings-grid input, .settings-grid select { width: 100%; min-height: 52px; border: 1px solid var(--line); border-radius: 12px; padding: 0 15px; background: var(--surface-2); color: var(--ink); outline: none; }
.stack-form input:focus, .settings-grid input:focus, .settings-grid select:focus, .scan-input-wrap:focus-within, .money-input:focus-within { border-color: var(--blue); box-shadow: 0 0 0 4px color-mix(in srgb, var(--blue) 18%, transparent); }
.form-message { min-height: 20px; margin: 9px 0 0; color: var(--red); font-size: 13px; font-weight: 700; }
.form-message.success { color: var(--green); }
.auth-notes { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 30px; padding-top: 22px; border-top: 1px solid var(--line); }
.auth-notes div { display: grid; gap: 5px; }
.auth-notes strong { font-size: 10px; letter-spacing: .08em; }
.auth-notes span { color: var(--ink-soft); font-size: 12px; line-height: 1.4; }

.button { min-height: 46px; border: 0; border-radius: 12px; padding: 0 18px; font-weight: 900; letter-spacing: .035em; transition: transform .12s ease, opacity .12s ease, background .12s ease; }
.button:active { transform: scale(.985); }
.button:disabled { opacity: .5; cursor: wait; }
.button-primary { background: var(--blue); color: #fff; box-shadow: 0 9px 22px color-mix(in srgb, var(--blue) 27%, transparent); }
.button-primary:hover { background: var(--blue-dark); }
.button-secondary { border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); }
.button-ghost { border: 1px dashed var(--line); background: transparent; color: var(--ink-soft); }
.button-large { min-height: 56px; font-size: 14px; }

.app-shell { min-height: 100vh; }
.topbar { position: sticky; top: 0; z-index: 80; min-height: 66px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px max(16px, env(safe-area-inset-left)) 10px max(16px, env(safe-area-inset-right)); border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(18px); }
.topbar-actions { display: flex; align-items: center; gap: 7px; }
.icon-button { min-height: 38px; border: 1px solid var(--line); border-radius: 11px; padding: 0 11px; background: var(--surface-2); color: var(--ink); font-size: 12px; font-weight: 900; }
.status-pill { display: inline-flex; align-items: center; min-height: 28px; padding: 0 9px; border-radius: 99px; background: var(--green-soft); color: var(--green); font-size: 10px; font-weight: 950; letter-spacing: .07em; }
.status-pill.offline { background: var(--red-soft); color: var(--red); }
.account-button { width: 39px; height: 39px; border: 0; border-radius: 50%; background: var(--navy); color: #fff; font-weight: 950; }
.account-menu { position: fixed; z-index: 100; top: 61px; right: 14px; width: min(310px, calc(100vw - 28px)); padding: 10px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); }
.account-menu button { width: 100%; min-height: 44px; border: 0; border-radius: 10px; padding: 0 12px; background: transparent; color: var(--ink); text-align: left; font-weight: 800; }
.account-menu button:hover { background: var(--surface-2); }
.account-identity { display: grid; gap: 4px; padding: 10px 12px 14px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.account-identity strong { font-size: 15px; }
.account-identity span { color: var(--ink-soft); font-size: 11px; font-weight: 800; letter-spacing: .07em; }
.buyer-badge { justify-self: start; margin-top: 4px; padding: 4px 7px; border-radius: 7px; background: var(--amber-soft); color: var(--amber) !important; }

.content-frame { width: min(100%, 1000px); margin: 0 auto; padding: 20px 16px calc(98px + var(--safe-bottom)); }
.view-panel { display: none; }
.view-panel.active { display: block; }
.scan-command-card { padding: 14px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); box-shadow: 0 8px 28px rgba(24,39,63,.06); }
.scan-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
.scan-input-wrap { min-height: 60px; display: flex; align-items: center; gap: 10px; border: 2px solid var(--ink); border-radius: 14px; padding: 0 12px; background: var(--surface-2); }
.scan-glyph { font-size: 25px; font-weight: 900; }
.scan-input-wrap input { min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 18px; font-weight: 850; text-transform: uppercase; }
.scan-input-wrap input::placeholder { color: var(--ink-soft); font-size: 13px; font-weight: 750; }
.input-clear { width: 34px; height: 34px; border: 0; border-radius: 50%; background: var(--surface-3); color: var(--ink); font-size: 22px; }
.lookup-button { min-width: 116px; }
.scan-methods { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.method-button { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid var(--line); border-radius: 11px; padding: 0 13px; background: var(--surface-2); color: var(--ink); font-size: 12px; font-weight: 900; }
.file-method { cursor: pointer; }
.file-method input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.scanner-hint { margin-left: auto; display: flex; align-items: center; gap: 7px; color: var(--ink-soft); font-size: 10px; font-weight: 850; letter-spacing: .05em; }
.pulse-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 5px color-mix(in srgb, var(--green) 13%, transparent); }
.scan-status { margin: 14px 0; padding: 13px 16px; border-radius: 12px; background: var(--surface-3); color: var(--ink); font-size: 13px; font-weight: 750; }
.scan-status.error { background: var(--red-soft); color: var(--red); }
.scan-status.success { background: var(--green-soft); color: var(--green); }
.scan-status.loading::before { content: ""; display: inline-block; width: 13px; height: 13px; margin-right: 9px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; vertical-align: -2px; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.empty-state { min-height: 58vh; display: grid; place-items: center; align-content: center; gap: 16px; padding: 44px 12px; text-align: center; }
.empty-visual { position: relative; width: 190px; height: 120px; display: grid; place-items: center; border: 2px solid color-mix(in srgb, var(--blue) 36%, var(--line)); border-radius: 20px; background: var(--surface); overflow: hidden; }
.barcode-bars { width: 120px; height: 64px; background: repeating-linear-gradient(90deg, var(--ink) 0 2px, transparent 2px 5px, var(--ink) 5px 9px, transparent 9px 12px); opacity: .75; }
.empty-state h1 { margin: 0; font-size: clamp(27px, 8vw, 43px); letter-spacing: -.04em; }
.empty-state p { max-width: 580px; margin: 0; color: var(--ink-soft); line-height: 1.6; }
.empty-steps { display: flex; flex-wrap: wrap; justify-content: center; gap: 9px; margin-top: 4px; }
.empty-steps span { display: flex; align-items: center; gap: 7px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 99px; background: var(--surface); font-size: 10px; font-weight: 900; letter-spacing: .04em; }
.empty-steps b { width: 20px; height: 20px; display: grid; place-items: center; border-radius: 50%; background: var(--navy); color: #fff; }

.result-view { display: grid; gap: 14px; margin-top: 14px; }
.decision-card { overflow: hidden; border-radius: var(--radius-xl); padding: 18px; color: #fff; box-shadow: var(--shadow); }
.decision-buy { background: linear-gradient(135deg, #087e4d, #10a967); }
.decision-maybe { background: linear-gradient(135deg, #a45b00, #dc8a12); }
.decision-pass { background: linear-gradient(135deg, #a82121, #da3939); }
.decision-topline { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 24px; font-size: 10px; font-weight: 900; letter-spacing: .08em; opacity: .9; }
.source-badge { padding: 5px 8px; border-radius: 99px; background: rgba(255,255,255,.18); }
.decision-main { display: grid; grid-template-columns: minmax(0, .9fr) minmax(300px, 1.1fr); align-items: end; gap: 24px; }
.decision-eyebrow { font-size: 11px; font-weight: 900; letter-spacing: .11em; opacity: .83; }
.decision-main h1 { margin: 5px 0 0; font-size: clamp(34px, 7vw, 62px); line-height: .92; letter-spacing: -.045em; }
.decision-pair { display: grid; grid-template-columns: 1.25fr .75fr; gap: 10px; }
.decision-number-block { min-height: 112px; display: grid; align-content: center; justify-items: center; gap: 2px; border-radius: 17px; background: rgba(255,255,255,.16); text-align: center; }
.decision-number-block span { font-size: 9px; font-weight: 900; letter-spacing: .06em; opacity: .86; }
.decision-number-block strong { font-size: clamp(35px, 8vw, 58px); line-height: 1; letter-spacing: -.05em; }
.quantity-block strong::after { content: " PCS"; font-size: 11px; letter-spacing: .03em; }
.decision-subline { margin: 14px 0 0; font-size: 12px; line-height: 1.5; font-weight: 750; opacity: .9; }
.eligibility-warning, .internal-access-warning { display: grid; gap: 5px; padding: 12px 14px; border: 1px solid color-mix(in srgb, var(--amber) 42%, var(--line)); border-radius: 13px; background: var(--amber-soft); color: var(--amber); }
.eligibility-warning strong, .internal-access-warning strong { font-size: 10px; font-weight: 950; letter-spacing: .08em; }
.eligibility-warning span, .internal-access-warning span { font-size: 10px; font-weight: 760; line-height: 1.45; }
.internal-access-warning { margin: -4px 0 12px; }

.product-card, .cost-check-card, .metrics-card, .fee-card, .advice-card, .settings-card { border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); box-shadow: 0 8px 28px rgba(24,39,63,.05); }
.product-card { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 18px; padding: 16px; }
.product-image-button { position: relative; min-height: 175px; border: 1px solid var(--line); border-radius: 14px; padding: 0; background: #fff; overflow: hidden; }
.product-image-button img { width: 100%; height: 100%; object-fit: contain; display: block; }
.saved-catalog-badge { position: absolute; left: 8px; bottom: 8px; padding: 5px 7px; border-radius: 7px; background: var(--blue); color: #fff; font-size: 9px; font-weight: 950; letter-spacing: .06em; }
.product-copy { min-width: 0; display: grid; align-content: center; gap: 13px; }
.product-heading-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.product-brand { display: block; margin-bottom: 5px; color: var(--blue); font-size: 12px; font-weight: 950; letter-spacing: .08em; }
.product-copy h2 { margin: 0; font-size: clamp(19px, 4vw, 28px); line-height: 1.16; letter-spacing: -.025em; text-transform: uppercase; }
.amazon-badge { flex: 0 0 auto; padding: 6px 8px; border-radius: 8px; background: var(--red-soft); color: var(--red); font-size: 9px; font-weight: 950; letter-spacing: .05em; }
.product-meta { display: flex; flex-wrap: wrap; gap: 7px; color: var(--ink-soft); font-size: 11px; font-weight: 800; }
.product-meta span { padding: 5px 7px; border-radius: 7px; background: var(--surface-2); }
.product-links { display: flex; flex-wrap: wrap; gap: 8px; }
.product-links a, .product-links button { padding: 7px 9px; border: 0; border-radius: 8px; background: var(--surface-3); color: var(--blue); text-decoration: none; font: inherit; font-size: 10px; font-weight: 900; letter-spacing: .04em; cursor: pointer; }

.cost-check-card, .metrics-card { padding: 18px; }
.section-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.section-kicker { display: block; margin-bottom: 5px; color: var(--blue); font-size: 10px; font-weight: 950; letter-spacing: .1em; }
.section-heading h2, .panel-header h1 { margin: 0; font-size: 18px; letter-spacing: -.025em; }
.saved-cogs-hint, .market-source-label { padding: 6px 8px; border-radius: 8px; background: var(--surface-3); color: var(--ink-soft); font-size: 9px; font-weight: 900; letter-spacing: .04em; }
.cost-row { display: grid; grid-template-columns: minmax(190px, .65fr) minmax(220px, 1fr); gap: 12px; }
.money-input { min-height: 82px; display: flex; align-items: center; border: 2px solid var(--ink); border-radius: 15px; padding: 0 16px; background: var(--surface-2); }
.money-input span { color: var(--ink-soft); font-size: 27px; font-weight: 900; }
.money-input input { min-width: 0; width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 36px; font-weight: 950; }
.cost-verdict { min-height: 82px; display: grid; place-items: center; align-content: center; border-radius: 15px; text-align: center; }
.cost-verdict.neutral { background: var(--surface-3); color: var(--ink-soft); }
.cost-verdict.good { background: var(--green-soft); color: var(--green); }
.cost-verdict.warn { background: var(--amber-soft); color: var(--amber); }
.cost-verdict.bad { background: var(--red-soft); color: var(--red); }
.cost-verdict strong { font-size: 22px; }
.cost-verdict span { margin-top: 3px; font-size: 10px; font-weight: 900; letter-spacing: .07em; }
.profit-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin-top: 10px; }
.profit-grid div { min-height: 70px; display: grid; align-content: center; gap: 4px; border-radius: 12px; padding: 10px; background: var(--surface-2); text-align: center; }
.profit-grid span { color: var(--ink-soft); font-size: 9px; font-weight: 900; letter-spacing: .05em; }
.profit-grid strong { font-size: 21px; }

.metric-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.metric { min-height: 85px; display: grid; align-content: center; gap: 5px; border: 1px solid var(--line); border-radius: 13px; padding: 12px; background: var(--surface-2); }
.metric span { color: var(--ink-soft); font-size: 9px; font-weight: 900; letter-spacing: .055em; }
.metric strong { font-size: clamp(20px, 4vw, 29px); letter-spacing: -.03em; }
.metric.primary { border-color: color-mix(in srgb, var(--blue) 42%, var(--line)); background: color-mix(in srgb, var(--blue) 6%, var(--surface)); }
.metric.primary strong { color: var(--blue); }
.metric.rank strong { font-size: clamp(21px, 4vw, 31px); }

.fee-card details { padding: 0 18px; }
.fee-card summary { min-height: 56px; display: flex; align-items: center; cursor: pointer; font-size: 11px; font-weight: 950; letter-spacing: .06em; }
.fee-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding: 0 0 16px; }
.fee-grid div { display: grid; gap: 5px; padding: 10px; border-radius: 10px; background: var(--surface-2); }
.fee-grid span { color: var(--ink-soft); font-size: 8px; font-weight: 900; letter-spacing: .04em; }
.fee-grid strong { font-size: 14px; }
.fee-note { margin: -5px 0 16px; color: var(--ink-soft); font-size: 11px; line-height: 1.5; }
.advice-card { padding: 16px; }
.warning-list, .reason-list { display: grid; gap: 8px; }
.reason-list { margin-top: 9px; }
.warning-item, .reason-item { display: flex; gap: 9px; align-items: flex-start; padding: 10px 11px; border-radius: 10px; font-size: 12px; line-height: 1.45; font-weight: 720; }
.warning-item { background: var(--amber-soft); color: var(--amber); }
.reason-item { background: var(--surface-2); color: var(--ink-soft); }
.result-actions { display: grid; grid-template-columns: 1.4fr .9fr .9fr; gap: 9px; }

.panel-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 5px 0 16px; }
.panel-header h1 { font-size: clamp(24px, 6vw, 36px); }
.recent-list { display: grid; gap: 10px; }
.recent-card { display: grid; grid-template-columns: 92px minmax(0, 1fr) auto; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 15px; padding: 13px; background: var(--surface); }
.recent-decision { min-height: 58px; display: grid; place-items: center; border-radius: 11px; color: #fff; font-size: 14px; font-weight: 950; }
.recent-decision.buy { background: var(--green); }
.recent-decision.maybe { background: var(--amber); }
.recent-decision.pass { background: var(--red); }
.recent-copy { min-width: 0; }
.recent-copy strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; text-transform: uppercase; }
.recent-copy span { display: block; margin-top: 5px; color: var(--ink-soft); font-size: 10px; font-weight: 750; }
.recent-pay { text-align: right; }
.recent-pay strong { display: block; font-size: 20px; }
.recent-pay span { color: var(--ink-soft); font-size: 9px; font-weight: 850; }
.empty-list { padding: 50px 20px; border: 1px dashed var(--line); border-radius: 16px; color: var(--ink-soft); text-align: center; }

.admin-only-badge { padding: 7px 9px; border-radius: 8px; background: var(--blue); color: #fff; font-size: 9px; font-weight: 950; letter-spacing: .07em; }
.settings-card { padding: 18px; }
.settings-section + .settings-section { margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--line); }
.settings-section h2 { margin: 0 0 14px; font-size: 14px; }
.settings-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 13px; }
.settings-grid input, .settings-grid select { min-height: 47px; }
.settings-card > .button { margin-top: 20px; }
.settings-grid label { align-content:start; }
.settings-grid input:disabled { opacity:.78; cursor:not-allowed; background:color-mix(in srgb, var(--surface-2) 82%, var(--line)); }
.settings-grid select { appearance:auto; }
.setting-help { display:block; color:var(--ink-soft); font-size:9px; line-height:1.45; font-weight:700; }
.decision-basis-grid { grid-template-columns:repeat(2,minmax(0,1fr)); margin-bottom:14px; }

.team-heading { margin-top: 30px; }
.team-list { display: grid; gap: 10px; }
.team-card { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.team-name strong { display: block; }
.team-name span { display: block; margin-top: 4px; color: var(--ink-soft); font-size: 10px; }
.team-control { display: grid; gap: 5px; }
.team-control > span { color: var(--ink-soft); font-size: 8px; font-weight: 900; }
.team-control input[type="number"] { width: 132px; min-height: 40px; border: 1px solid var(--line); border-radius: 9px; padding: 0 9px; background: var(--surface-2); color: var(--ink); }
.toggle-wrap { display: flex; align-items: center; gap: 7px; font-size: 10px; font-weight: 900; }
.toggle-wrap input { width: 42px; height: 24px; accent-color: var(--blue); }

.bottom-nav { position: fixed; z-index: 70; left: 50%; bottom: calc(10px + var(--safe-bottom)); transform: translateX(-50%); width: min(500px, calc(100vw - 20px)); min-height: 66px; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 5px; padding: 7px; border: 1px solid color-mix(in srgb, var(--line) 78%, transparent); border-radius: 20px; background: color-mix(in srgb, var(--navy) 94%, transparent); box-shadow: 0 18px 45px rgba(0,0,0,.27); backdrop-filter: blur(18px); }
.nav-button { border: 0; border-radius: 14px; display: grid; place-items: center; align-content: center; gap: 3px; background: transparent; color: #9aa7bb; }
.nav-button span { font-size: 19px; line-height: 1; }
.nav-button b { font-size: 9px; letter-spacing: .07em; }
.nav-button.active { background: #fff; color: #0b1220; }

.modal { position: fixed; z-index: 300; inset: 0; display: grid; place-items: center; padding: 16px; background: rgba(3,8,16,.72); backdrop-filter: blur(8px); }
.modal-sheet, .camera-sheet { width: min(100%, 720px); max-height: min(88vh, 920px); overflow: auto; border: 1px solid var(--line); border-radius: 22px; background: var(--surface); box-shadow: 0 30px 90px rgba(0,0,0,.38); }
.modal-header { position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 18px; border-bottom: 1px solid var(--line); background: var(--surface); }
.modal-header h2 { margin: 0; font-size: 21px; }
.modal-close { flex: 0 0 auto; width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 50%; background: var(--surface-2); color: var(--ink); font-size: 27px; line-height: 1; }
.modal-intro { margin: 0; padding: 14px 18px 0; color: var(--ink-soft); font-size: 12px; line-height: 1.5; }
.match-list { display: grid; gap: 10px; padding: 16px 18px 20px; }
.match-card { display: grid; grid-template-columns: 112px minmax(0, 1fr) auto; gap: 13px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); }
.match-card img { width: 112px; height: 112px; object-fit: contain; border-radius: 10px; background: #fff; }
.match-copy { min-width: 0; }
.match-copy strong { display: block; font-size: 13px; line-height: 1.35; text-transform: uppercase; }
.match-copy span { display: block; margin-top: 5px; color: var(--ink-soft); font-size: 10px; font-weight: 750; }
.match-card .button { min-width: 100px; }
.match-saved { border-color: var(--blue); box-shadow: 0 0 0 2px color-mix(in srgb, var(--blue) 14%, transparent); }

body.camera-open { overflow: hidden; }
.camera-sheet { width: min(100%, 820px); max-height: min(94vh, 980px); overflow: hidden; display: grid; grid-template-rows: auto minmax(300px, 1fr) auto; background: #050912; color: #fff; }
.dark-header { position: static; border-color: #253044; background: #0b1220; }
.dark-header .section-kicker { color: #82a8ff; }
.dark-header .modal-close { border-color: #2d3a51; background: #172237; color: #fff; }
.camera-header { padding: 14px 16px; }
.camera-header h2 { font-size: 18px; }
.camera-stage { --preview-zoom: 1; position: relative; min-height: 390px; aspect-ratio: 4 / 3; overflow: hidden; background: #000; touch-action: none; user-select: none; }
.camera-stage video { width: 100%; height: 100%; object-fit: cover; transform: scale(var(--preview-zoom)); transition: transform .16s ease-out; transform-origin: center; }
.camera-status-strip { position: absolute; z-index: 6; left: 10px; right: 10px; top: 10px; display: flex; flex-wrap: wrap; gap: 6px; pointer-events: none; }
.camera-status-strip span { padding: 6px 8px; border: 1px solid rgba(255,255,255,.2); border-radius: 99px; background: rgba(4,9,18,.72); color: #dce8fa; backdrop-filter: blur(10px); font-size: 8px; font-weight: 950; letter-spacing: .06em; }
.camera-frame { position: absolute; z-index: 3; inset: 29% 6% 31%; border: 2px solid rgba(255,255,255,.7); border-radius: 16px; box-shadow: 0 0 0 999px rgba(0,0,0,.28); pointer-events: none; }
.camera-frame b { position: absolute; left: 50%; bottom: -29px; transform: translateX(-50%); width: max-content; max-width: 90vw; color: #bcefd5; font-size: 8px; letter-spacing: .07em; text-align: center; }
.camera-frame::before, .camera-frame::after, .camera-frame span::before, .camera-frame span::after { content: ""; position: absolute; width: 40px; height: 40px; border-color: #59f0a6; border-style: solid; filter: drop-shadow(0 0 6px rgba(89,240,166,.62)); }
.camera-frame::before { left: -4px; top: -4px; border-width: 5px 0 0 5px; border-radius: 12px 0 0; }
.camera-frame::after { right: -4px; top: -4px; border-width: 5px 5px 0 0; border-radius: 0 12px 0 0; }
.camera-frame span::before { left: -4px; bottom: -4px; border-width: 0 0 5px 5px; border-radius: 0 0 0 12px; }
.camera-frame span::after { right: -4px; bottom: -4px; border-width: 0 5px 5px 0; border-radius: 0 0 12px; }
.camera-lock { position: absolute; z-index: 7; inset: 0; display: grid; place-items: center; pointer-events: none; opacity: 0; }
.camera-lock span { padding: 11px 15px; border-radius: 12px; background: rgba(3,10,18,.84); color: #fff; font-size: 13px; font-weight: 1000; letter-spacing: .09em; }
.camera-lock.locking { opacity: 1; }
.camera-lock.locking span { color: #ffe08b; border: 1px solid rgba(255,224,139,.45); }
.camera-lock.locked { opacity: 1; background: rgba(4,68,41,.22); }
.camera-lock.locked span { background: #0b8f58; }
.camera-tap-hint { position: absolute; z-index: 5; left: 50%; bottom: 9px; transform: translateX(-50%); width: max-content; max-width: calc(100% - 24px); padding: 6px 9px; border-radius: 99px; background: rgba(4,9,18,.68); color: #c3cede; font-size: 8px; font-weight: 850; letter-spacing: .04em; pointer-events: none; }
.camera-stage.tap-focus::after { content: ""; position: absolute; z-index: 8; left: 50%; top: 50%; width: 64px; height: 64px; transform: translate(-50%,-50%); border: 2px solid #ffe08b; border-radius: 12px; animation: focuspulse .58s ease-out forwards; pointer-events: none; }
@keyframes focuspulse { from { opacity: 1; transform: translate(-50%,-50%) scale(1.35); } to { opacity: 0; transform: translate(-50%,-50%) scale(.72); } }
.camera-footer { display: grid; gap: 10px; padding: 12px 14px calc(14px + env(safe-area-inset-bottom, 0px)); background: #0b1220; border-top: 1px solid #253044; }
.camera-message-row { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 9px; }
.camera-message-row p { margin: 0; color: #c4cede; font-size: 10px; line-height: 1.42; font-weight: 720; }
.camera-quality-badge { padding: 6px 8px; border-radius: 8px; background: #172237; color: #8fb5ff; font-size: 8px; font-weight: 950; letter-spacing: .06em; }
.camera-zoom-control { display: grid; grid-template-columns: 38px minmax(100px,1fr) 46px 38px; align-items: center; gap: 8px; }
.camera-zoom-control input[type="range"] { width: 100%; accent-color: #59f0a6; }
.camera-zoom-control strong { color: #fff; font-size: 12px; text-align: center; }
.camera-round-button { width: 38px; height: 38px; border: 1px solid #31415a; border-radius: 50%; background: #172237; color: #fff; font-size: 24px; line-height: 1; }
.camera-actions { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 7px; }
.camera-action { min-height: 40px; border-color: #31415a; background: #172237; color: #d8e3f3; font-size: 9px; }
.camera-action.active { border-color: #59f0a6; background: #123c2d; color: #9ff4c8; }
.camera-privacy-note { margin: 0; color: #7f8ca1; font-size: 8px; line-height: 1.35; text-align: center; }
.install-content { padding: 18px; }
.install-steps { display: grid; gap: 11px; }
.install-step { display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 11px; align-items: start; padding: 12px; border-radius: 12px; background: var(--surface-2); }
.install-step b { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: var(--navy); color: #fff; }
.install-step strong { display: block; font-size: 13px; }
.install-step span { display: block; margin-top: 4px; color: var(--ink-soft); font-size: 12px; line-height: 1.45; }
.install-sheet > .button { width: calc(100% - 36px); margin: 0 18px 18px; }
.password-sheet { width: min(100%, 480px); }
.password-sheet form { padding: 18px; }
.password-sheet form > p { margin: 0; color: var(--ink-soft); font-size: 11px; line-height: 1.45; }
.image-modal { position: fixed; z-index: 400; inset: 0; display: grid; place-items: center; padding: 22px; background: rgba(0,0,0,.9); }
.image-stage { max-width: min(92vw, 900px); max-height: 88vh; display: grid; place-items: center; gap: 10px; }
.image-stage img { max-width: 100%; max-height: 80vh; object-fit: contain; border-radius: 14px; background: #fff; }
.image-stage p { margin: 0; color: #fff; text-align: center; font-size: 12px; }
.image-close { position: absolute; top: max(14px, env(safe-area-inset-top)); right: 14px; width: 48px; height: 48px; border: 1px solid rgba(255,255,255,.35); border-radius: 50%; background: rgba(0,0,0,.4); color: #fff; font-size: 32px; }
.toast-region { position: fixed; z-index: 500; left: 50%; bottom: calc(91px + var(--safe-bottom)); transform: translateX(-50%); width: min(92vw, 520px); display: grid; gap: 8px; pointer-events: none; }
.toast { padding: 13px 15px; border-radius: 12px; background: var(--navy); color: #fff; box-shadow: var(--shadow); font-size: 12px; font-weight: 750; animation: toastin .2s ease-out; }
.toast.error { background: #a52020; }
.toast.success { background: #087348; }
@keyframes toastin { from { transform: translateY(10px); opacity: 0; } }

@media (min-width: 1180px) {
  .bottom-nav {
    left: 24px;
    top: 50%;
    bottom: auto;
    transform: translateY(-50%);
    width: 82px;
    min-height: 256px;
    grid-auto-flow: row;
    grid-auto-rows: 1fr;
    border-radius: 22px;
  }
  .toast-region { bottom: 24px; }
}

@media (max-width: 760px), (min-width: 480px) {
  .topbar { min-height: 60px; }
  .brand-lockup.compact .brand-name { font-size: 12px; }
  .brand-lockup.compact .brand-version { font-size: 8px; }
  .brand-lockup.compact .brand-mark { width: 35px; height: 35px; border-radius: 10px; }
  .brand-lockup.compact .brand-mark span { font-size: 19px; }
  .status-pill { display: none; }
  .content-frame { padding: 12px 10px calc(92px + var(--safe-bottom)); }
  .scan-command-card { padding: 10px; border-radius: 16px; }
  .scan-form { grid-template-columns: minmax(0, 1fr) 86px; gap: 7px; }
  .scan-input-wrap { min-height: 55px; padding: 0 9px; }
  .scan-input-wrap input { font-size: 16px; }
  .lookup-button { min-width: 0; padding: 0 9px; font-size: 11px; }
  .scan-methods { gap: 6px; }
  .method-button { flex: 1; min-height: 39px; padding: 0 8px; }
  .scanner-hint { display: none; }
  .empty-state { min-height: 55vh; }
  .decision-card { padding: 15px; border-radius: 20px; }
  .decision-main { grid-template-columns: 1fr; gap: 18px; }
  .decision-main h1 { font-size: clamp(38px, 13vw, 57px); }
  .decision-number-block { min-height: 95px; }
  .decision-number-block strong { font-size: clamp(37px, 12vw, 53px); }
  .product-card { grid-template-columns: 118px minmax(0, 1fr); gap: 11px; padding: 11px; }
  .product-image-button { min-height: 125px; }
  .product-heading-row { display: block; }
  .amazon-badge { display: inline-flex; margin-top: 8px; }
  .product-copy h2 { font-size: 16px; }
  .product-meta { gap: 4px; }
  .product-meta span { font-size: 8px; }
  .product-links a, .product-links button { font-size: 8px; }
  .cost-check-card, .metrics-card { padding: 14px; }
  .section-heading { display: block; }
  .saved-cogs-hint, .market-source-label { display: inline-flex; margin-top: 8px; }
  .cost-row { grid-template-columns: 1fr 1fr; gap: 8px; }
  .money-input, .cost-verdict { min-height: 76px; }
  .money-input input { font-size: 31px; }
  .cost-verdict strong { font-size: 17px; }
  .profit-grid { gap: 6px; }
  .profit-grid div { padding: 7px; }
  .profit-grid strong { font-size: 17px; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); gap: 7px; }
  .metric { min-height: 78px; padding: 10px; }
  .metric strong { font-size: 22px; }
  .fee-grid { grid-template-columns: repeat(2, 1fr); }
  .result-actions { grid-template-columns: 1fr; }
  .result-actions .button { min-height: 52px; }
  .settings-grid { grid-template-columns: 1fr 1fr; }
  .team-card { grid-template-columns: 1fr; }
  .team-control input[type="number"] { width: 100%; }
  .match-card { grid-template-columns: 90px minmax(0, 1fr); }
  .match-card img { width: 90px; height: 90px; }
  .match-card .button { grid-column: 1 / -1; width: 100%; }
  .modal:has(.camera-sheet) { padding: 0; background: #050912; }
  .camera-sheet { width: 100%; height: 100dvh; max-height: none; border: 0; border-radius: 0; grid-template-rows: auto minmax(0, 1fr) auto; }
  .camera-header { padding-top: max(12px, env(safe-area-inset-top)); }
  .camera-stage { min-height: 0; aspect-ratio: auto; }
  .camera-frame { inset: 32% 5% 34%; }
  .camera-status-strip span { font-size: 7px; }
  .camera-actions { grid-template-columns: 1.25fr .8fr .95fr; }
  .camera-privacy-note { display: none; }
}

@media (max-width: 430px), (min-width: 480px) {
  .auth-card { padding: 26px 20px; }
  .auth-notes { grid-template-columns: 1fr; }
  .decision-pair { grid-template-columns: 1.15fr .85fr; }
  .decision-number-block span { font-size: 8px; }
  .product-card { grid-template-columns: 104px minmax(0, 1fr); }
  .product-image-button { min-height: 112px; }
  .product-meta span:nth-child(3) { display: none; }
  .cost-row { grid-template-columns: 1fr; }
  .profit-grid { grid-template-columns: 1fr 1fr 1fr; }
  .profit-grid span { font-size: 7px; }
  .profit-grid strong { font-size: 15px; }
  .settings-grid { grid-template-columns: 1fr; }
  .recent-card { grid-template-columns: 76px minmax(0, 1fr); }
  .recent-pay { grid-column: 2; text-align: left; display: flex; gap: 7px; align-items: baseline; }
  .bottom-nav { bottom: calc(6px + var(--safe-bottom)); width: calc(100vw - 12px); }
}

@media (display-mode: standalone) {
  .install-button { display: none !important; }
  .topbar { padding-top: max(10px, env(safe-area-inset-top)); }
}

.team-actions { display: grid; gap: 8px; }

/* ========================================================================== */
/* HOSM SCOUT BETA 1.2.1 — CALM CONTINUOUS-SCAN UI                       */
/* ========================================================================== */

.scan-card-topline { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:10px; }
.scan-mode-toggle { display:inline-grid; grid-template-columns:1fr 1fr; gap:3px; min-width:190px; padding:3px; border:1px solid var(--line); border-radius:13px; background:var(--surface-3); }
.scan-mode-button { min-height:38px; border:0; border-radius:9px; padding:0 14px; background:transparent; color:var(--ink-soft); font-size:11px; font-weight:950; letter-spacing:.07em; }
.scan-mode-button.active { background:var(--surface); color:var(--blue); box-shadow:0 2px 9px rgba(18,35,59,.12); }
.main-mode-hint { margin:10px 2px 0; color:var(--ink-soft); font-size:10px; font-weight:800; letter-spacing:.035em; }
.scanner-hint { color:var(--green); font-size:9px; font-weight:900; letter-spacing:.06em; }
.calm-empty-state .empty-visual { position:relative; }
.calm-empty-state .barcode-bars { opacity:.78; }

.floating-scan-button { position:fixed; z-index:78; right:max(18px, env(safe-area-inset-right)); bottom:calc(82px + var(--safe-bottom)); width:88px; height:88px; display:grid; place-content:center; gap:1px; border:0; border-radius:50%; background:var(--blue); color:#fff; box-shadow:0 16px 34px rgba(21,94,239,.36); }
.floating-scan-button span { font-size:27px; line-height:1; }
.floating-scan-button b { font-size:12px; letter-spacing:.08em; }
.floating-scan-button:active { transform:scale(.98); }

.live-scan-modal { z-index:350; padding:0; background:#03070d; backdrop-filter:none; }
.live-scan-sheet { width:100%; height:100dvh; max-height:none; border:0; border-radius:0; overflow:hidden; display:grid; grid-template-rows:auto minmax(0,1fr) auto; background:#050912; color:#fff; box-shadow:none; }
.live-scan-header { min-height:68px; display:grid; grid-template-columns:48px minmax(0,1fr) auto; align-items:center; gap:10px; padding:max(8px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) 8px max(12px, env(safe-area-inset-left)); border-bottom:1px solid #273349; background:#0b1220; }
.camera-back-button { width:44px; height:44px; border:1px solid #34435b; border-radius:12px; background:#151f31; color:#fff; font-size:38px; line-height:.8; }
.live-scan-title { min-width:0; }
.live-scan-title h2 { margin:1px 0 0; font-size:18px; line-height:1; letter-spacing:.03em; }
.camera-mode-toggle { min-width:184px; border-color:#34435b; background:#101a2a; }
.camera-mode-toggle .scan-mode-button { color:#9daabc; }
.camera-mode-toggle .scan-mode-button.active { background:#eaf1ff; color:#0d42ad; box-shadow:none; }

.live-camera-stage { --preview-zoom:1; position:relative; min-height:0; overflow:hidden; background:#000; touch-action:none; user-select:none; }
.live-camera-stage video { width:100%; height:100%; object-fit:cover; transform:scale(var(--preview-zoom)); transform-origin:center; transition:none; }
.live-camera-stage::after { content:""; position:absolute; z-index:2; inset:0; background:linear-gradient(to bottom, rgba(0,0,0,.58) 0%, rgba(0,0,0,.10) 24%, rgba(0,0,0,.04) 68%, rgba(0,0,0,.58) 100%); pointer-events:none; }

.live-readout { position:absolute; z-index:8; left:14px; right:14px; display:grid; grid-template-columns:1fr 1fr; gap:12px; pointer-events:none; }
.live-readout-top { top:18px; }
.live-readout-bottom { bottom:18px; }
.live-data-cell { min-height:72px; display:flex; flex-direction:column; justify-content:center; padding:10px 13px; border:1px solid rgba(255,255,255,.22); border-radius:15px; background:rgba(4,9,18,.76); box-shadow:0 8px 24px rgba(0,0,0,.22); backdrop-filter:blur(8px); }
.live-data-cell.align-right { text-align:right; align-items:flex-end; }
.live-data-cell span { color:#aab9ce; font-size:9px; font-weight:900; letter-spacing:.12em; }
.live-data-cell strong { margin-top:2px; color:#fff; font-size:clamp(28px,8vw,48px); line-height:1; font-weight:1000; letter-spacing:-.035em; }
.live-decision strong { font-size:clamp(27px,8.2vw,50px); letter-spacing:-.045em; }
.live-decision.buy { border-color:rgba(82,230,154,.75); background:rgba(5,92,55,.86); }
.live-decision.check { border-color:rgba(255,193,84,.78); background:rgba(116,67,0,.88); }
.live-decision.pass { border-color:rgba(255,112,112,.78); background:rgba(128,25,31,.88); }
.live-decision.loading { border-color:rgba(111,163,255,.78); background:rgba(17,61,137,.88); }
.live-decision-reason {
  display:block;
  max-width:100%;
  margin-top:4px;
  color:#ffe7e7;
  font-size:clamp(8px,2.25vw,11px);
  line-height:1.12;
  font-weight:950;
  letter-spacing:.025em;
  text-wrap:balance;
}
.live-decision.buy .live-decision-reason { display:none !important; }


.live-camera-frame { position:absolute; z-index:5; left:6%; right:6%; top:31%; bottom:31%; border:3px solid rgba(255,255,255,.82); border-radius:18px; box-shadow:0 0 0 999px rgba(0,0,0,.17); pointer-events:none; }
.live-camera-frame.tag-frame { left:4%; right:4%; top:38%; bottom:38%; border-color:#7cc9ff; }
.live-camera-frame.barcode-frame { border-color:#8ff0bd; }
.live-camera-frame::before, .live-camera-frame::after, .live-camera-frame span::before, .live-camera-frame span::after { content:""; position:absolute; width:38px; height:38px; border-style:solid; border-color:currentColor; }
.live-camera-frame::before { left:-5px; top:-5px; border-width:6px 0 0 6px; border-radius:14px 0 0; }
.live-camera-frame::after { right:-5px; top:-5px; border-width:6px 6px 0 0; border-radius:0 14px 0 0; }
.live-camera-frame span::before { left:-5px; bottom:-5px; border-width:0 0 6px 6px; border-radius:0 0 0 14px; }
.live-camera-frame span::after { right:-5px; bottom:-5px; border-width:0 6px 6px 0; border-radius:0 0 14px; }
.live-camera-frame b { position:absolute; left:50%; bottom:-27px; transform:translateX(-50%); width:max-content; max-width:92vw; color:#e9f4ff; font-size:9px; font-weight:950; letter-spacing:.08em; text-align:center; }
.mode-tag .live-camera-frame { color:#7cc9ff; }
.mode-barcode .live-camera-frame { color:#8ff0bd; }

.camera-status-strip { position:absolute; z-index:9; left:50%; top:104px; transform:translateX(-50%); display:flex; justify-content:center; flex-wrap:wrap; gap:5px; width:calc(100% - 28px); pointer-events:none; }
.camera-status-strip span { padding:5px 7px; border:1px solid rgba(255,255,255,.18); border-radius:99px; background:rgba(4,9,18,.70); color:#c9d5e6; font-size:7px; font-weight:900; letter-spacing:.05em; }
.live-camera-message { position:absolute; z-index:9; left:50%; bottom:104px; transform:translateX(-50%); width:max-content; max-width:calc(100% - 28px); padding:7px 10px; border-radius:10px; background:rgba(4,9,18,.76); color:#d8e3f1; font-size:9px; font-weight:800; line-height:1.35; text-align:center; pointer-events:none; }
.camera-lock { z-index:11; }
.camera-lock.locking, .camera-lock.locked { opacity:1; }
.camera-lock span { font-size:12px; }

.live-camera-controls { position:relative; min-height:94px; display:grid; grid-template-columns:minmax(0,1fr) auto minmax(156px,auto); align-items:center; gap:10px; padding:10px max(12px, env(safe-area-inset-right)) calc(10px + env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left)); border-top:1px solid #273349; background:#0b1220; }
.compact-camera-tools { display:flex; align-items:center; gap:6px; min-width:0; }
.camera-tool-button, .camera-tool-value { min-width:42px; height:42px; border:1px solid #34435b; border-radius:12px; background:#151f31; color:#fff; font-weight:900; }
.camera-tool-button { font-size:22px; }
.camera-tool-button.text-tool { min-width:54px; padding:0 8px; font-size:9px; letter-spacing:.05em; }
.camera-tool-button.active { border-color:#68e2a5; background:#123c2d; color:#aef2cf; }
.camera-tool-value { min-width:54px; font-size:12px; }
.camera-quality-wrap { display:grid; justify-items:center; gap:4px; }
.camera-quality-badge { padding:5px 7px; border-radius:8px; background:#172237; color:#8fb5ff; font-size:8px; font-weight:950; letter-spacing:.06em; white-space:nowrap; }
.tag-ocr-status { color:#9eabc0; font-size:7px; font-weight:850; letter-spacing:.04em; white-space:nowrap; }
.live-scan-button { width:80px; height:72px; display:grid; place-content:center; gap:1px; border:0; border-radius:20px; background:#155eef; color:#fff; box-shadow:0 10px 25px rgba(21,94,239,.35); }
.live-scan-button span { font-size:22px; line-height:1; }
.live-scan-button b { font-size:11px; letter-spacing:.08em; }
.live-scan-button:disabled { opacity:.55; }

/* No moving laser, sweep, pulse, or focus animation in the scan experience. */
.scan-line, .camera-sweep { display:none !important; animation:none !important; }
.live-scan-modal *, .live-scan-modal *::before, .live-scan-modal *::after { animation:none !important; }
.camera-stage.tap-focus::after { animation:none !important; opacity:1; }

#matchModal { z-index:520; }

@media (min-width:761px) {
  .live-scan-sheet { width:min(100%,820px); height:min(96vh,980px); margin:auto; border:1px solid #2d3a51; border-radius:22px; }
  .live-scan-modal { display:grid; place-items:center; padding:18px; }
  .floating-scan-button { bottom:30px; right:30px; }
}

@media (max-width: 760px), (min-width: 480px) {
  .scan-card-topline { margin-bottom:8px; }
  .scan-mode-toggle { min-width:166px; }
  .scan-mode-button { min-height:36px; padding:0 10px; font-size:10px; }
  .floating-scan-button { width:82px; height:82px; }
  .live-scan-header { grid-template-columns:44px minmax(0,1fr) auto; }
  .live-scan-title .section-kicker { display:none; }
  .live-scan-title h2 { font-size:15px; }
  .camera-mode-toggle { min-width:160px; }
  .live-readout { left:10px; right:10px; gap:8px; }
  .live-readout-top { top:12px; }
  .live-readout-bottom { bottom:12px; }
  .live-data-cell { min-height:64px; padding:8px 10px; }
  .camera-status-strip { top:86px; }
  .live-camera-message { bottom:88px; }
  .live-camera-controls { grid-template-columns:minmax(0,1fr) auto minmax(148px,auto); min-height:86px; gap:7px; padding-top:8px; }
  .camera-tool-button, .camera-tool-value { min-width:38px; height:38px; }
  .camera-tool-button.text-tool { min-width:46px; padding:0 5px; }
  .live-scan-button { width:74px; height:66px; border-radius:18px; }
}

@media (max-width: 430px), (min-width: 480px) {
  .live-scan-title { display:none; }
  .live-scan-header { grid-template-columns:44px minmax(0,1fr); }
  .camera-mode-toggle { justify-self:stretch; width:100%; min-width:0; }
  .live-data-cell strong { font-size:clamp(27px,9vw,42px); }
  .live-decision strong { font-size:clamp(25px,8.6vw,41px); }
  .compact-camera-tools { gap:4px; }
  .camera-tool-button, .camera-tool-value { min-width:36px; height:38px; border-radius:10px; }
  .camera-tool-button.text-tool { min-width:42px; font-size:8px; }
  .camera-quality-wrap { display:none; }
  .live-camera-controls { grid-template-columns:minmax(0,1fr) 147px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior:auto !important; animation:none !important; transition:none !important; }
}

/* ========================================================================== 
   HOSM SCOUT BETA 1.3.6 — EXPLICIT REASONS + SEPARATE SCAN/TAG
   ========================================================================== */

body.camera-open { overflow:hidden; background:#03070d; }
body.camera-open .topbar,
body.camera-open .content-frame { visibility:hidden; }
body.camera-open .floating-scan-button { display:none; }
.bottom-nav { z-index:800; }
body.camera-open .bottom-nav { visibility:visible; }

.manual-lookup-card .scan-card-topline > div:first-child { display:grid; gap:3px; }
.manual-lookup-card .scan-card-topline strong { font-size:13px; letter-spacing:.035em; }

.live-scan-modal {
  z-index:450;
  inset:0 0 calc(82px + var(--safe-bottom)) 0;
  display:block;
  padding:0;
  overflow:hidden;
  background:#03070d;
}
.scanner-pager-viewport { width:100%; height:100%; overflow:hidden; touch-action:pan-y; }
.scanner-pager {
  width:200%;
  height:100%;
  display:flex;
  transform:translateX(0);
  transition:none;
  will-change:transform;
}
.scanner-pager[data-page="detail"] { transform:translateX(-50%); }
.scanner-page { flex:0 0 50%; width:50%; min-width:0; height:100%; overflow:hidden; }
.live-page { background:#03070d; }
.detail-page { background:var(--bg); color:var(--ink); overflow:auto; overscroll-behavior:contain; }

.live-scan-sheet {
  width:100%;
  height:100%;
  max-height:none;
  border:0;
  border-radius:0;
  display:grid;
  grid-template-rows:auto minmax(0,1fr) auto;
  overflow:hidden;
}
.live-scan-header {
  min-height:54px;
  grid-template-columns:minmax(0,1fr) auto;
  padding:max(7px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) 7px max(12px, env(safe-area-inset-left));
}
.live-mode-note { justify-self:end; color:#a9b7c9; font-size:9px; font-weight:850; letter-spacing:.055em; white-space:nowrap; }
.live-mode-note b { color:#fff; }
.live-mode-note span { margin:0 3px; color:#52627a; }

.live-camera-stage { min-height:0; height:100%; }
.live-readout { left:10px; right:10px; gap:8px; }
.live-readout-top { top:10px; }
.live-readout-bottom { bottom:10px; pointer-events:auto; }
.live-data-cell { position:relative; min-height:68px; padding:8px 11px; }
.live-data-cell strong { font-size:clamp(28px,8vw,46px); }
.live-decision { overflow:visible; }
.live-decision strong { padding-right:22px; }
.live-decision .live-decision-reason { padding-right:22px; }

.no-buy-reason-icon {
  position:absolute;
  z-index:4;
  top:5px;
  right:7px;
  min-width:25px;
  height:25px;
  display:grid;
  place-items:center;
  color:#fff;
  font-style:normal;
  font-size:19px;
  line-height:1;
  filter:drop-shadow(0 2px 4px rgba(0,0,0,.45));
}
.no-buy-reason-icon.reason-money_slash::after {
  content:"";
  position:absolute;
  width:28px;
  height:3px;
  border-radius:3px;
  background:#fff;
  transform:rotate(-42deg);
  box-shadow:0 1px 3px rgba(0,0,0,.45);
}

.hold-cell { appearance:none; width:100%; color:inherit; text-align:inherit; cursor:pointer; user-select:none; touch-action:none; }
.hold-cell:active { border-color:rgba(124,201,255,.8); }
.hold-reveal {
  position:absolute;
  z-index:22;
  left:5px;
  right:5px;
  bottom:5px;
  min-height:calc(100% - 10px);
  display:flex;
  flex-direction:column;
  justify-content:center;
  gap:5px;
  padding:8px 9px;
  border:1px solid rgba(124,201,255,.65);
  border-radius:11px;
  background:rgba(3,10,20,.97);
  color:#fff;
  text-align:left;
  box-shadow:0 12px 30px rgba(0,0,0,.46);
}
.hold-reveal small { color:#8fb5ff; font-size:8px; font-weight:950; letter-spacing:.09em; }
#currentPriceLadder { color:#fff; font-size:12px; font-weight:900; line-height:1.5; word-spacing:4px; }
#maxPayReveal { min-height:240px; bottom:0; transform:translateY(0); justify-content:flex-start; overflow:auto; }
#maxPayFormula { display:grid; gap:4px; width:100%; }
#maxPayFormula span { display:flex; justify-content:space-between; gap:12px; padding:3px 0; color:#d7e2f1; font-size:9px; line-height:1.2; }
#maxPayFormula b { font-size:8px; letter-spacing:.04em; }
#maxPayFormula em { color:#fff; font-style:normal; font-weight:950; }
#maxPayFormula .formula-total { margin-top:3px; padding-top:7px; border-top:1px solid #4d5e78; color:#8ff0bd; }
#maxPayFormula .formula-total b,
#maxPayFormula .formula-total em { color:#8ff0bd; font-size:10px; }

.live-camera-frame { top:30%; bottom:30%; }
.live-camera-frame.tag-frame { left:4%; right:4%; top:20%; bottom:20%; border-color:#7cc9ff; }
.live-camera-frame b { bottom:-24px; }
.camera-status-strip { top:88px; }
.live-camera-message { bottom:90px; }

.live-camera-controls {
  min-height:82px;
  grid-template-columns:minmax(0,1fr) auto minmax(148px,auto);
  gap:8px;
  padding:8px max(10px, env(safe-area-inset-right)) 8px max(10px, env(safe-area-inset-left));
}
.live-scan-button {
  position:relative;
  isolation:isolate;
  width:70px;
  height:64px;
  border-radius:17px;
  overflow:visible;
  touch-action:none;
  user-select:none;
}
.live-scan-button > .scan-button-symbol,
.live-scan-button > b,
.live-scan-button > small { position:relative; z-index:2; }
.live-scan-button { display:grid; place-content:center; justify-items:center; gap:1px; padding:6px 4px; }
.live-scan-button .scan-button-symbol { font-size:16px; line-height:1; }
.live-scan-button b { font-size:12px; line-height:1; letter-spacing:.045em; }
.live-scan-button small { color:rgba(255,255,255,.74); font-size:6px; line-height:1; font-weight:900; letter-spacing:.08em; }
.scan-action-group { display:grid; grid-template-columns:repeat(2,70px); align-items:center; justify-content:end; gap:7px; }
.barcode-scan-button { background:#1f67d2; }
.tag-scan-button { background:#0d6f9c; }
.mode-tag .tag-scan-button { background:#0d7eab; }

.scanner-page-indicators {
  position:fixed;
  z-index:780;
  left:50%;
  bottom:calc(88px + var(--safe-bottom));
  transform:translateX(-50%);
  display:flex;
  gap:8px;
  padding:7px 11px;
  border:1px solid rgba(255,255,255,.16);
  border-radius:99px;
  background:rgba(3,8,16,.74);
  backdrop-filter:blur(10px);
}
.page-dot { width:8px; height:8px; min-width:8px; padding:0; border:0; border-radius:50%; background:#64748b; }
.page-dot.active { width:22px; border-radius:99px; background:#fff; }
body.scanner-detail-open .scanner-page-indicators { border-color:var(--line); background:color-mix(in srgb, var(--surface) 92%, transparent); }
body.scanner-detail-open .page-dot { background:var(--line); }
body.scanner-detail-open .page-dot.active { background:var(--blue); }

.detail-page-shell { min-height:100%; padding:max(14px, env(safe-area-inset-top)) 14px 30px; overflow:auto; }
.detail-page-header { position:sticky; top:-14px; z-index:5; display:flex; align-items:center; justify-content:space-between; gap:12px; margin:-14px -14px 14px; padding:max(14px, env(safe-area-inset-top)) 14px 12px; border-bottom:1px solid var(--line); background:color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter:blur(14px); }
.detail-page-header h2 { margin:2px 0 0; font-size:22px; }
.swipe-hint { color:var(--ink-soft); font-size:9px; font-weight:900; letter-spacing:.07em; }
.detail-page-mount { width:min(100%,980px); margin:0 auto; }
.detail-page-mount .result-view { margin:0; }
.detail-page-mount .result-view:not(.hidden) { display:grid; }

.detail-intel-card {
  padding:15px;
  border:1px solid var(--line);
  border-radius:var(--radius-lg);
  background:var(--surface);
  box-shadow:0 8px 28px rgba(24,39,63,.055);
}
.detail-placeholder { min-height:72px; display:grid; place-items:center; padding:16px; border:1px dashed var(--line); border-radius:12px; color:var(--ink-soft); font-size:11px; font-weight:800; line-height:1.45; text-align:center; }
.mini-action { min-height:34px; border:1px solid var(--line); border-radius:9px; padding:0 10px; background:var(--surface-2); color:var(--ink); font-size:9px; font-weight:900; letter-spacing:.05em; }

.account-result-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
.account-result { min-height:104px; padding:12px; border:1px solid var(--line); border-radius:13px; background:var(--surface-2); }
.account-result-heading { display:flex; align-items:center; justify-content:space-between; gap:8px; }
.account-result-heading strong { font-size:12px; }
.account-result-heading span { padding:4px 7px; border-radius:99px; background:var(--surface-3); color:var(--ink-soft); font-size:9px; font-weight:950; }
.account-result small { display:block; margin-top:6px; color:var(--ink-soft); font-size:8px; font-weight:850; letter-spacing:.05em; }
.account-result p { margin:8px 0 0; color:var(--ink-soft); font-size:10px; line-height:1.4; }
.account-sellable { border-color:color-mix(in srgb, var(--green) 45%, var(--line)); background:var(--green-soft); }
.account-sellable .account-result-heading span { background:var(--green); color:#fff; }
.account-restricted { border-color:color-mix(in srgb, var(--red) 45%, var(--line)); background:var(--red-soft); }
.account-restricted .account-result-heading span { background:var(--red); color:#fff; }
.account-error { border-color:color-mix(in srgb, var(--amber) 45%, var(--line)); background:var(--amber-soft); }

.keepa-graph { min-height:220px; display:grid; place-items:center; overflow:hidden; border:1px solid var(--line); border-radius:13px; background:var(--surface-2); }
.keepa-graph svg { width:100%; height:auto; max-height:280px; }
.graph-axis { stroke:color-mix(in srgb, var(--ink-soft) 45%, transparent); stroke-width:1; }
.graph-price { fill:none; stroke:var(--blue); stroke-width:3; vector-effect:non-scaling-stroke; }
.graph-bsr { fill:none; stroke:var(--amber); stroke-width:2.4; stroke-dasharray:6 4; vector-effect:non-scaling-stroke; }
.graph-label { fill:var(--blue); font-size:11px; font-weight:900; }
.graph-bsr-label { fill:var(--amber); }

.offer-list { display:grid; gap:6px; }
.offer-row { display:grid; grid-template-columns:28px 88px minmax(0,1fr); align-items:center; gap:8px; min-height:42px; padding:7px 10px; border:1px solid var(--line); border-radius:10px; background:var(--surface-2); }
.offer-row > span { width:22px; height:22px; display:grid; place-items:center; border-radius:50%; background:var(--surface-3); color:var(--ink-soft); font-size:9px; font-weight:900; }
.offer-row strong { font-size:15px; }
.offer-row small { color:var(--ink-soft); font-size:9px; line-height:1.3; }

.risk-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
.risk-grid > div { min-height:100px; display:grid; align-content:start; gap:6px; padding:12px; border:1px solid var(--line); border-radius:12px; background:var(--surface-2); }
.risk-grid span { color:var(--ink-soft); font-size:9px; font-weight:900; letter-spacing:.07em; }
.risk-grid strong { font-size:14px; }
.risk-grid small { color:var(--ink-soft); font-size:9px; line-height:1.4; }

.ungating-queue { display:grid; gap:10px; margin-bottom:24px; }
.ungating-card { display:grid; gap:10px; padding:15px; border:1px solid var(--line); border-radius:var(--radius-lg); background:var(--surface); box-shadow:0 7px 22px rgba(24,39,63,.05); }
.ungating-heading { display:flex; justify-content:space-between; align-items:flex-start; gap:12px; }
.ungating-heading > div:first-child { display:grid; gap:4px; }
.ungating-heading strong { font-size:17px; }
.ungating-heading span { color:var(--ink-soft); font-size:9px; font-weight:800; letter-spacing:.04em; }
.ungating-count { display:grid; justify-items:end; }
.ungating-count strong { color:var(--red); font-size:28px; line-height:1; }
.ungating-count span { color:var(--ink-soft); font-size:7px; font-weight:900; letter-spacing:.06em; }
.ungating-card p { margin:0; color:var(--ink-soft); font-size:10px; line-height:1.45; }
.ungating-controls { display:grid; grid-template-columns:120px minmax(0,1fr) auto; gap:8px; }
.ungating-controls select,
.ungating-controls input { min-height:42px; border:1px solid var(--line); border-radius:10px; padding:0 10px; background:var(--surface-2); color:var(--ink); font-size:10px; font-weight:800; }
.admin-explainer { margin:-4px 0 12px; color:var(--ink-soft); font-size:11px; line-height:1.5; }

@media (min-width:761px) {
  .live-scan-modal { inset:12px 12px 92px; border:1px solid #2d3a51; border-radius:22px; }
  .live-scan-sheet { border-radius:22px; }
  .detail-page { border-radius:22px; }
  .scanner-page-indicators { bottom:104px; }
}

@media (max-width: 760px), (min-width: 480px) {
  .live-scan-modal { inset:0 0 calc(78px + var(--safe-bottom)) 0; }
  .live-scan-title { display:block; }
  .live-scan-header { grid-template-columns:minmax(0,1fr) auto; }
  .live-mode-note { font-size:8px; }
  .camera-status-strip { top:83px; }
  .live-camera-message { bottom:84px; }
  .scanner-page-indicators { bottom:calc(84px + var(--safe-bottom)); }
}

@media (max-width: 520px), (min-width: 480px) {
  .live-scan-title { display:none; }
  .live-scan-header { grid-template-columns:1fr; justify-items:center; min-height:46px; }
  .live-mode-note { justify-self:center; white-space:normal; text-align:center; }
  .live-readout { left:7px; right:7px; gap:6px; }
  .live-data-cell { min-height:61px; padding:7px 9px; border-radius:13px; }
  .live-data-cell span { font-size:8px; }
  .live-data-cell strong { font-size:clamp(25px,8.8vw,40px); }
  .live-decision strong { font-size:clamp(24px,8.2vw,38px); }
  .camera-status-strip { top:72px; }
  .camera-status-strip span:nth-child(3) { display:none; }
  .live-camera-message { bottom:78px; font-size:8px; }
  .live-camera-controls { grid-template-columns:minmax(0,1fr) 147px; min-height:74px; }
  .camera-quality-wrap { display:none; }
  .live-scan-button { width:68px; height:58px; border-radius:15px; }
  .scan-action-group { grid-template-columns:repeat(2,68px); gap:6px; }
  .compact-camera-tools { gap:4px; }
  .camera-tool-button, .camera-tool-value { min-width:35px; height:36px; border-radius:9px; }
  .camera-tool-button.text-tool { min-width:40px; padding:0 4px; font-size:7px; }
  .account-result-grid, .risk-grid { grid-template-columns:1fr; }
  .ungating-controls { grid-template-columns:1fr; }
  #maxPayReveal { min-height:225px; }
}

@media (prefers-reduced-motion: reduce) {
  .scanner-pager, .page-dot { transition:none !important; animation:none !important; }
}

/* Beta 1.3.6: keep the primary NO BUY reason readable without colliding with the reason icon. */
.live-decision > span { padding-right:30px; }
.live-decision.pass strong { font-size:clamp(25px,7.4vw,42px); }
.live-decision .live-decision-reason {
  align-self:stretch;
  padding-right:0;
  text-align:center;
  font-size:clamp(10px,2.65vw,12px);
  line-height:1.08;
}
@media (max-width: 520px), (min-width: 480px) {
  .camera-status-strip { top:92px; }
}

/* Beta 1.3.6 — pricing-basis toggle and persistent scan-mode feedback. */
.setting-toggle-card {
  display:grid;
  grid-template-columns:auto auto minmax(0,1fr);
  align-items:center;
  gap:12px;
  min-height:72px;
  padding:13px 14px;
  border:1px solid var(--line);
  border-radius:14px;
  background:var(--surface-2);
  cursor:pointer;
}
.setting-toggle-card > input {
  position:absolute;
  opacity:0;
  pointer-events:none;
}
.setting-toggle-track {
  position:relative;
  width:50px;
  height:29px;
  border-radius:99px;
  background:#9aa8ba;
  box-shadow:inset 0 0 0 1px rgba(0,0,0,.08);
  transition:none;
}
.setting-toggle-track i {
  position:absolute;
  left:3px;
  top:3px;
  width:23px;
  height:23px;
  border-radius:50%;
  background:#fff;
  box-shadow:0 2px 6px rgba(10,22,40,.24);
  transform:translateX(0);
  transition:none;
}
.setting-toggle-card > input:checked + .setting-toggle-track { background:var(--blue); }
.setting-toggle-card > input:checked + .setting-toggle-track i { transform:translateX(21px); }
.setting-toggle-card > input:focus-visible + .setting-toggle-track { outline:3px solid color-mix(in srgb, var(--blue) 28%, transparent); outline-offset:3px; }
.setting-toggle-copy { display:grid; gap:4px; }
.setting-toggle-copy b { color:var(--ink); font-size:12px; letter-spacing:.04em; }
.setting-toggle-copy small { color:var(--ink-soft); font-size:10px; line-height:1.45; font-weight:700; }
.settings-note { margin:12px 0 0; color:var(--ink-soft); font-size:10px; line-height:1.55; font-weight:700; }
.live-scan-button.active {
  border-color:#d9f5ff;
  box-shadow:0 0 0 3px rgba(124,201,255,.28), 0 8px 18px rgba(0,0,0,.24);
}
.live-scan-button:not(.active) { opacity:.82; }
.mode-tag .tag-scan-button.active { background:#087da9; }
.mode-barcode .barcode-scan-button.active { background:#1b6ddd; }
@media (max-width: 520px), (min-width: 480px) {
  .setting-toggle-card { grid-template-columns:auto minmax(0,1fr); }
  .setting-toggle-card > input { grid-column:1; }
  .setting-toggle-track { grid-column:1; }
  .setting-toggle-copy { grid-column:2; }
}

/* Beta 1.3.4 decision-basis clarity */
.live-data-cell > span { max-width:100%; }
.live-data-cell > span#liveBsrLabel { font-size:8px; }
.live-readout-bottom .live-data-cell > span { font-size:8px; }
@media (max-width: 640px), (min-width: 480px) { .decision-basis-grid { grid-template-columns:1fr; } }

/* ========================================================================== */
/* HOSM Scout Beta 1.3.6 — BSR-first road interface                       */
/* ========================================================================== */

.compact-manual-card { padding: 10px 12px; }
.compact-manual-card .scan-form { margin: 0; }
.compact-manual-card .scan-input-wrap input { min-height: 46px; }

.decision-card-135 {
  overflow: hidden;
  padding: 0;
  border: 0;
  border-radius: 24px;
  box-shadow: 0 18px 44px rgba(2, 8, 23, .18);
  color: #fff;
}
.decision-card-135.decision-buy { background: linear-gradient(145deg, #087a46 0%, #0b9a58 100%); }
.decision-card-135.decision-maybe { background: linear-gradient(145deg, #b57500 0%, #d99a12 100%); }
.decision-card-135.decision-pass { background: linear-gradient(145deg, #a71d2a 0%, #cf3342 100%); }
.decision-135-top {
  display: grid;
  grid-template-columns: minmax(0, .82fr) minmax(0, 1.18fr);
  gap: 12px;
  align-items: stretch;
  padding: 20px 20px 14px;
}
.decision-bsr-block,
.decision-state-block,
.decision-price-block {
  min-width: 0;
}
.decision-bsr-block span,
.decision-price-block > span,
.decision-135-footer b {
  display: block;
  font-size: .71rem;
  font-weight: 900;
  letter-spacing: .09em;
  text-transform: uppercase;
  opacity: .84;
}
.decision-bsr-block strong {
  display: block;
  margin-top: 2px;
  font-size: clamp(2.1rem, 9vw, 4.2rem);
  line-height: .95;
  letter-spacing: -.05em;
}
.decision-bsr-block small {
  display: block;
  margin-top: 7px;
  font-weight: 800;
  letter-spacing: .04em;
  opacity: .9;
}
.decision-state-block { text-align: right; }
.decision-state-block h1 {
  margin: 0;
  font-size: clamp(2.15rem, 10vw, 4.8rem);
  line-height: .92;
  letter-spacing: -.055em;
}
.decision-state-block p {
  margin: 8px 0 0;
  font-size: .78rem;
  font-weight: 900;
  letter-spacing: .035em;
  text-transform: uppercase;
  opacity: .92;
}
.decision-price-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: rgba(255,255,255,.2);
  border-top: 1px solid rgba(255,255,255,.2);
  border-bottom: 1px solid rgba(255,255,255,.2);
}
.decision-price-block {
  padding: 16px 20px 18px;
  background: rgba(0, 0, 0, .13);
}
.decision-price-block strong {
  display: block;
  margin-top: 4px;
  font-size: clamp(2rem, 8vw, 3.7rem);
  line-height: 1;
  letter-spacing: -.045em;
}
.source-price-block { text-align: right; }
.source-price-block small { font-size: .72rem; opacity: .9; }
.estimate-size-button {
  width: 100%;
  min-height: 50px;
  margin-top: 7px;
  padding: 9px 10px;
  border: 1px solid rgba(255,255,255,.65);
  border-radius: 12px;
  background: rgba(0,0,0,.24);
  color: #fff;
  font: inherit;
  font-size: .75rem;
  font-weight: 900;
  letter-spacing: .035em;
  line-height: 1.25;
}
.estimate-size-button small { font-size: .7rem; opacity: .9; }
.estimate-size-button:disabled { opacity: .7; }
.variation-price-note {
  margin: 0;
  padding: 7px 14px;
  background: #05070c;
  color: #fff;
  font-size: .7rem;
  font-weight: 900;
  letter-spacing: .055em;
  text-align: center;
  text-transform: uppercase;
}
.decision-135-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
  gap: 6px 12px;
  align-items: center;
  padding: 13px 18px 15px;
  font-size: .76rem;
  font-weight: 850;
  letter-spacing: .02em;
}
.decision-135-footer > span:nth-child(2) { text-align: right; }
.decision-135-footer strong { font-size: 1rem; }
.buyer-commission-pill {
  grid-column: 1 / -1;
  justify-self: end;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(0,0,0,.25);
  font-size: .68rem;
  font-weight: 900;
  letter-spacing: .04em;
}

.compact-market-card .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.lightweight-offers-card { content-visibility: auto; contain-intrinsic-size: 300px; }
.compact-result-actions { padding-bottom: 92px; }
.detail-scan-button {
  position: fixed;
  z-index: 45;
  right: max(16px, env(safe-area-inset-right));
  bottom: calc(16px + env(safe-area-inset-bottom));
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 58px;
  padding: 0 18px;
  border: 0;
  border-radius: 18px;
  background: #2563eb;
  color: #fff;
  box-shadow: 0 16px 36px rgba(37, 99, 235, .36);
  font: inherit;
  font-weight: 900;
  letter-spacing: .035em;
}
.detail-scan-button span { font-size: 1.35rem; }
body:not(.scanner-detail-open) .detail-scan-button { display: none; }

.price-priority-card {
  display: grid;
  gap: 6px;
  margin-top: 14px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-soft);
}
.price-priority-card b { font-size: .78rem; letter-spacing: .06em; }
.price-priority-card span { color: var(--muted); font-size: .83rem; }
.warning-toggle-grid { display: grid; gap: 10px; }
.buyer-settings-launch {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin: 16px 0 24px;
  padding: 17px 18px;
  border: 1px solid rgba(37,99,235,.28);
  border-radius: 18px;
  background: rgba(37,99,235,.09);
  color: var(--text);
  text-align: left;
  font: inherit;
}
.buyer-settings-launch span { font-weight: 950; font-size: 1rem; }
.buyer-settings-launch small { color: var(--muted); text-align: right; }
.buyer-settings-sheet { max-width: 560px; }
.buyer-settings-form { margin-top: 12px; }

/* Live scanner: calm, fixed-position information with no moving scan bar. */
.live-scan-header { min-height: 54px; padding: 10px 14px; }
.live-scan-title h2 { margin: 0; font-size: 1rem; }
.live-camera-stage {
  border: 3px solid rgba(148,163,184,.8);
  border-radius: 22px;
  overflow: hidden;
  transition: border-color .12s ease, box-shadow .12s ease;
}
.live-camera-stage.result-buy { border-color: #18b86a; box-shadow: inset 0 0 0 1px rgba(24,184,106,.25); }
.live-camera-stage.result-maybe { border-color: #f2ad23; box-shadow: inset 0 0 0 1px rgba(242,173,35,.25); }
.live-camera-stage.result-pass { border-color: #ef4556; box-shadow: inset 0 0 0 1px rgba(239,69,86,.25); }
.live-readout {
  background: rgba(5, 10, 20, .88);
  backdrop-filter: blur(8px);
}
.live-data-cell > span {
  font-size: .68rem;
  font-weight: 900;
  letter-spacing: .075em;
}
.live-data-cell > strong { letter-spacing: -.04em; }
.live-data-cell > small:not(.live-decision-reason) {
  display: block;
  margin-top: 3px;
  color: rgba(255,255,255,.72);
  font-size: .64rem;
  font-weight: 850;
}
.live-readout-bottom .live-data-cell { min-height: 94px; }
.live-readout-bottom .live-data-cell > strong { font-size: clamp(1.65rem, 7vw, 2.8rem); }
.live-readout-bottom .live-data-cell small { font-size: .65rem; }
.live-estimate-button {
  position: relative;
  z-index: 4;
  min-height: 40px;
  margin-top: 4px;
  padding: 7px 9px;
  font-size: .66rem;
}
.live-variation-note {
  position: absolute;
  z-index: 8;
  left: 50%;
  bottom: 104px;
  width: min(88%, 430px);
  transform: translateX(-50%);
  border-radius: 8px;
  padding: 5px 9px;
}
.live-decision-footer {
  position: absolute;
  z-index: 7;
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr);
  gap: 5px 10px;
  align-items: center;
  min-height: 48px;
  padding: 7px 12px;
  background: rgba(5, 10, 20, .91);
  color: #fff;
  font-size: .67rem;
  font-weight: 850;
  letter-spacing: .015em;
}
.live-decision-footer > span:nth-child(2) { text-align: right; }
.live-decision-footer strong { font-size: .83rem; }
.live-decision-footer .buyer-commission-pill { grid-column: 1 / -1; margin-top: 1px; }
.live-camera-frame b { display: none !important; }
.camera-frame::before,
.camera-frame::after { animation: none !important; }
.one-mode-action { justify-content: flex-end; }
.mode-switch-button {
  min-width: 154px;
  min-height: 58px;
  border-radius: 18px;
  padding: 0 16px;
}
.mode-switch-button b { font-size: .88rem; }
.mode-switch-button .scan-button-symbol { font-size: 1.15rem; }
.live-camera-controls { padding-bottom: max(10px, env(safe-area-inset-bottom)); }

.detail-page-header { padding: 12px 16px 4px; }
.detail-page-header h2 { margin: 0; font-size: 1rem; letter-spacing: .045em; }
.detail-page-mount { padding-top: 8px; }

/* Removed road-only intelligence panels remain absent even if an old cached DOM is restored. */
#restrictionSummaryCard,
#amazonAccountsCard,
#keepaGraphCard,
#riskCard,
.live-mode-note,
.camera-status-strip,
#cameraMessage,
#tagOcrStatus,
#cameraQualityBadge { display: none !important; }

@media (max-width: 560px), (min-width: 480px) {
  .decision-135-top { padding: 17px 16px 12px; gap: 8px; }
  .decision-price-block { padding: 14px 15px 16px; }
  .decision-135-footer { padding: 11px 14px 13px; }
  .compact-market-card .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .buyer-settings-launch { align-items: flex-start; flex-direction: column; }
  .buyer-settings-launch small { text-align: left; }
  .detail-scan-button { right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); min-height: 54px; }
}

@media (prefers-reduced-motion: reduce) {
  .live-camera-stage,
  .decision-card-135,
  .detail-scan-button { transition: none !important; animation: none !important; }
}

/* Beta 1.3.6 final live-card spacing: reserve a permanent row for rank and profit. */
.live-readout-bottom { bottom: 58px; }
.live-variation-note { bottom: 154px; }

/* ========================================================================== */
/* HOSM Scout Beta 1.3.6 — separated live cards and stable rule controls   */
/* ========================================================================== */

/* Restore the lighter 1.3.4 visual hierarchy: every live value floats as its
   own rounded card over the camera instead of merging into one black panel. */
.live-camera-stage,
.live-camera-stage.result-buy,
.live-camera-stage.result-maybe,
.live-camera-stage.result-pass {
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}
.live-readout {
  background: transparent !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
.live-data-cell {
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.24);
  border-radius: 17px;
  background: rgba(3,8,17,.86);
  box-shadow: 0 8px 24px rgba(0,0,0,.25);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.live-decision.buy {
  border-color: rgba(88,235,162,.78);
  background: rgba(5,112,64,.92);
}
.live-decision.check {
  border-color: rgba(255,194,72,.82);
  background: rgba(164,104,0,.92);
}
.live-decision.pass {
  border-color: rgba(255,116,126,.82);
  background: rgba(145,28,38,.94);
}
.live-decision-footer {
  left: 10px;
  right: 10px;
  bottom: 6px;
  min-height: 0;
  padding: 0;
  gap: 8px;
  background: transparent;
}
.live-decision-footer > span:not(.buyer-commission-pill) {
  min-width: 0;
  min-height: 38px;
  display: flex;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 12px;
  background: rgba(3,8,17,.86);
  box-shadow: 0 6px 18px rgba(0,0,0,.22);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.live-decision-footer > span:nth-child(2) {
  justify-content: flex-end;
  gap: 5px;
  text-align: right;
}
.live-decision-footer .buyer-commission-pill {
  justify-self: end;
  width: auto;
  border-radius: 99px;
}
.live-readout-bottom { bottom: 58px; }
.live-variation-note { bottom: 154px; }

.source-percent-card {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  gap: 10px 14px;
  align-items: center;
  margin-bottom: 14px;
  padding: 16px;
  border: 1px solid color-mix(in srgb, var(--blue) 25%, var(--line));
  border-radius: 18px;
  background: color-mix(in srgb, var(--blue) 7%, var(--surface-2));
}
.source-percent-copy { display: grid; gap: 4px; }
.source-percent-copy b { color: var(--ink); font-size: 13px; letter-spacing: .04em; }
.source-percent-copy small { color: var(--ink-soft); font-size: 10px; line-height: 1.45; font-weight: 700; }
.source-percent-value {
  min-width: 64px;
  padding: 9px 11px;
  border-radius: 12px;
  background: var(--blue);
  color: #fff;
  font-size: 20px;
  font-weight: 950;
  text-align: center;
}
.source-percent-card input[type="range"] {
  grid-column: 1 / -1;
  width: 100%;
  min-height: 34px;
  accent-color: var(--blue);
  touch-action: pan-x;
}
.source-percent-scale {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  margin-top: -10px;
  color: var(--ink-soft);
  font-weight: 800;
}
.rules-saved-at {
  min-height: 16px;
  margin: 8px 2px 0;
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: .07em;
  text-align: right;
}

@media (max-width: 430px), (min-width: 480px) {
  .live-readout { left: 8px; right: 8px; gap: 8px; }
  .live-data-cell { border-radius: 15px; }
  .live-decision-footer { left: 8px; right: 8px; gap: 7px; }
  .live-decision-footer > span:not(.buyer-commission-pill) { padding: 7px 9px; border-radius: 11px; }
  .source-percent-card { padding: 14px; }
}

/* Beta 1.3.7 decision-chime settings */
.chime-settings-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 760px), (min-width: 480px) { .chime-settings-grid { grid-template-columns: 1fr; } }


/* ==========================================================================
   HOSM SCOUT BETA 1.4 — LIVE UPC DISPLAY + MANUAL ENTRY
   ========================================================================== */
.live-upc-entry {
  position: absolute;
  z-index: 12;
  top: 96px;
  left: 10px;
  right: 10px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: 0;
  min-height: 44px;
  padding: 6px 7px;
  border: 1px solid rgba(255,255,255,.28);
  border-radius: 14px;
  background: rgba(3,8,17,.90);
  box-shadow: 0 7px 22px rgba(0,0,0,.28);
  backdrop-filter: blur(9px);
  -webkit-backdrop-filter: blur(9px);
  pointer-events: auto;
}
.live-upc-entry > label {
  color: #aab9ce;
  font-size: 9px;
  font-weight: 950;
  letter-spacing: .12em;
}
.live-upc-input-wrap {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0,1fr) 48px;
  align-items: center;
  gap: 6px;
}
.live-upc-input-wrap input {
  width: 100%;
  min-width: 0;
  height: 34px;
  padding: 0 11px;
  border: 0;
  border-radius: 9px;
  outline: 0;
  background: rgba(255,255,255,.10);
  color: #fff;
  font-size: 16px;
  font-weight: 900;
  letter-spacing: .055em;
  font-variant-numeric: tabular-nums;
}
.live-upc-input-wrap input::placeholder { color: rgba(210,222,238,.62); font-size: 10px; font-weight: 850; letter-spacing: .04em; }
.live-upc-input-wrap input:focus { box-shadow: inset 0 0 0 2px #6fb5ff; background: rgba(255,255,255,.15); }
.live-upc-input-wrap button {
  height: 34px;
  border: 0;
  border-radius: 9px;
  background: #2563eb;
  color: #fff;
  font: inherit;
  font-size: 11px;
  font-weight: 950;
  letter-spacing: .06em;
}
.live-camera-frame.tag-frame { top: 26%; bottom: 20%; }
@media (max-height: 720px) {
  .live-upc-entry { top: 90px; min-height: 40px; padding-top: 4px; padding-bottom: 4px; }
  .live-upc-input-wrap input, .live-upc-input-wrap button { height: 32px; }
  .live-camera-frame { top: 32%; bottom: 28%; }
  .live-camera-frame.tag-frame { top: 29%; bottom: 20%; }
}

/* ========================================================================== */
/* HOSM SCOUT BETA 1.4 — DELIBERATE AI TAG READER + SHARED REFRESH        */
/* ========================================================================== */

.ai-tag-frame,
.live-camera-frame.ai-tag-frame {
  top: 42%;
  bottom: 41%;
  left: 8%;
  right: 8%;
  border-radius: 15px;
  border-width: 2px;
  background: rgba(2,8,18,.08);
}
.live-camera-frame.ai-tag-frame b {
  display: block !important;
  position: absolute;
  left: 50%;
  bottom: 6px;
  transform: translateX(-50%);
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(3,8,17,.78);
  color: rgba(255,255,255,.9);
  font-size: 8px;
  font-weight: 950;
  letter-spacing: .12em;
  white-space: nowrap;
}
.ai-scan-button {
  min-width: 164px;
  background: linear-gradient(135deg, #6d4aff, #2469e8);
  box-shadow: 0 12px 30px rgba(74, 79, 245, .30);
}
.ai-scan-button.active { opacity: .82; }
.ai-scan-button .scan-button-symbol {
  min-width: 28px;
  font-size: .82rem;
  letter-spacing: -.03em;
}

.ai-variation-sheet { max-width: 760px; }
.ai-extraction-summary {
  margin: 2px 0 12px;
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, var(--blue) 26%, var(--line));
  border-radius: 14px;
  background: color-mix(in srgb, var(--blue) 7%, var(--surface-2));
  color: var(--ink);
  font-size: .78rem;
  font-weight: 900;
  letter-spacing: .04em;
}
.ai-family-tabs,
.ai-size-filters {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 0 10px;
  scrollbar-width: none;
}
.ai-family-tabs::-webkit-scrollbar,
.ai-size-filters::-webkit-scrollbar { display: none; }
.ai-family-tab,
.ai-size-chip {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--ink-soft);
  font: inherit;
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .035em;
}
.ai-family-tab.active,
.ai-size-chip.active {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
}
.ai-variation-list { display: grid; gap: 10px; max-height: min(58vh, 620px); overflow-y: auto; }
.ai-variation-card {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-2);
}
.ai-variation-card img {
  width: 72px;
  height: 72px;
  border-radius: 12px;
  object-fit: contain;
  background: #fff;
}
.ai-variation-card > div { min-width: 0; display: grid; gap: 5px; }
.ai-variation-card strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .82rem; }
.ai-variation-card span { color: var(--ink-soft); font-size: .70rem; line-height: 1.4; }
.ai-variation-card .button { min-height: 44px; padding: 0 13px; }

.compact-result-actions { padding-bottom: 196px; grid-template-columns: 1fr 1fr; }
.detail-fixed-actions {
  position: fixed;
  z-index: 48;
  right: max(16px, env(safe-area-inset-right));
  bottom: calc(16px + env(safe-area-inset-bottom));
  width: min(248px, calc(100vw - 32px));
  display: grid;
  gap: 11px;
}
.detail-data-freshness {
  justify-self: end;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(3,8,17,.82);
  color: #fff;
  font-size: .62rem;
  font-weight: 900;
  letter-spacing: .055em;
  box-shadow: 0 7px 20px rgba(0,0,0,.18);
}
.detail-refresh-button,
.detail-fixed-actions .detail-scan-button {
  position: static;
  width: 100%;
  min-height: 54px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 16px;
  border-radius: 17px;
  font: inherit;
  font-weight: 950;
  letter-spacing: .035em;
}
.detail-refresh-button {
  border: 1px solid rgba(37,99,235,.42);
  background: rgba(10,19,36,.94);
  color: #fff;
  box-shadow: 0 12px 28px rgba(0,0,0,.25);
}
.detail-refresh-button.refresh-recommended {
  border-color: #f2ad23;
  box-shadow: 0 0 0 2px rgba(242,173,35,.18), 0 12px 28px rgba(0,0,0,.25);
}
.detail-fixed-actions .detail-scan-button {
  border: 0;
  background: #2563eb;
  color: #fff;
  box-shadow: 0 16px 36px rgba(37,99,235,.36);
}
body:not(.scanner-detail-open) .detail-fixed-actions { display: none; }
body.scanner-detail-open .detail-fixed-actions .detail-scan-button { display: inline-flex; }

@media (max-width: 560px), (min-width: 480px) {
  .ai-tag-frame,
  .live-camera-frame.ai-tag-frame { top: 43%; bottom: 40%; left: 7%; right: 7%; }
  .ai-variation-card { grid-template-columns: 62px minmax(0, 1fr); }
  .ai-variation-card img { width: 62px; height: 62px; }
  .ai-variation-card .button { grid-column: 1 / -1; width: 100%; }
  .detail-fixed-actions { right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); width: min(238px, calc(100vw - 24px)); }
}
#aiVariationModal { z-index: 380; }
#aiVariationModal { z-index: 480; }


/* ========================================================================== */
/* HOSM SCOUT BETA 1.4.4 — EXPLICIT MODES + STABILITY POLISH              */
/* ========================================================================== */

/* Standard control roundness; circular identity controls intentionally stay circular. */
.button,
.icon-button,
.nav-button,
.lookup-button,
.input-clear,
.method-button,
.scan-mode-button,
.camera-back-button,
.camera-tool-button,
.camera-tool-value,
.live-upc-input-wrap input,
.live-upc-input-wrap button,
.live-mode-button,
.detail-square-action,
.modal-close,
.ai-family-tab,
.ai-size-chip { border-radius: var(--control-radius) !important; }

/* A completed code is visibly armed; tapping it selects/replaces the whole value. */
.live-upc-input-wrap input.input-armed {
  background: rgba(62, 131, 255, .24);
  box-shadow: inset 0 0 0 2px #72b4ff, 0 0 0 2px rgba(114,180,255,.14);
}

/* Checking must always remain inside the rounded decision card. */
.live-decision.loading strong {
  max-width: 100%;
  padding: 0 4px !important;
  font-size: clamp(1.15rem, 5.4vw, 1.85rem) !important;
  line-height: 1 !important;
  letter-spacing: -.025em !important;
  white-space: nowrap;
}

/* Two deliberate square mode controls; no edge-hugging and no text clutter. */
.live-camera-controls {
  grid-template-columns: minmax(0, 1fr) auto !important;
  gap: 14px !important;
  padding-right: max(18px, env(safe-area-inset-right)) !important;
}
.scan-action-group.dual-mode-actions {
  display: grid;
  grid-template-columns: repeat(2, 64px);
  gap: 12px;
  justify-content: end;
  align-items: center;
  margin-right: 2px;
}
.live-mode-button {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid #34435b;
  border-radius: var(--control-radius);
  background: #151f31;
  color: #d7e1ef;
  box-shadow: 0 10px 24px rgba(0,0,0,.22);
  transition: transform .12s ease, background .12s ease, border-color .12s ease, opacity .12s ease;
}
.live-mode-button:active { transform: scale(.97); }
.live-mode-button svg {
  width: 30px;
  height: 30px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.live-mode-button.active {
  border-color: #76a8ff;
  background: #1f67d2;
  color: #fff;
  box-shadow: 0 11px 26px rgba(31,103,210,.34);
}
.ai-mode-button.active { background: linear-gradient(145deg,#6b4cf5,#2469e8); }
.ai-mode-button.capture-ready { border-color: #b7a7ff; }
.ai-mode-button.working { opacity: .64; }

/* Barcode view remains wide; AI capture becomes a narrow text strip. */
.mode-barcode .live-camera-frame { top: 32%; bottom: 28%; left: 6%; right: 6%; }
.mode-ai .live-camera-frame.ai-tag-frame { top: 43%; bottom: 40%; left: 7%; right: 7%; border-color: #87b9ff; }
.mode-ai .live-camera-frame.ai-tag-frame b { display: block !important; }

/* Detail freshness banner defines the exact width of the two square actions below. */
.detail-fixed-actions {
  right: max(16px, env(safe-area-inset-right));
  width: min(168px, calc(100vw - 32px));
  gap: 10px;
}
.detail-data-freshness {
  width: 100%;
  min-height: 30px;
  display: grid;
  place-items: center;
  justify-self: stretch;
  padding: 5px 8px;
  border-radius: var(--control-radius);
  text-align: center;
  white-space: nowrap;
}
.detail-action-row {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.detail-square-action,
.detail-fixed-actions .detail-scan-button {
  position: static;
  width: 76px;
  height: 76px;
  min-height: 76px;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: var(--control-radius);
}
.detail-square-action svg {
  width: 31px;
  height: 31px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.detail-refresh-button { border: 1px solid rgba(37,99,235,.52); }
.detail-refresh-button.refresh-recommended { border-color: #f2ad23; }
.detail-fixed-actions .detail-scan-button { display: grid !important; }
body:not(.scanner-detail-open) .detail-fixed-actions { display: none; }

@media (max-width: 430px), (min-width: 480px) {
  .scan-action-group.dual-mode-actions { grid-template-columns: repeat(2, 58px); gap: 10px; }
  .live-mode-button { width: 58px; height: 58px; }
  .live-mode-button svg { width: 27px; height: 27px; }
  .live-camera-controls { gap: 10px !important; padding-right: max(14px, env(safe-area-inset-right)) !important; }
  .detail-fixed-actions { right: 12px; width: 160px; }
  .detail-action-row { gap: 16px; }
  .detail-square-action,
  .detail-fixed-actions .detail-scan-button { width: 72px; height: 72px; min-height: 72px; }
}

.detail-square-action.is-busy svg { opacity: .18; }
.detail-square-action.is-busy::after { content: ""; position: absolute; width: 23px; height: 23px; border: 3px solid rgba(255,255,255,.28); border-top-color: #fff; border-radius: 50%; animation: hosm-spin .75s linear infinite; }
.detail-square-action { position: relative !important; }
@keyframes hosm-spin { to { transform: rotate(360deg); } }
.detail-square-action,
.detail-fixed-actions .detail-scan-button { inset: auto !important; right: auto !important; bottom: auto !important; top: auto !important; left: auto !important; }


/* ========================================================================== */
/* HOSM SCOUT BETA 1.4.4 — LAYOUT, PRICING, POPUP, AND PAGER POLISH       */
/* ========================================================================== */

/* The two compact footer cards exactly mirror the 50/50 grid above. */
.live-decision-footer {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
}
.live-decision-footer > span:not(.buyer-commission-pill) { width: 100%; }

/* Equal visual breathing room above and below the horizontal barcode frame. */
.mode-barcode .live-camera-frame { top: 30% !important; bottom: 30% !important; }

/* A compact 90-day reference fits inside the existing Current Price card. */
.live-90d-average {
  display: block !important;
  min-height: 13px;
  margin-top: 4px !important;
  color: rgba(255,255,255,.82) !important;
  font-size: clamp(.60rem, 2.35vw, .72rem) !important;
  font-weight: 900 !important;
  line-height: 1 !important;
  letter-spacing: .035em !important;
  white-space: nowrap;
}

/* Source-price formula is a persistent tap popup, not a press-and-hold reveal. */
.tap-popup-cell {
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
}
.tap-popup-cell:active { border-color: rgba(124,201,255,.8); }
#liveMaxPayCell.formula-popup-open { overflow: visible; z-index: 40; }
#maxPayReveal.formula-popup {
  left: auto;
  right: 0;
  bottom: calc(100% + 8px);
  width: calc(200% + 8px);
  min-height: 0;
  max-height: min(42vh, 290px);
  padding: 10px 11px;
  overflow: auto;
  transform: none;
  justify-content: flex-start;
}

/* Lightweight GPU-accelerated polish between Live Scan and Detail. */
.scanner-pager {
  transform: translate3d(0,0,0);
  transition: transform 220ms cubic-bezier(.22,.61,.36,1);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.scanner-pager[data-page="detail"] { transform: translate3d(-50%,0,0); }

@media (max-width: 430px), (min-width: 480px) {
  #maxPayReveal.formula-popup { width: calc(200% + 7px); }
}

@media (prefers-reduced-motion: reduce) {
  .scanner-pager { transition: none !important; }
}

/* Beta 1.4.4 — secure Developer/API management and compact sellability status */
.developer-api-launch {
  width: 100%; min-height: 66px; margin-top: 12px; display: flex; align-items: center; justify-content: space-between; gap: 18px;
  border: 1px solid color-mix(in srgb, var(--blue) 38%, var(--line)); border-radius: var(--control-radius); padding: 13px 16px;
  background: color-mix(in srgb, var(--blue) 8%, var(--surface)); color: var(--ink); text-align: left;
}
.developer-api-launch span { font-weight: 950; font-size: 1rem; letter-spacing: .035em; }
.developer-api-launch small { color: var(--ink-soft); text-align: right; }
.developer-modal { padding: 0; align-items: stretch; }
.developer-sheet { width: min(100%, 980px); max-height: 100dvh; min-height: min(100dvh, 760px); border-radius: 0; padding: 18px clamp(14px, 3vw, 28px) calc(28px + var(--safe-bottom)); }
.developer-header { position: sticky; top: -18px; z-index: 8; margin: -18px calc(clamp(14px, 3vw, 28px) * -1) 0; padding: 18px clamp(14px, 3vw, 28px) 14px; background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(18px); border-bottom: 1px solid var(--line); }
.developer-tabs { position: sticky; top: 64px; z-index: 7; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 7px; padding: 10px 0; background: var(--surface); }
.developer-tab { min-height: 44px; border: 1px solid var(--line); border-radius: var(--control-radius); background: var(--surface-2); color: var(--ink-soft); font-weight: 950; font-size: 11px; letter-spacing: .06em; }
.developer-tab.active { border-color: var(--blue); background: var(--blue); color: #fff; }
.developer-view { display: block; padding-top: 8px; }
.developer-view.hidden { display: none; }
.developer-toolbar { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin: 10px 0 14px; }
.developer-toolbar h3 { margin: 3px 0 0; }
.developer-toolbar-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.developer-asin-field { width: min(100%, 330px); display: grid; gap: 7px; }
.developer-asin-field span { color: var(--ink-soft); font-size: 10px; font-weight: 900; letter-spacing: .08em; }
.developer-asin-field input { min-height: 46px; border: 1px solid var(--line); border-radius: var(--control-radius); padding: 0 13px; background: var(--surface-2); color: var(--ink); text-transform: uppercase; font-weight: 850; }
.developer-security-note { margin: 0 0 16px; padding: 11px 13px; border: 1px solid color-mix(in srgb, var(--green) 35%, var(--line)); border-radius: var(--control-radius); background: color-mix(in srgb, var(--green) 8%, var(--surface)); color: var(--ink-soft); font-size: 12px; line-height: 1.5; }
.amazon-store-list, .diagnostics-list { display: grid; gap: 12px; }
.amazon-store-card, .diagnostic-service-card { border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 15px; background: var(--surface-2); }
.amazon-store-card.disabled { opacity: .65; }
.amazon-store-heading, .diagnostic-card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.amazon-store-heading h3, .diagnostic-card-heading h3 { margin: 2px 0 3px; font-size: 16px; }
.amazon-store-heading p, .diagnostic-card-heading p { margin: 0; color: var(--ink-soft); font-size: 11px; overflow-wrap: anywhere; }
.connection-status-pill { flex: none; padding: 5px 8px; border-radius: 99px; background: var(--surface-3); color: var(--ink-soft); font-size: 9px; font-weight: 950; letter-spacing: .05em; }
.connection-status-pill.connected, .connection-status-pill.sellable { background: var(--green-soft); color: var(--green); }
.connection-status-pill.disconnected, .connection-status-pill.restricted { background: var(--red-soft); color: var(--red); }
.connection-status-pill.not-tested, .connection-status-pill.pending { background: var(--amber-soft); color: var(--amber); }
.amazon-store-meta { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; margin-top: 12px; }
.amazon-store-meta div { min-width: 0; padding: 9px 10px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); }
.amazon-store-meta span { display: block; color: var(--ink-soft); font-size: 8px; font-weight: 900; letter-spacing: .07em; }
.amazon-store-meta strong { display: block; margin-top: 4px; font-size: 11px; overflow-wrap: anywhere; }
.amazon-store-actions { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; margin-top: 12px; }
.amazon-store-actions button { min-height: 42px; border: 1px solid var(--line); border-radius: var(--control-radius); background: var(--surface); color: var(--ink); font-size: 10px; font-weight: 950; }
.amazon-store-actions button.danger { color: var(--red); }
.amazon-store-test-results { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 7px; margin-top: 12px; }
.amazon-test-cell { padding: 9px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); }
.amazon-test-cell b { display: block; font-size: 9px; letter-spacing: .04em; }
.amazon-test-cell span { display: block; margin-top: 5px; color: var(--ink-soft); font-size: 9px; line-height: 1.35; overflow-wrap: anywhere; }
.amazon-test-cell.connected { border-color: color-mix(in srgb, var(--green) 50%, var(--line)); }
.amazon-test-cell.disconnected { border-color: color-mix(in srgb, var(--red) 50%, var(--line)); }
.amazon-store-form { margin-top: 16px; padding: 16px; border: 1px solid var(--blue); border-radius: var(--radius-xl); background: var(--surface); box-shadow: var(--shadow); }
.store-form-header { margin-bottom: 14px; }
.store-form-header h3 { margin: 3px 0 0; }
.developer-store-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
.developer-enabled-toggle { margin-top: 13px; }
.developer-form-actions { display: flex; justify-content: flex-end; margin-top: 14px; }
.diagnostic-service-card { display: grid; gap: 11px; }
.diagnostic-components { display: grid; gap: 7px; }
.diagnostic-component { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 5px 12px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); }
.diagnostic-component strong { font-size: 11px; }
.diagnostic-component small { grid-column: 1 / -1; color: var(--ink-soft); line-height: 1.4; overflow-wrap: anywhere; }
.diagnostic-test-button { min-height: 40px; border: 1px solid var(--line); border-radius: var(--control-radius); padding: 0 13px; background: var(--surface); color: var(--ink); font-size: 10px; font-weight: 950; }
.amazon-sellability-card { margin-top: 14px; padding: 15px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
.amazon-sellability-summary { margin: -2px 0 12px; color: var(--ink-soft); font-size: 12px; line-height: 1.45; }
.amazon-sellability-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.amazon-sellability-store { padding: 11px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface-2); }
.amazon-sellability-store div { display: flex; justify-content: space-between; gap: 9px; align-items: center; }
.amazon-sellability-store strong { font-size: 11px; }
.amazon-sellability-store span { padding: 4px 7px; border-radius: 99px; background: var(--surface-3); color: var(--ink-soft); font-size: 8px; font-weight: 950; }
.amazon-sellability-store.sellable span { background: var(--green-soft); color: var(--green); }
.amazon-sellability-store.restricted span, .amazon-sellability-store.error span { background: var(--red-soft); color: var(--red); }
.amazon-sellability-store p { margin: 7px 0 0; color: var(--ink-soft); font-size: 9px; line-height: 1.4; }

@media (max-width: 700px) {
  .developer-toolbar { align-items: stretch; flex-direction: column; }
  .developer-asin-field { width: 100%; }
  .developer-toolbar-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .developer-store-grid, .amazon-store-meta, .amazon-store-test-results { grid-template-columns: 1fr; }
  .amazon-store-actions { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .amazon-sellability-list { grid-template-columns: 1fr; }
  .developer-api-launch { align-items: flex-start; flex-direction: column; }
  .developer-api-launch small { text-align: left; }
}

/* HOSM Scout Beta 1.4.4 — Amazon Listings Restrictions raw diagnostics */
.developer-debug-toggle { margin: 10px 0 13px; }
.amazon-raw-debug { grid-column: 1 / -1; margin-top: 4px; border: 1px solid rgba(59,130,246,.38); border-radius: var(--radius-md); background: #07101d; overflow: hidden; }
.amazon-raw-debug summary { cursor: pointer; list-style: none; padding: 11px 12px; color: #93c5fd; font-size: 10px; font-weight: 950; letter-spacing: .08em; user-select: none; }
.amazon-raw-debug summary::-webkit-details-marker { display: none; }
.amazon-raw-debug summary::after { content: "+"; float: right; color: #dbeafe; font-size: 15px; line-height: 10px; }
.amazon-raw-debug[open] summary::after { content: "−"; }
.amazon-raw-debug-body { display: grid; gap: 11px; padding: 0 12px 13px; border-top: 1px solid rgba(59,130,246,.2); }
.amazon-debug-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; padding-top: 11px; }
.amazon-debug-grid > div { min-width: 0; padding: 8px; border: 1px solid rgba(148,163,184,.18); border-radius: var(--radius-sm); background: rgba(15,23,42,.72); }
.amazon-debug-grid span { display: block; margin-bottom: 4px; color: #94a3b8; font-size: 8px; font-weight: 900; letter-spacing: .06em; }
.amazon-debug-grid code { display: block; color: #e2e8f0; font-size: 10px; line-height: 1.45; white-space: normal; overflow-wrap: anywhere; }
.amazon-raw-debug h4 { margin: 0; color: #cbd5e1; font-size: 9px; letter-spacing: .08em; }
.amazon-raw-debug pre { max-height: 300px; margin: -4px 0 0; padding: 10px; overflow: auto; border: 1px solid rgba(148,163,184,.18); border-radius: var(--radius-sm); background: #020617; color: #d1fae5; font: 10px/1.5 ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono",monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.amazon-debug-security { margin: 0; color: #94a3b8; font-size: 9px; line-height: 1.45; }
@media (max-width: 560px), (min-width: 480px) { .amazon-debug-grid { grid-template-columns: 1fr; } .amazon-raw-debug pre { max-height: 240px; } }

/* HOSM Scout Beta 1.8 — performance, NO RESULT, battery saver, reset */
.admin-settings-only.hidden { display: none !important; }
.device-settings-card { margin-bottom: 14px; }
.bottom-nav.five-actions { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.nav-action-button { touch-action: manipulation; }
.reset-nav-icon { display: inline-block; font-size: 21px !important; line-height: 1; }
.nav-action-button:active .reset-nav-icon { transform: rotate(35deg); }

.live-decision.loading strong,
#liveDecisionCell.loading #liveDecisionValue {
  font-size: clamp(1.15rem, 5.1vw, 1.95rem) !important;
  letter-spacing: -.025em !important;
  white-space: nowrap;
}
.live-decision.no-result {
  border-color: rgba(148,163,184,.58) !important;
  background: rgba(71,85,105,.86) !important;
  color: #f8fafc !important;
}
.live-decision.no-result strong { font-size: clamp(1.15rem, 5.5vw, 2rem) !important; white-space: nowrap; }
.camera-stage.no-result-active .live-readout-top > .live-data-cell:first-child { display: none; }
.camera-stage.no-result-active .live-readout-bottom,
.camera-stage.no-result-active .live-decision-footer,
.camera-stage.no-result-active .live-variation-note { visibility: hidden; pointer-events: none; }
.camera-stage.no-result-active .live-readout-top { grid-template-columns: 1fr; }
.camera-stage.no-result-active #liveDecisionCell { grid-column: 1 / -1; align-items: center; text-align: center; }
.no-result-panel {
  position: absolute;
  z-index: 28;
  left: 50%;
  top: 52%;
  width: min(82%, 390px);
  transform: translate(-50%, -50%);
  display: grid;
  gap: 7px;
  padding: 15px 17px;
  border: 1px solid rgba(203,213,225,.42);
  border-radius: var(--radius-lg);
  background: rgba(51,65,85,.94);
  color: #f8fafc;
  text-align: center;
  box-shadow: 0 18px 45px rgba(0,0,0,.38);
  backdrop-filter: blur(12px);
}
.no-result-panel.hidden { display: none; }
.no-result-panel strong { font-size: 13px; letter-spacing: .055em; }
.no-result-panel span { font-size: 11px; font-weight: 950; color: #e2e8f0; }
.no-result-panel small { font-size: 9px; line-height: 1.5; color: #cbd5e1; }

.scanner-sleep-overlay {
  position: absolute;
  z-index: 46;
  inset: 0;
  width: 100%;
  border: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 8px;
  background: rgba(2,6,23,.92);
  color: #fff;
  backdrop-filter: blur(12px);
  border-radius: 0;
  touch-action: manipulation;
}
.scanner-sleep-overlay.hidden { display: none; }
.scanner-sleep-overlay .sleep-icon { font-size: 42px; line-height: 1; color: #60a5fa; }
.scanner-sleep-overlay strong { font-size: 16px; letter-spacing: .08em; }
.scanner-sleep-overlay small { color: #aab9ce; font-size: 10px; letter-spacing: .08em; }

.store-status-inline {
  display: block;
  margin-top: 5px;
  min-height: 13px;
  max-width: 100%;
  overflow: hidden;
  color: #fff;
  font-size: clamp(7.5px, 2.18vw, 9.5px) !important;
  font-weight: 950;
  line-height: 1.2;
  letter-spacing: 0;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.store-status-inline.hidden { display: none; }
#detailStoreStatus { margin-top: 7px; font-size: clamp(7.5px, 2.18vw, 9.5px) !important; }

.scanner-metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.scanner-metric-grid > div {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
}
.scanner-metric-grid span { display: block; color: var(--ink-soft); font-size: 8px; font-weight: 900; letter-spacing: .07em; }
.scanner-metric-grid strong { display: block; margin-top: 4px; color: var(--ink); font-size: 12px; overflow-wrap: anywhere; }

@media (max-width: 430px), (min-width: 480px) {
  .bottom-nav.five-actions { gap: 2px; padding-inline: 4px; }
  .bottom-nav.five-actions .nav-button b { font-size: 7.7px; letter-spacing: .025em; }
  .no-result-panel { width: min(86%, 350px); padding: 13px 14px; }
  .store-status-inline { font-size: clamp(7.5px, 2.18vw, 9px) !important; }
}


/* HOSM Scout Beta 1.8 — multilingual field localization */
.language-settings-card { margin-top: 22px; }
.language-settings-card select { min-height: 48px; }
.language-resolved-text { margin: 10px 0 0; font-size: 12px; font-weight: 800; letter-spacing: .06em; color: var(--muted); }
html[lang="zh-CN"] body { font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", "Segoe UI", sans-serif; }
html[lang="es"] .nav-button b, html[lang="es"] .live-mode-button, html[lang="es"] .detail-square-action { letter-spacing: .01em; }
html[lang="zh-CN"] .nav-button b, html[lang="zh-CN"] .live-mode-button, html[lang="zh-CN"] .detail-square-action { letter-spacing: .02em; }
.decision-state-block h1, .live-decision strong, .nav-button b, button, select, option { overflow-wrap: anywhere; }

.language-settings-card label { display:grid !important; grid-template-columns:1fr !important; gap:8px; }
.language-settings-card select { width:100%; }
html[lang="es"] .live-decision strong, html[lang="es"] .decision-state-block h1 { white-space:nowrap; overflow-wrap:normal; font-size:clamp(24px,7.2vw,40px); }


/* HOSM Scout Beta 1.8 — Recent history, filter drawer, and complete images */
.recent-header-actions { display: flex; align-items: center; gap: 9px; }
.recent-filter-button { display: inline-flex; align-items: center; gap: 7px; }
.recent-filter-button.filter-active { border-color: var(--blue); color: var(--blue); background: color-mix(in srgb, var(--blue) 8%, var(--surface)); }
.recent-decision.no-result { background: #687386; }
.product-card { align-items: stretch; }
.product-image-button { min-height: 210px; height: 100%; display: flex; align-items: center; justify-content: center; isolation: isolate; }
.product-image-button::before { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg,#f1f4f8 20%,#fff 40%,#f1f4f8 60%); background-size: 220% 100%; opacity: 0; pointer-events: none; }
.product-image-button.image-loading::before { opacity: 1; animation: imageShimmer 1s linear infinite; }
.product-image-button img { width: 100%; height: 100%; min-height: 210px; object-fit: contain; object-position: center center; display: block; opacity: 1; transition: opacity .12s ease; }
.product-image-button.image-loading img { opacity: 0; }
@keyframes imageShimmer { to { background-position: -220% 0; } }
.recent-filter-drawer { position: fixed; inset: 0; z-index: 4500; display: block; pointer-events: none; }
.recent-filter-drawer.hidden { display: none; }
.recent-filter-backdrop { position: absolute; inset: 0; background: rgba(8,16,29,.42); opacity: 0; transition: opacity .22s ease; }
.recent-filter-sheet { position: absolute; top: 0; right: 0; width: min(88vw, 430px); height: 100%; display: grid; grid-template-rows: auto 1fr auto; background: var(--surface); color: var(--ink); box-shadow: -18px 0 50px rgba(4,12,24,.18); transform: translate3d(102%,0,0); transition: transform .22s cubic-bezier(.2,.75,.25,1); padding: max(16px,env(safe-area-inset-top)) 18px max(18px,env(safe-area-inset-bottom)); }
.recent-filter-drawer.open { pointer-events: auto; }
.recent-filter-drawer.open .recent-filter-backdrop { opacity: 1; }
.recent-filter-drawer.open .recent-filter-sheet { transform: translate3d(0,0,0); }
.recent-filter-header { display: grid; grid-template-columns: 48px 1fr auto; align-items: center; gap: 12px; min-height: 64px; border-bottom: 1px solid var(--line); }
.recent-filter-header h2 { margin: 0; font-size: 24px; letter-spacing: -.035em; }
.recent-filter-close { width: 46px; height: 46px; border: 0; border-radius: var(--radius-md); background: var(--surface-2); color: var(--ink); font-size: 30px; line-height: 1; }
.recent-filter-reset { min-height: 44px; border: 0; border-radius: var(--radius-md); padding: 0 16px; background: var(--surface-2); color: var(--ink); font-weight: 900; }
.recent-filter-body { padding: 28px 0; overflow: auto; }
.recent-filter-options { display: grid; margin-top: 10px; border-top: 1px solid var(--line); }
.recent-filter-options label { position: relative; min-height: 68px; display: flex; align-items: center; border-bottom: 1px solid var(--line); cursor: pointer; }
.recent-filter-options input { position: absolute; opacity: 0; pointer-events: none; }
.recent-filter-options span { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 0 14px; border: 2px solid transparent; border-radius: var(--radius-md); }
.recent-filter-options b { font-size: 17px; }
.recent-filter-options small { min-width: 34px; padding: 5px 8px; border-radius: 99px; background: var(--surface-3); color: var(--ink-soft); text-align: center; font-weight: 900; }
.recent-filter-options input:checked + span { min-height: 54px; border-color: var(--blue); background: color-mix(in srgb, var(--blue) 8%, var(--surface)); color: var(--blue); }
.recent-filter-footer { padding-top: 14px; border-top: 1px solid var(--line); }
.recent-filter-footer .button { width: 100%; min-height: 58px; border-radius: var(--radius-lg); font-size: 16px; }
@media (max-width: 620px) {
  .recent-header-actions { gap: 6px; }
  .recent-header-actions .button { min-height: 44px; padding: 0 12px; }
  .recent-filter-button b { display: none; }
  .recent-filter-sheet { width: 92vw; }
  .product-image-button, .product-image-button img { min-height: 190px; }
}


/* HOSM Scout Beta 1.8 — image-first Recent cards and 72-hour dedupe */
.recent-list { gap: 12px; }
.recent-card {
  display: grid;
  grid-template-columns: minmax(112px, 31%) minmax(0, 1fr);
  align-items: stretch;
  gap: 15px;
  padding: 14px;
  border-radius: 18px;
}
.recent-media { min-width: 0; display: grid; grid-template-rows: minmax(100px, 1fr) auto; gap: 10px; }
.recent-product-image {
  position: relative;
  min-height: 112px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 0;
  border-radius: 13px;
  background: #fff;
  isolation: isolate;
}
.recent-product-image::before { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg,#f1f4f8 20%,#fff 40%,#f1f4f8 60%); background-size: 220% 100%; opacity: 0; pointer-events: none; }
.recent-product-image.image-loading::before { opacity: 1; animation: imageShimmer 1s linear infinite; }
.recent-product-image img { width: 100%; height: 100%; min-height: 112px; object-fit: contain; object-position: center; display: block; opacity: 1; transition: opacity .12s ease; }
.recent-product-image.image-loading img { opacity: 0; }
.recent-decision { min-height: 34px; height: 34px; border-radius: 10px; font-size: clamp(12px, 3.5vw, 15px); letter-spacing: .01em; }
.recent-content { min-width: 0; display: grid; grid-template-rows: auto 1fr auto; gap: 11px; align-content: center; }
.recent-title {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  color: var(--ink);
  font-size: clamp(14px, 4.15vw, 18px);
  line-height: 1.14;
  font-weight: 950;
  text-transform: none;
}
.recent-stats { display: grid; grid-template-columns: .88fr .88fr 1.24fr; align-items: end; gap: 7px; }
.recent-stat { min-width: 0; }
.recent-stat + .recent-stat { border-left: 1px solid var(--line); padding-left: 8px; }
.recent-stat span { display: block; overflow: hidden; color: var(--ink-soft); min-height: 18px; display: flex; align-items: flex-end; font-size: clamp(7px, 1.95vw, 8px); line-height: 1.02; font-weight: 850; white-space: normal; overflow-wrap: normal; }
.recent-stat strong { display: block; margin-top: 5px; overflow: hidden; color: var(--ink); font-size: clamp(14px, 4.25vw, 19px); line-height: 1; font-weight: 950; white-space: nowrap; text-overflow: ellipsis; }
.recent-meta { min-width: 0; display: flex; align-items: center; gap: 8px; overflow: hidden; color: var(--ink-soft); font-size: clamp(10px, 3.05vw, 13px); line-height: 1.1; font-weight: 750; }
.recent-scanner-name, .recent-meta time { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font: inherit; color: inherit; }
.recent-scanner-name { max-width: 58%; }
.recent-meta-separator { flex: 0 0 auto; }
.recent-pay, .recent-copy { display: none; }
@media (max-width: 380px) {
  .recent-card { grid-template-columns: 104px minmax(0,1fr); gap: 11px; padding: 11px; }
  .recent-media { grid-template-rows: 96px auto; gap: 8px; }
  .recent-product-image, .recent-product-image img { min-height: 96px; }
  .recent-stat + .recent-stat { padding-left: 5px; }
  .recent-stats { gap: 5px; }
}


/* HOSM Scout Beta 1.8 stability revision — unobstructed NO RESULT and full reset recovery */
.no-result-panel {
  top: auto !important;
  bottom: 12px !important;
  transform: translateX(-50%) !important;
  width: min(88%, 410px) !important;
  pointer-events: none;
}
.camera-retry-overlay {
  position: absolute;
  z-index: 52;
  inset: 0;
  width: 100%;
  border: 0;
  display: grid;
  place-content: center;
  gap: 8px;
  padding: 24px;
  background: rgba(3,8,16,.91);
  color: #fff;
  text-align: center;
  backdrop-filter: blur(8px);
}
.camera-retry-overlay.hidden { display: none; }
.camera-retry-overlay strong { font-size: clamp(1.05rem,5vw,1.5rem); letter-spacing: .035em; }
.camera-retry-overlay small { color: #9fc2ff; font-size: .78rem; font-weight: 900; letter-spacing: .08em; }
.shake-reset-toggle { margin-top: 16px; }
@media (max-height: 720px) {
  .no-result-panel { bottom: 7px !important; padding: 11px 13px; gap: 4px; }
  .no-result-panel strong { font-size: 11px; }
  .no-result-panel span { font-size: 10px; }
  .no-result-panel small { font-size: 8px; }
}


/* HOSM Scout Beta 1.8 — polished H+ branding */
.brand-mark { border: 1px solid rgba(82,159,255,.22); }


/* HOSM Scout Beta 1.9.1 — startup splash critical CSS.
   This must remain in the external stylesheet because the production CSP blocks inline <style>. */
html.startup-active,
html.startup-active body,
body.startup-active {
  margin: 0 !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 100% !important;
  overflow: hidden !important;
  overscroll-behavior: none !important;
  background: #ffffff !important;
}
body.startup-active > #offlineBar,
body.startup-active > #loginView,
body.startup-active > #appView {
  visibility: hidden !important;
}
#startupVeil {
  position: fixed !important;
  z-index: 2147483647 !important;
  inset: -3px !important;
  width: auto !important;
  height: auto !important;
  min-height: calc(100vh + 6px) !important;
  min-height: calc(100dvh + 6px) !important;
  overflow: hidden !important;
  isolation: isolate;
  opacity: 1;
  background: #ffffff !important;
  color: #fff;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  transform: translateZ(0);
  transition: opacity .12s ease;
}
#startupVeil.hidden {
  opacity: 0;
  pointer-events: none;
}
#startupVeil .startup-art {
  position: absolute !important;
  z-index: 0;
  inset: 0 !important;
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  overflow: hidden !important;
  background: #ffffff !important;
}
#startupVeil .startup-art img {
  position: absolute !important;
  inset: 0 !important;
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  min-width: 100% !important;
  min-height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  object-fit: cover !important;
  object-position: center center !important;
  background: #ffffff !important;
  transform: translateZ(0) scale(1.004);
}
#startupVeil .startup-version {
  position: absolute !important;
  z-index: 2;
  left: 50% !important;
  bottom: max(30px, calc(env(safe-area-inset-bottom, 0px) + 18px)) !important;
  margin: 0 !important;
  transform: translateX(-50%) !important;
  color: #3984ff !important;
  background: transparent !important;
  font-size: clamp(13px, 3.8vw, 18px) !important;
  font-weight: 800 !important;
  line-height: 1 !important;
  letter-spacing: .045em !important;
  text-shadow: 0 0 18px rgba(24,108,255,.75);
  white-space: nowrap;
}
@media (max-height: 700px) {
  #startupVeil .startup-version {
    bottom: max(22px, calc(env(safe-area-inset-bottom, 0px) + 12px)) !important;
    font-size: 13px !important;
  }
}
@media (prefers-reduced-motion: reduce) {
  #startupVeil { transition: none; }
}


/* ========================================================================== */
/* HOSM SCOUT BETA 1.8.7 — DIAGNOSTICS, SAFE AREAS, BUYER BINARY MODE        */
/* ========================================================================== */
:root {
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
}

.camera-diagnostic-status {
  position: absolute;
  z-index: 13;
  left: 50%;
  width: min(calc(100% - 34px), 430px);
  min-height: 22px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3px 10px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 999px;
  background: rgba(3,8,17,.78);
  color: #dce8f7;
  font-size: clamp(8px, 2.2vw, 10px);
  font-weight: 900;
  letter-spacing: .035em;
  line-height: 1.25;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
  backdrop-filter: blur(8px);
}
.camera-diagnostic-status.neutral { border-color: rgba(148,163,184,.30); color: #dce8f7; }
.camera-diagnostic-status.focus { border-color: rgba(96,165,250,.55); color: #dbeafe; }
.camera-diagnostic-status.success { border-color: rgba(52,211,153,.62); color: #d1fae5; }
.camera-diagnostic-status.warning { border-color: rgba(251,191,36,.62); color: #fef3c7; }
.camera-diagnostic-status.error { border-color: rgba(248,113,113,.65); color: #fee2e2; }

/* Reserve a narrow diagnostic lane below the frame without moving any cards. */
.mode-barcode .live-camera-frame { top: 30% !important; bottom: 34% !important; }
.mode-barcode .camera-diagnostic-status { top: 68%; }
.mode-ai .live-camera-frame.ai-tag-frame { top: 42% !important; bottom: 43% !important; }
.mode-ai .camera-diagnostic-status { top: 60%; }

.buyer-settings-sheet {
  width: min(calc(100% - max(24px, var(--safe-left) + var(--safe-right))), 560px);
  max-width: 560px;
  padding-bottom: calc(20px + var(--safe-bottom));
}
.buyer-settings-form {
  width: min(100%, 450px);
  margin: 18px auto 0;
  padding: 0 clamp(18px, 5vw, 30px);
}
.buyer-binary-note {
  margin: -2px 0 2px;
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--blue) 25%, var(--line));
  border-radius: var(--control-radius);
  background: color-mix(in srgb, var(--blue) 6%, var(--surface));
  line-height: 1.45;
}
body.legacy-buyer-layout .buyer-hidden-decision { display: none !important; }

/* Developer pages must begin below the iPhone status bar and Dynamic Island. */
.developer-sheet {
  padding-top: calc(18px + var(--safe-top));
  padding-left: max(clamp(14px, 3vw, 28px), var(--safe-left));
  padding-right: max(clamp(14px, 3vw, 28px), var(--safe-right));
}
.developer-header {
  top: calc(-18px - var(--safe-top));
  margin-top: calc(-18px - var(--safe-top));
  margin-left: calc(max(clamp(14px, 3vw, 28px), var(--safe-left)) * -1);
  margin-right: calc(max(clamp(14px, 3vw, 28px), var(--safe-right)) * -1);
  padding-top: calc(18px + var(--safe-top));
  padding-left: max(clamp(14px, 3vw, 28px), var(--safe-left));
  padding-right: max(clamp(14px, 3vw, 28px), var(--safe-right));
}
.developer-tabs { top: calc(64px + var(--safe-top)); }
.developer-header .modal-close {
  min-width: 44px;
  min-height: 44px;
  margin-top: 1px;
  touch-action: manipulation;
}

@media (max-height: 700px) {
  .mode-barcode .live-camera-frame { top: 31% !important; bottom: 35% !important; }
  .mode-barcode .camera-diagnostic-status { top: 67%; }
  .mode-ai .camera-diagnostic-status { top: 59%; }
}


/* ========================================================================== */
/* HOSM SCOUT BETA 1.8.7 — SUBWINDOW FLOATING-BAR HOTFIX                   */
/* ========================================================================== */
/* Developer & API and 买手 Settings are full subwindows. The main navigation
   must not float over their forms; the close button is the return control. */
body.subsettings-open .bottom-nav,
body:has(#developerModal:not(.hidden)) .bottom-nav,
body:has(#buyerSettingsModal:not(.hidden)) .bottom-nav {
  display: none !important;
}

/* Ensure content remains comfortably scrollable after the navigation hides. */
body.subsettings-open .developer-sheet,
body.subsettings-open .buyer-settings-sheet {
  padding-bottom: calc(28px + var(--safe-bottom));
}


/* ========================================================================== */
/* HOSM SCOUT BETA 1.8.7 — FLOATING NAVIGATION CONTAINMENT                  */
/* ========================================================================== */
/* The bottom navigation belongs to the main app shell. Developer & API and
   买手 Settings are independent subwindows, so the nav is removed from layout,
   accessibility traversal, and touch hit-testing while either window is open. */
.bottom-nav.subsettings-nav-hidden,
.bottom-nav[hidden],
body.subsettings-open .bottom-nav {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* The nav must be above the live scanner only. On all other pages it remains
   below standard modal layers as a no-JavaScript/iOS restoration fallback. */
body:not(.camera-open) .bottom-nav { z-index: 70 !important; }
body.camera-open .bottom-nav { z-index: 800 !important; }

/* A second independent containment boundary prevents a stale nav frame from
   painting above these subwindows during a service-worker or BFCache handoff. */
.subsettings-modal { z-index: 900; }
.toast-region { z-index: 1000; }
body.subsettings-open { overflow: hidden; }


/* ========================================================================== */
/* HOSM SCOUT BETA 1.8.7 — FULL-WIDTH AI SEARCH + QUIET SCAN DIAGNOSTIC    */
/* Guidance is a placeholder inside the input. It disappears naturally as soon
   as typing or OCR supplies a value, so it never consumes search width. */
.live-upc-entry {
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 0 !important;
  padding-left: 7px !important;
}
.live-upc-entry > label { position: absolute !important; }
.live-upc-input-wrap { width: 100%; }
.live-upc-input-wrap input { min-width: 0; }

/* The lane stays geometrically reserved, but remains invisible during the
   first five seconds and only appears for one latched primary scan issue. */
.camera-diagnostic-status.hidden { display: none !important; }

/* ========================================================================== */
/* HOSM SCOUT BETA 1.8.7 — IOS DEVELOPER TAB SAFE-AREA CORRECTION          */
/* ========================================================================== */
/* The Developer header already absorbs the iPhone top safe area. WebKit was
   also adding that inset to the sticky tab rail, leaving a second finger-width
   gap. Keep the Android/Samsung rule unchanged and remove only that duplicate
   iOS offset. */
html.platform-ios .developer-tabs,
body.platform-ios .developer-tabs {
  top: 64px;
}



/* ========================================================================== */
/* HOSM SCOUT BETA 1.9.1 — COMPACT PARENT VARIATION CONTEXT                  */
/* ========================================================================== */
.decision-bsr-block .decision-variation-summary {
  min-height: 1.15em;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: clamp(.56rem, 2.25vw, .72rem);
  line-height: 1.15;
  letter-spacing: .015em;
}
.live-data-cell .live-variation-summary {
  min-height: 1.12em;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: clamp(.52rem, 2.05vw, .66rem) !important;
  line-height: 1.12;
  letter-spacing: .01em;
}


/* HOSM Scout 1.9 — one compact exact-ASIN sales/inventory line; no new card. */
.store-status-inline { font-variant-numeric: tabular-nums; }


/* ========================================================================== */
/* HOSM SCOUT BETA 1.9.1 — AUTO-WAKE, INTERNAL LABEL MODE, READABLE COUNTS */
/* ========================================================================== */
.live-upc-input-wrap.hosm-label-control-visible {
  grid-template-columns: minmax(0,1fr) 48px 30px;
}
.live-upc-input-wrap .hosm-label-mode-dot {
  position: static;
  z-index: auto;
  width: 30px;
  height: 34px;
  min-width: 30px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(248,113,113,.28);
  border-radius: 50% !important;
  background: rgba(3,8,17,.82);
  box-shadow: none;
  font-size: 0;
  letter-spacing: 0;
  touch-action: manipulation;
}
.live-upc-input-wrap .hosm-label-mode-dot.hidden { display: none !important; }
.live-upc-input-wrap .hosm-label-mode-dot > span {
  width: 12px;
  height: 12px;
  display: block;
  border: 2px solid #f87171;
  border-radius: 50%;
  background: transparent;
  transition: background .12s ease, box-shadow .12s ease, transform .12s ease;
}
.live-upc-input-wrap .hosm-label-mode-dot.active > span {
  border-color: #ef4444;
  background: #ef4444;
  box-shadow: 0 0 0 3px rgba(239,68,68,.18), 0 0 10px rgba(239,68,68,.66);
}
.live-upc-input-wrap .hosm-label-mode-dot:active > span { transform: scale(.88); }
.live-upc-input-wrap .hosm-label-mode-dot:focus-visible { outline: 3px solid rgba(248,113,113,.55); outline-offset: 2px; }
@media (max-height: 720px) {
  .live-upc-input-wrap.hosm-label-control-visible { grid-template-columns: minmax(0,1fr) 46px 28px; }
  .live-upc-input-wrap .hosm-label-mode-dot { width: 28px; min-width: 28px; height: 32px; }
}

/* Keep the compact line in its existing box, but make the numbers materially
   larger than the labels. Groups may wrap as complete units on very narrow phones. */
.store-status-inline {
  display: flex !important;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 2px 4px;
  min-height: 17px;
  overflow: visible;
  white-space: normal;
  text-overflow: clip;
  line-height: 1.05;
}
.store-status-group {
  min-width: 0;
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
  white-space: nowrap;
}
.store-status-label {
  color: rgba(255,255,255,.82) !important;
  font-size: clamp(7.5px, 2.05vw, 9px) !important;
  font-weight: 900 !important;
  line-height: 1 !important;
  letter-spacing: .01em !important;
}
.store-status-value {
  color: #fff;
  font-size: clamp(12.5px, 3.35vw, 15.5px) !important;
  font-weight: 1000;
  line-height: 1 !important;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}
.store-status-separator {
  color: rgba(255,255,255,.48) !important;
  font-size: 9px !important;
  line-height: 1 !important;
  letter-spacing: 0 !important;
}
#detailStoreStatus { font-size: inherit !important; }
@media (max-width: 370px) {
  .store-status-inline { gap: 2px 3px; }
  .store-status-label { font-size: 7.4px !important; }
  .store-status-value { font-size: 12.5px !important; }
}


/* ========================================================================== */
/* HOSM SCOUT BETA 1.9.1 — SAFE LABEL TOGGLE + TWO-ROW DETAIL METADATA   */
/* ========================================================================== */
#detailStoreStatus {
  width: 100%;
  min-height: 31px;
  margin-top: 7px;
  display: flex !important;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  flex-wrap: nowrap;
  gap: 4px;
  overflow: visible;
}
#detailStoreStatus .store-status-row {
  width: 100%;
  min-width: 0;
  display: flex;
  align-items: baseline;
  flex-wrap: nowrap;
  gap: 2px 4px;
  line-height: 1;
  white-space: nowrap;
}
#detailStoreStatus .store-status-sales-row,
#detailStoreStatus .store-status-inventory-row {
  justify-content: flex-start;
}
#detailStoreStatus .store-status-inventory-row .store-status-separator {
  margin: 0 1px;
}
#detailStoreStatus .store-status-group {
  flex: 0 0 auto;
}

/* ========================================================================== */
/* HOSM SCOUT BETA 1.9.1 — EQUAL-SIZE DETAIL SALES / STORE TYPOGRAPHY    */
/* ========================================================================== */
#detailStoreStatus {
  min-height: 39px;
  gap: 5px;
}
#detailStoreStatus .store-status-sales-row .store-status-label,
#detailStoreStatus .store-status-sales-row .store-status-value,
#detailStoreStatus .store-status-inventory-row .store-status-label,
#detailStoreStatus .store-status-inventory-row .store-status-value {
  font-size: clamp(14px, 4.25vw, 18px) !important;
  line-height: 1 !important;
  letter-spacing: -.01em !important;
}
#detailStoreStatus .store-status-sales-row .store-status-label,
#detailStoreStatus .store-status-inventory-row .store-status-label {
  color: rgba(255,255,255,.93) !important;
  font-weight: 950 !important;
}
#detailStoreStatus .store-status-sales-row .store-status-value,
#detailStoreStatus .store-status-inventory-row .store-status-value {
  font-weight: 1000 !important;
}
#detailStoreStatus .store-status-group {
  gap: 4px;
}
#detailStoreStatus .store-status-inventory-row {
  gap: 3px 6px;
}
#detailStoreStatus .store-status-inventory-row .store-status-separator {
  font-size: clamp(12px, 3.5vw, 15px) !important;
  margin: 0 1px;
}

/* ========================================================================== */
/* HOSM SCOUT BETA 1.9.1 — COMPLETE VARIATION PICKER + NAV CONTAINMENT      */
/* ========================================================================== */
body.ai-variation-open {
  overflow: hidden !important;
}
body.ai-variation-open .bottom-nav,
body.ai-variation-open .detail-fixed-actions,
body:has(#aiVariationModal:not(.hidden)) .bottom-nav,
body:has(#aiVariationModal:not(.hidden)) .detail-fixed-actions {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}
#aiVariationModal {
  z-index: 1200 !important;
  padding-top: max(8px, env(safe-area-inset-top, 0px));
  padding-right: max(8px, env(safe-area-inset-right, 0px));
  padding-bottom: max(8px, env(safe-area-inset-bottom, 0px));
  padding-left: max(8px, env(safe-area-inset-left, 0px));
}
#aiVariationModal .ai-variation-sheet {
  display: flex;
  flex-direction: column;
  width: min(100%, 760px);
  max-height: calc(100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 16px);
  overflow: hidden;
}
#aiVariationModal .modal-header,
#aiVariationModal .ai-extraction-summary,
#aiVariationModal .ai-family-tabs,
#aiVariationModal .ai-size-filters {
  flex: 0 0 auto;
}
#aiVariationModal .ai-variation-list {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-padding-bottom: calc(30px + env(safe-area-inset-bottom, 0px));
  padding-bottom: calc(30px + env(safe-area-inset-bottom, 0px));
}
#aiVariationModal .ai-variation-card:last-child {
  margin-bottom: 2px;
}

#aiVariationModal .ai-extraction-summary.partial-variations {
  border-color: #d98a00 !important;
  background: color-mix(in srgb, #f5a000 13%, var(--surface-2)) !important;
  color: var(--ink) !important;
}
@media (max-width: 560px), (min-width: 480px) {
  #aiVariationModal .ai-variation-sheet {
    max-height: calc(100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 12px);
  }
}



/* ========================================================================== */
/* HOSM SCOUT BETA 1.9.1 — RESPONSIVE LIVE RESULT STACK                    */
/* Prevent the four lower live-result boxes from colliding when the footer   */
/* gains a buyer-commission row or when phone safe-area geometry changes.    */
/* ========================================================================== */
.live-camera-stage {
  --live-footer-clearance: 58px;
}
.live-readout-bottom {
  bottom: var(--live-footer-clearance) !important;
}
.live-decision-footer {
  bottom: max(6px, env(safe-area-inset-bottom, 0px)) !important;
}
/* Keep each pair as two stable columns; values may shrink slightly on narrow phones. */
.live-readout-bottom,
.live-decision-footer {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}
.live-readout-bottom .live-data-cell,
.live-decision-footer > span:not(.buyer-commission-pill) {
  min-width: 0;
}
@media (max-width: 390px) {
  .live-readout-bottom { left: 8px !important; right: 8px !important; gap: 7px !important; }
  .live-readout-bottom .live-data-cell { padding-inline: 9px !important; }
  .live-readout-bottom .live-data-cell > strong { font-size: clamp(1.55rem, 7vw, 2.35rem) !important; }
  .live-decision-footer { left: 8px !important; right: 8px !important; gap: 7px !important; }
}
@media (max-height: 760px) {
  .live-readout-bottom .live-data-cell { min-height: 82px !important; padding-block: 8px !important; }
  .live-decision-footer > span:not(.buyer-commission-pill) { min-height: 34px !important; padding-block: 6px !important; }
}


/* ========================================================================== */
/* HOSM SCOUT BETA 1.9.1 — AVAILABLE / INBOUND INVENTORY + EBAY COMPS          */
/* ========================================================================== */
.store-status-main {
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
  white-space: nowrap;
}
.store-status-breakdown {
  color: rgba(255,255,255,.76) !important;
  font-size: clamp(8px, 2.25vw, 10.5px) !important;
  font-weight: 950 !important;
  line-height: 1 !important;
  letter-spacing: -.01em !important;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
#liveStoreStatus .inventory-group {
  display: inline-flex;
  flex-direction: row;
  align-items: baseline;
  gap: 3px;
}
#detailStoreStatus .store-status-inventory-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
  gap: 5px;
  white-space: normal;
}
#detailStoreStatus .store-status-inventory-row .store-status-separator { display: none; }
#detailStoreStatus .store-status-inventory-row .inventory-group {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: center;
  gap: 3px;
  padding: 5px 6px;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 9px;
  background: rgba(255,255,255,.055);
}
#detailStoreStatus .store-status-inventory-row .store-status-main {
  gap: 4px;
}
#detailStoreStatus .store-status-inventory-row .store-status-breakdown {
  font-size: clamp(10px, 2.85vw, 12.5px) !important;
  color: rgba(255,255,255,.82) !important;
}
#detailStoreStatus {
  min-height: 57px;
}
@media (max-width: 370px) {
  #detailStoreStatus .store-status-inventory-row .inventory-group { padding: 4px; }
  #detailStoreStatus .store-status-inventory-row .store-status-breakdown { font-size: 9.5px !important; }
}

.product-link-button {
  appearance: none;
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}
.ebay-entry-button { color: var(--blue); }
.ai-ebay-button,
.no-result-ebay-button {
  width: 100%;
  min-height: 42px;
  border: 1px solid color-mix(in srgb, #e53238 55%, var(--line));
  border-radius: 12px;
  background: color-mix(in srgb, #e53238 8%, var(--surface));
  color: color-mix(in srgb, #e53238 82%, var(--ink));
  font-size: 11px;
  font-weight: 950;
  letter-spacing: .055em;
}
.ai-ebay-button { margin: 0 0 10px; }
.no-result-ebay-button { min-height: 34px; margin-top: 8px; background: rgba(229,50,56,.14); color: #fff; }

body.ebay-comps-open {
  overflow: hidden !important;
}
body.ebay-comps-open .detail-fixed-actions {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}
body.ebay-comps-open .bottom-nav {
  display: grid !important;
  visibility: visible !important;
  pointer-events: auto !important;
  z-index: 1300 !important;
}
.ebay-modal {
  z-index: 1200;
  padding: 0 0 calc(88px + var(--safe-bottom));
  align-items: stretch;
  background: rgba(3,8,17,.72);
}
.ebay-sheet {
  width: min(100%, 760px);
  height: calc(100dvh - 88px - var(--safe-bottom));
  max-height: calc(100dvh - 88px - var(--safe-bottom));
  margin: 0 auto;
  padding: max(12px, env(safe-area-inset-top)) 12px 10px;
  border-radius: 0;
  display: grid;
  grid-template-rows: auto auto 56px auto auto auto minmax(0, 1fr);
  gap: 8px;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
}
.ebay-header {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 2px;
}
.ebay-header-copy { min-width: 0; }
.ebay-header h2 { margin: 1px 0 0; font-size: 1.25rem; letter-spacing: -.02em; }
.ebay-header small { display: block; margin-top: 3px; color: var(--ink-soft); font-size: 10px; font-weight: 900; letter-spacing: .045em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ebay-query-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 58px;
  gap: 8px;
}
.ebay-query-form input {
  min-width: 0;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 13px;
  background: var(--surface);
  color: var(--ink);
  outline: none;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: .03em;
}
.ebay-query-form input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 16%, transparent); }
.ebay-query-form .button { min-height: 44px; padding: 0 10px; }
.ebay-summary-bar {
  height: 100%;
  min-height: 74px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 7px 22px rgba(20,32,52,.07);
}
.ebay-summary-bar > div {
  min-width: 0;
  display: grid;
  place-content: center;
  text-align: center;
  border-right: 1px solid var(--line);
}
.ebay-summary-bar > div:last-child { border-right: 0; }
.ebay-summary-bar span { color: var(--ink-soft); font-size: clamp(7px, 1.9vw, 9px); font-weight: 950; letter-spacing: .05em; }
.ebay-summary-bar strong { margin-top: 3px; color: var(--ink); font-size: clamp(16px, 5vw, 25px); line-height: 1; font-weight: 1000; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.ebay-result-controls {
  min-height: 42px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}
.ebay-tabs {
  min-width: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface-2);
}
.ebay-tab {
  min-width: 0;
  min-height: 36px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 950;
  letter-spacing: .045em;
}
.ebay-tab.active { background: var(--surface); color: var(--ink); box-shadow: 0 4px 12px rgba(20,32,52,.09); }
.ebay-open-external {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  color: var(--blue);
  font-size: 9px;
  font-weight: 950;
  letter-spacing: .035em;
  text-decoration: none;
  white-space: nowrap;
}
.ebay-filter-row {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(118px, .72fr) minmax(0, 1.28fr);
  align-items: center;
  gap: 8px;
}
.ebay-filter-note {
  min-width: 0;
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .05em;
  line-height: 1.25;
  text-align: left;
}
.ebay-filter-controls { min-width: 0; display: grid; grid-template-columns: minmax(94px, .62fr) minmax(170px, 1.38fr); gap: 6px; }
.ebay-condition-control,
.ebay-sort-control {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 6px;
}
.ebay-condition-control > span, .ebay-sort-control > span { color: var(--ink-soft); font-size: 8px; font-weight: 950; letter-spacing: .06em; }
.ebay-condition-control select, .ebay-sort-control select {
  width: 100%;
  min-width: 0;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 24px 0 8px;
  background: var(--surface);
  color: var(--ink);
  font-size: 9px;
  font-weight: 950;
  letter-spacing: .025em;
  outline: none;
}
.ebay-condition-control select:focus, .ebay-sort-control select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 14%, transparent); }
.ebay-condition-control.disabled, .ebay-sort-control.disabled { opacity: .48; }
.ebay-status {
  min-height: 18px;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 850;
  line-height: 1.25;
  text-align: center;
}
.ebay-status.success { color: var(--green); }
.ebay-status.warning { color: var(--amber); }
.ebay-status.loading { color: var(--blue); }
.ebay-results {
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 8px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 1px 1px calc(14px + env(safe-area-inset-bottom));
  scrollbar-width: none;
}
.ebay-results::-webkit-scrollbar { display: none; }
.ebay-result-card {
  min-width: 0;
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  gap: 10px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  box-shadow: 0 5px 16px rgba(20,32,52,.05);
}
.ebay-result-card img {
  width: 84px;
  height: 84px;
  border-radius: 10px;
  object-fit: contain;
  background: #fff;
}
.ebay-result-copy { min-width: 0; display: grid; align-content: center; gap: 5px; }
.ebay-result-copy > strong { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; font-size: 12px; line-height: 1.25; }
.ebay-result-copy > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-soft); font-size: 9px; }
.ebay-result-foot { min-width: 0; display: flex; align-items: end; justify-content: space-between; gap: 8px; }
.ebay-total-price { min-width: 0; display: grid; gap: 3px; }
.ebay-total-price strong { overflow-wrap: anywhere; color: var(--ink); font-size: clamp(16px, 4.8vw, 20px); line-height: 1; font-weight: 1000; letter-spacing: -.035em; font-variant-numeric: tabular-nums; }
.ebay-total-price small { overflow-wrap: anywhere; color: var(--ink-soft); font-size: 9px; line-height: 1.2; font-weight: 800; font-variant-numeric: tabular-nums; }
.ebay-total-price.unknown strong { color: var(--amber); font-size: clamp(10px, 3vw, 12px); line-height: 1.12; letter-spacing: .005em; }
.ebay-result-foot em { flex: 0 0 auto; padding: 4px 6px; border-radius: 7px; background: color-mix(in srgb, #e53238 10%, var(--surface-2)); color: #e53238; font-size: 8px; font-style: normal; font-weight: 950; letter-spacing: .05em; }
.ebay-empty-state {
  min-height: 210px;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 9px;
  padding: 24px;
  border: 1px dashed var(--line);
  border-radius: 16px;
  background: var(--surface);
  text-align: center;
}
.ebay-empty-state strong { font-size: 15px; }
.ebay-empty-state span { max-width: 360px; color: var(--ink-soft); font-size: 11px; line-height: 1.5; }
.ebay-empty-state a { min-height: 42px; display: inline-flex; align-items: center; padding: 0 13px; border-radius: 10px; background: var(--blue); color: #fff; font-size: 10px; font-weight: 950; text-decoration: none; }
.ebay-loading-card { display: grid; gap: 9px; padding: 12px; }
.ebay-loading-card span { height: 84px; border-radius: 14px; background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 220% 100%; animation: ebay-shimmer 1.1s linear infinite; }
@keyframes ebay-shimmer { to { background-position: -220% 0; } }
@media (min-width: 761px) {
  .ebay-modal { padding: 18px; align-items: center; }
  .ebay-sheet { height: min(900px, calc(100dvh - 36px)); max-height: calc(100dvh - 36px); border-radius: 24px; box-shadow: var(--shadow); }
}
@media (max-width: 430px), (min-width: 480px) {
  .ebay-filter-row { grid-template-columns: 1fr; gap: 6px; }
  .ebay-filter-controls { grid-template-columns: minmax(92px, .58fr) minmax(166px, 1.42fr); gap: 5px; }
  .ebay-condition-control, .ebay-sort-control { gap: 4px; }
  .ebay-condition-control > span, .ebay-sort-control > span { font-size: 7px; }
  .ebay-condition-control select, .ebay-sort-control select { padding-left: 6px; font-size: 8px; }
}
@media (max-height: 720px) {
  .ebay-sheet { grid-template-rows: auto auto 54px auto auto auto minmax(0, 1fr); gap: 6px; }
  .ebay-summary-bar { min-height: 68px; padding: 6px; }
  .ebay-result-card { grid-template-columns: 70px minmax(0, 1fr); padding: 7px; }
  .ebay-result-card img { width: 70px; height: 70px; }
}

/* Compact equal-weight store typography for the added A/I/R split. */
#detailStoreStatus .store-status-inventory-row .store-status-label,
#detailStoreStatus .store-status-inventory-row .store-status-value {
  font-size: clamp(11px, 3.1vw, 13px) !important;
  letter-spacing: -.035em !important;
}
#detailStoreStatus .store-status-inventory-row .store-status-main {
  gap: 2px;
  justify-content: center;
}
#detailStoreStatus .store-status-inventory-row .store-status-breakdown {
  font-size: clamp(8.5px, 2.35vw, 10px) !important;
  letter-spacing: -.035em !important;
  text-align: center;
}
@media (max-width: 370px) {
  #detailStoreStatus .store-status-inventory-row .store-status-label,
  #detailStoreStatus .store-status-inventory-row .store-status-value { font-size: 11px !important; }
  #detailStoreStatus .store-status-inventory-row .store-status-breakdown { font-size: 8.5px !important; }
}


/* ========================================================================== */
/* HOSM SCOUT BETA 1.9.1 — EBAY OAUTH / BROWSE API SETTINGS                 */
/* ========================================================================== */
.developer-ebay-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
.ebay-api-toolbar { align-items: flex-start; }
.ebay-api-toolbar h3 { margin: 2px 0 2px; }
.ebay-api-toolbar p { margin: 0; color: var(--ink-soft); font-size: 11px; font-weight: 700; }
.ebay-api-form {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--card-radius);
  background: var(--surface-2);
}
.ebay-api-form label > span { display: block; margin-bottom: 5px; color: var(--ink-soft); font-size: 10px; font-weight: 950; letter-spacing: .055em; }
.ebay-api-form input,
.ebay-api-form select {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--control-radius);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-weight: 850;
}
.ebay-api-actions { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,.72fr) minmax(0,.82fr); gap: 10px; }
.ebay-api-test-results { margin-top: 0; }
.ebay-sold-api-note { margin: 12px 2px 4px; line-height: 1.45; }
.ebay-open-settings {
  min-height: 42px;
  padding: 0 16px;
  border: 0;
  border-radius: 12px;
  background: var(--ink);
  color: var(--surface);
  font-weight: 950;
  letter-spacing: .04em;
}
@media (max-width: 560px), (min-width: 480px) {
  .developer-tabs { gap: 5px; }
  .developer-tab { min-height: 42px; padding-inline: 5px; font-size: 9px; letter-spacing: .035em; }
  .developer-ebay-grid { grid-template-columns: 1fr; }
  .ebay-api-actions { grid-template-columns: 1fr; }
}


/* ========================================================================== */
/* HOSM SCOUT BETA 1.9.6 — CROSSLISTING CHANNEL ANALYSIS NAVIGATION          */
/* ========================================================================== */
.bottom-nav.five-actions {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 3px;
}
.ebay-nav-icon {
  display: inline-grid !important;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  font: 1000 17px/1 Arial, sans-serif !important;
  text-transform: lowercase;
}
body.ebay-comps-open .ebay-nav-button.active {
  background: #fff;
  color: #0b1220;
}
@media (max-width: 430px), (min-width: 480px) {
  .bottom-nav.five-actions { gap: 2px; padding-inline: 4px; }
  .bottom-nav.five-actions .nav-button { border-radius: 12px; }
  .bottom-nav.five-actions .nav-button b { font-size: 7.6px; letter-spacing: .02em; }
  .bottom-nav.five-actions .nav-button span:not(.ebay-nav-icon) { font-size: 18px; }
  .ebay-nav-icon { width: 20px; height: 20px; font-size: 15px !important; }
}
@media (max-width: 370px) {
  .bottom-nav.five-actions .nav-button b { font-size: 7px; }
  .bottom-nav.five-actions { padding-inline: 3px; }
}
@media (min-width: 761px) and (max-width: 1179px) {
  .ebay-modal { padding: 18px 18px calc(100px + var(--safe-bottom)); }
  .ebay-sheet { height: min(900px, calc(100dvh - 118px - var(--safe-bottom))); max-height: calc(100dvh - 118px - var(--safe-bottom)); }
}
@media (min-width: 1180px) {
  .ebay-modal { padding: 18px 18px 18px 112px; }
  .ebay-sheet { height: min(900px, calc(100dvh - 36px)); max-height: calc(100dvh - 36px); }
}


/* ========================================================================== */
/* HOSM SCOUT BETA 1.9.6 — DUAL ACTIVE-LISTING PROVIDER FAILOVER                  */
/* ========================================================================== */
.developer-integration-block {
  display: grid;
  gap: 10px;
}
.developer-provider-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 0 14px;
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 950;
  letter-spacing: .09em;
  text-align: center;
}
.developer-provider-divider::before,
.developer-provider-divider::after {
  content: "";
  flex: 1 1 auto;
  height: 1px;
  background: var(--line);
}
.developer-provider-divider span { flex: 0 0 auto; }
.serpapi-integration-block {
  padding-top: 2px;
}
.serpapi-api-toolbar .connection-status-pill { white-space: nowrap; }
.ebay-provider-note {
  margin: 16px 2px 4px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-2);
  line-height: 1.45;
}
.serpapi-api-form .ebay-diagnostic-article { grid-column: 1 / -1; }
@media (max-width: 560px), (min-width: 480px) {
  .developer-provider-divider { margin-block: 14px 10px; font-size: 8px; }
  .ebay-provider-note { padding: 10px 12px; }
}


/* ========================================================================== */
/* HOSM SCOUT BETA 1.9.6 — SEARCHAPI.IO PRIMARY / SERPAPI SECONDARY       */
/* ========================================================================== */
.searchapi-integration-block,
.serpapi-integration-block { padding-top: 2px; }
.searchapi-api-toolbar .connection-status-pill,
.serpapi-api-toolbar .connection-status-pill { white-space: nowrap; }
.searchapi-api-form .ebay-diagnostic-article,
.serpapi-api-form .ebay-diagnostic-article { grid-column: 1 / -1; }
.primary-provider-block {
  padding: 12px;
  border: 1px solid color-mix(in srgb, var(--blue) 32%, var(--line));
  border-radius: 16px;
  background: color-mix(in srgb, var(--blue) 4%, var(--surface));
}
.secondary-provider-block {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}
.amazon-test-cell.limit-reached {
  border-color: color-mix(in srgb, var(--amber) 62%, var(--line));
  background: color-mix(in srgb, var(--amber) 7%, var(--surface));
}
@media (max-width: 560px), (min-width: 480px) {
  .primary-provider-block,
  .secondary-provider-block { padding: 10px; }
}


/* HOSM SCOUT BETA 1.9.6 — buyer-facing active-listing total price.
   Missing shipping remains unknown; it is never styled or calculated as free. */

/* 1.9.6.5 retained launch-shell override */
html.startup-skipped #startupVeil{display:none!important;}
html.startup-skipped,html.startup-skipped body{background:var(--page-bg,#f4f7fb)!important;}

/* 1.9.6.5 — compact four-metric summary + scroll-collapse browsing */
.ebay-summary-bar {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  min-height: 68px;
  padding: 6px 4px;
  gap: 0;
}
.ebay-summary-bar > div { padding: 0 3px; }
.ebay-summary-bar span {
  font-size: clamp(6.5px, 1.65vw, 8.5px);
  letter-spacing: .035em;
  white-space: nowrap;
}
.ebay-summary-bar strong {
  margin-top: 2px;
  font-size: clamp(15px, 4.15vw, 23px);
  white-space: nowrap;
}
@media (max-width: 380px) {
  .ebay-summary-bar span { font-size: 6.5px; letter-spacing: .02em; }
  .ebay-summary-bar strong { font-size: 15px; }
  .ebay-summary-bar > div { padding: 0 2px; }
}


/* 1.9.6.5 — compact summary metric sizing retained. */
.ebay-summary-bar {
  width: min(100%, 360px);
  justify-self: center;
  min-height: 54px;
  padding: 4px 2px;
  border-radius: 13px;
}
.ebay-summary-bar > div { padding: 0 2px; }
.ebay-summary-bar span { font-size: clamp(6px, 1.5vw, 7.5px); line-height: 1; }
.ebay-summary-bar strong { margin-top: 2px; font-size: clamp(15px, 3.8vw, 20px); }

/* Scroll-collapse: browsing keeps only article search + condition/sort controls. */
.ebay-sheet.ebay-scroll-compact {
  grid-template-rows: 0 auto 0 0 auto 0 minmax(0, 1fr);
  gap: 5px;
}
.ebay-sheet.ebay-scroll-compact .ebay-header,
.ebay-sheet.ebay-scroll-compact .ebay-summary-bar,
.ebay-sheet.ebay-scroll-compact .ebay-result-controls,
.ebay-sheet.ebay-scroll-compact .ebay-filter-note,
.ebay-sheet.ebay-scroll-compact .ebay-status {
  min-height: 0 !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
}
.ebay-sheet.ebay-scroll-compact .ebay-query-form {
  position: relative;
  z-index: 2;
}
.ebay-sheet.ebay-scroll-compact .ebay-filter-row {
  grid-template-columns: 1fr;
}
.ebay-sheet.ebay-scroll-compact .ebay-filter-controls {
  width: 100%;
}
@media (max-width: 380px) {
  .ebay-summary-bar { width: min(100%, 340px); min-height: 52px; }
}

/* ========================================================================== */
/* HOSM SCOUT BETA 1.9.6.5 — SMOOTH COMPACT EBAY HEADER                       */
/* ========================================================================== */
/*
   The eBay result list remains the only scroll container. The retained
   article search and Condition/Sort controls stay exactly one standard 8 px
   rhythm apart while the other rows collapse through a brief slide/fade
   transition instead of disappearing in a single frame.
*/
.ebay-sheet {
  --ebay-compact-gap: 8px;
  --ebay-compact-motion: 260ms;
  --ebay-compact-ease: cubic-bezier(.45, 0, .55, 1);
  display: flex;
  flex-direction: column;
  gap: 0;
}
.ebay-header,
.ebay-query-form,
.ebay-summary-bar,
.ebay-result-controls,
.ebay-filter-row,
.ebay-status {
  flex: 0 0 auto;
  overflow: hidden;
}
.ebay-header {
  max-height: 52px;
  margin-bottom: var(--ebay-compact-gap);
  transition:
    max-height var(--ebay-compact-motion) var(--ebay-compact-ease),
    min-height var(--ebay-compact-motion) var(--ebay-compact-ease),
    margin-bottom var(--ebay-compact-motion) var(--ebay-compact-ease),
    opacity 210ms ease,
    transform var(--ebay-compact-motion) var(--ebay-compact-ease),
    padding var(--ebay-compact-motion) var(--ebay-compact-ease);
}
.ebay-query-form {
  margin-bottom: var(--ebay-compact-gap);
}
.ebay-summary-bar {
  align-self: center;
  height: auto;
  max-height: 54px;
  margin-bottom: var(--ebay-compact-gap);
  transition:
    max-height var(--ebay-compact-motion) var(--ebay-compact-ease),
    min-height var(--ebay-compact-motion) var(--ebay-compact-ease),
    margin-bottom var(--ebay-compact-motion) var(--ebay-compact-ease),
    opacity 210ms ease,
    transform var(--ebay-compact-motion) var(--ebay-compact-ease),
    padding var(--ebay-compact-motion) var(--ebay-compact-ease),
    border-width 210ms ease;
}
.ebay-result-controls {
  max-height: 42px;
  margin-bottom: var(--ebay-compact-gap);
  transition:
    max-height var(--ebay-compact-motion) var(--ebay-compact-ease),
    min-height var(--ebay-compact-motion) var(--ebay-compact-ease),
    margin-bottom var(--ebay-compact-motion) var(--ebay-compact-ease),
    opacity 210ms ease,
    transform var(--ebay-compact-motion) var(--ebay-compact-ease);
}
.ebay-filter-row {
  margin-bottom: var(--ebay-compact-gap);
  transition:
    gap var(--ebay-compact-motion) var(--ebay-compact-ease),
    margin-bottom var(--ebay-compact-motion) var(--ebay-compact-ease);
}
.ebay-filter-note {
  height: auto !important;
  max-height: 40px;
  overflow: hidden;
  transition:
    max-height var(--ebay-compact-motion) var(--ebay-compact-ease),
    opacity 210ms ease,
    transform var(--ebay-compact-motion) var(--ebay-compact-ease),
    margin var(--ebay-compact-motion) var(--ebay-compact-ease),
    padding var(--ebay-compact-motion) var(--ebay-compact-ease);
}
.ebay-status {
  height: auto !important;
  max-height: 42px;
  margin-bottom: var(--ebay-compact-gap);
  overflow: hidden;
  transition:
    max-height var(--ebay-compact-motion) var(--ebay-compact-ease),
    min-height var(--ebay-compact-motion) var(--ebay-compact-ease),
    margin-bottom var(--ebay-compact-motion) var(--ebay-compact-ease),
    opacity 210ms ease,
    transform var(--ebay-compact-motion) var(--ebay-compact-ease),
    padding var(--ebay-compact-motion) var(--ebay-compact-ease);
}
.ebay-results {
  flex: 1 1 0%;
  min-height: 0;
}
.ebay-sheet.ebay-scroll-compact {
  gap: 0;
}
.ebay-sheet.ebay-scroll-compact .ebay-header,
.ebay-sheet.ebay-scroll-compact .ebay-summary-bar,
.ebay-sheet.ebay-scroll-compact .ebay-result-controls,
.ebay-sheet.ebay-scroll-compact .ebay-status {
  height: auto !important;
  max-height: 0 !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  border-width: 0 !important;
  opacity: 0;
  transform: translateY(-10px);
  overflow: hidden;
  pointer-events: none;
}
.ebay-sheet.ebay-scroll-compact .ebay-filter-row {
  grid-template-columns: 1fr;
  gap: 0;
  margin-bottom: var(--ebay-compact-gap);
}
.ebay-sheet.ebay-scroll-compact .ebay-filter-note {
  height: auto !important;
  max-height: 0 !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  opacity: 0;
  transform: translateY(-6px);
  overflow: hidden;
  pointer-events: none;
}
.ebay-sheet.ebay-scroll-compact .ebay-filter-controls {
  width: 100%;
}
@media (prefers-reduced-motion: reduce) {
  .ebay-header,
  .ebay-summary-bar,
  .ebay-result-controls,
  .ebay-filter-row,
  .ebay-filter-note,
  .ebay-status {
    transition-duration: 1ms !important;
  }
}

/* ========================================================================== */
/* HOSM SCOUT BETA 1.9.6.7 — TRACKED EBAY HEADER + UNIFIED NAVIGATION         */
/* ========================================================================== */
/* Header line boxes receive enough vertical room so cap-height/descenders are
   not clipped by the collapsing container. */
.ebay-header-copy {
  box-sizing: border-box;
  padding: 2px 0 3px;
}
.ebay-header-copy .section-kicker {
  display: block;
  margin: 0 0 3px;
  padding: 0;
  line-height: 1.35;
}
.ebay-header h2 {
  margin: 0;
  line-height: 1.08;
}
.ebay-header small {
  margin-top: 2px;
  padding: 0;
  line-height: 1.35;
}

/* These values are written once per animation frame from accumulated scroll
   delta. There is intentionally no spring/transition: upward finger movement
   hides the optional rows and downward movement reveals them from any list
   position. */
.ebay-sheet {
  --ebay-reveal: 1;
  --ebay-header-size: 64px;
  --ebay-summary-size: 54px;
  --ebay-controls-size: 42px;
  --ebay-note-size: 40px;
  --ebay-status-size: 42px;
  --ebay-collapse-gap: 8px;
  --ebay-summary-padding-y: 4px;
  --ebay-border-width: 1px;
  --ebay-shift: 0px;
}
.ebay-sheet .ebay-header,
.ebay-sheet .ebay-summary-bar,
.ebay-sheet .ebay-result-controls,
.ebay-sheet .ebay-filter-note,
.ebay-sheet .ebay-status {
  transition: none !important;
  opacity: var(--ebay-reveal);
  transform: translateY(var(--ebay-shift));
  overflow: hidden;
}
.ebay-sheet .ebay-header {
  box-sizing: border-box;
  height: var(--ebay-header-size) !important;
  min-height: 0 !important;
  max-height: var(--ebay-header-size) !important;
  margin-bottom: var(--ebay-collapse-gap) !important;
  padding: 0 2px !important;
}
.ebay-sheet .ebay-query-form {
  margin-bottom: 8px !important;
}
.ebay-sheet .ebay-summary-bar {
  box-sizing: border-box;
  height: var(--ebay-summary-size) !important;
  min-height: 0 !important;
  max-height: var(--ebay-summary-size) !important;
  margin-bottom: var(--ebay-collapse-gap) !important;
  padding: var(--ebay-summary-padding-y) 2px !important;
  border-width: var(--ebay-border-width) !important;
}
.ebay-sheet .ebay-result-controls {
  height: var(--ebay-controls-size) !important;
  min-height: 0 !important;
  max-height: var(--ebay-controls-size) !important;
  margin-bottom: var(--ebay-collapse-gap) !important;
}
.ebay-sheet .ebay-filter-row {
  gap: var(--ebay-collapse-gap) !important;
  margin-bottom: 8px !important;
  transition: none !important;
}
.ebay-sheet .ebay-filter-note {
  height: auto !important;
  min-height: 0 !important;
  max-height: var(--ebay-note-size) !important;
}
.ebay-sheet .ebay-status {
  box-sizing: border-box;
  height: var(--ebay-status-size) !important;
  min-height: 0 !important;
  max-height: var(--ebay-status-size) !important;
  margin-bottom: var(--ebay-collapse-gap) !important;
  padding: 0 !important;
}
.ebay-sheet .ebay-status.success {
  font-size: 9px;
  font-weight: 950;
  letter-spacing: .055em;
}
.ebay-sheet.ebay-collapse-complete .ebay-header,
.ebay-sheet.ebay-collapse-complete .ebay-summary-bar,
.ebay-sheet.ebay-collapse-complete .ebay-result-controls,
.ebay-sheet.ebay-collapse-complete .ebay-filter-note,
.ebay-sheet.ebay-collapse-complete .ebay-status {
  visibility: hidden;
  pointer-events: none;
}
.ebay-sheet.ebay-collapse-complete .ebay-filter-row {
  grid-template-columns: 1fr;
}
.ebay-sheet.ebay-collapse-complete .ebay-filter-controls {
  width: 100%;
}

/* Every main tab uses the same zero-request inline SVG/letter icon frame and
   the same label metrics. No image fetch or icon font is introduced. */
.bottom-nav.five-actions .nav-button {
  min-width: 0;
  min-height: 52px;
  padding: 4px 2px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 1px solid transparent;
}
.bottom-nav.five-actions .nav-button > .nav-icon {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  display: grid !important;
  place-items: center;
  color: currentColor;
  font-size: 16px !important;
  line-height: 1 !important;
  transform-origin: center;
}
.bottom-nav.five-actions .nav-button > .nav-icon svg {
  width: 22px;
  height: 22px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.85;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}
.bottom-nav.five-actions .nav-button > .nav-icon-ebay {
  box-sizing: border-box;
  border: 1.85px solid currentColor;
  border-radius: 50%;
  padding: 0 0 2px;
  font-family: Arial, Helvetica, sans-serif !important;
  font-size: 16px !important;
  font-weight: 1000;
  text-transform: lowercase;
}
.bottom-nav.five-actions .nav-button > b {
  max-width: 100%;
  font-size: 8.25px !important;
  line-height: 1 !important;
  font-weight: 900;
  letter-spacing: .06em !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;
}
.bottom-nav.five-actions .nav-action-button:active .nav-icon-reset {
  transform: rotate(-35deg);
}
@media (max-width: 370px) {
  .bottom-nav.five-actions .nav-button > .nav-icon,
  .bottom-nav.five-actions .nav-button > .nav-icon svg { width: 20px; height: 20px; }
  .bottom-nav.five-actions .nav-button > .nav-icon { flex-basis: 20px; }
  .bottom-nav.five-actions .nav-button > .nav-icon-ebay { font-size: 15px !important; }
  .bottom-nav.five-actions .nav-button > b { font-size: 7.5px !important; letter-spacing: .035em !important; }
}


/* ========================================================================== */
/* HOSM SCOUT BETA 1.9.6.7 — COMPACT FILTER META + UNIFORM SELECT CHEVRONS    */
/* ========================================================================== */
.ebay-filter-meta {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  white-space: nowrap;
}
.ebay-filter-meta .ebay-filter-note {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ebay-filter-meta .ebay-status {
  flex: 0 0 auto;
  display: inline-flex !important;
  align-items: center;
  min-height: 0 !important;
  height: auto !important;
  max-height: none !important;
  margin: 0 !important;
  padding: 0 !important;
  font-size: 7px !important;
  line-height: 1 !important;
  letter-spacing: .035em !important;
  white-space: nowrap;
  text-align: right;
  overflow: visible !important;
  transform: none !important;
}
.ebay-condition-control select,
.ebay-sort-control select {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 30px !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='16' viewBox='0 0 12 16'%3E%3Cpath d='M3 6l3-3 3 3M3 10l3 3 3-3' fill='none' stroke='%23131d31' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 9px center;
  background-size: 10px 14px;
}
@media (max-width: 430px), (min-width: 480px) {
  .ebay-filter-row { grid-template-columns: 1fr !important; gap: 6px !important; }
  .ebay-filter-meta { gap: 6px; }
  .ebay-filter-note { font-size: 8px; letter-spacing: .035em; }
  .ebay-filter-meta .ebay-status { font-size: 6.5px !important; }
  .ebay-condition-control select,
  .ebay-sort-control select {
    padding-right: 28px !important;
    background-position: right 8px center;
  }
}
/* The provider/balance is now part of the filtered-meta line, so it must not
   reserve or animate a second row during scroll collapse. */
.ebay-sheet .ebay-status {
  height: auto !important;
  max-height: none !important;
  margin-bottom: 0 !important;
}
.ebay-sheet.ebay-collapse-complete .ebay-filter-meta,
.ebay-sheet.ebay-collapse-complete .ebay-filter-note,
.ebay-sheet.ebay-collapse-complete .ebay-status {
  display: none !important;
}


/* ========================================================================== */
/* HOSM SCOUT 2.0.0 — PROTECTED BUYER EXECUTION MODE                          */
/* ========================================================================== */
.buyer-decision-card {
  min-height: 430px;
  display: grid;
  grid-template-rows: minmax(220px, 1fr) auto;
  gap: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.buyer-decision-card.buy { border-color: color-mix(in srgb, var(--green) 65%, var(--line)); box-shadow: 0 0 0 1px color-mix(in srgb, var(--green) 20%, transparent), 0 20px 60px color-mix(in srgb, var(--green) 24%, transparent); }
.buyer-decision-card.pass { border-color: color-mix(in srgb, var(--red) 55%, var(--line)); }
.buyer-decision-card.checking { border-color: color-mix(in srgb, var(--blue) 55%, var(--line)); }
.buyer-product-image-button { position: relative; min-height: 220px; border: 0; border-radius: 22px; padding: 0; overflow: hidden; background: #fff; }
.buyer-product-image-button img { width: 100%; height: 100%; min-height: 220px; display: block; object-fit: contain; }
.buyer-image-expand, .buyer-live-image-button > span { position: absolute; right: 10px; bottom: 10px; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; background: rgba(11,18,32,.82); color: #fff; font-size: 15px; font-weight: 900; }
.buyer-decision-copy { text-align: center; }
.buyer-result-kicker { color: var(--ink-soft); font-size: 10px; font-weight: 950; letter-spacing: .15em; }
.buyer-decision-copy h1 { margin: 7px 0 14px; font-size: clamp(48px, 15vw, 76px); line-height: .94; letter-spacing: -.055em; }
.buyer-decision-card.buy h1 { color: var(--green); text-shadow: 0 0 24px color-mix(in srgb, var(--green) 35%, transparent); }
.buyer-decision-card.pass h1 { color: var(--red); }
.buyer-decision-card.checking h1 { color: var(--blue); font-size: clamp(34px, 10vw, 52px); }
.buyer-reward-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.buyer-reward-grid > div { min-height: 84px; display: grid; place-items: center; align-content: center; gap: 5px; border: 1px solid var(--line); border-radius: 17px; background: var(--surface-2); }
.buyer-reward-grid span { color: var(--ink-soft); font-size: 9px; font-weight: 950; letter-spacing: .085em; }
.buyer-reward-grid strong { font-size: clamp(28px, 8.5vw, 42px); line-height: 1; }
body.legacy-buyer-layout #resultView > :not(#buyerDecisionCard) { display: none !important; }
body.legacy-buyer-layout #resultView { display: block; max-width: 520px; margin-inline: auto; }
body.legacy-buyer-layout #resultView.hidden { display: none !important; }
body.legacy-buyer-layout .detail-page-header { display: none; }
body.legacy-buyer-layout .detail-page-shell { padding-top: 16px; }
body.legacy-buyer-layout #ebayTabButton,
body.legacy-buyer-layout #ebayCheckButton,
body.legacy-buyer-layout #aiEbayButton,
body.legacy-buyer-layout #liveNoResultEbayButton { display: none !important; }
.bottom-nav.five-actions.buyer-three-actions { grid-template-columns: repeat(3,minmax(0,1fr)); }

.buyer-live-result { position: absolute; z-index: 34; left: 14px; right: 14px; top: 50%; transform: translateY(-46%); display: grid; grid-template-columns: 122px minmax(0,1fr); gap: 14px; align-items: center; padding: 14px; border: 1px solid rgba(255,255,255,.22); border-radius: 24px; background: rgba(4,10,19,.88); color: #fff; box-shadow: 0 24px 72px rgba(0,0,0,.45); backdrop-filter: blur(18px); }
.buyer-live-result.buy { border-color: color-mix(in srgb, #43c88d 75%, transparent); box-shadow: 0 0 36px rgba(67,200,141,.35), 0 24px 72px rgba(0,0,0,.45); }
.buyer-live-result.pass { border-color: color-mix(in srgb, #ff7272 65%, transparent); }
.buyer-live-image-button { position: relative; width: 122px; height: 122px; border: 0; border-radius: 18px; padding: 0; overflow: hidden; background: #fff; }
.buyer-live-image-button img { width: 100%; height: 100%; object-fit: contain; }
.buyer-live-copy { min-width: 0; display: grid; gap: 7px; }
.buyer-live-copy > small { color: #aab7ca; font-size: 8px; font-weight: 950; letter-spacing: .13em; }
.buyer-live-copy > strong { font-size: clamp(34px, 10vw, 54px); line-height: .92; letter-spacing: -.045em; }
.buyer-live-result.buy .buyer-live-copy > strong { color: #56e6a4; text-shadow: 0 0 22px rgba(67,200,141,.4); }
.buyer-live-result.pass .buyer-live-copy > strong { color: #ff8585; }
.buyer-live-result.checking .buyer-live-copy > strong { color: #7ba8ff; font-size: clamp(24px, 7vw, 34px); }
.buyer-live-copy > div { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; }
.buyer-live-copy > div span { min-width: 0; display: grid; gap: 2px; color: #aab7ca; font-size: 8px; font-weight: 900; letter-spacing: .06em; }
.buyer-live-copy > div b { color: #fff; font-size: clamp(18px, 5vw, 25px); line-height: 1; letter-spacing: -.025em; }
body.legacy-buyer-layout .live-readout,
body.legacy-buyer-layout .live-decision-footer,
body.legacy-buyer-layout .live-variation-note { display: none !important; }
body.legacy-buyer-layout .camera-stage.no-result-active .buyer-live-result { display: grid !important; }

.buyer-match-card .match-copy span { font-size: 11px; }
.legacy-buyer-layout-management { margin-top: 24px; padding-top: 22px; border-top: 1px solid var(--line); }
.legacy-buyer-layout-management .panel-header { margin-bottom: 10px; }
.legacy-buyer-layout-management .panel-header h2 { margin: 3px 0 0; }
.buyer-commission-settings { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.buyer-settings-sheet { overflow: auto; }

.buyer-recent-card { grid-template-columns: 116px minmax(0,1fr); }
.buyer-recent-card .recent-media { min-height: 112px; }
.buyer-recent-reward { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.buyer-recent-reward > div { display: grid; gap: 5px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.buyer-recent-reward span { color: var(--ink-soft); font-size: 8px; font-weight: 950; letter-spacing: .065em; }
.buyer-recent-reward strong { font-size: 23px; line-height: 1; }

@media (prefers-reduced-motion: no-preference) {
  .buyer-decision-card.buy, .buyer-live-result.buy { animation: buyerBuyGlow 1.7s ease-in-out 1; }
}
@keyframes buyerBuyGlow { 0%,100% { filter: brightness(1); } 45% { filter: brightness(1.08); } }
@media (max-width: 380px) {
  .buyer-live-result { grid-template-columns: 98px minmax(0,1fr); gap: 10px; left: 9px; right: 9px; padding: 10px; }
  .buyer-live-image-button { width: 98px; height: 98px; }
  .buyer-commission-settings { grid-template-columns: 1fr; }
}

/* ========================================================================== */
/* HOSM SCOUT 2.0.0 — DESKTOP PHONE-DIMENSION VIEW                            */
/* Mobile and tablet rules above remain untouched. This frame activates only */
/* on pointer-based desktop browsers.                                         */
/* ========================================================================== */
@media (min-width: 480px) {
  :root { --desktop-phone-width: 430px; --desktop-phone-height: min(932px, calc(100dvh - 24px)); }
  html { background: #dfe5ed; }
  body { min-height: 100dvh; overflow: hidden; background: radial-gradient(circle at 20% 10%, rgba(21,94,239,.10), transparent 30%), radial-gradient(circle at 80% 90%, rgba(13,138,85,.08), transparent 28%), #dfe5ed; }
  .app-shell:not(.hidden), .auth-shell:not(.hidden) { position: relative; width: var(--desktop-phone-width); height: var(--desktop-phone-height); min-height: 0; margin: max(12px, calc((100dvh - var(--desktop-phone-height))/2)) auto; overflow: auto; overscroll-behavior: contain; border: 1px solid rgba(17,24,39,.18); border-radius: 34px; background: var(--bg); box-shadow: 0 34px 100px rgba(17,24,39,.28); scrollbar-width: thin; }
  .auth-shell:not(.hidden) { padding: 20px 14px; }
  .auth-card { width: 100%; padding: 28px 22px; }
  .content-frame { width: 100%; max-width: none; padding: 16px 12px 96px; }
  .topbar { border-radius: 34px 34px 0 0; }
  .account-menu { right: calc(50% - 205px); top: calc(max(12px, (100dvh - var(--desktop-phone-height))/2) + 61px); width: 300px; }
  .bottom-nav { left: 50%; top: auto; right: auto; bottom: calc(max(12px, (100dvh - var(--desktop-phone-height))/2) + 10px); transform: translateX(-50%); width: 410px; min-height: 66px; height: auto; grid-auto-flow: column; grid-auto-rows: auto; }
  .floating-scan-button { right: calc(50% - 205px); bottom: calc(max(12px, (100dvh - var(--desktop-phone-height))/2) + 84px); }
  .toast-region { width: 400px; bottom: calc(max(12px, (100dvh - var(--desktop-phone-height))/2) + 90px); }
  .offline-bar { left: 50%; right: auto; top: max(12px, calc((100dvh - var(--desktop-phone-height))/2)); width: var(--desktop-phone-width); transform: translateX(-50%); border-radius: 34px 34px 0 0; }
  .modal, .live-scan-modal, .image-modal, .recent-filter-drawer { inset: 50% auto auto 50% !important; width: var(--desktop-phone-width); height: var(--desktop-phone-height); min-height: 0; transform: translate(-50%,-50%); border-radius: 34px; overflow: hidden; }
  .modal { padding: 10px; }
  .modal-sheet { width: 100%; max-height: 100%; }
  .live-scan-modal { padding: 0 !important; border: 1px solid #2d3a51; }
  .scanner-pager-viewport, .scanner-pager, .scanner-page, .camera-sheet, .live-scan-sheet { width: 100%; height: 100%; max-height: none; }
  .camera-sheet { border: 0; border-radius: 34px; }
  .scanner-page-indicators { bottom: calc(max(12px, (100dvh - var(--desktop-phone-height))/2) + 88px); }
  .image-modal { background: rgba(3,8,16,.96); }
  .recent-filter-drawer { background: rgba(3,8,16,.55); }
  .recent-filter-sheet { position: absolute; inset: auto 0 0; max-height: 82%; }
}

body.legacy-buyer-layout #matchModal .modal-intro,
body.legacy-buyer-layout .buyer-match-card .match-copy { display: none !important; }
body.legacy-buyer-layout .buyer-match-card { grid-template-columns: minmax(0,1fr); }
body.legacy-buyer-layout .buyer-match-card > img { width: 100%; height: 210px; object-fit: contain; }
body.legacy-buyer-layout .buyer-match-card > .button { width: 100%; }

/* HOSM SCOUT 2.0.1 — BUYER PICTURE-ONLY VARIATION CHOOSER */
body.legacy-buyer-layout #aiVariationModal .section-kicker,
body.legacy-buyer-layout #aiFamilyTabs,
body.legacy-buyer-layout #aiSizeFilters,
body.legacy-buyer-layout #aiEbayButton { display: none !important; }
body.legacy-buyer-layout .ai-variation-list { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
body.legacy-buyer-layout .buyer-ai-variation-card { display: grid; grid-template-columns: minmax(0,1fr); gap: 8px; padding: 9px; }
body.legacy-buyer-layout .buyer-ai-image-button { min-height: 154px; border: 0; border-radius: 15px; padding: 0; overflow: hidden; background: #fff; cursor: zoom-in; }
body.legacy-buyer-layout .buyer-ai-image-button img { width: 100%; height: 154px; display: block; object-fit: contain; }
body.legacy-buyer-layout .buyer-ai-variation-card .button { width: 100%; min-height: 42px; }
@media (max-width: 370px) {
  body.legacy-buyer-layout .ai-variation-list { grid-template-columns: 1fr; }
}


/* ========================================================================== */
/* HOSM SCOUT 2.0.1 — SINGLE-PAGE BUYER LIVE SCAN + DESKTOP FRAME REPAIR      */
/* Admin phone geometry remains unchanged. These buyer rules turn the live     */
/* scanner into a compact top-search / camera / bottom-decision workflow.      */
/* ========================================================================== */

/* The wrapper is layout-neutral for Admin, preserving the 2.0.0 camera DOM. */
.buyer-camera-window { display: contents; }

body.legacy-buyer-layout .live-scan-header { display: none !important; }
body.legacy-buyer-layout .live-scan-sheet {
  grid-template-rows: minmax(0, 1fr) auto !important;
  background: #050912;
}
body.legacy-buyer-layout .live-camera-stage {
  display: grid;
  grid-template-rows: auto minmax(180px, 1fr) auto;
  gap: 8px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 0;
  padding: max(7px, env(safe-area-inset-top, 0px)) 8px 8px;
  overflow: hidden;
  background: #050912;
  touch-action: manipulation;
}
body.legacy-buyer-layout .live-camera-stage::after { display: none !important; }
body.legacy-buyer-layout .live-camera-stage > * { min-width: 0; max-width: 100%; }
body.legacy-buyer-layout .live-upc-entry {
  position: relative !important;
  z-index: 40;
  top: auto !important;
  left: auto !important;
  right: auto !important;
  grid-row: 1;
  min-height: 52px;
  margin: 0;
  padding: 6px 7px !important;
  border-radius: 16px;
  background: rgba(3, 8, 17, .98);
  box-shadow: 0 6px 20px rgba(0, 0, 0, .26);
}
body.legacy-buyer-layout .live-upc-input-wrap input,
body.legacy-buyer-layout .live-upc-input-wrap button { height: 40px; }
body.legacy-buyer-layout .live-upc-input-wrap input { font-size: 18px; }
body.legacy-buyer-layout .buyer-camera-window {
  position: relative;
  grid-row: 2;
  display: block;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  isolation: isolate;
  border: 1px solid #2e3b51;
  border-radius: 20px;
  background: #000;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.025);
}
body.legacy-buyer-layout .buyer-camera-window::after {
  content: "";
  position: absolute;
  z-index: 2;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(to bottom, rgba(0,0,0,.18), rgba(0,0,0,.02) 48%, rgba(0,0,0,.24));
}
body.legacy-buyer-layout .buyer-camera-window > video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
body.legacy-buyer-layout .mode-barcode .live-camera-frame {
  top: 15% !important;
  bottom: 17% !important;
  left: 6% !important;
  right: 6% !important;
}
body.legacy-buyer-layout .mode-ai .live-camera-frame.ai-tag-frame {
  top: 34% !important;
  bottom: 34% !important;
  left: 7% !important;
  right: 7% !important;
}

/* Buyer accounts use only the live scanner. The Admin swipe/detail workflow remains intact. */
body.legacy-buyer-layout #detailScanPage,
body.legacy-buyer-layout .scanner-page-indicators { display: none !important; }
body.legacy-buyer-layout #scannerPager {
  width: 100% !important;
  transform: none !important;
  transition: none !important;
}
body.legacy-buyer-layout #liveScanPage {
  flex: 0 0 100% !important;
  width: 100% !important;
}
body.legacy-buyer-layout.scanner-detail-open { overflow: hidden; }

/* Bottom buyer decision surface. */
body.legacy-buyer-layout .buyer-live-result {
  position: relative;
  z-index: 34;
  left: auto;
  right: auto;
  top: auto;
  grid-row: 3;
  transform: none;
  min-width: 0;
  min-height: 154px;
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
  margin: 0;
  padding: 12px;
  border-radius: 22px;
  background: rgba(4, 10, 19, .98);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: 0 12px 30px rgba(0,0,0,.34);
}
body.legacy-buyer-layout .buyer-live-result.buy {
  border-color: rgba(67, 200, 141, .78);
  box-shadow: 0 0 24px rgba(67,200,141,.18), 0 12px 30px rgba(0,0,0,.34);
}
body.legacy-buyer-layout .buyer-live-image-button {
  width: 112px;
  height: 100%;
  min-height: 130px;
  align-self: stretch;
  border-radius: 16px;
  cursor: zoom-in;
}
body.legacy-buyer-layout .buyer-live-copy {
  display: grid;
  grid-template-rows: auto minmax(42px, 1fr) auto;
  gap: 7px;
  min-width: 0;
}
body.legacy-buyer-layout .buyer-live-heading {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}
body.legacy-buyer-layout .buyer-live-signal {
  min-width: 0;
  display: grid;
  gap: 2px;
}
body.legacy-buyer-layout .buyer-live-signal small,
body.legacy-buyer-layout .buyer-live-commission span,
body.legacy-buyer-layout .buyer-live-max span {
  color: #aab7ca;
  font-size: 8px;
  line-height: 1;
  font-weight: 950;
  letter-spacing: .1em;
}
body.legacy-buyer-layout .buyer-live-signal strong {
  color: #7ba8ff;
  font-size: clamp(30px, 8vw, 44px);
  line-height: .92;
  letter-spacing: -.045em;
}
body.legacy-buyer-layout .buyer-live-result.buy .buyer-live-signal strong {
  color: #56e6a4;
  text-shadow: 0 0 16px rgba(67,200,141,.32);
}
body.legacy-buyer-layout .buyer-live-result.pass .buyer-live-signal strong { color: #ff8585; }
body.legacy-buyer-layout .buyer-live-result.checking .buyer-live-signal strong {
  color: #7ba8ff;
  font-size: clamp(22px, 6vw, 31px);
}
body.legacy-buyer-layout .buyer-live-commission {
  min-width: 92px;
  display: grid;
  justify-items: end;
  align-content: center;
  gap: 3px;
  padding: 7px 9px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 12px;
  background: rgba(255,255,255,.055);
}
body.legacy-buyer-layout .buyer-live-commission b {
  color: #fff;
  font-size: clamp(24px, 6.8vw, 34px);
  line-height: 1;
  letter-spacing: -.035em;
  font-variant-numeric: tabular-nums;
}
body.legacy-buyer-layout .buyer-live-result.buy .buyer-live-commission {
  border-color: rgba(86,230,164,.34);
  background: rgba(18,91,61,.28);
}
body.legacy-buyer-layout .buyer-live-result.buy .buyer-live-commission span,
body.legacy-buyer-layout .buyer-live-result.buy .buyer-live-commission b {
  color: #68efaf;
  text-shadow: 0 0 14px rgba(67,200,141,.34);
}
body.legacy-buyer-layout .buyer-live-description {
  min-width: 0;
  min-height: 42px;
  margin: 0;
  padding: 7px 9px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 11px;
  background: rgba(255,255,255,.045);
  color: #e9eef7;
  font-size: 10px;
  line-height: 1.26;
  font-weight: 760;
  letter-spacing: .005em;
}
body.legacy-buyer-layout .buyer-live-max {
  min-height: 31px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 0 2px;
}
body.legacy-buyer-layout .buyer-live-max b {
  color: #fff;
  font-size: clamp(22px, 6.2vw, 31px);
  line-height: 1;
  letter-spacing: -.035em;
  font-variant-numeric: tabular-nums;
}

@media (prefers-reduced-motion: no-preference) {
  body.legacy-buyer-layout .buyer-live-result.buy .buyer-live-commission b {
    animation: buyerCommissionGlow201 1.65s ease-out 1;
  }
}
@keyframes buyerCommissionGlow201 {
  0%, 100% { filter: brightness(1); text-shadow: 0 0 14px rgba(67,200,141,.34); }
  48% { filter: brightness(1.12); text-shadow: 0 0 22px rgba(67,200,141,.52); }
}

@media (max-width: 380px) {
  body.legacy-buyer-layout .live-camera-stage { grid-template-rows: auto minmax(160px, 1fr) auto; gap: 6px; padding-inline: 6px; }
  body.legacy-buyer-layout .buyer-live-result { grid-template-columns: 94px minmax(0,1fr); gap: 9px; min-height: 142px; padding: 9px; }
  body.legacy-buyer-layout .buyer-live-image-button { width: 94px; min-height: 120px; }
  body.legacy-buyer-layout .buyer-live-commission { min-width: 80px; padding-inline: 7px; }
  body.legacy-buyer-layout .buyer-live-description { -webkit-line-clamp: 2; font-size: 9px; }
}
@media (max-height: 740px) {
  body.legacy-buyer-layout .live-camera-stage { grid-template-rows: auto minmax(145px, 1fr) auto; gap: 6px; padding-block: 5px; }
  body.legacy-buyer-layout .live-upc-entry { min-height: 46px; padding-block: 4px !important; }
  body.legacy-buyer-layout .live-upc-input-wrap input,
  body.legacy-buyer-layout .live-upc-input-wrap button { height: 36px; }
  body.legacy-buyer-layout .buyer-live-result { min-height: 132px; padding-block: 8px; }
  body.legacy-buyer-layout .buyer-live-image-button { min-height: 112px; }
  body.legacy-buyer-layout .buyer-live-description { min-height: 34px; -webkit-line-clamp: 2; }
}

/* Keep the existing lightbox behavior while making its close affordance and
   image bounds reliable inside the desktop phone frame. */
body.legacy-buyer-layout .image-modal { z-index: 900; cursor: zoom-out; }
body.legacy-buyer-layout .image-stage { width: 100%; min-width: 0; }
body.legacy-buyer-layout .image-stage img { cursor: default; }

/* Desktop 2.0.0 accidentally forced the two-page scanner pager to 100% wide,
   revealing the Live and Detail pages side-by-side. Restore the intended 200%
   pager for Admin and a single 100% page for buyers. */
@media (min-width: 480px) {
  .app-shell:not(.hidden) {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    overflow: hidden;
  }
  .app-shell:not(.hidden) .content-frame {
    min-height: 0;
    height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
  }
  .live-scan-modal {
    inset: max(12px, calc((100dvh - var(--desktop-phone-height)) / 2)) auto auto 50% !important;
    height: calc(var(--desktop-phone-height) - 82px) !important;
    transform: translateX(-50%) !important;
  }
  .scanner-pager-viewport { width: 100% !important; height: 100% !important; min-width: 0; }
  .scanner-pager { width: 200% !important; height: 100% !important; min-width: 0; }
  .scanner-page { flex: 0 0 50% !important; width: 50% !important; height: 100% !important; }
  body.legacy-buyer-layout .scanner-pager { width: 100% !important; transform: none !important; }
  body.legacy-buyer-layout .scanner-page { flex: 0 0 100% !important; width: 100% !important; }
  .camera-sheet,
  .live-scan-sheet { min-width: 0; }
  .image-modal { padding: 14px; }
  .image-stage { width: 100%; max-width: 100%; max-height: 100%; }
  .image-stage img { max-width: 100%; max-height: calc(100% - 52px); }
}

/* HOSM SCOUT 2.0.1 — FINAL DESKTOP GRID CONTAINMENT
   Grid items default to min-width:auto, which lets the scanner's intrinsic
   content widen beyond the 430px phone frame. Explicitly zero that minimum
   and bind the scanner tree to the frame. */
@media (min-width: 480px) {
  #cameraModal,
  #scannerPagerViewport,
  #liveScanPage,
  #detailScanPage,
  .camera-sheet,
  .live-scan-sheet,
  .live-camera-stage,
  .buyer-camera-window {
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
  #scannerPager {
    min-width: 0 !important;
    max-width: none !important;
    box-sizing: border-box !important;
  }
  .live-camera-stage {
    width: 100% !important;
    justify-self: stretch !important;
    overflow: hidden !important;
  }
  body.legacy-buyer-layout .live-upc-entry,
  body.legacy-buyer-layout .buyer-camera-window,
  body.legacy-buyer-layout .buyer-live-result {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }
  body.legacy-buyer-layout .live-upc-input-wrap,
  body.legacy-buyer-layout .buyer-live-copy,
  body.legacy-buyer-layout .buyer-live-heading,
  body.legacy-buyer-layout .buyer-live-description,
  body.legacy-buyer-layout .buyer-live-max {
    min-width: 0 !important;
    max-width: 100% !important;
  }
}


/* ========================================================================== */
/* HOSM SCOUT 2.0.4 — BUYER SOURCE-PRICE CONFIRMATION                        */
/* Buyer-only controls. Admin smartphone and desktop sourcing layouts remain  */
/* on the 2.0.1 baseline.                                                      */
/* ========================================================================== */

body:not(.legacy-buyer-layout) #buyerSourcePriceControl { display: none !important; }

body.legacy-buyer-layout .live-camera-stage {
  grid-template-rows: auto minmax(150px, 1fr) auto auto;
}

body.legacy-buyer-layout .buyer-live-result { grid-row: 3; }

body.legacy-buyer-layout .buyer-live-copy {
  grid-template-rows: auto minmax(42px, 1fr) auto;
}

body.legacy-buyer-layout .buyer-live-result.unconfirmed {
  border-color: rgba(123, 168, 255, .44);
  box-shadow: 0 10px 26px rgba(0,0,0,.31);
}
body.legacy-buyer-layout .buyer-live-result.unconfirmed .buyer-live-signal strong {
  color: #a9c3f5;
  font-size: clamp(25px, 6.5vw, 35px);
  text-shadow: none;
}
body.legacy-buyer-layout .buyer-live-result.unconfirmed .buyer-live-commission {
  border-color: rgba(255,255,255,.10);
  background: rgba(255,255,255,.04);
}
body.legacy-buyer-layout .buyer-live-result.unconfirmed .buyer-live-commission b { color: #7d899c; text-shadow: none; }

body.legacy-buyer-layout .buyer-live-price-status {
  min-height: 29px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 8px;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 10px;
  background: rgba(255,255,255,.045);
  color: #aab7ca;
  font-size: 8px;
  line-height: 1.15;
  font-weight: 950;
  letter-spacing: .085em;
  text-align: center;
}
body.legacy-buyer-layout .buyer-live-result.buy .buyer-live-price-status {
  border-color: rgba(86,230,164,.28);
  color: #68efaf;
  background: rgba(18,91,61,.18);
}
body.legacy-buyer-layout .buyer-live-result.pass .buyer-live-price-status {
  border-color: rgba(255,133,133,.22);
  color: #ffb0b0;
  background: rgba(120,28,32,.18);
}

body.legacy-buyer-layout .buyer-source-price-control {
  position: relative;
  z-index: 36;
  grid-row: 4;
  display: grid;
  gap: 6px;
  min-width: 0;
  margin: 0;
  padding: 8px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 18px;
  background: rgba(8,14,25,.98);
  box-shadow: 0 8px 24px rgba(0,0,0,.28);
  user-select: none;
  -webkit-user-select: none;
}
body.legacy-buyer-layout .buyer-source-price-control.hidden { display: none !important; }
body.legacy-buyer-layout .buyer-source-price-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 4px;
}
body.legacy-buyer-layout .buyer-source-price-header span,
body.legacy-buyer-layout .buyer-source-price-header small {
  font-size: 8px;
  line-height: 1;
  font-weight: 950;
  letter-spacing: .1em;
}
body.legacy-buyer-layout .buyer-source-price-header span { color: #e8eef8; }
body.legacy-buyer-layout .buyer-source-price-header small { color: #9ba8ba; }
body.legacy-buyer-layout .buyer-source-price-control.confirmed .buyer-source-price-header small { color: #68efaf; }
body.legacy-buyer-layout .buyer-source-price-control.checking .buyer-source-price-header small { color: #7ba8ff; }

body.legacy-buyer-layout .buyer-price-stepper {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) 64px;
  gap: 7px;
  min-width: 0;
}
body.legacy-buyer-layout .buyer-price-step-button,
body.legacy-buyer-layout .buyer-price-confirm-button {
  min-width: 0;
  height: 58px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 13px;
  font: inherit;
  -webkit-tap-highlight-color: transparent;
}
body.legacy-buyer-layout .buyer-price-step-button {
  display: grid;
  place-content: center;
  gap: 1px;
  background: #182131;
  color: #fff;
  touch-action: manipulation;
}
body.legacy-buyer-layout .buyer-price-step-button:active { transform: scale(.975); background: #222f43; }
body.legacy-buyer-layout .buyer-price-step-button b { font-size: 26px; line-height: .8; }
body.legacy-buyer-layout .buyer-price-step-button small { color: #aeb9c9; font-size: 8px; font-weight: 900; letter-spacing: .06em; }

body.legacy-buyer-layout .buyer-price-confirm-button {
  display: grid;
  place-content: center;
  gap: 2px;
  padding: 4px 10px;
  overflow: hidden;
  background: #c8cdd5;
  color: #202938;
  cursor: pointer;
  touch-action: none;
}
body.legacy-buyer-layout .buyer-price-confirm-button small {
  color: #4d5868;
  font-size: 7px;
  line-height: 1;
  font-weight: 950;
  letter-spacing: .105em;
}
body.legacy-buyer-layout .buyer-price-confirm-button strong {
  font-size: clamp(31px, 8vw, 40px);
  line-height: .95;
  font-weight: 1000;
  letter-spacing: -.045em;
  font-variant-numeric: tabular-nums;
}
body.legacy-buyer-layout .buyer-price-confirm-button .price-before-tax {
  color: #5d6878;
  font-size: 6.5px;
  line-height: 1;
  font-weight: 950;
  letter-spacing: .11em;
}
body.legacy-buyer-layout .buyer-source-price-control.confirmed .buyer-price-confirm-button .price-before-tax { color: #d9e1ec; }
body.legacy-buyer-layout .buyer-source-price-control.confirmed .buyer-price-confirm-button {
  border-color: #090b0f;
  background: #05070b;
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.08);
}
body.legacy-buyer-layout .buyer-source-price-control.confirmed .buyer-price-confirm-button small { color: #68efaf; }
body.legacy-buyer-layout .buyer-source-price-control.checking .buyer-price-confirm-button { opacity: .72; }

body.legacy-buyer-layout #buyerPriceHint {
  margin: 0;
  color: #7f8da1;
  font-size: 7px;
  line-height: 1.1;
  font-weight: 850;
  letter-spacing: .045em;
  text-align: center;
}

@media (max-width: 380px) {
  body.legacy-buyer-layout .live-camera-stage { grid-template-rows: auto minmax(132px, 1fr) auto auto; }
  body.legacy-buyer-layout .buyer-price-stepper { grid-template-columns: 56px minmax(0,1fr) 56px; gap: 6px; }
  body.legacy-buyer-layout .buyer-price-step-button,
  body.legacy-buyer-layout .buyer-price-confirm-button { height: 54px; }
  body.legacy-buyer-layout .buyer-source-price-control { padding: 7px; gap: 5px; }
}

@media (max-height: 740px) {
  body.legacy-buyer-layout .live-camera-stage { grid-template-rows: auto minmax(120px, 1fr) auto auto; gap: 5px; }
  body.legacy-buyer-layout .buyer-live-result { min-height: 124px; }
  body.legacy-buyer-layout .buyer-live-image-button { min-height: 106px; }
  body.legacy-buyer-layout .buyer-source-price-control { gap: 4px; padding: 6px 7px; }
  body.legacy-buyer-layout .buyer-price-step-button,
  body.legacy-buyer-layout .buyer-price-confirm-button { height: 50px; }
  body.legacy-buyer-layout #buyerPriceHint { display: none; }
}

@media (min-width: 480px) {
  body.legacy-buyer-layout .buyer-source-price-control,
  body.legacy-buyer-layout .buyer-price-stepper,
  body.legacy-buyer-layout .buyer-price-confirm-button {
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
}


/* HOSM SCOUT 2.0.4 — secure buyer confirmation states */
body.legacy-buyer-layout .buyer-source-price-control.error .buyer-price-confirm-button {
  border-color: rgba(255, 151, 151, .62);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.05), 0 0 0 2px rgba(195, 55, 63, .12);
}
body.legacy-buyer-layout .buyer-source-price-control.error .buyer-source-price-header small,
body.legacy-buyer-layout .buyer-source-price-control.error .buyer-price-confirm-button small { color: #ffaaaa; }
body.legacy-buyer-layout .buyer-live-result.checking .buyer-live-signal strong { font-size: clamp(21px, 5.8vw, 31px); }
body.legacy-buyer-layout .buyer-price-step-button,
body.legacy-buyer-layout .buyer-price-confirm-button { -webkit-touch-callout: none; }


/* ========================================================================== */
/* HOSM SCOUT 2.1.7 — COMPACT ADMIN SOURCE-PRICE TOGGLE                      */
/* The buyer control remains unchanged. Full-mode/Admin gets the same thumb  */
/* gestures in a one-row strip between the camera and scan controls.         */
/* ========================================================================== */

body.legacy-buyer-layout #adminSourcePriceControl { display: none !important; }
body:not(.legacy-buyer-layout) .live-scan-sheet {
  grid-template-rows: auto minmax(0, 1fr) auto auto;
}
body:not(.legacy-buyer-layout) .admin-source-price-control {
  position: relative;
  z-index: 40;
  min-width: 0;
  min-height: 52px;
  display: grid;
  grid-template-columns: minmax(74px, .72fr) minmax(0, 2.28fr);
  align-items: center;
  gap: 7px;
  padding: 4px max(9px, env(safe-area-inset-right)) 4px max(9px, env(safe-area-inset-left));
  border-top: 1px solid #273349;
  background: #0b1220;
  color: #fff;
  user-select: none;
  -webkit-user-select: none;
}
body:not(.legacy-buyer-layout) .admin-source-price-control.hidden { display: none !important; }
body:not(.legacy-buyer-layout) .admin-source-price-control:not(.hidden) + .live-camera-controls { border-top: 0; }
body:not(.legacy-buyer-layout) .admin-source-price-label {
  min-width: 0;
  display: grid;
  gap: 3px;
  align-content: center;
  padding-left: 2px;
}
body:not(.legacy-buyer-layout) .admin-source-price-label b,
body:not(.legacy-buyer-layout) .admin-source-price-label small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1;
  font-weight: 950;
  letter-spacing: .085em;
}
body:not(.legacy-buyer-layout) .admin-source-price-label b { color: #eef4ff; font-size: 8px; }
body:not(.legacy-buyer-layout) .admin-source-price-label small { color: #8f9db0; font-size: 6.5px; }
body:not(.legacy-buyer-layout) .admin-price-taxed-value { color: #b7c3d4; font-size: 6px; line-height: 1; font-weight: 900; letter-spacing: .04em; white-space: nowrap; }
body:not(.legacy-buyer-layout) .admin-price-taxed-value.hidden { display: none !important; }
body:not(.legacy-buyer-layout) .admin-source-price-control.confirmed .admin-source-price-label small { color: #68efaf; }
body:not(.legacy-buyer-layout) .admin-price-stepper {
  min-width: 0;
  display: grid;
  grid-template-columns: 46px minmax(84px, 1fr) 46px;
  gap: 5px;
}
body:not(.legacy-buyer-layout) .admin-price-step-button,
body:not(.legacy-buyer-layout) .admin-price-confirm-button {
  min-width: 0;
  height: 44px;
  border: 1px solid #34435b;
  border-radius: 10px;
  font: inherit;
  -webkit-tap-highlight-color: transparent;
}
body:not(.legacy-buyer-layout) .admin-price-step-button {
  display: grid;
  place-content: center;
  gap: 0;
  padding: 0;
  background: #151f31;
  color: #fff;
  touch-action: manipulation;
}
body:not(.legacy-buyer-layout) .admin-price-step-button:active { transform: scale(.975); background: #202d42; }
body:not(.legacy-buyer-layout) .admin-price-step-button b { font-size: 21px; line-height: .78; }
body:not(.legacy-buyer-layout) .admin-price-step-button small { color: #a9b5c7; font-size: 6px; line-height: 1; font-weight: 900; }
body:not(.legacy-buyer-layout) .admin-price-confirm-button {
  display: grid;
  place-content: center;
  gap: 1px;
  padding: 2px 8px;
  overflow: hidden;
  background: #c8cdd5;
  color: #202938;
  cursor: pointer;
  touch-action: none;
}
body:not(.legacy-buyer-layout) .admin-price-confirm-button small {
  color: #4d5868;
  font-size: 6px;
  line-height: 1;
  font-weight: 950;
  letter-spacing: .1em;
}
body:not(.legacy-buyer-layout) .admin-price-confirm-button strong {
  font-size: clamp(21px, 6vw, 27px);
  line-height: .93;
  font-weight: 1000;
  letter-spacing: -.045em;
  font-variant-numeric: tabular-nums;
}
body:not(.legacy-buyer-layout) .admin-price-confirm-button .price-before-tax {
  color: #5b6574;
  font-size: 5.5px;
  line-height: 1;
  font-weight: 950;
  letter-spacing: .11em;
}
body:not(.legacy-buyer-layout) .admin-source-price-control.confirmed .admin-price-confirm-button .price-before-tax { color: #d9e1ec; }
body:not(.legacy-buyer-layout) .admin-source-price-control.confirmed .admin-price-confirm-button {
  border-color: #05070b;
  background: #05070b;
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.08);
}
body:not(.legacy-buyer-layout) .admin-source-price-control.confirmed .admin-price-confirm-button small { color: #68efaf; }

/* Recover most of the added strip height by tightening non-buyer chrome, not data. */
body:not(.legacy-buyer-layout) .live-scan-header {
  min-height: 50px;
  padding-top: max(5px, env(safe-area-inset-top));
  padding-bottom: 5px;
}
body:not(.legacy-buyer-layout) .live-camera-controls {
  min-height: 74px;
  gap: 8px !important;
  padding: 6px max(10px, env(safe-area-inset-right)) calc(6px + env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
}
body:not(.legacy-buyer-layout) .compact-camera-tools { gap: 4px; }
body:not(.legacy-buyer-layout) .scan-action-group.dual-mode-actions { gap: 8px; margin-right: 0; }

@media (max-width: 380px) {
  body:not(.legacy-buyer-layout) .admin-source-price-control {
    grid-template-columns: 70px minmax(0, 1fr);
    gap: 5px;
    padding-inline: 7px;
  }
  body:not(.legacy-buyer-layout) .admin-price-stepper { grid-template-columns: 43px minmax(76px, 1fr) 43px; gap: 4px; }
  body:not(.legacy-buyer-layout) .admin-price-step-button,
  body:not(.legacy-buyer-layout) .admin-price-confirm-button { height: 42px; }
}

@media (max-height: 740px) {
  body:not(.legacy-buyer-layout) .admin-source-price-control { min-height: 48px; padding-block: 3px; }
  body:not(.legacy-buyer-layout) .admin-price-step-button,
  body:not(.legacy-buyer-layout) .admin-price-confirm-button { height: 42px; }
  body:not(.legacy-buyer-layout) .live-camera-controls { min-height: 70px; padding-block: 5px; }
}


/* ========================================================================== */
/* HOSM SCOUT 2.1.7 — STRUCTURAL ADMIN RESULT LAYOUT                         */
/* The Admin result rows now occupy dedicated grid tracks. Scanner guidance  */
/* stays inside the camera lane and is removed after a valid result. Buyer   */
/* execution mode is intentionally untouched.                                */
/* ========================================================================== */

body:not(.legacy-buyer-layout) .live-camera-stage {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto minmax(118px, 1fr) auto auto auto;
  align-content: stretch;
  gap: 7px;
  padding: 8px 8px 5px;
  box-sizing: border-box;
  isolation: isolate;
}
body:not(.legacy-buyer-layout) .live-camera-stage::after { z-index: 1; }
body:not(.legacy-buyer-layout) .buyer-camera-window { display: contents; }
body:not(.legacy-buyer-layout) .buyer-camera-window > video {
  position: absolute;
  z-index: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
body:not(.legacy-buyer-layout) .buyer-camera-window > canvas { position: absolute; }

body:not(.legacy-buyer-layout) .live-readout {
  position: relative !important;
  z-index: 8;
  left: auto !important;
  right: auto !important;
  top: auto !important;
  bottom: auto !important;
  width: 100%;
  margin: 0;
}
body:not(.legacy-buyer-layout) .live-readout-top { grid-row: 1; }
body:not(.legacy-buyer-layout) .live-upc-entry {
  position: relative !important;
  z-index: 12;
  grid-row: 2;
  top: auto !important;
  left: auto !important;
  right: auto !important;
  width: 100%;
  min-height: 44px;
  margin: 0;
  box-sizing: border-box;
}

body:not(.legacy-buyer-layout) .live-camera-frame {
  position: relative !important;
  z-index: 5;
  grid-row: 3;
  grid-column: 1;
  inset: auto !important;
  top: auto !important;
  right: auto !important;
  bottom: auto !important;
  left: auto !important;
  width: auto;
  height: auto;
  min-height: 112px;
  margin: 1px 7%;
  align-self: stretch;
  justify-self: stretch;
  border-width: 3px;
  box-shadow: none;
}
body:not(.legacy-buyer-layout) .mode-barcode .live-camera-frame {
  top: auto !important;
  bottom: auto !important;
  left: auto !important;
  right: auto !important;
}
body:not(.legacy-buyer-layout) .mode-ai .live-camera-frame.ai-tag-frame,
body:not(.legacy-buyer-layout) .live-camera-frame.tag-frame {
  top: auto !important;
  right: auto !important;
  bottom: auto !important;
  left: auto !important;
  min-height: 66px;
  height: 42%;
  margin-inline: 6%;
  align-self: center;
}
body:not(.legacy-buyer-layout) .camera-diagnostic-status {
  position: relative !important;
  z-index: 13;
  grid-row: 3;
  grid-column: 1;
  top: auto !important;
  left: auto !important;
  right: auto !important;
  bottom: auto !important;
  width: min(94%, 430px);
  margin: 0 auto 8px;
  transform: none !important;
  align-self: end;
  justify-self: center;
}
body:not(.legacy-buyer-layout) .camera-stage.result-ready .camera-diagnostic-status {
  display: none !important;
}

body:not(.legacy-buyer-layout) .live-readout-bottom {
  grid-row: 4;
  margin-top: 3px;
  pointer-events: auto;
}
body:not(.legacy-buyer-layout) .live-readout-bottom .live-data-cell {
  min-height: 84px !important;
  padding-block: 8px !important;
}
body:not(.legacy-buyer-layout) .live-variation-note {
  position: relative !important;
  z-index: 8;
  grid-row: 5;
  left: auto !important;
  right: auto !important;
  bottom: auto !important;
  width: 100%;
  margin: 0;
  transform: none !important;
  box-sizing: border-box;
}
body:not(.legacy-buyer-layout) .live-decision-footer {
  position: relative !important;
  z-index: 8;
  grid-row: 6;
  left: auto !important;
  right: auto !important;
  bottom: auto !important;
  width: 100%;
  margin: 0;
  box-sizing: border-box;
}
body:not(.legacy-buyer-layout) .live-decision-footer > span:not(.buyer-commission-pill) {
  min-height: 36px !important;
  padding-block: 7px !important;
}

/* A no-result overlay remains centered in the camera lane, while hidden data */
/* rows retain the stable geometry needed to prevent the scanner from jumping. */
body:not(.legacy-buyer-layout) .no-result-panel {
  top: 50% !important;
  bottom: auto !important;
  transform: translate(-50%, -50%) !important;
}

@media (max-width: 390px) {
  body:not(.legacy-buyer-layout) .live-camera-stage {
    grid-template-rows: auto auto minmax(104px, 1fr) auto auto auto;
    gap: 6px;
    padding-inline: 7px;
  }
  body:not(.legacy-buyer-layout) .live-camera-frame { margin-inline: 7.5%; min-height: 104px; }
  body:not(.legacy-buyer-layout) .live-readout-bottom .live-data-cell { min-height: 80px !important; }
}

@media (max-height: 740px) {
  body:not(.legacy-buyer-layout) .live-camera-stage {
    grid-template-rows: auto auto minmax(88px, 1fr) auto auto auto;
    gap: 5px;
    padding-block: 6px 4px;
  }
  body:not(.legacy-buyer-layout) .live-camera-frame { min-height: 88px; margin-block: 0; }
  body:not(.legacy-buyer-layout) .live-readout-bottom .live-data-cell { min-height: 76px !important; padding-block: 6px !important; }
  body:not(.legacy-buyer-layout) .live-decision-footer > span:not(.buyer-commission-pill) { min-height: 32px !important; padding-block: 5px !important; }
}

/* Keep the active barcode target wide and shallow while the dedicated camera */
/* grid row continues to absorb the remaining vertical room. */
body:not(.legacy-buyer-layout) .mode-barcode .live-camera-frame {
  min-height: 0;
  height: auto;
  aspect-ratio: 1.82 / 1;
  align-self: center;
}


/* HOSM SCOUT 2.1.7 — before-tax shelf price and estimated purchase tax */
.cost-tax-hint { margin: 8px 0 0; color: var(--muted); font-size: 10px; line-height: 1.35; font-weight: 800; letter-spacing: .035em; }

/* 2.1.1 long-press default: suppress native touch callout on Admin center price. */
body:not(.legacy-buyer-layout) .admin-price-confirm-button { -webkit-touch-callout: none; }

/* HOSM Scout 2.1.7 */
.hosm-price-outlier-warning{grid-column:1/-1;margin-top:4px;padding:5px 8px;border:1px solid rgba(245,158,11,.72);border-radius:10px;background:rgba(245,158,11,.14);color:#fbbf24;font-size:10px;font-weight:900;letter-spacing:.055em;line-height:1.18;text-align:center;white-space:normal}
.weak-bsr-clearance-settings{margin:12px 0;padding:12px;border:1px solid rgba(37,99,235,.25);border-radius:16px;background:rgba(37,99,235,.045)}
.weak-bsr-clearance-settings .settings-section-label{font-size:12px;font-weight:900;letter-spacing:.08em;margin-bottom:9px}
.weak-bsr-grid{display:grid;grid-template-columns:1fr 1fr;gap:9px}.weak-bsr-grid label{position:relative;display:grid;gap:5px}.weak-bsr-grid span{font-size:9px;font-weight:850;line-height:1.25}.weak-bsr-grid input{width:100%;min-height:44px;padding:9px 28px 9px 10px;border-radius:12px}.weak-bsr-grid b{position:absolute;right:10px;bottom:13px;font-size:11px}.weak-bsr-clearance-settings small{display:block;margin-top:8px;font-size:9px;line-height:1.35;opacity:.72}
.camera-profile-setting{display:grid;gap:7px;margin:10px 0;padding:11px;border:1px solid rgba(148,163,184,.28);border-radius:14px}.camera-profile-setting>span{font-size:11px;font-weight:900;letter-spacing:.08em}.camera-profile-setting select{min-height:44px;border-radius:12px;padding:0 12px;font-weight:800}.camera-profile-setting small{font-size:9px;opacity:.72}
@media(max-width:370px){.weak-bsr-grid{grid-template-columns:1fr}.hosm-price-outlier-warning{font-size:9px}}

/* HOSM Scout 2.1.7 — native weak-BSR clearance controls */
.weak-bsr-clearance-settings .weak-bsr-settings-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.weak-bsr-clearance-settings .settings-note { margin-top: 10px; }
@media (max-width: 370px) { .weak-bsr-clearance-settings .weak-bsr-settings-grid { grid-template-columns: 1fr; } }


/* HOSM Scout 2.1.8 — keep NO RESULT explanation below scanner diagnostic.
   Admin only: preserve the camera target for the next barcode. */
body:not(.legacy-buyer-layout) .camera-stage.no-result-active .no-result-panel {
  position: relative !important;
  z-index: 14;
  grid-row: 4;
  grid-column: 1;
  top: auto !important;
  right: auto !important;
  bottom: auto !important;
  left: auto !important;
  width: min(94%, 430px) !important;
  margin: 0 auto !important;
  transform: none !important;
  align-self: start;
  justify-self: center;
  pointer-events: none;
}
body:not(.legacy-buyer-layout) .camera-stage.no-result-active .live-readout-bottom {
  display: none !important;
}
body:not(.legacy-buyer-layout) .camera-stage.no-result-active .live-variation-note,
body:not(.legacy-buyer-layout) .camera-stage.no-result-active .live-decision-footer {
  display: none !important;
}
@media (max-height: 740px) {
  body:not(.legacy-buyer-layout) .camera-stage.no-result-active .no-result-panel {
    padding: 10px 12px;
    gap: 4px;
  }
}
