:root {
  color-scheme: dark;
  --bg: #09111f;
  --bg-elevated: #121d31;
  --bg-soft: #192842;
  --card: rgba(17, 29, 49, 0.9);
  --card-strong: rgba(10, 24, 45, 0.95);
  --line: rgba(89, 118, 160, 0.3);
  --text: #f5f7fb;
  --muted: #9fb4d3;
  --accent: #1683ff;
  --accent-strong: #0f5bc5;
  --accent-soft: rgba(22, 131, 255, 0.18);
  --support: #60a5fa;
  --success: #7dd3fc;
  --warning: #f4d35e;
  --danger: #fb7185;
  --white: #ffffff;
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.35);
}

body.light-theme {
  color-scheme: light;
  --bg: #e7eef9;
  --bg-elevated: #f4f8ff;
  --bg-soft: #ffffff;
  --card: rgba(255, 255, 255, 0.96);
  --card-strong: rgba(255, 255, 255, 0.98);
  --line: rgba(22, 47, 86, 0.12);
  --text: #10203b;
  --muted: #536580;
  --accent: #0f6fe8;
  --accent-strong: #0c4ca0;
  --accent-soft: rgba(15, 111, 232, 0.14);
  --support: #155eef;
  --success: #0ea5e9;
  --warning: #ca8a04;
  --danger: #e11d48;
  --white: #ffffff;
  --shadow: 0 18px 50px rgba(34, 72, 127, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(22, 131, 255, 0.18), transparent 34%),
    radial-gradient(circle at top right, rgba(15, 91, 197, 0.2), transparent 28%),
    linear-gradient(160deg, var(--bg) 0%, #060c17 100%);
  color: var(--text);
  min-height: 100vh;
}

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

button {
  cursor: pointer;
  border: 0;
  transition:
    transform 160ms ease,
    opacity 160ms ease,
    background 160ms ease;
}

button:hover,
.import-btn:hover {
  transform: translateY(-1px);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
  transform: none;
}

.hidden {
  display: none !important;
}

.app-shell {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.25rem 0 4rem;
}

.hero-panel,
.panel-section,
.panel-card,
.workout-modal {
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.hero-panel {
  padding: 1.5rem;
  border-radius: 30px;
  display: grid;
  grid-template-columns: 1.8fr 1fr;
  gap: 1.5rem;
  overflow: hidden;
  position: relative;
}

.hero-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(120deg, transparent 0 66%, rgba(20, 109, 235, 0.2) 66% 74%, transparent 74%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent);
  pointer-events: none;
}

.hero-copy,
.hero-badge-card {
  position: relative;
  z-index: 1;
}

.eyebrow {
  margin: 0 0 0.75rem;
  font-size: 0.82rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--support);
}

h1,
h2,
h3,
h4,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0.75rem;
  font-size: clamp(2.2rem, 4vw, 4rem);
  line-height: 0.98;
}

h2 {
  font-size: clamp(1.5rem, 2vw, 2.2rem);
  margin-bottom: 0.4rem;
}

.hero-description,
.section-heading p,
.feature-card p,
.panel-card p,
.helper-text,
.review-card,
.disclaimer,
.timeline-stats,
.success-text,
.app-footer p {
  color: var(--muted);
}

.hero-actions,
.wizard-actions,
.dashboard-tools,
.settings-grid,
.filter-group {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.primary-btn,
.secondary-btn,
.ghost-btn,
.danger-btn,
.import-btn {
  border-radius: 16px;
  padding: 0.9rem 1.1rem;
  font-weight: 700;
}

.primary-btn {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
  color: var(--white);
}

.secondary-btn {
  background: linear-gradient(135deg, rgba(96, 165, 250, 0.25), rgba(22, 131, 255, 0.2));
  color: var(--text);
  border: 1px solid rgba(96, 165, 250, 0.26);
}

.ghost-btn,
.import-btn {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  border: 1px solid var(--line);
}

.danger-btn {
  background: rgba(251, 113, 133, 0.14);
  color: #ffd9df;
  border: 1px solid rgba(251, 113, 133, 0.28);
}

.hero-badge-card,
.feature-card,
.review-card,
.warning-card,
.summary-grid article,
.stats-grid article,
.timeline-card,
.modal-section,
.workout-entry,
.equipment-group,
.sticky-summary,
.chart-bar,
.weekly-item {
  background: var(--card-strong);
  border: 1px solid var(--line);
  border-radius: 24px;
}

.hero-badge-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 260px;
  text-align: center;
  gap: 1rem;
}

.brand-orb {
  width: 180px;
  aspect-ratio: 1;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background:
    linear-gradient(120deg, #1a2132 0 45%, #183d78 45% 52%, #0f5bc5 52% 62%, #1683ff 62% 100%);
  box-shadow:
    inset 0 0 20px rgba(255, 255, 255, 0.08),
    0 20px 40px rgba(0, 0, 0, 0.38);
}

.brand-orb span {
  font-size: 4rem;
  font-weight: 900;
  color: white;
  letter-spacing: -0.08em;
}

.panel-section {
  margin-top: 1.25rem;
  padding: 1.35rem;
  border-radius: 28px;
}

.feature-grid,
.summary-grid,
.stats-grid,
.timeline-grid,
.panel-grid,
.settings-grid {
  display: grid;
  gap: 1rem;
}

.feature-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 1rem 0 1.25rem;
}

.feature-card,
.review-card,
.warning-card,
.summary-grid article,
.stats-grid article,
.panel-card,
.timeline-card,
.equipment-group,
.modal-section,
.weekly-item {
  padding: 1rem;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

label {
  display: grid;
  gap: 0.45rem;
  color: var(--text);
  font-weight: 600;
}

input,
select,
textarea {
  width: 100%;
  padding: 0.85rem 0.95rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  border: 1px solid var(--line);
}

textarea {
  min-height: 110px;
  resize: vertical;
}

.wizard-progress {
  margin-bottom: 1rem;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 999px;
  overflow: hidden;
  height: 10px;
}

.wizard-progress-bar {
  height: 100%;
  width: 16.66%;
  background: linear-gradient(90deg, var(--accent), var(--support));
  transition: width 220ms ease;
}

.tag-grid,
.badges-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.tag-option {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.75rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
}

.tag-option input {
  width: auto;
  accent-color: var(--accent);
}

.equipment-groups,
.chart-stack,
.weekly-summary,
.timeline-stats {
  display: grid;
  gap: 1rem;
}

.equipment-group h4,
.modal-section h4,
.panel-card h3 {
  margin-bottom: 0.8rem;
}

.equipment-items {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.block-label {
  margin-bottom: 0.75rem;
  font-weight: 700;
}

.stack-block {
  margin-top: 1rem;
}

.warning-card {
  border-color: rgba(244, 211, 94, 0.35);
  background: rgba(244, 211, 94, 0.08);
  color: #ffefb0;
}

.success-text {
  margin-top: 1rem;
}

.summary-grid,
.stats-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.summary-grid article strong,
.stats-grid article strong,
.snapshot-value {
  display: block;
  font-size: 1.35rem;
  margin-top: 0.4rem;
}

.panel-grid {
  grid-template-columns: 1.2fr 1fr;
  margin-top: 1rem;
}

.sticky-summary {
  position: sticky;
  top: 1rem;
  align-self: start;
}

.timeline-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.search-label {
  width: min(280px, 100%);
}

.timeline-grid {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.timeline-card {
  display: grid;
  gap: 0.8rem;
}

.timeline-card-header,
.timeline-meta,
.workout-card-actions {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: flex-start;
  flex-wrap: wrap;
}

.badge,
.mini-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.38rem 0.75rem;
  font-size: 0.82rem;
  font-weight: 700;
  background: var(--accent-soft);
  color: var(--support);
}

.status-badge-completed {
  background: rgba(125, 211, 252, 0.15);
  color: #b8f0ff;
}

.status-badge-skipped {
  background: rgba(251, 113, 133, 0.14);
  color: #ffd2da;
}

.status-badge-partial {
  background: rgba(244, 211, 94, 0.14);
  color: #ffefb0;
}

.status-badge-not_started {
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
}

.progress-track {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--support));
}

.timeline-card textarea {
  min-height: 76px;
}

.timeline-stats {
  margin-bottom: 1rem;
}

.timeline-stats p {
  margin: 0;
}

.chart-bar {
  overflow: hidden;
}

.chart-bar-fill {
  height: 14px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--support));
  margin-top: 0.6rem;
}

.weekly-summary {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.weekly-item strong {
  display: block;
  margin-bottom: 0.35rem;
}

.badges-row .mini-badge {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.workout-modal {
  width: min(780px, calc(100% - 1rem));
  border-radius: 28px;
  padding: 0;
  color: var(--text);
}

.workout-modal::backdrop {
  background: rgba(2, 6, 23, 0.78);
}

.modal-header,
.modal-body {
  padding: 1.15rem 1.2rem;
}

.modal-header {
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.modal-body {
  display: grid;
  gap: 1rem;
  max-height: 72vh;
  overflow: auto;
}

.modal-section ul {
  margin: 0;
  padding-left: 1rem;
}

.workout-entry {
  margin-top: 0.8rem;
}

.snapshot-item {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.snapshot-item:last-child {
  border-bottom: 0;
}

.app-footer {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto 2.5rem;
  padding: 0 0 2rem;
}

.app-footer p {
  text-align: center;
  font-size: 0.9rem;
}

@media (max-width: 980px) {
  .hero-panel,
  .panel-grid {
    grid-template-columns: 1fr;
  }

  .summary-grid,
  .stats-grid,
  .feature-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .app-shell,
  .app-footer {
    width: min(100% - 1rem, 100%);
  }

  .hero-panel,
  .panel-section {
    border-radius: 22px;
    padding: 1rem;
  }

  .feature-grid,
  .summary-grid,
  .stats-grid,
  .form-grid,
  .settings-grid {
    grid-template-columns: 1fr;
  }

  .brand-orb {
    width: 140px;
  }

  .brand-orb span {
    font-size: 3rem;
  }

  .timeline-toolbar,
  .filter-group,
  .wizard-actions,
  .dashboard-tools {
    flex-direction: column;
  }

  .search-label {
    width: 100%;
  }
}

@media print {
  body {
    background: white;
    color: black;
  }

  .hero-panel,
  #wizardSection,
  #settingsSection,
  .timeline-toolbar,
  .workout-card-actions,
  .app-footer,
  #todayShortcutBtn,
  #themeToggleBtn {
    display: none !important;
  }

  .panel-section,
  .timeline-card {
    box-shadow: none;
    border: 1px solid #d0d7e2;
    background: white;
    color: black;
  }
}
