:root {
  --shell-bg: #02060c;
  --shell-bg-deep: #050b14;
  --panel-surface: rgba(8, 13, 23, 0.84);
  --panel-surface-strong: rgba(6, 10, 18, 0.94);
  --panel-border: rgba(126, 154, 184, 0.16);
  --panel-border-bright: rgba(0, 240, 255, 0.22);
  --text-primary: #f7fbff;
  --text-secondary: #b2c1d3;
  --text-muted: #88a0b9;
  --accent: #00f0ff;
  --accent-soft: rgba(0, 240, 255, 0.14);
  --shadow-xl: 0 24px 80px rgba(0, 0, 0, 0.42);
  --shadow-md: 0 12px 34px rgba(0, 0, 0, 0.28);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 16px;
}

html {
  background: var(--shell-bg);
  color-scheme: dark;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(0, 240, 255, 0.1), transparent 24rem),
    radial-gradient(circle at 85% 10%, rgba(56, 189, 248, 0.08), transparent 22rem),
    linear-gradient(180deg, #03070d 0%, #02060c 38%, #07101e 100%);
  color: var(--text-primary);
  overflow-x: hidden;
  position: relative;
  font-family: "Avenir Next", "Segoe UI", "Helvetica Neue", sans-serif;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: auto;
  pointer-events: none;
  z-index: 0;
  filter: blur(14px);
}

body::before {
  top: 9rem;
  right: -6rem;
  width: 20rem;
  height: 20rem;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(0, 240, 255, 0.16) 0%, rgba(0, 240, 255, 0) 72%);
}

body::after {
  left: -7rem;
  bottom: 6rem;
  width: 22rem;
  height: 22rem;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(34, 211, 238, 0.12) 0%, rgba(34, 211, 238, 0) 74%);
}

a {
  color: inherit;
}

img,
svg,
canvas {
  max-width: 100%;
}

.container {
  max-width: 1380px !important;
  padding: clamp(18px, 2.5vw, 32px) !important;
  position: relative;
  z-index: 1;
}

.nav {
  position: sticky;
  top: 12px;
  z-index: 40;
  margin-bottom: 30px !important;
  padding: 14px 16px !important;
  border: 1px solid rgba(126, 154, 184, 0.14);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(7, 11, 18, 0.92), rgba(7, 11, 18, 0.74));
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.36);
  backdrop-filter: blur(18px);
}

.brand {
  color: var(--text-primary) !important;
  font-family: "Avenir Next", "Arial Narrow", sans-serif;
  font-size: clamp(30px, 4vw, 38px) !important;
  font-weight: 900 !important;
  letter-spacing: -0.06em !important;
  text-decoration: none;
  text-shadow: none !important;
  position: relative;
}

.brand::after {
  content: "";
  display: block;
  width: 68%;
  height: 0.22rem;
  margin-top: 0.2rem;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), rgba(0, 240, 255, 0));
}

.nav-links {
  gap: 12px !important;
}

.nav-link,
.sync-nav-btn {
  min-height: 46px;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease,
    color 160ms ease,
    box-shadow 160ms ease;
}

.nav-link {
  padding: 11px 15px !important;
  border-radius: 999px !important;
  border: 1px solid rgba(126, 154, 184, 0.16) !important;
  background: rgba(255, 255, 255, 0.03) !important;
  color: var(--text-secondary) !important;
  font-size: 13px;
  font-weight: 800 !important;
  letter-spacing: 0.03em;
}

.nav-link:hover,
.sync-nav-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(0, 240, 255, 0.28) !important;
  box-shadow: 0 14px 28px rgba(0, 240, 255, 0.12);
}

.nav-link.active {
  color: #021015 !important;
  background: linear-gradient(135deg, #dffcff 0%, var(--accent) 70%) !important;
  border-color: rgba(223, 252, 255, 0.75) !important;
  box-shadow: 0 16px 30px rgba(0, 240, 255, 0.22);
}

.sync-nav-btn {
  border-radius: 999px !important;
  border-color: rgba(126, 154, 184, 0.16) !important;
  background: rgba(255, 255, 255, 0.03) !important;
}

.page-title,
.section-title,
.command-title,
.builder-highlight-title,
h1 {
  color: var(--text-primary);
  font-family: "Avenir Next", "Arial Narrow", sans-serif;
  letter-spacing: -0.055em;
}

.page-title,
h1 {
  font-size: clamp(40px, 5vw, 64px) !important;
  line-height: 0.96 !important;
}

.page-subtitle,
.page-subtitle strong,
.hero-note,
.page-subtitle span,
.page-subtitle a,
.section-copy,
.section-note,
.subtle,
.hero-note,
.builder-highlight-copy,
.command-copy,
.command-card-copy,
.builder-side-copy,
.install-card-copy {
  color: var(--text-secondary) !important;
}

.panel,
.card,
.state-card,
.calendar-card,
.feature-panel,
.command-panel,
.hero-panel,
.install-panel,
.builder-panel,
.season-panel,
.command-card,
.command-stat,
.builder-highlight,
.builder-side,
.install-card,
.settings-row,
.sync-stat,
.projection-card,
.hero-status-card,
.activity-item,
.preview-day-column,
.modal {
  border-color: var(--panel-border) !important;
  background: linear-gradient(180deg, rgba(8, 13, 23, 0.96), rgba(4, 8, 16, 0.96)) !important;
  box-shadow: var(--shadow-xl);
  backdrop-filter: blur(12px);
}

.panel,
.state-card,
.calendar-card,
.feature-panel,
.command-panel,
.hero-panel,
.install-panel,
.builder-panel,
.season-panel,
.modal {
  border-radius: var(--radius-xl) !important;
}

.card,
.command-card,
.command-stat,
.builder-highlight,
.builder-side,
.install-card,
.settings-row,
.sync-stat,
.projection-card,
.hero-status-card,
.activity-item,
.preview-day-column {
  border-radius: var(--radius-lg) !important;
}

.hero-panel,
.command-panel,
.install-panel,
.builder-panel {
  position: relative;
  overflow: hidden;
}

.hero-panel::before,
.command-panel::before,
.builder-panel::before,
.install-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(120deg, rgba(0, 240, 255, 0.1), rgba(0, 240, 255, 0) 42%),
    radial-gradient(circle at 100% 0%, rgba(143, 124, 255, 0.12), rgba(143, 124, 255, 0) 34%);
  pointer-events: none;
}

.page-title + .page-subtitle,
.page-title + .hero-note {
  max-width: 820px;
}

.button,
.btn,
.command-action,
.action-btn,
button,
input[type="submit"] {
  border-radius: 16px !important;
  font-weight: 800 !important;
  letter-spacing: 0.01em;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    border-color 160ms ease,
    background 160ms ease,
    color 160ms ease;
}

.button:hover,
.btn:hover,
.command-action:hover,
.action-btn:hover,
button:hover,
input[type="submit"]:hover {
  transform: translateY(-1px);
}

.button.primary,
.btn.primary,
button.primary,
.nav-link.active,
input[type="submit"] {
  box-shadow: 0 16px 32px rgba(0, 240, 255, 0.18);
}

.button.secondary,
.btn.secondary,
.command-action.secondary,
button.secondary {
  border-color: rgba(126, 154, 184, 0.18) !important;
  background: rgba(255, 255, 255, 0.04) !important;
  color: var(--text-primary) !important;
}

.button.secondary:hover,
.btn.secondary:hover,
.command-action.secondary:hover,
button.secondary:hover {
  border-color: rgba(0, 240, 255, 0.26) !important;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="number"],
select,
textarea,
input[type="file"] {
  border-radius: 16px !important;
  border: 1px solid rgba(126, 154, 184, 0.18) !important;
  background: rgba(4, 9, 18, 0.92) !important;
  color: var(--text-primary) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

input::placeholder,
textarea::placeholder {
  color: var(--text-muted);
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible,
a:focus-visible {
  outline: none;
  border-color: rgba(0, 240, 255, 0.46) !important;
  box-shadow:
    0 0 0 3px rgba(0, 240, 255, 0.12),
    0 18px 30px rgba(0, 0, 0, 0.24);
}

.metric-label,
.settings-name,
.command-kicker,
.builder-metric-label,
.command-stat-label,
.weekly-archetype-badge,
.eyebrow {
  color: #8eefff !important;
  letter-spacing: 0.14em !important;
}

.metric-value,
.command-stat-value,
.builder-metric-value {
  color: var(--text-primary) !important;
  letter-spacing: -0.04em;
}

.meta-chip,
.status-pill,
.weekly-archetype-badge {
  border-color: rgba(0, 240, 255, 0.18) !important;
  background: rgba(0, 240, 255, 0.1) !important;
  color: #dffcff !important;
}

.empty,
.info-box {
  border-radius: var(--radius-lg) !important;
  border-color: rgba(126, 154, 184, 0.16) !important;
  background: rgba(7, 14, 24, 0.8) !important;
}

.activity-item,
.preview-workout-card {
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.activity-item:hover,
.preview-workout-card:hover {
  transform: translateY(-2px);
  border-color: rgba(0, 240, 255, 0.26) !important;
  box-shadow: 0 18px 32px rgba(0, 240, 255, 0.08);
}

.modal-backdrop {
  backdrop-filter: blur(12px);
  background: rgba(1, 5, 10, 0.76) !important;
}

.unit-toggle {
  border-color: rgba(126, 154, 184, 0.16) !important;
  background: rgba(255, 255, 255, 0.03) !important;
  border-radius: 999px !important;
  padding: 4px;
}

.unit-btn {
  border-radius: 999px !important;
}

.unit-btn.active {
  box-shadow: 0 10px 20px rgba(0, 240, 255, 0.18);
}

.chart-wrap {
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(5, 10, 18, 0.92), rgba(3, 6, 12, 0.92));
  border: 1px solid rgba(126, 154, 184, 0.12);
  padding: 14px;
}

::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.03);
}

::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(126, 154, 184, 0.28);
  border: 2px solid transparent;
  background-clip: padding-box;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 240, 255, 0.35);
  background-clip: padding-box;
}

@media (max-width: 1024px) {
  .nav {
    top: 8px;
    padding: 12px 14px !important;
  }

  .brand {
    font-size: 30px !important;
  }

  .page-title,
  h1 {
    font-size: clamp(34px, 7vw, 48px) !important;
  }
}

@media (max-width: 640px) {
  body::before,
  body::after {
    opacity: 0.72;
  }

  .container {
    padding: 16px !important;
  }

  .nav {
    border-radius: 20px;
  }

  .nav-links {
    width: 100%;
  }

  .nav-link {
    justify-content: center;
    flex: 1 1 calc(50% - 12px);
  }

  .page-title,
  h1 {
    font-size: clamp(30px, 10vw, 40px) !important;
  }
}
