/* ─────────────────────────────────────────────────────
   Gym Tracker · Industrial Hi-Vis
   Graphite base + safety-yellow accent. Heavy weights,
   brutalist 2px borders, big-number statements.
   Used one-handed in a gym on mobile.
   ───────────────────────────────────────────────────── */

:root {
  color-scheme: dark;

  /* surfaces — pure graphite, no warm tint */
  --bg:             oklch(20% 0 0);
  --surface:        oklch(24% 0 0);
  --surface-2:      oklch(28% 0 0);
  --surface-soft:   oklch(22% 0 0);
  --surface-sunken: oklch(16% 0 0);

  /* ink */
  --fg:           oklch(98% 0 0);
  --ink-soft:     oklch(84% 0 0);
  --muted:        oklch(58% 0 0);
  --muted-strong: oklch(72% 0 0);

  /* lines — brutalist, full-strength */
  --line:        oklch(40% 0 0);
  --line-strong: oklch(58% 0 0);

  /* one accent — safety-yellow, used at most twice per screen */
  --accent:      oklch(88% 0.20 95);
  --accent-ink:  oklch(14% 0.06 95);
  --accent-soft: oklch(32% 0.10 95);
  --accent-dim:  oklch(52% 0.14 95);

  /* status */
  --warn:        oklch(78% 0.16 60);
  --warn-soft:   oklch(28% 0.06 60);
  --danger:      oklch(70% 0.20 25);
  --danger-soft: oklch(28% 0.07 25);
  --info:        oklch(76% 0.10 220);
  --info-soft:   oklch(26% 0.04 220);

  /* shape — flatter than tactile */
  --r-xs: 2px;
  --r-sm: 4px;
  --r-md: 6px;
  --r-lg: 10px;
  --r-pill: 999px;

  /* elevation — no shadows; borders carry the weight */
  --shadow-sm: 0 1px 0 0 oklch(100% 0 0 / 0.03) inset;
  --shadow-md: 0 1px 0 0 oklch(100% 0 0 / 0.04) inset, 0 8px 24px oklch(0% 0 0 / 0.4);
  --shadow-pop: 0 0 0 2px var(--accent), 0 24px 60px oklch(0% 0 0 / 0.6);

  /* border weights */
  --bw: 2px;

  /* safe-area-aware spacing */
  --pad-x: 16px;
  --nav-h: 64px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bot: env(safe-area-inset-bottom, 0px);

  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", system-ui, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.35;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overscroll-behavior-y: none;
}

button, input, textarea, select {
  font: inherit;
  color: inherit;
}
button { border: 0; cursor: pointer; background: transparent; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: none; }

::selection { background: var(--accent); color: var(--accent-ink); }

input::placeholder,
textarea::placeholder {
  color: var(--muted);
  opacity: 0.7;
}

#app {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* numbers everywhere — tabular */
.weight-stepper input,
.set-input input,
.history-set-field input,
.set-card-number,
.rep-count,
.session-date,
.bar-axis,
.day-card-stats .stat strong,
.progress-stats .stat strong,
.workout-block-summary,
.history-row time,
.history-row strong,
.set-row.readonly,
.day-card-list,
.muted.number,
.badge {
  font-variant-numeric: tabular-nums;
}

/* ─── Top navigation (becomes bottom tab bar on mobile) ──── */

.topnav {
  background: oklch(18% 0 0 / 0.92);
  backdrop-filter: saturate(140%) blur(18px);
  -webkit-backdrop-filter: saturate(140%) blur(18px);
  border-bottom: var(--bw) solid var(--line);
  padding: calc(var(--safe-top) + 12px) 24px 12px;
  display: flex;
  align-items: center;
  gap: 24px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topnav .brand {
  font-weight: 900;
  font-size: 18px;
  letter-spacing: -0.02em;
  color: var(--fg);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-transform: uppercase;
}
.topnav .brand::before {
  content: "";
  width: 14px;
  height: 14px;
  background: var(--accent);
  border: var(--bw) solid var(--fg);
}

.topnav .nav {
  display: flex;
  gap: 2px;
  margin-left: auto;
}

.topnav .nav a {
  padding: 10px 16px;
  border-radius: 0;
  color: var(--muted-strong);
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: background 0.1s ease, color 0.1s ease;
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.topnav .nav a:hover { color: var(--fg); }
.topnav .nav a.active {
  color: var(--accent-ink);
  background: var(--accent);
}

/* nav icons hidden on desktop — labels carry the meaning there */
.nav-icon {
  display: none;
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}
.nav-label {
  display: inline;
}

/* ─── Page shell ────────────────────────────────────── */

.content {
  flex: 1;
  padding: 24px var(--pad-x) calc(40px + var(--safe-bot));
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
}

.page {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.page-title {
  margin: 0;
  font-size: clamp(30px, 8vw, 44px);
  line-height: 0.98;
  letter-spacing: -0.035em;
  font-weight: 900;
  text-transform: uppercase;
}

.page-title.editable { cursor: pointer; }
.page-title.editable:hover { color: var(--accent); }

.page-sub {
  margin: 8px 0 0;
  color: var(--muted-strong);
  max-width: 60ch;
  line-height: 1.45;
  font-size: 14.5px;
}

.page-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.eyebrow {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--accent);
  font-family: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, monospace;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.eyebrow::before {
  content: "";
  width: 14px;
  height: var(--bw);
  background: var(--accent);
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
}
.breadcrumb a { color: var(--muted-strong); }
.breadcrumb a:hover { color: var(--fg); }
.breadcrumb strong { color: var(--fg); font-weight: 800; }
.breadcrumb span { color: var(--line-strong); }

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

/* ─── Buttons ──────────────────────────────────────── */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;
  padding: 0 20px;
  border-radius: var(--r-sm);
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 900;
  font-size: 14px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: filter 0.1s ease, transform 0.05s ease;
  border: var(--bw) solid var(--accent);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  min-width: 0;
}
.button:hover { filter: brightness(1.08); }
.button:active { transform: translateY(1px); }
.button:focus-visible {
  outline: var(--bw) solid var(--fg);
  outline-offset: 2px;
}

.button.secondary {
  background: transparent;
  color: var(--fg);
  border-color: var(--line-strong);
}
.button.secondary:hover {
  background: var(--surface-2);
  border-color: var(--fg);
  filter: none;
}

.button.danger {
  background: var(--danger);
  color: oklch(14% 0.04 25);
  border-color: var(--danger);
}

.button[disabled],
.button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  filter: grayscale(0.4);
}

.button.small {
  height: 40px;
  font-size: 12px;
  padding: 0 14px;
}

.icon-button {
  width: 40px;
  height: 40px;
  border-radius: var(--r-sm);
  background: transparent;
  border: var(--bw) solid var(--line);
  color: var(--ink-soft);
  display: inline-grid;
  place-items: center;
  font-size: 15px;
  transition: background 0.1s ease, color 0.1s ease, border-color 0.1s ease;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.icon-button:hover { background: var(--surface-2); color: var(--fg); border-color: var(--fg); }
.icon-button.danger:hover {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: var(--danger);
}

/* ─── Cards & overview ─────────────────────────────── */

.day-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.day-card {
  background: var(--surface);
  border-radius: var(--r-md);
  border: var(--bw) solid var(--line);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: border-color 0.12s ease, background 0.12s ease;
  position: relative;
  overflow: hidden;
  text-align: left;
}
.day-card:hover {
  background: var(--surface-2);
  border-color: var(--accent);
}

.day-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.day-card-title {
  margin: 0;
  font-size: 22px;
  letter-spacing: -0.025em;
  line-height: 1.05;
  font-weight: 900;
  text-transform: uppercase;
}

.badge {
  background: transparent;
  color: var(--accent);
  border-radius: 0;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 800;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  white-space: nowrap;
  border: var(--bw) solid var(--accent);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.day-card-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
}

.stat {
  background: var(--surface-sunken);
  border-radius: 0;
  padding: 12px 10px;
  min-width: 0;
  border: var(--bw) solid var(--line);
}
.stat span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 6px;
  font-weight: 800;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
}
.stat strong {
  display: block;
  font-size: 24px;
  line-height: 0.95;
  font-weight: 900;
  letter-spacing: -0.03em;
  overflow-wrap: anywhere;
  color: var(--fg);
}

.day-card-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 13px;
  color: var(--ink-soft);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
}
.day-card-list li {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 3px 0;
  letter-spacing: -0.005em;
}
.day-card-list li::before {
  content: "—  ";
  color: var(--muted);
}
.day-card-list li.more {
  color: var(--accent);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.day-card-list li.more::before { content: "+  "; }

.day-card-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
}
.day-card-actions .button {
  flex: 1;
  min-width: 0;
}
.day-card-actions .button.secondary { flex: 0 1 auto; padding: 0 14px; }

.day-card-add {
  background: transparent;
  border: var(--bw) dashed var(--line-strong);
  border-radius: var(--r-md);
  padding: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  color: var(--muted-strong);
  font-weight: 800;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  min-height: 220px;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}
.day-card-add:hover {
  background: var(--surface);
  border-style: solid;
  border-color: var(--accent);
  color: var(--accent);
}
.day-card-add-plus {
  font-size: 48px;
  font-weight: 200;
  line-height: 1;
  color: var(--accent);
}

/* ─── Day editor ───────────────────────────────────── */

.day-edit-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
}

.day-edit-fields {
  display: flex;
  gap: 12px;
  flex: 1;
  min-width: 240px;
}

.inline-edit {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-width: 0;
}
.inline-edit:first-child { flex: 0 0 130px; }
.inline-edit span {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--muted);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
}
.inline-edit input {
  border: var(--bw) solid transparent;
  background: transparent;
  border-radius: var(--r-xs);
  padding: 8px 10px;
  font-size: clamp(24px, 6vw, 32px);
  font-weight: 900;
  letter-spacing: -0.03em;
  margin-left: -10px;
  transition: background 0.12s ease, border-color 0.12s ease;
  width: 100%;
  color: var(--fg);
  text-transform: uppercase;
}
.inline-edit input:hover { background: var(--surface); }
.inline-edit input:focus {
  outline: 0;
  background: var(--surface);
  border-color: var(--accent);
}

.day-admin {
  margin-top: 8px;
  padding: 16px;
  background: var(--surface);
  border: var(--bw) solid var(--line);
  border-radius: var(--r-md);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.day-admin-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.day-admin-row .button.danger { margin-left: auto; }

/* ─── Program (day editor item list) ───────────────── */

.program-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.program-item {
  background: var(--surface);
  border-radius: var(--r-md);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  border: var(--bw) solid var(--line);
}

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

.program-item-title {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.program-item-title a {
  font-weight: 900;
  font-size: 16px;
  color: var(--fg);
  letter-spacing: -0.02em;
  text-transform: uppercase;
}
.program-item-title a:hover { color: var(--accent); }
.program-item-title .muted { font-size: 12px; font-family: ui-monospace, "SF Mono", Menlo, monospace; }

.program-item-controls {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.program-item-fields {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.inline-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}
.inline-field span {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 800;
  color: var(--muted);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
}
.inline-field.full { grid-column: 1 / -1; }
.inline-field input,
.inline-field select {
  width: 100%;
  min-width: 0;
  height: 44px;
  border: var(--bw) solid var(--line);
  border-radius: var(--r-xs);
  background: var(--surface-sunken);
  padding: 0 12px;
  font-size: 15px;
  font-weight: 700;
  color: var(--fg);
  transition: border-color 0.12s ease, background 0.12s ease;
  font-variant-numeric: tabular-nums;
}
.inline-field select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--accent) 50%),
                    linear-gradient(135deg, var(--accent) 50%, transparent 50%);
  background-position: calc(100% - 18px) 19px, calc(100% - 13px) 19px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 34px;
}
.inline-field input:focus,
.inline-field select:focus {
  outline: 0;
  border-color: var(--accent);
  background: var(--surface);
}

/* ─── Library ──────────────────────────────────────── */

.library-toolbar {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.search {
  width: 100%;
  height: 48px;
  border: var(--bw) solid var(--line);
  border-radius: var(--r-sm);
  padding: 0 16px;
  background: var(--surface);
  font-size: 15px;
  font-weight: 600;
  color: var(--fg);
  transition: border-color 0.12s ease;
}
.search:focus { outline: 0; border-color: var(--accent); }

.chip-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.chip {
  background: transparent;
  border: var(--bw) solid var(--line);
  color: var(--ink-soft);
  border-radius: 0;
  padding: 7px 14px;
  font-size: 11.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.chip:hover { background: var(--surface-2); color: var(--fg); border-color: var(--fg); }
.chip.active {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}

.library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 10px;
}

.library-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--surface);
  border: var(--bw) solid var(--line);
  border-radius: var(--r-md);
  padding: 16px;
  color: var(--fg);
  transition: background 0.12s ease, border-color 0.12s ease;
}
.library-card:hover {
  background: var(--surface-2);
  border-color: var(--accent);
}

.library-card-head h3 {
  margin: 0 0 4px;
  font-size: 16px;
  letter-spacing: -0.02em;
  font-weight: 900;
  overflow-wrap: anywhere;
  text-transform: uppercase;
  line-height: 1.1;
}
.library-card-head .muted {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
}

.library-card-meta {
  display: flex;
  gap: 12px;
  font-size: 13px;
  color: var(--ink-soft);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-weight: 700;
}
.library-card-meta span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.library-card-foot {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  margin-top: auto;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
}

/* ─── Forms ────────────────────────────────────────── */

.exercise-form,
.workout-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.form-section {
  background: var(--surface);
  border: var(--bw) solid var(--line);
  border-radius: var(--r-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.section-title {
  margin: 0;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--accent);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.section-title::before {
  content: "";
  width: 16px;
  height: var(--bw);
  background: var(--accent);
}

.section-hint {
  margin: -6px 0 0;
  color: var(--muted-strong);
  font-size: 13.5px;
  line-height: 1.5;
}

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

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.field.full { grid-column: 1 / -1; }
.field span {
  font-size: 11px;
  font-weight: 800;
  color: var(--muted-strong);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
}
.field input,
.field select,
.field textarea {
  width: 100%;
  border: var(--bw) solid var(--line);
  border-radius: var(--r-xs);
  padding: 12px 14px;
  background: var(--surface-sunken);
  font-size: 15px;
  font-weight: 600;
  color: var(--fg);
  transition: border-color 0.12s ease, background 0.12s ease;
  min-height: 48px;
}
.field textarea {
  min-height: 96px;
  resize: vertical;
  line-height: 1.5;
}
.field select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--accent) 50%),
                    linear-gradient(135deg, var(--accent) 50%, transparent 50%);
  background-position: calc(100% - 18px) 22px, calc(100% - 13px) 22px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 36px;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: 0;
  border-color: var(--accent);
  background: var(--surface);
}

.links-input {
  width: 100%;
  border: var(--bw) solid var(--line);
  border-radius: var(--r-xs);
  padding: 12px 14px;
  background: var(--surface-sunken);
  resize: vertical;
  font-family: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, monospace;
  font-size: 13px;
  color: var(--fg);
  min-height: 92px;
}
.links-input:focus { outline: 0; border-color: var(--accent); background: var(--surface); }

.usage-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
}
.usage-list li {
  padding: 10px 14px;
  background: var(--surface-sunken);
  border: var(--bw) solid var(--line);
  border-radius: var(--r-xs);
  font-weight: 600;
}

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

/* ─── Workout block (collapsible exercise) ─────────── */

.workout-block {
  background: var(--surface);
  border: var(--bw) solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
  transition: border-color 0.18s ease;
}
.workout-block + .workout-block { margin-top: 10px; }

.workout-block.done {
  border-color: var(--accent);
}

.skipped-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--warn-soft);
  border: var(--bw) solid var(--warn);
  border-radius: var(--r-sm);
  padding: 12px 16px;
  font-size: 12px;
  color: var(--warn);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.skipped-banner .button { flex-shrink: 0; }

.workout-add-row {
  display: flex;
  justify-content: center;
  padding: 4px 0 0;
}
.workout-add-row .button {
  width: 100%;
  height: 56px;
  font-size: 13px;
}

.workout-block-toggle {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  background: transparent;
  border: 0;
  padding: 18px 16px;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.1s ease;
}
.workout-block-toggle:hover { background: var(--surface-2); }
.workout-block.expanded .workout-block-toggle {
  background: var(--surface-2);
  border-bottom: var(--bw) solid var(--line);
}
.workout-block.done .workout-block-toggle {
  background: linear-gradient(90deg, var(--accent) 0 6px, transparent 6px);
}

.workout-block-toggle-main {
  flex: 1;
  min-width: 0;
}
.workout-block-toggle h2 {
  margin: 0;
  font-size: 16px;
  letter-spacing: -0.02em;
  font-weight: 900;
  text-transform: uppercase;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--fg);
  line-height: 1.15;
}

.workout-block-status {
  width: 28px;
  height: 28px;
  border-radius: 0;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 900;
  flex-shrink: 0;
  background: transparent;
  border: var(--bw) solid var(--line-strong);
  color: var(--muted);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
}
.workout-block.done .workout-block-status {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}

.workout-block-summary {
  font-weight: 900;
  color: var(--ink-soft);
  font-size: 12px;
  flex-shrink: 0;
  background: transparent;
  padding: 5px 10px;
  border-radius: 0;
  border: var(--bw) solid var(--line);
  letter-spacing: 0.04em;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  text-transform: uppercase;
}
.workout-block.done .workout-block-summary {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}

.workout-block-chevron {
  color: var(--muted);
  font-size: 12px;
  transition: transform 0.18s ease, color 0.12s ease;
  flex-shrink: 0;
}
.workout-block.expanded .workout-block-chevron { transform: rotate(180deg); color: var(--fg); }

.workout-block-body {
  display: none;
  padding: 0 16px 16px;
  flex-direction: column;
  gap: 14px;
}
.workout-block.expanded .workout-block-body {
  display: flex;
  padding-top: 14px;
}

.workout-block-finish-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px;
  margin-top: 4px;
}
.workout-block-finish-row .button { height: 48px; }

.add-set-btn {
  width: 100%;
  height: 52px;
  background: transparent;
  color: var(--accent);
  border: var(--bw) dashed var(--accent-dim);
  font-size: 13px;
}
.add-set-btn:hover {
  background: var(--accent-soft);
  border-style: solid;
  border-color: var(--accent);
  filter: none;
}

.finish-section { margin-top: 8px; }
.finish-actions {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
  margin-top: 4px;
}
.finish-actions .button { flex: 1; }

/* ─── Set card (the meat of the workout) ───────────── */

.set-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.set-card {
  background: var(--surface-sunken);
  border: var(--bw) solid var(--line);
  border-radius: var(--r-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
}
.set-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--line);
}
.set-card.has-data::before {
  background: var(--accent);
}

.set-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.set-card-number {
  font-weight: 900;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
}

.set-effort {
  height: 40px;
  border: var(--bw) solid var(--line);
  border-radius: var(--r-xs);
  background: var(--surface);
  padding: 0 32px 0 12px;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  min-width: 130px;
  color: var(--fg);
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--accent) 50%),
                    linear-gradient(135deg, var(--accent) 50%, transparent 50%);
  background-position: calc(100% - 16px) 17px, calc(100% - 11px) 17px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
.set-effort:focus { outline: 0; border-color: var(--accent); }

.set-input {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.set-input span {
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--muted);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
}
.set-input input {
  height: 60px;
  border: var(--bw) solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  padding: 0 14px;
  font-size: 32px;
  font-weight: 900;
  text-align: center;
  letter-spacing: -0.035em;
  color: var(--fg);
  transition: border-color 0.12s ease;
}
.set-input input:focus {
  outline: 0;
  border-color: var(--accent);
}

.weight-stepper {
  display: flex;
  align-items: stretch;
  border: var(--bw) solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  height: 60px;
  overflow: hidden;
  transition: border-color 0.12s ease;
}
.weight-stepper:focus-within { border-color: var(--accent); }

.weight-stepper input {
  flex: 1;
  border: 0;
  text-align: center;
  font-size: 32px;
  font-weight: 900;
  background: transparent;
  min-width: 0;
  letter-spacing: -0.035em;
  height: auto;
  padding: 0 4px;
  color: var(--fg);
}
.weight-stepper input:focus { outline: 0; }

.weight-btn {
  width: 64px;
  background: var(--accent);
  font-size: 28px;
  font-weight: 700;
  color: var(--accent-ink);
  display: grid;
  place-items: center;
  cursor: pointer;
  flex-shrink: 0;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: background 0.1s ease, transform 0.05s ease;
  border: 0;
  height: 100%;
}
.weight-btn:first-child { border-right: var(--bw) solid var(--line); }
.weight-btn:last-child { border-left: var(--bw) solid var(--line); }
.weight-btn:hover { filter: brightness(1.08); }
.weight-btn:active { transform: scale(0.93); }

.set-reps {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.set-reps-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}
.set-reps-head > span {
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--muted);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
}

.rep-count {
  font-weight: 900;
  font-size: 20px;
  color: var(--fg);
  letter-spacing: -0.03em;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
}

.set-card-note {
  height: 44px;
  border: var(--bw) solid var(--line);
  border-radius: var(--r-xs);
  background: var(--surface);
  padding: 0 14px;
  font-size: 14px;
  color: var(--fg);
}
.set-card-note:focus { outline: 0; border-color: var(--accent); }

/* ─── Rep tracker (the killer tactile feature) ─────── */

.rep-tracker {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.rep-dot {
  min-width: 52px;
  height: 52px;
  padding: 0 8px;
  border-radius: var(--r-sm);
  background: transparent;
  border: var(--bw) solid var(--line-strong);
  color: var(--ink-soft);
  font-size: 18px;
  font-weight: 900;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  display: grid;
  place-items: center;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: background 0.1s ease, color 0.1s ease, border-color 0.1s ease, transform 0.05s ease;
  letter-spacing: -0.02em;
}
.rep-dot:hover {
  border-color: var(--accent);
  color: var(--fg);
}
.rep-dot:active { transform: scale(0.92); }

.rep-dot.done {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}
.rep-dot.done:hover { background: var(--accent); }

.rep-dot.rep-add {
  background: transparent;
  border: var(--bw) dashed var(--line-strong);
  font-size: 14px;
  letter-spacing: 0.04em;
  color: var(--muted-strong);
  text-transform: uppercase;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
}
.rep-dot.rep-add:hover {
  background: transparent;
  border-style: solid;
  border-color: var(--accent);
  color: var(--accent);
}

/* ─── Workout picker (day chooser) ─────────────────── */

.picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 10px;
}

.picker-card {
  background: var(--surface);
  border: var(--bw) solid var(--line);
  border-radius: var(--r-md);
  padding: 24px 20px;
  color: var(--fg);
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: background 0.12s ease, border-color 0.12s ease;
  min-height: 140px;
}
.picker-card:hover {
  background: var(--surface-2);
  border-color: var(--accent);
}
.picker-card h2 {
  margin: 0;
  font-size: 24px;
  letter-spacing: -0.03em;
  font-weight: 900;
  text-transform: uppercase;
  line-height: 1.05;
}

/* ─── Progress ─────────────────────────────────────── */

.progress-toolbar {
  display: flex;
  gap: 12px;
  max-width: 420px;
}
.progress-toolbar .field { flex: 1; }

.progress-card {
  background: var(--surface);
  border: var(--bw) solid var(--line);
  border-radius: var(--r-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

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

.history-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.history-row {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr) 90px;
  gap: 14px;
  align-items: center;
}
.history-row time {
  font-size: 12px;
  color: var(--muted-strong);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-weight: 800;
  letter-spacing: 0.02em;
}
.history-row strong {
  text-align: right;
  font-size: 16px;
  font-weight: 900;
  color: var(--fg);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  letter-spacing: -0.02em;
}

.bar {
  height: 12px;
  background: var(--surface-sunken);
  border-radius: 0;
  overflow: hidden;
  border: var(--bw) solid var(--line);
}
.bar span {
  display: block;
  height: 100%;
  width: var(--bar-width);
  min-width: 2px;
  background: var(--accent);
}

/* ─── Exercise info (description + technique + videos) ─── */

.exercise-info {
  background: var(--surface-sunken);
  border: var(--bw) solid var(--line);
  border-radius: var(--r-sm);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--ink-soft);
}
.info-line { margin: 0; overflow-wrap: anywhere; }
.info-line strong {
  color: var(--accent);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 11px;
  display: inline-block;
  margin-right: 6px;
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 8px;
}

.youtube-embed {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--r-xs);
  border: var(--bw) solid var(--line);
  background: oklch(8% 0 0);
  display: block;
}

.link-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* ─── History list & detail ────────────────────────── */

.session-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.session-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  background: var(--surface);
  border: var(--bw) solid var(--line);
  border-radius: var(--r-md);
  color: var(--fg);
  transition: background 0.12s ease, border-color 0.12s ease;
}
.session-row:hover {
  background: var(--surface-2);
  border-color: var(--accent);
}

.session-row-main {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.session-date {
  font-weight: 900;
  font-size: 12px;
  color: var(--accent);
  white-space: nowrap;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: transparent;
  border: var(--bw) solid var(--accent);
  padding: 4px 8px;
}

.session-row-title {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.session-row-title strong {
  font-weight: 900;
  font-size: 16px;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}
.session-row-title .muted {
  font-size: 12px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  letter-spacing: 0.02em;
}

.session-row-stats {
  display: flex;
  gap: 14px;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  flex-shrink: 0;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.session-row-stats strong { color: var(--fg); font-weight: 900; margin-right: 3px; font-size: 14px; }

.session-notes {
  background: var(--surface-sunken);
  border-left: 4px solid var(--accent);
  border-top: var(--bw) solid var(--line);
  border-right: var(--bw) solid var(--line);
  border-bottom: var(--bw) solid var(--line);
  border-radius: 0;
  padding: 14px 16px;
  color: var(--ink-soft);
  line-height: 1.55;
  white-space: pre-wrap;
  font-size: 14px;
}

.history-meta { margin-bottom: 4px; }

.history-exercise {
  background: var(--surface);
  border: var(--bw) solid var(--line);
  border-radius: var(--r-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.history-exercise + .history-exercise { margin-top: 8px; }

.history-exercise-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}
.history-exercise-head h2 {
  margin: 0;
  font-size: 18px;
  letter-spacing: -0.025em;
  font-weight: 900;
  text-transform: uppercase;
}
.history-exercise-head h2 a { color: var(--fg); }
.history-exercise-head h2 a:hover { color: var(--accent); }
.history-exercise-head .muted {
  font-size: 12px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 700;
}

.history-set-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.history-set {
  background: var(--surface-sunken);
  border: var(--bw) solid var(--line);
  border-radius: var(--r-sm);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

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

.history-set-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.history-set-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}
.history-set-field span {
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--muted);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
}
.history-set-field input {
  height: 50px;
  border: var(--bw) solid var(--line);
  border-radius: var(--r-xs);
  background: var(--surface);
  padding: 0 14px;
  font-size: 22px;
  font-weight: 900;
  text-align: center;
  width: 100%;
  color: var(--fg);
  letter-spacing: -0.03em;
}
.history-set-field input:focus { outline: 0; border-color: var(--accent); }

.history-set-note {
  height: 44px;
  border: var(--bw) solid var(--line);
  border-radius: var(--r-xs);
  background: var(--surface);
  padding: 0 14px;
  font-size: 14px;
  width: 100%;
  color: var(--fg);
}
.history-set-note:focus { outline: 0; border-color: var(--accent); }

.history-actions {
  margin-top: 12px;
  display: flex;
  justify-content: center;
}
.history-actions .button { min-width: 240px; }

.set-row.readonly {
  background: var(--surface-sunken);
  border: var(--bw) solid var(--line);
  border-radius: var(--r-xs);
  padding: 8px 12px;
}
.set-row.readonly .set-cell {
  display: flex;
  align-items: center;
  height: 36px;
  font-size: 14px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
}

/* ─── Picker dialog (multi-select) ─────────────────── */

dialog#pickerDialog {
  width: min(720px, calc(100vw - 16px));
  max-height: calc(100dvh - 24px);
  border: var(--bw) solid var(--accent);
  padding: 0;
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--fg);
  overflow: hidden;
  box-shadow: var(--shadow-pop);
}
dialog#pickerDialog::backdrop {
  background: oklch(5% 0 0 / 0.75);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.picker {
  display: flex;
  flex-direction: column;
  max-height: calc(100dvh - 24px);
}

.picker-head {
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  border-bottom: var(--bw) solid var(--line);
}
.picker-head h2 {
  margin: 0 0 4px;
  font-size: 20px;
  letter-spacing: -0.025em;
  font-weight: 900;
  text-transform: uppercase;
}
.picker-head .muted {
  font-size: 12px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 700;
}

.picker-toolbar {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-bottom: var(--bw) solid var(--line);
  background: var(--surface-sunken);
}

.picker-list {
  overflow: auto;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-height: 220px;
  -webkit-overflow-scrolling: touch;
}

.picker-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: background 0.1s ease;
  min-height: 56px;
}
.picker-item:hover { background: var(--surface-2); }

.picker-item input[type="checkbox"] {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  cursor: pointer;
  accent-color: var(--accent);
}

.picker-item-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.picker-item-body strong {
  font-weight: 800;
  font-size: 15px;
  letter-spacing: -0.015em;
  text-transform: uppercase;
}
.picker-item-body .muted {
  font-size: 12px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.picker-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 16px calc(14px + var(--safe-bot));
  border-top: var(--bw) solid var(--line);
  background: var(--surface-sunken);
}

/* ─── Empty state ──────────────────────────────────── */

.empty {
  border: var(--bw) dashed var(--line-strong);
  border-radius: var(--r-md);
  padding: 36px 20px;
  color: var(--muted-strong);
  text-align: center;
  background: transparent;
  font-size: 14px;
  font-weight: 600;
}
.empty a {
  color: var(--accent);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: var(--bw) solid var(--accent);
}

/* ─── Mobile — bottom tab nav, denser type, full-width CTAs ── */

@media (max-width: 900px) {
  :root { --pad-x: 14px; }

  .content {
    padding: 18px var(--pad-x) calc(var(--nav-h) + 32px + var(--safe-bot));
  }

  /* topnav becomes bottom tab bar */
  .topnav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    top: auto;
    padding: 4px 4px calc(4px + var(--safe-bot));
    height: calc(var(--nav-h) + var(--safe-bot));
    border-top: var(--bw) solid var(--line-strong);
    border-bottom: 0;
    gap: 0;
    background: oklch(14% 0 0 / 0.96);
    backdrop-filter: saturate(160%) blur(22px);
    -webkit-backdrop-filter: saturate(160%) blur(22px);
    z-index: 50;
  }
  .topnav .brand {
    display: none;
  }
  .topnav .nav {
    margin: 0;
    flex: 1;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 2px;
  }
  .topnav .nav a {
    padding: 6px 4px;
    text-align: center;
    border-radius: 0;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    color: var(--muted);
    border-bottom: 3px solid transparent;
  }
  .topnav .nav a.active {
    background: transparent;
    color: var(--accent);
    border-bottom-color: var(--accent);
  }
  /* show icons, hide labels — pictogram-only bottom nav */
  .topnav .nav .nav-icon {
    display: block;
    width: 26px;
    height: 26px;
  }
  .topnav .nav .nav-label {
    display: none;
  }

  /* mobile-app header presence */
  .page { gap: 16px; }
  .page-header {
    flex-direction: column;
    align-items: stretch;
  }
  .page-actions { width: 100%; }
  .page-actions .button { flex: 1; }

  /* tighter day cards */
  .day-grid { grid-template-columns: 1fr; gap: 10px; }
  .day-card { padding: 16px; }
  .day-card-actions { flex-direction: row; }

  /* program form: 2-col instead of 4-col */
  .program-item-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  /* progress: 2 stats per row */
  .progress-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  /* forms collapse to single column */
  .form-grid { grid-template-columns: 1fr; }

  /* day-edit header stacks */
  .day-edit-header { flex-direction: column; align-items: stretch; }
  .day-edit-fields { width: 100%; }

  /* admin row */
  .day-admin-row .button.danger { margin-left: 0; }

  /* session row stacks */
  .session-row { padding: 12px 14px; }
  .session-row-main { flex-wrap: wrap; gap: 6px 12px; }
  .session-row-stats { gap: 12px; font-size: 11px; }

  /* history row narrower */
  .history-row { grid-template-columns: 80px 1fr 70px; gap: 10px; }

  /* picker dialog fullscreen feel */
  dialog#pickerDialog {
    width: 100%;
    max-width: 100%;
    height: 100dvh;
    max-height: 100dvh;
    margin: 0;
    border-radius: 0;
    border: 0;
  }
  .picker { max-height: 100dvh; }
  .picker-head { padding: calc(var(--safe-top) + 16px) 16px 14px; }
}

@media (max-width: 420px) {
  .day-card-stats { gap: 3px; }
  .stat { padding: 10px 8px; }
  .stat strong { font-size: 20px; }
  .day-card-actions .button.secondary {
    padding: 0 12px;
    font-size: 12px;
  }
  .program-item-fields { grid-template-columns: 1fr 1fr; gap: 6px; }
  .progress-stats { gap: 4px; }
  .weight-btn { width: 56px; font-size: 24px; }
  .rep-dot { min-width: 48px; height: 48px; font-size: 16px; }
  .topnav .nav .nav-icon { width: 24px; height: 24px; }
  .set-input input,
  .weight-stepper input { font-size: 26px; }
}

/* ─── Focus visibility (everywhere) ────────────────── */

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

/* respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
  }
}
