.training-header .th-title, #page-growth > h2 { font-size: clamp(28px,4vw,40px); letter-spacing: -.05em; }
.plan-nav-btn { min-height: 46px; }
.empty-icon { display: none; }
.profile-avatar { display: grid; place-items: center; color: var(--green-800); font-weight: 800; }
.si-icon, .pp-icon { display: grid; place-items: center; color: var(--primary); }
.ci-index { flex: 0 0 26px; color: var(--primary); font-size: 9px; font-weight: 850; letter-spacing: .08em; }
.body-metric-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; }
.body-metric { padding: 16px 14px; border: 1px solid var(--border); border-radius: 14px; background: white; }
.body-metric strong, .body-metric span { display: block; }
.body-metric strong { overflow: hidden; font-size: clamp(26px,4vw,40px); line-height: 1; letter-spacing: -.055em; text-overflow: ellipsis; }
.plan-generate-action { margin-bottom: 0; }
.exercise-library-toggle { display: block; width: auto; min-height:44px; border: 0; background: transparent; cursor: pointer; text-align: left; }
.dot-activity { background: var(--danger); }
.dot-training { background: var(--success); }
.dot-sleep { background: var(--primary); }
.page-title { margin-bottom: 4px; font-size: 22px; font-weight: 700; }
.page-date { margin-bottom: 16px; color: var(--text-secondary); font-size: 13px; }
.trend-empty { padding: 16px 0; color: var(--text-tertiary); font-size: 13px; text-align: center; }
.growth-evaluation { padding: 12px; border-radius: var(--radius-sm); background: var(--primary-soft); color: var(--primary); font-size: 14px; line-height: 1.6; }
.growth-summary-evaluation { margin-top: 12px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--primary-soft); color: var(--primary); font-size: 13px; line-height: 1.5; }
.body-metric span { margin-top: 9px; color: var(--text-secondary); font-size: 11px; }
.settings-item, .pp-card, .goal-chip, .plan-opt, .ex-cat-chip, .ex-card, .plan-day-card { cursor: pointer; }

.ui-reveal { opacity: 0; transform: translateY(12px); transition: opacity var(--motion-slow) var(--ease-out), transform var(--motion-slow) var(--ease-out); }
.ui-reveal.is-visible { opacity: 1; transform: translateY(0); }
.ui-reveal:nth-of-type(2) { transition-delay: 45ms; }
.ui-reveal:nth-of-type(3) { transition-delay: 80ms; }

.fit-segmented { --tab-x: 0px; --tab-w: 0px; position: relative; isolation: isolate; }
.fit-segmented::before { position: absolute; z-index: -1; top: 4px; bottom: 4px; left: 0; width: var(--tab-w); border-radius: 10px; background: var(--primary); content: ""; transform: translateX(var(--tab-x)); transition: transform var(--motion-base) var(--ease-standard), width var(--motion-base) var(--ease-standard); }
.workout-nav.fit-segmented { gap: 4px; padding: 4px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface-muted); }
.workout-nav.fit-segmented .plan-nav-btn { min-width: 104px; border: 0; background: transparent; color: var(--text-secondary); transition: color var(--motion-base) var(--ease-standard); }
.workout-nav.fit-segmented .plan-nav-btn.active { background: transparent; color: white; }
.metric-period-tabs { display: inline-flex; gap: 4px; margin: 0 0 16px; padding: 4px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface-muted); }
.metric-period-tabs::before { z-index: 0; }
.metric-period { position: relative; z-index: 1; min-width: 70px; min-height: 40px; border: 0; border-radius: 10px; background: transparent; color: var(--text-secondary); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; transition: color var(--motion-base) var(--ease-standard); }
.metric-period.active { color: white; }

.settings-toggle-row { cursor: default; }
.fit-switch { position: relative; flex: 0 0 48px; width: 48px; height: 28px; }
.fit-switch input { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.fit-switch > span { position: absolute; inset: 0; border-radius: 10px; background: var(--text-tertiary); transition: background-color var(--motion-base) var(--ease-standard); }
.fit-switch > span::after { position: absolute; top: 4px; left: 4px; width: 20px; height: 20px; border-radius: 8px; background: white; box-shadow: 0 2px 5px rgba(16,19,17,.18); content: ""; transition: transform var(--motion-base) var(--ease-standard); }
.fit-switch input:checked + span { background: var(--primary); }
.fit-switch input:checked + span::after { transform: translateX(20px); }
.fit-switch input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--primary) 28%, transparent); outline-offset: 2px; }

.form-group input, .form-group select, .ex-search, .chat-input-wrap { transition: border-color var(--motion-base) var(--ease-standard), box-shadow var(--motion-base) var(--ease-standard), background-color var(--motion-base) var(--ease-standard); }
.form-group input:focus, .form-group select:focus, .ex-search:focus, .chat-input-wrap:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 12%, transparent); }

.section-heading h2, .training-header .th-title, .page-title { line-height: 1.08; letter-spacing: -.035em; text-wrap: balance; }
.eyebrow { line-height: 1.2; }
.tp-title, .tp-mini-task, .st-label { line-break: strict; text-wrap: pretty; }
.tp-stats, .tp-pct, .panel-note, .cn-time { font-variant-numeric: tabular-nums; }
#barStress { background: var(--warning); }

/* Native dialogs share one surface; mobile panels sit within the safe area. */
.fit-dialog { width: min(460px,calc(100% - 32px)); max-height: calc(100dvh - 32px); margin: auto; padding: var(--space-6); overflow-y: auto; border: 0; border-radius: var(--radius-lg); background: var(--surface-card); color: var(--text); box-shadow: var(--shadow-overlay); }
.fit-dialog::backdrop { background: rgba(17,21,18,.48); }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); margin-bottom: var(--space-4); }
.dialog-heading h2 { font-size: 22px; letter-spacing: -.03em; }
.fit-dialog > p { color: var(--text-secondary); font-size: 14px; line-height: 1.6; }
.dialog-actions { display: flex; gap: var(--space-3); margin-top: var(--space-6); }
.fit-panel { width: min(520px,calc(100% - 32px)); }
.fit-panel .personality-picker { display: grid; gap: var(--space-2); margin: 0; padding: 0; background: transparent; }
.fit-panel .pp-card { min-height: 64px; }
.fit-panel .pp-card .pp-check { margin-left: auto; color: var(--primary); }
@media (max-width: 767px) {
  .fit-panel { width: 100%; max-height: calc(var(--app-viewport-height,100dvh) - 24px); margin: auto 0 0; padding: var(--space-6) var(--space-5) calc(var(--space-6) + env(safe-area-inset-bottom)); border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
}
.account-dialog { margin: auto; width: min(420px, calc(100vw - 32px)); max-height: 90dvh; overflow: auto; padding: 24px; border: 0; border-radius: 20px; color: var(--text-primary, #17211b); background: var(--bg-card, #fff); }
.account-dialog::backdrop { background: rgb(0 0 0 / 45%); }
.account-dialog label { display: block; margin-top: 14px; font-weight: 600; }
.account-dialog input { box-sizing: border-box; width: 100%; padding: 12px; border: 1px solid #c5cfc8; border-radius: 8px; font-size: 16px; }
.account-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.account-actions button { padding: 12px 16px; border: 1px solid #c5cfc8; border-radius: 8px; cursor: pointer; }
.account-dialog [hidden] { display: none; }
#accountError { min-height: 1.5em; color: #a52b25; }

.account-dialog h2 { margin-bottom: 10px; font-size: 24px; }
.account-dialog p { line-height: 1.6; margin-bottom: 14px; }
.account-dialog input:focus-visible { outline: 3px solid #a9c9b7; outline-offset: 2px; }
.account-dialog progress { width: 100%; }
.account-dialog li, .account-dialog output { overflow-wrap: anywhere; }
.account-dialog li { margin: 10px 0; }
.account-dialog button { min-height: 44px; margin: 4px; padding: 10px 14px; border: 1px solid #c5cfc8; border-radius: 8px; background: #f3f7f4; color: #173e30; font: inherit; cursor: pointer; }
.account-dialog button:focus-visible { outline: 3px solid #a9c9b7; outline-offset: 2px; }
.account-dialog button:disabled { opacity: 0.6; cursor: wait; }
.account-dialog .account-actions { position: sticky; bottom: -24px; margin-top: 16px; padding: 12px 0; background: var(--bg-card, #fff); }
.account-dialog h3 { margin-top: 20px; }
.account-dialog output { display: block; user-select: all; }
#accountLogin { background: #173e30; color: #fff; border-color: #173e30; }

/* Coaching forms share the existing dialog and button components. */
#coachDialog { max-height: 88dvh; overflow-y: auto; }
#coachDialog .dialog-heading { align-items: center; gap: 16px; }
#coachDialog .dialog-heading h2 { flex: 1; min-width: 0; }
#coachDialog .dialog-heading button { flex: 0 0 auto; width: auto; padding: 8px 16px; }
#coachDialog > label { display: block; margin: 12px 0; font-weight: 500; }
#coachDialog select, #coachDialog input:not([type="checkbox"]) { display: block; width: 100%; box-sizing: border-box; min-height: 44px; margin-top: 6px; padding: 8px 12px; border: 1px solid #d9dfdb; border-radius: 10px; background: #fff; color: #20342c; font: inherit; }
#coachDialog > button { margin-top: 8px; }
#coachDialog hr { margin: 20px 0; border: 0; border-top: 1px solid #d9dfdb; }
#coachDialog table { width: 100%; border-collapse: collapse; }
#coachDialog th, #coachDialog td { text-align: left; padding: 10px 4px; border-bottom: 1px solid #e6ebe8; }
#coachCandidates { display: grid; gap: 8px; margin-top: 12px; }
#coachStatus { margin-top: 12px; }
