.marketplace-page {
  --market-bg: #f5f7fb;
  --market-panel: #fff;
  --market-border: #e6ebf5;
  --market-text: #172033;
  --market-muted: #68768d;
  --market-brand: #6d28d9;
  --market-brand-blue: #2563eb;
  min-height: 100vh;
  background: linear-gradient(180deg, #f9faff 0%, var(--market-bg) 100%);
  color: var(--market-text);
  font-family: Inter, system-ui, sans-serif;
}

.marketplace-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(214, 222, 240, .9);
  background: rgba(255, 255, 255, .9);
  backdrop-filter: blur(12px);
}

.marketplace-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  max-width: 1440px;
  min-height: 74px;
  margin: 0 auto;
  padding: 10px 24px;
}

.marketplace-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  color: var(--market-text);
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -.04em;
  text-decoration: none;
}

.marketplace-brand strong { color: var(--market-brand); }
.marketplace-brand b { color: #f59e0b; }
.marketplace-brand-mark {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--market-brand), var(--market-brand-blue));
  box-shadow: 0 12px 22px rgba(109, 40, 217, .25);
  color: white;
  font-size: .8rem;
}

.marketplace-nav,
.marketplace-account {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.marketplace-nav a {
  padding: 9px 13px;
  border-radius: 12px;
  color: var(--market-muted);
  font-weight: 600;
  text-decoration: none;
}

.marketplace-nav a:hover,
.marketplace-nav a:focus-visible {
  background: #efe9ff;
  color: var(--market-brand);
}

.marketplace-account {
  justify-content: flex-end;
  gap: 12px;
  font-size: .85rem;
}

.marketplace-account button,
.marketplace-account a {
  padding: 9px 12px;
  border: 1px solid var(--market-border);
  border-radius: 12px;
  background: white;
  color: var(--market-text);
  font-weight: 600;
  text-decoration: none;
}

.marketplace-shell {
  width: min(1200px, 100%);
  margin: 32px auto 64px;
  padding: 0 24px;
}

.marketplace-hero {
  position: relative;
  overflow: hidden;
  margin-bottom: 24px;
  padding: clamp(26px, 5vw, 48px);
  border: 1px solid #e3e8f5;
  border-radius: 24px;
  background:
    radial-gradient(circle at 90% 15%, rgba(109, 40, 217, .14), transparent 33%),
    linear-gradient(120deg, #fff, #f0f5ff);
  box-shadow: 0 16px 40px rgba(17, 24, 39, .05);
}

.marketplace-hero h1 {
  margin: 8px 0;
  font-size: clamp(2rem, 4vw, 3rem);
  letter-spacing: -.05em;
  line-height: 1.15;
}

.marketplace-page .access-eyebrow {
  margin: 0;
  color: var(--market-brand);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .13em;
}

.marketplace-page .access-intro {
  max-width: 680px;
  margin: 8px 0 0;
  color: var(--market-muted);
}

#marketStatus {
  min-height: 26px;
  color: var(--market-muted);
}

.marketplace-panel {
  margin: 22px 0;
  padding: clamp(20px, 3vw, 30px);
  border: 1px solid var(--market-border);
  border-radius: 20px;
  background: rgba(255, 255, 255, .9);
  box-shadow: 0 16px 40px rgba(17, 24, 39, .045);
}

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

.marketplace-section-heading h2 {
  margin: 5px 0 0;
  font-size: clamp(1.25rem, 2.5vw, 1.65rem);
  letter-spacing: -.035em;
}

.marketplace-section-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid #dcd7fa;
  border-radius: 14px;
  background: linear-gradient(135deg, #fff, #f3efff);
  color: var(--market-brand);
  font-weight: 800;
}

.marketplace-page .access-row {
  border-color: var(--market-border);
  border-radius: 16px;
  box-shadow: 0 5px 16px rgba(23, 32, 51, .035);
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.marketplace-page .access-row:hover {
  border-color: #cfc3f4;
  box-shadow: 0 10px 24px rgba(23, 32, 51, .08);
  transform: translateY(-1px);
}

.marketplace-page .access-row-info strong,
.marketplace-page .access-row-info>a {
  color: var(--market-text);
  font-size: 1rem;
}

.marketplace-page .access-row-info p,
.marketplace-page .access-note {
  color: var(--market-muted);
}

.marketplace-page .access-button,
.marketplace-page .access-secondary {
  min-height: 42px;
  border-radius: 12px;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}

.marketplace-page .access-button {
  border: 0;
  background: linear-gradient(135deg, var(--market-brand), var(--market-brand-blue));
  box-shadow: 0 10px 20px rgba(109, 40, 217, .18);
}

.marketplace-page .access-button:hover:not(:disabled) {
  color: white;
  box-shadow: 0 12px 24px rgba(109, 40, 217, .25);
  transform: translateY(-1px);
}

.marketplace-page .access-secondary {
  border-color: var(--market-border);
  color: var(--market-brand);
}

.marketplace-page .access-secondary:hover:not(:disabled) {
  border-color: #d6c9fa;
  background: #f7f4ff;
}

.marketplace-page .access-toolbar {
  gap: 14px;
  margin: 16px 0;
}

.marketplace-page .access-toolbar label {
  flex: 1 1 220px;
  color: #425066;
}

.marketplace-page input,
.marketplace-page select {
  width: 100%;
  min-height: 44px;
  border-color: #dce3f0;
  border-radius: 12px;
}

.marketplace-page input:focus,
.marketplace-page select:focus {
  border-color: #9b7be8;
  outline: 3px solid rgba(109, 40, 217, .13);
}

.marketplace-subheading {
  margin: 28px 0 14px;
  font-size: 1.08rem;
  letter-spacing: -.02em;
}

.marketplace-admin .access-note {
  max-width: 900px;
}

.dashboard-embedded {
  min-height: 0;
  background: transparent;
}

.dashboard-embedded .marketplace-header,
.dashboard-embedded .marketplace-hero {
  display: none;
}

.dashboard-embedded .marketplace-shell {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0 0 24px;
}

.dashboard-embedded .marketplace-panel {
  margin-top: 0;
}

@media (max-width: 760px) {
  .marketplace-header-inner {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 12px;
  }

  .marketplace-nav { order: 3; width: 100%; }
  .marketplace-account { margin-left: auto; }
  .marketplace-shell { margin-top: 20px; padding: 0 16px; }
  .marketplace-page .access-row { align-items: stretch; }
  .marketplace-page .access-row > div:last-child { display: flex; flex-wrap: wrap; gap: 8px; }
  .dashboard-embedded .marketplace-shell { padding: 0 0 16px; }
}

@media (max-width: 480px) {
  .marketplace-header-inner { padding: 10px 16px; }
  .marketplace-account { width: 100%; justify-content: flex-start; }
  .marketplace-nav a { padding: 8px 10px; }
  .marketplace-panel { padding: 18px 14px; }
  .marketplace-section-mark { width: 38px; height: 38px; }
}
