:root {
  color-scheme: light;
  --bg: #f6f8f7;
  --surface: #ffffff;
  --surface-muted: #eef4f1;
  --ink: #17201d;
  --muted: #65736e;
  --line: #dce5e1;
  --accent: #0f766e;
  --accent-strong: #0b5f59;
  --accent-soft: #d8f1ed;
  --warning: #b7791f;
  --warning-soft: #fff1cf;
  --danger: #b42318;
  --danger-soft: #ffe4df;
  --shadow: 0 18px 50px rgba(30, 42, 38, 0.1);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    linear-gradient(140deg, rgba(15, 118, 110, 0.08), transparent 36%),
    linear-gradient(310deg, rgba(183, 121, 31, 0.09), transparent 34%),
    var(--bg);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

.marketplace {
  min-height: 100vh;
  background: #f7f9f8;
}

.marketplace[hidden] {
  display: none;
}

.marketplace-header {
  display: flex;
  min-height: 78px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
  padding: 14px max(24px, calc((100vw - 1440px) / 2));
}

.marketplace-brand,
.public-store-brand {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 14px;
  color: var(--ink);
  text-decoration: none;
}

.marketplace-brand h1 {
  font-size: 1.45rem;
}

.marketplace-brand p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.84rem;
}

.seller-access-link {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  white-space: nowrap;
}

.store-card-tooltip {
  position: absolute;
  z-index: 12;
  visibility: hidden;
  width: max-content;
  max-width: 220px;
  border-radius: 6px;
  background: #12211d;
  color: #ffffff;
  padding: 8px 10px;
  font-size: 0.76rem;
  line-height: 1.35;
  opacity: 0;
  pointer-events: none;
  transition: opacity 140ms ease;
}

.marketplace-store-card:hover .store-card-tooltip,
.marketplace-store-card:focus-visible .store-card-tooltip {
  visibility: visible;
  opacity: 1;
}

.marketplace-main {
  width: min(1440px, calc(100vw - 48px));
  margin: 0 auto;
  padding: 30px 0 48px;
}

.marketplace-search-section h2 {
  max-width: 900px;
  font-size: clamp(1.75rem, 3vw, 2.35rem);
  line-height: 1.12;
}

.marketplace-search-section > p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.95rem;
}

.marketplace-search {
  display: block;
  margin-top: 20px;
}

.marketplace-search input {
  width: 100%;
  min-height: 58px;
  border: 2px solid var(--accent);
  border-radius: 7px;
  background: #ffffff;
  color: var(--ink);
  padding: 0 18px;
  font-size: 1.02rem;
  outline: none;
}

.marketplace-search input:focus {
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.13);
}

.marketplace-filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr)) auto;
  gap: 18px;
  align-items: end;
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 16px;
}

.marketplace-filters label > span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 850;
  text-transform: uppercase;
}

.marketplace-filters select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff;
  color: var(--ink);
  padding: 0 30px 0 10px;
}

.marketplace-clear {
  padding-inline: 22px;
}

.marketplace-results-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 0 14px;
}

.marketplace-results-header h2 {
  color: var(--accent-strong);
  font-size: 1.05rem;
}

.marketplace-results-header p,
.marketplace-results-header > span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.8rem;
}

.marketplace-results-header > span {
  white-space: nowrap;
}

.marketplace-store-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.marketplace-store-card {
  position: relative;
  display: flex;
  min-width: 0;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  padding: 16px;
  box-shadow: 0 7px 22px rgba(30, 42, 38, 0.04);
  text-decoration: none;
  transition:
    border-color 150ms ease,
    box-shadow 150ms ease,
    transform 150ms ease;
}

.marketplace-store-card:hover,
.marketplace-store-card:focus-visible {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: 0 14px 34px rgba(15, 118, 110, 0.12);
  outline: none;
}

.store-card-tooltip {
  top: -10px;
  right: 18px;
  transform: translateY(-100%);
}

.marketplace-store-heading {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) 18px;
  gap: 12px;
  align-items: center;
}

.marketplace-store-mark {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border-radius: 8px;
  background: #12211d;
  color: #d7fff7;
  font-size: 0.9rem;
  font-weight: 900;
}

.marketplace-store-heading h3 {
  font-size: 1rem;
}

.marketplace-store-heading p {
  display: -webkit-box;
  margin-top: 4px;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.store-card-arrow {
  width: 9px;
  height: 9px;
  transform: rotate(-45deg);
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
}

.marketplace-store-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.marketplace-store-metrics > div {
  min-width: 0;
  padding: 10px 6px;
  text-align: center;
}

.marketplace-store-metrics > div + div {
  border-left: 1px solid var(--line);
}

.marketplace-store-metrics span,
.marketplace-store-metrics strong {
  display: block;
}

.marketplace-store-metrics span {
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 750;
  text-transform: uppercase;
}

.marketplace-store-metrics strong {
  margin-top: 5px;
  color: var(--accent-strong);
  font-size: 1.05rem;
}

.marketplace-match-section {
  flex: 1;
  margin-top: 14px;
}

.marketplace-match-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 7px;
}

.marketplace-match-heading span {
  font-size: 0.74rem;
  font-weight: 850;
}

.marketplace-match-heading small {
  color: var(--muted);
  font-size: 0.67rem;
}

.marketplace-card-previews {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.marketplace-card-preview {
  display: grid;
  min-width: 0;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px;
}

.marketplace-card-preview img,
.marketplace-card-placeholder {
  width: 38px;
  height: 52px;
  border-radius: 4px;
  object-fit: cover;
}

.marketplace-card-placeholder {
  display: grid;
  place-items: center;
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 0.58rem;
  font-weight: 850;
}

.marketplace-card-preview strong,
.marketplace-card-preview span,
.marketplace-card-preview small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}

.marketplace-card-preview strong {
  max-height: 2.5em;
  font-size: 0.67rem;
  line-height: 1.25;
}

.marketplace-card-preview span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.6rem;
  white-space: nowrap;
}

.marketplace-card-preview small {
  margin-top: 4px;
  color: var(--accent-strong);
  font-size: 0.62rem;
  font-weight: 800;
  white-space: nowrap;
}

.marketplace-view-store {
  display: grid;
  min-height: 38px;
  place-items: center;
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--accent-strong);
  font-size: 0.8rem;
  font-weight: 850;
}

.marketplace-store-card:hover .marketplace-view-store,
.marketplace-store-card:focus-visible .marketplace-view-store {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.marketplace-no-stock {
  grid-column: 1 / -1;
  padding: 22px 8px;
  color: var(--muted);
  font-size: 0.78rem;
  text-align: center;
}

.marketplace-empty {
  grid-column: 1 / -1;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 58px 20px;
  text-align: center;
}

.marketplace-empty p {
  margin-top: 6px;
  color: var(--muted);
}

.public-store {
  min-height: 100vh;
}

.public-store-header {
  display: flex;
  width: min(1440px, calc(100vw - 32px));
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 0 auto;
  border-bottom: 1px solid var(--line);
  padding: 22px 0;
}

.public-store-brand h1 {
  font-size: 1.55rem;
}

.public-store-brand p {
  margin-top: 4px;
  color: var(--muted);
}

.public-store-owner-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  white-space: nowrap;
}

.public-store-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.public-store-main {
  width: min(1440px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 22px 0 40px;
}

.public-store-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.public-store-summary > div {
  display: grid;
  gap: 3px;
  padding: 18px;
}

.public-store-summary > div + div {
  border-left: 1px solid var(--line);
}

.public-store-summary strong {
  font-size: 1.55rem;
}

.public-store-summary span,
.public-store-results {
  color: var(--muted);
  font-size: 0.82rem;
}

.public-store-details {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(260px, 0.7fr);
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.public-store-details[hidden] {
  display: none;
}

.public-store-instructions,
.public-store-contact {
  min-width: 0;
  padding: 18px;
}

.public-store-contact {
  border-left: 1px solid var(--line);
}

.public-store-details h2 {
  margin-bottom: 9px;
}

.public-store-instructions p {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.public-store-contact > div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.public-store-contact a {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-muted);
  color: var(--accent-strong);
  padding: 7px 10px;
  font-size: 0.82rem;
  font-weight: 750;
  overflow-wrap: anywhere;
  text-decoration: none;
}

.public-store-contact a:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.public-store-tools {
  display: grid;
  grid-template-columns: minmax(220px, 1.5fr) repeat(9, minmax(108px, 0.7fr));
  gap: 10px;
  align-items: end;
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
  padding: 14px;
}

.public-store-tools label > span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 850;
  text-transform: uppercase;
}

.public-store-tools select {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff;
  color: var(--ink);
  padding: 0 28px 0 10px;
}

.public-store-results {
  padding: 16px 2px 0;
}

.store-cart-toggle {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: #ffffff;
  color: var(--accent-strong);
  box-shadow: var(--shadow);
  padding: 0 13px;
  font-size: 0.84rem;
  font-weight: 850;
}

.store-cart-toggle[hidden] {
  display: none;
}

.store-cart-toggle strong,
.store-cart-toggle em {
  font-style: normal;
}

.store-cart-toggle em {
  color: var(--ink);
}

.public-store-shop {
  display: block;
}

.public-store-shop.has-cart {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 340px);
  gap: 16px;
  align-items: start;
}

.public-store-grid {
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  padding-inline: 0;
}

.public-store-grid.is-compact {
  grid-template-columns: repeat(auto-fill, minmax(138px, 1fr));
  gap: 8px;
}

.public-store-grid.is-list {
  grid-template-columns: 1fr;
  gap: 8px;
}

.public-store-grid .storefront-card,
.storefront-preview .storefront-card {
  display: flex;
  min-height: 100%;
  flex-direction: column;
  gap: 10px;
  padding: 10px;
}

.public-store-grid .storefront-card .card-image-button,
.public-store-grid .storefront-card > .collection-image-placeholder,
.storefront-preview .storefront-card .card-image-button,
.storefront-preview .storefront-card > .collection-image-placeholder {
  width: 100%;
  aspect-ratio: 0.716;
}

.public-store-grid .storefront-card .card-image-button img,
.storefront-preview .storefront-card .card-image-button img {
  object-fit: contain;
}

.public-store-grid .storefront-card .collection-card-body,
.storefront-preview .storefront-card .collection-card-body {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
}

.public-store-grid .storefront-card h3,
.storefront-preview .storefront-card h3 {
  display: -webkit-box;
  min-height: 2.28em;
  overflow: hidden;
  white-space: normal;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.public-store-grid .storefront-card .collection-meta,
.storefront-preview .storefront-card .collection-meta {
  min-height: 48px;
  align-content: flex-start;
}

.public-store-grid .storefront-card .collection-quantity,
.storefront-preview .storefront-card .collection-quantity {
  margin-top: auto;
}

.public-store-grid.is-compact .storefront-card {
  gap: 7px;
  padding: 8px;
}

.public-store-grid.is-compact .storefront-card h3 {
  min-height: 2.2em;
  font-size: 0.86rem;
}

.public-store-grid.is-compact .storefront-card .collection-code,
.public-store-grid.is-compact .storefront-card .market-price,
.public-store-grid.is-compact .storefront-card .collection-quantity {
  font-size: 0.76rem;
}

.public-store-grid.is-compact .storefront-card .collection-meta {
  display: none;
}

.public-store-grid.is-compact .storefront-cart-button {
  min-height: 32px;
  margin-top: 7px;
  padding-inline: 8px;
  font-size: 0.78rem;
}

.public-store-grid.is-list .storefront-card {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  min-height: 0;
  gap: 10px;
  padding: 8px;
}

.public-store-grid.is-list .storefront-card .card-image-button,
.public-store-grid.is-list .storefront-card > .collection-image-placeholder {
  width: 72px;
  align-self: start;
}

.public-store-grid.is-list .storefront-card .collection-card-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 5px 10px;
  align-items: center;
}

.public-store-grid.is-list .storefront-card h3 {
  min-height: 0;
  font-size: 0.92rem;
  -webkit-line-clamp: 1;
}

.public-store-grid.is-list .storefront-card .collection-code,
.public-store-grid.is-list .storefront-card .market-price,
.public-store-grid.is-list .storefront-card .collection-meta,
.public-store-grid.is-list .storefront-card .collection-quantity {
  grid-column: 1;
}

.public-store-grid.is-list .storefront-card .collection-meta {
  min-height: 0;
}

.public-store-grid.is-list .storefront-card .collection-quantity {
  margin-top: 0;
}

.public-store-grid.is-list .storefront-cart-button {
  grid-column: 2;
  grid-row: 1 / span 5;
  align-self: center;
  width: auto;
  min-width: 96px;
  margin-top: 0;
  padding-inline: 10px;
}

.store-cart {
  display: grid;
  gap: 12px;
  position: sticky;
  top: 16px;
  max-height: calc(100vh - 32px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
  padding: 14px;
}

.store-cart[hidden] {
  display: none;
}

.store-cart > div:first-child,
.store-cart-total,
.store-cart-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.store-cart > div:first-child span,
.store-cart-line small {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 750;
}

.store-cart-line {
  border-top: 1px solid var(--line);
  padding-top: 9px;
}

.store-cart-line > span {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.store-cart-line > span strong,
.store-cart-line > span small {
  overflow-wrap: anywhere;
}

.store-cart-line > div {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.storefront-cart-button {
  width: 100%;
  min-height: 36px;
  margin-top: 10px;
  padding-inline: 10px;
}

.public-store-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 16px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.public-store-pagination[hidden] {
  display: none;
}

.public-store-pagination span {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.public-store-page-numbers {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}

.page-number {
  display: inline-grid;
  min-width: 34px;
  min-height: 34px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff;
  color: var(--ink);
  padding: 0 9px;
  font-size: 0.82rem;
  font-weight: 850;
}

.page-number:hover {
  border-color: var(--accent);
  color: var(--accent-strong);
}

.page-number.is-active {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}

.page-ellipsis {
  display: inline-grid;
  min-width: 24px;
  min-height: 34px;
  place-items: center;
}

.public-store-pagination button:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.checkout-dialog {
  width: min(620px, calc(100vw - 32px));
  max-height: calc(100vh - 44px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.checkout-form {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.checkout-summary {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
  padding: 12px;
}

.checkout-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.86rem;
}

.checkout-line small {
  color: var(--muted);
}

.checkout-total {
  border-top: 1px solid var(--line);
  padding-top: 8px;
  font-weight: 850;
}

.checkout-message {
  width: 100%;
  min-height: 130px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  color: var(--ink);
  padding: 10px;
  font: inherit;
  line-height: 1.4;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  width: min(1500px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 24px 0 32px;
}

.app-shell.is-auth-gated {
  min-height: 100vh;
  padding: 0;
}

.app-shell.is-auth-gated > :not(#authModal) {
  display: none;
}

.app-shell.is-auth-gated .modal-backdrop {
  background:
    linear-gradient(140deg, rgba(15, 118, 110, 0.12), transparent 40%),
    linear-gradient(310deg, rgba(183, 121, 31, 0.1), transparent 38%),
    var(--bg);
}

.app-shell.is-auth-gated .auth-dialog {
  box-shadow: 0 22px 70px rgba(23, 32, 29, 0.16);
}

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

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 8px;
  background: #12211d;
  color: #d7fff7;
  font-weight: 850;
  letter-spacing: 0;
  box-shadow: inset 0 -8px 18px rgba(15, 118, 110, 0.3);
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(1.45rem, 3vw, 2.05rem);
  line-height: 1.05;
  letter-spacing: 0;
}

h2 {
  font-size: 1.02rem;
  letter-spacing: 0;
}

.brand p,
.panel-header p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.9rem;
}

.sync-panel {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  color: var(--muted);
  font-size: 0.88rem;
  text-align: right;
}

.cloud-button {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.75);
  color: var(--ink);
  padding: 0 11px;
  font-size: 0.82rem;
  font-weight: 750;
}

.cloud-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #9aa6a1;
}

.cloud-dot.is-syncing {
  background: var(--warning);
}

.cloud-dot.is-online {
  background: #2f8f46;
}

.cloud-dot.is-error {
  background: var(--danger);
}

.seller-order-alert {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  gap: 8px;
  border: 1px solid #e2c177;
  border-radius: 7px;
  background: var(--warning-soft);
  color: #7a4e12;
  padding: 0 12px;
  font-size: 0.82rem;
  font-weight: 850;
  white-space: nowrap;
}

.seller-order-alert[hidden] {
  display: none;
}

.seller-order-alert:hover {
  border-color: var(--warning);
  background: #ffe8ad;
}

.seller-order-alert-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--warning);
  box-shadow: 0 0 0 4px rgba(183, 121, 31, 0.16);
}

.currency-control select {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.75);
  color: var(--ink);
  padding: 0 28px 0 10px;
  font-weight: 750;
}

.ghost-button,
.primary-button,
.icon-button {
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: 7px;
  padding: 0 14px;
  font-weight: 750;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    transform 160ms ease;
}

.ghost-button {
  background: rgba(255, 255, 255, 0.75);
  border-color: var(--line);
  color: var(--ink);
}

.primary-button {
  background: var(--accent);
  color: #ffffff;
}

.ghost-button:hover,
.primary-button:hover,
.icon-button:hover {
  transform: translateY(-1px);
}

.primary-button:hover {
  background: var(--accent-strong);
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.metrics article {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 10px 32px rgba(30, 42, 38, 0.06);
}

.metrics span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.metrics strong {
  display: block;
  margin-top: 8px;
  font-size: clamp(1.3rem, 3vw, 2rem);
  line-height: 1;
}

.dashboard-view {
  display: grid;
  gap: 14px;
}

.dashboard-metrics {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
}

.dashboard-metrics article {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  padding: 15px;
  box-shadow: 0 8px 24px rgba(30, 42, 38, 0.05);
}

.dashboard-metrics span,
.dashboard-metrics strong,
.dashboard-metrics small {
  display: block;
}

.dashboard-metrics span {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 850;
  text-transform: uppercase;
}

.dashboard-metrics strong {
  margin-top: 8px;
  overflow: hidden;
  font-size: 1.45rem;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-metrics small {
  margin-top: 7px;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.72rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.positive-value {
  color: #236b2f;
}

.negative-value {
  color: var(--danger);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 14px;
}

.dashboard-panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 12px 34px rgba(30, 42, 38, 0.07);
}

.dashboard-span-5 {
  grid-column: span 5;
}

.dashboard-span-7 {
  grid-column: span 7;
}

.dashboard-span-12 {
  grid-column: span 12;
}

.dashboard-panel-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 14px 16px;
}

.dashboard-panel-header span {
  color: var(--muted);
  font-size: 0.74rem;
}

.stock-set-list,
.status-summary {
  padding: 8px 16px 12px;
}

.stock-set-row {
  display: grid;
  grid-template-columns: minmax(150px, 0.85fr) minmax(120px, 1.4fr) 78px;
  gap: 12px;
  align-items: center;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.stock-set-row:last-child {
  border-bottom: 0;
}

.stock-set-label strong,
.stock-set-label span {
  display: block;
}

.stock-set-label strong {
  overflow: hidden;
  font-size: 0.8rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stock-set-label span,
.stock-set-owned {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.68rem;
}

.stock-set-owned {
  margin: 0;
  text-align: right;
}

.dashboard-bar {
  height: 8px;
  overflow: hidden;
  border-radius: 3px;
  background: #e8eeeb;
}

.dashboard-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.status-summary-row {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.status-summary-row:last-child {
  border-bottom: 0;
}

.status-summary-row > div:first-child {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 7px;
}

.status-summary-row strong {
  font-size: 0.82rem;
}

.status-summary-row span {
  color: var(--muted);
  font-size: 0.72rem;
}

.status-bar-ordered span {
  background: #64748b;
}

.status-bar-prepared span {
  background: var(--warning);
}

.status-bar-shipped span {
  background: var(--accent);
}

.status-bar-delivered span {
  background: #39864a;
}

.dashboard-table-wrap {
  overflow-x: auto;
}

.dashboard-table {
  font-size: 0.78rem;
}

.dashboard-table th,
.dashboard-table td {
  padding: 9px 12px;
}

.dashboard-table th {
  position: static;
}

.recent-order-cards {
  max-width: 360px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-label,
.payment-label {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 0.68rem;
  font-weight: 850;
}

.dashboard-empty {
  padding: 28px 8px;
  color: var(--muted);
  font-size: 0.8rem;
  text-align: center;
}

.view-tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--line);
  scrollbar-width: none;
}

.view-tabs::-webkit-scrollbar {
  display: none;
}

.view-tab {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
  min-height: 42px;
  align-items: center;
  gap: 7px;
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: var(--muted);
  padding: 0 18px;
  font-size: 0.9rem;
  font-weight: 800;
}

.view-tab:hover {
  color: var(--ink);
}

.view-tab.is-active {
  border-bottom-color: var(--accent);
  color: var(--accent-strong);
}

.view-tab-badge {
  display: inline-grid;
  min-width: 20px;
  height: 20px;
  place-items: center;
  border-radius: 999px;
  background: var(--warning);
  color: #ffffff;
  padding: 0 6px;
  font-size: 0.68rem;
  font-weight: 900;
  line-height: 1;
}

.view-tab-badge[hidden] {
  display: none;
}

.app-view[hidden] {
  display: none;
}

.panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  width: min(560px, 56%);
}

.search-box {
  width: min(340px, 100%);
}

.field input,
.field select,
.field textarea,
.search-box input {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff;
  color: var(--ink);
  padding: 8px 10px;
  outline: none;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.search-box input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.14);
}

.field input[readonly] {
  background: #f8fafc;
  color: var(--muted);
  font-weight: 800;
}

.entry-form {
  display: grid;
  grid-template-columns: minmax(260px, 1.5fr) 82px repeat(4, minmax(108px, 0.7fr)) minmax(180px, 1fr) auto;
  gap: 10px;
  align-items: end;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-muted);
}

.sale-form {
  border-bottom: 1px solid var(--line);
  background: var(--surface-muted);
}

.order-edit-notice {
  border-bottom: 1px solid #e7cf8d;
  background: #fff6d8;
  color: #72510e;
  padding: 9px 18px;
  font-size: 0.78rem;
  font-weight: 850;
}

.buyer-form {
  display: grid;
  grid-template-columns:
    minmax(170px, 1fr) minmax(190px, 1fr) minmax(150px, 0.8fr)
    minmax(220px, 1.4fr) auto auto;
  gap: 10px;
  align-items: end;
  border-bottom: 1px solid var(--line);
  background: var(--surface-muted);
  padding: 14px 18px;
}

.storefront-form {
  display: grid;
  grid-template-columns: minmax(190px, 1fr) minmax(220px, 1fr) minmax(260px, 1.4fr) auto;
  gap: 10px;
  align-items: end;
  border-bottom: 1px solid var(--line);
  background: var(--surface-muted);
  padding: 14px 18px;
}

.storefront-public-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  gap: 12px;
  align-items: end;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
  padding: 16px 18px 18px;
}

.storefront-public-fields-header,
.storefront-instructions-field {
  grid-column: 1 / -1;
}

.storefront-public-fields-header p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.82rem;
}

.storefront-instructions-field textarea {
  min-height: 96px;
  resize: vertical;
  line-height: 1.45;
}

.storefront-save-button {
  white-space: nowrap;
}

.slug-input {
  display: flex;
  min-width: 0;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff;
}

.slug-input:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.14);
}

.slug-input span {
  padding-left: 10px;
  color: var(--muted);
  font-size: 0.8rem;
}

.slug-input input {
  min-width: 0;
  border: 0;
  box-shadow: none;
  padding-left: 2px;
}

.slug-input input:focus {
  box-shadow: none;
}

.storefront-visibility {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  gap: 8px;
  padding: 0 8px;
  font-size: 0.85rem;
  font-weight: 800;
}

.storefront-header-actions {
  display: flex;
  gap: 8px;
}

.storefront-status {
  border-bottom: 1px solid var(--line);
  padding: 12px 18px;
  color: var(--muted);
  font-size: 0.82rem;
  overflow-wrap: anywhere;
}

.storefront-preview {
  padding-top: 18px;
}

.storefront-preview .dashboard-panel-header {
  padding-inline: 18px;
}

.storefront-card .collection-quantity {
  justify-content: flex-start;
}

.buyer-form button {
  white-space: nowrap;
}

.order-header-fields,
.order-line-builder {
  display: grid;
  gap: 10px;
  align-items: end;
  padding: 14px 18px;
}

.order-header-fields {
  grid-template-columns: minmax(220px, 1fr) 150px 130px 100px;
  border-bottom: 1px solid var(--line);
}

.order-line-builder {
  grid-template-columns: minmax(280px, 1fr) 82px 130px auto;
}

.add-line-button {
  background: #ffffff;
}

.order-draft {
  border-top: 1px solid var(--line);
  background: #ffffff;
}

.order-draft-empty {
  padding: 17px 18px;
  color: var(--muted);
  font-size: 0.84rem;
  text-align: center;
}

.order-line {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 150px 130px auto;
  gap: 14px;
  align-items: center;
  padding: 9px 18px;
  border-bottom: 1px solid var(--line);
  font-size: 0.84rem;
}

.order-line-card {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-width: 0;
}

.order-line-card img {
  width: 38px;
  height: 52px;
  border-radius: 4px;
  object-fit: cover;
}

.order-line-card strong,
.order-line-card small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-line-card small,
.order-card-list small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.72rem;
}

.order-line-price {
  display: grid;
  grid-template-columns: auto minmax(78px, 1fr);
  align-items: center;
  gap: 7px;
}

.order-line-price input {
  width: 100%;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff;
  color: var(--ink);
  padding: 6px 8px;
  text-align: right;
}

.order-line-price input:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.14);
}

.inline-price-input {
  width: 96px;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff;
  color: var(--ink);
  padding: 6px 8px;
  text-align: right;
}

.inline-price-input:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.14);
}

.api-price-value {
  display: inline-block;
  min-width: 74px;
  color: var(--ink);
  font-weight: 700;
}

.api-price-cell {
  display: grid;
  justify-items: end;
  gap: 5px;
}

.price-chart-button {
  min-height: 26px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  color: var(--accent-strong);
  cursor: pointer;
  padding: 3px 9px;
  font-size: 0.68rem;
  font-weight: 850;
}

.price-chart-button:hover:not(:disabled),
.price-chart-button:focus-visible:not(:disabled) {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.price-chart-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.inventory-price-cell {
  display: grid;
  justify-items: end;
  gap: 5px;
}

.price-comparison {
  display: inline-flex;
  max-width: 132px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 3px 7px;
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1.1;
  text-align: center;
  white-space: normal;
}

.price-comparison.is-lower {
  background: #fee2e2;
  color: #991b1b;
}

.price-comparison.is-higher {
  background: #dcfce7;
  color: #166534;
}

.price-comparison.is-even {
  background: #e0f2fe;
  color: #075985;
}

.price-comparison.is-muted {
  background: #f1f5f9;
  color: var(--muted);
}

.order-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 22px;
  padding: 14px 18px;
}

.order-footer > div {
  text-align: right;
}

.order-footer span,
.order-footer strong {
  display: block;
}

.order-footer span {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 850;
  text-transform: uppercase;
}

.order-footer strong {
  margin-top: 2px;
  font-size: 1.15rem;
}

.seller-marketplace-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  white-space: nowrap;
}

.market-sync-button {
  border-color: #c58a26;
  color: #8a5a0a;
}

.market-sync-status {
  max-width: 190px;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.3;
}

.price-chart-dialog {
  width: min(760px, calc(100vw - 32px));
  max-height: calc(100vh - 44px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.price-chart-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px 12px;
  border-bottom: 1px solid var(--line);
}

.price-chart-eyebrow,
.price-chart-header span {
  margin: 0;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.price-chart-header h2 {
  margin: 3px 0 4px;
  font-size: 1.15rem;
  letter-spacing: 0;
}

.price-chart-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-muted);
}

.price-chart-tabs button {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  color: var(--ink);
  cursor: pointer;
  padding: 5px 12px;
  font-size: 0.76rem;
  font-weight: 850;
}

.price-chart-tabs button.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.price-chart-body {
  padding: 18px 20px 20px;
}

.price-chart-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.price-chart-summary > div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 10px;
}

.price-chart-summary span,
.price-chart-summary strong {
  display: block;
}

.price-chart-summary span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 850;
  text-transform: uppercase;
}

.price-chart-summary strong {
  margin-top: 4px;
  font-size: 0.95rem;
}

.price-line-chart {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(to bottom, transparent 24%, rgba(148, 163, 184, 0.13) 25%, transparent 26%),
    linear-gradient(to bottom, transparent 49%, rgba(148, 163, 184, 0.13) 50%, transparent 51%),
    linear-gradient(to bottom, transparent 74%, rgba(148, 163, 184, 0.13) 75%, transparent 76%),
    #ffffff;
}

.price-line-area {
  fill: rgba(15, 118, 110, 0.1);
}

.price-line-path {
  fill: none;
  stroke: var(--accent);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3;
}

.price-line-chart circle {
  fill: #ffffff;
  stroke: var(--accent-strong);
  stroke-width: 2;
}

.price-line-point {
  cursor: help;
}

.price-line-axis {
  fill: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.price-line-axis.is-end {
  text-anchor: end;
}

.price-range-chart {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 24px 18px 14px;
}

.price-range-track {
  position: relative;
  height: 14px;
  border-radius: 999px;
  background: linear-gradient(90deg, #fca5a5, #fde68a, #86efac);
}

.price-range-marker {
  position: absolute;
  top: 50%;
  width: 16px;
  height: 16px;
  border: 2px solid #ffffff;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.25);
  transform: translate(-50%, -50%);
}

.price-range-marker.is-current {
  background: var(--accent-strong);
}

.price-range-marker.is-average {
  background: #f59e0b;
}

.price-range-marker em {
  position: absolute;
  top: -23px;
  left: 50%;
  color: var(--muted);
  font-size: 0.66rem;
  font-style: normal;
  font-weight: 850;
  transform: translateX(-50%);
}

.price-range-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
}

.price-chart-note,
.price-chart-empty {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.price-chart-empty {
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
  padding: 18px;
  text-align: center;
}

.market-sync-dialog {
  display: grid;
  width: min(540px, calc(100vw - 32px));
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 16px;
  border: 1px solid #e2c177;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
  padding: 22px;
}

.market-sync-warning-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 50%;
  background: var(--warning-soft);
  color: #8a5a0a;
  font-size: 1.35rem;
  font-weight: 900;
}

.market-sync-dialog h2 {
  font-size: 1.2rem;
}

.market-sync-dialog p,
.market-sync-dialog li {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.55;
}

.market-sync-dialog p {
  margin-top: 7px;
}

.market-sync-dialog ul {
  margin: 12px 0 0;
  padding-left: 20px;
}

.market-sync-actions {
  display: flex;
  grid-column: 1 / -1;
  justify-content: flex-end;
  gap: 9px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.market-price {
  display: block;
  margin-top: 8px;
  color: #12633f;
  font-size: 0.8rem;
  font-weight: 800;
}

.storefront-card .market-price {
  margin-top: 6px;
  font-size: 0.88rem;
}

.marketplace-card-preview .market-price {
  margin-top: 2px;
  font-size: 0.7rem;
}

.order-card-list {
  min-width: 230px;
}

.order-card-summary {
  display: grid;
  min-width: 210px;
  gap: 4px;
}

.order-card-summary strong,
.order-card-summary small {
  display: block;
}

.order-card-summary small {
  color: var(--muted);
  font-size: 0.76rem;
}

.order-card-summary .icon-button,
.order-card-collapse {
  justify-self: start;
  margin-top: 3px;
}

.order-card-list > div + div {
  margin-top: 7px;
  border-top: 1px solid var(--line);
  padding-top: 7px;
}

.order-card-list strong,
.order-card-list small {
  display: block;
}

.order-card-piles {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 5px;
}

.order-card-piles span {
  display: inline-flex;
  max-width: 150px;
  min-height: 22px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--accent-strong);
  padding: 2px 7px;
  font-size: 0.68rem;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.field {
  min-width: 0;
}

.field label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 850;
  text-transform: uppercase;
}

.suggest-field {
  position: relative;
}

.suggestions {
  position: absolute;
  z-index: 20;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  display: none;
  max-height: 330px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 20px 44px rgba(23, 32, 29, 0.18);
}

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

.buyer-suggestion {
  display: grid;
  width: 100%;
  gap: 3px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink);
  padding: 10px 12px;
  text-align: left;
}

.buyer-suggestion:last-child {
  border-bottom: 0;
}

.buyer-suggestion:hover,
.buyer-suggestion:focus-visible {
  background: var(--accent-soft);
  outline: 0;
}

.buyer-suggestion small {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.75rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.suggestion {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  width: 100%;
  gap: 10px;
  align-items: center;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
  padding: 8px;
  color: var(--ink);
  text-align: left;
}

.suggestion:last-child {
  border-bottom: 0;
}

.suggestion:hover {
  background: var(--accent-soft);
}

.suggestion img {
  width: 38px;
  height: 52px;
  object-fit: cover;
  border-radius: 4px;
  background: #dfe7e4;
}

.suggestion strong,
.suggestion small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.suggestion small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.76rem;
}

.paid-check {
  display: flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff;
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 750;
}

.paid-check input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.import-summary {
  border-bottom: 1px solid #d8c68f;
  background: #fff8df;
  color: #684b13;
  padding: 11px 18px;
  font-size: 0.86rem;
  line-height: 1.45;
}

.import-summary strong {
  color: #44300d;
}

.filter-bar {
  display: grid;
  grid-template-columns: repeat(7, minmax(110px, 1fr)) auto;
  gap: 10px;
  align-items: end;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-muted);
}

.filter-bar label {
  min-width: 0;
}

.filter-bar label > span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 850;
  text-transform: uppercase;
}

.filter-bar input,
.filter-bar select {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff;
  color: var(--ink);
  padding: 0 28px 0 10px;
}

.filter-bar input {
  padding-right: 10px;
}

.sales-filter-bar {
  grid-template-columns: repeat(4, minmax(140px, 1fr)) auto;
}

.inventory-filter-bar {
  grid-template-columns: repeat(7, minmax(112px, 1fr)) auto;
}

.sales-merge-toolbar {
  display: flex;
  min-height: 54px;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
  padding: 9px 18px;
}

.sales-merge-toolbar span {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 750;
}

.merge-check-label,
.merge-primary-field {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
}

.merge-check-label input {
  width: 16px;
  height: 16px;
  margin: 0;
}

.merge-primary-field select {
  min-width: 180px;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff;
  color: var(--ink);
  padding: 0 28px 0 10px;
  font-weight: 800;
}

.sales-merge-toolbar button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.select-column {
  width: 44px;
  text-align: center;
}

.select-column input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.clear-filters {
  padding-inline: 16px;
}

.collection-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  padding: 18px;
}

.collection-card {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 12px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 10px;
  box-shadow: 0 8px 22px rgba(30, 42, 38, 0.06);
}

.collection-card > img,
.collection-image-placeholder {
  width: 76px;
  aspect-ratio: 0.72;
  object-fit: cover;
  border-radius: 5px;
  background: #dfe7e4;
}

.card-image-button {
  position: relative;
  width: 76px;
  aspect-ratio: 0.72;
  overflow: hidden;
  border: 0;
  border-radius: 5px;
  background: #dfe7e4;
  padding: 0;
  outline: none;
}

.card-image-button img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-image-button:focus-visible {
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.26);
}

.card-image-hint {
  position: absolute;
  z-index: 5;
  right: 4px;
  bottom: 4px;
  left: 4px;
  transform: translateY(4px);
  border-radius: 4px;
  background: rgba(18, 33, 29, 0.88);
  color: #ffffff;
  padding: 4px 2px;
  font-size: 0.58rem;
  font-weight: 800;
  opacity: 0;
  transition:
    opacity 140ms ease,
    transform 140ms ease;
}

.card-image-button:hover .card-image-hint,
.card-image-button:focus-visible .card-image-hint {
  transform: translateY(0);
  opacity: 1;
}

.foil-card-image,
.card-viewer-image-wrap.is-foil {
  --foil-x: 50%;
  --foil-y: 50%;
}

.foil-sheen {
  position: absolute;
  z-index: 2;
  inset: -18%;
  background:
    radial-gradient(circle at var(--foil-x) var(--foil-y), rgba(255, 255, 255, 0.68), transparent 28%),
    linear-gradient(
      118deg,
      transparent 12%,
      rgba(255, 92, 153, 0.34) 28%,
      rgba(255, 225, 95, 0.3) 40%,
      rgba(78, 232, 194, 0.34) 52%,
      rgba(80, 151, 255, 0.36) 65%,
      rgba(197, 112, 255, 0.3) 78%,
      transparent 91%
    );
  background-blend-mode: screen;
  mix-blend-mode: color-dodge;
  opacity: 0.48;
  pointer-events: none;
  animation: foil-shift 5.5s ease-in-out infinite alternate;
}

.foil-card-image {
  border: 1px solid rgba(106, 225, 205, 0.86);
  box-shadow:
    0 0 0 1px rgba(120, 152, 255, 0.34),
    0 5px 14px rgba(72, 112, 167, 0.24);
}

.foil-card-image .foil-sheen {
  inset: -30%;
  background:
    radial-gradient(circle at var(--foil-x) var(--foil-y), rgba(255, 255, 255, 0.9), transparent 24%),
    repeating-linear-gradient(
      112deg,
      rgba(255, 84, 149, 0.48) 0 9%,
      rgba(255, 224, 88, 0.42) 14% 22%,
      rgba(74, 235, 193, 0.48) 28% 36%,
      rgba(76, 145, 255, 0.52) 42% 50%,
      rgba(201, 101, 255, 0.45) 56% 64%,
      rgba(255, 84, 149, 0.48) 70% 78%
    );
  background-size:
    100% 100%,
    170% 170%;
  mix-blend-mode: screen;
  opacity: 0.68;
  animation: foil-thumbnail-shift 3.8s linear infinite;
}

.foil-card-image::after {
  position: absolute;
  z-index: 3;
  inset: -45% -120%;
  transform: translateX(-35%) rotate(18deg);
  background: linear-gradient(
    90deg,
    transparent 38%,
    rgba(255, 255, 255, 0.08) 44%,
    rgba(255, 255, 255, 0.82) 50%,
    rgba(255, 255, 255, 0.08) 56%,
    transparent 62%
  );
  content: "";
  pointer-events: none;
  animation: foil-thumbnail-glint 3.2s ease-in-out infinite;
}

.storefront-card.is-foil {
  border-color: rgba(66, 181, 163, 0.72);
  background:
    linear-gradient(112deg, rgba(232, 255, 250, 0.64), rgba(247, 245, 255, 0.58) 52%, #ffffff 78%);
  box-shadow: 0 8px 24px rgba(76, 141, 196, 0.16);
}

.card-viewer-modal {
  z-index: 110;
  overflow-y: auto;
  background: rgba(9, 15, 13, 0.84);
}

.card-viewer-dialog {
  position: relative;
  display: grid;
  width: min(520px, 100%);
  justify-items: center;
  gap: 16px;
  padding: 24px;
}

.card-viewer-close {
  position: absolute;
  z-index: 5;
  top: 4px;
  right: 4px;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 50%;
  background: rgba(18, 33, 29, 0.92);
  color: #ffffff;
  font-size: 1.45rem;
  line-height: 1;
}

.card-viewer-image-wrap {
  position: relative;
  width: min(390px, calc(100vw - 72px));
  max-height: calc(100vh - 160px);
  aspect-ratio: 0.716;
  overflow: hidden;
  border-radius: 8px;
  background: #101816;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.5);
}

.card-viewer-image-wrap img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.card-viewer-caption {
  color: #ffffff;
  text-align: center;
}

.card-viewer-caption h2 {
  font-size: 1.05rem;
}

.card-viewer-caption span {
  display: block;
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.78rem;
}

@keyframes foil-shift {
  from {
    transform: translate3d(-3%, -2%, 0) rotate(-2deg);
    filter: hue-rotate(0deg) saturate(1.05);
  }

  to {
    transform: translate3d(3%, 2%, 0) rotate(2deg);
    filter: hue-rotate(34deg) saturate(1.35);
  }
}

@keyframes foil-thumbnail-shift {
  from {
    transform: translate3d(-7%, -4%, 0) rotate(-3deg);
    background-position:
      50% 50%,
      0% 0%;
    filter: hue-rotate(0deg) saturate(1.2);
  }

  to {
    transform: translate3d(7%, 4%, 0) rotate(3deg);
    background-position:
      50% 50%,
      100% 100%;
    filter: hue-rotate(55deg) saturate(1.55);
  }
}

@keyframes foil-thumbnail-glint {
  0%,
  26% {
    transform: translateX(-35%) rotate(18deg);
    opacity: 0;
  }

  42% {
    opacity: 0.92;
  }

  60%,
  100% {
    transform: translateX(35%) rotate(18deg);
    opacity: 0;
  }
}

.collection-image-placeholder,
.card-image-placeholder {
  display: grid;
  place-items: center;
  background: #e8eeeb;
  color: #60706a;
  font-size: 0.7rem;
  font-weight: 900;
}

.collection-card-body {
  min-width: 0;
}

.collection-card h3 {
  margin: 1px 0 3px;
  overflow: hidden;
  font-size: 0.9rem;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.collection-code {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 750;
}

.collection-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 9px 0;
}

.collection-meta span {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f6f8f7;
  color: #47534f;
  padding: 2px 6px;
  font-size: 0.65rem;
  font-weight: 750;
}

.collection-quantity {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  border-top: 1px solid var(--line);
  padding-top: 8px;
  color: var(--muted);
  font-size: 0.72rem;
}

.collection-quantity .playset-ready {
  color: var(--accent-strong);
}

.collection-quantity strong {
  color: var(--ink);
}

.collection-empty {
  grid-column: 1 / -1;
  padding: 54px 20px;
  color: var(--muted);
  text-align: center;
}

.table-wrap {
  min-height: 360px;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}

th,
td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

th {
  position: sticky;
  z-index: 4;
  top: 0;
  background: #f9fbfa;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
  text-align: left;
  text-transform: uppercase;
}

.numeric {
  text-align: right;
}

.card-cell {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-width: 190px;
}

.card-cell img,
.card-image-placeholder {
  width: 38px;
  height: 52px;
  object-fit: cover;
  border-radius: 4px;
  background: #dfe7e4;
}

.card-cell strong,
.card-cell small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-cell small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.74rem;
}

.status-pill,
.paid-pill {
  display: inline-flex;
  min-width: 76px;
  min-height: 26px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 0.74rem;
  font-weight: 850;
}

.inline-select {
  appearance: auto;
  border: 0;
  outline: 0;
}

.paid-pill {
  border: 0;
}

.status-ordered {
  background: #e2e8f0;
  color: #334155;
}

.status-prepared {
  background: var(--warning-soft);
  color: #7a4e12;
}

.status-shipped {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.status-delivered,
.paid-yes {
  background: #dff7df;
  color: #236b2f;
}

.paid-no {
  background: var(--danger-soft);
  color: var(--danger);
}

.row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

.buyer-contact {
  display: grid;
  gap: 3px;
  min-width: 150px;
  color: var(--muted);
  font-size: 0.8rem;
}

.buyer-notes {
  max-width: 300px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.icon-button {
  min-width: 34px;
  min-height: 32px;
  padding: 0 9px;
  border-color: var(--line);
  background: #ffffff;
  color: var(--ink);
  font-size: 0.8rem;
}

.danger-button {
  color: var(--danger);
}

.empty-row td {
  padding: 30px 12px;
  color: var(--muted);
  text-align: center;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 50;
  max-width: min(420px, calc(100vw - 48px));
  transform: translateY(24px);
  border-radius: 8px;
  background: #12211d;
  color: #ffffff;
  padding: 12px 14px;
  box-shadow: 0 18px 44px rgba(23, 32, 29, 0.26);
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 160ms ease,
    transform 160ms ease;
}

.toast.is-visible {
  transform: translateY(0);
  opacity: 1;
}

.public-toast {
  z-index: 100;
}

.modal-backdrop {
  position: fixed;
  z-index: 60;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(15, 25, 22, 0.52);
  padding: 20px;
}

.modal-backdrop[hidden] {
  display: none;
}

.auth-dialog {
  width: min(440px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 28px 80px rgba(15, 25, 22, 0.3);
}

.receipt-modal {
  overflow-y: auto;
}

.receipt-dialog {
  width: min(760px, 100%);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 28px 80px rgba(15, 25, 22, 0.3);
}

.receipt-toolbar {
  position: sticky;
  z-index: 2;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
  padding: 12px 18px;
}

.receipt-sheet {
  padding: 32px;
}

.receipt-header,
.receipt-parties,
.receipt-total {
  display: flex;
  justify-content: space-between;
  gap: 24px;
}

.receipt-header {
  align-items: flex-start;
  border-bottom: 2px solid var(--ink);
  padding-bottom: 22px;
}

.receipt-eyebrow,
.receipt-parties span,
.receipt-total span {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 850;
  text-transform: uppercase;
}

.receipt-header h2 {
  margin-top: 5px;
  font-size: 1.55rem;
}

.receipt-store-details,
.receipt-reference {
  display: grid;
  gap: 4px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.82rem;
  overflow-wrap: anywhere;
}

.receipt-store-details a {
  color: var(--accent-strong);
}

.receipt-reference {
  min-width: 180px;
  margin-top: 0;
  text-align: right;
}

.receipt-reference strong {
  color: var(--ink);
  font-size: 1rem;
}

.receipt-parties {
  padding: 20px 0;
}

.receipt-parties > div {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.receipt-parties > div:last-child {
  text-align: right;
}

.receipt-parties small {
  color: var(--muted);
}

.receipt-items {
  border-top: 1px solid var(--line);
}

.receipt-items th {
  position: static;
}

.receipt-items td:first-child strong,
.receipt-items td:first-child small {
  display: block;
}

.receipt-items td:first-child small {
  margin-top: 3px;
  color: var(--muted);
}

.receipt-total {
  justify-content: flex-end;
  border-top: 2px solid var(--ink);
  padding-top: 18px;
}

.receipt-total > div {
  min-width: 120px;
  text-align: right;
}

.receipt-total span,
.receipt-total strong {
  display: block;
}

.receipt-total strong {
  margin-top: 4px;
  font-size: 1.15rem;
}

.receipt-total > div:last-child strong {
  font-size: 1.5rem;
}

.receipt-note {
  margin-top: 34px;
  color: var(--muted);
  font-size: 0.82rem;
  text-align: center;
}

.auth-dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  padding: 18px;
}

.auth-dialog-header p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.86rem;
}

.auth-dialog form {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.auth-message {
  min-height: 20px;
  color: var(--muted);
  font-size: 0.82rem;
}

.auth-message.is-error {
  color: var(--danger);
}

.checkout-stock-warning {
  position: relative;
  min-height: 0;
  border: 1px solid #e2c177;
  border-radius: 8px;
  background: var(--warning-soft);
  color: #7a4e12;
  padding: 11px 12px 11px 42px;
  font-size: 0.84rem;
  font-weight: 750;
  line-height: 1.45;
}

.checkout-stock-warning::before {
  position: absolute;
  top: 11px;
  left: 13px;
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border-radius: 50%;
  background: #8a5a0a;
  color: #ffffff;
  content: "!";
  font-size: 0.76rem;
  font-weight: 900;
}

.auth-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
}

.danger-text-button {
  min-height: 38px;
  border: 0;
  background: transparent;
  color: var(--danger);
  padding: 0 8px;
  font-weight: 750;
}

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

@media (max-width: 1180px) {
  .marketplace-store-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .entry-form {
    grid-template-columns: minmax(240px, 1.5fr) 82px 120px minmax(180px, 1fr);
  }

  .entry-form .primary-button {
    grid-column: 4;
  }

  .order-line {
    grid-template-columns: minmax(240px, 1fr) 120px 120px auto;
  }

  .filter-bar {
    grid-template-columns: repeat(4, minmax(120px, 1fr));
  }

  .buyer-form {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .storefront-form {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .storefront-public-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .storefront-save-button {
    grid-column: 2;
    justify-self: end;
  }

  .public-store-tools {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .public-store-shop.has-cart {
    grid-template-columns: minmax(0, 1fr) minmax(280px, 310px);
  }
}

@media (max-width: 820px) {
  .marketplace-main {
    width: min(100vw - 20px, 760px);
    padding-top: 24px;
  }

  .public-store-main {
    padding-bottom: 96px;
  }

  .marketplace-header {
    padding-inline: 10px;
  }

  .marketplace-filters {
    grid-template-columns: 1fr 1fr;
  }

  .marketplace-clear {
    grid-column: 1 / -1;
  }

  .marketplace-store-grid {
    grid-template-columns: 1fr;
  }

  .app-shell {
    width: min(100vw - 20px, 760px);
    padding-top: 14px;
  }

  .topbar,
  .panel-header {
    align-items: stretch;
    flex-direction: column;
  }

  .sync-panel {
    justify-content: flex-start;
    flex-wrap: wrap;
    text-align: left;
  }

  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-span-5,
  .dashboard-span-7 {
    grid-column: span 12;
  }

  .search-box {
    width: 100%;
  }

  .header-actions {
    justify-content: stretch;
    width: 100%;
  }

  .header-actions .search-box {
    flex: 1;
  }

  .entry-form {
    grid-template-columns: 1fr 1fr;
  }

  .buyer-form {
    grid-template-columns: 1fr 1fr;
  }

  .storefront-form,
  .public-store-tools {
    grid-template-columns: 1fr 1fr;
  }

  .public-store-shop.has-cart {
    display: flex;
    flex-direction: column-reverse;
    gap: 12px;
  }

  .public-store-shop.has-cart:not(.is-cart-open) .store-cart {
    display: none;
  }

  .store-cart-toggle {
    position: fixed;
    right: 12px;
    bottom: 12px;
    left: 12px;
    z-index: 20;
    justify-content: center;
    min-height: 48px;
  }

  .store-cart {
    position: static;
    z-index: 5;
    max-height: min(420px, calc(100vh - 16px));
  }

  .collection-grid.public-store-grid.is-cards,
  .collection-grid.public-store-grid.is-compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 0;
  }

  .collection-grid.public-store-grid.is-list {
    grid-template-columns: 1fr;
    padding: 0;
  }

  .storefront-public-fields {
    grid-template-columns: 1fr 1fr;
  }

  .entry-form .notes-field {
    grid-column: auto;
  }

  .wide-field,
  .notes-field,
  .entry-form .primary-button {
    grid-column: 1 / -1;
  }

  .order-line-builder {
    grid-template-columns: 1fr 82px 120px;
  }

  .order-line-builder .wide-field,
  .order-line-builder .add-line-button {
    grid-column: 1 / -1;
  }

  .order-line {
    grid-template-columns: minmax(200px, 1fr) auto auto;
  }

  .order-line .danger-button {
    grid-column: 2 / 4;
    justify-self: end;
  }

  .filter-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .clear-filters {
    grid-column: 1 / -1;
  }
}

@media (max-width: 540px) {
  .marketplace-header {
    align-items: stretch;
    flex-direction: column;
  }

  .marketplace-header .seller-access-link {
    width: 100%;
  }

  .marketplace-search-section h2 {
    font-size: 1.65rem;
  }

  .marketplace-filters {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .marketplace-clear {
    grid-column: 1;
    width: 100%;
  }

  .marketplace-results-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .marketplace-results-header > span {
    margin-top: 0;
  }

  .marketplace-store-card {
    padding: 13px;
  }

  .marketplace-card-previews {
    grid-template-columns: 1fr;
  }

  .marketplace-card-preview {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .marketplace-card-preview img,
  .marketplace-card-placeholder {
    width: 42px;
    height: 58px;
  }

  .card-viewer-dialog {
    padding: 16px 8px;
  }

  .card-viewer-image-wrap {
    width: min(340px, calc(100vw - 32px));
    max-height: calc(100vh - 130px);
  }

  .collection-grid.public-store-grid.is-cards,
  .collection-grid.public-store-grid.is-compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .public-store-grid.is-cards .storefront-card,
  .public-store-grid.is-compact .storefront-card {
    gap: 7px;
    padding: 8px;
  }

  .public-store-grid.is-cards .storefront-card h3,
  .public-store-grid.is-compact .storefront-card h3 {
    min-height: 2.2em;
    font-size: 0.84rem;
  }

  .public-store-grid.is-cards .storefront-card .collection-meta,
  .public-store-grid.is-compact .storefront-card .collection-meta {
    display: none;
  }

  .public-store-grid.is-cards .storefront-cart-button,
  .public-store-grid.is-compact .storefront-cart-button {
    min-height: 32px;
    margin-top: 7px;
    padding-inline: 8px;
    font-size: 0.76rem;
  }

  .public-store-grid.is-list .storefront-card {
    grid-template-columns: 58px minmax(0, 1fr);
  }

  .public-store-grid.is-list .storefront-card .card-image-button,
  .public-store-grid.is-list .storefront-card > .collection-image-placeholder {
    width: 58px;
  }

  .public-store-grid.is-list .storefront-card .collection-card-body {
    grid-template-columns: minmax(0, 1fr);
  }

  .public-store-grid.is-list .storefront-cart-button {
    grid-column: 1;
    grid-row: auto;
    justify-self: start;
    min-width: 0;
    min-height: 32px;
    padding-inline: 10px;
    font-size: 0.76rem;
  }

  .public-store-header-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .public-store-header-actions > * {
    flex: 1 1 160px;
  }

  .public-store-header-actions .seller-access-link {
    width: 100%;
  }

  .metrics,
  .entry-form {
    grid-template-columns: 1fr;
  }

  .sync-panel {
    flex-direction: column;
    align-items: stretch;
  }

  .view-tab {
    padding-inline: 5px;
    font-size: 0.78rem;
  }

  .buyer-form {
    grid-template-columns: 1fr;
  }

  .public-store-header {
    width: min(100vw - 20px, 760px);
    align-items: flex-start;
    flex-direction: column;
  }

  .public-store-main {
    width: min(100vw - 20px, 760px);
  }

  .store-cart {
    max-height: min(360px, calc(100vh - 16px));
  }

  .public-store-summary {
    grid-template-columns: 1fr;
  }

  .public-store-summary > div + div {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .public-store-details {
    grid-template-columns: 1fr;
  }

  .public-store-contact {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .storefront-form,
  .storefront-public-fields,
  .public-store-tools {
    grid-template-columns: 1fr;
  }

  .storefront-save-button {
    grid-column: 1;
    width: 100%;
  }

  .storefront-header-actions {
    width: 100%;
  }

  .storefront-header-actions button {
    flex: 1;
  }

  .dashboard-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-panel-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .stock-set-row {
    grid-template-columns: 1fr 64px;
  }

  .stock-set-row .dashboard-bar {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .header-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .filter-bar {
    grid-template-columns: 1fr;
  }

  .sales-merge-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .merge-check-label,
  .merge-primary-field {
    justify-content: space-between;
  }

  .merge-primary-field select {
    min-width: 0;
    flex: 1;
  }

  .sales-merge-toolbar button {
    width: 100%;
  }

  .collection-grid {
    grid-template-columns: 1fr;
    padding: 12px;
  }

  .collection-grid.public-store-grid.is-cards,
  .collection-grid.public-store-grid.is-compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 0;
  }

  .collection-grid.public-store-grid.is-list {
    grid-template-columns: 1fr;
    padding: 0;
  }

  .public-store-pagination {
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
  }

  .public-store-pagination span {
    order: -1;
    text-align: center;
  }

  .public-store-page-numbers {
    order: 0;
  }

  .order-header-fields,
  .order-line-builder {
    grid-template-columns: 1fr;
  }

  .order-line-builder .wide-field,
  .order-line-builder .add-line-button {
    grid-column: auto;
  }

  .order-line {
    grid-template-columns: 1fr auto;
  }

  .order-line-card {
    grid-column: 1 / -1;
  }

  .order-line .danger-button {
    grid-column: auto;
  }

  .order-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .order-footer > div {
    text-align: left;
  }

  .receipt-sheet {
    padding: 22px 18px;
  }

  .receipt-header,
  .receipt-parties {
    flex-direction: column;
  }

  .receipt-reference,
  .receipt-parties > div:last-child {
    text-align: left;
  }

  .receipt-reference {
    min-width: 0;
  }

  .receipt-items {
    font-size: 0.76rem;
  }

  .receipt-items th,
  .receipt-items td {
    padding-inline: 6px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .foil-sheen,
  .foil-card-image::after {
    animation: none;
  }

  .foil-card-image .foil-sheen {
    opacity: 0.58;
  }
}

/* Riftbound brand refresh */
:root {
  --bg: #ebe9e3;
  --surface: #fffdf8;
  --surface-muted: #f0eee8;
  --ink: #171717;
  --muted: #656967;
  --line: #d6d3ca;
  --accent: #ec6b00;
  --accent-strong: #bd4f00;
  --accent-soft: #fff0df;
  --rift-blue: #06384c;
  --rift-blue-deep: #031f2b;
  --rift-burgundy: #531d25;
  --rift-gold: #c9963e;
  --warning: #a96d16;
  --warning-soft: #fff2d2;
  --danger: #b42318;
  --danger-soft: #ffe5df;
  --shadow: 0 16px 42px rgba(14, 27, 31, 0.12);
}

html {
  background: #111111;
}

body {
  overflow-x: hidden;
  background:
    linear-gradient(rgba(6, 56, 76, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(6, 56, 76, 0.025) 1px, transparent 1px),
    var(--bg);
  background-size: 28px 28px;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
}

h1,
h2,
h3,
.brand-kicker,
.store-eyebrow,
.view-tab,
.primary-button,
.ghost-button {
  font-family: "Barlow Condensed", Inter, sans-serif;
}

h1,
h2,
h3 {
  letter-spacing: 0;
}

.brand-kicker,
.store-eyebrow {
  display: block;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
}

.brand-mark {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 3px;
  background: #0b0b0b;
  color: #ffffff;
  box-shadow:
    inset 0 -12px 20px rgba(236, 107, 0, 0.22),
    0 0 0 1px rgba(0, 0, 0, 0.38);
  font-family: "Barlow Condensed", sans-serif;
  font-size: 1.15rem;
  font-weight: 800;
}

.brand-mark::before {
  position: absolute;
  z-index: -1;
  width: 28px;
  height: 28px;
  transform: rotate(24deg);
  border: 4px solid var(--accent);
  border-right-color: transparent;
  border-radius: 50%;
  content: "";
}

.brand-mark span {
  position: relative;
  z-index: 1;
}

.ghost-button,
.primary-button,
.icon-button,
.cloud-button,
.seller-order-alert,
.page-number {
  border-radius: 3px;
}

.ghost-button,
.primary-button {
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.primary-button {
  background: var(--accent);
  color: #16110c;
  box-shadow: inset 0 -2px 0 rgba(90, 34, 0, 0.28);
}

.primary-button:hover {
  background: #ff7a08;
}

.ghost-button {
  background: #fffdf8;
  border-color: #c9c5bb;
}

input,
select,
textarea,
.search-box input,
.filter-bar input,
.filter-bar select,
.public-store-tools select,
.marketplace-filters select {
  border-radius: 3px;
  background: #fffdf8;
}

input:focus,
select:focus,
textarea:focus,
.search-box input:focus,
.filter-bar input:focus,
.filter-bar select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(236, 107, 0, 0.14);
  outline: 0;
}

.public-store {
  min-height: 100vh;
  background:
    linear-gradient(rgba(6, 56, 76, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(6, 56, 76, 0.03) 1px, transparent 1px),
    #ebe9e3;
  background-size: 28px 28px;
}

.public-store-header {
  position: sticky;
  z-index: 30;
  top: 0;
  width: 100%;
  min-height: 76px;
  margin: 0;
  border: 0;
  border-bottom: 3px solid var(--accent);
  background: #111111;
  padding: 12px max(18px, calc((100vw - 1480px) / 2));
  box-shadow: 0 8px 28px rgba(3, 18, 25, 0.2);
}

.public-store-brand {
  color: #ffffff;
}

.public-store-brand h1 {
  margin-top: 3px;
  color: #ffffff;
  font-size: 1.45rem;
  font-weight: 800;
  line-height: 1;
  text-transform: uppercase;
}

.public-store-brand p {
  max-width: 680px;
  margin-top: 4px;
  color: #aeb8bb;
  font-size: 0.78rem;
}

.public-store-header .ghost-button {
  border-color: rgba(255, 255, 255, 0.28);
  background: transparent;
  color: #ffffff;
}

.public-store-main {
  width: min(1480px, calc(100vw - 32px));
  padding: 18px 0 42px;
}

.public-store-hero {
  position: relative;
  isolation: isolate;
  display: grid;
  min-height: 312px;
  overflow: hidden;
  grid-template-columns: minmax(0, 1fr) minmax(330px, 0.7fr);
  grid-template-rows: 1fr auto;
  border: 1px solid #132f3a;
  border-radius: 4px;
  background:
    linear-gradient(115deg, rgba(83, 29, 37, 0.96), rgba(6, 56, 76, 0.94) 62%, #031f2b),
    #06384c;
  color: #ffffff;
  box-shadow: 0 18px 44px rgba(3, 31, 43, 0.2);
}

.public-store-hero::before,
.public-store-hero::after {
  position: absolute;
  z-index: -1;
  content: "";
  pointer-events: none;
}

.public-store-hero::before {
  inset: 0;
  background:
    repeating-linear-gradient(118deg, transparent 0 42px, rgba(255, 255, 255, 0.025) 43px 44px),
    linear-gradient(90deg, rgba(0, 0, 0, 0.08), transparent 58%);
}

.public-store-hero::after {
  top: -80px;
  right: 18%;
  width: 240px;
  height: 420px;
  transform: rotate(18deg);
  border-right: 1px solid rgba(201, 150, 62, 0.28);
  border-left: 1px solid rgba(201, 150, 62, 0.16);
}

.public-store-hero-copy {
  align-self: center;
  max-width: 750px;
  padding: 34px 42px 26px;
}

.public-store-hero-copy h2 {
  max-width: 700px;
  margin-top: 10px;
  color: #ffffff;
  font-size: clamp(2.55rem, 5vw, 4.7rem);
  font-weight: 800;
  line-height: 0.9;
  text-transform: uppercase;
}

.public-store-hero-copy > p:last-child {
  max-width: 610px;
  margin-top: 18px;
  color: #d5dcdd;
  font-size: 0.94rem;
  line-height: 1.55;
}

.public-store-hero-cards {
  position: relative;
  min-height: 224px;
  align-self: stretch;
}

.public-store-hero-cards img {
  position: absolute;
  top: 50%;
  width: 150px;
  aspect-ratio: 0.716;
  transform-origin: 50% 100%;
  border-radius: 7px;
  object-fit: contain;
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.44);
}

.public-store-hero-cards img[data-hero-card="1"] {
  right: 190px;
  transform: translateY(-46%) rotate(-12deg);
}

.public-store-hero-cards img[data-hero-card="2"] {
  z-index: 2;
  right: 100px;
  transform: translateY(-51%) rotate(1deg);
}

.public-store-hero-cards img[data-hero-card="3"] {
  right: 14px;
  transform: translateY(-45%) rotate(12deg);
}

.hero-card-placeholder {
  position: absolute;
  top: 50%;
  right: 70px;
  display: grid;
  width: 150px;
  aspect-ratio: 0.716;
  transform: translateY(-50%) rotate(5deg);
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 7px;
  background: rgba(3, 31, 43, 0.72);
  color: var(--accent);
  font: 800 2.5rem "Barlow Condensed", sans-serif;
}

.public-store-summary {
  grid-column: 1 / -1;
  grid-row: 2;
  border: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 0;
  background: rgba(2, 22, 31, 0.42);
}

.public-store-summary > div {
  gap: 1px;
  padding: 12px 22px;
}

.public-store-summary > div + div {
  border-left-color: rgba(255, 255, 255, 0.18);
}

.public-store-summary strong {
  color: #ffffff;
  font: 800 1.55rem "Barlow Condensed", sans-serif;
}

.public-store-summary span {
  color: #b9c5c8;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
}

.public-store-details {
  display: block;
  margin-top: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-left: 4px solid var(--rift-gold);
  border-radius: 3px;
  background: #fffdf8;
}

.public-store-details > summary {
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 10px 16px;
  cursor: pointer;
  list-style: none;
}

.public-store-details > summary::-webkit-details-marker {
  display: none;
}

.public-store-details > summary strong,
.public-store-details > summary small {
  display: block;
}

.public-store-details > summary strong {
  font: 800 1.05rem "Barlow Condensed", sans-serif;
  text-transform: uppercase;
}

.public-store-details > summary small {
  margin-top: 2px;
  color: var(--muted);
}

.details-toggle {
  color: var(--accent-strong);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.public-store-details[open] .details-toggle {
  font-size: 0;
}

.public-store-details[open] .details-toggle::after {
  content: "Close";
  font-size: 0.76rem;
}

.public-store-details-body {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(260px, 0.7fr);
  border-top: 1px solid var(--line);
}

.public-store-instructions,
.public-store-contact {
  padding: 18px;
}

.public-store-details h2 {
  font-size: 1rem;
  text-transform: uppercase;
}

.public-store-tools {
  position: sticky;
  z-index: 18;
  top: 76px;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
  border: 1px solid #cbc7bd;
  border-radius: 3px;
  background: rgba(240, 238, 232, 0.97);
  padding: 10px;
  box-shadow: 0 8px 20px rgba(20, 30, 31, 0.08);
  backdrop-filter: blur(12px);
}

.public-store-tools .search-box {
  grid-column: span 2;
}

.public-store-tools label > span,
.filter-bar label > span,
.field label {
  color: #5a5f5d;
  font-size: 0.64rem;
  letter-spacing: 0.04em;
}

.public-store-results {
  padding: 12px 2px 8px;
  font-weight: 600;
}

.public-store-grid {
  grid-template-columns: repeat(auto-fill, minmax(188px, 1fr));
  gap: 10px;
}

.collection-card,
.dashboard-panel,
.panel,
.dashboard-metrics article,
.metrics article {
  border-radius: 3px;
  background: #fffdf8;
  box-shadow: 0 8px 24px rgba(16, 31, 35, 0.07);
}

.public-store-grid .storefront-card {
  position: relative;
  gap: 8px;
  border-color: #d2cec5;
  padding: 9px;
  transition:
    border-color 150ms ease,
    box-shadow 150ms ease,
    transform 150ms ease;
}

.public-store-grid .storefront-card:hover {
  transform: translateY(-3px);
  border-color: var(--rift-gold);
  box-shadow: 0 16px 32px rgba(6, 56, 76, 0.16);
}

.public-store-grid .storefront-card h3 {
  font-family: Inter, sans-serif;
  font-size: 0.84rem;
  font-weight: 800;
}

.collection-meta span {
  border-radius: 2px;
  background: #f1efe9;
}

.market-price {
  color: var(--accent-strong);
  font-weight: 800;
}

.storefront-cart-button {
  border-color: #b94f00;
  background: var(--accent);
  color: #17110c;
}

.store-cart,
.checkout-dialog,
.auth-dialog,
.receipt-dialog,
.price-chart-dialog {
  border-radius: 4px;
  background: #fffdf8;
}

.store-cart {
  top: 158px;
  max-height: calc(100vh - 174px);
  border-top: 4px solid var(--accent);
}

.store-cart > div:first-child > strong {
  font: 800 1.05rem "Barlow Condensed", sans-serif;
  text-transform: uppercase;
}

.store-cart-total {
  border-top: 2px solid var(--ink);
  padding-top: 10px;
}

.page-number.is-active {
  border-color: var(--accent);
  background: var(--accent);
  color: #17110c;
}

.app-shell {
  width: 100%;
  max-width: none;
  padding: 0 0 32px;
}

.app-shell > main {
  width: min(1500px, calc(100vw - 32px));
  margin: 0 auto;
}

.topbar {
  position: sticky;
  z-index: 40;
  top: 0;
  min-height: 78px;
  margin: 0 0 14px;
  border-bottom: 3px solid var(--accent);
  background: #111111;
  color: #ffffff;
  padding: 12px max(18px, calc((100vw - 1500px) / 2));
  box-shadow: 0 8px 28px rgba(3, 18, 25, 0.2);
}

.brand h1 {
  margin-top: 3px;
  color: #ffffff;
  font-size: 1.45rem;
  text-transform: uppercase;
}

.brand p {
  margin-top: 3px;
  color: #aeb8bb;
  font-size: 0.76rem;
}

.sync-panel {
  color: #b8c0c2;
  gap: 7px;
}

.topbar .ghost-button,
.topbar .cloud-button,
.topbar .currency-control select {
  border-color: rgba(255, 255, 255, 0.24);
  background: #202020;
  color: #ffffff;
}

.topbar .market-sync-status {
  color: #d7dcde;
}

.view-tabs {
  position: sticky;
  z-index: 25;
  top: 78px;
  margin-bottom: 12px;
  border: 1px solid #202f35;
  border-radius: 3px;
  background: var(--rift-blue-deep);
  padding: 4px;
  box-shadow: 0 7px 18px rgba(3, 31, 43, 0.12);
}

.view-tab {
  min-height: 42px;
  border-radius: 2px;
  color: #bdc8ca;
  font-size: 0.92rem;
  font-weight: 700;
  text-transform: uppercase;
}

.view-tab:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
}

.view-tab.is-active {
  background: var(--accent);
  color: #17110c;
  box-shadow: inset 0 -2px 0 rgba(90, 34, 0, 0.28);
}

.panel {
  overflow: hidden;
  border-color: #cfcbc1;
}

.panel-header {
  min-height: 72px;
  border-bottom: 1px solid #cbc7bd;
  background:
    linear-gradient(90deg, rgba(6, 56, 76, 0.08), transparent 38%),
    #fffdf8;
}

.panel-header h2,
.dashboard-panel-header h2 {
  font-size: 1.15rem;
  text-transform: uppercase;
}

.entry-form,
.buyer-form,
.sale-form,
.storefront-form,
.storefront-public-fields {
  background: #fffdf8;
}

.filter-bar {
  background:
    linear-gradient(90deg, rgba(6, 56, 76, 0.055), transparent 44%),
    #f0eee8;
}

th {
  background: #e8e6df;
  color: #505653;
}

tbody tr:hover {
  background: #fff8ee;
}

.dashboard-metrics article {
  position: relative;
  overflow: hidden;
  border-color: #cfcbc1;
  padding-top: 18px;
}

.dashboard-metrics article::before {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 4px;
  background: var(--rift-blue);
  content: "";
}

.dashboard-metrics article:nth-child(3n + 2)::before {
  background: var(--accent);
}

.dashboard-metrics article:nth-child(3n + 3)::before {
  background: var(--rift-gold);
}

.dashboard-metrics strong {
  font-family: "Barlow Condensed", Inter, sans-serif;
  font-size: 1.65rem;
}

.dashboard-panel-header {
  background: #f5f2eb;
}

.dashboard-bar span {
  background: var(--accent);
}

.app-shell.is-auth-gated .modal-backdrop {
  background:
    linear-gradient(120deg, rgba(83, 29, 37, 0.96), rgba(6, 56, 76, 0.96)),
    #06384c;
}

.app-shell.is-auth-gated .auth-dialog {
  border-top: 4px solid var(--accent);
}

.auth-dialog-header {
  background: #f5f2eb;
}

.toast {
  border-bottom: 3px solid var(--accent);
  border-radius: 3px;
  background: #111111;
}

.card-viewer-modal {
  background: rgba(2, 18, 24, 0.9);
}

@media (max-width: 1180px) {
  .public-store-tools {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .public-store-hero {
    grid-template-columns: minmax(0, 1fr) 340px;
  }

  .public-store-hero-copy {
    padding-inline: 28px;
  }

  .public-store-hero-cards img {
    width: 132px;
  }

  .public-store-hero-cards img[data-hero-card="1"] {
    right: 165px;
  }

  .public-store-hero-cards img[data-hero-card="2"] {
    right: 88px;
  }

  .public-store-hero-cards img[data-hero-card="3"] {
    right: 10px;
  }
}

@media (max-width: 820px) {
  .public-store-header,
  .topbar {
    position: relative;
  }

  .public-store-main,
  .app-shell > main {
    width: min(100vw - 20px, 780px);
  }

  .public-store-hero {
    min-height: 380px;
    grid-template-columns: minmax(0, 1fr) 250px;
  }

  .public-store-hero-copy {
    align-self: start;
    padding: 28px 22px 18px;
  }

  .public-store-hero-copy h2 {
    font-size: clamp(2.3rem, 8vw, 3.8rem);
  }

  .public-store-hero-cards {
    min-height: 260px;
  }

  .public-store-hero-cards img {
    top: 54%;
    width: 112px;
  }

  .public-store-hero-cards img[data-hero-card="1"] {
    right: 126px;
  }

  .public-store-hero-cards img[data-hero-card="2"] {
    right: 65px;
  }

  .public-store-hero-cards img[data-hero-card="3"] {
    right: 4px;
  }

  .public-store-tools {
    position: static;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .public-store-tools .search-box {
    grid-column: span 3;
  }

  .public-store-details-body {
    grid-template-columns: 1fr;
  }

  .public-store-contact {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .topbar {
    padding-inline: 14px;
  }

  .sync-panel {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .sync-panel > button,
  .sync-panel > a,
  .sync-panel > label {
    min-width: 0;
  }

  #catalogStatus,
  .market-sync-status {
    display: none;
  }

  .view-tabs {
    top: 0;
  }
}

@media (max-width: 540px) {
  .public-store-header {
    min-height: 68px;
    align-items: center;
    flex-direction: row;
    padding: 9px 10px;
  }

  .public-store-brand {
    gap: 10px;
  }

  .public-store-brand .brand-mark {
    width: 42px;
    height: 42px;
    flex-basis: 42px;
  }

  .public-store-brand h1 {
    max-width: calc(100vw - 72px);
    overflow: hidden;
    font-size: 1.15rem;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .public-store-brand p {
    display: none;
  }

  .brand-kicker {
    font-size: 0.58rem;
  }

  .public-store-header-actions {
    width: auto;
  }

  .public-store-header-actions > * {
    flex: 0 0 auto;
  }

  .public-store-hero {
    min-height: 490px;
    grid-template-columns: 1fr;
    grid-template-rows: auto 210px auto;
  }

  .public-store-hero-copy {
    padding: 24px 18px 4px;
  }

  .public-store-hero-copy h2 {
    font-size: 2.65rem;
  }

  .public-store-hero-copy > p:last-child {
    margin-top: 12px;
    font-size: 0.82rem;
  }

  .public-store-hero-cards {
    grid-row: 2;
    min-height: 210px;
  }

  .public-store-hero-cards img {
    top: 47%;
    width: 112px;
  }

  .public-store-hero-cards img[data-hero-card="1"] {
    right: calc(50% + 34px);
  }

  .public-store-hero-cards img[data-hero-card="2"] {
    right: calc(50% - 56px);
  }

  .public-store-hero-cards img[data-hero-card="3"] {
    right: calc(50% - 146px);
  }

  .public-store-summary {
    grid-row: 3;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .public-store-summary > div {
    min-width: 0;
    padding: 10px 5px;
    text-align: center;
  }

  .public-store-summary > div + div {
    border-top: 0;
    border-left: 1px solid rgba(255, 255, 255, 0.18);
  }

  .public-store-summary strong {
    font-size: 1.3rem;
  }

  .public-store-summary span {
    font-size: 0.54rem;
  }

  .public-store-tools {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    padding: 8px;
  }

  .public-store-tools .search-box {
    grid-column: span 2;
  }

  .public-store-tools label > span {
    font-size: 0.59rem;
  }

  .collection-grid.public-store-grid.is-cards,
  .collection-grid.public-store-grid.is-compact {
    gap: 7px;
  }

  .public-store-grid .storefront-card {
    padding: 7px;
  }

  .topbar {
    align-items: stretch;
    padding: 10px;
  }

  .topbar .brand {
    align-items: center;
  }

  .topbar .brand-mark {
    width: 42px;
    height: 42px;
    flex-basis: 42px;
  }

  .brand h1 {
    font-size: 1.2rem;
  }

  .sync-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  .sync-panel .ghost-button,
  .sync-panel .cloud-button,
  .sync-panel select {
    width: 100%;
    min-height: 36px;
    padding-inline: 7px;
    font-size: 0.72rem;
  }

  .view-tabs {
    position: sticky;
    top: 0;
  }
}

@media print {
  @page {
    margin: 14mm;
  }

  body {
    min-width: 0;
    background: #ffffff;
  }

  body > .public-store,
  .app-shell > :not(.receipt-modal),
  .receipt-toolbar {
    display: none !important;
  }

  .app-shell,
  .receipt-modal,
  .receipt-dialog {
    position: static;
    display: block !important;
    width: 100%;
    max-height: none;
    margin: 0;
    overflow: visible;
    border: 0;
    background: #ffffff;
    padding: 0;
    box-shadow: none;
  }

  .receipt-sheet {
    padding: 0;
  }

  .receipt-items th {
    background: #ffffff;
  }
}

/* Personal store operations */
.order-tracker {
  min-height: 100vh;
  background: #f3f6f4;
}

.order-tracker-header {
  display: flex;
  min-height: 78px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid #d7e1dc;
  background: #ffffff;
  padding: 14px max(24px, calc((100vw - 1080px) / 2));
}

.order-tracker-main {
  width: min(1080px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 48px 0 72px;
}

.tracker-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}

.tracker-heading span,
.store-section-heading span {
  color: #ad5c31;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.tracker-heading h2 {
  margin: 3px 0 0;
  font-family: "Barlow Condensed", sans-serif;
  font-size: 3rem;
  line-height: 1;
}

.tracker-heading p {
  color: var(--muted);
  font-size: 0.82rem;
}

.tracker-details {
  border: 1px solid #d8e1dd;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 16px 42px rgba(29, 45, 38, 0.08);
  overflow: hidden;
}

.tracker-status-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-bottom: 1px solid #e3e9e6;
}

.tracker-status-grid article {
  padding: 22px;
}

.tracker-status-grid article + article {
  border-left: 1px solid #e3e9e6;
}

.tracker-status-grid span,
.tracker-status-grid strong {
  display: block;
}

.tracker-status-grid span {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
}

.tracker-status-grid strong {
  font-size: 1.05rem;
}

.tracker-progress {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  padding: 26px 22px;
}

.tracker-progress div {
  position: relative;
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
  color: #87928e;
}

.tracker-progress div::after {
  position: absolute;
  top: 13px;
  right: calc(50% + 18px);
  left: calc(-50% + 18px);
  height: 2px;
  background: #dce5e1;
  content: "";
}

.tracker-progress div:first-child::after {
  display: none;
}

.tracker-progress div.is-complete::after {
  background: #11806f;
}

.tracker-progress span {
  position: relative;
  z-index: 1;
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  place-items: center;
  border: 2px solid #d4ddd9;
  border-radius: 50%;
  background: #ffffff;
  font-size: 0.7rem;
  font-weight: 800;
}

.tracker-progress .is-complete {
  color: #13675c;
}

.tracker-progress .is-complete span {
  border-color: #11806f;
  background: #11806f;
  color: #ffffff;
}

.tracker-progress .is-current strong {
  color: var(--ink);
}

.tracker-items,
.tracker-totals {
  border-top: 1px solid #e3e9e6;
  padding: 22px;
}

.tracker-items h3 {
  margin: 0 0 12px;
}

.tracker-items > div,
.tracker-totals > div {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 8px 0;
}

.tracker-items small {
  color: var(--muted);
}

.tracker-totals {
  margin-left: auto;
}

.tracker-totals > div {
  margin-left: auto;
  max-width: 380px;
}

.tracker-totals .tracker-total {
  border-top: 1px solid #dce4e0;
  margin-top: 5px;
  padding-top: 14px;
  font-size: 1.12rem;
}

.store-highlights {
  display: grid;
  gap: 34px;
  margin: 34px 0;
}

.store-section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 14px;
}

.store-section-heading h2 {
  margin: 2px 0 0;
  font-family: "Barlow Condensed", sans-serif;
  font-size: 2rem;
  text-transform: uppercase;
}

.store-highlight-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.store-highlight-grid .storefront-card {
  display: flex;
  min-width: 0;
  min-height: 100%;
  flex-direction: column;
  gap: 8px;
  border-color: #d2cec5;
  padding: 9px;
}

.store-highlight-grid .storefront-card .card-image-button,
.store-highlight-grid .storefront-card > .collection-image-placeholder {
  width: 100%;
  aspect-ratio: 0.716;
}

.store-highlight-grid .storefront-card .card-image-button img {
  object-fit: contain;
}

.store-highlight-grid .storefront-card .collection-card-body {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
}

.store-highlight-grid .storefront-card h3 {
  display: -webkit-box;
  min-height: 2.28em;
  overflow: hidden;
  white-space: normal;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.store-highlight-grid .storefront-card .collection-meta {
  min-height: 48px;
  align-content: flex-start;
}

.store-highlight-grid .storefront-card .collection-quantity {
  margin-top: auto;
}

.playset-toggle {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 14px;
  border: 1px solid #b8cbc3;
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  margin: 26px 0 12px;
  padding: 13px 16px;
  text-align: left;
}

.playset-toggle:hover,
.playset-toggle.is-active {
  border-color: #0f766e;
  background: #ecf7f3;
}

.playset-toggle-mark {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  place-items: center;
  border-radius: 50%;
  background: #14241f;
  color: #ffffff;
  font-family: "Barlow Condensed", sans-serif;
  font-size: 1.25rem;
  font-weight: 800;
}

.playset-toggle strong,
.playset-toggle small {
  display: block;
}

.playset-toggle small {
  margin-top: 2px;
  color: var(--muted);
}

.shipping-estimate {
  margin: 10px 0 14px;
  color: #66746f;
  font-size: 0.76rem;
  line-height: 1.45;
}

.checkout-shipping-estimate {
  border-left: 3px solid #d99458;
  background: #fff7ef;
  margin-top: -4px;
  padding: 9px 11px;
}

.checkout-website-field {
  position: fixed;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.checkout-tracking-result {
  border: 1px solid #afd0c5;
  border-radius: 8px;
  background: #eef8f4;
  padding: 14px;
}

.checkout-tracking-result strong,
.checkout-tracking-result p,
.checkout-tracking-result a {
  display: block;
}

.checkout-tracking-result strong {
  font-size: 1.2rem;
}

.checkout-tracking-result p {
  margin: 5px 0 10px;
  color: var(--muted);
  font-size: 0.82rem;
}

.checkout-tracking-result a {
  margin-bottom: 10px;
  color: #0c6a60;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.collection-empty {
  display: grid;
  justify-items: center;
  gap: 7px;
  text-align: center;
}

.collection-empty span {
  color: var(--muted);
}

.history-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(340px, 0.75fr);
  gap: 16px;
}

.activity-list,
.recycle-list {
  display: grid;
  gap: 0;
}

.activity-entry,
.recycle-entry {
  display: flex;
  align-items: center;
  gap: 14px;
  border-top: 1px solid var(--line);
  padding: 13px 0;
}

.activity-entry:first-child,
.recycle-entry:first-child {
  border-top: 0;
}

.activity-entry > div,
.recycle-entry > div {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.activity-entry small,
.recycle-entry small {
  color: var(--muted);
  font-size: 0.75rem;
}

.activity-kind {
  min-width: 76px;
  border-radius: 4px;
  background: #e9f2ee;
  color: #32675b;
  padding: 5px 7px;
  font-size: 0.67rem;
  font-weight: 800;
  text-align: center;
  text-transform: uppercase;
}

.recycle-entry {
  justify-content: space-between;
}

.recycle-entry > div > span {
  color: #ad5c31;
  font-size: 0.7rem;
  font-weight: 800;
}

.audit-dialog {
  width: min(680px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
  border-radius: 8px;
  background: #ffffff;
  padding: 22px;
  overflow: auto;
}

.audit-card {
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr);
  align-items: center;
  gap: 20px;
  border-block: 1px solid var(--line);
  margin: 16px 0;
  padding: 20px 0;
}

.audit-card img {
  width: 118px;
  border-radius: 6px;
}

.audit-card span,
.audit-card p {
  color: var(--muted);
}

.audit-card h3 {
  margin: 5px 0 8px;
  font-family: "Barlow Condensed", sans-serif;
  font-size: 2rem;
  line-height: 1;
}

.audit-count-field {
  display: grid;
  grid-template-columns: 1fr 140px;
  align-items: center;
  gap: 8px 14px;
}

.audit-count-field label {
  font-weight: 700;
}

.audit-count-field input {
  min-height: 48px;
  font-size: 1.15rem;
  font-weight: 800;
  text-align: center;
}

.audit-count-field p {
  grid-column: 1 / -1;
  margin: 0;
  color: #397164;
}

.audit-count-field p.is-different {
  color: #ad5c31;
  font-weight: 700;
}

.audit-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 20px;
}

.collection-header-actions {
  display: flex;
  min-width: min(520px, 55vw);
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.collection-header-actions .search-box {
  width: min(320px, 100%);
}

.collection-mode-switch {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(78px, 1fr));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #f1efe9;
  padding: 2px;
}

.collection-mode-switch button {
  min-height: 34px;
  border: 0;
  border-radius: 2px;
  background: transparent;
  color: var(--muted);
  padding: 0 12px;
  font-size: 0.78rem;
  font-weight: 800;
}

.collection-mode-switch button:hover {
  color: var(--ink);
}

.collection-mode-switch button.is-active {
  background: var(--ink);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(15, 31, 34, 0.16);
}

.collection-grid.is-binder {
  display: block;
  background: #e9ece9;
  padding: 18px;
}

.binder-page {
  width: min(100%, 980px);
  margin: 0 auto 18px;
  border: 1px solid #c7ccc8;
  background: #f8f9f7;
  padding: 12px;
  break-inside: avoid;
}

.binder-page:last-child {
  margin-bottom: 0;
}

.binder-page-header {
  display: flex;
  min-height: 32px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid #d5d9d6;
  margin-bottom: 10px;
  padding: 0 2px 9px;
}

.binder-page-header strong {
  font-family: "Barlow Condensed", sans-serif;
  font-size: 1.05rem;
  text-transform: uppercase;
}

.binder-page-header span {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
}

.binder-page-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.binder-card {
  min-width: 0;
  border: 1px solid #cbd0cc;
  background: #ffffff;
  padding: 7px;
}

.binder-card-image {
  position: relative;
  aspect-ratio: 0.716;
  overflow: hidden;
  background: #dfe4e1;
}

.binder-card-image > button,
.binder-card-image img,
.binder-card-image .collection-image-placeholder {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 0;
  object-fit: cover;
  padding: 0;
}

.binder-card-image > button {
  background: transparent;
}

.binder-card-image > button:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: -3px;
}

.binder-card.is-missing .binder-card-image img {
  filter: grayscale(1) contrast(0.82);
  opacity: 0.26;
}

.binder-card.is-missing {
  border-style: dashed;
  background: #f1f3f1;
}

.binder-status-badge {
  position: absolute;
  right: 7px;
  bottom: 7px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 2px;
  background: rgba(24, 79, 65, 0.92);
  color: #ffffff;
  padding: 4px 7px;
  font-size: 0.66rem;
  font-weight: 900;
  text-transform: uppercase;
}

.binder-card.is-missing .binder-status-badge {
  background: rgba(156, 61, 39, 0.94);
}

.binder-card-info {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 2px 7px;
  padding: 7px 1px 1px;
}

.binder-card-info > span {
  grid-row: 1 / span 2;
  color: var(--accent-strong);
  font-family: "Barlow Condensed", sans-serif;
  font-size: 1rem;
  font-weight: 800;
}

.binder-card-info strong {
  min-width: 0;
  overflow: hidden;
  font-size: 0.76rem;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.binder-card-info small {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.63rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.binder-empty {
  background: #ffffff;
}

@media (max-width: 820px) {
  .collection-header-actions {
    width: 100%;
    min-width: 0;
    align-items: stretch;
    flex-direction: column;
  }

  .collection-header-actions .search-box {
    width: 100%;
  }

  .collection-mode-switch {
    width: 100%;
  }

  .collection-grid.is-binder {
    padding: 10px;
  }

  .binder-page {
    padding: 8px;
  }

  .binder-page-grid {
    gap: 7px;
  }

  .binder-card {
    padding: 4px;
  }

  .binder-status-badge {
    right: 4px;
    bottom: 4px;
    padding: 3px 5px;
    font-size: 0.56rem;
  }

  .order-tracker-header {
    align-items: flex-start;
    padding: 12px 16px;
  }

  .order-tracker-header .public-store-brand h1 {
    font-size: 1.15rem;
  }

  .order-tracker-main {
    padding-top: 28px;
  }

  .tracker-heading {
    display: block;
  }

  .tracker-heading p {
    margin-top: 8px;
  }

  .tracker-status-grid,
  .history-layout {
    grid-template-columns: 1fr;
  }

  .tracker-status-grid article + article {
    border-top: 1px solid #e3e9e6;
    border-left: 0;
  }

  .tracker-progress {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .tracker-progress div::after {
    top: -10px;
    bottom: auto;
    left: 13px;
    width: 2px;
    height: 12px;
  }

  .store-highlight-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 540px) {
  .binder-page-header span {
    display: none;
  }

  .binder-card-info {
    display: block;
    padding-top: 5px;
  }

  .binder-card-info > span,
  .binder-card-info strong {
    display: block;
    font-size: 0.66rem;
  }

  .binder-card-info small {
    display: none;
  }

  .order-tracker-header .ghost-button {
    min-height: 36px;
    padding: 7px 9px;
    font-size: 0.7rem;
  }

  .tracker-heading h2 {
    font-size: 2.4rem;
  }

  .store-highlights {
    margin: 24px 0;
  }

  .store-highlight-grid {
    gap: 7px;
  }

  .playset-toggle {
    margin-top: 18px;
  }

  .audit-card {
    grid-template-columns: 82px minmax(0, 1fr);
    gap: 13px;
  }

  .audit-card img {
    width: 82px;
  }

  .audit-card h3 {
    font-size: 1.55rem;
  }

  .audit-count-field {
    grid-template-columns: 1fr 110px;
  }

  .audit-actions > * {
    flex: 1 1 42%;
  }
}

/* Mobile storefront and owner navigation */
.lucide {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  stroke-width: 2;
  pointer-events: none;
}

.public-store-mobile-controls,
.mobile-sheet-header,
.mobile-sheet-actions,
.mobile-page-picker,
.store-cart-close,
.checkout-stepper,
.mobile-seller-nav,
.mobile-quick-add,
.mobile-seller-sheet,
.mobile-seller-sheet-backdrop {
  display: none;
}

.checkout-step {
  display: grid;
  gap: 14px;
}

.checkout-remember {
  display: flex;
  min-height: 44px;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.checkout-remember input {
  width: 20px;
  height: 20px;
}

.checkout-shipping-estimate {
  margin: 0;
}

.store-cart-header > div {
  display: grid;
  gap: 2px;
}

.storefront-cart-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

@media screen and (max-width: 820px) {
  body.mobile-sheet-open {
    overflow: hidden;
  }

  .public-store-main {
    display: flex;
    width: min(100% - 20px, 1480px);
    flex-direction: column;
    padding-top: 10px;
    padding-bottom: calc(86px + env(safe-area-inset-bottom));
  }

  .public-store-hero {
    order: 0;
    min-height: 270px;
    grid-template-columns: minmax(0, 1fr) 220px;
    grid-template-rows: 1fr auto;
  }

  .public-store-hero-copy {
    padding: 24px 24px 18px;
  }

  .public-store-hero-copy h2 {
    font-size: 2.45rem;
    line-height: 0.94;
  }

  .public-store-hero-cards {
    grid-column: 2;
    grid-row: 1;
    min-height: 200px;
  }

  .public-store-hero-cards img {
    width: 112px;
  }

  .public-store-hero-cards img[data-hero-card="1"] {
    right: 104px;
  }

  .public-store-hero-cards img[data-hero-card="2"] {
    right: 54px;
  }

  .public-store-hero-cards img[data-hero-card="3"] {
    right: 4px;
  }

  .public-store-summary {
    grid-row: 2;
  }

  .playset-toggle {
    order: 1;
    min-height: 58px;
    margin-top: 10px;
  }

  .public-store-mobile-controls {
    position: sticky;
    z-index: 22;
    top: 8px;
    order: 2;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    margin-top: 8px;
    background: rgba(246, 247, 245, 0.96);
    padding: 6px 0;
    backdrop-filter: blur(12px);
  }

  .mobile-store-search {
    position: relative;
    display: flex;
    min-width: 0;
    align-items: center;
  }

  .mobile-store-search .lucide {
    position: absolute;
    left: 13px;
    color: var(--muted);
  }

  .mobile-store-search input {
    width: 100%;
    min-height: 48px;
    padding-left: 40px;
  }

  .mobile-filter-button {
    position: relative;
    min-width: 104px;
    min-height: 48px;
    gap: 7px;
  }

  .mobile-filter-button strong {
    display: grid;
    min-width: 20px;
    height: 20px;
    place-items: center;
    border-radius: 10px;
    background: var(--accent);
    color: #17110c;
    font-size: 0.7rem;
  }

  .public-store-details {
    order: 3;
  }

  .store-highlights {
    order: 4;
  }

  .public-store-tools {
    position: fixed;
    z-index: 73;
    inset: auto 0 0;
    top: auto;
    display: none;
    max-height: min(82dvh, 720px);
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 0;
    overflow-y: auto;
    border: 0;
    border-top: 4px solid var(--accent);
    border-radius: 8px 8px 0 0;
    background: #fffdf8;
    padding: 0 14px calc(14px + env(safe-area-inset-bottom));
    box-shadow: 0 -18px 50px rgba(3, 18, 25, 0.24);
  }

  .public-store-tools.is-mobile-open {
    display: grid;
  }

  .public-store-tools .desktop-store-search {
    display: none;
  }

  .public-store-tools .mobile-sheet-header,
  .mobile-seller-sheet .mobile-sheet-header {
    position: sticky;
    z-index: 2;
    top: 0;
    display: flex;
    grid-column: 1 / -1;
    min-height: 66px;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border-bottom: 1px solid var(--line);
    background: #fffdf8;
    padding: 10px 0;
  }

  .mobile-sheet-header > div {
    display: grid;
    gap: 2px;
  }

  .mobile-sheet-header span {
    color: var(--muted);
    font-size: 0.75rem;
  }

  .public-store-tools label > span {
    font-size: 0.66rem;
  }

  .public-store-tools select {
    min-height: 48px;
  }

  .mobile-sheet-actions {
    position: sticky;
    bottom: calc(-14px - env(safe-area-inset-bottom));
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: 1fr 1.5fr;
    gap: 8px;
    border-top: 1px solid var(--line);
    background: #fffdf8;
    padding: 12px 0 calc(14px + env(safe-area-inset-bottom));
  }

  .mobile-sheet-actions > * {
    min-height: 48px;
  }

  .mobile-sheet-backdrop,
  .mobile-seller-sheet-backdrop {
    position: fixed;
    z-index: 72;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: 0;
    background: rgba(3, 18, 25, 0.54);
    padding: 0;
  }

  .mobile-sheet-backdrop[hidden],
  .mobile-seller-sheet-backdrop[hidden] {
    display: none;
  }

  .public-store-results {
    order: 5;
    scroll-margin-top: 74px;
  }

  .store-cart-toggle {
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom));
    left: auto;
    z-index: 45;
    display: grid;
    min-width: 174px;
    min-height: 52px;
    grid-template-columns: auto auto;
    gap: 0 8px;
    border: 1px solid #ba6405;
    border-radius: 6px;
    background: #17110c;
    color: #ffffff;
    padding: 7px 12px;
    box-shadow: 0 12px 30px rgba(3, 18, 25, 0.28);
    text-align: left;
  }

  .store-cart-toggle .lucide {
    grid-row: 1 / 3;
    align-self: center;
    color: var(--accent);
  }

  .store-cart-toggle > span {
    display: none;
  }

  .store-cart-toggle strong,
  .store-cart-toggle em {
    font-size: 0.74rem;
    font-style: normal;
    line-height: 1.2;
  }

  .store-cart-toggle em {
    color: #f3be78;
    font-weight: 800;
  }

  .public-store-shop,
  .public-store-shop.has-cart {
    order: 6;
    display: block;
  }

  .public-store-shop .store-cart,
  .public-store-shop.has-cart:not(.is-cart-open) .store-cart {
    display: none;
  }

  .public-store-shop.is-cart-open .store-cart {
    position: fixed;
    z-index: 74;
    inset: auto 0 0;
    display: grid;
    max-height: min(78dvh, 680px);
    overflow-y: auto;
    border: 0;
    border-top: 4px solid var(--accent);
    border-radius: 8px 8px 0 0;
    background: #fffdf8;
    padding: 14px 14px calc(14px + env(safe-area-inset-bottom));
    box-shadow: 0 -18px 50px rgba(3, 18, 25, 0.26);
  }

  .store-cart-header {
    position: sticky;
    z-index: 2;
    top: -14px;
    background: #fffdf8;
    padding: 4px 0 10px;
  }

  .store-cart-close {
    display: inline-grid;
  }

  .store-cart-line > div {
    flex-wrap: nowrap;
  }

  .store-cart-line .icon-button,
  .store-cart-close {
    min-width: 44px;
    min-height: 44px;
  }

  #storeCheckout {
    min-height: 48px;
  }

  .public-store-pagination {
    order: 7;
    display: grid;
    grid-template-columns: 1fr minmax(128px, 1.2fr) 1fr;
    gap: 8px;
  }

  .public-store-page-numbers {
    display: none;
  }

  .mobile-page-picker {
    display: block;
  }

  .mobile-page-picker select,
  .public-store-pagination button {
    width: 100%;
    min-height: 48px;
  }

  .public-store-pagination > span {
    grid-column: 1 / -1;
    grid-row: 1;
    text-align: center;
  }

  .public-store-pagination > button,
  .public-store-pagination > .mobile-page-picker {
    grid-row: 2;
  }

  #checkoutModal {
    z-index: 80;
    align-items: end;
    padding: 0;
  }

  .checkout-dialog {
    width: 100%;
    max-height: 94dvh;
    border: 0;
    border-top: 4px solid var(--accent);
    border-radius: 8px 8px 0 0;
  }

  .checkout-dialog .auth-dialog-header {
    position: sticky;
    z-index: 3;
    top: 0;
  }

  .checkout-form {
    padding: 14px 14px calc(14px + env(safe-area-inset-bottom));
  }

  .checkout-stepper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .checkout-stepper span {
    display: flex;
    min-height: 38px;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border-bottom: 3px solid var(--line);
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 850;
  }

  .checkout-stepper span.is-active {
    border-color: var(--accent);
    color: var(--ink);
  }

  .checkout-stepper em {
    font-style: normal;
  }

  .checkout-review-actions .primary-button {
    width: 100%;
    min-height: 50px;
  }

  .checkout-message {
    display: none;
  }

  .checkout-submit-actions {
    position: sticky;
    z-index: 2;
    bottom: calc(-14px - env(safe-area-inset-bottom));
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
    margin: 0 -14px;
    border-top: 1px solid var(--line);
    background: #fffdf8;
    padding: 10px 14px calc(14px + env(safe-area-inset-bottom));
  }

  .checkout-submit-actions > * {
    min-width: 0;
    min-height: 44px;
    padding-inline: 5px;
    font-size: 0.7rem;
  }

  #checkoutSubmit {
    grid-column: 1 / -1;
    grid-row: 1;
    min-height: 50px;
    font-size: 0.86rem;
  }

  .topbar {
    min-height: 66px;
    align-items: center;
    margin-bottom: 10px;
    padding: 8px 12px;
  }

  .topbar .brand p,
  .topbar .brand-kicker {
    display: none;
  }

  .topbar .brand-mark {
    width: 42px;
    height: 42px;
    flex-basis: 42px;
  }

  .topbar .brand h1 {
    font-size: 1.15rem;
  }

  .sync-panel > * {
    display: none;
  }

  .sync-panel #cloudButton,
  .sync-panel #sellerOrderNotification:not([hidden]) {
    display: inline-flex;
  }

  .sync-panel #cloudButton {
    min-width: 44px;
    min-height: 44px;
    padding: 7px 10px;
  }

  .sync-panel #cloudStatus {
    max-width: 92px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .app-shell > main {
    width: min(100% - 20px, 1500px);
    padding-bottom: calc(92px + env(safe-area-inset-bottom));
  }

  .view-tabs {
    display: none;
  }

  .mobile-seller-nav {
    position: fixed;
    z-index: 50;
    right: 0;
    bottom: 0;
    left: 0;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    border-top: 1px solid #303738;
    background: #111111;
    padding: 4px 4px calc(4px + env(safe-area-inset-bottom));
    box-shadow: 0 -10px 28px rgba(3, 18, 25, 0.18);
  }

  .mobile-seller-nav button {
    display: grid;
    min-width: 0;
    min-height: 54px;
    place-items: center;
    align-content: center;
    gap: 3px;
    border: 0;
    border-radius: 3px;
    background: transparent;
    color: #aeb8bb;
    padding: 4px 2px;
    font-size: 0.62rem;
    font-weight: 750;
  }

  .mobile-seller-nav button.is-active {
    background: #273234;
    color: #f4b45f;
  }

  .mobile-seller-nav .lucide {
    width: 20px;
    height: 20px;
  }

  .mobile-quick-add {
    position: fixed;
    z-index: 51;
    right: 14px;
    bottom: calc(70px + env(safe-area-inset-bottom));
    display: grid;
    width: 52px;
    height: 52px;
    place-items: center;
    border: 1px solid #ba6405;
    border-radius: 6px;
    background: var(--accent);
    color: #17110c;
    box-shadow: 0 12px 26px rgba(3, 18, 25, 0.28);
  }

  .mobile-seller-sheet {
    position: fixed;
    z-index: 74;
    inset: auto 0 0;
    display: block;
    max-height: 78dvh;
    overflow-y: auto;
    border-top: 4px solid var(--accent);
    border-radius: 8px 8px 0 0;
    background: #fffdf8;
    padding: 0 14px calc(14px + env(safe-area-inset-bottom));
    box-shadow: 0 -18px 50px rgba(3, 18, 25, 0.26);
  }

  .mobile-seller-sheet[hidden] {
    display: none;
  }

  .mobile-seller-more-actions,
  .mobile-seller-quick-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding-top: 12px;
  }

  .mobile-seller-more-actions[hidden],
  .mobile-seller-quick-actions[hidden] {
    display: none;
  }

  .mobile-seller-more-actions > *,
  .mobile-seller-quick-actions > * {
    display: flex;
    min-height: 52px;
    align-items: center;
    gap: 9px;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: #ffffff;
    color: var(--ink);
    padding: 10px;
    font: inherit;
    font-size: 0.78rem;
    font-weight: 800;
    text-align: left;
    text-decoration: none;
  }

  .mobile-seller-sheet-backdrop {
    z-index: 73;
  }

  .app-shell.is-auth-gated .mobile-seller-nav,
  .app-shell.is-auth-gated .mobile-quick-add {
    display: none;
  }

  @media (hover: none) {
    .public-store-grid .storefront-card:hover {
      transform: none;
    }
  }
}

@media screen and (max-width: 540px) {
  .public-store-header {
    padding: 8px 10px;
  }

  .public-store-hero {
    min-height: 214px;
    grid-template-columns: minmax(0, 1fr) 108px;
  }

  .public-store-hero-copy {
    padding: 18px 10px 12px 14px;
  }

  .store-eyebrow {
    font-size: 0.62rem;
  }

  .public-store-hero-copy h2 {
    margin-top: 6px;
    font-size: 1.78rem;
    line-height: 0.94;
  }

  .public-store-hero-copy > p:last-child {
    display: none;
  }

  .public-store-hero-cards {
    min-height: 150px;
  }

  .public-store-hero-cards img {
    width: 88px;
  }

  .public-store-hero-cards img[data-hero-card="1"],
  .public-store-hero-cards img[data-hero-card="3"] {
    display: none;
  }

  .public-store-hero-cards img[data-hero-card="2"] {
    right: 10px;
    transform: translateY(-50%) rotate(2deg);
  }

  .public-store-summary > div {
    padding: 7px 3px;
  }

  .public-store-summary strong {
    font-size: 1.1rem;
  }

  .public-store-summary span {
    font-size: 0.5rem;
  }

  .playset-toggle {
    margin-top: 8px;
  }

  .playset-toggle small {
    display: none;
  }

  .public-store-tools {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .collection-grid.public-store-grid.is-list {
    gap: 6px;
  }

  .public-store-grid.is-list .storefront-card {
    grid-template-columns: 62px minmax(0, 1fr);
    gap: 8px;
    padding: 7px;
  }

  .public-store-grid.is-list .storefront-card .card-image-button,
  .public-store-grid.is-list .storefront-card > .collection-image-placeholder {
    width: 62px;
  }

  .public-store-grid.is-list .storefront-card .collection-card-body {
    grid-template-columns: minmax(0, 1fr) 48px;
    gap: 3px 6px;
  }

  .public-store-grid.is-list .storefront-card h3 {
    font-size: 0.84rem;
  }

  .public-store-grid.is-list .storefront-card .collection-meta {
    max-height: 22px;
    overflow: hidden;
  }

  .public-store-grid.is-list .storefront-card .collection-meta span {
    padding: 2px 4px;
    font-size: 0.58rem;
  }

  .public-store-grid.is-list .storefront-card .collection-quantity {
    font-size: 0.68rem;
  }

  .public-store-grid.is-list .storefront-cart-button {
    grid-column: 2;
    grid-row: 1 / span 5;
    align-self: center;
    justify-self: stretch;
    width: 48px;
    min-width: 48px;
    min-height: 48px;
    padding: 0;
  }

  .public-store-grid.is-list .storefront-cart-button span {
    display: none;
  }

  .public-store-grid.is-compact .storefront-cart-button,
  .public-store-grid.is-cards .storefront-cart-button {
    min-height: 44px;
  }

  .store-cart-toggle {
    min-width: 158px;
  }

  .mobile-seller-more-actions,
  .mobile-seller-quick-actions {
    grid-template-columns: 1fr;
  }

  .topbar .brand h1 {
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

@media screen and (pointer: coarse) {
  button,
  a.ghost-button,
  a.primary-button,
  input,
  select,
  textarea {
    min-height: 44px;
  }

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

.storefront-destinations {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-bottom: 1px solid var(--line);
  background: var(--surface-muted);
}

.storefront-destination {
  display: grid;
  min-width: 0;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 16px 18px;
}

.storefront-destination + .storefront-destination {
  border-left: 1px solid var(--line);
}

.storefront-destination-mark {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 1px solid #c9c5bc;
  border-radius: 4px;
  background: #ffffff;
}

.storefront-destination-mark.is-store {
  color: var(--accent-strong);
}

.storefront-destination-mark.is-command {
  background: var(--rift-blue-deep);
  color: var(--rift-gold);
}

.storefront-destination > div:nth-child(2) {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.storefront-destination span {
  color: var(--muted);
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
}

.storefront-destination strong {
  overflow: hidden;
  font-size: 0.88rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.storefront-destination small {
  color: var(--muted);
  font-size: 0.72rem;
}

.storefront-destination-actions {
  display: flex;
  gap: 6px;
}

.storefront-form {
  grid-template-columns: minmax(220px, 1fr) minmax(320px, 2fr) auto;
}

@media screen and (max-width: 820px) {
  .storefront-destinations {
    grid-template-columns: 1fr;
  }

  .storefront-destination + .storefront-destination {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .storefront-form {
    grid-template-columns: 1fr;
  }

  .storefront-bio-field,
  .storefront-visibility {
    grid-column: 1;
  }
}

@media screen and (max-width: 540px) {
  .storefront-destination {
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 10px;
    padding: 13px 14px;
  }

  .storefront-destination-mark {
    width: 42px;
    height: 42px;
  }

  .storefront-destination-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }

  .storefront-destination-actions .icon-button {
    min-width: 48px;
    min-height: 48px;
  }
}
