:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #14141f;
  --bg-tertiary: #1e1e2e;
  --text-primary: #ffffff;
  --text-secondary: #a0a0b0;
  --text-muted: #606070;
  --accent: #00d4ff;
  --accent-secondary: #00ff88;
  --danger: #ff4466;
  --focus-ring: #00d4ff;
  --focus-glow: rgba(0, 212, 255, 0.4);
  --radius-md: 12px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body {
  width: 600px; height: 600px; overflow: hidden;
  background: #000;
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
#app { width: 100%; height: 100%; position: relative; }
.screen { width: 100%; height: 100%; position: absolute; top: 0; left: 0; display: flex; flex-direction: column; }
.screen.hidden { display: none; }
.focusable { transition: all 0.15s ease; border: 2px solid transparent; cursor: pointer; outline: none; }
.focusable:focus { border-color: var(--focus-ring); box-shadow: 0 0 20px rgba(0, 212, 255, 0.5); }
.hidden { display: none !important; }

/* ============ HEADER ============ */
.app-header {
  display: flex; align-items: center; gap: 14px;
  padding: 20px 24px 16px;
  background: linear-gradient(180deg, #14141f 0%, #0a0a0f 100%);
  border-bottom: 1px solid #22222e;
  flex-shrink: 0;
}
.app-header h1 { font-size: 30px; font-weight: 700; letter-spacing: -0.5px; }
.app-header h2 { font-size: 26px; font-weight: 700; flex: 1; }
.heart {
  font-size: 34px; color: var(--danger);
  filter: drop-shadow(0 0 12px rgba(255, 68, 102, 0.6));
  animation: pulse 1.3s ease-in-out infinite;
}
.sub-header { padding: 16px 20px; gap: 12px; }
.spacer { width: 52px; flex-shrink: 0; }

.icon-btn {
  width: 52px; height: 52px; border-radius: 12px;
  background: var(--bg-tertiary); color: var(--text-primary);
  font-size: 32px; line-height: 1; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.maxhr-chip {
  background: var(--bg-tertiary); color: var(--accent);
  font-size: 17px; font-weight: 700; padding: 8px 14px; border-radius: 999px;
  border: 1px solid rgba(0, 212, 255, 0.3); flex-shrink: 0;
}
.maxhr-chip span { color: #fff; }

/* ============ CONTENT ============ */
.content {
  flex: 1; padding: 16px 24px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 12px;
}
.content::-webkit-scrollbar { width: 0; height: 0; }

/* ============ READOUT ============ */
.readout {
  background: linear-gradient(135deg, #1a1a2e 0%, #14141f 100%);
  border: 1px solid #2a2a3e; border-radius: var(--radius-md);
  padding: 14px 20px; display: flex; align-items: center; justify-content: space-between;
}
.readout-label { font-size: 16px; color: var(--text-secondary); font-weight: 600; }
.readout-value { font-size: 40px; font-weight: 800; color: var(--accent); letter-spacing: -1px; }
.readout-value small { font-size: 17px; color: var(--text-secondary); font-weight: 600; margin-left: 6px; }

/* ============ FIELDS / STEPPERS ============ */
.field {
  background: var(--bg-secondary); border-radius: var(--radius-md);
  padding: 12px 16px; min-height: 64px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.field-label {
  font-size: 18px; font-weight: 600; color: var(--text-primary);
  display: flex; flex-direction: column; gap: 2px;
}
.field-label .sub { font-size: 12px; color: var(--text-muted); font-weight: 500; }
.field-control { display: flex; align-items: center; gap: 10px; }
.field-value {
  min-width: 92px; text-align: center; font-size: 26px; font-weight: 700;
  color: #fff;
}
.field-value.sm { font-size: 20px; min-width: 110px; }
.field-value small { font-size: 14px; color: var(--text-secondary); font-weight: 600; margin-left: 4px; }
.chev {
  font-size: 26px; color: var(--accent); width: 26px; text-align: center;
  font-weight: 700; opacity: 0.55; transition: opacity 0.15s ease;
}
.field:focus .chev { opacity: 1; }
.field.muted { opacity: 0.42; }
.field.muted:focus { opacity: 0.85; }
.field.bump .field-value { animation: bump 0.18s ease; }

/* ============ ACTIONS / BUTTONS ============ */
.actions {
  display: flex; gap: 12px; padding: 12px 24px 8px; flex-shrink: 0;
}
.btn {
  min-height: 60px; border-radius: var(--radius-md);
  font-size: 20px; font-weight: 700; color: #fff;
  background: var(--bg-tertiary);
  display: flex; align-items: center; justify-content: center;
}
.btn-primary {
  flex: 2;
  background: linear-gradient(135deg, #00d4ff 0%, #0099cc 100%);
  color: #04222b;
}
.btn-ghost { flex: 1; color: var(--text-secondary); }

/* ============ HINT BAR ============ */
.hint {
  display: flex; justify-content: center; gap: 22px;
  padding: 6px 0 14px; flex-shrink: 0;
  font-size: 13px; color: var(--text-muted);
}
.hint span { white-space: nowrap; }

/* ============ ZONE CARDS ============ */
.zones-list { gap: 12px; padding-top: 14px; padding-bottom: 24px; }
.zone-card {
  display: flex; align-items: stretch; gap: 0;
  background: var(--bg-secondary); border-radius: var(--radius-md);
  overflow: hidden; min-height: 84px;
}
.zone-bar {
  width: 8px; flex-shrink: 0; background: var(--zone-color);
  box-shadow: 0 0 16px var(--zone-color);
}
.zone-body { flex: 1; padding: 12px 16px; display: flex; flex-direction: column; justify-content: center; gap: 4px; }
.zone-top { display: flex; align-items: baseline; justify-content: space-between; }
.zone-num { font-size: 15px; font-weight: 700; color: var(--zone-color); letter-spacing: 0.3px; }
.zone-pct { font-size: 14px; color: var(--text-muted); font-weight: 600; }
.zone-name { font-size: 21px; font-weight: 700; color: #fff; }
.zone-range { font-size: 17px; color: var(--text-secondary); }
.zone-range strong { color: #fff; font-size: 22px; font-weight: 800; }

/* ============ DETAIL ============ */
.detail-content { gap: 16px; padding: 20px 24px; }
.detail-hero {
  border-radius: 16px; padding: 22px;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  background: var(--bg-secondary);
  border: 1px solid var(--zone-color);
  background:
    radial-gradient(120% 120% at 50% 0%, color-mix(in srgb, var(--zone-color) 28%, transparent) 0%, transparent 70%),
    var(--bg-secondary);
  border: 1px solid color-mix(in srgb, var(--zone-color) 45%, transparent);
}
.detail-zonenum { font-size: 17px; font-weight: 700; color: var(--zone-color); letter-spacing: 0.5px; }
.detail-range { font-size: 52px; font-weight: 800; color: #fff; letter-spacing: -1.5px; line-height: 1; }
.detail-range small { font-size: 20px; color: var(--text-secondary); font-weight: 600; margin-left: 8px; }
.detail-pct { font-size: 17px; color: var(--text-secondary); font-weight: 600; }
.detail-name { font-size: 30px; font-weight: 800; color: #fff; text-align: center; }
.detail-desc { font-size: 19px; line-height: 1.5; color: var(--text-secondary); }
.detail-meta { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.meta-row {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--bg-secondary); border-radius: 10px; padding: 12px 16px;
}
.meta-k { font-size: 16px; color: var(--text-muted); font-weight: 600; }
.meta-v { font-size: 18px; color: #fff; font-weight: 700; }

/* ============ ABOUT ============ */
.about-content { gap: 8px; padding: 20px 24px; }
.about-content h3 { font-size: 20px; font-weight: 700; color: var(--accent); margin-top: 12px; }
.about-content h3:first-child { margin-top: 0; }
.about-content p { font-size: 17px; line-height: 1.5; color: var(--text-secondary); }
.about-content strong { color: #fff; }
.disclaimer {
  margin-top: 16px; padding: 14px 16px; border-radius: 10px;
  background: rgba(255, 68, 102, 0.1); border: 1px solid rgba(255, 68, 102, 0.3);
  color: #ffb3c1; font-size: 15px; line-height: 1.45;
}

/* ============ ANIMATIONS ============ */
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.14); } }
@keyframes bump { 0% { transform: scale(1); } 45% { transform: scale(1.22); } 100% { transform: scale(1); } }

@media (prefers-reduced-motion: reduce) {
  .heart { animation: none; }
  .field.bump .field-value { animation: none; }
}
