:root {
  --bg: #0f172a;
  --surface: #1e293b;
  --surface-2: #162033;
  --border: rgba(148, 163, 184, 0.18);
  --text: #f8fafc;
  --muted: #94a3b8;
  --amber: #f59e0b;
  --amber-soft: rgba(245, 158, 11, 0.14);
  --teal: #14b8a6;
  --teal-soft: rgba(20, 184, 166, 0.14);
  --sky: #38bdf8;
  --sky-soft: rgba(56, 189, 248, 0.14);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif;
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

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

/* Header */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 24px;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.brand-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.65);
}

.brand-badge {
  font-size: 11px;
  font-weight: 700;
  color: var(--teal);
  background: var(--teal-soft);
  border: 1px solid rgba(20, 184, 166, 0.35);
  padding: 3px 8px;
  border-radius: 999px;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.1s ease;
}

.btn:hover { border-color: var(--teal); background: #24344d; }
.btn:active { transform: scale(0.98); }

.btn-primary {
  background: var(--amber);
  color: #0f172a;
  border-color: var(--amber);
}

.btn-primary:hover { background: #fbbf24; border-color: #fbbf24; }

.btn-teal {
  background: var(--teal);
  color: #0f172a;
  border-color: var(--teal);
}

.btn-teal:hover { background: #2dd4bf; border-color: #2dd4bf; }

/* Single shared toast stack (zero overlap rule) */
#alertToastStack {
  position: fixed;
  top: 72px;
  right: 20px;
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 320px;
  pointer-events: none;
}

.toast-item {
  pointer-events: auto;
  background: var(--surface);
  color: var(--text);
  border: 1px solid rgba(20, 184, 166, 0.45);
  border-left: 4px solid var(--teal);
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}

.toast-item.is-hidden { display: none !important; }

/* Hub Layout */
.container {
  max-width: 1160px;
  margin: 0 auto;
  padding: 36px 24px 64px;
}

.hero {
  margin-bottom: 28px;
}

.hero h1 {
  font-size: clamp(1.9rem, 4vw, 2.8rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  margin-bottom: 8px;
}

.hero p {
  color: var(--muted);
  font-size: 1rem;
  max-width: 560px;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 24px;
}

.search-input {
  flex: 1;
  min-width: 220px;
  max-width: 340px;
  min-height: 40px;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  outline: none;
}

.search-input:focus { border-color: var(--teal); }

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill {
  min-height: 36px;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  background: var(--surface);
  color: var(--muted);
  border: 1px solid var(--border);
  transition: all 0.15s ease;
}

.pill:hover { color: var(--text); border-color: var(--teal); }
.pill.active {
  background: var(--teal-soft);
  color: var(--teal);
  border-color: var(--teal);
}

.spaces-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 18px;
}

.space-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px;
  transition: border-color 0.18s ease, transform 0.18s ease;
}

.space-card.is-live:hover {
  border-color: var(--teal);
  transform: translateY(-2px);
}

.space-card.is-soon { opacity: 0.72; }

.card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.status-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  white-space: nowrap;
}

.status-live {
  color: var(--teal);
  background: var(--teal-soft);
  border: 1px solid rgba(20, 184, 166, 0.35);
}

.status-soon {
  color: var(--amber);
  background: var(--amber-soft);
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.part-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.space-card h2 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.space-card p {
  font-size: 0.92rem;
  color: #cbd5e1;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.runtime-tag {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  color: var(--muted);
}

@media (max-width: 640px) {
  .topbar { padding: 12px 16px; }
  .container { padding: 24px 16px 48px; }
  .brand-badge { display: none; }
}
