/* Shared pilot foundation, BRAND.md v20. No layout/navigation changes. */
:root body {
  -webkit-tap-highlight-color: transparent;
  font: 400 var(--type-body)/1.5 var(--font-text);
}
:root body h1 {
  font-size: var(--type-title-xl);
  font-weight: 700;
}
:root body h2 {
  font-size: var(--type-title);
  font-weight: 700;
}
:root body h3 {
  font-size: var(--type-heading);
  font-weight: 700;
}
.title-xl {
  font: 700 var(--type-title-xl)/1.2 var(--font-text);
}
.title {
  font: 700 var(--type-title)/1.3 var(--font-text);
}
.heading {
  font: 700 var(--type-heading)/1.5 var(--font-text);
}
.body {
  font: 400 var(--type-body)/1.5 var(--font-text);
}
.body-small {
  font: 400 var(--type-body-small)/1.5 var(--font-text);
}
.label {
  font: 700 var(--type-label)/1.5 var(--font-text);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.caption {
  font: 500 var(--type-caption)/1.5 var(--font-text);
}
.score-hero,
.score,
.stat,
.number-sm {
  font-family: var(--font-number);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.score-hero {
  font-size: var(--type-score-hero);
}
.score {
  font-size: var(--type-score);
}
.stat {
  font-size: var(--type-stat);
}
.number-sm {
  font-size: var(--type-number-sm);
}
:root body .cd-card,
:root body .card {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line-strong);
  box-shadow: none;
  border-radius: var(--radius-16);
  padding: var(--space-16);
}
:root body .cd-card--hero {
  background: var(--card-hero);
  border-radius: var(--radius-20);
  padding: var(--space-20);
}
:root body .cd-card--list {
  background: transparent;
  border-radius: 0;
  padding: 0;
}
.cd-card--list > * + * {
  border-top: 1px solid var(--line);
}
:root body .cd-btn--secondary,
:root body .secondary-button,
:root body .tiny-button,
:root body .icon-button,
:root body .workout-finish {
  background: var(--raised);
  color: var(--ink);
  border: 1px solid var(--line-strong);
}
:root body .cd-btn--primary,
:root body .primary-button {
  background: var(--brand);
  color: var(--on-brand);
  border-color: transparent;
}
:root body button:disabled {
  background: var(--raised);
  color: var(--ink-muted);
  opacity: 1;
}
:root body a:not(.cd-btn):not(.nav-link):not(.primary-button):not(.secondary-button) {
  color: var(--ink);
  text-decoration: underline;
}
/* Preserve focus and keyboard operation without leaving a ring after pointer input. */
:focus:not(:focus-visible),
:root[data-focus-input='pointer'] :focus {
  outline: none !important;
}
/* One focus rule applies to native and custom keyboard controls, across screen CSS. */
:focus-visible {
  outline: 2px solid var(--focus-ring) !important;
  outline-offset: 2px !important;
}
:root body .cd-segmented {
  background: var(--canvas);
  border: 1px solid var(--line);
  padding: 4px;
  gap: 4px;
}
:root body .cd-segmented button {
  padding: 8px 12px;
  font-size: var(--type-caption);
  color: var(--ink-muted);
}
:root body .cd-segmented button[aria-pressed='true'] {
  background: var(--raised);
  color: var(--ink);
}
:root body .is-done,
:root body .is-done .status-tag {
  background: var(--surface);
  color: var(--good-text);
}
:root body .cd-stat__value {
  font-size: var(--type-score);
  font-weight: 600;
}
:root body .cd-stat__label,
:root body .home-eyebrow {
  font-size: var(--type-caption);
  font-weight: 700;
}
/* Screen-specific selector classes share the same segmented control treatment. */
:root body .react-segmented {
  background: var(--canvas);
  border: 1px solid var(--line);
  padding: 4px;
  gap: 4px;
}
:root body .react-segmented button {
  padding: 8px 12px;
  min-height: var(--target-min);
  font-size: var(--type-caption);
  font-weight: 500;
  background: transparent;
  color: var(--ink-muted);
  border: 0;
}
:root body .react-segmented button[aria-selected='true'],
:root body .react-segmented button[aria-pressed='true'] {
  background: var(--raised);
  color: var(--ink);
  box-shadow: none;
}
:root body .react-filter-chips button[aria-pressed='true'],
:root body .react-choice-chips button[aria-pressed='true'] {
  background: var(--brand-soft);
  color: var(--brand-text);
  border-color: var(--brand-text);
}

/* Page sections are separated by hierarchy and spacing, not an enclosing frame.
   Standalone cards, form controls and actions keep their own surfaces and edges. */
:root body .section-surface,
:root body .cd-btn.section-surface {
  border: 0;
  box-shadow: none;
}

:root body .settings-group-title {
  font-size: var(--type-label);
  font-weight: 700;
}

@media (prefers-contrast: more) {
  :root {
    --line-strong: #b3bfba;
    --ink-muted: #c7d2ce;
  }
  :root[data-theme='light'] {
    --line-strong: #394b42;
    --ink-muted: #354b40;
  }
}
