/* ---------------------------------------------------------------------------
   Boxes marketplace clone — design tokens lifted from app.boxes.market
   (Hyvä "Satoshi" theme).
--------------------------------------------------------------------------- */

@font-face {
  font-family: Satoshi;
  src: url("../fonts/Satoshi-Medium.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
  font-style: normal;
}
@font-face {
  font-family: Satoshi;
  src: url("../fonts/Satoshi-Bold.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
  font-style: normal;
}

:root {
  --color-primary-50: #7e7e7e;
  --color-primary-100: #4b4b4b;
  --color-primary-400: #252525;
  --color-primary-500: #181818;
  --color-primary-600: #0b0b0b;
  --color-primary-700: #3f3f3f;

  --color-background-50: #ffffff;
  --color-background-400: #ffffff;
  --color-background-500: #f9f9f9;
  --color-background-600: #efefef;
  --color-background-700: #e6e6e6;

  --color-secondary-500: #f5f5f5;
  --color-secondary-600: #e8e8e8;
  --color-secondary-700: #dcdcdc;

  --color-text-50: #000000;
  --color-text-100: #0f0f0f;
  --color-text-400: #353535;
  --color-text-500: #424242;
  --color-text-600: #4f4f4f;
  --color-text-700: #5c5c5c;

  --color-overlay: #18181833;
  --color-overlay-dark: #18181866;
  --fade-in-bg: #f3f3f3;

  --header-shadow: 0 10px 8px rgb(0 0 0 / 0.04);
  --minicart-width: 400px;
  --account-width: 200px;
  --search-width: 450px;
  --menu-width: 250px;

  --font-body-family: "Satoshi", sans-serif;
  --font-body-weight: 500;
  --font-heading-weight: 700;
}

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

/* The UA rule for [hidden] is only `display: none`, so any component that sets
   its own `display` silently outranks it and the JS `el.hidden = true` stops
   working. That bit the intake queue filter and the matched-listing card. */
[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--color-background-500);
  color: var(--color-text-700);
  font-family: var(--font-body-family);
  font-weight: var(--font-body-weight);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4 {
  font-weight: var(--font-heading-weight);
  color: var(--color-text-500);
  margin: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

button {
  font: inherit;
  color: inherit;
  border: 0;
  background: none;
  cursor: pointer;
}

input {
  font: inherit;
}

.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;
}

.content-wrapper {
  width: 100%;
  max-width: 1280px;
  margin-inline: auto;
  padding-inline: 16px;
}

/* --------------------------------------------------------------- buttons -- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;
  padding-inline: 20px;
  border-radius: 8px;
  font-weight: 500;
  white-space: nowrap;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.button--filled-primary {
  background: var(--color-primary-500);
  color: #fff;
}
.button--filled-primary:hover {
  background: var(--color-primary-600);
}

.button--filled-secondary {
  background: var(--color-background-50);
  color: var(--color-text-500);
}
.button--filled-secondary:hover {
  background: var(--color-secondary-600);
}

.button--outline-secondary {
  border: 1px solid var(--color-text-700);
  color: var(--color-text-500);
}
.button--outline-secondary:hover:not(.button--disabled) {
  background: var(--color-secondary-600);
}

.button--disabled {
  color: var(--color-secondary-700);
  border-color: var(--color-secondary-700);
  cursor: not-allowed;
}

.icon-button {
  width: 48px;
  height: 48px;
  padding: 0 12px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Theme hook: only paints an edge in forced-contrast mode, like the original. */
.contrast-border {
  border: 0;
}

@media (prefers-contrast: more) {
  .contrast-border {
    border: 1px solid var(--color-secondary-700);
  }
}

/* ---------------------------------------------------------------- header -- */

.page-header {
  position: sticky;
  top: 0;
  z-index: 60;
  padding: 20px;
  pointer-events: none;
}

.page-header__inner {
  max-width: 1280px;
  margin-inline: auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
  gap: 12px;
}

.page-header__inner > * {
  pointer-events: auto;
}

/* Once content scrolls under it, the floating header needs its own surface —
   otherwise the logo sits unreadable on top of a product image. */
.page-header::before {
  content: "";
  position: absolute;
  inset: 0;
  background: color-mix(in srgb, var(--color-background-500) 82%, transparent);
  box-shadow: var(--header-shadow);
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

@supports (backdrop-filter: blur(1px)) {
  .page-header::before {
    backdrop-filter: blur(12px) saturate(1.4);
  }
}

.page-header.is-stuck::before {
  opacity: 1;
}

.header-left {
  justify-self: start;
}

.header-logo {
  justify-self: center;
  display: flex;
  align-items: center;
  height: 48px;
}

.header-logo img {
  height: 39px;
  width: auto;
}

.header-right {
  justify-self: end;
  display: flex;
  align-items: start;
  gap: 8px;
}

.header-right .icon-button {
  background: var(--color-background-50);
  color: var(--color-text-500);
}
.header-right .icon-button:hover {
  background: var(--color-secondary-600);
}

.menu-button {
  gap: 12px;
  padding-inline: 16px;
  width: auto;
}

.menu-button__label {
  font-weight: 700;
  color: var(--color-text-500);
}

.cart-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--color-primary-500);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
}

.icon-button--cart {
  position: relative;
}

/* --------------------------------------------------------------- panels --- */

.overlay {
  position: fixed;
  inset: 0;
  background: var(--color-overlay);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
  z-index: 70;
}

.overlay.is-open {
  opacity: 1;
  visibility: visible;
}

.panel {
  position: fixed;
  top: 0;
  bottom: 0;
  z-index: 80;
  width: min(100vw, var(--panel-width, 400px));
  background: var(--color-background-50);
  display: flex;
  flex-direction: column;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
}

.panel--left {
  left: 0;
  transform: translateX(-100%);
}
.panel--right {
  right: 0;
  transform: translateX(100%);
}
.panel.is-open {
  transform: translateX(0);
}

.panel--menu {
  --panel-width: 320px;
}
.panel--search {
  --panel-width: var(--search-width);
}
.panel--account {
  --panel-width: 320px;
}
.panel--cart {
  --panel-width: var(--minicart-width);
}

.panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 20px 12px;
}

.panel__title {
  font-size: 20px;
  font-weight: 700;
  color: var(--color-text-500);
}

.panel__body {
  padding: 8px 20px 24px;
  flex: 1;
}

.panel__foot {
  padding: 16px 20px 24px;
  border-top: 1px solid var(--color-background-700);
}

.panel-close {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--color-text-500);
  font-weight: 700;
}

/* menu */

.menu-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.menu-list li + li {
  border-top: 1px solid var(--color-background-600);
}

.menu-list a,
.menu-list button {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 14px 4px;
  color: var(--color-text-500);
  font-weight: 500;
  text-align: start;
}

.menu-list a:hover,
.menu-list button:hover {
  color: var(--color-text-50);
}

.menu-sublist {
  list-style: none;
  margin: 0;
  padding: 0 0 8px 16px;
  display: none;
}

.menu-sublist.is-open {
  display: block;
}

.menu-sublist a {
  padding: 10px 4px;
  font-size: 15px;
  color: var(--color-text-700);
}

.menu-chevron {
  transition: transform 0.2s ease;
}
.menu-chevron.is-open {
  transform: rotate(180deg);
}

/* search */

.search-field {
  position: relative;
  display: flex;
  align-items: center;
  border: 1px solid var(--color-text-700);
  border-radius: 8px;
  padding: 0 12px;
  height: 48px;
  gap: 8px;
}

.search-field input {
  flex: 1;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--color-text-500);
  min-width: 0;
}

.search-section-title {
  margin-top: 24px;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-text-500);
}

.search-hint,
.search-empty {
  font-size: 14px;
  color: var(--color-text-700);
}

.search-empty strong {
  display: block;
  color: var(--color-text-500);
}

.search-result {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--color-background-600);
}

.search-result img {
  width: 48px;
  height: 60px;
  object-fit: cover;
  border-radius: 6px;
  background: var(--fade-in-bg);
  mix-blend-mode: darken;
}

.search-result__name {
  font-weight: 700;
  font-size: 15px;
  color: var(--color-text-500);
}

.search-result__seller {
  font-size: 13px;
  color: var(--color-text-700);
}

/* account */

.account-links {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.account-links a {
  padding: 12px 4px;
  color: var(--color-text-500);
  font-weight: 500;
  border-bottom: 1px solid var(--color-background-600);
}

/* mini cart */

.cart-empty {
  color: var(--color-text-700);
  padding: 24px 0;
}

.cart-line {
  display: flex;
  gap: 12px;
  padding: 16px 0;
  border-bottom: 1px solid var(--color-background-600);
}

.cart-line img {
  width: 64px;
  height: 80px;
  object-fit: cover;
  border-radius: 8px;
  background: var(--fade-in-bg);
  mix-blend-mode: darken;
}

.cart-line__name {
  font-weight: 700;
  font-size: 15px;
  color: var(--color-text-500);
}

.cart-line__meta {
  font-size: 13px;
  color: var(--color-text-700);
}

.cart-line__remove {
  margin-left: auto;
  align-self: start;
  color: var(--color-text-700);
}

.order-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0 16px;
}

.order-summary__label {
  font-weight: 700;
  color: var(--color-text-500);
}

.checkout-link {
  width: 100%;
}

/* ------------------------------------------------------------ home grid --- */

.main {
  padding-top: 12px;
  padding-bottom: 64px;
}

/* Two up on a phone, matching app.boxes.market — measured at 375px, its cards
   are 162px in a two-column grid. Beyond looking like the real thing, a card
   half as wide needs a quarter of the pixels, so the same page of products is a
   fraction of the bytes. */
.product-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-inline: auto;
}

@media (min-width: 1024px) {
  .product-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.card-link {
  position: relative;
  display: flex;
  height: 100%;
  min-width: 0;
  border-radius: 6px;
  cursor: pointer;
}

/* Soft panel that fades in behind the whole card on hover. It bleeds 8px past
   the card on every side, which is wider than the 12px grid gap — so adjacent
   panels overlap by 4px. That is what the storefront does, and it is invisible
   because the fill is flat with no border. */
.card-link::before {
  content: "";
  position: absolute;
  inset: -8px;
  border-radius: 16px;
  background: var(--color-secondary-500);
  opacity: 0;
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-link:hover::before {
  opacity: 1;
}

.card-product {
  position: relative;
  z-index: 10;  /* above the hover panel */
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 12px;
  text-align: start;
}

.card-product__media {
  position: relative;
  overflow: hidden;
  border-radius: 6px;
  background: var(--fade-in-bg);
  transform: translateZ(0);
}

.card-product__media-inner {
  aspect-ratio: 0.75 / 1;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  /* The same fill as the parent, on the element that scales. Not redundant:
     transform makes this a stacking context, which becomes the isolation
     boundary for the image's mix-blend-mode. Without a fill here the image
     would blend against transparency the moment hover applies the scale, and
     the product's white backdrop would stop being darkened — the picture
     visibly washes out. The storefront puts the background on both for the
     same reason. */
  background: var(--fade-in-bg);
}

.card-product__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  mix-blend-mode: darken;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Both the frame and the image scale by 1.05, so the picture grows 1.1025x
   overall — the storefront puts the class on both elements and the transforms
   compound. Pointer devices only: a tap on a phone would leave the card stuck
   in its hover state. */
@media (min-width: 768px) and (hover: hover) {
  .card-link:hover .card-product__media-inner,
  .card-link:hover .card-product__media img {
    transform: scale(1.05);
  }
}

.card-product__body {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 12px;
}

.card-product__body p {
  margin: 0;
}

.card-product__name {
  font-size: 16px;
  font-weight: 700;
  color: var(--color-text-500);
}

.card-product__seller {
  font-size: 16px;
  color: var(--color-text-700);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-product__seller strong {
  color: var(--color-text-500);
}

.card-product__price {
  color: var(--color-text-700);
}

.card-product__quickbuy {
  position: absolute;
  right: 0;
  top: 0;
  color: var(--color-primary-500);
}

@media (min-width: 768px) {
  .card-product__quickbuy {
    display: none;
  }
}

/* -------------------------------------------------------- product detail -- */

.product-view {
  position: relative;
  z-index: 30;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-inline: auto;
  width: 100%;
}

@media (min-width: 768px) {
  .product-view {
    display: grid;
    grid-template-columns: 1fr 250px;
    align-items: start;
    gap: 24px;
  }
}

@media (min-width: 1024px) {
  .product-view {
    grid-template-columns: 1fr 330px;
  }
}

@media (min-width: 1280px) {
  .product-view {
    grid-template-columns: 1fr 400px;
    gap: 64px;
  }
}

.gallery {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  padding-bottom: 28px;
}

.gallery__figure {
  position: relative;
  /* <figure> carries a UA default of `margin: 1em 40px`. With width:100% below
     that made the box 80px wider than its track and shoved it 40px right —
     off-centre on every screen and overflowing on a phone. */
  margin: 0;
  /* Width must be definite or the ratio resolves against the row height. */
  width: 100%;
  aspect-ratio: 0.75 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--fade-in-bg);
  border-radius: 16px;
  cursor: zoom-in;
}

.gallery__figure img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  mix-blend-mode: darken;
}

.product-info {
  padding-top: 8px;
}

@media (min-width: 768px) {
  .product-info {
    position: sticky;
    top: 88px;
  }
}

.product-title {
  margin-bottom: 12px;
  font-size: 22px;
  line-height: 1.15;
  color: var(--color-text-500);
}

@media (min-width: 768px) {
  .product-title {
    font-size: 36px;
  }
}

.rating {
  display: flex;
  gap: 2px;
  color: var(--color-secondary-700);
  margin-bottom: 24px;
}

.product-price {
  color: var(--color-text-700);
  margin-bottom: 32px;
}

.add-to-cart-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
}

.qty-input {
  width: 44px;
  height: 48px;
  flex-shrink: 0;
  padding: 0 4px;
  text-align: center;
  background: transparent;
  border: 1px solid var(--color-text-700);
  border-radius: 8px;
  color: var(--color-text-500);
  -moz-appearance: textfield;
}

.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.add-to-cart {
  flex: 1 1 180px;
}

.product-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 8px;
}

.product-meta__row strong,
.product-meta__row a {
  color: var(--color-text-500);
  font-weight: 700;
}

.product-meta__row a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.accordion {
  border-top: 1px solid var(--color-background-700);
  margin-top: 16px;
}

.accordion__trigger {
  display: flex;
  width: 100%;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 0;
  text-align: start;
  font-weight: 700;
  color: var(--color-text-500);
}

.accordion__icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 1px solid var(--color-background-700);
  border-radius: 8px;
  transition: transform 0.2s ease;
}

.accordion__trigger[aria-expanded="true"] .accordion__icon {
  transform: rotate(180deg);
}

.accordion__panel {
  display: none;
  padding-bottom: 20px;
  color: var(--color-text-700);
}

.accordion__panel.is-open {
  display: block;
}

.accordion__panel p {
  margin: 0 0 16px;
}

.accordion__panel h4 {
  margin: 0 0 4px;
  font-size: 16px;
}

.share-row {
  display: flex;
  justify-content: center;
  padding: 32px 0;
}

.share-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  color: var(--color-text-500);
}

/* ------------------------------------------------------ similar products -- */

.similar {
  margin-top: 48px;
}

.similar__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.similar__title {
  font-size: 22px;
}

@media (min-width: 768px) {
  .similar__title {
    font-size: 28px;
  }
}

.similar__nav {
  display: flex;
  gap: 8px;
}

.similar__nav .icon-button {
  width: 44px;
  height: 44px;
}

.similar__rail {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: var(--color-secondary-700) transparent;
  /* overflow-x:auto clips vertically too, so leave room for the 8px hover
     panel bleed and pull it back with a matching negative margin — otherwise
     the top edge of the panel is sliced off. */
  padding-top: 8px;
  margin-top: -8px;
  padding-bottom: 12px;
  /* bleed to the viewport edges so cards scroll past the wrapper padding */
  margin-inline: -16px;
  padding-inline: 16px;
}

.similar__rail::-webkit-scrollbar {
  height: 6px;
}

.similar__rail::-webkit-scrollbar-track {
  background: var(--color-background-700);
  border-radius: 999px;
}

.similar__rail::-webkit-scrollbar-thumb {
  background: var(--color-secondary-700);
  border-radius: 999px;
}

.similar__rail::-webkit-scrollbar-thumb:hover {
  background: var(--color-primary-50);
}

.similar__item {
  flex: 0 0 auto;
  width: 240px;
  scroll-snap-align: start;
}

@media (min-width: 768px) {
  .similar__item {
    width: 303px;
  }
}

/* ----------------------------------------------------------------- reviews */

.reviews {
  border-top: 1px solid var(--color-background-700);
  padding-top: 40px;
  margin-top: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.reviews__title {
  font-size: 22px;
  margin-bottom: 8px;
}

@media (min-width: 768px) {
  .reviews__title {
    font-size: 28px;
  }
}

.reviews__subtitle {
  color: var(--color-text-700);
  margin: 0 0 24px;
}

.review-form {
  display: grid;
  gap: 16px;
  width: 100%;
  max-width: 560px;
  text-align: start;
}

.review-form .rating-input {
  justify-content: center;
  width: 100%;
}

.review-form .field:first-child {
  text-align: center;
}

.field label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 700;
  color: var(--color-text-500);
}

.field input,
.field textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--color-text-700);
  border-radius: 8px;
  background: transparent;
  color: var(--color-text-500);
  outline: none;
}

.field input:focus,
.field textarea:focus,
.search-field:focus-within {
  border-color: var(--color-primary-500);
}

.rating-input {
  display: inline-flex;
  gap: 4px;
}

.rating-input button {
  color: var(--color-secondary-700);
  line-height: 0;
}

.rating-input button.is-active {
  color: var(--color-primary-500);
}

.review-form .button {
  justify-self: center;
  min-width: 200px;
}

/* ---------------------------------------------------------------- footer -- */

.page-footer {
  border-top: 1px solid var(--color-background-700);
  margin-top: 48px;
  padding: 24px 0 40px;
}

.footer-accordion {
  max-width: 1280px;
  margin-inline: auto;
  padding-inline: 16px;
}

.footer-accordion__trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 16px 0;
  font-weight: 700;
  color: var(--color-text-500);
}

.footer-links {
  display: none;
  padding-bottom: 16px;
}

.footer-links.is-open {
  display: block;
}

.footer-links a {
  color: var(--color-text-700);
}
.footer-links a:hover {
  color: var(--color-text-500);
}

.copyright {
  padding-top: 24px;
  font-size: 14px;
  color: var(--color-text-700);
}

/* ------------------------------------------------------------------ misc -- */

.stub {
  min-height: 40vh;
  display: grid;
  place-items: center;
  text-align: center;
  gap: 8px;
  padding: 80px 16px;
}

.stub h1 {
  font-size: 32px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 16px);
  background: var(--color-primary-500);
  color: #fff;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 15px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 90;
}

.toast.is-open {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* The magnified layer sits inside the gallery frame, not over the page. Its
   background is the same file at 2x, panned by background-position as the
   cursor moves — see the zoom block in app.js. */
.zoomed-img-container {
  position: absolute;
  inset: 0;
  z-index: 10;
  margin: 0;
  display: block;
  height: 100%;
  width: 100%;
  max-width: 100%;
  cursor: zoom-out;
  border-radius: 16px;
  background-color: var(--fade-in-bg);
}

.zoomed-img-container .zoomed-img {
  height: 100%;
  background-repeat: no-repeat;
  /* Same blend as the resting image, so the product's white backdrop drops out
     on the tinted frame instead of showing as a bright rectangle. */
  mix-blend-mode: darken;
}

/* =========================================================================
   Marketplace: accounts, vendor listings, admin review
   ========================================================================= */

/* ----------------------------------------------------------------- flashes */

.flash-stack {
  display: grid;
  gap: 8px;
  margin-bottom: 20px;
}

.flash {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 15px;
  border: 1px solid transparent;
}

.flash--success {
  background: var(--color-background-50);
  border-color: var(--color-background-700);
  color: var(--color-text-500);
}

.flash--error {
  background: #fdf1f1;
  border-color: #f0cccc;
  color: #8c2f2f;
}

/* ------------------------------------------------------------ form pages -- */

.form-page {
  max-width: 520px;
  margin-inline: auto;
  padding: 8px 0 24px;
}

.form-page__head {
  margin-bottom: 24px;
  text-align: center;
}

.form-page__title {
  font-size: 28px;
  line-height: 1.15;
}

@media (min-width: 768px) {
  .form-page__title {
    font-size: 36px;
  }
}

.form-page__subtitle {
  margin: 8px 0 0;
  color: var(--color-text-700);
}

.stacked-form {
  display: grid;
  gap: 18px;
  background: var(--color-background-50);
  padding: 24px;
  border-radius: 12px;
}

.stacked-form .button[type="submit"] {
  width: 100%;
}

.field__hint {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--color-text-700);
}

.field textarea {
  resize: vertical;
  font-family: inherit;
}

.field input[type="file"] {
  padding: 10px;
  border: 1px dashed var(--color-text-700);
  background: var(--color-background-500);
}

.form-foot {
  margin: 0;
  text-align: center;
  font-size: 15px;
  color: var(--color-text-700);
}

.form-foot a,
.form-page a {
  color: var(--color-text-500);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.form-actions .button {
  flex: 1 1 160px;
}

.demo-accounts {
  border-top: 1px solid var(--color-background-700);
  padding-top: 16px;
  font-size: 14px;
  color: var(--color-text-700);
}

.demo-accounts h2 {
  font-size: 14px;
  margin-bottom: 6px;
}

.demo-accounts ul {
  margin: 0;
  padding-left: 18px;
}

/* choice cards (buyer / vendor) */

.choice-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr 1fr;
}

/* `label.choice` beats the `.field label { display: block }` base rule. */
label.choice {
  display: grid;
  gap: 2px;
  margin-bottom: 0;
  padding: 14px;
  border: 1px solid var(--color-background-700);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.choice:hover {
  border-color: var(--color-primary-50);
}

.choice.is-selected {
  border-color: var(--color-primary-500);
  background: var(--color-secondary-500);
}

.choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.choice__title {
  font-weight: 700;
  color: var(--color-text-500);
}

.choice__desc {
  font-size: 13px;
  color: var(--color-text-700);
}

.image-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  font-size: 13px;
  color: var(--color-text-700);
}

.image-preview img {
  width: 60px;
  height: 75px;
  object-fit: cover;
  border-radius: 8px;
  background: var(--fade-in-bg);
}

/* -------------------------------------------------------------- dashboard */

.dash {
  padding: 8px 0 24px;
}

.dash__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.dash__title {
  font-size: 28px;
  line-height: 1.15;
}

@media (min-width: 768px) {
  .dash__title {
    font-size: 36px;
  }
}

.dash__subtitle {
  margin: 8px 0 0;
  color: var(--color-text-700);
}

.stat-row {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 24px;
}

.stat {
  background: var(--color-background-50);
  border-radius: 12px;
  padding: 20px;
  display: grid;
  gap: 2px;
}

.stat__value {
  font-size: 32px;
  font-weight: 700;
  color: var(--color-text-500);
  line-height: 1.1;
}

.stat__label {
  font-size: 14px;
  color: var(--color-text-700);
}

/* ---------------------------------------------------------- listing rows -- */

.listing-rows {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.listing-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  padding: 16px;
  background: var(--color-background-50);
  border-radius: 12px;
}

.listing-row__img {
  width: 80px;
  height: 100px;
  object-fit: cover;
  border-radius: 8px;
  background: var(--fade-in-bg);
  mix-blend-mode: darken;
  flex-shrink: 0;
}

.listing-row__main {
  flex: 1 1 260px;
  min-width: 0;
}

.listing-row__name {
  font-size: 17px;
  margin-bottom: 4px;
}

.listing-row__meta,
.listing-row__desc {
  margin: 0 0 6px;
  font-size: 14px;
  color: var(--color-text-700);
}

.listing-row__desc {
  max-width: 60ch;
}

.listing-row__note {
  margin: 8px 0 0;
  font-size: 14px;
  color: #8c2f2f;
}

.listing-row__preview {
  display: inline-block;
  margin-top: 8px;
  font-size: 14px;
  font-weight: 700;
  color: var(--color-text-500);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.listing-row__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 8px;
  margin-left: auto;
}

.listing-row__actions .button {
  height: 40px;
  padding-inline: 14px;
  font-size: 15px;
}

.listing-row__actions--review {
  flex-direction: column;
  align-items: stretch;
  min-width: 220px;
}

.reject-form {
  display: flex;
  gap: 8px;
}

.reject-note {
  flex: 1;
  min-width: 0;
  height: 40px;
  padding: 0 10px;
  border: 1px solid var(--color-background-700);
  border-radius: 8px;
  background: transparent;
  color: var(--color-text-500);
  outline: none;
}

.reject-note:focus {
  border-color: var(--color-primary-500);
}

.button--danger {
  border-color: #d9a7a7;
  color: #8c2f2f;
}

.button--danger:hover:not(.button--disabled) {
  background: #fdf1f1;
}

/* ------------------------------------------------------------- badges ----- */

.status {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.status--approved {
  background: #e6f4ea;
  color: #1e6b38;
}

.status--pending {
  background: #fdf3e0;
  color: #8a5a12;
}

.status--rejected {
  background: #fdf1f1;
  color: #8c2f2f;
}

.role-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  text-transform: capitalize;
  background: var(--color-secondary-600);
  color: var(--color-text-500);
}

.role-badge--admin {
  background: var(--color-primary-500);
  color: #fff;
}

.role-badge--vendor {
  background: var(--color-text-500);
  color: #fff;
}

.pill {
  display: inline-block;
  min-width: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--color-primary-500);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
}

/* ---------------------------------------------------------------- tabs ---- */

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding-inline: 16px;
  border-radius: 8px;
  background: var(--color-background-50);
  color: var(--color-text-700);
  font-weight: 700;
}

.tab:hover {
  background: var(--color-secondary-600);
}

.tab.is-active {
  background: var(--color-primary-500);
  color: #fff;
}

.tab.is-active .pill {
  background: #fff;
  color: var(--color-primary-500);
}

/* -------------------------------------------------------- empty + banner -- */

.empty-state {
  background: var(--color-background-50);
  border-radius: 12px;
  padding: 48px 24px;
  text-align: center;
  display: grid;
  gap: 8px;
  justify-items: center;
}

.empty-state h2 {
  font-size: 20px;
}

.empty-state p {
  margin: 0 0 8px;
  color: var(--color-text-700);
}

.preview-banner {
  margin-bottom: 20px;
  padding: 14px 16px;
  border-radius: 8px;
  background: #fdf3e0;
  color: #8a5a12;
  font-size: 15px;
}

/* -------------------------------------------------------- account panel --- */

.account-greeting {
  margin: 0 0 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--color-text-700);
}

.account-greeting strong {
  color: var(--color-text-500);
}

.account-signout {
  margin-top: 20px;
}

.account-signout .button {
  width: 100%;
}

.account-hint {
  margin-top: 16px;
  font-size: 14px;
  color: var(--color-text-700);
}

.account-links a {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* =========================================================================
   Inventory + Metrc intake
   ========================================================================= */

.section-title {
  font-size: 20px;
  margin: 40px 0 12px;
}

.breadcrumb {
  margin: 0 0 8px;
  font-size: 14px;
}

.breadcrumb a,
.linked {
  color: var(--color-text-500);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.form-actions--tight .button {
  flex: 0 0 auto;
}

.field-pair {
  display: grid;
  gap: 18px;
  grid-template-columns: 1fr 1fr;
}

.stat-row--4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (max-width: 640px) {
  .stat-row,
  .stat-row--4,
  .field-pair,
  .choice-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.stat--warn .stat__value {
  color: #8a5a12;
}

.stat--danger .stat__value {
  color: #8c2f2f;
}

/* ---------------------------------------------------------------- tables -- */

.table-scroll {
  overflow-x: auto;
  background: var(--color-background-50);
  border-radius: 12px;
}

.inv-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

.inv-table th,
.inv-table td {
  padding: 12px 16px;
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid var(--color-background-600);
}

.inv-table thead th {
  font-size: 13px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--color-text-700);
  white-space: nowrap;
}

.inv-table tbody tr:last-child th,
.inv-table tbody tr:last-child td {
  border-bottom: 0;
}

.inv-table .num {
  text-align: right;
}

.inv-table .mono,
.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
}

.inv-product {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 260px;
}

.inv-product img {
  width: 40px;
  height: 50px;
  object-fit: cover;
  border-radius: 6px;
  background: var(--fade-in-bg);
  mix-blend-mode: darken;
  flex-shrink: 0;
}

.inv-name {
  display: block;
  font-weight: 700;
  color: var(--color-text-500);
}

.inv-sku {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-700);
}

.table-note {
  margin: 10px 2px 0;
  font-size: 14px;
  color: var(--color-text-700);
}

/* --------------------------------------------------------------- stepper -- */

.stepper {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.stepper__btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--color-background-700);
  color: var(--color-text-500);
  font-weight: 700;
  line-height: 1;
}

.stepper__btn:hover {
  background: var(--color-secondary-600);
}

.stepper__input,
.inline-input {
  width: 72px;
  height: 32px;
  padding: 0 8px;
  text-align: right;
  border: 1px solid var(--color-background-700);
  border-radius: 8px;
  background: transparent;
  color: var(--color-text-500);
  outline: none;
  -moz-appearance: textfield;
}

.stepper__input::-webkit-outer-spin-button,
.stepper__input::-webkit-inner-spin-button,
.inline-input::-webkit-outer-spin-button,
.inline-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.stepper__input:focus,
.inline-input:focus,
.inline-select:focus {
  border-color: var(--color-primary-500);
}

.inline-input.is-saved,
.stepper__input.is-saved {
  border-color: #7fb894;
}

.inline-select {
  height: 40px;
  min-width: 240px;
  max-width: 100%;
  padding: 0 10px;
  border: 1px solid var(--color-background-700);
  border-radius: 8px;
  background: var(--color-background-50);
  color: var(--color-text-500);
  font: inherit;
  outline: none;
}

/* ------------------------------------------------------------ stock chips -- */

.stock-chip {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.stock-chip--ok {
  background: #e6f4ea;
  color: #1e6b38;
}

.stock-chip--low {
  background: #fdf3e0;
  color: #8a5a12;
}

.stock-chip--out {
  background: #fdf1f1;
  color: #8c2f2f;
}

/* Takes over the pull-up under the price, since it now sits above .stock-line. */
.case-line {
  margin: -20px 0 6px;
  font-size: 14px;
  color: var(--color-text-700);
}

.case-line strong {
  color: var(--color-text-500);
}

.stock-line {
  margin: -20px 0 24px;
  font-size: 15px;
  font-weight: 700;
}

/* Only the first of the pair pulls up; otherwise they overlap. */
.case-line + .stock-line {
  margin-top: 0;
}

.stock-line--ok {
  color: #1e6b38;
}
.stock-line--low {
  color: #8a5a12;
}
.stock-line--out {
  color: #8c2f2f;
}

.sold-out {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgb(255 255 255 / 0.92);
  color: #8c2f2f;
  font-size: 12px;
  font-weight: 700;
}

.card-product__quickbuy[disabled],
.add-to-cart[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}

.add-to-cart[disabled]:hover {
  background: var(--color-primary-500);
}

/* -------------------------------------------------------------- notices --- */

.notice {
  padding: 14px 16px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-size: 15px;
  background: var(--color-background-50);
  border: 1px solid var(--color-background-700);
  color: var(--color-text-700);
}

.notice--ok {
  background: #e6f4ea;
  border-color: #c3e2ce;
  color: #1e6b38;
}

.notice--warn {
  background: #fdf3e0;
  border-color: #edd6ab;
  color: #8a5a12;
}

.notice code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  background: rgb(0 0 0 / 0.05);
  padding: 1px 5px;
  border-radius: 4px;
}

/* --------------------------------------------------------- transfer lines - */

.line-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.line {
  display: grid;
  gap: 20px;
  padding: 20px;
  background: var(--color-background-50);
  border-radius: 12px;
}

@media (min-width: 900px) {
  .line {
    grid-template-columns: 1fr 420px;
  }
}

.line--done {
  opacity: 0.75;
}

.line__label {
  margin: 0 0 6px;
  color: var(--color-text-700);
}

/* The case count leads the row: it is the quantity being bought and sold, and
   it replaced the package tag that used to sit here. */
.line__cases {
  display: flex;
  align-items: baseline;
  gap: 5px;
  margin: 0 0 4px;
  font-size: 14px;
  color: var(--color-text-700);
}

.case-count {
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--color-text-500);
}

.case-size {
  color: var(--color-text-700);
}

.warn {
  color: #a2521a;
  font-weight: 700;
}

/* Collapsed rows must never hide which physical packages they stand for, so the
   tags stay one click away rather than being dropped. */
.line__tags {
  margin: 8px 0 0;
  font-size: 13px;
}

.line__tags > summary {
  cursor: pointer;
  color: var(--color-text-700);
  width: fit-content;
}

.line__tags > summary:hover {
  color: var(--color-text-500);
}

/* Where the cases in one row came from, when they span more than one batch. */
.batch-list {
  margin: 6px 0 0;
  padding: 8px 10px;
  list-style: none;
  border-radius: 8px;
  background: var(--color-background-500);
}

.batch-list li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  line-height: 1.9;
  color: var(--color-text-700);
}

.batch-list__count {
  flex-shrink: 0;
  font-weight: 700;
  color: var(--color-text-500);
}

.tag-list {
  margin: 6px 0 0;
  padding: 8px 10px;
  list-style: none;
  border-radius: 8px;
  background: var(--color-background-500);
}

.tag-list li {
  font-size: 12px;
  line-height: 1.7;
  color: var(--color-text-700);
}

.line__name {
  font-size: 17px;
  margin-bottom: 4px;
}

.line__meta {
  margin: 0 0 4px;
  font-size: 14px;
  color: var(--color-text-700);
}

.line__hint {
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--color-text-700);
}

.line__map {
  display: grid;
  gap: 10px;
  align-content: start;
}

.map-form,
.receive-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.map-form .button,
.receive-form .button {
  height: 40px;
  padding-inline: 14px;
  font-size: 15px;
}

.receive-form .inline-input {
  height: 40px;
  width: 90px;
}

.empty-state--tight {
  padding: 24px;
}

/* =========================================================================
   Mobile — matches the live theme's small-screen header, plus responsive
   treatments for the marketplace screens the original doesn't have.
   ========================================================================= */

@media (max-width: 767px) {

  /* ------------------------------------------------------------- header -- */

  .page-header {
    padding: 16px 24px;
  }

  .page-header__inner {
    gap: 8px;
  }

  /* Icon-only, no pill — same as the theme's max-md treatment. */
  .menu-button {
    width: 40px;
    height: 40px;
    padding: 0;
    gap: 0;
    background: transparent;
  }

  .menu-button:hover {
    background: var(--color-secondary-600);
  }

  .menu-button__label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
  }

  .header-logo {
    height: 40px;
  }

  .header-logo img {
    height: 18px;
  }

  .header-right {
    gap: 0;
  }

  .header-right .icon-button,
  .menu-button {
    width: 40px;
    height: 40px;
    padding: 0;
  }

  .header-right .icon-button {
    background: transparent;
  }

  .cart-badge {
    top: 2px;
    right: 2px;
  }

  .main {
    padding-top: 8px;
  }

  /* ------------------------------------------------------------- cards --- */

  /* Leave room for the quick-buy button pinned to the right of the card body. */
  .card-product__name,
  .card-product__seller {
    width: calc(100% - 40px);
  }

  /* Type was sized for a full-width card. In the two-column grid the card is
     ~162px, where 16px runs a product name to three lines and pushes the next
     row of products off the screen. */
  .card-product__name {
    font-size: 13px;
    line-height: 1.3;
  }

  .card-product__seller,
  .card-product__price {
    font-size: 12px;
    line-height: 1.4;
  }

  .card-product__body {
    gap: 2px;
  }

  /* The button is 24px of icon in a 40px gutter; at this card width that gutter
     is a quarter of the row, so tighten it to match the smaller type. */
  .card-product__quickbuy svg {
    width: 20px;
    height: 20px;
  }

  /* ------------------------------------------------------ product page --- */

  /* Full-bleed gallery, like the theme's mobile carousel. */
  .gallery {
    margin-inline: -16px;
    padding-bottom: 20px;
    gap: 8px;
  }

  .gallery__figure {
    border-radius: 0;
    cursor: default;
  }

  .product-title {
    font-size: 22px;
  }

  .stock-line {
    margin-top: -16px;
    margin-bottom: 20px;
  }

  /* Stepper on one line, Add to cart full width beneath it. */
  .add-to-cart {
    flex: 1 0 100%;
  }

  .reviews {
    padding-top: 32px;
    margin-top: 32px;
  }

  /* --------------------------------------------------- similar products -- */

  /* Cards peek past the edge so the rail reads as scrollable without arrows. */
  .similar__nav {
    display: none;
  }

  .similar__rail {
    scroll-padding-inline: 16px;
    gap: 10px;
    -webkit-overflow-scrolling: touch;
  }

  .similar__item {
    width: 68vw;
    max-width: 280px;
  }

  .similar__title {
    font-size: 20px;
  }

  /* ------------------------------------------------------------- forms --- */

  .choice-grid,
  .field-pair,
  .form-actions {
    grid-template-columns: 1fr;
  }

  .form-actions {
    display: grid;
  }

  .form-actions--tight {
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
  }

  .stacked-form {
    padding: 20px 16px;
  }

  .form-page__title,
  .dash__title {
    font-size: 26px;
  }

  .dash__head {
    gap: 12px;
  }

  /* Keep tap targets comfortable. */
  .field input,
  .field textarea,
  .inline-select {
    font-size: 16px; /* stops iOS zooming on focus */
  }

  .inline-select {
    min-width: 0;
    width: 100%;
  }

  /* ------------------------------------------------------------ tables --- */

  /* Restack rows as cards instead of forcing a horizontal scroll. */
  .table-scroll {
    background: transparent;
    overflow-x: visible;
  }

  .inv-table,
  .inv-table tbody,
  .inv-table tr,
  .inv-table td {
    display: block;
    width: auto;
    min-width: 0;
  }

  .inv-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
  }

  .inv-table tr {
    background: var(--color-background-50);
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 10px;
  }

  .inv-table th[scope="row"] {
    display: flex;
    width: auto;
    padding: 0 0 10px;
    border: 0;
    font-size: 16px;
  }

  .inv-table td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 0;
    border: 0;
    text-align: left;
  }

  .inv-table td:empty {
    display: none;
  }

  .inv-table td {
    text-align: right;
  }

  .inv-table td::before {
    content: attr(data-label);
    flex-shrink: 0;
    margin-right: auto;
    text-align: left;
    font-size: 13px;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--color-text-700);
  }

  .cell-stack {
    display: block;
    min-width: 0;
  }

  .inv-table td[data-label=""]::before {
    content: none;
  }

  .inv-table td[data-label=""] {
    padding-top: 12px;
  }

  .inv-table td[data-label=""] .button {
    width: 100%;
  }

  .inv-table .mono {
    word-break: break-all;
    text-align: right;
  }

  .inv-product {
    min-width: 0;
  }

  .stepper__btn {
    width: 36px;
    height: 36px;
  }

  .stepper__input,
  .inline-input {
    height: 36px;
  }

  /* ------------------------------------------------------ listing rows --- */

  .listing-row__actions,
  .listing-row__actions--review {
    margin-left: 0;
    width: 100%;
    min-width: 0;
  }

  .listing-row__actions .button,
  .listing-row__actions form {
    flex: 1 1 100px;
  }

  .listing-row__actions form .button {
    width: 100%;
  }

  .listing-row__img {
    width: 64px;
    height: 80px;
  }

  /* ------------------------------------------------- metrc transfer UI --- */

  .map-form,
  .receive-form {
    flex-direction: column;
    align-items: stretch;
    /* Inherited flex-wrap:wrap would make a column container wrap into a second
       *column*, putting the button beside the field and reserving dead height. */
    flex-wrap: nowrap;
  }

  .receive-form .inline-input {
    width: 100%;
    height: 44px;
    text-align: center;
  }

  /* In a column flex container these are main-axis sized, so they shrink unless
     told not to — which drops them under the 44px touch minimum. */
  .map-form .button,
  .receive-form .button {
    height: 44px;
    min-height: 44px;
    flex-shrink: 0;
  }

  .line {
    padding: 16px;
  }

  .line__label {
    word-break: break-all;
  }

  .tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 4px;
    margin-inline: -16px;
    padding-inline: 16px;
  }

  .tab {
    flex-shrink: 0;
    height: 44px;
  }

  /* Drawer controls were inheriting text-sized hit areas. */
  .panel-close {
    min-height: 44px;
    padding-inline: 4px;
  }

  .cart-line__remove {
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
  }

  /* ------------------------------------------------------------ panels --- */

  .panel--menu,
  .panel--account {
    --panel-width: min(86vw, 340px);
  }

  .panel--search,
  .panel--cart {
    --panel-width: 100vw;
  }

  .notice,
  .preview-banner,
  .flash {
    font-size: 14px;
  }
}

/* Very narrow phones */
@media (max-width: 380px) {
  .stat-row,
  .stat-row--4 {
    grid-template-columns: 1fr 1fr;
  }

  .similar__item {
    width: 74vw;
  }
}

/* ------------------------------------------------- poller + credit routing -- */

.poll-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  margin-bottom: 20px;
  border-radius: 12px;
  background: var(--color-background-50);
  font-size: 14px;
  color: var(--color-text-700);
}

.poll-bar--off {
  background: #fdf3e0;
  color: #8a5a12;
}

.poll-bar__text {
  flex: 1;
  min-width: 0;
}

.poll-bar__text strong {
  color: var(--color-text-500);
}

.poll-bar__err {
  display: block;
  margin-top: 4px;
  color: #8c2f2f;
  word-break: break-word;
}

.poll-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--color-secondary-700);
  flex-shrink: 0;
}

.poll-dot--on {
  background: #2f9e5a;
  box-shadow: 0 0 0 0 rgb(47 158 90 / 0.5);
  animation: poll-pulse 2.4s ease-out infinite;
}

@keyframes poll-pulse {
  70% { box-shadow: 0 0 0 7px rgb(47 158 90 / 0); }
  100% { box-shadow: 0 0 0 0 rgb(47 158 90 / 0); }
}

@media (prefers-reduced-motion: reduce) {
  .poll-dot--on { animation: none; }
}

.credit {
  margin: 10px 0 0;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 14px;
}

.credit--note {
  background: #eef2fd;
  color: #2f4a8c;
}

.credit--license {
  background: #e6f4ea;
  color: #1e6b38;
}

.credit--none {
  background: #fdf3e0;
  color: #8a5a12;
}

.line__note {
  margin: 8px 0 0;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--color-background-500);
  font-size: 13px;
  color: var(--color-text-700);
  word-break: break-word;
}

.notice__runs {
  display: block;
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.run-chip {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--color-secondary-500);
  color: var(--color-text-700);
  font-size: 12px;
  white-space: nowrap;
}

.run-chip--bad {
  background: #fdf1f1;
  color: #8c2f2f;
}

.table-note--lead {
  margin: -4px 2px 12px;
}

/* ------------------------------------------------- intake search + combobox -- */

.queue-tools {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.queue-search {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--color-background-700);
  border-radius: 10px;
  background: var(--color-background-50);
  color: var(--color-text-700);
}

.queue-search:focus-within {
  border-color: var(--color-primary-500);
}

.queue-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--color-text-500);
}

.queue-count {
  flex-shrink: 0;
  font-size: 14px;
  color: var(--color-text-700);
  white-space: nowrap;
}

.queue-empty {
  padding: 32px;
  text-align: center;
  color: var(--color-text-700);
  background: var(--color-background-50);
  border-radius: 12px;
}

/* suggestion chips */

.suggests {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

/* Its own row: as a plain flex item the label sat inline with the first chip
   and only the overflow wrapped beneath it. 100% basis forces the break. */
.suggests__label {
  flex: 0 0 100%;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-text-700);
}

.suggest-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  max-width: 100%;
  padding: 5px 10px;
  border: 1px solid var(--color-background-700);
  border-radius: 999px;
  background: var(--color-background-50);
  font-size: 13px;
  color: var(--color-text-500);
  text-align: left;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.suggest-chip:hover {
  border-color: var(--color-primary-500);
  background: var(--color-secondary-500);
}

.suggest-chip--top {
  border-color: #7fb894;
  background: #e6f4ea;
  color: #1e6b38;
  font-weight: 700;
}

/* A different listing was chosen, so the recommendation is no longer the
   answer — drop it to neutral rather than showing two "correct" states. */
.suggest-chip--muted {
  border-color: var(--color-background-700);
  background: var(--color-background-50);
  color: var(--color-text-700);
  font-weight: 500;
}

.suggest-chip--muted:hover {
  border-color: var(--color-primary-500);
  background: var(--color-secondary-500);
}

.suggest-chip.is-chosen {
  border-color: #2f9e5a;
  background: #e6f4ea;
  color: #1e6b38;
  font-weight: 700;
}

.suggest-chip.is-chosen::before {
  content: "✓";
  font-size: 11px;
}

.suggest-chip__sku {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  opacity: 0.7;
}

/* combobox */

.combo {
  position: relative;
  flex: 1 1 260px;
  min-width: 0;
}

.combo__input {
  width: 100%;
  height: 40px;
  padding: 0 34px 0 12px;
  font-size: 14px;
  border: 1px solid var(--color-background-700);
  border-radius: 8px;
  background: var(--color-background-50);
  color: var(--color-text-500);
  outline: none;
}

.combo__input:focus {
  border-color: var(--color-primary-500);
}

/* Smaller than the value text so the hint fits a narrow field. */
.combo__input::placeholder {
  font-size: 13px;
  color: var(--color-text-700);
  opacity: 0.85;
}

.combo--set .combo__input {
  border-color: #7fb894;
  font-weight: 700;
}

.combo__clear {
  position: absolute;
  top: 0;
  right: 0;
  width: 34px;
  height: 40px;
  font-size: 20px;
  line-height: 1;
  color: var(--color-text-700);
}

.combo__clear:hover {
  color: var(--color-text-50);
}

.combo__list {
  position: absolute;
  z-index: 40;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 300px;
  overflow-y: auto;
  margin: 0;
  padding: 4px;
  list-style: none;
  background: var(--color-background-50);
  border: 1px solid var(--color-background-700);
  border-radius: 10px;
  box-shadow: 0 12px 28px rgb(0 0 0 / 0.12);
}

.combo__opt {
  display: grid;
  gap: 1px;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
}

.combo__opt:hover,
.combo__opt.is-active {
  background: var(--color-secondary-500);
}

.combo__name {
  font-size: 14px;
  font-weight: 700;
  color: var(--color-text-500);
}

.combo__meta {
  font-size: 12px;
  color: var(--color-text-700);
}

.combo__list mark {
  background: #fdf3c0;
  color: inherit;
  border-radius: 2px;
}

.combo__empty {
  padding: 10px;
  font-size: 13px;
  color: var(--color-text-700);
}

@media (max-width: 767px) {
  .queue-tools {
    flex-wrap: wrap;
  }
  .queue-search {
    flex: 1 1 100%;
    height: 48px;
  }
  .queue-search input {
    font-size: 16px;
  }
  .combo__input {
    height: 44px;
    font-size: 16px;
  }
  .combo__clear {
    height: 44px;
  }
  .suggest-chip {
    max-width: 100%;
  }
}

/* ------------------------------------------------- combobox selected card -- */

.combo__field {
  position: relative;
}

/* The card is a sibling of the form inside .line__map, so it spans the whole
   column rather than sharing a flex row with the Save button. */
.combo__detail--above {
  margin-bottom: 2px;
}

.combo__detail--below {
  margin-top: 2px;
}

.combo__detail {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid #7fb894;
  border-left-width: 3px;
  border-radius: 10px;
  background: #f2f9f4;
}

.combo__check {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: #2f9e5a;
  color: #fff;
}

.combo__thumb {
  flex-shrink: 0;
  width: 34px;
  height: 42px;
  object-fit: cover;
  border-radius: 6px;
  background: var(--fade-in-bg);
  mix-blend-mode: darken;
}

.combo__detail-text {
  display: grid;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.combo__detail-eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #1e6b38;
}

/* Wraps rather than truncating — seeing the whole title is the point. */
.combo__detail-name {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--color-text-500);
  overflow-wrap: anywhere;
}

.combo__detail-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--color-text-700);
}

.combo__change {
  flex-shrink: 0;
  align-self: flex-start;
  padding: 4px 10px;
  border: 1px solid #7fb894;
  border-radius: 999px;
  background: transparent;
  font-size: 12px;
  font-weight: 700;
  color: #1e6b38;
}

.combo__change:hover {
  background: #e6f4ea;
}

/* With the card carrying the detail, a committed field just invites a new search. */
.combo--set .combo__input {
  border-color: var(--color-background-700);
  font-weight: 500;
}

/* ---------------------------------------------------------- variant demo -- */

.variant {
  background: var(--color-background-50);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
}

.variant__head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.variant__tag {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--color-primary-500);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.variant__note {
  margin: 0 0 16px;
  font-size: 14px;
  color: var(--color-text-700);
}

.variant .line-list {
  margin: 0;
}

@media (max-width: 767px) {
  .combo__detail {
    flex-wrap: wrap;
  }
  .combo__change {
    margin-left: auto;
  }
}

/* --------------------------------------------- intake queue on small screens -- */

@media (max-width: 767px) {
  /* Chips hold long product titles; let them wrap instead of overflowing. */
  .suggest-chip {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    width: 100%;
    border-radius: 10px;
    padding: 8px 10px;
    font-size: 14px;
  }

  .suggests {
    display: grid;
    gap: 6px;
  }

  .suggests__label {
    margin-bottom: 2px;
  }

  /* Full-width controls: the map form already stacks, keep the parts matched. */
  .combo {
    flex: 1 1 100%;
  }

  .combo__input {
    height: 44px;
    font-size: 16px; /* keeps iOS from zooming on focus */
  }

  .combo__input::placeholder {
    font-size: 14px;
  }

  .combo__clear {
    height: 44px;
  }

  .combo__list {
    max-height: 50vh;
  }

  .combo__opt {
    padding: 10px;
  }

  .combo__detail {
    align-items: flex-start;
    padding: 12px;
  }

  .combo__detail-name {
    font-size: 15px;
  }

  .combo__change {
    order: 3;
    width: 100%;
    min-height: 44px;
    margin-top: 8px;
    padding: 8px;
    text-align: center;
  }

  /* Stretch the field to its label so a tap anywhere in the box lands on it. */
  .queue-search input {
    align-self: stretch;
  }

  .line__map {
    gap: 8px;
  }

  .line__metrc {
    padding-bottom: 4px;
    border-bottom: 1px solid var(--color-background-600);
  }

  /* Manifest/package identifiers are long strings of digits. */
  .line__meta .mono,
  .credit .mono {
    overflow-wrap: anywhere;
  }

  .queue-tools {
    position: sticky;
    top: 76px;
    z-index: 20;
    padding: 8px 0;
    margin-inline: -16px;
    padding-inline: 16px;
    background: var(--color-background-500);
  }

  .queue-count {
    flex: 1 1 100%;
    text-align: right;
  }

  .variant {
    padding: 16px 12px;
  }
}

/* ------------------------------------------------------- read-only stock -- */

.stock-count {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 15px;
  color: var(--color-text-500);
}

.readonly-value {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 0;
  padding: 10px 12px;
  border: 1px dashed var(--color-background-700);
  border-radius: 8px;
  background: var(--color-background-500);
}

.readonly-value strong {
  font-size: 18px;
  color: var(--color-text-500);
}

.readonly-value span {
  font-size: 13px;
  color: var(--color-text-700);
}

/* ------------------------------------------------------------ intake nav -- */

.icon-button--intake {
  position: relative;
}

/* Same badge treatment as the cart, so the two read as one row of tools. */
.intake-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--color-primary-500);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
}

/* ---------------------------------------------------- product copy blocks -- */

.product-short {
  margin: 0 0 12px;
  font-size: 15px;
  line-height: 1.55;
  color: var(--color-text-600);
}

.product-meta__muted {
  color: var(--color-text-700);
}

/* --------------------------------------------------------- coa directory -- */

.coa-flag {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  vertical-align: middle;
}

.coa-flag--pass {
  background: #e7f4ea;
  color: #17692e;
}

.coa-flag--fail {
  background: #fdeceb;
  color: #a11c15;
}

.field__optional {
  margin-left: 6px;
  font-size: 12px;
  font-weight: 400;
  color: var(--color-text-700);
  text-transform: none;
}

.coa-index {
  max-width: 860px;
  margin-inline: auto;
  padding-block: 24px 48px;
}

.coa-index__back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 16px;
  font-size: 14px;
  font-weight: 700;
  color: var(--color-text-600);
}

.coa-index__back:hover {
  color: var(--color-text-400);
}

.coa-index__title {
  margin: 0;
  font-size: 30px;
  line-height: 1.2;
  color: var(--color-text-400);
}

.coa-index__subtitle {
  margin: 6px 0 0;
  color: var(--color-text-600);
}

.coa-index__note {
  margin: 12px 0 0;
  max-width: 62ch;
  font-size: 13px;
  line-height: 1.55;
  color: var(--color-text-700);
}

.coa-index__list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
}

.coa-entry {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 18px;
  border: 1px solid var(--color-background-700);
  border-radius: 12px;
  background: var(--color-background-50);
}

.coa-entry__main {
  flex: 1 1 auto;
  min-width: 0;
}

/* The date the certificate joined this listing — the label the list is read by. */
.coa-entry__added {
  margin: 0 0 4px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-text-700);
}

.coa-entry__title {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0;
  font-size: 18px;
  color: var(--color-text-400);
}

.coa-entry__facts {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 24px;
  margin: 12px 0 0;
}

.coa-entry__facts div {
  display: flex;
  gap: 6px;
  font-size: 13px;
}

.coa-entry__facts dt {
  color: var(--color-text-700);
}

.coa-entry__facts dd {
  margin: 0;
  color: var(--color-text-500);
  overflow-wrap: anywhere;
}

.coa-entry__analytes {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
}

.coa-analyte {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--color-background-500);
  font-size: 12px;
  color: var(--color-text-700);
}

.coa-analyte strong {
  color: var(--color-text-500);
  font-variant-numeric: tabular-nums;
}

.coa-analyte--fail {
  background: #fdeceb;
  color: #a11c15;
}

.coa-analyte--fail strong {
  color: #a11c15;
}

.coa-entry__actions {
  flex: 0 0 auto;
}

@media (max-width: 767px) {
  .coa-index__title {
    font-size: 24px;
  }

  .coa-entry {
    flex-wrap: wrap;
    padding: 14px;
  }

  .coa-entry__facts {
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 4px;
  }

  .coa-entry__actions {
    flex: 1 1 100%;
  }

  .coa-entry__actions .button {
    width: 100%;
    min-height: 44px;
  }
}

/* ------------------------------------------------------- browse + paging -- */

.browse-head {
  padding: 24px 0 8px;
}

.browse-head__title {
  margin: 0;
  font-size: 28px;
  line-height: 1.2;
  color: var(--color-text-400);
}

.browse-head__count {
  margin: 4px 0 0;
  font-size: 14px;
  color: var(--color-text-700);
}

.facets {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 0 20px;
}

.facets__group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.facets__label {
  flex: 0 0 auto;
  min-width: 56px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-text-700);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--color-background-700);
  border-radius: 999px;
  background: var(--color-background-50);
  font-size: 13px;
  color: var(--color-text-600);
}

.chip:hover {
  background: var(--color-secondary-600);
}

.chip.is-active {
  background: var(--color-primary-500);
  border-color: var(--color-primary-500);
  color: #fff;
}

.chip__count {
  font-size: 11px;
  opacity: 0.7;
  font-variant-numeric: tabular-nums;
}

.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 32px 0 48px;
}

.pager__status {
  font-size: 14px;
  color: var(--color-text-600);
  text-align: center;
}

.pager__total {
  color: var(--color-text-700);
}

@media (max-width: 767px) {
  .browse-head__title {
    font-size: 22px;
  }

  .facets__group {
    /* Chips scroll sideways rather than stacking into a wall of rows. */
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
  }

  .chip {
    flex: 0 0 auto;
    min-height: 36px;
  }

  .pager {
    gap: 10px;
  }

  .pager .button {
    padding-inline: 14px;
  }

  .pager__total {
    display: none;
  }
}

/* ------------------------------------------------------- fixed unit count -- */

/* The booked quantity is the manifest's, so it reads as a fact rather than a
   field. Same dashed treatment as the read-only stock box on the product form. */
.units-fixed {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 0;
  padding: 8px 12px;
  border: 1px dashed var(--color-background-700);
  border-radius: 8px;
  background: var(--color-background-500);
  white-space: nowrap;
}

.units-fixed strong {
  font-size: 18px;
  font-variant-numeric: tabular-nums;
  color: var(--color-text-500);
}

.units-fixed span {
  font-size: 12px;
  color: var(--color-text-700);
}

@media (max-width: 767px) {
  .units-fixed {
    flex: 1 1 100%;
    white-space: normal;
  }
}

/* ------------------------------------------------------------ seller pages */

/* Built around the empty case. A seller who fills in nothing still gets a
   header with weight to it: the badge slot is always occupied — by a lettered
   tile when there is no picture — and the description is dropped entirely
   rather than left as a gap. Nothing here should read as "unfinished". */

.seller-head {
  display: flex;
  align-items: flex-start;
  gap: 28px;
  padding: 32px 0 28px;
  border-bottom: 1px solid var(--color-background-700);
  margin-bottom: 28px;
}

/* With no picture and no description there is far less to balance, so the
   whole block tightens rather than floating in space. */
.seller-head--bare {
  align-items: center;
  padding: 24px 0 20px;
  gap: 20px;
}

.seller-head__badge {
  flex-shrink: 0;
  width: 160px;
  height: 160px;
  border-radius: 16px;
  overflow: hidden;
  /* Not --color-background-500: that is the page background, and the tile
     vanished into it. 600 reads as a placed object against the page. */
  background: var(--color-background-600);
  display: grid;
  place-items: center;
}

.seller-head--bare .seller-head__badge {
  width: 104px;
  height: 104px;
  border-radius: 12px;
}

.seller-head__banner {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* The placeholder. Deliberately typographic rather than an icon — initials on a
   tinted tile look like a chosen mark, a grey image glyph looks like a 404. */
.seller-head__monogram {
  font-family: var(--font-heading-family, inherit);
  font-size: 54px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--color-text-500);
  opacity: 0.55;
  user-select: none;
}

.seller-head--bare .seller-head__monogram {
  font-size: 36px;
}

.seller-head__text {
  min-width: 0;
  flex: 1;
}

.seller-head__title {
  margin: 0;
  font-size: 32px;
  line-height: 1.15;
  color: var(--color-text-400);
  overflow-wrap: anywhere;
}

.seller-head__meta {
  margin: 8px 0 0;
  font-size: 14px;
  color: var(--color-text-700);
}

.seller-head__store {
  font-weight: 700;
  color: var(--color-text-500);
}

.seller-head__bio {
  margin-top: 14px;
  max-width: 62ch;
}

.seller-head__bio p {
  margin: 0 0 10px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--color-text-500);
}

.seller-head__bio p:last-child {
  margin-bottom: 0;
}

.seller-head__actions {
  margin: 16px 0 0;
}

@media (max-width: 767px) {
  /* With something to read, the picture gets its own row and the text runs the
     full width beneath it. */
  .seller-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    padding: 20px 0 18px;
  }

  .seller-head__badge {
    width: 96px;
    height: 96px;
  }

  .seller-head__monogram {
    font-size: 34px;
  }

  .seller-head__title {
    font-size: 26px;
  }

  /* Nothing to read, so stacking only pushes the products further down the
     phone. Badge and title share a row and the whole header stays shallow. */
  .seller-head--bare {
    flex-direction: row;
    align-items: center;
    gap: 14px;
    padding: 16px 0 14px;
  }

  .seller-head--bare .seller-head__badge {
    width: 64px;
    height: 64px;
    border-radius: 10px;
  }

  .seller-head--bare .seller-head__monogram {
    font-size: 24px;
  }

  .seller-head--bare .seller-head__title {
    font-size: 22px;
  }

  .seller-head--bare .seller-head__meta {
    margin-top: 4px;
  }

  /* The owner's edit button would otherwise force the row taller than the
     badge; below the header it costs nothing. */
  .seller-head--bare .seller-head__actions {
    margin-top: 10px;
  }

  .seller-search {
    margin-bottom: 16px;
  }
}

/* -- the edit form -- */

.banner-field {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.banner-field__preview {
  flex-shrink: 0;
  width: 120px;
  height: 120px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--color-background-600);
  border: 1px solid var(--color-background-700);
  display: grid;
  place-items: center;
}

.banner-field__preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.banner-field__monogram {
  font-size: 40px;
  font-weight: 700;
  color: var(--color-text-500);
  opacity: 0.5;
}

.banner-field__controls {
  min-width: 0;
  flex: 1;
}

.banner-field__controls .field__hint {
  margin-top: 6px;
}

/* Scoped, because `.field label { display: block }` would otherwise stack the
   checkbox above its text — the same specificity trap as the COA picker. */
.field .choice--inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  font-size: 14px;
  cursor: pointer;
}

.field__optional {
  margin-left: 6px;
  font-size: 12px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-700);
  opacity: 0.75;
}

@media (max-width: 600px) {
  .banner-field {
    flex-direction: column;
  }
}

/* -- admin index -- */

.seller-row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.seller-row__badge {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--color-background-600);
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--color-text-700);
}

.seller-row__badge img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.button--small {
  padding: 6px 12px;
  font-size: 13px;
}

.muted {
  color: var(--color-text-700);
  opacity: 0.7;
}

/* -- seller page search -- */

.seller-search {
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
  margin: 0 0 20px;
  padding: 0 12px;
  border: 1px solid var(--color-background-700);
  border-radius: 999px;
  background: var(--color-background-50);
  transition: border-color 0.15s ease;
}

.seller-search:focus-within {
  border-color: var(--color-primary-500);
}

.seller-search__icon {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  color: var(--color-text-700);
}

.seller-search__input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  padding: 12px 0;
  font-family: inherit;
  font-size: 15px;
  color: var(--color-text-500);
}

/* Safari draws its own clear affordance on type=search, next to ours. */
.seller-search__input::-webkit-search-decoration,
.seller-search__input::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
}

.seller-search__clear {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 999px;
  background: var(--color-background-600);
  color: var(--color-text-500);
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
}

.seller-search__clear:hover {
  background: var(--color-secondary-700);
}

.seller-search__go {
  flex-shrink: 0;
  padding: 8px 16px;
  font-size: 14px;
}

/* Dims the outgoing results while a request is in flight, rather than blanking
   them — a flash of empty grid between keystrokes reads as broken. */
.is-searching .product-grid {
  opacity: 0.55;
  transition: opacity 0.12s ease;
}

.seller-results__note {
  margin: 0 0 14px;
  font-size: 14px;
  color: var(--color-text-700);
}

.seller-results__note .linked {
  margin-left: 6px;
}

/* A submit button that has to read as a link inside a sentence. */
.linked--button {
  border: 0;
  padding: 0;
  background: none;
  font: inherit;
  color: inherit;
  cursor: pointer;
  text-decoration: underline;
}

@media (max-width: 600px) {
  /* The Search button is redundant on a phone: the keyboard has a Go key and
     results land as you type, so drop it and give the field the width. */
  .seller-search__go {
    display: none;
  }

  .seller-search__input {
    font-size: 16px; /* keeps iOS from zooming the page on focus */
  }
}

/* The escape hatch out of the ten-row dropdown and onto the results page. */
.search-all {
  margin: 16px 0 0;
}

.search-all .button {
  width: 100%;
  justify-content: center;
}

/* ------------------------------------------------------- sales & payouts */

/* Money direction reuses the status-pill palette: earned green, out red. */
.amount-in {
  color: #1e6b38;
  font-weight: 600;
}

.amount-out {
  color: #8c2f2f;
  font-weight: 600;
}

.ledger-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin: 20px 0 16px;
}

.ledger-filter label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--color-text-600);
}

.ledger-filter .inline-input {
  width: auto;
}

.ledger-filter__note {
  margin-left: auto;
  font-size: 13px;
  color: var(--color-text-600);
}

.receipt-label {
  color: var(--color-text-600);
  font-size: 13px;
}

.receipt-net td {
  border-top: 2px solid var(--color-text-50);
  font-size: 15px;
  font-weight: 700;
}

.payout-form {
  display: flex;
  gap: 8px;
  align-items: center;
}

.payout-form .inline-input {
  width: 90px;
}

.payout-form .inline-input[name="note"] {
  width: 140px;
}

.cart-line__price {
  font-weight: 600;
  color: var(--color-text-100);
}

/* Two fields side by side, stacking on phones. */
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.field-row .field {
  min-width: 0;
}

@media (max-width: 640px) {
  .field-row {
    grid-template-columns: 1fr;
  }
}

.pay-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 12px;
}

.pay-option {
  background: var(--color-background-500);
  border: 1px solid var(--color-secondary-700);
  border-radius: 12px;
  padding: 18px;
}

.pay-option h3 {
  margin: 0 0 8px;
  font-size: 15px;
}

.pay-option__id {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.04em;
  background: var(--color-background-600);
  border-radius: 8px;
  padding: 8px 12px;
  display: inline-block;
}

@media (max-width: 640px) {
  .pay-options {
    grid-template-columns: 1fr;
  }
}

.qb-panel {
  background: var(--color-background-500);
  border: 1px solid var(--color-secondary-700);
  border-radius: 12px;
  padding: 18px;
}

.qb-panel code {
  background: var(--color-background-600);
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 12px;
  word-break: break-all;
}

@media (max-width: 640px) {
  .ledger-filter__note {
    margin-left: 0;
    flex-basis: 100%;
  }

  .payout-form {
    flex-wrap: wrap;
  }
}
