/* Locally bundled OFL fonts; provenance and licenses are in fonts/. */
@font-face {
  font-family: Manrope;
  src: url('../fonts/manrope-latin-variable.woff2') format('woff2');
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Barlow Condensed';
  src: url('../fonts/barlow-condensed-latin-600.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Barlow Condensed';
  src: url('../fonts/barlow-condensed-latin-700.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
/* cd-root scopes the foundation typography; existing app elements are untouched. */
.cd-root {
  font-family: var(--font-text);
  color: var(--text);
}
.cd-root *,
.cd-root *::before,
.cd-root *::after {
  box-sizing: border-box;
}
.cd-number {
  font-family: var(--font-number);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.cd-root button {
  font-family: inherit;
}
.cd-root button:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}
.cd-root button:disabled {
  cursor: not-allowed;
  background: var(--raised);
  color: var(--muted);
  border-color: var(--line);
}
.cd-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-8);
  min-width: var(--target-min);
  min-height: var(--target-min);
  max-width: 100%;
  padding: var(--space-12) var(--space-20);
  border: 1px solid var(--line);
  border-radius: var(--radius-12);
  background: var(--surface);
  color: var(--text);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.4;
  text-align: center;
  cursor: pointer;
}
.cd-btn--primary {
  min-height: var(--button-primary-height);
  background: var(--accent);
  color: var(--on-accent);
  border-color: var(--accent);
}
.cd-btn--secondary {
  background: var(--raised);
  color: var(--text);
  border-color: var(--line);
}
.cd-btn--danger {
  background: var(--bad);
  color: var(--on-bad);
  border-color: var(--bad);
}
.cd-btn:hover:not(:disabled) {
  box-shadow: inset 0 0 0 1px currentColor;
}
.cd-card {
  padding: var(--space-20);
  border: 1px solid var(--line);
  border-radius: var(--radius-16);
  background: var(--surface);
  color: var(--text);
  min-width: 0;
}
.cd-card--raised {
  background: var(--raised);
  border-radius: var(--radius-12);
}
.cd-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-8);
  padding: var(--space-4) var(--space-12);
  border: 1px solid var(--line);
  border-radius: var(--radius-20);
  background: var(--raised);
  color: var(--text);
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.6;
}
.cd-chip::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted);
  flex: none;
}
.cd-chip--good::before {
  background: var(--good);
}
.cd-chip--warn::before {
  background: var(--warn);
}
.cd-chip--bad::before {
  background: var(--bad);
}
.cd-chip--neutral::before {
  background: var(--muted);
}
.cd-stat {
  display: grid;
  gap: var(--space-4);
  min-width: 0;
}
.cd-stat__label {
  font-size: var(--type-caption);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.cd-stat__value {
  font-family: var(--font-number);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 3rem;
  line-height: 1.1;
}
.cd-stat__change {
  font-size: 0.8125rem;
  color: var(--muted);
  font-weight: 600;
}
.cd-stat__change--good {
  color: var(--good-text);
}
.cd-segmented {
  display: flex;
  gap: var(--space-4);
  padding: var(--space-4);
  border: 1px solid var(--line);
  border-radius: var(--radius-12);
  background: var(--raised);
}
.cd-segmented button {
  flex: 1;
  min-width: var(--target-min);
  min-height: var(--target-min);
  border: 0;
  border-radius: var(--radius-10);
  background: transparent;
  color: var(--muted);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
}
.cd-segmented button[aria-pressed='true'] {
  background: var(--accent);
  color: var(--on-accent);
}
.cd-numpad {
  display: grid;
  grid-template-columns: repeat(8, minmax(var(--target-min), 1fr));
  gap: 1px;
  max-width: 480px;
}
.cd-numpad button {
  min-width: var(--target-min);
  min-height: var(--target-min);
  padding: var(--space-4);
  border: 1px solid var(--line);
  border-radius: var(--radius-10);
  background: var(--raised);
  color: var(--text);
  font-family: var(--font-number);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  font-size: 1.5rem;
  cursor: pointer;
}
.cd-numpad button[aria-pressed='true'] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}
.cd-dexter {
  display: flex;
  align-items: center;
  gap: var(--space-12);
  padding: var(--space-16);
  border-radius: var(--radius-12);
  background: var(--accent-soft);
  color: var(--text);
}
.cd-dexter__icon {
  width: 24px;
  height: 24px;
  flex: none;
  color: var(--accent-text);
}
.cd-dexter__copy {
  display: grid;
  gap: var(--space-4);
  min-width: 0;
  font-size: 0.875rem;
  line-height: 1.5;
}
.cd-dexter__copy span {
  color: var(--muted);
}
.cd-tabbar {
  display: flex;
  justify-content: space-around;
  gap: var(--space-4);
  padding: var(--space-8);
  padding-bottom: max(var(--space-8), env(safe-area-inset-bottom));
  border: 1px solid var(--line);
  border-radius: var(--radius-16);
  background: var(--surface);
}
.cd-tabbar button {
  display: grid;
  place-content: center;
  justify-items: center;
  gap: var(--space-4);
  flex: 1;
  min-width: var(--target-min);
  min-height: 56px;
  border: 0;
  border-radius: var(--radius-10);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.cd-tabbar svg {
  width: 24px;
  height: 24px;
}
.cd-tabbar button::after {
  content: '';
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: transparent;
}
.cd-tabbar button[aria-current='page'] {
  color: var(--accent-text);
}
.cd-tabbar button[aria-current='page']::after {
  background: var(--accent);
}
