.ewsd-demo {
  --ewsd-bg: #070b18;
  --ewsd-card: #111a2b;
  --ewsd-card-soft: #172337;
  --ewsd-border: rgba(255, 255, 255, 0.08);
  --ewsd-text: #ffffff;
  --ewsd-muted: #8f9bb3;
  --ewsd-blue: #2563eb;
  --ewsd-green: #22c55e;
  --ewsd-solar: #f5a400;
  --ewsd-danger: #ef4444;
  --ewsd-radius: 18px;
  --ewsd-shadow: 0 22px 60px rgba(0, 0, 0, 0.35);
  --ewsd-space: clamp(0.9rem, 1.4vw, 1.25rem);
  background: radial-gradient(circle at 20% 0, #0f1931 0%, var(--ewsd-bg) 55%);
  color: var(--ewsd-text);
  border-radius: calc(var(--ewsd-radius) + 6px);
  padding: clamp(1rem, 2vw, 2rem);
  box-shadow: var(--ewsd-shadow);
  font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.ewsd-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--ewsd-space);
  align-items: start;
}

.ewsd-card {
  background: linear-gradient(180deg, rgba(23, 35, 55, 0.95), rgba(17, 26, 43, 0.95));
  border: 1px solid var(--ewsd-border);
  border-radius: var(--ewsd-radius);
  padding: clamp(1rem, 1.5vw, 1.3rem);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.ewsd-heading {
  margin: 0 0 0.55rem;
  font-size: clamp(1.08rem, 1.8vw, 1.35rem);
  line-height: 1.3;
  color: var(--ewsd-text);
}

.ewsd-section-title {
  margin: 0 0 0.65rem;
  font-size: 0.9rem;
  color: #d9e2ff;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.ewsd-subtext {
  margin: 0;
  color: var(--ewsd-muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

.ewsd-product-selector {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
  margin: 1rem 0;
}

.ewsd-product-tile {
  border: 1px solid var(--ewsd-border);
  background: #0f1b31;
  color: var(--ewsd-text);
  border-radius: 14px;
  padding: 0.8rem;
  text-align: left;
  display: grid;
  gap: 0.4rem;
  cursor: pointer;
}

.ewsd-product-tile:hover,
.ewsd-product-tile:focus-visible {
  border-color: rgba(37, 99, 235, 0.75);
  outline: none;
}

.ewsd-product-tile.ewsd-active {
  border-color: rgba(37, 99, 235, 0.95);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.25);
  background: #102344;
}

.ewsd-product-title {
  font-weight: 700;
}

.ewsd-product-desc {
  color: var(--ewsd-muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.ewsd-assumptions {
  border-top: 1px solid var(--ewsd-border);
  margin-top: 0.8rem;
  padding-top: 0.9rem;
}

.ewsd-field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 0.7rem;
}

.ewsd-field {
  display: grid;
  gap: 0.36rem;
}

.ewsd-field label {
  font-size: 0.8rem;
  color: #cad7f5;
}

.ewsd-input {
  width: 100%;
  min-height: 2.3rem;
  border-radius: 10px;
  border: 1px solid rgba(143, 155, 179, 0.45);
  background: rgba(7, 11, 24, 0.9);
  color: var(--ewsd-text);
  padding: 0.4rem 0.55rem;
  font-size: 0.9rem;
}

.ewsd-input:focus-visible {
  border-color: var(--ewsd-blue);
  outline: none;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.ewsd-hidden {
  display: none;
}

.ewsd-schedule-group + .ewsd-schedule-group {
  margin-top: 1rem;
}

.ewsd-timer-row {
  background: var(--ewsd-card-soft);
  border: 1px solid var(--ewsd-border);
  border-radius: 12px;
  padding: 0.65rem;
  margin-top: 0.6rem;
  display: grid;
  grid-template-columns: auto minmax(120px, 1fr) repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
  align-items: center;
}

.ewsd-indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--ewsd-green);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2);
}

.ewsd-timer-meta span {
  display: block;
  font-weight: 600;
  font-size: 0.84rem;
}

.ewsd-timer-meta small {
  color: var(--ewsd-muted);
  font-size: 0.75rem;
}

.ewsd-time-field {
  display: grid;
  gap: 0.25rem;
  color: var(--ewsd-muted);
  font-size: 0.74rem;
}

.ewsd-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  padding: 0.1rem 0.42rem;
  border-radius: 100px;
  font-weight: 700;
  letter-spacing: 0.03em;
  background: rgba(34, 197, 94, 0.2);
  color: #c0fcd5;
}

.ewsd-pill-off {
  background: rgba(143, 155, 179, 0.2);
  color: #d5deef;
}

.ewsd-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(34, 197, 94, 0.16);
  border: 1px solid rgba(34, 197, 94, 0.5);
  color: #c5ffd9;
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-radius: 100px;
  padding: 0.3rem 0.6rem;
}

.ewsd-status-pill::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.ewsd-status-pill.ewsd-solar-mode {
  background: rgba(245, 164, 0, 0.14);
  border-color: rgba(245, 164, 0, 0.5);
  color: #ffd581;
}

.ewsd-result {
  margin: 0.5rem 0 0.85rem;
  font-weight: 800;
  font-size: clamp(1.5rem, 3vw, 2rem);
  color: var(--ewsd-green);
}

.ewsd-progress-wrap {
  margin-bottom: 0.9rem;
}

.ewsd-progress-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--ewsd-muted);
  margin-bottom: 0.35rem;
}

.ewsd-progress-track {
  background: #0b1529;
  border: 1px solid var(--ewsd-border);
  border-radius: 999px;
  height: 12px;
  overflow: hidden;
}

.ewsd-progress-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--ewsd-green), #6ef2a0);
  transition: width 180ms ease;
}

.ewsd-progress-fill.ewsd-solar-fill {
  background: linear-gradient(90deg, var(--ewsd-solar), #ffd369);
}

.ewsd-metric-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.42rem;
}

.ewsd-metric {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  font-size: 0.86rem;
  color: #dce5ff;
}

.ewsd-metric strong {
  font-weight: 700;
  color: var(--ewsd-text);
}

.ewsd-warning {
  min-height: 1.4rem;
  margin: 0.7rem 0 0;
  color: #ffd8af;
  font-size: 0.84rem;
}

.ewsd-cta-wrap {
  margin-top: 0.9rem;
}

.ewsd-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: var(--ewsd-blue);
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none;
  min-height: 2.45rem;
  padding: 0.45rem 1rem;
}

.ewsd-cta:hover,
.ewsd-cta:focus-visible {
  background: #1d4fd6;
}

.ewsd-disclaimer {
  margin: 1rem 0 0;
  color: #98a8c7;
  font-size: 0.78rem;
  line-height: 1.5;
}

@media (max-width: 1024px) {
  .ewsd-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ewsd-results-card {
    grid-column: 1 / -1;
  }

  .ewsd-timer-row {
    grid-template-columns: auto minmax(100px, 1fr);
  }
}

@media (max-width: 720px) {
  .ewsd-grid {
    grid-template-columns: 1fr;
  }

  .ewsd-setup-card {
    order: 1;
  }

  .ewsd-results-card {
    order: 2;
  }

  .ewsd-schedule-card {
    order: 3;
  }

  .ewsd-field-grid,
  .ewsd-product-selector {
    grid-template-columns: 1fr;
  }

  .ewsd-timer-row {
    grid-template-columns: 1fr;
  }

  .ewsd-time-field {
    grid-template-columns: auto 1fr;
    align-items: center;
  }

  .ewsd-disclaimer {
    order: 4;
  }
}
