:root {
  --primary: #7c6cf0;
  --primary-dark: #5a4bc6;
  --primary-glow: rgba(124, 108, 240, 0.35);
  --accent: #ffce4d;
  --bg: #0e0f14;
  --bg-elevated: #161820;
  --card: rgba(22, 24, 32, 0.92);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text: rgba(255, 255, 255, 0.92);
  --muted: #8b90a0;
  --font: "Manrope", system-ui, -apple-system, sans-serif;
  --radius: 16px;
  --radius-sm: 12px;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }

html { -webkit-tap-highlight-color: transparent; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  min-height: 100dvh;
}

.bg-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, var(--primary-glow), transparent 55%),
    radial-gradient(ellipse 60% 40% at 100% 50%, rgba(255, 206, 77, 0.06), transparent 50%);
}

.page {
  position: relative;
  z-index: 1;
  max-width: 640px;
  margin: 0 auto;
  padding: max(16px, env(safe-area-inset-top)) 16px max(32px, env(safe-area-inset-bottom));
}

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

.header__brand { min-width: 0; }

.header__logo {
  display: block;
  height: 28px;
  width: auto;
  max-width: 160px;
}

.header__tagline {
  margin: 4px 0 0;
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 500;
}

.badge {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 6px 12px;
  border-radius: 999px;
  color: var(--accent);
  background: rgba(255, 206, 77, 0.1);
  border: 1px solid rgba(255, 206, 77, 0.25);
}

/* Cards */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.card--install { padding-bottom: 20px; }

.card--hub {
  border-color: rgba(124, 108, 240, 0.35);
}

.demo-strip {
  margin: 0 0 12px;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  background: rgba(255, 206, 77, 0.08);
  border: 1px solid rgba(255, 206, 77, 0.22);
  line-height: 1.45;
}

.demo-strip code {
  font-size: 0.75rem;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.3);
}

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

.card h2 {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.chip {
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
}

.chip--accent {
  color: var(--accent);
  background: rgba(255, 206, 77, 0.12);
}

.hero { padding: 20px 18px; }

.hero h1 {
  margin: 0 0 8px;
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.lead {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.hero__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 600;
}

.hero__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #34c759;
  box-shadow: 0 0 8px rgba(52, 199, 89, 0.6);
}

.hint {
  margin: 0 0 14px;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.5;
}

.hint code {
  font-size: 0.78rem;
  padding: 0.15rem 0.4rem;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.35);
  color: var(--primary);
}

/* Tabs */
.tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-bottom: 12px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

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

.tabs--os { margin-bottom: 10px; }

.tabs--clients { margin-bottom: 18px; }

.tab {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.tab:hover { color: var(--text); border-color: var(--border-strong); }

.tab.is-active {
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-color: transparent;
  box-shadow: 0 4px 16px var(--primary-glow);
}

.tab__icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: 0.85;
}

.tab.is-active .tab__icon { opacity: 1; }

/* Guide steps */
.steps-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.step {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 12px 14px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}

.step:last-child { border-bottom: none; padding-bottom: 0; }

.step__num {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 800;
  color: var(--primary);
  background: rgba(124, 108, 240, 0.15);
  border: 1px solid rgba(124, 108, 240, 0.25);
}

.step__body { min-width: 0; }

.step__title {
  margin: 0 0 4px;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.step__text {
  margin: 0 0 12px;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.5;
}

.step__text:last-child { margin-bottom: 0; }

.guide__cta {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Servers */
.servers {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.server {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--border);
}

.server__info {
  min-width: 0;
  flex: 1;
}

.server__name {
  display: block;
  font-size: 0.95rem;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.server__host {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.server__actions {
  display: flex;
  flex-shrink: 0;
  gap: 6px;
}

.link-row {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.link-input {
  flex: 1;
  min-width: 0;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: #0c0d11;
  color: var(--text);
  font-size: 0.75rem;
  font-family: ui-monospace, monospace;
}

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

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  text-decoration: none;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  transition: transform 0.12s, opacity 0.12s;
}

.btn:active { transform: scale(0.98); }

.btn--sm {
  padding: 8px 12px;
  font-size: 12px;
  border-radius: 10px;
}

.btn--primary {
  box-shadow: 0 6px 20px var(--primary-glow);
}

.btn--ghost {
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--border);
  box-shadow: none;
}

.btn--outline {
  background: transparent;
  border: 1px solid var(--border-strong);
  color: var(--text);
  box-shadow: none;
}

.btn--block { width: 100%; }

.btn--icon {
  padding: 12px;
  flex-shrink: 0;
}

.btn--client {
  --client-color: var(--primary);
  background: linear-gradient(135deg, var(--client-color), color-mix(in srgb, var(--client-color) 70%, #000));
}

/* Fallback */
.fallback {
  margin-top: 18px;
  padding: 14px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
}

.fallback summary {
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--muted);
  list-style: none;
  user-select: none;
}

.fallback summary::-webkit-details-marker { display: none; }

.fallback summary::after {
  content: " ›";
  opacity: 0.6;
}

.fallback[open] summary::after { content: " ∨"; }

.fallback__text {
  margin: 12px 0 12px;
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.55;
}

/* Footer */
.footer {
  margin-top: 8px;
  text-align: center;
  font-size: 0.78rem;
  color: var(--muted);
}

.footer p { margin: 0; }

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: max(24px, env(safe-area-inset-bottom));
  transform: translateX(-50%) translateY(120%);
  z-index: 100;
  padding: 12px 20px;
  border-radius: 999px;
  background: rgba(30, 32, 42, 0.96);
  border: 1px solid var(--border-strong);
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: transform 0.25s ease, opacity 0.25s ease;
  pointer-events: none;
}

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

@media (min-width: 480px) {
  .hero h1 { font-size: 1.85rem; }
  .card { padding: 20px; }
}
