/* ═══════════════════════════════════════════════════
   Pod21 Design System v2 — Dark Neobrutalism
   ═══════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* ─── CSS Custom Properties ─────────────────────── */
:root {
  /* Backgrounds */
  --bg-primary:    #121212;
  --bg-secondary:  #1a1a1a;
  --bg-card:       #212121;

  /* Text */
  --text-primary:   #ffffff;
  --text-secondary: #c4c4c4;
  --text-muted:     #888888;

  /* Borders */
  --border:      #333333;
  --border-hard: #000000;

  /* Accents */
  --accent:      #ff931c;
  --accent-sub:  rgba(255, 147, 28, 0.15);
  --purple:      #420069;
  --purple-sub:  rgba(66, 0, 105, 0.15);

  /* Semantic */
  --danger:  #e74c3c;
  --success: #00b894;

  /* Shadows — exact 4-value neobrutalist format */
  --shadow-sm:       3px 3px 0px 0px rgba(0, 0, 0, 1);
  --shadow-md:       4px 4px 0px 0px rgba(0, 0, 0, 1);
  --shadow-lg:       8px 8px 0px 0px rgba(0, 0, 0, 1);
  --shadow-xl:      10px 10px 0px 0px rgba(0, 0, 0, 1);
  --shadow-hover:    6px 6px 0px 0px rgba(0, 0, 0, 1);
  --shadow-hover-lg: 8px 8px 0px 0px rgba(0, 0, 0, 1);
  --shadow-focus:    0 0 0 2px rgba(255, 147, 28, 0.2);
  --shadow-glow:     0 8px 25px rgba(255, 147, 28, 0.15);

  /* Radius */
  --r-sm:   8px;
  --r-md:   12px;
  --r-lg:   20px;
  --r-pill: 999px;

  /* Layout */
  --sidebar-w: 240px;
  --content-max: 1200px;
}

/* ─── Reset & Base ───────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  font-weight: 400;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
img { max-width: 100%; display: block; }
ul { list-style: none; }

/* ─── Animated Background Particles ─────────────── */
ul.background {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  overflow: hidden;
  z-index: 0;
  pointer-events: none;
}

ul.background li {
  position: absolute;
  display: block;
  width: 20px; height: 20px;
  background: rgba(255, 147, 28, 0.04);
  border: 1px solid rgba(255, 147, 28, 0.06);
  animation: animateParticle linear infinite;
  bottom: -150px;
  border-radius: 2px;
}

ul.background li:nth-child(1)  { left: 25%; width: 80px;  height: 80px;  animation-delay: 0s;    animation-duration: 20s; }
ul.background li:nth-child(2)  { left: 10%; width: 20px;  height: 20px;  animation-delay: 2s;    animation-duration: 12s; }
ul.background li:nth-child(3)  { left: 70%; width: 20px;  height: 20px;  animation-delay: 4s;    animation-duration: 16s; }
ul.background li:nth-child(4)  { left: 40%; width: 60px;  height: 60px;  animation-delay: 0s;    animation-duration: 18s; }
ul.background li:nth-child(5)  { left: 65%; width: 20px;  height: 20px;  animation-delay: 0s;    animation-duration: 14s; }
ul.background li:nth-child(6)  { left: 75%; width: 110px; height: 110px; animation-delay: 3s;    animation-duration: 22s; }
ul.background li:nth-child(7)  { left: 35%; width: 150px; height: 150px; animation-delay: 7s;    animation-duration: 26s; }
ul.background li:nth-child(8)  { left: 50%; width: 25px;  height: 25px;  animation-delay: 15s;   animation-duration: 15s; }
ul.background li:nth-child(9)  { left: 20%; width: 15px;  height: 15px;  animation-delay: 2s;    animation-duration: 30s; }
ul.background li:nth-child(10) { left: 85%; width: 150px; height: 150px; animation-delay: 0s;    animation-duration: 20s; }

@keyframes animateParticle {
  0%   { transform: translateY(0) rotate(0deg);   opacity: 0; }
  10%  { opacity: 1; }
  90%  { opacity: 1; }
  100% { transform: translateY(-1200px) rotate(720deg); opacity: 0; }
}

/* ─── Layout Shell ───────────────────────────────── */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--bg-secondary);
  border-right: 2px solid var(--border);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform 0.3s ease;
  overflow-y: auto;
}

.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
}

.page-container {
  padding: 32px 32px;
}

/* ─── Sidebar Internals ──────────────────────────── */
.sidebar-header {
  padding: 20px 16px 16px;
  border-bottom: 2px solid var(--border);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.sidebar-logo-text { color: var(--accent); }

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-section {
  margin-bottom: 20px;
}

.sidebar-section-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 0 8px;
  margin-bottom: 6px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--r-sm);
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
  border-left: 3px solid transparent;
}

.sidebar-link:hover,
.sidebar-link.active {
  background: var(--accent-sub);
  color: var(--accent);
  border-left-color: var(--accent);
}

.sidebar-link .sidebar-icon {
  font-size: 1rem;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

/* Sidebar Footer — Provider profile */
.sidebar-footer {
  padding: 14px 12px;
  border-top: 2px solid var(--border);
  background: var(--bg-primary);
}

.sidebar-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.sidebar-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  object-fit: cover;
  flex-shrink: 0;
}

.sidebar-profile-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.sidebar-profile-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-profile-nip05 {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 400;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-logout-btn {
  width: 100%;
  padding: 7px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--text-muted);
  font-size: 0.8rem;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.sidebar-logout-btn:hover {
  border-color: var(--danger);
  color: var(--danger);
}

/* Mobile hamburger nav */
.mobile-nav {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 56px;
  background: var(--bg-secondary);
  border-bottom: 2px solid var(--border);
  z-index: 99;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
}

.hamburger {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 4px;
}

.hamburger span {
  display: block;
  width: 24px; height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all 0.2s;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 99;
}

/* ─── Footer ─────────────────────────────────────── */
.site-footer {
  background: var(--bg-secondary);
  border-top: 2px solid var(--border);
  padding: 28px 24px;
  margin-top: auto;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-brand {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.footer-brand span { color: var(--accent); }

.footer-links {
  display: flex;
  gap: 20px;
  align-items: center;
}

.footer-links a {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 500;
  transition: color 0.15s;
}

.footer-links a:hover { color: var(--accent); }

/* ─── Typography ─────────────────────────────────── */
h1 { font-size: 2.5rem; font-weight: 700; line-height: 1.2; }
h2 { font-size: 2rem;   font-weight: 600; line-height: 1.25; }
h3 { font-size: 1.4rem; font-weight: 700; line-height: 1.3; }
h4 { font-size: 1rem;   font-weight: 700; }
p  { font-size: 0.95rem; font-weight: 500; color: var(--text-secondary); line-height: 1.7; }

.text-accent  { color: var(--accent); }
.text-muted   { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-danger  { color: var(--danger); }
.text-purple  { color: var(--purple); }

.mono {
  font-family: 'SF Mono', 'Fira Code', 'Fira Mono', 'Roboto Mono', ui-monospace, monospace;
  font-size: 0.85em;
}

/* ─── Buttons ─────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 20px;
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.1s;
  text-decoration: none;
  white-space: nowrap;
}

.btn:active { transform: translate(2px, 2px) !important; }

/* Primary — orange */
.btn-primary {
  background: var(--accent);
  color: #121212;
  border: 3px solid #000;
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover {
  transform: translate(-1px, -1px);
  box-shadow: var(--shadow-md);
  color: #121212;
}

/* Secondary — ghost */
.btn-secondary {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 2px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translate(-1px, -1px);
  box-shadow: var(--shadow-md);
}

/* Purple — Nostr */
.btn-purple {
  background: var(--purple);
  color: #fff;
  border: 3px solid #000;
  box-shadow: var(--shadow-sm);
}
.btn-purple:hover {
  transform: translate(-1px, -1px);
  box-shadow: var(--shadow-md);
  color: #fff;
}

/* Danger */
.btn-danger {
  background: var(--danger);
  color: #fff;
  border: 3px solid #000;
  box-shadow: var(--shadow-sm);
}
.btn-danger:hover {
  transform: translate(-1px, -1px);
  box-shadow: var(--shadow-md);
  color: #fff;
}

/* Sizes */
.btn-sm { padding: 6px 14px; font-size: 0.8rem; }
.btn-lg { padding: 14px 28px; font-size: 1rem; }

/* ─── Cards ──────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  padding: 20px;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}

.card-hover:hover {
  transform: translate(-2px, -2px);
  box-shadow: var(--shadow-hover);
  border-color: var(--accent);
}

.card-xl {
  box-shadow: var(--shadow-xl);
}

/* ─── Forms & Inputs ─────────────────────────────── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.form-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.01em;
}

.form-input,
.form-select,
.form-textarea {
  background: var(--bg-secondary);
  border: 2px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 10px 14px;
  transition: border-color 0.15s, box-shadow 0.15s;
  width: 100%;
  outline: none;
}

.form-textarea {
  min-height: 100px;
  resize: vertical;
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--text-muted);
  font-weight: 400;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--accent);
  box-shadow: var(--shadow-focus);
}

.form-select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23888' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

.form-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.form-error {
  font-size: 0.78rem;
  color: var(--danger);
  font-weight: 600;
}

/* ─── Badges ─────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: var(--r-pill);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.badge-provider {
  background: var(--purple);
  color: #fff;
}

.badge-provider-pending {
  background: var(--danger);
  color: #fff;
}

.badge-success {
  background: rgba(0, 184, 148, 0.15);
  color: var(--success);
  border: 1px solid rgba(0, 184, 148, 0.3);
}

.badge-pending {
  background: var(--accent-sub);
  color: var(--accent);
  border: 1px solid rgba(255, 147, 28, 0.3);
}

.badge-danger {
  background: rgba(231, 76, 60, 0.15);
  color: var(--danger);
  border: 1px solid rgba(231, 76, 60, 0.3);
}

.badge-category {
  background: var(--bg-secondary);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

/* Platform badges (image overlay) */
.platform-badge {
  position: absolute;
  bottom: 8px; right: 8px;
  padding: 3px 7px;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  pointer-events: none;
}

.platform-stl       { background: var(--accent);  color: #121212; }
.platform-printables { background: #fa6831;        color: #fff; }
.platform-makerworld { background: #06b6d4;        color: #fff; }
.platform-thingiverse{ background: #248bfb;        color: #fff; }

/* ─── Chips / Category Filters ───────────────────── */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  padding: 5px 14px;
  border-radius: var(--r-pill);
  background: var(--bg-card);
  border: 2px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
  white-space: nowrap;
}

.chip:hover,
.chip.active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-sub);
}

/* ─── Marketplace Cards ──────────────────────────── */
.listing-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.listing-card {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
  cursor: pointer;
  display: flex;
  flex-direction: column;
}

.listing-card:hover {
  transform: translate(-2px, -2px);
  box-shadow: var(--shadow-hover);
  border-color: var(--accent);
}

.listing-card-img {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--bg-secondary);
}

.listing-card-img img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.listing-card:hover .listing-card-img img {
  transform: scale(1.03);
}

.listing-card-body {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.listing-card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
}

.listing-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.listing-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  background: var(--bg-secondary);
}

.listing-creator {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
}

.listing-creator-avatar {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 1px solid var(--border);
  object-fit: cover;
}

.listing-price {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--success);
}

.listing-price.free { color: var(--accent); }

/* ─── Provider Cards ─────────────────────────────── */
.provider-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.provider-card {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}

.provider-card:hover {
  transform: translate(-2px, -2px);
  box-shadow: var(--shadow-hover);
  border-color: var(--accent);
}

.provider-card-header {
  display: flex;
  align-items: center;
  gap: 14px;
}

.provider-avatar {
  width: 52px; height: 52px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}

.provider-card-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.provider-card-location {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 2px;
}

.provider-materials {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.material-tag {
  padding: 2px 8px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.provider-stats {
  display: flex;
  gap: 16px;
}

.provider-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.provider-stat-value {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.provider-stat-label {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.rating-stars { color: var(--accent); font-weight: 700; }

/* ─── Nostr Profile Block ────────────────────────── */
.nostr-profile {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.nostr-avatar {
  width: 56px; height: 56px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  object-fit: cover;
  flex-shrink: 0;
}

.nostr-info { flex: 1; min-width: 0; }

.nostr-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.nostr-nip05 {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 400;
}

.nostr-npub-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}

.nostr-npub {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: 'SF Mono', ui-monospace, monospace;
  background: var(--bg-primary);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--border);
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.copy-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 6px;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 0.7rem;
  transition: color 0.15s, border-color 0.15s;
}

.copy-btn:hover { color: var(--accent); border-color: var(--accent); }

.nostr-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

/* ─── Page Header ────────────────────────────────── */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 28px;
}

.page-title {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.page-subtitle {
  font-size: 0.95rem;
  color: var(--text-secondary);
  font-weight: 500;
  margin-top: 4px;
}

/* ─── Section Headers ────────────────────────────── */
.section-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 8px;
}

.section-title {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 4px;
}

/* ─── Hero ───────────────────────────────────────── */
.hero {
  padding: 64px 32px 48px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: var(--accent-sub);
  border: 1px solid rgba(255, 147, 28, 0.3);
  border-radius: var(--r-pill);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 20px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.hero-title {
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  font-weight: 700;
  line-height: 1.15;
  color: var(--text-primary);
  margin-bottom: 16px;
  letter-spacing: -0.02em;
}

.hero-title span { color: var(--accent); }

.hero-sub {
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--text-secondary);
  max-width: 560px;
  line-height: 1.7;
  margin-bottom: 32px;
}

.hero-cta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* ─── Stats Row ──────────────────────────────────── */
.stats-row {
  display: flex;
  gap: 2px;
  flex-wrap: wrap;
}

.stat-card {
  background: var(--bg-card);
  border: 2px solid var(--border);
  box-shadow: var(--shadow-md);
  padding: 16px 24px;
  flex: 1;
  min-width: 120px;
  text-align: center;
}

.stat-card:first-child { border-radius: var(--r-md) 0 0 var(--r-md); }
.stat-card:last-child  { border-radius: 0 var(--r-md) var(--r-md) 0; }

.stat-value {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--accent);
  display: block;
  letter-spacing: -0.02em;
}

.stat-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ─── How It Works ───────────────────────────────── */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.step-card {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  padding: 24px;
  position: relative;
}

.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  background: var(--accent);
  color: #121212;
  font-weight: 800;
  font-size: 1rem;
  border-radius: var(--r-sm);
  border: 2px solid #000;
  box-shadow: var(--shadow-sm);
  margin-bottom: 14px;
}

.step-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.step-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  font-weight: 500;
  line-height: 1.6;
}

/* ─── Detail Page Layout ─────────────────────────── */
.detail-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 28px;
  align-items: start;
}

.detail-sidebar-card {
  position: sticky;
  top: 24px;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.detail-sidebar-card-header {
  padding: 16px;
  border-bottom: 2px solid var(--border);
  background: var(--bg-secondary);
}

.detail-sidebar-card-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ─── Tabs ───────────────────────────────────────── */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border);
  margin-bottom: 20px;
}

.tab-btn {
  padding: 10px 18px;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  color: var(--text-muted);
  font-family: 'Inter', sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}

.tab-btn.active,
.tab-btn:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ─── Search Bar ─────────────────────────────────── */
.search-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.search-input {
  flex: 1;
  background: var(--bg-secondary);
  border: 2px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 10px 16px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.search-input:focus {
  border-color: var(--accent);
  box-shadow: var(--shadow-focus);
}

.search-input::placeholder { color: var(--text-muted); }

/* ─── Table ──────────────────────────────────────── */
.table-wrap {
  overflow-x: auto;
  border: 2px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-md);
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-card);
}

thead tr {
  border-bottom: 2px solid var(--border);
  background: var(--bg-secondary);
}

th {
  padding: 10px 16px;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

td {
  padding: 12px 16px;
  font-size: 0.88rem;
  color: var(--text-secondary);
  font-weight: 500;
  border-bottom: 1px solid var(--border);
}

tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--bg-secondary); }

/* ─── Alerts / Notices ───────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: var(--r-sm);
  font-size: 0.88rem;
  font-weight: 600;
  border-left: 4px solid;
}

.alert-info    { background: var(--accent-sub);            color: var(--accent);  border-color: var(--accent); }
.alert-success { background: rgba(0, 184, 148, 0.1);       color: var(--success); border-color: var(--success); }
.alert-danger  { background: rgba(231, 76, 60, 0.1);       color: var(--danger);  border-color: var(--danger); }
.alert-purple  { background: var(--purple-sub);            color: #c084fc;        border-color: var(--purple); }

/* ─── Toggle Switch ──────────────────────────────── */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
}

.toggle {
  position: relative;
  width: 44px; height: 24px;
  cursor: pointer;
}

.toggle input { opacity: 0; width: 0; height: 0; }

.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--border);
  border-radius: var(--r-pill);
  transition: background 0.2s;
  border: 2px solid #000;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 14px; height: 14px;
  left: 3px; top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
}

.toggle input:checked + .toggle-slider { background: var(--accent); }
.toggle input:checked + .toggle-slider::before { transform: translateX(20px); }

/* ─── STL Dropzone ───────────────────────────────── */
.dropzone {
  border: 3px dashed var(--border);
  border-radius: var(--r-lg);
  padding: 48px 32px;
  text-align: center;
  background: var(--bg-secondary);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.dropzone:hover,
.dropzone.drag-over {
  border-color: var(--accent);
  background: var(--accent-sub);
}

.dropzone-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
  opacity: 0.5;
}

.dropzone-text {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.dropzone-sub {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 6px;
}

/* ─── Result / Slice Output ──────────────────────── */
.result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.result-metric {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-md);
  padding: 14px 16px;
  text-align: center;
}

.result-value {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--accent);
  display: block;
}

.result-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ─── Dashboard Widgets ──────────────────────────── */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 28px;
}

.widget {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-md);
  padding: 18px 20px;
}

.widget-value {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
  margin-bottom: 4px;
}

.widget-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ─── Login Page ─────────────────────────────────── */
.login-wrap {
  min-height: calc(100vh - 56px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-xl);
  padding: 36px 32px;
}

.login-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
}

.login-divider::before,
.login-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.login-divider span {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ─── Powered-By Section ─────────────────────────── */
.powered-by {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  padding: 32px;
  text-align: center;
  margin-top: 48px;
}

.powered-icons {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.powered-icon {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-secondary);
  padding: 8px 16px;
  background: var(--bg-secondary);
  border: 2px solid var(--border);
  border-radius: var(--r-sm);
}

/* ─── Components Showcase ────────────────────────── */
.component-section {
  margin-bottom: 48px;
}

.component-section-title {
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  border-bottom: 2px solid var(--border);
  padding-bottom: 8px;
  margin-bottom: 20px;
}

.swatch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
}

.swatch {
  border-radius: var(--r-sm);
  overflow: hidden;
  border: 2px solid var(--border);
}

.swatch-color {
  height: 60px;
}

.swatch-label {
  padding: 7px 10px;
  background: var(--bg-secondary);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.shadow-demo {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  align-items: flex-end;
}

.shadow-box {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--r-sm);
  padding: 16px 20px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  text-align: center;
  min-width: 90px;
}

/* ─── Responsive ─────────────────────────────────── */

/* 4 → 2 columns: sidebar still visible (content ~860px+), switch at 1100px viewport */
@media (max-width: 1100px) {
  .listing-grid   { grid-template-columns: repeat(2, 1fr); }
  .provider-grid  { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Detail sidebar stacks below 900px */
@media (max-width: 900px) {
  .detail-layout {
    grid-template-columns: 1fr;
  }
  .detail-sidebar-card {
    position: static;
  }
}

/* Sidebar goes off-canvas at 768px */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    z-index: 200;
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .sidebar-overlay.visible {
    display: block;
  }
  .mobile-nav {
    display: flex;
  }
  .main-content {
    margin-left: 0;
    padding-top: 56px;
  }
  .hero { padding: 32px 20px; }
  .page-container { padding: 20px 20px; }
  h1 { font-size: 1.8rem; }
  h2 { font-size: 1.5rem; }
}

/* 2 → 1 column on small phones */
@media (max-width: 520px) {
  .listing-grid   { grid-template-columns: 1fr; }
  .provider-grid  { grid-template-columns: 1fr; }
  .dashboard-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-row { flex-direction: column; }
  .stat-card:first-child { border-radius: var(--r-md) var(--r-md) 0 0; }
  .stat-card:last-child  { border-radius: 0 0 var(--r-md) var(--r-md); }
  .page-container { padding: 16px 16px; }
}

/* ═══════════════════════════════════════════════
   GLOBE + PROVIDER PANEL
   ═══════════════════════════════════════════════ */

/* ── Globe wrapper ───────────────────────────── */
.globe-wrap {
  position: relative;
  height: 660px;
  background: #05080f;
  border: 2px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  margin-bottom: 36px;
}

#globeViz {
  width: 100%;
  height: 100%;
}

#globeViz canvas {
  cursor: grab !important;
  display: block;
}

#globeViz canvas:active {
  cursor: grabbing !important;
}

/* ── Overlay: stat pills (top-left) ─────────── */
.globe-overlay-stats {
  position: absolute;
  top: 14px;
  left: 14px;
  display: flex;
  gap: 8px;
  z-index: 5;
  pointer-events: none;
}

.globe-stat-pill {
  background: rgba(5, 8, 16, 0.82);
  border: 1px solid rgba(255, 147, 28, 0.3);
  border-radius: var(--r-pill);
  padding: 4px 12px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-secondary);
  letter-spacing: 0.04em;
  backdrop-filter: blur(6px);
}

/* ── Overlay: drag hint (bottom-center) ─────── */
.globe-hint {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(5, 8, 16, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--r-pill);
  padding: 6px 18px;
  font-size: 0.72rem;
  color: var(--text-muted);
  pointer-events: none;
  z-index: 5;
  white-space: nowrap;
  backdrop-filter: blur(6px);
  transition: opacity 1.2s ease;
}

/* ── Provider markers ────────────────────────── */
.globe-marker {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 3px solid var(--accent);
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.95);
  cursor: pointer;
  overflow: hidden;
  background: var(--bg-card);
  /* No scale/transform transitions — globe.gl owns transform for positioning.
     Scaling the element changes its hit area and causes hover flicker. */
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
  pointer-events: all;
  user-select: none;
}

.globe-marker img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
  user-select: none;
}

.globe-marker:hover {
  border-color: #ffffff;
  box-shadow: 0 0 0 4px rgba(255, 147, 28, 0.5), 3px 3px 0 rgba(0, 0, 0, 0.95);
}

.globe-marker.active {
  border-color: #ffffff;
  box-shadow: 0 0 0 6px rgba(255, 147, 28, 0.7), 3px 3px 0 rgba(0, 0, 0, 0.95);
}

/* ── Slide-in provider panel ─────────────────── */
.provider-panel {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 316px;
  background: var(--bg-card);
  border-left: 2px solid var(--border);
  box-shadow: -8px 0 24px rgba(0, 0, 0, 0.55);
  transform: translateX(100%);
  transition: transform 0.34s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 20;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.provider-panel.open {
  transform: translateX(0);
}

.provider-panel-close {
  position: sticky;
  top: 0;
  align-self: flex-end;
  width: 30px;
  height: 30px;
  margin: 10px 10px 0 0;
  flex-shrink: 0;
  border: 2px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  z-index: 2;
}

.provider-panel-close:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #000;
}

/* ── Panel internals ─────────────────────────── */
.panel-header {
  padding: 0 16px 14px;
  display: flex;
  gap: 12px;
  align-items: center;
  border-bottom: 2px solid var(--border);
}

.panel-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.8);
  flex-shrink: 0;
  background: var(--bg-secondary);
}

.panel-header-info {
  flex: 1;
  min-width: 0;
}

.panel-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 3px;
}

.panel-nip05 {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-family: monospace;
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.panel-location {
  padding: 9px 16px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
}

.panel-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-bottom: 2px solid var(--border);
}

.panel-stat {
  padding: 11px 6px;
  text-align: center;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.panel-stat:last-child { border-right: none; }

.panel-stat-value {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
}

.panel-stat-label {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.panel-section {
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
}

.panel-section-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.panel-bio {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

.panel-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.panel-cta {
  padding: 14px 16px;
  margin-top: auto;
}

/* ── Active card in grid ─────────────────────── */
.provider-card.card-active {
  border-color: var(--accent);
  box-shadow: 6px 6px 0 rgba(0, 0, 0, 1), 0 0 0 3px rgba(255, 147, 28, 0.18);
}

/* ── Mobile overrides ────────────────────────── */
@media (max-width: 768px) {
  .globe-wrap {
    height: 360px;
    border-radius: var(--r-md);
  }

  .globe-marker {
    width: 34px;
    height: 34px;
    border-width: 2px;
  }

  /* Panel becomes a bottom sheet on mobile */
  .provider-panel {
    width: 100%;
    top: auto;
    height: 58%;
    border-left: none;
    border-top: 2px solid var(--border);
    border-radius: var(--r-lg) var(--r-lg) 0 0;
    transform: translateY(100%);
  }

  .provider-panel.open {
    transform: translateY(0);
  }

  .panel-stats { grid-template-columns: repeat(2, 1fr); }
  .panel-stat:nth-child(2) { border-right: none; }
  .panel-stat:nth-child(3) { border-top: 1px solid var(--border); }
  .panel-stat:nth-child(4) { border-top: 1px solid var(--border); border-right: none; }

  .globe-hint      { font-size: 0.65rem; padding: 5px 14px; }
  .globe-stat-pill { font-size: 0.65rem; padding: 3px 9px; }
}
