:root {
  --ink: #173b2b;
  --ink-soft: #426052;
  --cream: #f4f0e7;
  --paper: #fffdf8;
  --line: #d6d3c8;
  --lime: #d8ff62;
  --coral: #ff745c;
  --gold: #f2bd45;
  --shadow: 0 14px 35px rgba(23, 59, 43, .09);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.45;
}
button, input, select { font: inherit; }
button { cursor: pointer; }
body:not(.authenticated) > .topbar, body:not(.authenticated) > main { display: none; }
body.authenticated .auth-shell { display: none; }

.site-tour[hidden] { display: none; }
.site-tour { position: fixed; z-index: 1200; inset: 0; pointer-events: none; }
.site-tour-card { position: fixed; right: clamp(14px, 4vw, 54px); bottom: clamp(14px, 4vw, 42px); width: min(440px, calc(100vw - 28px)); padding: 20px; color: var(--ink); background: var(--paper); border: 2px solid var(--coral); border-radius: 20px; box-shadow: 0 24px 70px rgba(30,39,44,.28); pointer-events: auto; }
.site-tour-card:focus { outline: none; }
.site-tour-card-heading { display: flex; align-items: center; gap: 12px; }
.site-tour-card-heading img { width: 58px; height: 54px; object-fit: contain; }
.site-tour-card-heading span { display: block; margin-bottom: 3px; color: var(--coral); font-size: 10px; font-weight: 850; letter-spacing: .1em; text-transform: uppercase; }
.site-tour-card h2 { margin: 0; font-size: 23px; letter-spacing: -.025em; line-height: 1.1; }
.site-tour-card > p { margin: 14px 0 18px; color: var(--ink-soft); font-size: 14px; line-height: 1.5; }
.site-tour-actions { display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 9px; }
.site-tour-actions .text-button { color: var(--ink-soft); }
.site-tour-highlight { position: relative; z-index: 20; border-radius: 14px; outline: 4px solid var(--coral); outline-offset: 5px; box-shadow: 0 0 0 9px rgba(230,126,34,.18); scroll-margin: 110px 0 280px; animation: site-tour-pulse 1.5s ease-in-out infinite; }
body.site-tour-active .topbar { z-index: 30; }
@keyframes site-tour-pulse { 50% { outline-color: var(--forest); box-shadow: 0 0 0 12px rgba(46,125,50,.13); } }

@media screen and (max-width: 560px) {
  .site-tour-card { right: 9px; bottom: 9px; width: calc(100vw - 18px); padding: 16px; }
  .site-tour-card-heading img { width: 48px; height: 44px; }
  .site-tour-card h2 { font-size: 20px; }
  .site-tour-card > p { margin: 11px 0 14px; font-size: 13px; }
  .site-tour-actions { grid-template-columns: auto 1fr auto; }
  .site-tour-actions > span { display: none; }
}

.auth-shell { display: grid; min-height: 100vh; place-items: center; padding: 28px; background: radial-gradient(circle at 80% 15%, rgba(216,255,98,.6), transparent 28%), var(--cream); }
.auth-card { width: min(100%, 470px); padding: 36px; background: var(--paper); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow); }
.auth-brand { margin-bottom: 54px; }
.auth-card h1 { margin-bottom: 16px; font-size: clamp(50px, 10vw, 76px); }
.auth-copy { margin-bottom: 26px; color: var(--ink-soft); }
.auth-form { display: grid; gap: 15px; }
.auth-form label { display: grid; gap: 7px; }
.auth-form .button { justify-self: start; margin-top: 4px; }
.text-button { padding: 4px 0; color: var(--ink); background: transparent; border: 0; font-size: 12px; font-weight: 750; text-decoration: underline; text-underline-offset: 3px; }
.auth-card > div > .text-button { margin-top: 18px; }
.auth-links { display: flex; flex-wrap: wrap; gap: 10px 18px; margin-top: 18px; }
.auth-links .text-button { margin: 0; }
.account-actions { display: flex; align-items: center; justify-self: end; gap: 12px; }
.account-button { padding: 7px 12px; color: var(--ink); background: transparent; border: 1px solid var(--line); border-radius: 100px; font-size: 12px; font-weight: 750; }
.header-signout { text-decoration: none; }
dialog { color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: 22px; box-shadow: 0 24px 70px rgba(23,59,43,.24); }
dialog::backdrop { background: rgba(17,36,28,.46); backdrop-filter: blur(3px); }
.account-dialog { width: min(94vw, 620px); max-height: 88vh; padding: 28px; overflow: auto; }
.dialog-heading { display: flex; align-items: start; justify-content: space-between; gap: 20px; }
.dialog-heading h2, .recovery-dialog h2 { margin-bottom: 8px; font-family: Georgia, serif; font-size: 38px; font-weight: 400; }
.dialog-close { display: grid; width: 34px; height: 34px; place-items: center; background: #eef0e9; border: 0; border-radius: 50%; font-size: 22px; }
.account-identity { color: var(--ink-soft); font-size: 13px; }
.auth-form.compact { margin-top: 22px; padding-top: 22px; border-top: 1px solid var(--line); }
.auth-form.compact h3 { margin-bottom: 0; }
.form-note { margin-bottom: 0; color: var(--ink-soft); font-size: 12px; }
.recovery-dialog { width: min(92vw, 520px); padding: 30px; text-align: center; }
.recovery-dialog code { display: block; margin: 22px 0; padding: 16px; overflow-wrap: anywhere; color: var(--ink); background: #eef0e9; border-radius: 12px; font-size: 18px; font-weight: 800; user-select: all; }

.topbar {
  position: sticky;
  z-index: 10;
  top: 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 20px;
  min-height: 74px;
  padding: 12px clamp(20px, 5vw, 72px);
  background: rgba(244, 240, 231, .9);
  border-bottom: 1px solid rgba(23, 59, 43, .13);
  backdrop-filter: blur(12px);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 750; text-decoration: none; letter-spacing: -.03em; }
.brand-mark { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 50% 50% 50% 12%; background: var(--ink); color: var(--lime); font-family: Georgia, serif; font-size: 21px; }
.topbar > .button { justify-self: end; }
.scan-state { display: flex; align-items: center; gap: 8px; color: var(--ink-soft); font-size: 13px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #9caa9f; box-shadow: 0 0 0 4px rgba(156, 170, 159, .16); }
.scan-state.running .status-dot { background: var(--gold); animation: pulse 1.1s infinite; }
.scan-state.completed .status-dot { background: #2f9f61; }
.scan-state.failed .status-dot { background: var(--coral); }

main { width: min(1320px, calc(100% - 40px)); margin: 0 auto; padding-bottom: 80px; }
.hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 40px; min-height: 410px; padding: 74px 0 54px; border-bottom: 1px solid var(--line); }
.eyebrow { margin: 0 0 14px; color: var(--ink-soft); font-size: 12px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { max-width: 920px; margin-bottom: 22px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(48px, 7.5vw, 104px); font-weight: 400; letter-spacing: -.055em; line-height: .91; }
.lede { max-width: 710px; margin-bottom: 0; color: var(--ink-soft); font-size: clamp(16px, 2vw, 20px); }
.hero-note { display: flex; align-items: baseline; gap: 10px; padding: 18px 22px; background: var(--lime); border-radius: 100px; transform: rotate(-3deg); white-space: nowrap; }
.note-number { font-family: Georgia, serif; font-size: 54px; line-height: .8; }
.hero-note span:last-child { font-size: 12px; font-weight: 800; line-height: 1.1; text-transform: uppercase; }

.setup-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; padding: 24px 0 70px; }
.sale-only .setup-grid { grid-template-columns: 1fr; }
.sale-only .report-section { padding-bottom: 70px; }
.panel { min-width: 0; padding: 26px; background: var(--paper); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); }
.panel-heading, .panel-heading > div, .section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.panel-heading { margin-bottom: 24px; }
.panel-heading h2 { margin: 0; font-family: Georgia, serif; font-size: 30px; font-weight: 400; letter-spacing: -.03em; }
.list-heading-actions { display: flex; align-items: center; gap: 12px; }
.clear-list-button { color: #8f2f21; }
.clear-list-button:disabled { color: var(--ink-soft); cursor: default; opacity: .45; }
.step { display: grid; width: 30px; height: 30px; place-items: center; margin-right: 10px; border: 1px solid var(--ink); border-radius: 50%; font-size: 10px; font-weight: 800; }
.count, .report-meta { color: var(--ink-soft); font-size: 12px; }
.entry-form { display: flex; align-items: end; gap: 10px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.entry-form label { display: grid; gap: 7px; min-width: 120px; }
.entry-form label.grow { flex: 1; }
.entry-form label.short { min-width: 90px; width: 96px; }
label span { color: var(--ink-soft); font-size: 11px; font-weight: 750; text-transform: uppercase; letter-spacing: .08em; }
input { width: 100%; min-height: 44px; padding: 9px 12px; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 10px; outline: none; }
select { min-height: 42px; padding: 8px 34px 8px 12px; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 10px; }
input:focus { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(23, 59, 43, .09); }
.button { min-height: 42px; padding: 9px 17px; border: 0; border-radius: 100px; font-weight: 750; white-space: nowrap; transition: transform .15s ease, opacity .15s ease; }
.button:hover { transform: translateY(-1px); }
.button:disabled { cursor: wait; opacity: .55; transform: none; }
.button.primary { background: var(--lime); color: var(--ink); }
.button.dark { background: var(--ink); color: #fff; }
.saved-list { display: grid; gap: 9px; min-height: 42px; padding-top: 18px; }
.directory-note { margin: 0 0 16px; color: var(--ink-soft); font-size: 13px; }
.store-bulk-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin: -5px 0 12px; }
.store-bulk-actions > span { margin-right: auto; color: var(--ink-soft); font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.store-bulk-actions .text-button { font-size: 10px; }
.store-directory { display: grid; gap: 8px; max-height: 430px; overflow: auto; padding-right: 4px; }
.store-directory-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: #f2f2eb; border-radius: 12px; }
.store-directory-item.excluded { background: #e8e9e3; opacity: .62; }
.store-directory-item > div { min-width: 0; flex: 1; }
.store-directory-item strong, .store-directory-item small { display: block; }
.store-directory-item strong { font-size: 13px; }
.store-directory-item small { overflow: hidden; color: var(--ink-soft); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.store-directory-item .source-price-count { color: var(--forest); font-weight: 750; }
.coverage-badge { flex: 0 0 auto; padding: 4px 7px; border-radius: 100px; font-size: 9px; font-weight: 850; letter-spacing: .05em; text-transform: uppercase; }
.coverage-badge.live { background: var(--lime); }
.coverage-badge.partial { color: #594200; background: #f3d66e; }
.coverage-badge.directory { color: var(--ink-soft); background: #dedfd8; }
.store-choice { display: grid; flex: 0 0 auto; justify-items: center; gap: 2px; cursor: pointer; }
.store-choice input { width: 18px; min-height: 18px; margin: 0; padding: 0; accent-color: var(--ink); cursor: pointer; }
.store-choice span { font-size: 8px; letter-spacing: .05em; }
.saved-pill { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto auto; align-items: center; gap: 8px; width: 100%; min-width: 0; padding: 9px 10px 9px 7px; border-radius: 14px; background: #eef0e9; font-size: 13px; }
.saved-pill strong { min-width: 0; overflow-wrap: anywhere; white-space: normal; }
.saved-pill small { color: var(--ink-soft); }
.remove { display: grid; width: 24px; height: 24px; flex: 0 0 auto; place-items: center; border: 0; border-radius: 50%; background: rgba(23, 59, 43, .1); color: var(--ink); }
.remove:hover, .remove:focus-visible { color: #fff; background: #a33d2d; outline: none; }
.sortable-item { padding-left: 7px; cursor: grab; user-select: none; transition: opacity .15s ease, transform .15s ease, box-shadow .15s ease; }
.sortable-item:active { cursor: grabbing; }
.sortable-item.dragging { opacity: .45; transform: scale(.98); box-shadow: 0 0 0 2px var(--ink); }
.drag-handle { display: grid; width: 24px; height: 24px; flex: 0 0 auto; place-items: center; padding: 0; color: #718178; background: transparent; border: 0; border-radius: 50%; font-size: 17px; line-height: 1; cursor: grab; }
.drag-handle:hover, .drag-handle:focus-visible { color: var(--ink); background: rgba(23, 59, 43, .08); outline: none; }
.item-name { min-width: 0; line-height: 1.3; }
.item-setting { display: grid; flex: 0 0 auto; grid-template-columns: auto 46px; align-items: center; gap: 5px; padding-left: 8px; border-left: 1px solid rgba(23,59,43,.13); }
.item-setting span { font-size: 9px; white-space: nowrap; }
.item-setting input { width: 46px; min-height: 30px; padding: 4px 6px; border-radius: 8px; font-size: 12px; }
.item-setting.quantity-setting { grid-template-columns: auto auto; }
.quantity-stepper { display: inline-flex; align-items: center; overflow: hidden; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.quantity-stepper button { display: grid; width: 29px; height: 30px; place-items: center; padding: 0; color: var(--ink); background: #fff; border: 0; font-size: 17px; font-weight: 750; }
.quantity-stepper button:hover, .quantity-stepper button:focus-visible { background: var(--lime); outline: none; }
.quantity-stepper .quantity-step-remove { color: #8f3529; font-size: 11px; }
.quantity-stepper .quantity-step-remove:hover, .quantity-stepper .quantity-step-remove:focus-visible { color: #fff; background: #a33d2d; }
.quantity-stepper input { width: 38px; min-height: 30px; padding: 3px; border: 0; border-right: 1px solid var(--line); border-left: 1px solid var(--line); border-radius: 0; text-align: center; box-shadow: none; }
.item-setting.alert-setting { grid-template-columns: auto 66px; }
.item-setting.alert-setting input { width: 66px; }
.empty { margin: 4px 0; color: #718178; font-size: 13px; }

.scan-console { margin-bottom: 64px; padding: 26px; background: var(--ink); color: #fff; border-radius: 20px; box-shadow: var(--shadow); }
.console-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; }
.console-heading .eyebrow { color: #bfd0c5; }
.console-heading h2 { margin: 0; font-family: Georgia, serif; font-size: 34px; font-weight: 400; }
.schedule-form { display: flex; align-items: end; gap: 10px; }
.schedule-form > label { display: grid; gap: 6px; }
.schedule-form label > span { color: #dbe7df; }
.schedule-form .button { color: var(--ink); background: var(--lime); }
.toggle-label { display: flex !important; min-height: 42px; align-items: center; grid-template-columns: auto 1fr; gap: 8px !important; padding: 0 12px; border: 1px solid rgba(255,255,255,.25); border-radius: 10px; }
.toggle-label input { width: 18px; min-height: 18px; accent-color: var(--lime); }
.schedule-note { margin: 12px 0 20px; color: #bfd0c5; font-size: 12px; }
.diagnostic-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; }
.diagnostic-card { padding: 14px; color: var(--ink); background: #f5f3eb; border-left: 4px solid #8fa096; border-radius: 12px; }
.diagnostic-card.completed { border-left-color: var(--lime); }
.diagnostic-card.completed_with_warnings { border-left-color: var(--gold); }
.diagnostic-card.retry_queued { border-left-color: #f5b85b; }
.diagnostic-card.shared_catalog, .diagnostic-card.skipped_shared_catalog { border-left-color: #77a6b8; }
.diagnostic-card.shared_catalog_unavailable, .diagnostic-card.blocked, .diagnostic-card.interrupted, .diagnostic-card.partial { border-left-color: #dd8d55; }
.diagnostic-card.failed { border-left-color: var(--coral); }
.diagnostic-card > div { display: flex; justify-content: space-between; gap: 10px; }
.diagnostic-card p { margin: 7px 0 0; color: var(--ink-soft); font-size: 11px; }
.diagnostic-status { font-size: 10px; font-weight: 850; letter-spacing: .06em; text-transform: uppercase; }
.diagnostic-card details { margin-top: 8px; font-size: 11px; }
.diagnostic-card pre { overflow: auto; max-height: 100px; white-space: pre-wrap; }
.scan-console .empty { color: #bfd0c5; }
.collection-console { background: #203f4b; }
.collection-controls { display: flex; align-items: end; gap: 10px; }
.collection-safety { max-width: 900px; margin: 16px 0 12px; padding: 12px 14px; color: #dcecf0; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.16); border-radius: 12px; font-size: 12px; line-height: 1.55; }
.collection-safety code { padding: 2px 5px; color: var(--lime); background: rgba(0,0,0,.18); border-radius: 5px; }
.collection-summary { display: flex; align-items: center; gap: 9px; margin: 15px 0 4px; color: #fff; font-size: 13px; font-weight: 750; }
.collection-summary .status-dot { width: 9px; height: 9px; border-radius: 50%; background: #8fa096; }
.collection-summary.running .status-dot, .collection-summary.queued .status-dot { background: #f5b85b; box-shadow: 0 0 0 4px rgba(245,184,91,.16); }
.collection-summary.completed .status-dot { background: var(--lime); }
.collection-summary.failed .status-dot { background: var(--coral); }

.report-section { padding-top: 12px; }
.section-heading { align-items: end; margin-bottom: 26px; }
.section-heading h2 { margin: 0; font-family: Georgia, serif; font-size: clamp(34px, 5vw, 58px); font-weight: 400; letter-spacing: -.045em; }
.report-heading-controls { display: grid; justify-items: end; gap: 9px; }
.deal-filter { display: grid; grid-template-columns: 20px auto; align-items: center; column-gap: 9px; padding: 10px 13px; background: var(--paper); border: 1px solid var(--line); border-radius: 13px; cursor: pointer; }
.deal-filter input { width: 18px; min-height: 18px; margin: 0; accent-color: var(--ink); }
.deal-filter span { color: var(--ink); font-size: 12px; font-weight: 800; letter-spacing: 0; text-transform: none; }
.deal-filter small { grid-column: 2; max-width: 300px; color: var(--ink-soft); font-size: 10px; }
.tabs { display: flex; gap: 8px; margin-bottom: 18px; }
.tab { padding: 10px 15px; color: var(--ink-soft); background: transparent; border: 1px solid var(--line); border-radius: 100px; font-weight: 700; }
.tab span { display: inline-grid; min-width: 22px; min-height: 22px; margin-left: 6px; place-items: center; border-radius: 50%; background: rgba(23, 59, 43, .09); font-size: 11px; }
.tab.active { color: #fff; background: var(--ink); border-color: var(--ink); }
.tab.active span { background: rgba(255, 255, 255, .14); }
.tab-panel { min-height: 180px; }
.weekly-sales { background: var(--paper); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.weekly-sales-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; padding: 20px; border-bottom: 1px solid var(--line); }
.weekly-sales-heading h3 { margin: 0; font-family: Georgia, serif; font-size: 30px; font-weight: 400; }
.weekly-sales-heading > p { max-width: 520px; margin: 0; color: var(--ink-soft); font-size: 12px; }
.weekly-view-tools { display: grid; justify-items: end; gap: 10px; max-width: 560px; }
.weekly-view-tools > p { margin: 0; color: var(--ink-soft); font-size: 12px; text-align: right; }
.weekly-view-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.weekly-view-actions .button { padding: 7px 11px; font-size: 10px; }
.flipp-preview-shell { display: grid; gap: 14px; }
.flipp-preview-heading { align-items: center; }
.flipp-preview-heading .button { flex: 0 0 auto; }
.flipp-preview-note { margin: 0; padding: 12px 14px; color: var(--ink-soft); background: rgba(23,59,43,.055); border: 1px solid var(--line); border-radius: 12px; font-size: 12px; }
.flipp-preview-status { display: flex; align-items: center; gap: 9px; margin: 0; color: var(--ink-soft); font-size: 12px; font-weight: 750; }
.flipp-preview-status.running .status-dot, .flipp-preview-status.queued .status-dot { background: var(--gold); animation: pulse 1.1s infinite; }
.flipp-preview-status.completed .status-dot { background: #2f9f61; }
.flipp-preview-status.failed .status-dot { background: var(--coral); }
.flipp-stats { display: grid; grid-template-columns: repeat(4, minmax(120px, 1fr)); gap: 9px; }
.flipp-stat { padding: 13px 15px; background: #f3f2eb; border: 1px solid var(--line); border-radius: 12px; }
.flipp-stat strong { display: block; font-size: 22px; font-variant-numeric: tabular-nums; }
.flipp-stat span { color: var(--ink-soft); font-size: 10px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.flipp-controls { display: grid; grid-template-columns: minmax(180px, 1.5fr) minmax(150px, .7fr) auto; align-items: end; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; }
.flipp-controls label { display: grid; gap: 5px; }
.flipp-controls label > span { color: var(--ink-soft); font-size: 10px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.flipp-controls .deal-filter { display: grid; grid-template-columns: 20px auto; align-self: stretch; align-content: center; }
.flipp-preview-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; border-top: 1px solid var(--line); }
.flipp-preview-footer p { margin: 0; color: var(--ink-soft); font-size: 12px; }
.watch-group { margin-bottom: 18px; background: var(--paper); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.watch-title { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 17px 20px; border-bottom: 1px solid var(--line); }
.watch-title h3 { margin: 0; font-size: 16px; }
.watch-title p { margin: 0; color: var(--ink-soft); font-size: 12px; }
.deal-table { overflow-x: auto; }
.deal-list { display: grid; min-width: 900px; }
.deal-header, .deal-row { display: grid; grid-template-columns: minmax(240px, 2.2fr) minmax(125px, .9fr) .72fr .9fr .65fr 62px; align-items: center; gap: 20px; min-width: 900px; }
.deal-header { padding: 10px 20px; color: var(--ink-soft); background: #f3f2eb; border-bottom: 1px solid var(--line); font-size: 10px; font-weight: 850; letter-spacing: .09em; text-transform: uppercase; }
.sort-button { display: inline-flex; align-items: center; gap: 5px; padding: 3px 0; color: inherit; background: transparent; border: 0; font: inherit; letter-spacing: inherit; text-align: left; text-transform: inherit; }
.sort-button::after { color: #8a978f; content: "↕"; font-size: 11px; }
.sort-button[data-sort-priority]::before { display: inline-grid; width: 16px; height: 16px; place-items: center; color: #fff; background: var(--ink); border-radius: 50%; content: attr(data-sort-priority); font-size: 9px; letter-spacing: 0; }
.sort-button.ascending::after { color: var(--ink); content: "↑"; }
.sort-button.descending::after { color: var(--ink); content: "↓"; }
.sort-button:hover, .sort-button:focus-visible { color: var(--ink); outline: none; }
.sort-button:focus-visible { text-decoration: underline; text-underline-offset: 3px; }
.table-sort-status { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 20px; color: var(--ink-soft); background: #eef0e9; border-bottom: 1px solid var(--line); font-size: 12px; animation: sort-guidance-in 160ms ease-out; }
.table-sort-status span { line-height: 1.45; }
.table-sort-status small { display: block; margin-top: 2px; font-size: 11px; }
.table-sort-status button { flex: 0 0 auto; padding: 5px 10px; color: var(--ink); background: transparent; border: 1px solid #91a097; border-radius: 999px; font-size: 11px; font-weight: 800; }
.table-sort-status button:hover, .table-sort-status button:focus-visible { color: #fff; background: var(--ink); outline: none; }
@keyframes sort-guidance-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }
.deal-row { padding: 18px 20px; color: inherit; text-decoration: none; border-bottom: 1px solid var(--line); }
.deal-row:last-child { border-bottom: 0; }
.deal-row:hover { background: #faf8f1; }
.sale-table .deal-list { min-width: 900px; }
.sale-header, .sale-row { display: grid; grid-template-columns: minmax(250px, 2fr) minmax(140px, 1fr) minmax(115px, .72fr) minmax(100px, .62fr) minmax(220px, 1.4fr) minmax(120px, .75fr); align-items: center; gap: 18px; min-width: 900px; }
.sale-header { padding: 10px 20px; color: var(--ink-soft); background: #f3f2eb; border-bottom: 1px solid var(--line); font-size: 10px; font-weight: 850; letter-spacing: .09em; text-transform: uppercase; }
.sale-row { padding: 18px 20px; border-bottom: 1px solid var(--line); }
.sale-row:last-child { border-bottom: 0; }
.sale-row:hover { background: #faf8f1; }
.sale-offer strong, .sale-source strong { display: block; font-size: 12px; }
.sale-offer small, .sale-source small { display: block; margin-top: 4px; color: var(--ink-soft); font-size: 10px; }
.promotion-kind { display: inline-block; margin-bottom: 4px; padding: 3px 7px; color: #fff; background: var(--ink); border-radius: 100px; font-size: 9px; font-weight: 850; letter-spacing: .04em; text-transform: uppercase; }
.fulfillment-badge { display: inline-block; margin: 0 0 4px 5px; padding: 3px 7px; color: #173b2b; background: #d9f5ff; border: 1px solid #87c9dc; border-radius: 100px; font-size: 9px; font-weight: 850; letter-spacing: .03em; text-transform: uppercase; vertical-align: middle; }
.promotion-filter-button { display: block; margin-top: 8px; padding: 5px 9px; color: var(--ink); background: transparent; border: 1px solid #8e9d93; border-radius: 100px; font-size: 9px; font-weight: 850; white-space: nowrap; }
.promotion-filter-button:hover, .promotion-filter-button:focus-visible, .promotion-filter-button.active { color: #fff; background: var(--ink); border-color: var(--ink); outline: none; }
.deal-product-meta .promotion-filter-button { display: inline-block; margin-top: 0; }
.qualification-warning, .qualification-met { display: grid; gap: 4px; margin-top: 9px; padding: 9px 10px; border-radius: 10px; }
.qualification-warning { color: #74311f; background: #fff0e8; border: 1px solid #efb69f; }
.qualification-warning strong { font-size: 11px; font-weight: 850; line-height: 1.4; }
.qualification-met strong { font-size: 10px; }
.qualification-warning small, .qualification-met small { margin: 0; color: inherit; line-height: 1.35; }
.qualification-met { color: #195c39; background: #edf8f0; border: 1px solid #b7d8c1; }
.quantity-filter-controls { display: flex; gap: 10px; align-items: stretch; justify-content: flex-end; flex-wrap: wrap; }
.exact-quantity-filter { display: grid; gap: 4px; min-width: 160px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.55); }
.exact-quantity-filter span { color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.filter-help-label { display: inline-flex; width: fit-content; align-items: center; gap: 5px; border-radius: 5px; cursor: help; }
.filter-help-label::after { display: inline-grid; width: 14px; height: 14px; place-items: center; color: #fff; background: var(--forest); border-radius: 50%; content: "?"; font-size: 9px; font-weight: 900; letter-spacing: 0; line-height: 1; }
.exact-quantity-filter select { min-height: 34px; padding: 5px 30px 5px 8px; }
.exact-quantity-filter select:disabled { opacity: .55; cursor: not-allowed; }
.exact-quantity-filter[hidden] { display: none; }
.condition-badge { display: inline-block; margin: 5px 0 0 7px; padding: 3px 7px; color: #71351f; background: #ffe0bf; border-radius: 100px; font-size: 9px; font-weight: 850; line-height: 1.25; vertical-align: middle; }
.quantity-condition { display: block; margin-top: 2px; color: #9a4d2d; font-size: 10px; font-style: normal; font-weight: 750; }
.deal-product { min-width: 0; }
.deal-product strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.deal-product a { color: inherit; text-decoration: none; }
.deal-product a:hover { text-decoration: underline; text-underline-offset: 2px; }
.deal-product small, .deal-metric small { display: block; margin-top: 3px; color: var(--ink-soft); font-size: 11px; }
.deal-product-meta { display: flex; align-items: center; gap: 9px; margin-top: 3px; }
.deal-product-meta small { margin: 0; }
.add-to-list-button { padding: 3px 8px; color: var(--ink); background: transparent; border: 1px solid #aeb8b0; border-radius: 100px; font-size: 9px; font-weight: 800; white-space: nowrap; }
.add-to-list-button:hover, .add-to-list-button:focus-visible { background: var(--lime); border-color: var(--ink); outline: none; }
.add-to-list-button:disabled { color: #627269; background: #eef0e9; border-color: transparent; cursor: default; }
.deal-list-controls { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 4px; }
.deal-list-controls .quantity-stepper { border-radius: 100px; }
.deal-list-controls .quantity-stepper button { width: 23px; height: 24px; font-size: 14px; }
.deal-list-controls .quantity-stepper input { width: 30px; min-height: 24px; padding: 1px 2px; font-size: 10px; }
.deal-list-remove { display: grid; width: 24px; height: 24px; place-items: center; padding: 0; color: #7a352b; background: #fff4ef; border: 1px solid #e7bbae; border-radius: 50%; font-size: 11px; line-height: 1; }
.deal-list-remove:hover, .deal-list-remove:focus-visible { color: #fff; background: #a33d2d; border-color: #a33d2d; outline: none; }
.deal-store { color: var(--ink-soft); font-size: 13px; }
.deal-store a { display: block; color: inherit; font-weight: 750; text-decoration: underline; text-decoration-color: rgba(23,59,43,.28); text-underline-offset: 2px; }
.deal-store a + a { margin-top: 4px; }
.deal-metric b { font-size: 15px; font-variant-numeric: tabular-nums; }
.deal-metric b span { color: var(--ink-soft); font-size: 11px; font-weight: 700; }
.deal-metric small strong { color: #28744a; }
.price { position: relative; padding-top: 17px; }
.price b { font-family: Georgia, serif; font-size: 25px; font-weight: 400; }
.deal-metric .original-price { margin-top: 2px; color: #6f796f; font-size: 10px; font-weight: 750; }
.original-price del { text-decoration-thickness: 1px; }
.sale-discount strong { display: block; color: var(--forest); font-size: 14px; font-variant-numeric: tabular-nums; }
.sale-discount .advertised-discount-claim { color: #8a4b00; }
.sale-discount .featured-price-label { color: var(--ink); font-size: 12px; }
.sale-discount small { display: block; margin-top: 3px; color: var(--ink-soft); font-size: 9px; }
.last-updated { position: absolute; top: 0; right: 0; color: var(--ink-soft); font-size: 8px; font-weight: 750; line-height: 1.1; white-space: nowrap; }
.last-updated-card { display: block; margin-bottom: 5px; color: var(--ink-soft); font-size: 9px; font-weight: 750; }
.card-price > div strong { display: block; }
.mini-price-chart { display: block; width: 132px; height: 42px; margin-top: 7px; overflow: visible; }
.mini-price-chart polyline { fill: none; stroke: #5c796b; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.mini-price-chart .best-price-point { fill: var(--lime); stroke: var(--ink); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.mini-chart-button { display: block; padding: 0; color: var(--ink-soft); background: transparent; border: 0; text-align: left; }
.mini-chart-button > span { display: inline-block; margin-top: 1px; font-size: 9px; font-weight: 800; text-decoration: underline; text-underline-offset: 2px; }
.mini-chart-button:hover .mini-price-chart polyline, .mini-chart-button:focus-visible .mini-price-chart polyline { stroke: var(--ink); stroke-width: 3; }
.mini-chart-button:focus-visible { border-radius: 4px; outline: 2px solid var(--ink); outline-offset: 3px; }
.no-sale-history { display: block; max-width: 145px; margin-top: 8px; color: var(--ink-soft); font-size: 9px; font-weight: 750; line-height: 1.35; }
.product-history-popover { position: fixed; z-index: 40; width: min(400px, calc(100vw - 24px)); padding: 16px; background: var(--paper); border: 1px solid var(--ink); border-radius: 15px; box-shadow: 0 18px 55px rgba(23,59,43,.24); }
.product-history-popover[hidden] { display: none; }
.product-history-heading { display: flex; align-items: start; justify-content: space-between; gap: 14px; margin-bottom: 10px; }
.product-history-heading span, .product-history-heading strong { display: block; }
.product-history-heading span { margin-bottom: 3px; color: var(--ink-soft); font-size: 9px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.product-history-heading strong { max-width: 320px; font-size: 13px; line-height: 1.25; }
.product-history-heading button { display: grid; width: 27px; height: 27px; flex: 0 0 auto; place-items: center; padding: 0; color: var(--ink); background: #eef0e9; border: 0; border-radius: 50%; font-size: 19px; }
.product-history-chart { display: block; width: 100%; height: auto; }
.product-history-chart > line { stroke: #a8aea6; stroke-width: 1; }
.product-history-chart text { fill: var(--ink-soft); font-size: 10px; }
.product-history-chart polyline { fill: none; stroke: var(--ink); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.product-history-chart circle { fill: var(--lime); stroke: var(--ink); stroke-width: 2; vector-effect: non-scaling-stroke; }
.product-history-summary { margin: 6px 0 0; color: var(--ink-soft); font-size: 10px; }
.score-cell { display: grid; justify-content: end; }
.deal-score { display: grid; width: 50px; height: 50px; place-items: center; border-radius: 50%; background: var(--lime); font-size: 13px; font-weight: 850; }
.badge { display: inline-block; margin-left: 7px; padding: 2px 7px; border-radius: 100px; background: #ffe3dc; color: #8f2f21; font-size: 10px; font-weight: 800; text-transform: uppercase; }
.empty-report { display: grid; min-height: 180px; place-items: center; padding: 32px; color: var(--ink-soft); border: 1px dashed #afb5aa; border-radius: 18px; text-align: center; }
.report-loading { display: grid; min-height: 180px; place-items: center; align-content: center; gap: 8px; color: var(--ink-soft); border: 1px dashed #afb5aa; border-radius: 18px; text-align: center; }
.report-loading span { width: 24px; height: 24px; border: 3px solid #cbd1c8; border-top-color: var(--ink); border-radius: 50%; animation: report-spin .8s linear infinite; }
.report-loading small { font-size: 11px; }
.sale-pagination { display: flex; align-items: center; justify-content: center; gap: 18px; padding: 22px; border-top: 1px solid var(--line); }
.sale-pagination p { margin: 0; color: var(--ink-soft); font-size: 11px; }
.unusual-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.deal-card { display: grid; gap: 14px; padding: 21px; color: inherit; background: var(--paper); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); }
.deal-card:hover { transform: translateY(-2px); }
.deal-card-link { display: grid; gap: 20px; color: inherit; text-decoration: none; }
.deal-card-link:hover h3 { text-decoration: underline; text-underline-offset: 3px; }
.deal-card-actions { display: flex; justify-content: flex-start; padding-top: 12px; border-top: 1px solid var(--line); }
.deal-card .card-top { display: flex; align-items: start; justify-content: space-between; gap: 16px; }
.deal-card h3 { margin: 0 0 6px; font-size: 16px; }
.deal-card p { margin: 0; color: var(--ink-soft); font-size: 12px; }
.card-price { display: flex; align-items: end; justify-content: space-between; gap: 12px; }
.card-price strong { font-family: Georgia, serif; font-size: 36px; font-weight: 400; line-height: 1; }
.savings { color: #28744a; font-size: 12px; font-weight: 800; }

.optimizer-shell { display: grid; gap: 16px; }
.optimizer-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; padding: 0 4px; }
.optimizer-heading h3 { margin: 0; font-family: Georgia, serif; font-size: 28px; font-weight: 400; }
.optimizer-heading .eyebrow { margin-bottom: 5px; }
.optimizer-actions { display: flex; gap: 14px; }
.split-plan { padding: 22px; background: var(--paper); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); }
.split-total { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.split-total h3 { margin: 0; font-family: Georgia, serif; font-size: 48px; font-weight: 400; }
.split-total p { margin: 0 0 7px; color: #28744a; font-size: 12px; font-weight: 800; }
.split-plan ul { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.split-plan li { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.split-plan li > span { min-width: 0; }
.basket-line-details { flex: 1; }
.basket-line-title { display: flex; align-items: center; gap: 10px; }
.basket-line-title > b { min-width: 0; overflow-wrap: anywhere; }
.basket-line-title .quantity-stepper { flex: 0 0 auto; }
.split-plan li small { display: block; overflow: hidden; margin-top: 2px; color: var(--ink-soft); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.split-plan li > strong { font-variant-numeric: tabular-nums; }
.optimizer-note { margin: 14px 0 0; color: var(--ink-soft); font-size: 10px; }
.alert-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.alert-card { display: grid; gap: 8px; padding: 20px; color: inherit; text-decoration: none; background: var(--paper); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); }
.alert-card h3, .alert-card p { margin: 0; }
.alert-card p { color: var(--ink-soft); font-size: 11px; }
.alert-card > div { display: flex; align-items: end; justify-content: space-between; gap: 10px; }
.alert-card > div strong { font-family: Georgia, serif; font-size: 34px; font-weight: 400; }
.alert-card > div span { color: var(--ink-soft); font-size: 11px; }
.alert-hit { justify-self: start; padding: 3px 8px; color: #173b2b; background: var(--lime); border-radius: 100px; font-size: 9px; font-weight: 850; letter-spacing: .07em; text-transform: uppercase; }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 20; max-width: 380px; padding: 12px 16px; color: #fff; background: var(--ink); border-radius: 12px; box-shadow: var(--shadow); opacity: 0; transform: translateY(10px); pointer-events: none; transition: .2s ease; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { background: #8f2f21; }
.print-sheet { display: none; }

@keyframes pulse { 50% { transform: scale(1.25); opacity: .55; } }
@keyframes report-spin { to { transform: rotate(360deg); } }

@media (max-width: 980px) {
  .setup-grid { grid-template-columns: 1fr; }
  .unusual-grid { grid-template-columns: repeat(2, 1fr); }
  .alert-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 680px) {
  .topbar { grid-template-columns: auto 1fr; gap: 10px; padding-inline: 16px; }
  .scan-state { display: none; }
  .account-actions { gap: 6px; }
  .header-signout { display: none; }
  .account-button { max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .account-actions .button { padding-inline: 12px; }
  main { width: min(100% - 28px, 1320px); }
  .hero { grid-template-columns: 1fr; min-height: auto; padding-top: 54px; }
  .hero-note { justify-self: start; }
  .entry-form { align-items: stretch; flex-direction: column; }
  .entry-form label, .entry-form label.short { width: 100%; }
  .panel { padding: 20px; }
  .sortable-item { grid-template-columns: auto minmax(0, 1fr) auto; width: 100%; border-radius: 14px; }
  .item-name { grid-column: 2; }
  .sortable-item > .remove { grid-column: 3; grid-row: 1; }
  .sortable-item > .quantity-setting { grid-column: 2; grid-row: 2; justify-self: start; }
  .sortable-item > .alert-setting { grid-column: 2; grid-row: 3; justify-self: start; }
  .item-setting { grid-template-columns: auto 42px; }
  .item-setting input { width: 42px; }
  .item-setting.quantity-setting { grid-template-columns: auto auto; }
  .quantity-stepper input { width: 38px; }
  .item-setting.alert-setting { grid-template-columns: auto 58px; }
  .item-setting.alert-setting input { width: 58px; }
  .list-heading-actions { flex-wrap: wrap; justify-content: flex-end; gap: 5px 10px; }
  .tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tab { width: 100%; padding-inline: 10px; }
  .section-heading { align-items: start; flex-direction: column; }
  .report-heading-controls { width: 100%; justify-items: stretch; }
  .weekly-sales-heading { align-items: start; flex-direction: column; }
  .weekly-view-tools { justify-items: start; max-width: none; }
  .weekly-view-tools > p { text-align: left; }
  .weekly-view-actions { justify-content: flex-start; }
  .flipp-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .flipp-controls { grid-template-columns: 1fr; }
  .console-heading, .schedule-form, .collection-controls { align-items: stretch; flex-direction: column; }
  .optimizer-heading { align-items: start; flex-direction: column; }
  .schedule-form { margin-top: 8px; }
  .unusual-grid { grid-template-columns: 1fr; }
  .alert-grid { grid-template-columns: 1fr; }
  .split-total h3 { font-size: 40px; }
  .split-plan li { align-items: start; }
  .basket-line-title { align-items: start; flex-direction: column; gap: 7px; }
  .deal-table { overflow: visible; }
  .deal-header { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px 12px; min-width: 0; padding: 10px 18px; }
  .deal-header .sort-button { font-size: 9px; }
  .table-sort-status { align-items: flex-start; flex-direction: column; gap: 6px; padding-inline: 14px; }
  .table-sort-status small { display: block; margin: 3px 0 0; }
  .deal-list { min-width: 0; }
  .deal-row { grid-template-columns: 1fr 1fr; gap: 14px 20px; min-width: 0; padding: 18px; }
  .sale-table .deal-list { min-width: 0; }
  .sale-header { display: none; }
  .sale-row { grid-template-columns: 1fr 1fr; min-width: 0; padding: 18px; }
  .sale-row > *::before { display: block; margin-bottom: 4px; color: var(--ink-soft); content: attr(data-label); font-size: 9px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
  .deal-product { grid-column: 1 / -1; }
  .deal-cell::before { display: block; margin-bottom: 3px; color: var(--ink-soft); content: attr(data-label); font-size: 9px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
  .deal-product::before { display: none; }
  .score-cell { justify-content: start; }
  .deal-score { width: 42px; height: 42px; }
}

@media print {
  @page { margin: .55in; }
  body { background: #fff; color: #111; }
  body > *:not(.print-sheet) { display: none !important; }
  .print-sheet { display: block; font-family: Arial, sans-serif; }
  .print-sheet-header { display: flex; align-items: end; justify-content: space-between; gap: 30px; padding-bottom: 18px; border-bottom: 3px solid #173b2b; }
  .print-sheet-header .eyebrow { margin-bottom: 5px; color: #173b2b; }
  .print-sheet-header h1 { margin: 0; color: #173b2b; font-size: 42px; line-height: 1; }
  .print-sheet-meta { display: grid; justify-items: end; font-size: 12px; }
  .print-sheet-meta span { color: #555; }
  .print-list { margin: 24px 0 0; padding: 0; list-style: none; }
  .print-list li { display: grid; grid-template-columns: 20px 42px minmax(0, 1fr) auto; align-items: start; gap: 10px; min-height: 54px; padding: 11px 0; border-bottom: 1px solid #bbb; break-inside: avoid; }
  .print-check { width: 17px; height: 17px; margin-top: 2px; border: 1.5px solid #111; }
  .print-list li > b { font-variant-numeric: tabular-nums; }
  .print-list li strong, .print-list li small { display: block; }
  .print-list li small { margin-top: 3px; color: #555; font-size: 10px; }
  .print-alert { padding: 3px 7px; border: 1px solid #777; border-radius: 100px; font-size: 9px; font-weight: 700; }
  .print-section-row { min-height: 38px !important; padding-top: 20px !important; border-bottom: 2px solid #173b2b !important; }
  .print-sale-row { grid-template-columns: 28px 82px minmax(0, 1fr) 120px !important; min-height: 66px !important; }
  .print-sale-row > b { font-size: 15px; }
  .print-sale-rank { color: #666; font-size: 10px; }
  .print-sale-summary { text-align: right; }
  .print-sale-summary strong, .print-sale-summary small { display: block; }
  .sales-print .print-sheet-header { align-items: center; padding-bottom: 8px; border-bottom-width: 2px; }
  .sales-print .print-sheet-header .eyebrow { margin-bottom: 2px; font-size: 7px; }
  .sales-print .print-sheet-header h1 { font-size: 27px; }
  .sales-print .print-sheet-meta { font-size: 8px; }
  .sales-print .print-list { margin-top: 8px; }
  .sales-print .print-sale-row { grid-template-columns: 20px 62px minmax(0, 1fr) 105px !important; gap: 6px; min-height: 0 !important; padding: 4px 0; font-size: 8px; line-height: 1.15; }
  .sales-print .print-sale-row > b { font-size: 11px; }
  .sales-print .print-sale-row strong { font-size: 9px; line-height: 1.15; }
  .sales-print .print-sale-row small { margin-top: 1px; font-size: 7px; line-height: 1.15; }
  .sales-print .print-sale-rank { font-size: 7px; }
  .sales-print .print-sale-summary { line-height: 1.15; }
  .sales-print .print-sheet-footer { margin-top: 10px; font-size: 7px; }
  .print-sheet-footer { margin-top: 24px; color: #666; font-size: 9px; }
}

/* Bright 2026 interface refresh. Screen-only so printable views remain stable. */
@media screen {
  :root {
    --ink: #15324a;
    --ink-soft: #587386;
    --cream: #f5fbff;
    --paper: #ffffff;
    --line: #dceaf1;
    --lime: #76e6aa;
    --coral: #ff896f;
    --gold: #ffd663;
    --forest: #197553;
    --sky: #dff6ff;
    --blue: #2f9fe8;
    --violet: #7367e8;
    --shadow: 0 14px 40px rgba(43, 102, 137, .10);
  }

  body {
    background:
      radial-gradient(circle at 8% 5%, rgba(112, 213, 255, .18), transparent 26rem),
      linear-gradient(180deg, #ffffff 0, var(--cream) 32rem, #f8fcff 100%);
  }

  body.authenticated main { display: flex; flex-direction: column; }
  .hero { order: 1; }
  .report-section { order: 2; }
  .setup-grid { order: 3; }
  #admin-schedule-console { order: 4; }
  #catalog-collection-console { order: 5; }

  .topbar {
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    min-height: 68px;
    padding: 10px clamp(18px, 4vw, 58px);
    background: rgba(255, 255, 255, .92);
    border-bottom-color: var(--line);
    box-shadow: 0 6px 22px rgba(45, 105, 139, .07);
  }
  .brand { font-size: 16px; }
  .brand-mark {
    width: 38px;
    height: 38px;
    color: #fff;
    background: linear-gradient(145deg, var(--blue), var(--violet));
    border-radius: 13px;
    box-shadow: 0 7px 18px rgba(47, 159, 232, .25);
  }
  .primary-nav { display: flex; align-items: center; gap: 5px; margin-left: 22px; }
  .primary-nav a {
    padding: 8px 12px;
    color: var(--ink-soft);
    border-radius: 9px;
    font-size: 12px;
    font-weight: 800;
    text-decoration: none;
  }
  .primary-nav a:hover, .primary-nav a:focus-visible { color: var(--ink); background: var(--sky); outline: none; }
  .scan-state { padding: 7px 10px; background: #f1f8fb; border: 1px solid var(--line); border-radius: 100px; font-size: 11px; }
  .account-actions { gap: 8px; }
  .account-button { background: #fff; border-color: #bfd9e6; }
  .header-signout { color: var(--ink-soft); }

  main { width: min(1440px, calc(100% - 44px)); padding-bottom: 70px; }
  .hero {
    grid-template-columns: minmax(0, 1fr) auto;
    min-height: 0;
    margin: 28px 0 34px;
    padding: clamp(34px, 5vw, 62px);
    overflow: hidden;
    background:
      radial-gradient(circle at 88% 20%, rgba(255, 255, 255, .92), transparent 12rem),
      linear-gradient(125deg, #e0f7ff 0%, #edfff2 54%, #fff6d7 100%);
    border: 1px solid #cfebf3;
    border-radius: 30px;
    box-shadow: var(--shadow);
  }
  .hero .eyebrow { color: #2473a3; }
  .hero h1 { max-width: 760px; margin-bottom: 18px; font-size: clamp(44px, 6vw, 78px); line-height: .96; }
  .lede { max-width: 680px; color: #466a7e; font-size: clamp(15px, 1.7vw, 19px); }
  .hero-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 26px; }
  .hero-actions a { display: inline-flex; align-items: center; text-decoration: none; }
  .hero-note {
    align-self: center;
    color: var(--ink);
    background: rgba(255, 255, 255, .78);
    border: 1px solid rgba(255, 255, 255, .9);
    box-shadow: 0 12px 30px rgba(66, 123, 151, .12);
    transform: rotate(2deg);
  }
  .button { border-radius: 12px; box-shadow: none; }
  .button.primary { color: #fff; background: linear-gradient(135deg, var(--blue), #4a87ed); }
  .button.dark { color: #fff; background: var(--ink); }
  .button.light { color: var(--ink); background: rgba(255, 255, 255, .88); border: 1px solid #c8e2ec; }
  .text-button { color: #216f9f; }
  .utility-button {
    display: inline-flex;
    min-height: 34px;
    align-items: center;
    justify-content: center;
    padding: 6px 11px;
    color: #216f9f;
    background: #fff;
    border: 1px solid #b9dbea;
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(47, 126, 166, .06);
    font-size: 10px;
    font-weight: 850;
    line-height: 1.2;
    text-decoration: none;
    white-space: nowrap;
    transition: background .15s ease, border-color .15s ease, color .15s ease, transform .15s ease;
  }
  .utility-button:hover,
  .utility-button:focus-visible {
    color: #175b84;
    background: var(--sky);
    border-color: #84c8e2;
    outline: none;
    transform: translateY(-1px);
  }
  .utility-button:focus-visible { box-shadow: 0 0 0 3px rgba(47, 159, 232, .18); }
  .utility-button:disabled { cursor: default; opacity: .45; transform: none; }
  .utility-button.compact { min-height: 28px; padding: 4px 8px; border-radius: 8px; font-size: 9px; }
  .utility-button.danger { color: #a13e32; border-color: #efc5be; }
  .utility-button.danger:hover, .utility-button.danger:focus-visible { color: #8b3026; background: #fff1ee; border-color: #e9a99e; }
  .list-heading-actions, .optimizer-actions { gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

  .report-section {
    scroll-margin-top: 90px;
    margin-bottom: 38px;
    padding: 28px;
    background: rgba(255, 255, 255, .72);
    border: 1px solid var(--line);
    border-radius: 26px;
    box-shadow: var(--shadow);
  }
  .section-heading { align-items: start; margin-bottom: 18px; }
  .section-heading h2 { font-size: clamp(36px, 4vw, 54px); }
  .report-heading-controls { max-width: 820px; }
  .quantity-filter-controls { align-items: stretch; }
  .deal-filter, .exact-quantity-filter {
    background: #fff;
    border-color: #cfe3ec;
    box-shadow: 0 5px 16px rgba(54, 112, 145, .05);
  }
  .deal-filter input, .store-choice input { accent-color: var(--blue); }
  .tabs { gap: 7px; overflow-x: auto; padding: 2px 1px 10px; scrollbar-width: thin; }
  .tab { flex: 0 0 auto; padding: 9px 13px; background: #fff; border-color: #cfe2ea; border-radius: 11px; }
  .tab:hover { color: var(--ink); background: var(--sky); }
  .tab.active { color: #fff; background: linear-gradient(135deg, var(--blue), var(--violet)); border-color: transparent; box-shadow: 0 7px 18px rgba(86, 106, 222, .22); }

  .weekly-sales { border-color: var(--line); border-radius: 18px; box-shadow: none; }
  .weekly-sales-heading { background: linear-gradient(90deg, #fbfeff, #f5fbff); }
  .sale-header, .deal-header { color: #41697d; background: #eaf6fa; }
  .sort-button {
    min-height: 27px;
    padding: 4px 7px;
    border: 1px solid transparent;
    border-radius: 8px;
    transition: background .15s ease, border-color .15s ease, color .15s ease;
  }
  .sort-button:hover, .sort-button:focus-visible { color: #175b84; background: #fff; border-color: #b9dbea; text-decoration: none; }
  .sort-button.ascending, .sort-button.descending { color: #175b84; background: #fff; border-color: #84c8e2; box-shadow: 0 2px 8px rgba(47, 126, 166, .08); }
  .sort-button[data-sort-priority]::before { background: var(--blue); }
  .table-sort-status { background: #f2faff; }
  .table-sort-status .utility-button { color: #216f9f; background: #fff; border-color: #b9dbea; }
  .table-sort-status .utility-button:hover, .table-sort-status .utility-button:focus-visible { color: #175b84; background: var(--sky); border-color: #84c8e2; }
  .sale-row, .deal-row { border-bottom-color: #e3edf2; }
  .sale-row:hover, .deal-row:hover { background: #f4fbff; }
  .promotion-kind { background: #3c7f9f; }
  .fulfillment-badge { color: #20516a; background: #dff6ff; border-color: #a7dced; }
  .condition-badge { color: #7a4824; background: #fff0d5; }
  .deal-score { color: #15324a; background: linear-gradient(145deg, #ffed78, #8cf0b7); }
  .promotion-filter-button:hover, .promotion-filter-button:focus-visible, .promotion-filter-button.active { background: var(--blue); border-color: var(--blue); }

  .setup-grid { grid-template-columns: 1fr 1fr; gap: 20px; padding: 4px 0 38px; }
  #shopping-list { order: 1; }
  #stores { order: 2; }
  #shopping-list, #stores { scroll-margin-top: 90px; }
  .panel { border-color: var(--line); border-radius: 22px; box-shadow: var(--shadow); }
  .panel-heading { margin-bottom: 18px; }
  .panel-heading h2 { font-size: 28px; }
  .step { color: #fff; background: var(--blue); border: 0; }
  .entry-form { padding: 14px; background: #f4faff; border: 1px solid var(--line); border-radius: 14px; }
  input, select { background: #fff; border-color: #cbdfe8; }
  input:focus, select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(47, 159, 232, .13); outline: none; }
  .saved-pill, .store-directory-item { background: #f3f9fc; border: 1px solid #e0edf2; }
  .saved-pill:hover, .store-directory-item:hover { background: #ecf8fd; }
  .store-directory-item.excluded { background: #f2f4f5; }
  .coverage-badge.live { color: #166245; background: #d5f8e4; }
  .coverage-badge.partial { background: #fff1bd; }
  .quantity-stepper button:hover, .quantity-stepper button:focus-visible { background: var(--sky); }

  .scan-console {
    scroll-margin-top: 90px;
    margin-bottom: 28px;
    color: var(--ink);
    background: linear-gradient(135deg, #edfaff, #f3fff6);
    border: 1px solid #cfe8ef;
    border-radius: 22px;
    box-shadow: var(--shadow);
  }
  .console-heading .eyebrow, .schedule-note, .scan-console .empty { color: var(--ink-soft); }
  .schedule-form label > span { color: var(--ink-soft); }
  .schedule-form .button { color: #fff; background: var(--blue); }
  .toggle-label { border-color: #bcd7e2; background: #fff; }
  .toggle-label input { accent-color: var(--blue); }
  .diagnostic-card { background: #fff; border: 1px solid var(--line); border-left: 4px solid #9bb8c5; }
  .diagnostic-card.completed { border-left-color: var(--lime); }
  .collection-console { background: linear-gradient(135deg, #f3f1ff, #eefaff); border-color: #ddd9fb; }
  .collection-safety { color: var(--ink-soft); background: rgba(255,255,255,.7); border-color: #d8d8ef; }
  .collection-safety code { color: #5344b5; background: #edeafd; }
  .collection-summary { color: var(--ink); }

  .auth-shell { background: linear-gradient(145deg, #daf5ff, #f1fff5 52%, #fff5cf); }
  .auth-card { border-color: rgba(255,255,255,.9); border-radius: 28px; box-shadow: 0 24px 80px rgba(47, 114, 149, .16); }
  .auth-brand { margin-bottom: 42px; }
  .auth-card h1 { font-size: clamp(46px, 9vw, 68px); }
  dialog { border-color: var(--line); box-shadow: 0 24px 70px rgba(35, 83, 109, .22); }
  dialog::backdrop { background: rgba(28, 64, 84, .36); }
}

@media screen and (max-width: 1120px) {
  .topbar { grid-template-columns: auto minmax(0, 1fr) auto; }
  .scan-state { display: none; }
  .primary-nav { justify-content: center; }
  .hero-note { display: none; }
  .report-section { padding: 22px; }
  .section-heading { flex-direction: column; }
  .report-heading-controls { width: 100%; max-width: none; justify-items: stretch; }
}

@media screen and (max-width: 760px) {
  .topbar { grid-template-columns: auto 1fr; gap: 8px; padding: 9px 14px; }
  .primary-nav { grid-column: 1 / -1; grid-row: 2; justify-content: flex-start; margin: 0; overflow-x: auto; }
  .primary-nav a { flex: 0 0 auto; padding: 7px 10px; }
  .account-actions { grid-column: 2; grid-row: 1; }
  .account-actions .button { font-size: 10px; }
  main { width: min(100% - 24px, 1440px); }
  .hero { margin-top: 16px; padding: 30px 24px; border-radius: 22px; }
  .hero h1 { font-size: clamp(40px, 13vw, 58px); }
  .hero-actions { margin-top: 20px; }
  .report-section { padding: 16px; border-radius: 20px; }
  .quantity-filter-controls { justify-content: stretch; }
  .quantity-filter-controls > * { width: 100%; }
  .setup-grid { grid-template-columns: 1fr; }
  .scan-console { padding: 20px; }
}

/* priceraccoon.com brand system — based on the supplied local identity artwork. */
@media screen {
  :root {
    --ink: #1e272c;
    --ink-soft: #58656b;
    --cream: #f5f7f6;
    --paper: #ffffff;
    --line: #d9e1dc;
    --lime: #83c978;
    --coral: #e67e22;
    --gold: #f2b35f;
    --forest: #2e7d32;
    --sky: #e8f3e9;
    --blue: #2e7d32;
    --violet: #e67e22;
    --mask-grey: #34495e;
    --shadow: 0 14px 38px rgba(30, 39, 44, .09);
  }

  body {
    background:
      radial-gradient(circle at 6% 3%, rgba(46, 125, 50, .08), transparent 24rem),
      radial-gradient(circle at 94% 20%, rgba(230, 126, 34, .08), transparent 22rem),
      var(--cream);
    color: var(--ink);
  }
  h1, .section-heading h2, .panel-heading h2, .weekly-sales-heading h3,
  .optimizer-heading h3, .console-heading h2, .dialog-heading h2, .recovery-dialog h2 {
    font-family: "Avenir Next", Avenir, Inter, ui-sans-serif, system-ui, sans-serif;
    font-weight: 750;
    letter-spacing: -.045em;
  }
  .eyebrow { color: var(--forest); }

  .topbar {
    background: rgba(245, 247, 246, .95);
    border-bottom: 3px solid var(--forest);
    box-shadow: 0 7px 24px rgba(30, 39, 44, .08);
  }
  .brand { gap: 9px; color: var(--ink); letter-spacing: -.04em; }
  .brand-mark {
    position: relative;
    width: 29px;
    height: 25px;
    flex: 0 0 29px;
    color: transparent;
    background: var(--coral);
    border-radius: 4px 10px 10px 4px;
    box-shadow: none;
    transform: rotate(-7deg);
  }
  .brand-mark::before {
    position: absolute;
    top: 7px;
    right: 5px;
    width: 5px;
    height: 5px;
    background: var(--cream);
    border: 2px solid var(--mask-grey);
    border-radius: 50%;
    content: "";
  }
  .brand-mark::after {
    position: absolute;
    left: -7px;
    top: 6px;
    width: 14px;
    height: 14px;
    background: var(--coral);
    content: "";
    transform: rotate(45deg);
  }
  .brand-word { position: relative; z-index: 1; color: var(--ink); font-size: 21px; font-weight: 850; }
  .brand-word strong { color: var(--forest); font-weight: 850; }
  .brand-domain { color: var(--ink); }
  .primary-nav a:hover, .primary-nav a:focus-visible { color: var(--forest); background: #e5f0e6; }
  .scan-state { color: var(--mask-grey); background: #eef3f0; border-color: #d2ddd6; }
  .account-button { color: var(--mask-grey); background: #fff; border-color: #c5d2ca; }

  .hero {
    grid-template-columns: minmax(0, .88fr) minmax(470px, 1.12fr);
    align-items: center;
    background:
      linear-gradient(135deg, rgba(255,255,255,.93), rgba(245,247,246,.86)),
      repeating-linear-gradient(-45deg, transparent 0 18px, rgba(46,125,50,.025) 18px 36px);
    border: 1px solid #ccd9d1;
    border-top: 6px solid var(--forest);
    border-radius: 26px;
    box-shadow: var(--shadow);
  }
  .hero .eyebrow { color: var(--forest); }
  .hero h1 { max-width: 660px; color: var(--ink); font-size: clamp(46px, 6vw, 76px); line-height: .94; }
  .hero-brand-art {
    position: relative;
    overflow: hidden;
    min-width: 0;
    padding: 12px 12px 56px;
    background: #fff;
    border: 1px solid #dce3df;
    border-radius: 22px;
    box-shadow: 0 14px 30px rgba(30,39,44,.10);
    transform: rotate(1.25deg);
  }
  .hero-brand-art::after {
    position: absolute;
    right: -22px;
    bottom: -26px;
    width: 118px;
    height: 118px;
    background: rgba(230, 126, 34, .12);
    border-radius: 50%;
    content: "";
  }
  .hero-brand-art img {
    display: block;
    width: 108%;
    max-width: none;
    margin: -2% 0 0 -4%;
    border-radius: 13px;
  }
  .hero-brand-art p { position: absolute; left: 24px; bottom: 15px; z-index: 1; margin: 0; }
  .hero-brand-art p strong, .hero-brand-art p span { display: block; }
  .hero-brand-art p strong { color: var(--forest); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
  .hero-brand-art p span { color: var(--mask-grey); font-size: 11px; }

  .button { border-radius: 10px; }
  .button.primary { color: #fff; background: var(--forest); box-shadow: 0 6px 14px rgba(46,125,50,.18); }
  .button.primary:hover, .button.primary:focus-visible { background: #246928; outline: none; }
  .button.dark { color: #fff; background: var(--mask-grey); }
  .button.dark:hover, .button.dark:focus-visible { background: var(--ink); outline: none; }
  .button.light { color: var(--forest); background: #fff; border: 1px solid #a9c7ad; }
  .button.light:hover, .button.light:focus-visible { background: #eaf3eb; outline: none; }
  .text-button { color: var(--forest); }
  .utility-button {
    color: var(--forest);
    background: #fff;
    border-color: #a9c7ad;
    box-shadow: 0 3px 9px rgba(46,125,50,.06);
  }
  .utility-button:hover, .utility-button:focus-visible {
    color: #205d24;
    background: #e8f3e9;
    border-color: #78a97d;
    box-shadow: 0 0 0 3px rgba(46,125,50,.12);
  }
  .utility-button.danger { color: #a64d21; border-color: #e7bea3; }
  .utility-button.danger:hover, .utility-button.danger:focus-visible { color: #8c3d18; background: #fff0e5; border-color: #df9d72; }

  .report-section, .panel { background: rgba(255,255,255,.92); border-color: #d6dfd9; box-shadow: var(--shadow); }
  .report-section { border-top: 5px solid var(--forest); }
  .panel { border-top: 4px solid var(--coral); }
  #stores { border-top-color: var(--forest); }
  .step { color: #fff; background: var(--coral); }
  #stores .step { background: var(--forest); }
  .entry-form { background: #f4f7f5; border-color: #d8e2db; }
  input, select { border-color: #c8d4cc; }
  input:focus, select:focus { border-color: var(--forest); box-shadow: 0 0 0 3px rgba(46,125,50,.12); }
  .saved-pill, .store-directory-item { background: #f3f6f4; border-color: #e0e7e2; }
  .saved-pill:hover, .store-directory-item:hover { background: #eaf3eb; }
  .coverage-badge.live { color: #1d6122; background: #ddefdf; }
  .coverage-badge.partial { color: #82460f; background: #ffe6c8; }
  .quantity-stepper button:hover, .quantity-stepper button:focus-visible { background: #ddefdf; }

  .deal-filter, .exact-quantity-filter { background: #fff; border-color: #cbd8cf; box-shadow: none; }
  .deal-filter input, .store-choice input { accent-color: var(--forest); }
  .tabs { padding-bottom: 11px; border-bottom: 1px solid #dbe3de; }
  .tab { color: var(--mask-grey); background: #fff; border-color: #ced9d2; }
  .tab:hover { color: var(--forest); background: #edf5ee; }
  .tab.active { color: #fff; background: var(--forest); border-color: var(--forest); box-shadow: 0 6px 15px rgba(46,125,50,.18); }
  .tab.active span { color: var(--ink); background: #fff; }
  .weekly-sales { border-color: #d5ded8; }
  .weekly-sales-heading { background: linear-gradient(90deg, #f8fbf9, #fff8f1); }
  .sale-header, .deal-header { color: var(--mask-grey); background: #e8efe9; }
  .sale-row, .deal-row { border-bottom-color: #e1e7e3; }
  .sale-row:hover, .deal-row:hover { background: #fbf7f2; }
  .sort-button:hover, .sort-button:focus-visible { color: var(--forest); background: #fff; border-color: #9fbea3; }
  .sort-button.ascending, .sort-button.descending { color: var(--forest); background: #fff; border-color: #76a77b; box-shadow: 0 2px 8px rgba(46,125,50,.09); }
  .sort-button[data-sort-priority]::before { background: var(--coral); }
  .table-sort-status { background: #eef5ef; }
  .table-sort-status .utility-button { color: var(--forest); border-color: #a9c7ad; }
  .table-sort-status .utility-button:hover, .table-sort-status .utility-button:focus-visible { color: #205d24; background: #e1efe3; border-color: #78a97d; }
  .promotion-kind { background: var(--coral); }
  .promotion-filter-button:hover, .promotion-filter-button:focus-visible, .promotion-filter-button.active { background: var(--forest); border-color: var(--forest); }
  .fulfillment-badge { color: var(--mask-grey); background: #edf1f4; border-color: #c4cfd7; }
  .condition-badge { color: #85450e; background: #fff0dc; }
  .deal-score { color: #fff; background: var(--forest); }
  .savings { color: var(--forest); }
  .badge { color: #91450f; background: #ffead7; }

  .scan-console { background: #f0f5f1; border-color: #cad8cd; border-top: 5px solid var(--forest); }
  .collection-console { background: #f3f5f6; border-color: #d4dce1; border-top-color: var(--mask-grey); }
  .schedule-form .button { background: var(--forest); }
  .toggle-label { border-color: #b9c8bd; }
  .toggle-label input { accent-color: var(--forest); }
  .collection-safety { background: #fff; border-color: #d3dce0; }
  .collection-safety code { color: var(--forest); background: #e5eee6; }
  .diagnostic-card.completed { border-left-color: var(--forest); }
  .diagnostic-card.completed_with_warnings, .diagnostic-card.retry_queued { border-left-color: var(--coral); }

  .auth-shell {
    background:
      linear-gradient(90deg, rgba(245,247,246,.97), rgba(245,247,246,.88)),
      url("/assets/priceraccoon-com-brand.jpg") center / cover no-repeat;
  }
  .auth-card { border-top: 6px solid var(--forest); box-shadow: 0 24px 70px rgba(30,39,44,.15); }
  .auth-brand { margin-bottom: 38px; }
  dialog { border-top: 5px solid var(--forest); box-shadow: 0 24px 70px rgba(30,39,44,.22); }
  dialog::backdrop { background: rgba(30,39,44,.48); }
  .toast { background: var(--mask-grey); border-left: 5px solid var(--coral); }
}

@media screen and (max-width: 1120px) {
  .hero { grid-template-columns: 1fr; }
  .hero-brand-art { width: min(100%, 760px); }
}

@media screen and (max-width: 760px) {
  .topbar { border-bottom-width: 2px; }
  .brand-word { font-size: 17px; }
  .brand-mark { width: 24px; height: 21px; flex-basis: 24px; }
  .brand-mark::after { left: -5px; top: 5px; width: 12px; height: 12px; }
  .brand-mark::before { top: 5px; right: 4px; }
  .account-actions { display: grid; grid-template-columns: auto auto; align-self: start; gap: 5px 7px; }
  .account-actions #scan-button { grid-column: 1 / -1; justify-self: end; min-height: 34px; padding: 6px 11px; }
  .header-signout { display: inline-flex; align-self: center; white-space: nowrap; }
  .hero { padding: 26px 20px; border-top-width: 5px; }
  .hero-brand-art { padding: 8px 8px 52px; border-radius: 16px; transform: none; }
  .hero-brand-art img { width: 116%; margin-left: -8%; }
  .hero-brand-art p { left: 16px; bottom: 13px; }
  .report-section { border-top-width: 4px; }
  .panel-heading { align-items: flex-start; }
  .list-heading-actions { justify-content: flex-start; }
}

@media print {
  .print-sheet-header { border-bottom-color: #2e7d32; }
  .print-sheet-header .eyebrow, .print-sheet-header h1 { color: #1e272c; }
  .print-section-row { border-bottom-color: #2e7d32 !important; }
}

/* Whimsical mascot moments. Characters remain decorative; nearby HTML carries meaning. */
@media screen {
  .raccoon-mascot {
    display: block;
    max-width: 100%;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 10px 12px rgba(30, 39, 44, .12));
    pointer-events: none;
    user-select: none;
    animation: raccoon-bob 4.2s ease-in-out infinite;
  }
  .auth-shell { position: relative; grid-template-columns: minmax(0, 480px); overflow: hidden; }
  .auth-card { position: relative; z-index: 2; grid-area: 1 / 1; }
  .auth-raccoon {
    position: absolute;
    z-index: 1;
    right: max(18px, calc(50% - 410px));
    bottom: 10px;
    width: min(31vw, 330px);
    transform: rotate(3deg);
    transform-origin: bottom center;
  }
  .report-heading-side { display: flex; min-width: 0; align-items: flex-end; gap: 13px; }
  .comparing-raccoon { width: 118px; flex: 0 0 118px; margin-bottom: -8px; animation-delay: -.8s; }
  .report-heading-side .report-heading-controls { min-width: 0; }

  .playful-loading { grid-template-columns: 132px minmax(180px, auto); justify-content: center; align-items: center; text-align: left; }
  .playful-loading > div { display: grid; justify-items: start; gap: 7px; }
  .playful-loading > div > span { width: 22px; height: 22px; }
  .loading-raccoon { width: 124px; animation-duration: 2.8s; }

  .mascot-state { grid-template-columns: 110px minmax(0, 440px); justify-content: center; gap: 22px; text-align: left; }
  .mascot-state p { margin: 0; font-weight: 700; }
  .empty-raccoon { width: 108px; }

  .optimizer-celebration { display: flex; align-items: flex-end; justify-content: flex-end; gap: 14px; }
  .success-raccoon { width: 112px; margin: -32px 0 -12px; animation-delay: -.4s; }
  .mascot-banner {
    display: flex;
    align-items: center;
    gap: 18px;
    min-height: 126px;
    margin-bottom: 16px;
    padding: 14px 22px;
    overflow: hidden;
    background: linear-gradient(110deg, #fff7ec, #edf6ee);
    border: 1px solid #dfddd3;
    border-radius: 18px;
  }
  .mascot-banner h3 { margin: 0; color: var(--ink); font-size: 20px; }
  .mascot-banner .eyebrow { margin-bottom: 3px; }
  .celebrating-raccoon { width: 118px; margin: -12px 0 -20px; animation-duration: 2.5s; }

  .playful-heading { align-items: center; }
  .heading-mascot-copy { display: flex; max-width: 620px; align-items: center; gap: 12px; }
  .heading-mascot-copy > p { margin: 0; color: var(--ink-soft); font-size: 12px; }
  .discount-raccoon { width: 90px; flex: 0 0 90px; margin: -14px 0 -16px; animation-duration: 2.6s; }

  .panel, .weekly-sales, .report-section { position: relative; }
  .panel::after, .report-section::after {
    position: absolute;
    z-index: 0;
    width: 12px;
    height: 12px;
    background: var(--coral);
    border-radius: 3px 6px 6px 3px;
    content: "";
    opacity: .16;
    transform: rotate(-12deg);
    pointer-events: none;
  }
  .panel::after { right: 18px; bottom: 16px; }
  .report-section::after { right: 24px; top: 22px; }

  @keyframes raccoon-bob {
    0%, 100% { translate: 0 0; }
    50% { translate: 0 -5px; }
  }
}

@media screen and (max-width: 1120px) {
  .report-heading-side { width: 100%; justify-content: flex-end; }
  .report-heading-side .report-heading-controls { flex: 1; }
}

@media screen and (max-width: 760px) {
  .brand-word { font-size: 15px; }
  .auth-raccoon { right: -65px; bottom: -20px; width: 210px; opacity: .22; }
  .report-heading-side { align-items: flex-start; }
  .comparing-raccoon { width: 84px; flex-basis: 84px; }
  .playful-loading { grid-template-columns: 90px minmax(0, 1fr); }
  .loading-raccoon, .empty-raccoon { width: 86px; }
  .mascot-state { grid-template-columns: 86px minmax(0, 1fr); gap: 12px; }
  .optimizer-heading { align-items: flex-start; }
  .optimizer-celebration { align-items: flex-start; }
  .success-raccoon { width: 78px; margin: -12px 0 -2px; }
  .mascot-banner { min-height: 108px; padding: 12px 15px; }
  .celebrating-raccoon { width: 88px; }
  .heading-mascot-copy { align-items: flex-start; }
  .discount-raccoon { width: 72px; flex-basis: 72px; }
}

@media screen and (max-width: 520px) {
  .comparing-raccoon { display: none; }
  .playful-heading, .heading-mascot-copy { align-items: flex-start; flex-direction: column; }
  .discount-raccoon { margin: -4px 0 -6px; }
}

@media (prefers-reduced-motion: reduce) {
  .raccoon-mascot { animation: none !important; translate: none !important; }
}

/* The three sales filters are one control group for the currently visible list. */
@media screen {
  .report-heading-controls { width: min(100%, 820px); }
  .quantity-filter-controls {
    display: block;
    width: 100%;
    min-width: 0;
    margin: 0;
    padding: 8px 12px 10px;
    background: #f3f7f4;
    border: 1px solid #b9cdbd;
    border-radius: 16px;
    box-shadow: 0 7px 18px rgba(46, 125, 50, .07);
  }
  .quantity-filter-controls legend {
    padding: 0 8px;
    color: var(--forest);
    background: var(--paper);
    border-radius: 999px;
    font-size: 10px;
    font-weight: 850;
    letter-spacing: .09em;
    text-transform: uppercase;
  }
  .quantity-filter-row {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
    gap: 1px;
    overflow: hidden;
    background: #dbe4de;
    border: 1px solid #d2ddd5;
    border-radius: 12px;
  }
  .quantity-filter-row.quantity-visible { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
  .quantity-filter-controls .deal-filter,
  .quantity-filter-controls .exact-quantity-filter {
    min-width: 0;
    margin: 0;
    background: #fff;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }
  .quantity-filter-controls .report-meta { margin-top: 8px; padding: 0 3px; text-align: right; }
}

@media screen and (max-width: 760px) {
  .quantity-filter-controls legend { width: auto; }
  .quantity-filter-row, .quantity-filter-row.quantity-visible { grid-template-columns: 1fr; }
  .quantity-filter-controls .report-meta { text-align: left; }
}

/* Keep the opening brand moment useful without pushing the working UI down the page. */
@media screen {
  .hero {
    grid-template-columns: minmax(0, .76fr) minmax(500px, 1.24fr);
    gap: clamp(22px, 3vw, 38px);
    margin: 18px 0 24px;
    padding: clamp(24px, 3.2vw, 42px);
  }
  .hero .eyebrow { margin-bottom: 8px; }
  .hero h1 {
    max-width: 560px;
    margin-bottom: 12px;
    font-size: clamp(40px, 4.7vw, 62px);
    line-height: .96;
  }
  .hero .lede { max-width: 580px; font-size: clamp(14px, 1.45vw, 17px); line-height: 1.45; }
  .hero-actions { margin-top: 18px; }
  .hero-brand-art {
    padding: 8px 8px 42px;
    border-radius: 18px;
    transform: rotate(.5deg);
  }
  .hero-brand-art img { width: 104%; margin: -1% 0 0 -2%; border-radius: 11px; }
  .hero-brand-art p { left: 18px; bottom: 10px; }
}

@media screen and (max-width: 1120px) {
  .hero { grid-template-columns: 1fr; gap: 22px; padding: 28px; }
  .hero-copy { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; column-gap: 24px; }
  .hero-copy .eyebrow, .hero-copy h1, .hero-copy .lede { grid-column: 1; }
  .hero-copy .hero-actions { grid-column: 2; grid-row: 1 / span 3; align-self: end; justify-content: flex-end; }
  .hero-brand-art { width: 100%; }
}

@media screen and (max-width: 760px) {
  .hero { gap: 18px; margin: 14px 0 20px; padding: 22px 18px; }
  .hero-copy { display: block; }
  .hero h1 { font-size: clamp(38px, 12vw, 50px); }
  .hero-actions { margin-top: 16px; }
  .hero-brand-art { padding: 6px 6px 38px; }
  .hero-brand-art img { width: 108%; margin-left: -4%; }
  .hero-brand-art p { left: 14px; bottom: 9px; }
}

@media print {
  .raccoon-mascot, .mascot-banner, .button-help-tooltip { display: none !important; }
}

.button-help-tooltip {
  position: fixed;
  z-index: 3000;
  width: max-content;
  max-width: min(320px, calc(100vw - 16px));
  padding: 10px 13px;
  color: #fff;
  background: var(--charcoal, #1e272c);
  border: 1px solid rgb(255 255 255 / 18%);
  border-radius: 10px;
  box-shadow: 0 9px 28px rgb(30 39 44 / 24%);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.38;
  text-align: left;
  pointer-events: none;
  opacity: 0;
  transform: translateY(3px);
}

.button-help-tooltip.visible {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 120ms ease, transform 120ms ease;
}

.button-help-tooltip::after {
  position: absolute;
  left: var(--tooltip-arrow-left, 50%);
  bottom: -6px;
  width: 12px;
  height: 12px;
  background: var(--charcoal, #1e272c);
  content: "";
  transform: translateX(-50%) rotate(45deg);
}

.button-help-tooltip.below::after {
  top: -6px;
  bottom: auto;
}

button[data-help]:focus-visible, .filter-help-label:focus-visible {
  outline: 3px solid rgb(230 126 34 / 42%);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  .button-help-tooltip.visible { transition: none; }
  .site-tour-highlight { animation: none; }
}

/* Store picker: kept in the sticky navigation and opened on demand. */
@media screen {
  .primary-nav .nav-button {
    display: inline-flex;
    min-height: 34px;
    align-items: center;
    gap: 7px;
    padding: 8px 12px;
    color: var(--ink-soft);
    background: transparent;
    border: 0;
    border-radius: 9px;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
  }
  .primary-nav .nav-button:hover,
  .primary-nav .nav-button:focus-visible {
    color: var(--forest);
    background: #e5f0e6;
    outline: none;
  }
  #store-nav-count {
    display: inline-grid;
    min-width: 22px;
    height: 22px;
    place-items: center;
    padding: 0 6px;
    color: #fff;
    background: var(--forest);
    border-radius: 100px;
    font-size: 10px;
    line-height: 1;
  }
  .setup-grid { grid-template-columns: minmax(0, 1fr); }
  #shopping-list { order: initial; }
  .stores-dialog {
    width: min(94vw, 760px);
    max-height: min(88vh, 820px);
    padding: 26px;
    overflow: hidden;
  }
  .stores-dialog[open] { display: flex; flex-direction: column; animation: store-dialog-in 150ms ease-out; }
  .stores-dialog-heading { margin-bottom: 8px; }
  .stores-dialog-summary { display: flex; align-items: baseline; gap: 14px; margin-bottom: 18px; }
  .stores-dialog-summary .count { flex: 0 0 auto; color: var(--forest); font-weight: 850; }
  .stores-dialog-summary p { margin: 0; color: var(--ink-soft); font-size: 13px; }
  .stores-dialog .store-bulk-actions { margin-top: 0; }
  .stores-dialog .store-directory { min-height: 180px; max-height: min(54vh, 520px); padding-right: 7px; }
  .stores-dialog-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
  }
  .stores-dialog-footer span { color: var(--ink-soft); font-size: 12px; }
  @keyframes store-dialog-in {
    from { opacity: 0; transform: translateY(10px) scale(.985); }
    to { opacity: 1; transform: translateY(0) scale(1); }
  }
}

@media screen and (max-width: 760px) {
  .primary-nav .nav-button { flex: 0 0 auto; padding: 7px 10px; }
  .stores-dialog { width: calc(100vw - 18px); height: calc(100vh - 24px); max-height: calc(100vh - 24px); padding: 20px 16px 16px; }
  .stores-dialog-heading h2 { font-size: 32px; }
  .stores-dialog-summary { display: grid; gap: 4px; }
  .stores-dialog .store-directory { flex: 1 1 auto; min-height: 120px; max-height: none; }
  .stores-dialog-footer { flex: 0 0 auto; margin-top: 12px; padding-top: 12px; }
  .store-directory-item { align-items: flex-start; flex-wrap: wrap; }
  .store-directory-item > div { flex-basis: calc(100% - 70px); }
  .store-directory-item .coverage-badge { order: 3; }
  .store-directory-item .store-choice { margin-left: auto; }
}

@media (prefers-reduced-motion: reduce) {
  .stores-dialog[open] { animation: none; }
}

