:root {
  --bg: #0f1419;
  --surface: #1a2332;
  --surface-2: #243044;
  --text: #eef2f7;
  --text-muted: #94a3b8;
  --accent: #34d399;
  --accent-dim: #059669;
  --danger: #f87171;
  --radius: 16px;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 1.0625rem;
  background:
    radial-gradient(ellipse at top, #1e3a2f 0%, transparent 55%),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}

.app {
  max-width: 560px;
  margin: 0 auto;
  padding: 24px 16px 40px;
}

.header {
  text-align: center;
  margin-bottom: 28px;
}

.logo {
  display: block;
  width: 120px;
  height: 120px;
  margin: 0 auto 12px;
  border-radius: 28px;
  filter: hue-rotate(32deg) saturate(1.12) brightness(1.03);
  box-shadow: 0 10px 28px rgba(52, 211, 153, 0.18);
}

.header h1 {
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.35;
}

.tagline {
  color: var(--text-muted);
  margin-top: 6px;
  font-size: 1.05rem;
}

.card {
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}

.card h2 {
  font-size: 1.4rem;
}

.hidden {
  display: none !important;
}

.hint {
  color: var(--text-muted);
  font-size: 1rem;
  margin: 8px 0 20px;
}

.btn {
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-size: 1.05rem;
  font-weight: 600;
  padding: 12px 18px;
  transition: transform 0.15s, opacity 0.15s;
}

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

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-dim));
  color: #052e1a;
  margin-top: 4px;
}

.btn-secondary {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
}

.btn-ghost:disabled {
  cursor: not-allowed;
  opacity: 0.4;
  transform: none;
}

.empty-state h2 {
  margin-bottom: 8px;
}

.empty-state .hint {
  margin-bottom: 0;
}

.stats {
  text-align: center;
  margin-bottom: 16px;
}

.stats-label {
  color: var(--text-muted);
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 16px;
}

.timer {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.timer-block {
  background: var(--surface-2);
  border-radius: 12px;
  min-width: 96px;
  padding: 16px 12px;
}

.timer-value {
  display: block;
  font-size: 2.75rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1.1;
}

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

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.stat-card {
  padding: 18px;
}

.stat-label {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 8px;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.3;
}

#time-saved {
  font-size: 1.35rem;
  white-space: nowrap;
}

.quote-card {
  margin-bottom: 20px;
  border-left: 3px solid var(--accent);
}

.quote {
  font-size: 1.2rem;
  font-style: italic;
  color: #d1fae5;
}

.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.actions .btn {
  flex: 1;
  min-width: 140px;
  text-align: center;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.page-nav {
  margin-bottom: 20px;
}

.page-nav-link {
  width: 100%;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.error-state {
  color: var(--danger);
  margin-bottom: 16px;
}

.health-summary {
  color: var(--text-muted);
  margin-bottom: 16px;
  text-align: center;
}

.health-note {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 20px;
  text-align: center;
}

.milestones-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.milestone {
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  transition: border-color 0.25s, box-shadow 0.25s;
}

.milestone--complete {
  border-color: rgba(52, 211, 153, 0.45);
  box-shadow:
    var(--shadow),
    0 0 0 1px rgba(52, 211, 153, 0.12);
}

.milestone-head {
  align-items: flex-start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 10px;
}

.milestone-period {
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.milestone-title {
  font-size: 1.15rem;
}

.milestone-status {
  background: var(--surface-2);
  border-radius: 999px;
  color: var(--text-muted);
  flex-shrink: 0;
  font-size: 0.8rem;
  padding: 6px 10px;
  white-space: nowrap;
}

.milestone--complete .milestone-status {
  background: rgba(52, 211, 153, 0.15);
  color: #a7f3d0;
}

.milestone-fact {
  color: var(--text-muted);
  font-size: 0.98rem;
  margin-bottom: 14px;
}

.progress-track {
  background: var(--surface-2);
  border-radius: 999px;
  height: 12px;
  overflow: hidden;
}

.progress-fill {
  background: linear-gradient(90deg, var(--accent-dim), var(--accent));
  border-radius: 999px;
  height: 100%;
  min-width: 0;
  transition: width 0.6s ease;
}

.milestone--complete .progress-fill {
  box-shadow: 0 0 12px rgba(52, 211, 153, 0.35);
}

.milestone-percent {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 8px;
  text-align: right;
}

.milestone--complete .milestone-percent {
  color: #a7f3d0;
  font-weight: 600;
}

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

  .timer-value {
    font-size: 2.35rem;
  }

  .stat-value {
    font-size: 1.65rem;
  }

  #time-saved {
    font-size: 1.45rem;
  }
}
