@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Playfair+Display:ital,wght@1,700&display=swap');

:root {
  --forest: #133b2c;
  --forest-2: #1d513d;
  --accent: #133b2c;
  --cream: #f5f3ec;
  --paper: #fffefa;
  --ink: #183229;
  --muted: #718078;
  --line: #dedfd8;
  --mint: #dcece2;
  --coral: #e56d55;
  --gold: #e7b95c;
  --shadow: 0 12px 40px rgba(31, 52, 42, .09);
  --nav: #68756f;
  --nav-hover: #f3f5f1;
  --note: #61766b;
  --eyebrow: #7b8881;
  --soft: #f7f7f3;
  --input-bg: #fff;
  --danger-bg: #fff5f3;
  --danger-line: #efc7bf;
  --danger: #b84d39;
  --pill-bg: #f8e1dc;
  --pill: #bd523e;
  --gold-bg: #f8edcf;
  --gold-ink: #9b721d;
  --insight-bg: #edf3ed;
  --insight-line: #d9dfd9;
  --insight-text: #63736a;
  --close-bg: #f0f1ec;
  --drop-bg: #fafbf8;
  --mobile-nav: rgba(255,254,250,.96);
  --status-strong: #3b8761;
  --secondary-bg: #fff;
  --warning-bg: #fff3d9;
  --warning-ink: #72591f;
  --privacy-bg: #f6f4ed;
  --stepper: #e7e8e3;
  --stepper-ink: #919a94;
}

html.theme-dark {
  --forest: #176b4a;
  --forest-2: #2f8a64;
  --accent: #c9ead8;
  --cream: #101614;
  --paper: #24332c;
  --ink: #e7f0eb;
  --muted: #9aada4;
  --line: #3d564b;
  --mint: #24362c;
  --coral: #f08a74;
  --gold: #e7b95c;
  --shadow: 0 12px 40px rgba(0, 0, 0, .35);
  --nav: #b7c7be;
  --nav-hover: #24302b;
  --note: #9aada4;
  --eyebrow: #8ea099;
  --soft: #141c19;
  --input-bg: #101816;
  --danger-bg: #3a2420;
  --danger-line: #6a3a32;
  --danger: #f0a090;
  --pill-bg: #3a2824;
  --pill: #f0a090;
  --gold-bg: #3a3220;
  --gold-ink: #e7c98a;
  --insight-bg: #1c2a23;
  --insight-line: #3d564b;
  --insight-text: #b7c7be;
  --close-bg: #2a3530;
  --drop-bg: #141c19;
  --mobile-nav: rgba(16, 22, 20, .96);
  --status-strong: #7dcea8;
  --secondary-bg: #24302b;
  --warning-bg: #3a3220;
  --warning-ink: #e7c98a;
  --privacy-bg: #141c19;
  --stepper: #2a3530;
  --stepper-ink: #9aada4;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { background: var(--cream); color: var(--ink); font-family: "DM Sans", sans-serif; }
body { margin: 0; min-width: 320px; }
button, input { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, label:has(input:focus-visible) { outline: 3px solid rgba(229,109,85,.35); outline-offset: 2px; }

.app-shell { min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: 238px; z-index: 10;
  background: var(--paper); border-right: 1px solid var(--line); padding: 31px 22px;
  display: flex; flex-direction: column;
}
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; color: var(--accent); padding: 0 8px 35px; }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; background: var(--forest); color: white; font-family: Georgia, serif; font-size: 22px; }
.brand strong { display: block; font-size: 17px; line-height: 15px; }
.brand small { font-size: 9px; letter-spacing: 4px; font-weight: 700; }
.desktop-nav { display: grid; gap: 7px; }
.nav-item {
  border: 0; background: transparent; border-radius: 11px; padding: 12px 14px; display: flex; gap: 13px;
  align-items: center; cursor: pointer; color: var(--nav); text-align: left; font-size: 14px; font-weight: 600;
}
.nav-item span { width: 22px; text-align: center; font-size: 20px; }
.nav-item:hover { background: var(--nav-hover); color: var(--accent); }
.nav-item.active { background: var(--forest); color: white; box-shadow: 0 8px 18px rgba(19,59,44,.15); }
.sidebar-note { margin-top: auto; display: flex; gap: 10px; align-items: flex-start; padding: 13px; background: var(--mint); border-radius: 12px; }
.sidebar-note strong, .sidebar-note small { display: block; }
.sidebar-note strong { font-size: 11px; }
.sidebar-note small { margin-top: 3px; color: var(--note); font-size: 9px; line-height: 13px; }
.status-dot { width: 8px; height: 8px; margin-top: 4px; border-radius: 50%; background: #40a267; box-shadow: 0 0 0 4px rgba(64,162,103,.13); }

main { margin-left: 238px; min-height: 100vh; padding: 0 4.5vw 80px; }
.topbar { min-height: 105px; display: flex; justify-content: space-between; align-items: center; }
.other-warehouse { display: block; color: var(--muted); font-size: 11px; margin-top: 2px; }
.topbar h1 { font-size: 23px; line-height: 1; margin: 3px 0 0; }
.eyebrow { margin: 0; letter-spacing: 2px; font-size: 9px; color: var(--eyebrow); font-weight: 700; }
.top-actions { display: flex; gap: 12px; align-items: center; }
.icon-button { position: relative; border: 1px solid var(--line); background: var(--paper); border-radius: 11px; width: 42px; height: 42px; font-size: 21px; cursor: pointer; color: var(--accent); }
.icon-button.active { background: var(--forest); color: white; border-color: var(--forest); }
.primary-button, .light-button, .secondary-button {
  border: 0; border-radius: 10px; padding: 12px 18px; font-weight: 700; font-size: 13px; cursor: pointer;
}
.primary-button { background: var(--coral); color: white; box-shadow: 0 7px 15px rgba(229,109,85,.18); }
.primary-button:hover { background: #d85f49; transform: translateY(-1px); }
.primary-button:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.secondary-button { background: var(--secondary-bg); border: 1px solid var(--line); color: var(--accent); }
.secondary-button:disabled { opacity: .45; cursor: not-allowed; }
.danger-button { border: 1px solid var(--danger-line); border-radius: 10px; background: var(--danger-bg); color: var(--danger); padding: 12px 18px; font-weight: 700; font-size: 13px; cursor: pointer; }
.danger-button:hover { filter: brightness(1.05); }
.compact { padding: 8px 11px; font-size: 10px; white-space: nowrap; }
.light-button { background: var(--secondary-bg); color: var(--accent); padding: 13px 18px; }
.light-button span { padding-left: 18px; }
.wide { min-width: 150px; }
.text-button { background: none; border: 0; color: var(--accent); cursor: pointer; font-size: 12px; font-weight: 700; padding: 7px 0; }
.text-button:disabled { opacity: .45; }
.view { display: none; animation: reveal .25s ease; }
.view.active { display: block; }
@keyframes reveal { from { opacity: 0; transform: translateY(4px); } }

.hero {
  min-height: 298px; display: grid; grid-template-columns: 1.35fr 1fr; align-items: center; overflow: hidden;
  padding: 43px 6%; color: white; background: var(--forest); border-radius: 22px; position: relative;
}
.hero::after { content: ""; position: absolute; width: 340px; height: 340px; border-radius: 50%; right: -30px; top: -145px; border: 1px solid rgba(255,255,255,.08); box-shadow: 0 0 0 50px rgba(255,255,255,.025), 0 0 0 105px rgba(255,255,255,.02); }
.hero-kicker { font-size: 9px; font-weight: 700; letter-spacing: 2px; color: #c0d0c7; margin: 0 0 12px; }
.hero h2 { font-size: clamp(28px, 3vw, 42px); letter-spacing: .4px; line-height: 1.05; margin: 0 0 10px; }
.hero h2 em { color: #f2c66f; font-family: "Playfair Display", serif; font-weight: 700; font-style: italic; letter-spacing: 0; }
.hero-sub { color: #f2c66f; font-family: "Playfair Display", serif; font-size: 22px; line-height: 1.2; margin: 0 0 12px; max-width: 440px; }
.hero p:not(.hero-kicker):not(.hero-sub) { color: #c8d5ce; font-size: 12px; line-height: 19px; max-width: 440px; margin: 0 0 23px; }
.hero-illustration { height: 220px; position: relative; z-index: 1; }
.bag {
  position: absolute; width: 165px; height: 146px; background: #ecb85b; border-radius: 5px 5px 22px 22px;
  right: 20%; bottom: -18px; transform: rotate(3deg); box-shadow: 10px 14px 0 rgba(0,0,0,.06);
}
.bag::before { content: ""; position: absolute; width: 80px; height: 60px; border: 7px solid #e9a839; border-bottom: 0; border-radius: 50px 50px 0 0; left: 36px; top: -48px; }
.bag span { position: absolute; inset: 39px auto auto 53px; width: 58px; height: 58px; display: grid; place-items: center; color: white; background: var(--forest); border-radius: 50%; font: 32px Georgia; }
.bag i { position: absolute; width: 21px; height: 36px; background: #e46e56; top: -18px; border-radius: 50% 50% 5px 5px; }
.bag i:first-of-type { left: 14px; transform: rotate(-15deg); }
.bag i:last-of-type { right: 9px; background: #e8d69e; transform: rotate(18deg); height: 50px; top: -31px; }
.price-bubble { position: absolute; z-index: 2; right: 4%; top: 3px; background: var(--paper); color: var(--ink); padding: 12px 17px; border-radius: 12px; transform: rotate(5deg); box-shadow: var(--shadow); }
.price-bubble::after { content: ""; position: absolute; bottom: -7px; left: 15px; width: 15px; height: 15px; background: var(--paper); transform: rotate(45deg); }
.price-bubble small, .price-bubble strong { display: block; }
.price-bubble small { font-size: 7px; letter-spacing: 1.5px; }
.price-bubble strong { color: var(--coral); font-size: 22px; margin-top: 2px; }

.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; margin: 18px 0 32px; }
.stat-card { display: flex; align-items: center; gap: 14px; min-height: 86px; background: var(--paper); border: 1px solid var(--line); border-radius: 15px; padding: 15px 20px; }
.stat-card strong, .stat-card small { display: block; }
.stat-card strong { font-size: 21px; }
.stat-card small { color: var(--muted); font-size: 10px; margin-top: 2px; }
.stat-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 13px; font-weight: 700; }
.stat-icon.mint { background: var(--mint); color: var(--accent); }
.stat-icon.coral { background: var(--pill-bg); color: var(--coral); }
.stat-icon.gold { background: var(--gold-bg); color: var(--gold-ink); }
.section-heading, .page-heading { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin: 0 0 16px; }
.section-heading h3, .page-heading h2 { margin: 3px 0 0; }
.section-heading h3 { font-size: 22px; }
.page-heading { min-height: 90px; align-items: center; }
.page-heading h2 { font-size: 30px; }
.page-heading p:not(.eyebrow) { color: var(--muted); font-size: 12px; margin: 6px 0 0; }
.deal-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.deal-card { background: var(--paper); border: 1px solid var(--line); border-radius: 15px; padding: 17px; min-width: 0; }
.deal-card .deal-top { display: flex; justify-content: space-between; align-items: start; }
.product-glyph { width: 50px; height: 50px; border-radius: 13px; background: var(--mint); display: grid; place-items: center; font-size: 24px; }
.deal-pill { border-radius: 20px; background: var(--pill-bg); color: var(--pill); font-size: 8px; font-weight: 700; padding: 5px 8px; }
.deal-card h4 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin: 13px 0 4px; font-size: 13px; }
.deal-card .item-number { color: var(--muted); font-size: 9px; }
.deal-where { display: block; margin-top: 8px; color: var(--accent); font-size: 13px; font-weight: 700; line-height: 1.35; white-space: normal; }
.price-row { display: flex; justify-content: space-between; align-items: end; margin-top: 13px; padding-top: 10px; border-top: 1px solid var(--line); }
.price-row strong { color: var(--coral); font-size: 18px; }
.price-row span { color: var(--muted); font-size: 9px; text-decoration: line-through; }
.money-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-top: 22px; }
.money-grid .stat-card { align-items: flex-start; }
.money-grid p { color: var(--muted); font-size: 11px; line-height: 16px; margin: 6px 0 0; }
.deal-name, .item-name { border: 0; background: none; color: inherit; font: inherit; font-weight: 700; cursor: pointer; text-align: left; padding: 0; }
.deal-name { display: block; width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin: 13px 0 4px; font-size: 13px; }
.item-name { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.deal-name:hover, .item-name:hover { color: var(--accent); }
.dismiss-deal { margin-top: 10px; }
.history-chart { margin-top: 18px; }
.history-chart svg { width: 100%; height: auto; display: block; }
.history-chart .axis { stroke: var(--line); }
.price-place { color: var(--accent); font-weight: 700; }
.history-chart .line { fill: none; stroke-width: 2.5; }
.history-legend .series-swatch { width: 9px; height: 9px; border-radius: 50%; display: inline-block; margin-right: 6px; }
.history-chart .point { fill: var(--forest); }
.history-chart .paid-point { fill: #e0b15a; }
.history-chart .match-window { fill: #e0b15a; opacity: 0.18; }
.history-chart .match-deadline { stroke: #c4923a; stroke-width: 1.75; stroke-dasharray: 3 4; }
.history-legend { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; margin: 8px 0 0; color: var(--muted); font-size: 11px; }
.history-legend span { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; }
.history-legend .paid-swatch { background: #e0b15a; }
.history-legend .check-swatch { background: var(--forest); }
.history-legend .match-swatch { width: 16px; height: 0; border-radius: 0; border-top: 2px dashed #c4923a; background: transparent; }
.history-chart text { fill: var(--muted); font-size: 11px; font-family: inherit; }
.history-empty { margin: 12px 0 0; color: var(--muted); font-size: 12px; }
.insight-banner { margin-top: 22px; border: 1px solid var(--insight-line); background: var(--insight-bg); border-radius: 15px; padding: 18px 22px; display: flex; align-items: center; gap: 15px; }
.insight-icon { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; flex: 0 0 auto; background: var(--forest); color: #f4ca70; }
.insight-banner div { flex: 1; }
.insight-banner strong { font-size: 12px; }
.insight-banner p { display: inline; margin-left: 9px; color: var(--insight-text); font-size: 11px; }

.search { background: var(--paper); border: 1px solid var(--line); border-radius: 11px; padding: 9px 13px; display: flex; gap: 9px; align-items: center; }
.search input { border: 0; outline: 0; background: transparent; color: var(--ink); width: min(260px, 35vw); font-size: 12px; }
.filter-row { display: flex; gap: 8px; margin-bottom: 15px; }
.chip { border: 1px solid var(--line); border-radius: 20px; background: var(--paper); padding: 7px 13px; font-size: 11px; cursor: pointer; }
.chip.active { background: var(--forest); border-color: var(--forest); color: white; }
.item-list, .receipt-list, .alert-list, .check-list, .check-preview { display: grid; gap: 10px; }
.check-preview { grid-template-columns: repeat(4, 1fr); margin-bottom: 28px; }
.check-row {
  display: grid; grid-template-columns: minmax(220px, 1.6fr) minmax(280px, 1fr); gap: 16px; align-items: center;
  background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 15px 18px;
}
.check-actions { display: flex; gap: 8px; align-items: end; justify-content: end; flex-wrap: wrap; }
.check-actions label { color: var(--muted); font-size: 8px; }
.check-actions input { width: 92px; margin-top: 4px; padding: 9px; border: 1px solid var(--line); border-radius: 8px; background: var(--input-bg); color: var(--ink); }
.page-heading label { color: var(--muted); font-size: 9px; }
.page-heading label input { display: block; margin-top: 4px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; min-width: 220px; background: var(--input-bg); color: var(--ink); }
.check-heading-actions { display: flex; gap: 9px; align-items: center; flex-wrap: wrap; }
.check-heading-actions a { text-decoration: none; }
.item-row {
  display: grid; grid-template-columns: minmax(210px, 1.8fr) repeat(3, minmax(95px, .65fr)) 90px; gap: 18px; align-items: center;
  background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 15px 18px;
}
.item-identity { display: flex; align-items: center; gap: 13px; min-width: 0; }
.item-identity div:last-child { min-width: 0; }
.item-identity strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.item-identity small, .data-cell small { color: var(--muted); display: block; font-size: 9px; margin-top: 3px; white-space: nowrap; }
.data-cell strong { font-size: 13px; }
.down-price { color: var(--coral); }
.aged-price { color: var(--gold-ink); }
.out-of-stock { color: var(--muted); font-size: 12px; }
.price-cell {
  border: 0; background: transparent; color: inherit; text-align: left; cursor: pointer;
  border-radius: 8px; padding: 6px 8px; font: inherit;
}
.price-cell:hover, .bought-cell:hover { background: var(--nav-hover); }
.bought-cell {
  border: 0; background: transparent; color: inherit; text-align: left; cursor: pointer;
  border-radius: 8px; padding: 6px 8px; font: inherit;
}
.bought-cell small { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.heading-title { display: flex; align-items: center; gap: 4px; }
.heading-title h2 { margin: 0; }
.info-button {
  width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%;
  background: transparent; display: inline-grid; place-items: center; cursor: pointer; flex: none;
}
.info-button img { display: block; width: 26px; height: 26px; }
.purchase-picks { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 14px; }
.purchase-picks p { width: 100%; margin: 0; color: var(--muted); font-size: 12px; }
.purchase-picks button {
  border: 1px solid var(--line); border-radius: 20px; background: var(--paper); color: var(--ink);
  padding: 7px 12px; font: inherit; font-size: 12px; cursor: pointer;
}
.purchase-picks button.active { background: var(--forest); border-color: var(--forest); color: white; }
.receipt-line.is-match { background: var(--nav-hover); border-radius: 10px; }
.purchase-note { color: var(--muted); font-size: 13px; margin: 8px 0 0; }
.upload-guide { display: grid; gap: 10px; margin: 14px 0 0; }
.guide-caption { margin: 0; color: var(--ink); font-size: 15px; font-weight: 700; line-height: 1.4; }
.guide-shot { position: relative; }
.guide-shot img { display: block; width: 100%; height: auto; border-radius: 12px; border: 1px solid var(--line); }
.guide-fade {
  position: absolute;
  left: 0;
  right: 0;
  background: color-mix(in srgb, var(--forest) 68%, transparent);
  pointer-events: none;
}
.guide-fade-top { top: 0; height: 27.3%; border-radius: 12px 12px 0 0; }
.guide-fade-bottom { top: 91%; bottom: 0; border-radius: 0 0 12px 12px; }
.guide-need {
  position: absolute;
  left: 3%;
  width: 94%;
  top: 27.6%;
  height: 63%;
  border: 4px solid var(--forest);
  border-radius: 8px;
  box-shadow: 0 0 0 2px #fffefa;
  pointer-events: none;
}
.guide-key { list-style: none; display: grid; gap: 10px; margin: 0 0 16px; padding: 0; }
.guide-key li { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; }
.guide-key strong { display: inline; }
.swatch-dot.blue { background: #145ca8; }
.swatch-dot.green { background: #137a42; }
.swatch-dot.orange { background: #c45c2a; }
.guide-copy { display: grid; gap: 10px; font-size: 14px; }
.guide-copy p, .guide-copy ul { margin: 0; }
.guide-copy ul { padding-left: 18px; display: grid; gap: 6px; }
.price-spinner {
  display: inline-block; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid var(--line); border-top-color: var(--forest); animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.watch-toggle { display: flex; flex-direction: column; align-items: end; gap: 4px; }
.watch-toggle span { color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.switch { width: 39px; height: 22px; border: 0; background: #c9cec9; padding: 3px; border-radius: 30px; cursor: pointer; }
.switch::after { content: ""; display: block; width: 16px; height: 16px; border-radius: 50%; background: white; transition: .2s; }
.switch.on { background: var(--forest); }
.switch.on::after { transform: translateX(17px); }
.empty-state { background: var(--paper); border: 1px dashed var(--line); border-radius: 15px; text-align: center; padding: 50px; color: var(--muted); }
.receipt-card { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.receipt-card.open { border-color: var(--forest-2); }
.receipt-summary { display: flex; align-items: center; }
.receipt-row {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 15px; background: transparent; border: 0;
  color: inherit; text-align: left; padding: 17px 8px 17px 17px; cursor: pointer;
}
.receipt-row:hover { background: var(--nav-hover); }
.receipt-chevron { color: var(--muted); width: 18px; text-align: center; flex: 0 0 auto; }
.receipt-row .receipt-icon, .alert-row .alert-icon { width: 45px; height: 45px; display: grid; place-items: center; border-radius: 12px; background: var(--mint); color: var(--accent); flex: 0 0 auto; }
.receipt-row > div:nth-child(2), .alert-row > div:nth-child(2) { flex: 1; min-width: 0; }
.receipt-row strong, .alert-row strong { display: block; font-size: 13px; }
.receipt-row small, .alert-row small { color: var(--muted); font-size: 10px; }
.receipt-total { text-align: right; }
.receipt-total small { display: block; }
.receipt-actions { display: flex; gap: 7px; padding-right: 17px; flex: 0 0 auto; }
.receipt-detail { padding: 0 17px 16px 77px; }
.receipt-lines { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.receipt-line {
  display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 14px; align-items: center;
  padding: 10px 12px; background: var(--soft); border-radius: 10px;
}
.receipt-line > div { min-width: 0; }
.receipt-line strong, .receipt-line small { display: block; }
.receipt-line strong { font-size: 13px; }
.receipt-line small { color: var(--muted); font-size: 10px; margin-top: 2px; }
.receipt-line-qty, .receipt-line-cost { font-size: 13px; font-weight: 700; text-align: right; white-space: nowrap; }
.alert-row { display: flex; align-items: center; gap: 15px; background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 17px; }
.alert-row.unread { border-left: 4px solid var(--coral); }
.settings-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.settings-card { background: var(--paper); border: 1px solid var(--line); border-radius: 15px; padding: 22px; display: flex; gap: 16px; }
.settings-card > span { width: 43px; height: 43px; border-radius: 12px; background: var(--mint); color: var(--accent); display: grid; place-items: center; flex: 0 0 auto; }
.settings-card h3 { margin: 1px 0 7px; font-size: 15px; }
.settings-card p { color: var(--muted); font-size: 11px; line-height: 17px; margin: 0 0 9px; }
.settings-card strong { color: var(--status-strong); font-size: 10px; }
.theme-toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.theme-toggle strong { font-size: 12px; color: var(--ink); }
.settings-card .status-warning { color: #b65a43; }
.settings-card.wide-card { grid-column: 1 / -1; }
.settings-card .secondary-button { margin-top: 12px; }
.choice-list { display: grid; gap: 10px; margin-top: 4px; }
.choice-list label { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: 14px; }
.choice-later { color: var(--muted); }
.settings-label { display: block; margin-top: 8px; color: var(--muted); font-size: 12px; }
.access-address { color: var(--ink); font-weight: 700; font-size: 14px; word-break: break-all; white-space: pre-line; }
.access-code-field { font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; }
.login-screen { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--cream); }
.login-card { width: min(420px, 100%); background: var(--paper); border: 1px solid var(--line); border-radius: 18px; padding: 28px 24px; box-shadow: var(--shadow); }
.login-card h1 { font-family: "Playfair Display", serif; font-size: 32px; margin: 8px 0 10px; }
.login-card p { color: var(--muted); margin: 0 0 16px; }
.login-card .settings-field { width: 100%; margin-bottom: 12px; letter-spacing: 0.12em; text-transform: uppercase; }
.login-error { color: var(--danger); min-height: 18px; margin: 0 0 8px; }
.profile-gate { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 24px; background: var(--cream); overflow: auto; }
.profile-gate[hidden] { display: none; }
.profile-gate .login-card { margin: auto; }
.browser-banner { margin: 0 0 12px; padding: 12px 14px; border-radius: 12px; background: var(--insight-bg); color: var(--ink); border: 1px solid var(--insight-line); font-size: 14px; font-weight: 600; line-height: 1.45; }
.settings-field { display: block; width: 100%; margin-top: 6px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--input-bg); color: var(--ink); font-size: 16px; }
.settings-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.settings-actions .secondary-button, .settings-actions .file-choice { margin-top: 0; }
.price-key { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 0 0 8px; color: var(--muted); font-size: 12px; line-height: 1.4; }
.stock-note { margin: 0 0 14px; color: var(--muted); font-size: 12px; line-height: 1.45; max-width: 720px; }
.price-key span { display: inline-flex; align-items: center; gap: 7px; }
.swatch-dot { width: 10px; height: 10px; border-radius: 50%; flex: 0 0 auto; }
.swatch-dot.red { background: var(--coral); }
.swatch-dot.yellow { background: var(--gold-ink); }
.source-detail { display: block; color: var(--muted); font-size: 9px; margin-top: 5px; }
.source-links { display: flex; flex-wrap: wrap; gap: 5px 12px; margin-top: 10px; }
.source-links a { color: var(--accent); font-size: 9px; font-weight: 700; }

dialog { width: min(670px, calc(100% - 28px)); max-height: calc(100vh - 28px); max-height: calc(100dvh - 28px); padding: 0; border: 0; border-radius: 20px; background: var(--paper); color: var(--ink); box-shadow: 0 25px 80px rgba(15,36,27,.3); overflow: auto; }
#receipt-guide-dialog[open] {
  position: fixed; z-index: 40; overflow: auto;
  top: max(14px, env(safe-area-inset-top)); margin-top: 0;
  max-height: calc(100dvh - 28px - env(safe-area-inset-bottom));
}
#receipt-guide-dialog .upload-mark { background: var(--mint); }
#receipt-guide-dialog .upload-mark img { width: 28px; height: 28px; display: block; }
dialog::backdrop { background: rgba(16,38,29,.62); backdrop-filter: blur(3px); }
.dialog-shell { padding: 28px; position: relative; }
.dialog-close { position: absolute; top: 17px; right: 18px; border: 0; background: var(--close-bg); color: var(--ink); width: 31px; height: 31px; border-radius: 50%; font-size: 20px; cursor: pointer; }
.dialog-heading { display: flex; gap: 14px; align-items: center; }
.dialog-heading h2 { margin: 2px 0; font-size: 24px; }
.dialog-heading p:not(.eyebrow) { margin: 0; color: var(--muted); font-size: 11px; }
.upload-mark { width: 49px; height: 49px; border-radius: 14px; display: grid; place-items: center; background: var(--forest); color: white; font-size: 23px; }
.stepper { display: grid; grid-template-columns: auto 1fr auto 1fr auto; align-items: center; margin: 24px 15px; }
.stepper span { display: flex; align-items: center; gap: 6px; width: 25px; height: 25px; border-radius: 50%; justify-content: center; background: var(--stepper); color: var(--stepper-ink); font-size: 10px; font-weight: 700; white-space: nowrap; }
.stepper span small { position: absolute; transform: translateY(23px); font-size: 8px; letter-spacing: .5px; }
.stepper span.active { color: white; background: var(--forest); }
.stepper i { height: 1px; background: var(--line); }
.drop-zone { min-height: 235px; border: 2px dashed var(--line); border-radius: 15px; display: flex; flex-direction: column; justify-content: center; align-items: center; background: var(--drop-bg); color: var(--ink); transition: .2s; }
.drop-zone:hover, .drop-zone.dragging { background: #f1f7f2; border-color: var(--forest); }
.drop-zone.has-file { border-style: solid; border-color: #78a68d; background: var(--mint); }
.drop-zone strong { font-size: 14px; margin: 13px 0 5px; }
.drop-zone small { font-size: 10px; color: var(--muted); }
.upload-choices { display: flex; gap: 9px; margin: 18px 0 12px; }
.file-choice { display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.file-choice input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.desktop-drop-hint { opacity: .8; }
.camera-icon { font-size: 36px; }
.privacy-note { margin: 12px 0; padding: 11px; border-radius: 9px; background: var(--privacy-bg); text-align: center; color: var(--muted); font-size: 9px; }
.dialog-actions { margin-top: 20px; display: flex; justify-content: flex-end; gap: 9px; }
.review-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 10px 0 14px; }
.review-meta .review-title { grid-column: 1 / -1; }
.review-meta label { color: var(--muted); font-size: 9px; }
.review-meta input, .review-line input { width: 100%; margin-top: 4px; padding: 9px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: var(--input-bg); }
.review-items { display: grid; gap: 7px; max-height: 290px; overflow: auto; padding-right: 3px; }
.review-line { display: grid; grid-template-columns: 90px 1fr 55px 76px 100px 28px; gap: 7px; align-items: end; padding: 9px; background: var(--soft); border-radius: 9px; }
.review-line label { color: var(--muted); font-size: 8px; }
.review-line .effective-price { display: block; color: var(--accent); font-weight: 700; margin-top: 4px; white-space: nowrap; }
.remove-line { border: 0; background: none; color: var(--coral); height: 34px; cursor: pointer; font-size: 17px; }
.review-warning { background: var(--warning-bg); color: var(--warning-ink); border-radius: 9px; padding: 12px; margin-bottom: 10px; font-size: 16px; line-height: 1.35; }
.review-check { margin: 0 0 12px; font-size: 16px; line-height: 1.35; font-weight: 700; }
.camera-stage { position: relative; width: 100%; aspect-ratio: 3 / 4; max-height: min(52vh, 460px); background: #111; border-radius: 16px; overflow: hidden; }
.camera-stage video, .camera-stage img { width: 100%; height: 100%; object-fit: contain; background: #111; }
.camera-frame { position: absolute; inset: 8% 12%; border: 4px solid #fffefa; border-radius: 12px; box-shadow: 0 0 0 4px var(--forest), 0 0 0 2000px rgba(0, 0, 0, .35); pointer-events: none; }
.camera-focus { position: absolute; width: 72px; height: 72px; margin: -36px 0 0 -36px; border: 3px solid #fffefa; border-radius: 8px; pointer-events: none; }
.camera-coach { margin: 14px 0 6px; font-size: 22px; line-height: 1.3; font-weight: 700; text-align: center; }
.camera-help { margin: 0 0 12px; font-size: 16px; line-height: 1.35; text-align: center; color: var(--muted); }
.camera-actions { display: grid; gap: 10px; }
.camera-actions .wide { width: 100%; min-height: 56px; font-size: 20px; }
.camera-shutter { min-height: 64px; font-size: 22px; }
.review-tools { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 10px; }
.screenshot-count { margin: 0 0 10px; color: var(--muted); font-size: 11px; }
.upload-mode { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.mode-choice { border: 1px solid var(--line); background: var(--paper); color: var(--ink); border-radius: 12px; padding: 10px 12px; text-align: left; cursor: pointer; }
.mode-choice small { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; font-weight: 500; line-height: 1.35; }
.mode-choice.active { background: var(--forest); border-color: var(--forest); color: white; }
.mode-choice.active small { color: rgba(255,255,255,.82); }
.bulk-summary { margin: 0 0 12px; color: var(--muted); font-size: 12px; }
.bulk-list { display: grid; gap: 10px; max-height: min(420px, 50vh); overflow: auto; padding-right: 3px; }
.bulk-card { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 12px; padding: 10px; background: var(--soft); border: 1px solid transparent; border-radius: 12px; }
.bulk-card.needs-look { border-color: var(--danger-line); background: var(--danger-bg); }
.bulk-thumb { width: 72px; height: 96px; padding: 0; border: 0; border-radius: 8px; background: var(--paper); cursor: zoom-in; }
.bulk-thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: 8px; display: block; }
#photo-zoom { width: min(1100px, calc(100vw - 32px)); height: min(92vh, 980px); padding: 0; background: #0e1713; overflow: hidden; }
.photo-zoom-close {
  position: absolute; top: 14px; right: 14px; z-index: 2; width: 42px; height: 42px; border-radius: 50%;
  border: 2px solid var(--forest); background: var(--paper); color: var(--forest); font-size: 26px; line-height: 1; cursor: pointer;
}
.photo-zoom-stage { width: 100%; height: 100%; overflow: hidden; display: grid; place-items: center; cursor: zoom-in; touch-action: none; }
.photo-zoom-stage.is-zoomed { cursor: grab; }
.photo-zoom-stage.is-dragging { cursor: grabbing; }
.photo-zoom-stage img { max-width: 100%; max-height: 100%; transform-origin: center center; user-select: none; -webkit-user-drag: none; }
.bulk-card h3 { margin: 0 0 2px; font-size: 15px; }
.bulk-file { display: block; color: var(--muted); font-size: 10px; margin-bottom: 4px; overflow-wrap: anywhere; }
.bulk-card p { margin: 0; font-size: 12px; line-height: 1.4; }
.bulk-card-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 8px; }
.bulk-card-actions .text-button { padding: 8px 4px; }
.receipt-viewer-shell { padding: 26px; position: relative; }
.receipt-viewer-shell .dialog-heading { padding-right: 42px; align-items: flex-start; }
.viewer-title-block { min-width: 0; flex: 1; }
.viewer-title { display: flex; align-items: center; gap: 8px; min-width: 0; flex-wrap: wrap; }
.viewer-title h2 { margin: 2px 0; overflow-wrap: anywhere; }
.title-pencil, .receipt-edit { border: 0; cursor: pointer; display: grid; place-items: center; color: var(--accent); }
.title-pencil svg, .receipt-edit svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.title-pencil { width: 28px; height: 28px; border-radius: 8px; background: var(--mint); flex: none; }
.title-pencil svg { width: 14px; height: 14px; }
.receipt-edit { width: 52px; height: 52px; margin-left: auto; border-radius: 16px; background: var(--forest); color: white; flex: none; }
.receipt-edit svg { width: 26px; height: 26px; }
.rename-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.rename-form[hidden] { display: none; }
.rename-form input { padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--input-bg); color: var(--ink); min-width: min(220px, 100%); }
.receipt-gallery { display: grid; gap: 16px; margin-top: 18px; }
.receipt-gallery figure { margin: 0; }
.receipt-gallery figcaption { color: var(--muted); font-size: 11px; letter-spacing: .04em; margin-bottom: 6px; }
.receipt-gallery img { display: block; width: 100%; height: auto; border-radius: 12px; background: var(--soft); }
.toast { position: fixed; left: 50%; bottom: 25px; z-index: 50; transform: translate(-50%, 100px); opacity: 0; background: var(--forest); color: white; border-radius: 10px; padding: 12px 18px; font-size: 12px; box-shadow: var(--shadow); transition: .25s; }
.toast.show { transform: translate(-50%, 0); opacity: 1; }
.mobile-nav { display: none; }

@media (max-width: 1020px) {
  .deal-grid, .check-preview { grid-template-columns: repeat(2, 1fr); }
  .item-row { grid-template-columns: minmax(140px, 1.4fr) repeat(2, minmax(88px, 100px)) 70px; gap: 12px; }
  .item-row .hide-tablet { display: none; }
}

@media (max-width: 760px) {
  .sidebar { display: none; }
  main { margin: 0; padding: 0 16px 128px; }
  .topbar { min-height: 85px; }
  .topbar h1 { font-size: 20px; }
  .top-actions .primary-button { display: none; }
  .hero { min-height: 350px; grid-template-columns: 1fr; padding: 30px 25px; align-items: start; }
  .hero > div:first-child { z-index: 2; }
  .hero h2 { font-size: 32px; }
  .hero-sub, .hero p:not(.hero-kicker):not(.hero-sub) { max-width: 290px; }
  .hero-illustration { position: absolute; right: -25px; bottom: -5px; width: 220px; transform: scale(.73); transform-origin: bottom right; }
  .price-bubble { right: 8%; top: 25px; }
  .stat-grid { grid-template-columns: 1fr; gap: 8px; }
  .stat-card { min-height: 67px; }
  .deal-grid, .check-preview { display: flex; overflow: auto; scroll-snap-type: x mandatory; padding-bottom: 8px; }
  .deal-card { min-width: 205px; scroll-snap-align: start; }
  .money-grid { grid-template-columns: 1fr; }
  .page-heading { align-items: flex-start; flex-direction: column; padding: 20px 0 7px; }
  .page-heading .primary-button { width: 100%; }
  .search { width: 100%; }
  .search input { width: 100%; }
  .item-row {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "identity watch" "bought price";
    gap: 8px 12px;
    align-items: start;
  }
  .item-identity { grid-area: identity; }
  .watch-toggle { grid-area: watch; align-self: center; }
  .item-row .data-cell { display: none; }
  .item-row .price-cell, .item-row .bought-cell { display: block; }
  .item-row .bought-cell { grid-area: bought; text-align: left; }
  .item-row .price-cell { grid-area: price; justify-self: end; text-align: right; max-width: 168px; }
  .item-row .price-cell small, .item-row .bought-cell small { white-space: normal; }
  .settings-grid { grid-template-columns: 1fr; }
  .mobile-nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
    display: flex; flex-direction: row; justify-content: center; align-items: flex-end;
    gap: 28px; width: 100%; height: 92px;
    background: var(--mobile-nav); border-top: 1px solid var(--line);
    padding: 8px 0 max(12px, env(safe-area-inset-bottom));
  }
  .mobile-nav button {
    flex: 0 0 76px; width: 76px; max-width: 76px; min-width: 0;
    border: 0; background: none; color: var(--nav); font-size: 12px;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    text-align: center; gap: 5px; cursor: pointer; min-height: 64px;
  }
  .mobile-nav button span { font-size: 30px; line-height: 1; }
  .mobile-nav button.active { color: var(--accent); font-weight: 700; }
.mobile-nav .home-fab {
  flex: 0 0 68px; width: 68px; max-width: 68px; height: 68px; min-height: 68px; padding: 0; border-radius: 50%;
  align-self: center; background: var(--forest); color: white;
  transform: translateY(-18px); box-shadow: 0 8px 19px rgba(19, 59, 44, .28);
  font-size: 11px; font-weight: 700; gap: 0;
}
.mobile-nav .home-fab span { font-size: 26px; }
.mobile-nav .home-fab.active { color: white; }
  .review-line { grid-template-columns: 65px 1fr 48px 25px; }
  .review-line label:nth-child(4) { grid-column: 1 / 3; }
  .review-line label:nth-child(5) { grid-column: 3 / 5; }
  .review-line .remove-line { grid-column: 4; grid-row: 1; }
  .upload-choices { width: calc(100% - 32px); flex-direction: column; }
  .file-choice { width: 100%; min-height: 44px; }
  .desktop-drop-hint { display: none; }
  .receipt-summary { align-items: flex-start; flex-wrap: wrap; }
  .receipt-row { align-items: flex-start; flex-wrap: wrap; }
  .receipt-row > div:nth-child(2) { min-width: calc(100% - 80px); }
  .receipt-total { flex: 1; text-align: left; padding-left: 60px; }
  .receipt-actions { width: 100%; padding: 0 17px 14px 77px; }
  .receipt-detail { padding-left: 17px; }
  .receipt-line { gap: 10px; }
  .receipt-actions .compact { min-height: 39px; }
  .receipt-viewer-shell { padding: 20px 15px 15px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}
