:root {
  color-scheme: light;
  --bg: #eef1ed;
  --bg-elevated: rgba(255, 255, 255, 0.78);
  --panel: rgba(255, 255, 255, 0.66);
  --panel-strong: #ffffff;
  --panel-soft: rgba(19, 22, 20, 0.045);
  --text: #151715;
  --muted: #727972;
  --faint: #a3aaa3;
  --line: rgba(16, 20, 17, 0.1);
  --orange: #ff641f;
  --orange-dark: #d9480b;
  --green: #52bd00;
  --green-soft: rgba(82, 189, 0, 0.13);
  --danger: #ee493c;
  --shadow: 0 22px 70px rgba(22, 25, 23, 0.13);
  --nav-bg: rgba(248, 250, 247, 0.84);
  --blur: blur(20px) saturate(140%);
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b0d0c;
  --bg-elevated: rgba(25, 28, 26, 0.78);
  --panel: rgba(27, 30, 28, 0.67);
  --panel-strong: #181b19;
  --panel-soft: rgba(255, 255, 255, 0.045);
  --text: #f4f6f2;
  --muted: #989f98;
  --faint: #676d68;
  --line: rgba(255, 255, 255, 0.09);
  --orange: #ff681f;
  --orange-dark: #ff4d00;
  --green: #8cff18;
  --green-soft: rgba(140, 255, 24, 0.12);
  --danger: #ff6257;
  --shadow: 0 28px 90px rgba(0, 0, 0, 0.42);
  --nav-bg: rgba(14, 16, 15, 0.84);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: #daddd9;
  font-family: "Manrope", system-ui, sans-serif;
  letter-spacing: 0;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  color: var(--text);
}

button,
input,
textarea {
  color: inherit;
  font: inherit;
  letter-spacing: 0;
}

button {
  border: 0;
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 2px;
}

.viewport {
  display: grid;
  width: 100%;
  min-height: var(--app-height, 100dvh);
  overflow-x: hidden;
  place-items: center;
  background:
    radial-gradient(circle at 18% 20%, rgba(255, 104, 31, 0.11), transparent 27%),
    linear-gradient(145deg, #eef0ed 0%, #d8ddd8 100%);
}

html[data-theme="dark"] .viewport {
  background:
    radial-gradient(circle at 20% 12%, rgba(255, 104, 31, 0.09), transparent 26%),
    linear-gradient(145deg, #111311 0%, #050605 100%);
}

.app-shell {
  position: relative;
  width: min(100%, 430px);
  min-width: 0;
  max-width: 100vw;
  height: min(920px, var(--app-height, 100dvh));
  overflow: clip;
  background: var(--bg);
  box-shadow: var(--shadow);
  isolation: isolate;
}

.app {
  height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: max(18px, env(safe-area-inset-top)) 18px calc(104px + env(safe-area-inset-bottom));
  scrollbar-width: none;
}

.app::-webkit-scrollbar,
.chat::-webkit-scrollbar {
  display: none;
}

.topbar,
.page-head,
.sub-head,
.onboarding-header,
.bottom-sheet > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.topbar {
  min-height: 58px;
  margin-bottom: 17px;
}

.app.has-subscreen .topbar {
  display: none;
}

.topbar span,
.page-head span,
.bottom-sheet header span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.topbar h1,
.page-head h2,
.sub-head h2,
.bottom-sheet h2 {
  margin: 2px 0 0;
  font-size: 25px;
  line-height: 1.08;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn,
.avatar-btn {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--panel);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
}

.icon-btn svg {
  width: 19px;
}

.avatar-btn {
  overflow: hidden;
  padding: 0;
}

.avatar-btn img,
.profile-row img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.screen {
  display: none;
  animation: screen-in 240ms ease both;
}

.screen.is-active {
  display: block;
}

@keyframes screen-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.workout-hero {
  position: relative;
  min-height: 300px;
  overflow: hidden;
  border-radius: 8px;
  background: #151715;
  color: #fff;
}

.workout-hero > img {
  position: absolute;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 54% 50%;
}

.workout-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(5, 6, 5, 0.08) 5%, rgba(5, 6, 5, 0.16) 40%, rgba(5, 6, 5, 0.88) 100%);
}

.workout-content {
  position: absolute;
  inset: auto 18px 18px;
}

.eyebrow {
  display: inline-flex;
  margin-bottom: 7px;
  color: rgba(255, 255, 255, 0.74);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.workout-content h2 {
  margin: 0;
  font-size: 28px;
  line-height: 1.05;
}

.workout-content p {
  margin: 7px 0 16px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 13px;
}

.btn {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 7px;
  padding: 0 16px;
  font-size: 13px;
  font-weight: 800;
}

.btn svg {
  width: 17px;
}

.btn.primary,
.hero-btn {
  background: var(--orange);
  color: #fff;
}

.btn.primary:hover,
.hero-btn:hover {
  background: var(--orange-dark);
}

.btn.ghost {
  border: 1px solid var(--line);
  background: var(--panel-soft);
}

.btn.full {
  width: 100%;
}

.hero-btn {
  width: 100%;
}

.metric-grid {
  display: grid;
  gap: 8px;
}

.home-metrics,
.stats-metrics,
.recovery-metrics {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 8px;
}

.metric-card {
  min-width: 0;
  min-height: 96px;
  padding: 14px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
}

.metric-card svg {
  width: 17px;
  color: var(--orange);
}

.metric-card b {
  display: block;
  margin-top: 5px;
  font-size: 24px;
  line-height: 1;
}

.metric-card span,
.metric-card small {
  display: block;
  margin-top: 7px;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric-card.accent {
  border-color: rgba(255, 104, 31, 0.35);
  background: linear-gradient(145deg, rgba(255, 104, 31, 0.18), var(--panel));
}

.positive {
  color: var(--green) !important;
}

.danger {
  color: var(--danger) !important;
}

button:disabled,
input:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.warning {
  color: var(--danger) !important;
}

.recovery-preview,
.coach-brief,
.quote,
.profile-row,
.theme-setting,
.list-link {
  width: 100%;
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
}

.recovery-preview {
  display: grid;
  grid-template-columns: 48px 1fr 20px;
  align-items: center;
  gap: 12px;
  padding: 13px;
  text-align: left;
}

.recovery-preview > svg {
  width: 18px;
  color: var(--muted);
}

.mini-score {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 4px solid var(--green);
  border-radius: 50%;
  box-shadow: 0 0 22px var(--green-soft);
}

.mini-score b {
  font-size: 15px;
}

.recovery-preview div:nth-child(2) span,
.recovery-preview div:nth-child(2) small,
.coach-brief span,
.profile-row span,
.theme-setting small,
.menu-list small {
  display: block;
  color: var(--muted);
  font-size: 10px;
}

.recovery-preview div:nth-child(2) b {
  display: block;
  margin: 2px 0 4px;
  font-size: 13px;
}

.coach-brief {
  display: grid;
  grid-template-columns: 42px 1fr 32px;
  align-items: start;
  gap: 11px;
  padding: 14px;
}

.coach-mark,
.ai-orbit {
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 104, 31, 0.17);
  box-shadow: 0 0 30px rgba(255, 104, 31, 0.24);
}

.coach-mark {
  width: 42px;
  height: 42px;
}

.coach-mark img,
.ai-orbit img {
  width: 28px;
  filter: drop-shadow(0 0 8px rgba(255, 104, 31, 0.45));
}

.coach-brief p {
  margin: 5px 0 0;
  font-size: 12px;
  line-height: 1.5;
}

.coach-brief button {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 50%;
  background: var(--panel-soft);
}

.coach-brief button svg {
  width: 16px;
}

.quote {
  position: relative;
  min-height: 94px;
  overflow: hidden;
  margin: 8px 0 0;
  padding: 22px 86px 22px 18px;
}

.quote p {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.35;
}

.quote img {
  position: absolute;
  right: 17px;
  bottom: 10px;
  width: 58px;
  opacity: 0.95;
}

.quote.compact {
  margin: 12px 0 0;
}

.page-head {
  min-height: 52px;
  margin-bottom: 17px;
}

.page-head h2 {
  font-size: 24px;
}

.week-strip,
.date-strip {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
  margin-bottom: 13px;
}

.week-strip button,
.date-strip span {
  display: grid;
  min-width: 0;
  min-height: 51px;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
}

.week-strip button b,
.date-strip small {
  display: block;
  margin-top: 1px;
  color: var(--text);
  font-size: 14px;
}

.week-strip button.is-active,
.date-strip span.is-active {
  border-color: rgba(255, 104, 31, 0.25);
  background: var(--orange);
  color: #fff;
}

.week-strip button.is-active b,
.date-strip span.is-active small {
  color: #fff;
}

.proposal-card,
.chart-panel,
.recovery-score,
.factor-list,
.chat-proposal,
.ai-review {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
}

.proposal-card {
  margin-bottom: 12px;
  padding: 15px;
}

.proposal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.proposal-head span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--orange);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.proposal-head svg {
  width: 15px;
}

.proposal-head small {
  color: var(--muted);
  font-size: 9px;
}

.proposal-card h3,
.chat-proposal h3 {
  margin: 11px 0 6px;
  font-size: 17px;
}

.proposal-card p,
.chat-proposal p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.proposal-diff {
  display: grid;
  grid-template-columns: 1fr 18px 1fr;
  align-items: center;
  gap: 7px;
  margin: 13px 0;
  padding: 10px;
  background: var(--panel-soft);
  font-size: 10px;
  line-height: 1.35;
}

.proposal-diff svg {
  width: 15px;
  color: var(--orange);
}

.button-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  margin-top: 13px;
}

.workout-list {
  display: grid;
  gap: 7px;
}

.workout-item {
  display: grid;
  width: 100%;
  grid-template-columns: 38px 34px minmax(0, 1fr) 26px;
  align-items: center;
  gap: 11px;
  min-height: 72px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  text-align: left;
  transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.workout-item.is-complete {
  border-color: color-mix(in srgb, var(--green) 42%, transparent);
  background: linear-gradient(110deg, var(--green-soft), var(--panel) 55%);
  box-shadow: inset 3px 0 0 var(--green), 0 0 22px var(--green-soft);
}

.workout-item.is-skipped {
  border-color: color-mix(in srgb, var(--danger) 34%, transparent);
  background: color-mix(in srgb, var(--danger) 7%, var(--panel));
  opacity: 0.78;
}

.workout-item.is-skipped .workout-info b {
  text-decoration: line-through;
  text-decoration-color: color-mix(in srgb, var(--danger) 64%, transparent);
}

.workout-item .day {
  color: var(--muted);
  font-size: 9px;
  text-align: center;
  text-transform: uppercase;
}

.workout-item .day b {
  display: block;
  margin-top: 2px;
  color: var(--text);
  font-size: 18px;
}

.workout-info b,
.activity-list b,
.menu-list b,
.profile-row b,
.theme-setting b {
  display: block;
  font-size: 12px;
}

.workout-info small,
.activity-list small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
}

.workout-status {
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
}

.workout-status svg {
  width: 14px;
}

.workout-item.is-complete .workout-status {
  border-color: var(--green);
  background: var(--green);
  color: #0b1208;
  box-shadow: 0 0 14px var(--green-soft);
}

.workout-item.is-skipped .workout-status {
  border-color: var(--danger);
  color: var(--danger);
}

.sport-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
}

.sport-icon svg {
  width: 16px;
}

.sport-icon.run { background: #ff641f; }
.sport-icon.bike { background: #2a71e9; }
.sport-icon.swim { background: #00a5bc; }
.sport-icon.strength { background: #845bd9; }
.sport-icon.mobility { background: #4ca354; }
.sport-icon.rest { background: #777d78; }

.segmented {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-soft);
}

.segmented button {
  min-width: 0;
  min-height: 35px;
  overflow: hidden;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.segmented button.is-active {
  background: var(--panel-strong);
  color: var(--text);
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.08);
}

.filter-row {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  margin: 10px 0 12px;
  scrollbar-width: none;
}

.filter-row button,
.quick-prompts button {
  flex: 0 0 auto;
  min-height: 33px;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 0 14px;
  background: var(--panel);
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.filter-row button.is-active {
  border-color: var(--text);
  background: var(--text);
  color: var(--bg);
}

.stats-metrics .metric-card {
  min-height: 91px;
}

.stats-metrics .metric-card b {
  font-size: 21px;
}

.chart-panel {
  margin-top: 8px;
  padding: 15px 14px 12px;
}

.chart-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
}

.chart-head span {
  color: var(--muted);
  font-size: 10px;
}

.chart-head b {
  display: block;
  margin-top: 3px;
  font-size: 25px;
}

.line-chart {
  width: 100%;
  height: 160px;
  margin-top: 7px;
  overflow: visible;
}

.chart-grid {
  fill: none;
  stroke: var(--line);
  stroke-width: 1;
}

.chart-line {
  fill: none;
  stroke: var(--orange);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3;
  filter: drop-shadow(0 0 7px rgba(255, 104, 31, 0.45));
}

.chart-point {
  fill: var(--panel-strong);
  stroke: var(--orange);
  stroke-width: 2;
}

.chart-axis {
  display: flex;
  justify-content: space-between;
  color: var(--faint);
  font-size: 8px;
}

.insight-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  margin-top: 8px;
}

.insight-grid article {
  min-height: 94px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
}

.insight-grid span,
.insight-grid small {
  display: block;
  color: var(--muted);
  font-size: 10px;
}

.insight-grid b {
  display: block;
  margin: 8px 0 4px;
  font-size: 20px;
}

.list-link {
  display: flex;
  min-height: 54px;
  align-items: center;
  justify-content: space-between;
  padding: 0 15px;
}

.list-link span {
  display: flex;
  align-items: center;
  gap: 10px;
}

.list-link svg {
  width: 18px;
}

.list-link > svg {
  color: var(--muted);
}

.coach-screen {
  min-height: calc(var(--app-height, 100dvh) - 164px);
  padding-bottom: 0;
}

.coach-screen.is-active {
  display: flex;
  flex-direction: column;
}

.coach-title > img {
  width: 42px;
  filter: drop-shadow(0 0 12px rgba(255, 104, 31, 0.45));
}

.coach-title span {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--green);
}

.status-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
}

.chat {
  display: flex;
  min-height: 220px;
  flex-direction: column;
  gap: 9px;
  overflow-y: auto;
  padding-bottom: 8px;
}

.message {
  width: fit-content;
  max-width: 84%;
  padding: 11px 12px 8px;
  border-radius: 8px;
  font-size: 11px;
  line-height: 1.5;
}

.message p {
  margin: 0;
}

.message time {
  display: block;
  margin-top: 4px;
  color: inherit;
  font-size: 8px;
  opacity: 0.57;
  text-align: right;
}

.message.assistant {
  align-self: flex-start;
  border: 1px solid var(--line);
  background: var(--panel);
}

.message.user {
  align-self: flex-end;
  background: var(--orange);
  color: #fff;
}

.message.loading {
  color: var(--muted);
}

.chat-proposal {
  margin-top: 8px;
  padding: 14px;
}

.chat-proposal > span {
  color: var(--orange);
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
}

.quick-prompts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-top: 9px;
}

.quick-prompts button {
  min-width: 0;
  padding-right: 9px;
  padding-left: 9px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quick-prompts button:last-child {
  grid-column: 1 / -1;
}

.composer {
  position: static;
  z-index: 4;
  display: grid;
  grid-template-columns: 1fr 39px;
  gap: 7px;
  margin: auto -4px 0;
  padding: 6px 6px 6px 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--nav-bg);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
}

.composer input {
  min-width: 0;
  border: 0;
  background: transparent;
  font-size: 16px;
  outline: 0;
}

.composer button {
  display: grid;
  width: 39px;
  height: 39px;
  place-items: center;
  border-radius: 6px;
  background: var(--orange);
  color: #fff;
}

.composer svg {
  width: 18px;
}

.profile-row {
  display: grid;
  grid-template-columns: 52px 1fr 42px;
  align-items: center;
  gap: 12px;
  padding: 13px;
}

.profile-row > img {
  width: 52px;
  height: 52px;
  border-radius: 50%;
}

.profile-row b {
  font-size: 15px;
}

.profile-row span {
  margin-top: 4px;
}

.menu-list {
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--panel);
}

.menu-list button {
  display: grid;
  width: 100%;
  min-height: 66px;
  grid-template-columns: 34px 1fr auto;
  align-items: center;
  gap: 11px;
  padding: 10px 13px;
  border-bottom: 1px solid var(--line);
  background: transparent;
  text-align: left;
}

.menu-list button:last-child {
  border-bottom: 0;
}

.menu-list button:disabled {
  cursor: default;
  opacity: 0.58;
}

.menu-list button > svg:first-child {
  width: 19px;
  color: var(--orange);
}

.menu-list button > svg:last-child {
  width: 17px;
  color: var(--muted);
}

.menu-list small {
  margin-top: 4px;
}

.menu-list em {
  color: var(--muted);
  font-size: 8px;
  font-style: normal;
}

.theme-setting {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 13px;
}

.theme-setting > div:first-child {
  display: grid;
  grid-template-columns: 34px 1fr;
  align-items: center;
  gap: 11px;
}

.theme-setting > div:first-child svg {
  width: 19px;
  color: var(--orange);
}

.theme-setting .segmented {
  width: 142px;
}

.theme-setting .segmented button {
  min-height: 30px;
  font-size: 9px;
}

.sub-head {
  min-height: 48px;
  margin-bottom: 14px;
}

.sub-head h2 {
  font-size: 19px;
}

.sub-head-spacer {
  width: 42px;
  height: 42px;
}

.settings-form {
  display: grid;
  gap: 8px;
}

.setting-row,
.time-setting,
.reminder-note {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
}

.setting-row,
.time-setting {
  display: grid;
  min-height: 72px;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 13px 14px;
}

.setting-row b,
.setting-row small,
.time-setting b,
.time-setting small {
  display: block;
}

.setting-row b,
.time-setting b {
  font-size: 12px;
}

.setting-row small,
.time-setting small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
}

.switch-row {
  position: relative;
}

.switch-row input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.switch-row > i {
  position: relative;
  width: 46px;
  height: 26px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--panel-soft);
  transition: background 160ms ease, border-color 160ms ease;
}

.switch-row > i::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--muted);
  content: "";
  transition: transform 160ms ease, background 160ms ease;
}

.switch-row input:checked + i {
  border-color: var(--orange);
  background: color-mix(in srgb, var(--orange) 24%, transparent);
}

.switch-row input:checked + i::after {
  background: var(--orange);
  transform: translateX(20px);
}

.switch-row input:focus-visible + i {
  outline: 2px solid var(--orange);
  outline-offset: 2px;
}

.time-setting input {
  width: 92px;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-soft);
  padding: 0 9px;
  font-size: 16px;
  font-weight: 800;
  text-align: center;
}

.reminder-note {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 10px;
  padding: 14px;
}

.reminder-note svg {
  width: 19px;
  color: var(--green);
}

.reminder-note p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.55;
}

.settings-form > .btn {
  margin-top: 4px;
}

.date-strip span {
  text-align: center;
}

.recovery-score {
  position: relative;
  display: grid;
  width: 214px;
  height: 214px;
  margin: 18px auto 12px;
  place-items: center;
  border-radius: 50%;
  background: transparent;
  box-shadow: 0 0 50px var(--green-soft);
}

.recovery-score svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.score-track,
.score-value {
  fill: none;
  stroke-width: 10;
}

.score-track {
  stroke: var(--line);
}

.score-value {
  stroke: var(--green);
  stroke-dasharray: 427;
  stroke-dashoffset: 77;
  stroke-linecap: round;
  filter: drop-shadow(0 0 7px var(--green));
}

.recovery-score div {
  z-index: 1;
  text-align: center;
}

.recovery-score b,
.recovery-score span,
.recovery-score small {
  display: block;
}

.recovery-score b {
  font-size: 47px;
  line-height: 1;
}

.recovery-score span {
  margin-top: 6px;
  color: var(--muted);
  font-size: 10px;
}

.recovery-score small {
  margin-top: 7px;
  color: var(--green);
  font-size: 10px;
  font-weight: 800;
}

.recovery-copy {
  max-width: 330px;
  margin: 0 auto 16px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
  text-align: center;
}

.recovery-metrics .metric-card {
  min-height: 86px;
}

.recovery-metrics .metric-card b {
  font-size: 19px;
}

.factor-list {
  margin: 8px 0;
  padding: 15px;
}

.factor-list h3 {
  margin: 0 0 15px;
  font-size: 13px;
}

.factor-list > div {
  display: grid;
  grid-template-columns: 92px 1fr 30px;
  align-items: center;
  gap: 9px;
  margin-top: 12px;
  font-size: 9px;
}

.factor-list > div > i {
  display: block;
  height: 5px;
  overflow: hidden;
  border-radius: 3px;
  background: var(--line);
}

.factor-list > div > i b {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
}

.factor-list > div > i b.orange {
  background: var(--orange);
}

.factor-list em {
  color: var(--muted);
  font-size: 9px;
  font-style: normal;
  text-align: right;
}

.activity-list {
  display: grid;
  gap: 7px;
}

.activity-list button {
  display: grid;
  width: 100%;
  grid-template-columns: 42px 1fr auto;
  align-items: center;
  gap: 11px;
  min-height: 66px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  text-align: left;
}

.activity-list em {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--green);
  font-size: 8px;
  font-style: normal;
  font-weight: 700;
}

.activity-list em svg {
  width: 13px;
}

.workout-detail-sheet {
  display: block;
}

.detail-hero {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.detail-hero .sport-icon {
  width: 48px;
  height: 48px;
}

.detail-hero small,
.detail-hero b,
.detail-section > span,
.detail-metrics span,
.detail-metrics b {
  display: block;
}

.detail-hero small,
.detail-section > span,
.detail-metrics span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
}

.detail-hero b {
  margin-top: 4px;
  font-size: 14px;
}

.detail-section {
  margin-top: 9px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.detail-section p {
  margin: 8px 0 0;
  font-size: 12px;
  line-height: 1.55;
}

.detail-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin-top: 9px;
}

.detail-metrics div {
  min-width: 0;
  padding: 13px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
}

.detail-metrics b {
  margin-top: 6px;
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-actions {
  display: grid;
  gap: 7px;
  margin-top: 10px;
}

.bottom-nav {
  position: absolute;
  z-index: 10;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  height: calc(70px + env(safe-area-inset-bottom));
  grid-template-columns: repeat(5, 1fr);
  align-items: start;
  padding: 8px 7px env(safe-area-inset-bottom);
  border-top: 1px solid var(--line);
  background: var(--nav-bg);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
}

.nav-btn {
  display: grid;
  min-width: 0;
  height: 52px;
  place-items: center;
  align-content: center;
  gap: 4px;
  background: transparent;
  color: var(--muted);
}

.nav-btn svg {
  width: 20px;
  height: 20px;
  stroke-width: 1.8;
}

.nav-btn span {
  max-width: 100%;
  overflow: hidden;
  font-size: 8px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-btn.is-active {
  color: var(--orange);
}

.splash,
.welcome,
.onboarding {
  position: absolute;
  z-index: 50;
  inset: 0;
}

.splash {
  overflow: hidden;
  background: #090a09;
  color: #fff;
  transition: opacity 420ms ease, visibility 420ms ease;
}

.splash.is-hidden,
.welcome.is-hidden,
.onboarding.is-hidden {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.splash > img:first-child {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.splash-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.14) 48%, rgba(0, 0, 0, 0.86));
}

.splash-logo {
  position: absolute;
  top: max(34px, env(safe-area-inset-top));
  left: 25px;
  width: 145px;
}

.splash-status {
  position: absolute;
  right: 25px;
  bottom: calc(32px + env(safe-area-inset-bottom));
  left: 25px;
  display: flex;
  align-items: center;
  gap: 9px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 10px;
  font-weight: 700;
}

.splash-status span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--orange);
  box-shadow: 0 0 15px var(--orange);
  animation: pulse 1.1s ease infinite;
}

@keyframes pulse {
  50% { opacity: 0.35; transform: scale(0.72); }
}

.welcome {
  z-index: 45;
  display: grid;
  place-items: center;
  align-content: center;
  padding: 30px;
  background: var(--bg);
  text-align: center;
  transition: opacity 350ms ease, visibility 350ms ease;
}

.welcome img {
  width: 104px;
  filter: drop-shadow(0 0 34px rgba(255, 104, 31, 0.52));
}

.welcome p {
  margin: 24px 0 8px;
  font-size: 30px;
  font-weight: 800;
}

.welcome span {
  max-width: 280px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.onboarding {
  z-index: 40;
  display: flex;
  overflow: hidden;
  flex-direction: column;
  padding: max(19px, env(safe-area-inset-top)) 18px calc(18px + env(safe-area-inset-bottom));
  background: var(--bg);
  transition: opacity 320ms ease, visibility 320ms ease;
}

.onboarding-header img {
  width: 112px;
}

.progress-track {
  height: 3px;
  margin: 20px 0 26px;
  overflow: hidden;
  border-radius: 2px;
  background: var(--line);
}

.progress-track span {
  display: block;
  width: 20%;
  height: 100%;
  background: var(--orange);
  transition: width 260ms ease;
}

.onboarding-form {
  display: grid;
  min-height: 0;
  flex: 1;
  grid-template-rows: minmax(0, 1fr) auto auto;
}

.onboarding-pages {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0 2px 12px 0;
  scroll-padding: 16px 0;
  scrollbar-width: none;
}

.onboarding-pages::-webkit-scrollbar {
  display: none;
}

.onboarding-page {
  display: none;
  padding-bottom: 8px;
}

.onboarding-page.is-active {
  display: block;
  animation: screen-in 230ms ease both;
}

.step-label {
  margin: 0 0 10px;
  color: var(--orange);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.onboarding-page h1 {
  margin: 0;
  font-size: 29px;
  line-height: 1.12;
}

.lead {
  margin: 10px 0 21px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.form-grid.compact-top {
  margin-top: 16px;
}

.field {
  display: block;
}

.field.full {
  grid-column: 1 / -1;
}

.field > span,
.field-caption {
  display: block;
  margin: 0 0 7px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.field input,
.field textarea {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 13px;
  background: var(--panel);
  outline: 0;
}

.field textarea {
  min-height: 86px;
  resize: vertical;
  padding-top: 12px;
}

.choice-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.choice input,
.pill-choices input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.choice > span {
  display: grid;
  min-height: 106px;
  align-content: start;
  gap: 5px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
}

.choice input:checked + span {
  border-color: var(--orange);
  box-shadow: inset 0 0 0 1px var(--orange);
}

.choice svg {
  width: 19px;
  color: var(--orange);
}

.choice b {
  margin-top: 5px;
  font-size: 12px;
}

.choice small {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.35;
}

.choice.full-choice {
  grid-column: 1 / -1;
}

.choice.full-choice > span {
  min-height: 78px;
  grid-template-columns: 25px minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-content: center;
  align-items: start;
  column-gap: 9px;
  row-gap: 3px;
}

.choice.full-choice svg {
  grid-row: 1 / 3;
  margin-top: 2px;
}

.choice.full-choice b {
  grid-column: 2;
  margin-top: 0;
}

.choice.full-choice small {
  grid-column: 2;
  margin-top: 0;
}

.choice input:focus-visible + span,
.pill-choices input:focus-visible + span {
  outline: 2px solid var(--orange);
  outline-offset: 2px;
}

.range-block {
  margin: 15px 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
}

.range-block > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 11px;
  font-size: 11px;
  font-weight: 700;
}

.range-block b {
  color: var(--orange);
  font-size: 18px;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--orange);
}

.field-caption {
  margin-top: 18px;
}

.pill-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.pill-choices span {
  display: inline-flex;
  min-height: 35px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 0 14px;
  background: var(--panel);
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.pill-choices input:checked + span {
  border-color: var(--orange);
  background: rgba(255, 104, 31, 0.12);
  color: var(--text);
}

.segmented.wide {
  grid-auto-flow: initial;
  grid-template-columns: 1fr 1fr;
}

.ai-review {
  display: grid;
  grid-template-columns: 66px 1fr;
  align-items: center;
  gap: 15px;
  padding: 17px;
}

.ai-orbit {
  width: 66px;
  height: 66px;
}

.ai-orbit img {
  width: 42px;
}

.ai-review b {
  font-size: 13px;
}

.ai-review p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

.review-list {
  display: grid;
  gap: 8px;
  margin: 13px 0 0;
  padding: 0;
  list-style: none;
}

.review-list li {
  display: grid;
  grid-template-columns: 22px 1fr;
  align-items: center;
  gap: 9px;
  min-height: 49px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  font-size: 10px;
}

.review-list svg {
  width: 18px;
  color: var(--green);
}

.onboarding-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 11px;
  border-top: 1px solid var(--line);
  background: var(--bg);
}

.onboarding-actions .btn {
  flex: 1;
}

.form-error {
  min-height: 17px;
  margin: 8px 0 0;
  color: var(--danger);
  font-size: 10px;
}

.bottom-sheet {
  position: absolute;
  z-index: 60;
  right: 0;
  bottom: 0;
  left: 0;
  max-height: 91%;
  overflow-y: auto;
  scroll-padding-bottom: calc(24px + env(safe-area-inset-bottom));
  padding: 17px 18px calc(22px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  border-radius: 8px 8px 0 0;
  background: var(--bg-elevated);
  box-shadow: 0 -25px 80px rgba(0, 0, 0, 0.38);
  backdrop-filter: blur(28px) saturate(150%);
  -webkit-backdrop-filter: blur(28px) saturate(150%);
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateY(105%);
  transition: transform 300ms ease, opacity 220ms ease, visibility 300ms ease;
}

.bottom-sheet.is-open {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.bottom-sheet > header {
  margin-bottom: 17px;
}

.bottom-sheet .range-block {
  margin: 9px 0;
}

.toast {
  position: absolute;
  z-index: 80;
  top: max(18px, env(safe-area-inset-top));
  right: 14px;
  left: 14px;
  display: grid;
  min-height: 61px;
  grid-template-columns: 32px 1fr;
  align-items: center;
  gap: 10px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--nav-bg);
  box-shadow: var(--shadow);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-16px);
  transition: opacity 220ms ease, transform 220ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.toast > svg {
  width: 25px;
  color: var(--green);
}

.toast b,
.toast span {
  display: block;
}

.toast b {
  font-size: 12px;
}

.toast span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
}

[hidden] {
  display: none !important;
}

@media (min-width: 600px) {
  .app-shell {
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 22px;
  }

  .bottom-nav {
    border-radius: 0 0 22px 22px;
  }
}

@media (max-width: 599px) {
  .viewport {
    place-items: start center;
  }
}

@media (max-width: 350px) {
  .app,
  .onboarding {
    padding-right: 13px;
    padding-left: 13px;
  }

  .home-metrics .metric-card,
  .stats-metrics .metric-card,
  .recovery-metrics .metric-card {
    padding: 12px 8px;
  }

  .metric-card b {
    font-size: 20px;
  }

  .coach-brief {
    grid-template-columns: 38px 1fr;
  }

  .coach-brief > button {
    display: none;
  }

  .onboarding-actions .btn {
    min-width: 0;
    padding-right: 10px;
    padding-left: 10px;
    font-size: 12px;
  }
}

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