:root {
  color-scheme: dark;
  --bg: #06100f;
  --bg-2: #0a1614;
  --panel: rgba(255, 255, 255, 0.075);
  --panel-strong: rgba(255, 255, 255, 0.12);
  --border: rgba(216, 255, 236, 0.12);
  --text: #f5fbf8;
  --muted: #92a49d;
  --green: #35e58f;
  --cyan: #20d4f0;
  --purple: #9d5cff;
  --amber: #ffb84d;
  --coral: #ff6b6b;
  --shadow: 0 22px 80px rgba(0, 0, 0, 0.38);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 18% -4%, rgba(53, 229, 143, 0.2), transparent 30%),
    radial-gradient(circle at 84% 0%, rgba(32, 212, 240, 0.13), transparent 25%),
    linear-gradient(180deg, #071211 0%, var(--bg) 38%, #030706 100%);
  color: var(--text);
}

button,
a,
textarea {
  -webkit-tap-highlight-color: transparent;
}

button,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

h1,
h2,
h3,
p {
  margin: 0;
}

.shell {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) 18px 56px;
}

.topbar {
  position: sticky;
  top: 10px;
  z-index: 10;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
  min-height: 64px;
  padding: 10px 12px;
  border: 1px solid rgba(216, 255, 236, 0.12);
  border-radius: 20px;
  background: rgba(5, 13, 12, 0.78);
  box-shadow: 0 18px 52px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(24px);
}

.brand,
.top-actions,
.nav,
.status-card,
.section-title,
.legend,
.chart-legend,
.ai-report-head {
  display: flex;
  align-items: center;
}

.brand {
  gap: 10px;
  font-weight: 850;
  letter-spacing: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  color: #04120c;
  background: linear-gradient(135deg, var(--green), var(--cyan));
  box-shadow: 0 0 28px rgba(53, 229, 143, 0.35);
}

.nav {
  justify-content: center;
  gap: 6px;
}

.nav a {
  min-height: 36px;
  padding: 8px 12px;
  border-radius: 999px;
  color: #bad0c7;
  font-size: 14px;
}

.nav a:hover {
  background: rgba(255, 255, 255, 0.075);
  color: var(--text);
}

.top-actions {
  justify-content: flex-end;
  gap: 10px;
}

.sync-pill,
.status-pills span {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.06);
  color: #d7e6df;
  font-size: 13px;
  font-weight: 750;
}

.sync-pill {
  padding: 0 12px;
  white-space: nowrap;
}

.icon-button,
.primary-button,
.ghost-button {
  border: 1px solid var(--border);
  color: var(--text);
  background: rgba(255, 255, 255, 0.075);
  backdrop-filter: blur(20px);
}

.icon-button {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  font-size: 22px;
}

.icon-button span {
  display: inline-block;
}

.icon-button.loading span {
  animation: rotate 0.8s linear infinite;
}

.primary-button,
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 124px;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 14px;
  font-weight: 820;
}

.primary-button {
  color: #03120c;
  border-color: transparent;
  background: linear-gradient(135deg, var(--green), var(--cyan));
  box-shadow: 0 14px 36px rgba(53, 229, 143, 0.22);
}

.primary-button.disabled {
  opacity: 0.55;
  pointer-events: none;
}

.hero {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 54px 4px 22px;
}

.eyebrow,
.muted,
small {
  color: var(--muted);
}

.eyebrow {
  margin-bottom: 10px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1 {
  max-width: 820px;
  font-size: clamp(38px, 6vw, 78px);
  line-height: 0.98;
  letter-spacing: 0;
}

.hero-subtitle {
  max-width: 620px;
  margin-top: 18px;
  color: #a5bbb3;
  font-size: 16px;
  line-height: 1.6;
}

h2 {
  font-size: 24px;
  letter-spacing: 0;
}

h3 {
  font-size: 18px;
}

.status-card,
.panel,
.recovery-card,
.metric-card,
.coach-card {
  border: 1px solid var(--border);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.035)),
    rgba(7, 18, 16, 0.56);
  box-shadow: var(--shadow);
  backdrop-filter: blur(28px);
}

.status-card {
  justify-content: space-between;
  gap: 18px;
  padding: 18px;
  border-radius: 18px;
  margin: 0 0 16px;
}

.status-card p {
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.55;
}

.status-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.status-pills span {
  gap: 7px;
  padding: 0 11px;
}

.status-pills i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--amber);
}

.status-pills .ok i {
  background: var(--green);
}

.today-board {
  display: grid;
  grid-template-columns: 1.12fr 1fr 1fr;
  gap: 14px;
}

.recovery-card {
  grid-row: span 2;
  min-height: 390px;
  padding: 24px;
  border-radius: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.ring-wrap {
  position: relative;
  width: 208px;
  height: 208px;
}

.ring {
  width: 208px;
  height: 208px;
  transform: rotate(-90deg);
}

.ring-track,
.ring-value,
.orbit-ring-value {
  fill: none;
  stroke-width: 13;
}

.ring-track {
  stroke: rgba(255, 255, 255, 0.1);
}

.ring-value,
.orbit-ring-value {
  stroke: var(--green);
  stroke-linecap: round;
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  filter: drop-shadow(0 0 18px rgba(53, 229, 143, 0.52));
  transition: stroke-dashoffset 1.1s cubic-bezier(0.16, 1, 0.3, 1), stroke 0.3s ease;
}

.ring-center {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
}

.ring-center span {
  font-size: 46px;
  font-weight: 900;
}

.readiness p {
  margin-top: 10px;
  color: #b8cbc3;
  line-height: 1.7;
}

.coach-card {
  grid-column: span 2;
  padding: 22px;
  border-radius: 24px;
}

.section-title {
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.section-title.compact {
  margin-bottom: 14px;
}

.section-title > span {
  color: var(--muted);
  font-size: 14px;
  text-align: right;
}

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

.action-list div,
.body-metrics div,
.stats-list div,
.issue-list div,
.mini-grid > div {
  border: 1px solid rgba(216, 255, 236, 0.1);
  background: rgba(255, 255, 255, 0.055);
}

.action-list div {
  min-height: 92px;
  padding: 14px;
  border-radius: 16px;
}

.action-list b,
.action-list span,
.stats-list span,
.stats-list strong,
.stats-list small,
.issue-list span,
.issue-list p,
.body-metrics span,
.body-metrics strong {
  display: block;
}

.action-list span {
  margin-top: 10px;
  color: #bad0c7;
  line-height: 1.45;
}

.metric-card {
  min-height: 152px;
  padding: 18px;
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  animation: floatIn 0.7s both;
}

.metric-card span {
  color: var(--muted);
  font-size: 14px;
}

.metric-card strong {
  font-size: clamp(28px, 4vw, 42px);
  letter-spacing: 0;
}

.accent-green {
  border-color: rgba(53, 229, 143, 0.24);
}

.accent-cyan {
  border-color: rgba(32, 212, 240, 0.24);
}

.accent-amber {
  border-color: rgba(255, 184, 77, 0.26);
}

.accent-coral {
  border-color: rgba(255, 107, 107, 0.26);
}

.pipe-section {
  scroll-margin-top: 96px;
  margin-top: 28px;
}

.panel {
  padding: 22px;
  border-radius: 22px;
  animation: panelIn 0.42s both;
}

.pipe-grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr 1fr;
  gap: 14px;
}

.sleep-timeline {
  display: flex;
  height: 52px;
  margin-top: 18px;
  border-radius: 14px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.075);
}

.sleep-timeline span {
  display: block;
  min-width: 5px;
  animation: grow 0.9s both;
}

.awake {
  background: #d7e0de;
}

.light {
  background: var(--cyan);
}

.deep {
  background: var(--purple);
}

.rem {
  background: var(--green);
}

.legend,
.chart-legend {
  flex-wrap: wrap;
  gap: 13px;
  margin-top: 16px;
  color: var(--muted);
  font-size: 13px;
}

.legend i,
.chart-legend i {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-right: 7px;
}

.chart-legend .green {
  background: var(--green);
}

.chart-legend .purple {
  background: var(--purple);
}

.chart-legend .amber {
  background: var(--amber);
}

.mini-grid {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.mini-grid.two {
  grid-template-columns: repeat(2, 1fr);
}

.mini-grid > div {
  min-height: 78px;
  padding: 14px;
  border-radius: 16px;
}

.mini-grid strong {
  display: block;
  margin-top: 8px;
  font-size: 20px;
}

.strain-meter {
  position: relative;
  height: 20px;
  margin: 22px 0;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.strain-fill {
  width: 20%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--amber), var(--coral));
  transition: width 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.panel p {
  color: #b8cbc3;
  line-height: 1.65;
}



.training-story {
  overflow: hidden;
}

.training-story-head,
.trend-card-head,
.heart-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.training-story-head p,
.heart-card-head span {
  color: var(--muted);
}

.training-story-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.95fr);
  gap: 16px;
  margin-top: 20px;
}

.route-card,
.heart-card,
.whoop-link {
  border: 1px solid rgba(216, 255, 236, 0.1);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.052);
}

.route-card {
  min-height: 390px;
  padding: 16px;
}

.route-viz {
  width: 100%;
  min-height: 310px;
  border-radius: 16px;
  background:
    radial-gradient(circle at 24% 20%, rgba(53, 229, 143, 0.16), transparent 28%),
    radial-gradient(circle at 80% 64%, rgba(32, 212, 240, 0.1), transparent 30%),
    rgba(4, 12, 11, 0.6);
}

.route-grid {
  stroke: rgba(216, 255, 236, 0.08);
  stroke-width: 1;
}

.route-line-glow,
.route-line {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.route-line-glow {
  stroke: rgba(32, 212, 240, 0.25);
  stroke-width: 14;
  filter: blur(8px);
}

.route-line {
  stroke: url(#routeGradient);
  stroke-width: 5;
  stroke-dasharray: 1200;
  stroke-dashoffset: 1200;
  animation: dashRoute 2.2s ease forwards;
}

.route-viz .route-line {
  stroke: var(--cyan);
}

.route-dot {
  fill: var(--green);
  filter: drop-shadow(0 0 12px rgba(53, 229, 143, 0.9));
}

.route-caption,
.route-empty-text,
.hr-empty-text,
.chart-note {
  color: var(--muted);
  fill: var(--muted);
  font-size: 13px;
}

.route-caption {
  margin-top: 12px;
}

.training-side {
  display: grid;
  gap: 12px;
}

.training-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.training-metrics > div,
.training-empty {
  min-height: 104px;
  padding: 14px;
  border: 1px solid rgba(216, 255, 236, 0.1);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.055);
}

.training-metrics span,
.training-metrics small {
  display: block;
  color: var(--muted);
}

.training-metrics strong {
  display: block;
  margin: 10px 0 6px;
  font-size: clamp(24px, 3vw, 34px);
}

.heart-card {
  padding: 14px;
}

.hr-viz {
  width: 100%;
  height: 128px;
  margin-top: 8px;
  overflow: visible;
}

.hr-line {
  fill: none;
  stroke: var(--coral);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 14px rgba(255, 107, 107, 0.35));
}

.muted-line {
  stroke: rgba(255, 107, 107, 0.45);
  stroke-dasharray: 8 8;
}

.whoop-link {
  padding: 14px;
  color: #d7e6df;
  line-height: 1.6;
}

.zone-bars {
  display: flex;
  min-height: 34px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.075);
}

.zone-segment {
  display: grid;
  place-items: center;
  min-width: 0;
  color: #05110f;
  font-size: 11px;
  font-weight: 900;
}

.zone-segment.z0 { background: #b7c2bd; }
.zone-segment.z1 { background: #35e58f; }
.zone-segment.z2 { background: #20d4f0; }
.zone-segment.z3 { background: #ffcc66; }
.zone-segment.z4 { background: #ff8a4d; }
.zone-segment.z5 { background: #ff5f6d; }

.zone-empty {
  padding: 8px 12px;
  color: var(--muted);
}

.training-trends {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 14px;
}

.trend-card-head span {
  color: var(--muted);
  text-align: right;
  font-size: 13px;
  line-height: 1.5;
}

.training-chart {
  width: 100%;
  min-height: 250px;
  margin-top: 14px;
}

.load-bar {
  fill: rgba(255, 255, 255, 0.08);
}

.load-bar.active {
  fill: rgba(32, 212, 240, 0.65);
  filter: drop-shadow(0 0 12px rgba(32, 212, 240, 0.3));
}

.trend-recovery {
  stroke-width: 4;
  filter: drop-shadow(0 0 10px rgba(53, 229, 143, 0.28));
}

@keyframes dashRoute {
  to { stroke-dashoffset: 0; }
}

.strava-panel {
  display: grid;
  gap: 18px;
}

.strava-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.strava-head p {
  margin-top: 8px;
}

.strava-list {
  display: grid;
  gap: 10px;
}

.strava-item,
.strava-empty {
  border: 1px solid rgba(216, 255, 236, 0.1);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.055);
}

.strava-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px;
}

.strava-item small,
.strava-item strong,
.strava-metrics span {
  display: block;
}

.strava-item small {
  color: var(--muted);
  font-size: 13px;
}

.strava-item strong {
  margin-top: 6px;
  font-size: 18px;
}

.strava-metrics {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.strava-metrics span {
  min-height: 30px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.075);
  color: #d7e6df;
  font-size: 13px;
  font-weight: 760;
}

.strava-empty {
  padding: 18px;
  color: var(--muted);
}

.workout-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid rgba(216, 255, 236, 0.12);
}

.workout-row span {
  color: var(--muted);
}

.body-metrics,
.stats-list,
.issue-list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.body-metrics div,
.stats-list div,
.issue-list div {
  padding: 14px;
  border-radius: 16px;
}

.body-metrics span,
.stats-list span,
.issue-list span {
  color: var(--muted);
  font-size: 13px;
}

.body-metrics strong,
.stats-list strong {
  margin-top: 6px;
  font-size: 22px;
}

.stats-list small,
.issue-list p {
  margin-top: 7px;
  color: #b8cbc3;
  line-height: 1.5;
}

.trend-layout,
.month-grid {
  display: grid;
  grid-template-columns: 1.6fr 0.9fr;
  gap: 14px;
}

.chart-panel {
  overflow: hidden;
}

.chart,
.scatter {
  width: 100%;
  height: auto;
  min-height: 300px;
}

.grid-line {
  stroke: rgba(216, 255, 236, 0.09);
  stroke-width: 1;
}

.axis-text,
.axis-label {
  fill: #82958e;
  font-size: 13px;
}

.axis-label {
  font-size: 15px;
}

.axis-label.vertical {
  transform: rotate(-90deg);
  transform-origin: 14px 84px;
}

.line {
  fill: none;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 900;
  stroke-dashoffset: 900;
  animation: drawLine 1.35s 0.12s forwards cubic-bezier(0.16, 1, 0.3, 1);
}

.line.green {
  stroke: var(--green);
  filter: drop-shadow(0 0 10px rgba(53, 229, 143, 0.35));
}

.line.purple {
  stroke: var(--purple);
}

.line.amber {
  stroke: var(--amber);
}

.green-area {
  fill: rgba(53, 229, 143, 0.12);
}

.dot {
  fill: var(--green);
  stroke: rgba(255, 255, 255, 0.7);
  stroke-width: 1.5;
}

.trend-line {
  stroke: rgba(216, 255, 236, 0.34);
  stroke-width: 3;
  stroke-dasharray: 8 8;
}

.scatter-dot {
  fill: var(--dot);
  stroke: rgba(255, 255, 255, 0.72);
  stroke-width: 1.4;
  filter: drop-shadow(0 0 8px color-mix(in srgb, var(--dot), transparent 55%));
}

.ai-report {
  min-height: 300px;
}

.ai-report-head {
  gap: 13px;
  margin-bottom: 18px;
}

.ai-report-head p {
  margin-top: 6px;
  color: var(--muted);
}

.pulse {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(53, 229, 143, 0.44);
  animation: pulse 2.2s infinite;
}

.ai-report-body,
.coach-answer {
  white-space: pre-wrap;
  line-height: 1.75;
  color: #dff8ea;
}

.ai-report-body {
  padding: 18px;
  border: 1px solid rgba(53, 229, 143, 0.18);
  border-radius: 18px;
  background: rgba(53, 229, 143, 0.07);
}

.coach-tools {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 14px;
}

.note-box,
.chat-box {
  display: grid;
  gap: 12px;
}

.tag-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-grid button {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.055);
  color: var(--text);
  font-weight: 760;
}

.tag-grid button.selected {
  color: #06100b;
  background: var(--green);
  border-color: transparent;
}

textarea {
  width: 100%;
  min-height: 92px;
  resize: vertical;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px;
  color: var(--text);
  background: rgba(0, 0, 0, 0.24);
  outline: none;
  line-height: 1.55;
}

.form-button {
  width: fit-content;
}

.coach-answer {
  grid-column: 1 / -1;
  padding: 16px;
  border-radius: 16px;
  background: rgba(32, 212, 240, 0.07);
  border: 1px solid rgba(32, 212, 240, 0.16);
}

.wide-button {
  grid-column: 1 / -1;
  width: 100%;
}

.menu-button {
  display: none;
}

.core-screen {
  display: grid;
  gap: 14px;
}

.core-headline {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.core-headline .eyebrow {
  margin-bottom: 6px;
}

.core-headline > span {
  color: var(--muted);
  font-size: 14px;
  white-space: nowrap;
}

.core-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.core-card,
.today-command,
.settings-drawer {
  border: 1px solid var(--border);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.035)),
    rgba(7, 18, 16, 0.58);
  box-shadow: var(--shadow);
  backdrop-filter: blur(28px);
}

.core-card {
  position: relative;
  min-height: 250px;
  padding: 22px;
  border-radius: 24px;
  overflow: hidden;
  animation: panelIn 0.42s both;
}

.core-card::after {
  content: "";
  position: absolute;
  inset: auto -18% -36% 18%;
  height: 120px;
  opacity: 0.34;
  filter: blur(24px);
  pointer-events: none;
}

.core-sleep::after {
  background: var(--cyan);
}

.core-recovery::after {
  background: var(--green);
}

.core-strain::after {
  background: var(--amber);
}

.metric-label {
  display: block;
  color: var(--muted);
  font-size: 14px;
  font-weight: 760;
}

.core-card strong {
  display: block;
  margin-top: 18px;
  font-size: clamp(42px, 6vw, 68px);
  line-height: 0.95;
  letter-spacing: 0;
}

.core-card p {
  position: relative;
  z-index: 1;
  margin-top: 14px;
  color: #b8cbc3;
  line-height: 1.5;
}

.core-recovery {
  display: grid;
  place-items: center;
  text-align: center;
}

.core-recovery .metric-label {
  justify-self: start;
  align-self: start;
}

.core-recovery .ring-wrap,
.core-recovery .ring {
  width: 164px;
  height: 164px;
}

.core-recovery .ring-center span {
  font-size: 38px;
}

.mini-bar {
  position: relative;
  z-index: 1;
  height: 11px;
  margin-top: 22px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.09);
}

.mini-bar span {
  display: block;
  width: 20%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--cyan), var(--green));
  transition: width 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.compact-meter {
  margin: 28px 0 0;
}

.today-command {
  display: grid;
  grid-template-columns: 0.95fr 1.35fr;
  gap: 18px;
  padding: 22px;
  border-radius: 24px;
}

.support-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.settings-drawer {
  margin-top: 16px;
  border-radius: 22px;
  overflow: hidden;
}

.settings-drawer summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 64px;
  padding: 0 20px;
  cursor: pointer;
  list-style: none;
}

.settings-drawer summary::-webkit-details-marker {
  display: none;
}

.settings-drawer summary span {
  font-weight: 860;
}

.settings-drawer summary small {
  text-align: right;
}

.settings-drawer .status-card {
  margin: 0;
  border-width: 1px 0 0;
  border-radius: 0;
  box-shadow: none;
  background: rgba(255, 255, 255, 0.035);
}

.settings-actions {
  display: grid;
  gap: 10px;
  min-width: 150px;
}


.lifestyle-section {
  position: relative;
}

.lifestyle-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.9fr 0.95fr;
  gap: 14px;
}

.lifestyle-command-card,
.food-camera-card,
.takeout-helper-card,
.lifestyle-tile {
  position: relative;
  overflow: hidden;
}

.lifestyle-command-card {
  min-height: 300px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: start;
}

.lifestyle-score {
  display: grid;
  place-items: center;
  width: 132px;
  height: 132px;
  border: 1px solid rgba(53, 229, 143, 0.24);
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(53, 229, 143, 0.18), rgba(32, 212, 240, 0.05) 58%, transparent 60%),
    rgba(255, 255, 255, 0.045);
  box-shadow: inset 0 0 0 12px rgba(255, 255, 255, 0.035);
  text-align: center;
}

.lifestyle-score strong {
  display: block;
  font-size: 44px;
  line-height: 1;
}

.lifestyle-score span,
.lifestyle-tile span,
.takeout-rule-list span,
.lifestyle-signal-list span {
  color: var(--muted);
}

.lifestyle-signal-list {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 6px;
}

.lifestyle-signal-list div,
.takeout-rule-list div {
  min-height: 82px;
  padding: 13px;
  border: 1px solid rgba(216, 255, 236, 0.1);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.052);
}

.lifestyle-signal-list strong,
.lifestyle-signal-list small,
.lifestyle-tile strong,
.lifestyle-tile span {
  display: block;
}

.lifestyle-signal-list strong {
  margin-top: 8px;
  font-size: 18px;
}

.lifestyle-signal-list small {
  margin-top: 5px;
  line-height: 1.4;
}

.food-rule-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0 14px;
}

.food-rule-strip span {
  min-height: 32px;
  padding: 7px 11px;
  border-radius: 999px;
  color: #05110f;
  background: linear-gradient(135deg, var(--green), var(--cyan));
  font-size: 13px;
  font-weight: 850;
}

.food-camera-card small {
  display: block;
  color: var(--muted);
  line-height: 1.5;
}

.takeout-rule-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.takeout-rule-list b {
  display: block;
  margin-bottom: 6px;
}

.lifestyle-tiles {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.lifestyle-tile {
  min-height: 168px;
}

.lifestyle-tile strong {
  margin: 12px 0 10px;
  font-size: clamp(20px, 2.2vw, 28px);
  line-height: 1.16;
}

html[data-life-level="good"] .lifestyle-score {
  border-color: rgba(53, 229, 143, 0.34);
}

html[data-life-level="steady"] .lifestyle-score {
  border-color: rgba(255, 184, 77, 0.36);
}

html[data-life-level="recover"] .lifestyle-score {
  border-color: rgba(255, 107, 107, 0.38);
}

@keyframes rotate {
  to {
    transform: rotate(360deg);
  }
}

@keyframes pulse {
  70% {
    box-shadow: 0 0 0 14px rgba(53, 229, 143, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(53, 229, 143, 0);
  }
}

@keyframes floatIn {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
}

@keyframes panelIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}

@keyframes grow {
  from {
    transform: scaleX(0.2);
    transform-origin: left;
  }
}

@keyframes drawLine {
  to {
    stroke-dashoffset: 0;
  }
}

@media (max-width: 920px) {
  .topbar {
    grid-template-columns: 1fr auto;
  }

  .nav {
    order: 3;
    grid-column: 1 / -1;
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .today-board,
  .pipe-grid,
  .trend-layout,
  .month-grid,
  .lifestyle-grid,
  .lifestyle-tiles {
    grid-template-columns: 1fr 1fr;
  }

  .recovery-card,
  .coach-card,
  .sleep-panel,
  .chart-panel {
    grid-column: 1 / -1;
  }

  .coach-tools {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .shell {
    padding: max(12px, env(safe-area-inset-top)) 12px 34px;
  }

  .topbar {
    top: 6px;
    gap: 10px;
    grid-template-columns: auto 1fr auto;
    min-height: 54px;
    padding: 8px;
    border-radius: 18px;
  }

  .brand span:last-child {
    display: none;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 13px;
  }

  .top-actions {
    grid-column: 3;
    gap: 8px;
  }

  .sync-pill {
    display: none;
  }

  .menu-button {
    display: inline-grid;
    place-items: center;
  }

  .nav {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    grid-column: auto;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 4px;
    padding: 8px;
    overflow: visible;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: rgba(5, 13, 12, 0.94);
    box-shadow: 0 16px 44px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(24px);
  }

  body.nav-open .nav {
    display: grid;
  }

  .nav a {
    display: grid;
    place-items: center;
    min-width: 0;
    min-height: 38px;
    padding: 0 4px;
    font-size: 13px;
  }

  .lifestyle-score {
    width: 112px;
    height: 112px;
  }

  .hero {
    padding: 24px 2px 10px;
  }

  .hero-subtitle {
    margin-top: 12px;
    font-size: 15px;
    line-height: 1.55;
  }

  h1 {
    font-size: 40px;
  }

  h2 {
    font-size: 21px;
  }

  .status-card,
  .hero,
  .section-title,
  .lifestyle-command-card,
  .lifestyle-signal-list,
  .lifestyle-grid,
  .lifestyle-tiles,
  

.training-story {
  overflow: hidden;
}

.training-story-head,
.trend-card-head,
.heart-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.training-story-head p,
.heart-card-head span {
  color: var(--muted);
}

.training-story-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.95fr);
  gap: 16px;
  margin-top: 20px;
}

.route-card,
.heart-card,
.whoop-link {
  border: 1px solid rgba(216, 255, 236, 0.1);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.052);
}

.route-card {
  min-height: 390px;
  padding: 16px;
}

.route-viz {
  width: 100%;
  min-height: 310px;
  border-radius: 16px;
  background:
    radial-gradient(circle at 24% 20%, rgba(53, 229, 143, 0.16), transparent 28%),
    radial-gradient(circle at 80% 64%, rgba(32, 212, 240, 0.1), transparent 30%),
    rgba(4, 12, 11, 0.6);
}

.route-grid {
  stroke: rgba(216, 255, 236, 0.08);
  stroke-width: 1;
}

.route-line-glow,
.route-line {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.route-line-glow {
  stroke: rgba(32, 212, 240, 0.25);
  stroke-width: 14;
  filter: blur(8px);
}

.route-line {
  stroke: url(#routeGradient);
  stroke-width: 5;
  stroke-dasharray: 1200;
  stroke-dashoffset: 1200;
  animation: dashRoute 2.2s ease forwards;
}

.route-viz .route-line {
  stroke: var(--cyan);
}

.route-dot {
  fill: var(--green);
  filter: drop-shadow(0 0 12px rgba(53, 229, 143, 0.9));
}

.route-caption,
.route-empty-text,
.hr-empty-text,
.chart-note {
  color: var(--muted);
  fill: var(--muted);
  font-size: 13px;
}

.route-caption {
  margin-top: 12px;
}

.training-side {
  display: grid;
  gap: 12px;
}

.training-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.training-metrics > div,
.training-empty {
  min-height: 104px;
  padding: 14px;
  border: 1px solid rgba(216, 255, 236, 0.1);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.055);
}

.training-metrics span,
.training-metrics small {
  display: block;
  color: var(--muted);
}

.training-metrics strong {
  display: block;
  margin: 10px 0 6px;
  font-size: clamp(24px, 3vw, 34px);
}

.heart-card {
  padding: 14px;
}

.hr-viz {
  width: 100%;
  height: 128px;
  margin-top: 8px;
  overflow: visible;
}

.hr-line {
  fill: none;
  stroke: var(--coral);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 14px rgba(255, 107, 107, 0.35));
}

.muted-line {
  stroke: rgba(255, 107, 107, 0.45);
  stroke-dasharray: 8 8;
}

.whoop-link {
  padding: 14px;
  color: #d7e6df;
  line-height: 1.6;
}

.zone-bars {
  display: flex;
  min-height: 34px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.075);
}

.zone-segment {
  display: grid;
  place-items: center;
  min-width: 0;
  color: #05110f;
  font-size: 11px;
  font-weight: 900;
}

.zone-segment.z0 { background: #b7c2bd; }
.zone-segment.z1 { background: #35e58f; }
.zone-segment.z2 { background: #20d4f0; }
.zone-segment.z3 { background: #ffcc66; }
.zone-segment.z4 { background: #ff8a4d; }
.zone-segment.z5 { background: #ff5f6d; }

.zone-empty {
  padding: 8px 12px;
  color: var(--muted);
}

.training-trends {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 14px;
}

.trend-card-head span {
  color: var(--muted);
  text-align: right;
  font-size: 13px;
  line-height: 1.5;
}

.training-chart {
  width: 100%;
  min-height: 250px;
  margin-top: 14px;
}

.load-bar {
  fill: rgba(255, 255, 255, 0.08);
}

.load-bar.active {
  fill: rgba(32, 212, 240, 0.65);
  filter: drop-shadow(0 0 12px rgba(32, 212, 240, 0.3));
}

.trend-recovery {
  stroke-width: 4;
  filter: drop-shadow(0 0 10px rgba(53, 229, 143, 0.28));
}

@keyframes dashRoute {
  to { stroke-dashoffset: 0; }
}

.strava-panel {
  display: grid;
  gap: 18px;
}

.strava-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.strava-head p {
  margin-top: 8px;
}

.strava-list {
  display: grid;
  gap: 10px;
}

.strava-item,
.strava-empty {
  border: 1px solid rgba(216, 255, 236, 0.1);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.055);
}

.strava-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px;
}

.strava-item small,
.strava-item strong,
.strava-metrics span {
  display: block;
}

.strava-item small {
  color: var(--muted);
  font-size: 13px;
}

.strava-item strong {
  margin-top: 6px;
  font-size: 18px;
}

.strava-metrics {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.strava-metrics span {
  min-height: 30px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.075);
  color: #d7e6df;
  font-size: 13px;
  font-weight: 760;
}

.strava-empty {
  padding: 18px;
  color: var(--muted);
}

.workout-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .today-board,
  .pipe-grid,
  .trend-layout,
  .month-grid,
  .mini-grid.two {
    grid-template-columns: 1fr;
  }

  .core-headline {
    align-items: flex-start;
  }

  .core-headline > span {
    font-size: 12px;
    white-space: normal;
    text-align: right;
  }

  .core-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .core-card {
    min-height: 148px;
    padding: 12px;
    border-radius: 18px;
  }

  .metric-label {
    font-size: 12px;
  }

  .core-card strong {
    margin-top: 16px;
    font-size: 34px;
  }

  .core-card p {
    margin-top: 8px;
    font-size: 12px;
    line-height: 1.35;
  }

  .core-recovery .ring-wrap,
  .core-recovery .ring {
    width: 92px;
    height: 92px;
  }

  .core-recovery .ring-track,
  .core-recovery .ring-value {
    stroke-width: 16;
  }

  .core-recovery .ring-center span {
    font-size: 24px;
  }

  .core-recovery .ring-center small {
    font-size: 11px;
  }

  .mini-bar {
    height: 8px;
    margin-top: 14px;
  }

  .compact-meter {
    height: 10px;
    margin-top: 16px;
  }

  .today-command,
  .support-metrics {
    grid-template-columns: 1fr;
  }

  .today-command {
    gap: 16px;
    padding: 16px;
    border-radius: 18px;
  }

  .action-list {
    grid-template-columns: 1fr;
  }

  .action-list div {
    min-height: 72px;
  }

  .recovery-card,
  .metric-card,
  .panel,
  .coach-card {
    border-radius: 18px;
  }

  .recovery-card {
    min-height: 0;
    gap: 24px;
  }

  .ring-wrap,
  .ring {
    width: 178px;
    height: 178px;
  }

  .ring-center span {
    font-size: 40px;
  }

  .metric-card {
    min-height: 126px;
  }

  .settings-drawer {
    border-radius: 18px;
  }

  .settings-drawer summary {
    min-height: 58px;
    padding: 0 14px;
  }

  .settings-drawer .status-card {
    gap: 16px;
  }

  .settings-actions,
  .settings-actions .primary-button,
  .settings-actions .ghost-button {
    width: 100%;
  }

  .chart,
  .scatter {
    min-height: 250px;
  }
}


/* Mobile training layout hardening: keep COROS x WHOOP readable on iPhone/WeChat. */
@media (max-width: 760px) {
  .training-section,
  .training-story,
  .training-story-grid,
  .training-side,
  .training-trends,
  .trend-card,
  .route-card,
  .heart-card,
  .whoop-link {
    min-width: 0 !important;
    max-width: 100% !important;
  }

  .training-story-grid,
  .training-trends {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .training-story-head,
  .trend-card-head,
  .heart-card-head {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 10px !important;
  }

  .training-story-head .ghost-button {
    width: 100%;
  }

  .route-card {
    min-height: 0 !important;
    padding: 12px !important;
  }

  .route-viz {
    height: 238px !important;
    min-height: 238px !important;
  }

  .training-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .training-metrics > div {
    min-height: 92px !important;
    padding: 12px !important;
  }

  .training-metrics strong {
    font-size: 26px !important;
  }

  .hr-viz,
  .training-chart {
    width: 100% !important;
    min-width: 0 !important;
  }

  .training-chart {
    min-height: 210px !important;
  }
}

@media (max-width: 420px) {
  .training-metrics {
    grid-template-columns: minmax(0, 1fr) !important;
  }
}


/* Mobile polish: keep the original dark theme, but make the header compact and core metrics readable. */
@media (max-width: 760px) {
  .shell {
    padding-top: max(18px, env(safe-area-inset-top)) !important;
  }

  .topbar {
    position: fixed !important;
    top: max(10px, env(safe-area-inset-top)) !important;
    right: 12px !important;
    left: auto !important;
    width: auto !important;
    min-height: 0 !important;
    padding: 6px !important;
    display: flex !important;
    grid-template-columns: none !important;
    border-radius: 18px !important;
    background: rgba(5, 13, 12, 0.78) !important;
    box-shadow: 0 14px 42px rgba(0, 0, 0, 0.28) !important;
    z-index: 80 !important;
  }

  .topbar .brand,
  .topbar .sync-pill {
    display: none !important;
  }

  .topbar .top-actions {
    display: flex !important;
    grid-column: auto !important;
    gap: 8px !important;
  }

  .topbar .icon-button {
    width: 44px !important;
    height: 44px !important;
    border-radius: 14px !important;
  }

  .topbar .nav {
    position: fixed !important;
    top: calc(max(10px, env(safe-area-inset-top)) + 62px) !important;
    left: 12px !important;
    right: 12px !important;
    display: none !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 6px !important;
    width: auto !important;
    padding: 8px !important;
    border: 1px solid var(--border) !important;
    border-radius: 18px !important;
    background: rgba(5, 13, 12, 0.94) !important;
    box-shadow: 0 18px 52px rgba(0, 0, 0, 0.32) !important;
    z-index: 79 !important;
  }

  body.nav-open .topbar .nav {
    display: grid !important;
  }

  .topbar .nav a {
    min-height: 38px !important;
    padding: 0 6px !important;
    display: grid !important;
    place-items: center !important;
    font-size: 13px !important;
  }

  .hero {
    padding-top: 38px !important;
  }

  .core-headline {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    align-items: end !important;
    gap: 12px !important;
  }

  .core-metrics {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 12px !important;
  }

  .core-card {
    min-height: 138px !important;
    padding: 16px !important;
    border-radius: 20px !important;
  }

  .core-card strong {
    margin-top: 12px !important;
    font-size: 44px !important;
  }

  .core-card p {
    font-size: 14px !important;
    line-height: 1.45 !important;
  }

  .core-recovery {
    grid-template-columns: minmax(0, 1fr) auto !important;
    text-align: left !important;
    place-items: center stretch !important;
  }

  .core-recovery .metric-label {
    align-self: start !important;
  }

  .core-recovery .ring-wrap,
  .core-recovery .ring {
    width: 116px !important;
    height: 116px !important;
  }

  .core-recovery .ring-center span {
    font-size: 30px !important;
  }

  .core-strain .compact-meter,
  .core-sleep .mini-bar {
    max-width: 220px !important;
  }
}


/* Visual dashboard upgrade: graph-first cards for WHOOP, body metrics and COROS training. */
.visual-vital-card,
.body-visual,
.week-visual-card,
.training-stat {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.visual-vital-card::before,
.body-visual::before,
.week-visual-card::before,
.training-stat::before {
  content: "";
  position: absolute;
  inset: auto -20% -42% 18%;
  height: 120px;
  background: color-mix(in srgb, var(--accent, var(--green)), transparent 40%);
  opacity: 0.22;
  filter: blur(26px);
  pointer-events: none;
}

.visual-vital-card {
  --accent: var(--cyan);
  min-height: 208px;
  gap: 12px;
  justify-content: start;
}

.visual-vital-card.accent-amber {
  --accent: var(--amber);
}

.vital-copy,
.body-copy,
.stat-copy {
  position: relative;
  z-index: 1;
}

.vital-copy span,
.body-copy span,
.stat-copy span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 760;
}

.visual-vital-card strong,
.body-visual strong,
.training-stat strong,
.week-visual-card strong {
  display: block;
  margin-top: 8px;
  color: var(--text);
  line-height: 0.98;
}

.visual-vital-card small,
.body-visual small,
.training-stat small,
.week-visual-card small {
  display: block;
  margin-top: 8px;
  color: #b8cbc3;
  line-height: 1.45;
}

#bodyValue {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-size: clamp(44px, 5.4vw, 68px);
  line-height: 0.92;
  white-space: nowrap;
}

#bodyValue .body-separator {
  color: inherit;
  display: inline-block;
  font-size: 0.48em;
  font-weight: inherit;
  line-height: 1;
  opacity: 0.42;
  transform: translateY(-0.08em);
}

.mini-spark {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 92px;
  margin-top: 4px;
}

.spark-area {
  fill: color-mix(in srgb, var(--accent, var(--cyan)), transparent 82%);
}

.spark-line {
  fill: none;
  stroke: var(--accent, var(--cyan));
  stroke-width: 5;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 520;
  stroke-dashoffset: 520;
  animation: drawLine 1.35s 0.1s forwards cubic-bezier(0.16, 1, 0.3, 1);
  filter: drop-shadow(0 0 11px color-mix(in srgb, var(--accent, var(--cyan)), transparent 46%));
}

.mini-spark.cyan { --accent: var(--cyan); }
.mini-spark.amber { --accent: var(--amber); }

.vital-scale,
.wide-progress {
  position: relative;
  z-index: 1;
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.vital-scale i,
.wide-progress i {
  display: block;
  width: var(--pct, 50%);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent, var(--green)), color-mix(in srgb, var(--accent, var(--green)), white 18%));
  animation: grow 0.9s both;
}

.vital-scale.reverse i {
  background: linear-gradient(90deg, var(--green), var(--amber));
}

.body-metrics.visual-body {
  gap: 12px;
}

.body-visual {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 116px;
  align-items: center;
  column-gap: 18px;
  min-height: 126px;
  padding: 16px;
  border: 1px solid rgba(216, 255, 236, 0.1);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.055);
}

.oxygen-ring,
.training-gauge,
.mini-ring {
  position: relative;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: conic-gradient(var(--accent, var(--cyan)) var(--pct, 50%), rgba(255,255,255,0.09) 0);
  box-shadow: inset 0 0 0 10px rgba(5, 13, 12, 0.58), 0 0 24px color-mix(in srgb, var(--accent, var(--cyan)), transparent 70%);
}

.body-visual .oxygen-ring,
.body-visual .thermo,
.body-visual .body-silhouette {
  justify-self: center;
  align-self: center;
}

.oxygen-ring b,
.training-gauge span,
.mini-ring b {
  position: absolute;
  inset: 13px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(5, 13, 12, 0.68);
  color: var(--text);
  font-size: 14px;
  font-weight: 900;
}

.thermo {
  position: relative;
  width: 20px;
  height: 82px;
  margin-right: 26px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 0 0 1px rgba(216, 255, 236, 0.1);
}

.thermo::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -12px;
  width: 44px;
  height: 44px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff3c5, var(--amber) 42%, var(--coral));
  filter: drop-shadow(0 0 16px rgba(255, 184, 77, 0.38));
}

.thermo i {
  position: absolute;
  left: 4px;
  right: 4px;
  bottom: 0;
  height: var(--pct, 55%);
  border-radius: inherit;
  background: linear-gradient(180deg, var(--coral), var(--amber));
  animation: growThermo 1s both;
}

.body-silhouette {
  position: relative;
  width: 64px;
  height: 80px;
  border-radius: 28px 28px 22px 22px;
  background: linear-gradient(180deg, rgba(53, 229, 143, 0.18), rgba(32, 212, 240, 0.14));
  box-shadow: inset 0 0 0 1px rgba(216, 255, 236, 0.12);
}

.body-silhouette i {
  position: absolute;
  top: 9px;
  left: 50%;
  width: 22px;
  height: 22px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: var(--green);
}

.body-silhouette b {
  position: absolute;
  left: 50%;
  top: 36px;
  width: 34px;
  height: 30px;
  transform: translateX(-50%);
  border-radius: 18px 18px 8px 8px;
  background: rgba(255, 255, 255, 0.72);
}

.stats-list.visual-week {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.week-visual-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 142px;
}

.week-visual-card .mini-ring,
.week-visual-card .wide-progress,
.week-dot-row {
  position: relative;
  z-index: 1;
}

.week-dot-row {
  display: grid;
  grid-template-columns: repeat(7, 10px);
  gap: 6px;
  align-items: end;
  min-height: 74px;
}

.week-dot-row i {
  display: block;
  width: 10px;
  border-radius: 999px;
  background: var(--green);
  animation: floatIn 0.65s both;
}

.week-dot-row i.good { height: 52px; background: var(--green); }
.week-dot-row i.mid { height: 36px; background: var(--amber); }
.week-dot-row i.low { height: 22px; background: var(--coral); }

.week-visual-card .wide-progress {
  grid-column: 1 / -1;
  height: 12px;
  margin-top: 8px;
}

.strain-progress i {
  background: linear-gradient(90deg, var(--green), var(--amber), var(--coral));
}

.training-metrics.visual-training {
  gap: 12px;
}

.training-stat {
  --accent: var(--cyan);
  min-height: 136px !important;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border-color: color-mix(in srgb, var(--accent), transparent 76%) !important;
}

.training-stat strong {
  font-size: clamp(24px, 3vw, 36px) !important;
}

.stat-route {
  position: relative;
  z-index: 1;
  width: 112px;
  height: 74px;
  overflow: visible;
}

.stat-route-shadow,
.stat-route-line {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.stat-route-shadow {
  stroke: rgba(32, 212, 240, 0.18);
  stroke-width: 12;
  filter: blur(5px);
}

.stat-route-line {
  stroke: var(--cyan);
  stroke-width: 5;
  stroke-dasharray: 240;
  stroke-dashoffset: 240;
  animation: dashRoute 1.8s ease forwards;
}

.stat-route-dot {
  fill: var(--green);
  filter: drop-shadow(0 0 10px rgba(53, 229, 143, 0.86));
}

.clock-face {
  position: relative;
  z-index: 1;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: conic-gradient(var(--purple) var(--pct, 35%), rgba(255,255,255,0.09) 0);
  box-shadow: inset 0 0 0 10px rgba(5, 13, 12, 0.58), 0 0 20px rgba(157, 92, 255, 0.18);
}

.clock-face i,
.clock-face b {
  position: absolute;
  left: 50%;
  top: 50%;
  transform-origin: 50% 100%;
  border-radius: 999px;
  background: var(--text);
}

.clock-face i {
  width: 4px;
  height: 26px;
  transform: translate(-50%, -100%) rotate(135deg);
  animation: tickHand 4s linear infinite;
}

.clock-face b {
  width: 5px;
  height: 5px;
  transform: translate(-50%, -50%);
}

.energy-flame {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, 10px);
  align-items: end;
  gap: 6px;
  height: 76px;
  padding: 10px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
}

.energy-flame i {
  display: block;
  height: calc((var(--pct, 30%) / 100%) * 54px);
  min-height: 14px;
  border-radius: 999px;
  background: linear-gradient(180deg, #fff1a7, var(--amber), var(--coral));
  filter: drop-shadow(0 0 10px rgba(255, 184, 77, 0.34));
  animation: flameFloat 1.7s ease-in-out infinite alternate;
}

.energy-flame i:nth-child(2) { animation-delay: 0.14s; height: calc((var(--pct, 30%) / 100%) * 64px); }
.energy-flame i:nth-child(3) { animation-delay: 0.28s; height: calc((var(--pct, 30%) / 100%) * 48px); }
.energy-flame i:nth-child(4) { animation-delay: 0.42s; height: calc((var(--pct, 30%) / 100%) * 58px); }

.training-gauge {
  width: 76px;
  height: 76px;
}

.route-viz .route-line {
  stroke: url(#routeGradient) !important;
}

.route-line {
  animation: dashRoute 2.2s ease forwards, routeGlow 3.2s ease-in-out infinite alternate;
}

@keyframes growThermo {
  from { height: 8%; }
}

@keyframes tickHand {
  to { transform: translate(-50%, -100%) rotate(495deg); }
}

@keyframes flameFloat {
  from { transform: translateY(3px) scaleY(0.88); opacity: 0.74; }
  to { transform: translateY(-3px) scaleY(1); opacity: 1; }
}

@keyframes routeGlow {
  from { filter: drop-shadow(0 0 8px rgba(32, 212, 240, 0.22)); }
  to { filter: drop-shadow(0 0 18px rgba(53, 229, 143, 0.34)); }
}

@media (max-width: 760px) {
  .visual-vital-card {
    min-height: 178px;
  }

  .body-visual,
  .week-visual-card,
  .training-stat {
    min-height: 124px !important;
  }

  .stats-list.visual-week {
    grid-template-columns: minmax(0, 1fr);
  }

  .training-metrics.visual-training {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .training-stat strong {
    font-size: 30px !important;
  }

  .stat-route {
    width: 104px;
  }
}


/* Visual component reset: prevent old list-card rules from boxing inner graphics. */
.body-metrics.visual-body > .body-visual,
.stats-list.visual-week > .week-visual-card {
  border: 1px solid rgba(216, 255, 236, 0.1);
  background: rgba(255, 255, 255, 0.055);
}

.body-metrics.visual-body .body-visual > div,
.body-metrics.visual-body .body-visual .oxygen-ring,
.body-metrics.visual-body .body-visual .thermo,
.body-metrics.visual-body .body-visual .body-silhouette,
.stats-list.visual-week .week-visual-card > div,
.stats-list.visual-week .week-visual-card .mini-ring,
.stats-list.visual-week .week-visual-card .week-dot-row,
.stats-list.visual-week .week-visual-card .wide-progress {
  padding: 0;
  border: 0;
  background-color: transparent;
  box-shadow: none;
}

.body-metrics.visual-body .oxygen-ring,
.stats-list.visual-week .mini-ring {
  border-radius: 50%;
  background: conic-gradient(var(--accent, var(--cyan)) var(--pct, 50%), rgba(255,255,255,0.09) 0);
  box-shadow: inset 0 0 0 10px rgba(5, 13, 12, 0.58), 0 0 24px color-mix(in srgb, var(--accent, var(--cyan)), transparent 70%);
}

.body-metrics.visual-body .thermo {
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 0 0 1px rgba(216, 255, 236, 0.1);
}

.body-metrics.visual-body .body-silhouette {
  background: linear-gradient(180deg, rgba(53, 229, 143, 0.18), rgba(32, 212, 240, 0.14));
  box-shadow: inset 0 0 0 1px rgba(216, 255, 236, 0.12);
}

.stats-list.visual-week .wide-progress {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
}

.stats-list.visual-week .week-dot-row {
  background: transparent;
}


/* Mobile nav, flatter Apple-style visual cards, and richer motion pass. */
.nav a {
  min-width: 58px;
  text-align: center;
}

@media (max-width: 760px) {
  .topbar {
    right: 4px !important;
    top: max(8px, env(safe-area-inset-top)) !important;
    padding: 5px !important;
    border-radius: 18px !important;
    background: rgba(9, 28, 24, 0.94) !important;
    border-color: rgba(216, 255, 236, 0.18) !important;
    box-shadow: 0 16px 34px rgba(0, 0, 0, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
  }

  .topbar #refreshButton {
    display: none !important;
  }

  .topbar .top-actions {
    gap: 0 !important;
  }

  .topbar .menu-button {
    display: inline-grid !important;
    width: 50px !important;
    height: 50px !important;
    border-radius: 16px !important;
    color: #f5fbf8 !important;
    background: linear-gradient(145deg, rgba(29, 58, 51, 0.98), rgba(8, 18, 16, 0.98)) !important;
    border: 1px solid rgba(216, 255, 236, 0.22) !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.12), 0 0 0 1px rgba(53,229,143,0.08) !important;
  }

  .topbar .menu-button span {
    font-size: 24px !important;
    line-height: 1 !important;
  }

  .topbar .nav,
  body.nav-open .topbar .nav,
  body.nav-open .nav {
    position: fixed !important;
    top: calc(max(8px, env(safe-area-inset-top)) + 64px) !important;
    left: 10px !important;
    right: 10px !important;
    width: auto !important;
    max-width: none !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 8px !important;
    padding: 10px !important;
    border-radius: 22px !important;
    background: rgba(6, 18, 16, 0.96) !important;
    border: 1px solid rgba(216, 255, 236, 0.16) !important;
    box-shadow: 0 22px 56px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255,255,255,0.08) !important;
    backdrop-filter: blur(22px) !important;
    z-index: 79 !important;
  }

  .topbar .nav {
    display: none !important;
  }

  body.nav-open .topbar .nav,
  body.nav-open .nav {
    display: grid !important;
    animation: navSheetIn 0.26s cubic-bezier(0.16, 1, 0.3, 1) both;
  }

  .topbar .nav a,
  body.nav-open .nav a {
    min-height: 46px !important;
    min-width: 0 !important;
    padding: 0 8px !important;
    border-radius: 15px !important;
    background: rgba(255, 255, 255, 0.065) !important;
    color: #e9f7f1 !important;
    font-size: 14px !important;
    font-weight: 820 !important;
    letter-spacing: 0 !important;
    box-shadow: inset 0 0 0 1px rgba(216, 255, 236, 0.08) !important;
  }

  body.nav-open .hero {
    padding-top: 158px !important;
  }

  .visual-body-panel,
  .visual-week-panel {
    padding: 16px 12px !important;
    border-radius: 26px !important;
  }

  .visual-body-panel h3,
  .visual-week-panel h3 {
    padding-left: 6px;
  }

  .body-metrics.visual-body,
  .stats-list.visual-week {
    width: 100%;
    margin-top: 14px;
    gap: 10px;
  }

  .body-metrics.visual-body > .body-visual,
  .stats-list.visual-week > .week-visual-card {
    width: 100%;
    min-height: 112px !important;
    padding: 16px 18px !important;
    border-radius: 24px !important;
    background:
      linear-gradient(145deg, rgba(255, 255, 255, 0.072), rgba(255, 255, 255, 0.032)),
      rgba(10, 24, 21, 0.72) !important;
    border-color: rgba(216, 255, 236, 0.12) !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.07) !important;
  }

  .body-metrics.visual-body > .body-visual {
    grid-template-columns: minmax(0, 1fr) 96px;
  }

  .body-visual strong,
  .week-visual-card strong {
    font-size: 34px !important;
  }

  .oxygen-ring,
  .training-gauge,
  .mini-ring,
  .clock-face {
    width: 68px !important;
    height: 68px !important;
  }

  .thermo {
    width: 16px !important;
    height: 70px !important;
    margin-right: 22px !important;
  }

  .thermo::after {
    width: 38px !important;
    height: 38px !important;
  }

  .body-silhouette {
    width: 58px !important;
    height: 72px !important;
  }

  .week-dot-row {
    grid-template-columns: repeat(7, 9px) !important;
    gap: 5px !important;
  }
}

@media (min-width: 761px) {
  .nav {
    gap: 10px;
  }

  .nav a {
    min-width: 66px;
  }

  .visual-body-panel {
    padding: 20px;
  }
}

.core-card,
.panel,
.visual-vital-card,
.body-visual,
.week-visual-card,
.training-stat,
.trend-card {
  transform-style: preserve-3d;
  will-change: transform;
}

.visual-vital-card,
.body-visual,
.week-visual-card,
.training-stat {
  animation: cardFloatIn 0.6s both cubic-bezier(0.16, 1, 0.3, 1);
}

.body-visual:nth-child(2),
.week-visual-card:nth-child(2),
.training-stat:nth-child(2) { animation-delay: 0.04s; }
.body-visual:nth-child(3),
.week-visual-card:nth-child(3),
.training-stat:nth-child(3) { animation-delay: 0.08s; }
.week-visual-card:nth-child(4),
.training-stat:nth-child(4) { animation-delay: 0.12s; }

.oxygen-ring,
.mini-ring,
.training-gauge,
.ring-wrap,
.clock-face {
  animation: ringBreathe 4.8s ease-in-out infinite;
}

.route-grid,
.grid-line {
  animation: gridPulse 5s ease-in-out infinite;
}

.load-bar.active {
  transform-origin: center bottom;
  animation: barRise 0.9s both cubic-bezier(0.16, 1, 0.3, 1), neonPulse 3.4s ease-in-out infinite;
}

.zone-segment {
  transform-origin: left center;
  animation: zoneGrow 0.8s both cubic-bezier(0.16, 1, 0.3, 1);
}

.scatter-dot,
.dot,
.week-dot-row i {
  animation: dotPop 0.55s both cubic-bezier(0.16, 1, 0.3, 1);
}

.chart-panel,
.route-card,
.visual-body-panel,
.visual-week-panel {
  position: relative;
  overflow: hidden;
}

.chart-panel::after,
.route-card::after,
.visual-body-panel::after,
.visual-week-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(115deg, transparent 18%, rgba(255,255,255,0.045) 38%, transparent 58%);
  transform: translateX(-120%);
  animation: surfaceSweep 7s ease-in-out infinite;
}

.visual-body-panel::before,
.visual-week-panel::before {
  content: "";
  position: absolute;
  right: 22px;
  top: 22px;
  width: 118px;
  height: 78px;
  border: 1px solid rgba(216, 255, 236, 0.08);
  border-radius: 24px;
  transform: rotate(-9deg) translate3d(0, 0, -18px);
  opacity: 0.52;
  pointer-events: none;
}

@media (hover: hover) and (pointer: fine) {
  .core-card:hover,
  .visual-vital-card:hover,
  .body-visual:hover,
  .week-visual-card:hover,
  .training-stat:hover {
    transform: perspective(900px) rotateX(1.5deg) rotateY(-2deg) translateY(-2px);
    transition: transform 180ms cubic-bezier(0.16, 1, 0.3, 1), border-color 180ms ease;
    border-color: rgba(216, 255, 236, 0.22) !important;
  }
}

@keyframes navSheetIn {
  from { opacity: 0; transform: translateY(-8px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes cardFloatIn {
  from { opacity: 0; transform: translateY(12px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes ringBreathe {
  0%, 100% { filter: drop-shadow(0 0 0 rgba(53, 229, 143, 0)); transform: translateZ(0) scale(1); }
  50% { filter: drop-shadow(0 0 12px rgba(53, 229, 143, 0.18)); transform: translateZ(0) scale(1.018); }
}

@keyframes gridPulse {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 0.95; }
}

@keyframes barRise {
  from { transform: scaleY(0.12); opacity: 0.45; }
  to { transform: scaleY(1); opacity: 1; }
}

@keyframes neonPulse {
  0%, 100% { filter: drop-shadow(0 0 8px rgba(32, 212, 240, 0.2)); }
  50% { filter: drop-shadow(0 0 18px rgba(32, 212, 240, 0.38)); }
}

@keyframes zoneGrow {
  from { transform: scaleX(0.2); opacity: 0.6; }
  to { transform: scaleX(1); opacity: 1; }
}

@keyframes dotPop {
  from { transform: scale(0.35); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

@keyframes surfaceSweep {
  0%, 58% { transform: translateX(-120%); opacity: 0; }
  66% { opacity: 1; }
  82%, 100% { transform: translateX(120%); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}


/* Mobile nav escape hatch: the compact topbar cannot create a containing block for the fixed nav sheet. */
@media (max-width: 760px) {
  .topbar {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    transform: none !important;
    filter: none !important;
    contain: none !important;
  }

  body.nav-open header.topbar nav#mainNav {
    position: fixed !important;
    inset-inline: 10px !important;
    left: 10px !important;
    right: 10px !important;
    top: calc(max(8px, env(safe-area-inset-top)) + 64px) !important;
    width: calc(100vw - 20px) !important;
    min-width: 0 !important;
    max-width: calc(100vw - 20px) !important;
    box-sizing: border-box !important;
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}


/* Persistent visible motion pass: make the dashboard feel alive after initial load. */
.core-card,
.visual-vital-card,
.body-visual,
.week-visual-card,
.training-stat {
  animation: livingCard 6.5s ease-in-out infinite !important;
}

.core-card::before,
.visual-vital-card::after,
.body-visual::after,
.week-visual-card::after,
.training-stat::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(110deg, transparent 18%, rgba(255,255,255,0.06) 42%, transparent 62%);
  transform: translateX(-120%);
  animation: visibleSweep 4.6s ease-in-out infinite !important;
  z-index: 0;
}

.core-card > *,
.visual-vital-card > *,
.body-visual > *,
.week-visual-card > *,
.training-stat > * {
  position: relative;
  z-index: 1;
}

.ring-wrap,
.oxygen-ring,
.mini-ring,
.training-gauge,
.clock-face {
  animation: visibleBreathe 2.8s ease-in-out infinite !important;
}

.ring-value,
.route-line,
.hr-line,
.spark-line,
.line,
.trend-recovery {
  animation-name: drawLine, visibleGlow !important;
  animation-duration: 1.35s, 2.8s !important;
  animation-delay: 0s, 1.35s !important;
  animation-fill-mode: forwards, none !important;
  animation-iteration-count: 1, infinite !important;
  animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1), ease-in-out !important;
}

.mini-bar span,
.strain-fill,
.vital-scale i,
.wide-progress i,
.zone-segment,
.load-bar.active {
  background-size: 220% 100% !important;
  animation: meterGrow 0.9s both cubic-bezier(0.16, 1, 0.3, 1), meterFlow 2.2s linear infinite !important;
}

.dot,
.scatter-dot,
.week-dot-row i,
.route-dot,
.stat-route-dot {
  animation: dotPop 0.55s both cubic-bezier(0.16, 1, 0.3, 1), dotPulse 1.8s ease-in-out infinite !important;
}

.visual-body-panel,
.visual-week-panel,
.training-story,
.chart-panel,
.route-card {
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,0.08), 0 0 0 1px rgba(53,229,143,0.035);
}

.visual-body-panel::before,
.visual-week-panel::before,
.training-story::before {
  opacity: 0.82 !important;
  border-color: rgba(53, 229, 143, 0.14) !important;
  animation: explodedLayerDrift 6s ease-in-out infinite !important;
}

.recovery-context {
  display: none;
}

@media (max-width: 760px) {
  .core-recovery {
    grid-template-areas: "label ring" "context ring" !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    align-items: center !important;
    min-height: 128px !important;
  }

  .core-recovery .metric-label {
    grid-area: label;
  }

  .core-recovery .ring-wrap {
    grid-area: ring;
  }

  .recovery-context {
    grid-area: context;
    display: block;
    align-self: end;
  }

  .recovery-context strong {
    margin: 6px 0 0 !important;
    font-size: 34px !important;
    line-height: 1 !important;
  }

  .recovery-context span {
    display: block;
    margin-top: 8px;
    color: #b8cbc3;
    font-size: 14px;
    font-weight: 760;
  }

  .recovery-pips {
    display: flex;
    gap: 6px;
    margin-top: 12px;
  }

  .recovery-pips i {
    width: 22px;
    height: 7px;
    border-radius: 999px;
    background: rgba(255,255,255,0.16);
    animation: pipWave 1.6s ease-in-out infinite;
  }

  .recovery-pips i:nth-child(1) { background: var(--green); }
  .recovery-pips i:nth-child(2) { animation-delay: 0.15s; }
  .recovery-pips i:nth-child(3) { animation-delay: 0.3s; }
}

@keyframes livingCard {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(0, -2px, 0); }
}

@keyframes visibleSweep {
  0%, 45% { transform: translateX(-120%); opacity: 0; }
  55% { opacity: 1; }
  78%, 100% { transform: translateX(120%); opacity: 0; }
}

@keyframes visibleBreathe {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 0 rgba(53, 229, 143, 0)); }
  50% { transform: scale(1.035); filter: drop-shadow(0 0 18px rgba(53, 229, 143, 0.28)); }
}

@keyframes visibleGlow {
  0%, 100% { filter: drop-shadow(0 0 7px rgba(32, 212, 240, 0.2)); }
  50% { filter: drop-shadow(0 0 20px rgba(53, 229, 143, 0.38)); }
}

@keyframes meterGrow {
  from { transform: scaleX(0.18); transform-origin: left center; opacity: 0.55; }
  to { transform: scaleX(1); transform-origin: left center; opacity: 1; }
}

@keyframes meterFlow {
  from { background-position: 0% 50%; }
  to { background-position: 220% 50%; }
}

@keyframes dotPulse {
  0%, 100% { opacity: 0.82; filter: drop-shadow(0 0 4px rgba(53, 229, 143, 0.28)); }
  50% { opacity: 1; filter: drop-shadow(0 0 14px rgba(53, 229, 143, 0.58)); }
}

@keyframes explodedLayerDrift {
  0%, 100% { transform: rotate(-9deg) translate3d(0, 0, -18px); }
  50% { transform: rotate(-5deg) translate3d(-8px, 5px, -18px); }
}

@keyframes pipWave {
  0%, 100% { transform: scaleX(0.72); opacity: 0.5; }
  50% { transform: scaleX(1.1); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .core-card,
  .visual-vital-card,
  .body-visual,
  .week-visual-card,
  .training-stat,
  .ring-wrap,
  .oxygen-ring,
  .mini-ring,
  .training-gauge,
  .clock-face,
  .ring-value,
  .route-line,
  .hr-line,
  .spark-line,
  .line,
  .trend-recovery,
  .mini-bar span,
  .strain-fill,
  .vital-scale i,
  .wide-progress i,
  .zone-segment,
  .load-bar.active,
  .dot,
  .scatter-dot,
  .week-dot-row i,
  .route-dot,
  .stat-route-dot {
    animation-duration: 6s, 6s !important;
    animation-iteration-count: infinite !important;
  }
}


/* Dillon polish pass: COROS wording, clearer zones, readable charts, and calmer mobile nav. */
:root {
  --recovery-tone: var(--green);
  --sleep-pct: 61%;
  --strain-pct: 57%;
}

.ring-value {
  stroke: var(--recovery-tone) !important;
  filter: drop-shadow(0 0 18px color-mix(in srgb, var(--recovery-tone), transparent 50%)) !important;
  animation: none !important;
}

.core-recovery::after {
  background: var(--recovery-tone) !important;
}

.core-recovery .recovery-pips i:nth-child(1) {
  background: var(--recovery-tone) !important;
}

.core-sleep,
.core-strain {
  padding-right: 22px;
}

.core-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 164px;
  grid-template-rows: auto auto auto auto;
  align-items: center;
  column-gap: 18px;
}

.core-sleep .metric-label,
.core-sleep > strong,
.core-sleep > p,
.core-sleep .mini-bar,
.core-strain .metric-label,
.core-strain > strong,
.core-strain > p,
.core-strain .compact-meter,
.core-recovery .metric-label,
.core-recovery .recovery-context {
  grid-column: 1;
}

.core-side-visual,
.core-recovery .ring-wrap {
  position: relative !important;
  grid-column: 2 !important;
  grid-row: 1 / 5 !important;
  align-self: center !important;
  justify-self: center !important;
  right: auto !important;
  top: auto !important;
  transform: none !important;
}

.core-recovery {
  grid-template-columns: minmax(0, 1fr) 164px !important;
  grid-template-rows: auto auto auto auto !important;
  text-align: left !important;
  place-items: center stretch !important;
}

.core-recovery .metric-label {
  grid-row: 1;
}

.core-recovery .recovery-context {
  grid-row: 2 / 5;
  align-self: center;
}

.core-side-visual {
  position: absolute;
  z-index: 1;
  right: 22px;
  top: 50%;
  width: 164px;
  height: 164px;
  transform: translateY(-50%);
  border-radius: 50%;
  animation: ringBreathe 4.8s ease-in-out infinite;
}

.core-side-visual .ring,
.core-side-visual svg {
  width: 100%;
  height: 100%;
}

.core-side-visual .orbit-ring-value {
  stroke: var(--orbit-accent);
  filter: drop-shadow(0 0 18px color-mix(in srgb, var(--orbit-accent), transparent 50%));
}

.core-side-visual .ring-center span {
  font-size: 38px;
}

.core-side-visual .ring-center small {
  color: #b8cbc3;
  font-size: 12px;
  font-weight: 760;
}

.sleep-orbit {
  --orbit-accent: var(--cyan);
  --orbit-pct: var(--sleep-pct);
}

.strain-orbit {
  --orbit-accent: var(--amber);
  --orbit-pct: var(--strain-pct);
}

.training-auth-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(216, 255, 236, 0.1);
}

.training-auth-row .ghost-button {
  min-width: 168px;
}

#weekRecoveryLine {
  stroke-width: 6 !important;
  filter: drop-shadow(0 0 14px rgba(53, 229, 143, 0.46));
  animation: metricFocusRecovery 8s infinite !important;
}

#weekHrvLine {
  stroke-width: 4 !important;
  stroke-dasharray: 13 10 !important;
  animation: metricFocusHrv 8s infinite !important;
}

#weekSleepLine {
  stroke-width: 3.5 !important;
  stroke-dasharray: 2 12 !important;
  animation: metricFocusSleep 8s infinite !important;
  opacity: 0.95;
}

.week-sleep-bar {
  fill: rgba(255, 184, 77, 0.18);
  filter: drop-shadow(0 0 10px rgba(255, 184, 77, 0.12));
  animation: metricFocusSleep 8s infinite !important;
}

.hrv-dot {
  fill: var(--purple);
  stroke: rgba(255,255,255,0.72);
  stroke-width: 1.4;
  animation: metricFocusHrv 8s infinite !important;
}

.green-dot {
  animation: metricFocusRecovery 8s infinite !important;
}

.chart-legend span {
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.055);
}

.chart-legend span:nth-child(1) {
  animation: legendFocusRecovery 8s infinite !important;
}

.chart-legend span:nth-child(2) {
  animation: legendFocusHrv 8s infinite !important;
}

.chart-legend span:nth-child(3) {
  animation: legendFocusSleep 8s infinite !important;
}

.ai-report-body {
  display: grid;
  gap: 10px;
  white-space: normal;
}

.ai-section-title {
  margin-top: 6px;
  color: #f5fbf8;
  font-size: 18px;
  font-weight: 900;
}

.ai-point {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 10px 12px;
  border: 1px solid rgba(216, 255, 236, 0.08);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.045);
}

.ai-point span {
  line-height: 1.6;
}

.ai-point p {
  color: #dff8ea;
  line-height: 1.7;
}

.hr-average-line {
  stroke: rgba(255, 184, 77, 0.7);
  stroke-width: 2;
  stroke-dasharray: 7 8;
}

.hr-marker-text,
.hr-caption-text {
  fill: #c8d9d2;
  font-size: 13px;
  font-weight: 760;
}

.hr-caption-text {
  fill: #92a49d;
}

.chart-note {
  fill: #d7e6df !important;
  font-size: 18px !important;
  font-weight: 820;
}

.chart-note-load {
  fill: #a8edf8 !important;
}

@media (max-width: 760px) {
  .core-card {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 116px !important;
    grid-template-rows: auto auto auto auto !important;
    align-items: center !important;
    column-gap: 14px !important;
    min-height: 170px !important;
  }

  .core-sleep,
  .core-strain {
    min-height: 170px !important;
    padding-right: 16px !important;
  }

  .core-sleep .metric-label,
  .core-sleep > strong,
  .core-sleep > p,
  .core-sleep .mini-bar,
  .core-strain .metric-label,
  .core-strain > strong,
  .core-strain > p,
  .core-strain .compact-meter,
  .core-recovery .metric-label,
  .core-recovery .recovery-context {
    grid-column: 1 !important;
  }

  .core-side-visual {
    position: relative !important;
    grid-column: 2 !important;
    grid-row: 1 / 5 !important;
    top: auto !important;
    right: auto !important;
    width: 116px;
    height: 116px;
    transform: none !important;
    align-self: center !important;
    justify-self: center !important;
  }

  .core-side-visual .ring-center span {
    font-size: 30px;
  }

  .core-side-visual .ring-center small {
    font-size: 11px;
  }

  .core-recovery {
    grid-template-columns: minmax(0, 1fr) 116px !important;
    grid-template-rows: auto auto auto auto !important;
    grid-template-areas: none !important;
    text-align: left !important;
    place-items: center stretch !important;
    min-height: 170px !important;
  }

  .core-recovery .metric-label {
    grid-row: 1 !important;
  }

  .core-recovery .recovery-context {
    grid-row: 2 / 5 !important;
    align-self: center !important;
  }

  .core-recovery .ring-wrap {
    position: relative !important;
    grid-column: 2 !important;
    grid-row: 1 / 5 !important;
    width: 116px !important;
    height: 116px !important;
    align-self: center !important;
    justify-self: center !important;
  }

  .core-recovery .ring {
    width: 116px !important;
    height: 116px !important;
  }

  .core-recovery .ring-track,
  .core-recovery .ring-value,
  .core-side-visual .ring-track,
  .core-side-visual .orbit-ring-value {
    stroke-width: 13 !important;
    animation: none !important;
  }

  .training-story-head {
    display: block !important;
  }

  .training-auth-row {
    justify-content: stretch;
  }

  .training-auth-row .ghost-button {
    width: 100%;
  }

  .topbar .nav,
  body.nav-open header.topbar nav#mainNav {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 7px !important;
    padding: 8px !important;
    border-radius: 18px !important;
    background: rgba(6, 18, 16, 0.82) !important;
    border-color: rgba(216, 255, 236, 0.14) !important;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-10px) scale(0.985);
    backdrop-filter: blur(18px) !important;
  }

  body.nav-open header.topbar nav#mainNav {
    opacity: 1;
    pointer-events: auto;
    animation: navSheetIn 0.24s cubic-bezier(0.16, 1, 0.3, 1) both;
  }

  body.nav-closing header.topbar nav#mainNav {
    opacity: 1;
    display: grid !important;
    pointer-events: none;
    animation: navSheetOut 0.22s ease both;
  }

  .topbar .nav a,
  body.nav-open .nav a {
    min-height: 38px !important;
    padding: 0 6px !important;
    border-radius: 13px !important;
    background: rgba(255, 255, 255, 0.045) !important;
    color: rgba(245, 251, 248, 0.88) !important;
    font-size: 12px !important;
    font-weight: 760 !important;
  }

  body.nav-open .hero {
    padding-top: 128px !important;
  }

  .chart-note {
    font-size: 26px !important;
  }
}

@keyframes navSheetOut {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(-10px) scale(0.985); }
}

@keyframes metricFocusRecovery {
  0%, 30% { opacity: 1; filter: drop-shadow(0 0 16px rgba(53, 229, 143, 0.48)); }
  36%, 100% { opacity: 0.18; filter: none; }
}

@keyframes metricFocusHrv {
  0%, 30% { opacity: 0.18; filter: none; }
  36%, 63% { opacity: 1; filter: drop-shadow(0 0 13px rgba(157, 92, 255, 0.48)); }
  69%, 100% { opacity: 0.18; filter: none; }
}

@keyframes metricFocusSleep {
  0%, 63% { opacity: 0.18; filter: none; }
  69%, 96% { opacity: 1; filter: drop-shadow(0 0 13px rgba(255, 184, 77, 0.42)); }
  100% { opacity: 0.18; filter: none; }
}

@keyframes legendFocusRecovery {
  0%, 30% { opacity: 1; transform: translateY(0); }
  36%, 100% { opacity: 0; transform: translateY(4px); pointer-events: none; }
}

@keyframes legendFocusHrv {
  0%, 30% { opacity: 0; transform: translateY(4px); pointer-events: none; }
  36%, 63% { opacity: 1; transform: translateY(0); }
  69%, 100% { opacity: 0; transform: translateY(4px); pointer-events: none; }
}

@keyframes legendFocusSleep {
  0%, 63% { opacity: 0; transform: translateY(4px); pointer-events: none; }
  69%, 96% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(4px); pointer-events: none; }
}

/* 2026-05-02 UI tuning: unified core rings, clearer charts, slower single-metric focus. */
.core-metrics {
  align-items: stretch;
}

.core-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 148px;
  grid-template-rows: auto auto auto auto 1fr;
  column-gap: 18px;
  min-height: 244px;
}

.core-card .metric-label,
.core-card > strong,
.core-card > p,
.core-card .mini-bar,
.core-card .compact-meter,
.core-card .recovery-context {
  grid-column: 1;
}

.core-card > strong,
.recovery-context strong {
  color: #f7fffb;
}

.core-card > p,
.recovery-context span,
.recovery-context p {
  max-width: 100%;
}

.core-advice {
  margin-top: 8px !important;
  color: #f2fbf7 !important;
  font-size: 15px;
  font-weight: 820;
  line-height: 1.45 !important;
}

.core-recovery {
  place-items: stretch;
  text-align: left;
}

.recovery-context {
  align-self: center;
}

.recovery-context strong {
  display: block;
  margin-top: 18px;
  font-size: clamp(42px, 6vw, 68px);
  line-height: 0.95;
}

.recovery-context span {
  display: block;
  margin-top: 14px;
  color: #b8cbc3;
  line-height: 1.5;
}

.recovery-pips {
  display: none;
}

.core-side-visual,
.core-recovery .ring-wrap {
  position: absolute !important;
  z-index: 1;
  top: 56px !important;
  right: 22px !important;
  width: 148px !important;
  height: 148px !important;
  transform: none !important;
}

.core-side-visual .ring,
.core-side-visual svg,
.core-recovery .ring,
.core-recovery .ring-wrap svg {
  width: 148px !important;
  height: 148px !important;
}

.core-side-visual .ring-center span,
.core-recovery .ring-center span {
  font-size: 34px !important;
}

.core-sleep::after {
  background: var(--sleep-tone, var(--amber));
}

.core-recovery::after {
  background: var(--recovery-tone, var(--amber));
}

.mini-bar span {
  background: linear-gradient(90deg, var(--sleep-tone, var(--amber)), color-mix(in srgb, var(--sleep-tone, var(--amber)), white 18%));
}

.sleep-timeline {
  height: 38px;
  border-radius: 12px;
}

.sleep-timeline span {
  display: grid;
  place-items: center;
  min-width: 42px;
  color: #06110f;
  font-size: 12px;
  font-weight: 900;
  text-align: center;
}

.sleep-timeline b,
.sleep-timeline small {
  display: block;
  line-height: 1.05;
}

.sleep-timeline small {
  margin-top: 2px;
  font-size: 10px;
  opacity: 0.78;
}

.sleep-timeline .deep,
.sleep-timeline .rem {
  color: #f7fffb;
}

.sleep-detail-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

#weekRecoveryArea {
  animation: metricFocusRecovery 8s infinite !important;
}

#weekRecoveryLine,
.week-recovery-point,
.green-dot {
  animation: metricFocusRecovery 8s infinite !important;
}

#weekHrvLine,
.week-hrv-point,
.hrv-dot {
  animation: metricFocusHrv 8s infinite !important;
}

#weekSleepLine,
.week-sleep-point,
.week-sleep-bar {
  animation: metricFocusSleep 8s infinite !important;
}

.chart-legend span:nth-child(1) {
  animation: legendFocusRecovery 8s infinite !important;
}

.chart-legend span:nth-child(2) {
  animation: legendFocusHrv 8s infinite !important;
}

.chart-legend span:nth-child(3) {
  animation: legendFocusSleep 8s infinite !important;
}

.training-chart {
  min-height: 280px;
}

.training-chart .chart-note {
  font-size: 14px !important;
}

.load-axis {
  fill: #a8edf8 !important;
}

.load-bar.active {
  fill: rgba(32, 212, 240, 0.72);
}

.trend-recovery {
  stroke: var(--green);
  stroke-width: 4.5;
}

.hr-viz {
  height: 164px;
}

.hr-caption-text {
  font-size: 12px;
  opacity: 0.86;
}

@media (max-width: 760px) {
  .core-card,
  .core-recovery {
    grid-template-columns: minmax(0, 1fr) 116px !important;
    min-height: 170px !important;
  }

  .core-side-visual,
  .core-recovery .ring-wrap {
    position: relative !important;
    grid-column: 2 !important;
    grid-row: 1 / 6 !important;
    top: auto !important;
    right: auto !important;
    width: 116px !important;
    height: 116px !important;
    transform: none !important;
    align-self: center !important;
    justify-self: center !important;
  }

  .core-side-visual .ring,
  .core-side-visual svg,
  .core-recovery .ring,
  .core-recovery .ring-wrap svg {
    width: 116px !important;
    height: 116px !important;
  }

  .core-side-visual .ring-center span,
  .core-recovery .ring-center span {
    font-size: 28px !important;
  }

  .recovery-context strong {
    margin-top: 12px;
    font-size: 44px;
  }

  .core-advice {
    font-size: 13px;
  }

  .sleep-detail-grid {
    grid-template-columns: 1fr;
  }

  .sleep-timeline {
    height: 44px;
  }

  .sleep-timeline span {
    min-width: 34px;
    font-size: 10px;
  }

  .training-chart .chart-note {
    font-size: 12px !important;
  }
}

@keyframes metricFocusRecovery {
  0%, 31% { opacity: 1; filter: drop-shadow(0 0 16px rgba(53, 229, 143, 0.48)); }
  33%, 100% { opacity: 0; filter: none; }
}

@keyframes metricFocusHrv {
  0%, 33% { opacity: 0; filter: none; }
  34%, 64% { opacity: 1; filter: drop-shadow(0 0 13px rgba(157, 92, 255, 0.48)); }
  66%, 100% { opacity: 0; filter: none; }
}

@keyframes metricFocusSleep {
  0%, 66% { opacity: 0; filter: none; }
  67%, 97% { opacity: 1; filter: drop-shadow(0 0 13px rgba(255, 184, 77, 0.42)); }
  99%, 100% { opacity: 0; filter: none; }
}

@keyframes legendFocusRecovery {
  0%, 31% { opacity: 1; transform: translateY(0); }
  33%, 100% { opacity: 0; transform: translateY(4px); pointer-events: none; }
}

@keyframes legendFocusHrv {
  0%, 33% { opacity: 0; transform: translateY(4px); pointer-events: none; }
  34%, 64% { opacity: 1; transform: translateY(0); }
  66%, 100% { opacity: 0; transform: translateY(4px); pointer-events: none; }
}

@keyframes legendFocusSleep {
  0%, 66% { opacity: 0; transform: translateY(4px); pointer-events: none; }
  67%, 97% { opacity: 1; transform: translateY(0); }
  99%, 100% { opacity: 0; transform: translateY(4px); pointer-events: none; }
}


.weather-section {
  scroll-margin-top: 96px;
}

.weather-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.weather-card {
  min-height: 260px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.weather-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.weather-card h3 {
  font-size: 24px;
  line-height: 1.15;
}

.weather-card-head > strong {
  font-size: 42px;
  line-height: 1;
  letter-spacing: 0;
}

.weather-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.weather-metrics div {
  min-height: 72px;
  padding: 12px;
  border: 1px solid rgba(216, 255, 236, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055);
}

.weather-metrics span,
.weather-actions span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 6px;
}

.weather-metrics strong {
  font-size: 20px;
  line-height: 1.1;
}

.weather-card p:not(.eyebrow) {
  color: #c7d8d0;
  line-height: 1.6;
}

.decision-weather {
  justify-content: space-between;
}

.decision-weather h3 {
  font-size: 28px;
}

.weather-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

html[data-weather-level="go"] .decision-weather {
  border-color: rgba(53, 229, 143, 0.38);
}

html[data-weather-level="indoor"] .decision-weather,
html[data-weather-level="walk"] .decision-weather {
  border-color: rgba(255, 184, 77, 0.38);
}

html[data-weather-level="rest"] .decision-weather {
  border-color: rgba(255, 107, 107, 0.38);
}

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

  .weather-card {
    min-height: 0;
  }

  .weather-card-head > strong {
    font-size: 36px;
  }
}


.brand-mark {
  position: relative;
  overflow: hidden;
}

.brand-mark::after {
  content: "";
  position: absolute;
  inset: -45%;
  background: conic-gradient(from 0deg, transparent 0 42%, rgba(255, 255, 255, 0.7), transparent 58% 100%);
  animation: brandSweep 4.8s linear infinite;
}

.brand-mark span,
.brand-mark {
  isolation: isolate;
}

.weather-hero-mark {
  display: grid;
  justify-items: center;
  gap: 8px;
  min-width: 84px;
}

.weather-icon,
.body-weather-icon,
.decision-weather-visual {
  position: relative;
  width: 76px;
  height: 58px;
}

.weather-icon.small {
  width: 46px;
  height: 36px;
  transform: scale(0.9);
  transform-origin: center;
}

.weather-icon i,
.weather-icon b,
.weather-icon span,
.weather-icon em,
.body-weather-icon i,
.body-weather-icon b,
.decision-weather-visual i,
.decision-weather-visual b,
.decision-weather-visual span {
  position: absolute;
  display: block;
}

.weather-icon-sunny i,
.weather-icon-night i {
  width: 36px;
  height: 36px;
  left: 20px;
  top: 10px;
  border-radius: 50%;
  background: #ffcc66;
  box-shadow: 0 0 24px rgba(255, 204, 102, 0.55);
  animation: weatherPulse 2.8s ease-in-out infinite;
}

.weather-icon-sunny b {
  inset: 6px 16px;
  border-radius: 50%;
  border: 2px dashed rgba(255, 204, 102, 0.55);
  animation: rotate 8s linear infinite;
}

.weather-icon-night i {
  background: #dbeafe;
  box-shadow: 0 0 22px rgba(219, 234, 254, 0.45);
}

.weather-icon-night span {
  width: 24px;
  height: 24px;
  left: 34px;
  top: 8px;
  border-radius: 50%;
  background: var(--panel);
}

.weather-icon-cloudy i,
.weather-icon-rain i,
.weather-icon-haze i,
.weather-icon-snow i {
  width: 54px;
  height: 26px;
  left: 12px;
  top: 24px;
  border-radius: 999px;
  background: linear-gradient(180deg, #e9fff7, #9cc7bd);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2);
  animation: cloudFloat 4s ease-in-out infinite;
}

.weather-icon-cloudy b,
.weather-icon-rain b,
.weather-icon-haze b,
.weather-icon-snow b {
  width: 28px;
  height: 28px;
  left: 22px;
  top: 10px;
  border-radius: 50%;
  background: #dffbf2;
  animation: cloudFloat 4s ease-in-out infinite;
}

.weather-icon-cloudy span,
.weather-icon-rain span,
.weather-icon-haze span,
.weather-icon-snow span {
  width: 22px;
  height: 22px;
  left: 38px;
  top: 16px;
  border-radius: 50%;
  background: #c5e5dc;
  animation: cloudFloat 4s ease-in-out infinite;
}

.weather-icon-rain em,
.weather-icon-rain::before,
.weather-icon-rain::after {
  content: "";
  position: absolute;
  width: 3px;
  height: 12px;
  top: 48px;
  border-radius: 999px;
  background: var(--cyan);
  animation: rainDrop 1.1s ease-in infinite;
}

.weather-icon-rain em { left: 26px; }
.weather-icon-rain::before { left: 38px; animation-delay: 0.18s; }
.weather-icon-rain::after { left: 50px; animation-delay: 0.36s; }

.weather-icon-haze em,
.weather-icon-haze::before,
.weather-icon-haze::after {
  content: "";
  position: absolute;
  left: 8px;
  width: 60px;
  height: 2px;
  border-radius: 999px;
  background: rgba(255, 184, 77, 0.72);
  animation: hazeDrift 2.8s ease-in-out infinite;
}

.weather-icon-haze em { top: 45px; }
.weather-icon-haze::before { top: 52px; animation-delay: 0.25s; }
.weather-icon-haze::after { top: 59px; animation-delay: 0.5s; }

.weather-icon-snow::before,
.weather-icon-snow::after {
  content: "";
  position: absolute;
  width: 6px;
  height: 6px;
  top: 48px;
  border-radius: 50%;
  background: #e0f2fe;
  animation: snowFall 1.8s ease-in-out infinite;
}

.weather-icon-snow::before { left: 30px; }
.weather-icon-snow::after { left: 48px; animation-delay: 0.5s; }

.body-weather-icon {
  border-radius: 50%;
  border: 1px solid rgba(216, 255, 236, 0.14);
}

.body-weather-icon i {
  width: 28px;
  height: 42px;
  left: 24px;
  top: 8px;
  border-radius: 18px 18px 12px 12px;
  background: linear-gradient(180deg, rgba(53, 229, 143, 0.9), rgba(32, 212, 240, 0.42));
  animation: bodyGlow 3.2s ease-in-out infinite;
}

.body-weather-icon b {
  inset: 4px;
  border-radius: 50%;
  border: 2px solid rgba(53, 229, 143, 0.22);
  animation: weatherPulse 2.5s ease-in-out infinite;
}

.body-weather-rain i {
  background: linear-gradient(180deg, rgba(255, 107, 107, 0.9), rgba(157, 92, 255, 0.42));
}

.body-weather-cloud i {
  background: linear-gradient(180deg, rgba(255, 184, 77, 0.85), rgba(157, 92, 255, 0.38));
}

.decision-weather-visual {
  align-self: flex-end;
  margin-bottom: -8px;
}

.decision-weather-visual i {
  width: 58px;
  height: 58px;
  right: 0;
  top: 0;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(53, 229, 143, 0.95), rgba(32, 212, 240, 0.36));
  animation: weatherPulse 2.6s ease-in-out infinite;
}

.decision-weather-visual b {
  width: 34px;
  height: 4px;
  right: 12px;
  top: 27px;
  border-radius: 999px;
  background: #04120c;
}

.decision-weather-visual span {
  width: 14px;
  height: 14px;
  right: 18px;
  top: 18px;
  border-right: 4px solid #04120c;
  border-bottom: 4px solid #04120c;
  transform: rotate(-45deg);
}

.decision-rest i,
.decision-indoor i {
  background: radial-gradient(circle, rgba(255, 107, 107, 0.92), rgba(255, 184, 77, 0.34));
}

.decision-walk i {
  background: radial-gradient(circle, rgba(255, 184, 77, 0.92), rgba(32, 212, 240, 0.3));
}

.weekly-weather-panel {
  margin-top: 16px;
}

.weekly-weather-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.weekly-weather-head h3 {
  font-size: 24px;
}

.weekly-weather-head span {
  color: var(--muted);
  font-size: 13px;
}

.weekly-weather-list {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
}

.weekly-weather-day,
.weekly-weather-empty {
  min-height: 150px;
  display: grid;
  align-content: start;
  justify-items: center;
  gap: 7px;
  padding: 12px 8px;
  border: 1px solid rgba(216, 255, 236, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.052);
  text-align: center;
}

.weekly-weather-day strong {
  font-size: 15px;
}

.weekly-weather-day span,
.weekly-weather-day small {
  color: var(--muted);
  font-size: 12px;
}

.weekly-weather-day b {
  font-size: 14px;
}

@keyframes weatherPulse {
  0%, 100% { transform: scale(1); opacity: 0.86; }
  50% { transform: scale(1.08); opacity: 1; }
}

@keyframes cloudFloat {
  0%, 100% { transform: translateX(-2px); }
  50% { transform: translateX(4px); }
}

@keyframes rainDrop {
  0% { transform: translateY(-5px); opacity: 0; }
  35% { opacity: 1; }
  100% { transform: translateY(8px); opacity: 0; }
}

@keyframes hazeDrift {
  0%, 100% { transform: translateX(-6px); opacity: 0.45; }
  50% { transform: translateX(8px); opacity: 0.9; }
}

@keyframes snowFall {
  0% { transform: translateY(-4px); opacity: 0.2; }
  50% { opacity: 1; }
  100% { transform: translateY(9px); opacity: 0.1; }
}

@keyframes bodyGlow {
  0%, 100% { filter: drop-shadow(0 0 8px rgba(53, 229, 143, 0.24)); transform: translateY(0); }
  50% { filter: drop-shadow(0 0 18px rgba(53, 229, 143, 0.55)); transform: translateY(-2px); }
}

@keyframes brandSweep {
  to { transform: rotate(360deg); }
}

@media (max-width: 1020px) {
  .weekly-weather-list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .weekly-weather-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .weather-metrics {
    grid-template-columns: 1fr 1fr;
  }
}


.weekly-weather-day strong {
  white-space: nowrap;
}

.weekly-weather-day span {
  min-height: 30px;
  line-height: 1.25;
}

.weekly-weather-day small {
  line-height: 1.35;
}

@media (max-width: 640px) {
  .weekly-weather-day {
    min-height: 164px;
  }
}


@media (min-width: 761px) {
  #bodyValue {
    font-size: clamp(30px, 2vw, 36px) !important;
    line-height: 1.04;
    gap: 8px;
  }

  #bodyValue .body-separator {
    font-size: 0.76em;
    transform: translateY(-0.02em);
  }
}


/* Lifestyle mobile hardening */
@media (max-width: 920px) {
  .lifestyle-grid {
    grid-template-columns: 1fr;
  }

  .lifestyle-tiles {
    grid-template-columns: 1fr 1fr;
  }
}

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

  .lifestyle-score {
    width: 112px;
    height: 112px;
  }

  .lifestyle-signal-list,
  .lifestyle-tiles {
    grid-template-columns: 1fr;
  }
}


/* Takeout helper chooser */
.takeout-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.takeout-choice {
  min-width: 0;
  min-height: 62px;
  padding: 10px 11px;
  border: 1px solid rgba(216, 255, 236, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.052);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.takeout-choice span,
.food-choice-result span,
.food-choice-result small {
  color: var(--muted);
}

.takeout-choice span {
  display: block;
  margin-bottom: 5px;
  font-size: 11px;
  font-weight: 850;
}

.takeout-choice strong {
  display: block;
  font-size: 14px;
  line-height: 1.25;
}

.takeout-choice.is-active {
  border-color: rgba(53, 229, 143, 0.46);
  background: rgba(53, 229, 143, 0.12);
}

.food-choice-result {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid rgba(216, 255, 236, 0.12);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.05);
}

.food-choice-result div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.food-choice-result strong {
  font-size: 18px;
  line-height: 1.15;
}

.food-choice-result p {
  margin: 10px 0 6px;
  line-height: 1.45;
}

.food-choice-result small {
  display: block;
  line-height: 1.45;
}

.food-choice-result.level-green {
  border-color: rgba(53, 229, 143, 0.34);
}

.food-choice-result.level-yellow {
  border-color: rgba(255, 204, 102, 0.34);
}

.food-choice-result.level-red {
  border-color: rgba(255, 107, 107, 0.34);
}

@media (max-width: 620px) {
  .takeout-choice-grid {
    grid-template-columns: 1fr;
  }

  .takeout-choice {
    min-height: 56px;
  }
}

/* Hermes food analysis */
.hermes-input-box {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.hermes-input-box label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hermes-input-box textarea {
  width: 100%;
  box-sizing: border-box;
  resize: vertical;
  min-height: 86px;
  padding: 12px;
  border: 1px solid rgba(216, 255, 236, 0.14);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.052);
  color: var(--text);
  font: inherit;
  line-height: 1.45;
}

.hermes-input-box textarea::placeholder {
  color: rgba(204, 222, 216, 0.56);
}

.hermes-upload-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.hermes-upload-row input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.hermes-upload-button,
.hermes-actions button {
  min-height: 40px;
  border: 1px solid rgba(53, 229, 143, 0.28);
  border-radius: 14px;
  background: rgba(53, 229, 143, 0.12);
  color: var(--text);
  cursor: pointer;
}

.hermes-upload-button {
  display: inline-grid;
  place-items: center;
  padding: 0 12px;
}

#hermesPhotoName {
  min-width: 0;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hermes-actions {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 10px;
}

.hermes-actions button {
  padding: 0 12px;
  font-weight: 850;
}

.hermes-actions button:disabled {
  cursor: wait;
  opacity: 0.62;
}

.hermes-result {
  display: none;
  margin-top: 14px;
  padding: 13px;
  border: 1px solid rgba(216, 255, 236, 0.12);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.05);
}

.hermes-result.is-loading,
.hermes-result.level-green,
.hermes-result.level-yellow,
.hermes-result.level-red {
  display: block;
}

.hermes-result.level-green {
  border-color: rgba(53, 229, 143, 0.34);
}

.hermes-result.level-yellow {
  border-color: rgba(255, 204, 102, 0.34);
}

.hermes-result.level-red {
  border-color: rgba(255, 107, 107, 0.34);
}

.hermes-result-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: baseline;
}

.hermes-result-head span,
.hermes-result dt,
.hermes-result small,
.hermes-meal-log > span,
.hermes-meal-log span {
  color: var(--muted);
}

.hermes-result-head strong {
  font-size: 18px;
  line-height: 1.25;
}

.hermes-result dl {
  display: grid;
  gap: 8px;
  margin: 12px 0 8px;
}

.hermes-result dl div {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 8px;
}

.hermes-result dt,
.hermes-result dd {
  margin: 0;
  line-height: 1.45;
}

.hermes-result small {
  display: block;
  margin-top: 7px;
  line-height: 1.45;
}

.hermes-meal-log {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

#hermesMealLog {
  display: grid;
  gap: 8px;
}

#hermesMealLog div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid rgba(216, 255, 236, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.045);
}

#hermesMealLog b {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 620px) {
  .hermes-upload-row,
  .hermes-actions,
  #hermesMealLog div {
    grid-template-columns: 1fr;
  }
}
