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

:root {
  --bg: #07131a;
  --panel: #0e1c22;
  --panel-2: #132833;
  --ink: #f7fbfb;
  --muted: #9ab0b8;
  --line: rgba(255, 255, 255, 0.1);
  --gold: #f4b860;
  --pink: #ff2d75;
  --teal: #5be7c4;
  --danger: #ff6b8a;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.38);
  --font-head: "Space Grotesk", system-ui, sans-serif;
  --font-body: "DM Sans", system-ui, sans-serif;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100svh;
  color: var(--ink);
  font-family: var(--font-body);
  background:
    linear-gradient(180deg, rgba(255, 45, 117, 0.08), transparent 260px),
    linear-gradient(90deg, rgba(91, 231, 196, 0.06), transparent 45%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
}

body.modal-open {
  overflow: hidden;
}

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

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

button {
  cursor: pointer;
}

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  min-height: 70px;
  padding: 12px clamp(16px, 4vw, 34px);
  border-bottom: 1px solid var(--line);
  background: rgba(7, 19, 26, 0.9);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-head);
  font-size: 20px;
  font-weight: 700;
  color: #fff;
}

.brand img {
  width: 34px;
  height: 34px;
  border-radius: 8px;
}

.topnav {
  display: inline-flex;
  align-items: center;
  justify-self: center;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.nav-tab {
  min-height: 36px;
  padding: 0 14px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.nav-tab.is-active {
  background: #fff;
  color: #07131a;
}

.account-slot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 180px;
}

.account-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  max-width: 280px;
  padding: 5px 6px 5px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
}

.account-pill span {
  min-width: 0;
  overflow: hidden;
  color: #dbe6e8;
  font-size: 13px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0 80px;
}

.store-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
  gap: 18px;
  align-items: end;
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--gold);
  font-family: var(--font-head);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  color: #fff;
  font-family: var(--font-head);
  letter-spacing: 0;
}

h1 {
  font-size: clamp(36px, 6vw, 64px);
  line-height: 0.95;
}

h2 {
  font-size: clamp(24px, 3vw, 34px);
}

h3 {
  font-size: 18px;
  line-height: 1.2;
}

.searchbox {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  outline: none;
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

input,
select {
  padding: 0 12px;
}

textarea {
  min-height: 92px;
  padding: 12px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(244, 184, 96, 0.8);
  box-shadow: 0 0 0 3px rgba(244, 184, 96, 0.16);
}

input::placeholder,
textarea::placeholder {
  color: rgba(224, 235, 238, 0.45);
}

select option {
  color: #07131a;
}

.status-strip {
  display: none;
  margin: 0 0 22px;
}

.status-strip.is-visible {
  display: block;
}

.notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid rgba(91, 231, 196, 0.25);
  border-radius: 8px;
  background: rgba(91, 231, 196, 0.08);
  color: #dffbf6;
  font-size: 14px;
}

.notice.error {
  border-color: rgba(255, 107, 138, 0.32);
  background: rgba(255, 107, 138, 0.1);
  color: #ffdbe3;
}

.notice.warn {
  border-color: rgba(244, 184, 96, 0.32);
  background: rgba(244, 184, 96, 0.1);
  color: #fff2d8;
}

.view-panel {
  display: none;
}

.view-panel.is-active {
  display: block;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin: 28px 0 18px;
}

.category-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.chip.is-active {
  border-color: rgba(255, 45, 117, 0.65);
  background: rgba(255, 45, 117, 0.16);
  color: #fff;
}

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

.product-card,
.stage-card,
.seller-panel,
.auth-panel,
.empty-state {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(14, 28, 34, 0.82);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.2);
}

.product-card {
  overflow: hidden;
  text-align: left;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.product-card:hover,
.product-card:focus-within {
  transform: translateY(-3px);
  border-color: rgba(244, 184, 96, 0.42);
  box-shadow: var(--shadow);
}

.product-card button {
  display: block;
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}

.product-media {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #10252f;
}

.product-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 6px;
  background: rgba(7, 19, 26, 0.78);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.product-media .badge {
  position: absolute;
  left: 10px;
  top: 10px;
}

.product-body {
  display: grid;
  gap: 8px;
  padding: 12px;
}

.product-title {
  min-height: 43px;
  overflow: hidden;
  color: #fff;
  font-family: var(--font-head);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.25;
}

.product-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}

.price {
  color: var(--teal);
  font-family: var(--font-head);
  font-size: 18px;
  font-weight: 700;
}

.merchant-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stage-card {
  overflow: hidden;
}

.stage-cover {
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: #101b21;
}

.stage-cover img,
.stage-cover video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.stage-body {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.stage-products {
  display: grid;
  gap: 8px;
}

.drop-row {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 58px;
  padding: 6px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.drop-row img {
  width: 54px;
  height: 54px;
  border-radius: 6px;
  object-fit: cover;
}

.drop-title {
  min-width: 0;
  overflow: hidden;
  color: #fff;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.drop-price {
  color: var(--teal);
  font-weight: 700;
}

.button,
.ghost-button,
.link-button,
.danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 800;
}

.button {
  border: 0;
  background: var(--pink);
  color: #fff;
}

.button:hover {
  filter: brightness(1.08);
}

.button:disabled,
.ghost-button:disabled,
.danger-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.ghost-button,
.link-button {
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}

.danger-button {
  border: 1px solid rgba(255, 107, 138, 0.35);
  background: rgba(255, 107, 138, 0.12);
  color: #ffdbe3;
}

.small-button {
  min-height: 32px;
  padding: 0 10px;
  font-size: 12px;
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 260px;
  padding: 28px;
  color: var(--muted);
  text-align: center;
}

.empty-state h3 {
  margin-bottom: 8px;
}

.loading-row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-weight: 700;
}

.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.16);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(0, 0, 0, 0.68);
}

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

.modal {
  position: relative;
  width: min(900px, 100%);
  max-height: min(88svh, 850px);
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: #091820;
  box-shadow: var(--shadow);
}

.modal-close {
  position: sticky;
  top: 12px;
  left: calc(100% - 50px);
  z-index: 4;
  width: 38px;
  height: 38px;
  margin: 12px 12px -50px auto;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(7, 19, 26, 0.86);
  color: #fff;
  font-size: 26px;
  line-height: 1;
}

.product-detail {
  display: grid;
  grid-template-columns: minmax(0, 0.94fr) minmax(0, 1.06fr);
  gap: 0;
}

.detail-media {
  min-height: 520px;
  background: #10242e;
}

.detail-media img {
  width: 100%;
  height: 100%;
  min-height: 520px;
  object-fit: cover;
}

.detail-body {
  display: grid;
  align-content: start;
  gap: 18px;
  padding: 34px;
}

.detail-body p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.detail-actions {
  display: grid;
  grid-template-columns: 100px minmax(0, 1fr);
  gap: 10px;
}

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

.field {
  display: grid;
  gap: 7px;
}

.field.full {
  grid-column: 1 / -1;
}

.field label,
.field > span,
.file-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.auth-panel,
.seller-panel {
  padding: 18px;
}

.auth-layout,
.seller-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.86fr) minmax(0, 1.14fr);
  gap: 16px;
  align-items: start;
}

.auth-panel h3,
.seller-panel h3 {
  margin-bottom: 8px;
}

.muted {
  color: var(--muted);
}

.panel-copy {
  margin: 0 0 16px;
  color: var(--muted);
  line-height: 1.55;
}

.form {
  display: grid;
  gap: 12px;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.provider-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.seller-status {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.seller-status strong {
  color: #fff;
}

.merchant-dashboard-head {
  display: grid;
  grid-template-columns: minmax(280px, 0.92fr) minmax(0, 1.08fr);
  gap: 16px;
  align-items: stretch;
}

.merchant-stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.merchant-stat-card {
  display: grid;
  gap: 6px;
  min-height: 118px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.merchant-stat-card span,
.merchant-stat-card small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.merchant-stat-card strong {
  color: #fff;
  font-family: var(--font-head);
  font-size: 24px;
  line-height: 1;
}

.merchant-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0;
}

.merchant-dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
}

.merchant-money-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--muted);
}

.section-mini-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.merchant-filter-row {
  justify-content: flex-start;
  margin-bottom: 12px;
}

.merchant-products {
  display: grid;
  gap: 10px;
}

.merchant-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.merchant-row-loose {
  align-items: start;
}

.merchant-row strong {
  display: block;
  overflow: hidden;
  color: #fff;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.merchant-row small {
  display: block;
  color: var(--muted);
}

.merchant-order-card {
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.merchant-order-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.merchant-order-actions select {
  width: min(220px, 100%);
  min-height: 34px;
}

.places-results {
  display: grid;
  gap: 6px;
  margin-top: 6px;
}

.places-row {
  display: grid;
  gap: 2px;
  width: 100%;
  min-height: 48px;
  padding: 9px 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
  text-align: left;
}

.places-row:hover {
  border-color: rgba(244, 184, 96, 0.45);
  background: rgba(244, 184, 96, 0.08);
}

.places-row span {
  color: var(--muted);
  font-size: 13px;
}

.map-preview {
  width: 100%;
  min-height: 180px;
  max-height: 240px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  object-fit: cover;
  background: #10252f;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 9px;
  border-radius: 6px;
  background: rgba(244, 184, 96, 0.12);
  color: #ffe7b9;
  font-size: 12px;
  font-weight: 800;
}

.pill.good {
  background: rgba(91, 231, 196, 0.12);
  color: #cafff4;
}

.pill.bad {
  background: rgba(255, 107, 138, 0.13);
  color: #ffd7df;
}

.hidden {
  display: none !important;
}

@media (max-width: 1020px) {
  .product-grid,
  .stage-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 800px) {
  .topbar {
    grid-template-columns: 1fr auto;
  }

  .topnav {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-self: stretch;
  }

  .account-slot {
    grid-column: 2;
    grid-row: 1;
  }

  .nav-tab {
    flex: 1;
    padding: 0 8px;
  }

  .account-slot {
    min-width: 0;
  }

  .store-toolbar,
  .auth-layout,
  .seller-layout,
  .merchant-dashboard-head,
  .merchant-dashboard-grid,
  .product-detail {
    grid-template-columns: 1fr;
  }

  .section-head {
    align-items: start;
    flex-direction: column;
  }

  .category-row {
    justify-content: flex-start;
  }

  .detail-media,
  .detail-media img {
    min-height: 0;
    aspect-ratio: 1 / 1;
  }
}

@media (max-width: 640px) {
  .shell {
    width: min(100% - 22px, 1180px);
    padding-top: 24px;
  }

  .product-grid,
  .stage-grid,
  .field-grid,
  .provider-row {
    grid-template-columns: 1fr;
  }

  .product-card {
    display: grid;
  }

  .detail-body {
    padding: 22px;
  }

  .detail-actions {
    grid-template-columns: 1fr;
  }

  .merchant-row {
    grid-template-columns: 1fr;
  }

  .merchant-stat-grid {
    grid-template-columns: 1fr;
  }

  .merchant-order-actions {
    justify-content: stretch;
  }

  .merchant-order-actions > * {
    width: 100%;
  }
}
