/* ═══════════════════════════════════════════════════════════════════════════
   CARMELO BOT — OBSIDIAN COSMOS & STARK WHITE (Antigravity Mobile-First v3)
   Sistema di design unificato con dashboard.html e dj.html.
   Mobile-first (320px -> 640px -> 768px -> 1024px -> 1280px), target touch >= 44px.
   ═══════════════════════════════════════════════════════════════════════════ */

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

:root {
  /* Superfici Obsidian Void & Dark Glass */
  --bg-void:        #030305;
  --bg-base:        #030305;
  --bg-surface:     rgba(11, 11, 17, 0.72);
  --bg-card:        rgba(14, 14, 21, 0.66);
  --bg-card-hover:  rgba(20, 20, 30, 0.82);
  --bg-glass-heavy: rgba(8, 8, 13, 0.88);
  --bg-elevated:    rgba(22, 22, 32, 0.88);
  --bg-hover:       rgba(255, 255, 255, 0.065);
  --bg-code:        rgba(255, 255, 255, 0.06);

  /* Bordi vetro */
  --border:         rgba(255, 255, 255, 0.09);
  --border-dim:     rgba(255, 255, 255, 0.085);
  --border-hover:   rgba(255, 255, 255, 0.22);
  --border-mid:     rgba(255, 255, 255, 0.22);
  --border-bright:  rgba(255, 255, 255, 0.48);

  /* Tipografia Stark White */
  --text-white:     #ffffff;
  --text-primary:   #f4f4f5;
  --text-secondary: #a1a1aa;
  --text-muted:     #71717a;

  /* Accenti raffinati (coerenti con telemetria & dashboard) */
  --blue:           #7dd3fc;
  --blue-faint:     rgba(125, 211, 252, 0.10);
  --blue-glow:      rgba(125, 211, 252, 0.24);
  --teal:           #5eead4;
  --green:          #4ade80;
  --gold:           #facc15;
  --purple:         #c084fc;
  --red:            #f87171;

  /* Font */
  --font-display:   'Space Grotesk', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-sans:      'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono:      'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;

  /* Raggi e spaziature */
  --radius-sm:      0.5rem;
  --radius-md:      0.875rem;
  --radius-lg:      1.25rem;
  --radius-xl:      1.5rem;
  --radius-pill:    999px;

  /* Ombre weightless */
  --shadow-float:   0 18px 48px rgba(0, 0, 0, 0.55), 0 1px 0 rgba(255, 255, 255, 0.05) inset;
  --shadow-card:    0 12px 32px rgba(0, 0, 0, 0.42);
  --shadow-pop:     0 24px 64px rgba(0, 0, 0, 0.68);

  /* Transizioni */
  --ease:           0.22s cubic-bezier(0.16, 1, 0.3, 1);
  --ease-slow:      0.45s cubic-bezier(0.16, 1, 0.3, 1);

  --nav-h:          4.25rem;
}

/* ── Tema chiaro opzionale (Porcellana & Vetro Satinato) ───────────────── */
:root.light {
  --bg-void:        #f4f5f8;
  --bg-base:        #f4f5f8;
  --bg-surface:     rgba(255, 255, 255, 0.82);
  --bg-card:        rgba(255, 255, 255, 0.78);
  --bg-card-hover:  rgba(255, 255, 255, 0.96);
  --bg-glass-heavy: rgba(255, 255, 255, 0.94);
  --bg-elevated:    #ffffff;
  --bg-hover:       rgba(15, 23, 42, 0.05);
  --bg-code:        rgba(15, 23, 42, 0.06);

  --border:         rgba(15, 23, 42, 0.10);
  --border-dim:     rgba(15, 23, 42, 0.09);
  --border-hover:   rgba(15, 23, 42, 0.24);
  --border-mid:     rgba(15, 23, 42, 0.20);
  --border-bright:  rgba(15, 23, 42, 0.40);

  --text-white:     #09090b;
  --text-primary:   #111827;
  --text-secondary: #4b5563;
  --text-muted:     #6b7280;

  --blue:           #0284c7;
  --blue-faint:     rgba(2, 132, 199, 0.09);
  --blue-glow:      rgba(2, 132, 199, 0.18);
  --teal:           #0d9488;
  --green:          #16a34a;
  --gold:           #ca8a04;
  --purple:         #7c3aed;
  --red:            #dc2626;

  --shadow-float:   0 18px 40px rgba(15, 23, 42, 0.08), 0 1px 0 rgba(255, 255, 255, 0.9) inset;
  --shadow-card:    0 10px 28px rgba(15, 23, 42, 0.06);
  --shadow-pop:     0 24px 60px rgba(15, 23, 42, 0.14);
}

/* ── Base tipografia & anti-overflow mobile ────────────────────────────── */
html {
  scroll-behavior: smooth;
  font-size: 16px;
  background-color: var(--bg-void);
  color-scheme: dark;
  overflow-x: clip;
}
:root.light { color-scheme: light; }

body {
  min-height: 100dvh;
  background-color: var(--bg-void);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
  display: flex;
  flex-direction: column;
}

main, .container { flex: 1 0 auto; }

img, svg, video { max-width: 100%; height: auto; }

a {
  color: var(--blue);
  text-decoration: none;
  transition: color var(--ease), opacity var(--ease);
}

code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--bg-code);
  border: 1px solid var(--border-dim);
  padding: 0.12em 0.42em;
  border-radius: 0.375rem;
  color: var(--text-primary);
  overflow-wrap: anywhere;
}

:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.tabular { font-variant-numeric: tabular-nums; }
.hidden { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ── Sfondo Spaziale Obsidian Cosmos (Canvas 3D + Vignette + Griglia) ──── */
#agCosmosBg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  display: block;
}

.ag-backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 70% 50% at 50% -10%, rgba(125, 211, 252, 0.085), transparent 65%),
    radial-gradient(ellipse 55% 40% at 85% 35%, rgba(192, 132, 252, 0.045), transparent 65%),
    radial-gradient(circle at 50% 50%, transparent 45%, rgba(3, 3, 5, 0.72) 100%);
}
:root.light .ag-backdrop {
  background:
    radial-gradient(ellipse 75% 45% at 50% -10%, rgba(2, 132, 199, 0.08), transparent 65%),
    radial-gradient(ellipse 55% 40% at 85% 30%, rgba(124, 58, 237, 0.05), transparent 65%);
}

.ag-grid-overlay {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.32;
  background-image: radial-gradient(rgba(255, 255, 255, 0.14) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: radial-gradient(ellipse 80% 65% at 50% 25%, #000 10%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 80% 65% at 50% 25%, #000 10%, transparent 80%);
}
:root.light .ag-grid-overlay {
  opacity: 0.25;
  background-image: radial-gradient(rgba(15, 23, 42, 0.18) 1px, transparent 1px);
}

/* ── Container Mobile-First ────────────────────────────────────────────── */
.container {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 72rem;
  margin: 0 auto;
  padding: 1.5rem 1rem 5rem;
}

.container--narrow { max-width: 58rem; }
.container--wide { max-width: 78rem; }

@media (min-width: 640px) {
  .container { padding: 2rem 1.5rem 5.5rem; }
}
@media (min-width: 1024px) {
  .container { padding: 2.5rem 2rem 6.5rem; }
}

/* ── Navbar Glass Fluttuante (Mobile-First) ────────────────────────────── */
.navbar-wrap {
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 0.625rem 0.75rem 0;
}

.navbar {
  position: sticky;
  top: 0.625rem;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: calc(100% - 1.5rem);
  max-width: 78rem;
  min-height: 3.75rem;
  margin: 0.625rem auto 0;
  padding: 0.375rem 0.75rem 0.375rem 1rem;
  background: var(--bg-glass-heavy);
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-float);
}

.navbar-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
  font-family: var(--font-display);
  font-size: 1.08rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text-white);
  text-decoration: none;
  flex-shrink: 0;
}
.navbar-logo-mark {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 0.5rem;
  background: var(--text-white);
  color: var(--bg-void);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  flex-shrink: 0;
}
.navbar-logo span { color: var(--blue); }

.navbar-links {
  display: none;
  align-items: center;
  gap: 0.125rem;
  list-style: none;
  margin: 0 auto;
}

.navbar-links a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0.375rem 0.65rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
  transition: color var(--ease), background var(--ease);
}

.navbar-links a:hover,
.navbar-links a.active {
  color: var(--text-white);
  background: var(--bg-hover);
}
.navbar-links a.active {
  color: var(--text-white);
  background: rgba(255, 255, 255, 0.11);
}
:root.light .navbar-links a.active {
  background: rgba(15, 23, 42, 0.08);
}

.navbar-actions {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  flex-shrink: 0;
}

.navbar-cta {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 44px;
  padding: 0.5rem 1.05rem;
  border-radius: var(--radius-md);
  background: var(--text-white);
  color: var(--bg-void);
  font-family: var(--font-display);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
  flex-shrink: 0;
  transition: transform var(--ease), opacity var(--ease);
}
.navbar-cta:hover { opacity: 0.9; transform: translateY(-1px); color: var(--bg-void); }
.navbar-cta:active { transform: scale(0.98); }

.theme-toggle,
.hamburger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  cursor: pointer;
  flex-shrink: 0;
  transition: color var(--ease), background var(--ease), border-color var(--ease);
}
.theme-toggle:hover,
.hamburger:hover {
  color: var(--text-white);
  background: var(--bg-hover);
  border-color: var(--border-mid);
}

.theme-toggle svg { width: 1.125rem; height: 1.125rem; }
.theme-toggle .icon-sun { display: none; }
:root.light .theme-toggle .icon-moon { display: none; }
:root.light .theme-toggle .icon-sun { display: block; }

.hamburger {
  flex-direction: column;
  gap: 5px;
}
.hamburger span {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition: transform 0.25s ease, opacity 0.2s ease;
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (min-width: 1100px) {
  .navbar { padding: 0.375rem 0.75rem 0.375rem 1.25rem; }
  .navbar-links { display: flex; }
  .navbar-cta { display: inline-flex; }
  .hamburger { display: none; }
}

/* ── Mobile Navigation Drawer (Slide-Over Touch-Friendly >= 48px) ──────── */
.mobile-backdrop {
  position: fixed;
  inset: 0;
  z-index: 55;
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.mobile-backdrop.open { opacity: 1; pointer-events: auto; }

.mobile-menu {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  width: min(86vw, 21rem);
  padding: 5.25rem 1rem 2rem;
  background: var(--bg-glass-heavy);
  backdrop-filter: blur(26px) saturate(160%);
  -webkit-backdrop-filter: blur(26px) saturate(160%);
  border-left: 1px solid var(--border);
  box-shadow: -20px 0 60px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  overflow-y: auto;
  transform: translateX(104%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.mobile-menu.open { transform: translateX(0); }

.mobile-menu a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 1rem;
  font-weight: 500;
  transition: background var(--ease), color var(--ease);
}
.mobile-menu a:hover,
.mobile-menu a.active {
  color: var(--text-white);
  background: var(--bg-hover);
}
.mobile-menu a.active {
  background: rgba(255, 255, 255, 0.11);
}
:root.light .mobile-menu a.active {
  background: rgba(15, 23, 42, 0.08);
}

.mobile-menu .mobile-cta {
  margin-top: 0.75rem;
  justify-content: center;
  gap: 0.5rem;
  background: var(--text-white);
  color: var(--bg-void);
  font-family: var(--font-display);
  font-weight: 700;
}
.mobile-menu .mobile-cta:hover { color: var(--bg-void); opacity: 0.92; }

/* ── Componenti Comuni: Pulsanti, Pillole, Card Glass, Tipografia ──────── */
.section-label, .kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 0.65rem;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.65rem, 3.8vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.12;
  color: var(--text-white);
  margin-bottom: 0.625rem;
}

.section-sub {
  font-size: 1rem;
  color: var(--text-secondary);
  max-width: 58ch;
  margin-bottom: 2rem;
}

.page-hero {
  text-align: center;
  padding: 2.25rem 0 2.5rem;
  max-width: 44rem;
  margin: 0 auto;
}
@media (min-width: 768px) {
  .page-hero { padding: 3.5rem 0 3rem; }
}
.page-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5.5vw, 3.4rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.08;
  color: var(--text-white);
  margin-bottom: 0.875rem;
}
.page-hero p {
  font-size: clamp(1rem, 2vw, 1.125rem);
  color: var(--text-secondary);
  max-width: 54ch;
  margin: 0 auto;
}

/* Pulsanti (min-height 48px touch friendly) */
.btn-primary,
.btn-secondary,
.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-height: 48px;
  padding: 0.75rem 1.4rem;
  border-radius: var(--radius-md);
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  cursor: pointer;
  text-decoration: none;
  transition: transform var(--ease), background var(--ease), border-color var(--ease), opacity var(--ease);
}

.btn-primary {
  background: var(--text-white);
  color: var(--bg-void);
  border: 1px solid transparent;
  box-shadow: 0 10px 28px rgba(255, 255, 255, 0.12);
}
:root.light .btn-primary {
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.16);
}
.btn-primary:hover {
  opacity: 0.92;
  transform: translateY(-2px);
  color: var(--bg-void);
}
.btn-primary:active { transform: scale(0.98); }

.btn-secondary,
.btn-ghost {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-mid);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.btn-secondary:hover,
.btn-ghost:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-bright);
  color: var(--text-white);
  transform: translateY(-2px);
}

.btn-disabled {
  opacity: 0.62;
  cursor: not-allowed;
  pointer-events: auto;
}
.btn-disabled:hover { transform: none; opacity: 0.62; }

.btn-badge {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.18rem 0.5rem;
  border-radius: var(--radius-pill);
  background: rgba(3, 3, 5, 0.16);
  border: 1px solid rgba(3, 3, 5, 0.22);
}

/* Superficie Glass Antigravity + 3D Tilt (solo desktop pointer fine) */
.ag-card,
.card,
.feat-card,
.feature-card,
.stat-card,
.legal-card,
.tl-card,
.dev-profile,
.step-card,
.platform-tab {
  position: relative;
  background: var(--bg-card);
  backdrop-filter: blur(16px) saturate(135%);
  -webkit-backdrop-filter: blur(16px) saturate(135%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  transition: transform var(--ease), border-color var(--ease), background var(--ease);
}

@media (hover: hover) and (pointer: fine) {
  .ag-tilt {
    transform-style: preserve-3d;
    transform: perspective(1000px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateZ(0);
  }
  .ag-tilt::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    opacity: var(--glare, 0);
    background: radial-gradient(360px circle at var(--mx, 50%) var(--my, 50%), rgba(255, 255, 255, 0.085), transparent 55%);
    transition: opacity 0.25s ease;
  }
  :root.light .ag-tilt::after {
    background: radial-gradient(360px circle at var(--mx, 50%) var(--my, 50%), rgba(2, 132, 199, 0.08), transparent 55%);
  }
  .ag-card:hover,
  .feat-card:hover,
  .feature-card:hover,
  .stat-card:hover,
  .legal-card:hover,
  .dev-profile:hover,
  .platform-tab:hover {
    border-color: var(--border-mid);
    background: var(--bg-card-hover);
  }
}

/* ── Status Telemetry Pill ─────────────────────────────────────────────── */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.4rem 0.9rem;
  border-radius: var(--radius-pill);
  background: var(--bg-card);
  border: 1px solid var(--border-mid);
  backdrop-filter: blur(14px);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--text-primary);
  margin-bottom: 1.25rem;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════════════════════
   HOME PAGE (index.html) — SPATIAL HERO + 3D ISOMETRIC PREVIEW + BENTO
   ═══════════════════════════════════════════════════════════════════════════ */
.ag-hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  align-items: center;
  padding: 2rem 0 3rem;
}
@media (min-width: 1024px) {
  .ag-hero {
    grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr);
    gap: 3rem;
    padding: 4rem 0 4.5rem;
  }
}

.ag-hero-copy {
  text-align: left;
}
.ag-hero-copy h1 {
  font-family: var(--font-display);
  font-size: clamp(2.25rem, 6vw, 4.1rem);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 1.04;
  color: var(--text-white);
  margin-bottom: 1.125rem;
}
.ag-hero-copy h1 .accent {
  color: var(--blue);
}
.ag-hero-sub {
  font-size: clamp(1rem, 2.2vw, 1.15rem);
  color: var(--text-secondary);
  max-width: 48ch;
  margin-bottom: 1.75rem;
}

.hero-cta {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.75rem;
}
@media (min-width: 480px) {
  .hero-cta {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
  }
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.375rem 0.75rem;
  border-radius: var(--radius-pill);
  background: var(--bg-card);
  border: 1px solid var(--border);
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

/* 3D Isometric Spatial Stack (Visualizzazione Dashboard 3D + Console DJ) */
.ag-spatial-stage {
  position: relative;
  min-height: 20rem;
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 1200px;
}
@media (min-width: 1024px) {
  .ag-spatial-stage { min-height: 25rem; }
}

.ag-iso-stack {
  position: relative;
  width: 100%;
  max-width: 29rem;
  transform-style: preserve-3d;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
@media (min-width: 768px) {
  .ag-iso-stack {
    transform: rotateX(10deg) rotateY(-12deg) rotateZ(1.5deg);
  }
  .ag-spatial-stage:hover .ag-iso-stack {
    transform: rotateX(5deg) rotateY(-5deg) rotateZ(0deg);
  }
}

.ag-preview-window {
  background: rgba(9, 9, 15, 0.88);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-xl);
  padding: 1.25rem;
  box-shadow: var(--shadow-pop);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
:root.light .ag-preview-window {
  background: rgba(255, 255, 255, 0.92);
}

.ag-win-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 0.875rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}
.ag-win-dots { display: flex; gap: 0.4rem; }
.ag-win-dots span {
  width: 0.55rem; height: 0.55rem; border-radius: 50%;
  background: var(--border-mid);
}
.ag-win-url {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.ag-galaxy-mock {
  position: relative;
  border-radius: var(--radius-md);
  padding: 1.25rem;
  background: radial-gradient(circle at 50% 45%, rgba(125, 211, 252, 0.16), rgba(3, 3, 5, 0.9) 70%);
  border: 1px solid var(--border);
  overflow: hidden;
  margin-bottom: 0.875rem;
}
:root.light .ag-galaxy-mock {
  background: radial-gradient(circle at 50% 45%, rgba(2, 132, 199, 0.14), rgba(15, 23, 42, 0.04) 70%);
}

.ag-orbit-ring {
  width: 7.5rem;
  height: 7.5rem;
  margin: 0.25rem auto 0.75rem;
  border-radius: 50%;
  border: 1px dashed rgba(255, 255, 255, 0.24);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  animation: agSpinSlow 24s linear infinite;
}
:root.light .ag-orbit-ring { border-color: rgba(15, 23, 42, 0.22); }
.ag-orbit-ring::before {
  content: '';
  position: absolute;
  top: -4px;
  left: 50%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 12px var(--blue);
}
.ag-orbit-core {
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #ffffff, #7dd3fc 55%, #0ea5e9 100%);
  box-shadow: 0 0 28px rgba(125, 211, 252, 0.45);
}

.ag-mock-kpis {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}
.ag-mock-kpi {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.65rem;
}
:root.light .ag-mock-kpi { background: rgba(15, 23, 42, 0.03); }
.ag-mock-kpi strong {
  display: block;
  font-family: var(--font-display);
  font-size: 0.95rem;
  color: var(--text-white);
}
.ag-mock-kpi span {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

/* Card flottante Console DJ sopra lo stack */
.ag-float-dj {
  margin-top: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 0.875rem 1rem;
  border-radius: var(--radius-lg);
  background: rgba(15, 15, 24, 0.92);
  border: 1px solid var(--border-mid);
  box-shadow: var(--shadow-float);
}
:root.light .ag-float-dj { background: #ffffff; }
@media (min-width: 768px) {
  .ag-float-dj {
    position: relative;
    margin: -1.1rem 0 0 1.5rem;
    transform: translateZ(36px);
  }
}

.ag-mini-vinyl {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  flex-shrink: 0;
  background:
    radial-gradient(circle, var(--bg-void) 0 18%, var(--blue) 19% 34%, #18181b 35% 100%);
  border: 1px solid var(--border-mid);
  animation: agSpinSlow 9s linear infinite;
}
.ag-eq-mini {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 1.25rem;
  margin-left: auto;
}
.ag-eq-mini span {
  width: 3px;
  border-radius: 2px;
  background: var(--blue);
  animation: agBarBounce 1.2s ease-in-out infinite alternate;
}
.ag-eq-mini span:nth-child(1) { height: 45%; animation-delay: 0s; }
.ag-eq-mini span:nth-child(2) { height: 90%; animation-delay: 0.18s; }
.ag-eq-mini span:nth-child(3) { height: 60%; animation-delay: 0.32s; }
.ag-eq-mini span:nth-child(4) { height: 100%; animation-delay: 0.12s; }
.ag-eq-mini span:nth-child(5) { height: 50%; animation-delay: 0.28s; }

@keyframes agSpinSlow { to { transform: rotate(360deg); } }
@keyframes agBarBounce { from { transform: scaleY(0.35); } to { transform: scaleY(1); } }

/* Live Telemetry Strip (2x2 mobile -> 4-col desktop) */
.stats-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin: 0 0 4rem;
}
@media (min-width: 768px) {
  .stats-row {
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
  }
}
.stat-item {
  padding: 1.25rem 1rem;
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  border: 1px solid var(--border);
  backdrop-filter: blur(14px);
  text-align: center;
}
.stat-num {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3.5vw, 2.15rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  color: var(--text-white);
  font-variant-numeric: tabular-nums;
}
.stat-lbl {
  display: block;
  margin-top: 0.25rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* Bento Feature Grid (Mobile 1col -> Tablet 2col -> Desktop 3col asimmetrico) */
.bento-grid,
.features-grid,
.feature-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-bottom: 4.5rem;
}
@media (min-width: 640px) {
  .bento-grid,
  .features-grid,
  .feature-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (min-width: 1024px) {
  .bento-grid,
  .features-grid,
  .feature-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.125rem;
  }
  .bento-span-2 { grid-column: span 2; }
}

.feat-card,
.feature-card {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.feat-icon,
.feature-icon {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--feat-color, var(--blue));
  font-size: 1.25rem;
  flex-shrink: 0;
}
:root.light .feat-icon,
:root.light .feature-icon { background: rgba(15, 23, 42, 0.04); }

.feat-title,
.feature-card h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-white);
}
.feat-desc,
.feature-card p {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.58;
  flex: 1;
}
.feat-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.35rem;
}
.feat-tag {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 0.22rem 0.55rem;
  border-radius: var(--radius-sm);
  background: var(--bg-code);
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

/* Ecosystem Split Showcase (Dashboard 3D + Console DJ) */
.eco-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-bottom: 4.5rem;
}
@media (min-width: 768px) {
  .eco-grid { grid-template-columns: repeat(2, 1fr); gap: 1.25rem; }
}
.eco-card {
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}
.eco-card h3 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text-white);
}
.eco-card p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  flex: 1;
}

/* Updates / News List */
.updates-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}
.update-row {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1.125rem 1.25rem;
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  transition: border-color var(--ease), transform var(--ease), background var(--ease);
}
@media (min-width: 640px) {
  .update-row { flex-direction: row; align-items: center; gap: 1rem; }
}
.update-row:hover {
  border-color: var(--border-mid);
  background: var(--bg-card-hover);
  transform: translateX(3px);
  color: var(--text-primary);
}
.update-ver {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--bg-void);
  background: var(--text-white);
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}
.update-text { flex: 1; font-size: 0.95rem; }
.update-date { font-family: var(--font-mono); font-size: 0.78rem; color: var(--text-muted); flex-shrink: 0; }

/* FAQ Accordion */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-bottom: 4.5rem;
}
.faq-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  backdrop-filter: blur(14px);
}
.faq-item[open] { border-color: var(--border-mid); }
.faq-q {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 54px;
  padding: 1rem 1.25rem;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-white);
  cursor: pointer;
  list-style: none;
}
.faq-q::-webkit-details-marker { display: none; }
.faq-chevron {
  width: 1.15rem;
  height: 1.15rem;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: transform 0.25s ease;
}
.faq-item[open] .faq-chevron { transform: rotate(180deg); color: var(--text-white); }
.faq-a {
  padding: 0 1.25rem 1.25rem;
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.65;
  max-width: 68ch;
}

/* CTA Strip & Devs */
.cta-strip {
  position: relative;
  padding: 2.5rem 1.5rem;
  border-radius: var(--radius-xl);
  background:
    radial-gradient(ellipse 80% 90% at 50% 0%, rgba(125, 211, 252, 0.10), transparent 70%),
    var(--bg-card);
  border: 1px solid var(--border-mid);
  text-align: center;
  margin-bottom: 3rem;
  box-shadow: var(--shadow-float);
}
@media (min-width: 768px) {
  .cta-strip { padding: 3.5rem 2.5rem; }
}
.cta-strip h2 {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3.8vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  color: var(--text-white);
  margin-bottom: 0.75rem;
}
.cta-strip p {
  color: var(--text-secondary);
  font-size: 1rem;
  max-width: 50ch;
  margin: 0 auto 1.5rem;
}

.devs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.875rem;
  margin-bottom: 3.5rem;
}
.dev-card {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 1.1rem;
  border-radius: var(--radius-pill);
  background: var(--bg-card);
  border: 1px solid var(--border);
}
.dev-avatar {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
}
.dev-name { font-family: var(--font-display); font-weight: 700; font-size: 0.95rem; color: var(--text-white); }
.dev-role { font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-muted); }

/* ═══════════════════════════════════════════════════════════════════════════
   STATS PAGE (stats.html) — SPATIAL TELEMETRY CONSOLE
   ═══════════════════════════════════════════════════════════════════════════ */
.status-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.25rem;
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  border: 1px solid var(--border-mid);
  backdrop-filter: blur(16px);
  margin-bottom: 1.5rem;
}
@media (min-width: 640px) {
  .status-section { flex-direction: row; align-items: center; justify-content: space-between; padding: 1.25rem 1.5rem; }
}
.status-left { display: flex; align-items: center; gap: 0.875rem; }
.status-indicator {
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 12px rgba(74, 222, 128, 0.55);
  flex-shrink: 0;
}
.status-indicator.offline { background: var(--red); box-shadow: 0 0 12px rgba(248, 113, 113, 0.45); }
.status-text span { display: block; font-family: var(--font-display); font-weight: 700; color: var(--text-white); }
.status-text small { display: block; font-family: var(--font-mono); font-size: 0.78rem; color: var(--text-muted); word-break: break-all; }
.status-right { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; }
.status-right > span { font-family: var(--font-mono); font-size: 0.8rem; color: var(--text-muted); }

.refresh-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 44px;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  border: 1px solid var(--border-mid);
  color: var(--text-white);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  cursor: pointer;
  transition: border-color var(--ease), background var(--ease);
}
.refresh-btn:hover { border-color: var(--border-bright); background: var(--bg-hover); }

.stats-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}
@media (min-width: 640px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
  .stats-grid { grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
}

.stat-card {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.stat-icon {
  width: 2.5rem; height: 2.5rem; border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 1.15rem; margin-bottom: 0.35rem;
}
.stat-value {
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 4vw, 2.4rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  color: var(--text-white);
  font-variant-numeric: tabular-nums;
  min-height: 2.6rem;
}
.stat-value.loading {
  border-radius: var(--radius-sm);
  background: linear-gradient(90deg, rgba(255,255,255,0.04), rgba(255,255,255,0.11), rgba(255,255,255,0.04));
  background-size: 200% 100%;
  animation: agShimmer 1.4s infinite;
}
.stat-label { font-family: var(--font-mono); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); }
.stat-sub { font-size: 0.875rem; color: var(--text-secondary); }
.latency-bar-wrap {
  width: 100%; height: 6px; border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.08); overflow: hidden; margin-top: 0.5rem;
}
.latency-bar { height: 100%; width: 0%; border-radius: var(--radius-pill); transition: width 0.5s ease; }

@keyframes agShimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
@keyframes spin { to { transform: rotate(360deg); } }

/* ═══════════════════════════════════════════════════════════════════════════
   COMMANDS PAGE (commands.html) — MOBILE CARD REFLOW + MODAL SHEET
   ═══════════════════════════════════════════════════════════════════════════ */
.search-wrap {
  position: relative;
  max-width: 36rem;
  margin: 0 auto 1.25rem;
}
.search-wrap svg {
  position: absolute; left: 1rem; top: 50%; transform: translateY(-50%);
  width: 1.15rem; height: 1.15rem; color: var(--text-muted); pointer-events: none;
}
#cmd-search, .search-input {
  width: 100%;
  min-height: 48px;
  padding: 0.75rem 1rem 0.75rem 2.85rem;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border-mid);
  color: var(--text-white);
  font-family: var(--font-sans);
  font-size: 1rem;
  backdrop-filter: blur(14px);
}
#cmd-search::placeholder { color: var(--text-muted); }
#cmd-search:focus { border-color: var(--blue); outline: none; }

.cat-pills {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding: 0.25rem 0 0.75rem;
  margin-bottom: 1.5rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.cat-pills::-webkit-scrollbar { display: none; }
@media (min-width: 1024px) {
  .cat-pills { flex-wrap: wrap; justify-content: center; overflow-x: visible; }
}

.cat-pill, .cl-filter {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 44px;
  padding: 0.5rem 0.95rem;
  border-radius: var(--radius-pill);
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  flex-shrink: 0;
  transition: background var(--ease), color var(--ease), border-color var(--ease);
}
.cat-pill:hover, .cl-filter:hover { color: var(--text-white); border-color: var(--border-mid); }
.cat-pill.active, .cl-filter.active {
  background: var(--text-white);
  color: var(--bg-void);
  border-color: var(--text-white);
  font-weight: 600;
}

.cat-block { margin-bottom: 2.5rem; }
.cat-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.875rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--border);
}
.cat-header h2, .cat-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-white);
}
.cat-count {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-pill);
  background: var(--bg-card);
  border: 1px solid var(--border);
}

/* Tabella comandi: Card stack su mobile (<768px), Tabella glass su desktop */
table.cmd-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}
table.cmd-table thead { display: none; }
table.cmd-table tbody {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
table.cmd-table tbody tr {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.35rem 0.75rem;
  padding: 1rem;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: border-color var(--ease), background var(--ease);
}
table.cmd-table tbody tr:hover {
  border-color: var(--border-mid);
  background: var(--bg-card-hover);
}
table.cmd-table td {
  display: block;
  border: none;
  padding: 0;
  vertical-align: middle;
}
table.cmd-table td:nth-child(1) { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
table.cmd-table td:nth-child(2) { grid-column: 1 / -1; color: var(--text-secondary); font-size: 0.9375rem; }
table.cmd-table td:nth-child(3) { grid-column: 1 / -1; }

@media (min-width: 768px) {
  table.cmd-table {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    backdrop-filter: blur(14px);
  }
  table.cmd-table thead { display: table-header-group; }
  table.cmd-table th {
    text-align: left;
    padding: 0.875rem 1.15rem;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.02);
  }
  table.cmd-table tbody { display: table-row-group; }
  table.cmd-table tbody tr {
    display: table-row;
    border-radius: 0;
    border: none;
    background: transparent;
  }
  table.cmd-table tbody tr:hover { background: var(--bg-hover); }
  table.cmd-table td {
    display: table-cell;
    padding: 0.875rem 1.15rem;
    border-bottom: 1px solid var(--border-dim);
  }
  table.cmd-table tbody tr:last-child td { border-bottom: none; }
  table.cmd-table td:nth-child(1) { display: table-cell; white-space: nowrap; }
}

.cmd-name {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--cat-color, var(--blue));
}
.cmd-name-wrap { display: inline-flex; align-items: center; gap: 0.5rem; }

.copy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  min-height: 38px;
  padding: 0.35rem;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  transition: color var(--ease), border-color var(--ease), background var(--ease);
}
.copy-btn:hover { color: var(--text-white); border-color: var(--border-mid); background: var(--bg-hover); }
.copy-btn.copied { color: var(--green); border-color: var(--green); }

.badge, .perm-badge, .cmd-panel-badge {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.18rem 0.55rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  color: var(--text-secondary);
}
.badge.admin, .perm-badge.admin, .cmd-panel-badge.admin { color: var(--red); border-color: rgba(248, 113, 113, 0.35); background: rgba(248, 113, 113, 0.1); }
.badge.mod, .perm-badge.mod, .cmd-panel-badge.mod { color: var(--gold); border-color: rgba(250, 204, 21, 0.35); background: rgba(250, 204, 21, 0.1); }
.badge.dev, .perm-badge.dev, .cmd-panel-badge.dev { color: var(--purple); border-color: rgba(192, 132, 252, 0.35); background: rgba(192, 132, 252, 0.1); }

#no-results, .cl-no-results {
  display: none;
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--text-muted);
  font-size: 1rem;
}

/* Command Detail Modal (Bottom-sheet su mobile, centrato su desktop) */
.cmd-panel-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}
@media (min-width: 640px) {
  .cmd-panel-overlay { align-items: center; padding: 1.5rem; }
}
.cmd-panel-overlay.open { opacity: 1; pointer-events: auto; }

.cmd-panel {
  position: relative;
  width: 100%;
  max-width: 32rem;
  max-height: 88dvh;
  overflow-y: auto;
  padding: 1.5rem;
  background: var(--bg-glass-heavy);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  box-shadow: var(--shadow-pop);
  transform: translateY(20px);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}
@media (min-width: 640px) {
  .cmd-panel { border-radius: var(--radius-xl); padding: 1.75rem; }
}
.cmd-panel-overlay.open .cmd-panel { transform: translateY(0); }

.cmd-panel-close, .platform-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border-mid);
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.cmd-panel-close:hover, .platform-modal-close:hover { background: var(--bg-hover); color: var(--text-white); }
.cmd-panel-name { font-family: var(--font-mono); font-size: 1.35rem; font-weight: 700; color: var(--panel-color, var(--blue)); padding-right: 3rem; margin-bottom: 0.4rem; }
.cmd-panel-desc { color: var(--text-secondary); margin: 0.75rem 0 1.25rem; }
.cmd-panel-label { font-family: var(--font-mono); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); margin-bottom: 0.4rem; }
.cmd-panel-code { font-family: var(--font-mono); font-size: 0.9rem; background: var(--bg-code); border: 1px solid var(--border); padding: 0.75rem 1rem; border-radius: var(--radius-md); margin-bottom: 1rem; overflow-x: auto; }
.cmd-panel-meta { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.25rem; }
.cmd-panel-chip { font-family: var(--font-mono); font-size: 0.8rem; padding: 0.3rem 0.65rem; border-radius: var(--radius-pill); background: var(--bg-code); border: 1px solid var(--border); }
.cmd-panel-copy {
  width: 100%; min-height: 48px; border-radius: var(--radius-md); border: none;
  background: var(--text-white); color: var(--bg-void);
  font-family: var(--font-display); font-weight: 700; font-size: 0.95rem; cursor: pointer;
}
.cmd-panel-copy.copied { background: var(--green); color: #03140b; }

/* ═══════════════════════════════════════════════════════════════════════════
   GUIDE PAGE (guide.html) — AUDIO LAB & PIATTAFORME MUSICALI
   ═══════════════════════════════════════════════════════════════════════════ */
.platform-tabs, .platforms-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.875rem;
  margin-bottom: 3rem;
}
@media (min-width: 640px) {
  .platform-tabs, .platforms-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
  .platform-tabs, .platforms-grid { grid-template-columns: repeat(5, 1fr); }
}
.platform-tab {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.875rem;
  padding: 1rem 1.15rem;
  text-align: left;
  cursor: pointer;
  color: var(--text-primary);
  min-height: 68px;
}
@media (min-width: 1024px) {
  .platform-tab { flex-direction: column; text-align: center; justify-content: center; padding: 1.35rem 1rem; }
}
.platform-tab img { width: 2.5rem; height: 2.5rem; object-fit: contain; border-radius: 0.5rem; flex-shrink: 0; }
.platform-tab-name { font-family: var(--font-display); font-weight: 700; font-size: 1rem; color: var(--text-white); }
.platform-tab-sub { font-size: 0.8125rem; color: var(--text-muted); }

/* Platform Full-Screen Glass Modal */
.platform-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(3, 3, 5, 0.82);
  backdrop-filter: blur(14px);
  overflow-y: auto;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
@media (min-width: 768px) { .platform-overlay { padding: 2.5rem 1.5rem; } }
.platform-overlay.open { opacity: 1; pointer-events: auto; }
.platform-modal-close { position: fixed; top: 1rem; right: 1rem; z-index: 90; }

.platform-modal {
  position: relative;
  max-width: 50rem;
  margin: 2.5rem auto 2rem;
  padding: 1.5rem;
  border-radius: var(--radius-xl);
  background: var(--bg-glass-heavy);
  border: 1px solid var(--border-mid);
  box-shadow: var(--shadow-pop);
}
@media (min-width: 768px) { .platform-modal { padding: 2.25rem; } }
.platform-panel-content { display: none; }
.platform-panel-content.active { display: block; }

.pf-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  padding-bottom: 1.25rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}
.pf-header-icon img { width: 3rem; height: 3rem; object-fit: contain; border-radius: 0.75rem; }
.pf-header-text { flex: 1; min-width: 12rem; }
.pf-header-text h2 { font-family: var(--font-display); font-size: 1.6rem; color: var(--text-white); }
.pf-header-text p { color: var(--text-secondary); font-size: 0.95rem; }
.pf-header-link {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0.5rem 0.95rem;
  border-radius: var(--radius-md); background: var(--bg-code); border: 1px solid var(--border-mid);
  font-family: var(--font-mono); font-size: 0.875rem; color: var(--text-white);
}

/* Listen Web Audio Player (preserva classi config.js!) */
.listen-inline { margin-bottom: 1.75rem; }
.listen-label { font-family: var(--font-mono); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); margin-bottom: 0.6rem; }
.listen-card {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-mid);
  overflow: hidden;
}
:root.light .listen-card { background: rgba(15, 23, 42, 0.03); }
.listen-info { flex: 1 1 9rem; min-width: 0; }
.listen-title { font-family: var(--font-display); font-weight: 700; color: var(--text-white); font-size: 1rem; }
.listen-artist { font-size: 0.85rem; color: var(--text-muted); }
.fx-control { flex: 0 1 auto; }
.fx-select {
  min-height: 44px;
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  border: 1px solid var(--border-mid);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.875rem;
}
.volume-control { display: flex; align-items: center; gap: 0.45rem; }
.volume-btn {
  width: 44px; height: 44px; border-radius: var(--radius-md);
  background: transparent; border: 1px solid var(--border); color: var(--text-secondary);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}
.volume-slider { width: 5.5rem; accent-color: var(--pcolor, var(--blue)); cursor: pointer; }
.listen-play {
  width: 48px; height: 48px; border-radius: 50%; border: none;
  background: var(--text-white); color: var(--bg-void);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0;
}
.listen-play.playing .icon-play { display: none; }
.listen-play.playing .icon-pause { display: block !important; }
.listen-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255, 255, 255, 0.08); }
.listen-progress-bar { height: 100%; width: 0%; background: var(--pcolor, var(--blue)); transition: width 0.1s linear; }

.pf-section { margin-bottom: 1.5rem; }
.pf-section-title { font-family: var(--font-display); font-size: 1.05rem; font-weight: 700; color: var(--text-white); margin-bottom: 0.65rem; }
.pf-section-body { color: var(--text-secondary); font-size: 0.95rem; }
.pf-section-body ul { padding-left: 1.25rem; display: flex; flex-direction: column; gap: 0.45rem; margin-bottom: 0.75rem; }
.pf-example {
  border-radius: var(--radius-md); background: var(--bg-code); border: 1px solid var(--border);
  padding: 0.9rem 1rem; margin-bottom: 0.75rem; display: flex; flex-direction: column; gap: 0.5rem;
}
.pf-example-label {
  display: inline-block; font-family: var(--font-mono); font-size: 0.72rem; text-transform: uppercase;
  color: var(--blue); margin-right: 0.5rem;
}
.pf-error {
  border-radius: var(--radius-md); background: rgba(248, 113, 113, 0.07);
  border: 1px solid rgba(248, 113, 113, 0.25); padding: 0.9rem 1rem; margin-bottom: 0.75rem;
}
.pf-error-msg { font-family: var(--font-mono); font-size: 0.875rem; color: var(--red); margin-bottom: 0.35rem; }

.effects-grid, .overview-grid, .trouble-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.875rem;
  margin-bottom: 3rem;
}
@media (min-width: 640px) {
  .effects-grid, .overview-grid, .trouble-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
  .effects-grid { grid-template-columns: repeat(3, 1fr); }
  .overview-grid { grid-template-columns: repeat(3, 1fr); }
}
.effect-card, .overview-card, .trouble-card {
  padding: 1.25rem;
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  border: 1px solid var(--border);
  backdrop-filter: blur(14px);
}
.effect-card h3, .overview-card h3, .trouble-card h3 {
  font-family: var(--font-display); font-size: 1.05rem; color: var(--text-white); margin-bottom: 0.35rem;
}
.effect-card p, .overview-card p, .trouble-card p { font-size: 0.92rem; color: var(--text-secondary); }

/* ═══════════════════════════════════════════════════════════════════════════
   SETUP & INVITE PAGES (setup.html, invite.html)
   ═══════════════════════════════════════════════════════════════════════════ */
.inv-hero { text-align: center; padding: 2.25rem 0 2.5rem; max-width: 46rem; margin: 0 auto; }
.inv-hero h1 { font-family: var(--font-display); font-size: clamp(2rem, 5.5vw, 3.35rem); font-weight: 700; letter-spacing: -0.04em; line-height: 1.08; color: var(--text-white); margin-bottom: 1rem; }
.inv-hero p { font-size: 1.0625rem; color: var(--text-secondary); max-width: 54ch; margin: 0 auto 1.75rem; }
.inv-cta-row { display: flex; flex-direction: column; gap: 0.75rem; justify-content: center; margin-bottom: 2.25rem; }
@media (min-width: 480px) { .inv-cta-row { flex-direction: row; flex-wrap: wrap; } }
.inv-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
@media (min-width: 640px) { .inv-stats { grid-template-columns: repeat(4, 1fr); } }
.inv-stat { padding: 1.125rem; border-radius: var(--radius-lg); background: var(--bg-card); border: 1px solid var(--border); }
.inv-stat-num { font-family: var(--font-display); font-size: 1.65rem; font-weight: 700; color: var(--text-white); }
.inv-stat-lbl { font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; }

.inv-section, .setup-section { margin-bottom: 3.5rem; }
.inv-section-head { margin-bottom: 1.5rem; }
.inv-section-head h2 { font-family: var(--font-display); font-size: clamp(1.5rem, 3.5vw, 2.1rem); color: var(--text-white); letter-spacing: -0.03em; margin-bottom: 0.4rem; }
.inv-section-head p { color: var(--text-secondary); max-width: 58ch; }

.perm-grid, .permissions-grid {
  display: grid; grid-template-columns: 1fr; gap: 0.75rem;
}
@media (min-width: 640px) { .perm-grid, .permissions-grid { grid-template-columns: repeat(2, 1fr); } }
.perm-row, .perm-item {
  display: flex; align-items: flex-start; gap: 0.875rem; padding: 1.125rem;
  border-radius: var(--radius-lg); background: var(--bg-card); border: 1px solid var(--border);
}
.perm-icon {
  width: 2.5rem; height: 2.5rem; border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.05); border: 1px solid var(--border);
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.perm-row h4, .perm-item-title { font-family: var(--font-display); font-weight: 700; font-size: 1rem; color: var(--text-white); margin-bottom: 0.2rem; }
.perm-row p, .perm-item-why { font-size: 0.9rem; color: var(--text-secondary); }

.setup-list, .step-list { display: flex; flex-direction: column; gap: 0.875rem; }
.setup-row, .step-card {
  display: flex; align-items: flex-start; gap: 1rem; padding: 1.25rem;
}
.setup-num, .step-num-badge {
  width: 2.25rem; height: 2.25rem; border-radius: 50%;
  background: var(--text-white); color: var(--bg-void);
  font-family: var(--font-display); font-weight: 700; font-size: 0.95rem;
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.setup-content h4, .step-title { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; color: var(--text-white); margin-bottom: 0.35rem; display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.setup-content p, .step-desc { font-size: 0.95rem; color: var(--text-secondary); }
.step-cmd {
  font-family: var(--font-mono); font-size: 0.82rem; font-weight: 600;
  padding: 0.22rem 0.6rem; border-radius: var(--radius-sm);
  background: var(--blue-faint); border: 1px solid rgba(125, 211, 252, 0.28); color: var(--blue);
  cursor: pointer;
}
.step-badge, .setup-tag {
  display: inline-block; margin-top: 0.5rem; font-family: var(--font-mono); font-size: 0.72rem;
  padding: 0.16rem 0.55rem; border-radius: var(--radius-pill);
  border: 1px solid var(--border-mid); color: var(--text-muted);
}
.setup-section-header { display: flex; align-items: center; gap: 0.875rem; margin-bottom: 1.25rem; }
.setup-icon {
  width: 3rem; height: 3rem; border-radius: var(--radius-md);
  background: var(--bg-card); border: 1px solid var(--border-mid);
  display: inline-flex; align-items: center; justify-content: center; font-size: 1.35rem; flex-shrink: 0;
}
.setup-section-header h2 { font-family: var(--font-display); font-size: 1.4rem; color: var(--text-white); }
.setup-section-header p { color: var(--text-secondary); font-size: 0.95rem; }
.first-step {
  display: flex; align-items: flex-start; gap: 1rem; padding: 1.25rem 1.4rem;
  border-radius: var(--radius-lg); background: var(--blue-faint); border: 1px solid rgba(125, 211, 252, 0.28);
  margin: 1.5rem 0 3rem;
}
.first-step h3 { font-family: var(--font-display); font-size: 1.08rem; color: var(--text-white); margin-bottom: 0.25rem; }
.first-step p { color: var(--text-secondary); font-size: 0.95rem; }

/* ═══════════════════════════════════════════════════════════════════════════
   CHANGELOG PAGE (changelog.html)
   ═══════════════════════════════════════════════════════════════════════════ */
.cl-filters {
  display: flex; gap: 0.5rem; overflow-x: auto; padding-bottom: 0.5rem; margin-bottom: 2rem;
  -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.cl-filters::-webkit-scrollbar { display: none; }
@media (min-width: 768px) { .cl-filters { justify-content: center; flex-wrap: wrap; } }

.timeline { position: relative; display: flex; flex-direction: column; gap: 1.125rem; padding-left: 1.5rem; }
.timeline::before {
  content: ''; position: absolute; left: 0.42rem; top: 0.5rem; bottom: 0.5rem;
  width: 2px; background: var(--border);
}
.tl-entry { position: relative; }
.tl-dot {
  position: absolute; left: -1.42rem; top: 1.5rem;
  width: 0.72rem; height: 0.72rem; border-radius: 50%;
  background: var(--text-muted); border: 2px solid var(--bg-void);
}
.tl-dot.latest { background: var(--blue); box-shadow: 0 0 12px var(--blue); }
.tl-card { padding: 1.35rem 1.45rem; }
.tl-header { display: flex; flex-wrap: wrap; align-items: center; gap: 0.65rem; margin-bottom: 1rem; }
.tl-version {
  font-family: var(--font-mono); font-size: 0.9rem; font-weight: 700;
  padding: 0.22rem 0.65rem; border-radius: var(--radius-sm);
  background: var(--text-white); color: var(--bg-void);
}
.tl-badge-latest {
  font-family: var(--font-mono); font-size: 0.72rem; font-weight: 600;
  padding: 0.2rem 0.6rem; border-radius: var(--radius-pill);
  background: var(--blue-faint); color: var(--blue); border: 1px solid rgba(125, 211, 252, 0.3);
}
.tl-date { margin-left: auto; font-family: var(--font-mono); font-size: 0.8rem; color: var(--text-muted); }
.change-group { margin-bottom: 0.9rem; }
.change-group:last-child { margin-bottom: 0; }
.change-type {
  display: inline-block; font-family: var(--font-mono); font-size: 0.74rem; font-weight: 600;
  padding: 0.16rem 0.55rem; border-radius: var(--radius-sm); margin-bottom: 0.5rem;
}
.type-new { background: rgba(74, 222, 128, 0.12); color: var(--green); }
.type-change { background: rgba(125, 211, 252, 0.12); color: var(--blue); }
.type-fix { background: rgba(250, 204, 21, 0.12); color: var(--gold); }
.type-remove { background: rgba(248, 113, 113, 0.12); color: var(--red); }
.change-list { padding-left: 1.25rem; display: flex; flex-direction: column; gap: 0.45rem; color: var(--text-secondary); font-size: 0.95rem; }

/* ═══════════════════════════════════════════════════════════════════════════
   ABOUT & CREDITS (about.html, credits.html)
   ═══════════════════════════════════════════════════════════════════════════ */
.about-hero { text-align: center; padding: 2.25rem 0 2.5rem; max-width: 44rem; margin: 0 auto; }
.about-hero h1 { font-family: var(--font-display); font-size: clamp(2rem, 5vw, 3.1rem); color: var(--text-white); letter-spacing: -0.04em; line-height: 1.1; margin-bottom: 1rem; }
.about-hero p { color: var(--text-secondary); font-size: 1.05rem; }
.story-section { margin-bottom: 3rem; max-width: 65ch; margin-left: auto; margin-right: auto; }
.story-section h2 { font-family: var(--font-display); font-size: 1.65rem; color: var(--text-white); letter-spacing: -0.03em; margin-bottom: 1rem; }
.story-section p { color: var(--text-secondary); margin-bottom: 1rem; line-height: 1.72; }
.devs-grid, .credits-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; margin-top: 1.25rem; }
@media (min-width: 640px) { .devs-grid, .credits-grid { grid-template-columns: repeat(2, 1fr); } }
.dev-profile { padding: 1.5rem; }
.dev-avatar-big { width: 3.25rem; height: 3.25rem; border-radius: var(--radius-md); background: rgba(255,255,255,0.06); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; font-size: 1.6rem; margin-bottom: 0.875rem; }
.dev-profile h3 { font-family: var(--font-display); font-size: 1.2rem; color: var(--text-white); }
.dev-profile .role { font-family: var(--font-mono); font-size: 0.78rem; color: var(--blue); margin: 0.2rem 0 0.75rem; }
.mini-timeline { display: flex; flex-direction: column; gap: 0.875rem; margin-top: 1.5rem; }
.mini-tl-entry { padding: 1.125rem 1.25rem; border-radius: var(--radius-lg); background: var(--bg-card); border: 1px solid var(--border); }
.mini-tl-entry.highlight { border-color: var(--border-mid); }
.mini-tl-date { font-family: var(--font-mono); font-size: 0.75rem; color: var(--blue); margin-bottom: 0.25rem; }
.mini-tl-title { font-family: var(--font-display); font-weight: 700; color: var(--text-white); margin-bottom: 0.25rem; }
.mini-tl-desc { font-size: 0.93rem; color: var(--text-secondary); }

/* ═══════════════════════════════════════════════════════════════════════════
   LEGAL HUB, EULA & PRIVACY (legal.html, eula.html, privacy.html)
   ═══════════════════════════════════════════════════════════════════════════ */
.legal-hub { position: relative; z-index: 2; max-width: 56rem; width: 100%; margin: 0 auto; padding: 2rem 1rem 5rem; }
@media (min-width: 768px) { .legal-hub { padding: 3.5rem 2rem 6rem; } }
.legal-hub-header { text-align: center; margin-bottom: 2.5rem; }
.legal-hub-header h1 { font-family: var(--font-display); font-size: clamp(2rem, 5vw, 3.2rem); color: var(--text-white); letter-spacing: -0.04em; margin-bottom: 0.75rem; }
.legal-hub-header p { color: var(--text-secondary); max-width: 54ch; margin: 0 auto; }

.legal-cards { display: grid; grid-template-columns: 1fr; gap: 1rem; margin-bottom: 2.5rem; }
@media (min-width: 640px) { .legal-cards { grid-template-columns: repeat(2, 1fr); gap: 1.25rem; } }
.legal-card { padding: 1.75rem; display: flex; flex-direction: column; gap: 0.55rem; color: var(--text-primary); }
.legal-card-icon { width: 2.75rem; height: 2.75rem; border-radius: var(--radius-md); background: rgba(255,255,255,0.05); border: 1px solid var(--border); display: inline-flex; align-items: center; justify-content: center; font-size: 1.3rem; margin-bottom: 0.35rem; }
.legal-card h2 { font-family: var(--font-display); font-size: 1.45rem; color: var(--text-white); }
.card-subtitle { font-family: var(--font-mono); font-size: 0.78rem; color: var(--blue); text-transform: uppercase; letter-spacing: 0.06em; }
.legal-card p { font-size: 0.95rem; color: var(--text-secondary); flex: 1; }
.legal-card-meta { display: flex; align-items: center; justify-content: space-between; padding-top: 1rem; margin-top: 0.5rem; border-top: 1px solid var(--border); font-family: var(--font-mono); font-size: 0.8rem; color: var(--text-muted); }
.legal-card-arrow { color: var(--text-white); font-weight: 600; }

.legal-contacts {
  padding: 2rem 1.5rem; border-radius: var(--radius-xl); background: var(--bg-card);
  border: 1px solid var(--border-mid); text-align: center; margin-bottom: 2rem;
}
.legal-contacts h3 { font-family: var(--font-display); font-size: 1.35rem; color: var(--text-white); margin: 0.5rem 0; }
.legal-contacts p { color: var(--text-secondary); max-width: 48ch; margin: 0 auto 1.25rem; }
.contact-emails { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.75rem; }
.email-pill {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0.55rem 1.1rem;
  border-radius: var(--radius-pill); background: var(--bg-elevated); border: 1px solid var(--border-mid);
  font-family: var(--font-mono); font-size: 0.875rem; color: var(--text-white);
}
.email-pill:hover { border-color: var(--blue); color: var(--blue); }
.legal-hub-footer { text-align: center; font-size: 0.85rem; color: var(--text-muted); }

/* Document Layout (eula.html, privacy.html) — Collapsible TOC mobile -> Sticky Sidebar desktop */
.legal-layout { display: grid; grid-template-columns: 1fr; gap: 1.5rem; align-items: start; }
@media (min-width: 1024px) {
  .legal-layout { grid-template-columns: 16.5rem minmax(0, 1fr); gap: 2.25rem; }
}
.legal-sidebar {
  padding: 1.15rem; border-radius: var(--radius-lg); background: var(--bg-card);
  border: 1px solid var(--border); backdrop-filter: blur(14px);
}
@media (min-width: 1024px) {
  .legal-sidebar { position: sticky; top: 5.5rem; max-height: calc(100dvh - 7rem); overflow-y: auto; }
}
.sidebar-label { font-family: var(--font-mono); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--blue); margin-bottom: 0.75rem; }
.sidebar-nav { list-style: none; display: flex; flex-direction: column; gap: 0.2rem; }
.sidebar-nav a {
  display: flex; align-items: center; min-height: 40px; padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm); font-size: 0.875rem; color: var(--text-secondary);
}
.sidebar-nav a:hover, .sidebar-nav a.active { background: var(--bg-hover); color: var(--text-white); }
.sidebar-divider { height: 1px; background: var(--border); margin: 0.65rem 0; }

.legal-section-header { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; margin-bottom: 1.25rem; }
.legal-section-header h2 { font-family: var(--font-display); font-size: clamp(1.5rem, 3.8vw, 2.2rem); color: var(--text-white); letter-spacing: -0.03em; }
.legal-section-header .updated { margin-left: auto; font-family: var(--font-mono); font-size: 0.78rem; color: var(--text-muted); }
.legal-main .card { padding: 1.5rem; }
@media (min-width: 768px) { .legal-main .card { padding: 2.25rem; } }
.legal-main h3 {
  font-family: var(--font-display); font-size: 1.2rem; color: var(--text-white);
  margin: 2rem 0 0.75rem; scroll-margin-top: 6rem;
}
.legal-main h3:first-of-type { margin-top: 0.5rem; }
.legal-main p, .legal-main li { color: var(--text-secondary); line-height: 1.72; max-width: 68ch; margin-bottom: 0.8rem; }
.legal-main ul { padding-left: 1.3rem; margin-bottom: 1rem; }

/* 404 Void Card */
.error-wrap {
  position: relative; z-index: 2; flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 3rem 1.25rem 5rem;
}
.error-card {
  width: 100%; max-width: 34rem; padding: 2.5rem 1.75rem;
  border-radius: var(--radius-xl); background: var(--bg-card);
  border: 1px solid var(--border-mid); backdrop-filter: blur(20px);
  box-shadow: var(--shadow-float);
}
.error-code {
  font-family: var(--font-display); font-size: clamp(4.5rem, 14vw, 7rem);
  font-weight: 700; letter-spacing: -0.06em; line-height: 1; color: var(--text-white);
  margin-bottom: 0.5rem;
}
.error-title { font-family: var(--font-display); font-size: 1.5rem; color: var(--text-white); margin-bottom: 0.65rem; }
.error-sub { color: var(--text-secondary); margin-bottom: 1.75rem; }

/* ── Footer Unificato Antigravity ──────────────────────────────────────── */
footer {
  position: relative;
  z-index: 2;
  width: 100%;
  border-top: 1px solid var(--border);
  background: rgba(6, 6, 10, 0.72);
  backdrop-filter: blur(16px);
  padding: 2.5rem 1.25rem;
  margin-top: auto;
}
:root.light footer { background: rgba(255, 255, 255, 0.78); }

.footer-inner {
  max-width: 78rem;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
@media (min-width: 900px) {
  .footer-inner { flex-direction: row; align-items: center; justify-content: space-between; }
}
.footer-brand { font-family: var(--font-display); font-size: 1.1rem; font-weight: 700; color: var(--text-white); margin-bottom: 0.3rem; }
.footer-brand span { color: var(--blue); }
.footer-meta { font-family: var(--font-mono); font-size: 0.78rem; color: var(--text-muted); margin-bottom: 0.25rem; }
.footer-copy { font-size: 0.8125rem; color: var(--text-muted); }

.footer-links {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.9rem;
}
.footer-links a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  font-size: 0.875rem;
  color: var(--text-secondary);
}
.footer-links a:hover { color: var(--text-white); }

/* Back to top (>= 48px touch target) */
.back-to-top {
  position: fixed;
  right: 1rem;
  bottom: 1.25rem;
  z-index: 45;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--bg-glass-heavy);
  border: 1px solid var(--border-mid);
  color: var(--text-white);
  backdrop-filter: blur(14px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity var(--ease), transform var(--ease), background var(--ease);
}
.back-to-top.visible { opacity: 1; pointer-events: auto; transform: translateY(0); }
.back-to-top svg { width: 1.25rem; height: 1.25rem; stroke: currentColor; }

/* ── Reduced Motion (Obbligatorio per accessibilità & antigravity-design) ─ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .ag-iso-stack, .ag-tilt { transform: none !important; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   COMPONENTI DEDICATI PAGINE RICCHE DI CONTENUTO (commands, guide, about,
   credits, changelog, eula, privacy) — Mobile-First Obsidian Cosmos
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Commands.html extra ── */
.cat-filter {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding: 0.25rem 0 0.75rem;
  margin-bottom: 1.5rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.cat-filter::-webkit-scrollbar { display: none; }
@media (min-width: 1024px) {
  .cat-filter { flex-wrap: wrap; justify-content: center; overflow-x: visible; }
}
.cat-heading {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.875rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--border);
}
.cat-heading h2 { font-family: var(--font-display); font-size: 1.25rem; color: var(--text-white); }
.cat-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.cmd-cell { display: inline-flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.cmd-badge {
  display: inline-flex; align-items: center; font-family: var(--font-mono); font-size: 0.72rem;
  font-weight: 600; padding: 0.16rem 0.55rem; border-radius: var(--radius-pill);
  border: 1px solid var(--border); color: var(--text-secondary);
}
.badge-admin { color: var(--red); border-color: rgba(248,113,113,0.35); background: rgba(248,113,113,0.1); }
.badge-mod { color: var(--gold); border-color: rgba(250,204,21,0.35); background: rgba(250,204,21,0.1); }
.badge-dev { color: var(--purple); border-color: rgba(192,132,252,0.35); background: rgba(192,132,252,0.1); }
.cmd-panel-section { margin-bottom: 1rem; }
.cmd-panel-section-label {
  font-family: var(--font-mono); font-size: 0.72rem; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--text-muted); margin-bottom: 0.35rem;
}
.no-results { display: none; text-align: center; padding: 2.5rem 1rem; color: var(--text-muted); }

/* ── Guide.html (Audio Lab, piattaforme, effetti, troubleshooting) ── */
.guide-hero { text-align: center; padding: 2.25rem 0 2.5rem; max-width: 46rem; margin: 0 auto; }
.guide-hero h1 { font-family: var(--font-display); font-size: clamp(2rem, 5.5vw, 3.35rem); color: var(--text-white); letter-spacing: -0.04em; line-height: 1.08; margin-bottom: 0.875rem; }
.guide-hero p { color: var(--text-secondary); font-size: 1.05rem; max-width: 54ch; margin: 0 auto; }
.section-kicker { font-family: var(--font-mono); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--blue); margin-bottom: 0.4rem; }
.section-heading { font-family: var(--font-display); font-size: clamp(1.5rem, 3.5vw, 2.15rem); color: var(--text-white); letter-spacing: -0.03em; margin-bottom: 0.75rem; }
.tabs-hint { text-align: center; font-family: var(--font-mono); font-size: 0.8rem; color: var(--text-muted); margin-bottom: 1rem; }
.platform-icon {
  width: 2.75rem; height: 2.75rem; border-radius: var(--radius-md);
  background: rgba(255,255,255,0.05); border: 1px solid var(--border);
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; padding: 0.35rem;
}
.platform-icon img { width: 100%; height: 100%; object-fit: contain; }

.pf-overview {
  margin-bottom: 3rem;
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  border: 1px solid var(--border);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.pf-overview-table { width: 100%; min-width: 36rem; border-collapse: collapse; font-size: 0.92rem; }
.pf-overview-table th, .pf-overview-table td { padding: 0.9rem 1rem; text-align: left; border-bottom: 1px solid var(--border-dim); }
.pf-overview-table th { font-family: var(--font-mono); font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); background: rgba(255,255,255,0.02); }
.pf-overview-table tr:last-child td { border-bottom: none; }
.pf-platform-cell { display: inline-flex; align-items: center; gap: 0.6rem; font-weight: 600; color: var(--text-white); white-space: nowrap; }
.pf-table-icon { width: 1.4rem; height: 1.4rem; object-fit: contain; }

.effects-section, .troubleshoot-section { margin-bottom: 3.5rem; }
.effect-card { display: flex; align-items: flex-start; gap: 0.875rem; }
.effect-emoji {
  width: 2.5rem; height: 2.5rem; border-radius: var(--radius-md);
  background: rgba(255,255,255,0.05); border: 1px solid var(--border);
  display: inline-flex; align-items: center; justify-content: center; font-size: 1.2rem; flex-shrink: 0;
}
.effect-name { font-family: var(--font-display); font-weight: 700; color: var(--text-white); margin-bottom: 0.2rem; }
.effect-desc { font-size: 0.9rem; color: var(--text-secondary); }
.effects-note {
  padding: 1rem 1.25rem; border-radius: var(--radius-md); background: var(--blue-faint);
  border: 1px solid rgba(125,211,252,0.28); color: var(--text-secondary); font-size: 0.92rem;
}

.troubleshoot-list { display: flex; flex-direction: column; gap: 0.75rem; }
.troubleshoot-item {
  padding: 1.25rem; border-radius: var(--radius-lg); background: var(--bg-card); border: 1px solid var(--border);
}
.troubleshoot-q { font-family: var(--font-display); font-weight: 700; font-size: 1.02rem; color: var(--text-white); margin-bottom: 0.4rem; }
.troubleshoot-msg { font-family: var(--font-mono); font-size: 0.84rem; color: var(--gold); margin-bottom: 0.4rem; }
.troubleshoot-a { color: var(--text-secondary); font-size: 0.94rem; }
.pf-example-input, .pf-example-output { font-family: var(--font-mono); font-size: 0.85rem; overflow-wrap: anywhere; }
.pf-no { padding: 0.85rem 1rem; border-radius: var(--radius-md); background: rgba(255,255,255,0.03); border: 1px solid var(--border); }
.pf-error-fix { font-size: 0.92rem; color: var(--text-secondary); }

/* ── Changelog extra ── */
.change-divider { height: 1px; background: var(--border); margin: 0.9rem 0; }

/* ── About & Credits extra ── */
.hero-icon {
  width: 3.75rem; height: 3.75rem; margin: 0 auto 1rem; border-radius: var(--radius-lg);
  background: var(--bg-card); border: 1px solid var(--border-mid);
  display: flex; align-items: center; justify-content: center; font-size: 1.85rem;
}
.values-grid { display: grid; grid-template-columns: 1fr; gap: 0.875rem; margin-top: 1.25rem; }
@media (min-width: 640px) { .values-grid { grid-template-columns: repeat(2, 1fr); } }
.value-card, .credit-card, .thankyou-card, .cta-cbtlv {
  padding: 1.35rem; border-radius: var(--radius-lg); background: var(--bg-card);
  border: 1px solid var(--border); backdrop-filter: blur(14px);
}
.value-card h3, .cc-name { font-family: var(--font-display); font-weight: 700; font-size: 1.1rem; color: var(--text-white); margin-bottom: 0.25rem; }
.value-card p, .credit-card p { font-size: 0.93rem; color: var(--text-secondary); }
.credits-hero { text-align: center; padding: 2.25rem 0 2.5rem; max-width: 44rem; margin: 0 auto; }
.credits-hero h1 { font-family: var(--font-display); font-size: clamp(2rem, 5vw, 3.1rem); color: var(--text-white); letter-spacing: -0.04em; margin-bottom: 0.875rem; }
.credits-hero p { color: var(--text-secondary); }
.credits-section { margin-bottom: 3rem; }
.credits-section h2 { font-family: var(--font-display); font-size: 1.45rem; color: var(--text-white); margin-bottom: 1rem; }
.cc-role { font-size: 0.9rem; color: var(--text-secondary); margin-bottom: 0.5rem; }
.cc-license {
  display: inline-block; font-family: var(--font-mono); font-size: 0.74rem;
  padding: 0.16rem 0.55rem; border-radius: var(--radius-pill);
  background: var(--bg-code); border: 1px solid var(--border); color: var(--blue);
}
.thankyou-card, .cta-cbtlv { text-align: center; padding: 2rem 1.5rem; margin-top: 2rem; border-color: var(--border-mid); }
.ty-icon { font-size: 2rem; margin-bottom: 0.5rem; }

/* ── EULA & Privacy extra (Mobile Collapsible TOC + Grids) ── */
.legal-icon {
  width: 2.75rem; height: 2.75rem; border-radius: var(--radius-md);
  background: var(--bg-card); border: 1px solid var(--border-mid);
  display: inline-flex; align-items: center; justify-content: center; font-size: 1.25rem;
}
.back-link {
  display: inline-flex; align-items: center; gap: 0.4rem; min-height: 44px;
  font-family: var(--font-mono); font-size: 0.85rem; color: var(--text-secondary);
}
.back-link:hover { color: var(--text-white); }

.legal-toc-mobile {
  display: block;
  margin-bottom: 1.25rem;
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  border: 1px solid var(--border-mid);
  overflow: hidden;
}
.legal-toc-mobile summary {
  display: flex; align-items: center; justify-content: space-between; min-height: 48px;
  padding: 0.85rem 1.15rem; font-family: var(--font-display); font-weight: 700; color: var(--text-white);
  cursor: pointer; list-style: none;
}
.legal-toc-mobile summary::-webkit-details-marker { display: none; }
.legal-toc-mobile .sidebar-nav { padding: 0 0.75rem 0.85rem; }
@media (min-width: 1024px) {
  .legal-toc-mobile { display: none; }
}
.legal-sidebar { display: none; }
@media (min-width: 1024px) {
  .legal-sidebar { display: block; }
}

.file-grid, .rights-grid {
  display: grid; grid-template-columns: 1fr; gap: 0.65rem; margin: 1rem 0 1.25rem;
}
@media (min-width: 640px) {
  .file-grid, .rights-grid { grid-template-columns: repeat(2, 1fr); }
}
.file-pill, .right-pill {
  padding: 0.85rem 1rem; border-radius: var(--radius-md);
  background: var(--bg-code); border: 1px solid var(--border); font-size: 0.9rem; color: var(--text-secondary);
}
.right-pill { display: flex; align-items: flex-start; gap: 0.65rem; }
.rp-emoji { flex-shrink: 0; font-size: 1.15rem; }
.third-party-card {
  display: flex; align-items: flex-start; gap: 0.875rem; padding: 1rem 1.15rem;
  border-radius: var(--radius-md); background: var(--bg-code); border: 1px solid var(--border);
  margin-bottom: 0.75rem;
}
.tp-icon { font-size: 1.35rem; flex-shrink: 0; }
.tp-name { font-family: var(--font-display); font-weight: 700; color: var(--text-white); margin-bottom: 0.2rem; }
.tp-desc { font-size: 0.92rem; color: var(--text-secondary); }
