/* ===== Colors & sizing ===== */
:root {
  --blue: #2450d6;          /* royal blue: buttons, fills */
  --blue-dark: #1a3aa3;     /* hover, text on soft blue */
  --blue-text: #2450d6;     /* links and blue text */
  --blue-soft: #e8eefc;
  --blue-line: #b8c6ea;
  --on-blue: #ffffff;
  --bg: #f6f8fc;
  --card: #ffffff;
  --card-2: #fafbff;        /* inset areas inside cards */
  --text: #1c2333;
  --muted: #5a6478;
  --border: #dde3ee;
  --shadow: rgba(28, 35, 51, 0.12);
  --glow: rgba(36, 80, 214, 0.16);
  --radius: 20px;

  --tab-h: 64px;            /* bottom tab bar height (plus the phone's safe area) */
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
  color-scheme: light;
}

/* Dark mode follows the phone's setting */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --blue: #3a66ea;
    --blue-dark: #2c54d0;
    --blue-text: #8ea8f7;
    --blue-soft: #1d2846;
    --blue-line: #3a4c80;
    --bg: #0f1420;
    --card: #171e2e;
    --card-2: #1b2336;
    --text: #e8ecf5;
    --muted: #a0aabf;
    --border: #2a3450;
    --shadow: rgba(0, 0, 0, 0.45);
    --glow: rgba(58, 102, 234, 0.3);
    color-scheme: dark;
  }
}
/* Same dark colors when someone picks dark mode by hand */
:root[data-theme="dark"] {
  --blue: #3a66ea;
  --blue-dark: #2c54d0;
  --blue-text: #8ea8f7;
  --blue-soft: #1d2846;
  --blue-line: #3a4c80;
  --bg: #0f1420;
  --card: #171e2e;
  --card-2: #1b2336;
  --text: #e8ecf5;
  --muted: #a0aabf;
  --border: #2a3450;
  --shadow: rgba(0, 0, 0, 0.45);
  --glow: rgba(58, 102, 234, 0.3);
  color-scheme: dark;
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, "Roboto", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  /* room for the bottom tab bar */
  padding-bottom: calc(var(--tab-h) + var(--safe-bottom));
}

[hidden] { display: none !important; }

/* ===== Accessibility helpers ===== */
.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  background: var(--blue);
  color: var(--on-blue);
  padding: 10px 16px;
  border-radius: 8px;
  z-index: 50;
}
.skip-link:focus { top: calc(12px + var(--safe-top)); }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

:focus-visible {
  outline: 3px solid var(--blue-text);
  outline-offset: 3px;
}
.headline:focus { outline: none; }

/* ===== Top app bar ===== */
.app-bar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: calc(12px + var(--safe-top)) 16px 12px;
  background: var(--bg);
  border-bottom: 1px solid transparent;
  /* No backdrop blur here on phones: it would trap the fixed tab bar inside the header */
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.15rem;
  color: inherit;
  text-decoration: none;
  border-radius: 12px;
}
.logo-badge {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: var(--blue);
  color: var(--on-blue);
  font-size: 1.15rem;
}

/* ===== Tab bar: pinned to the bottom on phones ===== */
.tab-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  height: calc(var(--tab-h) + var(--safe-bottom));
  padding: 0 8px var(--safe-bottom);
  background: var(--card);
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 20px var(--shadow);
}
.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 14px;
}
.tab svg {
  width: 44px;
  height: 28px;
  padding: 3px 10px;
  border-radius: 999px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: background 0.15s;
}
.tab[aria-current="page"] { color: var(--blue-text); }
.tab[aria-current="page"] svg { background: var(--blue-soft); }
.tab:focus-visible { outline-offset: -3px; }

/* Wide screens (laptop browser): tabs move up into the top bar */
@media (min-width: 768px) {
  body { padding-bottom: 0; }
  .app-bar {
    padding: 14px 24px;
    border-bottom-color: var(--border);
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }
  .tab-bar {
    position: static;
    display: flex;
    gap: 6px;
    height: auto;
    padding: 0;
    background: none;
    border: 0;
    box-shadow: none;
  }
  .tab {
    flex-direction: row;
    gap: 8px;
    padding: 8px 16px 8px 12px;
    font-size: 0.95rem;
    border-radius: 999px;
  }
  .tab svg { width: 22px; height: 22px; padding: 0; background: none !important; }
  .tab:hover { background: var(--blue-soft); color: var(--blue-text); }
  .tab[aria-current="page"] { background: var(--blue-soft); }
}

/* ===== Screens ===== */
main {
  max-width: 880px;
  margin: 0 auto;
  padding: 16px 16px 32px;
}
main:has(#screen-equipment:not([hidden])) { max-width: 1000px; }

@media (min-width: 768px) {
  main { padding-top: 32px; padding-bottom: 64px; }
}

.page-intro {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 24px;
}
.step {
  background: var(--blue-soft);
  color: var(--blue-text);
  font-weight: 600;
  font-size: 0.85rem;
  padding: 4px 14px;
  border-radius: 999px;
  margin-bottom: 12px;
}
.headline {
  margin: 0;
  font-size: clamp(1.6rem, 6vw, 2.6rem);
  font-weight: 700;
  line-height: 1.2;
}
.subhead {
  color: var(--muted);
  margin: 8px 0 0;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 4px;
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 40px 20px;
  margin-top: 8px;
}
.empty-state .btn { margin-top: 20px; }

/* ===== Gym choice cards ===== */
fieldset {
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
}

.cards {
  display: grid;
  gap: 14px;
}

/* Phones: icon on the left, text on the right */
.card {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 20px 52px 20px 18px;
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.card-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Hide the real radio visually but keep it usable by keyboard & screen readers */
.card input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.card-icon {
  flex-shrink: 0;
  width: 60px;
  height: 60px;
  padding: 12px;
  border-radius: 16px;
  background: var(--blue-soft);
  fill: var(--blue-text);
  stroke: var(--blue-text);
}
.card-title {
  font-size: 1.2rem;
  font-weight: 700;
}
.card-desc {
  color: var(--muted);
  font-size: 0.95rem;
}

/* Checkmark circle in the corner */
.card-check {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid var(--border);
}

.card:active { transform: scale(0.98); }
.card:has(input:checked) {
  border-color: var(--blue);
  box-shadow: 0 10px 28px var(--glow);
}
.card:has(input:checked) .card-check {
  background: var(--blue);
  border-color: var(--blue);
}
.card:has(input:checked) .card-check::after {
  content: "";
  position: absolute;
  left: 7px;
  top: 3px;
  width: 7px;
  height: 12px;
  border: solid var(--on-blue);
  border-width: 0 3px 3px 0;
  transform: rotate(45deg);
}
.card:has(input:focus-visible) {
  outline: 3px solid var(--blue-text);
  outline-offset: 4px;
}

/* Bigger screens: two big side-by-side cards, like before */
@media (min-width: 600px) {
  .cards { grid-template-columns: 1fr 1fr; gap: 20px; }
  .card {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 36px 28px;
  }
  .card-text { align-items: center; gap: 8px; }
  .card-icon { width: 72px; height: 72px; padding: 14px; border-radius: 18px; }
  .card-title { font-size: 1.35rem; }
  .card-desc { font-size: 1rem; }
}
@media (hover: hover) {
  .card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 28px var(--glow);
  }
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 32px;
  font: inherit;
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--on-blue);
  background: var(--blue);
  border: 2px solid var(--blue);
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
  touch-action: manipulation;
  transition: background 0.15s, transform 0.1s;
}
.btn:active { transform: scale(0.97); }
.btn:disabled {
  opacity: 0.6;
  cursor: wait;
}
@media (hover: hover) {
  .btn:hover { background: var(--blue-dark); border-color: var(--blue-dark); }
  .btn-outline:hover { background: var(--blue-soft); border-color: var(--blue); }
}
.btn-block {
  display: flex;
  width: 100%;
}
.btn-outline {
  background: transparent;
  color: var(--blue-text);
  border-color: var(--blue);
}
.btn-small {
  min-height: 46px;
  padding: 10px 22px;
  font-size: 1rem;
}

/* Bottom action bar: stays in view above the tab bar while scrolling */
.action-bar {
  position: sticky;
  bottom: calc(var(--tab-h) + var(--safe-bottom) + 10px);
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 20px;
  padding: 10px 10px 10px 20px;
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: 999px;
  box-shadow: 0 8px 28px var(--shadow);
}
.action-bar:has(.btn-block) {
  padding: 0;
  background: none;
  border: 0;
  box-shadow: none;
}
.action-bar .btn-block { box-shadow: 0 8px 24px var(--glow); }
.action-bar .count { color: var(--muted); }
.action-bar .count strong { color: var(--text); }
@media (min-width: 768px) {
  .action-bar { bottom: 16px; }
}
.confirm-status { text-align: center; }

/* ===== Equipment screen ===== */
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }

.note {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--blue-soft);
  border-left: 5px solid var(--blue);
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 20px;
}
.note p { margin: 0; }
.note-icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  fill: var(--blue);
}
.note-icon-mark { fill: var(--on-blue); }

.panel {
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 16px;
  margin-bottom: 20px;
}
@media (min-width: 600px) {
  .panel { padding: 28px; }
}
.panel h2 {
  margin: 0 0 4px;
  font-size: 1.25rem;
}

/* Photo upload */
.upload-panel { transition: background 0.15s, border-color 0.15s; }
.upload-panel.dragging {
  background: var(--blue-soft);
  border-color: var(--blue);
  border-style: dashed;
}
.photo-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 16px;
}
.btn-photo {
  position: relative;
  padding: 12px 14px;
  font-size: 1rem;
}
.btn-photo svg {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linejoin: round;
}
.btn-photo input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.btn-photo:has(input:focus-visible) {
  outline: 3px solid var(--blue-text);
  outline-offset: 3px;
}
/* Computers with a mouse can't open the camera this way, so just show "Choose" */
@media (hover: hover) and (pointer: fine) {
  .camera-only { display: none; }
  .photo-actions { grid-template-columns: auto; justify-content: start; }
}
@media (max-width: 359px) {
  .photo-actions { grid-template-columns: 1fr; }
}
.drag-hint { margin: 10px 0 0; }

.thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  list-style: none;
  padding: 0;
  margin: 16px 0 0;
}
.thumbs:empty { display: none; }
.thumbs li { position: relative; }
.thumbs img {
  display: block;
  width: 88px;
  height: 88px;
  object-fit: cover;
  border-radius: 12px;
  border: 2px solid var(--border);
}
.thumb-remove {
  position: absolute;
  top: -10px;
  right: -10px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid var(--card);
  background: var(--text);
  color: var(--bg);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}
#identify-btn { margin-top: 16px; }

.status {
  margin: 12px 0 0;
  font-weight: 500;
  color: var(--blue-text);
}
.status:empty { display: none; }

/* Checklist */
.list-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 4px 12px;
  margin-bottom: 8px;
}
.list-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.link-btn {
  min-height: 40px;
  background: none;
  border: 0;
  padding: 4px 6px;
  font: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--blue-text);
  cursor: pointer;
  border-radius: 6px;
}
@media (hover: hover) {
  .link-btn:hover { text-decoration: underline; }
}

.category {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.category-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.category-header h3 {
  margin: 0;
  font-size: 1.05rem;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 10px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 16px 8px 14px;
  border: 2px solid var(--border);
  border-radius: 22px; /* a pill on one line, still rounded if the badge wraps */
  flex-wrap: wrap;
  row-gap: 4px;
  background: var(--card);
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  transition: border-color 0.15s, background 0.15s;
}
@media (hover: hover) {
  .chip:hover { border-color: var(--blue-line); }
}
.chip input {
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: var(--blue);
  cursor: pointer;
}
.chip:has(input:checked) {
  border-color: var(--blue);
  background: var(--blue-soft);
  color: var(--blue-text);
  font-weight: 600;
}
.chip:has(input:focus-visible) {
  outline: 3px solid var(--blue-text);
  outline-offset: 2px;
}
.chip input:focus-visible { outline: none; }

.badge {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  background: var(--blue);
  color: var(--on-blue);
  padding: 2px 8px;
  border-radius: 999px;
}

/* Type-in box with suggestions */
.add-equipment {
  margin-top: 12px;
  padding: 16px;
  background: var(--card-2);
  border: 2px solid var(--border);
  border-radius: 16px;
}
.add-label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
}
.combo {
  position: relative;
  display: flex;
  gap: 8px;
}
.combo input {
  flex: 1;
  min-width: 0;
  min-height: 46px;
  padding: 10px 16px;
  font: inherit;
  font-size: 1rem; /* 16px or more stops iPhones from zooming in */
  color: var(--text);
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: 999px;
}
.combo input:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-soft);
}
.suggestions {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 5;
  list-style: none;
  margin: 0;
  padding: 6px;
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 12px 28px var(--shadow);
}
.suggestions li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 8px 12px;
  border-radius: 10px;
  cursor: pointer;
}
.suggestions li:hover,
.suggestions li[aria-selected="true"] {
  background: var(--blue-soft);
  color: var(--blue-text);
}
.suggestions mark {
  background: none;
  color: inherit;
  font-weight: 700;
}
.suggestion-tag {
  flex-shrink: 0;
  font-size: 0.8rem;
  color: var(--muted);
}

/* Items the user added can be removed */
.chip-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
}
.chip-group .chip {
  min-width: 0;
  -webkit-touch-callout: none; /* no phone menu on press and hold; the picture shows instead */
}
.chip > span:not(.badge) { overflow-wrap: anywhere; }
.chip-remove {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--card);
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
}
@media (hover: hover) {
  .chip-remove:hover {
    border-color: var(--blue);
    color: var(--blue-text);
  }
}

/* "Show pictures" on/off switch */
.switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}
.switch input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.switch .muted { font-weight: 400; }
.switch-track {
  position: relative;
  flex-shrink: 0;
  width: 44px;
  height: 26px;
  border-radius: 999px;
  background: var(--border);
  transition: background 0.15s;
}
.switch-track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  transition: transform 0.15s;
}
.switch input:checked + .switch-track { background: var(--blue); }
.switch input:checked + .switch-track::after { transform: translateX(18px); }
.switch input:focus-visible + .switch-track {
  outline: 3px solid var(--blue-text);
  outline-offset: 2px;
}

/* Photo preview: floating card on computers, bottom sheet on phones */
.photo-preview {
  position: absolute;
  z-index: 40;
  width: 260px;
  max-width: calc(100vw - 32px);
  padding: 10px;
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 16px 36px var(--shadow);
}
.photo-preview img {
  display: block;
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: 10px;
  background: var(--blue-soft);
}
.preview-name {
  margin: 8px 4px 0;
  font-weight: 700;
}
.preview-credit {
  margin: 2px 4px 0;
  font-size: 0.75rem;
  color: var(--muted);
}
.preview-guide {
  display: inline-block;
  margin: 6px 4px 2px;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--blue-text);
  text-decoration: none;
}
.preview-guide:hover { text-decoration: underline; }
.preview-close { display: none; }

.photo-preview.as-sheet {
  position: fixed;
  left: 8px;
  right: 8px;
  bottom: calc(var(--tab-h) + var(--safe-bottom) + 8px);
  width: auto;
  max-width: none;
  padding: 12px;
  border-radius: 22px;
  animation: sheet-up 0.2s ease-out;
}
.photo-preview.as-sheet img { height: min(260px, 40vh); }
.photo-preview.as-sheet .preview-close {
  position: absolute;
  top: 20px;
  right: 20px;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}
@keyframes sheet-up {
  from { transform: translateY(24px); opacity: 0; }
  to { transform: none; opacity: 1; }
}

/* ===== Guide: all equipment A to Z ===== */
.guide-letters {
  position: sticky;
  top: calc(60px + var(--safe-top)); /* just under the top bar */
  z-index: 10;
  display: flex;
  gap: 4px;
  overflow-x: auto;
  margin: 0 -16px 8px;
  padding: 8px 16px;
  background: var(--bg);
  scrollbar-width: none;
}
.guide-letters::-webkit-scrollbar { display: none; }
.letter-jump {
  flex-shrink: 0;
  min-width: 40px;
  height: 40px;
  border: 2px solid var(--border);
  border-radius: 12px;
  background: var(--card);
  color: var(--blue-text);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
}
@media (hover: hover) {
  .letter-jump:hover { border-color: var(--blue); background: var(--blue-soft); }
}
@media (min-width: 768px) {
  .guide-letters { top: 69px; flex-wrap: wrap; margin-inline: 0; padding-inline: 0; }
}

.guide-group { scroll-margin-top: calc(120px + var(--safe-top)); }
.guide-letter {
  margin: 20px 0 10px;
  font-size: 1.5rem;
  color: var(--blue-text);
  scroll-margin-top: calc(120px + var(--safe-top));
}
.guide-letter:focus { outline: none; }
.guide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  list-style: none;
  margin: 0;
  padding: 0;
}
@media (min-width: 768px) {
  .guide-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
}
.guide-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  padding: 12px;
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: 16px;
  scroll-margin-top: calc(120px + var(--safe-top));
}
.guide-card:focus { outline: none; }
.guide-card:focus-visible { outline: 3px solid var(--blue-text); outline-offset: 2px; }
.guide-card h3 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.guide-card img,
.guide-no-photo {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  max-width: 100%;
  object-fit: cover;
  border-radius: 10px;
  background: var(--blue-soft);
}
.guide-no-photo {
  display: grid;
  place-items: center;
  padding: 8px;
  border: 2px dashed var(--blue-line);
  background: var(--card-2);
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
}
.guide-credit {
  margin: 0;
  font-size: 0.72rem;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.guide-card.flash { animation: guide-flash 1.6s ease-out; }
@keyframes guide-flash {
  0%, 40% { border-color: var(--blue); box-shadow: 0 0 0 4px var(--glow); }
  100% { border-color: var(--border); box-shadow: none; }
}

/* ===== Footer photo credits ===== */
.site-footer {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 16px 24px;
  color: var(--muted);
  font-size: 0.85rem;
}
.credits summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--blue-text);
  width: fit-content;
  padding: 8px 0;
}
.credits ul {
  padding-left: 18px;
  columns: 2 280px;
}
.credits li { margin-bottom: 4px; break-inside: avoid; overflow-wrap: anywhere; }
.credits a { color: var(--blue-text); }

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

/* ===== How-to cards (howto.js), placard-style instructions for each piece of equipment ===== */
.howto-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  padding: 16px;
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
}
.howto-head h3 { margin: 0; font-size: 1.15rem; }
.howto-equipment { margin: 2px 0 0; color: var(--muted); font-size: 0.85rem; }
.howto-diagram {
  display: grid;
  grid-template-columns: 1fr 22px 1fr;
  align-items: center;
  gap: 4px;
  padding: 8px;
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: 14px;
}
.howto-panel { margin: 0; min-width: 0; }
.howto-panel svg { display: block; width: 100%; height: auto; overflow: visible; }
.howto-panel figcaption {
  text-align: center;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.howto-arrow { width: 22px; height: 22px; fill: none; stroke: var(--blue-text); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

/* Diagram drawing: the person in the text color, equipment in blue */
.howto-panel .fig, .howto-panel .fig-far { stroke: var(--text); stroke-width: 4.4; stroke-linecap: round; fill: none; }
.howto-panel .fig-far { opacity: 0.35; }
.howto-panel .fig-torso { stroke-width: 6; }
.howto-panel .fig-halo { stroke: var(--card-2); stroke-width: 7.4; stroke-linecap: round; fill: none; }
.howto-panel .fig-head { fill: var(--card-2); stroke: var(--text); stroke-width: 3.2; }
.howto-panel .floor { stroke: var(--border); stroke-width: 2; stroke-linecap: round; }
.howto-panel .eq { stroke: var(--blue-text); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; fill: none; }
.howto-panel .eq-light { stroke: var(--blue-line); stroke-width: 2.4; stroke-linecap: round; fill: none; }
.howto-panel .eq-fill { fill: var(--blue-soft); stroke: var(--blue-text); stroke-width: 2; }
.howto-panel .eq-light-fill { fill: var(--blue-soft); stroke: var(--blue-line); stroke-width: 2; }
.howto-panel .eq-solid { fill: var(--blue-text); }
.howto-panel .pad-out { stroke: var(--blue-text); stroke-width: 7.5; stroke-linecap: round; }
.howto-panel .pad-in { stroke: var(--blue-soft); stroke-width: 4; stroke-linecap: round; }
.howto-panel .cable { stroke: var(--blue-line); stroke-width: 1.6; stroke-dasharray: 3 2.5; }
.howto-panel .band { stroke: var(--blue-text); stroke-width: 2.2; fill: none; stroke-linecap: round; }

.howto-steps { margin: 0; padding-left: 22px; display: grid; gap: 6px; }
.howto-steps li::marker { color: var(--blue-text); font-weight: 700; }
.howto-works { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0; }
.howto-works > span:first-child { font-weight: 700; margin-right: 2px; }
.howto-chip {
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue-text);
  font-size: 0.85rem;
  font-weight: 600;
}
.howto-tip {
  margin: 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--card-2);
  border: 1px dashed var(--blue-line);
  font-size: 0.92rem;
}

/* ===== Workout tab ===== */
.plan-controls { display: grid; gap: 12px; margin-bottom: 16px; }
.segmented {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-self: center;
  padding: 4px 4px 4px 14px;
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: 999px;
}
.segmented-label { font-weight: 600; margin-right: 6px; }
.segmented button {
  min-width: 44px;
  min-height: 40px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.segmented button[aria-checked="true"] { background: var(--blue); color: var(--on-blue); }

.day-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin: 0 -16px;
  padding: 2px 16px 6px;
  scrollbar-width: none;
}
.day-tabs::-webkit-scrollbar { display: none; }
.day-tabs button {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 120px;
  padding: 8px 14px;
  border: 2px solid var(--border);
  border-radius: 14px;
  background: var(--card);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.day-tabs button[aria-selected="true"] { border-color: var(--blue); background: var(--blue-soft); }
.day-num { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--blue-text); }
.day-name { font-weight: 600; }
@media (min-width: 600px) { .day-tabs { margin: 0; padding-inline: 0; } }

.plan-summary {
  display: grid;
  gap: 8px;
  padding: 14px 16px;
  margin-bottom: 8px;
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
}
.progress { display: grid; gap: 4px; }
.progress-bar { height: 10px; border-radius: 999px; background: var(--blue-soft); overflow: hidden; }
.progress-bar span { display: block; height: 100%; background: var(--blue); border-radius: inherit; transition: width 0.25s; }
.progress-text { font-size: 0.85rem; color: var(--muted); font-variant-numeric: tabular-nums; }

.plan-section { margin-top: 24px; }
.plan-section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.plan-section-head h2 { margin: 0; font-size: 1.3rem; }
.plan-section > .muted { margin: 4px 0 12px; }
.rest-pill {
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue-text);
  font-weight: 700;
  font-size: 0.85rem;
}
.exercise-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.exercise-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  min-width: 0;
}
.exercise-head { display: flex; gap: 12px; align-items: flex-start; }
.exercise-head h3 { margin: 0; font-size: 1.1rem; }
.exercise-num {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--blue);
  color: var(--on-blue);
  font-weight: 700;
}
.exercise-meta { margin: 2px 0 0; color: var(--muted); font-size: 0.9rem; }
.type-tag {
  display: inline-block;
  padding: 1px 8px;
  margin-right: 4px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.type-compound { background: var(--blue); color: var(--on-blue); }
.type-isolation { background: var(--blue-soft); color: var(--blue-text); }

.set-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.set-btn {
  min-height: 46px;
  border: 2px solid var(--border);
  border-radius: 14px;
  background: var(--card-2);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  touch-action: manipulation;
}
.set-btn[aria-pressed="true"] { background: var(--blue); border-color: var(--blue); color: var(--on-blue); }
.set-btn[aria-pressed="true"]::before { content: "✓ "; }

.weight-log { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.weight-log input {
  width: 96px;
  min-height: 44px;
  padding: 8px 12px;
  font: inherit;
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: 12px;
}
.weight-log input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.exercise-card > .muted.small { margin: 0; }

.howto-details summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--blue-text);
  padding: 6px 0;
  width: fit-content;
}
.howto-details .howto-card { margin-top: 8px; border-width: 1px; }
.howto-details .howto-head { display: none; } /* the exercise card already shows the name */

.plan-footer { display: grid; justify-items: center; gap: 8px; margin-top: 24px; text-align: center; }

/* Rest timer bar, above the tab bar */
.rest-timer {
  position: fixed;
  left: max(12px, env(safe-area-inset-left, 0px));
  right: max(12px, env(safe-area-inset-right, 0px));
  bottom: calc(var(--tab-h) + var(--safe-bottom) + 10px);
  z-index: 35;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  max-width: 560px;
  margin: 0 auto;
  padding: 10px 12px 10px 18px;
  background: var(--text);
  color: var(--bg);
  border-radius: 20px;
  box-shadow: 0 10px 30px var(--shadow);
}
body:not([data-tab="workout"]) .rest-timer { display: none; }
.rest-label { font-weight: 600; }
.rest-time { font-size: 1.6rem; font-weight: 700; font-variant-numeric: tabular-nums; margin-right: auto; }
.rest-buttons { display: flex; gap: 6px; }
.rest-buttons button {
  min-height: 40px;
  padding: 6px 12px;
  border: 0;
  border-radius: 12px;
  background: color-mix(in srgb, var(--bg) 18%, transparent);
  color: var(--bg);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.rest-timer.done { background: var(--blue); color: var(--on-blue); }
.rest-timer.done .rest-buttons button { color: var(--on-blue); background: rgba(255, 255, 255, 0.2); }
@media (min-width: 768px) { .rest-timer { bottom: 20px; } }
/* Keep the last exercise visible above the timer */
body[data-tab="workout"] main { padding-bottom: 120px; }
.plan-note { margin: 0; padding: 8px 12px; border-radius: 12px; background: var(--blue-soft); color: var(--text); font-size: 0.9rem; }

/* ===== Account button (top bar) ===== */
.account-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 4px 14px 4px 4px;
  border: 2px solid var(--border);
  border-radius: 999px;
  background: var(--card);
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
  max-width: 50vw;
}
.account-btn:not(.signed-in) { padding-left: 14px; }
.account-btn:not(.signed-in) .account-avatar { display: none; }
.account-btn.active { border-color: var(--blue); }
.account-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-avatar {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--blue);
  color: var(--on-blue);
  font-weight: 700;
}
.account-avatar.big { width: 64px; height: 64px; font-size: 1.8rem; margin-bottom: 10px; }
@media (max-width: 380px) { .account-btn.signed-in .account-label { display: none; } .account-btn.signed-in { padding-right: 4px; } }
.tab { font-size: 0.7rem; }
@media (min-width: 768px) { .tab { font-size: 0.95rem; } }

/* ===== Account screen ===== */
.auth-switch { display: flex; width: fit-content; margin: 0 auto 16px; padding-left: 4px; }
.auth-switch button { padding: 0 18px; }
.auth-switch button[aria-selected="true"] { background: var(--blue); color: var(--on-blue); }
.auth-form { display: grid; gap: 6px; max-width: 440px; margin: 0 auto 16px; }
.auth-form label { font-weight: 600; margin-top: 8px; }
.auth-form input {
  min-height: 48px;
  padding: 10px 14px;
  font: inherit;
  font-size: 1rem;
  color: var(--text);
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: 14px;
}
.auth-form input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.auth-form .btn { margin-top: 12px; }
.auth-form .forgot { justify-self: start; }
.auth-form p { margin: 0; }
.center { text-align: center; }
.account-panel { max-width: 560px; margin-inline: auto; }
.account-panel h2 { font-size: 1.1rem; }
.account-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.sync-line { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font-weight: 600; }
.sync-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--blue); flex-shrink: 0; }
.sync-dot.syncing { background: var(--blue-line); }
.sync-dot.error { background: #c2410c; }
.btn-danger { background: #b42318; border-color: #b42318; color: #fff; }
@media (hover: hover) { .btn-danger:hover { background: #8f1c13; border-color: #8f1c13; } }

/* ===== History screen ===== */
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 20px; }
.stat {
  display: grid;
  gap: 2px;
  padding: 14px 12px;
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: 16px;
  text-align: center;
}
.stat-num { font-size: 1.8rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.1; }
.stat-label { font-size: 0.8rem; color: var(--muted); }
.chart-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.chart-head h2 { margin: 0; }
.chart-pick select {
  min-height: 42px;
  max-width: 100%;
  padding: 6px 12px;
  font: inherit;
  color: var(--text);
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: 12px;
}
.chart-wrap { position: relative; }
.progress-chart { display: block; width: 100%; height: auto; touch-action: pan-y; }
.ch-grid { stroke: var(--border); stroke-width: 1; }
.ch-axis { stroke: var(--blue-line); stroke-width: 1; }
.ch-tick { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.ch-line { fill: none; stroke: var(--blue); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.ch-dot { fill: var(--blue); stroke: var(--card); stroke-width: 2; }
.ch-end { fill: var(--text); font-size: 12px; font-weight: 700; }
.ch-cross { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; }
.ch-hit { fill: transparent; cursor: crosshair; }
.ch-tip {
  position: absolute;
  transform: translate(-50%, calc(-100% - 12px));
  display: grid;
  padding: 6px 10px;
  background: var(--text);
  color: var(--bg);
  border-radius: 10px;
  font-size: 0.85rem;
  pointer-events: none;
  white-space: nowrap;
}
.chart-empty { margin: 8px 0; }
.chart-table summary { cursor: pointer; color: var(--blue-text); font-weight: 600; }
.chart-table table { border-collapse: collapse; margin-top: 8px; font-variant-numeric: tabular-nums; }
.chart-table th, .chart-table td { padding: 4px 16px 4px 0; text-align: left; border-bottom: 1px solid var(--border); }
.history-list-section h2 { font-size: 1.3rem; }
.history-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.history-item { padding: 16px; background: var(--card); border: 2px solid var(--border); border-radius: var(--radius); }
.history-top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.history-top h3 { margin: 0; font-size: 1.1rem; }
.history-top p { margin: 0; }
.history-date { font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--blue-text); }
.history-exercises { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 4px; }
.history-exercises li { display: flex; justify-content: space-between; gap: 12px; padding-top: 4px; border-top: 1px solid var(--border); font-size: 0.92rem; }
.history-exercises li { flex-wrap: wrap; gap: 0 12px; }
.note a, .status a { color: var(--blue-text); font-weight: 600; }

/* ===== Workout type, days a week, and per-set weights ===== */
.plan-control { display: grid; gap: 8px; }
.control-label { font-weight: 700; }
.type-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
@media (min-width: 700px) { .type-grid { grid-template-columns: repeat(4, 1fr); } }
.type-grid button {
  display: grid;
  gap: 2px;
  min-height: 64px;
  padding: 10px 12px;
  border: 2px solid var(--border);
  border-radius: 14px;
  background: var(--card);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  touch-action: manipulation;
}
.type-grid button[aria-checked="true"] { border-color: var(--blue); background: var(--blue-soft); }
.type-name { font-weight: 700; }
.type-desc { font-size: 0.8rem; color: var(--muted); line-height: 1.3; }
.day-count { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; max-width: 420px; }
.day-count button {
  min-height: 44px;
  border: 2px solid var(--border);
  border-radius: 12px;
  background: var(--card);
  color: var(--text);
  font: inherit;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  touch-action: manipulation;
}
.day-count button[aria-checked="true"] { background: var(--blue); border-color: var(--blue); color: var(--on-blue); }

.set-list { display: grid; gap: 8px; }
/* "Set 1" on top, then weight, reps and Done in a row */
.set-line {
  display: grid;
  grid-template-columns: 104px 1fr auto;
  align-items: start;
  gap: 4px 8px;
  padding: 8px 10px;
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: 14px;
}
.set-label { grid-column: 1 / -1; font-weight: 700; font-size: 0.9rem; }
.set-weight, .set-reps { display: grid; gap: 2px; min-width: 0; }
.set-line input {
  width: 100%;
  max-width: 84px;
  min-height: 44px;
  padding: 6px 10px;
  font: inherit;
  font-size: 1rem; /* stops iPhones zooming in */
  font-variant-numeric: tabular-nums;
  color: var(--text);
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: 10px;
}
.set-line input::placeholder { color: var(--muted); opacity: 0.6; }
.set-line input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
/* An empty box (only a grey hint) gets a dashed border so it's clear it still needs a number */
.set-line input:placeholder-shown { border-style: dashed; background: transparent; }
.set-unit { color: var(--muted); font-size: 0.8rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.set-bw { align-self: center; color: var(--muted); font-size: 0.9rem; }
.set-line .set-btn { min-width: 76px; min-height: 44px; padding-inline: 6px; }
.last-time { margin: 0; font-size: 0.92rem; color: var(--muted); }
.last-time strong { color: var(--blue-text); }
.set-tip { margin: 0; padding: 10px 12px; border-radius: 12px; background: var(--blue-soft); font-weight: 600; font-size: 0.92rem; }
.set-tip:empty { display: none; }
.set-error { margin: 0; color: #b42318; font-weight: 600; font-size: 0.9rem; }
.set-error:empty { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .set-error { color: #ff8a7a; } }
:root[data-theme="dark"] .set-error { color: #ff8a7a; }
.ch-end-kg { fill: var(--muted); font-size: 11px; }

/* Picture button beside each checklist item */
.chip-pic {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--card);
  color: var(--muted);
  cursor: pointer;
  touch-action: manipulation;
}
.chip-pic svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }
.chip-pic[aria-expanded="true"] { background: var(--blue); border-color: var(--blue); color: var(--on-blue); }
@media (hover: hover) { .chip-pic:hover { border-color: var(--blue); color: var(--blue-text); } .chip-pic[aria-expanded="true"]:hover { color: var(--on-blue); } }
.chip-pic:focus-visible { outline: 3px solid var(--blue-text); outline-offset: 2px; }
.preview-credit a, .guide-credit a { color: inherit; text-decoration: underline; text-decoration-color: var(--blue-line); }
/* No footer anymore: keep the last content clear of the bottom tab bar */
main { padding-bottom: 40px; }

/* An exercise with all its sets done gets a blue outline */
.exercise-card { scroll-margin-top: calc(80px + var(--safe-top)); transition: border-color 0.2s, box-shadow 0.2s; }
.exercise-card:focus { outline: none; }
.exercise-card.complete { border-color: var(--blue); box-shadow: 0 0 0 3px var(--glow); }

@media (max-width: 350px) {
  .exercise-card { padding: 12px 8px; }
  .set-line { grid-template-columns: 92px 1fr auto; gap: 4px 6px; padding: 8px 6px; }
  .set-line .set-btn { min-width: 68px; font-size: 0.9rem; }
}

/* ===== Height & weight box (Workout tab) and weekly report (History tab) ===== */
.body-panel { padding: 14px 16px; margin-bottom: 16px; }
.body-panel summary { cursor: pointer; }
.body-title { font-weight: 700; }
#body-summary { display: block; margin-top: 2px; }
#body-form { display: grid; gap: 12px; margin-top: 14px; justify-items: start; }
#body-form .status { margin: 0; }
.body-field { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.body-label { flex-basis: 100%; font-weight: 600; }
.body-inputs { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 600; }
.body-inputs input {
  width: 60px;
  min-height: 44px;
  padding: 6px 10px;
  font: inherit;
  font-size: 1rem;
  font-weight: 400;
  color: var(--text);
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: 10px;
}
.body-inputs input.wide { width: 92px; }
.body-inputs input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.body-inputs input::placeholder { color: var(--muted); opacity: 0.6; }
.body-metric { color: var(--muted); white-space: nowrap; }

.report-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.report-head p { margin: 0; }
.report-nav { display: flex; gap: 6px; }
.report-nav button {
  width: 44px;
  height: 44px;
  border: 2px solid var(--border);
  border-radius: 12px;
  background: var(--card);
  color: var(--blue-text);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}
.report-nav button:disabled { opacity: 0.35; cursor: default; }
.report-list { margin: 12px 0; }
.report-list > div { display: flex; justify-content: space-between; gap: 16px; padding: 8px 0; border-top: 1px solid var(--border); }
.report-list dt { flex-shrink: 0; color: var(--muted); }
.report-list dd { margin: 0; text-align: right; }
.report-list a { color: var(--blue-text); font-weight: 600; }
.report-panel > .small { margin: 0; }

/* "Workout saved" message at the top of History */
.saved-note { margin: 0 0 16px; padding: 12px 16px; border-radius: 14px; background: var(--blue); color: var(--on-blue); font-weight: 600; text-align: center; }
