/**
 * SitePulse Design System
 * Black · White · Orange only. Flat. No gradients.
 * One source of truth for marketing + app shells.
 */

/* ═══════════════════════════════════════════════════
   TOKENS
   ═══════════════════════════════════════════════════ */
:root {
  --sp-black: #000000;
  --sp-white: #ffffff;
  --sp-orange: #f26622;
  --sp-orange-hover: #d9541a;
  --sp-orange-soft: #fff4ed;
  --sp-orange-ring: rgba(242, 102, 34, 0.22);
  --sp-orange-dim: rgba(242, 102, 34, 0.14);

  --sp-brand: var(--sp-orange);
  --sp-brand-hover: var(--sp-orange-hover);
  --sp-brand-deep: #c44e14;
  --sp-brand-soft: var(--sp-orange-soft);
  --sp-brand-ring: var(--sp-orange-ring);

  --sp-ink: var(--sp-black);
  --sp-ink-soft: #1a1a1a;
  --sp-muted: #666666;
  --sp-muted-2: #888888;
  --sp-line: #e8e8e8;
  --sp-line-strong: #d4d4d4;
  --sp-surface: var(--sp-white);
  --sp-surface-2: #f7f7f7;

  /* Dark app shell (dashboard / admin) — pure black scale */
  --sp-app-bg: #000000;
  --sp-app-panel: #0a0a0a;
  --sp-app-card: #111111;
  --sp-app-line: #222222;
  --sp-app-line-2: #2a2a2a;
  --sp-app-text: #ffffff;
  --sp-app-muted: #999999;
  --sp-app-faint: #666666;

  --sp-dark: var(--sp-black);
  --sp-dark-2: #111111;
  --sp-on-dark: var(--sp-white);
  --sp-on-dark-muted: #bbbbbb;

  --sp-radius-sm: 0.5rem;
  --sp-radius: 0.75rem;
  --sp-radius-lg: 1rem;
  --sp-radius-xl: 1.25rem;

  --sp-font-display: "Syne", system-ui, sans-serif;
  --sp-font-body: "DM Sans", system-ui, sans-serif;

  --sp-text-xs: 0.75rem;
  --sp-text-sm: 0.875rem;
  --sp-text-base: 1rem;
  --sp-text-lg: 1.125rem;
  --sp-text-xl: 1.25rem;
  --sp-text-2xl: 1.5rem;
  --sp-text-3xl: 1.875rem;
  --sp-text-4xl: clamp(2rem, 5vw, 2.75rem);

  --sp-space-1: 0.25rem;
  --sp-space-2: 0.5rem;
  --sp-space-3: 0.75rem;
  --sp-space-4: 1rem;
  --sp-space-5: 1.25rem;
  --sp-space-6: 1.5rem;
  --sp-space-8: 2rem;
  --sp-space-10: 2.5rem;
  --sp-space-12: 3rem;

  --sp-pad-x: clamp(1rem, 4vw, 2rem);
  --sp-section-y: clamp(3rem, 8vw, 5.5rem);
  --sp-nav-h: 4rem;
  --sp-sidebar-w: 240px;
  --sp-tap: 44px;
  --sp-max: 72rem;
  --sp-shadow: none; /* flat by default */
  --sp-shadow-brand: 0 8px 22px rgba(242, 102, 34, 0.28);
  --sp-focus: 0 0 0 3px var(--sp-orange-ring);
  --sp-transition: 0.18s ease;
}

/* ═══════════════════════════════════════════════════
   BASE
   ═══════════════════════════════════════════════════ */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  overflow-x: hidden;
  background: var(--sp-surface);
  color: var(--sp-ink);
  font-family: var(--sp-font-body);
  font-size: var(--sp-text-sm);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, .font-display {
  font-family: var(--sp-font-display);
  letter-spacing: -0.02em;
  line-height: 1.15;
}

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

a {
  color: inherit;
}

button, input, select, textarea {
  font-family: inherit;
}

:focus-visible {
  outline: none;
  box-shadow: var(--sp-focus);
}

.brand {
  color: var(--sp-orange) !important;
}

/* Kill non-brand color utilities from older markup */
.bg-blue-50, .bg-purple-50, .bg-green-50, .bg-red-50,
.bg-yellow-50, .bg-indigo-50, .bg-teal-50, .bg-blue-100,
.bg-green-100, .bg-purple-100 {
  background-color: var(--sp-orange-soft) !important;
}
.text-blue-500, .text-blue-400, .text-purple-400, .text-purple-500,
.text-green-400, .text-green-500, .text-yellow-400, .text-yellow-500,
.text-indigo-500, .text-teal-500 {
  color: var(--sp-orange) !important;
}
/* Keep error red subtle — only force orange for decorative accents */
.text-red-400.brand-force {
  color: var(--sp-orange) !important;
}
.bg-green-600, .bg-red-600, .bg-orange-500 {
  background-color: var(--sp-black) !important;
  border: 1px solid var(--sp-app-line) !important;
}
.bg-orange-500.bg-brand,
.bg-brand {
  background-color: var(--sp-orange) !important;
  border-color: var(--sp-orange) !important;
}
.fill-yellow-400 {
  fill: var(--sp-orange) !important;
  color: var(--sp-orange) !important;
}

/* ═══════════════════════════════════════════════════
   LOGO
   ═══════════════════════════════════════════════════ */
.sp-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  color: inherit;
  line-height: 1;
}
.sp-logo-mark {
  width: 2rem;
  height: 2rem;
  border-radius: 0.55rem;
  background: var(--sp-black);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.sp-logo-mark svg {
  width: 1.15rem;
  height: 1.15rem;
}
.sp-logo-word {
  font-family: var(--sp-font-display);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  color: var(--sp-black);
}
.sp-logo-word .pulse {
  color: var(--sp-orange);
}
.sp-logo--on-dark .sp-logo-word {
  color: var(--sp-white);
}
.sp-logo--sm .sp-logo-mark {
  width: 1.65rem;
  height: 1.65rem;
  border-radius: 0.45rem;
}
.sp-logo--sm .sp-logo-mark svg {
  width: 0.95rem;
  height: 0.95rem;
}
.sp-logo--sm .sp-logo-word {
  font-size: 0.95rem;
}

/* ═══════════════════════════════════════════════════
   TYPE / LABELS
   ═══════════════════════════════════════════════════ */
.section-label {
  font-family: var(--sp-font-body);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--sp-orange);
}

.sp-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--sp-orange-soft);
  border: 1px solid #ffd8c2;
  border-radius: 999px;
  padding: 0.35rem 0.9rem;
  color: var(--sp-brand-deep);
  font-size: var(--sp-text-xs);
  font-weight: 600;
}
.sp-pill-dot {
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 999px;
  background: var(--sp-orange);
  box-shadow: 0 0 0 3px var(--sp-orange-ring);
}

.pro-badge {
  background: var(--sp-orange);
  color: var(--sp-white);
  font-size: 10px;
  font-family: var(--sp-font-display);
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 99px;
  display: inline-block;
  letter-spacing: 0.04em;
}

/* ═══════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════ */
.btn-primary,
.btn-brand {
  background: var(--sp-orange);
  color: var(--sp-white) !important;
  font-family: var(--sp-font-display);
  font-weight: 600;
  font-size: var(--sp-text-sm);
  transition: background var(--sp-transition), border-color var(--sp-transition);
  cursor: pointer;
  border: none;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  border-radius: var(--sp-radius);
  min-height: 2.75rem;
  padding: 0.65rem 1.25rem;
  line-height: 1.2;
}
.btn-primary:hover,
.btn-brand:hover {
  background: var(--sp-orange-hover);
}
.btn-primary:disabled,
.btn-brand:disabled {
  background: #cccccc;
  color: #666 !important;
  cursor: not-allowed;
}

.btn-secondary {
  border: 1.5px solid var(--sp-black);
  color: var(--sp-black) !important;
  background: var(--sp-white);
  font-family: var(--sp-font-display);
  font-weight: 600;
  font-size: var(--sp-text-sm);
  transition: background var(--sp-transition), color var(--sp-transition);
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  border-radius: var(--sp-radius);
  min-height: 2.75rem;
  padding: 0.65rem 1.25rem;
}
.btn-secondary:hover {
  background: var(--sp-black);
  color: var(--sp-white) !important;
}

.btn-ghost-light {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.75rem;
  border-radius: var(--sp-radius);
  border: 1.5px solid #444;
  color: var(--sp-white) !important;
  font-family: var(--sp-font-display);
  font-weight: 600;
  font-size: var(--sp-text-sm);
  text-decoration: none;
  background: transparent;
  transition: background var(--sp-transition), border-color var(--sp-transition);
  min-height: 2.75rem;
}
.btn-ghost-light:hover {
  background: #1a1a1a;
  border-color: var(--sp-orange);
}

/* Dark app ghost */
.btn-ghost {
  background: transparent;
  color: var(--sp-app-text) !important;
  border: 1px solid var(--sp-app-line-2);
  font-family: var(--sp-font-display);
  font-weight: 600;
  font-size: var(--sp-text-xs);
  transition: border-color var(--sp-transition), color var(--sp-transition), background var(--sp-transition);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  border-radius: var(--sp-radius);
  min-height: 2.5rem;
  padding: 0.5rem 0.85rem;
  text-decoration: none;
}
.btn-ghost:hover {
  border-color: var(--sp-orange);
  color: var(--sp-orange) !important;
  background: var(--sp-orange-dim);
}

.input-field:focus,
input:focus,
textarea:focus,
select:focus {
  border-color: var(--sp-orange) !important;
  box-shadow: var(--sp-focus) !important;
  outline: none;
}

/* ═══════════════════════════════════════════════════
   MARKETING LAYOUT
   ═══════════════════════════════════════════════════ */
.sp-hero-wash {
  background: var(--sp-white);
  position: relative;
}
.sp-hero-wash::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--sp-orange-soft);
  opacity: 0.55;
  pointer-events: none;
  z-index: 0;
}
.sp-hero-wash > * {
  position: relative;
  z-index: 1;
}

.sp-section {
  padding: var(--sp-section-y) var(--sp-pad-x);
}
.sp-section--muted {
  background: var(--sp-surface-2);
  border-top: 1px solid var(--sp-line);
  border-bottom: 1px solid var(--sp-line);
}
.sp-container {
  max-width: var(--sp-max);
  margin: 0 auto;
}

.sp-card-lift {
  transition: border-color var(--sp-transition);
  background: var(--sp-white);
  border: 1px solid var(--sp-line);
  border-radius: var(--sp-radius-lg);
}
.sp-card-lift:hover {
  border-color: #ffd8c2;
}

.icon-box {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--sp-radius);
  background: var(--sp-orange-soft);
  border: 1px solid #ffd8c2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--sp-orange);
}

/* Reveal */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.visible {
  opacity: 1;
  transform: none;
}
.reveal-delay-1 { transition-delay: 0.08s; }
.reveal-delay-2 { transition-delay: 0.16s; }
.reveal-delay-3 { transition-delay: 0.24s; }
.reveal-delay-4 { transition-delay: 0.32s; }

.stagger > * {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.45s ease, transform 0.45s ease;
}
.stagger.visible > * { opacity: 1; transform: none; }
.stagger.visible > *:nth-child(1) { transition-delay: 0.05s; }
.stagger.visible > *:nth-child(2) { transition-delay: 0.1s; }
.stagger.visible > *:nth-child(3) { transition-delay: 0.15s; }
.stagger.visible > *:nth-child(4) { transition-delay: 0.2s; }
.stagger.visible > *:nth-child(5) { transition-delay: 0.25s; }
.stagger.visible > *:nth-child(6) { transition-delay: 0.3s; }
.stagger.visible > *:nth-child(7) { transition-delay: 0.35s; }
.stagger.visible > *:nth-child(8) { transition-delay: 0.4s; }

@keyframes sp-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}
.sp-float { animation: sp-float 4s ease-in-out infinite; }

.skeleton {
  background: #ececec;
  border-radius: 6px;
  min-height: 1rem;
}

/* Social */
.sp-social {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
}
.sp-social-btn {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.65rem;
  background: #1a1a1a;
  color: var(--sp-white);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background var(--sp-transition);
  text-decoration: none;
  border: none;
}
.sp-social-btn:hover {
  background: var(--sp-orange);
}
.sp-social-btn svg {
  width: 1rem;
  height: 1rem;
}

/* Footer + CTA */
.sp-footer {
  background: var(--sp-black);
  color: var(--sp-white);
  border-top: 1px solid #222;
}
.sp-footer a {
  color: #ccc;
  text-decoration: none;
  transition: color var(--sp-transition);
}
.sp-footer a:hover {
  color: var(--sp-orange);
}
.sp-footer-tag {
  color: #999;
  font-size: var(--sp-text-xs);
  margin-top: 0.2rem;
}
.sp-footer .sp-social-btn {
  background: #1a1a1a;
}
.sp-footer .sp-social-btn:hover {
  background: var(--sp-orange);
}
.sp-footer-brand-block {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.sp-cta-band {
  background: var(--sp-black);
  color: var(--sp-white);
  border-top: 1px solid #222;
  border-bottom: 1px solid #222;
  padding: var(--sp-section-y) var(--sp-pad-x);
  text-align: center;
}
.sp-cta-band h2 {
  color: var(--sp-white);
  margin: 0 0 0.75rem;
}
.sp-cta-band p {
  color: #aaa;
  margin: 0 auto 1.75rem;
}

.sp-stats-strip {
  background: var(--sp-black);
  color: var(--sp-white);
  padding: clamp(1.75rem, 4vw, 2.5rem) var(--sp-pad-x);
  border-top: 1px solid #222;
  border-bottom: 1px solid #222;
}
.sp-stats-strip .stat-label {
  color: #999;
}

/* ═══════════════════════════════════════════════════
   NAV (shared marketing)
   ═══════════════════════════════════════════════════ */
#sp-nav,
.sp-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.98);
  border-bottom: 1px solid transparent;
  transition: border-color var(--sp-transition);
}
#sp-nav.is-scrolled,
.sp-nav.is-scrolled {
  border-bottom-color: var(--sp-line);
}
.sp-nav-inner {
  max-width: 80rem;
  margin: 0 auto;
  padding: 0 var(--sp-pad-x);
  height: var(--sp-nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.sp-nav-links {
  display: none;
  align-items: center;
  gap: 1.75rem;
}
.sp-nav-link {
  font-size: var(--sp-text-sm);
  font-weight: 500;
  color: #555;
  text-decoration: none;
  position: relative;
  padding: 0.25rem 0;
}
.sp-nav-link:hover {
  color: var(--sp-black);
}
.sp-nav-link.is-active {
  color: var(--sp-black);
  font-weight: 600;
}
.sp-nav-link.is-active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -0.35rem;
  height: 2px;
  background: var(--sp-orange);
}
.sp-nav-actions {
  display: none;
  align-items: center;
  gap: 0.5rem;
}
.sp-nav-btn {
  font-size: 0.8125rem !important;
  padding: 0.5rem 1rem !important;
  min-height: 2.4rem !important;
  border-radius: 0.65rem !important;
}
.sp-nav-btn-sm {
  font-size: 0.75rem !important;
  padding: 0.35rem 0.75rem !important;
  min-height: 2.15rem !important;
  border-radius: 0.55rem !important;
  gap: 0.35rem;
}
.sp-nav-user {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.sp-nav-dropdown {
  position: relative;
}
.sp-nav-user-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--sp-white);
  border: 1px solid var(--sp-line);
  border-radius: 0.65rem;
  padding: 0.4rem 0.7rem;
  font-size: var(--sp-text-xs);
  color: #333;
  cursor: pointer;
  min-height: 2.4rem;
}
.sp-nav-email {
  max-width: 9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sp-nav-drop-menu {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 0.35rem);
  min-width: 12rem;
  background: var(--sp-white);
  border: 1px solid var(--sp-line);
  border-radius: var(--sp-radius);
  padding: 0.35rem 0;
  z-index: 60;
}
.sp-nav-drop-menu.is-open {
  display: block;
}
.sp-nav-drop-menu a,
.sp-nav-drop-menu button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.65rem 1rem;
  font-size: 0.8125rem;
  color: #222;
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: none;
  min-height: var(--sp-tap);
}
.sp-nav-drop-menu a:hover,
.sp-nav-drop-menu button:hover {
  background: var(--sp-surface-2);
}
.sp-nav-signout {
  color: var(--sp-orange) !important;
}
.sp-nav-burger {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.65rem;
  border: 1px solid var(--sp-line);
  background: var(--sp-white);
  cursor: pointer;
  padding: 0.55rem;
}
.sp-nav-burger span {
  display: block;
  height: 2px;
  background: var(--sp-black);
  border-radius: 2px;
}
.sp-nav-panel {
  display: contents;
}
.sp-nav-spacer {
  height: var(--sp-nav-h);
}

@media (min-width: 768px) {
  .sp-nav-burger { display: none; }
  .sp-nav-links,
  .sp-nav-actions { display: flex; }
}
@media (max-width: 767px) {
  .sp-nav-panel {
    display: none;
    position: fixed;
    inset: var(--sp-nav-h) 0 0 0;
    background: var(--sp-white);
    border-top: 1px solid var(--sp-line);
    padding: 1.25rem var(--sp-pad-x);
    flex-direction: column;
    gap: 1.25rem;
    z-index: 49;
    overflow-y: auto;
  }
  .sp-nav-panel.is-open { display: flex; }
  .sp-nav-links {
    display: flex;
    flex-direction: column;
    gap: 0;
  }
  .sp-nav-link {
    padding: 0.95rem 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 1rem;
    min-height: var(--sp-tap);
    display: flex;
    align-items: center;
  }
  .sp-nav-link.is-active::after { display: none; }
  .sp-nav-actions {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 0.65rem;
  }
  .sp-nav-actions .btn-primary,
  .sp-nav-actions .btn-secondary {
    width: 100%;
    justify-content: center;
  }
  .sp-nav-user {
    flex-wrap: wrap;
    width: 100%;
  }
  .sp-nav-user-btn {
    width: 100%;
    justify-content: space-between;
  }
  .sp-nav-drop-menu {
    position: static;
    width: 100%;
    margin-top: 0.35rem;
  }
  body.sp-nav-open { overflow: hidden; }
}

/* ═══════════════════════════════════════════════════
   AUTH
   ═══════════════════════════════════════════════════ */
.auth-shell {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--sp-white);
}
.auth-card {
  background: var(--sp-white);
  border: 1px solid var(--sp-line);
  border-radius: var(--sp-radius-xl);
  width: 100%;
  max-width: 420px;
  padding: 2rem 1.5rem;
}
.auth-brand-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 1.5rem;
  gap: 0.65rem;
}
.auth-tabs {
  display: flex;
  border: 1px solid var(--sp-line);
  border-radius: var(--sp-radius);
  padding: 0.25rem;
  background: var(--sp-surface-2);
  margin-bottom: 1.25rem;
  gap: 0.25rem;
}
.auth-tab {
  flex: 1;
  border: none;
  background: transparent;
  color: #666;
  font-family: var(--sp-font-display);
  font-weight: 600;
  font-size: var(--sp-text-sm);
  padding: 0.65rem 0.75rem;
  border-radius: 0.55rem;
  cursor: pointer;
  min-height: var(--sp-tap);
}
.auth-tab.active {
  background: var(--sp-white);
  color: var(--sp-black);
  border: 1px solid var(--sp-line);
}
.auth-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.85rem;
}
.auth-field label {
  font-size: var(--sp-text-xs);
  font-weight: 600;
  color: #333;
}
.auth-field .input-wrap { position: relative; }
.auth-field .lead-icon {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: #888;
  pointer-events: none;
  display: flex;
}
.auth-field input {
  width: 100%;
  padding: 0.8rem 1rem 0.8rem 2.5rem;
  font-size: 16px;
  border: 1px solid var(--sp-line);
  border-radius: var(--sp-radius);
  background: #fafafa;
  outline: none;
  color: var(--sp-black);
  min-height: var(--sp-tap);
}
.auth-field input:focus {
  background: var(--sp-white);
  border-color: var(--sp-orange);
  box-shadow: var(--sp-focus);
}
.auth-toggle-pass {
  position: absolute;
  right: 0.65rem;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  color: #888;
  cursor: pointer;
  padding: 0.25rem;
  display: flex;
}
.auth-error {
  font-size: var(--sp-text-xs);
  color: #b91c1c;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 0.65rem;
  padding: 0.55rem 0.75rem;
  margin-bottom: 0.75rem;
  display: none;
}
.auth-error.show { display: block; }
.auth-hint {
  font-size: 0.7rem;
  color: #666;
  margin: -0.35rem 0 0.75rem;
}
.auth-link {
  color: var(--sp-orange);
  font-weight: 600;
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  font-size: inherit;
  font-family: inherit;
}
.auth-link:hover { text-decoration: underline; }
.sp-built-by {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: var(--sp-text-xs);
  color: #888;
}
.sp-built-by a {
  color: var(--sp-orange);
  font-weight: 600;
  text-decoration: none;
}

/* ═══════════════════════════════════════════════════
   APP SHELL (dashboard + admin) — unified dark UI
   ═══════════════════════════════════════════════════ */
body.sp-app-body,
.sp-app-body {
  background: var(--sp-app-bg) !important;
  color: var(--sp-app-text) !important;
  min-height: 100dvh;
}

.sp-app {
  display: flex;
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
  background: var(--sp-app-bg);
  color: var(--sp-app-text);
}

/* Sidebar */
.sp-app-sidebar,
#sidebar {
  width: var(--sp-sidebar-w);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: var(--sp-app-panel);
  border-right: 1px solid var(--sp-app-line);
  transition: transform 0.28s ease;
  z-index: 60;
}

.sp-app-nav-item,
.nav-item,
#sidebar .nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.7rem 1rem;
  border-radius: 0.625rem;
  border: none;
  background: none;
  color: var(--sp-app-muted);
  font-size: 0.8125rem;
  font-weight: 500;
  font-family: var(--sp-font-body);
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: background var(--sp-transition), color var(--sp-transition);
  min-height: var(--sp-tap);
}
.sp-app-nav-item:hover,
.nav-item:hover,
#sidebar .nav-item:hover {
  background: var(--sp-orange-dim);
  color: var(--sp-orange);
}
.sp-app-nav-item.active,
.nav-item.active,
#sidebar .nav-item.active {
  background: rgba(242, 102, 34, 0.18);
  color: var(--sp-orange);
  font-weight: 600;
}
.sp-app-nav-item i,
.nav-item i,
#sidebar .nav-item i {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.sp-app-main,
#main-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sp-app-topbar {
  height: 3.5rem;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0 1rem;
  border-bottom: 1px solid var(--sp-app-line);
  background: rgba(10, 10, 10, 0.95);
}

.sp-app-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 1rem;
  padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
}

.sp-app-backdrop,
#sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 55;
}
.sp-app-backdrop.is-open,
.sp-app-backdrop.open,
#sidebar-backdrop.open {
  display: block;
}

/* Cards */
.sp-app .card,
body.sp-app-body .card,
.card {
  background: var(--sp-app-card);
  border: 1px solid var(--sp-app-line);
  border-radius: var(--sp-radius-lg);
  transition: border-color var(--sp-transition);
}
.sp-app .card:hover,
body.sp-app-body .card:hover {
  border-color: rgba(242, 102, 34, 0.35);
}
.card-hover:hover {
  border-color: rgba(242, 102, 34, 0.3);
}

/* Tables */
.data-table {
  width: 100%;
  border-collapse: collapse;
}
.data-table th {
  font-family: var(--sp-font-display);
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--sp-app-faint);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--sp-app-line);
}
.data-table td {
  padding: 0.75rem 1rem;
  font-size: 0.8125rem;
  color: #ddd;
  border-bottom: 1px solid #1a1a1a;
  vertical-align: middle;
}
.data-table tr:hover td {
  background: rgba(255, 255, 255, 0.03);
}

.sp-table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--sp-radius);
}
.sp-table-wrap .data-table {
  min-width: 560px;
}

/* App inputs */
.sp-app .input,
body.sp-app-body .input,
.input {
  width: 100%;
  padding: 0.65rem 0.875rem;
  font-size: 0.875rem;
  border: 1px solid var(--sp-app-line-2);
  border-radius: var(--sp-radius);
  background: rgba(255, 255, 255, 0.04);
  color: var(--sp-white);
  outline: none;
  transition: border-color var(--sp-transition);
  font-family: var(--sp-font-body);
  min-height: 2.5rem;
}
.sp-app .input:focus,
body.sp-app-body .input:focus,
.input:focus {
  border-color: var(--sp-orange);
  box-shadow: var(--sp-focus);
}
.input::placeholder {
  color: #555;
}

/* Badges / pills (app) */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.65rem;
  border-radius: 99px;
  font-size: 0.7rem;
  font-weight: 700;
  gap: 0.3rem;
}
.badge-l1,
.badge-pro,
.score-good {
  background: var(--sp-orange-dim);
  color: var(--sp-orange);
  border: 1px solid rgba(242, 102, 34, 0.3);
}
.badge-l2,
.badge-l3,
.score-fair {
  background: rgba(255, 255, 255, 0.08);
  color: #ccc;
  border: 1px solid #333;
}
.badge-exp,
.score-poor {
  background: rgba(255, 255, 255, 0.05);
  color: #888;
  border: 1px solid #2a2a2a;
}
.score-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.65rem;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 700;
}

.online-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.15rem 0.55rem;
  border-radius: 99px;
  font-size: 0.65rem;
  font-weight: 700;
}
.online-pill.on {
  background: var(--sp-orange-dim);
  color: var(--sp-orange);
  border: 1px solid rgba(242, 102, 34, 0.3);
}
.online-pill.off {
  background: rgba(255, 255, 255, 0.06);
  color: #999;
  border: 1px solid #333;
}

.session-card {
  border: 1px solid var(--sp-app-line);
  border-radius: 0.875rem;
  padding: 0.875rem 1rem;
  background: rgba(255, 255, 255, 0.02);
}
.session-card.live {
  border-color: rgba(242, 102, 34, 0.35);
}

.tab-btn,
.tab {
  padding: 0.45rem 0.875rem;
  font-size: 0.8125rem;
  font-weight: 600;
  font-family: var(--sp-font-display);
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all var(--sp-transition);
  border: none;
  background: transparent;
  color: #777;
}
.tab-btn.active,
.tab.active {
  background: var(--sp-orange);
  color: #fff;
}

/* Permission toggles */
.perm-toggle {
  position: relative;
  display: inline-block;
  width: 34px;
  height: 18px;
}
.perm-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}
.perm-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: #333;
  border-radius: 18px;
  transition: 0.2s;
}
.perm-slider:before {
  content: "";
  position: absolute;
  width: 12px;
  height: 12px;
  left: 3px;
  bottom: 3px;
  background: #999;
  border-radius: 50%;
  transition: 0.2s;
}
input:checked + .perm-slider {
  background: var(--sp-orange);
}
input:checked + .perm-slider:before {
  transform: translateX(16px);
  background: #fff;
}
input:disabled + .perm-slider {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Live dots — orange only */
.live-dot,
.sp-live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--sp-orange);
  animation: spPulse 2s infinite;
  flex-shrink: 0;
}
@keyframes spPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

/* Severity — orange scale only */
.sev-info { color: #aaa; }
.sev-warning { color: var(--sp-orange); }
.sev-critical { color: #fff; }

/* Toast */
#toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  transition: all 0.3s;
  transform: translateY(6rem);
  opacity: 0;
  pointer-events: none;
  border-radius: var(--sp-radius);
  padding: 0.85rem 1rem;
  font-size: var(--sp-text-sm);
  font-weight: 600;
  font-family: var(--sp-font-display);
  color: #fff;
  background: var(--sp-black);
  border: 1px solid var(--sp-app-line);
}
#toast.show {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

/* Modals */
.modal-overlay,
.modal-bg {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}
.modal-overlay.open,
.modal-bg.open {
  opacity: 1;
  pointer-events: auto;
}
.modal-box {
  background: var(--sp-app-card);
  border: 1px solid var(--sp-app-line-2);
  border-radius: var(--sp-radius-xl);
  width: 100%;
  max-width: 520px;
  max-height: min(90dvh, 640px);
  overflow-y: auto;
  transform: translateY(0.75rem);
  transition: transform 0.25s;
}
.modal-overlay.open .modal-box,
.modal-bg.open .modal-box {
  transform: translateY(0);
}

/* Gates */
#pro-gate { display: none; }
body.gate-mode #dashboard-app { display: none; }
body.gate-mode #pro-gate { display: flex; }
#gate { display: none; }
body.gated #gate { display: flex; }
body.gated #admin-app { display: none; }

#dash-error { display: none; }
#dash-error.show { display: flex; }
#dash-loading { display: none; }
#dash-loading.show { display: flex; }

/* Filters */
.sp-filter-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}
@media (min-width: 640px) {
  .sp-filter-row { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 1024px) {
  .sp-filter-row { grid-template-columns: repeat(5, 1fr) auto; }
}

/* App skeleton on dark */
body.sp-app-body .skeleton,
.sp-app .skeleton {
  background: #1a1a1a;
}

/* ═══════════════════════════════════════════════════
   MOBILE APP + GLOBAL POLISH
   ═══════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .sp-app-sidebar,
  #sidebar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    bottom: 0 !important;
    height: 100dvh !important;
    width: min(280px, 86vw) !important;
    max-width: 86vw !important;
    transform: translate3d(-100%, 0, 0) !important;
    z-index: 80 !important;
    transition: transform 0.28s ease !important;
    box-shadow: none;
  }
  .sp-app-sidebar.is-open,
  .sp-app-sidebar.open,
  #sidebar.open,
  body.sp-drawer-open #sidebar {
    transform: translate3d(0, 0, 0) !important;
    box-shadow: 8px 0 32px rgba(0, 0, 0, 0.55) !important;
  }
  #sidebar-backdrop {
    z-index: 70 !important;
  }
  body.sp-drawer-open #sidebar-backdrop,
  #sidebar-backdrop.open {
    display: block !important;
  }
  .sp-app-main,
  #main-content {
    margin-left: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
  }
  .sp-drawer-btn {
    display: inline-flex !important;
    z-index: 5;
  }
  .sp-app-content,
  main.flex-1 {
    padding: 0.75rem !important;
  }
  .sp-app-topbar,
  header.h-14 {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }
  .hide-mobile { display: none !important; }
  .data-table { min-width: 520px; }
  .btn-primary, .btn-secondary, .btn-brand, .btn-ghost {
    min-height: var(--sp-tap);
  }
  #toast {
    left: 1rem !important;
    right: 1rem !important;
    bottom: calc(1rem + env(safe-area-inset-bottom, 0px)) !important;
    max-width: none;
  }
  .modal-overlay,
  .modal-bg {
    padding: 0.75rem;
    align-items: flex-end;
  }
  canvas { max-width: 100% !important; }
  .sp-footer {
    padding-bottom: calc(1.5rem + env(safe-area-inset-bottom, 0px));
  }
}

@media (max-width: 767px) {
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="url"],
  input[type="number"],
  input[type="date"],
  input[type="search"],
  select,
  textarea {
    font-size: 16px !important;
  }
}

@supports (padding: max(0px)) {
  #sp-nav .sp-nav-inner {
    padding-left: max(var(--sp-pad-x), env(safe-area-inset-left));
    padding-right: max(var(--sp-pad-x), env(safe-area-inset-right));
  }
}

/* ═══════════════════════════════════════════════════
   INTERACTIVE MODALS
   ═══════════════════════════════════════════════════ */
.sp-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.55);
  opacity: 0;
  transition: opacity 0.2s ease;
}
.sp-modal-backdrop.is-open {
  opacity: 1;
}
.sp-modal-backdrop[hidden] {
  display: none !important;
}
.sp-modal {
  width: 100%;
  max-width: 420px;
  background: var(--sp-white);
  border: 1px solid var(--sp-line);
  border-radius: var(--sp-radius-xl);
  padding: 1.75rem 1.5rem 1.5rem;
  text-align: center;
  transform: translateY(12px) scale(0.98);
  transition: transform 0.22s ease;
}
.sp-modal-backdrop.is-open .sp-modal {
  transform: none;
}
.sp-modal-icon {
  width: 3rem;
  height: 3rem;
  border-radius: 0.85rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  background: var(--sp-orange-soft);
  color: var(--sp-orange);
  border: 1px solid #ffd8c2;
}
.sp-modal--warn .sp-modal-icon,
.sp-modal--danger .sp-modal-icon {
  background: #fff4ed;
  color: var(--sp-orange);
}
.sp-modal--success .sp-modal-icon {
  background: var(--sp-orange-soft);
  color: var(--sp-orange);
}
.sp-modal--cta .sp-modal-icon {
  background: var(--sp-black);
  color: var(--sp-orange);
  border-color: #333;
}
.sp-modal-title {
  font-family: var(--sp-font-display);
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--sp-black);
  margin: 0 0 0.5rem;
}
.sp-modal-msg {
  font-size: 0.875rem;
  color: #555;
  line-height: 1.55;
  margin: 0 0 1.35rem;
}
.sp-modal-actions {
  display: flex;
  flex-direction: column-reverse;
  gap: 0.5rem;
}
@media (min-width: 420px) {
  .sp-modal-actions {
    flex-direction: row;
    justify-content: center;
  }
}
.sp-modal-btn {
  flex: 1;
  min-height: 44px;
  border-radius: var(--sp-radius);
  font-family: var(--sp-font-display);
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  border: 1.5px solid var(--sp-line);
  background: var(--sp-white);
  color: var(--sp-black);
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.sp-modal-btn--primary {
  background: var(--sp-orange);
  border-color: var(--sp-orange);
  color: #fff;
}
.sp-modal-btn--primary:hover {
  background: var(--sp-orange-hover);
}
.sp-modal-btn--danger {
  background: var(--sp-black);
  border-color: var(--sp-black);
  color: #fff;
}
.sp-modal-btn--danger:hover {
  border-color: var(--sp-orange);
  color: var(--sp-orange);
}
.sp-modal-btn--ghost:hover {
  border-color: var(--sp-black);
  background: var(--sp-surface-2);
}

/* Dark app modals inherit when body is dark */
body.sp-app-body .sp-modal {
  background: var(--sp-app-card);
  border-color: var(--sp-app-line);
}
body.sp-app-body .sp-modal-title {
  color: #fff;
}
body.sp-app-body .sp-modal-msg {
  color: #aaa;
}
body.sp-app-body .sp-modal-btn--ghost {
  background: transparent;
  border-color: var(--sp-app-line-2);
  color: #fff;
}

/* PWA install modal */
#sp-pwa-modal {
  position: fixed;
  inset: 0;
  z-index: 220;
}
#sp-pwa-modal[hidden] {
  display: none !important;
}
.sp-pwa-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  transition: opacity 0.2s ease;
}
#sp-pwa-modal.is-open .sp-pwa-backdrop {
  opacity: 1;
}
.sp-pwa-dialog {
  position: relative;
  width: 100%;
  max-width: 400px;
  background: #fff;
  border: 1px solid var(--sp-line);
  border-radius: 1.25rem;
  padding: 1.75rem 1.35rem 1.35rem;
  text-align: center;
  transform: translateY(12px);
  transition: transform 0.22s ease;
}
#sp-pwa-modal.is-open .sp-pwa-dialog {
  transform: none;
}
.sp-pwa-close {
  position: absolute;
  top: 0.65rem;
  right: 0.75rem;
  border: none;
  background: transparent;
  font-size: 1.5rem;
  line-height: 1;
  color: #888;
  cursor: pointer;
  width: 2.25rem;
  height: 2.25rem;
}
.sp-pwa-close:hover {
  color: #000;
}
.sp-pwa-icon {
  width: 3rem;
  height: 3rem;
  margin: 0 auto 0.85rem;
  border-radius: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--sp-orange-soft);
  color: var(--sp-orange);
  border: 1px solid #ffd8c2;
}
.sp-pwa-title {
  font-family: var(--sp-font-display);
  font-weight: 700;
  font-size: 1.15rem;
  margin: 0 0 0.45rem;
  color: #000;
}
.sp-pwa-msg {
  font-size: 0.875rem;
  color: #555;
  line-height: 1.5;
  margin: 0 0 0.85rem;
}
.sp-pwa-list {
  text-align: left;
  margin: 0 0 1.15rem;
  padding: 0 0 0 1.1rem;
  font-size: 0.8125rem;
  color: #444;
  line-height: 1.6;
}
.sp-pwa-actions {
  display: flex;
  flex-direction: column-reverse;
  gap: 0.5rem;
}
@media (min-width: 400px) {
  .sp-pwa-actions {
    flex-direction: row;
  }
}
.sp-pwa-btn {
  flex: 1;
  min-height: 44px;
  border-radius: 0.75rem;
  font-family: var(--sp-font-display);
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  border: 1.5px solid #e5e5e5;
  background: #fff;
  color: #000;
}
.sp-pwa-btn-primary {
  background: #f26622;
  border-color: #f26622;
  color: #fff;
}
.sp-pwa-btn-primary:hover {
  background: #d9541a;
}
.sp-pwa-btn-ghost:hover {
  border-color: #000;
  background: #f7f7f7;
}
.sp-pwa-hint {
  margin: 0.75rem 0 0;
  font-size: 0.75rem;
  color: #888;
  min-height: 1.1em;
}
body.sp-app-body .sp-pwa-dialog {
  background: #111;
  border-color: #222;
}
body.sp-app-body .sp-pwa-title {
  color: #fff;
}
body.sp-app-body .sp-pwa-msg,
body.sp-app-body .sp-pwa-list {
  color: #aaa;
}
body.sp-app-body .sp-pwa-btn-ghost {
  background: transparent;
  border-color: #333;
  color: #fff;
}

/* Feature comparison (reimagined) */
.sp-compare {
  border: 1px solid var(--sp-line);
  border-radius: var(--sp-radius-lg);
  overflow: hidden;
  background: var(--sp-white);
}
.sp-compare-head {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr 0.8fr;
  gap: 0;
  background: var(--sp-black);
  color: #fff;
  padding: 0.85rem 1rem;
  align-items: center;
}
.sp-compare-head span {
  font-family: var(--sp-font-display);
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.sp-compare-head .pro-col {
  color: var(--sp-orange);
  text-align: center;
}
.sp-compare-head .free-col {
  text-align: center;
  color: #ccc;
}
.sp-compare-row {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr 0.8fr;
  padding: 0.85rem 1rem;
  border-top: 1px solid var(--sp-line);
  align-items: center;
  gap: 0.5rem;
  transition: background 0.15s;
}
.sp-compare-row:hover {
  background: var(--sp-orange-soft);
}
.sp-compare-row:nth-child(even) {
  background: var(--sp-surface-2);
}
.sp-compare-row:nth-child(even):hover {
  background: var(--sp-orange-soft);
}
.sp-compare-feat {
  font-size: 0.8125rem;
  color: #222;
  font-weight: 500;
}
.sp-compare-cell {
  text-align: center;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #666;
}
.sp-compare-yes {
  color: var(--sp-orange);
  font-size: 1.1rem;
}
.sp-compare-no {
  color: #ccc;
  font-size: 1.1rem;
}
.sp-compare-pro {
  color: var(--sp-orange);
}
.sp-compare-foot {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr 0.8fr;
  background: var(--sp-surface-2);
  border-top: 1px solid var(--sp-line);
  padding: 1rem;
  gap: 0.5rem;
  align-items: center;
}
@media (max-width: 560px) {
  .sp-compare-head,
  .sp-compare-row,
  .sp-compare-foot {
    grid-template-columns: 1fr 0.7fr 0.7fr;
    padding: 0.75rem;
  }
  .sp-compare-feat {
    font-size: 0.75rem;
  }
}

/* Dashboard empty + filters — always stacked & centered (mobile-first) */
.sp-empty,
#first-empty.sp-empty,
.card.sp-empty {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  width: 100% !important;
  max-width: 100% !important;
  padding: 2rem 1.25rem !important;
  box-sizing: border-box;
  gap: 0;
}
.sp-empty.hidden,
#first-empty.sp-empty.hidden {
  display: none !important;
}
.sp-empty-icon {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 1rem;
  margin: 0 auto 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--sp-orange-dim);
  color: var(--sp-orange);
  border: 1px solid rgba(242, 102, 34, 0.25);
}
.sp-empty h3,
.sp-empty .sp-empty-title {
  margin: 0 0 0.5rem;
  font-size: 1.125rem;
  color: #fff;
  width: 100%;
  max-width: 22rem;
}
.sp-empty p,
.sp-empty .sp-empty-desc {
  margin: 0 auto 1.25rem;
  max-width: 22rem;
  width: 100%;
  font-size: 0.875rem;
  color: #888;
  line-height: 1.55;
}
.sp-empty-actions {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  justify-content: center !important;
  gap: 0.5rem !important;
  width: 100% !important;
  max-width: 18rem;
  margin: 0 auto;
}
.sp-empty-actions .btn-brand,
.sp-empty-actions .btn-ghost,
.sp-empty-actions a {
  width: 100% !important;
  justify-content: center !important;
  min-height: 44px;
}
@media (min-width: 480px) {
  .sp-empty,
  #first-empty.sp-empty,
  .card.sp-empty {
    padding: 2.75rem 2rem !important;
  }
  .sp-empty-actions {
    flex-direction: row !important;
    flex-wrap: wrap !important;
    max-width: none;
    width: auto !important;
  }
  .sp-empty-actions .btn-brand,
  .sp-empty-actions .btn-ghost,
  .sp-empty-actions a {
    width: auto !important;
  }
}
/* When overview is empty, hide noisy widgets */
#overview-when-empty-hide.hidden,
.sp-hide-when-empty.hidden {
  display: none !important;
}
.sp-filter-panel {
  border: 1px solid var(--sp-app-line);
  border-radius: var(--sp-radius-lg);
  background: var(--sp-app-card);
  overflow: hidden;
  margin-bottom: 1rem;
}
.sp-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  cursor: pointer;
  user-select: none;
  border: none;
  width: 100%;
  background: transparent;
  color: #fff;
  font-family: var(--sp-font-display);
  font-weight: 600;
  font-size: 0.8125rem;
  text-align: left;
}
.sp-filter-bar:hover {
  background: rgba(255, 255, 255, 0.03);
}
.sp-filter-body {
  display: none;
  padding: 0 1rem 1rem;
  border-top: 1px solid var(--sp-app-line);
}
.sp-filter-panel.is-open .sp-filter-body {
  display: block;
  padding-top: 0.85rem;
}
.sp-filter-panel.is-open .sp-filter-chevron {
  transform: rotate(180deg);
}
.sp-filter-chevron {
  transition: transform 0.2s;
  color: #888;
}
.sp-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.65rem;
}
.sp-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  background: var(--sp-orange-dim);
  color: var(--sp-orange);
  border: 1px solid rgba(242, 102, 34, 0.25);
}
.sp-chip button {
  border: none;
  background: none;
  color: inherit;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  font-size: 0.85rem;
}

/* Analyzer results mobile dock */
.sp-results-dock {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  display: flex;
  gap: 0.5rem;
  padding: 0.65rem 0.85rem;
  padding-bottom: calc(0.65rem + env(safe-area-inset-bottom, 0px));
  background: rgba(255, 255, 255, 0.97);
  border-top: 1px solid var(--sp-line);
}
#results-section {
  padding-bottom: 5.5rem;
}
@media (min-width: 640px) {
  #results-section {
    padding-bottom: 6rem;
  }
}

/* Drawer toggle — works desktop + mobile */
.sp-drawer-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.65rem;
  border: 1px solid var(--sp-app-line);
  background: transparent;
  color: #ccc;
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.sp-drawer-btn:hover {
  border-color: var(--sp-orange);
  color: var(--sp-orange);
  background: var(--sp-orange-dim);
}
.sp-drawer-logo {
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
  display: inline-flex;
  align-items: center;
}
/* Desktop collapsible sidebar */
@media (min-width: 769px) {
  body.sp-sidebar-collapsed .sp-app-sidebar,
  body.sp-sidebar-collapsed #sidebar {
    width: 0 !important;
    min-width: 0 !important;
    overflow: hidden;
    border-right-width: 0;
    opacity: 0;
    pointer-events: none;
  }
  body.sp-sidebar-collapsed .sp-app-main,
  body.sp-sidebar-collapsed #main-content {
    width: 100%;
  }
}
