@font-face {
  font-family: "Roboto";
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url("./fonts/roboto-latin-variable.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Material Symbols Rounded";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("./fonts/material-symbols-rounded.woff2") format("woff2");
}

:root {
  color-scheme: light;
  --background: #f7f2fa;
  --surface: #fffbfe;
  --surface-container: #f3edf7;
  --surface-container-high: #ece6f0;
  --surface-container-highest: #e6e0e9;
  --surface-variant: #e7e0ec;
  --primary: #65558f;
  --primary-on: #ffffff;
  --primary-container: #eaddff;
  --primary-container-on: #21005d;
  --secondary: #625b71;
  --secondary-container: #e8def8;
  --tertiary: #7d5260;
  --tertiary-container: #ffd8e4;
  --danger: #b3261e;
  --danger-container: #f9dedc;
  --stop: #ba1a1a;
  --stop-on: #ffffff;
  --ink: #1d1b20;
  --muted: #49454f;
  --outline: #79747e;
  --outline-variant: #cac4d0;
  --slider-active: #65558f;
  --slider-inactive: #e8def8;
  --slider-stop: #4a4458;
  --slider-gap: #f7f2fa;
  --nav-background: rgba(255, 251, 255, 0.88);
  --shadow: 0 16px 40px rgba(31, 27, 32, 0.12);
  --shadow-soft: 0 1px 2px rgba(31, 27, 32, 0.12), 0 1px 3px rgba(31, 27, 32, 0.08);
  --state-hover: color-mix(in srgb, var(--primary) 8%, transparent);
  --state-focus: color-mix(in srgb, var(--primary) 22%, transparent);
  font-family: Roboto, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --background: #141218;
  --surface: #211f26;
  --surface-container: #2b2930;
  --surface-container-high: #36343b;
  --surface-container-highest: #45424b;
  --surface-variant: #49454f;
  --primary: #d0bcff;
  --primary-on: #381e72;
  --primary-container: #4f378b;
  --primary-container-on: #eaddff;
  --secondary: #ccc2dc;
  --secondary-container: #4a4458;
  --tertiary: #efb8c8;
  --tertiary-container: #633b48;
  --danger: #f2b8b5;
  --danger-container: #8c1d18;
  --stop: #cf2a27;
  --stop-on: #ffffff;
  --ink: #e6e0e9;
  --muted: #cac4d0;
  --outline: #938f99;
  --outline-variant: #49454f;
  --slider-active: #d0bcff;
  --slider-inactive: #4a4458;
  --slider-stop: #e6e0e9;
  --slider-gap: #141218;
  --nav-background: rgba(33, 31, 38, 0.9);
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.5);
  --shadow-soft: 0 1px 2px rgba(0, 0, 0, 0.42), 0 1px 3px rgba(0, 0, 0, 0.28);
  --state-hover: color-mix(in srgb, var(--primary) 10%, transparent);
  --state-focus: color-mix(in srgb, var(--primary) 26%, transparent);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --background: #141218;
    --surface: #211f26;
    --surface-container: #2b2930;
    --surface-container-high: #36343b;
    --surface-container-highest: #45424b;
    --surface-variant: #49454f;
    --primary: #d0bcff;
    --primary-on: #381e72;
    --primary-container: #4f378b;
    --primary-container-on: #eaddff;
    --secondary: #ccc2dc;
    --secondary-container: #4a4458;
    --tertiary: #efb8c8;
    --tertiary-container: #633b48;
    --danger: #f2b8b5;
    --danger-container: #8c1d18;
    --stop: #cf2a27;
    --stop-on: #ffffff;
    --ink: #e6e0e9;
    --muted: #cac4d0;
    --outline: #938f99;
    --outline-variant: #49454f;
    --slider-active: #d0bcff;
    --slider-inactive: #4a4458;
    --slider-stop: #e6e0e9;
    --slider-gap: #141218;
    --nav-background: rgba(33, 31, 38, 0.9);
    --shadow: 0 18px 48px rgba(0, 0, 0, 0.5);
    --shadow-soft: 0 1px 2px rgba(0, 0, 0, 0.42), 0 1px 3px rgba(0, 0, 0, 0.28);
    --state-hover: color-mix(in srgb, var(--primary) 10%, transparent);
    --state-focus: color-mix(in srgb, var(--primary) 26%, transparent);
  }
}

* {
  box-sizing: border-box;
}

.material-symbols-rounded {
  direction: ltr;
  display: inline-block;
  font-family: "Material Symbols Rounded";
  font-feature-settings: "liga";
  -webkit-font-feature-settings: "liga";
  font-size: 24px;
  font-style: normal;
  font-weight: normal;
  letter-spacing: 0;
  line-height: 1;
  text-rendering: optimizeLegibility;
  text-transform: none;
  white-space: nowrap;
  word-wrap: normal;
  -webkit-font-smoothing: antialiased;
}

html,
body {
  min-height: 100%;
}

html {
  touch-action: manipulation;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--ink);
  overscroll-behavior: none;
}

body.drawer-open {
  overflow: hidden;
}

button,
input,
select {
  font: inherit;
  touch-action: manipulation;
}

button {
  cursor: pointer;
  transition: background-color 140ms ease, box-shadow 140ms ease, color 140ms ease, opacity 140ms ease, transform 140ms ease;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 3px solid var(--state-focus);
  outline-offset: 2px;
}

.app-shell {
  position: relative;
  width: min(1120px, 100%);
  min-height: calc(100vh - 82px);
  margin: 0 auto;
  padding: 18px 18px 82px;
}

.top-bar {
  display: grid;
  grid-template-columns: minmax(112px, 1fr) auto minmax(112px, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 64px;
}

.menu-button {
  justify-self: start;
}

.connect-pill {
  justify-self: end;
}

.menu-button,
.connect-pill {
  min-height: 48px;
  border: 0;
  border-radius: 999px;
  background: var(--primary-container);
  color: var(--primary-container-on);
  font-weight: 780;
}

.menu-button {
  display: grid;
  place-content: center;
  width: 48px;
  padding: 0;
}

.menu-button .material-symbols-rounded {
  font-size: 28px;
}

.menu-button.active {
  background: var(--primary);
  color: var(--primary-on);
}

.drawer-scrim {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(29, 27, 32, 0.36);
  opacity: 0;
  transition: opacity 180ms ease;
}

.drawer-scrim.open {
  opacity: 1;
}

.navigation-drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 80;
  display: flex;
  flex-direction: column;
  width: min(360px, calc(100vw - 56px));
  padding: max(18px, env(safe-area-inset-top)) 12px max(18px, env(safe-area-inset-bottom));
  border-radius: 0 28px 28px 0;
  background: var(--surface-container);
  box-shadow: var(--shadow);
  transform: translateX(-104%);
  transition: transform 220ms cubic-bezier(0.2, 0, 0, 1);
}

.navigation-drawer.open {
  transform: translateX(0);
}

.drawer-header {
  display: grid;
  gap: 3px;
  padding: 10px 16px 18px;
}

.drawer-title {
  color: var(--ink);
  font-size: 1.05rem;
  font-weight: 780;
}

.drawer-subtitle {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 600;
}

.drawer-list {
  display: grid;
  gap: 4px;
}

.drawer-list button {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  padding: 0 18px;
  text-align: left;
  font-weight: 760;
}

.drawer-list .material-symbols-rounded {
  color: var(--muted);
  font-size: 24px;
}

.drawer-list button:hover,
.drawer-list button.active {
  background: var(--primary-container);
  color: var(--primary-container-on);
}

.drawer-list button:hover .material-symbols-rounded,
.drawer-list button.active .material-symbols-rounded {
  color: currentColor;
}

.drawer-divider {
  height: 1px;
  margin: 12px 16px;
  background: var(--outline-variant);
}

.connect-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 112px;
  padding: 0 18px;
}

.connect-pill.connecting {
  color: var(--primary-container-on);
}

.connect-pill.connected {
  background: var(--primary);
  color: var(--primary-on);
}

.connect-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.48;
}

.connect-pill.connected .connect-dot {
  opacity: 1;
}

.connect-pill.connecting .connect-dot {
  animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 0.35;
    transform: scale(0.9);
  }

  50% {
    opacity: 1;
    transform: scale(1.12);
  }
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  min-width: 0;
  text-align: center;
  font-size: 2rem;
  line-height: 1.05;
}

h2 {
  font-size: 1.25rem;
}

h3 {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 780;
  letter-spacing: 0;
}

.screen {
  display: none;
}

[hidden] {
  display: none !important;
}

.screen.active {
  display: block;
}

.screen:not(#screen-workout) {
  padding-bottom: 0;
}

.workout-grid {
  display: grid;
  grid-template-columns: minmax(76px, 120px) minmax(0, 1fr) minmax(76px, 120px);
  gap: 18px;
  align-items: stretch;
  min-height: calc(100vh - 216px);
}

.workout-grid.meter-layout-single {
  grid-template-columns: minmax(76px, 120px) minmax(0, 1fr);
}

.workout-grid.meter-layout-none {
  grid-template-columns: minmax(0, 1fr);
}

.center-console,
.panel {
  background: var(--surface);
  border: 1px solid var(--outline-variant);
  border-radius: 24px;
  box-shadow: var(--shadow-soft);
}

.center-console {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
  min-height: 590px;
  padding: clamp(18px, 4vw, 38px);
}

.center-console.workout-running {
  justify-content: center;
}

.workout-config {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
}

.active-workout {
  display: grid;
  place-items: center;
  min-height: 100%;
}

.active-workout-inner {
  display: grid;
  place-items: center;
  gap: 16px;
  width: 100%;
}

.big-stop-button {
  width: min(440px, 86%);
  aspect-ratio: 1 / 1;
  border: 0;
  border-radius: 999px;
  background: var(--stop);
  color: var(--stop-on);
  box-shadow: 0 22px 60px color-mix(in srgb, var(--stop) 36%, transparent);
  font-size: clamp(3rem, 9vw, 6rem);
  font-weight: 900;
  letter-spacing: 0;
}

.voice-stop-status,
.voice-stop-heard {
  max-width: min(360px, 90%);
  border-radius: 999px;
  padding: 8px 14px;
  text-align: center;
  font-size: 0.88rem;
  font-weight: 760;
}

.voice-stop-status {
  background: var(--surface-container-high);
  color: var(--muted);
}

.voice-stop-status.listening,
.voice-stop-status.starting {
  background: var(--primary-container);
  color: var(--primary-container-on);
}

.voice-stop-status.heard {
  background: var(--primary);
  color: var(--primary-on);
}

.voice-stop-status.error,
.voice-stop-status.unavailable {
  background: var(--danger-container);
  color: var(--danger);
}

.voice-stop-heard {
  overflow: hidden;
  background: var(--surface-container);
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.weight-dial {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) 56px;
  align-items: center;
  gap: 14px;
}

.weight-dial.adaptive {
  grid-template-columns: minmax(0, 1fr);
}

.weight-readout {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  min-height: 156px;
  border-radius: 24px;
  background: var(--surface-container);
  border: 1px solid var(--outline-variant);
}

#weightValue {
  width: 5.1ch;
  min-height: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  padding: 0;
  text-align: center;
  font-size: 7.25rem;
  font-weight: 780;
  line-height: 1;
}

#weightValue:focus {
  outline: 3px solid color-mix(in srgb, var(--primary) 32%, transparent);
  outline-offset: 4px;
}

#weightValue::-webkit-outer-spin-button,
#weightValue::-webkit-inner-spin-button {
  margin: 0;
  appearance: none;
}

#weightValue[type="number"] {
  appearance: textfield;
}

#autoLoadValue {
  color: var(--ink);
  font-size: 7.25rem;
  font-weight: 780;
  line-height: 1;
}

#weightUnit {
  color: var(--muted);
  font-size: 1.8rem;
  font-weight: 750;
}

.mode-readout {
  text-align: center;
  min-height: 34px;
  color: var(--primary);
  font-size: 1.3rem;
  font-weight: 760;
}

.exercise-select-button {
  display: inline-grid;
  grid-template-columns: auto minmax(0, auto);
  justify-content: center;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  max-width: 100%;
  margin-inline: auto;
  border: 1px solid var(--outline-variant);
  border-radius: 999px;
  background: var(--secondary-container);
  color: var(--ink);
  padding: 0 16px;
  font-size: 0.98rem;
  font-weight: 780;
}

.exercise-select-button .material-symbols-rounded {
  color: var(--primary);
  font-size: 20px;
}

.exercise-select-button span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mode-picker {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  min-height: 48px;
  padding: 0 14px;
  border-radius: 16px;
  background: var(--surface-container-high);
  color: var(--muted);
  font-weight: 760;
}

.mode-picker select {
  min-height: 38px;
  border-radius: 12px;
  background: var(--surface);
  font-weight: 760;
}

.toggle-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  min-height: 46px;
  padding: 0 14px;
  border-radius: 16px;
  background: var(--surface-container);
  color: var(--ink);
}

.toggle-row input {
  width: 24px;
  min-height: 24px;
  accent-color: var(--primary);
}

.workout-options {
  display: block;
  padding: 0 12px 12px;
  border-radius: 18px;
  background: var(--surface-container);
}

.workout-options summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 780;
  cursor: pointer;
  list-style: none;
}

.workout-options summary::-webkit-details-marker {
  display: none;
}

.workout-options summary::after {
  content: "+";
  color: var(--tertiary);
  font-size: 1.1rem;
  font-weight: 800;
}

.workout-options[open] summary::after {
  content: "-";
}

.workout-options .toggle-row {
  margin-bottom: 10px;
  background: var(--surface);
  border: 1px solid var(--outline-variant);
}

.control-grid,
.echo-panel,
.profile-control-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.control-grid.single,
.profile-control-grid.single {
  grid-template-columns: 1fr;
}

.echo-panel,
.profile-control-grid {
  margin-top: 12px;
}

.profile-control-select {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.profile-control-select select {
  min-height: 48px;
  border-radius: 14px;
  background: var(--surface);
  font-weight: 760;
}

.profile-toggle-control {
  min-height: 72px;
  border: 1px solid var(--outline-variant);
  background: var(--surface);
}

.mini-stepper {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) 32px;
  gap: 6px;
  min-width: 0;
}

.mini-stepper button {
  min-height: 48px;
  border: 0;
  border-radius: 12px;
  background: var(--secondary-container);
  color: var(--ink);
  font-weight: 900;
}

.mini-stepper input {
  min-width: 0;
  appearance: textfield;
  padding-left: 4px;
  padding-right: 4px;
  text-align: center;
  font-weight: 760;
}

.mini-stepper input::-webkit-outer-spin-button,
.mini-stepper input::-webkit-inner-spin-button {
  margin: 0;
  appearance: none;
}

label,
.settings-row {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

input,
select {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--outline);
  border-radius: 14px;
  background: var(--surface);
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.2;
  padding: 0 14px;
}

.rom-strip,
.profile-telemetry-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.rom-strip > div,
.profile-telemetry-strip > div,
.info-grid > div {
  min-height: 70px;
  padding: 12px;
  border-radius: 18px;
  background: var(--surface-container);
}

.metric-label,
dt {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 760;
  text-transform: uppercase;
}

dd {
  margin: 4px 0 0;
  font-size: 1.05rem;
  font-weight: 760;
}

.action-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.filled-button,
.tonal-button,
.danger-button,
.icon-button {
  min-height: 48px;
  border: 0;
  border-radius: 999px;
  padding: 0 18px;
  font-weight: 780;
}

.filled-button {
  background: var(--primary);
  color: var(--primary-on);
}

.tonal-button {
  background: var(--primary-container);
  color: var(--primary-container-on);
}

.filled-link-button,
.tonal-link-button {
  display: inline-grid;
  min-height: 48px;
  align-items: center;
  justify-items: center;
  border-radius: 999px;
  padding: 0 18px;
  font-weight: 780;
  text-decoration: none;
}

.filled-link-button {
  background: var(--primary);
  color: var(--primary-on);
}

.tonal-link-button {
  background: var(--primary-container);
  color: var(--primary-container-on);
}

.danger-button {
  background: var(--danger-container);
  color: var(--danger);
}

.filled-button:not(:disabled):hover,
.filled-link-button:hover,
.connect-pill.connected:hover {
  box-shadow: 0 2px 8px color-mix(in srgb, var(--primary) 24%, transparent);
}

.tonal-button:not(:disabled):hover,
.tonal-link-button:hover,
.menu-button:hover,
.connect-pill:hover,
.history-date-button:hover,
.mini-stepper button:hover,
.plan-tabs button:hover,
.preset-filter-tabs button:hover {
  background: color-mix(in srgb, var(--primary-container) 78%, var(--primary) 22%);
}

.danger-button:not(:disabled):hover {
  background: color-mix(in srgb, var(--danger-container) 78%, var(--danger) 22%);
}

.icon-button:hover {
  background: var(--surface-container-highest);
}

.filled-button:disabled,
.tonal-button:disabled,
.danger-button:disabled,
.compact-button:disabled {
  background: var(--surface-container-highest);
  color: var(--muted);
  opacity: 0.72;
}

.compact-button {
  min-height: 40px;
  padding-inline: 16px;
}

.icon-button {
  width: 56px;
  padding: 0;
  background: var(--surface-variant);
  color: var(--ink);
  font-size: 1.8rem;
}

.meter-column {
  display: grid;
  align-self: stretch;
  min-height: 590px;
}

.load-meter {
  display: grid;
  grid-template-rows: 1fr auto auto;
  align-items: end;
  justify-items: center;
  gap: 10px;
  min-height: 590px;
  padding: 18px 10px;
}

.load-meter.editable {
  cursor: ns-resize;
  touch-action: none;
}

.load-meter:focus-visible {
  outline: none;
}

.load-meter:focus-visible .meter-track {
  box-shadow: 0 0 0 10px color-mix(in srgb, var(--slider-active) 18%, transparent);
}

.load-meter.editable .meter-track {
  box-shadow: 0 0 0 8px color-mix(in srgb, var(--slider-active) 10%, transparent);
}

.load-meter.editable .meter-fill {
  background: var(--slider-active);
}

.load-meter.editable .meter-fill.right {
  background: var(--slider-active);
}

.meter-track {
  position: relative;
  width: min(78px, 100%);
  height: 100%;
  min-height: 420px;
  overflow: visible;
  border-radius: 999px;
  background: var(--slider-inactive);
  border: 0;
  isolation: isolate;
}

.meter-track::before {
  content: "";
  position: absolute;
  top: 20px;
  left: 50%;
  z-index: 1;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--slider-stop);
  opacity: 0.86;
  transform: translateX(-50%);
}

.meter-fill {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 0%;
  min-height: 0;
  background: var(--slider-active);
  border-radius: 0 0 999px 999px;
  z-index: 2;
  transition: height 160ms linear;
}

.meter-fill::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  z-index: 3;
  width: calc(100% + 12px);
  height: 7px;
  border-radius: 999px;
  background: var(--slider-active);
  box-shadow: 0 0 0 5px var(--slider-gap);
  transform: translate(-50%, -50%);
}

.meter-fill.right {
  background: var(--slider-active);
}

.meter-value {
  min-height: 28px;
  font-size: 1.1rem;
  font-weight: 780;
}

.meter-label {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 760;
}

.panel {
  min-height: calc(100vh - 216px);
  padding: 24px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.panel-head.compact {
  margin-bottom: 12px;
}

.muted {
  color: var(--muted);
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
}

.list-panel,
.about-panel,
.trainer-panel,
.settings-panel,
.history-panel {
  display: grid;
  align-content: start;
  gap: 16px;
  padding-bottom: 104px;
}

.trainer-panel .panel-head {
  margin-bottom: 0;
}

.empty-state {
  display: grid;
  gap: 4px;
  min-height: 88px;
  align-content: center;
  padding: 16px 18px;
  border-radius: 22px;
  background: var(--surface-container);
}

.empty-state strong {
  color: var(--ink);
  font-size: 1rem;
}

.empty-state span {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
}

.plan-toolbar,
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.section-head h3 {
  color: var(--ink);
  font-size: 0.94rem;
}

.plan-tabs,
.preset-filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.plan-tabs button,
.preset-filter-tabs button,
.archive-toggle {
  min-height: 40px;
  border: 0;
  border-radius: 999px;
  background: var(--surface-container-high);
  color: var(--ink);
  padding: 0 14px;
  font-weight: 760;
}

.plan-tabs button.active,
.preset-filter-tabs button.active {
  background: var(--primary);
  color: var(--primary-on);
}

.plan-select-label {
  display: grid;
  grid-template-columns: auto minmax(132px, 220px);
  align-items: center;
  gap: 8px;
  color: var(--muted);
}

.plan-select-label select {
  min-height: 40px;
  border-color: transparent;
  background: var(--surface-container-high);
  font-weight: 760;
}

.exercise-section {
  display: grid;
  gap: 10px;
}

.archive-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-container);
}

.archive-toggle input {
  width: 18px;
  min-height: 18px;
  accent-color: var(--primary);
}

.search-field {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 48px;
  border-radius: 18px;
  background: var(--surface-container);
  color: var(--muted);
  padding: 0 14px;
}

.search-field input {
  min-height: 40px;
  border: 0;
  background: transparent;
  padding: 0;
}

.preset-list,
.catalog-list {
  display: grid;
  gap: 8px;
}

.exercise-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 68px;
  border-radius: 20px;
  background: var(--surface-container);
  padding: 10px 12px 10px 14px;
}

.exercise-row:hover {
  background: color-mix(in srgb, var(--surface-container) 86%, var(--primary) 14%);
}

.exercise-row button {
  min-height: 40px;
}

.exercise-row-actions {
  display: flex;
  gap: 8px;
}

.exercise-row-main {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.exercise-row-title {
  overflow: hidden;
  color: var(--ink);
  font-size: 0.98rem;
  font-weight: 780;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.exercise-row-meta {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 5px;
}

.profile-chip {
  display: inline-grid;
  min-height: 26px;
  align-items: center;
  border-radius: 999px;
  background: var(--secondary-container);
  color: var(--primary-container-on);
  padding: 0 10px;
  font-size: 0.76rem;
  font-weight: 780;
}

.profile-chip.compat-current {
  background: var(--primary-container);
  color: var(--primary-container-on);
}

.profile-chip.compat-compatible {
  background: var(--tertiary-container);
  color: var(--tertiary-container-on);
}

.profile-chip.compat-translatable {
  background: var(--secondary-container);
  color: var(--primary-container-on);
}

.profile-chip.compat-incompatible {
  background: var(--surface-container-highest);
  color: var(--muted);
}

.profile-chip.preset-source {
  background: var(--secondary-container);
  color: var(--primary-container-on);
}

.history-date-button {
  display: inline-grid;
  grid-template-columns: auto minmax(0, auto);
  align-items: center;
  gap: 8px;
  min-height: 44px;
  border: 0;
  border-radius: 999px;
  background: var(--primary-container);
  color: var(--primary-container-on);
  padding: 0 16px;
  font-weight: 780;
}

.history-date-button .material-symbols-rounded {
  font-size: 20px;
}

.date-picker-dialog {
  width: min(440px, calc(100vw - 28px));
  border: 1px solid var(--outline-variant);
  border-radius: 28px;
  background: var(--surface);
  color: var(--ink);
  padding: 0;
  box-shadow: var(--shadow);
}

.date-picker-dialog::backdrop {
  background: rgb(0 0 0 / 0.32);
}

.date-picker {
  display: grid;
  gap: 14px;
  padding: 20px;
}

.date-picker-head {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  align-items: center;
  gap: 8px;
}

.date-picker-head strong {
  text-align: center;
  font-size: 1rem;
}

.date-picker-weekdays,
.date-picker-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
}

.date-picker-weekdays span {
  color: var(--muted);
  text-align: center;
  font-size: 0.72rem;
  font-weight: 780;
}

.date-picker-day {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 0;
  aspect-ratio: 1;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 740;
}

.date-picker-day.outside {
  color: var(--muted);
  opacity: 0.54;
}

.date-picker-day.today {
  box-shadow: inset 0 0 0 1px var(--primary);
}

.date-picker-day.selected {
  background: var(--primary);
  color: var(--primary-on);
}

.date-picker-day.has-workout::after {
  content: "";
  position: absolute;
  bottom: 6px;
  left: 50%;
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: currentColor;
  transform: translateX(-50%);
}

.date-picker-actions {
  display: flex;
  justify-content: end;
  gap: 8px;
}

.history-list {
  display: grid;
  gap: 8px;
}

.history-row {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto 44px;
  align-items: center;
  gap: 12px;
  min-height: 82px;
  border-radius: 22px;
  background: var(--surface-container);
  padding: 12px;
}

.history-row:hover {
  background: color-mix(in srgb, var(--surface-container) 86%, var(--primary) 14%);
}

.history-row-leading {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 16px;
  background: var(--secondary-container);
  color: var(--primary-container-on);
}

.history-row-leading .material-symbols-rounded {
  font-size: 24px;
}

.history-row-main {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.history-row-title {
  overflow: hidden;
  color: var(--ink);
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-row-meta {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 620;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-row-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(58px, auto));
  gap: 8px;
}

.history-row-metrics span {
  display: grid;
  gap: 2px;
  min-width: 58px;
  border-radius: 14px;
  background: var(--surface-container-high);
  padding: 8px 10px;
}

.history-row-metrics small {
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 760;
}

.history-row-metrics strong {
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 840;
  white-space: nowrap;
}

.history-row-open {
  display: grid;
  place-items: center;
  min-width: 44px;
  min-height: 44px;
  border-radius: 999px;
  background: transparent;
  color: var(--primary);
}

.history-row-open:hover {
  background: var(--state-hover);
}

.history-dialog {
  width: min(900px, calc(100vw - 28px));
  max-height: min(860px, calc(100dvh - 32px));
  border: 1px solid var(--outline-variant);
  border-radius: 28px;
  background: var(--surface);
  color: var(--ink);
  padding: 0;
  box-shadow: var(--shadow);
}

.history-dialog::backdrop {
  background: rgb(0 0 0 / 0.32);
}

.history-detail {
  display: grid;
  gap: 16px;
  padding: 22px;
  overflow: auto;
}

.history-detail-head,
.history-detail-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.compact-icon-button {
  width: 44px;
  height: 44px;
}

.history-close-button {
  justify-self: end;
  min-width: 48px;
  width: 48px;
  min-height: 48px;
  height: 48px;
  border-radius: 999px;
  background: var(--surface-container-high);
  color: var(--ink);
  box-shadow: none;
}

.history-close-button .material-symbols-rounded {
  font-size: 24px;
}

.history-close-button:hover {
  background: var(--surface-container-highest);
}

.history-close-button:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--primary) 36%, transparent);
  outline-offset: 2px;
}

.history-stat-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.history-stat {
  display: grid;
  gap: 4px;
  min-height: 82px;
  align-content: start;
  border-radius: 18px;
  background: var(--surface-container);
  padding: 12px;
}

.history-stat span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 760;
}

.history-stat strong {
  color: var(--ink);
  font-size: 1.05rem;
}

.history-stat small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 650;
  line-height: 1.25;
}

.history-chart-card {
  display: grid;
  gap: 10px;
  border-radius: 18px;
  background: var(--surface-container);
  padding: 14px;
}

.history-chart-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.history-chart-head h3 {
  margin: 0;
  color: var(--ink);
  font-size: 1rem;
}

.history-chart-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: end;
  gap: 6px;
}

.history-chart-legend-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  border-radius: 999px;
  background: var(--surface-container-high);
  color: var(--ink);
  padding: 0 10px;
  font-size: 0.74rem;
  font-weight: 760;
}

.history-chart-legend-chip > span:first-child {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--primary);
}

.history-chart-legend-chip.series-1 > span:first-child {
  background: var(--tertiary);
}

.history-chart-legend-chip.series-2 > span:first-child {
  background: var(--secondary);
}

.history-chart-legend-chip.series-mean > span:first-child {
  background: var(--ink);
}

.history-chart {
  width: 100%;
  min-height: 280px;
  overflow: visible;
  border-radius: 16px;
  background: var(--surface);
}

.history-chart path,
.history-chart line {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.history-chart-plot {
  fill: var(--surface);
  stroke: var(--outline-variant);
  stroke-width: 1;
}

.history-chart-grid {
  stroke: var(--outline-variant);
  stroke-width: 1;
  opacity: 0.58;
}

.history-chart-axis {
  stroke: var(--outline);
  stroke-width: 1.2;
}

.history-chart-axis-label,
.history-chart-threshold-label,
.history-chart-empty {
  fill: var(--muted);
  font-size: 12px;
  font-weight: 720;
}

.history-chart-threshold {
  stroke: var(--primary);
  stroke-width: 1.5;
  stroke-dasharray: 6 6;
  opacity: 0.72;
}

.history-chart-threshold.avg {
  stroke: var(--ink);
  stroke-dasharray: none;
  opacity: 0.55;
}

.history-chart-threshold.min,
.history-chart-threshold.max {
  stroke: var(--tertiary);
}

.history-chart-series {
  filter: drop-shadow(0 1px 1px rgb(0 0 0 / 0.08));
}

.history-chart-point {
  stroke: var(--surface);
  stroke-width: 1.6;
}

.history-channel-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.history-channel-card {
  display: grid;
  gap: 10px;
  border-radius: 16px;
  background: var(--surface-container);
  padding: 12px;
}

.history-channel-card > strong {
  color: var(--ink);
  font-size: 0.92rem;
}

.history-channel-card > small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 650;
}

.history-channel-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.history-channel-stats span {
  display: grid;
  gap: 2px;
  border-radius: 12px;
  background: var(--surface-container-high);
  padding: 8px;
}

.history-channel-stats small {
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 760;
}

.history-channel-stats b {
  color: var(--ink);
  font-size: 0.84rem;
}

.about-head {
  display: grid;
  gap: 4px;
}

.settings-title {
  display: flex;
  align-items: center;
  min-height: 32px;
}

.settings-section {
  display: grid;
  gap: 10px;
}

.settings-section h3 {
  padding-inline: 2px;
  color: var(--ink);
  font-size: 0.94rem;
}

.settings-list {
  overflow: hidden;
  border-radius: 22px;
  background: var(--surface-container);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--outline-variant) 78%, transparent);
}

.profile-settings-list {
  margin-top: 12px;
}

.settings-panel {
  width: min(760px, 100%);
  gap: 14px;
  margin-inline: auto;
  padding: 22px 24px 104px;
}

.settings-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(132px, 220px);
  align-items: center;
  gap: 16px;
  min-height: 64px;
  padding: 8px 14px 8px 18px;
  border-bottom: 1px solid color-mix(in srgb, var(--outline-variant) 82%, transparent);
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 760;
}

.settings-item:hover {
  background: var(--state-hover);
}

.settings-item:last-child {
  border-bottom: 0;
}

.settings-item-warning {
  background: color-mix(in srgb, var(--danger-container) 55%, var(--surface-container));
}

.settings-item-warning .settings-copy > span,
.settings-item-warning .settings-value {
  color: var(--danger);
}

.settings-item-stack {
  grid-template-columns: 1fr;
  align-items: stretch;
  gap: 10px;
  padding-block: 12px;
}

.diagnostic-action-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.settings-copy {
  display: grid;
  min-width: 0;
  color: var(--ink);
}

.settings-copy:only-child {
  grid-column: 1 / -1;
}

.settings-copy > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-copy small {
  margin-top: 2px;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-value {
  overflow: hidden;
  color: var(--ink);
  font-weight: 780;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-item input,
.settings-item select {
  min-height: 42px;
  border-color: transparent;
  border-radius: 16px;
  background: var(--surface);
  font-weight: 700;
}

.channel-role-list {
  display: grid;
  gap: 8px;
}

.channel-role-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(120px, 180px);
  align-items: center;
  gap: 10px;
  min-height: 46px;
  border-radius: 16px;
  background: var(--surface);
  padding: 6px 8px 6px 12px;
}

.channel-role-row span {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-weight: 760;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.channel-role-row select {
  min-height: 36px;
  background: var(--surface-container);
}

.channel-role-value {
  justify-self: end;
  min-width: 96px;
  border-radius: 14px;
  background: var(--surface-container);
  color: var(--muted);
  padding: 9px 12px;
  text-align: center;
  font-weight: 760;
}

.switch-control {
  position: relative;
  justify-self: end;
  width: 52px;
  height: 32px;
}

.switch-control input {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  min-height: 100%;
  margin: 0;
  opacity: 0;
}

.switch-control span {
  position: absolute;
  inset: 0;
  border: 2px solid var(--outline);
  border-radius: 999px;
  background: var(--surface-container-highest);
  transition: background 140ms ease, border-color 140ms ease;
}

.switch-control span::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 7px;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: var(--outline);
  transform: translateY(-50%);
  transition: left 140ms ease, width 140ms ease, height 140ms ease, background 140ms ease;
}

.switch-control input:checked + span {
  border-color: var(--primary);
  background: var(--primary);
}

.switch-control input:checked + span::after {
  left: 24px;
  width: 22px;
  height: 22px;
  background: var(--primary-on);
}

.switch-control input:focus-visible + span {
  outline: 3px solid color-mix(in srgb, var(--primary) 28%, transparent);
  outline-offset: 2px;
}

.auth-shell {
  min-height: 100dvh;
  align-content: center;
}

.auth-panel {
  width: min(560px, 100%);
  gap: 18px;
  margin: auto;
}

.auth-panel h1 {
  margin: 0;
  color: var(--ink);
  font-size: 1.7rem;
}

.auth-status {
  min-height: 44px;
  border-radius: 18px;
  padding: 12px 14px;
  background: var(--surface-container);
  color: var(--muted);
  font-weight: 650;
}

.turnstile-widget {
  display: grid;
  justify-content: center;
  min-height: 65px;
}

.stacked-actions {
  grid-template-columns: 1fr;
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: repeat(4, minmax(72px, 1fr));
  gap: 4px;
  width: min(620px, calc(100% - 24px));
  min-height: 62px;
  padding: 6px;
  border: 1px solid var(--outline-variant);
  border-radius: 22px;
  background: var(--nav-background);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.bottom-nav button {
  display: grid;
  place-items: center;
  gap: 2px;
  border: 0;
  border-radius: 18px;
  background: transparent;
  color: var(--muted);
  font-weight: 760;
  line-height: 1;
}

.bottom-nav button.active {
  color: var(--primary-container-on);
}

.bottom-nav .material-symbols-rounded {
  display: grid;
  min-width: 64px;
  min-height: 32px;
  place-items: center;
  border-radius: 999px;
  font-size: 20px;
}

.bottom-nav button.active .material-symbols-rounded {
  background: var(--primary-container);
}

.debug-overlay-scrim {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: color-mix(in srgb, var(--ink) 42%, transparent);
}

.debug-overlay {
  position: fixed;
  inset: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom));
  z-index: 81;
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: min(720px, calc(100% - 24px));
  margin: 0 auto;
  padding: 14px;
  border: 1px solid var(--outline-variant);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.debug-overlay-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.debug-overlay-header p {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 560;
}

.debug-overlay-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.debug-overlay-content {
  flex: 1;
  min-height: 0;
  margin: 0;
  overflow: auto;
  padding: 12px;
  border: 1px solid var(--outline-variant);
  border-radius: 16px;
  background: var(--surface-container);
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.78rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 92px;
  transform: translateX(-50%) translateY(16px);
  max-width: calc(100% - 32px);
  min-height: 44px;
  padding: 12px 18px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--surface);
  opacity: 0;
  pointer-events: none;
  transition: opacity 150ms ease, transform 150ms ease;
}

.toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (min-width: 761px) {
  .screen:not(#screen-workout) {
    height: calc(100vh - 166px);
  }

  .screen:not(#screen-workout) .panel {
    height: 100%;
    min-height: 0;
    overflow: auto;
    scroll-padding-bottom: 104px;
  }
}

@media (max-width: 760px) {
  body {
    overflow: hidden;
  }

  .app-shell {
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
    padding: 8px 8px 64px;
  }

  .top-bar {
    grid-template-columns: minmax(100px, 1fr) auto minmax(100px, 1fr);
    gap: 6px;
    min-height: 44px;
  }

  h1 {
    font-size: 0.98rem;
  }

  .menu-button {
    width: 42px;
    min-height: 42px;
  }

  .connect-pill {
    min-width: 100px;
    min-height: 42px;
    padding: 0 12px;
    font-size: 0.86rem;
  }

  .navigation-drawer {
    width: min(320px, calc(100vw - 56px));
    padding-top: max(24px, env(safe-area-inset-top));
    border-radius: 0 24px 24px 0;
  }

  .drawer-header {
    padding-top: 24px;
    padding-bottom: 24px;
  }

  .drawer-title {
    font-size: 1rem;
  }

  .drawer-list button {
    min-height: 56px;
    padding-inline: 20px;
  }

  .workout-grid {
    grid-template-columns: 56px minmax(0, 1fr) 56px;
    gap: 8px;
    height: calc(100dvh - 122px);
    min-height: 0;
  }

  .workout-grid.meter-layout-single {
    grid-template-columns: 56px minmax(0, 1fr);
  }

  .workout-grid.meter-layout-none {
    grid-template-columns: minmax(0, 1fr);
  }

  .center-console {
    justify-content: start;
    gap: 7px;
    height: 100%;
    min-height: 0;
    padding: 9px;
    border-radius: 20px;
  }

  .workout-config {
    justify-content: start;
    gap: 8px;
    min-height: 100%;
  }

  .center-console.workout-running {
    justify-content: center;
  }

  .big-stop-button {
    width: min(210px, 86%);
    font-size: 3rem;
  }

  .active-workout-inner {
    gap: 10px;
  }

  .voice-stop-status,
  .voice-stop-heard {
    max-width: 94%;
    padding: 7px 11px;
    font-size: 0.72rem;
  }

  .meter-column {
    height: 100%;
    min-height: 0;
  }

  .load-meter {
    gap: 5px;
    height: 100%;
    min-height: 0;
    padding: 8px 0;
  }

  .meter-track {
    width: 44px;
    min-height: 0;
  }

  .meter-track::before {
    top: 15px;
    width: 5px;
    height: 5px;
  }

  .meter-fill::after {
    width: calc(100% + 9px);
    height: 5px;
    box-shadow: 0 0 0 4px var(--slider-gap);
  }

  .weight-dial {
    grid-template-columns: 34px minmax(0, 1fr) 34px;
    gap: 4px;
  }

  .weight-dial.adaptive {
    grid-template-columns: minmax(0, 1fr);
  }

  .icon-button {
    width: 34px;
    min-height: 34px;
    font-size: 1.35rem;
  }

  .weight-readout {
    min-height: 78px;
    gap: 4px;
    border-radius: 20px;
  }

  #weightValue {
    width: 5.2ch;
    font-size: 2.55rem;
  }

  #weightUnit {
    font-size: 0.78rem;
  }

  .weight-dial.adaptive #weightValue {
    font-size: 2.85rem;
  }

  #autoLoadValue,
  .weight-dial.adaptive #autoLoadValue {
    font-size: 2.85rem;
  }

  .mode-readout {
    min-height: 24px;
    font-size: 1rem;
  }

  .exercise-select-button {
    min-height: 40px;
    padding-inline: 13px;
    font-size: 0.9rem;
  }

  .mode-picker {
    grid-template-columns: 44px minmax(0, 1fr);
    min-height: 38px;
    padding: 0 8px;
    border-radius: 14px;
    font-size: 0.78rem;
  }

  .mode-picker select {
    min-height: 32px;
    padding: 0 8px;
    border-radius: 10px;
    font-size: 1rem;
  }

  .toggle-row {
    min-height: 36px;
    padding: 0 10px;
    font-size: 0.82rem;
  }

  .workout-options {
    padding: 0 8px 8px;
    border-radius: 14px;
  }

  .workout-options summary {
    min-height: 34px;
    font-size: 0.78rem;
  }

  .workout-options .toggle-row {
    margin-bottom: 7px;
  }

  .control-grid,
  .echo-panel,
  .profile-control-grid,
  .rom-strip,
  .action-row {
    gap: 7px;
  }

  .control-grid,
  .echo-panel,
  .profile-control-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .rom-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .rom-strip > div {
    min-height: 50px;
    padding: 8px;
    border-radius: 14px;
  }

  input,
  select,
  .filled-button,
  .tonal-button,
  .danger-button {
    min-height: 38px;
    padding-left: 10px;
    padding-right: 10px;
    border-radius: 12px;
  }

  input,
  select {
    font-size: 1rem;
  }

  .filled-button,
  .tonal-button,
  .danger-button {
    font-size: 0.88rem;
  }

  .mini-stepper {
    grid-template-columns: 30px minmax(0, 1fr) 30px;
    gap: 4px;
  }

  .mini-stepper button {
    min-height: 38px;
    border-radius: 12px;
    font-size: 0.9rem;
  }

  .mini-stepper input {
    padding-left: 0;
    padding-right: 0;
    font-size: 1rem;
  }

  label,
  .settings-item,
  .meter-label {
    font-size: 0.76rem;
  }

  .metric-label,
  dt {
    font-size: 0.68rem;
  }

  .meter-value,
  dd {
    font-size: 0.86rem;
  }

  .screen:not(#screen-workout) {
    height: calc(100dvh - 144px - env(safe-area-inset-bottom));
    padding-bottom: 0;
  }

  .panel {
    height: 100%;
    min-height: 0;
    overflow: auto;
    padding: 16px 16px calc(108px + env(safe-area-inset-bottom));
    scroll-padding-bottom: calc(108px + env(safe-area-inset-bottom));
  }

  body.drawer-open .panel {
    overflow: hidden;
  }

  .info-grid {
    grid-template-columns: 1fr;
  }

  .settings-item {
    grid-template-columns: minmax(0, 1fr) minmax(112px, 42%);
    gap: 10px;
    min-height: 60px;
    padding: 8px 12px;
  }

  .settings-copy > span {
    white-space: normal;
  }

  .settings-copy small {
    white-space: normal;
  }

  .settings-value {
    text-align: left;
  }

  .settings-item-stack {
    grid-template-columns: 1fr;
    align-items: stretch;
    gap: 8px;
    padding-block: 10px;
  }

  .settings-item input,
  .settings-item select {
    min-height: 40px;
  }

  .diagnostic-action-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .debug-overlay {
    inset: max(8px, env(safe-area-inset-top)) 8px max(72px, env(safe-area-inset-bottom));
    width: calc(100% - 16px);
    padding: 12px;
    border-radius: 20px;
  }

  .settings-list {
    border-radius: 18px;
  }

  .settings-section {
    gap: 7px;
  }

  .plan-toolbar,
  .plan-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .section-head {
    align-items: center;
    flex-direction: row;
  }

  .section-head .compact-button {
    min-width: auto;
    white-space: nowrap;
  }

  .plan-select-label {
    grid-template-columns: 1fr;
  }

  .plan-tabs,
  .preset-filter-tabs {
    gap: 6px;
  }

  .plan-tabs button,
  .preset-filter-tabs button,
  .archive-toggle {
    min-height: 36px;
    padding-inline: 12px;
    font-size: 0.88rem;
  }

  .archive-toggle {
    width: fit-content;
  }

  .search-field {
    min-height: 46px;
    border-radius: 22px;
  }

  .exercise-row {
    grid-template-columns: minmax(0, 1fr);
    min-height: 72px;
    border-radius: 22px;
    padding: 12px 14px;
  }

  .exercise-row-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .exercise-row button {
    width: 100%;
  }

  .history-date-filter,
  .history-row {
    grid-template-columns: minmax(0, 1fr) 44px;
  }

  .history-row-leading {
    display: none;
  }

  .history-row {
    grid-template-areas:
      "main open"
      "metrics metrics";
    align-items: start;
    gap: 10px;
    min-height: 0;
    padding: 14px 16px;
    border-radius: 24px;
  }

  .history-row-main {
    grid-area: main;
  }

  .history-row-title,
  .history-row-meta {
    white-space: normal;
  }

  .history-row-meta {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .history-row-metrics {
    grid-area: metrics;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .history-row-open {
    grid-area: open;
    width: 44px;
    min-width: 44px;
    min-height: 44px;
    border-radius: 999px;
    background: var(--surface-container-high);
  }

  .history-dialog {
    width: calc(100vw - 16px);
    max-height: calc(100dvh - 20px);
    border-radius: 24px;
  }

  .date-picker-dialog {
    width: calc(100vw - 16px);
    border-radius: 24px;
  }

  .history-detail {
    gap: 12px;
    padding: 16px;
  }

  .history-detail-head,
  .history-detail-actions,
  .history-chart-head {
    align-items: stretch;
    flex-direction: column;
  }

  .history-detail-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 48px;
    align-items: start;
  }

  .history-detail-head > div:first-child {
    min-width: 0;
  }

  .history-detail-head h2 {
    font-size: 1.16rem;
    line-height: 1.15;
  }

  .history-close-button {
    width: 48px;
    min-height: 48px;
    height: 48px;
  }

  .history-stat-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .history-stat {
    min-height: 70px;
    border-radius: 16px;
    padding: 8px 9px;
  }

  .history-stat span {
    font-size: 0.68rem;
  }

  .history-stat strong {
    font-size: 0.98rem;
  }

  .history-stat small {
    font-size: 0.62rem;
    line-height: 1.16;
  }

  .history-chart-legend {
    justify-content: start;
  }

  .history-chart {
    min-height: 240px;
  }

  .history-channel-grid {
    grid-template-columns: 1fr;
  }

  .bottom-nav {
    bottom: 6px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    width: calc(100% - 16px);
    min-height: 58px;
    border-radius: 18px;
  }

  .bottom-nav button {
    border-radius: 13px;
    font-size: 0.68rem;
  }

  .bottom-nav .material-symbols-rounded {
    font-size: 19px;
  }

  .toast {
    bottom: 64px;
  }
}

@media (max-width: 360px) {
  .top-bar {
    grid-template-columns: minmax(86px, 1fr) auto minmax(86px, 1fr);
    gap: 4px;
  }

  h1 {
    font-size: 0.86rem;
  }

  .menu-button {
    width: 38px;
    min-height: 38px;
  }

  .connect-pill {
    min-width: 86px;
    min-height: 38px;
    gap: 5px;
    padding: 0 8px;
    font-size: 0.74rem;
  }

  .connect-dot {
    width: 7px;
    height: 7px;
  }
}
