/* RuckOps — tactical dark theme.
   Colors locked from APP_DESIGN_BLUEPRINT.md. */

:root {
  --amber: #F4811F;
  --amber-dim: #b76018;
  --olive: #4A5D23;
  --bg: #0D0F0D;
  --surface: #1A1D1A;
  --surface-2: #232723;
  --text: #E8E8E8;
  --muted: #8B8F89;
  --danger: #DC2626;
  --green: #4ade80;
  --header-h: 56px;
  --tab-h: 64px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
}

#app {
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.boot {
  margin: auto;
  font-family: 'JetBrains Mono', monospace;
  color: var(--amber);
  letter-spacing: 0.2em;
  font-size: 14px;
}

.hidden { display: none !important; }

.screen {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding:
    calc(16px + env(safe-area-inset-top, 0px))
    calc(16px + env(safe-area-inset-right, 0px))
    calc(var(--tab-h) + 16px + env(safe-area-inset-bottom, 0px))
    calc(16px + env(safe-area-inset-left, 0px));
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.screen-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 8px 0 4px;
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  background: var(--bg);
  z-index: 5;
  padding: 4px 0;
}

.screen-header h2 {
  flex: 1;
  font-family: 'Roboto Condensed', sans-serif;
  font-weight: 700;
  font-size: 22px;
  letter-spacing: 0.08em;
  margin: 0;
}

.back {
  background: transparent;
  border: 1px solid var(--surface-2);
  color: var(--text);
  width: 36px;
  height: 36px;
  border-radius: 6px;
  font-size: 18px;
  cursor: pointer;
}

.title {
  font-family: 'Roboto Condensed', sans-serif;
  font-weight: 700;
  font-size: 26px;
  letter-spacing: 0.08em;
  margin: 8px 0 4px;
}

.muted { color: var(--muted); }
.small { font-size: 12px; }
.danger { color: var(--danger) !important; }

/* Buttons -------------------------------------------------------------- */

.btn {
  font-family: 'Roboto Condensed', sans-serif;
  font-weight: 700;
  letter-spacing: 0.1em;
  font-size: 15px;
  padding: 14px 18px;
  border-radius: 6px;
  border: none;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: transform 0.06s ease, opacity 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-primary {
  background: var(--amber);
  color: #1a1102;
}

.btn-primary:hover:not(:disabled) { background: var(--amber-dim); }

.btn-outline {
  background: transparent;
  color: var(--amber);
  border: 1px solid var(--amber);
}

.btn-danger {
  background: transparent;
  color: var(--danger);
  border: 1px solid var(--danger);
}

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

.btn-square {
  width: 56px;
  padding: 14px 0;
}

.big-cta {
  font-size: 22px;
  padding: 22px;
  margin-top: auto;
}

.row {
  display: flex;
  gap: 12px;
}

.row .btn { flex: 1; }

/* Welcome -------------------------------------------------------------- */

.welcome {
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 100dvh;
  padding-bottom: 32px;
  position: relative;
}

.topo {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(ellipse at 20% 30%, rgba(244, 129, 31, 0.06), transparent 50%),
    radial-gradient(ellipse at 80% 70%, rgba(74, 93, 35, 0.08), transparent 50%);
  pointer-events: none;
  z-index: 0;
}

.welcome > * { position: relative; z-index: 1; }

.welcome-hero {
  margin-top: 18vh;
}

.wordmark {
  font-family: 'Roboto Condensed', sans-serif;
  font-weight: 700;
  font-size: 56px;
  letter-spacing: 0.1em;
  margin: 0;
  line-height: 1;
}

.wordmark span { color: var(--amber); }

.tagline {
  margin-top: 8px;
  color: var(--amber);
  font-size: 12px;
  letter-spacing: 0.4em;
  font-weight: 600;
}

.auth-block {
  margin-top: auto;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 32px;
}

.welcome-footer {
  margin-top: 24px;
}

/* Onboarding ----------------------------------------------------------- */

.step-dots {
  display: flex;
  gap: 8px;
  justify-content: center;
  padding: 8px 0;
}

.step-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--surface-2);
}

.step-dots[data-step="1"] span:nth-child(1),
.step-dots[data-step="2"] span:nth-child(2),
.step-dots[data-step="3"] span:nth-child(3),
.step-dots[data-step="4"] span:nth-child(4) {
  background: var(--amber);
}

.ob-step {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.card-row {
  display: flex;
  gap: 12px;
}

.ob-card {
  flex: 1;
  padding: 24px 12px;
  background: var(--surface);
  border: 2px solid var(--surface-2);
  border-radius: 8px;
  color: var(--text);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
  font-family: 'Roboto Condensed', sans-serif;
}

.ob-card .big {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.ob-card .sub {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.1em;
}

.ob-card.selected {
  border-color: var(--amber);
}

.ob-card.selected .big { color: var(--amber); }

.num-input {
  display: flex;
  align-items: baseline;
  gap: 8px;
  background: var(--surface);
  border-radius: 8px;
  padding: 16px;
  border: 1px solid var(--surface-2);
}

.num-input input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text);
  font-family: 'JetBrains Mono', monospace;
  font-size: 32px;
  font-weight: 700;
  outline: none;
  width: 100%;
}

.num-input.large input { font-size: 48px; }
.num-input.small { padding: 8px 12px; }
.num-input.small input { font-size: 18px; }

.suffix {
  font-family: 'JetBrains Mono', monospace;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.perm-card {
  background: var(--surface);
  border-radius: 8px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.perm-card h3 {
  font-family: 'Roboto Condensed', sans-serif;
  margin: 0;
  letter-spacing: 0.1em;
  font-size: 16px;
  color: var(--amber);
}

.perm-status {
  font-size: 12px;
  letter-spacing: 0.1em;
  font-family: 'JetBrains Mono', monospace;
  color: var(--muted);
}

.perm-status.granted { color: var(--green); }
.perm-status.denied { color: var(--danger); }

/* Home ----------------------------------------------------------------- */

.status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
}

.brand {
  font-family: 'Roboto Condensed', sans-serif;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--amber);
}

.perm-banner {
  background: rgba(244, 129, 31, 0.12);
  border: 1px solid var(--amber);
  color: var(--amber);
  padding: 12px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  text-align: center;
}

.hero-cta {
  background: var(--amber);
  color: #1a1102;
  border: none;
  border-radius: 10px;
  padding: 36px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
  cursor: pointer;
  font-family: 'Roboto Condensed', sans-serif;
  min-height: 22vh;
  justify-content: center;
}

.cta-label {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.cta-sub {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.05em;
  opacity: 0.75;
}

.panel {
  background: var(--surface);
  border-radius: 8px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.panel-title {
  font-family: 'Roboto Condensed', sans-serif;
  font-size: 13px;
  letter-spacing: 0.18em;
  color: var(--muted);
  margin: 0;
  font-weight: 700;
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: var(--surface-2);
  padding: 10px 8px;
  border-radius: 6px;
}

.stat-label {
  font-family: 'Roboto Condensed', sans-serif;
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--muted);
}

.stat-val {
  font-family: 'JetBrains Mono', monospace;
  font-size: 18px;
  font-weight: 700;
  color: var(--amber);
}

.workout-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.workout-row {
  display: grid;
  grid-template-columns: 6px 1fr auto;
  gap: 10px;
  align-items: center;
  background: var(--surface-2);
  border-radius: 6px;
  padding: 10px;
  cursor: pointer;
}

.workout-row .stripe {
  width: 4px;
  height: 100%;
  border-radius: 2px;
  align-self: stretch;
}

.workout-row.ruck .stripe { background: var(--amber); }
.workout-row.run .stripe { background: var(--olive); }

.workout-row .info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.workout-row .top-line {
  display: flex;
  gap: 8px;
  align-items: center;
}

.workout-row .type-chip {
  font-family: 'Roboto Condensed', sans-serif;
  font-size: 10px;
  letter-spacing: 0.15em;
  background: var(--surface);
  color: var(--amber);
  padding: 2px 6px;
  border-radius: 4px;
}

.workout-row.run .type-chip { color: var(--olive); }

.workout-row .when {
  font-size: 12px;
  color: var(--muted);
}

.workout-row .bottom-line {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
}

.workout-row .right {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 16px;
  color: var(--amber);
}

.tabbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(13, 15, 13, 0.94);
  backdrop-filter: blur(8px);
  border-top: 1px solid var(--surface-2);
  display: flex;
  height: var(--tab-h);
  z-index: 50;
}

.tabbar .tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Roboto Condensed', sans-serif;
  letter-spacing: 0.18em;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-decoration: none;
}

.tabbar .tab.active { color: var(--amber); }

/* Pre-workout ---------------------------------------------------------- */

.mode-toggle {
  display: flex;
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface);
}

.mode {
  flex: 1;
  padding: 16px;
  background: transparent;
  color: var(--amber);
  border: 1px solid var(--amber);
  font-family: 'Roboto Condensed', sans-serif;
  font-weight: 700;
  letter-spacing: 0.18em;
  cursor: pointer;
}

.mode.selected {
  background: var(--amber);
  color: #1a1102;
}

.pack-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.gps-panel {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border-radius: 8px;
  padding: 14px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  letter-spacing: 0.1em;
}

.gps-status { font-weight: 700; color: var(--danger); }
.gps-status.fair { color: var(--amber); }
.gps-status.strong { color: var(--green); }

.foreground-note {
  text-align: center;
  margin-top: 4px;
}

/* Live ----------------------------------------------------------------- */

.live {
  position: relative;
  padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  min-height: 100dvh;
}

.live-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
}

.gps-chip {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--muted);
  background: var(--surface);
  padding: 6px 10px;
  border-radius: 12px;
}

.gps-chip.strong { color: var(--olive); }
.gps-chip.fair { color: var(--amber); }
.gps-chip.lost {
  color: var(--danger);
  background: rgba(220, 38, 38, 0.15);
  animation: gps-lost-pulse 1s ease-in-out infinite;
}

@keyframes gps-lost-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.6; }
}

.icon-btn {
  background: var(--surface);
  border: none;
  color: var(--text);
  width: 48px;
  height: 48px;
  border-radius: 8px;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-btn:active { background: #2a2d2a; }

.hero-metric {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 6vh;
  gap: 4px;
}

.hero-num {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: clamp(96px, 28vw, 168px);
  color: var(--amber);
  line-height: 1;
  letter-spacing: -0.02em;
}

.hero-unit {
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.2em;
  color: var(--muted);
  font-size: 16px;
  margin-top: 4px;
}

.hero-label {
  font-family: 'Roboto Condensed', sans-serif;
  font-size: 11px;
  letter-spacing: 0.3em;
  color: var(--muted);
  margin-top: 8px;
}

/* F-ADAPT-UI: Adaptive UI baseline per COMPOSITION_REGISTRY.md §6.
 * Live screen sub-metrics adapt to container width via container queries.
 * Outside the primitive registry — this is UI-infrastructure, validated by
 * form-factor visual checks at 320×568, 414×896, and 1024×1366.
 */
.live {
  container-type: inline-size;
  container-name: live;
}
.sub-metrics {
  display: grid;
  /* Auto-fit means: as many columns as fit while each is at least 80px wide.
   * On a 320px iPhone SE: 320 / (80 + 8 gap) ≈ 3 columns. On a 1024 iPad:
   * up to 6 columns. The 4-stat layout becomes responsive without media
   * queries firing on viewport breakpoints. */
  grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  gap: 8px;
  margin-top: 6vh;
}

@container live (max-width: 360px) {
  .sub-metrics {
    /* On very narrow containers, force 2-up to keep cards readable */
    grid-template-columns: repeat(2, 1fr);
  }
  .sub-stat {
    padding: 12px 4px;
    min-height: 56px;
  }
}

@container live (min-width: 720px) {
  /* Tablets and landscape phones — allow more breathing room */
  .sub-metrics {
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
  }
}

.sub-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: var(--surface);
  padding: 14px 4px;
  border-radius: 8px;
  align-items: center;
  min-height: 64px;
  justify-content: center;
}

.sub-stat .label {
  font-family: 'Roboto Condensed', sans-serif;
  font-size: 10px;
  letter-spacing: 0.15em;
  color: var(--muted);
}

.sub-stat .val {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  /* Fluid type: 18px on iPhone SE, scales up to 28px on tablets */
  font-size: clamp(18px, 5vw, 28px);
  color: var(--text);
}

/* Reduce motion support: disable pulsing animations for users who request it
 * via OS accessibility settings. The GPS-lost pulse and DR pulse are visual
 * affordances, not load-bearing UX. */
@media (prefers-reduced-motion: reduce) {
  .gps-chip.lost,
  .hr-chip.dr-active,
  .pacing-banner-row {
    animation: none !important;
  }
  * {
    transition-duration: 0.01ms !important;
  }
}

.live-controls {
  display: flex;
  gap: 12px;
  margin-top: auto;
  padding-top: 24px;
}

.live-controls .btn-large {
  flex: 1;
  padding: 22px;
  font-size: 18px;
  min-height: 60px;
}

.paused-overlay,
.lock-overlay {
  position: fixed;
  inset: 0;
  background: rgba(13, 15, 13, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 24px;
  z-index: 80;
  padding: 24px;
}

.paused-label {
  font-family: 'Roboto Condensed', sans-serif;
  font-size: 56px;
  letter-spacing: 0.2em;
  color: var(--amber);
}

.lock-label {
  font-family: 'Roboto Condensed', sans-serif;
  font-size: 32px;
  letter-spacing: 0.2em;
  color: var(--text);
}

.lock-overlay .small {
  letter-spacing: 0.1em;
}

/* Summary -------------------------------------------------------------- */

.summary-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.summary-stat {
  background: var(--surface);
  border-radius: 6px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.summary-stat .label {
  font-family: 'Roboto Condensed', sans-serif;
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--muted);
}

.summary-stat .val {
  font-family: 'JetBrains Mono', monospace;
  font-size: 22px;
  font-weight: 700;
  color: var(--amber);
}

.map-wrap {
  width: 100%;
  height: 240px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface);
}

.map-wrap.empty::before {
  content: "NO ROUTE RECORDED";
  display: flex;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.15em;
  font-size: 12px;
}

textarea {
  background: var(--surface);
  border: 1px solid var(--surface-2);
  color: var(--text);
  border-radius: 6px;
  padding: 12px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  resize: vertical;
}

/* History -------------------------------------------------------------- */

.filter-row {
  display: flex;
  gap: 8px;
}

.filter {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--surface-2);
  padding: 8px 14px;
  border-radius: 999px;
  font-family: 'Roboto Condensed', sans-serif;
  letter-spacing: 0.15em;
  font-size: 12px;
  cursor: pointer;
}

.filter.selected {
  background: var(--amber);
  color: #1a1102;
  border-color: var(--amber);
}

.empty {
  text-align: center;
  padding: 24px;
}

/* Detail --------------------------------------------------------------- */

.notes {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  margin: 0;
  white-space: pre-wrap;
}

/* Profile -------------------------------------------------------------- */

.setting-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
}

select {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--surface-2);
  border-radius: 6px;
  padding: 8px 10px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
}

.toggle {
  position: relative;
  width: 42px;
  height: 24px;
  display: inline-block;
}

.toggle input { display: none; }

.toggle span {
  position: absolute;
  inset: 0;
  background: var(--surface-2);
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.toggle span::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: var(--muted);
  border-radius: 50%;
  transition: all 0.15s ease;
}

.toggle input:checked + span {
  background: var(--amber);
}

.toggle input:checked + span::after {
  left: 21px;
  background: #1a1102;
}

/* Toast ---------------------------------------------------------------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tab-h) + 12px);
  transform: translateX(-50%) translateY(20px);
  background: var(--surface-2);
  color: var(--text);
  padding: 10px 16px;
  border-radius: 6px;
  font-size: 13px;
  letter-spacing: 0.05em;
  border: 1px solid var(--amber);
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
  z-index: 100;
  max-width: 90vw;
  text-align: center;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast.danger { border-color: var(--danger); }
.toast.success { border-color: var(--green); }

/* Leaflet dark tweaks -------------------------------------------------- */

.leaflet-container {
  background: var(--surface) !important;
}

.leaflet-control-attribution {
  background: rgba(13, 15, 13, 0.7) !important;
  color: var(--muted) !important;
  font-size: 10px !important;
}

.leaflet-control-attribution a {
  color: var(--muted) !important;
}

/* Confirmation modal --------------------------------------------------- */

.modal-root {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.modal-card {
  position: relative;
  background: var(--surface);
  border: 1px solid #2a2d2a;
  border-radius: 12px;
  padding: 24px;
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

.modal-title {
  font-family: 'Roboto Condensed', sans-serif;
  font-weight: 700;
  font-size: 22px;
  letter-spacing: 0.05em;
  color: var(--text);
  margin: 0;
}

.modal-message {
  color: var(--muted);
  margin: 0;
  line-height: 1.5;
}

.modal-actions {
  display: flex;
  gap: 12px;
  margin-top: 8px;
  justify-content: flex-end;
}

.modal-actions .btn {
  min-width: 100px;
  min-height: 48px;
}

.modal-card.danger .btn-primary {
  background: var(--danger);
  color: var(--text);
}

/* Pack-weight stepper -------------------------------------------------- */

.stepper {
  display: flex;
  align-items: stretch;
  gap: 12px;
  margin-top: 12px;
}

.stepper-btn {
  flex: 0 0 64px;
  height: 80px;
  background: var(--surface);
  border: 1px solid #2a2d2a;
  color: var(--amber);
  border-radius: 8px;
  font-size: 36px;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

.stepper-btn:active {
  background: #2a2d2a;
  transform: scale(0.96);
}

.stepper-display {
  flex: 1;
  background: var(--surface);
  border: 1px solid #2a2d2a;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 80px;
}

.stepper-display input {
  width: 100%;
  background: transparent;
  border: none;
  color: var(--amber);
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 44px;
  text-align: right;
  padding: 0;
  -moz-appearance: textfield;
  -webkit-appearance: none;
  appearance: none;
}

.stepper-display input::-webkit-outer-spin-button,
.stepper-display input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.stepper-display input:focus {
  outline: none;
}

.stepper-display .suffix {
  font-family: 'JetBrains Mono', monospace;
  color: var(--muted);
  font-size: 14px;
  letter-spacing: 0.2em;
  padding-right: 12px;
}

/* Header action button slot (right side of screen-header) -------------- */

.screen-header .header-action {
  margin-left: auto;
}

/* Min tap targets ------------------------------------------------------ */

.btn,
.tab,
.back,
.icon-btn,
.mode,
.filter,
.ob-card {
  min-height: 48px;
}

.btn-large {
  min-height: 60px;
}

/* Tabbar safe-area ----------------------------------------------------- */

.tabbar {
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

/* Pacing options (pre-workout) ----------------------------------------- */

.pacing-section {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pacing-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pacing-opt {
  background: var(--surface);
  border: 1px solid #2a2d2a;
  color: var(--text);
  padding: 14px 16px;
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  min-height: 56px;
  transition: border-color 0.15s, background 0.15s;
}

.pacing-opt:active { background: #2a2d2a; }

.pacing-opt.selected {
  border-color: var(--amber);
  background: rgba(244, 129, 31, 0.08);
}

.pacing-opt .opt-label {
  font-family: 'Roboto Condensed', sans-serif;
  font-weight: 700;
  letter-spacing: 0.1em;
  font-size: 14px;
}

.pacing-opt .opt-sub {
  font-family: 'JetBrains Mono', monospace;
  color: var(--muted);
  font-size: 12px;
}

.pacing-opt.selected .opt-label {
  color: var(--amber);
}

/* Pacing banner (live screen) ----------------------------------------- */

.pacing-banner {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 16px;
  border-radius: 8px;
  background: var(--surface);
  border-left: 4px solid var(--olive);
  margin: 4px 0;
}

.pacing-banner-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.pacing-banner-row.paces {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.pacing-target,
.pacing-current {
  display: inline-block;
}

.pacing-current.on-target { color: var(--olive); }
.pacing-current.slow      { color: var(--amber); }
.pacing-current.too-slow  { color: var(--danger); }
.pacing-current.too-fast  { color: #5b8db3; }

.pacing-banner.run {
  border-left-color: var(--olive);
  background: rgba(74, 93, 35, 0.12);
}

.pacing-banner.walk {
  border-left-color: var(--amber);
  background: rgba(244, 129, 31, 0.12);
}

.pacing-phase {
  font-family: 'Roboto Condensed', sans-serif;
  font-weight: 700;
  letter-spacing: 0.2em;
  font-size: 22px;
}

.pacing-banner.run .pacing-phase { color: var(--olive); }
.pacing-banner.walk .pacing-phase { color: var(--amber); }

.pacing-remaining {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 18px;
  color: var(--text);
}

/* Pace + custom + goal configurators ----------------------------------- */

.pace-config,
.custom-config,
.goal-config {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pace-value,
.goal-value {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  color: var(--amber);
  font-size: 44px;
}

.pace-derived,
.goal-eta {
  font-family: 'JetBrains Mono', monospace;
  color: var(--olive);
  font-size: 13px;
  letter-spacing: 0.08em;
  margin: 0;
  white-space: pre-line;
  line-height: 1.5;
}

.stepper-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stepper-btn.small {
  flex: 0 0 56px;
  height: 56px;
  font-size: 28px;
}

.stepper-display.small {
  height: 56px;
}

.stepper-display.small span {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 28px;
  color: var(--amber);
}

/* Injury warning ------------------------------------------------------- */

.injury-warning {
  background: rgba(220, 38, 38, 0.1);
  border-left: 4px solid var(--danger);
  color: var(--text);
  font-size: 13px;
  line-height: 1.5;
  padding: 10px 12px;
  border-radius: 4px;
  margin: 0;
}

.injury-warning.caution {
  background: rgba(244, 129, 31, 0.1);
  border-left-color: var(--amber);
}

/* Goal section --------------------------------------------------------- */

.goal-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.goal-options {
  display: flex;
  gap: 8px;
}

.goal-opt {
  flex: 1;
  background: var(--surface);
  border: 1px solid #2a2d2a;
  color: var(--text);
  padding: 12px;
  border-radius: 6px;
  font-family: 'Roboto Condensed', sans-serif;
  font-weight: 700;
  letter-spacing: 0.15em;
  cursor: pointer;
  min-height: 48px;
}

.goal-opt:active { background: #2a2d2a; }

.goal-opt.selected {
  border-color: var(--amber);
  background: rgba(244, 129, 31, 0.1);
  color: var(--amber);
}

/* Live screen — goal progress + pace color cue ------------------------- */

.goal-progress {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0 8px;
  margin-top: -8px;
}

.goal-progress-bar {
  height: 6px;
  background: #1a1d1a;
  border-radius: 3px;
  overflow: hidden;
}

.goal-progress-fill {
  height: 100%;
  background: var(--amber);
  width: 0%;
  transition: width 0.5s ease;
}

.goal-progress-label {
  display: flex;
  justify-content: space-between;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.sub-stat .val.on-target { color: var(--olive); }
.sub-stat .val.slow      { color: var(--amber); }
.sub-stat .val.too-slow  { color: var(--danger); }
.sub-stat .val.too-fast  { color: #5b8db3; }

/* Fuel/hydration alert (live screen) ----------------------------------- */

.fuel-alert {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 10px;
  background: rgba(91, 141, 179, 0.15);
  border: 1px solid rgba(91, 141, 179, 0.4);
  margin: 4px 0;
  animation: fuel-pulse 1.4s ease-in-out infinite;
}

@keyframes fuel-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(91, 141, 179, 0.35); }
  50%      { box-shadow: 0 0 0 6px rgba(91, 141, 179, 0); }
}

.fuel-alert-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.fuel-alert-title {
  font-family: 'Roboto Condensed', sans-serif;
  font-weight: 700;
  letter-spacing: 0.2em;
  font-size: 18px;
  color: #8db4d6;
}

.fuel-alert-detail {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--text);
}

.fuel-alert-actions {
  display: flex;
  gap: 6px;
}

.fuel-alert-actions .btn {
  padding: 10px 14px;
  min-height: 44px;
  font-size: 13px;
}

/* Goal status chip + required pace hint -------------------------------- */

.goal-status-chip {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.1em;
  padding: 2px 8px;
  border-radius: 10px;
}

.goal-status-chip.on-track { color: var(--olive); }
.goal-status-chip.ahead    { color: #5b8db3; }
.goal-status-chip.behind   { color: var(--amber); }

.required-pace-hint {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--muted);
  margin: 4px 0 0;
  text-align: center;
}

.required-pace-hint.urgent { color: var(--amber); }

/* Fuel plan preview (pre-workout) -------------------------------------- */

.fuel-plan-preview {
  margin-top: 12px;
  padding: 10px 12px;
  background: var(--surface);
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.fuel-plan-preview .row {
  display: flex;
  justify-content: space-between;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
}

.fuel-plan-preview .row .label {
  color: var(--muted);
}

.fuel-plan-preview .row .val {
  color: var(--text);
}

.fuel-plan-preview .notes {
  color: var(--muted);
  font-size: 12px;
  font-style: italic;
  margin: 4px 0 0;
}

/* ============================================================
   TILES — glanceable, tap-to-open-sheet primitives
   ============================================================ */

.tile-screen {
  /* No internal scrolling — pages fit on one screen on phones. */
  gap: 12px;
  padding-bottom: calc(var(--tab-h, 64px) + 24px + env(safe-area-inset-bottom, 0px));
}

.tile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.tile-grid.cols-4 {
  grid-template-columns: 1fr 1fr;
}

.tile {
  background: linear-gradient(180deg, #1a1d1a 0%, #14171a 100%);
  border: 1px solid #2a2d2a;
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  text-align: left;
  min-height: 76px;
  position: relative;
  overflow: hidden;
  transition: transform 0.1s ease, border-color 0.15s ease, background 0.15s ease;
  touch-action: manipulation;
  color: var(--text);
  font-family: inherit;
}

.tile::after {
  content: '›';
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 22px;
  font-weight: 300;
  line-height: 1;
}

.tile:active {
  transform: scale(0.98);
  background: #1f2421;
  border-color: var(--amber);
}

.tile-wide { grid-column: 1 / -1; min-height: 76px; }

.tile-label {
  font-family: 'Roboto Condensed', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--muted);
}

.tile-value {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 17px;
  color: var(--text);
  padding-right: 18px; /* room for the chevron */
  line-height: 1.3;
}

.tile-detail {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.05em;
  color: var(--olive);
}

/* Tile in "warn" state — e.g. injury risk on pacing tile */
.tile.warn { border-color: var(--amber); }
.tile.warn .tile-value { color: var(--amber); }
.tile.danger { border-color: var(--danger); }
.tile.danger .tile-value { color: var(--danger); }

/* GPS chip line on pre-workout */
.gps-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 4px;
  gap: 8px;
  flex-wrap: wrap;
}

.injury-pill {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 12px;
  background: rgba(244, 129, 31, 0.12);
  color: var(--amber);
  letter-spacing: 0.05em;
}

.injury-pill.danger {
  background: rgba(220, 38, 38, 0.15);
  color: var(--danger);
}

/* ============================================================
   BOTTOM SHEETS — slide-up popovers for deeper interaction
   ============================================================ */

.sheet {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  pointer-events: auto;
}

.sheet.hidden {
  pointer-events: none;
}

.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.sheet:not(.hidden) .sheet-backdrop { opacity: 1; }

.sheet-card {
  position: relative;
  background: linear-gradient(180deg, #1a1d1a 0%, #0f1110 100%);
  border-top: 1px solid #2a2d2a;
  border-radius: 20px 20px 0 0;
  width: 100%;
  max-width: 560px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
  box-shadow: 0 -20px 80px rgba(0, 0, 0, 0.7);
  overflow: hidden;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.sheet:not(.hidden) .sheet-card { transform: translateY(0); }

.sheet-handle {
  width: 40px;
  height: 4px;
  background: #3a3d3a;
  border-radius: 2px;
  margin: 10px auto 4px;
  flex: 0 0 auto;
}

.sheet-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 20px 12px;
  border-bottom: 1px solid #1f2421;
  flex: 0 0 auto;
}

.sheet-header h3 {
  font-family: 'Roboto Condensed', sans-serif;
  font-weight: 700;
  letter-spacing: 0.15em;
  font-size: 16px;
  margin: 0;
  color: var(--text);
}

.sheet-close {
  background: none;
  border: none;
  color: var(--amber);
  font-family: 'Roboto Condensed', sans-serif;
  font-weight: 700;
  letter-spacing: 0.15em;
  font-size: 13px;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 6px;
  min-height: 44px;
}

.sheet-close:active { background: rgba(244, 129, 31, 0.12); }

.sheet-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 16px 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  -webkit-overflow-scrolling: touch;
}

.sheet-body .btn { width: 100%; }

/* Inputs/selects inside sheets follow the existing setting-row style. */

/* Hide leftover screen-header back button label on tile pages */
.tile-screen .screen-header h2 {
  flex: 1;
  font-size: 22px;
  letter-spacing: 0.12em;
}

/* Mode help text inside mode sheet */
.mode-help {
  margin: 12px 0 0;
  line-height: 1.5;
}

/* Storage-stats rows */
.storage-stats {
  background: var(--surface);
  border-radius: 8px;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.storage-stats .row {
  display: flex;
  justify-content: space-between;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
}
.storage-stats .row .label { color: var(--muted); }
.storage-stats .row .val   { color: var(--text); }

.version-line { text-align: center; margin: 4px 0 0; }

/* ============================================================
   HOME — calibration prompt + readiness card
   ============================================================ */

.calibration-card {
  background: linear-gradient(135deg, rgba(244, 129, 31, 0.18), rgba(74, 93, 35, 0.12));
  border: 1px solid rgba(244, 129, 31, 0.35);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.calibration-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cal-title {
  font-family: 'Roboto Condensed', sans-serif;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--amber);
  font-size: 13px;
}

.cal-sub {
  color: var(--text);
  font-size: 13px;
  line-height: 1.45;
}

.calibration-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.calibration-actions .btn { min-width: 100px; min-height: 44px; }

.readiness-card {
  background: var(--surface);
  border-radius: 12px;
  border: 1px solid #2a2d2a;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.readiness-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.readiness-label {
  font-family: 'Roboto Condensed', sans-serif;
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--muted);
}

.readiness-value {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 18px;
  color: var(--olive);
}

.readiness-value.warn   { color: var(--amber); }
.readiness-value.danger { color: var(--danger); }

.readiness-detail { margin: 2px 0 0; line-height: 1.4; }

.compact-panel { padding: 12px 16px; }

.panel-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
}

.link-btn {
  background: none;
  border: none;
  color: var(--amber);
  font-family: 'Roboto Condensed', sans-serif;
  font-weight: 700;
  letter-spacing: 0.12em;
  font-size: 12px;
  cursor: pointer;
  padding: 4px 8px;
}

/* ============================================================
   CALIBRATION SCREEN
   ============================================================ */

.cal-phase-card {
  background: linear-gradient(180deg, rgba(244, 129, 31, 0.12), rgba(244, 129, 31, 0.04));
  border: 1px solid rgba(244, 129, 31, 0.3);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
}

.cal-phase-label {
  font-family: 'Roboto Condensed', sans-serif;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.25em;
  color: var(--amber);
}

.cal-phase-step {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.cal-instruction {
  background: var(--surface);
  border-left: 3px solid var(--olive);
  padding: 12px 14px;
  border-radius: 6px;
  color: var(--text);
  font-size: 13px;
  line-height: 1.5;
  margin: 0;
}

.cal-steps {
  margin: 8px 0;
  padding-left: 20px;
  line-height: 1.6;
  color: var(--text);
  font-size: 14px;
}

.cal-steps li { margin: 4px 0; }

.cal-result-headline {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 22px;
  color: var(--amber);
  text-align: center;
  margin: 4px 0 8px;
}

/* ============================================================
   WORKOUT-OF-THE-DAY CARD — the hero recommendation on home
   ============================================================ */

.wod-card {
  background: linear-gradient(135deg, #1a1d1a 0%, #2a1f15 60%, #1a1d1a 100%);
  border: 1px solid rgba(244, 129, 31, 0.4);
  border-radius: 14px;
  padding: 18px 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  text-align: left;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform 0.1s ease, border-color 0.15s ease;
  touch-action: manipulation;
  color: var(--text);
  font-family: inherit;
}

.wod-card::before {
  /* Subtle glow on top-left to hint at the energy. */
  content: '';
  position: absolute;
  top: -50%;
  left: -20%;
  width: 80%;
  height: 100%;
  background: radial-gradient(circle, rgba(244, 129, 31, 0.18), transparent 60%);
  pointer-events: none;
}

.wod-card:active {
  transform: scale(0.985);
  border-color: var(--amber);
}

.wod-card.rest {
  background: linear-gradient(135deg, #1a1d1a 0%, #1d2415 60%, #1a1d1a 100%);
  border-color: rgba(74, 93, 35, 0.4);
}
.wod-card.rest::before {
  background: radial-gradient(circle, rgba(74, 93, 35, 0.15), transparent 60%);
}
.wod-card.rest .wod-action { color: var(--olive); }
.wod-card.rest .wod-tag { color: var(--olive); border-color: rgba(74, 93, 35, 0.4); }

.wod-tag {
  font-family: 'Roboto Condensed', sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.22em;
  color: var(--amber);
  border: 1px solid rgba(244, 129, 31, 0.4);
  padding: 3px 8px;
  border-radius: 4px;
  align-self: flex-start;
  text-transform: uppercase;
}

.wod-label {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 22px;
  line-height: 1.15;
  letter-spacing: 0.02em;
  color: var(--text);
  margin-top: 2px;
  padding-right: 8px;
}

.wod-sub {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  padding-right: 8px;
}

.wod-action {
  font-family: 'Roboto Condensed', sans-serif;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--amber);
  margin-top: 8px;
  align-self: flex-end;
}

.freestyle-btn {
  text-align: center;
  width: 100%;
  font-size: 11px;
  padding: 8px;
  color: var(--muted);
  letter-spacing: 0.1em;
  text-transform: none;
}

/* ============================================================
   HR PAIRING TILE STATES + LIVE HR DISPLAY
   ============================================================ */

.hr-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(220, 38, 38, 0.12);
  color: #ff7070;
  border: 1px solid rgba(220, 38, 38, 0.25);
  border-radius: 12px;
  padding: 4px 10px;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.05em;
}

.hr-chip.zone-1 { color: #4a90c2; }
.hr-chip.zone-2 { color: #7ec96a; }
.hr-chip.zone-3 { color: #f5d847; }
.hr-chip.zone-4 { color: #f4811f; }
.hr-chip.zone-5 { color: #dc2626; }

/* Pulse animation when HR is live */
.hr-chip.live::before {
  content: '♥';
  animation: hrpulse 1s ease-in-out infinite;
}

@keyframes hrpulse {
  0%, 100% { opacity: 0.5; transform: scale(1); }
  20% { opacity: 1; transform: scale(1.15); }
  40% { opacity: 0.6; transform: scale(1); }
}

/* Post-workout RPE picker */
.rpe-picker {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}

.rpe-btn {
  background: var(--surface);
  border: 1px solid #2a2d2a;
  border-radius: 8px;
  padding: 12px 0;
  cursor: pointer;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 18px;
  color: var(--text);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  touch-action: manipulation;
}
.rpe-btn:active { transform: scale(0.95); }
.rpe-btn.selected {
  background: var(--amber);
  color: var(--bg);
  border-color: var(--amber);
}
.rpe-btn .rpe-sub {
  font-family: 'Roboto Condensed', sans-serif;
  font-size: 9px;
  letter-spacing: 0.1em;
  color: var(--muted);
  font-weight: 400;
}
.rpe-btn.selected .rpe-sub { color: var(--bg); }

/* Cadence and dead-reckoning chips */
.hr-chip.cadence {
  background: rgba(74, 93, 35, 0.16);
  color: var(--olive);
  border-color: rgba(74, 93, 35, 0.3);
}
.hr-chip.cadence::before {
  content: '👟';
  animation: none;
  font-size: 11px;
}

.hr-chip.dr-active {
  background: rgba(244, 129, 31, 0.16);
  color: var(--amber);
  border-color: rgba(244, 129, 31, 0.35);
  animation: pdr-pulse 1.2s ease-in-out infinite;
}
@keyframes pdr-pulse {
  0%, 100% { opacity: 0.7; }
  50%       { opacity: 1.0; }
}

/* Goal-behavior toggle row */
.goal-behavior-row {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--divider, rgba(255,255,255,0.08));
}
.goal-behavior-row .muted.small {
  display: block;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 8px;
  opacity: 0.7;
}
.goal-behavior-options {
  display: flex;
  gap: 8px;
}
.goal-behavior-opt {
  flex: 1;
  padding: 10px 12px;
  border-radius: 6px;
  border: 1px solid var(--divider, rgba(255,255,255,0.12));
  background: transparent;
  color: var(--fg, #d8d4cc);
  font-size: 12px;
  letter-spacing: 0.06em;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.4, 0.0, 0.2, 1);
}
.goal-behavior-opt:hover {
  border-color: var(--olive, #4a5d23);
}
.goal-behavior-opt.selected {
  background: var(--olive, #4a5d23);
  border-color: var(--olive, #4a5d23);
  color: #fff;
}
.muted.tiny {
  font-size: 10.5px;
  opacity: 0.55;
  margin-top: 6px;
  letter-spacing: 0.02em;
}

/* Diagnostics export row on summary — F-DIAG */
.diag-row {
  display: flex;
  justify-content: center;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--divider, rgba(255,255,255,0.06));
}
.btn.btn-text.small {
  font-size: 11px;
  letter-spacing: 0.08em;
  opacity: 0.6;
  padding: 8px 16px;
}
.btn.btn-text.small:hover {
  opacity: 1;
}

/* ----- F-PLAN UI ----- */
/* Plan progress card on home — visible only when a plan is active */
.plan-progress-card {
  background: var(--surface);
  border: 1px solid var(--divider, rgba(255,255,255,0.08));
  border-radius: 12px;
  padding: 14px 14px 12px;
  margin-top: 14px;
}
.plan-progress-card .panel-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
}
.plan-progress-card .panel-title {
  font-family: 'Roboto Condensed', sans-serif;
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--olive, #4a5d23);
  margin: 0;
}
.plan-progress-row {
  height: 6px;
  background: rgba(255,255,255,0.06);
  border-radius: 3px;
  overflow: hidden;
  margin: 6px 0 8px;
}
.plan-progress-fill {
  height: 100%;
  background: var(--olive, #4a5d23);
  transition: width 0.4s cubic-bezier(0.4, 0.0, 0.2, 1);
  width: 0%;
}

.plans-link {
  font-size: 12px;
  margin-top: 12px;
  opacity: 0.75;
  display: inline-block;
}

/* Plans sheet — picker + active sections */
.plans-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 16px 0;
}
.plan-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--bg, #0D0F0D);
  border: 1px solid var(--divider, rgba(255,255,255,0.12));
  border-radius: 10px;
  padding: 14px;
  text-align: left;
  color: var(--fg, #d8d4cc);
  cursor: pointer;
  transition: border-color 0.2s, transform 0.1s;
}
.plan-card:hover {
  border-color: var(--olive, #4a5d23);
}
.plan-card:active {
  transform: scale(0.99);
}
.plan-card-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}
.plan-card-label {
  font-family: 'Roboto Condensed', sans-serif;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text);
}
.plan-card-duration {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--olive, #4a5d23);
  letter-spacing: 0.08em;
}
.plan-card-desc {
  font-size: 13px;
  line-height: 1.45;
  margin: 4px 0 0;
}
.plan-card-target,
.plan-citation {
  font-size: 11px;
  line-height: 1.4;
  margin: 0;
  opacity: 0.65;
}
.plan-card-action {
  margin-top: 8px;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--amber, #c9a45c);
  text-align: right;
}

.plan-active-summary {
  padding: 14px;
  background: var(--bg, #0D0F0D);
  border-radius: 8px;
  margin-bottom: 14px;
}
.plan-active-label {
  display: block;
  font-family: 'Roboto Condensed', sans-serif;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--olive, #4a5d23);
  margin-bottom: 6px;
}

/* ----- F-METRONOME: live header chip + button state ----- */
.hr-chip.metronome {
  background: rgba(244, 129, 31, 0.18);
  color: var(--amber, #c9a45c);
  border: 1px solid rgba(244, 129, 31, 0.4);
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
}
.icon-btn.on {
  background: var(--amber, #c9a45c);
  color: #0D0F0D;
}
.icon-btn.on:active {
  background: #d4b06a;
}

/* ----- F-PACE-ZONES: pre-workout pace zones card ----- */
.zones-card {
  background: rgba(244, 129, 31, 0.07);
  border: 1px solid rgba(244, 129, 31, 0.25);
  border-radius: 10px;
  padding: 10px 12px;
  margin: 8px 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.zones-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: var(--amber, #c9a45c);
  text-transform: uppercase;
}
.zones-detail {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--text-2, #b0b3b0);
  line-height: 1.4;
}

/* ----- F-PLAN-GENERATE: generate-plan form styling ----- */
.gen-plan-section {
  margin: 16px 0;
  padding: 12px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
#gen-plan-toggle {
  width: 100%;
  font-size: 13px;
}
.gen-plan-form {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.gen-plan-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.gen-plan-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-2, #b0b3b0);
  min-width: 110px;
}
.seg {
  display: flex;
  gap: 4px;
  background: rgba(255, 255, 255, 0.04);
  padding: 3px;
  border-radius: 8px;
}
.seg-btn {
  background: transparent;
  border: none;
  color: var(--text-2, #b0b3b0);
  padding: 6px 10px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.seg-btn.selected {
  background: var(--amber, #c9a45c);
  color: #0D0F0D;
}
.seg-btn.hidden {
  display: none;
}
.gen-plan-num {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: var(--text, #ECECEC);
  padding: 6px 10px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  font-weight: 700;
  width: 70px;
  text-align: center;
}
.gen-plan-result {
  margin-top: 4px;
  font-size: 12px;
  color: var(--amber, #c9a45c);
  line-height: 1.4;
  min-height: 16px;
}
