.bobby-shop-intro {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 20px;
  margin-bottom: 16px;
  overflow: hidden;
  border-color: #dce8c2;
  background:
    radial-gradient(circle at 88% 18%, rgba(185, 229, 49, .24), transparent 30%),
    linear-gradient(135deg, #fffdf8, #f5fae9);
}

.bobby-shop-intro h2,
.bobby-shop-card-heading h3,
.bobby-shop-empty-state h2,
.bobby-shop-learning h2 {
  margin: 0;
}

.bobby-shop-intro p:last-child,
.bobby-shop-learning p:last-child {
  max-width: 760px;
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.58;
}

.bobby-shop-intro-mark {
  display: grid;
  width: 72px;
  height: 72px;
  place-items: center;
  border: 1px solid rgba(78, 106, 28, .16);
  border-radius: 22px;
  background: rgba(255, 255, 255, .82);
  box-shadow: var(--surface-shadow);
  font-size: 2.1rem;
}

.bobby-shop-snapshot-status {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px 16px;
  margin-bottom: 16px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--surface-shadow);
}

.bobby-shop-snapshot-status > div {
  min-width: 0;
}

.bobby-shop-snapshot-status .eyebrow {
  margin: 0 0 2px;
}

.bobby-shop-snapshot-status strong,
.bobby-shop-snapshot-status small {
  display: block;
}

.bobby-shop-snapshot-status small {
  margin-top: 2px;
  color: var(--muted);
}

.bobby-shop-snapshot-status > .message {
  grid-column: 1 / -1;
  margin: 2px 0 0;
}

.bobby-shop-learning {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 14px;
  margin-bottom: 16px;
  border-color: #d4e5a0;
  background: linear-gradient(135deg, #fbfff1, #f4f9e7);
}

.bobby-shop-learning > span {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 15px;
  background: rgba(185, 229, 49, .2);
  font-size: 1.45rem;
}

.bobby-shop-learning .eyebrow {
  margin: 0 0 3px;
}

.bobby-shop-controls {
  position: sticky;
  top: 116px;
  z-index: 8;
  display: grid;
  grid-template-columns: minmax(220px, .9fr) minmax(320px, 1.35fr);
  align-items: end;
  gap: 16px;
  margin-bottom: 20px;
  padding: 16px;
  border-color: #d7dfd8;
  box-shadow: 0 12px 30px rgba(29, 37, 32, .11);
}

.bobby-shop-store-field {
  margin: 0;
}

.bobby-shop-store-field label {
  display: block;
  margin-bottom: 6px;
  color: var(--ink);
  font-size: .84rem;
  font-weight: 850;
}

.bobby-shop-store-field small {
  display: block;
  min-height: 1.35em;
  margin-top: 5px;
  color: var(--muted);
  font-size: .77rem;
}

.bobby-shop-view-switcher {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--soft);
}

.bobby-shop-view-switcher button {
  min-height: 48px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--muted);
  background: transparent;
  font: inherit;
  font-size: .84rem;
  font-weight: 900;
  cursor: pointer;
  touch-action: manipulation;
  transition:
    color var(--motion-duration-quick) var(--motion-ease-smooth),
    border-color var(--motion-duration-quick) var(--motion-ease-smooth),
    background-color var(--motion-duration-quick) var(--motion-ease-smooth),
    transform var(--motion-duration-instant) var(--motion-ease-smooth);
}

.bobby-shop-view-switcher button[aria-pressed="true"] {
  color: #fff;
  border-color: var(--orange);
  background: linear-gradient(135deg, var(--orange), #e98600);
  box-shadow: 0 5px 14px rgba(255, 94, 0, .2);
}

.bobby-shop-view-switcher button:focus-visible,
.bobby-shop-trend summary:focus-visible,
.bobby-shop-history-status + .text-button:focus-visible {
  outline: 3px solid rgba(255, 94, 0, .24);
  outline-offset: 2px;
}

.bobby-shop-control-note {
  grid-column: 1 / -1;
  margin: -4px 0 0;
  color: var(--muted);
  font-size: .8rem;
}

.bobby-shop-results {
  min-height: 240px;
}

.bobby-shop-results > section,
.bobby-shop-category {
  margin-bottom: 28px;
}

.bobby-shop-results .section-head {
  align-items: center;
}

.bobby-shop-results .section-head h2,
.bobby-shop-category .section-head h2 {
  margin: 0;
}

.bobby-shop-section-note {
  max-width: 780px;
  margin: -6px 0 15px;
  color: var(--muted);
}

.bobby-shop-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 285px), 1fr));
  gap: 14px;
}

.bobby-shop-card-grid > .card {
  content-visibility: auto;
  contain-intrinsic-size: auto 310px;
}

.bobby-shop-deal-card,
.bobby-shop-price-card,
.bobby-shop-cheapest-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 8px;
  border-color: #dfe7df;
}

.bobby-shop-deal-card {
  border-top: 4px solid var(--lime);
}

.bobby-shop-card-heading {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px;
}

.bobby-shop-card-heading .eyebrow {
  margin: 0 0 2px;
}

.bobby-shop-card-heading h3 {
  overflow-wrap: anywhere;
  font-size: 1.05rem;
  line-height: 1.25;
}

.bobby-shop-item-icon {
  display: grid;
  width: 43px;
  height: 43px;
  place-items: center;
  border-radius: 13px;
  background: var(--soft);
  font-size: 1.3rem;
}

.bobby-shop-tier,
.bobby-shop-cheapest-badge {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  justify-content: center;
  padding: 4px 8px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: .7rem;
  font-weight: 900;
  line-height: 1.1;
  text-align: center;
}

.bobby-shop-tier.is-learning {
  color: #5f665f;
  border-color: #d6ded7;
  background: #f2f5f2;
}

.bobby-shop-tier.is-normal {
  color: #4c5950;
  background: #eaf0eb;
}

.bobby-shop-tier.is-good {
  color: #38600e;
  background: #e8f3cf;
}

.bobby-shop-tier.is-great {
  color: #22622f;
  background: #dff2df;
}

.bobby-shop-tier.is-best,
.bobby-shop-cheapest-badge {
  color: #704000;
  border-color: #efc664;
  background: #fff1bc;
}

.bobby-shop-price-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 7px;
  margin-top: 4px;
}

.bobby-shop-price-line strong {
  color: var(--ink);
  font-size: 1.62rem;
  line-height: 1.1;
}

.bobby-shop-price-line del {
  color: var(--muted);
  font-size: .94rem;
}

.bobby-shop-promo {
  padding: 3px 7px;
  border-radius: 999px;
  color: #7b3500;
  background: #ffe7d4;
  font-size: .7rem;
  font-weight: 900;
}

.bobby-shop-unit-price,
.bobby-shop-store-name,
.bobby-shop-discount,
.bobby-shop-unavailable {
  margin: 0;
}

.bobby-shop-unit-price,
.bobby-shop-unavailable {
  color: var(--muted);
  line-height: 1.45;
}

.bobby-shop-store-name {
  color: var(--ink);
  font-weight: 850;
}

.bobby-shop-discount {
  color: var(--success);
  font-weight: 850;
}

.bobby-shop-trend {
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.bobby-shop-trend summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--orange-dark);
  font-size: .83rem;
  font-weight: 850;
  cursor: pointer;
}

.bobby-shop-trend summary::after {
  content: "+";
  font-size: 1.15rem;
  line-height: 1;
}

.bobby-shop-trend[open] summary::after {
  content: "−";
}

.bobby-shop-trend .muted,
.bobby-shop-history-status {
  margin: 4px 0 8px;
  font-size: .8rem;
}

.bobby-shop-sparkline {
  display: grid;
  gap: 7px;
  padding: 8px 0 2px;
}

.bobby-shop-sparkline svg {
  width: 100%;
  min-height: 64px;
  border-radius: 9px;
  background: var(--soft);
}

.bobby-shop-sparkline polyline {
  fill: none;
  stroke: var(--orange);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3;
  vector-effect: non-scaling-stroke;
}

.bobby-shop-sparkline > div {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px 10px;
  color: var(--muted);
  font-size: .72rem;
}

.bobby-shop-sparkline > div strong {
  color: var(--ink);
}

.bobby-shop-sparkline small {
  color: var(--muted);
  font-size: .72rem;
}

.bobby-shop-empty-state {
  display: grid;
  justify-items: start;
  gap: 10px;
  max-width: 760px;
  margin: 18px auto;
}

.bobby-shop-empty-state p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.bobby-shop-empty-icon {
  display: grid;
  width: 50px;
  height: 50px;
  place-items: center;
  border-radius: 16px;
  color: var(--ink);
  background: var(--soft);
  font-size: 1.4rem;
  font-weight: 950;
}

.bobby-shop-attribution {
  display: grid;
  gap: 6px;
  margin-top: 28px;
  border-left: 4px solid var(--orange);
}

.bobby-shop-attribution p {
  margin: 0;
  color: var(--muted);
  font-size: .82rem;
  line-height: 1.5;
}

.bobby-shop-attribution strong {
  color: var(--ink);
}

html[data-theme="dark"] .bobby-shop-intro {
  border-color: #435531;
  background:
    radial-gradient(circle at 88% 18%, rgba(185, 229, 49, .11), transparent 30%),
    linear-gradient(135deg, #182019, #202c1d);
}

html[data-theme="dark"] .bobby-shop-intro-mark,
html[data-theme="dark"] .bobby-shop-snapshot-status {
  color: var(--ink);
  border-color: var(--line);
  background: #151e18;
}

html[data-theme="dark"] .bobby-shop-learning {
  border-color: #4d642d;
  background: linear-gradient(135deg, #1b2719, #202d1a);
}

html[data-theme="dark"] .bobby-shop-controls {
  background: #151e18;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .34);
}

html[data-theme="dark"] .bobby-shop-view-switcher {
  background: #111914;
}

html[data-theme="dark"] .bobby-shop-tier.is-learning,
html[data-theme="dark"] .bobby-shop-tier.is-normal {
  color: #d1d9d2;
  border-color: #465249;
  background: #283229;
}

html[data-theme="dark"] .bobby-shop-tier.is-good,
html[data-theme="dark"] .bobby-shop-tier.is-great {
  color: #c9f7b6;
  background: #1d3a22;
}

html[data-theme="dark"] .bobby-shop-tier.is-best,
html[data-theme="dark"] .bobby-shop-cheapest-badge {
  color: #ffe19b;
  border-color: #765b24;
  background: #3b3017;
}

html[data-theme="dark"] .bobby-shop-promo {
  color: #ffc7a6;
  background: #462414;
}

@media (hover: hover) and (pointer: fine) {
  .bobby-shop-view-switcher button:not([aria-pressed="true"]):hover {
    color: var(--orange-dark);
    border-color: rgba(255, 94, 0, .2);
    background: #fff5ed;
    transform: translateY(-1px);
  }

  html[data-theme="dark"] .bobby-shop-view-switcher button:not([aria-pressed="true"]):hover {
    background: #382116;
  }
}

@media (max-width: 760px) {
  .bobby-shop-intro {
    grid-template-columns: minmax(0, 1fr);
  }

  .bobby-shop-intro-mark {
    display: none;
  }

  .bobby-shop-controls {
    top: 68px;
    grid-template-columns: minmax(0, 1fr);
    padding: 12px;
  }

  .bobby-shop-view-switcher {
    grid-template-columns: minmax(0, 1fr);
  }

  .bobby-shop-view-switcher button {
    justify-content: flex-start;
    text-align: left;
  }
}

@media (max-width: 560px) {
  .bobby-shop-snapshot-status {
    grid-template-columns: minmax(0, 1fr);
  }

  .bobby-shop-snapshot-status .button {
    width: 100%;
  }

  .bobby-shop-card-heading {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .bobby-shop-card-heading > :last-child:is(.bobby-shop-tier, .bobby-shop-cheapest-badge) {
    grid-column: 1 / -1;
    justify-self: start;
  }

  .bobby-shop-card-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  .bobby-shop-view-switcher button {
    transition: none;
  }
}
