:root {
  color-scheme: dark;
}

.sw-page {
  min-height: 100vh;
  font-family: var(--forge-font-sans, 'DM Sans', system-ui, sans-serif);
}

.sw-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.25rem;
}

.sw-brand {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.sw-brand-icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.75rem;
  display: grid;
  place-items: center;
  font-weight: 700;
  background: linear-gradient(135deg, #38bdf8, #6366f1);
  color: #0f172a;
}

.sw-brand-sub {
  margin: 0;
  font-size: 0.75rem;
  color: var(--forge-color-muted, #94a3b8);
}

.sw-nav-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.nav-btn {
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  color: var(--forge-color-text, #e2e8f0);
  padding: 0.55rem 0.75rem;
  border-radius: 0.5rem;
  cursor: pointer;
  font: inherit;
}

.nav-btn:hover,
.nav-btn.active {
  background: rgba(56, 189, 248, 0.12);
  color: #7dd3fc;
}

.sw-disclosure {
  margin-top: auto;
  font-size: 0.75rem;
  color: var(--forge-color-muted, #94a3b8);
  line-height: 1.4;
}

.sw-main-wrap {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.sw-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--forge-color-border, rgba(148, 163, 184, 0.2));
}

.sw-header-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.sw-main {
  padding: 1rem 1.5rem 2rem;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.sw-hero-grid {
  display: grid;
  grid-template-columns: minmax(220px, 280px) 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.sw-health-card {
  text-align: center;
  padding: 1.25rem;
}

.health-ring {
  width: 8rem;
  height: 8rem;
  margin: 0.75rem auto;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 4px solid rgba(148, 163, 184, 0.3);
}

.health-ring.health-strong { border-color: #22c55e; box-shadow: 0 0 24px rgba(34, 197, 94, 0.25); }
.health-ring.health-stable { border-color: #38bdf8; box-shadow: 0 0 24px rgba(56, 189, 248, 0.2); }
.health-ring.health-watch { border-color: #fbbf24; }
.health-ring.health-risk { border-color: #f87171; }

.health-score-value {
  font-size: 2rem;
  font-weight: 700;
  font-family: var(--forge-font-mono, 'JetBrains Mono', monospace);
}

.health-label {
  font-weight: 600;
  margin: 0.25rem 0 0.75rem;
}

.sw-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
}

.sw-kpi {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.sw-kpi-label {
  font-size: 0.8rem;
  color: var(--forge-color-muted, #94a3b8);
}

.sw-kpi-value {
  font-size: clamp(1.1rem, 2vw, 1.35rem);
  font-weight: 700;
  font-family: var(--forge-font-mono, 'JetBrains Mono', monospace);
}

.sw-kpi-sub {
  font-size: 0.75rem;
  color: var(--forge-color-muted, #94a3b8);
}

.sw-chart-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

.sw-chart-card {
  padding: 1rem;
}

.sw-chart-card h3 {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
}

.chart-wrap {
  height: 220px;
  position: relative;
}

.sw-detail-panel {
  padding: 1rem;
  margin-bottom: 1rem;
}

.detail-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.65rem;
}

.detail-list li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.95rem;
}

.detail-list span {
  color: var(--forge-color-muted, #94a3b8);
}

.sw-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.75rem 1rem;
}

.sw-muted {
  color: var(--forge-color-muted, #94a3b8);
  font-size: 0.9rem;
}

@media (max-width: 768px) {
  .sw-hero-grid {
    grid-template-columns: 1fr;
  }

  .sw-header {
    padding: 1rem;
  }

  .sw-main {
    padding: 0.75rem 1rem 1.5rem;
  }
}

@media (max-width: 360px) {
  .sw-kpi-grid {
    grid-template-columns: 1fr 1fr;
  }
}


/* design-identity motion + responsive floor */
button, .forge-btn, a, .nav-btn, input, select {
  transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}
button:hover, .forge-btn:hover, a:hover, .nav-btn:hover {
  filter: brightness(1.05);
}
.forge-shell-kpi-row { display: grid; gap: 1rem; }
.kpi-card { padding: 1.25rem; border-radius: 0.75rem; }
.kpi-value { font-size: clamp(1.25rem, 2vw, 1.75rem); font-weight: 700; }
@media (max-width: 768px) {
  .app-shell, .forge-page { flex-direction: column; }
}

/* Tesla feel shell */
.tesla-marketing { background: hsl(var(--background, 0 0% 100%)); color: inherit; }
.tesla-hero-fullbleed { position: relative; min-height: 100svh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; color: #fff; padding: 6rem 1.5rem 4rem; overflow: hidden; }
.tesla-hero-fullbleed__media, .entry-plate { position: absolute; inset: 0; z-index: 0; }
.tesla-hero-fullbleed__photo { width: 100%; height: 100%; object-fit: cover; display: block; }
.tesla-hero-fullbleed__overlay { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,0.2) 0%, rgba(0,0,0,0.55) 100%); z-index: 1; }
.tesla-hero-fullbleed__content { position: relative; z-index: 2; max-width: 44rem; }
.tesla-hero-title, .marketing-hero__title { font-size: clamp(2.5rem, 6vw, 4.25rem); font-weight: 600; color: #fff; margin: 0 0 0.75rem; }
.tesla-hero-subhead, .marketing-hero__sub { color: rgba(255,255,255,0.92); font-size: clamp(1rem, 2vw, 1.25rem); line-height: 1.5; margin: 0 auto 1.5rem; max-width: 36rem; }
.tesla-marketing-nav, .marketing-nav { position: absolute; top: 0; left: 0; right: 0; z-index: 3; display: flex; align-items: center; justify-content: space-between; padding: 1.25rem 1.75rem; color: #fff; }
.tesla-marketing-nav__brand { font-weight: 600; font-size: 1.1rem; }
.tesla-nav-link, .tesla-glass-cta { border-radius: 999px; background: rgba(255,255,255,0.92); color: #171717; font-weight: 600; padding: 0.75rem 1.5rem; border: none; cursor: pointer; font-size: 0.95rem; }
.tesla-glass-cta--ghost { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,0.45); }
.tesla-hero-cta-row { display: flex; flex-wrap: wrap; gap: 0.75rem; justify-content: center; }
.tesla-section-stack, .how-it-works { display: grid; gap: 0; max-width: 56rem; margin: 0 auto; padding: 0 1.5rem 3rem; }
.tesla-editorial-section { text-align: center; padding: 3rem 0; border-top: 1px solid hsl(var(--border, 0 0% 85%)); }
.tesla-section-title { font-size: clamp(1.75rem, 4vw, 2.5rem); margin: 0 0 0.5rem; }
.tesla-section-body { color: hsl(var(--muted-foreground, 0 0% 40%)); max-width: 32rem; margin: 0 auto; line-height: 1.55; }
.auth-plate { min-height: 100svh; display: grid; place-items: center; padding: 2rem 1.5rem; background: hsl(var(--background, 0 0% 98%)); }
.auth-plate__card { width: min(100%, 24rem); padding: 2rem; border-radius: 1rem; border: 1px solid hsl(var(--border, 0 0% 85%)); background: hsl(var(--card, 0 0% 100%)); box-shadow: 0 8px 32px rgba(0,0,0,0.08); }
.auth-plate__title { font-size: 1.5rem; font-weight: 600; margin: 0 0 0.5rem; }
.auth-plate__lead { color: hsl(var(--muted-foreground, 0 0% 40%)); margin: 0 0 1.25rem; line-height: 1.45; }
.auth-plate__form { display: grid; gap: 0.75rem; }
.auth-plate__form input { width: 100%; padding: 0.65rem 0.85rem; border-radius: 0.5rem; border: 1px solid hsl(var(--border, 0 0% 85%)); }
.auth-plate__actions { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.5rem; }
.screen-app[hidden], #screen-landing[hidden], #screen-signin[hidden] { display: none !important; }

