/* Mobile-first shell. Presentation only: no account, timer or training mutations. */
.app {
  --tap: 44px;
  --mobile-nav-height: 56px;
  --mobile-gap: 12px;
}
.app .topbar { display: none !important; }
.app #appNav { top: 0; }
.app .profile-app-settings { margin-top: 12px; padding: 0; border: 0; background: transparent; }
.app .profile-app-settings > summary { display: flex; align-items: center; min-height: 44px; padding: 8px 0; font-size: 13px; font-weight: 700; cursor: pointer; }
.app .profile-app-settings > summary::after { content: '+'; margin-left: auto; }
.app .profile-app-settings[open] > summary::after { content: '−'; }
.app .profile-app-settings .profile-settings-row { margin-top: 8px; }
.app :is(button,summary,[role="button"]) { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.app :is(button,summary):focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
.app :is(.section,.panel,.ex-tile,.field,.profile-section,.section-head,.dialog-head) { min-width: 0; }
.app :is(input,select,textarea) { max-width: 100%; scroll-margin-block: 100px; }
.app :is(.ev-help-row,.section-head,.profile-section-head) { gap: 8px; }
.app .ev-help-row > :is(h2,h3,label) { min-width: 0; }
.app .ev-help-row .ev-help-button { margin-left: auto; flex: 0 0 44px; }
.app .profile-photo-button { aspect-ratio: 1; flex-shrink: 0; object-fit: cover; }
.app #nativeRunEntry { margin-block: 16px; }
.app .ex-training-grid #nativeRunEntry { margin: 0; }
.app #nativeRunEntry .native-run-actions { width: 100%; margin-top: auto; grid-column: 1 / -1; }
.app #nativeRunEntry > h3 { grid-column: 2; align-self: center; }
.app #nativeRunStatus:empty { display: none; }
.app #appNav .nav-icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.app #appNav > button { transition: background-color .18s,color .18s; }
.app #appNav > button.active { background: var(--surface-2); color: var(--ink); box-shadow: none; }
.app #appNav > button.active .nav-icon { color: #141b05; background: var(--brand); border-radius: 9px; }
.app #nativeRunEntry .native-run-context { margin: 0; font-size: 13px; }
.app #nativeRunEntry .native-run-more { width: 100%; grid-column: 1 / -1; }
.app #nativeRunEntry .native-run-more summary { font-size: 12px; color: var(--muted); }
.app .native-run-fields #runGpsButton { width: 100%; }
.app .native-run-fields #runGpsStatus { font-size: 12px; }
.app .native-mode-picker { display: flex; gap: 4px; padding: 4px; margin: 12px 0; border-radius: 14px; background: var(--surface-2); }
.app .native-mode-picker button { flex: 1; min-width: 0; min-height: 44px; padding: 9px 12px; border: 0; border-radius: 11px; background: transparent; color: var(--muted); font-size: 14px; }
.app .native-mode-picker button[aria-checked="true"] { background: var(--brand); color: var(--brand-ink); }
.app .workout-step-nav > button { min-width: 0; white-space: normal; overflow-wrap: anywhere; line-height: 1.2; }
.app #workoutNext { font-size: 12px; padding-inline: 6px; }
.app .native-run-fields .run-metrics:has(b:empty) { display: none; }
.app .today-workout-details { margin: 0; padding: 0; border: 0; background: transparent; }
.app .today-workout-details > summary { min-height: 44px; padding: 12px 0; font-size: 12px; font-weight: 750; color: #e2e8d9; cursor: pointer; }
.app .today-workout-details[open] > summary { margin-bottom: 4px; }

@media screen and (max-width: 900px) {
  html { scroll-padding-top: 12px; scroll-padding-bottom: 80px; }
  .app { padding: 10px max(12px,env(safe-area-inset-right)) calc(76px + env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left)); }
  .app .topbar,.app .topbar:has(#brandHome) { top: 0; grid-template-columns: minmax(0,1fr) auto; gap: 8px; margin: 0 0 12px; padding: 4px 2px; border: 0; border-radius: 0; min-height: 52px; box-shadow: none; }
  .app .brand { gap: 8px; min-height: 44px; padding: 0; }
  .app .brand-icon { width: 34px; height: 34px; }
  .app #brandHome .brand-icon { flex: 0 0 32px; width: 32px; height: 32px; border-radius: 8px; }
  .app #brandHome .brand-text { display: block; }
  .app #brandHome .brand-text b { font-size: 17px; letter-spacing: -.04em; }
  .app .brand b { font-size: 17px; }
  .app .brand small { display: none; }
  .app .app-header-context { display: none; }
  .app .top-actions { gap: 4px; }
  .app .top-actions > button { width: 44px; height: 44px; min-width: 44px; min-height: 44px; padding: 0; }
  .app #headerProfileAvatar { width: 32px; height: 32px; margin: auto; }
  .app #openProfileSettings { border-radius: 50%; }
  .app #appNav { position: fixed; top: auto; bottom: 0; left: 0; right: 0; z-index: 40; grid-template-columns: repeat(6,minmax(0,1fr)); gap: 2px; margin: 0; padding: 4px max(6px,env(safe-area-inset-right)) calc(4px + env(safe-area-inset-bottom)) max(6px,env(safe-area-inset-left)); border-radius: 0; border: 0; border-top: 1px solid var(--line); box-shadow: 0 -4px 20px rgba(0,0,0,.06); }
  .app #appNav > button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-width: 0; min-height: 47px; padding: 3px 1px; border: 0; border-radius: 11px; font-size: 9px; line-height: 1.2; }
  .app #appNav > button[data-app-view="profile"] { display: flex; }
  .app #appNav .nav-icon { display: grid; place-items: center; width: 32px; height: 24px; font-size: 18px; line-height: 1; }
  .app #appNav .nav-icon svg { width: 20px; height: 20px; }
  .app #appNav .nav-label { white-space: nowrap; max-width: 100%; letter-spacing: -.02em; }
  .app #appNav > button.active { box-shadow: none; background: transparent; font-weight: 800; }
  .app .top-actions #themeToggle { background: transparent; border-color: transparent; }
  .app:has(#profilePanel:not(.hidden)) #openProfileSettings { border-color: var(--ink); background: var(--surface-3); }
  .app .panel { padding: 16px; border-radius: 18px; }
  .app .section { margin-top: 14px; scroll-margin-top: 12px; }
  .app .section-head { margin-bottom: 12px; gap: 8px; }
  .app :is(.section-head h2,.ex-hub-head h2) { font-size: clamp(25px,5.5vw,32px); line-height: 1.12; margin-bottom: 6px; }
  .app :is(button,.secondary,.primary,.small-btn) { min-height: 44px; padding: 10px 12px; font-size: 13px; line-height: 1.3; white-space: normal; }
  .app :is(button.icon-button,.ev-help-button,.ex-close) { width: 44px; height: 44px; min-width: 44px; padding: 0; }
  .app summary { min-height: 44px; }
  .app .field { margin-bottom: 12px; }
  .app .field > label { font-size: 13px; line-height: 1.35; }
  .app :is(input:not([type="checkbox"]):not([type="radio"]),select,textarea) { font-size: 16px; line-height: 1.4; min-height: 46px; padding: 10px 12px; border-radius: 12px; }
  .app .field input[type="checkbox"],.app input[type="radio"] { min-height: auto; }
  .app .grid { gap: 12px; }
  .app .step-intro { gap: 12px; padding: 14px; margin-bottom: 18px; }
  .app .step-intro > strong { display: grid; place-items: center; width: 40px; height: 40px; min-width: 40px; font-size: 16px; }
  .app .step-intro b { font-size: 16px; line-height: 1.3; }
  .app .step-intro span { font-size: 12px; line-height: 1.45; }
  .app .today-card { min-height: 0; padding: 20px 16px; border-radius: 22px; }
  .app .today-greeting { margin: 18px 0 10px; font-size: 13px; }
  .app .today-card h1 { font-size: clamp(32px,8vw,48px); line-height: .98; overflow-wrap: break-word; }
  .app .today-detail { font-size: 13px; line-height: 1.5; }
  .app .today-workout-details { border-block: 1px solid rgba(255,255,255,.15); }
  .app .today-workout-details .today-coach-cue { margin-bottom: 12px; }
  .app .plan-ready-note { top: auto; bottom: calc(90px + env(safe-area-inset-bottom)); font-size: 12px; }
  .app .today-card .hero-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 16px; }
  .app .today-card .hero-actions > button { min-width: 0; width: 100%; min-height: 48px; padding: 10px; }
  .app .today-card .hero-actions > .today-start { grid-column: 1 / -1; }
  .app .today-meta { gap: 6px; }
  .app .today-meta span { padding: 6px 8px; font-size: 11px; }
  .app .today-card .week-strip { display: grid; grid-template-columns: repeat(7,minmax(46px,1fr)); gap: 4px; margin: 10px 0 0; padding: 0 0 8px; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x proximity; scrollbar-width: thin; }
  .app .today-card .week-strip .week-day { min-width: 46px; min-height: 80px; grid-template-rows: 16px minmax(30px,1fr) 14px; gap: 3px; padding: 8px 3px; scroll-snap-align: start; }
  .app .today-card .week-strip .week-day > span { font-size: 10px; }
  .app .today-card .week-strip .week-day > b { font-size: 10px; line-height: 1.35; }
  .app .today-card .week-strip .week-day > .week-day-intensity { font-size: 9px; }
  .app .week-strip-head { margin-top: 20px; }
  .app .week-strip-head > span { display: none; }
  .app .daily-coach { margin: 0; }
  .app .daily-coach .field { margin-bottom: 10px; }
  .app :is(.progress-kpis,.progress-score-grid) { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
  .app :is(.progress-kpi,.progress-score) { min-width: 0; padding: 12px; }
  .app :is(.progress-kpi b,.progress-score b) { font-size: 26px; line-height: 1.15; font-variant-numeric: tabular-nums; }
  .app .load-signal-card { padding: 14px; gap: 10px; margin-block: 14px; }
  .app .ex-hub-head { margin-bottom: 16px; }
  .app .ex-training-grid { grid-template-columns: 1fr; gap: 12px; }
  .app .ex-training-grid .ex-tile { display: grid; grid-template-columns: 40px minmax(0,1fr); grid-auto-rows: auto; min-height: 0; gap: 8px 10px; padding: 16px; border-radius: 18px; }
  .app .ex-training-grid .ex-tile > :is(.ex-glyph,.station-glyph) { grid-column: 1; grid-row: 1; width: 40px; height: 40px; min-width: 40px; margin: 0; font-size: 22px; border-radius: 12px; }
  .app .ex-training-grid .ex-tile > .ev-help-row { grid-column: 2; grid-row: 1; align-self: center; }
  .app .ex-training-grid .ex-tile h3 { font-size: 18px; line-height: 1.25; }
  .app .ex-training-grid .ex-tile > :is(button,details,p,.ex-planned-name) { grid-column: 1 / -1; width: 100%; margin: 0; min-width: 0; }
  .app .ex-training-grid .ex-tile > button { min-height: 44px; text-align: center; }
  .app .ex-training-grid .ex-planned-name { font-size: 15px; line-height: 1.4; }
  .app .ex-training-grid .ex-tile > .primary { margin-top: 4px; min-height: 48px; }
  .app .ex-training-grid .ex-planned-actions { grid-column: 1 / -1; }
  .app #nativeRunEntry { padding: 16px; border-radius: 18px; }
  .app #nativeRunEntry h3 { font-size: 18px; }
  .app #nativeRunEntry p { font-size: 12px; }
  .app #nativeRunEntry button { flex: 1 1 130px; }
  .app #workoutHistorySection { margin-top: 24px; }
  .app .history-card > summary { gap: 8px; padding: 12px; }
  .app .history-card .history-total { font-size: 21px; white-space: nowrap; }
  .app .history-body { padding: 0 12px 12px; }
  .app .history-pages { display: flex; gap: 8px; align-items: center; justify-content: space-between; margin-top: 12px; }
  .app .history-pages button { font-size: 12px; padding: 9px; }
  .app .plan-heading { align-items: center; }
  .app .plan-toolbar { flex-wrap: wrap; gap: 6px; }
  .app .plan-next-card { padding: 18px 16px; border-radius: 20px; }
  .app .plan-next-title { font-size: 26px; line-height: 1.1; }
  .app .plan-heading-actions { display: grid; grid-template-columns: minmax(0,1fr) 44px; gap: 8px; }
  .app .plan-heading-actions .primary { min-height: 48px; }
  .app .plan-heading-actions .plan-calendar-button { align-self: center; }
  .app #plan .week { padding: 8px 12px; margin: 10px 0; }
  .app #plan .week-head { align-items: center; flex-wrap: wrap; }
  .app #plan .week-head h3 { font-size: 15px; }
  .app #plan .session > summary { padding: 8px 0; gap: 6px; }
  .app #plan .session-title { font-size: 13px; line-height: 1.35; }
  .app #plan .session-date { font-size: 11px; line-height: 1.35; }
  .app #plan .session-completion { min-width: 44px; min-height: 44px; display: grid; place-items: center; }
  .app #plan .session-completion input { width: 18px; height: 18px; min-height: 0; padding: 0; margin: 0; }
  .app .plan-viewbar { flex-wrap: wrap; gap: 8px; }
  .app .plan-viewbar .segmented { flex: 1 1 200px; display: flex; }
  .app .plan-viewbar .segmented > button { flex: 1; }
  .app .plan-viewbar .compact-filter { flex: 1 1 150px; }
  .app .calendar-grid:not(.week-mode),.app .calendar-weekdays { margin-inline: 0; gap: 3px; }
  .app .calendar-grid:not(.week-mode) .calendar-day { min-width: 0; min-height: 48px; padding: 4px; }
  .app .calendar-toolbar { flex-wrap: wrap; gap: 8px; }
  .app .agenda-session { padding: 12px; gap: 10px; }
  .app .agenda-actions { gap: 8px; }
  .app .profile-switcher { padding: 12px; grid-template-columns: minmax(0,1fr) auto; }
  .app .profile-switcher select { min-width: 0; width: 100%; }
  .app .profile-switcher > button { font-size: 12px; padding: 10px; }
  .app .profile-section { padding: 14px; margin-block: 14px; border-radius: 16px; }
  .app .profile-section .profile-actions:has(.profile-route) { display: grid; grid-template-columns: 1fr; gap: 8px; }
  .app .profile-settings-row { display: grid; grid-template-columns: 1fr; gap: 8px; }
  .app .profile-settings-row > button { width: 100%; justify-content: flex-start; min-height: 48px; }
  .app .profile-settings-row .account-quick-label { display: inline; }
  .app .profile-settings-row .account-quick { width: 100%; padding: 10px 12px; }
  .app :is(.profile-route,.profile-manage-card) { padding: 12px; }
  .app .workout-console-head { grid-template-columns: 44px minmax(0,1fr); gap: 8px; padding: 12px; }
  .app .workout-console-head .workout-home { grid-column: 1; grid-row: 1; width: 44px; height: 44px; min-width: 44px; padding: 0; border-radius: 12px; }
  .app .workout-console-head .workout-home-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .app .workout-console-head .workout-session-copy { grid-column: 2; grid-row: 1; min-width: 0; }
  .app .workout-console-head .workout-live-stats { grid-column: 1 / -1; display: flex; justify-content: space-between; width: 100%; }
  .app .workout-console-head .workout-clock button { font-size: 0; line-height: 1; padding: 0; }
  .app .workout-exit-bar:not(:has(.workout-home)) { display: none; }
  .app .workout-console-head h2 { font-size: 18px; line-height: 1.25; }
  .app .workout-current { padding: 16px; gap: 10px; }
  .app .workout-current h3 { font-size: clamp(25px,6vw,36px); line-height: 1.1; }
  .app .workout-current .station-glyph { width: 58px; height: 58px; font-size: 28px; }
  .app .workout-step-nav { bottom: 0; left: 0; right: 0; gap: 6px; padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); border-radius: 18px 18px 0 0; grid-template-columns: 44px minmax(0,1fr) 78px; }
  .app .workout-step-nav button { min-height: 48px; padding: 8px; }
  .app .workout-step-nav .primary { font-size: 12px; }
  .app #workoutPanel.is-live .workout-console { padding-bottom: 88px; }
  .app:has(#workoutPanel.is-live:not(.hidden)) #appNav { display: none; }
  .app .wizard-controls { bottom: calc(var(--mobile-nav-height) + env(safe-area-inset-bottom)); padding: 8px; gap: 8px; }
  .app:has(#appNav.hidden) .wizard-controls { bottom: env(safe-area-inset-bottom); }
  .app .wizard-controls button { min-height: 46px; }
  .app .wizard-top { gap: 8px; }
  .app .stepper { grid-template-columns: repeat(5,minmax(0,1fr)); gap: 2px; }
  .app .stepper .step-btn { min-width: 0; padding: 0 2px; font-size: 0; }
  .app .stepper .step-btn::after { font-size: 10px; line-height: 1.3; }
  .app .wizard-step { padding: 6px 2px; min-width: 0; }
  .app :is(.data-dialog,.ex-dialog,.auth-dialog,.ev-help-dialog) { width: 100%; max-width: 640px; max-height: calc(100dvh - 16px); margin: auto auto 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); border-radius: 24px 24px 0 0; overflow-y: auto; overscroll-behavior: contain; scroll-padding-bottom: 80px; }
  body.keyboard-open .app #appNav { display: none; }
  body.keyboard-open .app dialog[open] { max-height: calc(var(--app-viewport-height,100dvh) - 12px); margin-bottom: var(--app-keyboard-inset,0px); }
  .app dialog::backdrop { backdrop-filter: blur(4px); }
  .app :is(.dialog-head,.ex-dialog-head) { align-items: start; gap: 10px; margin-bottom: 14px; }
  .app :is(.dialog-head h2,.ex-dialog-head h2) { font-size: 25px; line-height: 1.12; margin-block: 8px 0; }
  .app #cloudDialog.auth-dialog { width: 100%; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); }
  .app #cloudDialog .dialog-head { top: -18px; padding-top: 8px; }
  .app .builder-dialog { padding: 0; width: 100%; border-radius: 24px 24px 0 0; }
  .app .builder-body { padding: 14px; }
  .app .builder-footer { padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); }
  .app .ex-result-grid { grid-template-columns: 1fr; gap: 16px; }
  .app .ex-result-time { font-size: 60px; }
  .app .ex-share-preview { max-height: 240px; }
  .app .grp-toolbar,.app .grp-home-actions { gap: 8px; }
  .app .grp-round-result > summary { padding: 12px; }
  .app .grp-action-grid { gap: 8px; }
  .app footer { font-size: 11px; line-height: 1.5; }
}

@media screen and (max-width: 380px) {
  .app .app-header-context { display: none; }
  .app .topbar { grid-template-columns: minmax(0,1fr) auto; }
  .app .topbar:has(#brandHome) { grid-template-columns: minmax(0,1fr) auto; }
  .app .today-card .hero-actions { grid-template-columns: 1fr; }
  .app .today-card .hero-actions > .today-start { grid-column: auto; }
  .app #appNav { gap: 1px; padding-inline: 6px; }
  .app #appNav > button { font-size: 9px; }
  .app .profile-switcher { grid-template-columns: 1fr; }
  .app .ex-planned-actions { grid-template-columns: 1fr; }
}
@media screen and (min-width: 701px) and (max-width: 900px) {
  .app .ex-training-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .app .profile-settings-row { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media screen and (min-width: 901px) {
  .app .shell { max-width: 1280px; }
  .app .ex-training-grid { gap: 16px; }
  .app #nativeRunEntry { max-width: 100%; }
  .app .today-workout-details[open] > summary { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .app *, .app *::before, .app *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* Task-first surfaces. Explanations stay available, not in every heading. */
.app { --control-height:46px; --action-height:48px; --control-gap:8px; --button-radius:12px; }
.app :is(button.primary,button.secondary,button.small-btn) { min-height:var(--control-height); padding:10px 14px; border-radius:var(--button-radius); font-size:13px; line-height:1.35; }
.app :is(.hero-actions,.plan-heading-actions,.session-actions,.profile-actions,.profile-settings-row,.progress-page-actions,.daily-coach-actions,.agenda-actions,.ex-actions,.grp-actions) { gap:var(--control-gap); }
.app :is(button.icon-button,.ev-help-button,.ex-close) { width:44px; height:44px; min-width:44px; min-height:44px; padding:0; }
.app :is(.ex-hub-head,.section-head) > div > .eyebrow { margin-bottom:4px; }
.app .ev-section-help { grid-column:1/-1; margin-top:16px; padding:0; border:0; border-top:1px solid var(--line); border-radius:0; background:transparent; }
.app .ev-section-help[hidden] { display:none !important; }
.app .ev-section-help > summary { min-height:44px; display:flex; align-items:center; justify-content:space-between; gap:12px; padding:10px 0; font-size:12px; font-weight:650; color:var(--muted); list-style:none; cursor:pointer; }
.app .ev-section-help > summary::after { content:'+'; font-size:17px; }
.app .ev-section-help[open] > summary::after { content:'−'; }
.app .ev-section-help-body { display:grid; gap:14px; padding:10px 0; }
.app .ev-section-help-body section { margin:0; padding:0; }
.app .ev-section-help-body h4 { font-size:13px; margin:0 0 5px; color:var(--ink); }
.app .ev-section-help-body p { margin:0; font-size:13px; line-height:1.5; white-space:pre-line; color:var(--muted); }
.app #workoutPanel.is-live > .ev-section-help { display:none; }
.app .app-disclaimer { border:0; padding:0; background:transparent; }
.app .app-disclaimer > summary { min-height:44px; padding:10px; font-size:11px; cursor:pointer; }
.app .app-disclaimer p { font-size:11px; line-height:1.5; }
.app .profile-route small { display:none; }
.app .profile-route { min-height:50px; }
.app .profile-section--identity { position:relative; overflow:hidden; }
.app .profile-section--identity::before { content:''; position:absolute; right:-16px; top:-12px; width:180px; height:180px; background:url('endyvo-brand.svg') center/contain no-repeat; opacity:.045; pointer-events:none; }
.app .profile-section--identity > * { position:relative; }
.app .profile-settings-row { grid-template-columns:repeat(2,minmax(0,1fr)); }
.app .ex-training-grid .ex-tile:not(:first-child):not(#nativeRunEntry) { --surface:inherit; --surface-2:inherit; --ink:inherit; --muted:inherit; --line:inherit; --accent-text:inherit; background:var(--surface-2); color:var(--ink); border-color:var(--line); }
.app .ex-training-grid .ex-tile:not(:first-child):not(#nativeRunEntry)::before,.app .ex-training-grid .ex-tile:not(:first-child):not(#nativeRunEntry)::after { opacity:.06; }
.app .ex-training-grid .ex-tile:not(:first-child):not(#nativeRunEntry) :is(h3,.ex-glyph,.station-glyph) { color:var(--ink); }
.app .ex-training-grid .ex-tile:not(:first-child):not(#nativeRunEntry) :is(.ex-glyph,.station-glyph) { background:color-mix(in srgb,var(--brand) 13%,var(--surface)); border-color:var(--line); color:var(--accent-text); }
.app .ex-training-grid .ex-tile:not(:first-child):not(#nativeRunEntry) .secondary { background:var(--surface); color:var(--ink); border-color:var(--line); }
.app :is(.ex-training-grid,.grp-connect-actions) .primary { min-height:var(--action-height); }
.app .grp-social-hero .eyebrow { display:none; }
.app .grp-social-hero h2 { margin-top:0; }
.app .progress-page-hero > .eyebrow { display:none; }
.app .ec-row h2 { font-size:22px; line-height:1.2; }
.app .ec-empty { font-size:12px; line-height:1.5; padding:12px 0; }

/* The first screen is the workout, not a dashboard wall of equally weighted cards. */
.app #dashboardHero { grid-template-columns:1fr 1fr; }
.app #dashboardHero > .today-card { grid-column:1/-1; order:0; display:flex; flex-direction:column; min-height:calc(100svh - 120px); padding:clamp(24px,4vw,48px); border-radius:24px; }
.app .today-card .today-topline { flex:0 0 auto; }
.app .today-card .today-greeting { margin:28px 0 14px; }
.app .today-card h1 { max-width:18ch; margin:8px 0 20px; font-size:clamp(40px,6.5vw,84px); line-height:1.02; }
.app .today-card .today-workout-details { max-width:720px; margin:0; }
.app .today-card .today-workout-details > summary { display:flex; align-items:center; min-height:44px; padding:10px 0; font-size:13px; }
.app .today-card .today-workout-details[open] > summary { display:flex; }
.app .today-card .today-meta { margin:12px 0 20px; }
.app .today-card .hero-actions { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); width:100%; max-width:640px; gap:8px; margin-top:auto; padding-top:16px; }
.app .today-card .hero-actions > button { width:100%; min-height:48px; margin:0; padding:12px 14px; font-size:14px; }
.app .home-week-card { grid-column:auto; order:1; margin:0; padding:20px; }
.app .home-week-card .week-strip-head { margin:0 0 12px; align-items:center; }
.app .home-week-card h2 { color:var(--ink); margin:0; font-size:20px; line-height:1.2; }
.app .home-week-card .week-strip { display:grid; grid-template-columns:repeat(7,minmax(44px,1fr)); gap:5px; margin:0; padding-bottom:6px; overflow-x:auto; overscroll-behavior-x:contain; }
.app .home-week-card .week-day { display:grid; grid-template-rows:14px minmax(26px,1fr) 14px; align-content:start; gap:3px; min-height:78px; min-width:44px; padding:9px 4px; background:var(--surface-2); border-color:var(--line); color:var(--ink); box-shadow:none; text-align:center; }
.app .home-week-card .week-day > span { color:var(--muted); font-size:10px; }
.app .home-week-card .week-day > b { color:var(--ink); margin:0; font-size:11px; line-height:1.3; white-space:normal; }
.app .home-week-card .week-day.today { border-color:var(--accent-text); background:color-mix(in srgb,var(--brand) 14%,var(--surface)); box-shadow:inset 0 0 0 1px var(--accent-text); }
.app .home-week-card .week-day.done { background:color-mix(in srgb,var(--green) 12%,var(--surface)); }
.app #dashboardWeekStrip .week-day.hard:not(.done) { box-shadow:none; }
.app #dashboardHero > .race-card { order:2; margin:0; }
.app #dashboardHero > .dashboard-quickbar { order:3; grid-template-columns:repeat(2,minmax(0,1fr)); }
.app #dashboardHero > .adaptation-notice { order:4; }
.app #dashboardHero > .dashboard-insights { order:5; }
.app .dashboard-quickbar :is(.quickbar-copy,#dashboardOpenWeek) { display:none; }
.app .quick-action small { display:none; }
.app #workoutHistorySection .section-head p { display:none; }
@media screen and (max-width:900px) {
  .app #dashboardHero { display:flex; flex-direction:column; gap:14px; }
  .app #dashboardHero > .today-card { min-height:calc(100svh - var(--mobile-nav-height) - env(safe-area-inset-bottom) - 22px); padding:22px 18px; border-radius:22px; }
  .app .today-card .today-greeting { margin:24px 0 12px; font-size:13px; }
  .app .today-card h1 { font-size:clamp(32px,8.5vw,52px); margin:14px 0 18px; line-height:1.04; max-width:18ch; }
  .app .today-card .hero-actions { grid-template-columns:1fr; max-width:none; }
  .app .today-card .hero-actions > .today-start { grid-column:auto; }
  .app .today-card .hero-actions > button { min-height:48px; }
  .app .home-week-card { width:100%; padding:16px; }
  .app .home-week-card .week-strip-head { margin-bottom:10px; }
  .app .profile-settings-row { grid-template-columns:1fr; }
  .app .profile-settings-row > button { min-height:46px; }
  .app .grp-home-actions > button { min-height:46px; }
}
@media screen and (max-height:700px) and (max-width:900px) {
  .app #dashboardHero > .today-card { padding:18px 16px; }
  .app .today-card .today-greeting { margin:18px 0 10px; }
  .app .today-card h1 { font-size:clamp(28px,7.5vw,42px); margin:8px 0 12px; }
  .app .today-card .today-meta { margin:8px 0 12px; }
}

/* Race context, quiet settings, exercise selection and a board-first social view. */
.app .today-race-strip { display:grid; grid-template-columns:1fr auto; align-items:center; gap:7px 12px; margin:18px 0 0; padding:14px 16px; border:1px solid #ffffff26; border-radius:14px; background:#ffffff0a; color:#f7f9ef; }
.app .today-race-strip > span:first-child { font-size:11px; text-transform:uppercase; font-weight:800; letter-spacing:.04em; }
.app .today-race-strip > b { font-size:14px; color:#dfff00; }
.app .today-race-strip > span:last-child { grid-column:1/-1; font-size:11px; color:#c3cdb9; }
.app .today-card .today-greeting { margin-top:18px; }
.app .session { padding:12px 16px; }
.app .session summary { padding-right:12px; gap:10px; align-items:center; }
.app .session-tag { flex-shrink:0; margin-right:6px; max-width:90px; overflow-wrap:anywhere; line-height:1.35; padding:5px 9px; }
.app #plan .session { padding:0; }
.app #plan .session > summary { padding:10px 12px; gap:3px 8px; }
.app #plan .session > summary .session-tag { margin-right:0; }
.app #planHistoryPanel,.app #workoutPanel > .ev-section-help,.app #exReceipt { display:none !important; }
.app #storageStatus:not([data-kind]),.app #storageStatus[data-kind=ok] { display:none; }
.app footer[hidden] { display:none; }
.app .ec-card > p.small.muted { padding:8px 12px; }
.app .ex-planned-actions { gap:8px; }
.app .ex-planned-actions > :is(details,button) { border-radius:12px; font-size:13px; line-height:1.35; margin:0; }
.app .ex-planned-actions > details { padding:0; }
.app .ex-planned-actions > details > summary { display:flex; align-items:center; min-height:46px; padding:10px 14px; font-size:13px; font-weight:700; }
.app .ex-planned-actions > details .field { margin:0; padding:4px 12px 12px; }
.app .history-card { border-radius:18px; margin:12px 0; box-shadow:0 3px 12px #101b0805; }
.app .history-card > summary { min-height:76px; padding:16px; gap:12px; }
.app .history-card > summary b { font-size:15px; line-height:1.3; }
.app .history-card > summary small { margin-top:5px; font-size:11px; }
.app .history-card .history-total { font-size:22px; color:var(--accent-text); }
.app .history-card .history-body { padding:4px 16px 16px; }
.app .profile-settings-heading { margin:24px 0 12px; font-size:14px; color:var(--muted); }
.app #profilePanel .profile-section--account { border-top:1px solid var(--line); }
.app #profilePanel details.profile-section > :not(summary) { margin:0 12px 12px; }
.app #profilePanel #profileFriendIdentity { padding:12px; border:0; background:var(--surface-2); }
.app #profilePanel .profile-section--identity { grid-column:1/-1; }
.app #profilePanel details.profile-section { padding:0; }
.app #profilePanel details.profile-section > summary,.app .profile-legal > summary { min-height:52px; display:flex; align-items:center; justify-content:space-between; padding:14px 16px; font-weight:750; list-style:none; cursor:pointer; }
.app #profilePanel details.profile-section > summary::after { content:'⌄'; color:var(--muted); }
.app #profilePanel details.profile-section[open] > summary::after { content:'⌃'; }
.app #profilePanel details.profile-section .profile-actions { padding:0 12px 12px; }
.app .profile-legal { border-top:1px solid var(--line); margin-top:12px; }
.app .profile-legal p { padding:0 16px 16px; margin:0; font-size:12px; line-height:1.5; color:var(--muted); }
.app #profilePanel .profile-manage .profile-switcher { padding:0; border:0; background:none; }
.app .builder-dialog { width:min(760px,calc(100vw - 16px)); }
.app .builder-body { padding-bottom:12px; }
.app .builder-tabs { position:sticky; top:0; z-index:3; display:grid; grid-template-columns:1fr 1fr; gap:6px; padding:5px; border:1px solid var(--line); background:var(--surface); border-radius:14px; margin:14px 0; }
.app .builder-tabs button { min-height:44px; border:0; margin:0; font-size:12px; }
.app .builder-tabs button[aria-pressed=true] { background:var(--brand); color:var(--brand-ink); }
.app #builderCount { font-size:12px; color:var(--muted); margin:12px 0; }
.app .builder-library > select { width:100%; min-height:46px; margin-bottom:8px; }
.app .builder-catalog { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
.app .builder-catalog .build-exercise { min-height:48px; font-size:12px; padding:10px 12px; text-align:left; white-space:normal; overflow-wrap:anywhere; }
.app .builder-catalog .build-exercise.is-added { border-color:var(--accent-text); background:color-mix(in srgb,var(--brand) 12%,var(--surface)); color:var(--ink); }
.app #builderStatus { position:sticky; bottom:0; margin:0; padding:10px 14px; border-radius:12px; background:var(--surface-2); color:var(--ink); font-weight:750; font-size:12px; min-height:0; }
.app #builderStatus:empty { display:none; }
.app .builder-footer { padding-top:10px; gap:8px; }
.app .build-step { padding:14px; border-radius:14px; margin:10px 0; }
.app .build-step-head { gap:10px; align-items:flex-start; }
.app .build-step-head > b { font-size:14px; line-height:1.4; }
.app .grp-sharing-settings { display:none; }
.app #groupsDialog.grp-settings-mode #groupsContent > :not(#groupsSettingsSection) { display:none !important; }
.app #groupsDialog.grp-settings-mode #groupsSettingsSection { display:block; }
.app #groupsDialog.grp-settings-mode #groupsSettingsSection > h3 { margin-top:0; font-size:17px; }
.app .grp-connect-actions { display:flex; justify-content:flex-end; margin:0; }
.app .grp-social-hero { display:flex; align-items:center; justify-content:space-between; gap:12px; min-height:0; margin:0 0 14px; padding:0; background:none; border:0; box-shadow:none; color:var(--ink); }
.app #groupsStatus[data-quiet=true] { display:none; }
.app #groupsInviteDialog #groupsAddPane { padding:0; border:0; margin:0; }
.app #groupsInviteDialog #groupsAddPane > summary { display:none; }
.app #groupsInviteDialog .grp-link-actions { display:grid; grid-template-columns:1fr; margin:0 0 12px; }
.app #groupsInviteDialog #groupsInvitePane { margin-top:14px; padding:12px; border-radius:14px; background:var(--surface-2); }
.app #groupsInviteStatus:empty { display:none; }
.app :is(#groupsFriendAliasField,#groupsInvitePane,#groupsConnectPane,.grp-invite-link-field)[hidden] { display:none !important; }
.app #groupsInviteDialog:has(#groupsInvitePane:not([hidden])) .grp-link-actions { display:none; }
.app .grp-social-hero::after,.app #groupsFriendHint,.app #groupsDetail > .grp-subhead,.app .grp-peer-list { display:none; }
.app .grp-social-hero h2 { color:var(--ink); font-size:28px; }
.app .grp-social-hero .grp-hero-count { color:var(--muted); font-size:11px; margin-top:5px; }
.app .grp-social-hero .primary { min-height:44px; font-size:12px; padding:10px 14px; }
.app .grp-main-actions { max-width:none; }
.app .grp-board-filters { gap:10px; margin:12px 0; }
.app .grp-round-group { padding:14px; border-radius:18px; }
.app .grp-cohort-head { align-items:center; gap:10px; margin-bottom:8px; }
.app .grp-cohort-head h4 { font-size:14px; line-height:1.3; margin:0; }
.app .grp-round-result { margin:8px 0; border:1px solid var(--line); border-radius:12px; }
.app .grp-round-result > summary { padding:12px; min-height:64px; gap:10px; }
.app .grp-round-result > summary b { font-size:13px; }
.app .grp-round-result .grp-time { font-size:19px; }
.app .grp-demo { margin:18px 0 0; border-top:1px solid var(--line); padding-top:8px; }
.app .grp-demo > summary { min-height:44px; padding:10px 0; font-size:12px; color:var(--muted); cursor:pointer; }
.app .grp-demo h3 { font-size:17px; }
.app .grp-demo > .grp-round-result > summary { display:grid; grid-template-columns:30px minmax(0,1fr) auto 12px; }
.app .grp-demo .grp-rank { color:var(--accent-text); font-size:14px; font-weight:850; }
.app .grp-sharing-settings #groupsAutoScope { font-size:12px; line-height:1.5; margin:10px 0 16px; }
@media(max-width:600px) {
  .app .today-race-strip { margin-top:12px; padding:11px 12px; gap:6px; }
  .app .today-race-strip > b { font-size:12px; }
  .app .today-race-strip > span:first-child { font-size:10px; }
  .app .today-card .today-greeting { margin-top:14px; }
  .app .today-card h1 { font-size:clamp(28px,7vw,42px); }
  .app #plan .session { padding:0; }
  .app .history-card > summary { padding:12px; }
  .app .history-card .history-total { font-size:19px; }
  .app .grp-round-group { padding:12px; }
  .app .grp-round-result > summary { gap:8px; padding:10px; }
  .app .grp-round-result .grp-time { font-size:17px; }
  .app .builder-body .build-order { gap:3px; }
}
/* A paused workout is still open. Finish/save or explicitly discard first. */
body.workout-active .app #appNav { display:none !important; }
.app .profile-devices .profile-settings-row { display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:8px;padding-top:12px; }
.app .progress-history { margin-block:16px; }
.app .progress-history > summary { min-height:44px;font-weight:800;cursor:pointer; }
.app .progress-history > .section-head { margin-top:12px; }
.app .build-live-fields .set-target { grid-column:2 / -1; font-size:11px; color:var(--muted); text-align:left; }
.app .build-live-fields .build-set { padding:10px; border:1px solid var(--line); border-radius:12px; background:var(--surface-2); }
.app .build-live-fields .build-set input { min-height:44px; padding:8px; font-size:16px; }
.app .build-live-fields .build-set input[type=checkbox] { width:44px; height:44px; accent-color:var(--brand); }
.app .split-row { align-items:start; grid-template-columns:24px minmax(0,1fr); }
.app .split-row > .muted { grid-column:2; max-width:none; white-space:normal; text-align:left; line-height:1.4; }
.app .native-run-fields .run-metrics { grid-template-columns:repeat(2,minmax(0,1fr)); }
.app .native-run-fields .run-metrics > div:has(#runAverage) { display:none; }
.app .build-next-exercise { display:flex; gap:10px; align-items:baseline; border-top:1px solid var(--line); padding-top:12px; margin-top:10px; font-size:12px; text-align:left; }
.app .build-next-exercise > span { color:var(--muted); flex-shrink:0; }
.app .build-next-exercise > b { overflow-wrap:anywhere; font-weight:650; }
.app .build-live-fields .run-metrics b { font-variant-numeric:tabular-nums; }
.app #workoutStepNav > button { min-height:48px; border-radius:14px; }
.app #workoutStepNav > .primary { font-size:15px; }
.app .workout-step-hint:empty { display:none; }
.app .workout-step-hint { margin:8px 0 12px; padding:10px 12px; border:1px solid var(--line); border-radius:12px; color:var(--ink); background:var(--surface-2); line-height:1.4; }
.app .build-set input[aria-invalid="true"] { outline:2px solid var(--red,#ce4329); outline-offset:2px; }
@media (max-width: 680px) {
  .app .workout-current:has(.native-run-fields) { display:block; position:relative; min-height:0; padding:14px; text-align:left; }
  .app .workout-current:has(.native-run-fields) > .station-glyph { position:absolute; top:14px; right:14px; width:44px; height:44px; min-width:44px; min-height:44px; font-size:23px; }
  .app .workout-current:has(.native-run-fields) .segment-index { padding-right:52px; font-size:10px; }
  .app .workout-current:has(.native-run-fields) h3 { padding-right:48px; margin:8px 0; font-size:24px; line-height:1.15; }
  .app .workout-current:has(.native-run-fields) > div > p { margin:8px 0; font-size:13px; line-height:1.4; }
  .app .workout-current:has(.native-run-fields) .workout-target-cue { display:none; }
  .app .workout-current:has(.native-run-fields) .step-live { margin:10px 0; display:flex; flex-direction:row; align-items:center; gap:10px; text-align:left; }
  .app .workout-current:has(.native-run-fields) .step-live-time { font-size:36px; line-height:1; }
  .app .workout-current:has(.native-run-fields) .step-live-copy > span { display:none; }
  .app .native-run-fields { margin-top:10px; padding-top:10px; gap:8px; }
  .app .native-run-fields #runRemaining { font-size:12px; }
  .app .native-run-fields #runGpsStatus:empty { display:none; }
}
