/*
 * PT Online Pro — web redesign layer (native fire/ember parity).
 * Loaded after app.css. Mirrors WorkoutDesignTokens / WorkoutPalette / Fire* colors from the KMP app.
 */

:root {
  --fire-yellow: #facc15;
  --fire-orange: #fb923c;
  --fire-red: #ef4444;
  --fire-deep: #7c2d12;
  --cta-from: #dc2626;
  --cta-to: #ea580c;
  --pillar-workout: #fb923c;
  --pillar-diet: #34d399;
  --pillar-sleep: #a78bfa;
  --pillar-rest: #2dd4bf;
  --body-fat: #22d3ee;
  --surface-3: #1f2733;
  --text-secondary: #a3b1c2;
  --font-display: "Barlow Condensed", "DM Sans", system-ui, sans-serif;
  --radius-lg: 20px;
  --radius-xl: 24px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --dur-fast: 150ms;
  --dur-med: 260ms;
  --focus-ring: 0 0 0 2px var(--bg), 0 0 0 4px rgba(251, 146, 60, 0.85);
}

/* ---------------------------------------------------------------- base polish */

.workout-app :where(button, [role="button"], [role="tab"], [role="radio"], [role="slider"], a, summary) {
  -webkit-tap-highlight-color: transparent;
}

.workout-app :where(button, [role="tab"], [role="radio"], a, summary):focus-visible,
.workout-app :where(input, textarea, select):focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.workout-app .btn {
  min-height: 44px;
  border-radius: 12px;
  font-weight: 700;
  letter-spacing: 0.01em;
  transition: transform var(--dur-fast) ease, box-shadow var(--dur-fast) ease, filter var(--dur-fast) ease, opacity var(--dur-fast) ease;
}

.workout-app .btn .ui-icon { width: 18px; height: 18px; }

.workout-app .btn-primary:not(:disabled):not(.is-disabled):not([aria-disabled="true"]) {
  background: linear-gradient(135deg, var(--cta-from), var(--cta-to));
  box-shadow: 0 8px 22px rgba(234, 88, 12, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.workout-app .btn-primary:not(:disabled):not(.is-disabled):not([aria-disabled="true"]):hover {
  filter: brightness(1.08);
  box-shadow: 0 10px 28px rgba(234, 88, 12, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.workout-app .btn-outline:hover {
  border-color: rgba(251, 146, 60, 0.45);
  background: rgba(251, 146, 60, 0.06);
}

.btn-block { width: 100%; }
.btn-sm { min-height: 36px; padding: 0.45rem 0.9rem; font-size: 0.8125rem; }

.workout-app .card {
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent 40%), var(--surface);
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.ui-icon {
  display: inline-flex;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.ui-icon svg { width: 100%; height: 100%; }

.icon-btn {
  min-width: 44px;
  min-height: 44px;
}

.icon-btn svg { width: 20px; height: 20px; }

.link-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  min-height: 44px;
  padding: 0 0.25rem 0 0.6rem;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--fire-orange);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 700;
  cursor: pointer;
  transition: color var(--dur-fast) ease, background var(--dur-fast) ease;
}

.link-btn:hover { color: #fdba74; background: rgba(251, 146, 60, 0.08); }
.link-btn .ui-icon, .link-btn svg { width: 18px; height: 18px; }

.eyebrow {
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.eyebrow--fire { color: var(--fire-yellow); }

.tab-enter {
  animation: tab-enter var(--dur-med) var(--ease-out);
}

@keyframes tab-enter {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

/* ---------------------------------------------------------------- primary nav */

.site-nav.site-nav--primary {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-width: 560px;
  gap: 0.5rem;
}

.site-nav--primary .nav-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 44px;
  padding: 0.55rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 700;
}

.site-nav--primary .nav-tab-icon {
  display: inline-flex;
  width: 18px;
  height: 18px;
}

.site-nav--primary .nav-tab-icon svg { width: 100%; height: 100%; }

.site-nav--primary .nav-tab[aria-selected="true"] {
  color: var(--fire-orange);
}

.site-nav--primary.site-nav--indicator-ready .nav-tab[aria-selected="true"] {
  color: #fdba74;
}

.site-nav--primary .nav-tab-indicator {
  background: linear-gradient(135deg, rgba(220, 38, 38, 0.22), rgba(234, 88, 12, 0.22));
  border-color: rgba(251, 146, 60, 0.55);
  box-shadow: 0 6px 18px rgba(234, 88, 12, 0.18);
}

/* ---------------------------------------------------------------- daily sub-tabs */

.daily-subtabs {
  position: sticky;
  top: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.25rem;
  margin: 0 auto 0.85rem;
  max-width: 640px;
  padding: 0.3rem;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(20, 26, 34, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.daily-subtab-wrap {
  position: relative;
  display: flex;
  min-width: 0;
}

.daily-subtab {
  --tone: var(--fire-orange);
  display: inline-flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-width: 0;
  min-height: 44px;
  padding: 0.45rem 0.4rem;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 700;
  cursor: pointer;
  transition: color var(--dur-fast) ease, background var(--dur-fast) ease, border-color var(--dur-fast) ease;
}

.daily-subtab span:not(.ui-icon) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.daily-subtab .ui-icon { width: 18px; height: 18px; }
.daily-subtab--overall { --tone: var(--fire-yellow); }
.daily-subtab--workout { --tone: var(--pillar-workout); }
.daily-subtab--diet { --tone: var(--pillar-diet); }
.daily-subtab--sleep { --tone: var(--pillar-sleep); }

.daily-subtab:hover { color: var(--text); background: rgba(255, 255, 255, 0.04); }

.daily-subtab[aria-selected="true"] {
  color: var(--tone);
  background: color-mix(in srgb, var(--tone) 14%, transparent);
  border-color: color-mix(in srgb, var(--tone) 45%, transparent);
}

.daily-subtab.coach-highlight { animation: coach-tab-glow 1.4s ease-in-out infinite; }
.daily-subtab-bubble { top: calc(100% + 10px); }

@media (max-width: 420px) {
  .daily-subtab { flex-direction: column; gap: 0.1rem; font-size: 0.6875rem; }
}

/* ---------------------------------------------------------------- fire card + embers */

.fire-card {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  border-radius: var(--radius-xl);
  background: linear-gradient(135deg, rgba(124, 45, 18, 0.34), #17111d 55%, var(--surface));
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}

.fire-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  padding: 1px;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(250, 204, 21, 0.75), rgba(251, 146, 60, 0.35), rgba(239, 68, 68, 0.12));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.ember-field {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.ember-field i {
  position: absolute;
  bottom: -10px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: radial-gradient(circle, #fde68a, rgba(251, 146, 60, 0.6) 60%, transparent 70%);
  opacity: 0;
  animation: ember-rise 6s linear infinite;
}

.ember-field i:nth-child(1) { left: 8%; animation-delay: 0s; }
.ember-field i:nth-child(2) { left: 22%; animation-delay: 1.4s; width: 3px; height: 3px; }
.ember-field i:nth-child(3) { left: 41%; animation-delay: 3.1s; }
.ember-field i:nth-child(4) { left: 58%; animation-delay: 0.7s; width: 5px; height: 5px; }
.ember-field i:nth-child(5) { left: 74%; animation-delay: 2.3s; }
.ember-field i:nth-child(6) { left: 88%; animation-delay: 4.2s; width: 3px; height: 3px; }
.ember-field i:nth-child(7) { left: 33%; animation-delay: 5s; }
.ember-field i:nth-child(8) { left: 66%; animation-delay: 3.7s; width: 3px; height: 3px; }

@keyframes ember-rise {
  0% { transform: translate(0, 0); opacity: 0; }
  12% { opacity: 0.9; }
  70% { opacity: 0.5; }
  100% { transform: translate(14px, -220px); opacity: 0; }
}

/* ---------------------------------------------------------------- ring */

.hero-ring {
  position: relative;
  flex-shrink: 0;
  width: var(--ring-size);
  height: var(--ring-size);
  display: grid;
  place-items: center;
}

.hero-ring-svg { position: absolute; inset: 0; overflow: visible; }
.hero-ring-track { stroke: rgba(255, 255, 255, 0.08); }

.hero-ring-value {
  transition: stroke-dashoffset 900ms var(--ease-out);
}

.hero-ring--empty .hero-ring-value { opacity: 0; }

.hero-ring--fire .ring-stop-a { stop-color: var(--fire-yellow); }
.hero-ring--fire .ring-stop-b { stop-color: var(--fire-red); }
.hero-ring--workout .ring-stop-a { stop-color: #fdba74; }
.hero-ring--workout .ring-stop-b { stop-color: #ea580c; }
.hero-ring--diet .ring-stop-a { stop-color: #6ee7b7; }
.hero-ring--diet .ring-stop-b { stop-color: #059669; }
.hero-ring--sleep .ring-stop-a { stop-color: #c4b5fd; }
.hero-ring--sleep .ring-stop-b { stop-color: #7c3aed; }
.hero-ring--rest .ring-stop-a,
.hero-ring--rest .ring-stop-b { stop-color: var(--pillar-rest); }

.hero-ring-center {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1.05;
  padding: 0 10px;
}

.hero-ring-pct {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.hero-ring--drag .hero-ring-pct { font-size: 2rem; }

.hero-ring-hint {
  margin-top: 2px;
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.hero-ring-flame { width: 18px; height: 18px; color: var(--fire-orange); margin-bottom: 2px; }
.hero-ring-flame.is-muted { color: var(--text-secondary); }
.hero-ring-glyph { width: 28px; height: 28px; color: var(--pillar-rest); }

.hero-ring-empty {
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--text-secondary);
  max-width: 70px;
}

.hero-ring-count strong {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
}

.hero-ring-count small { font-size: 0.875rem; color: var(--text-secondary); font-weight: 700; }

.hero-ring--drag {
  cursor: grab;
  touch-action: none;
  border-radius: 50%;
}

.hero-ring--drag.is-dragging { cursor: grabbing; }
.hero-ring--drag.is-dragging .hero-ring-value { transition: none; }

.hero-ring-knob {
  fill: #fff;
  stroke: #ea580c;
  stroke-width: 3;
  filter: drop-shadow(0 2px 6px rgba(234, 88, 12, 0.55));
  transition: r var(--dur-fast) ease;
}

.hero-ring--drag:hover .hero-ring-knob,
.hero-ring--drag.is-dragging .hero-ring-knob { r: 11; }

.hero-ring--drag:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.hero-ring-wrap {
  position: relative;
  border-radius: 50%;
}

.hero-ring-wrap .log-here-bubble {
  left: 50%;
  top: auto;
  bottom: calc(100% + 8px);
  transform: translateX(-50%);
}

/* ---------------------------------------------------------------- chips, meters, status */

.pill-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.pill-chip-row--center { justify-content: center; }

.pill-chip {
  --tone: rgba(255, 255, 255, 0.35);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--tone) 45%, transparent);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.pill-chip .ui-icon { width: 14px; height: 14px; color: var(--tone); }
.pill-chip--orange { --tone: var(--fire-orange); }
.pill-chip--yellow { --tone: var(--fire-yellow); }
.pill-chip--teal { --tone: var(--pillar-rest); }
.pill-chip--soft { border-color: transparent; background: rgba(255, 255, 255, 0.08); }

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  width: max-content;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.3;
}

.status-chip .ui-icon { width: 14px; height: 14px; }
.status-chip--good { color: #4ade80; background: rgba(34, 197, 94, 0.14); }
.status-chip--warn { color: #fbbf24; background: rgba(234, 179, 8, 0.14); }
.status-chip--muted { color: var(--text-secondary); background: rgba(255, 255, 255, 0.06); }
.status-chip--rest { color: var(--pillar-rest); background: rgba(45, 212, 191, 0.14); }

.meter {
  --tone: var(--fire-orange);
  position: relative;
  display: block;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.meter > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--tone);
  transition: width 700ms var(--ease-out);
}

.meter--fire > span { background: linear-gradient(90deg, var(--fire-yellow), var(--fire-orange), var(--fire-red)); }
.meter--workout { --tone: var(--pillar-workout); }
.meter--diet, .meter--in { --tone: var(--pillar-diet); }
.meter--sleep { --tone: var(--pillar-sleep); }
.meter--out { --tone: var(--fire-orange); }

.sub-label {
  margin: 1rem 0 0.5rem;
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.section-bar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0.25rem 0 0.75rem;
}

.section-bar-accent {
  width: 4px;
  height: 20px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--fire-yellow), var(--fire-orange), var(--fire-red));
}

.section-bar-title {
  flex: 1;
  min-width: 0;
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 800;
  font-style: italic;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------------------------------------------------------------- home */

.home-tab {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 980px;
  margin: 0 auto 1.5rem;
}

.home-hero {
  padding: 1.25rem 1.25rem 1rem;
}

.home-hero-top {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.home-hero-text { flex: 1; min-width: 0; }

.home-hero-date {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fire-yellow);
}

.home-hero-greeting {
  margin: 0.15rem 0 0.25rem;
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 5vw, 2.4rem);
  font-weight: 800;
  font-style: italic;
  line-height: 1.05;
  letter-spacing: 0.01em;
}

.home-hero-motto {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.9375rem;
  font-weight: 500;
}

.home-flames {
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.home-flame-row {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.home-flame {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  color: rgba(255, 255, 255, 0.16);
}

.home-flame .ui-icon { width: 24px; height: 24px; }

.home-flame.is-lit { color: var(--fire-orange); }
.home-flame.is-lit .ui-icon { filter: drop-shadow(0 0 8px rgba(251, 146, 60, 0.6)); }
.home-flame.is-today .ui-icon { animation: flame-pulse 1.8s ease-in-out infinite; }

.home-flame-day {
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: capitalize;
}

.home-flame.is-today .home-flame-day { color: var(--fire-yellow); }

@keyframes flame-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.18); }
}

.home-flames-caption {
  margin: 0.6rem 0 0;
  text-align: center;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.home-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}

@media (min-width: 860px) {
  .home-grid { grid-template-columns: 1.25fr 1fr; align-items: start; }
  .home-card--workout { grid-row: span 2; }
}

.home-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.1rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: linear-gradient(180deg, color-mix(in srgb, var(--tone, var(--fire-orange)) 9%, transparent), transparent 55%), var(--surface);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

.home-card--workout { --tone: var(--pillar-workout); }
.home-card--tasks { --tone: var(--fire-yellow); }
.home-card--energy { --tone: var(--fire-red); }
.home-card--sleep { --tone: var(--pillar-sleep); }
.home-card--rest { --tone: var(--pillar-rest); }

.home-card-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.home-card-head h2 {
  flex: 1;
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.home-card-icon { width: 20px; height: 20px; color: var(--tone); }

.home-card-meta {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--text);
}

.home-workout-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1.1;
}

.home-exercises {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.home-exercise {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-height: 44px;
  padding: 0.25rem 0.25rem 0.25rem 0.5rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
}

.home-exercise-num {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  border-radius: 8px;
  background: rgba(251, 146, 60, 0.16);
  color: var(--fire-orange);
  font-size: 0.8125rem;
  font-weight: 800;
}

.home-exercise-name { flex: 1; min-width: 0; font-size: 0.9375rem; font-weight: 500; }

.home-exercise-play {
  border-radius: 50%;
  color: var(--fire-orange);
  border-color: rgba(251, 146, 60, 0.35);
}

.home-exercise-play:hover { color: #fff; background: linear-gradient(135deg, var(--cta-from), var(--cta-to)); }
.home-exercise-play svg { width: 16px; height: 16px; }

.home-more { margin: 0; font-size: 0.8125rem; color: var(--text-secondary); font-weight: 600; }

.home-rest h3 {
  margin: 0 0 0.35rem;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--pillar-rest);
}

.home-rest p { margin: 0; color: var(--text-secondary); }

.home-task-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.home-task {
  --tone: var(--fire-orange);
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  min-height: 48px;
  padding: 0.5rem 0.65rem;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: background var(--dur-fast) ease, border-color var(--dur-fast) ease;
}

.home-task--workout { --tone: var(--pillar-workout); }
.home-task--diet { --tone: var(--pillar-diet); }
.home-task--sleep { --tone: var(--pillar-sleep); }

.home-task:hover { border-color: color-mix(in srgb, var(--tone) 45%, transparent); background: color-mix(in srgb, var(--tone) 8%, transparent); }

.home-task-check {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.22);
  color: #0c0f14;
}

.home-task-check svg { width: 14px; height: 14px; stroke-width: 3; }

.home-task.is-done .home-task-check { border-color: var(--tone); background: var(--tone); }
.home-task.is-done .home-task-label { color: var(--text-secondary); text-decoration: line-through; text-decoration-color: rgba(255, 255, 255, 0.3); }
.home-task-icon { color: var(--tone); }
.home-task-label { flex: 1; min-width: 0; }
.home-task-chevron { width: 18px; height: 18px; color: var(--text-secondary); }

.energy-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.3rem 0.75rem;
  align-items: baseline;
  width: 100%;
  padding: 0.6rem 0.7rem;
  border-radius: 14px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color var(--dur-fast) ease;
}

.energy-row:hover { border-color: rgba(255, 255, 255, 0.12); }
.energy-row .meter { grid-column: 1 / -1; }
.energy-label { font-size: 0.8125rem; font-weight: 700; color: var(--text-secondary); }

.energy-value {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.energy-value small { font-family: "DM Sans", sans-serif; font-size: 0.75rem; color: var(--text-secondary); font-weight: 600; }
.energy-value--in { color: var(--pillar-diet); }
.energy-value--out { color: var(--fire-orange); }
.energy-sub { grid-column: 1 / -1; font-size: 0.75rem; color: var(--text-secondary); }

.home-sleep-target {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 800;
}

.home-sleep-target .ui-icon { color: var(--pillar-sleep); }

.home-countdown,
.home-sleep-logged {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.home-countdown.is-now { color: var(--pillar-sleep); animation: flame-pulse 2s ease-in-out infinite; }

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
  padding: 2.5rem 1.5rem;
  text-align: center;
}

.empty-state-icon { width: 44px; height: 44px; color: var(--fire-orange); }

/* ---------------------------------------------------------------- overall */

.overall-tab .week-nav-wrap { margin-bottom: 0.5rem; }

.week-hero {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.1rem;
}

.week-hero-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.week-hero-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: -0.4rem -0.4rem -0.2rem 0;
}

.week-hero-head .icon-btn { border-color: transparent; background: transparent; }

.week-hero-verdict {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--text-secondary);
}

.week-hero-hint { margin: 0.15rem 0 0; font-size: 0.8125rem; color: var(--text-secondary); }

.pillar-tiles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
}

.pillar-tile {
  --tone: var(--pillar-workout);
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  min-width: 0;
  padding: 0.75rem;
  border-radius: 16px;
  border: 1px solid color-mix(in srgb, var(--tone) 32%, transparent);
  background: linear-gradient(180deg, color-mix(in srgb, var(--tone) 16%, transparent), var(--surface-2));
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform var(--dur-fast) ease, border-color var(--dur-fast) ease;
}

.pillar-tile:hover { border-color: color-mix(in srgb, var(--tone) 60%, transparent); }
.pillar-tile:active { transform: scale(0.98); }
.pillar-tile--diet { --tone: var(--pillar-diet); }
.pillar-tile--sleep { --tone: var(--pillar-sleep); }

.pillar-tile-head {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--tone);
}

.pillar-tile-icon { width: 16px; height: 16px; }

.pillar-tile-value {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}

.pillar-tile-value strong {
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.pillar-tile-value small { font-size: 0.6875rem; font-weight: 600; color: var(--text-secondary); }
.pillar-tile .meter { --tone: inherit; }
.pillar-tile .meter > span { background: var(--tone); }

.pillar-tile-caption { font-size: 0.75rem; font-weight: 600; color: var(--text-secondary); }
.pillar-tile-caption.is-action { color: var(--tone); }

.overall-chart-card {
  padding: 0.5rem 0.25rem 0;
}

@media (max-width: 420px) {
  .week-hero { flex-direction: column; text-align: center; }
  .week-hero-body { align-items: center; }
  .week-hero-head { margin: 0; width: 100%; justify-content: center; position: relative; }
  .week-hero-head .icon-btn { position: absolute; right: -0.5rem; top: -0.75rem; }
  .pillar-tile { padding: 0.6rem; }
  .pillar-tile-value strong { font-size: 1.35rem; }
}

/* ---------------------------------------------------------------- pillar hero */

.pillar-hero {
  --tone: var(--pillar-workout);
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  margin: 0.25rem 0 1rem;
  padding: 1.1rem;
  border-radius: var(--radius-lg);
  border: 1px solid color-mix(in srgb, var(--tone) 32%, transparent);
  background:
    radial-gradient(120% 90% at 100% 0%, color-mix(in srgb, var(--tone) 20%, transparent), transparent 60%),
    var(--surface);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
}

.pillar-hero--diet { --tone: var(--pillar-diet); }
.pillar-hero--sleep { --tone: var(--pillar-sleep); }

.pillar-hero-main {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.pillar-hero-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.pillar-hero-eyebrow {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 0.6rem;
  margin: 0;
}

.pillar-hero-eyebrow > span:first-child {
  font-family: var(--font-display);
  font-size: 0.9375rem;
  font-weight: 800;
  font-style: italic;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--tone);
}

.pillar-hero-date { font-size: 0.8125rem; font-weight: 600; color: var(--text-secondary); }

.pillar-hero-headline {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 4.5vw, 2rem);
  font-weight: 800;
  line-height: 1.08;
  overflow-wrap: anywhere;
}

.pillar-hero-support { margin: 0; font-size: 0.875rem; color: var(--text-secondary); font-weight: 500; }

.quick-chips {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.4rem;
}

.quick-chip {
  min-height: 44px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: background var(--dur-fast) ease, border-color var(--dur-fast) ease, color var(--dur-fast) ease;
}

.quick-chip:hover { border-color: rgba(251, 146, 60, 0.45); }

.quick-chip.is-active {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, var(--cta-from), var(--cta-to));
}

.stat-tiles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
}

.stat-tile {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding: 0.65rem 0.8rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
}

.stat-tile--accent { border-color: rgba(251, 146, 60, 0.3); background: rgba(251, 146, 60, 0.07); }

.stat-tile-label {
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.stat-tile strong {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.stat-tile small { font-family: "DM Sans", sans-serif; font-size: 0.75rem; color: var(--text-secondary); font-weight: 600; }

.accent-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 44px;
  margin-top: 0.75rem;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(251, 146, 60, 0.4);
  background: rgba(251, 146, 60, 0.1);
  color: #fdba74;
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--dur-fast) ease;
}

.accent-pill-btn:hover { background: rgba(251, 146, 60, 0.18); }
.accent-pill-btn svg { width: 16px; height: 16px; }

.hero-eval-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.hero-eval-list li {
  position: relative;
  padding: 0.5rem 0.7rem 0.5rem 1.8rem;
  border-radius: 12px;
  background: rgba(52, 211, 153, 0.07);
  font-size: 0.875rem;
  line-height: 1.4;
}

.hero-eval-list li::before {
  content: "";
  position: absolute;
  left: 0.75rem;
  top: 0.95rem;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--pillar-diet);
}

.macro-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 0.4rem;
}

.macro-tile {
  --tone: var(--text-secondary);
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding: 0.55rem 0.65rem;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--tone) 35%, transparent);
  background: color-mix(in srgb, var(--tone) 8%, transparent);
}

.macro-tile--good { --tone: #4ade80; }
.macro-tile--warn { --tone: #fbbf24; }
.macro-tile--poor { --tone: #f87171; }

.macro-tile-label {
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--tone);
}

.macro-tile strong { font-size: 0.9375rem; font-weight: 700; text-transform: capitalize; }

.hero-disclosure { display: flex; flex-direction: column; gap: 0.35rem; }
.hero-disclosure .link-btn { align-self: flex-start; padding-left: 0; color: var(--pillar-diet); }

.meal-kcal-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.meal-kcal-list li {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.45rem 0.65rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  font-size: 0.875rem;
}

.meal-kcal-list strong { white-space: nowrap; color: var(--pillar-diet); }

.sleep-eval {
  --tone: #fbbf24;
  display: flex;
  gap: 0.65rem;
  padding: 0.75rem 0.85rem;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--tone) 40%, transparent);
  background: color-mix(in srgb, var(--tone) 10%, transparent);
}

.sleep-eval--good { --tone: #4ade80; }
.sleep-eval--poor { --tone: #f87171; }
.sleep-eval-icon { width: 22px; height: 22px; color: var(--tone); margin-top: 1px; }
.sleep-eval strong { display: block; font-size: 0.9375rem; color: var(--tone); }
.sleep-eval p { margin: 0.15rem 0 0; font-size: 0.8125rem; color: var(--text-secondary); line-height: 1.4; }

.workout-rest-card { margin-top: 0; }

@media (max-width: 480px) {
  .pillar-hero-main { align-items: flex-start; }
  .pillar-hero .hero-ring--drag { --ring-size: 112px !important; width: 112px; height: 112px; }
}

/* ---------------------------------------------------------------- plan hero + verdict */

.plan-hero {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  margin-bottom: 1rem;
  padding: 1.1rem;
}

.plan-hero-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.plan-hero-head .eyebrow {
  flex: 1;
  font-family: var(--font-display);
  font-size: 0.9375rem;
  font-style: italic;
}

.plan-hero-head .icon-btn { border-color: transparent; background: rgba(255, 255, 255, 0.05); }

.journey-row {
  --tone: var(--fire-orange);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 0.4rem;
}

.journey-row--fat { --tone: var(--body-fat); }

.journey-end {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
  padding: 0.7rem 0.4rem;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.05);
  text-align: center;
  min-width: 0;
}

.journey-end.is-goal {
  border-color: color-mix(in srgb, var(--tone) 45%, transparent);
  background: color-mix(in srgb, var(--tone) 12%, transparent);
}

.journey-label {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.journey-end.is-goal .journey-label { color: var(--tone); }

.journey-value strong {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.journey-row--fat .journey-value strong { font-size: 1.5rem; }
.journey-value small { margin-left: 0.15rem; font-size: 0.8125rem; font-weight: 700; color: var(--text-secondary); }
.journey-value em { font-style: normal; font-size: 0.9375rem; font-weight: 700; color: var(--text-secondary); }

.journey-arrow {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  min-width: 64px;
  color: var(--tone);
}

.journey-delta {
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--tone), color-mix(in srgb, var(--tone) 50%, #ef4444));
  color: #fff;
  font-size: 0.75rem;
  font-weight: 800;
  white-space: nowrap;
}

.journey-row--fat .journey-delta { background: linear-gradient(90deg, var(--body-fat), #3b82f6); }

.plan-week-progress p { margin: 0 0 0.35rem; font-size: 0.8125rem; font-weight: 700; }
.plan-week-progress .meter { height: 8px; }

.plan-verdict-card { padding: 1rem; }

.insight-tiles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
}

@media (min-width: 720px) {
  .insight-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.insight-tile {
  --tone: var(--fire-orange);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
  padding: 0.8rem;
  border-radius: 16px;
  border: 1px solid color-mix(in srgb, var(--tone) 28%, transparent);
  background: linear-gradient(160deg, color-mix(in srgb, var(--tone) 14%, transparent), transparent 70%), var(--surface-2);
}

.insight-tile--orange { --tone: var(--fire-orange); }
.insight-tile--cyan { --tone: var(--body-fat); }
.insight-tile--teal { --tone: var(--pillar-rest); }
.insight-tile--red { --tone: var(--fire-red); }
.insight-tile--yellow { --tone: var(--fire-yellow); }
.insight-tile--fire { --tone: #fdba74; }
.insight-tile--diet { --tone: var(--pillar-diet); }

.insight-tile-icon { display: inline-flex; width: 22px; height: 22px; color: var(--tone); }
.insight-tile-icon svg { width: 100%; height: 100%; }

.insight-tile-value {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.insight-tile-label { font-size: 0.75rem; font-weight: 600; color: var(--text-secondary); }

.pace-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  width: max-content;
  margin-top: 0.15rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 800;
}

.pace-badge .ui-icon { width: 12px; height: 12px; }
.pace-badge--safe { color: #4ade80; background: rgba(34, 197, 94, 0.14); }
.pace-badge--fast { color: #fbbf24; background: rgba(234, 179, 8, 0.16); }

.plan-details-toggle { display: flex; margin: 0.5rem auto 0; }
.plan-verdict-details { margin-top: 0.75rem; padding-top: 0.75rem; border-top: 1px solid var(--border); }

.alert-banner {
  display: flex;
  gap: 0.85rem;
  margin-bottom: 1rem;
  padding: 1rem;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(234, 179, 8, 0.45);
  background: linear-gradient(135deg, rgba(234, 179, 8, 0.14), rgba(239, 68, 68, 0.08));
}

.alert-banner-icon { width: 28px; height: 28px; color: var(--fire-yellow); }
.alert-banner-body { display: flex; flex-direction: column; gap: 0.4rem; align-items: flex-start; }
.alert-banner h2 { margin: 0; font-family: var(--font-display); font-size: 1.35rem; font-weight: 800; }
.alert-banner p { margin: 0; color: var(--text-secondary); font-size: 0.9375rem; }

.locked-card {
  display: flex;
  gap: 0.85rem;
  align-items: center;
  margin-bottom: 1rem;
  padding: 1rem;
  border-radius: var(--radius-lg);
  border: 1px dashed rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.02);
}

.locked-card-icon { width: 26px; height: 26px; color: var(--text-secondary); }
.locked-card h3 { margin: 0 0 0.15rem; font-size: 1rem; }
.locked-card p { margin: 0; color: var(--text-secondary); font-size: 0.875rem; }

/* ---------------------------------------------------------------- goal inputs */

.intensity-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
}

.intensity-option {
  --tone: var(--fire-orange);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  min-height: 88px;
  padding: 0.75rem;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color var(--dur-fast) ease, background var(--dur-fast) ease;
}

.intensity-option--chill { --tone: var(--pillar-rest); }
.intensity-option--moderate { --tone: var(--fire-yellow); }
.intensity-option--high { --tone: var(--fire-orange); }
.intensity-option--extreme { --tone: var(--fire-red); }

.intensity-option:hover { border-color: color-mix(in srgb, var(--tone) 50%, transparent); }

.intensity-option[aria-checked="true"] {
  border-color: var(--tone);
  background: color-mix(in srgb, var(--tone) 13%, transparent);
  box-shadow: inset 0 0 0 1px var(--tone);
}

.intensity-bolts { display: inline-flex; color: var(--tone); }
.intensity-bolts svg { width: 16px; height: 16px; margin-right: -3px; }
.intensity-option strong { font-size: 0.9375rem; }
.intensity-option small { font-size: 0.75rem; color: var(--text-secondary); line-height: 1.35; }

.target-shape-summary {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.target-shape-end {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  padding: 0.5rem 0.7rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
}

.target-shape-end.is-goal { border-color: rgba(45, 212, 191, 0.45); background: rgba(45, 212, 191, 0.08); }
.target-shape-end small { font-size: 0.6875rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-secondary); }
.target-shape-end strong { font-size: 0.9375rem; }
.target-shape-arrow { display: inline-flex; width: 20px; height: 20px; color: var(--pillar-rest); }
.target-shape-arrow svg { width: 100%; height: 100%; }

/* ---------------------------------------------------------------- plan generating */

.plan-gen {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  overflow: auto;
  padding: 2rem 1.25rem;
  background:
    radial-gradient(70% 50% at 50% 20%, rgba(234, 88, 12, 0.28), transparent 70%),
    radial-gradient(60% 40% at 50% 100%, rgba(124, 45, 18, 0.45), transparent 70%),
    #0b0d12;
  animation: plan-gen-in 320ms var(--ease-out);
}

.plan-gen .ember-field { z-index: 0; }

@keyframes plan-gen-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.plan-gen-close {
  position: absolute;
  top: max(1rem, env(safe-area-inset-top));
  right: 1rem;
  z-index: 2;
  border-radius: 50%;
}

.plan-gen-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
  width: 100%;
  max-width: 440px;
  text-align: center;
}

.plan-gen-orb {
  position: relative;
  display: grid;
  place-items: center;
  width: 112px;
  height: 112px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 60%, rgba(251, 146, 60, 0.35), rgba(124, 45, 18, 0.2) 60%, transparent 72%);
  color: var(--fire-orange);
}

.plan-gen-orb svg { width: 52px; height: 52px; filter: drop-shadow(0 0 16px rgba(251, 146, 60, 0.75)); animation: flame-pulse 1.6s ease-in-out infinite; }

.plan-gen-orb-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px solid transparent;
  border-top-color: var(--fire-yellow);
  border-right-color: var(--fire-orange);
  animation: spin 1.4s linear infinite;
}

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

.plan-gen h2 {
  margin: 0.25rem 0 0;
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 6vw, 2.4rem);
  font-weight: 800;
  font-style: italic;
  line-height: 1.05;
}

.plan-gen-sub { margin: 0; color: var(--text-secondary); }

.plan-gen-steps {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  width: 100%;
  margin: 0.5rem 0 0;
  padding: 0;
  list-style: none;
  text-align: left;
}

.plan-gen-steps li {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.75rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  font-size: 0.9375rem;
  font-weight: 600;
  opacity: 0.45;
  animation: plan-gen-step 0.5s var(--ease-out) forwards;
  animation-delay: calc(var(--step) * 2.4s);
}

.plan-gen-step-dot {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.2);
  color: transparent;
  animation: plan-gen-dot 0.5s var(--ease-out) forwards;
  animation-delay: calc(var(--step) * 2.4s + 2s);
}

.plan-gen-step-dot svg { width: 13px; height: 13px; stroke-width: 3; }

@keyframes plan-gen-step {
  to { opacity: 1; color: var(--text); background: rgba(251, 146, 60, 0.1); }
}

@keyframes plan-gen-dot {
  to { border-color: transparent; background: linear-gradient(135deg, var(--cta-from), var(--cta-to)); color: #fff; }
}

.plan-gen-perks {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.4rem;
  width: 100%;
  margin: 0.5rem 0 0;
  padding: 0;
  list-style: none;
}

.plan-gen-perks li {
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
  padding: 0.55rem 0.6rem;
  border-radius: 12px;
  border: 1px solid rgba(251, 146, 60, 0.18);
  background: rgba(251, 146, 60, 0.05);
  font-size: 0.8125rem;
  text-align: left;
  line-height: 1.35;
}

.plan-gen-perks .ui-icon { width: 16px; height: 16px; color: var(--fire-orange); margin-top: 1px; }

/* ---------------------------------------------------------------- layout tweaks */

.workout-app.is-home-tab .app-body-scroll { padding-top: 0.75rem; }

.overall-tab,
.app-main--home {
  max-width: 980px;
  margin-inline: auto;
}

@media (max-width: 480px) {
  .app-panel { padding-inline: 0.85rem; }
  .home-hero { padding: 1rem; }
  .journey-arrow { min-width: 52px; }
  .journey-value strong { font-size: 1.6rem; }
}

/* ---------------------------------------------------------------- reduced motion */

@media (prefers-reduced-motion: reduce) {
  .ember-field,
  .plan-gen-orb-ring { display: none; }

  .tab-enter,
  .plan-gen,
  .home-flame.is-today .ui-icon,
  .home-countdown.is-now,
  .plan-gen-orb svg,
  .daily-subtab.coach-highlight { animation: none; }

  .plan-gen-steps li { animation: none; opacity: 1; color: var(--text); }
  .plan-gen-step-dot { animation: none; }
  .hero-ring-value,
  .meter > span { transition: none; }
  .input-page,
  .onboarding-backdrop,
  .onboarding-copy { animation: none; }
}

/* Plan day intake target — food tone so it is not read as workout burn. */
.meta-chip--intake { color: var(--pillar-diet); border-color: color-mix(in srgb, var(--pillar-diet) 40%, transparent); }

/* ---------------------------------------------------------------- plan input wizard (native ProfileStep / GoalStep) */

.input-wizard {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
  max-width: 640px;
  margin-inline: auto;
}

.input-step-indicator { display: flex; flex-direction: column; gap: 6px; }
.input-step-segs { display: flex; gap: 4px; }
.input-step-seg {
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: var(--border);
  transition: background-color var(--dur-fast) var(--ease-out);
}
.input-step-seg.is-done { background: var(--app-primary); }
.input-step-label { font-size: 0.75rem; color: var(--text-secondary); }

.input-page.is-entering { animation: input-page-in-fwd 280ms var(--ease-out) both; }
.input-page.is-entering.input-page--back { animation-name: input-page-in-back; }
@keyframes input-page-in-fwd { from { opacity: 0; transform: translateX(24px); } }
@keyframes input-page-in-back { from { opacity: 0; transform: translateX(-24px); } }

.input-page-card { margin: 0; }

.input-page-actions { display: flex; gap: 12px; }
.input-page-actions .btn { min-height: 48px; margin: 0; }
.input-page-actions .input-action-back { flex: 1; }
.input-page-actions .input-action-next { flex: 1.5; }
.input-page-actions.is-single .input-action-next { flex: 1; }

/* Web mode — wide wizard on desktop: short fields pair up, body shapes become a full grid. */
@media (min-width: 900px) {
  .input-wizard { max-width: 960px; gap: 1.25rem; }
  .input-page-card {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 2.5rem;
    row-gap: 0.25rem;
    align-items: center;
    padding: 2rem 2.25rem;
  }
  .input-page-card > * { grid-column: 1 / -1; }
  .input-page-card > .metric-picker,
  .input-page-card > .field:has(> input:not([type="range"])) { grid-column: auto; }
  .input-page-card > h2 { font-size: 1.375rem; margin-bottom: 0.25rem; }
  .input-page-card > .input-page-intro { margin-bottom: 1.25rem; }
  .input-page-card .chip-row { gap: 0.5rem; }
  .input-page-card .chip { min-height: 40px; padding-inline: 1.1rem; }
  .input-page-card textarea { min-height: 6rem; }

  .input-page-card .body-shape-row {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 0.75rem;
    overflow: visible;
  }
  .input-page-card .body-shape-card { padding: 0.5rem 0.5rem 0.75rem; }
  .input-page-card .body-shape-card.is-selected { padding: calc(0.5rem - 1px) calc(0.5rem - 1px) calc(0.75rem - 1px); }
  .input-page-card .body-shape-label { font-size: 0.875rem; }
  .input-page-card .body-stats-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }

  .input-page-actions { justify-content: flex-end; }
  .input-page-actions .btn { flex: 0 0 auto; min-width: 11rem; }
  .input-page-actions.is-single .input-action-next { flex: 0 0 auto; }
}

/* Native MetricSlider value pill — label left, tappable value right (select = number wheel on iOS). */
.metric-picker {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  margin-bottom: 0.6rem;
}
.metric-picker-label { font-size: 0.8125rem; font-weight: 500; color: var(--text-secondary); }
.metric-picker-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  border-radius: 10px;
  background: var(--app-box-bg-alt);
  border: 1px solid var(--border);
  color: var(--app-primary);
  transition: border-color var(--dur-fast) var(--ease-out);
}
.metric-picker-pill:hover,
.metric-picker-pill:focus-within { border-color: var(--app-primary-border); }
.metric-picker-pill select {
  appearance: none;
  -webkit-appearance: none;
  min-height: 40px;
  padding: 0 34px 0 14px;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}
.metric-picker-pill.is-empty select { color: var(--text-secondary); }
.metric-picker-pill select:focus-visible { outline: none; }
.metric-picker-pill:focus-within { box-shadow: var(--focus-ring); }
.metric-picker-pill select option { color: #0c0f14; }
.metric-picker-icon { position: absolute; right: 10px; pointer-events: none; }

/* ---------------------------------------------------------------- first-run onboarding (native AppOnboardingFlow, photo mode) */

.onboarding-root { min-height: 100dvh; }

.onboarding {
  position: fixed;
  inset: 0;
  z-index: 60;
  overflow: hidden;
  background: #000;
  color: #fff;
}

.onboarding-backdrops { position: absolute; inset: 0; }
.onboarding-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  opacity: 0;
  transition: opacity 420ms var(--ease-out);
}
.onboarding-backdrop.is-active {
  opacity: 1;
  animation: onboarding-zoom 12s linear infinite alternate;
}
@keyframes onboarding-zoom { to { transform: scale(1.08); } }

.onboarding-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.5) 0%, transparent 14%, transparent 40%, rgba(0, 0, 0, 0.88) 66%, #000 100%);
}
.onboarding-scrim--strong {
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.55) 0%, rgba(0, 0, 0, 0.72) 35%, rgba(0, 0, 0, 0.94) 100%);
}

.onboarding-body {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  max-width: 520px;
  margin-inline: auto;
  padding: max(env(safe-area-inset-top), 0px) 20px max(env(safe-area-inset-bottom), 16px);
}

.onboarding-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  flex-shrink: 0;
}

.ob-quiet,
.ob-icon-btn {
  min-height: 48px;
  min-width: 48px;
  padding: 0 12px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: rgba(255, 255, 255, 0.72);
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
  transition: color var(--dur-fast) var(--ease-out), background-color var(--dur-fast) var(--ease-out);
}
.ob-icon-btn { display: inline-flex; align-items: center; justify-content: center; padding: 0; color: #fff; }
.ob-quiet:hover,
.ob-icon-btn:hover { color: #fff; background: rgba(255, 255, 255, 0.08); }
.ob-quiet:focus-visible,
.ob-icon-btn:focus-visible,
.ob-cta:focus-visible,
.ob-choice:focus-visible { outline: 2px solid #fdba74; outline-offset: 2px; }

.onboarding-copy {
  margin-top: auto;
  padding-bottom: 28px;
  animation: onboarding-copy-in-fwd 420ms var(--ease-out) both;
}
.onboarding-copy--back { animation-name: onboarding-copy-in-back; }
@keyframes onboarding-copy-in-fwd { from { opacity: 0.35; transform: translate(24px, 28px); } }
@keyframes onboarding-copy-in-back { from { opacity: 0.35; transform: translate(-24px, 28px); } }

.ob-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 6vw, 2.125rem);
  line-height: 1.18;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 0 28px rgba(251, 146, 60, 0.6);
  text-wrap: balance;
}
.ob-title--survey { font-size: clamp(1.7rem, 5.5vw, 1.875rem); }
.ob-accent { color: #fdba74; }
.ob-body {
  margin: 12px 0 0;
  font-size: 1rem;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.84);
}

.ob-dots { display: flex; justify-content: center; gap: 8px; margin-bottom: 20px; }
.ob-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.32);
  transition: width var(--dur-fast) var(--ease-out), background-color var(--dur-fast) var(--ease-out);
}
.ob-dot.is-active { width: 24px; background: var(--app-primary); }

.ob-cta {
  flex-shrink: 0;
  width: 100%;
  min-height: 54px;
  border: 0;
  border-radius: 16px;
  background: linear-gradient(90deg, #fb923c, #ef4444);
  box-shadow: 0 10px 30px -8px rgba(239, 68, 68, 0.6);
  color: #fff;
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform var(--dur-fast) var(--ease-out), opacity var(--dur-fast) var(--ease-out);
}
.ob-cta:active { transform: scale(0.98); }
.ob-cta:disabled { background: var(--app-box-bg-alt); box-shadow: none; color: var(--text-secondary); cursor: default; }

.onboarding-survey-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-bottom: 12px;
}
.ob-flag { color: #fdba74; display: inline-flex; }
.ob-subtitle { margin: 0; font-size: 0.9375rem; line-height: 1.4; color: rgba(255, 255, 255, 0.72); }
.ob-question { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.ob-question-title { margin: 0; font-size: 1rem; font-weight: 600; color: #fff; }
.ob-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.ob-choice {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 52px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid #354a62;
  background: rgba(20, 26, 34, 0.55);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: #fff;
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 500;
  text-align: center;
  cursor: pointer;
  transition: border-color 160ms var(--ease-out), background-color 160ms var(--ease-out);
}
.ob-choice .ob-icon { color: rgba(255, 255, 255, 0.6); flex-shrink: 0; }
.ob-choice.is-selected {
  border: 1.5px solid #fdba74;
  background: rgba(42, 32, 25, 0.85);
  font-weight: 600;
}
.ob-choice.is-selected .ob-icon { color: #fdba74; }
.ob-hint { margin: 0; font-size: 0.8125rem; color: rgba(255, 255, 255, 0.72); }
.ob-note {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-radius: 16px;
  background: rgba(251, 146, 60, 0.22);
  font-size: 0.875rem;
  color: #fff;
}
.ob-note .ob-icon { color: #fdba74; flex-shrink: 0; }

/* ---------------------------------------------------------------- brand → homepage link */

.app-home-link {
  color: inherit;
  text-decoration: none;
  border-radius: 14px;
  transition: opacity var(--dur-fast) var(--ease-out);
}
.app-home-link:hover { opacity: 0.85; }

/* ---------------------------------------------------------------- company footer (shared renderCompanyFooter, Photo parity) */
.workout-app .company-footer {
  --glass: rgba(12, 15, 20, 0.86);
  --accent-soft: rgba(251, 146, 60, 0.14);
  --accent-border: rgba(251, 146, 60, 0.42);
  --accent-text: #fdba74;
  --cta-glow: rgba(239, 68, 68, 0.28);
  --focus-ring: #fb923c;
  --grad-text: linear-gradient(120deg, #fdba74, #f87171);
  --gutter: 1.5rem;
  margin: 3rem calc(50% - 50vw) 0;
  padding-inline: max(var(--gutter), calc(50vw - var(--page-max, 1120px) / 2 + var(--gutter)));
}
.workout-app.page { overflow-x: clip; }
.workout-app.page-shell .app-body-scroll { display: flex; flex-direction: column; }
.workout-app.page-shell .app-panel-wrap { flex: 0 0 auto; }
.workout-app.page-shell .company-footer { margin-top: auto; }
.workout-app .company-footer::before {
  background: linear-gradient(90deg, transparent, rgba(251, 146, 60, 0.5) 20%, rgba(239, 68, 68, 0.45) 80%, transparent);
}
@media (max-width: 560px) {
  .workout-app .company-footer { --gutter: 0.85rem; }
}
