@font-face {
  font-family: Manrope;
  src: url("fonts/Manrope.946beb949095.ttf") format("truetype");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Barlow Condensed";
  src: url("fonts/BarlowCondensed-SemiBold.277d45807d45.ttf") format("truetype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

:root {
  --canvas: #10131e;
  --surface: #1a2130;
  --surface-hover: #222c3e;
  --text: #f4f1ea;
  --muted: #b3b9c7;
  --accent: #f4bb83;
  --info: #aab9f2;
  --border: #343e52;
  --success: #a3d4bd;
  --danger: #ffb5ad;
  --radius: 18px;
  --section-gap: clamp(24px, 4vw, 32px);
  color-scheme: dark;
  font-family: Manrope, "Segoe UI", sans-serif;
  font-size: 100%;
  line-height: 1.65;
  background: var(--canvas);
  color: var(--text);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 24px; }
body { margin: 0; min-width: 320px; background: radial-gradient(ellipse 80% 380px at 50% 0, #202a443d, transparent); }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea, summary { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { opacity: .45; cursor: not-allowed; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
svg { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
p, h1, h2, h3, h4 { margin: 0; }
h1, h2, h3, h4 { font-weight: 650; line-height: 1.3; letter-spacing: -.025em; }
h1 { font-family: "Barlow Condensed", Manrope, sans-serif; font-size: 3.5rem; font-weight: 600; line-height: 1.05; letter-spacing: -.015em; overflow-wrap: anywhere; }
h2 { font-size: 1.375rem; }
h3 { font-size: 1.125rem; }
h4 { font-size: 1rem; }
p { overflow-wrap: anywhere; }
strong { font-weight: 650; }
button:focus-visible, a:focus-visible, summary:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
main:focus { outline: none; }
[hidden] { display: none !important; }
.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; }
.skip-link { position: fixed; top: 12px; left: 12px; z-index: 30; clip-path: inset(50%); transform: translateY(-180%); padding: 12px 18px; background: var(--accent); color: var(--canvas); border-radius: 6px; }
.skip-link:focus { clip-path: none; transform: translateY(0); }

.app-shell { width: 100%; max-width: 928px; margin: 0 auto; padding: 0 32px; }
.app-header { display: flex; align-items: center; justify-content: space-between; gap: 32px; min-height: 80px; border-bottom: 1px solid var(--border); }
.brand { display: inline-flex; align-items: center; gap: 11px; min-height: 48px; font-size: 1.375rem; font-weight: 750; letter-spacing: -.045em; }
.brand img { width: 36px; height: 36px; }
.page-navigation { display: flex; align-items: center; gap: 4px; background: #0c101a; border: 1px solid #293247; padding: 4px; border-radius: 12px; }
.page-navigation a { display: flex; align-items: center; position: relative; min-height: 44px; padding: 9px 18px; color: var(--muted); font-size: 0.9375rem; font-weight: 600; border-radius: 8px; transition: background .15s, color .15s; }
.page-navigation a:hover { color: var(--text); }
.page-navigation a[aria-current="page"] { color: var(--text); background: #293348; box-shadow: inset 0 1px 0 #ffffff0d, 0 2px 8px #0003; }
.main-content { padding: 32px 0 40px; }
.page-heading { margin-bottom: var(--section-gap); }
.page-heading .eyebrow { margin-bottom: 9px; }
.page-description { margin-top: 12px; max-width: 680px; color: var(--muted); font-size: 1.0625rem; }
.eyebrow { color: var(--info); font-size: 0.875rem; font-weight: 650; line-height: 1.5; letter-spacing: .025em; }
.muted, .meta, .quiet-label { color: var(--muted); }
.meta, .quiet-label { font-size: 0.875rem; }
.meta { margin-top: 8px; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; box-shadow: 0 12px 32px #0000000d; }
.section-description { color: var(--muted); margin-top: 12px; }
.section-heading { margin-bottom: 25px; }
.section-heading h2 { font-size: 1.5rem; }
.section-heading p { color: var(--muted); margin-top: 8px; }
.page-section { padding: 34px 0; border-top: 1px solid var(--border); }
.page-section:first-of-type { padding-top: 28px; }

.button { display: inline-flex; justify-content: center; align-items: center; gap: 16px; min-height: 50px; border: 1px solid transparent; border-radius: 10px; padding: 12px 20px; font-size: 1rem; font-weight: 700; line-height: 1.5; text-align: center; transition: background .15s, border-color .15s, box-shadow .15s; }
.button.primary { background: var(--accent); color: #281c17; box-shadow: inset 0 1px 0 #fff5, 0 4px 16px #0002; }
.button.primary:hover:not(:disabled) { background: #ffcea0; box-shadow: inset 0 1px 0 #fff7, 0 6px 24px #f4bb8314; }
.button.secondary { background: #ffffff03; border-color: #535e73; color: var(--text); }
.button.secondary:hover:not(:disabled) { background: var(--surface-hover); border-color: var(--muted); }
.button.danger { color: var(--danger); background: transparent; border-color: #75534f; }
.button.small { min-height: 44px; }
.full-width { width: 100%; }
.text-link, .text-button { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 6px 0; border: 0; background: transparent; color: var(--accent); font-size: 1rem; font-weight: 600; text-align: left; }
.text-link:hover, .text-button:hover { text-decoration: underline; text-underline-offset: 4px; }
.icon-button { display: grid; place-items: center; flex: none; width: 44px; min-height: 44px; padding: 0; border: 0; border-radius: 6px; color: var(--muted); background: transparent; font-size: 1.625rem; }
.tag { display: inline-flex; align-items: center; gap: 7px; color: var(--info); background: #aab9f20c; border: 1px solid #aab9f230; border-radius: 6px; padding: 3px 9px; font-size: 0.875rem; font-weight: 600; }
.tag-success { color: var(--success); border-color: #a3d4bd40; background: #a3d4bd0a; }
.status-dot { width: 7px; height: 7px; flex: none; border-radius: 50%; background: var(--muted); }
.status-dot.is-connected { background: var(--success); }

.notice { padding: 18px 20px; margin: 0 0 24px; border: 1px solid #aab9f240; border-left: 3px solid var(--info); border-radius: 10px; background: #aab9f208; font-size: 1rem; }
.notice p + p { margin-top: 8px; }
.notice.error { color: var(--danger); border-color: #ffb5ad45; border-left-color: var(--danger); background: #ffb5ad06; }
.notice.warning { border-color: #f4bb8340; border-left-color: var(--accent); }
.notice.success { border-color: #a3d4bd45; border-left-color: var(--success); }
.notice .button { margin-top: 12px; }
.notice form { display: inline-block; }
.notice form + form { margin-left: 8px; }
.result-ready form { display: flex; flex-wrap: wrap; gap: 8px 24px; margin-top: 8px; }
.notification-guard { color: var(--accent); }
.job-status { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 24px; }
.job-status strong { display: block; font-size: 1rem; }
.job-status p { margin-top: 5px; color: var(--muted); font-size: 0.875rem; }
.job-status .eyebrow { margin-top: 8px; }
.activity-indicator { flex: none; width: 18px; height: 18px; margin-top: 4px; border: 2px solid #f4bb8330; border-top-color: var(--accent); border-radius: 50%; animation: spin 1.2s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.workout-title-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 16px; }
.workout-title-row h1 { min-width: 0; flex: 1 1 14rem; }
.workout-title-row > a { white-space: nowrap; font-size: .9rem; }
.workout-meta + .workout-title-row { margin-top: 12px; }
.workout-overview { margin-bottom: var(--section-gap); padding: 26px 28px; background: var(--surface); border: 1px solid var(--border); border-top: 3px solid var(--accent); border-radius: var(--radius); box-shadow: 0 16px 36px #00000014; }
.workout-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; color: var(--muted); font-size: 0.875rem; }
.workout-meta time { margin-left: auto; }
.workout-summary { margin-top: 20px; line-height: 1.8; }
.training-facts { display: flex; flex-wrap: wrap; gap: 18px 32px; padding: 0 0 22px; margin: 22px 0 0; border-bottom: 1px solid var(--border); }
.training-facts > div { min-width: 0; }
.training-facts dt { color: var(--muted); font-size: .875rem; }
.training-facts dd { margin: 3px 0 0; font-family: "Barlow Condensed", Manrope, sans-serif; font-size: 2rem; font-weight: 600; line-height: 1.2; }
.training-facts dd span { font-family: Manrope, sans-serif; font-size: 1rem; font-weight: 500; }
.session-focus { color: var(--muted); margin-top: 12px; }
.session-focus strong { color: var(--text); margin-right: 5px; }
.workout-overview .notice { margin-top: 20px; }
.workout-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.generation-outcome h2 { font-size: 1.25rem; }
.generation-outcome h2 + p { margin-top: 10px; }
.previous-proposal { margin: -10px 0 20px; }
.exercise-section-heading { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px 16px; margin: 0 0 16px; }
.exercise-section-heading p { color: var(--muted); font-size: .875rem; }
.exercise-list { padding: 0; margin: 0; list-style: none; background: #171e2c; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.single-publication { margin-top: 16px; }
.single-publication .workout-actions { margin: 0; }
#training-result:has(.exercise-list, .workout-comparison) { margin-bottom: var(--section-gap); }
.exercise-list > li + li { border-top: 1px solid var(--border); }
summary { cursor: pointer; list-style: none; }
summary::-webkit-details-marker { display: none; }
details:not([open]) > :not(summary) { display: none; }
.exercise-row > summary { display: flex; align-items: center; gap: 18px; min-height: 100px; padding: 20px 22px; transition: background .15s; }
.exercise-row > summary:hover { background: var(--surface-hover); }
.exercise-row > summary:focus-visible { outline-offset: -4px; }
.exercise-number { display: grid; place-items: center; flex: none; min-width: 2.5rem; min-height: 2.5rem; border: 1px solid #3c4861; border-radius: 12px; background: #253049; color: var(--info); font-family: "Barlow Condensed", Manrope, sans-serif; font-size: 1.375rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.exercise-main { display: grid; gap: 5px; flex: 1; min-width: 0; }
.exercise-name { font-size: 1.125rem; font-weight: 650; letter-spacing: -.015em; line-height: 1.45; overflow-wrap: anywhere; }
.exercise-target { color: #c2c9d8; font-size: 0.875rem; line-height: 1.7; overflow-wrap: anywhere; }
.exercise-target > span { margin: 0 3px; }
.disclosure-icon { display: grid; place-items: center; width: 1.5rem; height: 1.5rem; flex: none; margin-left: auto; color: var(--info); font-size: 1.5rem; line-height: 1; text-align: center; font-weight: 400; transition: transform .15s; }
details[open] > summary > .disclosure-icon { transform: rotate(45deg); color: var(--accent); }
.exercise-row[open] > summary { border-bottom: 1px solid var(--border); }
.exercise-content { padding: 24px 22px 18px 80px; background: #131a27; }
.exercise-context { display: flex; flex-wrap: wrap; gap: 8px 20px; color: var(--muted); font-size: 0.875rem; margin-bottom: 14px; }
.sets-table-wrap { min-width: 0; max-width: 100%; overflow-x: auto; overscroll-behavior-x: contain; }
.sets-table { width: 100%; border-collapse: collapse; text-align: left; font-size: 1rem; font-variant-numeric: tabular-nums; }
.sets-table th, .sets-table td { padding: 12px 8px; border-bottom: 1px solid var(--border); font-weight: 500; }
.sets-table .working-set td { color: var(--text); font-weight: 650; }
.sets-table th:first-child { padding-left: 0; }
.sets-table th:last-child, .sets-table td:last-child { padding-right: 0; text-align: right; }
.sets-table thead th { color: var(--muted); font-size: 0.875rem; font-weight: 500; }
.sets-table tbody tr:last-child > * { border-bottom: 0; }
.sets-table td span { color: var(--muted); font-size: 0.875rem; }
.set-index { display: inline-block; margin-left: 8px; color: var(--muted); font-size: 0.875rem; }
.warmup-set { color: var(--muted); }
.exercise-note { margin-top: 24px; }
.exercise-note h3 { color: var(--muted); font-size: 0.875rem; font-weight: 600; letter-spacing: 0; margin-bottom: 7px; }
.exercise-note p { line-height: 1.8; }
.exercise-note p + p { margin-top: 5px; }
.exercise-options { margin-top: 24px; }
.exercise-exclusion { padding-top: 12px; border-top: 1px solid var(--border); }
.exercise-exclusion .field-help { margin: 0; }

.section-disclosure { border-top: 1px solid var(--border); scroll-margin-top: 24px; }
.section-disclosure.refinement { padding: 0 28px; margin-bottom: 16px; border: 1px solid #aab9f245; border-radius: var(--radius); background: #aab9f207; }
.refinement-controls { display: grid; grid-template-columns: minmax(0, 230px) auto; gap: 8px 24px; justify-content: start; }
.refinement-controls .form-field { display: contents; }
.refinement-controls label { grid-column: 1; grid-row: 1; margin: 0; }
.refinement-controls input { grid-column: 1; grid-row: 2; }
.refinement-controls .field-help { grid-column: 1 / -1; grid-row: 3; margin: 0; }
.refinement-controls .field-error { grid-column: 1 / -1; }
.refinement-controls .form-actions { grid-column: 2; grid-row: 2; align-self: center; justify-content: flex-end; margin: 0; }
.refinement .summary-title { color: var(--info); }
.section-disclosure > summary { display: flex; align-items: center; gap: 20px; min-height: 82px; padding: 22px 0; }
.summary-title { display: block; font-size: 1.125rem; font-weight: 650; line-height: 1.5; }
.summary-description { display: block; color: var(--muted); font-size: 0.875rem; margin-top: 5px; }
.disclosure-content { padding: 0 0 28px; }
.disclosure-content > .stack-form { margin-top: 4px; }
.nested-disclosure { border-top: 1px solid var(--border); }
.nested-disclosure > summary { display: flex; align-items: center; gap: 16px; min-height: 54px; padding: 12px 0; color: var(--muted); font-size: 0.875rem; font-weight: 600; }
.nested-disclosure > summary:hover { color: var(--text); }
.nested-disclosure > .stack-form { margin: 12px 0 24px; }
.reasoning-content h3 { margin-top: 16px; }
.reasoning-content ul { padding-left: 20px; margin: 16px 0 24px; }
.reasoning-content li { margin-top: 14px; }
.reasoning-content .field-help { margin-top: 7px; }

.stack-form { display: grid; gap: 24px; margin-top: 24px; }
.generation-section { padding: 26px 28px 28px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 16px 36px #00000014; }
.generation-section > .stack-form { margin-top: 0; }
.generation-section .section-heading { padding-bottom: 22px; border-bottom: 1px solid var(--border); }
.generation-heading { margin-bottom: 20px; }
#training-result:has(.new-training-heading) ~ #generation .generation-heading { display: none; }
#training-result:has(.exercise-list, .workout-comparison) ~ #generation { margin-top: var(--section-gap); }
.generation-form { gap: 18px; }
.generation-submit { display: flex; justify-content: flex-start; }
.workout-count { min-width: 0; margin: 0; padding: 0; border: 0; }
.workout-count legend { margin-bottom: 7px; }
.workout-count-buttons { display: inline-flex; gap: 4px; padding: 4px; border: 1px solid var(--border); border-radius: 12px; background: var(--canvas); }
.workout-count-buttons label { position: relative; cursor: pointer; }
.workout-count-buttons input { position: absolute; width: 1px; height: 1px; margin: 0; opacity: 0; }
.workout-count-buttons span {
  display: grid; min-width: 44px; min-height: 40px; place-items: center;
  border: 1px solid transparent; border-radius: 8px; color: var(--muted); font-weight: 750;
}
.workout-count-buttons label:hover span { color: var(--text); background: var(--surface-hover); }
.workout-count-buttons input:checked + span { color: var(--accent); border-color: #f4bb8370; background: #f4bb831c; }
.workout-count-buttons input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.generation-options { border-top: 1px solid var(--border); }
.generation-options > summary { display: flex; align-items: center; gap: 10px; min-height: 44px; padding-top: 4px; color: var(--muted); font-size: .9rem; }
.generation-options > summary:hover { color: var(--text); }
.generation-options .disclosure-icon { font-size: 1.2rem; }
.generation-fields { display: grid; gap: 18px; margin-top: 10px; }
.generation-form > .form-note { margin: 0; }
.generation-section #generation-feedback:empty { display: none; }

.comparison-heading { display: grid; gap: 6px; margin-bottom: 16px; }
.comparison-heading p { color: var(--muted); font-size: .9rem; }
.workout-comparison {
  display: grid; grid-auto-flow: column; grid-auto-columns: clamp(265px, 49%, 460px);
  align-items: stretch; gap: 18px; overflow-x: auto; padding: 3px 3px 8px;
  scroll-snap-type: x proximity; scroll-padding-inline: 3px; scrollbar-color: #74809a var(--canvas);
}
.workout-comparison:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 12px; }
.comparison-card {
  display: flex; min-width: 0; flex-direction: column; scroll-snap-align: start;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
}
.comparison-card-header { padding: 18px 22px 14px; border-radius: var(--radius) var(--radius) 0 0; background: #232d42; }
.comparison-position { color: var(--info); font-size: .78rem; font-weight: 750; font-variant-numeric: tabular-nums; }
.comparison-card h2 {
  overflow-wrap: anywhere; margin: 6px 0 14px; font: 600 clamp(1.75rem, 4vw, 2.3rem)/1.05 "Barlow Condensed", Manrope, sans-serif;
}
.comparison-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin: 0; padding-top: 12px; border-top: 1px solid var(--border); }
.comparison-facts dt { color: var(--muted); font-size: clamp(.65rem, 3vw, .78rem); overflow-wrap: anywhere; }
.comparison-facts dd { margin: 0; font-variant-numeric: tabular-nums; font-weight: 800; }
.comparison-exercises { list-style: none; margin: 3px 22px 0; padding: 0; }
.comparison-exercises li { display: grid; gap: 1px; padding: 9px 0; border-bottom: 1px solid var(--border); overflow-wrap: anywhere; }
.comparison-exercises span, .comparison-summary { color: var(--muted); font-size: .85rem; }
.comparison-summary { margin-inline: 22px; }
.comparison-summary > summary { min-height: 44px; padding: 0; color: var(--accent); }
.comparison-summary:not([open]) .comparison-summary-less,
.comparison-summary[open] .comparison-summary-more { display: none; }
.comparison-actions { display: grid; gap: 5px; margin-top: auto; padding: 15px 22px 18px; }
.comparison-actions .text-link { justify-self: start; min-height: 35px; font-size: .9rem; }
.comparison-actions .button { width: 100%; justify-content: space-between; }
.comparison-actions [data-action-feedback]:empty { display: none; }
@media (max-width: 520px) {
  .generation-submit .button { width: 100%; }
  .app-header:has(.page-navigation) .brand span { display: none; }
  .app-header .brand { min-width: 44px; }
  .workout-title-row h1 { flex-basis: 100%; }
  .workout-title-row > a { min-height: 44px; }

  .workout-comparison { grid-auto-columns: 92%; gap: 14px; }
  .comparison-card-header, .comparison-actions { padding-inline: 15px; }
  .comparison-summary, .comparison-exercises { margin-inline: 15px; }
}
.form-field { min-width: 0; }
.form-field > label, fieldset > legend { display: block; font-size: 1rem; line-height: 1.5; font-weight: 600; margin-bottom: 10px; overflow-wrap: anywhere; }
.optional { display: inline-block; margin-left: 4px; font-size: 0.875rem; color: var(--muted); font-weight: 400; }
.form-field input:not([type="radio"]):not([type="checkbox"]), .form-field select, .form-field textarea { display: block; width: 100%; max-width: 100%; min-height: 52px; border: 1px solid #4a566d; border-radius: 10px; background: #101724; color: var(--text); padding: 13px 15px; font-size: 1rem; line-height: 1.6; transition: border-color .15s, background .15s; }
.form-field textarea { resize: vertical; min-height: 118px; }
.form-field input[type="number"] { max-width: 230px; }
.form-field input:hover, .form-field select:hover, .form-field textarea:hover { border-color: #747c89; }
.form-field input::placeholder, .form-field textarea::placeholder { color: var(--muted); opacity: .85; }
.form-field select[multiple] { min-height: 200px; padding: 6px; }
.form-field select[multiple] option { padding: 10px; min-height: 44px; }
.has-error input, .has-error textarea, .has-error select { border-color: var(--danger) !important; }
.field-help, .form-note { font-size: 0.875rem; color: var(--muted); line-height: 1.7; margin-top: 8px; }
.push-notifications { display: grid; justify-items: start; gap: 12px; }
.push-notifications .form-note { margin: 0; }
.push-notifications.is-compact { gap: 4px; }
.push-notifications.is-compact .text-button { color: var(--muted); font-size: inherit; font-weight: 500; }
.push-notifications.is-compact .form-note { max-width: 44ch; font-size: inherit; }
.field-error, .errorlist { color: var(--danger); font-size: 0.875rem; margin-top: 8px; }
.errorlist { padding-left: 20px; }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 24px; margin-top: 2px; }
.form-actions .form-note { margin: 0; max-width: 360px; flex: 1 1 220px; }
.refinement-history { list-style: none; padding: 0; margin: 0 0 18px; }
.refinement-history li { padding-block: 10px; border-bottom: 1px solid var(--border); overflow-wrap: anywhere; }
.refinement-history strong { font-size: .875rem; color: var(--muted); }
.refinement-history p { margin-block: 4px; }
.mode-options { margin: 0; padding: 0; border: 0; min-width: 0; }
.mode-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.mode-option { display: flex; align-items: flex-start; gap: 12px; padding: 18px; border: 1px solid #46526a; background: #151d2c; border-radius: 12px; cursor: pointer; transition: background .15s, border-color .15s; }
.mode-option:hover { background: var(--surface-hover); }
.mode-option:has(input:checked) { background: linear-gradient(120deg, #f4bb8314, #f4bb8304); border-color: #d9aa7d; box-shadow: inset 0 0 0 1px #f4bb8320; }
.mode-option:has(input:checked) strong { color: #ffd3ac; }
.mode-option input { appearance: none; display: grid; place-content: center; flex: none; width: 1.25rem; height: 1.25rem; border: 1px solid #68748d; border-radius: 50%; margin: 3px 0 0; background: #101724; }
.mode-option input:checked { border-color: var(--accent); background: var(--accent); }
.mode-option input:checked::before { content: ""; width: .5rem; height: .3rem; border-left: 2px solid #302018; border-bottom: 2px solid #302018; transform: translateY(-1px) rotate(-45deg); }
.mode-option strong { display: block; font-size: 1rem; }
.mode-option span span { display: block; color: var(--muted); font-size: 0.875rem; line-height: 1.6; margin-top: 4px; }

.chat-messages { display: grid; gap: 20px; margin: 2px 0 28px; }
.chat-message { border-left: 2px solid var(--border); padding: 2px 0 2px 18px; }
.chat-message.from-coach { border-left-color: var(--info); }
.message-meta { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; font-size: 0.875rem; margin-bottom: 8px; }
.message-meta time { color: var(--muted); font-size: 0.875rem; }
.from-coach .message-meta strong { color: var(--info); }
.message-content { font-size: 1rem; line-height: 1.85; overflow-wrap: anywhere; }

.connection-section { padding: 25px 0; border-bottom: 1px solid var(--border); }
.connection-section:first-of-type { padding-top: 0; }
.connection-section:last-child { padding-bottom: 0; border-bottom: 0; }
.connection-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.connection-heading h3 { font-size: 1.25rem; }
.connection-state { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 0.875rem; }
.account-email { margin-top: 8px; color: var(--muted); font-size: 0.875rem; }
.account-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.connection-action { margin-top: 20px; }
.connection-section .notice { margin-top: 20px; }
.device-code { display: inline-flex; flex-direction: column; gap: 6px; margin: 20px 20px 20px 0; padding: 16px 24px; border: 1px dashed #626a77; border-radius: 7px; text-align: center; background: var(--surface); }
.device-code > span { color: var(--muted); font-size: 0.875rem; }
.device-code strong { font-size: 1.5rem; color: var(--accent); letter-spacing: .1em; }
.usage-limits { margin-top: 24px; padding: 20px; border-radius: 7px; background: var(--surface); }
.usage-limits h4 { margin-bottom: 16px; }
.usage-row { display: flex; justify-content: space-between; gap: 16px; font-size: 1rem; }
.usage-row strong { color: var(--accent); }
.usage-limits .field-help { margin-bottom: 16px; }
.usage-limits .field-help:last-child { margin-bottom: 0; }
.disconnect-details { margin-top: 24px; }
.disconnect-details form { margin-top: 18px; }
.install-panel .nested-disclosure { border-top: 0; }
.install-panel .section-heading { margin-bottom: 12px; }
.install-panel .section-description { margin-top: 8px; }
.logout-form { border-top: 1px solid var(--border); padding-top: 24px; }
.logout-form .text-button { color: var(--muted); }

.profile-heading { position: relative; isolation: isolate; overflow: hidden; padding: 28px; border: 1px solid #303b52; border-radius: var(--radius); background: linear-gradient(110deg, #202b41, #151c2c); }
.profile-heading::after { position: absolute; z-index: -1; inset: 0; content: ""; background: url("session-plates.548a2533ad88.svg") no-repeat right bottom / 235px auto; opacity: .55; }
.profile-identity { display: flex; align-items: flex-start; gap: 18px; margin-bottom: 18px; }
.profile-identity > div { min-width: 0; }
.profile-identity .eyebrow { color: var(--accent); margin: 0 0 5px; }
.profile-avatar { display: grid; place-items: center; flex: none; width: 64px; height: 64px; border: 1px solid #f4bb8366; border-radius: 20px; background: #f4bb8312; color: var(--accent); font-family: "Barlow Condensed", Manrope, sans-serif; font-size: 32px; font-weight: 600; }
.profile-goal { max-width: 72%; color: var(--text); font-size: 1.125rem; font-weight: 600; }
.profile-time { display: inline-block; margin-top: 9px; color: var(--muted); font-size: .875rem; }
.profile-editor { display: grid; gap: 24px; margin-bottom: 34px; }
.profile-card { padding: 28px; margin-bottom: 24px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.profile-editor .profile-card { margin: 0; }
.profile-card-heading { display: flex; align-items: center; gap: 14px; margin-bottom: 26px; }
.profile-card-heading h2 { font-size: 1.375rem; }
.profile-card-heading p { margin-top: 4px; color: var(--muted); font-size: .875rem; }
.profile-section-icon { display: grid; place-items: center; flex: none; width: 44px; height: 44px; border: 1px solid #f4bb833d; border-radius: 13px; background: #f4bb8308; color: var(--accent); }
.profile-section-icon svg { width: 24px; height: 24px; }
.profile-card .stack-form { margin: 0; }
.profile-card .button { max-width: 100%; overflow-wrap: anywhere; }
.profile-card .account-actions form { min-width: 0; max-width: 100%; }
.profile-exercise-group { min-width: 0; margin: 0; padding: 0; border: 0; }
.profile-exercise-group + .profile-exercise-group { margin-top: 28px; padding-top: 26px; border-top: 1px solid var(--border); }
.profile-exercise-group legend { padding: 0; font-size: 1.125rem; font-weight: 650; }
.profile-exercise-group .field-help { margin: 4px 0 16px; }
.exercise-picker-selected { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.exercise-chip { display: inline-flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; max-width: 100%; padding: 8px 12px; border: 1px solid #f4bb8355; border-radius: 9px; background: #f4bb830c; color: var(--accent); font-size: .875rem; text-align: left; }
.exercise-chip > span:first-child { overflow-wrap: anywhere; }
.exercise-chip > span:last-child { flex: none; font-size: 1.25rem; line-height: 1; }
.exercise-chip:hover { background: #f4bb831c; }
.exercise-picker-search { position: relative; margin-bottom: 10px; }
.exercise-picker-search > svg { position: absolute; top: 50%; left: 14px; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.exercise-picker-search input { display: block; width: 100%; min-height: 50px; padding: 12px 14px 12px 44px; border: 1px solid #4a566d; border-radius: 10px; background: #101724; color: var(--text); font: inherit; }
.exercise-picker-search input::placeholder { color: var(--muted); }
.exercise-picker-options { max-height: 16rem; overflow: auto; overscroll-behavior: contain; border: 1px solid var(--border); border-radius: 10px; background: #101724; scrollbar-width: thin; scrollbar-color: #535e73 #101724; }
.exercise-picker-option { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 12px 14px; cursor: pointer; font-size: 1rem; line-height: 1.5; }
.exercise-picker-option + .exercise-picker-option { border-top: 1px solid #343e5266; }
.exercise-picker-option:hover { background: var(--surface-hover); }
.exercise-picker-option:has(:checked) { background: #f4bb8310; }
.exercise-picker-option input { flex: none; width: 20px; height: 20px; margin: 0; accent-color: var(--accent); }
.exercise-picker-option span { overflow-wrap: anywhere; }
.is-excluded .exercise-chip { color: var(--danger); border-color: #ffb5ad50; background: #ffb5ad08; }
.is-excluded .exercise-picker-option:has(:checked) { background: #ffb5ad0a; }
.is-excluded .exercise-picker-option input { accent-color: var(--danger); }
.picker-empty { padding: 16px; color: var(--muted); font-size: .875rem; }
.picker-count { margin-top: 8px; color: var(--muted); font-size: .875rem; }
.profile-save .button { min-width: 220px; }
.profile-card-summary { display: flex; align-items: center; gap: 14px; min-height: 52px; }
.profile-card-summary > :nth-child(2) { min-width: 0; flex: 1; }
.profile-card-summary .disclosure-icon { margin-left: auto; }
.profile-settings-status { display: block; color: var(--muted); font-size: .875rem; margin-top: 5px; }
.profile-settings .profile-section-icon { color: var(--info); border-color: #aab9f23d; background: #aab9f208; }
.profile-card-body { margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--border); }
.profile-card-body .connection-heading { flex-wrap: wrap; }
.profile-logout { margin-top: 24px; padding-top: 12px; border-top: 1px solid var(--border); }
.profile-logout .text-button { color: var(--muted); }
.profile-card.install-panel .profile-card-heading { margin-bottom: 12px; }

@media (max-width: 600px) {
  .profile-heading, .profile-card { padding: 22px 18px; }
  .profile-identity { gap: 14px; }
  .profile-avatar { width: 52px; height: 52px; border-radius: 16px; }
  .profile-heading h1 { font-size: 3rem; }
  .profile-heading::after { background-size: 190px auto; opacity: .4; }
  .profile-goal { font-size: 1rem; }
  .profile-card-heading { gap: 12px; }
  .profile-card-heading h2 { font-size: 1.25rem; }
  .profile-card-summary { gap: 12px; }
  .profile-card-summary .summary-title { font-size: 1rem; }
  .profile-save .button { width: 100%; }
  .exercise-picker-option { padding: 12px; }
}

.insight-coverage { padding: 24px; border: 1px solid var(--border); background: var(--surface); border-radius: var(--radius); margin-bottom: 24px; }
.insight-coverage h2 { font-size: 1.125rem; }
.insight-coverage .eyebrow { margin: 0 0 10px; color: var(--info); }
.insight-coverage > p { margin-top: 10px; color: var(--muted); }
.insight-coverage .coverage-action { color: var(--text); }
.insight-coverage.is-ready { border: 0; border-left: 2px solid var(--info); background: transparent; border-radius: 0; padding: 2px 0 2px 20px; margin-bottom: 30px; }
.insight-actions { display: flex; flex-wrap: wrap; gap: 0 24px; border-top: 1px solid var(--border); margin-top: 8px; padding-top: 8px; }
.insight-actions a + a { color: var(--muted); }
.insights-list { display: grid; gap: 16px; }
.insight-item { --insight-accent: var(--info); padding: 26px; border: 1px solid var(--border); border-top: 3px solid var(--insight-accent); border-radius: var(--radius); background: var(--surface); }
.insight-item[data-kind="attention"], .insight-item[data-kind="load_check"] { --insight-accent: var(--accent); }
.insight-item[data-kind="preference"] { --insight-accent: var(--success); }
.insight-item .eyebrow { margin-bottom: 12px; color: var(--insight-accent); }
.insight-category { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.insight-category .eyebrow { margin: 0; }
.insight-icon { display: grid; place-items: center; flex: none; width: 2.5rem; height: 2.5rem; border: 1px solid var(--border); border-radius: 12px; background: #0f1623; color: var(--insight-accent); }
.insight-icon svg { width: 1.375rem; height: 1.375rem; }
.insight-exercise { color: var(--muted); font-size: .875rem; margin-bottom: 8px; }
.insight-item h2 { font-size: 1.3125rem; }
.insight-summary { color: var(--muted); margin-top: 12px; }
.insight-action { display: flex; gap: 12px; margin-top: 20px; padding: 16px 18px; background: #0f1623; border-radius: 10px; }
.insight-action strong { display: block; font-size: .875rem; color: var(--insight-accent); margin-bottom: 5px; }
.action-arrow { color: var(--insight-accent); font-size: 1.375rem; line-height: 1.4; }
.insight-evidence { border-top: 0; margin-top: 12px; }
.insight-evidence > summary { padding: 8px 0; min-height: 44px; }
.insight-evidence .disclosure-icon { margin-left: auto; font-size: 1.25rem; }
.insight-evidence ul { color: var(--muted); font-size: 0.875rem; line-height: 1.8; margin: 12px 0 0; padding-left: 20px; }
.insight-evidence li + li { margin-top: 8px; }
.insights-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; border-top: 1px solid var(--border); padding-top: 28px; }
.insights-footer > div > p:first-child { font-size: 1rem; }
.app-status { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 24px; padding: 14px 0 28px; border-top: 1px solid var(--border); color: var(--muted); font-size: .875rem; }
.history-status { min-width: 0; }
.history-status-details { position: relative; width: fit-content; max-width: 100%; }
.history-status-details > summary { display: flex; align-items: center; gap: 10px; min-height: 44px; border-radius: 6px; }
.history-status[data-state="updating"] .status-dot { background: var(--info); }
.history-status[data-state="stale"] .status-dot { background: var(--accent); }
.history-status[data-state="error"] .status-dot { background: var(--danger); }
.history-status-tooltip { position: absolute; z-index: 10; bottom: calc(100% + 8px); left: 0; width: min(320px, calc(100vw - 64px)); padding: 14px 16px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text); box-shadow: 0 8px 28px #0004; }
.history-status-tooltip p + p { margin-top: 6px; color: var(--muted); }

.login-layout { max-width: 460px; margin: 12px auto 0; }
.login-art { width: 100%; height: 146px; object-fit: contain; margin-bottom: 20px; }
.login-layout .page-heading { margin-bottom: 28px; }
.login-layout h1 { font-size: 3rem; }
.login-form-panel { padding: 26px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: 0 24px 48px #0002; }
.login-layout .stack-form { margin: 0; }
.login-note { margin-top: 24px; color: var(--muted); font-size: 0.875rem; }
.offline-page { max-width: 520px; margin: 0 auto; padding: 80px 28px; }
.offline-page .offline-art { width: 100%; height: 150px; object-fit: contain; margin-bottom: 32px; }
.offline-page > img { margin-bottom: 32px; }
.offline-page > p { margin-top: 18px; color: var(--muted); }
.offline-page .button { margin-top: 28px; }
.update-prompt { position: fixed; z-index: 20; bottom: 24px; left: 50%; transform: translateX(-50%); width: 700px; max-width: calc(100vw - 32px); display: flex; align-items: center; gap: 18px; padding: 20px; box-shadow: 0 8px 32px #0006; }
.update-prompt p { color: var(--muted); font-size: 0.875rem; margin-top: 4px; }
.update-prompt .button { margin-left: auto; white-space: nowrap; }
.update-prompt .icon-button { margin-left: -8px; }

@media (max-width: 760px) {
  .app-shell { padding: 0 22px; }
  .app-header { min-height: 68px; gap: 12px; flex-wrap: wrap; }
  .page-navigation { gap: 0; padding: 2px; }
  .page-navigation a { justify-content: center; padding-inline: 12px; }
  .main-content { padding: 24px 0 32px; }
  .insight-actions { flex-direction: column; align-items: stretch; }
  h1 { font-size: 3rem; }
  h2 { font-size: 1.3125rem; }
  .page-heading { margin-bottom: 26px; }
  .page-description { font-size: 1rem; margin-top: 10px; }
  .workout-overview { padding: 22px 20px; }
  .training-facts { gap: 16px 28px; }
  .workout-meta { gap: 10px 12px; }
  .workout-meta time { margin-left: auto; }
  .workout-summary { margin-top: 18px; }
  .workout-actions { gap: 10px; }
  .workout-actions form { flex: 1 1 auto; }
  .workout-actions form .button { width: 100%; }
  .workout-actions > .button { flex: 1 1 auto; }
  .exercise-row > summary { padding: 17px 16px; gap: 12px; min-height: 90px; }
  .exercise-number { min-width: 2.125rem; min-height: 2.125rem; border-radius: 10px; font-size: 1.25rem; }
  .exercise-name { font-size: 1.0625rem; }
  .exercise-content { padding: 20px 16px; }
  .sets-table th, .sets-table td { padding-top: 11px; padding-bottom: 11px; }
  .set-index { margin-left: 5px; }
  .section-disclosure > summary { gap: 12px; }
  .section-disclosure.refinement { padding: 0 18px; }
  .refinement-controls { grid-template-columns: minmax(0, 1fr); gap: 10px; justify-content: stretch; }
  .refinement-controls .form-actions { grid-column: 1; grid-row: 4; margin-top: 8px; }
  .summary-title { font-size: 1.0625rem; }
  .mode-choices { grid-template-columns: 1fr; gap: 10px; }
  .mode-option { padding: 15px; }
  .generation-section { padding: 22px 20px; }
  .form-actions { align-items: stretch; gap: 14px; }
  .form-actions .button { width: 100%; }
  .form-actions .form-note { flex-basis: 100%; }
  .page-section { padding: 28px 0; }
  .connection-heading { align-items: baseline; }
  .connection-state { max-width: 65%; }
  .account-actions { display: grid; gap: 10px; }
  .account-actions .button { width: 100%; }
  .message-meta { flex-wrap: wrap; gap: 4px 12px; }
  .insight-coverage { padding: 20px; }
  .insight-item { padding: 22px 20px; }
  .insight-action { padding: 14px; }
  .insight-item h2 { font-size: 1.25rem; }
  .insights-footer { align-items: stretch; }
  .insights-footer form, .insights-footer .button { width: 100%; }
  .login-layout { margin: 0 auto; }
  .login-art { height: 116px; margin-bottom: 12px; }
  .login-form-panel { padding: 22px 20px; }
  .update-prompt { flex-wrap: wrap; bottom: 16px; padding: 18px; gap: 12px; }
  .update-prompt > div { width: calc(100% - 32px); }
  .update-prompt .button { margin-left: 0; }
  .update-prompt .icon-button { position: absolute; right: 6px; top: 6px; margin: 0; }
}

@media (max-width: 359px) {
  .app-shell { padding: 0 16px; }
  .workout-overview, .generation-section, .insight-item, .login-form-panel { padding-left: 16px; padding-right: 16px; }
  .exercise-row > summary { padding-left: 12px; padding-right: 12px; gap: 10px; }
  .exercise-content { padding-left: 12px; padding-right: 12px; }
  .sets-table { font-size: 1rem; }
  .set-index { display: none; }
  .connection-heading { flex-wrap: wrap; gap: 7px; }
  .connection-state { max-width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .activity-indicator { border-color: var(--accent); opacity: .7; }
}

.proposal-back { display: inline-flex; gap: 10px; margin-bottom: 28px; }
.previous-heading { padding: 24px 0; border-bottom: 1px dashed var(--border); }
.previous-heading .eyebrow { color: var(--muted); }
.previous-proposal-page .workout-overview { border-top: 1px solid var(--border); box-shadow: none; }
.previous-proposal-page .tag { background: transparent; color: var(--muted); border: 1px solid var(--border); }
.refinement-reply { margin-bottom: 22px; padding-left: 18px; border-left: 2px solid var(--accent); }
.refinement-reply p + p { margin-top: 12px; }
.insight-link { gap: 8px; }
.insight-empty .insight-link { margin-top: 8px; }
.insight-empty { padding: 20px 0 0; border-top: 1px solid var(--border); }
.insight-empty h2 { font-size: 1.25rem; margin-bottom: 10px; }
.insight-empty p { color: var(--muted); }
