:root {
  --color-bg: #0d1013;
  --color-surface: #151a1e;
  --color-surface-2: #1b2126;
  --color-border: #262e34;
  --color-lime: #c8f24a;
  --color-lime-light: #daf87c;
  --color-lime-dim: #3a4a1f;
  --color-text: #f5f7f6;
  --color-text-secondary: #8a959a;
  --color-danger: #ff6b6b;
  --color-danger-bg: #2a1414;
  --color-danger-border: #4a2323;
  --font-body: system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Space Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--color-bg);
  color: var(--color-text);
}

.app-shell {
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* ---------- Shared form controls ---------- */

label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  margin-top: 1rem;
  margin-bottom: 0.3rem;
}

input,
select,
textarea {
  width: 100%;
  padding: 0.6rem 0.75rem;
  font-size: 1rem;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  font-family: inherit;
  background: var(--color-surface-2);
  color: var(--color-text);
}

input::placeholder,
textarea::placeholder {
  color: var(--color-text-secondary);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--color-lime);
  box-shadow: 0 0 0 3px rgba(200, 242, 74, 0.25);
}

.error {
  color: var(--color-danger);
  background: var(--color-danger-bg);
  border: 1px solid var(--color-danger-border);
  border-radius: 8px;
  padding: 0.6rem 0.75rem;
  margin-top: 1rem;
  font-size: 0.85rem;
}

.modal-hint {
  color: var(--color-text-secondary);
  font-size: 0.85rem;
  margin: 0.5rem 0 0;
}

/* ---------- Auth screen ---------- */

/* :not([hidden]) so el.*.hidden = true actually suppresses display —
   an unconditional `display` here would silently override the browser's
   default [hidden] { display: none } rule (see the guide-link fix). */
.auth-screen:not([hidden]) {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.auth-card {
  width: 100%;
  max-width: 360px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 16px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.4);
  padding: 2rem 1.75rem;
}

.auth-card h1 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
  text-align: center;
  color: var(--color-lime-light);
}

/* :not([hidden]) so el.importUploadRow.hidden = true actually suppresses
   display — an unconditional `display` here would silently override the
   browser's default [hidden] { display: none } rule (see the guide-link/
   auth-screen fix above). Harmless for this class's other, never-hidden
   usages (auth form, modal footers). */
.button-row:not([hidden]) {
  display: flex;
  gap: 0.6rem;
  margin-top: 1.5rem;
}

.btn {
  flex: 1;
  padding: 0.65rem;
  font-size: 0.95rem;
  font-family: var(--font-display);
  font-weight: 700;
  border: none;
  border-radius: 10px;
  cursor: pointer;
}

.btn-primary {
  background: var(--color-lime);
  color: #0d1013;
}

.btn-primary:hover:not(:disabled) {
  background: var(--color-lime-light);
}

.btn-secondary {
  background: var(--color-surface-2);
  color: var(--color-text);
  border: 1px solid var(--color-border);
}

.btn-secondary:hover:not(:disabled) {
  background: #232b31;
}

.btn-danger {
  background: var(--color-danger);
  color: #1a0a0a;
}

.btn-danger:hover:not(:disabled) {
  background: #ff8787;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-ghost {
  flex: none;
  background: var(--color-surface-2);
  color: var(--color-text-secondary);
  border: 1px solid var(--color-border);
  padding: 0.4rem 0.9rem;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
}

.btn-ghost:hover {
  border-color: var(--color-lime);
  color: var(--color-text);
}

/* ---------- Chat screen ---------- */

.chat-screen:not([hidden]) {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-width: 720px;
  width: 100%;
  margin: 0 auto;
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.85rem 1.25rem;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
}

.chat-header h1 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0;
  white-space: nowrap;
}

/* ---------- IGKA AI brand mark ---------- */
/*
   The logo is a portrait shield with the name inside it, so it is placed as
   the heading's content rather than beside it — no second "IGKA AI" in text.
   Only `height` is set; `width: auto` keeps the artwork's own proportions,
   and the file is used exactly as delivered.
*/

.brand-heading {
  display: flex;
  align-items: center;
  margin: 0;
  /* The h1 no longer holds text, so its font metrics must not add a line box
     of their own on top of the image. */
  line-height: 0;
}

.brand-logo {
  /* Sized to the header's existing rhythm: the text it replaces occupied
     roughly this much, so the bar keeps its height. */
  height: 2.4rem;
  width: auto;
  display: block;
}

.auth-logo {
  height: 7.5rem;
  width: auto;
  display: block;
  margin: 0 auto 0.5rem;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-lime);
  background: var(--color-lime-dim);
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
}

.status-indicator::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-lime);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.chat-log {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.message {
  max-width: 82%;
  padding: 0.65rem 0.9rem;
  border-radius: 14px;
  font-size: 0.95rem;
  line-height: 1.45;
}

.message-text {
  margin: 0;
  white-space: pre-wrap;
}

.message-author {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-display);
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--color-lime);
  background: var(--color-lime-dim);
  padding: 0.12rem 0.5rem;
  border-radius: 999px;
  margin-bottom: 0.4rem;
}

.message-user {
  align-self: flex-end;
  background: var(--color-lime);
  color: #0d1013;
  border-bottom-right-radius: 4px;
  font-weight: 600;
}

.message-coach {
  align-self: flex-start;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-bottom-left-radius: 4px;
}

.message-loading .message-text {
  color: var(--color-text-secondary);
  font-style: italic;
  animation: thinking-pulse 1.4s ease-in-out infinite;
}

@keyframes thinking-pulse {
  0%,
  100% {
    opacity: 0.45;
  }
  50% {
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .message-loading .message-text {
    animation: none;
  }
}

.message-error {
  align-self: flex-start;
  background: var(--color-danger-bg);
  color: var(--color-danger);
  border: 1px solid var(--color-danger-border);
  border-bottom-left-radius: 4px;
}

/* Empty-chat example prompts (Fix 3) — visually secondary, tappable pills
   shown only under the welcome message on a genuinely empty chat. */
.example-prompts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-self: flex-start;
  max-width: 92%;
}

.example-prompt-btn {
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  padding: 0.5rem 0.9rem;
  font-family: inherit;
  font-size: 0.82rem;
  color: var(--color-text-secondary);
  cursor: pointer;
  text-align: left;
}

.example-prompt-btn:hover,
.example-prompt-btn:focus-visible {
  border-color: var(--color-lime);
  color: var(--color-text);
}

.guide-link:not([hidden]) {
  display: inline-block;
  margin-top: 0.55rem;
  font-size: 0.85rem;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--color-lime);
  text-decoration: none;
}

.guide-link:hover {
  color: var(--color-lime-light);
  text-decoration: underline;
}

/* ---------- Interactive coach cards (plan selector / focus confirm) ------- */

.interactive-card {
  align-self: flex-start;
  max-width: 92%;
  width: 100%;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 14px;
  border-bottom-left-radius: 4px;
  padding: 0.9rem 1rem;
}

.interactive-card.is-resolved {
  opacity: 0.6;
}

/* A card the user never finished (a new message was sent instead) — dimmed
   further than a normally-resolved card, plus a short label, so it reads as
   "no longer active" rather than "completed". */
.interactive-card.is-expired {
  opacity: 0.45;
}

.interactive-card.is-expired::after {
  content: "Больше не активно";
  display: block;
  margin-top: 0.6rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--color-text-secondary);
}

.interactive-card h3 {
  font-family: var(--font-display);
  margin: 0 0 0.75rem;
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--color-text);
}

.plan-choice-row {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.plan-choice-btn {
  display: block;
  width: 100%;
  text-align: left;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 0.6rem 0.75rem;
  cursor: pointer;
  color: var(--color-text);
  font-family: inherit;
}

.plan-choice-btn:hover:not(:disabled) {
  border-color: var(--color-lime);
}

.plan-choice-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.plan-choice-title {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.92rem;
}

.plan-choice-hint {
  display: block;
  font-size: 0.78rem;
  color: var(--color-text-secondary);
  margin-top: 0.15rem;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.85rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: var(--color-lime);
  color: #0d1013;
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 800;
  border-radius: 999px;
  padding: 0.3rem 0.7rem;
}

.card-actions {
  display: flex;
  gap: 0.5rem;
}

.card-actions .btn {
  flex: 1;
  padding: 0.55rem;
  font-size: 0.85rem;
}

/* ---------- Workout logging confirmation card ---------- */

.log-duplicate-warning {
  font-size: 0.82rem;
  color: var(--color-danger);
  background: var(--color-danger-bg);
  border: 1px solid var(--color-danger-border);
  border-radius: 8px;
  padding: 0.5rem 0.7rem;
  margin: 0 0 0.7rem;
}

.log-exercise {
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 0.6rem 0.8rem;
  margin-bottom: 0.5rem;
}

.log-exercise-name {
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-weight: 700;
  margin: 0 0 0.4rem;
}

.log-sets-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.6rem;
}

/* ---------- Anatomical muscle selector ---------- */

.anatomy-card {
  max-width: 100%;
}

.anatomy-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.9rem;
}

.anatomy-head-row h3 {
  margin: 0;
}

.anatomy-toggle {
  display: flex;
  flex: none;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  padding: 3px;
}

.anatomy-toggle-btn {
  font-family: var(--font-display);
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: var(--color-text-secondary);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

.anatomy-toggle-btn.is-active {
  background: var(--color-lime);
  color: #0d1013;
}

.anatomy-toggle-btn:disabled {
  cursor: not-allowed;
}

.anatomy-figure-wrap {
  display: flex;
  justify-content: center;
  margin: 0.4rem 0 0.6rem;
}

.anatomy-figure {
  width: 220px;
  height: 460px;
  max-width: 100%;
}

.anatomy-neutral {
  fill: #232b31;
}

.anatomy-zone {
  cursor: pointer;
}

.anatomy-zone-shape {
  fill: var(--color-surface-2);
  stroke: var(--color-border);
  stroke-width: 1.5;
  transition: fill 0.12s ease, stroke 0.12s ease, opacity 0.12s ease;
}

/* Invisible, enlarged sibling of .anatomy-zone-shape used only to widen the
   tappable area on small screens — never painted, but still hit-tested
   (explicit pointer-events since a fully transparent fill alone isn't
   reliably clickable in every browser). The visible artwork above is
   completely unaffected. */
.anatomy-zone-hitarea {
  fill: transparent;
  stroke: none;
  pointer-events: all;
}

.anatomy-zone-label {
  font-family: var(--font-display);
  font-size: 8.5px;
  font-weight: 700;
  fill: var(--color-text-secondary);
  letter-spacing: 0.02em;
  pointer-events: none;
}

.anatomy-zone:hover:not(.is-disabled):not(.is-selected) .anatomy-zone-shape {
  stroke: var(--color-lime-light);
}

.anatomy-zone.is-selected .anatomy-zone-shape {
  fill: var(--color-lime);
  stroke: var(--color-lime);
  filter: drop-shadow(0 0 8px rgba(200, 242, 74, 0.6));
}

.anatomy-zone.is-selected .anatomy-zone-label {
  fill: #0d1013;
  font-weight: 800;
}

.anatomy-zone.is-disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

/* .anatomy-zone-hitarea sets its own pointer-events: all (needed since a
   transparent fill alone isn't reliably clickable), which would otherwise
   override the parent's pointer-events: none above — this more specific
   rule keeps a disabled zone's enlarged hit area inert too. */
.anatomy-zone.is-disabled .anatomy-zone-hitarea {
  pointer-events: none;
}

.anatomy-hint {
  font-size: 0.78rem;
  color: var(--color-text-secondary);
  text-align: center;
  margin: 0 0 0.75rem;
}

.anatomy-summary {
  font-size: 0.85rem;
  color: var(--color-text-secondary);
  margin: 0 0 0.75rem;
}

.anatomy-summary.has-selection {
  color: var(--color-text);
}

.anatomy-summary.has-selection::after {
  content: "";
}

/* ---------- Workout plan card ---------- */

.plan-card {
  align-self: flex-start;
  max-width: 92%;
  width: 100%;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 14px;
  border-bottom-left-radius: 4px;
  padding: 1rem 1.1rem;
}

.plan-card-eyebrow {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-lime);
  margin: 0 0 0.15rem;
}

.plan-card-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0 0 0.85rem;
  color: var(--color-text);
}

.plan-card-section-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-secondary);
  margin: 0 0 0.3rem;
}

.plan-card-warmup {
  font-size: 0.88rem;
  color: var(--color-text-secondary);
  margin: 0 0 1rem;
  white-space: pre-wrap;
}

.plan-exercise {
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 0.7rem 0.85rem;
  margin-bottom: 0.6rem;
}

.plan-exercise-name {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
}

.plan-exercise-stats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.7rem;
  font-size: 0.85rem;
  color: var(--color-text-secondary);
  margin-bottom: 0.3rem;
}

.stat-pill {
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 700;
  background: var(--color-lime-dim);
  color: var(--color-lime);
  padding: 0.18rem 0.5rem;
  border-radius: 6px;
}

.stat-text {
  font-size: 0.8rem;
  color: var(--color-text-secondary);
}

.rpe-bar {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 14px;
}

.rpe-bar-segment {
  width: 3px;
  background: var(--color-border);
  border-radius: 1px;
  display: block;
}

.rpe-bar-segment.is-on {
  background: var(--color-lime);
}

.plan-exercise-notes {
  font-size: 0.82rem;
  color: var(--color-text-secondary);
  margin: 0.3rem 0 0;
  white-space: pre-wrap;
}

/* Plain-language load guidance (Fix B) — the primary "how hard" signal,
   deliberately more prominent than the small secondary RPE stat-text above. */
.plan-exercise-load {
  font-size: 0.85rem;
  color: var(--color-text);
  margin: 0.35rem 0 0;
  white-space: pre-line;
}

/* Smart Progression v1 — a short explanation of *why* this weight, distinct
   from the load-guidance line above (which is about today's target effort,
   not the number itself). Same secondary-text treatment as plan-exercise-
   notes, kept visually quiet rather than competing with the weight pill. */
.plan-exercise-progression {
  font-size: 0.82rem;
  color: var(--color-text-secondary);
  margin: 0.3rem 0 0;
}

/* One small, reusable, collapsed-by-default RPE explainer per plan card
   (never per exercise) — contextual, not a permanent fixture. */
.rpe-explain-toggle {
  display: block;
  background: none;
  border: none;
  padding: 0;
  margin: 0 0 0.85rem;
  font-family: inherit;
  font-size: 0.78rem;
  color: var(--color-text-secondary);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

/* Per-exercise substitution control. Deliberately quiet — it sits on the
   plan card only, never as a standing panel in the chat. */
.plan-substitute-btn {
  margin-top: 0.55rem;
  background: none;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 0.4rem 0.7rem;
  font-family: inherit;
  font-size: 0.78rem;
  color: var(--color-text-secondary);
  cursor: pointer;
}

.plan-substitute-btn:hover:not(:disabled) {
  border-color: var(--color-lime);
  color: var(--color-lime-light);
}

.plan-substitute-btn:disabled {
  opacity: 0.6;
  cursor: default;
}

.rpe-explain-toggle:hover,
.rpe-explain-toggle:focus-visible {
  color: var(--color-lime);
}

.rpe-explain-panel {
  font-size: 0.8rem;
  color: var(--color-text-secondary);
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 0.6rem 0.75rem;
  margin: -0.55rem 0 0.85rem;
}

.plan-card-notes {
  margin: 0.9rem 0 0;
  padding-left: 1.1rem;
  font-size: 0.85rem;
  color: var(--color-text-secondary);
}

.plan-card-notes li {
  margin-bottom: 0.25rem;
}

/* ---------- Plan completion loop (Как прошла тренировка?) ---------- */

.plan-completion {
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--color-border);
}

.plan-completion-label {
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 700;
  margin: 0 0 0.55rem;
  color: var(--color-text);
}

.plan-completion .card-actions {
  flex-wrap: wrap;
}

.plan-completion .card-actions .btn {
  flex: 1 1 auto;
  min-width: 8.5rem;
}

/* Same visual language as .interactive-card.is-resolved/.is-expired —
   only the action row dims, never the plan's own content above it. */
.plan-completion.is-resolved {
  opacity: 0.6;
}

.plan-completion.is-expired {
  opacity: 0.45;
}

.plan-completion.is-expired::after {
  content: "Больше не активно";
  display: block;
  margin-top: 0.6rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--color-text-secondary);
}

/* ---------- Composer ---------- */

.composer {
  border-top: 1px solid var(--color-border);
  background: var(--color-surface);
  padding: 0.6rem 1.25rem 0.9rem;
  /* Same rule the guided action bar already uses: in an installed app the
     page reaches the bottom of the screen, and the home indicator sits on
     top of whatever is there. Resolves to 0 everywhere else. */
  padding-bottom: calc(0.9rem + env(safe-area-inset-bottom, 0px));
}

.composer-category {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.composer-category label {
  margin: 0;
  font-size: 0.72rem;
  color: var(--color-text-secondary);
  white-space: nowrap;
}

.composer-category select {
  padding: 0.3rem 0.5rem;
  font-size: 0.8rem;
  border-radius: 8px;
  width: auto;
  color: var(--color-text-secondary);
  background: var(--color-surface-2);
}

.composer-row {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
}

.composer-row textarea {
  flex: 1;
  resize: none;
  border-radius: 16px;
  padding: 0.6rem 0.9rem;
  max-height: 6rem;
}

.send-btn {
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: none;
  background: var(--color-lime);
  color: #0d1013;
  font-size: 1.15rem;
  font-family: var(--font-display);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.send-btn:hover:not(:disabled) {
  background: var(--color-lime-light);
}

.send-btn:disabled {
  background: var(--color-surface-2);
  color: var(--color-text-secondary);
  cursor: not-allowed;
}

/* ---------- Modals (import / clear chat) ---------- */

/* :not([hidden]) so el.*Modal.hidden = true actually suppresses
   display — see the chat-screen/auth-screen fix for why an unconditional
   `display` here would silently defeat the hidden attribute. */
.modal-overlay:not([hidden]) {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 10;
}

.modal-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 16px;
  padding: 1.5rem;
  max-width: 420px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
}

.modal-card h2 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 1rem;
  color: var(--color-text);
}

/* Title row with the single close control. The modal's only way out, so
   there is no competing "Отмена" button alongside the real choices. */
.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.modal-header h2 {
  margin-bottom: 0.75rem;
}

.modal-close-btn {
  flex: 0 0 auto;
  /* A comfortable touch target even though the glyph itself is small. */
  width: 2.25rem;
  height: 2.25rem;
  margin: -0.35rem -0.35rem 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  border-radius: 8px;
  font-family: inherit;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--color-text-secondary);
  cursor: pointer;
}

.modal-close-btn:hover {
  background: var(--color-surface-2);
  color: var(--color-text);
}

/* --- profile panel --- */

.profile-field-label {
  margin: 0 0 0.6rem;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-text-secondary);
}

.profile-level-options {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

/* The level currently stored, so the panel shows the present setting rather
   than two identical-looking choices. */
.profile-level-options .btn.is-selected {
  border-color: var(--color-lime);
  color: var(--color-lime-light);
}

.modal-card ul {
  margin: 0.4rem 0;
  padding-left: 1.2rem;
  font-size: 0.9rem;
  color: var(--color-text-secondary);
}

#import-result:not([hidden]) {
  margin-top: 1rem;
  padding: 0.6rem 0.75rem;
  background: rgba(200, 242, 74, 0.12);
  color: var(--color-lime-light);
  border: 1px solid rgba(200, 242, 74, 0.3);
  border-radius: 8px;
  font-size: 0.9rem;
}

/* ---------- Onboarding ---------- */
/* Same visual language as .auth-screen/.auth-card (dark surface, acid-lime
   accent, existing .btn/.button-row) — deliberately not a separate visual
   system. */

.onboarding-screen:not([hidden]) {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.onboarding-card {
  width: 100%;
  max-width: 480px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 16px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.4);
  padding: 2rem 1.75rem;
  max-height: 85vh;
  overflow-y: auto;
}

.onboarding-card h1 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  margin: 0 0 0.6rem;
  text-align: center;
  color: var(--color-lime-light);
}

.onboarding-hint {
  font-size: 0.88rem;
  color: var(--color-text-secondary);
  text-align: center;
  margin: 0 0 1.25rem;
  line-height: 1.5;
}

.onboarding-choice-row {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* Two big, unambiguous, thumb-friendly buttons — the whole point of step
   1's UX (see the product spec's own "не использовать профессиональные
   термины" requirement). */
.onboarding-choice-btn {
  padding: 1.1rem 1rem;
  font-size: 1.05rem;
}

.onboarding-exercise-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 40vh;
  overflow-y: auto;
  margin-bottom: 0.75rem;
}

.onboarding-exercise-btn {
  display: block;
  width: 100%;
  text-align: left;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 0.65rem 0.85rem;
  cursor: pointer;
  color: var(--color-text);
  font-family: inherit;
  font-size: 0.92rem;
}

.onboarding-exercise-btn:hover:not(:disabled) {
  border-color: var(--color-lime);
}

.onboarding-exercise-btn.is-selected {
  border-color: var(--color-lime);
  background: rgba(200, 242, 74, 0.12);
  color: var(--color-lime-light);
}

.onboarding-exercise-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.onboarding-limit-hint {
  font-size: 0.78rem;
  color: var(--color-text-secondary);
  text-align: center;
  margin: 0 0 0.5rem;
}

.onboarding-results-list {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  margin-bottom: 1.25rem;
}

.onboarding-result-row {
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 0.7rem 0.85rem;
}

.onboarding-result-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.92rem;
  margin: 0 0 0.5rem;
  color: var(--color-text);
}

.onboarding-result-input {
  width: 100%;
  box-sizing: border-box;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 0.5rem 0.65rem;
  color: var(--color-text);
  font-family: inherit;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.onboarding-result-input:disabled {
  opacity: 0.5;
}

.onboarding-forgot-btn {
  background: none;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 0.35rem 0.65rem;
  font-size: 0.78rem;
  color: var(--color-text-secondary);
  cursor: pointer;
  font-family: inherit;
}

.onboarding-forgot-btn.is-active {
  border-color: var(--color-lime);
  color: var(--color-lime-light);
}

.onboarding-result-date {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.6rem;
  padding-top: 0.6rem;
  border-top: 1px solid var(--color-border);
}

.onboarding-result-date-label {
  margin: 0;
  flex-basis: 100%;
  font-size: 0.78rem;
  color: var(--color-text-secondary);
}

.onboarding-result-date-input {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 0.45rem 0.6rem;
  color: var(--color-text);
  font-family: inherit;
  font-size: 0.88rem;
  /* Keeps the native picker's own icon legible on the dark surface
     instead of rendering as a near-black glyph on near-black. */
  color-scheme: dark;
}

.onboarding-result-date-display {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--color-lime-light);
  font-variant-numeric: tabular-nums;
}

/* ---------- "Сегодня" card ---------- */
/*
   Sits between the header and the chat log, so it is the first thing read on
   entry and then scrolls out of the way — the chat log keeps its own scroll
   area, and this block never grows into one. Capped in height rather than
   allowed to push the composer off a phone screen: a six-exercise session
   fits, a longer one scrolls inside the card.
*/

/* Only `display` is guarded by :not([hidden]), and it is guarded on purpose:
   an author `display: flex` beats the browser's default [hidden] { display:
   none }, so without this the card painted as an empty box whenever it was
   meant to be hidden — the same trap the auth screen, the modals and
   .button-row are guarded against above. Everything else stays on the bare
   class so the responsive block below can still override it. */
.today-card:not([hidden]) {
  display: flex;
}

.today-card {
  flex: 0 0 auto;
  flex-direction: column;
  margin: 0.9rem 1.25rem 0;
  padding: 0.95rem 1.05rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  /* The lime edge is what makes it read as today's state rather than as one
     more message in the log. */
  border-left: 3px solid var(--color-lime);
  border-radius: 14px;
  /* Capped so a long session never pushes the composer off a phone screen.
     Only the exercise list scrolls (below): the day, the session name and the
     "Начать тренировку" button stay put, because a primary action hidden
     under an inner scrollbar is a primary action nobody presses. */
  max-height: 42vh;
  overflow: hidden;
}

.today-eyebrow {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-lime);
  margin: 0 0 0.2rem;
}

.today-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.3;
  margin: 0;
  color: var(--color-text);
  overflow-wrap: anywhere;
}

.today-subtitle {
  font-size: 0.88rem;
  color: var(--color-text-secondary);
  margin: 0.3rem 0 0;
  overflow-wrap: anywhere;
}

.today-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.55rem;
}

.today-chip {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-lime-light);
  background: var(--color-lime-dim);
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
}

.today-exercise-list {
  margin: 0.75rem 0 0;
  padding-left: 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-height: 0;
  overflow-y: auto;
}

.today-exercise {
  font-size: 0.9rem;
  line-height: 1.35;
  color: var(--color-text);
  overflow-wrap: anywhere;
}

.today-exercise::marker {
  color: var(--color-text-secondary);
  font-variant-numeric: tabular-nums;
}

.today-start-btn {
  flex: 0 0 auto;
  margin-top: 0.9rem;
  width: 100%;
}

/* ---------- Guided Workout ---------- */
/*
   A gym screen: one exercise at a time, big targets, and the action row
   pinned to the bottom where a thumb already is. The list of sets is the only
   thing that scrolls, so "Дальше" never walks off the screen — and because it
   sits inside the flex column rather than being `position: fixed`, the mobile
   keyboard pushes it up instead of covering it.
*/

.guided-screen:not([hidden]) {
  display: flex;
}

.guided-screen {
  flex: 1;
  min-height: 0;
  flex-direction: column;
  max-width: 720px;
  width: 100%;
  margin: 0 auto;
  background: var(--color-bg);
}

.guided-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1.25rem;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
}

.guided-heading {
  min-width: 0;
}

.guided-heading h2 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0;
  overflow-wrap: anywhere;
}

.guided-heading p {
  margin: 0.15rem 0 0;
  font-size: 0.85rem;
  color: var(--color-text-secondary);
}

.guided-progress {
  margin: 0;
  padding: 0.6rem 1.25rem 0;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-lime);
}

.guided-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0.75rem 1.25rem 1rem;
}

.guided-exercise-name {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.25;
  margin: 0 0 0.35rem;
  overflow-wrap: anywhere;
}

.guided-hint {
  margin: 0 0 0.9rem;
  font-size: 0.9rem;
  color: var(--color-text-secondary);
}

/* The weight hint. Deliberately quieter than the exercise name and than the
   set inputs: it is an orientation point, not the thing being recorded. */
.guided-weight-hint {
  margin: 0 0 0.9rem;
  padding: 0.7rem 0.85rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
}

.guided-weight-label {
  margin: 0;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-secondary);
}

.guided-weight-value {
  margin: 0.15rem 0 0;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--color-lime);
  font-variant-numeric: tabular-nums;
}

.guided-weight-why,
.guided-weight-empty {
  margin: 0.35rem 0 0;
  font-size: 0.85rem;
  line-height: 1.4;
  color: var(--color-text-secondary);
}

/* Scoped through the hint so it outranks the plain `.btn-ghost` rules — one
   of which sits later in the responsive block below and would otherwise
   shrink this to a header-sized button. */
.guided-weight-hint .guided-use-weight {
  margin-top: 0.6rem;
  width: 100%;
  padding: 0.6rem 0.9rem;
}

/* The coach. Lime-edged like the "Сегодня" card, because it is the app
   speaking rather than a field to fill in. */
.guided-coach {
  margin: 0.9rem 0;
  padding: 0.75rem 0.85rem;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--color-lime);
  border-radius: 12px;
}

.guided-coach-label {
  margin: 0 0 0.25rem;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-lime);
}

.guided-coach-message {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.guided-coach-next {
  margin: 0.4rem 0 0;
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--color-lime-light);
  overflow-wrap: anywhere;
}

.guided-note {
  margin-bottom: 0.6rem;
}

.guided-note-input {
  margin: 0;
  font-size: 0.9rem;
}

.guided-body .guided-set-done {
  width: 100%;
  margin-bottom: 0.6rem;
  padding: 0.75rem 0.9rem;
}

.guided-body .guided-set-done:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.guided-set-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-bottom: 0.9rem;
}

.guided-set-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 0.6rem 0.7rem;
}

.guided-set-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--color-text-secondary);
  white-space: nowrap;
}

.guided-set-input {
  flex: 1 1 0;
  min-width: 0;
  width: auto;
  margin: 0;
  padding: 0.65rem 0.5rem;
  text-align: center;
  font-family: var(--font-display);
  font-variant-numeric: tabular-nums;
}

.guided-set-times {
  color: var(--color-text-secondary);
  font-weight: 700;
}

.guided-set-remove {
  flex: 0 0 auto;
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  color: var(--color-text-secondary);
  font-size: 1rem;
  line-height: 1;
  padding: 0.55rem 0.7rem;
  cursor: pointer;
}

.guided-set-remove:hover {
  color: var(--color-danger);
  border-color: var(--color-danger-border);
}

.guided-add-set {
  width: 100%;
}

.guided-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  padding: 0.85rem 1.25rem;
  padding-bottom: calc(0.85rem + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--color-border);
  background: var(--color-surface);
}

.guided-actions .btn,
.guided-actions .btn-ghost {
  flex: 1 1 auto;
  padding: 0.85rem 1rem;
  font-size: 1rem;
}

/* Both need the `.guided-actions` prefix: the shared `.guided-actions .btn`
   rule above is more specific than a bare class would be, and would otherwise
   win and put every button on one row. */
.guided-actions .guided-next-btn {
  /* The one action the screen is about, so it takes the room. */
  flex: 2 1 55%;
}

.guided-actions .guided-skip-btn {
  /* Its own row, below the primary action — it is the rarer choice. */
  flex: 1 1 100%;
  font-size: 0.9rem;
}

.guided-summary {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.guided-summary-count {
  margin: 0 0 0.2rem;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
}

.guided-summary-item,
.guided-summary-skipped {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 0.65rem 0.8rem;
}

.guided-summary-skipped {
  margin-top: 0.6rem;
  border-style: dashed;
}

.guided-summary-name {
  margin: 0 0 0.25rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  overflow-wrap: anywhere;
}

/* Today-only changes: secondary to the sets, but still real tap targets. */
.guided-tweaks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.9rem;
}

.guided-tweaks .btn-ghost {
  flex: 1 1 auto;
  padding: 0.7rem 0.9rem;
  font-size: 0.9rem;
}

.guided-panel {
  margin-top: 0.9rem;
  padding: 0.85rem 0.9rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--color-lime);
  border-radius: 12px;
}

.guided-panel-title {
  margin: 0 0 0.7rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.guided-panel-search {
  margin: 0 0 0.7rem;
}

.guided-candidate-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-bottom: 0.7rem;
}

.guided-candidate {
  width: 100%;
  text-align: left;
  padding: 0.75rem 0.85rem;
  overflow-wrap: anywhere;
}

.guided-panel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.guided-panel-actions .btn {
  flex: 1 1 auto;
  padding: 0.75rem 0.9rem;
}

.guided-panel-error {
  margin: 0 0 0.7rem;
}

.guided-panel .btn-secondary {
  width: 100%;
}

.guided-panel-actions .btn-secondary {
  width: auto;
}

.guided-summary-status {
  margin: 0.75rem 0 0;
}

/* A save that is not yet allowed must look it, not just refuse the tap. */
.guided-actions .btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.guided-summary-sets {
  margin: 0;
  font-size: 0.9rem;
  color: var(--color-text-secondary);
  font-variant-numeric: tabular-nums;
}

#guided-error {
  margin: 0 1.25rem;
}

/* ---------- Responsive ---------- */

@media (max-width: 768px) {
  .chat-screen:not([hidden]) {
    max-width: 100%;
  }
}

@media (max-width: 600px) {
  .chat-header,
  .chat-log,
  .composer {
    padding-left: 0.85rem;
    padding-right: 0.85rem;
  }

  .message,
  .interactive-card,
  .plan-card {
    max-width: 92%;
  }

  /* Narrower gutters to match the header and log, and a smaller share of a
     phone screen so the composer and the first messages stay visible. */
  .today-card {
    margin-left: 0.85rem;
    margin-right: 0.85rem;
    max-height: 38vh;
  }

  /* A full-width, thumb-sized target — the primary action on the screen. */
  .today-start-btn {
    padding: 0.8rem 1rem;
    font-size: 1rem;
  }

  .auth-card {
    padding: 1.5rem 1.25rem;
  }

  .onboarding-card {
    padding: 1.5rem 1.25rem;
    max-height: 90vh;
  }

  /* Thumb-friendly on mobile — bigger tap target than the desktop size. */
  .onboarding-choice-btn {
    padding: 1.3rem 1rem;
    font-size: 1.1rem;
  }

  .onboarding-exercise-btn {
    padding: 0.85rem;
  }

  /* A native date picker is only comfortable to open one-handed if the
     control itself is a real touch target, so it goes full-width here. */
  .onboarding-result-date-input {
    flex: 1 1 auto;
    min-width: 0;
    padding: 0.6rem;
    font-size: 0.95rem;
  }

  /* Comfortable thumb target, and long Russian exercise names must wrap
     rather than push the card sideways. */
  .plan-substitute-btn {
    padding: 0.55rem 0.85rem;
    font-size: 0.85rem;
  }

  .plan-exercise-name {
    overflow-wrap: anywhere;
  }

  .anatomy-figure {
    width: 176px;
    height: 368px;
  }

  .anatomy-head-row {
    flex-wrap: wrap;
  }

  .header-actions {
    gap: 0.35rem;
  }

  /* The header's buttons wrap onto three rows on a phone; a smaller mark
     keeps the bar from growing with them. */
  .brand-logo {
    height: 2rem;
  }

  /* Narrower gutters, matching the rest of the app on a phone. */
  .guided-header,
  .guided-progress,
  .guided-body,
  .guided-actions {
    padding-left: 0.85rem;
    padding-right: 0.85rem;
  }

  #guided-error {
    margin-left: 0.85rem;
    margin-right: 0.85rem;
  }

  /* Thumb-sized: this screen is used standing up, mid-set. */
  .guided-set-input {
    padding: 0.75rem 0.4rem;
    font-size: 1rem;
  }

  .guided-exercise-name {
    font-size: 1.35rem;
  }

  /* The phone-sized .btn-ghost above is a header button; this one is tapped
     mid-set with one hand, so it keeps a real target size. */
  .guided-weight-hint .guided-use-weight {
    padding: 0.7rem 0.9rem;
    font-size: 0.9rem;
  }

  .auth-logo {
    height: 6rem;
  }

  .btn-ghost {
    padding: 0.35rem 0.6rem;
    font-size: 0.78rem;
  }
}

/* ---------- Settings toggle & body weight ---------- */

.profile-divider {
  height: 1px;
  background: var(--color-border);
  margin: 1.4rem 0 1.2rem;
}

/* A whole-row label: the entire block is the tap target, not just the
   14 px switch. */
.settings-toggle {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  cursor: pointer;
  padding: 0.6rem 0;
  min-height: 48px;
}

/* Kept in the accessibility tree and keyboard-reachable — hidden only from
   sight, with the track below drawn in its place. */
.settings-toggle-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  margin: 0;
}

.settings-toggle-track {
  flex: 0 0 auto;
  width: 46px;
  height: 28px;
  border-radius: 999px;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  position: relative;
  transition: background 0.15s ease, border-color 0.15s ease;
  margin-top: 0.1rem;
}

.settings-toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--color-text-secondary);
  transition: transform 0.15s ease, background 0.15s ease;
}

.settings-toggle-input:checked + .settings-toggle-track {
  background: var(--color-lime-dim);
  border-color: var(--color-lime);
}

.settings-toggle-input:checked + .settings-toggle-track .settings-toggle-thumb {
  transform: translateX(18px);
  background: var(--color-lime);
}

.settings-toggle-input:focus-visible + .settings-toggle-track {
  outline: 2px solid var(--color-lime);
  outline-offset: 2px;
}

.settings-toggle-input:disabled + .settings-toggle-track {
  opacity: 0.5;
}

.settings-toggle-text {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.settings-toggle-title {
  color: var(--color-text);
  font-size: 0.95rem;
}

.settings-toggle-hint {
  color: var(--color-text-secondary);
  font-size: 0.85rem;
  line-height: 1.35;
}

.body-weight-question {
  margin: 0 0 1.1rem;
  color: var(--color-text);
  font-size: 1rem;
  line-height: 1.4;
}

.body-weight-field {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

/* Big enough to type into with a thumb, and large enough that iOS does not
   zoom the page on focus (which is what any font-size under 16px does). */
.body-weight-input {
  flex: 1 1 auto;
  min-width: 0;
  height: 56px;
  padding: 0 1rem;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-variant-numeric: tabular-nums;
  color: var(--color-text);
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: 12px;
}

.body-weight-input:focus {
  outline: none;
  border-color: var(--color-lime);
}

.body-weight-unit {
  flex: 0 0 auto;
  color: var(--color-text-secondary);
  font-size: 1rem;
}

/* Stacked, full width, in the order the user is most likely to want them.
   Save first: skipping is the quieter action and reads as such. */
.body-weight-actions {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 1.2rem;
}

.body-weight-actions .btn {
  width: 100%;
  min-height: 48px;
}

/* The fact the target is based on, and the target itself when it is measured
   in repetitions rather than kilograms. */
.guided-weight-history {
  margin: 0 0 0.35rem;
  color: var(--color-text-secondary);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}

.guided-weight-reps {
  margin: 0.35rem 0 0;
  color: var(--color-text);
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
}
