/* Shared layout for every screen. No viewport-scaled fonts or tab-specific shell rules. */
:root {
  color-scheme: dark;
  --font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  font-family: var(--font-ui);
  font-size: 16px;
  --accent: #58f9a6;
  --accent-hi: #93ffcb;
  --accent-lo: #42f69a;
  --accent-ink: #002011;
  --plan-accent: var(--accent);
  --muted: #a9bec3;
  --plan-muted: var(--muted);
  --text: #f7faf8;
  --background: #03170e;
  --border: #315d456e;
  --surface: #10271c;
  --danger: #ffb4bd;
  --warning: #f6dba1;
  --glow-1: #0c3520aa;
  --glow-2: #0b291baa;
  --orbit-line: #5be39255;
  --nav-bg: linear-gradient(130deg, #123524f5, #051b12fa);
  --nav-border: #294f3a77;
  --nav-active: linear-gradient(160deg, #99ffcc, #41f899);
  --btn-primary: linear-gradient(160deg, #93ffcb, #42f69a);
  --progress-fill: linear-gradient(90deg, #1cf781, #31ed91);
  --progress-track: #203b2e;
  --dialog-bg: var(--background);
  --ring-track: #1b4934;
  --theme-color: #03170e;
  --icon-surface: linear-gradient(130deg, #224d3899, #102c1f99);
  --time-bg: linear-gradient(140deg, #285941b3, #173c2bad);
  --time-border: #427d5b99;
  --safe-top: max(env(safe-area-inset-top, 0px), var(--tg-safe-area-inset-top, 0px));
  --safe-bottom: max(env(safe-area-inset-bottom, 0px), var(--tg-safe-area-inset-bottom, 0px));
  --safe-left: max(env(safe-area-inset-left, 0px), var(--tg-safe-area-inset-left, 0px));
  --safe-right: max(env(safe-area-inset-right, 0px), var(--tg-safe-area-inset-right, 0px));
  --inset-top: calc(var(--safe-top) + var(--tg-content-safe-area-inset-top, 0px));
  --inset-bottom: calc(var(--safe-bottom) + var(--tg-content-safe-area-inset-bottom, 0px));
  --gutter: 16px;
  --nav-height: 72px;
}
html[data-theme="green"] {
  --accent: #58f9a6;
  --accent-hi: #93ffcb;
  --accent-lo: #42f69a;
  --accent-ink: #002011;
  --text: #f7faf8;
  --muted: #a9bec3;
  --background: #03170e;
  --border: #315d456e;
  --surface: #10271c;
  --glow-1: #0c3520aa;
  --glow-2: #0b291baa;
  --orbit-line: #5be39255;
  --nav-bg: linear-gradient(130deg, #123524f5, #051b12fa);
  --nav-border: #294f3a77;
  --nav-active: linear-gradient(160deg, #99ffcc, #41f899);
  --btn-primary: linear-gradient(160deg, #93ffcb, #42f69a);
  --progress-fill: linear-gradient(90deg, #1cf781, #31ed91);
  --progress-track: #203b2e;
  --dialog-bg: var(--background);
  --ring-track: #1b4934;
  --theme-color: #03170e;
  --icon-surface: linear-gradient(130deg, #224d3899, #102c1f99);
  --time-bg: linear-gradient(140deg, #285941b3, #173c2bad);
  --time-border: #427d5b99;
}
html[data-theme="purple"] {
  --accent: #d8b4fe;
  --accent-hi: #f3e8ff;
  --accent-lo: #a855f7;
  --accent-ink: #1a0828;
  --text: #f7faf8;
  --muted: #c4b5d4;
  --background: #140b20;
  --border: #6b4a8a6e;
  --surface: #1b102a;
  --glow-1: #3b1d66aa;
  --glow-2: #24123faa;
  --orbit-line: #c084fc55;
  --nav-bg: linear-gradient(130deg, #2a1848f5, #12081cfa);
  --nav-border: #5b3d7a77;
  --nav-active: linear-gradient(160deg, #e9d5ff, #a855f7);
  --btn-primary: linear-gradient(160deg, #e9d5ff, #a855f7);
  --progress-fill: linear-gradient(90deg, #c084fc, #a855f7);
  --progress-track: #2a1a40;
  --dialog-bg: var(--background);
  --ring-track: #3d2460;
  --theme-color: #140b20;
  --icon-surface: linear-gradient(130deg, #3b246099, #1a0f2e99);
  --time-bg: linear-gradient(140deg, #4a2d78b3, #241248ad);
  --time-border: #7c5aa699;
}
html[data-theme="red"] {
  --accent: #ff8a8a;
  --accent-hi: #ffc9c9;
  --accent-lo: #f04343;
  --accent-ink: #2a0606;
  --text: #faf5f5;
  --muted: #d4b5b5;
  --background: #1a0808;
  --border: #8a4a4a6e;
  --surface: #2d1414;
  --glow-1: #661d1daa;
  --glow-2: #3f1212aa;
  --orbit-line: #fc848455;
  --nav-bg: linear-gradient(130deg, #481818f5, #1c0808fa);
  --nav-border: #7a3d3d77;
  --nav-active: linear-gradient(160deg, #ffd5d5, #f04343);
  --btn-primary: linear-gradient(160deg, #ffd5d5, #f04343);
  --progress-fill: linear-gradient(90deg, #fc8484, #f04343);
  --progress-track: #401a1a;
  --dialog-bg: var(--background);
  --ring-track: #602424;
  --theme-color: #1a0808;
  --icon-surface: linear-gradient(130deg, #60242499, #2e0f0f99);
  --time-bg: linear-gradient(140deg, #782d2db3, #481212ad);
  --time-border: #a65a5a99;
}
html[data-theme="yellow"] {
  --accent: #f5d76e;
  --accent-hi: #ffe9a8;
  --accent-lo: #e0b12a;
  --accent-ink: #241800;
  --text: #faf8f2;
  --muted: #d4cbb5;
  --background: #141008;
  --border: #8a7a4a6e;
  --surface: #292212;
  --glow-1: #66551daa;
  --glow-2: #3f3012aa;
  --orbit-line: #f5d76e55;
  --nav-bg: linear-gradient(130deg, #483818f5, #1c1408fa);
  --nav-border: #7a6a3d77;
  --nav-active: linear-gradient(160deg, #ffe9a8, #e0b12a);
  --btn-primary: linear-gradient(160deg, #ffe9a8, #e0b12a);
  --progress-fill: linear-gradient(90deg, #f5d76e, #e0b12a);
  --progress-track: #3a3018;
  --dialog-bg: var(--background);
  --ring-track: #5a4820;
  --theme-color: #141008;
  --icon-surface: linear-gradient(130deg, #5a482099, #2e241099);
  --time-bg: linear-gradient(140deg, #78682db3, #483012ad);
  --time-border: #a68a5a99;
}
html[data-theme="light"] {
  color-scheme: light;
  --accent: #1a9f5c;
  --accent-hi: #2fd47a;
  --accent-lo: #128a4c;
  --accent-ink: #ffffff;
  --text: #14201a;
  --muted: #5a6b63;
  --background: #f4f6f8;
  --border: #c5d0c96e;
  --surface: #ffffff;
  --danger: #a8233c;
  --warning: #795009;
  --glow-1: #c8e8d6aa;
  --glow-2: #dce8e2aa;
  --orbit-line: #1a9f5c33;
  --nav-bg: linear-gradient(130deg, #fffffff5, #eef2f0fa);
  --nav-border: #c5d0c977;
  --nav-active: linear-gradient(160deg, #2fd47a, #1a9f5c);
  --btn-primary: linear-gradient(160deg, #2fd47a, #1a9f5c);
  --progress-fill: linear-gradient(90deg, #2fd47a, #1a9f5c);
  --progress-track: #d8e4de;
  --dialog-bg: var(--background);
  --ring-track: #c5d8cc;
  --theme-color: #f4f6f8;
  --icon-surface: linear-gradient(130deg, #e8f5ee, #dceae3);
  --time-bg: linear-gradient(140deg, #dff3e8, #cfe8da);
  --time-border: #8bc4a499;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--background); color: var(--text); }
html.tg-fullscreen,
html.tg-fullscreen body { background: var(--background); }
* {
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--muted) 38%, transparent) transparent;
}
*::-webkit-scrollbar {
  width: 3px;
  height: 3px;
}
*::-webkit-scrollbar-track {
  background: transparent;
}
*::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--muted) 42%, transparent);
  border-radius: 999px;
}
*::-webkit-scrollbar-thumb:hover {
  background: color-mix(in srgb, var(--muted) 58%, transparent);
}
*::-webkit-scrollbar-corner {
  background: transparent;
}
html {
  overflow-y: scroll;
  scrollbar-gutter: stable;
}
body { margin: 0; color: var(--text); background: var(--background); font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
html, body { width: 100%; min-height: 100%; }
html.pet-lock, html.pet-lock body {
  overflow-y: scroll;
  overscroll-behavior-y: none;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { border: 0; padding: 0; background: transparent; cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
button:disabled { opacity: .45; cursor: default; }
button:focus,
button:focus-visible { outline: none; }
input:focus,
input:focus-visible,
textarea:focus,
textarea:focus-visible,
select:focus,
select:focus-visible {
  outline: none;
  box-shadow: none;
}
button:not(:disabled):active { filter: brightness(1.12); }
svg { display: block; width: 24px; height: 24px; flex-shrink: 0; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3, strong { overflow-wrap: anywhere; }
h1, h2 { font-size: 20px; font-weight: 700; line-height: 1.3; letter-spacing: -.3px; }
h3 { font-size: 17px; line-height: 1.35; }

/* A normal document flow lets cards grow without shrinking or clipping their children. */
.diary {
  position: relative; isolation: isolate; width: 100%; max-width: 600px; margin: 0 auto;
  min-height: 100vh; min-height: 100dvh; min-height: var(--tg-viewport-stable-height, 100vh);
  padding: calc(12px + var(--inset-top)) calc(var(--gutter) + var(--safe-right))
    calc(var(--nav-height) + 34px + var(--inset-bottom)) calc(var(--gutter) + var(--safe-left));
  background: var(--background);
}
.orbit { display: none; }
.diary > header {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  margin-bottom: 12px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.diary > header[hidden] { display: none !important; margin: 0 !important; padding: 0 !important; min-height: 0 !important; }
.diary > header h1 { font-size: 20px; text-align: center; min-width: 0; visibility: hidden; }
.diary > header .header-actions { grid-column: 3; justify-self: end; display: flex; align-items: center; gap: 8px; }
.diary.planning > header { display: none !important; margin: 0 !important; min-height: 0 !important; }
.app-plate {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 14px;
  border: 1px solid color-mix(in srgb, var(--border) 88%, transparent);
  border-radius: 22px;
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  box-shadow: 0 10px 24px #00000016;
}
.workouts-page {
  display: grid;
  gap: 12px;
}
.workouts-cta {
  background: transparent;
  box-shadow: none;
}
.workouts-cta .wide { margin: 0; }
.workouts-list-plate > .section-label { margin: 0 0 2px; }
.workouts-list-plate .template-list { gap: 10px; }
.workouts-list-plate .empty {
  display: grid;
  justify-items: center;
  text-align: center;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: 0 12px 25px #00000015;
}
.workouts-list-plate .empty h3 { margin: 0; }
.workouts-list-plate .empty p { max-width: 280px; margin: 8px auto 0; }
.round { display: grid; place-items: center; width: 44px; height: 44px; border: 1px solid var(--border); border-radius: 50%; background: color-mix(in srgb, var(--accent) 8%, var(--background)); }
.round svg { width: 19px; height: 19px; }
.card, .plan-card { min-width: 0; padding: 18px; border: 1px solid var(--border); border-radius: 22px; background: var(--surface); box-shadow: 0 12px 25px #00000015; }
.next { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 6px 10px; }
.next-icon { align-self: center; color: var(--accent); }
.next-icon svg { width: 20px; height: 20px; }
.eyebrow { font-size: 11px; line-height: 1.4; letter-spacing: .8px; color: var(--muted); }
.next .eyebrow { align-self: center; }
.date { grid-column: 2; font-size: 30px; line-height: 1.2; letter-spacing: -.6px; margin-top: 4px; }
.muscles { grid-column: 2; font-size: 15px; overflow-wrap: anywhere; }
.time { grid-column: 2; justify-self: start; display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 9px 15px; margin-top: 4px; border: 1px solid var(--time-border); border-radius: 18px; background: var(--time-bg); font-size: 16px; }
.time svg { width: 20px; height: 20px; color: var(--accent); }
.workout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; margin-top: 14px; }
.workout-head { display: flex; align-items: center; gap: 14px; min-width: 0; }
.workout-head > div:last-child { min-width: 0; }
.weight-icon { display: grid; place-items: center; flex: 0 0 56px; height: 56px; border: 1px solid var(--border); border-radius: 17px; background: var(--icon-surface); color: var(--accent); }
.weight-icon svg { width: 34px; height: 30px; }
.workout-head p { font-size: 14px; color: var(--muted); margin-top: 6px; overflow-wrap: anywhere; }
.start, .plan-btn.primary { color: var(--accent-ink); background: var(--btn-primary); border-color: transparent; box-shadow: none; }
.start { display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; min-width: 0; min-height: 50px; padding: 13px 14px; border-radius: 18px; font-size: 16px; font-weight: 700; line-height: 1.4; }
.start svg { width: 20px; height: 20px; }
.week { display: flex; align-items: center; gap: 16px; margin-top: 14px; }
.ring { flex: 0 0 72px; height: 72px; position: relative; }
.ring > svg { width: 100%; height: 100%; }
.ring b { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 3px; font-size: 18px; letter-spacing: -.6px; }
.ring small { font-size: 13px; }
.week-info { flex: 1; min-width: 0; }
.week-info h2 { font-size: 15px; margin-top: 5px; letter-spacing: 0; }
.fraction { display: block; text-align: right; font-size: 12px; color: var(--muted); margin-top: 6px; }
.progress { height: 7px; margin-top: 6px; overflow: hidden; border-radius: 99px; background: var(--progress-track); }
.progress i { display: block; height: 100%; border-radius: inherit; background: var(--progress-fill); }
.history-heading, .section-label { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 24px 0 12px; }
.section-label > span { flex-shrink: 0; color: var(--muted); font-size: 13px; }
.history-heading button { min-height: 44px; min-width: 44px; color: var(--accent); font-size: 14px; flex-shrink: 0; }
.history-list, .session-list, .template-list, .workout-exercise-list, .workout-picks { display: grid; gap: 12px; }
.history { width: 100%; text-align: left; display: grid; gap: 12px; }
.history-open {
  display: grid;
  gap: 0;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.history-date { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.history-date svg { width: 18px; height: 18px; }
.history h3 { font-size: 18px; margin: 10px 0 14px; }
.history-delete { margin: 0; }
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.stats > div { min-width: 0; padding: 12px; border: 1px solid color-mix(in srgb, var(--accent) 24%, transparent); border-radius: 15px; background: var(--icon-surface); }
.stats b { display: block; font-size: 18px; overflow-wrap: anywhere; }
.stats span { display: block; margin-top: 3px; font-size: 12px; color: var(--muted); }
.empty, .empty-history { text-align: center; padding: 24px 18px; }
.empty-history { display: grid; align-content: center; gap: 8px; min-height: 116px; }
.empty-history h3 { font-size: 17px; margin: 0; }
.empty p, .empty-history p { font-size: 14px; color: var(--muted); line-height: 1.5; }
.empty p { margin-top: 8px; }
.empty-symbol { display: grid; place-items: center; margin: 0 auto 12px; width: 44px; height: 44px; border: 1px solid var(--border); border-radius: 14px; color: var(--accent); font-size: 25px; }

/* One navigation definition, regardless of the selected tab or screen width. */
.diary nav {
  position: fixed;
  z-index: 3;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(10px + var(--inset-bottom));
  width: calc(100% - (2 * var(--gutter)) - var(--safe-left) - var(--safe-right));
  max-width: calc(600px - (2 * var(--gutter)));
  height: var(--nav-height);
  padding: 5px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  border: 1px solid color-mix(in srgb, var(--border) 88%, transparent);
  border-radius: 22px;
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  backdrop-filter: blur(15px);
  box-sizing: border-box;
}
.diary nav button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 0;
  width: 100%;
  height: 100%;
  padding: 5px 2px;
  border: 0;
  border-radius: 16px;
  background: transparent;
  font-size: clamp(9px, 2.55vw, 10.5px);
  font-weight: 550;
  letter-spacing: -.02em;
  line-height: 1.1;
  color: var(--muted);
  overflow: hidden;
  transition: background .22s ease, color .22s ease, box-shadow .22s ease, transform .22s ease;
}
.diary nav button span {
  display: block;
  max-width: 100%;
  padding: 0 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}
.diary nav svg {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  transition: transform .22s ease;
}
.diary nav .active {
  background: var(--nav-active);
  color: var(--accent-ink);
  box-shadow: 0 0 22px color-mix(in srgb, var(--accent) 14%, transparent);
}
.diary nav .active svg { transform: scale(1.04); }
.plan-page { font-size: 15px; }
.plan-page > .wide:first-child { margin-top: 0; }
.plan-page > .section-label:first-child { margin-top: 0; }
.progress-page .section-label,
.pg-label { margin-top: 18px; }
.progress-page > .section-label:first-child { margin-top: 0; }
.progress-page .pg-label {
  display: grid;
  justify-items: start;
  gap: 4px;
  margin-bottom: 10px;
}
.progress-page .pg-label > span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.3;
}
.pg-cal {
  display: grid;
  gap: 14px;
  margin: 0;
}
.pg-cal-stat {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding-top: 14px;
  margin-bottom: -4px;
  border-top: 1px solid color-mix(in srgb, var(--border) 80%, transparent);
}
.pg-cal-stat b {
  color: var(--text);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -.4px;
  line-height: 1;
}
.pg-cal-stat span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
}
.pg-cal-nav {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 36px;
  align-items: center;
  gap: 8px;
}
.pg-cal-nav strong {
  text-align: center;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -.2px;
}
.pg-shift {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin: 0;
  padding: 0;
  border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--accent) 24%, transparent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  color: var(--accent);
  font-size: 22px;
  line-height: 1;
}
.pg-shift:disabled {
  opacity: .28;
}
.pg-week, .pg-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px 0;
}
.pg-week span {
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
}
.pg-day {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  margin: 0 auto;
  border-radius: 50%;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.pg-day.is-empty { visibility: hidden; }
.pg-day.is-on {
  background: color-mix(in srgb, var(--accent) 24%, transparent);
  color: var(--text);
}
.pg-compliance {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 0;
}
.pg-compliance-chart {
  flex: 0 0 84px;
  width: 84px;
  height: 84px;
  position: relative;
}
.pg-compliance-svg {
  width: 100%;
  height: 100%;
  display: block;
}
.pg-compliance-track {
  fill: none;
  stroke: var(--ring-track);
  stroke-width: 9;
}
.pg-compliance-fill {
  fill: none;
  stroke: url(#pg-grad-compliance);
  stroke-width: 9;
  stroke-linecap: round;
  transition: stroke-dasharray .45s ease;
}
.pg-compliance-center {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  pointer-events: none;
}
.pg-compliance-center b {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -.4px;
  line-height: 1;
  color: var(--text);
}
.pg-compliance-body {
  flex: 1;
  min-width: 0;
}
.pg-compliance-body strong {
  display: block;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.25;
  color: var(--text);
}
.pg-compliance-body p {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.35;
}
.pg-stats-card {
  display: grid;
  gap: 12px;
  margin: 0;
}
.pg-periods {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--accent) 6%, var(--background));
}
.pg-period-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 6px 8px;
  margin: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s ease;
}
.pg-period-btn.active {
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 2px 10px color-mix(in srgb, var(--accent) 30%, transparent);
}
.pg-totals {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 0;
}
.pg-totals > div {
  min-width: 0;
  padding: 12px 6px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--accent) 5%, var(--surface));
  text-align: center;
}
.pg-totals b { display: block; font-size: 19px; font-weight: 700; letter-spacing: -.3px; color: #ffffff; }
.pg-totals span { display: block; margin-top: 4px; font-size: 11px; color: var(--muted); }
.pg-records-card {
  display: grid;
  gap: 14px;
}
.pg-muscle-filter {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x;
  scrollbar-width: none;
  padding: 2px 2px 4px;
  margin: -2px -2px 0;
}
.pg-muscle-filter::-webkit-scrollbar {
  display: none;
}
.pg-muscle-btn {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 6px 14px;
  margin: 0;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--accent) 7%, var(--surface));
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color .18s ease, color .18s ease, border-color .18s ease, box-shadow .18s ease;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.pg-muscle-btn:hover {
  color: var(--text);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
}
.pg-muscle-btn.active {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
  font-weight: 700;
  box-shadow: 0 2px 10px color-mix(in srgb, var(--accent) 32%, transparent);
}
.pg-records-empty {
  text-align: center;
  padding: 24px 12px;
  color: var(--muted);
  font-size: 13px;
}
.pg-ex-list { display: grid; gap: 10px; }
.pg-ex {
  display: grid;
  position: relative;
  grid-template-columns: 60px minmax(0, 1fr);
  gap: 8px 12px;
  align-items: center;
  width: 100%;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(177, 146, 204, .18);
  background: rgba(255, 255, 255, .025);
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, transform .15s ease;
}
.pg-ex:active { transform: scale(.985); }
.pg-ex:hover, .pg-ex:focus-visible {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  background: color-mix(in srgb, var(--accent) 8%, var(--background));
  outline: none;
}
.pg-ex-chevron {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--accent);
  font-size: 22px;
  line-height: 1;
  opacity: .55;
}
.pg-photo {
  grid-column: 1;
  grid-row: 1 / span 2;
  width: 60px;
  aspect-ratio: 1;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(177, 146, 204, .14);
  background: rgba(177, 146, 204, .08);
  flex-shrink: 0;
}
.pg-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pg-photo.is-empty { display: block; }
.pg-ex-body { display: grid; grid-column: 2; grid-row: 1 / span 2; gap: 6px; min-width: 0; padding-right: 20px; }
.pg-ex-summary { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; min-width: 0; }
.pg-ex-copy { min-width: 0; }
.pg-ex-copy strong { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; font-size: 14px; font-weight: 700; line-height: 1.3; color: var(--text); }
.pg-ex-meta { display: block; min-width: 0; color: var(--muted); font-size: 12px; line-height: 1.35; overflow-wrap: anywhere; }
.pg-ex-side { display: flex; align-items: center; justify-content: flex-end; gap: 7px; min-width: 0; }
.pg-ex-side b { color: var(--accent); font-size: 14px; font-weight: 700; letter-spacing: -.2px; white-space: nowrap; }
.exercise-history-sheet .plan-muted { margin-top: 0; }
.exercise-history-list { display: grid; gap: 12px; margin-top: 4px; }
.exercise-history-card {
  border: 1px solid color-mix(in srgb, var(--accent) 18%, transparent);
  border-radius: 18px;
  background: color-mix(in srgb, var(--surface) 88%, var(--background));
  padding: 12px 14px 4px;
}
.exercise-history-head {
  display: grid;
  gap: 2px;
  padding-bottom: 8px;
}
.exercise-history-head strong {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
}
.exercise-history-head span {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.35;
}
.exercise-history-set {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 0;
  border-top: 1px solid color-mix(in srgb, var(--border) 75%, transparent);
  font-size: 14px;
}
.exercise-history-set b { font-weight: 600; }
.exercise-history-set span {
  color: var(--accent-hi);
  font-weight: 600;
  white-space: nowrap;
}
.pg-bars {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 20px;
}
.pg-bars i {
  display: block;
  width: 4px;
  border-radius: 99px;
  background: var(--accent);
}
.plan-intro, .plan-muted { font-size: 14px; color: var(--muted); margin: 8px 0 16px; }
.plan-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 11px 16px; border: 1px solid color-mix(in srgb, var(--accent) 18%, transparent); border-radius: 16px; background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); font-size: 15px; font-weight: 600; line-height: 1.4; text-align: center; overflow-wrap: anywhere; }
.wide { width: 100%; margin-top: 18px; }
.template { display: flex; align-items: center; width: 100%; text-align: left; gap: 12px; }
.template > span:first-child, .planned-info { min-width: 0; }
.template p, .planned-info p, .card-link p { font-size: 13px; color: var(--muted); margin-top: 5px; }
.template-icon { flex-shrink: 0; width: 35px; font-size: 24px; color: var(--accent); }
.chevron { flex-shrink: 0; margin-left: auto; font-size: 26px; color: var(--accent); }
.planned-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px 12px; width: 100%; text-align: left; }
.planned-info { display: grid; gap: 6px; min-width: 0; }
.planned-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.planned-date { color: var(--accent); font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }
.planned-card .chevron { grid-column: 2; grid-row: 1 / -1; }
.planned-info h3 { margin: 0; font-size: 17px; line-height: 1.25; }
.planned-info > p { margin: 0; }
.planned-fine {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}
.planned-fine.with-fine { color: var(--accent); }
.planned-card.is-missed {
  border-color: color-mix(in srgb, #ff6b6b 45%, transparent);
  background: linear-gradient(120deg, color-mix(in srgb, #ff4d4d 14%, transparent), color-mix(in srgb, #2a1010 70%, transparent));
}
.planned-missed {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, #ff8e8e 45%, transparent);
  background: color-mix(in srgb, #ff4d4d 18%, transparent);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  line-height: 1.2;
  color: #ffb4b4;
}
.planned-card.is-missed .planned-date { color: #ffd0d0; }
.planned-card.is-missed h3 { color: #fff4f4; }
.schedule-page .week { margin-top: 14px; }
.schedule-nearest {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 10px 14px;
  align-items: center;
}
.schedule-nearest-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 18px;
  border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent);
  background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 22%, transparent), color-mix(in srgb, var(--accent) 6%, transparent));
  color: var(--accent);
}
.schedule-nearest-icon svg { width: 26px; height: 26px; }
.schedule-nearest-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}
.schedule-nearest .eyebrow { margin: 0; }
.schedule-nearest .date {
  grid-column: auto;
  margin: 0;
  font-size: 20px;
  line-height: 1.25;
  letter-spacing: -.3px;
}
.schedule-nearest .muscles {
  grid-column: auto;
  margin: 0;
  font-size: 14px;
  color: var(--muted);
}
.schedule-nearest .home-fine { margin: 2px 0 0; color: var(--accent); font-size: 13px; }
.schedule-nearest .start {
  grid-column: 1 / -1;
  margin-top: 2px;
}
.schedule-nearest.is-empty .date { font-size: 18px; font-weight: 700; }
.schedule-nearest.is-empty .schedule-nearest-icon {
  opacity: .72;
  border-color: color-mix(in srgb, var(--muted) 35%, transparent);
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  color: var(--muted);
}
.schedule-list-head { margin-top: 18px; }
.home-fine {
  margin: 6px 0 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  overflow-wrap: anywhere;
}
.next .home-fine { grid-column: 2; margin-top: 4px; }
.planned-sheet-fine {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
}
.planned-sheet-fine.with-fine { color: var(--accent); }
.planned-sheet-meta {
  display: grid;
  gap: 10px;
  margin: -8px 0 14px;
  min-width: 0;
}
.planned-sheet-meta .planned-missed { justify-self: start; }
.planned-sheet-date {
  margin: 0;
  color: var(--accent);
  font-size: 14px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.planned-sheet-meta.is-missed .planned-sheet-date { color: #ffd0d0; }
.session-date { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.session-date b { color: var(--accent); }
.card-link { display: block; width: 100%; text-align: left; padding: 4px 0; }
.small-actions, .confirm-actions { display: flex; gap: 10px; margin-top: 18px; }
.small-actions > *, .confirm-actions > * { flex: 1; min-width: 0; }
.confirm-sheet .plan-muted { margin-top: -8px; }
.penalty-confirm { display: grid; gap: 8px; margin-top: 4px; }
.penalty-confirm .plan-muted { margin: 0; }
.penalty-confirm .confirm-actions { display: grid; margin-top: 8px; }
.storage-note, .quick-label, #dates-summary { font-size: 12px; color: var(--muted); margin: 18px 0 4px; overflow-wrap: anywhere; }

/* Sheets and workout screens share typography, controls and safe-area handling. */
.sheet-open { overflow: hidden; }
.plan-dialog { position: relative; color: var(--text); font: 15px/1.45 Arial, Helvetica, sans-serif; background: var(--dialog-bg); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); border-radius: 26px 26px 0 0; width: min(100%, 600px); max-width: 100%; max-height: calc(100dvh - 12px - var(--inset-top)); margin: auto auto 0; padding: 16px calc(18px + var(--safe-right)) calc(24px + var(--inset-bottom)) calc(18px + var(--safe-left)); box-shadow: 0 -15px 80px #0009; overflow-y: auto; overscroll-behavior-y: contain; }
.plan-dialog::backdrop { background: #000a; backdrop-filter: blur(5px); }
.sheet-top { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-shrink: 0; min-height: 44px; margin: 0 0 8px; padding: 0; }
.sheet-handle { display: none !important; }
.sheet-top .sheet-close,
.sheet-top [data-close] { position: relative; z-index: 2; margin-left: auto; flex: 0 0 44px; width: 44px; height: 44px; background: color-mix(in srgb, var(--text) 6%, transparent); color: var(--muted); font-size: 25px; line-height: 1; border-radius: 50%; outline: none; box-shadow: none; -webkit-tap-highlight-color: transparent; }
.ios-webkit .sheet-top .sheet-close,
.ios-webkit .sheet-top [data-close] { background: transparent; border-radius: 0; }
.sheet-top .sheet-back { position: relative; z-index: 2; flex: 0 1 auto; display: inline-flex; align-items: center; max-width: calc(100% - 56px); min-height: 44px; height: 44px; padding: 0 10px 0 0; margin: 0; border: 0; background: transparent; color: var(--accent); font-size: 14px; font-weight: 600; line-height: 1.2; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; outline: none; box-shadow: none; -webkit-tap-highlight-color: transparent; }
.sheet-top.has-title { display: grid; grid-template-columns: auto minmax(0, 1fr) 44px; }
.sheet-top.has-title .sheet-back { max-width: none; }
.sheet-top.has-title .sheet-close,
.sheet-top.has-title [data-close] { margin-left: 0; }
.plan-dialog h2.sheet-top-title { margin: 0; padding: 0; font-size: 16px; font-weight: 650; line-height: 1.2; text-align: center; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Pinned substrate under Telegram's native Close/menu chrome — same solid as app bg */
html::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--inset-top);
  background: var(--background);
  z-index: 10000;
  pointer-events: none;
}
.plan-dialog.workout-fullscreen::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: var(--inset-top);
  background: var(--background);
  z-index: 40;
  pointer-events: none;
}
.plan-dialog h2 { font-size: 22px; padding-right: 24px; margin-bottom: 20px; }
.plan-dialog h3 { font-size: 17px; }
.plan-dialog label { display: flex; flex-direction: column; min-width: 0; gap: 7px; font-size: 13px; color: var(--muted); margin: 12px 0; }
.plan-dialog input, .plan-dialog textarea { width: 100%; min-width: 0; min-height: 46px; padding: 12px; font-size: 16px; color: var(--text); background: color-mix(in srgb, var(--background) 72%, transparent); border: 1px solid var(--border); border-radius: 13px; outline: none; box-shadow: none; -webkit-appearance: none; appearance: none; }
.plan-dialog input:focus,
.plan-dialog input:focus-visible,
.plan-dialog textarea:focus,
.plan-dialog textarea:focus-visible {
  outline: none;
  box-shadow: none;
  border-color: var(--border);
}
.plan-dialog textarea { min-height: 110px; resize: vertical; line-height: 1.4; }
.form-error { font-size: 14px; line-height: 1.5; color: var(--danger); margin: 14px 0; overflow-wrap: anywhere; }
.exercise-row { display: grid; grid-template-columns: minmax(0, 1fr) 44px; align-items: end; gap: 0 10px; padding: 8px 0 14px; border-bottom: 1px solid #ffffff0a; }
.exercise-row > label:first-child { grid-column: 1 / -1; }
.exercise-row label { margin-bottom: 0; }
.workout-create {
  display: grid;
  gap: 22px;
  padding-bottom: 4px;
}
.workout-choice-sheet {
  display: grid;
  gap: 0;
  min-width: 0;
}
.workout-choice-lead {
  margin: -6px 0 18px;
  font-size: 15px;
  line-height: 1.4;
  color: var(--muted);
}
.workout-choice-list {
  display: grid;
  gap: 14px;
  padding-bottom: 8px;
}
.workout-choice-card,
.workout-choice-card.is-featured {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 18px 16px 16px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: 0 12px 25px #00000015;
}
.workout-choice-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-bottom: 2px;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--accent) 34%, transparent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  color: var(--accent-hi, var(--accent));
}
.workout-choice-icon-line { display: flex; align-items: center; gap: 8px; min-height: 46px; }
.workout-choice-icon-line .workout-choice-icon { margin: 0; }
.workout-choice-beta { padding: 5px 9px; border: 1px solid var(--border); border-radius: 999px; color: var(--muted); background: color-mix(in srgb, var(--surface) 90%, var(--background)); font-size: 11px; line-height: 1; font-weight: 700; letter-spacing: .3px; }
.workout-choice-icon svg { width: 22px; height: 22px; }
.workout-choice-title {
  font-size: 18px;
  line-height: 1.25;
  font-weight: 700;
  color: var(--text);
}
.workout-choice-text {
  margin: 0;
  font-size: 14px;
  line-height: 1.45;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.workout-choice-cta {
  width: 100%;
  margin-top: 6px;
  min-height: 50px;
  border-radius: 999px;
  font-weight: 700;
}
.workout-choice-cta.is-outline {
  color: var(--text);
  background: transparent;
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
}
.workout-choice-cta.is-outline:active {
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}
.ready-programs-sheet { padding-bottom: calc(16px + var(--inset-bottom)); }
.ready-program-list { display: grid; gap: 12px; padding-bottom: 12px; }
.ready-program-card {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 10px 12px;
  align-items: start;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
}
.ready-program-number {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  color: var(--accent-hi, var(--accent));
  background: color-mix(in srgb, var(--accent) 13%, transparent);
  font-size: 12px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}
.ready-program-copy { min-width: 0; align-self: center; }
.ready-program-copy strong { display: block; font-size: 15px; line-height: 1.3; overflow-wrap: anywhere; }
.ready-program-copy p { margin: 5px 0 0; color: var(--muted); font-size: 12px; line-height: 1.4; overflow-wrap: anywhere; }
.ready-program-card .workout-choice-cta { grid-column: 1 / -1; margin-top: 2px; min-height: 44px; }
@media (max-width: 380px) {
  .ready-program-card { padding: 12px; gap: 9px 10px; }
  .ready-program-copy strong { font-size: 14px; }
}
.ready-program-detail { padding-bottom: 18px; }
.ready-program-detail > .sheet-back { margin-bottom: 10px; }
.ready-program-notes { margin: 0 0 16px; padding: 0 16px; border: 1px solid var(--border); border-radius: 17px; background: color-mix(in srgb, var(--surface) 90%, var(--background)); box-shadow: none; }
.ready-program-notes summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; color: var(--text); font-size: 15px; line-height: 1.3; font-weight: 700; cursor: pointer; list-style: none; }
.ready-program-notes summary::-webkit-details-marker { display: none; }
.ready-program-notes summary::after { content: '⌄'; flex: 0 0 auto; color: var(--accent-hi, var(--accent)); font-size: 19px; transition: transform .18s ease; }
.ready-program-notes[open] summary::after { transform: rotate(180deg); }
.ready-program-notes-content { display: grid; gap: 8px; padding: 0 0 14px; }
.ready-program-notes-content p { margin: 0; padding-top: 9px; border-top: 1px solid color-mix(in srgb, var(--accent) 18%, var(--border)); color: var(--muted); font-size: 12px; line-height: 1.55; overflow-wrap: anywhere; }
.ready-program-days { display: grid; gap: 18px; }
.ready-program-day { display: grid; gap: 10px; }
.ready-program-day-head { display: grid; gap: 4px; }
.ready-program-day-head h3 { margin: 0; font-size: 18px; line-height: 1.3; }
.ready-program-day-head span { color: var(--muted); font-size: 12px; }
.ready-program-exercises { display: grid; gap: 9px; }
.ready-program-exercise {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 17px;
  background: color-mix(in srgb, var(--surface) 90%, var(--background));
}
.ready-program-exercise .assist-preview-photo { width: 76px; height: 76px; margin: 0; border-radius: 13px; }
.ready-program-exercise-copy { display: grid; gap: 5px; min-width: 0; }
.ready-program-exercise-copy strong { font-size: 14px; line-height: 1.3; overflow-wrap: anywhere; }
.ready-program-exercise-copy span { color: var(--muted); font-size: 12px; line-height: 1.35; }
.ready-program-exercise-copy small { color: var(--muted); font-size: 11px; line-height: 1.3; }
@media (max-width: 380px) {
  .ready-program-day-head h3 { font-size: 16px; }
  .ready-program-exercise { grid-template-columns: 64px minmax(0, 1fr); gap: 10px; padding: 9px; }
  .ready-program-exercise .assist-preview-photo { width: 64px; height: 64px; }
  .ready-program-exercise-copy strong { font-size: 13px; }
}
.plan-dialog.workout-fullscreen.assist-open {
  top: var(--assist-top, 0px);
  right: auto;
  bottom: auto;
  left: 50%;
  width: min(100%, 600px);
  height: var(--assist-vh, 100dvh);
  max-height: var(--assist-vh, 100dvh);
  transform: translateX(-50%);
}
.plan-dialog.workout-fullscreen .assist-wizard {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.assist-scroll.workout-sheet-body {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding-bottom: 16px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  min-height: 0;
}
.assist-scroll h2 { margin-bottom: 8px; }
.assist-scroll > label { margin-top: 16px; }
.assist-scroll textarea, .assist-chat-footer textarea {
  box-sizing: border-box; width: 100%; min-height: 88px; max-height: 160px;
  padding: 12px; border: 1px solid var(--border); border-radius: 14px;
  background: var(--background); color: var(--text); font: inherit; font-size: 16px;
  resize: vertical; line-height: 1.4;
}
.assist-scroll select { width: 100%; min-width: 0; min-height: 48px; font-size: 16px; }
.assist-exclusions { display: grid; gap: 8px; margin-block: 12px; }
.assist-exclusions button { text-align: left; white-space: normal; overflow-wrap: anywhere; }
.assist-chat-body { padding-bottom: 16px; }
.assist-chat-messages { display: grid; gap: 12px; }
.assist-chat-message { padding: 12px 14px; border: 1px solid var(--border); border-radius: 18px; overflow-wrap: anywhere; }
.assist-chat-message.from-user { margin-left: 24px; background: color-mix(in srgb, var(--accent) 12%, var(--background)); }
.assist-chat-message.from-assistant { margin-right: 12px; background: var(--background); }
.assist-chat-message small { color: var(--muted); font-size: 12px; }
.assist-chat-message p { white-space: pre-wrap; margin: 6px 0 0; line-height: 1.5; }
.assist-chat-footer { display: grid; gap: 8px; padding-bottom: calc(12px + var(--inset-bottom)); }
.assist-chat-footer label { margin: 0; font-size: 14px; }
.assist-chat-footer textarea { display: block; margin-top: 6px; min-height: 72px; }
.assist-chat-footer button { min-height: 44px; }
.assist-lead { margin: 0 0 16px; }
.assist-group { display: grid; gap: 10px; }
.assist-group + .assist-group { margin-top: 22px; }
.assist-group h3 { margin: 0; font-size: 16px; }
.assist-focus-muscles { margin-top: 12px; }
.assist-options { display: grid; gap: 10px; }
.plan-dialog label.assist-option {
  position: relative;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  margin: 0;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: color-mix(in srgb, var(--background) 55%, transparent);
  color: var(--text);
  font-size: 16px;
  line-height: 1.35;
  cursor: pointer;
}
.plan-dialog label.assist-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  border: 0;
  opacity: 0;
}
.assist-option-check {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1.5px solid color-mix(in srgb, var(--muted) 75%, transparent);
  background: transparent;
}
.assist-option:has(input[type="checkbox"]) .assist-option-check { border-radius: 7px; }
.assist-option:has(input:checked) {
  border-color: var(--accent);
  color: var(--text);
  background: color-mix(in srgb, var(--accent) 16%, var(--background));
  box-shadow: 0 0 0 1px var(--accent);
}
.assist-option:has(input:checked) .assist-option-check {
  border-color: transparent;
  background: var(--accent);
}
.assist-option:has(input:checked) .assist-option-check::after {
  content: "";
  width: 6px;
  height: 10px;
  margin-top: -2px;
  border: solid var(--accent-ink);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.assist-option:has(input:focus-visible) {
  outline: none;
}
.assist-option-label { min-width: 0; }
.assist-week {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.assist-week .assist-option {
  justify-content: center;
  min-height: 52px;
  padding: 10px 8px;
}
.assist-note {
  margin: 14px 0 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--muted);
}
.plan-dialog .assist-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  color: var(--text);
  font-size: 16px;
}
.assist-counter {
  margin: 8px 0 0;
  text-align: right;
  font-size: 12px;
  color: var(--muted);
}
.assist-dock {
  flex-shrink: 0;
  display: grid;
  gap: 12px;
  margin-left: calc(-1 * (18px + var(--safe-left)));
  margin-right: calc(-1 * (18px + var(--safe-right)));
  padding: 12px calc(18px + var(--safe-right)) calc(12px + var(--assist-bottom-inset, var(--inset-bottom))) calc(18px + var(--safe-left));
  background: var(--dialog-bg);
  border-top: 1px solid color-mix(in srgb, var(--border) 85%, transparent);
}
.assist-dock-progress {
  gap: 0;
  padding-top: 10px;
  padding-bottom: calc(10px + var(--assist-bottom-inset, var(--inset-bottom)));
}
.assist-step-actions {
  margin-top: auto;
  padding-top: 20px;
  display: grid;
}
.assist-step-actions .plan-btn {
  width: 100%;
  margin: 0;
}
.assist-scroll > .assist-status,
.assist-scroll > .form-error {
  margin-top: auto;
  margin-bottom: 0;
}
.assist-scroll > .assist-status + .assist-step-actions,
.assist-scroll > .form-error + .assist-step-actions {
  margin-top: 12px;
}
.assist-dock-inline {
  margin: 18px 0 0;
  padding: 18px 0 calc(8px + var(--assist-bottom-inset, var(--inset-bottom)));
  background: transparent;
  border-top: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
}
.assist-progress { display: grid; gap: 8px; }
.assist-progress-label { font-size: 13px; font-weight: 700; color: var(--muted); }
.assist-bar {
  height: 6px;
  border-radius: 999px;
  background: var(--progress-track);
  overflow: hidden;
}
.assist-bar i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: var(--progress-fill);
  transition: width .35s ease;
}
.assist-nav { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 10px; }
.assist-nav .plan-btn { width: 100%; margin: 0; }
.assist-dock .form-error { margin: 0; }
html[data-theme="light"] .assist-dock .form-error { color: #8f1d1d; }
.assist-preview-lead { margin: 0 0 14px; }
.assist-info-card { margin-top: 12px; }
.assist-info-card .eyebrow { margin: 0 0 8px; }
.assist-tips-card .eyebrow:not(:first-child) { margin-top: 14px; }
.assist-preview-copy {
  margin: 0;
  font-size: 15px;
  line-height: 1.45;
  color: var(--text);
}
.assist-schedule-card {
  display: grid;
  gap: 10px;
}
.assist-schedule-strip {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}
.assist-schedule-pill {
  min-height: 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 7px 2px;
  border-radius: 13px;
  transition: all .2s ease;
  user-select: none;
}
.assist-schedule-pill .pill-day {
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
}
.assist-schedule-pill .pill-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  display: block;
}
.assist-schedule-pill.is-workout {
  background: color-mix(in srgb, var(--accent) 14%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
}
.assist-schedule-pill.is-workout .pill-day {
  color: var(--text);
  font-weight: 700;
}
.assist-schedule-pill.is-workout .pill-dot {
  background: var(--accent);
  box-shadow: 0 0 6px var(--accent);
}
.assist-schedule-pill.is-rest {
  background: color-mix(in srgb, var(--surface) 40%, transparent);
  border: 1px solid color-mix(in srgb, var(--border) 40%, transparent);
}
.assist-schedule-pill.is-rest .pill-day {
  color: var(--muted);
  font-weight: 500;
}
.assist-schedule-pill.is-rest .pill-dot {
  background: color-mix(in srgb, var(--muted) 35%, transparent);
}
.assist-schedule-caption {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  text-align: center;
  line-height: 1.4;
  padding: 2px 4px;
}
@media (max-width: 360px) {
  .assist-schedule-strip {
    gap: 4px;
  }
  .assist-schedule-pill {
    min-height: 44px;
    padding: 6px 1px;
    border-radius: 10px;
  }
  .assist-schedule-pill .pill-day {
    font-size: 12px;
  }
}
.assist-workout-card {
  margin-top: 12px;
  display: grid;
  gap: 12px;
}
.assist-add-exercise {
  margin-top: 0;
}
.assist-workout-head { display: grid; gap: 6px; }
.assist-workout-name-label {
  display: grid;
  gap: 7px;
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}
.assist-workout-name-label input,
.plan-dialog .assist-workout-name-label input {
  width: 100%;
  min-height: 46px;
  padding: 12px;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  background: color-mix(in srgb, var(--background) 72%, transparent);
  border: 1px solid var(--border);
  border-radius: 13px;
}
.assist-ex-list { display: grid; gap: 8px; }
.assist-ex-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) 14px;
  gap: 10px;
  align-items: start;
  width: 100%;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 17px;
  background: var(--surface);
  box-shadow: 0 12px 25px #00000015;
  color: inherit;
  text-align: left;
  font: inherit;
  cursor: pointer;
}
.assist-ex-row .assist-preview-photo {
  width: 72px;
  height: 72px;
  aspect-ratio: 1;
  border-radius: 12px;
}
.assist-ex-row .assist-ex-copy {
  align-self: center;
  min-height: 72px;
  display: grid;
  align-content: center;
  gap: 4px;
}
.assist-ex-row .chevron {
  align-self: center;
}
.assist-ex-row.is-static {
  cursor: default;
}
.assist-ex-row:disabled {
  opacity: .72;
  cursor: default;
}
.assist-ex-row .chevron {
  margin-left: 0;
  justify-self: end;
}
.assist-ex-row.completed {
  border-color: color-mix(in srgb, #3dcf7a 60%, transparent);
  background: color-mix(in srgb, #3dcf7a 16%, var(--background));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, #3dcf7a 28%, transparent);
}
.assist-ex-row.completed .assist-ex-meta {
  color: color-mix(in srgb, #8af0b4 75%, var(--muted));
}
html[data-theme="light"] .assist-ex-row.completed {
  border-color: color-mix(in srgb, #1f9a55 45%, transparent);
  background: color-mix(in srgb, #1f9a55 12%, var(--background));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, #1f9a55 22%, transparent);
}
.template-details-body {
  display: grid;
  gap: 14px;
}
.template-details-head {
  display: grid;
  gap: 6px;
  padding: 2px 2px 0;
}
.template-details-body .assist-workout-title {
  margin: 0;
  font-size: 22px;
}
.template-details-body .assist-preview-meta {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
}
.template-details-body .assist-ex-list {
  margin: 0;
  gap: 8px;
}
.template-details-body .assist-ex-row {
  grid-template-columns: 80px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 10px;
  border-radius: 16px;
}
.template-details-body .assist-ex-row .assist-preview-photo {
  width: 80px;
  height: 80px;
  max-width: 80px;
  aspect-ratio: 1 / 1;
  border-radius: 12px;
}
.template-details-body .assist-ex-row .assist-ex-copy {
  min-height: 0;
  height: auto;
  align-self: center;
}
.template-details-body .assist-ex-copy strong {
  font-size: 15px;
  font-weight: 650;
  line-height: 1.25;
}
.template-details-body .assist-ex-meta {
  font-size: 12px;
  line-height: 1.3;
}
.template-details-body .assist-ex-row .chevron {
  display: none;
}
.template-details-body .assist-workout-card {
  margin-top: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}
.template-details-actions {
  display: grid;
  gap: 10px;
  margin-top: 4px;
  padding-bottom: 4px;
}
.template-details-actions .plan-btn {
  margin-top: 0;
}
.template-details-actions .plan-btn.wide + .plan-btn.wide {
  margin-top: 0;
}
.order-list { display: grid; gap: 8px; }
.order-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--accent) 18%, transparent);
  border-radius: 16px;
  background: color-mix(in srgb, var(--surface) 88%, var(--background));
}
.order-index {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  text-align: center;
}
.order-copy { min-width: 0; display: grid; gap: 2px; }
.order-copy strong { font-size: 15px; line-height: 1.3; overflow-wrap: anywhere; }
.order-copy small { font-size: 12px; color: var(--muted); }
.order-moves { display: grid; gap: 6px; }
.order-moves button {
  width: 36px;
  height: 32px;
  border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent);
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent);
  font-size: 16px;
  line-height: 1;
}
.session-details-actions {
  display: grid;
  gap: 10px;
  margin-top: 4px;
  padding-bottom: 4px;
  background: transparent;
  box-shadow: none;
  align-content: start;
}
.session-details-actions .plan-btn {
  margin-top: 0;
  min-height: 48px;
  height: 48px;
  padding: 0 16px;
  box-sizing: border-box;
}
.session-details-actions .plan-btn.wide + .plan-btn.wide {
  margin-top: 0;
}
.session-details-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}
.session-details-row .plan-btn {
  width: 100%;
  margin: 0;
}
.session-details-body {
  display: grid;
  gap: 12px;
  align-content: start;
}
.session-details-body .planned-sheet-meta {
  margin: 0;
}
.session-details-body .planned-sheet-fine {
  margin: 0;
}
.session-details-head {
  display: grid;
  gap: 4px;
  padding: 0;
}
.plan-dialog .session-details-body .assist-workout-title {
  margin: 0;
  padding: 0;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -.3px;
}
.session-details-body .assist-preview-meta {
  margin: 0;
  font-size: 13px;
  line-height: 1.35;
  color: var(--muted);
}
.session-details-body .assist-ex-list {
  margin: 0;
  gap: 8px;
}
.session-details-body .assist-ex-row {
  grid-template-columns: 80px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 10px;
  border-radius: 16px;
}
.session-details-body .assist-ex-row .assist-preview-photo {
  width: 80px;
  height: 80px;
  max-width: 80px;
  aspect-ratio: 1 / 1;
  border-radius: 12px;
}
.session-details-body .assist-ex-row .assist-ex-copy {
  min-height: 0;
  height: auto;
  align-self: center;
}
.session-details-body .assist-ex-copy strong {
  font-size: 15px;
  font-weight: 650;
  line-height: 1.25;
}
.session-details-body .assist-ex-meta {
  font-size: 12px;
  line-height: 1.3;
}
.workout-sheet-body.session-details-body > .sheet-top {
  margin-bottom: 4px;
}
.assist-ex-copy { min-width: 0; display: grid; gap: 4px; }
.assist-ex-copy strong {
  font-size: 15px;
  line-height: 1.3;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}
.assist-ex-meta { display: block; color: var(--muted); font-size: 12px; line-height: 1.35; }
.assist-workout-title {
  margin: 0;
  font-size: 18px;
  line-height: 1.25;
}
.assist-ex-detail {
  display: grid;
  gap: 12px;
  justify-items: start;
}
.assist-ex-detail-photo {
  width: 100px;
  aspect-ratio: 1024 / 853;
  padding: 0;
  border: 0;
  border-radius: 14px;
  overflow: hidden;
  background: color-mix(in srgb, var(--border) 55%, transparent);
}
.assist-ex-detail-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.assist-ex-detail-name {
  font-size: 18px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.assist-ex-edit-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
}
.assist-ex-edit-fields label {
  display: grid;
  gap: 6px;
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}
.assist-ex-edit-fields input,
.plan-dialog .assist-ex-edit-fields input {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  font-size: 16px;
  color: var(--text);
  background: color-mix(in srgb, var(--background) 72%, transparent);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.assist-ex-actions {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}
.assist-ex-actions .wide {
  margin-top: 0;
}
.assist-ex-delete {
  color: #ffb0b0;
  border-color: color-mix(in srgb, #ff7c81 35%, transparent);
  background: #ff7c8110;
}
.assist-preview-meta { margin: 0; color: var(--muted); font-size: 13px; }
.assist-duration-warning { margin: 2px 0 0; color: #ffb0b0; font-size: 12px; font-weight: 650; }
.assist-preview-photo {
  width: 78px;
  aspect-ratio: 1024 / 853;
  padding: 0;
  border: 0;
  border-radius: 12px;
  overflow: hidden;
  background: color-mix(in srgb, var(--border) 55%, transparent);
  flex-shrink: 0;
}
.assist-preview-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.assist-preview-photo-empty { display: block; }
.assist-preview-block {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: color-mix(in srgb, var(--background) 40%, transparent);
}
.assist-preview-block h3 { margin: 0 0 6px; }
.assist-preview-card {
  margin-top: 14px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface);
}
.assist-preview-label {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .6px;
  text-transform: uppercase;
  color: var(--muted);
}
.assist-preview-notes {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: color-mix(in srgb, var(--background) 40%, transparent);
}
.assist-preview-notes h3,
.assist-preview-why h3 { margin: 0 0 6px; font-size: 16px; }
.assist-preview-notes h3 + p,
.assist-preview-notes p { margin: 0 0 10px; }
.assist-preview-notes p:last-child { margin-bottom: 0; }
.assist-preview-exercise {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 8px 0;
  border-top: 1px solid color-mix(in srgb, var(--border) 80%, transparent);
}
.assist-preview-exercise strong { display: block; font-size: 14px; }
.assist-preview-exercise small { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; line-height: 1.35; }
.assist-status { margin: 0; font-size: 14px; font-weight: 700; line-height: 1.35; }
.assist-loading-wizard .assist-loading {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 32px 8px 48px;
  text-align: center;
}
.assist-loading h2 {
  margin: 0;
  padding: 0;
  max-width: 100%;
  font-size: 24px;
  line-height: 1.2;
  text-wrap: balance;
}
.assist-loading-text {
  margin: 0;
  max-width: 36ch;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.45;
  text-wrap: balance;
}
.assist-loading-spinner {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 3px solid color-mix(in srgb, var(--accent) 22%, transparent);
  border-top-color: var(--accent);
  animation: assist-spin 0.9s linear infinite;
}
@keyframes assist-spin {
  to { transform: rotate(360deg); }
}
.assist-nav.assist-nav-stack { grid-template-columns: 1fr; }
.assist-nav .plan-btn { white-space: normal; }
.exercise-advice { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; font-weight: 500; line-height: 1.35; }
.workout-recommendation { margin: 0 0 12px; }
.workout-ex-hero {
  display: grid;
  gap: 12px;
  margin: 0 0 10px;
}
.workout-ex-hero-photo {
  width: 100%;
  aspect-ratio: 1024 / 853;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--accent) 16%, transparent);
  background: color-mix(in srgb, var(--accent) 10%, var(--background));
}
.workout-ex-hero-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}
.workout-ex-hero-photo.is-empty {
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 18%, transparent), transparent 55%),
    color-mix(in srgb, var(--border) 55%, transparent);
}
.workout-ex-hero-copy {
  display: grid;
  gap: 4px;
}
.workout-ex-hero-title,
.plan-dialog .workout-ex-hero-title {
  margin: 0;
  margin-bottom: 0;
  padding-right: 24px;
  font-size: 22px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.workout-ex-hero .exercise-pick-meta {
  margin: 0;
  align-items: flex-start;
  gap: 6px;
}
.workout-ex-hero .exercise-pick-meta-text {
  margin: 0;
}
.workout-step-body {
  display: grid;
  gap: 16px;
  align-content: start;
}
.workout-step-top {
  display: grid;
  gap: 8px;
}
.workout-step-body .workout-ex-hero { margin-bottom: 4px; }
.workout-step-kicker {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}
.workout-step-kicker,
.workout-step-plan {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}
.workout-step-setline {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -.3px;
  line-height: 1.2;
}
.workout-prev-card {
  margin-top: 6px;
  padding: 12px;
  border: 1px solid color-mix(in srgb, var(--accent) 16%, transparent);
  border-radius: 16px;
  background: color-mix(in srgb, var(--accent) 8%, var(--background));
}
.workout-prev-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 10px;
  margin-bottom: 8px;
}
.workout-prev-head strong { font-size: 13px; }
.workout-prev-head span { color: var(--muted); font-size: 12px; }
.workout-prev-sets { display: grid; gap: 6px; }
.workout-prev-set {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 7px 9px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--background) 70%, transparent);
  font-size: 12px;
}
.workout-prev-set.is-current {
  border: 1px solid color-mix(in srgb, var(--accent) 36%, transparent);
  background: color-mix(in srgb, var(--accent) 14%, var(--background));
}
.workout-prev-set span { color: var(--muted); text-align: right; }
.workout-prev-set.is-time { grid-template-columns: 1fr auto; }
.workout-timer-card {
  display: grid;
  grid-template-rows: 1fr auto;
  align-items: stretch;
  justify-items: center;
  gap: 0;
  min-height: 210px;
  margin: 0;
  padding: 18px 16px 16px;
  border-radius: 22px;
  border: 1px solid color-mix(in srgb, var(--accent) 24%, transparent);
  background:
    radial-gradient(120% 90% at 50% 0%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 58%),
    color-mix(in srgb, var(--surface) 90%, var(--background));
  box-shadow: none;
}
.workout-timer-readout {
  margin: 0;
  align-self: center;
  justify-self: center;
  font-size: 48px;
  font-weight: 700;
  letter-spacing: -.04em;
  line-height: .95;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.workout-timer-readout.is-running { color: var(--accent); }
.workout-timer-readout.below-prev,
.workout-timer-readout.below-prev.is-running {
  color: #ff5c6a;
}
.workout-timer-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  width: 100%;
  margin-top: 8px;
}
.workout-timer-actions .plan-btn { margin: 0; }
.workout-step-entry { margin: 0; }
.workout-step-actions {
  display: grid;
  gap: 10px;
  margin: 0;
  width: 100%;
  max-width: 100%;
  align-self: stretch;
  box-sizing: border-box;
}
.workout-step-actions .plan-btn.wide {
  margin: 0;
  width: 100%;
  min-height: 48px;
  box-sizing: border-box;
}
.workout-step-secondary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
  width: 100%;
}
.workout-step-secondary-btn {
  width: 100%;
  min-height: 48px;
  height: 48px;
  margin: 0;
  padding: 0 16px;
  font-size: 15px;
  font-weight: 600;
  box-sizing: border-box;
}
.workout-step-progress {
  display: grid;
  gap: 8px;
  margin-top: 6px;
  padding-top: 12px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  align-self: stretch;
  box-sizing: border-box;
  border-top: 1px solid color-mix(in srgb, var(--border) 80%, transparent);
}
.workout-step-progress-meta {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
}
.workout-step-progress-meta > span {
  min-width: 0;
  flex: 1 1 auto;
  overflow-wrap: anywhere;
}
.workout-step-progress-meta strong {
  flex: 0 0 auto;
  color: var(--text);
  font-size: 13px;
}
.workout-step-progress-track {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-start;
  gap: 3px;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  overflow: hidden;
}
.workout-step-progress-track i {
  flex: 0 1 10px;
  width: 10px;
  min-width: 4px;
  height: 8px;
  aspect-ratio: 1;
  border-radius: 999px;
  background: color-mix(in srgb, var(--border) 90%, transparent);
}
.workout-step-progress-track i.is-done { background: var(--accent); }
.workout-step-progress-track i.is-skip {
  background: color-mix(in srgb, var(--muted) 55%, transparent);
  opacity: .85;
}
.workout-rest-body {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  text-align: center;
  padding-top: 8px;
}
.workout-rest-body .eyebrow { margin: 0; }
.plan-dialog .workout-rest-body h2 {
  margin: 0;
  padding: 0;
  font-size: 28px;
  line-height: 1.15;
  text-align: center;
}
.workout-rest-timer {
  margin: 4px 0 0;
  font-size: 56px;
  font-weight: 700;
  letter-spacing: -.04em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.workout-rest-body .plan-muted { margin: 0 auto; max-width: 28ch; }
.workout-rest-body .plan-btn.wide {
  width: 100%;
  margin: auto 0 0;
}
.workout-rest-body .workout-step-progress {
  width: 100%;
  margin-top: 2px;
  text-align: left;
}
.workout-summary-list {
  display: grid;
  gap: 8px;
  margin: 8px 0 4px;
}
.workout-summary-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 12px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--accent) 14%, transparent);
  background: color-mix(in srgb, var(--accent) 8%, var(--background));
}
.workout-summary-row span { color: var(--muted); font-size: 13px; }
.workout-review-card {
  display: grid;
  gap: 0;
  margin: 0 0 16px;
  padding: 14px 12px 8px;
  border-radius: 18px;
  border: 1px solid color-mix(in srgb, var(--accent) 18%, transparent);
  background: color-mix(in srgb, var(--surface) 88%, var(--background));
  overflow: hidden;
}
.workout-review-card h3 {
  margin: 0 0 12px;
  font-size: 16px;
  line-height: 1.3;
}
.workout-review-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 8px;
  align-items: start;
}
.workout-review-head {
  padding: 0 0 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.workout-review-head span { text-align: left; }
.workout-review-date {
  display: block;
  margin-top: 2px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: var(--muted);
}
.workout-review-line {
  padding: 10px 0;
  border-top: 1px solid color-mix(in srgb, var(--border) 75%, transparent);
  font-size: 13px;
}
.workout-review-line b,
.workout-review-line small { display: block; }
.workout-review-line small { margin-top: 2px; color: var(--muted); font-size: 12px; }
.workout-review-line > span { text-align: left; }
.workout-review-line.is-done b { color: var(--accent); }
.workout-review-line.is-skip b { color: var(--muted); }
.workout-review-undo {
  min-height: 30px;
  margin: 6px 0 0;
  padding: 4px 10px;
  font-size: 12px;
}
.workout-create-field {
  margin: 0 !important;
  gap: 8px !important;
  font-size: 12px !important;
  letter-spacing: .02em;
}
.workout-create-field input {
  margin-top: 0;
}
.workout-create-section {
  margin: 0;
}
.workout-create-section h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
}
.workout-create-empty {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 28px 18px 20px;
  text-align: center;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  box-shadow: none;
}
.workout-create-empty-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin-bottom: 4px;
  border-radius: 16px;
  border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent);
  background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 20%, transparent), color-mix(in srgb, var(--accent) 6%, transparent));
  color: var(--accent);
}
.workout-create-empty-icon svg { width: 26px; height: 26px; }
.workout-create-empty strong {
  font-size: 16px;
  line-height: 1.3;
  font-weight: 700;
}
.workout-create-empty p {
  margin: 0;
  max-width: 260px;
  font-size: 14px;
  line-height: 1.45;
  color: var(--muted);
}
.workout-create-add {
  width: 100%;
  margin-top: 8px;
}
.workout-create-list {
  margin: 0;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 22px;
  overflow: hidden;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
}
.workout-create-ex {
  position: relative;
  padding-right: 44px;
}
.workout-create-ex-remove {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: color-mix(in srgb, var(--text) 8%, transparent);
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.assist-add-exercise,
.workout-create-add,
.exercise-pick-add-stub {
  color: var(--accent-ink);
  background: var(--btn-primary);
  border-color: transparent;
  box-shadow: none;
  font-weight: 700;
}
.workout-create-save {
  margin-top: 2px;
}
.workout-create-save:disabled,
.workout-create-save[aria-disabled="true"] {
  opacity: .42;
  cursor: not-allowed;
  box-shadow: none;
  filter: grayscale(.15);
}
.add-exercise-lead {
  margin: -10px 0 18px;
  font-size: 14px;
  line-height: 1.4;
  color: var(--muted);
}
.exercise-pick-add-stub {
  width: 100%;
  margin: -6px 0 14px;
}
.custom-exercise-body .add-exercise-lead {
  margin-top: 0;
}
.custom-ex-photo-preview {
  display: grid;
  place-items: center;
  justify-items: center;
  align-content: center;
  gap: 10px;
  width: 100%;
  height: 100%;
  min-height: 180px;
  border: 0;
  padding: 0;
  margin: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
}
.custom-ex-photo-preview svg {
  width: 64px;
  height: 64px;
  opacity: .85;
}
.custom-ex-photo-hint {
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
}
.custom-exercise-card .exercise-pick-hero {
  display: grid;
  place-items: center;
  min-height: 200px;
  aspect-ratio: auto;
}
.custom-exercise-card .exercise-pick-equipment-input,
.plan-dialog .custom-exercise-card .exercise-pick-equipment-input {
  font-size: 16px;
  line-height: 1.35;
  color: var(--muted);
}
.add-exercise-sheet {
  display: grid;
  gap: 18px;
  padding-bottom: 6px;
}
.add-exercise-section { margin: 0; }
.add-exercise-section h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
}
.muscle-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.muscle-card {
  display: grid;
  grid-template-rows: 1fr auto;
  min-width: 0;
  min-height: 148px;
  padding: 0;
  overflow: hidden;
  text-align: left;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: none;
  color: var(--text);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.muscle-card:active {
  transform: scale(.985);
  border-color: color-mix(in srgb, var(--accent) 28%, transparent);
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
}
.muscle-card-media {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 4 / 3;
  min-height: 0;
  overflow: hidden;
  background: #0c0616;
}
.muscle-card-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}
.muscle-card-placeholder {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  min-height: 96px;
  color: color-mix(in srgb, var(--muted) 78%, var(--accent));
  background:
    linear-gradient(160deg, color-mix(in srgb, var(--accent) 10%, transparent), transparent 70%),
    color-mix(in srgb, var(--background) 55%, transparent);
}
.muscle-card-placeholder svg { width: 28px; height: 28px; opacity: .7; }
.muscle-card-name {
  display: block;
  padding: 12px 12px 14px;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.add-exercise-custom {
  margin-top: 4px;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  border-color: color-mix(in srgb, var(--accent) 18%, transparent);
}
.add-exercise-custom:disabled,
.add-exercise-custom[aria-disabled="true"] {
  opacity: .55;
  cursor: not-allowed;
}
.exercise-pick-body {
  display: grid;
  align-content: start;
  gap: 14px;
  padding-bottom: calc(18px + var(--inset-bottom));
}
.exercise-pick-search {
  position: relative;
  display: block;
  margin: 0 !important;
}
.exercise-pick-search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  color: var(--muted);
  pointer-events: none;
}
.exercise-pick-search-icon svg { width: 18px; height: 18px; }
.exercise-pick-search input {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px 12px 44px;
  font-size: 16px;
  color: var(--text);
  background: color-mix(in srgb, var(--background) 72%, transparent);
  border: 1px solid var(--border);
  border-radius: 16px;
}
.exercise-pick-list {
  display: grid;
  gap: 12px;
}
.exercise-pick-block {
  display: grid;
  gap: 12px;
}
.exercise-pick-block-label {
  margin: 4px 0 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .4px;
  text-transform: uppercase;
  color: var(--muted);
}
.exercise-pick-card.is-custom {
  border-color: color-mix(in srgb, var(--accent) 42%, transparent);
}
.exercise-pick-delete {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 3;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, #ff7c81 40%, transparent);
  border-radius: 50%;
  background: color-mix(in srgb, #1a0c18 82%, transparent);
  color: #ffb0b0;
  padding: 0;
  cursor: pointer;
}
.exercise-pick-delete svg {
  width: 18px;
  height: 18px;
}
.exercise-pick-delete:active {
  transform: scale(.96);
}
.exercise-pick-empty {
  display: grid;
  gap: 8px;
  padding: 28px 18px;
  text-align: center;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
}
.exercise-pick-empty strong { font-size: 16px; }
.exercise-pick-empty p {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
}
.exercise-pick-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: none;
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.exercise-pick-card.is-selected {
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
  box-shadow:

    0 0 0 1px color-mix(in srgb, var(--accent) 28%, transparent),
    0 0 24px color-mix(in srgb, var(--accent) 16%, transparent);
}
.exercise-pick-head {
  display: grid;
  gap: 4px;
  min-width: 0;
}
.exercise-pick-name {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.exercise-pick-equipment {
  font-size: 13px;
  color: var(--muted);
}
.exercise-pick-photos {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.exercise-pick-photo-img,
.exercise-pick-photo-placeholder {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 1.2;
  min-height: 72px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--border) 80%, transparent);
  background: color-mix(in srgb, var(--background) 60%, transparent);
}
.exercise-pick-photo-img {
  object-fit: cover;
}
.exercise-pick-photo-open {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}
.exercise-pick-photo-open .exercise-pick-photo-img {
  display: block;
}
.exercise-photo-viewer {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: grid;
  grid-template-rows: auto 1fr auto;
  background: #05030acc;
  backdrop-filter: blur(10px);
}
.exercise-photo-viewer-close {
  position: absolute;
  top: calc(10px + var(--inset-top, 0px));
  right: calc(12px + var(--safe-right, 0px));
  z-index: 2;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  color: #fff;
  font-size: 28px;
  line-height: 1;
  background: color-mix(in srgb, #000 45%, transparent);
}
.exercise-photo-viewer-nav {
  position: absolute;
  top: 50%;
  z-index: 2;
  width: 44px;
  height: 44px;
  margin-top: -22px;
  border: 0;
  border-radius: 50%;
  color: #fff;
  font-size: 28px;
  line-height: 1;
  background: color-mix(in srgb, #000 45%, transparent);
}
.exercise-photo-viewer-nav.is-prev { left: calc(8px + var(--safe-left, 0px)); }
.exercise-photo-viewer-nav.is-next { right: calc(8px + var(--safe-right, 0px)); }
.exercise-photo-viewer-track {
  grid-row: 1 / -1;
  display: flex;
  height: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x;
}
.exercise-photo-viewer-slide {
  flex: 0 0 100%;
  min-width: 100%;
  width: 100%;
  height: 100%;
  scroll-snap-align: center;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  padding: 64px 18px 72px;
  box-sizing: border-box;
}
.exercise-photo-viewer-slide img {
  max-width: 100%;
  max-height: calc(100dvh - 160px);
  object-fit: contain;
  border-radius: 16px;
}
.exercise-photo-viewer-caption {
  color: #fff;
  font-size: 14px;
  font-weight: 600;
}
.exercise-photo-viewer-dots {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(18px + var(--inset-bottom, 0px));
  z-index: 2;
  display: flex;
  justify-content: center;
  gap: 8px;
}
.exercise-photo-viewer-dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: color-mix(in srgb, #fff 35%, transparent);
}
.exercise-photo-viewer-dot[aria-current="true"] {
  background: #fff;
}
.exercise-pick-photo-placeholder {
  color: color-mix(in srgb, var(--muted) 78%, var(--accent));
  background:
    linear-gradient(160deg, color-mix(in srgb, var(--accent) 10%, transparent), transparent 70%),
    color-mix(in srgb, var(--background) 60%, transparent);
}
.exercise-pick-photo-placeholder svg { width: 24px; height: 24px; opacity: .7; }
.exercise-pick-card.is-hero {
  gap: 0;
  padding: 0;
  overflow: hidden;
}
.exercise-pick-hero {
  position: relative;
  width: 100%;
  aspect-ratio: 1024 / 853;
  overflow: hidden;
  background: #0c0616;
}
.exercise-pick-hero-img,
.exercise-pick-hero-placeholder {
  display: block;
  width: 100%;
  height: 100%;
}
.exercise-pick-hero-img {
  object-fit: cover;
  object-position: center;
}
.exercise-pick-hero-placeholder {
  display: grid;
  place-items: center;
  color: color-mix(in srgb, var(--muted) 78%, var(--accent));
  background:
    linear-gradient(160deg, color-mix(in srgb, var(--accent) 10%, transparent), transparent 70%),
    color-mix(in srgb, var(--background) 60%, transparent);
}
.exercise-pick-hero-placeholder svg { width: 36px; height: 36px; opacity: .7; }
.exercise-pick-info {
  display: grid;
  gap: 12px;
  padding: 14px;
  justify-items: stretch;
}
.exercise-pick-controls.is-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  min-width: 0;
}
.exercise-pick-controls.is-inline .exercise-pick-check {
  justify-self: auto;
  min-height: 40px;
  margin: 0;
  padding: 0;
}
.exercise-pick-controls.is-inline .exercise-pick-sets {
  margin-left: auto;
}
.exercise-pick-primary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  width: 100%;
  min-width: 0;
}
.exercise-pick-primary .exercise-pick-sets {
  margin-left: auto;
}
.assist-ex-pick-card {
  flex: 0 0 auto;
  align-self: stretch;
  margin: 0 0 16px;
  width: 100%;
  overflow: visible;
}
.assist-ex-pick-card.exercise-pick-card.is-hero {
  overflow: hidden;
  display: grid;
  grid-template-rows: auto auto;
}
.assist-ex-pick-card .exercise-pick-hero {
  flex: 0 0 auto;
  position: relative;
  z-index: 0;
}
.assist-ex-pick-card .exercise-pick-info {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 12px;
  padding: 14px;
  background: var(--surface);
}
.exercise-pick-field {
  display: block;
  margin: 0 !important;
  width: 100%;
  min-width: 0;
  gap: 0 !important;
  color: inherit;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.exercise-pick-name-input,
.plan-dialog .exercise-pick-name-input {
  width: 100%;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
  outline: none;
  box-shadow: none;
}
.exercise-pick-equipment-input,
.plan-dialog .exercise-pick-equipment-input {
  width: 100%;
  min-height: 0;
  margin: 2px 0 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.35;
  outline: none;
  box-shadow: none;
}
.exercise-pick-name-input:focus,
.exercise-pick-equipment-input:focus {
  color: var(--text);
}
.assist-ex-pick-card .exercise-pick-primary.is-sets-only {
  justify-content: flex-end;
}
.exercise-pick-primary.is-sets-only {
  justify-content: flex-end;
}
.exercise-pick-primary.is-sets-only .exercise-pick-sets {
  margin-left: 0;
}
.exercise-pick-hero-open {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.exercise-pick-hero-open .exercise-pick-hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.exercise-pick-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.exercise-pick-meta-text {
  font-size: 13px;
  line-height: 1.35;
  color: var(--muted);
  font-weight: 600;
}
.exercise-pick-hint {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 0;
  background: transparent;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
  flex: 0 0 auto;
  opacity: .92;
}
.exercise-pick-hint svg {
  width: 18px;
  height: 18px;
  display: block;
}
.exercise-pick-hint[aria-expanded="true"] {
  opacity: 1;
  color: var(--accent);
  filter: brightness(1.08);
}
.exercise-pick-hint-tip {
  flex: 1 0 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  font-weight: 500;
}
.exercise-pick-hint-tip[hidden] {
  display: none !important;
}
@media (max-width: 380px) {
  .exercise-pick-controls.is-inline .exercise-pick-sets,
  .exercise-pick-primary .exercise-pick-sets {
    width: 100%;
    margin-left: 0;
  }
}
.exercise-pick-controls {
  display: grid;
  gap: 10px;
}
.exercise-pick-check {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  justify-self: start;
  min-height: 44px;
  padding: 0;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  background: transparent;
  border: 0;
}
.exercise-pick-box {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  border: 1.5px solid color-mix(in srgb, var(--accent) 35%, transparent);
  background: color-mix(in srgb, var(--background) 55%, transparent);
  position: relative;
  flex: 0 0 auto;
}
.exercise-pick-card.is-selected .exercise-pick-box {
  border-color: var(--accent);
  background: var(--accent);
}
.exercise-pick-card.is-selected .exercise-pick-box::after {
  content: '';
  position: absolute;
  left: 6px;
  top: 2px;
  width: 6px;
  height: 11px;
  border: solid var(--accent-ink);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.exercise-pick-sets {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.exercise-pick-sets-label {
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
}
.exercise-pick-stepper {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--accent) 18%, transparent);
  background: color-mix(in srgb, var(--background) 55%, transparent);
}
.exercise-pick-step {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  border: 0;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent);
  font-size: 20px;
  font-weight: 600;
  line-height: 1;
}
.exercise-pick-sets-value {
  min-width: 28px;
  text-align: center;
  font-size: 16px;
  font-weight: 700;
}
.exercise-pick-footer .exercise-pick-submit:disabled,
.exercise-pick-footer .exercise-pick-submit[aria-disabled="true"] {
  opacity: .42;
  cursor: not-allowed;
  box-shadow: none;
  filter: grayscale(.12);
}
.exercise-pick-body .add-exercise-custom {
  margin-top: 4px;
  margin-bottom: 8px;
}
.remove-exercise, .remove-result-set { width: 44px; height: 46px; border-radius: 12px; background: #ff7c8110; color: #ffb0b0; font-size: 24px; }
.exercise-details { margin: 20px 0; padding-left: 24px; }
.exercise-details li { padding: 14px 0; border-bottom: 1px solid color-mix(in srgb, var(--accent) 14%, transparent); }
.exercise-details li span { display: block; overflow-wrap: anywhere; padding-bottom: 6px; }
.exercise-details li b { font-size: 13px; color: var(--accent); }
.sheet-actions { display: grid; gap: 10px; }
.danger { color: #ffd0d0; background: #7d2638; border-color: #ed647355; }
.planner-block { margin-bottom: 24px; }
.planner-block > h3 { margin-bottom: 12px; }
#planner-calendar { padding: 10px; }
.change-date-body .planner-block { margin-bottom: 16px; }
#edit-session-calendar { padding: 10px; }
.change-date-actions {
  display: grid;
  gap: 10px;
  margin-top: 8px;
  padding-bottom: 4px;
  background: transparent;
  box-shadow: none;
}
.change-date-actions .plan-btn {
  margin-top: 0;
}
.change-date-actions .plan-btn.wide + .plan-btn.wide,
.change-date-actions .plan-btn + .plan-btn {
  margin-top: 0;
}
.calendar-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 14px; }
.calendar-title h3 { text-align: center; font-size: 16px; font-weight: 600; text-transform: capitalize; }
.calendar-title button { flex-shrink: 0; width: 44px; height: 44px; border: 1px solid color-mix(in srgb, var(--accent) 12%, transparent); border-radius: 14px; background: color-mix(in srgb, var(--accent) 5%, transparent); color: var(--accent); font-size: 26px; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; text-align: center; }
.weekday { font-size: 12px; color: var(--muted); padding: 4px 0 8px; }
.day { position: relative; min-width: 0; height: 44px; font-size: 14px; border: 1px solid transparent; border-radius: 13px; }
.day.today { border-color: color-mix(in srgb, var(--accent) 47%, transparent); }
.day.marked::after { content: ''; position: absolute; bottom: 4px; left: calc(50% - 2px); width: 4px; height: 4px; border-radius: 50%; background: var(--accent); }
.day.selected { background: var(--accent); color: var(--accent-ink); font-weight: 700; }
.day.selected::after { background: var(--accent-ink); }
.day:disabled { opacity: .25; }
.workout-picks button { width: 100%; padding: 12px 14px; min-height: 58px; border: 1px solid color-mix(in srgb, var(--accent) 18%, transparent); border-radius: 16px; background: color-mix(in srgb, var(--accent) 12%, var(--background)); color: var(--text); text-align: left; }
.change-template-body .workout-picks button {
  border-color: var(--border);
  background: var(--surface);
  box-shadow: none;
}
.change-template-body .workout-picks [aria-pressed=true] {
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 1px var(--accent);
}
.change-template-body .sheet-actions [data-do="back-session"] {
  border-color: var(--border);
  background: var(--surface);
  color: var(--text);
}
.workout-picks strong, .workout-picks span { display: block; }
.workout-picks span { font-size: 13px; color: var(--muted); margin-top: 4px; }
.workout-picks [aria-pressed=true] { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 22%, var(--background)); box-shadow: 0 0 0 1px var(--accent); }
.penalty-picks { display: grid; gap: 8px; }
.penalty-picks button {
  width: 100%;
  min-height: 52px;
  padding: 12px 14px;
  text-align: left;
  border-radius: 16px;
  border: 1px solid color-mix(in srgb, var(--accent) 18%, transparent);
  background: color-mix(in srgb, var(--accent) 8%, var(--background));
  color: var(--text);
}
.penalty-picks button strong,
.penalty-picks button span { display: block; }
.penalty-picks button span { margin-top: 4px; font-size: 13px; color: var(--muted); }
.penalty-picks button[aria-pressed=true] {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 18%, var(--background));
  box-shadow: 0 0 0 1px var(--accent);
}
#planner-form .penalty-picks button,
#planner-form .workout-picks button,
#planner-form #planner-calendar {
  border-color: var(--border);
  background: var(--surface);
  box-shadow: 0 12px 25px #00000015;
}
#planner-form .penalty-picks button[aria-pressed=true],
#planner-form .workout-picks [aria-pressed=true] {
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 1px var(--accent);
}
.fine-amount-block {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}
.fine-amount-block[hidden] { display: none !important; }
.fine-amount-block label {
  margin: 0;
}
.fine-amount-block .chip-row { margin: 0; }
.fine-amount-panel .plan-btn { margin-top: 0; }
.fine-amount-title {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.fine-amount-title > strong { min-width: 0; }
.fine-amount-panel .exercise-pick-hint-tip {
  font-size: 14px;
  line-height: 1.45;
}
.fine-amount-current {
  margin: 0;
  color: var(--text);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -.4px;
}
.fine-explain-panel { gap: 10px; }
.fine-explain-copy {
  display: grid;
  gap: 10px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
}
.fine-explain-copy p { margin: 0; }
.fine-explain-more { display: grid; gap: 10px; }
.fine-explain-more[hidden] { display: none; }
.fine-explain-more-btn {
  justify-self: start; margin: 0; padding: 0; border: 0; background: none;
  color: var(--accent); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
}
.weekday-picks button { border-radius: 12px; border: 1px solid color-mix(in srgb, var(--accent) 27%, transparent); min-height: 44px; padding: 7px 11px; color: var(--muted); background: color-mix(in srgb, var(--accent) 10%, var(--background)); }
.weekday-picks [aria-pressed=true] { color: var(--accent-ink); background: var(--accent); }
#dates-summary { max-height: 90px; overflow: auto; }
.plan-dialog.workout-fullscreen { position: fixed; inset: 0; margin: 0; width: 100%; max-width: none; height: auto; max-height: none; border-radius: 0; border: 0; padding-top: calc(12px + var(--inset-top)); padding-bottom: 0; display: flex; flex-direction: column; overflow: hidden; overflow-anchor: none; background: var(--background); }
.plan-dialog.workout-fullscreen:has(.support-chat) .sheet-top { margin-bottom: 0; }
body.sheet-open .diary nav { visibility: hidden; }
.workout-sheet-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
  padding-bottom: calc(18px + var(--inset-bottom));
  scroll-padding-block: 16px;
  touch-action: pan-y;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.workout-sheet-body::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}
.workout-sheet-footer { flex-shrink: 0; padding: 12px 0 calc(18px + var(--inset-bottom)); background: var(--background); }
.workout-sheet-footer .wide { margin-top: 0; }
.fine-amount-footer {
  background: transparent;
  padding-top: 8px;
}
.workout-sheet-body.support-chat {
  display: flex;
  flex-direction: column;
  height: auto;
  overflow: hidden;
  gap: 8px;
  padding-bottom: 8px;
}
.support-footer .form-error:empty { display: none; margin: 0; }
.support-log {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-anchor: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 4px 2px 8px;
}
.support-empty { margin: auto 0; text-align: center; }
.support-bubble {
  align-self: flex-start;
  max-width: 82%;
  display: grid;
  gap: 6px;
  padding: 10px 12px;
  border-radius: 16px 16px 16px 6px;
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
  color: var(--text);
}
.support-bubble.mine {
  align-self: flex-end;
  border-radius: 16px 16px 6px 16px;
  background: var(--btn-primary);
  color: var(--accent-ink);
}
.support-bubble p { margin: 0; font-size: 15px; line-height: 1.4; overflow-wrap: anywhere; }
.support-meta { display: flex; justify-content: flex-end; align-items: center; gap: 4px; }
.support-bubble time { font-size: 11px; opacity: .72; }
.support-ticks { display: inline-flex; opacity: .72; }
.support-ticks.read { opacity: 1; }
.support-ticks svg { width: 16px; height: 11px; }
.support-bubble-photo {
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  border-radius: 12px;
  background: color-mix(in srgb, var(--background) 40%, transparent);
}
.support-composer {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  margin-top: auto;
}
.support-composer.is-attach { margin-top: 4px; }
.support-clip, .support-send {
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  color: var(--accent);
}
.support-clip svg { width: 20px; height: 20px; }
.support-send {
  background: var(--btn-primary);
  color: var(--accent-ink);
  border-color: transparent;
  font-size: 18px;
}
.plan-dialog .support-input {
  margin: 0;
  min-height: 42px;
  max-height: 120px;
  resize: none;
  overflow-y: hidden;
  line-height: 1.35;
  padding-top: 10px;
  padding-bottom: 10px;
  border-radius: 18px;
  field-sizing: content;
  outline: none;
  box-shadow: none;
  -webkit-tap-highlight-color: transparent;
}
.plan-dialog .support-input:focus,
.plan-dialog .support-input:focus-visible {
  outline: none;
  box-shadow: none;
  border-color: color-mix(in srgb, var(--text) 18%, var(--border));
}
.plan-dialog.workout-fullscreen .support-chat { flex: 1; min-height: 0; }
.support-attach {
  display: flex;
  align-items: center;
  gap: 10px;
}
.support-attach img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 12px;
}
.support-attach button {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 0;
  background: color-mix(in srgb, var(--text) 12%, transparent);
  color: var(--text);
}
.support-attach-label { color: var(--muted); font-size: 14px; }
.workout-exercise { display: grid; grid-template-columns: 38px minmax(0, 1fr) 14px; align-items: center; gap: 10px; width: 100%; min-height: 68px; padding: 12px; border: 1px solid color-mix(in srgb, var(--accent) 18%, transparent); border-radius: 17px; background: color-mix(in srgb, var(--accent) 12%, var(--background)); color: var(--text); text-align: left; }
.exercise-order { display: grid; place-items: center; width: 38px; height: 38px; flex-shrink: 0; border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent); border-radius: 12px; color: var(--accent); font-weight: 700; }
.exercise-copy { min-width: 0; }
.exercise-copy strong, .exercise-copy small { display: block; overflow-wrap: anywhere; }
.exercise-copy small { font-size: 12px; color: var(--muted); margin-top: 4px; }
.workout-exercise.completed { border-color: color-mix(in srgb, var(--accent) 45%, transparent); background: color-mix(in srgb, var(--accent) 20%, var(--background)); }
.workout-exercise.completed .exercise-order { color: var(--accent-ink); background: var(--accent); }
.workout-status { font-size: 13px; color: var(--muted); margin-top: 16px; }
.sheet-back { min-height: 44px; padding: 10px 0; margin-bottom: 12px; color: var(--accent); font-size: 14px; text-align: left; }
.previous-result, .completed-exercise { padding: 14px; border: 1px solid color-mix(in srgb, var(--accent) 18%, transparent); border-radius: 17px; background: color-mix(in srgb, var(--accent) 10%, var(--background)); }
.previous-result { margin-bottom: 22px; }
.previous-result h3 { font-size: 16px; }
.previous-result p { margin-top: 7px; color: var(--muted); font-size: 13px; }
.previous-result-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 10px; }
.previous-result-head span { color: var(--muted); font-size: 12px; }
.previous-sets { display: grid; gap: 7px; margin-top: 12px; }
.previous-sets > div { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 8px 10px; border-radius: 11px; background: color-mix(in srgb, var(--background) 70%, transparent); font-size: 12px; overflow-wrap: anywhere; }
.previous-sets span { color: var(--muted); text-align: right; }
#result-sets { display: grid; gap: 18px; }
.result-set-wrap { display: grid; gap: 6px; }
.result-set {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: color-mix(in srgb, var(--surface) 88%, var(--background));
  box-shadow: none;
}
.set-number {
  margin: 0;
  padding: 0 4px;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -.3px;
  color: var(--text);
}
.set-hint {
  margin: 0 0 4px;
  padding: 0 4px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--muted);
}
.set-save-btn { margin: 0; }
.result-set-wheels.is-locked,
.wheel.is-locked {
  pointer-events: none;
  touch-action: none;
}
.result-set-wheels.is-locked .wheel {
  overflow: hidden;
  overscroll-behavior: none;
}
.result-set-wrap.is-saved .result-set {
  border-color: color-mix(in srgb, var(--accent) 28%, var(--border));
}
.exercise-result-form {
  position: relative;
  display: grid;
  gap: 0;
}
.set-saved-modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #00000088;
  backdrop-filter: blur(4px);
}
.set-saved-modal[hidden] { display: none !important; }
.set-saved-card {
  width: min(100%, 340px);
  display: grid;
  gap: 12px;
  padding: 22px 18px 16px;
  border-radius: 22px;
  border: 1px solid var(--border);
  background: var(--dialog-bg);
  box-shadow: 0 18px 40px #00000055;
  text-align: center;
}
.set-saved-card h3 {
  margin: 0;
  font-size: 20px;
  line-height: 1.25;
}
.set-saved-card p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}
.result-set-wheels {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.result-set label { margin: 0; font-size: 12px; }
.result-set input { padding: 10px; }
.wheel-field {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  padding: 12px;
  border: 1px solid color-mix(in srgb, var(--border) 80%, transparent);
  border-radius: 18px;
  background: color-mix(in srgb, var(--background) 42%, transparent);
}
.wheel-label {
  display: block;
  min-height: 20px;
  padding: 0 2px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  text-align: center;
  overflow-wrap: normal;
  color: var(--muted);
}
.wheel-label svg { width: 16px; height: 16px; color: var(--accent); }
.wheel-frame {
  position: relative;
  box-sizing: content-box;
  height: 144px;
  border: 1px solid color-mix(in srgb, var(--accent) 18%, transparent);
  border-radius: 16px;
  background: color-mix(in srgb, var(--background) 78%, transparent);
  overflow: hidden;
  mask-image: linear-gradient(180deg, transparent 0%, #000 18%, #000 82%, transparent 100%);
}
.wheel {
  position: relative;
  z-index: 1;
  height: 144px;
  border: 0;
  border-radius: 0;
  background: transparent;
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-snap-type: none;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.wheel::-webkit-scrollbar { display: none; }
.wheel-highlight {
  position: absolute;
  left: 4px;
  right: 4px;
  top: 48px;
  z-index: 0;
  height: 48px;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--accent) 32%, transparent);
  background: color-mix(in srgb, var(--accent) 16%, var(--surface));
  box-shadow: none;
  pointer-events: none;
}
.wheel-list { position: relative; z-index: 1; padding: 48px 0; }
.wheel-item {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  scroll-snap-align: center;
  color: color-mix(in srgb, var(--muted) 78%, transparent);
  font-size: 16px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.wheel-item::before,
.wheel-item::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 6px;
  height: 2px;
  margin-top: -1px;
  border-radius: 2px;
  background: color-mix(in srgb, var(--muted) 45%, transparent);
}
.wheel-item::before { left: 6px; }
.wheel-item::after { right: 6px; }
.wheel-item[aria-selected=true] { color: var(--text); font-size: 28px; font-weight: 700; }
.wheel-item[aria-selected=true]::before,
.wheel-item[aria-selected=true]::after {
  width: 8px;
  background: var(--accent);
}
.wheel-item.below-prev { color: #ff8d95; }
.wheel-item.below-prev[aria-selected=true] { color: #ffd0d4; }
#exercise-result-form [data-do="add-result-set"] { margin-top: 14px; }
.completed-details { display: grid; gap: 14px; margin-top: 8px; }
.completed-exercise-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.completed-exercise-head > div { min-width: 0; }
.completed-exercise-head strong, .completed-exercise-head small { display: block; }
.completed-exercise-head small { color: var(--muted); font-size: 12px; margin-top: 3px; }
.toast { position: fixed; z-index: 100; left: 50%; bottom: calc(90px + var(--inset-bottom)); max-width: calc(100% - 32px); width: max-content; transform: translate(-50%, 10px); padding: 12px 18px; border-radius: 18px; color: var(--accent-ink); background: var(--accent-hi); font-size: 14px; opacity: 0; transition: opacity .2s, transform .2s; pointer-events: none; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.sheet-open .toast { display: none; }
.profile-stack { display: grid; gap: 12px; }
.profile-link, .profile-row {
  display: flex; align-items: center; gap: 14px; width: 100%;
  min-height: 64px; padding: 14px 16px; text-align: left;
  border: 1px solid var(--border); border-radius: 22px;
  background: var(--surface); color: var(--text);
  box-shadow: 0 10px 22px #00000012;
  transition: border-color .2s, box-shadow .2s, transform .15s;
}
.profile-link:active, .profile-row:active { transform: scale(.985); }
.profile-link.account { min-height: 76px; }
.profile-avatar {
  display: grid; place-items: center; flex: 0 0 56px; width: 56px; height: 56px;
  overflow: hidden; border-radius: 18px; border: 1px solid var(--border);
  background: var(--icon-surface); color: var(--accent); font-size: 22px; font-weight: 700;
}
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.profile-link .profile-copy, .profile-row .profile-copy { min-width: 0; flex: 1; }
.profile-link strong, .profile-row strong, .profile-stat strong { display: block; font-size: 16px; }
.profile-link small, .profile-row small, .profile-stat small { display: block; margin-top: 4px; color: var(--muted); font-size: 13px; }
.profile-stat {
  position: relative; display: grid; gap: 8px; width: 100%; padding: 18px 44px 18px 18px; text-align: left;
  border: 1px solid var(--border); border-radius: 22px; background: var(--surface);
  color: var(--text); box-shadow: none;
  transition: border-color .2s, box-shadow .2s;
}
.profile-stat .chevron { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); margin-left: 0; }
.profile-stat.control { gap: 10px; padding: 20px; border-color: color-mix(in srgb, var(--accent) 35%, var(--border)); box-shadow: 0 0 28px color-mix(in srgb, var(--accent) 10%, transparent); }
.profile-stat.control .plan-btn { margin-top: 6px; }
.profile-stat .stat-line { color: var(--muted); font-size: 14px; }
.profile-stat .stat-line b { color: var(--accent); font-weight: 700; }
.profile-stat .stat-line .price-was,
.sub-connect-amount .price-was {
  color: var(--muted);
  text-decoration: line-through;
  opacity: 0.72;
  font-weight: 500;
  margin: 0 2px;
  white-space: nowrap;
}
.sub-connect-amount .price-now { color: var(--accent); }
.sub-connect-amount .price-period {
  color: var(--text);
  font-weight: 650;
  font-size: 0.72em;
  margin-left: 4px;
  white-space: nowrap;
}
.profile-stat-title {
  display: inline-flex !important;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 16px;
}
.profile-stat-title .status-pill {
  flex: 0 0 auto;
  font-weight: 600;
}
.profile-badges { display: flex; gap: 8px; }
.status-pill.active-sub { color: var(--accent-ink); background: var(--accent); border-color: transparent; }
.profile-desc { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.45; }
.profile-panel {
  display: grid; gap: 10px; padding: 18px; border: 1px solid var(--border); border-radius: 22px;
  background: var(--surface); box-shadow: none;
}
.profile-panel > strong { font-size: 16px; }
.workout-control-card {
  gap: 10px;
  padding: 20px;
}
.workout-control-card .plan-btn { margin-top: 6px; width: 100%; }
.workout-control-sheet { gap: 12px; }
.workout-control-sheet > .plan-muted { margin-top: -8px; }
.profile-panel label { display: flex; flex-direction: column; gap: 7px; margin: 0; font-size: 13px; color: var(--muted); }
.profile-panel input {
  width: 100%; min-height: 46px; padding: 12px; font-size: 16px; color: var(--text);
  background: color-mix(in srgb, var(--background) 72%, transparent); border: 1px solid var(--border); border-radius: 13px;
}
.profile-panel .form-error { margin: 0; }
.profile-panel .wide { margin-top: 4px; }
.visit-verify-sheet {
  display: grid;
  gap: 12px;
  align-content: start;
  justify-items: stretch;
}
.visit-verify-sheet .plan-btn.wide { margin-top: 4px; }
.visit-verify-sheet .plan-btn.visit-start-btn {
  width: auto;
  min-width: 0;
  max-width: 100%;
  justify-self: start;
  margin-top: 8px;
  padding: 11px 20px;
}
.visit-photo-preview {
  display: grid; place-items: center; min-height: 200px; padding: 16px;
  border-radius: 18px; border: 1px dashed color-mix(in srgb, var(--accent) 35%, var(--border));
  background: color-mix(in srgb, var(--background) 70%, transparent);
  color: var(--muted); font-size: 13px; text-align: center; overflow: hidden;
}
.visit-photo-preview.has-photo { padding: 0; border-style: solid; }
.visit-photo-preview img { width: 100%; max-height: 320px; object-fit: cover; display: block; }
.visit-spinner {
  width: 34px; height: 34px; margin: 8px auto 0; border-radius: 50%;
  border: 3px solid color-mix(in srgb, var(--accent) 25%, transparent);
  border-top-color: var(--accent); animation: visit-spin .8s linear infinite;
}
@keyframes visit-spin { to { transform: rotate(360deg); } }
.notify-list { margin: 0; padding-left: 18px; color: var(--muted); font-size: 13px; line-height: 1.5; display: grid; gap: 4px; }
.notify-example {
  margin: 4px 0 0; padding: 12px 14px; border-radius: 16px;
  border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  color: var(--text); font-size: 13px; line-height: 1.45;
}
.profile-links { display: grid; gap: 8px; margin-top: 4px; }
.profile-links .profile-row { min-height: 52px; border-radius: 18px; padding: 12px 14px; }
.theme-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.theme-option {
  display: flex; flex-direction: column; align-items: stretch; gap: 0;
  min-height: 108px; padding: 0; overflow: hidden; text-align: left;
  border: 1px solid var(--border); border-radius: 18px; background: var(--icon-surface); color: var(--text);
  transition: border-color .2s, box-shadow .2s;
}
.theme-option[aria-pressed=true] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 0 20px color-mix(in srgb, var(--accent) 18%, transparent); }
.theme-option .theme-preview { height: 36px; border-bottom: 1px solid color-mix(in srgb, var(--border) 80%, transparent); }
.theme-option .theme-meta { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px 14px; }
.theme-option strong { font-size: 15px; }
.theme-option span { font-size: 12px; color: var(--muted); }
.theme-option[data-theme-pick="green"] .theme-preview { background: linear-gradient(160deg, #93ffcb, #03190f); }
.theme-option[data-theme-pick="purple"] .theme-preview { background: linear-gradient(160deg, #e9d5ff, #140b20); }
.theme-option[data-theme-pick="red"] .theme-preview { background: linear-gradient(160deg, #ffd5d5, #1a0808); }
.theme-option[data-theme-pick="yellow"] .theme-preview { background: linear-gradient(160deg, #ffe9a8, #141008); }
.theme-option[data-theme-pick="light"] .theme-preview { background: linear-gradient(160deg, #2fd47a, #f4f6f8); }
.theme-swatch { width: 36px; height: 36px; border-radius: 12px; border: 1px solid color-mix(in srgb, var(--text) 12%, transparent); }
.theme-swatch.green { background: linear-gradient(160deg, #93ffcb, #42f69a); }
.theme-swatch.purple { background: linear-gradient(160deg, #e9d5ff, #a855f7); }
.theme-swatch.red { background: linear-gradient(160deg, #ffd5d5, #f04343); }
.theme-swatch.yellow { background: linear-gradient(160deg, #ffe9a8, #e0b12a); }
.theme-swatch.light { background: linear-gradient(160deg, #e8f5ee, #2fd47a); }
.tariff-picks { display: grid; gap: 10px; margin-bottom: 16px; }
.tariff-option {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 72px;
  padding: 14px 16px; text-align: left; border: 1px solid var(--border); border-radius: 18px;
  background: var(--icon-surface); color: var(--text); transition: border-color .2s, box-shadow .2s;
}
.tariff-option[aria-pressed=true] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.tariff-option strong, .tariff-option small { display: block; }
.tariff-option small { margin-top: 4px; color: var(--muted); font-size: 13px; }
.tariff-option .check { margin-left: auto; color: var(--accent); font-size: 18px; opacity: 0; }
.tariff-option[aria-pressed=true] .check { opacity: 1; }
.fine-card {
  display: grid; gap: 6px; padding: 14px 16px; border: 1px solid var(--border);
  border-radius: 18px; background: var(--icon-surface);
}
.fine-card .fine-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.fine-card strong { font-size: 15px; }
.fine-card .fine-amount { color: var(--accent); font-weight: 700; font-size: 16px; }
.fine-card small { color: var(--muted); font-size: 12px; }
.status-pill {
  display: inline-flex; align-items: center; min-height: 26px; padding: 2px 10px;
  border-radius: 999px; font-size: 12px; font-weight: 600;
  border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent);
  background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent);
}
.status-pill.charged { color: #ffb0b0; border-color: #ed647355; background: #ff7c8114; }
.status-pill.disputed, .status-pill.review { color: #ffd0a0; border-color: #e0b12a55; background: #f5d76e18; }
.status-pill.refunded { color: var(--accent); }
.status-pill.cancelled { color: var(--muted); border-color: color-mix(in srgb, var(--muted) 35%, transparent); background: color-mix(in srgb, var(--muted) 12%, transparent); }
.profile-panel label.is-disabled { opacity: .45; }
.profile-panel .plan-btn:disabled { opacity: .45; pointer-events: none; }
.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin: 0;
}
.panel-head-copy {
  min-width: 0;
  flex: 1;
  display: grid;
  gap: 6px;
}
.panel-head-copy strong {
  display: block;
  font-size: 16px;
  line-height: 1.3;
  padding-right: 4px;
}
.panel-head .toggle {
  margin-top: 1px;
}
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 32px;
  margin: 0;
}
.toggle-row > span,
.toggle-row > strong {
  min-width: 0;
  flex: 1;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
}
.toggle {
  position: relative; width: 52px; height: 32px; flex-shrink: 0; border-radius: 999px;
  border: 1px solid var(--border); background: color-mix(in srgb, var(--muted) 22%, transparent);
  transition: background .2s, border-color .2s;
}
.toggle[aria-pressed=true] { background: color-mix(in srgb, var(--accent) 35%, transparent); border-color: var(--accent); }
.toggle::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px;
  border-radius: 50%; background: var(--text); transition: transform .2s, background .2s;
}
.toggle[aria-pressed=true]::after { transform: translateX(20px); background: var(--accent); }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 12px; }
.chip-row button {
  min-height: 40px; padding: 8px 14px; border-radius: 14px; font-size: 14px; font-weight: 600;
  border: 1px solid var(--border); background: var(--icon-surface); color: var(--text);
  transition: border-color .2s, background .2s;
}
.chip-row button[aria-pressed=true] { border-color: var(--accent); color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.reason-picks { display: grid; gap: 8px; margin: 12px 0 16px; }
.reason-picks button {
  min-height: 48px; padding: 12px 14px; text-align: left; border-radius: 14px;
  border: 1px solid var(--border); background: var(--icon-surface); color: var(--text);
}
.reason-picks button[aria-pressed=true] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.faq-list { display: grid; gap: 10px; margin-top: 4px; }
.faq-sheet { padding-bottom: 8px; }
.faq-item {
  border: 1px solid var(--border); border-radius: 16px; background: var(--icon-surface);
  overflow: hidden; transition: border-color .2s, box-shadow .2s;
}
.faq-item[open] { border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 18%, transparent); }
.faq-item summary {
  list-style: none; cursor: pointer; min-height: 56px; padding: 16px 48px 16px 16px;
  font-size: 15px; font-weight: 600; line-height: 1.4; position: relative;
  color: var(--text); word-break: break-word;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: '›'; position: absolute; right: 16px; top: 50%; transform: translateY(-50%) rotate(90deg);
  color: var(--accent); font-size: 22px; transition: transform .2s;
}
.faq-item[open] summary::after { transform: translateY(-50%) rotate(-90deg); }
.faq-item p,
.faq-answer {
  margin: 0; padding: 0 16px 16px; color: var(--muted); font-size: 14px; line-height: 1.55;
  word-break: break-word; overflow-wrap: anywhere;
}
.faq-answer .linkish {
  display: inline; padding: 0; border: 0; background: none; color: var(--accent);
  font: inherit; text-decoration: underline; cursor: pointer;
}
.faq-actions {
  display: grid; gap: 10px; margin-top: 18px; padding-top: 4px;
}
.faq-actions .plan-btn {
  min-height: 48px; font-size: 15px; margin-top: 0;
}
@media (max-width: 350px) {
  .diary nav button { font-size: 9px; letter-spacing: -.03em; padding: 5px 1px; gap: 4px; }
  .diary nav svg { width: 18px; height: 18px; }
  :root { --gutter: 12px; }
  .card, .plan-card { padding: 16px; }
  .workout-head { gap: 10px; }
  .weight-icon { flex-basis: 48px; height: 48px; }
}
@media (min-width: 700px) { .plan-dialog:not(.workout-fullscreen) { margin: auto; border-radius: 26px; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* Pet home: one floor baseline for the mascot, contact shadow and platform. */
.profile-entry,
.notify-entry { position: relative; }
.profile-entry.active,
.notify-entry.active { border-color: var(--accent); background: var(--icon-surface); color: var(--accent-hi); }
.profile-dot { display: none !important; }
.notify-entry.has-unread::after {
  content: "";
  position: absolute; top: 8px; right: 8px;
  width: 8px; height: 8px; border-radius: 50%;
  background: #ff5a7a;
  box-shadow: 0 0 0 2px var(--background);
}
.app-notes { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.app-notes li {
  padding: 14px 16px; border-radius: 16px;
  border: 1px solid var(--border); background: var(--surface);
}
.app-notes li.unread { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.app-notes .app-note-body {
  margin: 0; color: var(--muted); font-size: 14px; line-height: 1.45;
  overflow-wrap: anywhere;
}
.app-notes .app-note-h {
  display: block; margin: 0 0 8px;
  color: var(--text); font-size: 20px; font-weight: 700; line-height: 1.25;
}
.app-notes .app-note-support {
  display: flex; width: 100%; margin-top: 12px;
}
.app-notes time { display: block; margin-top: 8px; color: var(--muted); font-size: 12px; text-align: right; }
.diary.pet-mode {
  display: flex; flex-direction: column;
  height: var(--tg-viewport-stable-height, 100dvh);
  min-height: 0; max-height: none; overflow: auto;
  padding: calc(12px + var(--inset-top)) calc(var(--gutter) + var(--safe-right))
    calc(var(--nav-height) + 24px + var(--inset-bottom)) calc(var(--gutter) + var(--safe-left));
  color: var(--text);
  background: var(--background);
}
.diary.pet-mode > header { flex: 0 0 auto; margin-bottom: 12px; }
.diary.pet-mode > header h1 { visibility: hidden; color: var(--text); font-size: 16px; font-weight: 600; letter-spacing: .2px; }
.pet-home { display: flex; flex-direction: column; flex: 1 0 auto; min-height: 370px; position: relative; }
.pet-intro { flex: 0 0 auto; text-align: center; }
.pet-eyebrow { font-size: 10px; font-weight: 700; line-height: 1.5; letter-spacing: 1.8px; color: var(--muted); }
.pet-intro h2 { margin-top: 6px; font-size: 28px; line-height: 1.15; letter-spacing: -.8px; color: var(--text); }
.pet-intro > p:last-child { margin-top: 8px; font-size: 12px; color: var(--muted); }
.pet-stage {
  --floor-y: 28px;
  position: relative; isolation: isolate; flex: 1 1 auto; min-height: 190px;
  margin: 8px calc(-1 * var(--gutter)) 0; overflow: hidden;
}
.pet-halo {
  position: absolute; height: 72%; max-height: 300px; max-width: 82%; aspect-ratio: 1;
  top: 48%; left: 50%; transform: translate(-50%, -50%); border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--accent) 14%, transparent);
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 18%, transparent), color-mix(in srgb, var(--accent) 6%, transparent) 62%, transparent 72%);
  box-shadow: 0 0 75px color-mix(in srgb, var(--accent) 12%, transparent), inset 0 0 50px color-mix(in srgb, var(--accent) 6%, transparent);
}
.pet-halo::after { content: ''; position: absolute; inset: 14px; border: 1px solid color-mix(in srgb, var(--accent) 8%, transparent); border-radius: inherit; }
.pet-stage-label { position: absolute; top: 18%; left: 0; right: 0; text-align: center; font-size: clamp(40px, 13vw, 72px); font-weight: 800; letter-spacing: 5px; color: #ddc3ff06; }
.pet-floor { display: none !important; }
/* Keep podium geometry for level 6–8 seating math, but never show the plate. */
.pet-podium {
  position: absolute; bottom: calc(var(--floor-y) - 16px); left: 50%; transform: translateX(-50%);
  width: 58%; max-width: 260px; height: 36px; border-radius: 50%;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  opacity: 0 !important;
  pointer-events: none !important;
}
.pet-contact-shadow {
  position: absolute; z-index: 1; bottom: calc(var(--floor-y) - 2px); left: 50%; transform: translateX(-50%);
  width: 34%; max-width: 150px; height: 10px; border-radius: 50%;
  background: radial-gradient(ellipse, #07020ee6 0%, #120722a6 48%, transparent 76%);
  filter: blur(3px);
}
.pet-photo {
  position: absolute; z-index: 2; bottom: calc(var(--floor-y) - 25px); left: 50%; transform: translateX(-50%);
  display: block; height: calc(100% - 36px); width: 78%; max-width: 340px;
  object-fit: contain; object-position: center bottom; pointer-events: none;
  filter: drop-shadow(0 8px 18px #00000055);
}
.pet-level-arrow {
  position: absolute; z-index: 4; top: 53%; display: grid; place-items: center;
  width: 36px; height: 36px; padding: 0; border: 1px solid var(--border);
  border-radius: 50%; background: color-mix(in srgb, var(--surface) 80%, var(--background)); color: var(--accent);
  box-shadow: 0 4px 14px #00000030; backdrop-filter: blur(8px);
}
.pet-level-arrow[hidden] { display: none !important; }
.pet-level-arrow svg { width: 19px; height: 19px; }
.pet-level-arrow-prev { left: 12px; }
.pet-level-arrow-next { right: 12px; }
.pet-level-arrow:disabled { opacity: .22; }
.pet-panel {
  position: relative; flex: 0 0 auto; width: 100%; box-sizing: border-box;
  margin: 8px 0 0; padding: 14px;
  border: 1px solid color-mix(in srgb, var(--border) 88%, transparent); border-radius: 22px;
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  box-shadow: 0 10px 24px #00000016;
}
.pet-panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pet-panel .pet-eyebrow { font-size: 9px; letter-spacing: 1.5px; color: var(--muted); }
.pet-title { margin-top: 4px; font-size: 18px; font-weight: 700; line-height: 1.3; letter-spacing: -.4px; color: var(--text); display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 8px; }
.pet-level-main { color: var(--text); font-size: inherit; font-weight: 700; white-space: nowrap; }
.pet-level-name, .pet-title [data-pet-level-name] {
  color: var(--muted); font-size: 14px; font-weight: 500; line-height: 1.3; white-space: nowrap;
}
.pet-level-label { color: var(--muted); font-size: 14px; font-weight: 500; white-space: nowrap; }
.pet-level-icon { display: grid; place-items: center; width: 38px; height: 38px; flex: 0 0 38px; border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent); border-radius: 13px; color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.pet-level-icon svg { width: 21px; height: 21px; }
.pet-xp-row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-top: 17px; font-size: 11px; color: var(--muted); }
.pet-xp-row b { font-size: 12px; color: var(--text); white-space: nowrap; }
.pet-xp-total { color: var(--muted); font-weight: 400; }
.pet-progress { height: 9px; margin-top: 8px; overflow: hidden; border-radius: 99px; background: var(--progress-track); box-shadow: inset 0 1px 2px #00000050; }
.pet-progress i { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--progress-fill); box-shadow: 0 0 12px color-mix(in srgb, var(--accent) 30%, transparent); transition: width .45s ease; }
.pet-hint { margin-top: 10px; font-size: 10px; line-height: 1.5; color: var(--muted); }
@media (max-height: 700px) {
  .diary.pet-mode > header { margin-bottom: 5px; }
  .pet-intro h2 { font-size: 24px; }
  .pet-intro > p:last-child { margin-top: 4px; }
  .pet-panel { padding: 13px 15px 11px; }
  .pet-xp-row { margin-top: 12px; }
  .pet-hint { margin-top: 8px; }
}
@media (max-width: 350px) {
  .pet-title { font-size: 16px; }
  .pet-level-label, .pet-level-name, .pet-title [data-pet-level-name] { font-size: 12px; }
  .pet-panel { padding-left: 14px; padding-right: 14px; }
  .pet-intro > p:last-child { font-size: 11px; }
}
@media (max-height: 620px) {
  .pet-intro > .pet-eyebrow { display: none; }
  .pet-intro h2 { margin-top: 0; font-size: 22px; }
  .pet-panel .pet-eyebrow { display: none; }
  .pet-title { margin-top: 0; }
  .pet-level-icon { width: 30px; height: 30px; flex-basis: 30px; border-radius: 10px; }
}
/* Telegram on iOS reports a compact viewport after its native header is reserved.
   Keep the mascot prominent without moving the floor or the progress card. */
@media (max-height: 700px) {
  .ios-webkit .diary.pet-mode > header h1 { visibility: hidden; }
  .ios-webkit .pet-intro { display: none; }
  .ios-webkit .pet-photo { height: calc(100% - 28px); bottom: calc(var(--floor-y) - 22px); width: 74%; max-width: 320px; }
  .ios-webkit .pet-halo { height: 68%; max-height: 280px; max-width: 78%; top: 48%; }
  .ios-webkit .pet-podium { width: 52%; max-width: 240px; height: 34px; bottom: calc(var(--floor-y) - 14px); }
  .ios-webkit .pet-contact-shadow { width: 32%; max-width: 145px; height: 10px; bottom: calc(var(--floor-y) - 2px); }
  .ios-webkit .pet-panel { margin-top: 4px; padding: 10px 14px 8px; border-radius: 19px; }
  .ios-webkit .pet-panel .pet-eyebrow { display: none; }
  .ios-webkit .pet-title { margin-top: 0; font-size: 16px; }
  .ios-webkit .pet-level-label,
  .ios-webkit .pet-level-name,
  .ios-webkit .pet-title [data-pet-level-name] { font-size: 12px; }
  .ios-webkit .pet-level-icon { width: 30px; height: 30px; flex-basis: 30px; border-radius: 10px; }
  .ios-webkit .pet-xp-row { margin-top: 8px; font-size: 10px; }
  .ios-webkit .pet-xp-row b { font-size: 11px; }
  .ios-webkit .pet-progress { height: 7px; margin-top: 6px; }
  .ios-webkit .pet-hint { margin-top: 6px; font-size: 9px; }
}
/* Android mirrors the iPhone pet screen: same geometry and spacing,
   applied without the iOS-only max-height media query. Android has no home
   indicator inset, so the gap above the tab bar is added here instead. */
html:not(.ios-webkit) .diary.pet-mode {
  padding-bottom: calc(var(--nav-height) + 34px + var(--inset-bottom));
}
html:not(.ios-webkit) .pet-home[class*="pet-level-"] .pet-panel { margin-bottom: 13px; }
html:not(.ios-webkit) .pet-home[class*="pet-level-"] .pet-photo { margin-bottom: 16px; }
html:not(.ios-webkit) .diary.pet-mode > header { margin-bottom: 6px; }
html:not(.ios-webkit) .diary.pet-mode > header h1 { visibility: hidden; }
html:not(.ios-webkit) .pet-intro { display: none !important; }
html:not(.ios-webkit) .pet-halo {
  height: 68%;
  max-height: 280px;
  max-width: 78%;
  top: 48%;
}
html:not(.ios-webkit) .pet-podium {
  width: 52%;
  max-width: 240px;
  height: 34px;
  bottom: calc(var(--floor-y) - 14px);
}
html:not(.ios-webkit) .pet-contact-shadow {
  width: 32%;
  max-width: 145px;
  height: 10px;
  bottom: calc(var(--floor-y) - 2px);
}
html:not(.ios-webkit) .pet-photo {
  height: calc(100% - 28px);
  width: 74%;
  max-width: 320px;
  bottom: calc(var(--floor-y) - 22px);
}
html:not(.ios-webkit) .pet-panel {
  margin-top: 4px;
  padding: 10px 14px 8px;
  border-radius: 19px;
}
html:not(.ios-webkit) .pet-panel .pet-eyebrow { display: none; }
html:not(.ios-webkit) .pet-title { margin-top: 0; font-size: 16px; }
html:not(.ios-webkit) .pet-level-label,
html:not(.ios-webkit) .pet-level-name,
html:not(.ios-webkit) .pet-title [data-pet-level-name] { font-size: 12px; }
html:not(.ios-webkit) .pet-level-icon {
  width: 30px; height: 30px; flex-basis: 30px; border-radius: 10px;
}
html:not(.ios-webkit) .pet-xp-row { margin-top: 8px; font-size: 10px; }
html:not(.ios-webkit) .pet-xp-row b { font-size: 11px; }
html:not(.ios-webkit) .pet-progress { height: 7px; margin-top: 6px; }
html:not(.ios-webkit) .pet-hint { margin-top: 6px; font-size: 9px; }
/* Level 1 photo already includes podium + shadow: larger and seated just above the panel. */
.pet-home.pet-level-1 .pet-contact-shadow { display: none !important; }
.pet-home.pet-level-1 .pet-stage { overflow: visible; }
.pet-home.pet-level-1 .pet-panel { margin-top: 0; }
.pet-home.pet-level-1 .pet-photo {
  bottom: -15px;
  width: 78%;
  max-width: 340px;
  height: calc(100% - 8px);
  transform: translateX(-50%) scale(1.25);
  transform-origin: 50% 100%;
  filter: none;
}
/* Level 2 photo already includes podium + shadow: same seating as level 1. */
.pet-home.pet-level-2 .pet-contact-shadow { display: none !important; }
.pet-home.pet-level-2 .pet-stage { overflow: visible; }
.pet-home.pet-level-2 .pet-panel { margin-top: 0; }
.pet-home.pet-level-2 .pet-photo {
  bottom: -13px;
  width: 78%;
  max-width: 340px;
  height: calc(100% - 8px);
  transform: translateX(-50%) scale(1.25);
  transform-origin: 50% 100%;
  filter: none;
}
/* Level 3 photo already includes podium + shadow: same seating as level 1. */
.pet-home.pet-level-3 .pet-contact-shadow { display: none !important; }
.pet-home.pet-level-3 .pet-stage { overflow: visible; }
.pet-home.pet-level-3 .pet-panel { margin-top: 0; }
.pet-home.pet-level-3 .pet-photo {
  bottom: -5px;
  width: 78%;
  max-width: 340px;
  height: calc(100% - 8px);
  transform: translateX(-50%) scale(1.25);
  transform-origin: 50% 100%;
  filter: none;
}
/* Level 4 photo already includes podium + shadow: same seating as level 1. */
.pet-home.pet-level-4 .pet-contact-shadow { display: none !important; }
.pet-home.pet-level-4 .pet-stage { overflow: visible; }
.pet-home.pet-level-4 .pet-panel { margin-top: 0; }
.pet-home.pet-level-4 .pet-photo {
  bottom: 0px;
  width: 78%;
  max-width: 340px;
  height: calc(100% - 8px);
  transform: translateX(-50%) scale(1.25);
  transform-origin: 50% 100%;
  filter: none;
}

/* Level 5 photo already includes podium + shadow: same seating as level 1, then +20px. */
.pet-home.pet-level-5 .pet-contact-shadow { display: none !important; }
.pet-home.pet-level-5 .pet-stage { overflow: visible; }
.pet-home.pet-level-5 .pet-panel { margin-top: 0; }
.pet-home.pet-level-5 .pet-photo {
  bottom: 0px;
  width: 78%;
  max-width: 340px;
  height: calc(100% - 8px);
  transform: translateX(-50%) scale(1.25);
  transform-origin: 50% 100%;
  filter: none;
}

/* Level 6 photo already includes podium + shadow: same seating as level 1, then +17px. */
.pet-home.pet-level-6 .pet-contact-shadow { display: none !important; }
.pet-home.pet-level-6 .pet-stage { overflow: visible; }
.pet-home.pet-level-6 .pet-panel { margin-top: 0; }
.pet-home.pet-level-6 .pet-photo {
  left: 50%;
  bottom: -1px;
  top: auto;
  width: 78%;
  max-width: 340px;
  height: calc(100% - 8px);
  transform: translateX(-50%) scale(1.25);
  transform-origin: 50% 100%;
  filter: none;
}

/* Level 7 photo already includes podium + shadow: same seating as level 1. */
.pet-home.pet-level-7 .pet-contact-shadow { display: none !important; }
.pet-home.pet-level-7 .pet-stage { overflow: visible; }
.pet-home.pet-level-7 .pet-panel { margin-top: 0; }
.pet-home.pet-level-7 .pet-photo {
  left: 50%;
  bottom: 5px;
  top: auto;
  width: 78%;
  max-width: 340px;
  height: calc(100% - 8px);
  transform: translateX(-50%) scale(1.25);
  transform-origin: 50% 100%;
  filter: none;
}

/* Level 8 photo already includes podium + shadow: same seating as level 1. */
.pet-home.pet-level-8 .pet-contact-shadow { display: none !important; }
.pet-home.pet-level-8 .pet-stage { overflow: visible; }
.pet-home.pet-level-8 .pet-panel { margin-top: 0; }
.pet-home.pet-level-8 .pet-photo {
  left: 50%;
  bottom: 6px;
  top: auto;
  width: 78%;
  max-width: 340px;
  height: calc(100% - 8px);
  transform: translateX(-50%) scale(1.25);
  transform-origin: 50% 100%;
  filter: none;
}

/* Workout XP / level-up sheet */
.level-up-sheet { text-align: center; padding: 8px 4px 4px; }
.level-up-eyebrow { margin: 0; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.level-up-xp {
  margin: 10px 0 4px; font-size: 28px; font-weight: 800; letter-spacing: -.5px;
  color: #e4c7ff;
  animation: level-up-pop .45s ease;
}
.level-up-xp.is-loss { color: #ffb4c8; }
.level-up-title { margin: 12px 0 6px; font-size: 26px; letter-spacing: -.4px; }
.level-up-level {
  margin: 0 0 10px; font-size: 18px; font-weight: 700; color: #d7b6ff;
  animation: level-up-pop .55s ease .05s both;
}
@keyframes level-up-pop {
  0% { transform: scale(.86); opacity: .2; }
  70% { transform: scale(1.05); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

/* Legal consents and medical notice */
.consent-stack { display: grid; gap: 10px; margin: 14px 0 4px; }
.plan-dialog label.consent-check,
.consent-check {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 12px;
  margin: 0;
  border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent);
  border-radius: 14px;
  background: color-mix(in srgb, #241336 70%, transparent);
  color: var(--text);
  font-size: 14px;
  line-height: 1.4;
}
.consent-check input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0.2em 0 0;
  padding: 0;
  flex: 0 0 auto;
  accent-color: #a855f7;
}
.consent-check .consent-copy { flex: 1; min-width: 0; }
.consent-check .linkish {
  display: inline; padding: 0; border: 0; background: none; color: var(--accent);
  font: inherit; text-decoration: underline; cursor: pointer;
}
.consent-stack.compact { gap: 14px; margin: 12px 0 4px; }
.plan-dialog label.consent-check.compact,
.consent-check.compact {
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  font-size: 13px;
  line-height: 1.4;
  gap: 8px;
}
.consent-check.compact input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin-top: 0.22em;
}
.consent-check.compact .consent-copy { color: var(--text); }
.consent-check.compact .consent-hint {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}
.sub-connect-sheet { display: flex; flex-direction: column; gap: 0; }
.sub-connect-sheet #sheet-title { margin-bottom: 14px; }
.sub-connect-price {
  margin: 0 0 14px;
  padding: 14px 14px;
  border-radius: 16px;
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--border));
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
}
.sub-connect-amount {
  color: var(--text);
  font-size: 28px;
  font-weight: 750;
  letter-spacing: -0.02em;
  line-height: 1.15;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 0;
}
.sub-connect-amount .price-was {
  font-size: 0.55em;
  font-weight: 560;
  margin: 0 4px;
}
.sub-connect-note {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}
.plan-dialog label.sub-connect-email { margin: 0 0 6px; }
.sub-connect-hint {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}
.sub-connect-actions { margin-top: 16px; }
.medical-note {
  margin: 0 0 14px; padding: 12px 14px; border-radius: 14px;
  border: 1px solid color-mix(in srgb, #f0c36a 35%, transparent);
  background: color-mix(in srgb, #3a2a12 55%, transparent);
  color: #f6e7c8; font-size: 13px; line-height: 1.45;
}

/* Shared visual finish. Geometry follows the available viewport, not the OS. */
.plan-dialog { font-family: var(--font-ui); line-height: 1.5; }
.card, .plan-card, .profile-link, .profile-row, .profile-stat, .pet-panel { border-radius: 20px; }
.plan-btn, .start { gap: 8px; border-radius: 16px; font-size: 15px; font-weight: 600; }
.plan-btn svg { width: 20px; height: 20px; }
.plan-intro, .plan-muted { line-height: 1.5; }
:is(button, a, input, textarea, select):focus-visible {
  outline: 2px solid var(--accent); outline-offset: 3px;
}
.sheet-top .sheet-back:focus,
.sheet-top .sheet-back:focus-visible,
.sheet-top .sheet-back:active,
.sheet-top .sheet-close:focus,
.sheet-top .sheet-close:focus-visible,
.sheet-top .sheet-close:active,
.sheet-top [data-close]:focus,
.sheet-top [data-close]:focus-visible,
.sheet-top [data-close]:active {
  outline: none !important;
  outline-offset: 0 !important;
  box-shadow: none !important;
}
.plan-dialog :is(input, textarea, select):focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 12%, transparent);
}
.plan-dialog .consent-check input[type="checkbox"] {
  appearance: auto; -webkit-appearance: checkbox; min-height: 20px; width: 20px; height: 20px;
  flex: 0 0 20px; accent-color: var(--accent-lo); border-radius: 4px;
}
.consent-check { cursor: pointer; }
.plan-dialog label.consent-check { background: var(--surface); }
.plan-dialog label.consent-check.compact { background: transparent; min-height: 44px; align-items: flex-start; }
.medical-note { color: var(--warning); background: color-mix(in srgb, var(--warning) 8%, var(--background)); border-color: color-mix(in srgb, var(--warning) 25%, transparent); }
.level-up-xp, .level-up-level { color: var(--accent); }
.level-up-xp.is-loss { color: var(--danger); }
.pet-panel-heading > div { min-width: 0; }
.pet-title [data-pet-level-name] { white-space: normal; overflow-wrap: anywhere; }
.sheet-top.has-title { grid-template-columns: auto minmax(0, 1fr) 44px; }
.plan-dialog h2.sheet-top-title { white-space: normal; line-height: 1.35; overflow-wrap: anywhere; }
.plan-dialog { scroll-padding-block: 20px; }
.plan-dialog :is(input, textarea, select) { scroll-margin-block: 24px; }
.toast { line-height: 1.5; overflow-wrap: anywhere; text-align: center; }
.ui-state { display: grid; justify-items: center; gap: 12px; padding: 32px 18px; text-align: center; border: 1px solid var(--border); border-radius: 20px; background: var(--surface); }
.ui-state h3 { font-size: 17px; }
.ui-state p { max-width: 34ch; margin: 0; font-size: 14px; line-height: 1.5; color: var(--muted); }
.ui-state .plan-btn { margin-top: 4px; }
.ui-state-icon { display: grid; place-items: center; width: 44px; height: 44px; color: var(--accent); border-radius: 14px; background: color-mix(in srgb, var(--accent) 10%, transparent); }
.ui-spinner { width: 28px; height: 28px; border: 2px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: ui-spin .9s linear infinite; }
@keyframes ui-spin { to { transform: rotate(360deg); } }

/* Keep the same low-contrast scene on both WebKit and Chromium. */
html[data-theme] .diary.pet-mode > header { margin-bottom: 8px; }
html[data-theme] .pet-intro { display: none; }
html[data-theme] .pet-home { flex: 1 0 auto; min-height: 340px; }
html[data-theme] .pet-stage { flex: 1 1 auto; min-height: 200px; margin: 0 calc(-1 * var(--gutter)); }
html[data-theme] .pet-home[class*="pet-level-"] { flex: 1 0 auto; min-height: 340px; }
html[data-theme] .pet-home[class*="pet-level-"] .pet-stage { flex: 1 1 auto; min-height: 200px; }
html[data-theme] .pet-halo {
  height: 68%; max-height: 280px; max-width: 78%; top: 48%;
  border-color: rgba(192, 132, 252, .12);
  background: radial-gradient(circle, rgba(143, 75, 205, .12), rgba(93, 44, 143, .04) 62%, transparent 72%);
  box-shadow: 0 0 48px rgba(126, 66, 183, .09);
}
html[data-theme] .pet-halo::after { border-color: rgba(192, 132, 252, .07); }
html[data-theme] .pet-floor { display: none !important; }
html[data-theme] .pet-podium {
  width: 54%; max-width: 240px; height: 34px; bottom: calc(var(--floor-y) - 14px);
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  opacity: 0 !important;
}
html[data-theme] .diary.pet-mode .orbit::after { opacity: .3; box-shadow: none; }
html[data-theme] .pet-panel { margin-top: 8px; padding: 14px; }
html[data-theme] .pet-panel .pet-eyebrow { display: none; }
html[data-theme] .pet-title { margin-top: 0; font-size: 16px; }
html[data-theme] .pet-title [data-pet-level-name] { font-size: 12px; }
html[data-theme] .pet-xp-row { margin-top: 10px; font-size: 12px; flex-wrap: wrap; }
html[data-theme] .pet-xp-row b { font-size: 12px; }
html[data-theme] .pet-progress { height: 7px; margin-top: 8px; }
html[data-theme] .pet-hint { margin-top: 8px; font-size: 11px; }
html[data-theme] .pet-level-arrow { width: 44px; height: 44px; top: 52%; background: var(--surface); box-shadow: none; }
html[data-theme="light"] :is(.pg-totals b, .pg-cal-stat, .planned-card.is-missed h3) { color: var(--text); }
html[data-theme="light"] :is(.planned-missed, .planned-card.is-missed .planned-date, .wheel-item.below-prev) { color: var(--danger); }
html[data-theme="light"] .planned-card.is-missed { background: color-mix(in srgb, var(--danger) 6%, var(--surface)); }
html[data-theme="light"] {
  --accent: #7135a5;
  --accent-hi: #7135a5;
  --accent-lo: #7135a5;
  --text: #251a30;
  --muted: #685a75;
  --background: #faf7fd;
  --border: #ddd3e7;
  --glow-1: #e7d8f455;
  --glow-2: #eee6f555;
  --nav-bg: #faf7fd;
  --nav-border: #ddd3e7;
  --dialog-bg: var(--background);
  --theme-color: #faf7fd;
  --icon-surface: #f0e8f7;
  --ring-track: #e4d9ed;
  --progress-track: #e4d9ed;
  --progress-fill: #8b49bd;
  --time-bg: #f0e8f7;
  --time-border: #d4bee5;
  --btn-primary: linear-gradient(160deg, #8244b5, #7135a5);
  --nav-active: linear-gradient(160deg, #8244b5, #7135a5);
}
@media (max-width: 360px) {
  :root { --gutter: 12px; }
  .card, .plan-card { padding: 14px; }
  .plan-dialog { padding-inline: calc(14px + var(--safe-left)) calc(14px + var(--safe-right)); }
  .diary nav button { font-size: 9.5px; }
  .plan-dialog h2 { font-size: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
.keyboard-open .plan-dialog:not(.assist-open) {
  position: fixed; top: var(--visible-top, 0px); bottom: auto;
  max-height: var(--visible-height, 100dvh); margin-block: 0;
}
.keyboard-open .plan-dialog.workout-fullscreen:not(.assist-open) { height: var(--visible-height, 100dvh); padding-top: 8px; }
/* Клавиатура перекрывает низ листа: запас прокрутки позволяет поднять
   активное поле под шапку, даже если viewport не уменьшился. */
.custom-exercise-body.is-typing { padding-bottom: 75vh; }
.keyboard-open .diary nav { visibility: hidden; }

/* Subtle, shared outlines on Android WebView and iOS WebKit. */
html[data-theme="purple"] {
  --border: rgba(176, 145, 201, .19);
  --nav-border: rgba(176, 145, 201, .19);
}
.round,
.pg-shift,
.pg-ex,
.pg-photo,
.pg-muscle-btn,
.pg-periods,
.pg-totals > div,
.pet-level-icon,
.pet-level-arrow,
.weight-icon,
.schedule-nearest-icon,
.profile-avatar { border-color: var(--border); }
.card, .plan-card, .pet-panel, .profile-link, .profile-row, .profile-stat { border-color: var(--border); }
.pg-ex { grid-template-columns: 60px minmax(0, 1fr); min-width: 0; }
.pg-ex-body { min-width: 0; }
.pg-ex-summary { grid-template-columns: minmax(0, 1fr) auto; }
.pg-bars { flex: 0 0 auto; }
.pg-ex-meta { overflow-wrap: anywhere; }
.plan-dialog { border-color: var(--border); }
.plan-btn { border-color: var(--border); }
.plan-dialog label.consent-check { border-color: var(--border); }
.pg-muscle-btn { min-height: 40px; }
@media (max-width: 380px) {
  .pg-muscle-btn { min-height: 44px; padding-inline: 12px; }
}
html[data-theme="light"] .pg-ex { background: #ffffff; }
/* Full-height sheets share a scroll area and a bottom action area. */
.plan-dialog.workout-fullscreen:not(.assist-open) {
  top: var(--visible-top, 0px);
  bottom: auto;
  height: var(--visible-height, 100dvh);
  max-height: var(--visible-height, 100dvh);
  box-sizing: border-box;
}
.sheet-form-layout { display: flex; flex-direction: column; flex: 1; min-height: 0; margin: 0; overflow: hidden; }
.workout-sheet-body { min-width: 0; }
.workout-sheet-body > .sheet-top { position: relative; z-index: 1; }
.workout-sheet-footer { max-height: 48%; overflow-y: auto; overscroll-behavior: contain; }
.sheet-bottom-actions { display: flex; flex-direction: column; gap: 10px; padding-top: 12px; }
.sheet-bottom-actions > * { flex-shrink: 0; }
.sheet-bottom-actions :is(.sheet-actions,.confirm-actions,.assist-ex-actions,.wide) { margin-top: 0 !important; margin-bottom: 0; }
.sheet-bottom-actions > .form-error:empty { display: none; }
.workout-step-body { padding-bottom: calc(12px + var(--inset-bottom)); }
.workout-sheet-body.workout-step-body:has(.workout-step-actions.result-set),
.workout-sheet-body:has(#planner-form) {
  display: flex;
  flex-direction: column;
}
.workout-step-body > .form-error:empty,
#planner-form > .form-error:empty { display: none; margin: 0; }
.workout-step-actions.result-set {
  margin-top: auto;
  padding: 16px 0 0;
  width: 100%;
  background: transparent;
  border: 0;
  box-shadow: none;
}
.workout-step-body .wheel-highlight {
  border-color: var(--border);
  background: var(--surface);
}
.workout-step-body .workout-step-secondary-btn {
  border-color: var(--border);
  background: var(--surface);
  color: var(--text);
}
#planner-form {
  display: flex;
  flex-direction: column;
  flex: 1 0 auto;
  min-height: 0;
}
#planner-form > .plan-btn[type="submit"] {
  margin-top: auto;
}
.sheet-bottom-actions .workout-step-actions { padding: 0; border: 0; background: transparent; }
.result-set-wheels { gap: 10px; }
.wheel-field { padding: 10px 6px; }
.wheel-label { font-size: clamp(12px, 3.6vw, 14px); }
.wheel-item { white-space: nowrap; }
.wheel-item::before,.wheel-item::after { display: none; }
.wheel-item[aria-selected=true] { font-size: clamp(23px, 7vw, 28px); }
@media (max-width: 360px) {
  .workout-step-entry.result-set { padding: 8px; }
  .result-set-wheels { gap: 8px; }
}
@media (max-width: 380px) {
  .pg-ex { grid-template-columns: 52px minmax(0, 1fr); gap: 8px 10px; padding: 10px; }
  .pg-photo { width: 52px; border-radius: 11px; }
  .pg-ex-body { padding-right: 14px; }
  .pg-ex-summary { gap: 5px; }
  .pg-ex-copy strong { font-size: 13px; }
  .pg-ex-side { gap: 4px; }
  .pg-ex-side b { font-size: 12px; }
  .pg-bars { display: none; }
}
/* Exercise history: the illustration introduces the exercise; the result stays a compact badge. */
.pg-records-card { min-width: 0; gap: 12px; }
.pg-records-card .pg-muscle-filter { margin: 0; padding: 0 0 4px; gap: 6px; }
.pg-records-card .pg-muscle-btn { min-height: 44px; padding: 8px 14px; border-radius: 22px; font-size: 12px; box-shadow: none; }
.pg-records-card .pg-ex {
  grid-template-columns: 68px minmax(0, 1fr);
  gap: 12px;
  padding: 14px 14px 0;
  border-radius: 20px;
  background: var(--surface);
  align-items: start;
}
.pg-records-card .pg-photo {
  grid-area: 1 / 1 / span 2 / 2;
  width: 68px;
  height: 68px;
  border: 0;
  border-radius: 15px;
  align-self: start;
}
.pg-record-main { grid-area: 1 / 2; display: grid; align-content: start; gap: 9px; min-width: 0; padding-top: 1px; }
.pg-record-name { min-width: 0; font-size: 15px; font-weight: 700; line-height: 1.32; white-space: normal; overflow-wrap: anywhere; }
.pg-record-result {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  gap: 6px;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  color: var(--accent-hi);
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
  font-size: 12px;
  line-height: 1;
}
.pg-record-result > span { color: inherit; }
.pg-record-result > span::after { content: "·"; margin-left: 6px; opacity: .7; }
.pg-record-result b { color: inherit; font-size: 13px; line-height: 1; font-variant-numeric: tabular-nums; }
.pg-record-change { grid-column: 1 / -1; color: var(--muted); font-size: 12px; line-height: 1.35; }
.pg-record-meta { grid-column: 1 / -1; color: var(--muted); font-size: 12px; line-height: 1.45; overflow-wrap: anywhere; }
.pg-record-link {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  min-height: 50px;
  margin-top: 2px;
  padding: 0 2px;
  border-top: 1px solid var(--border);
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
}
.pg-record-link > span:last-child { font-size: 22px; font-weight: 400; line-height: 1; }
@media (max-width: 380px) {
  .pg-records-card .pg-ex { grid-template-columns: 60px minmax(0, 1fr); gap: 10px; padding: 12px 12px 0; }
  .pg-records-card .pg-photo { width: 60px; height: 60px; border-radius: 13px; }
  .pg-record-main { gap: 7px; }
  .pg-record-name { font-size: 14px; }
  .pg-record-result { min-height: 26px; padding: 4px 8px; font-size: 11px; }
  .pg-record-result b { font-size: 12px; }
}
