/* Thrift mode: one hand, bright store lights, big targets. */
.scan-page main { max-width: 520px; }
.scan-title { font-size: 1.6rem; margin: 4px 0 12px; }
.scan-big, .scan-page .scan-big.scan-big { width: 100%; min-height: 52px; font-size: 1.1rem; }
.scan-page input { font-size: 1.1rem; min-height: 48px; }

.camera { position: relative; border-radius: var(--radius); overflow: hidden; background: #000; margin: 8px 0 12px; aspect-ratio: 4 / 3; }
.camera video { width: 100%; height: 100%; object-fit: cover; display: block; }
.camera .aim { position: absolute; left: 10%; right: 10%; top: 38%; height: 24%; border: 3px solid rgba(255, 255, 255, 0.85); border-radius: 10px; box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.25); pointer-events: none; }
.camera-stop { position: absolute; right: 10px; bottom: 10px; }

.verdict { border-radius: var(--radius); padding: 18px 16px; font-size: 1.7rem; font-weight: 700; text-align: center; border: 2px solid var(--none-line); background: var(--none-bg); color: var(--none); }
.verdict small { display: block; font-size: 0.95rem; font-weight: 500; margin-top: 4px; }
.verdict.good { background: var(--good-bg); border-color: var(--good-line); color: var(--good); }
.verdict.warn { background: var(--warn-bg); border-color: var(--warn-line); color: var(--warn); }
.verdict.bad { background: var(--bad-bg); border-color: var(--bad-line); color: var(--bad); }

.verdict-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 14px 0; }
.verdict-grid > div { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px; }
.verdict-grid b { display: block; font-size: 1.25rem; margin-top: 2px; }
.warn-list { padding-left: 18px; color: var(--warn); }
.comp-list { padding-left: 18px; }
.comp-list li { margin: 6px 0; }
.comps-box summary { cursor: pointer; padding: 8px 0; }
.scan-page .field { display: block; margin: 12px 0; }
.scan-page .field .label-text { display: block; margin-bottom: 6px; font-weight: 600; }
.scan-page .field input { width: 100%; box-sizing: border-box; }

/* Segmented choices (Where are you? / Condition): big tap targets. */
.seg-field { margin: 12px 0; }
.seg-field .label-text { display: block; margin-bottom: 6px; font-weight: 600; }
.seg { display: flex; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); overflow: hidden; }
.seg button { flex: 1; min-height: 44px; border: 0; border-radius: 0; background: var(--surface); color: var(--fg-2); font-weight: 600; }
.seg button + button { border-left: 1px solid var(--line-strong); }
.seg button[aria-checked="true"] { background: var(--accent); color: var(--on-accent); }
#taxNote { display: block; margin-top: 4px; }

/* Photo identification: confirm before pricing. */
.ident { border: 1px solid var(--line); background: var(--surface-2); border-radius: var(--radius-sm); padding: 12px; margin: 10px 0; }
.ident-head { margin: 0 0 6px; font-size: 1.05rem; }
.ident .chip { margin-left: 6px; }
.warn-text { color: var(--warn); }
.alt-btn { margin: 4px 6px 0 0; }

/* Check later list. */
.queue-head { display: flex; align-items: center; justify-content: space-between; }
.queue-list { list-style: none; padding: 0; margin: 8px 0 0; }
.queue-list li { display: flex; gap: 10px; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); padding: 10px 0; }
.queue-list .q-main { min-width: 0; }
.queue-list .q-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.queue-list .q-state { font-size: 0.85rem; color: var(--fg-3); }
.queue-list .q-state.good { color: var(--good); } .queue-list .q-state.warn { color: var(--warn); } .queue-list .q-state.bad { color: var(--bad); }

/* Scan outcome: big and coloured, so you know at a glance whether the barcode read. */
.scan-msg { border-radius: var(--radius-sm); padding: 12px 14px; margin: 8px 0 12px; font-size: 1.05rem; font-weight: 600; border: 2px solid var(--line); background: var(--surface-2); color: var(--fg); }
.scan-msg.good { background: var(--good-bg); border-color: var(--good-line); color: var(--good); }
.scan-msg.bad { background: var(--warn-bg); border-color: var(--warn-line); color: var(--warn); }
.scan-msg.busy { color: var(--fg-2); }

/* ---------- launch polish: one hand, bright light ---------- */
.appbar-link { display: inline-flex; align-items: center; min-height: 44px; padding: 0 10px; margin-right: -10px; font-size: 15px; font-weight: 600; }

/* Start: Scan barcode, its photo fallback right under it, then the item photo. Full width, stacked. */
.scan-start { display: flex; flex-direction: column; gap: 10px; margin: 14px 0; }
.scan-start .scan-big, .scan-page .scan-start .scan-big.scan-big { min-height: 56px; white-space: nowrap; }
.scan-fallback { width: 100%; min-height: 44px; font-size: 15px; color: var(--accent); }

/* Price: a fixed "$" that stays while typing. */
.price-wrap { position: relative; display: block; }
.price-prefix { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); font-size: 1.1rem; font-weight: 600; color: var(--fg-2); pointer-events: none; }
.price-wrap .price-prefix { left: 3px; }
.scan-page .price-wrap input { border: 0; box-shadow: none !important; padding-left: 18px; font-variant-numeric: tabular-nums; }


/* Result shown: the form collapses to one line; the result sits on top. */
.has-result .scan-title { display: none; }
.ask-summary { display: flex; align-items: center; gap: 8px; margin: 10px 0 0; padding: 4px 4px 4px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); font-size: 14px; color: var(--fg-2); }
.ask-summary-text { flex: 1; min-width: 0; display: flex; white-space: nowrap; }
.ask-summary-text .t { min-width: 0; overflow: hidden; text-overflow: ellipsis; color: var(--fg); font-weight: 600; }
.ask-summary-text .m { flex: none; }
.ask-summary .ask-edit { min-height: 44px; padding: 0 12px; font-size: 15px; font-weight: 600; flex: none; }
#result { margin-top: 12px; }

/* The verdict is a headline; the profit is the biggest number on the screen. */
.scan-page .verdict { font-size: 1.2rem; padding: 12px 14px; }
.scan-page .verdict small { font-size: 0.85rem; }
.verdict-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.verdict-grid > div { min-width: 0; }
.verdict-grid .label-text { display: block; font-size: 12px; line-height: 1.25; color: var(--fg-3); }
.verdict-grid > div { padding: 8px 10px; }
.verdict-grid b { font-size: 1.05rem; }
.verdict-grid .profit-tile { grid-column: 1 / -1; display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 12px 14px; }
.verdict-grid .profit-tile .label-text { font-size: 15px; font-weight: 600; color: var(--fg-2); }
.verdict-grid .profit-tile b { font-size: 2.6rem; line-height: 1.05; letter-spacing: -0.02em; margin: 0; }
#profit.neg { color: var(--bad); }
.tile-sub { display: block; font-size: 12px; font-weight: 500; color: var(--fg-3); margin-top: 1px; }
.result-msg:empty { display: none; }
.result-msg { margin: 6px 0; font-weight: 600; color: var(--fg-2); }
#why { font-size: 14px; color: var(--fg-2); }

/* "Bought it" / "Check another": pinned to the bottom while a result is shown. */
.result-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: flex; gap: 10px; padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  background: var(--surface); border-top: 1px solid var(--line); box-shadow: 0 -2px 10px rgba(16, 24, 40, 0.08);
}
.result-bar > button { flex: 1 1 0; min-width: 0; min-height: 52px; font-size: 15px; }
.result-bar.again-first > #againBtn { order: -1; }
.result-bar .btn-secondary { background: var(--surface); border: 1px solid var(--line-strong); color: var(--fg); }
.has-result main { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }

/* Usage: one short chip, louder on the free plan when one check (or none) is left. */
.usage-row { margin: 0 0 6px; }
.usage { display: inline-flex; align-items: center; max-width: 100%; font-size: 13px; font-weight: 500; line-height: 1.3; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); }
.usage.usage-low { font-size: 14px; font-weight: 600; color: var(--warn); background: var(--warn-bg); border-color: var(--warn-line); padding: 6px 12px; }

/* Sales-tax note: Settings is a real link, big enough to tap. */
.tax-link { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; }
#taxNote { margin-top: 0; }

/* No (or too few) matching sales: no numbers, one clear next step. */
.no-match { margin: 14px 0; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); }
.no-match-head { font-size: 1.15rem; margin: 0 0 6px; }
.no-match p { margin: 0 0 12px; color: var(--fg-2); font-size: 14px; }
#why:empty, .warn-list:empty { display: none; }

/* Check later: one-handed rows, a full-height button on each. */
.queue-list li { min-height: 56px; padding: 6px 0; align-items: stretch; }
.queue-list .q-main { flex: 1; align-self: center; }
.queue-list .q-action { flex: none; align-self: stretch; min-height: 44px; min-width: 84px; padding: 0 14px; font-size: 15px; }
.queue-clear { min-height: 44px; padding: 0 14px; font-size: 14px; }

/* The pinned buttons line up with the content column (main's padding: 16px on phones, 20px wider up). */
.result-bar { padding-left: max(16px, calc(50% - 244px)); padding-right: max(16px, calc(50% - 244px)); }
@media (min-width: 601px) { .result-bar { padding-left: calc(50% - 240px); padding-right: calc(50% - 240px); } }
