/* Bodivox presentation system. Keep feature-specific mechanics in app.css. */
:root {
  --brand: #0969c3;
  --brand-2: #087f78;
  --ink: #172b42;
  --muted: #53667b;
  --surface: #fff;
  --page: #f3f6fa;
  --panel-soft: #edf2f7;
  --border: #d8e1ea;
  --chip: #e7f1fc;
  --radius-card: 18px;
  --shadow-card: 0 4px 20px #10263e05;
  --space-1: 4px; --space-2: 8px; --space-3: 12px;
  --space-4: 16px; --space-6: 24px; --space-8: 32px;
}
[data-theme="dark"] {
  --brand: #64b5ff;
  --brand-2: #50d9c4;
  --ink: #eef4fb;
  --muted: #a4b4c8;
  --page: #09111d;
  --surface: #121e2e;
  --panel-soft: #0e1928;
  --border: #55698a;
  --chip: #192f48;
  --shadow-card: none;
}
[data-theme="default"] {
  --brand: #ef8b69;
  --brand-2: #ef8b69;
  --ink: #f3f2ee;
  --muted: #a6aaa5;
  --page: #111312;
  --surface: #181b19;
  --panel-soft: #202321;
  --border: #3b413d;
  --chip: #262b28;
  --shadow-card: none;
}
body { font-size: 1rem; line-height: 1.6; }
h1, .h3, .workout-page-header h1, .dashboard-hero h1 {
  font-size: clamp(1.75rem, 4vw, 2rem); font-weight: 750;
  letter-spacing: -.045em; line-height: 1.2; margin-bottom: .6rem;
}
h2, .h4 { font-size: 1.25rem; font-weight: 700; letter-spacing: -.025em; }
h3, .h5 { font-size: 1.1rem; font-weight: 700; }
.text-secondary, .text-muted { color: var(--muted) !important; }
.small, small, .workout-footnote, .dashboard-card-meta { font-size: .8125rem; line-height: 1.55; }
.eyebrow, .workout-page-header .eyebrow { color: var(--muted); font-size: .75rem; letter-spacing: .1em; font-weight: 700; margin: 0 0 .2rem; text-transform: uppercase; }
.app-shell { padding-inline: 20px; }
@view-transition { navigation: none; }
.app-brand-wordmark { font-size: 1.55rem; }
.app-topbar { border-bottom-color: var(--border); }
.app-tabbar .nav-link, .app-tabbar .nav-link svg { color: var(--muted); }
.app-tabbar .nav-link { font-size: .75rem; min-height: 48px; justify-content: center; font-weight: 600; }
.app-tabbar .nav-link.active, .app-tabbar .nav-link.active svg { color: var(--brand); }
.app-tabbar .nav-link[data-nav-item="activities"] svg { background: var(--brand); color: var(--page); border-radius: 12px; padding: 5px; width: 34px; height: 34px; }
.app-tabbar .nav-link[data-nav-item="activities"] { gap: 0; border: 0; background: transparent; }
.app-tabbar .nav-link.active::after { content: ""; width: 4px; height: 4px; border-radius: 50%; background: currentColor; position: absolute; bottom: 0; }
body.keyboard-open .app-tabbar { display: none; }
.skip-link { position: fixed; left: 16px; top: -100px; padding: 12px 20px; background: var(--surface); z-index: 3000; border: 2px solid var(--brand); border-radius: 10px; }
.skip-link:focus { top: 12px; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 3px; }
.btn { border-radius: 12px; min-height: 44px; padding: .6rem 1rem; font-size: .875rem; font-weight: 650; box-shadow: none; }
.btn-lg { min-height: 48px; font-size: 1rem; }
.btn-primary { --bs-btn-bg: #1476cc; --bs-btn-border-color: #1476cc; --bs-btn-color: #fff; background: #1476cc; color: #fff; box-shadow: none; }
[data-theme="default"] .btn-primary {
  --bs-btn-bg: #b84328;
  --bs-btn-border-color: #b84328;
  --bs-btn-hover-bg: #963720;
  --bs-btn-hover-border-color: #963720;
  --bs-btn-active-bg: #84301c;
  --bs-btn-active-border-color: #84301c;
  background: #b84328;
}
/* Bootstrap's stock info alert is a fixed light blue; tint it from the theme instead. */
.alert-info { --bs-alert-color: var(--ink); --bs-alert-bg: var(--chip); --bs-alert-border-color: color-mix(in srgb, var(--brand) 35%, var(--border)); --bs-alert-link-color: var(--brand); }
.snapshot-notice:not([hidden]) { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.btn-outline-primary { --bs-btn-color: var(--brand); --bs-btn-border-color: var(--border); --bs-btn-hover-bg: var(--chip); --bs-btn-hover-color: var(--brand); --bs-btn-hover-border-color: var(--brand); }
.btn-outline-secondary { --bs-btn-color: var(--muted); --bs-btn-border-color: var(--border); --bs-btn-hover-bg: var(--panel-soft); --bs-btn-hover-color: var(--ink); }
.btn-quiet { color: var(--muted); border-color: transparent; background: transparent; }
.form-control, .form-select { min-height: 46px; border-radius: 10px; font-size: 1rem; padding: .65rem .8rem; }
.form-select { padding-right: 2.2rem; }
.form-label { display: block; font-size: .875rem; font-weight: 600; margin-bottom: .5rem; }
.form-label > .form-control, .form-label > .form-select { margin-top: .4rem; }
.input-group-text { border-radius: 10px; }
.dashboard-card, .workout-panel, .site-field, .analytics-card, .analytics-chart-card, .reference-card, .auth-card { border-radius: var(--radius-card); padding: 22px; box-shadow: var(--shadow-card); }
.dashboard-card:hover, .analytics-card:hover, .reference-card:hover, .workout-panel:hover { transform: none; box-shadow: var(--shadow-card); }
.dashboard-card-icon, .metric-icon, .more-action[data-more] > svg { color: var(--brand); background: transparent; box-shadow: none; }
.dashboard-card-header { text-transform: none; font-size: .9375rem; margin-bottom: 20px; }
.dashboard-collapse-toggle { width: 44px; height: 44px; }
.dashboard-collapse-toggle svg { width: .85rem; height: .85rem; }
.dashboard-hero { margin: 8px 0 28px; }
.dashboard-hero p, .workout-page-header p { color: var(--muted); }
.dashboard-grid { gap: 20px; }
.dashboard-list-row { padding-block: 9px; }
.dashboard-list-row small { font-size: .875rem; }
.dashboard-list-row strong { font-variant-numeric: tabular-nums; }
.dashboard-card-primary { background: var(--surface); color: var(--ink); border: 1px solid var(--border); }
.dashboard-card-primary .hero-summary-metric small, .dashboard-card-primary .hero-summary-metric em,
.dashboard-card-primary .hero-energy-target span, .dashboard-card-primary .hero-energy-target small { color: var(--muted); }
.hero-energy-target i { background: linear-gradient(90deg, var(--brand-2) var(--progress, 0%), var(--border) var(--progress, 0%)); }
.hero-summary-metric strong { color: var(--ink); }
.home-focus { margin: 0 0 20px; display: grid; gap: 24px; }
.home-metric { border: 1px solid var(--border); border-radius: 24px; background: var(--surface); padding: 24px; }
.home-metric-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.home-metric-heading p { margin: 0; color: var(--muted); font-size: .875rem; }
.home-metric-heading a { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; margin: -12px; color: var(--brand); flex: 0 0 auto; }
.home-metric-value { display: block; font-size: clamp(2.5rem, 6vw, 3.4rem); letter-spacing: -.06em; line-height: 1.3; font-weight: 750; font-variant-numeric: tabular-nums; margin: 14px 0 4px; }
.home-metric-value-row { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; }
.home-metric-value-row .home-metric-value { margin-right: 0; }
.home-metric-value-row .dashboard-weight-alternatives { white-space: nowrap; }
.home-metric-change { font-size: .875rem; color: var(--muted); }
.weight-sparkline { display: block; width: 100%; height: 96px; margin-top: 20px; overflow: visible; color: var(--brand-2); }
.sparkline-dates { display: flex; justify-content: space-between; color: var(--muted); font-size: .75rem; margin-top: 8px; }
.home-actions { display: flex; flex-direction: column; gap: 12px; }
/* Dashboard tiles (app/templates/dashboard/tiles/). The first fills .home-focus-tile. */
.home-focus-tile { min-width: 0; display: grid; gap: 20px; align-content: start; }
.dashboard-customise { display: flex; justify-content: center; }
.dashboard-customise .btn { display: inline-flex; align-items: center; gap: .4rem; }
.dashboard-customise svg { width: 16px; height: 16px; }
.dashboard-upcoming { list-style: none; margin: .25rem 0 0; padding: 0; display: grid; gap: .5rem; }
.dashboard-upcoming li { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.dashboard-upcoming strong, .dashboard-upcoming small { display: block; }
.dashboard-upcoming small { color: var(--muted); font-weight: 600; }
.dashboard-big-number { margin: .5rem 0 .25rem; font-size: 2.4rem; font-weight: 750; letter-spacing: -.04em; line-height: 1.1; color: var(--ink); }
.dashboard-big-number span { font-size: 1.2rem; margin-left: .15rem; color: var(--muted); }
.dashboard-strength-pick { display: flex; align-items: center; gap: .6rem; margin: .25rem 0 .75rem; font-size: 1rem; }
.dashboard-strength-pick .routine-match { position: static; display: inline-grid; place-items: center; min-width: 47px; padding: .25rem .4rem; border-radius: 999px; line-height: 1; }
.dashboard-strength-pick .routine-match b { font-size: .72rem; }
.dashboard-strength-pick .routine-match small { font-size: .52rem; font-weight: 800; text-transform: uppercase; }
/* Customise dashboard */
.dashboard-tile-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.dashboard-tile-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .7rem .8rem; background: var(--panel-soft); border: 1px solid var(--border); border-radius: 12px; }
.dashboard-tile-row > div:first-child { min-width: 0; }
.dashboard-tile-row strong, .dashboard-tile-row small { display: block; }
.dashboard-tile-row small { color: var(--muted); }
.dashboard-tile-first { display: inline-block; margin-left: .35rem; padding: .05rem .45rem; border-radius: 999px; background: var(--chip); color: var(--brand); font-size: .7rem; vertical-align: middle; }
.dashboard-tile-actions { display: flex; gap: .35rem; flex: none; }
.dashboard-tile-actions .btn { min-width: 44px; display: inline-flex; align-items: center; justify-content: center; gap: .3rem; }
.dashboard-tile-actions svg { width: 16px; height: 16px; }
.home-actions h2 { margin: 0 0 4px; }
.today-action { display: flex; align-items: center; gap: 16px; padding: 16px; border: 1px solid var(--border); background: var(--surface); border-radius: 14px; color: var(--ink); text-decoration: none; min-height: 72px; }
.today-action > svg { color: var(--brand); width: 22px; flex-shrink: 0; }
.today-action strong, .today-action small { display: block; }
.today-action small { color: var(--muted); }
.today-action:hover { border-color: var(--brand); }
.dashboard-weight-alternatives { font-size: .8125rem; }
.empty-state { padding: 20px; border-style: solid; text-align: left; align-items: start; }
.empty-state > svg { width: 24px; height: 24px; margin-bottom: 8px; }
.empty-state p { font-size: .875rem; margin-bottom: 0; }
.first-workout { margin: 24px 0; padding: 32px; background: var(--surface); border: 1px solid var(--border); border-radius: 20px; }
.first-workout p { color: var(--muted); max-width: 48ch; }
.workout-page-header { margin-bottom: 24px; }
.workout-header-actions { gap: 10px; }
.workout-subnav { border-radius: 12px; margin-bottom: 24px; padding: 4px; gap: 4px; }
.workout-subnav a { min-height: 44px; display: grid; place-items: center; border-radius: 9px; font-size: .875rem; }
.workout-subnav a.active { background: var(--chip); color: var(--brand); box-shadow: none; }
.workout-metric-grid article { padding: 20px; }
.workout-metric-grid article strong { font-size: 1.75rem; }
.workout-metric-grid article > span:last-child { font-size: .8125rem; }
.routine-meta .workout-form-grid { display: block; }
.routine-meta label { display: block; width: 100%; }
[data-dashboard-card] .dashboard-card-icon, .workout-metric-grid .metric-icon { color: var(--brand); background: transparent; box-shadow: none; }
[data-theme="default"] .workout-metric-grid .metric-icon[data-metric] {
  color: var(--brand);
  background: color-mix(in srgb, var(--brand) 12%, var(--surface));
}
.routine-details { margin-top: 24px; }
.routine-details summary { cursor: pointer; color: var(--muted); padding: 12px 0; }
.routine-details[open] > div { padding-top: 16px; }
.routine-save-bar { position: sticky; bottom: calc(82px + env(safe-area-inset-bottom, 0px)); background: var(--page); padding: 12px 0; z-index: 20; display: flex; justify-content: flex-end; }
.routine-save-bar .btn { min-width: 160px; }
.routine-utility-actions a { width: auto; }
.routine-add-actions { justify-content: flex-start; margin-top: 16px; }
.active-workout-bar { box-shadow: none; border-bottom: 1px solid var(--border); }
.active-workout-bar span, .active-exercise-card header small, .active-set-head { font-size: .75rem; }
.active-exercise-card header h2 { font-size: 1.15rem; }
.active-set-inputs input { min-height: 48px; font-size: 1.125rem; }
.set-done button { width: 44px; height: 44px; border-radius: 12px; }
.set-done button[data-toggle-set] { background: var(--panel-soft); color: var(--muted); }
.complete .set-done button[data-toggle-set] { background: var(--brand-2); color: var(--page); box-shadow: none; transform: none; }
.last-value { font-size: .8125rem; color: var(--muted); }
.rest-timer { border-radius: 14px; background: var(--chip); color: var(--ink); box-shadow: none; padding: 8px 12px; }
.active-exercise-actions button { min-height: 44px; font-size: .8125rem; }
.active-exercise-actions button[data-add-set] { background: var(--chip); color: var(--brand); box-shadow: none; }
.progress-sections { display: flex; gap: 4px; background: var(--panel-soft); border-radius: 12px; padding: 4px; margin: 20px 0; }
.progress-sections button { flex: 1; border: 0; border-radius: 9px; min-height: 44px; padding: 8px 12px; color: var(--muted); background: transparent; font-weight: 650; }
.progress-sections button[aria-pressed="true"] { color: var(--brand); background: var(--surface); }
.progress-metric-picker { max-width: 340px; margin-bottom: 20px; }
.progress-enhanced #progressTabs { display: none; }
.progress-pace { padding: 22px; border: 1px solid var(--border); border-radius: var(--radius-card); background: var(--surface); }
.skinfold-history-values { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; margin: 0; }
.skinfold-history-values dt { font-weight: 500; }
.skinfold-history-values dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.progress-goal-heading { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 16px; }
.progress-goal-heading h2 { font-size: 1.3rem; margin: 4px 0; }
.progress-review-period { margin: 20px 0 0; color: var(--muted); }
.progress-pace .progress-insight { box-shadow: none; background: var(--panel-soft); }
.progress-pace .progress-insight h3 { font-size: 1.2rem; margin: 6px 0; }
.progress-pace-values { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); gap: 16px; margin: 20px 0; }
.progress-pace-values dt { font-size: .8125rem; color: var(--muted); }
.progress-pace-values dd { margin: 6px 0 0; font-size: 1.25rem; font-weight: 700; }
.progress-pace-values small { font-size: .8125rem; font-weight: 500; }
.progress-pace-comparison p { margin-bottom: 8px; }
.progress-pace-method { color: var(--muted); font-size: .875rem; }
.progress-pace-method summary { cursor: pointer; min-height: 44px; padding: 10px 0; color: var(--ink); }
.progress-pace-method p { margin: 8px 0; }
.analytics-overview-grid.progress-nutrition-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }
.progress-nutrition-label { margin: 0; color: var(--muted); font-size: .8125rem; font-weight: 700; }
.progress-nutrition-grid .analytics-card span + span { margin-top: 8px; }
.progress-nutrition-detail { color: var(--muted); font-size: .875rem; }
.progress-nutrition-detail summary { cursor: pointer; min-height: 44px; padding: 10px 0; color: var(--ink); }
.progress-nutrition-detail p { margin: 8px 0; }
.analytics-card-heading h2 { font-size: 1.125rem; }
.analytics-chart-box { height: 280px; }
.analytics-overview-grid { margin-top: 20px; gap: 16px; }
.analytics-card strong { font-size: 1.35rem; letter-spacing: -.03em; }
.analytics-card span { font-size: .8125rem; }
.progress-insight { margin-top: 20px; padding: 20px; background: var(--surface); border-radius: 14px; }
.progress-current { font-size: 2.25rem; font-weight: 750; letter-spacing: -.05em; margin: 12px 0; }
.progress-current small { letter-spacing: normal; font-weight: 500; color: var(--muted); }
.goal-calories { font-size: 2rem; letter-spacing: -.04em; font-weight: 750; }
.goal-calories small { color: var(--muted); font-weight: 500; letter-spacing: normal; }
.goal-macros { display: flex; gap: 20px; flex-wrap: wrap; margin-top: 16px; }
.goal-macros span { display: flex; flex-direction: column; color: var(--muted); font-size: .8125rem; }
.goal-macros b { color: var(--ink); font-size: 1rem; }
.method-note { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--border); color: var(--muted); font-size: .875rem; }
.method-note summary { cursor: pointer; padding: 8px 0; }
.settings-group { margin-bottom: 28px; }
.settings-group h2 { font-size: .8125rem; color: var(--muted); letter-spacing: .04em; margin: 0 0 12px 4px; }
/* A group holding a form rather than a link list: a card with a real heading, so each
   section reads as its own block instead of a caption above the next set of fields. */
.settings-group--form { border: 1px solid var(--border); border-radius: 16px; background: var(--surface); padding: 20px; }
.settings-group--form h2 { font-size: 1.25rem; font-weight: 700; color: var(--ink); letter-spacing: -.01em; margin: 0 0 16px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.settings-list { border: 1px solid var(--border); border-radius: 16px; background: var(--surface); overflow: hidden; }
.settings-row { display: flex; align-items: center; gap: 16px; min-height: 76px; padding: 16px 20px; text-decoration: none; color: var(--ink); }
.settings-row + .settings-row { border-top: 1px solid var(--border); }
.settings-row > svg:first-child { width: 21px; color: var(--muted); flex-shrink: 0; }
.settings-row > svg:last-child { width: 16px; color: var(--muted); margin-left: auto; flex-shrink: 0; }
.settings-row strong, .settings-row small { display: block; }
.settings-row small { color: var(--muted); }
.settings-row:hover { background: var(--panel-soft); color: var(--ink); }
.onboarding-reminder {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  margin: 0 0 20px;
  padding: 18px;
  border: 1px solid color-mix(in srgb, var(--brand) 40%, var(--border));
  border-radius: 16px;
  background: color-mix(in srgb, var(--brand) 8%, var(--surface));
}
.onboarding-reminder-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  color: var(--brand);
  border-radius: 12px;
  background: color-mix(in srgb, var(--brand) 14%, var(--surface));
}
.onboarding-reminder-icon svg { width: 20px; height: 20px; }
.onboarding-reminder strong { display: block; font-size: 1.05rem; }
.onboarding-reminder p { margin: 3px 0 12px; color: var(--muted); font-size: .875rem; }
.onboarding-reminder > form button {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  color: var(--muted);
  border: 0;
  background: transparent;
}
.onboarding-reminder > form svg { width: 18px; height: 18px; }
.onboarding-hero {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
  padding: clamp(24px, 5vw, 44px);
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow-card);
}
.onboarding-hero > div { max-width: 700px; }
.onboarding-hero h1 { margin: 5px 0 12px; max-width: 650px; font-size: clamp(1.8rem, 5vw, 3rem); line-height: 1.05; letter-spacing: -.045em; }
.onboarding-hero > div > p:last-child { max-width: 640px; margin: 0; color: var(--muted); font-size: 1rem; line-height: 1.6; }
.onboarding-eyebrow { margin: 0; color: var(--brand); font-size: .75rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.onboarding-section { margin-top: clamp(32px, 6vw, 52px); }
.onboarding-section-heading { display: flex; justify-content: space-between; gap: 24px; align-items: end; margin-bottom: 16px; }
.onboarding-section-heading h2 { margin: 4px 0 0; font-size: clamp(1.35rem, 3vw, 1.8rem); letter-spacing: -.03em; }
.onboarding-section-heading > p { max-width: 380px; margin: 0; color: var(--muted); font-size: .875rem; }
.onboarding-steps { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; counter-reset: none; }
.onboarding-step {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
}
.onboarding-step-number {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  color: var(--surface);
  border-radius: 50%;
  background: var(--brand);
  font-weight: 800;
}
.onboarding-step-number svg { width: 18px; height: 18px; }
.onboarding-step.is-complete .onboarding-step-number { color: var(--topbar-bg); background: var(--brand-2); }
.onboarding-step h3 { margin: 0 0 4px; font-size: 1.05rem; }
.onboarding-step p { margin: 0; color: var(--muted); font-size: .875rem; line-height: 1.5; }
.onboarding-finish { display: flex; gap: 14px; align-items: center; margin-top: 18px; }
.onboarding-finish span { color: var(--muted); font-size: .8125rem; }
.onboarding-nav-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.onboarding-nav-grid a { min-width: 0; padding: 18px; color: var(--ink); border: 1px solid var(--border); border-radius: 16px; background: var(--surface); text-decoration: none; }
.onboarding-nav-grid a:hover { border-color: color-mix(in srgb, var(--brand) 55%, var(--border)); }
.onboarding-nav-grid svg { width: 22px; height: 22px; margin-bottom: 18px; color: var(--brand); }
.onboarding-nav-grid strong, .onboarding-nav-grid span { display: block; }
.onboarding-nav-grid span { margin-top: 5px; color: var(--muted); font-size: .8125rem; line-height: 1.45; }
.onboarding-directory { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.onboarding-directory .settings-group { min-width: 0; margin: 0; }
.onboarding-directory .settings-group h3 { margin: 0 0 10px 4px; color: var(--muted); font-size: .8125rem; letter-spacing: .04em; }
.onboarding-directory .settings-row { min-height: 82px; padding: 14px 16px; gap: 12px; }
.onboarding-directory .settings-row > svg:first-child { width: 19px; }
.mobile-records { display: none; }
.record-row { border: 1px solid var(--border); border-radius: 14px; padding: 16px; background: var(--surface); }
.record-row summary { display: flex; justify-content: space-between; align-items: center; gap: 12px; cursor: pointer; }
.record-row summary > span { min-width: 0; }
.record-row strong, .record-row small { display: block; }
.record-row strong { font-size: 1.3rem; font-variant-numeric: tabular-nums; }
.record-row small { color: var(--muted); }
.record-row summary > svg { width: 18px; color: var(--muted); }
.record-row[open] > .record-details { padding-top: 16px; margin-top: 16px; border-top: 1px solid var(--border); }
.record-row .record-details p { margin-bottom: 12px; font-size: .875rem; }
.reading-grid label { font-size: .8125rem; color: var(--muted); }
.reading-input { margin-top: 6px; min-height: 48px; font-size: 1.125rem; }
.reading-summary { font-size: .9375rem; padding: 12px 0 0; border-top: 1px solid var(--border); }
.reading-summary [data-average] { color: var(--ink); font-weight: 700; }
.fold-direction-chip { background: transparent; color: var(--muted); font-size: .75rem; text-transform: none; }
.site-field legend { font-size: 1.05rem; display: flex; align-items: center; justify-content: space-between; }
.help-button { width: 44px; height: 44px; flex-shrink: 0; }
.measurement-form .sticky-action { bottom: calc(80px + env(safe-area-inset-bottom, 0px)); box-shadow: 0 0 0 8px var(--page); }
.reference-search { margin: 20px 0; }
.circumference-form { min-width: 0; }
.circumference-intro { color: var(--muted); font-size: .875rem; margin: 0 0 16px; }
.circumference-unit { max-width: 280px; }
.circumference-section { border-top: 1px solid var(--border); margin-top: 24px; padding-top: 20px; }
.circumference-section h2 { font-size: 1rem; margin: 0 0 16px; }
.circumference-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 16px; }
.circumference-field { min-width: 0; }
.circumference-field > label { display: block; font-size: .875rem; font-weight: 600; margin-bottom: 6px; }
.circumference-input { position: relative; }
.circumference-input .form-control { width: 100%; min-width: 0; height: 48px; min-height: 48px; padding: 10px 36px 10px 12px; font-size: 1rem; border-radius: 10px; }
.circumference-input > span { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: .8125rem; pointer-events: none; }
.circumference-input input { appearance: textfield; -moz-appearance: textfield; }
.tape-connect { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.tape-connect[hidden] { display: none; }
.tape-connect .btn { display: inline-flex; align-items: center; gap: 6px; }
.tape-connect .btn svg { width: 18px; height: 18px; }
.form-control.tape-target { border-color: var(--bs-primary); box-shadow: 0 0 0 3px rgba(var(--bs-primary-rgb), .25); }
.circumference-input input::-webkit-inner-spin-button, .circumference-input input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.circumference-field > small { display: block; color: var(--muted); margin-top: 6px; overflow-wrap: anywhere; }
@media (max-width: 359px) { .circumference-grid { gap: 16px 12px; } }
.reference-index { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.reference-index a { padding: 8px 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); text-decoration: none; font-size: .875rem; }
.reference-card { scroll-margin-top: 90px; }
.fold-guide { display: flex; align-items: center; gap: 12px; padding: 12px 0; color: var(--brand); }
.fold-guide svg { flex-shrink: 0; }
.fold-guide strong, .fold-guide small { display: block; }
.fold-guide small { color: var(--muted); font-size: .8125rem; }
.current-value input { min-height: 48px; font-size: 1.125rem; border-radius: 10px; }
.current-value label > span, .active-exercise-card header p { font-size: .75rem; }
.record-actions summary { cursor: pointer; min-height: 44px; padding: 10px; color: var(--muted); }
.dose-time-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 44px; gap: 8px; }
.dose-time-row > div { width: auto; padding: 0; }
.dose-time-row .remove-dose { width: 44px; padding: 8px; }
.task-complete-button, [data-complete-task] { min-height: 48px; }
.technique-list { border: 0; background: transparent; padding: 8px 0 0 24px; }
.technique-list li { padding: 6px 0 6px 4px; }
.profile-hero { padding: 24px; border-radius: 18px; }
.award-panel.is-empty { border: 0; background: transparent; padding: 8px 0; }
.award-panel.is-empty h2 { font-size: .875rem; }
.auth-panel { max-width: 460px; margin: 24px auto; }
.auth-card { padding: 32px; }
.auth-card h1 { margin-bottom: 8px; }
.auth-intro { color: var(--muted); margin-bottom: 24px; }
.auth-logo { display: none; }
.task-create-panel > summary { padding-block: 4px; }
.task-create-panel[open] { margin-bottom: 24px !important; }
.task-card h2 { font-size: 1.125rem; }
.task-example-list .btn { font-size: .8125rem; }
.medication-card, .task-card { border-radius: 16px; }
[hidden] { display: none !important; }
@media (min-width: 1000px) {
  .app-shell.shell-wide { max-width: 1160px; }
  .home-focus { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); }
  .home-metric { padding: 32px; }
  .weight-sparkline { height: 112px; }
  .analytics-chart-box { height: 340px; }
}
@media (min-width: 720px) {
  .app-tabbar .nav-link, .app-tabbar .nav-link svg { color: #b1c2d6; }
  .app-tabbar .nav-link.active, .app-tabbar .nav-link.active svg { color: #64b5ff; }
  .app-tabbar .nav-link[data-nav-item="activities"] svg { color: #09111d; background: #64b5ff; }
  [data-theme="default"] .app-tabbar .nav-link,
  [data-theme="default"] .app-tabbar .nav-link svg { color: var(--muted); }
  [data-theme="default"] .app-tabbar .nav-link.active,
  [data-theme="default"] .app-tabbar .nav-link.active svg { color: var(--brand); }
  [data-theme="default"] .app-tabbar .nav-link[data-nav-item="activities"] svg { color: var(--page); background: var(--brand); }
  .routine-save-bar, .measurement-form .sticky-action { bottom: 16px; }
}
@media (max-width: 719px) {
  .app-shell { padding-inline: 16px; padding-bottom: calc(100px + env(safe-area-inset-bottom, 0px)) !important; }
  .app-tabbar { padding: 8px 4px calc(8px + env(safe-area-inset-bottom, 0px)); }
  .app-tabbar .nav-link { font-size: .6875rem; padding: 2px 0; min-height: 52px; }
  .app-tabbar .nav-link svg { width: 22px; height: 22px; }
  .app-brand-wordmark { font-size: 1.4rem; }
  .dashboard-card, .workout-panel, .site-field, .analytics-chart-card { padding: 20px; }
  .home-metric { padding: 20px; }
  .onboarding-reminder { grid-template-columns: auto minmax(0, 1fr); }
  .onboarding-reminder > form { position: absolute; top: 4px; right: 4px; }
  .onboarding-reminder > div:nth-child(2) { padding-right: 20px; }
  .onboarding-hero { display: grid; padding: 24px 20px; }
  .onboarding-hero form, .onboarding-hero form .btn { width: 100%; }
  .onboarding-section-heading { display: block; }
  .onboarding-section-heading > p { margin-top: 8px; }
  .onboarding-step { grid-template-columns: 40px minmax(0, 1fr); padding: 18px; }
  .onboarding-step > .btn { grid-column: 1 / -1; width: 100%; }
  .onboarding-finish { align-items: flex-start; flex-direction: column; }
  .onboarding-finish .btn { width: 100%; }
  .onboarding-nav-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .onboarding-nav-grid a:last-child { grid-column: 1 / -1; }
  .onboarding-directory { grid-template-columns: 1fr; gap: 24px; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .analytics-overview-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .analytics-card { padding: 16px; }
  .analytics-card strong { font-size: 1.1rem; }
  .analytics-card-heading { align-items: flex-start; }
  .analytics-range { max-width: 110px; }
  .mobile-records { display: grid; gap: 12px; }
  .records-desktop { display: none; }
  .routine-builder .workout-header-actions { align-items: flex-start; }
  .routine-utility-actions { width: auto; }
  .routine-save-bar .btn { width: 100%; }
  .active-exercise-card { overflow: hidden; }
  .active-exercise-card > header { flex-wrap: wrap; }
  .active-exercise-card > header > div:first-child { width: 100%; }
  .active-exercise-card .exercise-menu { margin-left: auto; }
  .active-set-row { min-width: 0; }
  .active-set-head, .active-set-row-surface { grid-template-columns: 38px minmax(42px, .6fr) minmax(112px, 1.4fr) 44px; }
  .active-set-inputs input { font-size: 1rem; }
  .active-set-head, .active-set { font-size: .75rem; }
  .rest-timer { grid-template-columns: 1fr auto; top: 137px; }
  .auth-card { padding: 24px; }
  body.keyboard-open .app-shell { padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px)) !important; }
  body.keyboard-open .sticky-action, body.keyboard-open .routine-save-bar { bottom: 12px; }
  .photo-single-meta, .photo-compare-selectors { min-width: 0; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; } }

/* Inside the iOS app, UI text is not selectable and a long press shows no copy or link
   preview menu, as in a native app; fields and anything marked .selectable still are.
   The page itself does not rubber-band past the top bar and tab bar either. */
/* Double-tap must not zoom the page; pinch zoom still works for anyone who needs it. */
html { touch-action: manipulation; }
html.native-app { overscroll-behavior: none; }
html.native-app body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
html.native-app :is(input, textarea, select, [contenteditable], .selectable) { -webkit-user-select: text; user-select: text; -webkit-touch-callout: default; }

/* Desktop browsers: the tab bar becomes a website-style text nav beside the wordmark,
   and the header content lines up with the wide page container. The iOS app
   (html.native-app, set in base.html) keeps its own layout at every width. */
.app-tabbar .nav-caret { display: none; }
@media (min-width: 1024px) {
  html:not(.native-app) .app-topbar { padding-inline: max(24px, calc((100vw - 1160px) / 2)); }
  html:not(.native-app) .topbar-back-button { display: none; }
  html:not(.native-app) .app-tabbar {
    top: 0; bottom: auto; right: auto; transform: none; width: auto; height: calc(3.5rem - 1px); padding: 0;
    border: 0; background: transparent; backdrop-filter: none;
    left: calc(max(24px, (100vw - 1160px) / 2) + 150px);
  }
  html:not(.native-app) .app-tabbar .container-fluid { justify-content: flex-start !important; gap: .15rem; height: 100%; padding: 0; }
  html:not(.native-app) .app-tabbar .nav-activity-picker { flex: none; }
  html:not(.native-app) .app-tabbar .nav-link {
    flex-direction: row; gap: .3rem; height: 100%; min-width: 0; min-height: 0; padding: 0 .85rem;
    font-size: .9375rem; font-weight: 650; white-space: nowrap;
  }
  html:not(.native-app) .app-tabbar .nav-link > svg:not(.nav-caret) { display: none; }
  html:not(.native-app) .app-tabbar .nav-link[data-nav-item="activities"] svg.nav-caret {
    display: block; width: 15px; height: 15px; padding: 0; border-radius: 0; background: none; color: currentColor; stroke-width: 2.4;
  }
  html:not(.native-app) .app-tabbar .nav-link:hover { color: var(--ink); }
  html:not(.native-app) .app-tabbar .nav-link.active::after { left: .85rem; right: .85rem; bottom: -1px; width: auto; height: 2px; border-radius: 2px; }
  html:not(.native-app) .app-tabbar .activity-menu { left: 0; transform: translate(0, -8px) scale(.96); transform-origin: top left; }
  html:not(.native-app) .app-tabbar .nav-activity-picker.is-open .activity-menu { transform: translate(0, 0) scale(1); }
}
@media (min-width: 1024px) and (prefers-reduced-motion: reduce) {
  html:not(.native-app) .app-tabbar .activity-menu,
  html:not(.native-app) .app-tabbar .nav-activity-picker.is-open .activity-menu { transform: none; }
}

/* Progress overview: the evidence leads; methods stay available on demand. */
.progress-visual-review { min-width: 0; }
.progress-review-heading { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; }
.progress-review-heading h2 { font-size: 1.2rem; margin: 0; }
.progress-review-heading h3, .progress-waist-summary h3 { font-size: 1rem; margin: 0; }
.progress-review-heading > a, .progress-review-link { display: inline-flex; align-items: center; min-height: 44px; font-size: .875rem; text-underline-offset: 4px; }
.progress-visual-review .progress-pace-values { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 12px 0 4px; font-variant-numeric: tabular-nums; }
.progress-visual-review .progress-pace-values dd { font-size: 1.5rem; }
.progress-visual-review .progress-pace-values small { display: block; color: var(--muted); }
.progress-no-value { font-size: 1rem; }
.progress-direction { display: inline-flex; align-items: center; gap: 6px; font-size: .875rem; font-weight: 600; }
.progress-direction::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: #d97706; }
.progress-direction.is-on-track::before { background: #16a34a; }
.progress-rate-chart { position: relative; height: 110px; margin-top: 12px; }
.progress-chart-caption { color: var(--muted); font-size: .8125rem; margin: 8px 0 12px; }
.progress-weight-figure { margin: 22px 0 8px; }
.progress-weight-figure figcaption { font-size: .875rem; font-weight: 650; display: flex; justify-content: space-between; }
.progress-weight-figure figcaption span { color: var(--muted); font-weight: 400; }
.progress-weight-chart { position: relative; height: 220px; }
.progress-lift { padding: 20px 0 12px; border-top: 1px solid var(--border); }
.progress-lift-change { font-size: 1rem; font-variant-numeric: tabular-nums; }
.progress-lift-values { margin: 12px 0 4px; font-size: 1.25rem; font-weight: 650; font-variant-numeric: tabular-nums; }
.progress-lift-values span { display: block; color: var(--muted); font-size: .8125rem; font-weight: 400; }
.progress-lift-chart { position: relative; height: 150px; }
.progress-waist-summary { border-top: 1px solid var(--border); margin-top: 16px; padding-top: 20px; }
.progress-waist-summary p { margin: 8px 0; }
.progress-visual-review table { font-variant-numeric: tabular-nums; font-size: .8125rem; }
@media (max-width: 380px) {
  .progress-visual-review { padding: 16px; }
  .progress-visual-review .progress-pace-values dd { font-size: 1.3rem; }
}
