
/* ---------- staggered entrance (tasteful, CSS only) ---------- */
@keyframes riseIn {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
.view.on .rise { animation: riseIn 0.5s cubic-bezier(0.2, 0.7, 0.25, 1) both; }
.view.on .d1 { animation-delay: 0.05s; }
.view.on .d2 { animation-delay: 0.1s; }
.view.on .d3 { animation-delay: 0.16s; }
.view.on .d4 { animation-delay: 0.22s; }
.view.on .d5 { animation-delay: 0.28s; }
.view.on .d6 { animation-delay: 0.34s; }
.view.on .d7 { animation-delay: 0.4s; }
.view.on .d8 { animation-delay: 0.46s; }
@media (prefers-reduced-motion: reduce) {
  .view.on .rise { animation: none; }
  .route-dots { animation: none !important; }
  .pin-glow { animation: none !important; }
}

/* ---------- coach quick-ask bar ---------- */
.quick-ask {
  display: flex; align-items: center; gap: 10px;
  margin-top: 14px; padding: 8px 8px 8px 18px;
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
}
.quick-ask input {
  flex: 1; min-width: 0; background: none; border: none;
  color: var(--text); font-size: 15px; font-family: var(--font-body);
}
.quick-ask input:focus { outline: none; }
.quick-ask input::placeholder { color: var(--muted); }
.quick-send {
  width: 46px; height: 46px; border-radius: 12px; border: none; cursor: pointer;
  background: linear-gradient(135deg, var(--red), #a80400);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(225, 6, 0, 0.35);
}
.quick-send:active { transform: scale(0.94); }
.quick-send svg { width: 22px; height: 22px; stroke: #fff; }

/* ---------- track: hero ---------- */
.track-hero-head {
  font-family: var(--font-display); font-weight: 800;
  font-size: 46px; line-height: 0.98; letter-spacing: 0.5px;
  margin: 4px 2px 10px; color: #fff;
}
.track-hero-head span { color: var(--salmon); }
.track-hero-sub {
  color: var(--muted); font-size: 14px; line-height: 1.55;
  margin: 0 2px 18px; max-width: 420px;
}

/* ---------- track: 7-day output card ---------- */
.output-card {
  position: relative; overflow: hidden;
  border: 1px solid var(--line); border-radius: 20px;
  padding: 20px 20px 8px;
  background:
    repeating-linear-gradient(115deg, rgba(255, 255, 255, 0.028) 0 2px, transparent 2px 15px),
    linear-gradient(120deg, #15151a 0%, #0b0b0f 70%);
}
.output-card .eyebrow-red { margin-bottom: 6px; }
.output-stat { display: flex; align-items: baseline; gap: 8px; }
.output-stat b {
  font-family: var(--font-display); font-weight: 800;
  font-size: 64px; line-height: 1; letter-spacing: 0.5px; color: #fff;
}
.output-stat span {
  font-size: 15px; font-weight: 800; letter-spacing: 1px; color: var(--muted);
}
.output-sub { color: var(--muted); font-size: 13px; margin: 6px 0 0; }
.route-art { display: block; width: 100%; height: auto; margin-top: 2px; }
.route-reveal { transform-box: fill-box; transform-origin: left center; }
.route-art:not(.draw) .route-reveal { transform: scaleX(0); }
.route-art.draw .route-reveal {
  transform: scaleX(1);
  transition: transform 1.15s cubic-bezier(0.45, 0, 0.2, 1) 0.2s;
}
.route-dots { animation: dotFlow 2.8s linear infinite; }
@keyframes dotFlow { to { stroke-dashoffset: -10.5; } }
.pin-glow {
  transform-box: fill-box; transform-origin: center;
  animation: pinPulse 2.2s ease-in-out infinite;
}
@keyframes pinPulse { 50% { transform: scale(1.4); opacity: 0.5; } }

.output-strip {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 4px; margin: 2px 0 4px;
  border-bottom: 1px solid var(--line);
}
.output-strip p { margin: 0; }
.output-strip span { color: var(--muted); font-size: 12px; }

/* ---------- track: activity selector ---------- */
.act-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
  margin: 14px 0;
}
.act-card {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; padding: 16px 6px 13px; cursor: pointer;
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  color: var(--muted); font-family: var(--font-body);
  transition: transform 0.12s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.act-card:active { transform: scale(0.95); }
.act-card svg {
  width: 24px; height: 24px; fill: none;
  stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.act-card span { font-size: 12px; font-weight: 800; letter-spacing: 1.5px; }
.act-card.on {
  border-color: var(--green); color: var(--green);
  box-shadow: 0 0 0 1px var(--green), 0 0 22px rgba(34, 197, 94, 0.22);
  background: rgba(34, 197, 94, 0.06);
}

/* ---------- track: name + goal fields ---------- */
.track-fields { display: flex; gap: 10px; margin-bottom: 12px; }
.tfield { flex: 1; min-width: 0; }
.tfield.goal { flex: 0 0 108px; }
.tfield label {
  display: block; font-size: 10.5px; font-weight: 800; letter-spacing: 1.8px;
  color: var(--muted); margin: 0 2px 7px;
}
.tfield input {
  width: 100%; padding: 13px 14px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--card); color: var(--text);
  font-size: 15px; font-weight: 600; font-family: var(--font-body);
}
.tfield input:focus { outline: none; border-color: var(--red); }

/* ---------- track: start button ---------- */
.start-activity {
  width: 100%; display: flex; align-items: center; gap: 15px;
  padding: 15px 18px; border: none; border-radius: 18px; cursor: pointer;
  background: linear-gradient(135deg, #f1261f, #b30400);
  color: #fff; text-align: left; font-family: var(--font-body);
  box-shadow: 0 10px 30px rgba(225, 6, 0, 0.35);
  transition: transform 0.12s ease;
}
.start-activity:active { transform: scale(0.985); }
.sa-icon {
  width: 48px; height: 48px; border-radius: 50%; flex-shrink: 0;
  background: rgba(255, 255, 255, 0.18);
  display: flex; align-items: center; justify-content: center;
}
.sa-icon svg {
  width: 24px; height: 24px; fill: none;
  stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.sa-text b { display: block; font-size: 17px; font-weight: 800; letter-spacing: 0.2px; }
.sa-text small { color: rgba(255, 255, 255, 0.78); font-size: 12px; }
.start-activity.recording {
  background: linear-gradient(135deg, #1b1b20, #2b2b32);
  border: 2px solid var(--red);
  animation: pulse 1.6s ease-in-out infinite;
}
.gps-note {
  display: flex; gap: 8px; align-items: flex-start;
  color: var(--muted); font-size: 12px; line-height: 1.5;
  margin: 12px 2px 0;
}
.gps-note svg {
  width: 15px; height: 15px; flex-shrink: 0; margin-top: 1px;
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.live-stats { margin-top: 14px; }

/* ---------- track: sensor hub ---------- */
.section-title.eyebrow-green { color: var(--green); }
.sensor-card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px; margin-bottom: 6px;
}
.hr-row { display: flex; align-items: center; gap: 16px; margin-bottom: 14px; }
.hr-readout {
  width: 86px; height: 86px; border-radius: 50%; flex-shrink: 0;
  border: 2px solid var(--green); background: rgba(34, 197, 94, 0.07);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.hr-readout b {
  font-family: var(--font-display); font-weight: 800; font-size: 32px;
  color: var(--green); line-height: 1;
}
.hr-readout small { color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: 2px; }
.hr-info b { font-size: 15px; font-weight: 700; display: block; margin-bottom: 4px; }
.hr-status { color: var(--muted); font-size: 12.5px; line-height: 1.5; margin: 0; }
.sensor-card .btn-red:disabled { opacity: 0.45; cursor: not-allowed; box-shadow: none; }

/* ---------- saved-plate delete button ---------- */
.meal-del {
  width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0;
  border: 1px solid var(--line); background: transparent;
  color: var(--muted); font-size: 14px; cursor: pointer;
}
.meal-del:active { transform: scale(0.92); color: var(--red-soft); border-color: var(--red); }

/* ---------- sensor hub: rows + import ---------- */
.sensor-title {
  display: flex; align-items: center; justify-content: space-between;
  font-family: var(--font-display); font-weight: 800; font-size: 24px;
  letter-spacing: 0.5px; margin: 0 0 4px;
}
.sensor-title svg { width: 22px; height: 22px; stroke: var(--red-soft); flex-shrink: 0; }
.sensor-row {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 0; border-top: 1px solid var(--line);
}
.sensor-row-text { flex: 1; }
.badge {
  font-size: 9.5px; font-weight: 800; letter-spacing: 1px;
  padding: 5px 8px; border-radius: 7px; flex-shrink: 0; margin-top: 1px;
}
.badge-live { background: rgba(34, 197, 94, 0.14); color: var(--green); border: 1px solid rgba(34,197,94,.35); }
.badge-file { background: rgba(142, 147, 156, 0.12); color: var(--muted); border: 1px solid var(--line); }
.sensor-row-text b { font-size: 14.5px; font-weight: 700; display: block; margin-bottom: 3px; }
.sensor-row-text p { color: var(--muted); font-size: 12.5px; line-height: 1.5; margin: 0; }
.sensor-card .hr-row { margin: 12px 0; }
.import-row { display: flex; gap: 10px; align-items: flex-end; margin-top: 4px; }
.import-row .tfield { flex: 1; margin-bottom: 0; }
.import-btn {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 10px; border-radius: 12px; cursor: pointer; white-space: nowrap;
  background: transparent; border: 1.5px solid var(--green); color: var(--green);
  font-weight: 800; font-size: 13px; letter-spacing: 0.5px; font-family: var(--font-body);
}
.import-btn:active { transform: scale(0.97); background: rgba(34, 197, 94, 0.08); }
.import-btn svg { width: 16px; height: 16px; }
.import-status { font-size: 12.5px; color: var(--muted); margin: 10px 2px 0; line-height: 1.5; }

.empty-activities {
  border: 1.5px dashed var(--line); border-radius: var(--radius);
  padding: 36px 20px; text-align: center;
}
.empty-activities svg { width: 30px; height: 30px; stroke: var(--red-soft); margin-bottom: 10px; }
.empty-activities b {
  display: block; font-family: var(--font-display); font-weight: 800;
  font-size: 22px; letter-spacing: 1.5px; margin-bottom: 6px;
}
.empty-activities p { color: var(--muted); font-size: 13px; margin: 0; }

/* ---------- plans v2: training HQ ---------- */
.plans-sub {
  color: var(--muted); font-size: 14px; line-height: 1.55;
  margin: -8px 2px 16px; max-width: 34ch;
}

.plan-block-card {
  background: linear-gradient(120deg, #16161b 0%, #0e0e12 70%);
  border: 1px solid var(--line); border-radius: 22px;
  overflow: hidden; margin-bottom: 14px;
}
.plan-block-top { display: flex; gap: 8px; padding: 20px 20px 6px; align-items: center; }
.plan-block-text { flex: 1; min-width: 0; }
.plan-block-text .eyebrow-green { margin: 0 0 6px; }
.plan-block-text h3 {
  font-family: var(--font-display); font-weight: 800; font-size: 26px;
  letter-spacing: 0.5px; margin: 0 0 8px; color: #fff; line-height: 1.05;
}
.plan-block-text p { color: var(--muted); font-size: 13px; line-height: 1.55; margin: 0; }
.run-art { width: 132px; height: 110px; flex-shrink: 0; }

.plan-stats {
  display: flex; margin-top: 14px;
  border-top: 1px solid var(--line);
}
.plan-stats > div {
  flex: 1; padding: 14px 18px;
  border-left: 1px solid var(--line);
}
.plan-stats > div:first-child { border-left: none; }
.plan-stats b {
  display: block; font-family: var(--font-display);
  font-size: 30px; font-weight: 800; line-height: 1;
}
.plan-stats small {
  display: block; color: var(--muted); font-size: 10px;
  font-weight: 800; letter-spacing: 1.8px; margin-top: 4px;
}
.stats-hint {
  margin: 0; padding: 10px 18px 14px;
  color: var(--muted); font-size: 12px;
  border-top: 1px solid var(--line);
}

.plan-inputs {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px 18px 18px; margin-bottom: 6px;
}
.plan-inputs .eyebrow-green { margin: 0 0 6px; }
.plan-inputs > h3 {
  font-family: var(--font-display); font-weight: 800; font-size: 26px;
  letter-spacing: 0.5px; margin: 0 0 14px; color: #fff;
}
.plan-inputs .plate-grid { margin-bottom: 12px; }
.plan-inputs .tfield { margin-bottom: 12px; }
.plan-inputs .plate-grid .tfield { margin-bottom: 0; }

.freq-card {
  border: 1px solid var(--line); border-radius: 14px;
  padding: 14px; margin-bottom: 14px; background: var(--bg);
}
.freq-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px;
}
.freq-head span {
  font-size: 10.5px; font-weight: 800; letter-spacing: 1.8px; color: var(--muted);
}
.freq-head b { font-size: 12px; font-weight: 800; letter-spacing: 0.5px; color: var(--text); }
.freq-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.freq-day {
  padding: 11px 0; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--line); background: transparent; color: var(--text);
  font-family: var(--font-body); font-weight: 700; font-size: 13px;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.freq-day.on {
  background: var(--red); border-color: var(--red); color: #fff;
  box-shadow: 0 3px 12px rgba(225, 6, 0, 0.35);
}
.freq-day:active { transform: scale(0.95); }

.build-plan {
  display: flex; align-items: center; justify-content: space-between;
  padding: 17px 20px; font-size: 16px; font-weight: 800;
  border-radius: 14px;
}
.build-plan span { font-size: 20px; }
.build-plan:disabled { opacity: 0.55; cursor: wait; }

.plan-note {
  margin: 10px 2px 0; color: var(--red-soft);
  font-size: 13px; line-height: 1.5;
}

.preview-card { border-color: var(--red); }
.preview-card .eyebrow-red { margin: 0 0 6px; }
.join-cta { margin-top: 14px; }
.preview-note {
  text-align: center; color: var(--muted); font-size: 12px; margin: 10px 0 0;
}

/* expandable saved plans */
.plan-head {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  gap: 12px; background: none; border: none; cursor: pointer; padding: 0;
  color: var(--text); text-align: left; font-family: inherit;
}
.plan-head h3 { flex: 1; }
.plan-head .meta { display: block; }
.plan-caret {
  font-size: 18px; color: var(--muted); flex-shrink: 0;
  transition: transform 0.2s ease;
}
.plan-card.open .plan-caret { transform: rotate(180deg); }
.plan-days { display: none; margin-top: 6px; }
.plan-card.open .plan-days { display: block; animation: fadeUp 0.22s ease; }
