:root {
  color-scheme: light;
  --visual-viewport-height: 100vh;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --ink: #11201a;
  --muted: #647169;
  --surface: #ffffff;
  --surface-soft: #f4f7f5;
  --line: #dfe7e2;
  --accent: #118657;
  --accent-strong: #08603f;
  --accent-soft: #e7f6ef;
  --warm: #ffefc2;
  --danger: #a83232;
  --danger-soft: #fff0f0;
  --shadow: 0 18px 60px rgba(24, 56, 42, 0.12);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
}

* {
  box-sizing: border-box;
}

html {
  background: #eef4f0;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    radial-gradient(circle at 90% -10%, rgba(17, 134, 87, 0.14), transparent 34rem),
    linear-gradient(180deg, #f8fbf9 0%, #eef4f0 100%);
}

button,
input,
textarea,
select {
  font: inherit;
}

input,
textarea,
select {
  font-size: 16px;
}

button {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 3px solid rgba(17, 134, 87, 0.25);
  outline-offset: 2px;
}

.app-shell {
  width: min(100%, 1120px);
  margin: 0 auto;
  padding: 0 18px calc(124px + env(safe-area-inset-bottom));
}

.topbar {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: white;
  font-weight: 900;
  letter-spacing: -0.07em;
  background: linear-gradient(145deg, #0b6d49, #18a86e);
  box-shadow: 0 10px 25px rgba(17, 134, 87, 0.24);
}

.brand-copy {
  display: grid;
  line-height: 1.1;
}

.brand-copy strong {
  font-size: 1.02rem;
  letter-spacing: -0.025em;
}

.brand-copy small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.72rem;
}

.icon-button {
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.84);
  color: var(--ink);
  font-size: 1.25rem;
  cursor: pointer;
}

.hero {
  padding: 42px 0 22px;
}

.eyebrow {
  color: var(--accent-strong);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  max-width: 750px;
  margin-bottom: 14px;
  font-size: clamp(2.45rem, 11vw, 5rem);
  line-height: 0.94;
  letter-spacing: -0.062em;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(1.35rem, 5vw, 2rem);
  letter-spacing: -0.04em;
}

.hero-copy {
  max-width: 650px;
  margin-bottom: 28px;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.55;
}

.search-card {
  padding: 14px;
  border: 1px solid rgba(205, 220, 211, 0.88);
  border-radius: var(--radius-xl);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

textarea {
  width: 100%;
  min-height: 144px;
  resize: vertical;
  padding: 16px;
  border: 0;
  border-radius: 18px;
  color: var(--ink);
  background: #f8faf8;
  font-size: 1.03rem;
  line-height: 1.55;
}

textarea::placeholder {
  color: #89958e;
}

.quick-examples {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 12px 2px 4px;
  scrollbar-width: none;
}

.quick-examples::-webkit-scrollbar {
  display: none;
}

.chip,
.location-pill {
  border: 1px solid var(--line);
  background: white;
  color: #33443b;
  white-space: nowrap;
  cursor: pointer;
}

.chip {
  padding: 9px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
}

.search-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 4px 12px;
}

.location-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 11px;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 700;
}

.trust-note {
  color: var(--muted);
  font-size: 0.74rem;
  text-align: right;
}

.primary-button,
.secondary-button,
.ghost-button {
  width: 100%;
  min-height: 52px;
  border-radius: 16px;
  font-weight: 800;
  cursor: pointer;
}

.primary-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 0 18px;
  border: 0;
  color: white;
  background: linear-gradient(135deg, var(--accent-strong), var(--accent));
  box-shadow: 0 10px 24px rgba(17, 134, 87, 0.22);
}

.primary-button:disabled {
  cursor: wait;
  opacity: 0.7;
}

.secondary-button {
  border: 1px solid var(--accent);
  color: var(--accent-strong);
  background: var(--accent-soft);
}

.ghost-button {
  border: 1px solid var(--line);
  color: var(--ink);
  background: white;
}

.savings-strip {
  margin: 18px 0;
  padding: 18px;
  border-radius: var(--radius-lg);
  background: #0d2d22;
  color: white;
}

.savings-strip .metric-label {
  color: #b9d5c9;
  font-size: 0.78rem;
  font-weight: 700;
}

.savings-strip .metric-value {
  display: block;
  margin-top: 2px;
  font-size: clamp(1.9rem, 9vw, 3rem);
  font-weight: 900;
  letter-spacing: -0.055em;
}

.savings-strip .metric-note {
  display: block;
  margin-top: 4px;
  color: #cce1d8;
  font-size: 0.78rem;
}

.loading-state {
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 22px 0;
  padding: 20px;
  border-radius: var(--radius-lg);
  background: white;
  border: 1px solid var(--line);
}

.loading-state p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.45;
  font-size: 0.86rem;
}

.loading-orbit {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border: 4px solid #dfeee7;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.results {
  padding-top: 18px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin: 28px 2px 14px;
}

.section-heading.compact {
  margin-top: 36px;
}

.updated-at {
  color: var(--muted);
  font-size: 0.72rem;
  text-align: right;
}

.decision-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.decision-card {
  position: relative;
  overflow: hidden;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: white;
}

.decision-card.primary {
  border-color: rgba(17, 134, 87, 0.35);
  background:
    radial-gradient(circle at 100% 0%, rgba(17, 134, 87, 0.14), transparent 12rem),
    white;
}

.decision-badge {
  display: inline-flex;
  margin-bottom: 14px;
  padding: 6px 9px;
  border-radius: 999px;
  color: var(--accent-strong);
  background: var(--accent-soft);
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.decision-title {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.decision-price {
  margin: 4px 0;
  font-size: clamp(2rem, 10vw, 3.25rem);
  font-weight: 900;
  letter-spacing: -0.06em;
}

.decision-retailers {
  font-weight: 800;
}

.decision-sub {
  margin-top: 7px;
  color: var(--muted);
  font-size: 0.78rem;
}

.saving-callout {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--accent-strong);
  font-weight: 800;
  font-size: 0.86rem;
}

.plan-card {
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: white;
  overflow: hidden;
}

.plan-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 17px;
  border-bottom: 1px solid var(--line);
}

.plan-header strong {
  font-size: 0.96rem;
}

.plan-header span {
  color: var(--muted);
  font-size: 0.78rem;
}

.store-section + .store-section {
  border-top: 1px solid var(--line);
}

.store-name {
  padding: 13px 17px 5px;
  color: var(--accent-strong);
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.product-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  padding: 11px 17px;
}

.product-row + .product-row {
  border-top: 1px solid #eef2ef;
}

.product-main {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  min-width: 0;
  align-items: start;
}

.product-copy {
  min-width: 0;
}

.product-thumbnail {
  width: 58px;
  height: 58px;
  object-fit: contain;
  border-radius: 12px;
  background: #fff;
  border: 1px solid #e8eeea;
}

.product-request {
  font-size: 0.83rem;
  font-weight: 800;
}

.product-match {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.35;
}

.product-evidence {
  margin-top: 5px;
  color: #75837b;
  font-size: 0.68rem;
}

.product-price {
  text-align: right;
  white-space: nowrap;
}

.product-price strong {
  display: block;
  font-size: 0.9rem;
}

.product-price span {
  display: block;
  color: var(--muted);
  font-size: 0.7rem;
}

.plan-total {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 17px;
  color: var(--ink);
  background: var(--surface-soft);
  font-weight: 900;
}

.coverage-panel {
  margin-top: 14px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: white;
  overflow: hidden;
}

.coverage-panel summary {
  cursor: pointer;
  padding: 16px 17px;
  font-weight: 800;
}

.coverage-list {
  border-top: 1px solid var(--line);
}

.coverage-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  padding: 11px 17px;
  font-size: 0.8rem;
}

.coverage-row + .coverage-row {
  border-top: 1px solid #eef2ef;
}

.coverage-status {
  color: var(--muted);
}

.coverage-status.complete {
  color: var(--accent-strong);
  font-weight: 800;
}

.coverage-status.error {
  color: var(--danger);
}

.notice {
  margin: 14px 0;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  line-height: 1.45;
  font-size: 0.84rem;
}

.notice.error {
  color: var(--danger);
  background: var(--danger-soft);
  border: 1px solid #ffd0d0;
}

.notice.subtle {
  color: #5b664f;
  background: #fff9e6;
  border: 1px solid #f0e2b3;
}

.notice.coverage-warning {
  color: #785d19;
  background: #fff8df;
  border: 1px solid #ead58f;
}

.result-actions {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.result-action-wide {
  grid-column: 1 / -1;
}

.footer {
  display: grid;
  gap: 5px;
  margin-top: 48px;
  padding: 22px 4px 12px;
  color: var(--muted);
  font-size: 0.72rem;
}

.footer strong {
  color: var(--ink);
}

dialog {
  width: min(calc(100% - 24px), 520px);
  max-height: calc(var(--visual-viewport-height, 100vh) - 24px);
  padding: 0;
  border: 0;
  border-radius: 26px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

dialog::backdrop {
  background: rgba(5, 24, 17, 0.55);
  backdrop-filter: blur(4px);
}

.dialog-card {
  max-height: calc(var(--visual-viewport-height, 100vh) - 24px);
  padding: 20px;
  padding-bottom: max(20px, env(safe-area-inset-bottom));
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-padding-bottom: 24px;
  -webkit-overflow-scrolling: touch;
}

.dialog-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.field {
  display: grid;
  gap: 7px;
  margin-bottom: 17px;
}

.field > span {
  font-size: 0.82rem;
  font-weight: 800;
}

.field small {
  color: var(--muted);
  line-height: 1.4;
}

.field input,
.field select {
  width: 100%;
  min-height: 48px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--ink);
  background: white;
}

.form-status {
  min-height: 18px;
  margin: 10px 2px 0;
  color: var(--muted);
  font-size: 0.76rem;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(18px + env(safe-area-inset-bottom));
  z-index: 30;
  transform: translateX(-50%);
  width: min(calc(100% - 32px), 480px);
  padding: 13px 16px;
  border-radius: 14px;
  color: white;
  background: #102b22;
  box-shadow: var(--shadow);
  font-size: 0.82rem;
  font-weight: 700;
  text-align: center;
}

.hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (min-width: 720px) {
  .app-shell {
    padding-inline: 28px;
  }

  .topbar {
    min-height: 88px;
  }

  .hero {
    padding-top: 72px;
  }

  .search-card {
    padding: 18px;
  }

  textarea {
    min-height: 164px;
    font-size: 1.12rem;
  }

  .decision-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .result-actions {
    grid-template-columns: 1fr 1fr;
  }

  .savings-strip {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
  }
}

@media (min-width: 980px) {
  .hero {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(500px, 1.1fr);
    gap: 52px;
    align-items: end;
  }

  .hero .eyebrow,
  .hero h1,
  .hero .hero-copy {
    grid-column: 1;
  }

  .hero .eyebrow {
    align-self: end;
  }

  .hero h1 {
    margin-bottom: 12px;
  }

  .hero-copy {
    margin-bottom: 0;
  }

  .search-card {
    grid-column: 2;
    grid-row: 1 / span 3;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .loading-orbit {
    animation: none;
  }
}

.app-view {
  min-height: 62vh;
  padding-top: 24px;
}

.view-heading {
  margin-top: 22px;
}

.feature-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: white;
  box-shadow: 0 10px 34px rgba(24, 56, 42, 0.07);
}

.feature-copy {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.5;
}

.compact-form {
  display: grid;
  gap: 14px;
}

.compact-form .field {
  margin-bottom: 0;
}

.money-input {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: white;
  overflow: hidden;
}

.money-input input {
  min-height: 48px;
  border: 0;
  border-radius: 0;
}

.money-input > span {
  padding: 0 14px;
  color: var(--muted);
  font-weight: 800;
}

.stack-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.list-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: white;
}

.item-main {
  min-width: 0;
}

.item-title {
  font-size: 0.86rem;
  font-weight: 850;
  overflow-wrap: anywhere;
}

.item-meta {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.35;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.small-button {
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: white;
  color: var(--ink);
  font-size: 0.76rem;
  font-weight: 800;
  cursor: pointer;
}

.small-button.primary-lite {
  border-color: rgba(17, 134, 87, 0.35);
  color: var(--accent-strong);
  background: var(--accent-soft);
}

.small-button.danger {
  color: var(--danger);
}

.empty-state {
  padding: 26px 10px;
  color: var(--muted);
  text-align: center;
  line-height: 1.5;
}

.empty-state strong {
  display: block;
  margin-bottom: 6px;
  color: var(--ink);
}

.habitual-items {
  display: grid;
  gap: 8px;
  margin: 4px 0 16px;
}

.habitual-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid #edf2ef;
}

.habitual-item:last-child {
  border-bottom: 0;
}

.habitual-item strong {
  font-size: 0.84rem;
}

.habitual-item span {
  color: var(--muted);
  font-size: 0.72rem;
  text-align: right;
}

.savings-dashboard {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
}

.saving-card {
  padding: 19px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: white;
}

.saving-card.verified {
  color: white;
  border-color: transparent;
  background: linear-gradient(145deg, #0b6d49, #0f8b5c);
}

.saving-card .saving-label {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
}

.saving-card.verified .saving-label,
.saving-card.verified .saving-note {
  color: #c9e3d8;
}

.saving-number {
  display: block;
  margin-top: 4px;
  font-size: clamp(2rem, 11vw, 3.2rem);
  font-weight: 950;
  letter-spacing: -0.06em;
}

.saving-note {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.45;
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: calc(10px + env(safe-area-inset-bottom));
  z-index: 20;
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  width: min(calc(100% - 20px), 620px);
  padding: 7px;
  border: 1px solid rgba(207, 220, 213, 0.9);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 18px 55px rgba(14, 44, 31, 0.17);
  backdrop-filter: blur(16px);
  transition: opacity 160ms ease, transform 160ms ease;
}

html.keyboard-open .bottom-nav {
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, calc(100% + 24px));
}

.nav-item {
  display: grid;
  place-items: center;
  gap: 3px;
  min-height: 48px;
  padding: 5px 4px;
  border: 0;
  border-radius: 16px;
  color: var(--muted);
  background: transparent;
  font-size: 0.67rem;
  font-weight: 800;
  cursor: pointer;
}

.nav-item.active {
  color: var(--accent-strong);
  background: var(--accent-soft);
}

.nav-icon {
  font-size: 1rem;
  line-height: 1;
}

.footer {
  padding-bottom: 86px;
}


.scanner-button {
  width: 100%;
  min-height: 48px;
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: white;
  color: var(--ink);
  font-weight: 800;
  cursor: pointer;
}

.capture-card {
  min-height: 190px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  padding: 24px;
  border: 1px dashed rgba(17, 134, 87, 0.45);
  border-radius: var(--radius-lg);
  color: var(--accent-strong);
  background: var(--accent-soft);
  text-align: center;
  cursor: pointer;
}

.capture-card small {
  max-width: 340px;
  color: var(--muted);
  line-height: 1.45;
}

.capture-icon {
  font-size: 2.5rem;
  line-height: 1;
}

.separator {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.separator::before,
.separator::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--line);
}

.scanner-status {
  min-height: 22px;
  margin: 14px 2px 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.45;
}


.network-status {
  margin: 0 auto;
  max-width: 760px;
  padding: 10px 16px;
  border: 1px solid rgba(180, 120, 0, 0.28);
  border-radius: 14px;
  background: #fff7dd;
  color: #6d4a00;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.4;
}

.pwa-install-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--accent-soft);
}

.pwa-install-card > div {
  min-width: 0;
}

.pwa-install-card .feature-copy {
  margin: 6px 0 0;
}

.pwa-install-card .secondary-button {
  width: auto;
  min-width: 104px;
  flex: 0 0 auto;
}

html.offline .trust-note::after {
  content: " · offline";
}

@media (display-mode: standalone) {
  body {
    padding-top: env(safe-area-inset-top);
  }

  .topbar {
    top: env(safe-area-inset-top);
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
  }

  .bottom-nav {
    padding-bottom: max(8px, env(safe-area-inset-bottom));
  }
}

@media (max-width: 420px) {
  .pwa-install-card {
    align-items: stretch;
    flex-direction: column;
  }

  .pwa-install-card .secondary-button {
    width: 100%;
  }
}


.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 1000;
  transform: translateY(-160%);
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--ink);
  color: white;
  font-weight: 800;
  text-decoration: none;
}

.skip-link:focus {
  transform: translateY(0);
}

:where(
  button,
  a,
  input,
  textarea,
  select,
  [tabindex]
):focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

button,
.icon-button,
.small-button,
.nav-item {
  min-height: 44px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
.view-intro {
  max-width: 720px;
  margin: -4px 2px 18px;
}

.favorite-button {
  min-height: 36px;
  margin-top: 8px;
  padding: 0 10px;
  border: 1px solid rgba(17, 134, 87, 0.28);
  border-radius: 10px;
  color: var(--accent-strong);
  background: var(--accent-soft);
  font-size: 0.72rem;
  font-weight: 800;
  cursor: pointer;
}

.favorite-button:disabled {
  opacity: 0.65;
  cursor: wait;
}

.favorites-list {
  display: grid;
  gap: 12px;
}
.favorite-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: white;
  box-shadow: 0 10px 34px rgba(24, 56, 42, 0.07);
}

.favorite-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: start;
}

.favorite-retailer {
  color: var(--accent-strong);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.favorite-card h3 {
  margin: 4px 0 5px;
  font-size: 1rem;
  line-height: 1.25;
}
.favorite-meta,
.favorite-history-note {
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.4;
}

.favorite-current {
  text-align: right;
  white-space: nowrap;
}

.favorite-current span,
.favorite-current small {
  display: block;
  color: var(--muted);
  font-size: 0.68rem;
}

.favorite-current strong {
  display: block;
  margin: 2px 0;
  font-size: 1.45rem;
  letter-spacing: -0.045em;
}

.history-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 16px;
}
.history-stats > div {
  padding: 10px;
  border-radius: 12px;
  background: var(--surface-soft);
}

.history-stats span,
.history-stats strong {
  display: block;
}

.history-stats span {
  color: var(--muted);
  font-size: 0.66rem;
}

.history-stats strong {
  margin-top: 3px;
  font-size: 0.9rem;
}

.favorite-history-note {
  margin-top: 9px;
}

.favorite-history {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.history-chart svg {
  width: 100%;
  height: 110px;
  overflow: visible;
}

.history-chart polyline {
  stroke: var(--accent);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.history-axis {
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.65rem;
}

.history-single {
  padding: 14px;
  border-radius: 12px;
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 0.75rem;
  text-align: center;
}
.history-list {
  display: grid;
  gap: 0;
  margin-top: 12px;
  border-top: 1px solid var(--line);
}

.history-point {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 9px 2px;
  border-bottom: 1px solid #edf2ef;
}

.history-point > div {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.history-point span,
.history-point small {
  color: var(--muted);
  font-size: 0.68rem;
}

@media (max-width: 420px) {
  .nav-item {
    font-size: 0.6rem;
  }

  .favorite-head {
    grid-template-columns: 1fr;
  }
  .favorite-current {
    display: flex;
    align-items: baseline;
    gap: 8px;
    text-align: left;
  }

  .favorite-current span,
  .favorite-current small,
  .favorite-current strong {
    display: inline;
  }
}

.receipt-entry-card {
  display: grid;
  gap: 14px;
  margin-bottom: 14px;
}

.receipt-entry-card .secondary-button {
  width: 100%;
}

.receipt-result {
  margin-top: 14px;
}

.receipt-summary {
  display: grid;
  gap: 14px;
}

.receipt-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
}

.receipt-heading > div:first-child {
  display: grid;
  gap: 3px;
}

.receipt-kicker {
  color: var(--accent-strong);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.receipt-heading strong {
  font-size: 0.85rem;
}

.receipt-total {
  text-align: right;
}

.receipt-total span {
  display: block;
  color: var(--muted);
  font-size: 0.68rem;
}

.receipt-total strong {
  display: block;
  margin-top: 2px;
  font-size: 1.65rem;
  letter-spacing: -0.05em;
}

.receipt-validation {
  display: grid;
  gap: 4px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface-soft);
}

.receipt-validation strong {
  font-size: 0.82rem;
}

.receipt-validation span {
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.45;
}

.receipt-validation.verified {
  border-color: rgba(17, 134, 87, 0.35);
  background: var(--accent-soft);
}

.receipt-validation.mismatch {
  border-color: #ffd0d0;
  background: var(--danger-soft);
}

.receipt-confidence {
  color: var(--muted);
  font-size: 0.7rem;
}

.receipt-lines {
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}

.receipt-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  background: white;
}

.receipt-line + .receipt-line {
  border-top: 1px solid #edf2ef;
}

.receipt-line > div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.receipt-line strong {
  font-size: 0.76rem;
  overflow-wrap: anywhere;
}

.receipt-line-kind {
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.receipt-line-amount {
  font-size: 0.78rem;
  font-weight: 900;
  white-space: nowrap;
}

.receipt-truth-note {
  margin: 0;
}

@media (max-width: 420px) {
  .receipt-heading {
    grid-template-columns: 1fr;
  }

  .receipt-total {
    text-align: left;
  }
}

/* SmartCompra brand system — 2026-09-27 */
:root {
  color-scheme: dark;
  --ink: #f4fbff;
  --muted: #9bb5cc;
  --surface: #0b2242;
  --surface-soft: #0f2a4f;
  --line: rgba(169, 213, 241, 0.16);
  --accent: #1ecbff;
  --accent-strong: #62f45d;
  --accent-soft: rgba(30, 203, 255, 0.13);
  --warm: #ffd66e;
  --danger: #ff9a9a;
  --danger-soft: rgba(255, 90, 90, 0.12);
  --shadow: 0 20px 64px rgba(0, 7, 18, 0.38);
}

html {
  background: #020b19;
}

body {
  color: var(--ink);
  background:
    radial-gradient(circle at 12% -8%, rgba(30, 203, 255, 0.17), transparent 33rem),
    radial-gradient(circle at 92% 8%, rgba(98, 244, 93, 0.10), transparent 27rem),
    linear-gradient(180deg, #031226 0%, #061a33 54%, #020b19 100%);
  background-attachment: fixed;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 18;
  margin-inline: -18px;
  padding-inline: 18px;
  background: linear-gradient(180deg, rgba(3, 18, 38, 0.96), rgba(3, 18, 38, 0.76));
  border-bottom: 1px solid rgba(30, 203, 255, 0.10);
  backdrop-filter: blur(18px);
}

.brand-logo {
  width: 52px;
  height: 52px;
  flex: 0 0 auto;
  border-radius: 15px;
  filter: drop-shadow(0 8px 18px rgba(30, 203, 255, 0.17));
}

.brand-copy strong {
  color: #f7fcff;
  font-weight: 900;
}

.brand-copy small {
  color: #91abc3;
}

.icon-button {
  color: var(--ink);
  background: rgba(11, 34, 66, 0.82);
  border-color: var(--line);
}

.eyebrow {
  color: var(--accent);
}

h1 {
  color: #f7fcff;
  text-shadow: 0 12px 44px rgba(30, 203, 255, 0.10);
}

.hero-copy,
.feature-copy,
.updated-at,
.trust-note {
  color: var(--muted);
}

.search-card,
.feature-card,
.favorite-card,
.decision-card,
.plan-card,
.coverage-panel,
.loading-state {
  border-color: var(--line);
  background: rgba(9, 30, 59, 0.88);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.decision-card.primary {
  border-color: rgba(30, 203, 255, 0.38);
  background:
    radial-gradient(circle at 100% 0%, rgba(98, 244, 93, 0.13), transparent 14rem),
    radial-gradient(circle at 0% 100%, rgba(30, 203, 255, 0.10), transparent 16rem),
    rgba(9, 30, 59, 0.94);
}

textarea,
.field input,
.field select,
.money-input {
  color: var(--ink);
  border-color: var(--line);
  background: rgba(4, 20, 42, 0.88);
}

textarea::placeholder,
input::placeholder {
  color: #6f8aa4;
}

.chip,
.location-pill,
.ghost-button,
.small-button,
.scanner-button {
  color: var(--ink);
  border-color: var(--line);
  background: rgba(13, 40, 75, 0.86);
}

.chip:hover,
.location-pill:hover,
.small-button:hover,
.scanner-button:hover {
  border-color: rgba(30, 203, 255, 0.42);
  background: rgba(17, 53, 94, 0.95);
}

.primary-button {
  color: #031226;
  background: linear-gradient(135deg, #1ecbff 0%, #28dff0 44%, #62f45d 100%);
  box-shadow: 0 12px 32px rgba(30, 203, 255, 0.20);
}

.secondary-button {
  color: #c7f5ff;
  border-color: rgba(30, 203, 255, 0.48);
  background: rgba(30, 203, 255, 0.11);
}

.decision-badge,
.favorite-button {
  color: #9aff92;
  background: rgba(98, 244, 93, 0.11);
  border-color: rgba(98, 244, 93, 0.26);
}

.store-name,
.favorite-retailer,
.receipt-kicker,
.saving-callout {
  color: var(--accent);
}

.plan-total,
.history-stats > div,
.history-single,
.receipt-validation,
.pwa-install-card {
  color: var(--ink);
  background: rgba(15, 42, 79, 0.86);
}

.product-row + .product-row,
.coverage-row + .coverage-row,
.habitual-item,
.history-point,
.receipt-line + .receipt-line {
  border-color: rgba(169, 213, 241, 0.11);
}

.receipt-line {
  background: rgba(7, 27, 54, 0.90);
}

.receipt-validation.verified {
  border-color: rgba(98, 244, 93, 0.34);
  background: rgba(98, 244, 93, 0.09);
}

.receipt-validation.mismatch {
  border-color: rgba(255, 90, 90, 0.30);
  background: var(--danger-soft);
}

.savings-strip,
.saving-card.verified {
  color: #f7fcff;
  border: 1px solid rgba(30, 203, 255, 0.18);
  background:
    radial-gradient(circle at 100% 0%, rgba(98, 244, 93, 0.18), transparent 15rem),
    linear-gradient(135deg, #06213e, #0a3348);
  box-shadow: var(--shadow);
}

.savings-strip .metric-label,
.savings-strip .metric-note,
.saving-card.verified .saving-label,
.saving-card.verified .saving-note {
  color: #a7cde2;
}

.saving-card {
  border-color: var(--line);
  background: rgba(9, 30, 59, 0.90);
}

.notice.coverage-warning {
  color: #ffd980;
  background: rgba(255, 214, 110, 0.09);
  border-color: rgba(255, 214, 110, 0.28);
}

.bottom-nav {
  border-color: rgba(30, 203, 255, 0.16);
  background: rgba(3, 18, 38, 0.92);
  box-shadow: 0 18px 55px rgba(0, 7, 18, 0.42);
}

.nav-item {
  color: #8ea8bf;
}

.nav-item.active {
  color: #7edcff;
  background: rgba(30, 203, 255, 0.13);
  box-shadow: inset 0 0 0 1px rgba(30, 203, 255, 0.08);
}

dialog {
  color: var(--ink);
  background: #081d39;
  border: 1px solid rgba(30, 203, 255, 0.14);
}

dialog::backdrop {
  background: rgba(0, 7, 18, 0.76);
}

.dialog-card {
  color: var(--ink);
  background:
    radial-gradient(circle at 100% 0%, rgba(30, 203, 255, 0.09), transparent 18rem),
    #081d39;
}

.capture-card {
  color: #8be4ff;
  border-color: rgba(30, 203, 255, 0.45);
  background: rgba(30, 203, 255, 0.08);
}

.toast {
  color: #f7fcff;
  background: #0b2948;
  border: 1px solid rgba(30, 203, 255, 0.18);
}

.footer strong,
.empty-state strong {
  color: var(--ink);
}

.network-status {
  color: #ffe9a6;
  border-color: rgba(255, 214, 110, 0.28);
  background: rgba(100, 72, 8, 0.34);
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
summary:focus-visible,
:where(button, a, input, textarea, select, [tabindex]):focus-visible {
  outline-color: rgba(30, 203, 255, 0.72);
}

@media (min-width: 720px) {
  .topbar {
    margin-inline: -28px;
    padding-inline: 28px;
  }
}

@media (max-width: 420px) {
  .brand-logo {
    width: 46px;
    height: 46px;
    border-radius: 13px;
  }

  .brand-copy strong {
    font-size: 0.98rem;
  }

  .brand-copy small {
    max-width: 190px;
    font-size: 0.68rem;
  }
}

.receipt-product-resolution {
  display: grid;
  gap: 4px;
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(30, 203, 255, 0.16);
  border-radius: 14px;
  background: rgba(30, 203, 255, 0.07);
}

.receipt-product-resolution strong {
  color: var(--ink);
}

.receipt-product-resolution span {
  color: var(--muted);
  font-size: 0.78rem;
}

.receipt-product-state {
  display: block;
  margin-top: 5px;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.35;
}

.receipt-product-state.resolved {
  color: #8df58a;
}

.receipt-product-state.ambiguous {
  color: #ffd66e;
}

.receipt-product-state.unresolved {
  color: #91abc3;
}

.receipt-price-history {
  display: grid;
  gap: 4px;
  margin-top: 10px;
  padding: 12px 14px;
  border: 1px solid rgba(98, 244, 93, 0.18);
  border-radius: 14px;
  background: rgba(98, 244, 93, 0.07);
}

.receipt-price-history strong {
  color: var(--ink);
}

.receipt-price-history span {
  color: var(--muted);
  font-size: 0.78rem;
}

.receipt-price-state {
  display: block;
  margin-top: 5px;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.35;
}

.receipt-price-state.recorded {
  color: #8df58a;
}

.receipt-price-state.duplicate {
  color: #7edcff;
}

.receipt-price-state.skipped {
  color: #91abc3;
}
