:root {
  --page-bg: #0b1120;
  --panel-bg: #121a2b;
  --panel-bg-strong: #0f1728;
  --panel-border: #24314c;
  --panel-border-strong: #304267;
  --text-main: #e5ebf7;
  --text-muted: #95a1ba;
  --text-soft: #b8c2d9;
  --accent-start: #7c3aed;
  --accent-end: #22c55e;
  --accent-link: #8fd3ff;
  --accent-best: #35d399;
  --accent-warn: #f87171;
  --shadow-lg: 0 28px 80px rgba(2, 8, 23, 0.48);
  --shadow-md: 0 14px 42px rgba(2, 8, 23, 0.28);
  --sticky-progress-top: 1rem;
  --sticky-shop-header-top: 7.65rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background: linear-gradient(180deg, #11182c 0%, #0b1120 28%, #060913 100%);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text-main);
  font-family: "Avenir Next", "Segoe UI", "Helvetica Neue", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(124, 58, 237, 0.18), transparent 28rem),
    radial-gradient(circle at top right, rgba(34, 197, 94, 0.12), transparent 26rem),
    linear-gradient(180deg, #11182c 0%, #0b1120 28%, #060913 100%);
}

a {
  color: var(--accent-link);
}

button,
input,
textarea {
  font: inherit;
}

.search-page {
  padding: 3rem 1.5rem 4rem;
}

.search-shell {
  width: min(1180px, 100%);
  margin: 0 auto;
}

.search-shell__header {
  margin-bottom: 1.5rem;
}

.search-shell__home-link {
  display: inline-block;
  color: inherit;
  text-decoration: none;
}

.search-shell__home-link:hover .search-shell__title,
.search-shell__home-link:hover .search-shell__eyebrow {
  color: #bae6fd;
}

.search-shell__home-link:focus-visible {
  outline: 3px solid rgba(125, 211, 252, 0.55);
  outline-offset: 0.35rem;
  border-radius: 0.4rem;
}

.search-shell__eyebrow {
  margin: 0 0 0.5rem;
  color: #7dd3fc;
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.search-shell__title {
  margin: 0;
  color: #bfdbfe;
  font-size: clamp(2.4rem, 5vw, 4rem);
  line-height: 1.02;
  letter-spacing: -0.04em;
}

.search-shell__subtitle {
  max-width: 48rem;
  margin: 0.9rem 0 0;
  color: var(--text-muted);
  font-size: 1.15rem;
  line-height: 1.6;
}

.search-shell__alert {
  margin: 0 0 1rem;
  padding: 1rem 1.1rem;
  color: #fee2e2;
  background: rgba(127, 29, 29, 0.7);
  border: 1px solid rgba(248, 113, 113, 0.35);
  border-radius: 1rem;
}

.search-shell__notice {
  margin: 0 0 1rem;
  padding: 1rem 1.1rem;
  color: #d1fae5;
  background: rgba(6, 95, 70, 0.42);
  border: 1px solid rgba(52, 211, 153, 0.35);
  border-radius: 1rem;
}

.search-panel,
.recent-searches,
.searched-cards,
.progress-panel,
.results-shell__empty,
.shop-section {
  background: rgba(18, 26, 43, 0.94);
  border: 1px solid var(--panel-border);
  border-radius: 1.4rem;
  box-shadow: var(--shadow-md);
}

.search-panel {
  padding: 1.25rem;
  margin-bottom: 1.1rem;
}

.recent-searches {
  padding: 1rem 1.1rem;
  margin-bottom: 1.1rem;
}

.recent-searches__header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  margin-bottom: 0.8rem;
}

.recent-searches__title {
  margin: 0;
  font-size: 1.2rem;
  line-height: 1.2;
}

.recent-searches__list {
  display: grid;
  gap: 0.55rem;
}

.recent-searches__item {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  min-width: 0;
  padding: 0.75rem 0.85rem;
  color: inherit;
  text-decoration: none;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(36, 49, 76, 0.8);
  border-radius: 0.85rem;
}

.recent-searches__item:hover {
  border-color: rgba(125, 211, 252, 0.62);
  background: rgba(15, 23, 42, 0.82);
}

.recent-searches__item:focus-visible {
  outline: 3px solid rgba(125, 211, 252, 0.55);
  outline-offset: 0.18rem;
}

.recent-searches__body,
.recent-searches__query,
.recent-searches__meta {
  display: block;
  min-width: 0;
}

.recent-searches__query {
  overflow: hidden;
  color: var(--text-main);
  font-weight: 800;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recent-searches__meta {
  margin-top: 0.18rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.35;
}

.recent-searches__view {
  flex: 0 0 auto;
  padding: 0.38rem 0.65rem;
  color: #e0f2fe;
  font-size: 0.84rem;
  font-weight: 800;
  border: 1px solid rgba(125, 211, 252, 0.44);
  border-radius: 999px;
}

.search-panel__validation-warning {
  padding: 0.9rem 1rem;
  margin-bottom: 1rem;
  color: #fee2e2;
  background: rgba(127, 29, 29, 0.36);
  border: 1px solid rgba(248, 113, 113, 0.35);
  border-radius: 0.9rem;
}

.search-panel__validation-title {
  margin: 0;
  font-size: 1rem;
  line-height: 1.3;
}

.search-panel__validation-copy {
  margin: 0.35rem 0 0;
  color: #fecaca;
  line-height: 1.45;
}

.search-panel__validation-list {
  display: grid;
  gap: 0.25rem;
  padding: 0;
  margin: 0.7rem 0 0;
  list-style: none;
}

.search-panel__validation-list li {
  display: flex;
  gap: 0.55rem;
  align-items: baseline;
}

.search-panel__validation-position {
  flex: 0 0 auto;
  color: #fca5a5;
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

.searched-cards {
  position: relative;
  padding: 0.85rem 1rem;
  margin-bottom: 1.1rem;
}

.searched-cards__summary {
  display: flex;
  justify-content: space-between;
  gap: 0.7rem;
  align-items: flex-start;
  min-height: 2.15rem;
  padding-right: 10.4rem;
  cursor: pointer;
  list-style: none;
}

.searched-cards__summary::-webkit-details-marker {
  display: none;
}

.searched-cards__title {
  display: block;
  font-size: 1.2rem;
  font-weight: 800;
  line-height: 1.2;
}

.searched-cards__meta {
  display: block;
  margin-top: 0.2rem;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.searched-cards__toggle {
  flex: 0 0 auto;
  color: var(--accent-link);
  font-size: 0.82rem;
  font-weight: 800;
}

.searched-cards__toggle::before {
  content: "Hide";
}

.searched-cards__details:not([open]) .searched-cards__toggle::before {
  content: "Show";
}

.searched-cards__new-search {
  position: absolute;
  top: 0.85rem;
  right: 1rem;
  padding: 0.46rem 0.7rem;
  color: #e0f2fe;
  font-size: 0.84rem;
  font-weight: 800;
  text-decoration: none;
  background: rgba(14, 165, 233, 0.18);
  border: 1px solid rgba(125, 211, 252, 0.5);
  border-radius: 999px;
}

.searched-cards__new-search:hover {
  color: var(--text-main);
  border-color: rgba(125, 211, 252, 0.78);
}

.searched-cards__list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 0.18rem 0.75rem;
  padding: 0;
  margin: 0.55rem 0 0;
  list-style: none;
}

.searched-cards__item {
  display: grid;
  grid-template-columns: 2.1rem minmax(0, 1fr);
  gap: 0.42rem;
  align-items: start;
  min-width: 0;
  padding: 0.16rem 0;
  color: var(--text-soft);
}

.searched-cards__quantity {
  color: var(--text-muted);
  font-weight: 800;
  text-align: right;
}

.searched-cards__body,
.searched-cards__name,
.searched-cards__printing {
  display: block;
  min-width: 0;
}

.searched-cards__name {
  overflow-wrap: anywhere;
}

.searched-cards__printing {
  margin-top: 0.14rem;
  color: var(--text-muted);
  font-size: 0.8rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.search-panel__shops {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0.8rem 1rem;
  margin-bottom: 0.7rem;
}

.search-panel__shop-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text-soft);
  font-size: 1rem;
}

.search-panel__shop-pill input {
  width: 1rem;
  height: 1rem;
  accent-color: #2563eb;
}

.search-panel__shop-shortcuts {
  display: flex;
  gap: 0.55rem;
  margin-bottom: 1rem;
}

.search-panel__shortcut {
  padding: 0.35rem 0.6rem;
  color: var(--accent-link);
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid var(--panel-border);
  border-radius: 999px;
  cursor: pointer;
}

.search-panel__shortcut:hover {
  color: var(--text-main);
  border-color: rgba(125, 211, 252, 0.65);
}

.search-panel__mode {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.search-panel__mode-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 0.8rem;
  color: var(--text-muted);
  border: 1px solid var(--panel-border);
  border-radius: 999px;
}

.search-panel__mode-pill--active {
  color: #fff;
  border-color: rgba(96, 165, 250, 0.55);
  background: rgba(37, 99, 235, 0.22);
}

.search-panel__textarea {
  width: 100%;
  min-height: 14rem;
  padding: 1rem 1.1rem;
  color: var(--text-main);
  background: #0b1324;
  border: 1px solid var(--panel-border);
  border-radius: 1rem;
  resize: vertical;
}

.search-panel__textarea:focus {
  outline: none;
  border-color: rgba(96, 165, 250, 0.55);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.14);
}

.search-panel__limit-warning {
  margin: 0.65rem 0 0;
  color: #fca5a5;
  font-size: 0.95rem;
  font-weight: 700;
}

.search-panel__actions {
  display: flex;
  gap: 0.8rem;
  margin-top: 1rem;
}

.search-panel__submit {
  padding: 0.95rem 1.45rem;
  color: #fff;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent-start), #8b5cf6);
  border: 0;
  border-radius: 0.95rem;
  box-shadow: 0 12px 26px rgba(124, 58, 237, 0.32);
  cursor: pointer;
}

.search-panel__submit:hover {
  filter: brightness(1.06);
}

.search-panel__submit:disabled {
  color: rgba(255, 255, 255, 0.72);
  background: #475569;
  box-shadow: none;
  cursor: not-allowed;
  filter: none;
}

.progress-panel {
  position: sticky;
  top: var(--sticky-progress-top);
  z-index: 30;
  padding: 1rem 1.15rem 1.1rem;
  margin-bottom: 1.35rem;
  backdrop-filter: blur(10px);
}

.progress-panel__header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 0.9rem;
}

.progress-panel__title {
  margin: 0;
  font-size: 1.3rem;
}

.progress-panel__meta,
.progress-panel__hint {
  margin: 0.3rem 0 0;
  color: var(--text-muted);
}

.progress-panel__hint--error {
  color: #fca5a5;
}

.progress-panel__count {
  color: var(--text-soft);
  font-size: 1.3rem;
  font-weight: 700;
}

.progress-panel__actions {
  display: flex;
  justify-content: flex-end;
  margin: -0.35rem 0 0.75rem;
}

.progress-panel__bar {
  height: 0.82rem;
  overflow: hidden;
  background: #0a1220;
  border: 1px solid var(--panel-border);
  border-radius: 999px;
}

.progress-panel__bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #38bdf8, var(--accent-end));
  transition: width 180ms ease;
}

.results-shell {
  display: grid;
  gap: 1.25rem;
}

.results-sort {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
  padding: 0 0.25rem;
  margin-bottom: 1.25rem;
}

.results-sort__label {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.results-sort__option {
  padding: 0.5rem 0.75rem;
  color: var(--text-soft);
  text-decoration: none;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid var(--panel-border);
  border-radius: 999px;
}

.results-sort__option:hover,
.results-sort__option--active {
  color: var(--text-main);
  border-color: rgba(125, 211, 252, 0.65);
}

.results-sort__option--active {
  background: rgba(14, 165, 233, 0.18);
}

.results-shell__empty {
  padding: 1rem 1.1rem;
  color: var(--text-muted);
}

.shop-section {
  padding: 1rem 1.1rem 1.15rem;
}

.shop-section__header {
  position: sticky;
  top: var(--sticky-shop-header-top);
  z-index: 20;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
  margin-bottom: 0.85rem;
  background: rgba(18, 26, 43, 0.96);
  border-bottom: 1px solid rgba(48, 66, 103, 0.55);
  backdrop-filter: blur(10px);
  cursor: pointer;
  list-style: none;
}

.shop-section[data-search-details-locked="true"] .shop-section__header {
  cursor: default;
}

.shop-section[data-search-details-locked="true"] .shop-section__header::before {
  color: var(--text-muted);
}

.shop-section__header::-webkit-details-marker {
  display: none;
}

.shop-section__header > div {
  min-width: 0;
}

.shop-section__header::before {
  content: "▾";
  flex: 0 0 auto;
  margin-top: 0.2rem;
  color: var(--accent-link);
  font-size: 1.1rem;
  transition: transform 150ms ease;
}

.shop-section:not([open]) .shop-section__header {
  margin-bottom: 0;
  border-bottom: 0;
}

.shop-section:not([open]) .shop-section__header::before {
  transform: rotate(-90deg);
}

.shop-section__title {
  margin: 0;
  font-size: 1.7rem;
  line-height: 1.1;
}

.shop-section__count {
  color: var(--text-muted);
  font-size: 1.05rem;
}

.shop-section__status {
  margin-left: auto;
  padding: 0.42rem 0.8rem;
  color: var(--text-soft);
  font-size: 0.9rem;
  text-transform: capitalize;
  border: 1px solid var(--panel-border);
  border-radius: 999px;
}

.shop-section__status--completed {
  color: #d1fae5;
  border-color: rgba(52, 211, 153, 0.35);
  background: rgba(6, 95, 70, 0.36);
}

.shop-section__status--running,
.shop-section__status--queued {
  color: #dbeafe;
  border-color: rgba(96, 165, 250, 0.35);
  background: rgba(30, 64, 175, 0.26);
}

.shop-section__status--failed {
  color: #fee2e2;
  border-color: rgba(248, 113, 113, 0.35);
  background: rgba(127, 29, 29, 0.42);
}

.shop-section__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1rem;
}

.shop-section__empty,
.shop-section__error {
  margin: 0;
  color: var(--text-muted);
}

.shop-section__error {
  margin-top: 0.35rem;
  color: #fca5a5;
}

.shop-section__retry {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0.85rem;
  margin: 0 0 0.9rem;
  color: #fecaca;
  background: rgba(127, 29, 29, 0.24);
  border: 1px solid rgba(248, 113, 113, 0.26);
  border-radius: 0.9rem;
}

.retry-button {
  display: inline-flex;
  align-items: center;
  min-height: 2.25rem;
  padding: 0.45rem 0.8rem;
  color: #e0f2fe;
  font-size: 0.9rem;
  font-weight: 800;
  background: rgba(14, 165, 233, 0.18);
  border: 1px solid rgba(125, 211, 252, 0.5);
  border-radius: 999px;
  cursor: pointer;
}

.retry-button:hover {
  color: #fff;
  border-color: rgba(125, 211, 252, 0.72);
  filter: brightness(1.08);
}

.retry-button--compact {
  min-height: 2rem;
  padding: 0.38rem 0.65rem;
  font-size: 0.85rem;
}

.result-card {
  padding: 1rem;
  background: rgba(15, 23, 40, 0.9);
  border: 1px solid rgba(36, 49, 76, 0.92);
  border-radius: 1.2rem;
}

.result-card--cart-picked {
  background:
    linear-gradient(135deg, rgba(6, 95, 70, 0.22), rgba(15, 23, 40, 0.9) 42%),
    rgba(15, 23, 40, 0.9);
  border-color: rgba(52, 211, 153, 0.58);
  box-shadow: inset 0 0 0 1px rgba(52, 211, 153, 0.14);
}

.result-card--cart-duplicate {
  background: rgba(15, 23, 40, 0.62);
  border-color: rgba(36, 49, 76, 0.56);
}

.result-card__header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 0.9rem;
}

.result-card--cart-duplicate .result-card__header {
  opacity: 0.52;
}

.result-card__title {
  margin: 0;
  font-size: 1.1rem;
}

.result-card--cart-picked .result-card__title::after {
  content: "Added";
  display: inline-flex;
  margin-left: 0.55rem;
  padding: 0.12rem 0.45rem;
  color: #d1fae5;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  vertical-align: middle;
  background: rgba(6, 95, 70, 0.58);
  border: 1px solid rgba(52, 211, 153, 0.38);
  border-radius: 999px;
}

.result-card__range {
  margin: 0.3rem 0 0;
  color: var(--text-muted);
}

.result-card__range-primary {
  color: var(--accent-best);
}

.result-card__cache {
  margin: 0.25rem 0 0;
  color: #fbbf24;
  font-size: 0.85rem;
}

.result-card__view-all,
.results-modal__close {
  padding: 0;
  color: var(--accent-link);
  background: transparent;
  border: 0;
  cursor: pointer;
}

.listing-card {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  gap: 0.95rem;
  padding: 0.95rem;
  background: rgba(20, 28, 46, 0.92);
  border: 1px solid rgba(45, 59, 88, 0.85);
  border-radius: 1.1rem;
}

.listing-card--featured {
  border-color: rgba(53, 211, 153, 0.8);
  box-shadow: inset 0 0 0 1px rgba(53, 211, 153, 0.2);
}

.listing-card--cart-picked {
  background: rgba(6, 95, 70, 0.16);
  border-color: rgba(52, 211, 153, 0.62);
  box-shadow: inset 0 0 0 1px rgba(52, 211, 153, 0.12);
}

.listing-card--cart-duplicate {
  opacity: 0.58;
  background: rgba(15, 23, 40, 0.74);
}

.listing-card__image-wrap {
  width: 84px;
}

.listing-card__image-button {
  display: block;
  padding: 0;
  background: transparent;
  border: 0;
  cursor: zoom-in;
}

.listing-card__image-button:focus-visible {
  outline: 3px solid rgba(125, 211, 252, 0.6);
  outline-offset: 0.2rem;
  border-radius: 0.7rem;
}

.listing-card__image,
.listing-card__image-placeholder {
  display: block;
  width: 84px;
  height: 116px;
  object-fit: cover;
  border: 1px solid rgba(77, 90, 120, 0.8);
  border-radius: 0.7rem;
}

.listing-card__image-placeholder {
  display: grid;
  place-items: center;
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 700;
  background: linear-gradient(180deg, #27324a, #131b2d);
}

.listing-card__title,
.listing-card__price,
.listing-card__comparison,
.listing-card__meta,
.listing-card__match-warning {
  margin: 0;
}

.listing-card__title {
  font-size: 1rem;
  line-height: 1.28;
}

.listing-card__price {
  margin-top: 0.3rem;
  font-size: 1.1rem;
  font-weight: 800;
}

.listing-card__comparison {
  margin-top: 0.1rem;
  font-weight: 700;
}

.listing-card__comparison--best {
  color: var(--accent-best);
}

.listing-card__comparison--delta {
  color: var(--accent-warn);
}

.listing-card__meta {
  margin-top: 0.45rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.listing-card__match-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.45rem;
}

.listing-card__match-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.22rem;
  min-height: 1.45rem;
  padding: 0.16rem 0.45rem;
  color: #bbf7d0;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.1;
  text-transform: uppercase;
  background: rgba(22, 101, 52, 0.28);
  border: 1px solid rgba(74, 222, 128, 0.28);
  border-radius: 999px;
}

.listing-card__match-warning {
  position: relative;
  display: inline-flex;
  width: fit-content;
  margin-top: 0.4rem;
  color: #fbbf24;
  font-weight: 700;
  cursor: help;
}

.listing-card__match-warning::after {
  position: absolute;
  bottom: calc(100% + 0.55rem);
  left: 0;
  z-index: 5;
  width: min(18rem, 72vw);
  padding: 0.6rem 0.7rem;
  color: var(--text-main);
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.35;
  text-align: left;
  pointer-events: none;
  content: attr(data-tooltip);
  background: rgba(2, 8, 23, 0.96);
  border: 1px solid var(--panel-border-strong);
  border-radius: 0.65rem;
  box-shadow: var(--shadow-md);
  opacity: 0;
  transform: translateY(0.25rem);
  transition: opacity 140ms ease, transform 140ms ease;
}

.listing-card__match-warning:hover::after,
.listing-card__match-warning:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
}

.listing-card__links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 0.55rem;
}

.listing-card__cart {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-top: 0.65rem;
}

.listing-card__cart-warning {
  flex-basis: 100%;
  margin: 0;
  color: #fbbf24;
  font-size: 0.9rem;
  font-weight: 700;
}

.listing-card__cart-note {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 1.35rem;
  height: 1.35rem;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 800;
  border: 1px solid var(--panel-border-strong);
  border-radius: 999px;
  cursor: help;
}

.listing-card__cart-note::after {
  position: absolute;
  bottom: calc(100% + 0.55rem);
  left: 50%;
  z-index: 5;
  width: min(16rem, 72vw);
  padding: 0.6rem 0.7rem;
  color: var(--text-main);
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.35;
  text-align: left;
  pointer-events: none;
  content: attr(data-tooltip);
  background: rgba(2, 8, 23, 0.96);
  border: 1px solid var(--panel-border-strong);
  border-radius: 0.65rem;
  box-shadow: var(--shadow-md);
  opacity: 0;
  transform: translate(-50%, 0.25rem);
  transition: opacity 140ms ease, transform 140ms ease;
}

.listing-card__cart-note:hover::after,
.listing-card__cart-note:focus-visible::after {
  opacity: 1;
  transform: translate(-50%, 0);
}

.listing-card__cart-badge,
.listing-card__cart-button {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding: 0.38rem 0.65rem;
  font-size: 0.88rem;
  font-weight: 800;
  border-radius: 999px;
}

.listing-card__cart-badge {
  color: #d1fae5;
  background: rgba(6, 95, 70, 0.5);
  border: 1px solid rgba(52, 211, 153, 0.42);
}

.listing-card__cart-button {
  color: #e0f2fe;
  background: rgba(14, 165, 233, 0.18);
  border: 1px solid rgba(125, 211, 252, 0.5);
  cursor: pointer;
}

.listing-card__cart-button--secondary {
  color: var(--text-soft);
  background: rgba(15, 23, 42, 0.66);
  border-color: var(--panel-border-strong);
}

.listing-card__cart-form {
  margin: 0;
}

.results-modal {
  width: min(1280px, calc(100vw - 2rem));
  padding: 0;
  color: var(--text-main);
  background: transparent;
  border: 0;
}

.results-modal::backdrop {
  background: rgba(2, 8, 23, 0.78);
  backdrop-filter: blur(6px);
}

.results-modal__surface {
  overflow: hidden;
  background: rgba(18, 26, 43, 0.98);
  border: 1px solid var(--panel-border);
  border-radius: 1.35rem;
  box-shadow: var(--shadow-lg);
}

.results-modal__header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  padding: 1.1rem 1.3rem;
  border-bottom: 1px solid rgba(48, 66, 103, 0.6);
}

.results-modal__title {
  margin: 0;
  font-size: 1.25rem;
}

.results-modal__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1rem;
  padding: 1.3rem;
}

.card-image-modal {
  width: min(30rem, calc(100vw - 1.5rem));
  padding: 0;
  color: var(--text-main);
  background: transparent;
  border: 0;
}

.card-image-modal::backdrop {
  background: rgba(2, 8, 23, 0.82);
  backdrop-filter: blur(6px);
}

.card-image-modal__surface {
  overflow: hidden;
  background: rgba(18, 26, 43, 0.98);
  border: 1px solid var(--panel-border);
  border-radius: 1rem;
  box-shadow: var(--shadow-lg);
}

.card-image-modal__header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  padding: 0.75rem 0.9rem;
  border-bottom: 1px solid rgba(48, 66, 103, 0.6);
}

.card-image-modal__title {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  font-size: 0.95rem;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-image-modal__close {
  padding: 0;
  color: var(--accent-link);
  background: transparent;
  border: 0;
  cursor: pointer;
}

.card-image-modal__body {
  display: grid;
  place-items: center;
  padding: 1rem;
}

.card-image-modal__image {
  display: block;
  width: auto;
  max-width: min(100%, 24rem);
  max-height: min(76vh, 42rem);
  object-fit: contain;
  border-radius: 0.85rem;
  box-shadow: 0 18px 54px rgba(2, 8, 23, 0.42);
}

@media (max-width: 720px) {
  :root {
    --sticky-progress-top: 0.5rem;
    --sticky-shop-header-top: 2.8rem;
  }

  .search-page {
    padding: 1.5rem 1rem 2.5rem;
  }

  .search-panel,
  .recent-searches,
  .searched-cards,
  .progress-panel,
  .shop-section {
    padding-left: 0.9rem;
    padding-right: 0.9rem;
  }

  .searched-cards {
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
    border-radius: 1rem;
  }

  .searched-cards__summary {
    min-height: 1.9rem;
    padding-right: 8.8rem;
  }

  .searched-cards__title {
    font-size: 0.98rem;
  }

  .searched-cards__meta,
  .searched-cards__toggle {
    font-size: 0.78rem;
  }

  .searched-cards__new-search {
    top: 0.75rem;
    right: 0.9rem;
    padding: 0.38rem 0.56rem;
    font-size: 0.72rem;
  }

  .searched-cards__list {
    grid-template-columns: 1fr;
    gap: 0.1rem;
    margin-top: 0.45rem;
  }

  .searched-cards__item {
    grid-template-columns: 1.65rem minmax(0, 1fr);
    gap: 0.35rem;
    padding: 0.08rem 0;
    font-size: 0.88rem;
  }

  .recent-searches {
    border-radius: 1rem;
  }

  .recent-searches__title {
    font-size: 1rem;
  }

  .recent-searches__item {
    gap: 0.65rem;
    padding: 0.65rem 0.7rem;
  }

  .recent-searches__query {
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .recent-searches__meta {
    font-size: 0.78rem;
  }

  .recent-searches__view {
    padding: 0.32rem 0.52rem;
    font-size: 0.72rem;
  }

  .result-card__header,
  .results-modal__header {
    flex-direction: column;
    align-items: flex-start;
  }

  .progress-panel {
    padding: 0.5rem 0.6rem;
    margin-bottom: 0.8rem;
    border-radius: 0.85rem;
  }

  .progress-panel__header {
    display: none;
  }

  .progress-panel__hint {
    display: none;
  }

  .progress-panel__bar {
    height: 0.55rem;
  }

  .shop-section {
    padding-top: 0.65rem;
    padding-bottom: 0.85rem;
    border-radius: 1rem;
  }

  .shop-section__header {
    gap: 0.55rem;
    align-items: center;
    padding-top: 0.45rem;
    padding-bottom: 0.45rem;
    margin-bottom: 0.7rem;
  }

  .shop-section__header::before {
    margin-top: 0;
    font-size: 0.9rem;
  }

  .shop-section__title {
    font-size: 1.25rem;
  }

  .shop-section__count {
    display: block;
    margin-top: 0.08rem;
    font-size: 0.82rem;
    line-height: 1.25;
  }

  .shop-section__status {
    flex: 0 0 auto;
    padding: 0.26rem 0.5rem;
    font-size: 0.72rem;
  }

  .shop-section__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem;
  }

  .result-card {
    min-width: 0;
    padding: 0.55rem;
    background: rgba(15, 23, 40, 0.74);
    border-color: rgba(36, 49, 76, 0.62);
    border-radius: 0.85rem;
  }

  .result-card__header {
    gap: 0.25rem;
    margin-bottom: 0.45rem;
  }

  .result-card__title {
    font-size: 0.9rem;
    line-height: 1.2;
  }

  .result-card__range {
    margin-top: 0.18rem;
    font-size: 0.78rem;
    line-height: 1.25;
  }

  .result-card__range-secondary {
    display: block;
  }

  .result-card__cache,
  .result-card__view-all {
    font-size: 0.78rem;
  }

  .listing-card {
    grid-template-columns: 68px minmax(0, 1fr);
    gap: 0.45rem;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .listing-card--featured,
  .listing-card--cart-picked {
    border: 0;
    box-shadow: none;
  }

  .listing-card__image-wrap {
    width: 68px;
  }

  .listing-card__image-button:focus-visible {
    border-radius: 0.5rem;
  }

  .listing-card__image,
  .listing-card__image-placeholder {
    width: 68px;
    height: 94px;
    border-radius: 0.5rem;
  }

  .listing-card__body {
    min-width: 0;
  }

  .listing-card__title {
    font-size: 0.78rem;
    line-height: 1.18;
  }

  .listing-card__price {
    margin-top: 0.18rem;
    font-size: 0.9rem;
  }

  .listing-card__comparison {
    font-size: 0.72rem;
    line-height: 1.2;
  }

  .listing-card__meta {
    display: none;
  }

  .listing-card__match-warning {
    margin-top: 0.18rem;
    font-size: 0.72rem;
    line-height: 1.2;
  }

  .listing-card__match-warning::after {
    width: min(13rem, 58vw);
    font-size: 0.68rem;
  }

  .listing-card__cart {
    gap: 0.25rem;
    margin-top: 0.35rem;
  }

  .listing-card__cart-badge,
  .listing-card__cart-button {
    min-height: 1.55rem;
    padding: 0.24rem 0.4rem;
    font-size: 0.7rem;
  }

  .listing-card__cart-note {
    width: 1.1rem;
    height: 1.1rem;
    font-size: 0.64rem;
  }

  .listing-card__cart-warning {
    font-size: 0.68rem;
    line-height: 1.2;
  }

  .listing-card__links {
    gap: 0.45rem;
    margin-top: 0.3rem;
    font-size: 0.72rem;
  }

  .results-modal {
    width: calc(100vw - 1rem);
  }

  .results-modal__grid {
    grid-template-columns: 1fr;
    padding: 1rem;
  }

  .card-image-modal {
    width: calc(100vw - 1rem);
  }

  .card-image-modal__body {
    padding: 0.75rem;
  }

  .card-image-modal__image {
    max-width: min(100%, 21rem);
    max-height: 72vh;
  }
}

@media (max-width: 360px) {
  .shop-section__grid {
    grid-template-columns: 1fr;
  }
}
