﻿:root {
  --bg: #0a1226;
  --bg-alt: #0d1b3b;
  --card: #22262d;
  --card-soft: #2f3642;
  --text: #f1f5f9;
  --text-muted: #9aa7bd;
  --accent: #24d3ee;
  --accent-soft: rgba(36, 211, 238, 0.2);
  --border: rgba(148, 163, 184, 0.2);
  --shadow: 0 18px 50px rgba(2, 6, 23, 0.45);
  --radius: 20px;
  --radius-sm: 14px;
  --font-display: "Space Grotesk", sans-serif;
  --font-body: "Space Grotesk", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(180deg, #143373 0%, #0c1a3b 45%, #0b1020 100%);
  color: var(--text);
  font-family: var(--font-body);
  letter-spacing: 0.01em;
}

@property --x1 {
  syntax: "<percentage>";
  inherits: false;
  initial-value: 20%;
}
@property --y1 {
  syntax: "<percentage>";
  inherits: false;
  initial-value: 20%;
}
@property --x2 {
  syntax: "<percentage>";
  inherits: false;
  initial-value: 80%;
}
@property --y2 {
  syntax: "<percentage>";
  inherits: false;
  initial-value: 30%;
}
@property --x3 {
  syntax: "<percentage>";
  inherits: false;
  initial-value: 60%;
}
@property --y3 {
  syntax: "<percentage>";
  inherits: false;
  initial-value: 85%;
}
@property --x4 {
  syntax: "<percentage>";
  inherits: false;
  initial-value: 15%;
}
@property --y4 {
  syntax: "<percentage>";
  inherits: false;
  initial-value: 70%;
}
@property --x5 {
  syntax: "<percentage>";
  inherits: false;
  initial-value: 90%;
}
@property --y5 {
  syntax: "<percentage>";
  inherits: false;
  initial-value: 65%;
}

.bg-shapes {
  position: fixed;
  inset: 0;
  --x1: 20%;
  --y1: 20%;
  --x2: 80%;
  --y2: 30%;
  --x3: 60%;
  --y3: 85%;
  --x4: 15%;
  --y4: 70%;
  --x5: 90%;
  --y5: 65%;
  background: radial-gradient(
      900px 650px at var(--x1) var(--y1),
      rgba(95, 67, 247, 0.45),
      transparent 70%
    ),
    radial-gradient(
      800px 600px at var(--x2) var(--y2),
      rgba(72, 117, 235, 0.45),
      transparent 68%
    ),
    radial-gradient(
      750px 550px at var(--x3) var(--y3),
      rgba(49, 168, 222, 0.4),
      transparent 70%
    ),
    radial-gradient(
      700px 500px at var(--x4) var(--y4),
      rgba(24, 222, 208, 0.35),
      transparent 72%
    ),
    radial-gradient(
      600px 450px at var(--x5) var(--y5),
      rgba(72, 117, 235, 0.25),
      transparent 70%
    ),
    linear-gradient(180deg, #0b1020 0%, #050712 100%);
  background-blend-mode: screen, screen, screen, screen, screen, normal;
  animation: moveLights 10s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.2rem;
  backdrop-filter: blur(12px);
  background: rgba(10, 18, 38, 0.85);
  border-bottom: 1px solid rgba(148, 163, 184, 0.08);
}

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

.brand-logo {
  width: 40px;
  height: 40px;
  object-fit: contain;
  border-radius: 10px;
  background: rgba(148, 163, 184, 0.12);
  padding: 4px;
}

.brand-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.02em;
}

.brand-subtitle {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.hero-title {
  margin: 1.5rem 0 1rem;
  text-align: center;
  font-family: var(--font-display);
  font-size: 1.9rem;
  color: var(--text);
}

.shell {
  position: relative;
  z-index: 1;
  padding: 1.5rem 1.2rem 5.5rem;
  display: grid;
  gap: 1.5rem;
}

.hero {
  display: none;
}

.eyebrow {
  text-transform: uppercase;
  font-family: var(--font-display);
  letter-spacing: 0.2em;
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

h1,
h2 {
  font-family: var(--font-display);
  margin: 0 0 0.75rem;
}

h1 {
  font-size: 2.2rem;
  line-height: 1.1;
}

.hero-copy {
  font-size: 1.1rem;
  color: var(--text-muted);
  margin: 0;
}

.hero-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.hero-label {
  margin: 0 0 0.75rem;
  font-family: var(--font-display);
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.progress {
  height: 8px;
  background: rgba(148, 163, 184, 0.2);
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 12.5%;
  background: linear-gradient(90deg, #24d3ee, #38bdf8);
  transition: width 0.3s ease;
}

.progress-text {
  margin: 0.75rem 0 0;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.form-shell {
  background: rgba(16, 23, 42, 0.35);
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: var(--radius);
  padding: 1.5rem 1.2rem 2.5rem;
  box-shadow: var(--shadow);
}

.step-indicator {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 0.4rem;
  margin-bottom: 1.5rem;
}

.step-indicator span {
  height: 3px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.25);
}

.step-indicator span.is-active {
  background: linear-gradient(90deg, #24d3ee, #38bdf8);
}

.form-step {
  display: none;
  animation: fadeIn 0.35s ease;
}

.form-step.is-active {
  display: block;
}

.edit-save-btn {
  display: none;
}

.edit-mode .form-step {
  display: block;
}

.edit-mode .step-indicator {
  display: none;
}

.edit-mode .form-nav {
  grid-template-columns: minmax(0, 1fr);
}

.edit-mode #prev-btn,
.edit-mode #next-btn {
  display: none;
}

.edit-mode .edit-save-btn {
  display: inline-flex;
}

.step-desc {
  margin: 0 0 1.25rem;
  color: var(--text-muted);
}

@keyframes moveLights {
  0% {
    --x1: 18%;
    --y1: 24%;
    --x2: 82%;
    --y2: 28%;
    --x3: 58%;
    --y3: 86%;
    --x4: 14%;
    --y4: 72%;
    --x5: 88%;
    --y5: 66%;
  }
  25% {
    --x1: 28%;
    --y1: 18%;
    --x2: 74%;
    --y2: 22%;
    --x3: 64%;
    --y3: 80%;
    --x4: 20%;
    --y4: 78%;
    --x5: 84%;
    --y5: 72%;
  }
  50% {
    --x1: 36%;
    --y1: 30%;
    --x2: 68%;
    --y2: 26%;
    --x3: 54%;
    --y3: 76%;
    --x4: 24%;
    --y4: 68%;
    --x5: 76%;
    --y5: 64%;
  }
  75% {
    --x1: 26%;
    --y1: 36%;
    --x2: 76%;
    --y2: 34%;
    --x3: 58%;
    --y3: 84%;
    --x4: 18%;
    --y4: 66%;
    --x5: 86%;
    --y5: 76%;
  }
  100% {
    --x1: 22%;
    --y1: 26%;
    --x2: 80%;
    --y2: 24%;
    --x3: 60%;
    --y3: 82%;
    --x4: 16%;
    --y4: 74%;
    --x5: 90%;
    --y5: 70%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bg-shapes {
    animation: none;
  }
}

.card-grid {
  display: grid;
  gap: 0.85rem;
}

.option-card {
  position: relative;
  display: grid;
  gap: 0.5rem;
  padding: 0.9rem 1rem;
  background: var(--card);
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  cursor: pointer;
  transition: transform 0.2s ease, border 0.2s ease;
}

.option-card input {
  position: absolute;
  opacity: 0;
}

.option-card span {
  display: grid;
  gap: 0.25rem;
  position: relative;
}

.option-card:hover {
  transform: translateY(-2px);
  border-color: rgba(36, 211, 238, 0.4);
}

.option-card:has(input:checked) {
  border-color: rgba(56, 189, 248, 0.9);
  background: rgba(56, 189, 248, 0.25);
}

.option-card strong {
  font-family: var(--font-display);
}

.option-card:has(input:checked) strong {
  color: var(--text);
}

.option-card em {
  color: var(--text-muted);
  font-style: normal;
  font-size: 0.95rem;
}

.field-grid {
  display: grid;
  gap: 1rem;
  margin-top: 1.5rem;
}

.section-label {
  margin: 1.2rem 0 0.6rem;
  font-family: var(--font-display);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--text-muted);
}

.field {
  display: grid;
  gap: 0.4rem;
  font-family: var(--font-display);
}

.field input,
.field select {
  padding: 0.7rem 0.85rem;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(15, 23, 42, 0.8);
  color: var(--text);
  font-family: var(--font-display);
}

.select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.7rem 0.85rem;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(15, 23, 42, 0.8);
  color: rgba(241, 245, 249, 0.7);
  font-family: var(--font-display);
  cursor: pointer;
}

.select-trigger .chevron {
  color: rgba(148, 163, 184, 0.7);
}

.field input:focus,
.field select:focus {
  outline: 2px solid rgba(36, 211, 238, 0.6);
  border-color: rgba(36, 211, 238, 0.6);
}

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

.pill-grid.compact {
  grid-template-columns: repeat(auto-fit, minmax(64px, 1fr));
  gap: 0.5rem;
}

.pill {
  padding: 0.35rem 0.55rem;
  border-radius: 999px;
  background: rgba(17, 24, 39, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.35);
  color: var(--text);
  font-family: var(--font-display);
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.pill.is-active {
  border-color: rgba(56, 189, 248, 0.9);
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.25);
  background: rgba(56, 189, 248, 0.25);
  color: #f8fafc;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.35rem;
  padding: 0.35rem;
  border-radius: 999px;
  background: rgba(17, 24, 39, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.3);
}

.segmented-btn {
  border: none;
  border-radius: 999px;
  padding: 0.6rem 0.4rem;
  font-family: var(--font-display);
  font-size: 0.85rem;
  color: var(--text-muted);
  background: transparent;
  cursor: pointer;
  transition: all 0.2s ease;
}

.segmented-btn.is-active {
  background: rgba(56, 189, 248, 0.25);
  color: #e2f7ff;
  box-shadow: inset 0 0 0 1px rgba(56, 189, 248, 0.8);
}

.elevation-display {
  margin-top: 1rem;
  font-family: var(--font-display);
  font-size: 2.4rem;
  text-align: center;
  color: rgba(241, 245, 249, 0.7);
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  padding-bottom: 0.75rem;
}

.big-input {
  margin-top: 1rem;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.4rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  padding-bottom: 0.65rem;
}

.big-input input {
  width: 110px;
  background: transparent;
  border: none;
  color: rgba(241, 245, 249, 0.9);
  font-family: var(--font-display);
  font-size: 2.2rem;
  text-align: center;
}

.big-input input:focus {
  outline: none;
}

.big-input .unit {
  font-family: var(--font-display);
  font-size: 1rem;
  color: rgba(241, 245, 249, 0.6);
  text-transform: lowercase;
}

.toggle-row {
  display: inline-flex;
  gap: 1rem;
  align-items: center;
}

.switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
  font-family: var(--font-display);
}

.switch input {
  position: absolute;
  opacity: 0;
}

.switch .slider {
  position: relative;
  width: 44px;
  height: 24px;
  border-radius: 999px;
  background: #1f2937;
  border: 1px solid rgba(148, 163, 184, 0.35);
  transition: background 0.2s ease, border 0.2s ease;
}

.switch .slider::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #f8fafc;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.45);
  transition: transform 0.2s ease;
}

.switch input:checked + .slider {
  background: rgba(36, 211, 238, 0.25);
  border-color: rgba(36, 211, 238, 0.6);
}

.switch input:checked + .slider::after {
  transform: translateX(20px);
}

.switch-label {
  font-size: 0.95rem;
  color: var(--text-muted);
}

.switch input:checked ~ .switch-label {
  color: var(--text);
}

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

.checkbox {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
  font-family: var(--font-display);
  align-items: flex-start;
}

.checkbox input {
  margin-top: 0.25rem;
}

.checkbox a {
  color: #38bdf8;
  text-decoration: none;
}

.checkbox a:hover {
  text-decoration: underline;
}

.policy-shell {
  display: grid;
  gap: 1rem;
}

.policy-shell h2 {
  margin: 0;
}

.policy-shell h3 {
  margin: 0.5rem 0 0;
  font-family: var(--font-display);
}

.policy-shell p,
.policy-shell li {
  color: var(--text-muted);
}

.policy-shell a {
  color: #38bdf8;
  text-decoration: none;
}

.policy-shell a:hover {
  text-decoration: underline;
}

.weekday-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.weekday {
  padding: 0.45rem 0;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(47, 54, 66, 0.7);
  color: var(--text);
  font-family: var(--font-display);
  cursor: pointer;
}

.weekday.is-active {
  background: rgba(36, 211, 238, 0.18);
  border-color: rgba(36, 211, 238, 0.6);
}

.weekday.is-disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.strength-weekday-grid {
  margin-top: 0.75rem;
}

.helper,
.warn {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 0.5rem 0 0;
}

.warn {
  color: #fbbf24;
}

.range-labels {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

input[type="range"] {
  accent-color: rgba(56, 189, 248, 0.9);
}

input[type="range"]::-webkit-slider-runnable-track {
  height: 4px;
  background: rgba(148, 163, 184, 0.3);
  border-radius: 999px;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.95);
  border: 2px solid rgba(17, 24, 39, 0.9);
  margin-top: -7px;
}

input[type="range"]::-moz-range-track {
  height: 4px;
  background: rgba(148, 163, 184, 0.3);
  border-radius: 999px;
}

input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.95);
  border: 2px solid rgba(17, 24, 39, 0.9);
}

.summary {
  display: grid;
  gap: 0.75rem;
  background: rgba(15, 23, 42, 0.7);
  border-radius: var(--radius-sm);
  padding: 1rem;
  border: 1px solid var(--border);
}

.summary-collapsible {
  background: rgba(15, 23, 42, 0.7);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  padding: 0.75rem 0.9rem;
  margin-top: 0.5rem;
}

.summary-collapsible > summary {
  cursor: pointer;
  font-family: var(--font-display);
  font-weight: 600;
  list-style: none;
  color: var(--text);
}

.summary-collapsible > summary::-webkit-details-marker {
  display: none;
}

.summary-collapsible > summary::after {
  content: "▾";
  float: right;
  color: var(--text-muted);
  transition: transform 0.2s ease;
}

.summary-collapsible[open] > summary::after {
  transform: rotate(180deg);
}

.summary-collapsible .summary {
  margin-top: 0.75rem;
  border: 0;
  padding: 0.75rem 0;
  background: transparent;
}

.summary-item {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-family: var(--font-display);
}

.alert {
  margin-top: 1rem;
  border-radius: var(--radius-sm);
  padding: 1rem;
  display: grid;
  gap: 0.75rem;
  border: 1px solid transparent;
  background: rgba(15, 23, 42, 0.55);
}

.alert-head {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.75rem;
  align-items: start;
}

.alert-title {
  margin: 0 0 0.25rem;
  font-family: var(--font-display);
  font-weight: 600;
}

.alert p {
  margin: 0;
}

.alert-icon {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 1.15rem;
  background: rgba(148, 163, 184, 0.2);
  color: #e2e8f0;
}

.alert.is-success {
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.45);
  color: #dcfce7;
}

.alert.is-success .alert-icon {
  background: rgba(34, 197, 94, 0.2);
  color: #dcfce7;
}

.alert.is-success .alert-icon::before {
  content: "✓";
}

.alert.is-error {
  background: rgba(249, 115, 22, 0.14);
  border: 1px solid rgba(249, 115, 22, 0.6);
  color: #ffedd5;
}

.alert.is-error .alert-icon {
  background: rgba(249, 115, 22, 0.2);
  color: #ffedd5;
}

.alert.is-error .alert-icon::before {
  content: "!";
}

.alert-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.form-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
  margin-top: 2.5rem;
  padding: 0.85rem 1.2rem 1.1rem;
  background: linear-gradient(
    180deg,
    rgba(11, 16, 32, 0) 0%,
    rgba(11, 16, 32, 0.85) 35%,
    rgba(11, 16, 32, 0.98) 100%
  );
  z-index: 10;
}

.primary-btn,
.ghost-btn {
  border-radius: 999px;
  padding: 0.85rem 1rem;
  font-family: var(--font-display);
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
}

.primary-btn {
  background: #e2e8f0;
  color: #0b0f1a;
  box-shadow: 0 12px 24px rgba(2, 6, 23, 0.25);
}

.ghost-btn {
  background: rgba(15, 23, 42, 0.4);
  color: var(--text);
  border-color: rgba(148, 163, 184, 0.35);
}

.output {
  padding: 0 1.5rem 3rem;
}

.output-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 1.5rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.peak-week {
  margin: 0.35rem 0 1rem;
  font-family: var(--font-display);
  color: var(--text-muted);
}

.breakdown-title {
  margin: 0.35rem 0 0.5rem;
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--text);
}

.plan-viewer {
  padding: 0.15rem;
}

.plan-loading {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 2rem;
  background: rgba(5, 7, 18, 0.88);
  z-index: 30;
}

.plan-loading-card {
  display: grid;
  gap: 0.9rem;
  justify-items: center;
  text-align: center;
  padding: 2rem 2.5rem;
  border-radius: 20px;
  background: rgba(16, 23, 42, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.25);
  font-family: var(--font-display);
}

.plan-loading-title {
  margin: 0;
  font-size: 1.4rem;
  color: var(--text);
}

.plan-loading-subtitle {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
  max-width: 420px;
}

.plan-spinner {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 5px solid rgba(148, 163, 184, 0.25);
  border-top-color: #38bdf8;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.plan-shell {
  background: rgba(16, 23, 42, 0.35);
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: var(--radius);
  padding: 0.65rem;
  box-shadow: var(--shadow);
  width: 100%;
}

.plan-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.75rem;
}

.plan-link {
  margin-top: 0.75rem;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.5rem;
  align-items: center;
  padding: 0.6rem 0.75rem;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(15, 23, 42, 0.6);
  font-family: var(--font-display);
  font-size: 0.85rem;
  color: var(--text-muted);
}

.plan-link input {
  width: 100%;
  background: transparent;
  border: none;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 0.85rem;
}

.plan-link button {
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.7);
  color: var(--text);
  border-radius: 10px;
  padding: 0.35rem 0.6rem;
  cursor: pointer;
}

.plan-zones-btn {
  margin-top: 0.8rem;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.7);
  color: var(--text);
  border-radius: 12px;
  padding: 0.5rem 0.8rem;
  font-family: var(--font-display);
  cursor: pointer;
  width: 100%;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.7);
  display: grid;
  place-items: center;
  z-index: 50;
  padding: 1.5rem;
}

.modal-card {
  background: #111827;
  border-radius: 18px;
  padding: 1.2rem;
  border: 1px solid rgba(148, 163, 184, 0.2);
  width: 100%;
  max-width: 420px;
  display: grid;
  gap: 0.75rem;
  font-family: var(--font-display);
}

.modal-help {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.modal-field {
  display: grid;
  gap: 0.35rem;
}

.modal-field input {
  padding: 0.6rem 0.75rem;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  background: rgba(15, 23, 42, 0.8);
  color: var(--text);
  font-family: var(--font-display);
}

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

.plan-week {
  display: grid;
  justify-items: center;
  gap: 0.35rem;
}

.plan-week-label {
  font-family: var(--font-display);
  font-weight: 600;
}

.plan-week-select {
  padding: 0.35rem 0.6rem;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.8);
  color: var(--text);
  font-family: var(--font-display);
}

.plan-nav-btn {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  background: rgba(15, 23, 42, 0.65);
  color: var(--text);
  font-size: 1.3rem;
  cursor: pointer;
}

.plan-calendar {
	margin-top: 1rem;
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 0.35rem;
    padding: 0.15rem;
    border-radius: 16px;
    border: 1px dashed rgba(148, 163, 184, 0.25);
}

.plan-view-toggle {
  margin-top: 0.75rem;
  margin-left: auto;
  display: flex;
  gap: 0.35rem;
  padding: 0.25rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(15, 23, 42, 0.7);
  width: fit-content;
}

.view-toggle-btn {
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-display);
  font-size: 0.85rem;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  cursor: pointer;
}

.view-toggle-btn.is-active {
  color: var(--text);
  background: rgba(56, 189, 248, 0.2);
  box-shadow: inset 0 0 0 1px rgba(56, 189, 248, 0.45);
}

.calendar-day {
  border-radius: 12px;
  padding: 0.35rem 0.2rem;
  text-align: center;
  font-family: var(--font-display);
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: grid;
  gap: 0.15rem;
}

.calendar-day strong {
  display: block;
  font-size: 0.8rem;
  color: var(--text);
}

.calendar-day span {
  font-size: 0.6rem;
  line-height: 1;
}

.calendar-day.has-session {
  border-color: rgba(56, 189, 248, 0.7);
  color: #e2f7ff;
}

.calendar-day.is-strength {
  border-color: rgba(250, 204, 21, 0.9);
  color: #fef3c7;
}

.calendar-day.is-long {
  border-color: rgba(99, 102, 241, 0.9);
  color: #e0e7ff;
}

.calendar-day.is-selected {
  border-color: rgba(36, 211, 238, 0.9);
  box-shadow: 0 0 0 2px rgba(36, 211, 238, 0.35);
}

.plan-body {
  display: grid;
  gap: 1.25rem;
  margin-top: 1.5rem;
}

.plan-details {
  display: grid;
  gap: 0.75rem;
}

.plan-sessions {
  display: grid;
  gap: 0.75rem;
}

.plan-sessions-list {
  display: grid;
  gap: 0.75rem;
}

.plan-body.is-chart .session-card {
  padding: 1.2rem;
}

.plan-body.is-chart .session-bars {
  height: 94px;
}

.plan-body.is-chart .session-bar {
  min-width: 8px;
}

.plan-details-title {
  margin: 0.5rem 0 0;
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--text);
}

.session-card {
  padding: 1rem;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: linear-gradient(
    135deg,
    rgba(20, 35, 80, 0.95),
    rgba(15, 23, 42, 0.9)
  );
  cursor: pointer;
  display: grid;
  gap: 0.75rem;
  box-shadow: 0 14px 28px rgba(2, 6, 23, 0.35);
}

.session-card.is-rest {
  background: linear-gradient(
    135deg,
    rgba(11, 18, 34, 0.95),
    rgba(15, 23, 42, 0.9)
  );
  cursor: default;
}

.session-card.is-strength {
  background: linear-gradient(
    135deg,
    rgba(20, 40, 75, 0.95),
    rgba(15, 23, 42, 0.9)
  );
  border-color: rgba(56, 189, 248, 0.5);
  cursor: default;
}

.session-rest {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.detail-card {
  padding: 1rem;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: linear-gradient(
    135deg,
    rgba(20, 35, 80, 0.95),
    rgba(15, 23, 42, 0.9)
  );
  display: grid;
  gap: 0.65rem;
  position: relative;
}

.detail-card::before {
  content: "";
  position: absolute;
  left: 0.85rem;
  top: 1.1rem;
  width: 4px;
  height: 18px;
  border-radius: 999px;
  background: #60a5fa;
}

.detail-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-weight: 600;
  padding-left: 0.75rem;
}

.detail-title span {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.detail-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.detail-meta strong {
  color: var(--text);
  font-weight: 600;
}

.detail-meta-label {
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.detail-zone {
  font-family: var(--font-display);
  font-weight: 600;
}

.detail-hr {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.detail-reps {
  padding: 0.85rem;
  border-radius: 16px;
  background: rgba(148, 163, 184, 0.15);
  border: 1px solid #0f172a;
  display: grid;
  gap: 0.6rem;
}

.detail-card.is-warmup::before {
  background: #f87171;
}

.detail-card.is-cooldown::before {
  background: #a855f7;
}

.detail-card.is-main::before {
  background: #60a5fa;
}

.detail-card.is-elevation::before {
  background: #22d3ee;
}

.detail-reps-header {
  font-family: var(--font-display);
  font-weight: 600;
  color: #e2e8f0;
}

.detail-reps-grid {
  display: grid;
  gap: 0.5rem;
}

.session-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-display);
}

.session-title {
  font-weight: 600;
}

.session-time {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.session-bars {
  display: flex;
  align-items: flex-end;
  gap: 0.25rem;
  height: 34px;
  padding: 0.4rem 0.2rem 0.2rem;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.7);
}

.session-meta {
  display: grid;
  gap: 0.35rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: left;
}

.session-meta strong {
  color: var(--text);
  font-weight: 600;
}

.session-bar {
  border-radius: 6px;
  min-width: 6px;
  transition: transform 0.2s ease;
}

.session-bar:hover {
  transform: translateY(-2px);
}

.bar-z1 {
  background: #6ea8fe;
  height: 20%;
}
.bar-z2 {
  background: #58d68d;
  height: 40%;
}
.bar-z3 {
  background: #f4d03f;
  height: 60%;
}
.bar-z4 {
  background: #f28c52;
  height: 80%;
}
.bar-z5 {
  background: #f25f5c;
  height: 100%;
}

.plan-legend {
  background: rgba(0, 0, 0, 0.65);
  border-radius: 16px;
  padding: 1rem;
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.floating-btn {
    position: fixed;
    bottom: 1.6rem;
    padding: 0.75rem 1.1rem;
    border-radius: 999px;
    border: 1px solid rgb(0 255 241 / 85%);
    background: rgb(1 123 137);
    color: #ffffff;
    font-family: var(--font-display);
    font-weight: 600;
    cursor: pointer;
    box-shadow: 6px -1px 8px 6px rgba(2, 6, 23, 0.35);
    z-index: 25;
}

.floating-btn:hover {
  background: rgba(14, 116, 144, 1);
}

.round-btn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  padding: 0;
  font-size: 1.8rem;
  line-height: 1;
}

.floating-btn.left-btn {
  left: 1.5rem;
}

.floating-btn.right-btn {
  right: 1.5rem;
}

.plan-legend h3 {
  margin: 0 0 0.75rem;
  font-family: var(--font-display);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  font-family: var(--font-display);
}

.legend-range {
  margin-left: auto;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.legend-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-block;
}

.legend-dot.z1 {
  background: #6ea8fe;
}
.legend-dot.z2 {
  background: #58d68d;
}
.legend-dot.z3 {
  background: #f4d03f;
}
.legend-dot.z4 {
  background: #f28c52;
}
.legend-dot.z5 {
  background: #f25f5c;
}

.toast {
  position: fixed;
  left: 1.2rem;
  right: 1.2rem;
  bottom: 6.2rem;
  transform: translateY(10px);
  background: #f3d6b0;
  color: #1f2937;
  padding: 0.7rem 1rem;
  border-radius: 12px;
  border: 1px solid rgba(251, 146, 60, 0.5);
  box-shadow: 0 12px 30px rgba(30, 41, 59, 0.25);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: auto;
  font-family: var(--font-display);
  font-size: 0.9rem;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.hidden {
  display: none;
}

[hidden] {
  display: none !important;
}

.sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.6);
  z-index: 40;
}

.sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: #1f2430;
  border-radius: 20px 20px 0 0;
  padding: 1rem 1.2rem 1.5rem;
  z-index: 41;
  box-shadow: 0 -20px 60px rgba(2, 6, 23, 0.45);
}

.sheet-handle {
  width: 50px;
  height: 4px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.4);
  margin: 0.5rem auto 1rem;
}

.sheet h3 {
  margin: 0 0 1rem;
  text-align: center;
  font-family: var(--font-display);
}

.sheet-list {
  display: grid;
  gap: 0.65rem;
  margin-bottom: 1.2rem;
}

.sheet-option {
    padding: 0.75rem 0.9rem;
    border-radius: 14px;
    background: rgba(31, 41, 55, 0.9);
    border: 1px solid rgb(60 203 255 / 20%);
    color: var(--text);
    font-family: var(--font-display);
    cursor: pointer;
    text-align: left;
    text-decoration: none;
}

.sheet-option-title {
  font-weight: 600;
}

.sheet-option-subtitle {
  margin-top: 0.2rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.sheet-option.is-active {
  border-color: rgba(56, 189, 248, 0.9);
  color: rgba(56, 189, 248, 0.95);
}

.sheet-confirm {
  width: 100%;
}

.sheet-close {
  position: absolute;
  top: 0.85rem;
  right: 1rem;
  padding: 0.25rem;
  border: 0;
  background: transparent;
  color: #ffffff;
  font-size: 1.2rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (min-width: 900px) {
  .shell {
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
  }

  .hero {
    display: none;
  }

  .form-shell {
    padding: 2rem 2.5rem;
    justify-self: center;
    max-width: 560px;
    width: 100%;
  }

  h1 {
    font-size: 2.8rem;
  }

  .form-nav {
    left: 50%;
    right: auto;
    width: 50%;
    transform: translateX(-50%);
    padding: 0.85rem 0 1.1rem;
  }

  .plan-shell {
    max-width: 760px;
    margin: 0 auto;
  }

  .plan-body {
    grid-template-columns: minmax(0, 1fr) 220px;
    grid-template-areas:
      "sessions zones-title"
      "sessions zones-card";
    align-items: start;
  }

  .plan-sessions {
    grid-area: sessions;
  }

  .plan-body > .plan-details-title {
    grid-area: zones-title;
    margin-top: 0;
  }

  .plan-legend {
    grid-area: zones-card;
    margin-top: 0;
  }

  .floating-btn.left-btn {
    left: calc(50% - 180px - 80px);
    right: auto;
    transform: none;
  }

  .floating-btn.right-btn {
    left: calc(50% + 180px + 24px);
    right: auto;
    transform: none;
  }

  .toast {
    left: 50%;
    right: auto;
    width: 560px;
    transform: translateX(-50%) translateY(10px);
  }

  .toast.is-visible {
    transform: translateX(-50%) translateY(0);
  }
}
