@font-face {
  font-family: "Fredoka";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("fonts/fredoka-700.woff2") format("woff2");
}

:root {
  --ink: #f9efd9;
  --muted: #b4a084;
  --paper: #120e0a;
  --card: #1e1811;
  --card-2: #241d15;
  --line: rgba(240, 180, 41, .16);
  --line-strong: rgba(240, 180, 41, .3);
  --brand: #e8471c;
  --brand-2: #f0632f;
  --accent: #f0b429;
  --buy: #3fae72;
  --amber: #f0b429;
  --red: #e2564a;
  --shadow: 0 20px 55px rgba(0, 0, 0, .5);
  --display: "Fredoka", ui-rounded, "Segoe UI", sans-serif;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; background: var(--paper); }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
[hidden] { display: none !important; }

.impersonation-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 10px 20px;
  background: var(--accent);
  color: var(--paper);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}
.impersonation-banner strong { font-weight: 900; }
.impersonation-banner .secondary-button { height: 32px; padding: 0 12px; font-size: 12px; background: rgba(0, 0, 0, .18); color: var(--paper); }
.impersonation-banner .secondary-button:hover { background: rgba(0, 0, 0, .28); }

.install-banner { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding: 12px 20px; background: var(--card); border-bottom: 1px solid var(--line); font-size: 13px; color: var(--ink); }
.install-banner-actions { display: flex; align-items: center; gap: 12px; flex: none; }
.install-banner .secondary-button { height: 34px; padding: 0 14px; font-size: 12px; }
.queue-banner { background: rgba(240, 180, 41, .12); border-bottom-color: var(--line-strong); }

.venue-line { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; font-size: 13px; color: var(--muted); }
.venue-naming { display: flex; gap: 8px; align-items: center; }
.venue-naming input { height: 42px; }
.venue-naming .secondary-button { height: 42px; white-space: nowrap; }

.repeat-notice { display: block; width: 100%; text-align: left; margin-bottom: 18px; padding: 13px 15px; border: 1px solid var(--line-strong); border-radius: 12px; background: rgba(240, 180, 41, .1); color: var(--ink); font: inherit; font-size: 13px; line-height: 1.5; cursor: pointer; }
.repeat-notice:hover { background: rgba(240, 180, 41, .16); }
.cross-check-note { margin: 0 0 18px; padding: 11px 14px; border-radius: 12px; background: rgba(63, 174, 114, .12); border: 1px solid rgba(63, 174, 114, .3); color: var(--ink); font-size: 13px; line-height: 1.5; }
.repeat-notice strong { color: var(--accent); }

.outcome-box { margin-bottom: 18px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; display: flex; flex-direction: column; gap: 10px; }
.outcome-heading { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.outcome-actions { display: flex; gap: 8px; }
.outcome-button.active { background: var(--brand); color: white; }
.outcome-sold { display: flex; gap: 8px; align-items: end; }
.outcome-sold .secondary-button { white-space: nowrap; }
.outcome-real { margin: 0; font-size: 13px; font-weight: 800; color: var(--buy); }
.outcome-real.negative { color: var(--red) !important; }
.location-block { margin-bottom: 18px; }
.scan-map { height: 200px; margin-top: 8px; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--card-2); }
/* Leaflet paints its own light chrome; keep it readable on the dark theme. */
.scan-map .leaflet-control-attribution { background: rgba(18, 14, 10, .8); color: var(--muted); font-size: 10px; }
.scan-map .leaflet-control-attribution a { color: var(--brand-2); }
.scan-map .leaflet-bar a { background: var(--card); color: var(--ink); border-bottom-color: var(--line); }
.scan-map .leaflet-bar a:hover { background: var(--card-2); color: var(--accent); }
.scan-map .leaflet-popup-content-wrapper, .scan-map .leaflet-popup-tip { background: var(--card); color: var(--ink); }

.advert-output { margin-bottom: 18px; display: flex; flex-direction: column; gap: 14px; }
.advert-basis { margin: 0; font-size: 12px; color: var(--muted); }
.advert-market { padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--card-2); display: flex; flex-direction: column; gap: 10px; }
.advert-market-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.advert-market-head strong { font-size: 15px; color: var(--ink); }
.advert-price { font-family: var(--display); font-size: 20px; color: var(--accent); font-variant-numeric: tabular-nums; }
.advert-note { margin: 0; font-size: 11px; line-height: 1.5; color: var(--muted); }
.advert-field { display: flex; flex-direction: column; gap: 6px; }
.advert-field > span { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.advert-field textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--ink); font: inherit; font-size: 13px; line-height: 1.5; resize: vertical; }
.advert-field .secondary-button { align-self: flex-start; height: 34px; padding: 0 12px; font-size: 12px; }
.advert-checklist { padding: 12px 14px; border-radius: 12px; background: rgba(240, 180, 41, .1); font-size: 12px; line-height: 1.5; }
.advert-checklist ul { margin: 6px 0 0; padding-left: 18px; }

.share-box { margin-bottom: 18px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.share-box .microcopy { flex: 1; min-width: 0; word-break: break-all; }
.share-wordmark { font-size: 22px; }

.topbar {
  height: 76px;
  padding: 0 max(24px, calc((100vw - 1180px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(18, 14, 10, .88);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(16px);
}
.topbar.simple { position: static; }
.wordmark { display: flex; align-items: center; text-decoration: none; }
.wordmark-text {
  font-family: var(--display);
  font-weight: 700;
  font-size: 32px;
  line-height: 1;
  letter-spacing: -.01em;
  color: var(--accent);
  -webkit-text-stroke: 2px var(--paper);
  paint-order: stroke fill;
  text-shadow: 3px 3px 0 var(--brand);
  white-space: nowrap;
  display: inline-block;
}
.wordmark-o {
  position: relative;
  display: inline-block;
  color: transparent;
  width: .92em;
  height: .92em;
  vertical-align: -.14em;
}
.wordmark-o svg { position: absolute; inset: -10%; width: 120%; height: 120%; }
.brand-mark { display: block; border-radius: 22%; width: 56px; height: 56px; margin-bottom: 20px; }
.topbar nav { display: flex; align-items: center; gap: 20px; }
.topbar nav a, .back-link { color: var(--muted); font-size: 14px; text-decoration: none; font-weight: 700; }
.topbar nav a:hover, .back-link:hover { color: var(--brand-2); }
.topbar nav a.nav-username, .nav-username { color: var(--accent); font-size: 13px; font-weight: 800; padding: 6px 11px; background: rgba(240, 180, 41, .14); border-radius: 999px; }
.topbar nav a.nav-username:hover { color: var(--brand-2); }

.page-shell { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 72px 0 90px; }
.page-shell.narrow { width: min(720px, calc(100% - 32px)); }
.hero-grid { display: grid; grid-template-columns: .8fr 1.2fr; gap: 70px; align-items: center; min-height: 620px; }
.hero-copy h1 { margin: 8px 0 24px; font-family: var(--display); font-weight: 700; font-size: clamp(56px, 7.4vw, 100px); line-height: .92; letter-spacing: -.02em; color: var(--accent); -webkit-text-stroke: 1.5px var(--paper); paint-order: stroke fill; text-shadow: 4px 4px 0 var(--brand); }
.hero-copy > p:not(.eyebrow) { max-width: 440px; color: var(--muted); font-size: 18px; line-height: 1.6; }
.eyebrow { margin: 0 0 9px; color: var(--brand-2); font-size: 12px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.connection-pills { display: flex; gap: 8px; margin-top: 28px; flex-wrap: wrap; }
.connection-pills span { padding: 8px 12px; border-radius: 999px; background: rgba(255, 255, 255, .06); color: var(--muted); font-size: 12px; font-weight: 800; }
.connection-pills span.connected { background: rgba(63, 174, 114, .16); color: #7fdba6; }

.scan-card, .panel, .decision-panel { background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); }
.scan-card { border-radius: 28px; padding: 30px; }
.mode-tabs { display: flex; gap: 6px; margin-bottom: 14px; padding: 4px; background: rgba(255, 255, 255, .04); border: 1px solid var(--line); border-radius: 14px; }
.mode-tab { flex: 1; border: 0; padding: 10px; border-radius: 10px; background: none; color: var(--muted); font-weight: 800; font-size: 13px; cursor: pointer; }
.mode-tab.active { background: var(--brand); color: white; }
.lot-photo-input { min-height: 130px; }
.lot-photo-input input:disabled { cursor: not-allowed; }
.lot-thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.lot-thumbs:empty { margin-top: 0; }
.lot-thumb { position: relative; width: 64px; height: 64px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); }
.lot-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lot-thumb button { position: absolute; top: 2px; right: 2px; width: 20px; height: 20px; border: 0; border-radius: 50%; background: rgba(0,0,0,.65); color: white; font-size: 12px; line-height: 1; cursor: pointer; }
#lot-clear-photos { margin-top: 10px; }
.step-heading, .panel-heading { display: flex; align-items: center; gap: 13px; margin-bottom: 23px; }
.step-heading > span, .number { flex: none; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: var(--brand); color: var(--accent); font-weight: 900; }
.step-heading div, .panel-heading div { display: flex; flex-direction: column; gap: 3px; }
.step-heading strong, .panel-heading strong { font-size: 17px; color: var(--ink); }
.step-heading small, .panel-heading small { color: var(--muted); }
.photo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.photo-input { position: relative; min-height: 162px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; border: 1.5px dashed var(--line-strong); border-radius: 18px; background: var(--card-2); overflow: hidden; cursor: pointer; text-align: center; }
.photo-input-wide { grid-column: 1 / -1; min-height: 100px; flex-direction: row; gap: 12px; padding: 0 20px; }
.photo-input-wide .photo-icon { font-size: 22px; }
.photo-input-wide strong, .photo-input-wide small { text-align: left; }
.photo-input:hover { border-color: var(--brand-2); background: rgba(240, 180, 41, .07); }
.photo-input input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.photo-input img { display: none; position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.photo-input.has-photo img { display: block; }
.photo-input.has-photo::after { content: "Change"; position: absolute; right: 8px; bottom: 8px; padding: 6px 9px; border-radius: 8px; color: white; background: rgba(0, 0, 0, .68); font-size: 11px; font-weight: 800; z-index: 2; }
.photo-icon { font-size: 27px; color: var(--brand-2); }
.photo-input strong { font-size: 14px; color: var(--ink); }
.photo-input small { color: var(--muted); font-size: 11px; }
.or-divider { display: flex; align-items: center; margin: 22px 0; color: var(--muted); font-size: 11px; text-transform: uppercase; font-weight: 800; letter-spacing: .06em; }
.or-divider::before, .or-divider::after { content: ""; height: 1px; flex: 1; background: var(--line); }
.or-divider span { padding: 0 12px; }
.field-label { display: flex; flex-direction: column; gap: 7px; color: var(--ink); font-size: 12px; font-weight: 800; }
.field-label > span, .stack-form label > span { color: var(--muted); font-weight: 500; }
/* 16px is a hard requirement, not a style choice: iOS Safari zooms the page in
   whenever a focused input is smaller than that, and these inputs sit inside
   12px labels, so they inherited a size that triggered it on every tap. */
input, textarea, select { font-size: 16px; }
input { width: 100%; min-width: 0; height: 48px; padding: 0 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--card-2); color: var(--ink); outline: none; }
input:focus { border-color: var(--brand-2); box-shadow: 0 0 0 3px rgba(240, 99, 47, .22); }
.form-row { display: grid; grid-template-columns: 150px 1fr; gap: 12px; margin-top: 14px; }
.barcode-row { grid-template-columns: 1fr auto auto; align-items: end; }
.barcode-row .secondary-button { height: 48px; white-space: nowrap; }
#barcode-hint { margin: 8px 0 0; }
.currency-input { position: relative; display: block; }
.currency-input b { position: absolute; z-index: 1; left: 14px; top: 14px; color: var(--accent); }
.currency-input input { padding-left: 30px; }
.primary-button, .secondary-button { border: 0; cursor: pointer; font-weight: 900; transition: transform .15s ease, filter .15s ease; }
.primary-button { min-height: 52px; padding: 0 18px; border-radius: 14px; background: var(--brand); color: white; }
.primary-button:hover, .secondary-button:hover { filter: brightness(1.1); }
.primary-button:active, .secondary-button:active { transform: translateY(1px); }
.primary-button:disabled { opacity: .6; cursor: wait; }
.scan-button { width: 100%; margin-top: 18px; display: flex; justify-content: space-between; align-items: center; }
.scan-button b { color: var(--accent); font-size: 21px; }
.microcopy, .helper-copy { color: var(--muted); font-size: 11px; line-height: 1.5; }
.scan-card .microcopy { text-align: center; margin: 10px 0 0; }

.loading-panel { margin: 24px 0; padding: 22px; border-radius: 18px; background: var(--brand); color: white; display: flex; align-items: center; justify-content: center; gap: 16px; box-shadow: var(--shadow); }
.loading-panel > div:last-child { display: flex; flex-direction: column; gap: 4px; }
.loading-panel span { color: rgba(255,255,255,.78); font-size: 13px; }
.spinner { width: 28px; height: 28px; border: 3px solid rgba(255,255,255,.25); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.notice { padding: 14px 16px; border-radius: 12px; font-size: 14px; line-height: 1.45; }
.notice.error { background: rgba(226, 86, 74, .14); color: #ff9a8c; border: 1px solid rgba(226, 86, 74, .35); }
.notice.success { background: rgba(63, 174, 114, .14); color: #7fdba6; border: 1px solid rgba(63, 174, 114, .35); }
.result-error { margin: 20px 0; }

.results { padding-top: 54px; }
.result-topline, .section-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; }
.result-topline { margin-bottom: 20px; }
.result-topline h2, .section-heading h2, .panel h1 { margin: 0; font-family: var(--display); font-weight: 700; color: var(--accent); font-size: 30px; letter-spacing: -.01em; }
.confidence { padding: 8px 12px; border-radius: 999px; background: rgba(255, 255, 255, .06); color: var(--muted); font-size: 12px; font-weight: 900; }
.confidence.high { background: rgba(63, 174, 114, .16); color: #7fdba6; }
.confidence.low { background: rgba(226, 86, 74, .16); color: #ff9a8c; }
.result-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.panel { padding: 26px; border-radius: 22px; }
.fact-chips { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 20px; }
.fact-chips span { padding: 7px 10px; border-radius: 9px; background: rgba(240, 180, 41, .12); color: var(--accent); font-size: 12px; font-weight: 700; }
.inspection-box { margin-top: 18px; padding: 12px 14px; border-radius: 12px; background: var(--card-2); color: var(--muted); font-size: 12px; line-height: 1.5; }
.inspection-box p { margin: 0 0 10px; }
.inspection-box p:last-child { margin-bottom: 0; }
.inspection-box summary { cursor: pointer; color: var(--brand-2); font-weight: 800; }
.inspection-box ul { padding-left: 19px; margin-bottom: 0; }
.market-summary { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.market-summary > div { padding: 14px; display: flex; flex-direction: column; gap: 5px; border-right: 1px solid var(--line); }
.market-summary > div:last-child { border-right: 0; }
.market-summary span { color: var(--muted); font-size: 10px; }
.market-summary strong { color: var(--accent); font-size: 17px; }
.market-links { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.modal-market-links { margin-bottom: 16px; }
.market-button { min-height: 47px; padding: 0 13px; display: flex; align-items: center; justify-content: space-between; border-radius: 12px; color: white; text-decoration: none; font-size: 13px; font-weight: 900; }
.market-button.ebay { background: #315cb5; }
.market-button.vinted { background: #007782; }
.market-button.facebook { background: #0866ff; grid-column: 1 / -1; }
.helper-copy { margin: 10px 0 14px; }
.estimate-explanation { margin: 13px 0; padding: 11px 13px; border-radius: 11px; background: var(--card-2); color: var(--muted); font-size: 11px; line-height: 1.5; }
.scan-alternatives { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.scan-alternatives summary { cursor: pointer; color: var(--brand-2); font-size: 12px; font-weight: 800; }
.scan-alternatives[open] summary { margin-bottom: 12px; }
.scan-alternatives .form-row { margin-top: 12px; }

.manual-market-checks { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 12px; }
.manual-market-checks summary { cursor: pointer; color: var(--brand-2); font-size: 12px; font-weight: 850; }
.manual-market-checks[open] summary { margin-bottom: 12px; }
.sold-entry { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 8px; }
.secondary-button { height: 48px; padding: 0 15px; border-radius: 12px; background: rgba(255, 255, 255, .06); color: var(--accent); }
.sold-price-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; min-height: 28px; }
.sold-price-chips button { border: 0; padding: 6px 9px; border-radius: 8px; background: var(--accent); color: var(--paper); cursor: pointer; font-size: 12px; font-weight: 900; }
.sold-price-chips span { opacity: .55; }

.decision-panel { margin-top: 18px; padding: 26px; border-radius: 22px; }
.decision-body { display: grid; grid-template-columns: 190px 1fr; gap: 25px; align-items: center; }
.decision-orb { height: 130px; border-radius: 18px; display: flex; flex-direction: column; align-items: center; justify-content: center; color: white; }
.decision-orb.buy { background: var(--buy); }
.decision-orb.maybe { background: var(--amber); color: #2c1e08; }
.decision-orb.leave { background: var(--red); }
.decision-orb span { font-size: 30px; font-weight: 950; letter-spacing: .05em; }
.decision-orb small { margin-top: 5px; padding: 0 12px; text-align: center; font-weight: 700; opacity: .85; }
.decision-metrics { display: grid; grid-template-columns: repeat(3, 1fr); }
.decision-metrics > div { display: flex; flex-direction: column; min-height: 80px; padding: 6px 18px; border-right: 1px solid var(--line); }
.decision-metrics > div:first-child { padding-left: 0; }
.decision-metrics > div:last-child { border-right: 0; }
.decision-metrics span, .decision-metrics small { color: var(--muted); font-size: 11px; }
.decision-metrics strong { margin: 7px 0; color: var(--accent); font-size: 25px; }
.decision-metrics strong.negative, .negative { color: var(--red) !important; }
.save-status { margin: 16px 0 0; display: flex; align-items: center; gap: 6px; }
.save-status.saved { color: var(--buy); }
.save-status.error { color: var(--red); }

.active-section, .history-section { padding-top: 72px; }
.section-heading { margin-bottom: 20px; }
.section-heading small { color: var(--muted); }
.listing-scroll { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(175px, 210px); gap: 11px; overflow-x: auto; padding: 2px 2px 16px; scroll-snap-type: x mandatory; }
.listing-card { padding: 10px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); color: var(--ink); text-decoration: none; scroll-snap-align: start; }
.listing-image { height: 150px; margin-bottom: 10px; border-radius: 11px; overflow: hidden; background: var(--card-2); }
.listing-image img { width: 100%; height: 100%; object-fit: cover; }
.listing-price { display: block; color: var(--accent); font-size: 19px; }
.listing-title { display: -webkit-box; margin-top: 5px; overflow: hidden; color: var(--muted); font-size: 11px; line-height: 1.4; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.text-button { border: 0; background: none; color: var(--brand-2); font-weight: 800; cursor: pointer; text-decoration: none; }
.section-actions { display: flex; align-items: center; gap: 14px; flex: none; }
.lot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.lot-item { display: flex; flex-direction: column; gap: 10px; padding: 18px; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); border-radius: 18px; }
.lot-item-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.lot-item-top strong { font-size: 15px; line-height: 1.3; color: var(--ink); }
.lot-item-note { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.lot-item-value { padding: 10px 12px; border-radius: 12px; background: var(--card-2); }
.lot-item-value span { display: block; color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.lot-item-value strong { color: var(--accent); font-size: 20px; }
.lot-item-value small { color: var(--muted); font-size: 11px; }
.lot-item .market-links { grid-template-columns: 1fr; margin-top: 0; }
.lot-item .market-button { min-height: 40px; font-size: 12px; }
.history-list { display: grid; gap: 8px; }
.history-card { width: 100%; display: grid; grid-template-columns: 70px 1fr auto; gap: 14px; align-items: center; padding: 15px 17px; background: rgba(255, 255, 255, .03); border: 1px solid var(--line); border-radius: 14px; font: inherit; text-align: left; cursor: pointer; transition: transform .12s ease, background .12s ease; color: var(--ink); }
.history-card:hover, .history-card:focus-visible { background: rgba(255, 255, 255, .06); transform: translateY(-1px); }
.history-card div { min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.history-card div strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.history-card small { color: var(--muted); }
.history-decision { padding: 7px; border-radius: 8px; text-align: center; font-size: 11px; font-weight: 950; }
.history-decision.buy { background: rgba(63, 174, 114, .16); color: #7fdba6; }
.history-decision.maybe { background: rgba(240, 180, 41, .18); color: #f7cf6b; }
.history-decision.leave { background: rgba(226, 86, 74, .16); color: #ff9a8c; }
.empty-state { padding: 30px; text-align: center; color: var(--muted); border: 1px dashed var(--line-strong); border-radius: 14px; }

.modal-overlay { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center; background: rgba(0, 0, 0, .65); backdrop-filter: blur(3px); padding: 0; }
body.modal-open { overflow: hidden; }
.modal-card { width: min(640px, 100%); max-height: 88vh; overflow-y: auto; background: var(--card); border-radius: 22px 22px 0 0; box-shadow: 0 -20px 55px rgba(0, 0, 0, .55); padding: 26px; }
.modal-header { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 18px; }
.modal-header > div { flex: 1; min-width: 0; }
.modal-header h2 { margin: 0; font-family: var(--display); font-weight: 700; color: var(--accent); font-size: 22px; letter-spacing: -.01em; }
.modal-decision { flex: none; padding: 8px 12px; }
.modal-close { flex: none; width: 34px; height: 34px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .08); color: var(--ink); font-size: 14px; cursor: pointer; }
.modal-close:hover { background: rgba(255, 255, 255, .16); }
.camera-overlay { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; background: rgba(0, 0, 0, .92); padding: 16px; }
.camera-card { width: min(480px, 100%); display: flex; flex-direction: column; gap: 14px; }
.camera-header { display: flex; align-items: center; justify-content: space-between; color: white; }
.camera-header .modal-close { background: rgba(255,255,255,.18); color: white; }
.camera-header .modal-close:hover { background: rgba(255,255,255,.3); }
#camera-video { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 18px; background: #000; }
#camera-status { color: rgba(255,255,255,.8); text-align: center; margin: 0; }
.modal-body p { margin: 0 0 12px; font-size: 14px; line-height: 1.55; }
.modal-body ul { margin: 0 0 12px; padding-left: 19px; font-size: 13px; line-height: 1.6; color: var(--muted); }
.modal-photo-note { padding: 11px 13px; border-radius: 11px; background: var(--card-2); color: var(--muted); font-size: 12px; line-height: 1.5; }
.modal-photo-gallery { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; margin-bottom: 16px; }
.modal-photo-gallery img { flex: none; height: 180px; width: auto; border-radius: 14px; object-fit: cover; background: var(--card-2); }
.modal-metrics { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin: 6px 0 16px; }
.modal-metrics div { padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; }
.modal-metrics span { display: block; color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 4px; }
.modal-metrics strong { font-size: 18px; color: var(--accent); }
.static-chip { display: inline-block; padding: 6px 9px; border-radius: 8px; background: var(--accent); color: var(--paper); font-size: 12px; font-weight: 900; margin: 0 6px 6px 0; }
@media (max-width: 620px) {
  .modal-card { padding: 20px; max-height: 92vh; }
  .modal-metrics { grid-template-columns: 1fr 1fr; }
}

.auth-page { display: grid; min-height: 100vh; place-items: center; padding: 30px; background: var(--paper); background-image: radial-gradient(circle at 50% -10%, rgba(232, 71, 28, .22), transparent 55%); }
.auth-shell { width: min(570px, 100%); padding: 44px; border-radius: 26px; background: var(--card); border: 1px solid var(--line); box-shadow: 0 40px 90px rgba(0,0,0,.55); }
.auth-shell.compact { width: min(440px, 100%); }
.auth-shell h1 { margin: 0 0 10px; font-family: var(--display); font-weight: 700; font-size: 38px; line-height: 1; letter-spacing: -.01em; color: var(--accent); -webkit-text-stroke: 1.5px var(--paper); paint-order: stroke fill; text-shadow: 3px 3px 0 var(--brand); }
.muted { color: var(--muted); line-height: 1.55; }
.stack-form { display: grid; gap: 15px; margin-top: 24px; }
.stack-form label { display: flex; flex-direction: column; gap: 7px; color: var(--ink); font-size: 12px; font-weight: 800; }
.stack-form details { border: 1px solid var(--line); border-radius: 12px; }
.stack-form summary { padding: 14px; cursor: pointer; color: var(--brand-2); font-size: 13px; font-weight: 800; }
.details-body { display: grid; gap: 12px; padding: 0 14px 14px; }
.status-row { display: flex; justify-content: space-between; align-items: center; padding: 12px 0 5px; border-top: 1px solid var(--line); }
.status { padding: 5px 8px; border-radius: 7px; font-size: 11px; }
.status.ready { background: rgba(63, 174, 114, .16); color: #7fdba6; }
.status.missing { background: rgba(240, 180, 41, .18); color: #f7cf6b; }
.three-fields { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }

.report-header { margin-bottom: 28px; }
.report-header h1 { margin: 6px 0 8px; font-family: var(--display); font-weight: 700; color: var(--accent); font-size: 34px; letter-spacing: -.01em; }
.report-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 32px; }
.report-stats div { padding: 14px; border: 1px solid var(--line); border-radius: 14px; text-align: center; background: var(--card); }
.report-stats strong { display: block; color: var(--accent); font-size: 22px; }
.report-stats span { color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.report-section { margin-bottom: 32px; }
.report-section h2 { margin: 0 0 14px; font-family: var(--display); font-weight: 700; color: var(--accent); font-size: 20px; }
.report-table-scroll { border: 1px solid var(--line); border-radius: 14px; overflow-x: auto; }
.report-row { display: grid; grid-template-columns: 90px 200px 120px 70px 70px 70px 70px 100px; gap: 8px; padding: 10px 14px; font-size: 12px; align-items: center; border-bottom: 1px solid var(--line); min-width: max-content; }
.report-row-venue { grid-template-columns: 200px 70px 70px 110px; }
.report-row:last-child { border-bottom: 0; }
.report-row-head { background: rgba(255, 255, 255, .04); color: var(--muted); font-weight: 800; text-transform: uppercase; font-size: 10px; letter-spacing: .03em; }
.report-decision { font-weight: 900; }
.report-decision.buy { color: #7fdba6; }
.report-decision.maybe { color: #f7cf6b; }
.report-decision.leave { color: #ff9a8c; }
.report-footer { margin-top: 20px; font-size: 11px; }

@media print {
  .no-print { display: none !important; }
  body, .page-shell { background: #fff !important; color: #111 !important; }
  .report-stats div, .report-table-scroll { border-color: #ccc !important; background: #fff !important; }
  .report-header h1, .report-section h2, .report-stats strong { color: #111 !important; -webkit-text-stroke: 0 !important; text-shadow: none !important; }
  .report-row-head { background: #f2f2f2 !important; color: #444 !important; }
  .muted { color: #555 !important; }
  .negative { color: #b00 !important; }
}

.admin-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 18px; }
.admin-stats div { padding: 16px; border: 1px solid var(--line); border-radius: 14px; text-align: center; }
.admin-stats strong { display: block; color: var(--accent); font-size: 26px; }
.admin-stats span { color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.admin-user-list { display: grid; gap: 8px; margin-top: 16px; }
.admin-user-row { display: flex; flex-direction: column; gap: 5px; padding: 15px 17px; background: rgba(255, 255, 255, .03); border: 1px solid var(--line); border-radius: 14px; color: inherit; }
.admin-user-row > div { display: flex; align-items: center; gap: 8px; }
.admin-user-row small { color: var(--muted); }
.admin-user-row-foot { justify-content: space-between; }
.admin-user-name { color: var(--ink); text-decoration: none; font-weight: 700; }
.admin-user-name:hover { color: var(--brand-2); text-decoration: underline; }
.admin-create { margin-top: 18px; border: 1px solid var(--line); border-radius: 12px; }
.admin-create summary { padding: 14px; cursor: pointer; color: var(--brand-2); font-size: 13px; font-weight: 800; }
.admin-create .stack-form { padding: 0 14px 14px; margin-top: 0; }
.admin-history-entry { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.admin-history-entry summary { cursor: pointer; list-style: none; }
.admin-history-entry summary::-webkit-details-marker { display: none; }
.admin-history-entry .history-card { border: 0; border-radius: 0; }
.admin-history-detail { padding: 4px 17px 17px; }
.admin-history-detail p { margin: 0 0 8px; font-size: 13px; line-height: 1.5; }
.admin-history-detail.lot-grid { padding-top: 10px; }

@media (max-width: 900px) {
  .page-shell { padding-top: 40px; }
  .hero-grid { grid-template-columns: 1fr; gap: 24px; min-height: 0; }
  .hero-copy h1 { font-size: clamp(40px, 10vw, 60px); line-height: .98; margin: 6px 0 14px; }
  .hero-copy > p:not(.eyebrow) { font-size: 15px; max-width: none; }
  .connection-pills { margin-top: 18px; }
  .result-grid { grid-template-columns: 1fr; }
  .decision-body { grid-template-columns: 150px 1fr; }
}

@media (max-width: 620px) {
  .topbar { height: 68px; padding: 0 14px; }
  .wordmark-text { font-size: 21px; }
  .topbar nav { gap: 8px; }
  .topbar nav a:first-child { display: none; }
  /* Admin-only text link is dropped on a phone to make room; the ⚙ still opens
     Settings, which links straight on to the admin console. */
  .nav-admin { display: none; }
  /* The username pill is the only route to My account (password, buying rules),
     so it has to stay reachable on a phone — just made compact. inline-block is
     required for max-width to apply and keep a long username from overflowing. */
  .topbar nav a.nav-username, .nav-username { display: inline-block; font-size: 12px; padding: 5px 8px; max-width: 64px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; }
  .page-shell { width: min(100% - 24px, 1180px); padding-top: 22px; }
  .mode-tabs { margin-bottom: 10px; }
  .scan-card, .panel, .decision-panel { padding: 19px; border-radius: 19px; }
  .photo-input { min-height: 145px; }
  .form-row { grid-template-columns: 125px 1fr; }
  .barcode-row { grid-template-columns: 1fr; }
  .barcode-row .field-label { grid-column: 1 / -1; }
  .result-topline { align-items: start; }
  .result-topline h2, .section-heading h2 { font-size: 26px; }
  .confidence { max-width: 90px; text-align: center; }
  .market-summary > div { padding: 10px 8px; }
  .market-summary strong { font-size: 14px; }
  .market-links { grid-template-columns: 1fr; }
  .decision-body { grid-template-columns: 1fr; }
  .decision-orb { height: 105px; }
  .decision-metrics > div { padding: 5px 9px; }
  .decision-metrics strong { font-size: 20px; }
  .history-card { grid-template-columns: 62px 1fr; }
  .history-card > b { grid-column: 2; }
  .auth-page { padding: 14px; }
  .auth-shell { padding: 28px 22px; }
  .auth-shell h1 { font-size: 32px; }
  .three-fields { grid-template-columns: 1fr; }
}
