:root {
  --ink: #171915;
  --ink-2: #242720;
  --paper: #f4f2eb;
  --surface: #fffef9;
  --line: #d9d8cf;
  --line-dark: #b9bbb0;
  --muted: #70736a;
  --quiet: #989b91;
  --acid: #c9f64b;
  --acid-dark: #789b17;
  --orange: #f17842;
  --orange-soft: #fbe3d8;
  --red: #b34e42;
  --red-soft: #f5dcd8;
  --green: #477253;
  --green-soft: #dcebdd;
  --shadow: 0 22px 70px rgba(23, 25, 21, .1);
  --radius: 22px;
  --sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --display: Georgia, "Times New Roman", serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 85% -5%, rgba(201, 246, 75, .2), transparent 28rem),
    var(--paper);
  font-family: var(--sans);
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button, a { -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.2rem;
  background:
    linear-gradient(125deg, transparent 55%, rgba(201, 246, 75, .12) 55%),
    var(--ink);
}
.login-card {
  width: min(500px, 100%);
  color: var(--paper);
  padding: clamp(1.4rem, 5vw, 3.5rem);
}
.login-home {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  color: var(--ink);
  background: var(--acid);
  border-radius: 50%;
  text-decoration: none;
  font-family: var(--display);
  font-size: 1.3rem;
  margin-bottom: 4rem;
}
.kicker {
  margin: 0 0 .8rem;
  color: var(--acid-dark);
  font-family: var(--mono);
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .14em;
}
.login-card .kicker { color: var(--acid); }
.login-card h1, .setup-intro h1 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(2.8rem, 9vw, 5rem);
  font-weight: 400;
  line-height: .95;
  letter-spacing: -.045em;
}
.login-copy {
  color: #adb1a6;
  line-height: 1.65;
  max-width: 28rem;
  margin: 1.5rem 0 2.3rem;
}
.field-label {
  display: block;
  margin: 0 0 .45rem;
  color: var(--quiet);
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .09em;
}
.text-input {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line-dark);
  border-radius: 12px;
  padding: .75rem .85rem;
  color: var(--ink);
  background: var(--surface);
  outline: none;
}
.text-input:focus { border-color: var(--acid-dark); box-shadow: 0 0 0 3px rgba(201, 246, 75, .18); }
.login-card .text-input { border-color: #454940; color: white; background: #20231d; }

.button {
  border: 0;
  border-radius: 12px;
  min-height: 46px;
  padding: .75rem 1rem;
  font-weight: 700;
  transition: transform .12s, filter .15s, background .15s;
}
.button:hover { filter: brightness(1.03); }
.button:active { transform: translateY(1px); }
.button:disabled { opacity: .45; cursor: not-allowed; }
.button-primary { color: var(--ink); background: var(--acid); }
.button-dark { color: white; background: var(--ink); }
.button-quiet { color: var(--ink); border: 1px solid var(--line); background: transparent; }
.button-danger { color: var(--red); background: var(--red-soft); }
.button-wide { width: 100%; margin-top: .75rem; }
.button-large { min-height: 60px; padding: 1rem 1.25rem; display: flex; justify-content: space-between; align-items: center; width: 100%; font-size: 1rem; }
.form-error { min-height: 1.2rem; margin: .7rem 0 0; color: #f59d8e; font-size: .82rem; }

.topbar {
  height: 72px;
  padding: 0 max(1rem, calc((100% - 1180px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid rgba(112, 115, 106, .18);
  background: rgba(244, 242, 235, .86);
  backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  z-index: 30;
}
.brand { display: flex; align-items: center; gap: .75rem; color: inherit; text-decoration: none; }
.brand-mark { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; color: var(--ink); background: var(--acid); font-family: var(--display); }
.brand strong, .brand small { display: block; }
.brand strong { font-family: var(--display); font-size: 1.05rem; font-weight: 500; }
.brand small { margin-top: .08rem; color: var(--muted); font-size: .65rem; }
.topbar-actions { display: flex; align-items: center; gap: .8rem; }
.sync-state { display: flex; align-items: center; gap: .38rem; color: var(--muted); font-family: var(--mono); font-size: .65rem; }
.sync-state i { width: 6px; height: 6px; border-radius: 50%; background: var(--green); }
.sync-state.saving i { background: var(--orange); animation: pulse 1s infinite; }
.sync-state.error i { background: var(--red); }
@keyframes pulse { 50% { opacity: .35; } }
.icon-button { border: 0; color: var(--muted); background: transparent; padding: .5rem; }

.setup-shell {
  width: min(1080px, calc(100% - 2rem));
  margin: 0 auto;
  padding: clamp(3rem, 7vw, 7rem) 0 6rem;
  display: grid;
  grid-template-columns: .85fr 1.15fr;
  gap: clamp(2rem, 7vw, 7rem);
  align-items: start;
}
.setup-intro { position: sticky; top: 120px; }
.setup-intro h1 { font-size: clamp(2.6rem, 5vw, 4.3rem); }
.setup-intro > p:last-child { color: var(--muted); line-height: 1.7; max-width: 30rem; }
.setup-form { min-width: 0; }
.setup-block { margin: 0 0 1.1rem; padding: 1.3rem; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(255, 254, 249, .72); }
.setup-block legend { padding: 0 .3rem; font-family: var(--display); font-size: 1.25rem; }
.setup-block legend span { color: var(--quiet); font-family: var(--mono); font-size: .65rem; margin-right: .45rem; }
.setup-block > p { color: var(--muted); font-size: .82rem; line-height: 1.55; margin: .25rem 0 1rem; }
.setup-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.setup-block.compact { min-width: 0; }
.choice-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: .55rem; }
.choice { min-height: 50px; border: 1px solid var(--line); border-radius: 11px; color: var(--ink); background: var(--surface); font-family: var(--display); font-size: 1.2rem; }
.choice.active { border-color: var(--ink); color: white; background: var(--ink); }
.option-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; }
.option-card { min-height: 128px; padding: .9rem; text-align: left; border: 1px solid var(--line); border-radius: 13px; color: var(--ink); background: var(--surface); }
.option-card strong, .option-card small { display: block; }
.option-card strong { font-family: var(--display); font-size: 1.05rem; font-weight: 500; }
.option-card small { color: var(--muted); font-size: .72rem; line-height: 1.45; margin-top: .55rem; }
.option-card.active { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.option-card.active::after { content: "Scelto"; display: inline-block; color: var(--acid-dark); margin-top: .7rem; font-family: var(--mono); font-size: .6rem; text-transform: uppercase; }
.muscle-legend { display: flex; gap: 1rem; margin-bottom: .75rem; color: var(--muted); font-size: .7rem; }
.muscle-legend span { display: flex; align-items: center; gap: .35rem; }
.muscle-legend i { width: 8px; height: 8px; border-radius: 50%; }
.focus-dot { background: var(--acid-dark); }
.exclude-dot { background: var(--red); }
.muscle-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .45rem; }
.muscle-chip { min-height: 42px; padding: .6rem .7rem; text-align: left; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: var(--surface); font-size: .8rem; }
.muscle-chip[data-state="focus"] { border-color: var(--acid-dark); background: rgba(201, 246, 75, .22); }
.muscle-chip[data-state="focus"]::after { content: "Focus"; float: right; color: var(--acid-dark); font-family: var(--mono); font-size: .58rem; text-transform: uppercase; }
.muscle-chip[data-state="excluded"] { color: var(--red); border-color: #e2b6b0; background: var(--red-soft); text-decoration: line-through; }

.builder-shell { width: min(1180px, calc(100% - 2rem)); margin: 0 auto; padding: clamp(2rem, 5vw, 4rem) 0 6rem; }
.builder-header { display: flex; justify-content: space-between; align-items: end; gap: 1.5rem; margin-bottom: 1.4rem; }
.builder-header h1 { margin: 0; font-family: var(--display); font-size: clamp(2.6rem, 6vw, 4.8rem); font-weight: 400; line-height: .98; letter-spacing: -.045em; }
.builder-header > div > p:last-child { max-width: 42rem; margin: 1rem 0 0; color: var(--muted); line-height: 1.6; }
.routine-name-field { max-width: 620px; margin: 2rem 0 1rem; }
.routine-name-field label { display: block; margin-bottom: .4rem; color: var(--quiet); font-family: var(--mono); font-size: .62rem; text-transform: uppercase; letter-spacing: .08em; }
.routine-name-field .text-input { min-height: 58px; font-family: var(--display); font-size: 1.25rem; }
.routine-method-card { margin: 1rem 0 1.4rem; padding: 1rem; border-radius: 18px; color: white; background: var(--ink); }
.routine-method-heading { display: flex; align-items: end; justify-content: space-between; gap: 1rem; }
.routine-method-heading span { color: var(--acid); font-family: var(--mono); font-size: .56rem; text-transform: uppercase; letter-spacing: .07em; }
.routine-method-heading h2 { margin: .25rem 0 0; font-family: var(--display); font-size: 1.55rem; font-weight: 500; }
.routine-method-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)); gap: .55rem; margin-top: 1rem; }
.routine-method-grid label { color: #b5b9ae; font-size: .6rem; }
.routine-method-grid .text-input { width: 100%; min-height: 43px; margin-top: .3rem; border-color: #474c42; color: white; background: #242720; }
.routine-method-grid small { display: block; margin-top: .25rem; color: #797e72; font-size: .54rem; }
.routine-method-card > p { margin: .85rem 0 0; color: #aeb2a6; font-size: .66rem; line-height: 1.5; }
.routine-targets-card { margin: 1rem 0 1.4rem; padding: 1rem; border: 1px solid var(--line); border-radius: 18px; background: rgba(255,254,249,.78); }
.routine-targets-heading { display: flex; align-items: end; justify-content: space-between; gap: 1rem; }
.routine-targets-heading span { color: var(--acid-dark); font-family: var(--mono); font-size: .56rem; text-transform: uppercase; letter-spacing: .07em; }
.routine-targets-heading h2 { margin: .25rem 0 0; font-family: var(--display); font-size: 1.45rem; font-weight: 500; }
.routine-targets-heading p { max-width: 31rem; margin: 0; color: var(--muted); font-size: .68rem; line-height: 1.5; text-align: right; }
.routine-targets-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: .5rem; margin-top: .9rem; }
.routine-target-field { padding: .65rem; border: 1px solid var(--line); border-radius: 12px; background: white; }
.routine-target-field > span { display: flex; align-items: baseline; justify-content: space-between; gap: .35rem; }
.routine-target-field strong { font-family: var(--display); font-size: .9rem; font-weight: 500; }
.routine-target-field small { color: var(--quiet); font-size: .54rem; white-space: nowrap; }
.routine-target-field > div { display: flex; align-items: center; gap: .3rem; margin-top: .5rem; border-bottom: 1px solid var(--line-dark); }
.routine-target-field input { min-width: 0; width: 100%; padding: .25rem 0; border: 0; outline: 0; color: var(--ink); background: transparent; font-family: var(--display); font-size: 1.25rem; }
.routine-target-field em { color: var(--quiet); font-size: .56rem; font-style: normal; }
.routine-targets-note { margin: .7rem 0 0; color: var(--quiet); font-size: .6rem; }
.routine-days { display: grid; gap: 1rem; }
.routine-day-card { overflow: hidden; border: 1px solid var(--line); border-radius: 22px; background: rgba(255,254,249,.78); }
.routine-day-header { display: grid; grid-template-columns: 42px minmax(180px, 1fr) auto; gap: .7rem; align-items: center; padding: .9rem 1rem; color: white; background: var(--ink); }
.routine-day-header > span { color: var(--acid); font-family: var(--mono); font-size: .7rem; }
.routine-day-header > input { min-width: 0; border: 0; border-bottom: 1px solid #4d5148; padding: .35rem 0; outline: none; color: white; background: transparent; font-family: var(--display); font-size: 1.35rem; }
.routine-day-actions, .exercise-editor-actions { display: flex; gap: .3rem; }
.rest-after-field { display: flex; align-items: center; gap: .35rem; margin-right: .35rem; color: #aeb2a6; font-family: var(--mono); font-size: .52rem; white-space: nowrap; text-transform: uppercase; }
.rest-after-field select { width: 38px; height: 32px; border: 1px solid #4d5148; border-radius: 7px; color: white; background: #242720; text-align: center; }
.routine-day-peak { align-self: center; margin-right: .25rem; color: #aeb2a6; font-family: var(--mono); font-size: .55rem; white-space: nowrap; text-transform: uppercase; }
.routine-day-peak.high { color: #ff9d8c; }
.routine-day-actions button, .exercise-editor-actions button { width: 34px; height: 34px; border: 1px solid #4d5148; border-radius: 8px; color: #d5d8cf; background: transparent; }
.routine-day-actions button:disabled, .exercise-editor-actions button:disabled, .add-day-button:disabled { opacity: .3; cursor: not-allowed; }
.routine-exercises { padding: 0 1rem; }
.routine-exercise-editor { padding: 1rem 0; border-bottom: 1px solid var(--line); }
.routine-exercise-top { display: grid; grid-template-columns: 28px minmax(140px, .55fr) minmax(220px, 1fr) auto; gap: .65rem; align-items: end; }
.drag-index { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; color: var(--muted); background: #e9e8e0; font-family: var(--mono); font-size: .62rem; }
.exercise-choice { min-width: 0; }
.exercise-filter-field { display: block; min-width: 0; color: var(--quiet); font-size: .6rem; }
.exercise-filter-field > span { display: block; margin-bottom: .28rem; }
.exercise-filter-field .text-input { width: 100%; min-height: 44px; padding: .5rem; border-radius: 9px; }
.exercise-editor-actions button { color: var(--muted); border-color: var(--line); background: white; }
.custom-name { margin: .75rem 0 0 2.65rem; }
.custom-name label, .exercise-prescription-grid label { display: block; color: var(--quiet); font-size: .6rem; }
.custom-name label { margin-bottom: .25rem; }
.exercise-prescription-grid { display: grid; grid-template-columns: repeat(6, minmax(82px, 1fr)); gap: .55rem; margin: .8rem 0 0 2.65rem; }
.exercise-prescription-grid .text-input { min-height: 42px; margin-top: .28rem; padding: .5rem; border-radius: 9px; }
.exercise-method-note { margin: .75rem 0 0 2.65rem; padding: .65rem .75rem; border-left: 3px solid var(--acid); color: var(--muted); background: rgba(201,246,75,.08); font-size: .62rem; line-height: 1.5; }
.exercise-method-note p { margin: 0; }
.exercise-method-note span { display: block; margin-top: .25rem; color: var(--quiet); }
.exercise-method-note strong { color: var(--ink); font-weight: 600; }
.secondary-muscles { margin: .9rem 0 0 2.65rem; }
.secondary-muscles > span { display: block; margin-bottom: .4rem; color: var(--quiet); font-size: .62rem; }
.secondary-muscles > div { display: flex; flex-wrap: wrap; gap: .35rem; }
.secondary-muscles button { padding: .35rem .5rem; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: white; font-size: .62rem; }
.secondary-muscles button.active { color: var(--ink); border-color: var(--acid-dark); background: rgba(201,246,75,.25); }
.routine-empty { padding: 1.3rem 0; color: var(--muted); text-align: center; font-size: .75rem; }
.add-exercise-button, .add-day-button { border: 1px dashed var(--line-dark); border-radius: 12px; color: var(--muted); background: transparent; }
.add-exercise-button { width: calc(100% - 2rem); min-height: 42px; margin: .7rem 1rem 1rem; }
.add-day-button { width: 100%; min-height: 50px; margin-top: 1rem; }
.builder-volume-summary { margin-top: 2rem; }
.builder-save { max-width: 680px; margin: 1.4rem auto 0; text-align: center; }
.builder-save > p:first-child { color: var(--muted); font-size: .75rem; }

.page-shell { width: min(1180px, calc(100% - 2rem)); margin: 0 auto; padding: 1.2rem 0 6rem; }
.tabs { display: flex; gap: .25rem; overflow-x: auto; scrollbar-width: none; padding: .2rem 0 1.1rem; position: sticky; top: 72px; z-index: 20; background: linear-gradient(var(--paper) 78%, transparent); }
.tabs::-webkit-scrollbar { display: none; }
.tab { white-space: nowrap; border: 0; border-radius: 999px; padding: .6rem .9rem; color: var(--muted); background: transparent; font-size: .82rem; }
.tab.active { color: var(--ink); background: var(--surface); box-shadow: 0 4px 18px rgba(23,25,21,.06); }
.tab-panel { min-height: 65vh; }

.workout-picker { margin: .25rem 0 1rem; padding: 1rem; border: 1px solid var(--line); border-radius: 20px; background: rgba(255,254,249,.72); }
.workout-picker-heading { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: .8rem; }
.workout-picker-heading span { color: var(--acid-dark); font-family: var(--mono); font-size: .58rem; text-transform: uppercase; letter-spacing: .1em; }
.workout-picker-heading h2 { margin: .25rem 0 0; font-family: var(--display); font-size: 1.55rem; font-weight: 400; }
.workout-picker-heading p { max-width: 30rem; margin: 0; color: var(--muted); font-size: .7rem; line-height: 1.5; text-align: right; }
.workout-picker-heading p strong { color: var(--ink); }
.workout-day-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)); gap: .55rem; }
.workout-day-option { min-width: 0; padding: .75rem; border: 1px solid var(--line); border-radius: 13px; color: var(--ink); background: white; text-align: left; }
.workout-day-option:hover { border-color: var(--line-dark); }
.workout-day-option.selected { border-color: var(--acid-dark); background: rgba(201,246,75,.2); box-shadow: inset 0 0 0 1px var(--acid-dark); }
.workout-day-option span, .workout-day-option strong, .workout-day-option small { display: block; }
.workout-day-option span { color: var(--quiet); font-family: var(--mono); font-size: .52rem; text-transform: uppercase; }
.workout-day-option strong { margin-top: .3rem; overflow-wrap: anywhere; font-family: var(--display); font-size: 1.05rem; font-weight: 500; }
.workout-day-option small { margin-top: .25rem; color: var(--muted); font-size: .6rem; }

.workout-hero { display: grid; grid-template-columns: 1.4fr .6fr; border-radius: 28px; overflow: hidden; background: var(--ink); color: white; }
.workout-hero-main { padding: clamp(1.5rem, 5vw, 4rem); }
.workout-hero-side { padding: clamp(1.5rem, 4vw, 2.5rem); display: flex; flex-direction: column; justify-content: space-between; color: var(--ink); background: var(--acid); }
.hero-index { color: var(--acid); font-family: var(--mono); font-size: .7rem; text-transform: uppercase; letter-spacing: .14em; }
.workout-hero h1 { margin: 1.1rem 0 0; font-family: var(--display); font-size: clamp(3rem, 8vw, 6.2rem); line-height: .92; font-weight: 400; letter-spacing: -.055em; }
.workout-meta { display: flex; flex-wrap: wrap; gap: 1.2rem; margin-top: 1.7rem; color: #acb0a5; font-size: .78rem; }
.workout-meta strong { color: white; }
.side-label { font-family: var(--mono); font-size: .62rem; text-transform: uppercase; letter-spacing: .1em; }
.side-value { font-family: var(--display); font-size: clamp(1.8rem, 4vw, 3rem); line-height: 1; margin-top: .5rem; }
.start-form { margin-top: 2rem; }
.start-form label { display: block; font-size: .68rem; margin-bottom: .4rem; }
.weight-entry { display: flex; align-items: center; border-bottom: 1px solid rgba(23,25,21,.35); }
.weight-entry input { width: 100%; border: 0; padding: .45rem 0; outline: 0; color: var(--ink); background: transparent; font-family: var(--display); font-size: 1.6rem; }
.weight-entry span { font-size: .75rem; }
.start-form .button { width: 100%; margin-top: 1rem; background: var(--ink); color: white; }

.section-head { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin: 3rem 0 1rem; }
.section-head h2 { margin: 0; font-family: var(--display); font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 400; letter-spacing: -.03em; }
.section-head p { margin: .3rem 0 0; color: var(--muted); font-size: .8rem; }
.exercise-preview { border-top: 1px solid var(--line); }
.preview-row { display: grid; grid-template-columns: 42px minmax(180px, 1.5fr) .7fr .55fr 1.3fr; gap: 1rem; align-items: center; padding: 1rem .2rem; border-bottom: 1px solid var(--line); }
.exercise-number { color: var(--quiet); font-family: var(--mono); font-size: .68rem; }
.exercise-title strong, .exercise-title small { display: block; }
.exercise-title strong { font-family: var(--display); font-size: 1.05rem; font-weight: 500; }
.exercise-title small { color: var(--muted); font-size: .68rem; margin-top: .2rem; }
.preview-stat span { display: block; color: var(--quiet); font-family: var(--mono); font-size: .58rem; text-transform: uppercase; }
.preview-stat strong { display: block; margin-top: .2rem; font-weight: 600; font-size: .8rem; }
.recommendation { color: var(--muted); font-size: .72rem; line-height: 1.45; }
.recommendation b { color: var(--ink); }

.active-head { padding: 1.1rem 1.25rem; border-radius: 18px; display: flex; align-items: center; justify-content: space-between; gap: 1rem; color: white; background: var(--ink); position: sticky; top: 128px; z-index: 15; box-shadow: var(--shadow); }
.active-head small, .active-head strong { display: block; }
.active-head small { color: var(--acid); font-family: var(--mono); font-size: .6rem; text-transform: uppercase; letter-spacing: .1em; }
.active-head strong { margin-top: .2rem; font-family: var(--display); font-size: 1.25rem; font-weight: 400; }
.active-head-actions { display: flex; align-items: center; gap: .85rem; }
.active-progress { text-align: right; }
.active-progress span { display: block; color: #aeb1a7; font-size: .65rem; }
.active-progress b { font-family: var(--mono); font-size: .9rem; }
.active-empty-button { min-height: 34px; padding: .4rem .65rem; border: 1px solid #745248; border-radius: 9px; color: #ffd6ca; background: #3b2822; font-size: .65rem; font-weight: 700; }
.active-empty-button:hover { background: #4b3028; }
.exercise-log-list { display: grid; gap: .85rem; margin-top: 1rem; }
.exercise-card { border: 1px solid var(--line); border-radius: 20px; background: rgba(255,254,249,.8); overflow: hidden; }
.exercise-card-head { display: grid; grid-template-columns: 1fr auto; gap: 1rem; padding: 1.2rem; border-bottom: 1px solid var(--line); }
.exercise-card-head h2 { margin: 0; font-family: var(--display); font-weight: 500; font-size: 1.35rem; }
.exercise-card-head p { margin: .3rem 0 0; color: var(--muted); font-size: .7rem; }
.exercise-target { text-align: right; }
.exercise-target strong { display: block; font-family: var(--display); font-size: 1.1rem; }
.exercise-target span { color: var(--quiet); font-size: .63rem; }
.set-adjuster { display: grid; grid-template-columns: 34px 36px 34px; justify-content: end; align-items: center; gap: .3rem; margin: -.25rem 0 .25rem; }
.set-adjuster button { display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); background: white; font-size: 1.05rem; line-height: 1; }
.set-adjuster button:active:not(:disabled) { transform: translateY(1px); background: var(--acid); }
.set-adjuster button:disabled { color: var(--quiet); background: #efeee8; cursor: not-allowed; opacity: .55; }
.set-adjuster strong { text-align: center; font-size: 1.35rem; }
.exercise-guidance { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .7rem 1.2rem; color: var(--muted); background: rgba(201,246,75,.1); font-size: .7rem; line-height: 1.45; }
.exercise-guidance strong { color: var(--acid-dark); font-family: var(--mono); font-size: .58rem; font-weight: 500; white-space: nowrap; }
.set-table { padding: .4rem 1.2rem 1rem; }
.set-row { display: grid; grid-template-columns: 38px minmax(78px, .8fr) minmax(68px, .65fr) minmax(58px, .55fr) 46px; gap: .55rem; align-items: end; padding: .65rem 0; border-bottom: 1px solid rgba(217,216,207,.7); }
.set-row:last-child { border-bottom: 0; }
.set-row-head { padding: .5rem 0 .2rem; align-items: center; color: var(--quiet); font-family: var(--mono); font-size: .56rem; text-transform: uppercase; }
.set-number { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; color: var(--muted); background: #ebe9e1; font-family: var(--mono); font-size: .7rem; }
.set-row.saved .set-number { color: var(--ink); background: var(--acid); }
.set-row.historical-extra { opacity: .72; }
.set-row.historical-extra .set-number { box-shadow: inset 0 0 0 1px #b58c3c; }
.set-field label { display: none; }
.set-field input { width: 100%; height: 39px; padding: .4rem .5rem; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); background: white; text-align: center; outline: none; }
.set-field input:focus { border-color: var(--acid-dark); }
.save-set { width: 42px; height: 39px; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); background: white; }
.set-row.saved .save-set { color: var(--green); border-color: #bdd2c0; background: var(--green-soft); }
.set-row.saved .save-set.undo-set { color: #9a4c2b; border-color: #edc9b8; background: var(--orange-soft); font-size: 1rem; }
.set-row.saved .save-set.undo-set:active { transform: translateY(1px); }
.finish-card { margin-top: 1rem; padding: 1.3rem; border-radius: 20px; color: white; background: var(--ink); }
.finish-card h2 { margin: 0; font-family: var(--display); font-size: 1.7rem; font-weight: 400; }
.finish-card > p { color: #aaaea3; font-size: .76rem; }
.finish-grid { display: grid; grid-template-columns: .65fr 1.35fr; gap: 1rem; margin-top: 1rem; }
.finish-card label { display: block; color: #aaaea3; font-size: .65rem; margin-bottom: .4rem; }
.readiness { display: grid; grid-template-columns: repeat(5, 1fr); gap: .3rem; }
.readiness button { min-height: 42px; border: 1px solid #4b5046; border-radius: 9px; color: #c7cbc1; background: transparent; }
.readiness button.active { border-color: var(--acid); color: var(--ink); background: var(--acid); }
.finish-card textarea { width: 100%; min-height: 72px; border: 1px solid #4b5046; border-radius: 10px; padding: .65rem; color: white; background: #22251f; resize: vertical; outline: none; }
.finish-card .button { width: 100%; margin-top: 1rem; }
.finish-card-empty { border: 1px solid #5c4037; background: #27221e; }
.finish-card-empty .button-danger { color: #ffd8cc; background: #733e2d; }

.program-header, .progress-header { display: flex; justify-content: space-between; align-items: end; gap: 1rem; padding: 2rem 0 1.2rem; }
.program-header h1, .progress-header h1 { margin: 0; font-family: var(--display); font-size: clamp(2.6rem, 7vw, 5rem); font-weight: 400; letter-spacing: -.05em; }
.program-header p, .progress-header p { color: var(--muted); margin: .5rem 0 0; }
.volume-summary { margin: 1rem 0 2.5rem; border: 1px solid var(--line); border-radius: 24px; padding: clamp(1rem, 3vw, 1.6rem); background: rgba(255,254,249,.82); }
.volume-heading { display: flex; align-items: end; justify-content: space-between; gap: 1rem; }
.volume-heading .kicker { margin-bottom: .45rem; }
.volume-heading h2 { margin: 0; font-family: var(--display); font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 400; letter-spacing: -.03em; }
.volume-heading > p { max-width: 25rem; margin: 0; color: var(--muted); font-size: .74rem; line-height: 1.5; text-align: right; }
.balance-check { display: grid; grid-template-columns: minmax(180px, .55fr) 1.45fr; gap: 1rem; align-items: center; margin-top: 1rem; padding: .8rem 1rem; border-radius: 14px; }
.balance-check.ok { color: var(--green); background: var(--green-soft); }
.balance-check.warning { color: #8d4527; background: var(--orange-soft); }
.balance-check.target-note { color: #745819; background: #f5e8be; }
.target-check { margin-top: .55rem; }
.balance-check span, .balance-check strong { display: block; }
.balance-check span { font-family: var(--mono); font-size: .55rem; text-transform: uppercase; letter-spacing: .06em; opacity: .75; }
.balance-check strong { margin-top: .2rem; font-family: var(--display); font-size: 1.15rem; font-weight: 500; }
.balance-check p, .balance-check ul { margin: 0; font-size: .68rem; line-height: 1.5; }
.balance-check ul { display: grid; gap: .25rem; padding-left: 1rem; }
.volume-metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: .55rem; margin: 1.3rem 0; }
.volume-metric { min-height: 112px; padding: .9rem; border-radius: 14px; background: var(--ink); color: white; }
.volume-metric:first-child { background: var(--acid); color: var(--ink); }
.volume-metric span, .volume-metric small { display: block; }
.volume-metric span { color: #aeb2a6; font-family: var(--mono); font-size: .56rem; text-transform: uppercase; letter-spacing: .06em; }
.volume-metric:first-child span, .volume-metric:first-child small { color: #596a25; }
.volume-metric.metric-warning { background: var(--orange); }
.volume-metric.metric-warning span, .volume-metric.metric-warning small { color: #5d2c19; }
.volume-metric strong { display: block; margin-top: .65rem; font-family: var(--display); font-size: clamp(1.55rem, 3vw, 2.15rem); font-weight: 400; line-height: 1; }
.volume-metric small { margin-top: .35rem; color: #858a7e; font-size: .6rem; }
.muscle-volume-list { border-top: 1px solid var(--line); }
.muscle-volume-head, .muscle-volume-row { display: grid; grid-template-columns: minmax(120px, .8fr) minmax(120px, 1.2fr) 112px 52px 88px 108px; gap: .75rem; align-items: center; }
.muscle-volume-head { padding: .7rem .2rem .45rem; color: var(--quiet); font-family: var(--mono); font-size: .54rem; text-transform: uppercase; letter-spacing: .05em; }
.muscle-volume-head span:nth-child(n+3):nth-child(-n+5) { text-align: right; }
.muscle-volume-row { min-height: 51px; padding: .55rem .2rem; border-top: 1px solid rgba(217,216,207,.65); }
.muscle-volume-name strong, .muscle-volume-name small { display: block; }
.muscle-volume-name strong { font-family: var(--display); font-size: 1rem; font-weight: 500; }
.muscle-volume-name small { margin-top: .1rem; color: var(--acid-dark); font-family: var(--mono); font-size: .54rem; text-transform: uppercase; }
.volume-track { height: 8px; overflow: hidden; border-radius: 99px; background: #e5e4dc; }
.volume-track span { display: block; height: 100%; border-radius: inherit; background: var(--acid-dark); }
.muscle-volume-row.status-elevated .volume-track span { background: #b58c3c; }
.muscle-volume-row.status-high .volume-track span { background: var(--orange); }
.muscle-volume-row.status-session-high .volume-track span { background: var(--red); }
.muscle-volume-row.status-low .volume-track span { background: #aa8840; }
.muscle-volume-row > b { text-align: right; font-family: var(--mono); font-size: .72rem; font-weight: 500; }
.volume-evaluation { display: grid; justify-items: end; gap: .25rem; }
.volume-status { justify-self: end; padding: .3rem .45rem; border-radius: 999px; font-family: var(--mono); font-size: .53rem; white-space: nowrap; text-transform: uppercase; }
.target-delta { color: var(--quiet); font-size: .53rem; white-space: nowrap; }
.target-delta.met { color: var(--green); }
.target-delta.under { color: #785f24; }
.target-delta.over { color: #9c4a26; }
.volume-status.in-range { color: var(--green); background: var(--green-soft); }
.volume-status.low { color: #785f24; background: #f2e8cd; }
.volume-status.elevated { color: #745819; background: #f5e8be; }
.volume-status.high { color: #9c4a26; background: var(--orange-soft); }
.volume-status.session-high { color: var(--red); background: var(--red-soft); }
.volume-status.none, .volume-status.excluded { color: var(--quiet); background: #e9e8e1; }
.muscle-volume-row.status-excluded { opacity: .62; }
.session-volume-section { margin-top: 1.2rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.session-volume-heading { display: flex; justify-content: space-between; align-items: end; gap: 1rem; }
.session-volume-heading span { color: var(--acid-dark); font-family: var(--mono); font-size: .56rem; text-transform: uppercase; letter-spacing: .06em; }
.session-volume-heading h3 { margin: .25rem 0 0; font-family: var(--display); font-size: 1.35rem; font-weight: 500; }
.session-volume-heading p { max-width: 26rem; margin: 0; color: var(--muted); font-size: .66rem; text-align: right; }
.session-volume-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .55rem; margin-top: .8rem; }
.session-volume-card { overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: white; }
.session-volume-card header { display: flex; justify-content: space-between; align-items: center; gap: .8rem; padding: .65rem .75rem; color: white; background: var(--ink); }
.session-volume-card header span { color: var(--acid); font-family: var(--mono); font-size: .55rem; text-transform: uppercase; }
.session-volume-card header strong { font-family: var(--display); font-size: .92rem; font-weight: 500; }
.session-volume-card > div { padding: .3rem .75rem .6rem; }
.session-muscle { padding: .42rem 0; border-bottom: 1px solid rgba(217,216,207,.65); }
.session-muscle:last-child { border-bottom: 0; }
.session-muscle > div { display: flex; justify-content: space-between; gap: .7rem; font-size: .64rem; }
.session-muscle b { font-family: var(--mono); font-size: .58rem; font-weight: 500; }
.session-muscle i { display: block; height: 5px; margin-top: .28rem; overflow: hidden; border-radius: 99px; background: #e9e8e1; }
.session-muscle em { display: block; height: 100%; border-radius: inherit; background: var(--acid-dark); }
.session-muscle.near em { background: #aa8840; }
.session-muscle.high em { background: var(--red); }
.session-muscle.high b { color: var(--red); }
.session-empty { margin: 0; padding: .8rem; color: var(--quiet); font-size: .65rem; }
.volume-note { margin: 1rem 0 0; padding-top: .9rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .68rem; line-height: 1.55; }
.volume-note strong { color: var(--ink); }
.volume-note a { color: var(--acid-dark); }
.evidence-details { margin-top: .65rem; color: var(--muted); font-size: .68rem; line-height: 1.55; }
.evidence-details summary { width: fit-content; color: var(--ink); cursor: pointer; font-weight: 700; }
.evidence-details p { max-width: 62rem; margin: .6rem 0 0; }
.anatomy-map { position: relative; overflow: hidden; margin: 1rem 0 2.5rem; border: 1px solid #34382f; border-radius: 28px; padding: clamp(1rem, 3vw, 1.7rem); color: white; background: radial-gradient(circle at 17% 25%, rgba(191,217,110,.13), transparent 28%), radial-gradient(circle at 77% 70%, rgba(231,119,66,.1), transparent 24%), #171915; box-shadow: 0 22px 55px rgba(23,25,21,.12); }
.anatomy-map::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .2; background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px); background-size: 34px 34px; mask-image: linear-gradient(to bottom, black, transparent 88%); }
.anatomy-map > * { position: relative; z-index: 1; }
.anatomy-map-head { display: flex; align-items: end; justify-content: space-between; gap: 1.5rem; }
.anatomy-map-head .kicker { margin: 0 0 .45rem; color: var(--acid); }
.anatomy-map-head h2 { margin: 0; font-family: var(--display); font-size: clamp(2rem, 5vw, 3.25rem); font-weight: 400; letter-spacing: -.035em; }
.anatomy-map-head > p { max-width: 25rem; margin: 0; color: #aeb2a6; font-size: .72rem; line-height: 1.5; text-align: right; }
.anatomy-controls { display: grid; grid-template-columns: minmax(150px, .65fr) minmax(220px, 1.35fr) minmax(150px, .55fr); gap: .65rem; margin: 1.35rem 0; }
.anatomy-controls label, .anatomy-count { min-height: 72px; border: 1px solid #41463c; border-radius: 15px; padding: .7rem .8rem; background: rgba(33,36,30,.8); }
.anatomy-controls label > span, .anatomy-count > span { display: block; margin-bottom: .35rem; color: #858b7d; font-family: var(--mono); font-size: .54rem; text-transform: uppercase; letter-spacing: .06em; }
.anatomy-controls select { width: 100%; border: 0; padding: 0 1.35rem 0 0; color: white; background: transparent; outline: none; font-size: .72rem; text-overflow: ellipsis; }
.anatomy-controls select option { color: var(--ink); background: white; }
.anatomy-count { display: grid; grid-template-columns: 1fr auto; align-items: center; }
.anatomy-count > span { grid-column: 1 / -1; }
.anatomy-count strong { font-family: var(--display); font-size: 1.7rem; font-weight: 400; line-height: 1; color: var(--acid); }
.anatomy-count small { color: #9da295; font-size: .57rem; text-align: right; }
.anatomy-stage { display: grid; grid-template-columns: minmax(420px, 1.45fr) minmax(250px, .55fr); gap: 1rem; align-items: stretch; }
.anatomy-figures { display: grid; grid-template-columns: 1fr 1fr; gap: .55rem; min-height: 600px; border: 1px solid #3a3f36; border-radius: 22px; padding: .8rem; background: radial-gradient(ellipse at 50% 42%, #30342c 0, #21241f 53%, #171915 100%); }
.anatomy-figures figure { position: relative; display: grid; place-items: center; min-width: 0; margin: 0; }
.anatomy-figures figcaption { position: absolute; z-index: 2; top: .25rem; left: .4rem; color: #737a6c; font-family: var(--mono); font-size: .53rem; text-transform: uppercase; letter-spacing: .08em; }
.anatomy-svg { display: block; width: min(100%, 270px); height: 550px; overflow: visible; }
.anatomy-body-model path { stroke: #8f958a; stroke-width: 1.2; stroke-linejoin: round; }
.anatomy-region { stroke-width: 1.25; stroke-linejoin: round; transition: fill .25s ease, stroke .25s ease, filter .25s ease, opacity .25s ease; cursor: help; }
.anatomy-region.level-0 { opacity: .38; stroke-width: .8; }
.anatomy-region.level-1 { opacity: .82; }
.anatomy-region.level-2 { opacity: .9; }
.anatomy-region.level-3, .anatomy-region.level-4 { opacity: 1; filter: drop-shadow(0 0 5px rgba(191,217,110,.2)); }
.anatomy-region.partial-only.level-3, .anatomy-region.partial-only.level-4 { filter: drop-shadow(0 0 5px rgba(231,119,66,.25)); }
.anatomy-region.mixed { stroke-width: 2.5; }
.anatomy-region:hover { filter: brightness(1.12) drop-shadow(0 0 7px rgba(255,255,255,.2)); }
.anatomy-landmark { fill: none; stroke: rgba(76,81,72,.58); stroke-width: .8; stroke-linecap: round; pointer-events: none; }
.anatomy-analysis { display: flex; flex-direction: column; gap: .75rem; min-width: 0; }
.anatomy-insight, .anatomy-key, .anatomy-ranking { border: 1px solid #3d4238; border-radius: 18px; padding: 1rem; background: rgba(36,39,33,.86); }
.anatomy-insight.single { border-color: #667841; background: linear-gradient(145deg, rgba(94,118,39,.26), rgba(36,39,33,.88)); }
.anatomy-insight-label { display: block; color: #858b7d; font-family: var(--mono); font-size: .53rem; text-transform: uppercase; letter-spacing: .07em; }
.anatomy-insight h3 { margin: .5rem 0 .35rem; font-family: var(--display); font-size: 1.45rem; font-weight: 400; }
.anatomy-insight p { margin: 0; color: #aeb2a6; font-size: .66rem; line-height: 1.55; }
.evidence-chip { display: inline-flex; align-items: center; min-height: 25px; border-radius: 999px; padding: 0 .55rem; color: #d5e5a3; background: rgba(127,157,55,.28); font-family: var(--mono); font-size: .52rem; text-transform: uppercase; }
.evidence-chip.evidence-emg { color: #ffd2bd; background: rgba(231,119,66,.2); }
.evidence-chip.evidence-biomechanics { color: #c2c6bb; background: rgba(141,146,135,.18); }
.evidence-mix { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .75rem; }
.evidence-mix span { border: 1px solid #4a5044; border-radius: 999px; padding: .28rem .45rem; color: #aeb2a6; font-size: .52rem; }
.anatomy-key { display: flex; flex: 1; flex-direction: column; gap: .9rem; }
.anatomy-key-group > strong { display: block; margin-bottom: .4rem; font-family: var(--display); font-size: .9rem; font-weight: 500; }
.anatomy-key-group > small { display: block; margin-top: .35rem; color: #858b7d; font-size: .53rem; line-height: 1.45; }
.anatomy-key > p { margin: auto 0 0; padding-top: .75rem; border-top: 1px solid #3c4038; color: #92988b; font-size: .61rem; line-height: 1.5; }
.anatomy-heat-scale { display: grid; grid-template-columns: repeat(5, 1fr); gap: 3px; height: 12px; }
.anatomy-heat-scale i { border-radius: 4px; }
.anatomy-heat-scale i:nth-child(1) { background: #e8e7df; opacity: .45; }
.anatomy-heat-scale i:nth-child(2) { background: #dfeab8; }
.anatomy-heat-scale i:nth-child(3) { background: #bfd96e; }
.anatomy-heat-scale i:nth-child(4) { background: #8db638; }
.anatomy-heat-scale i:nth-child(5) { background: #557d1d; }
.anatomy-origin-key > div { display: flex; flex-wrap: wrap; gap: .55rem .7rem; }
.anatomy-origin-key span { display: flex; align-items: center; gap: .3rem; color: #aeb2a6; font-size: .57rem; }
.anatomy-origin-key i { width: 12px; height: 12px; border-radius: 4px; background: var(--acid); }
.anatomy-origin-key i.partial { background: var(--orange); }
.anatomy-origin-key i.mixed { border: 2px solid var(--orange); background: var(--acid); }
.anatomy-ranking { margin-top: 1rem; }
.anatomy-ranking-head { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: .75rem; }
.anatomy-ranking-head h3 { margin: .3rem 0 0; font-family: var(--display); font-size: 1.45rem; font-weight: 400; }
.anatomy-ranking-head > strong { color: var(--acid); font-family: var(--display); font-size: 2.2rem; font-weight: 400; line-height: 1; }
.anatomy-region-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .45rem; }
.anatomy-rank { display: grid; grid-template-columns: 24px 1fr; gap: .55rem; align-items: center; min-width: 0; padding: .65rem; border: 1px solid #3c4038; border-radius: 12px; background: rgba(25,27,23,.45); }
.anatomy-rank > span { color: #697062; font-family: var(--mono); font-size: .55rem; }
.anatomy-rank strong, .anatomy-rank small { display: block; }
.anatomy-rank strong { font-family: var(--display); font-size: .82rem; font-weight: 500; line-height: 1.15; }
.anatomy-rank small { margin-top: .08rem; color: #777e70; font-size: .52rem; }
.anatomy-rank-title { display: flex; align-items: center; justify-content: space-between; gap: .4rem; min-width: 0; }
.anatomy-rank-title em { flex: 0 0 auto; border-radius: 999px; padding: .16rem .3rem; color: #cdd9a6; background: rgba(141,182,56,.16); font-family: var(--mono); font-size: .45rem; font-style: normal; text-transform: uppercase; }
.anatomy-rank[data-origin="indiretto"] .anatomy-rank-title em { color: #ffc9af; background: rgba(231,119,66,.16); }
.anatomy-rank[data-origin="misto"] .anatomy-rank-title em { color: #f1dda1; background: rgba(181,140,60,.17); }
.anatomy-rank i { display: flex; height: 4px; margin-top: .38rem; overflow: hidden; border-radius: 999px; background: #31352d; }
.anatomy-rank i em { display: block; background: var(--acid); }
.anatomy-rank i b { display: block; background: var(--orange); }
.anatomy-empty { padding: 1.2rem 0; color: #858b7d; font-size: .66rem; }
.anatomy-method { margin-top: 1rem; border-top: 1px solid #383d34; padding-top: .85rem; color: #9ba093; font-size: .63rem; line-height: 1.6; }
.anatomy-method summary { width: fit-content; color: #d5d8cf; cursor: pointer; font-weight: 700; }
.anatomy-method > div { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem 1.2rem; margin-top: .65rem; }
.anatomy-method p { margin: 0; }
.anatomy-method p:last-child { grid-column: 1 / -1; }
.anatomy-method strong { color: white; }
.anatomy-method a { color: var(--acid); }
.program-header-actions, .setting-actions { display: flex; gap: .5rem; }
.mesocycle-card { margin: .5rem 0 1.2rem; padding: 1rem; border: 1px solid var(--line); border-radius: 20px; background: rgba(255,254,249,.8); }
.mesocycle-heading { display: flex; align-items: end; justify-content: space-between; gap: 1rem; }
.mesocycle-heading h2 { margin: .2rem 0 0; font-family: var(--display); font-size: 1.7rem; font-weight: 500; }
.mesocycle-heading p:last-child { margin: .3rem 0 0; color: var(--muted); font-size: .66rem; }
.mesocycle-actions { display: flex; gap: .4rem; }
.mesocycle-actions button { padding: .5rem .65rem; border: 1px solid var(--line-dark); border-radius: 999px; color: var(--ink); background: white; font-size: .6rem; }
.mesocycle-actions button:disabled { opacity: .35; cursor: not-allowed; }
.mesocycle-weeks { display: grid; grid-template-columns: repeat(auto-fit, minmax(105px, 1fr)); gap: .45rem; margin-top: .9rem; }
.mesocycle-week { padding: .65rem; border: 1px solid var(--line); border-radius: 11px; background: white; }
.mesocycle-week.active { border-color: var(--acid-dark); box-shadow: inset 0 0 0 1px var(--acid-dark); background: rgba(201,246,75,.18); }
.mesocycle-week.deload { background: #eee9dc; }
.mesocycle-week span, .mesocycle-week strong, .mesocycle-week small { display: block; }
.mesocycle-week span { color: var(--quiet); font-family: var(--mono); font-size: .52rem; }
.mesocycle-week strong { margin-top: .35rem; font-family: var(--display); font-size: 1.25rem; font-weight: 500; }
.mesocycle-week small { margin-top: .2rem; color: var(--muted); font-size: .55rem; }
.mesocycle-note { margin: .8rem 0 0; color: var(--muted); font-size: .62rem; line-height: 1.5; }
.program-detail-head { margin-top: 0; }
.program-days { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.program-day { border: 1px solid var(--line); border-radius: 20px; background: rgba(255,254,249,.75); overflow: hidden; }
.program-day-head { display: flex; justify-content: space-between; gap: 1rem; padding: 1.1rem 1.2rem; color: white; background: var(--ink); }
.program-day-head span { color: var(--acid); font-family: var(--mono); font-size: .62rem; }
.program-day-head h2 { margin: .25rem 0 0; font-family: var(--display); font-weight: 400; font-size: 1.4rem; }
.program-day-head b { align-self: center; font-family: var(--display); font-size: 2rem; font-weight: 400; color: #696e63; }
.program-day-actions { display: flex; align-items: center; gap: .7rem; }
.program-day-actions button { border: 1px solid #4e5348; border-radius: 999px; padding: .42rem .65rem; color: var(--acid); background: transparent; font-size: .62rem; }
.program-exercise { display: grid; grid-template-columns: 1fr auto; gap: .8rem; padding: .85rem 1.1rem; border-bottom: 1px solid var(--line); }
.program-exercise:last-child { border-bottom: 0; }
.program-exercise strong, .program-exercise small { display: block; }
.program-exercise strong { font-family: var(--display); font-weight: 500; }
.program-exercise small { color: var(--muted); font-size: .65rem; margin-top: .2rem; }
.program-exercise em { display: block; margin-top: .2rem; color: var(--quiet); font-size: .57rem; font-style: normal; }
.program-dose { text-align: right; font-family: var(--mono); font-size: .68rem; }
.program-dose span { display: block; color: var(--quiet); margin-top: .2rem; font-size: .56rem; }

.progress-grid { display: grid; grid-template-columns: .8fr 1.2fr; gap: 1rem; }
.panel-card { border: 1px solid var(--line); border-radius: 20px; padding: 1.2rem; background: rgba(255,254,249,.8); }
.panel-card h2 { margin: 0; font-family: var(--display); font-weight: 400; font-size: 1.45rem; }
.panel-card > p { margin: .35rem 0 1rem; color: var(--muted); font-size: .72rem; line-height: 1.5; }
.weight-form { display: grid; grid-template-columns: 1fr 1fr auto; gap: .55rem; align-items: end; }
.mini-field label { display: block; color: var(--quiet); font-size: .6rem; text-transform: uppercase; margin-bottom: .3rem; }
.mini-field .text-input { min-height: 42px; padding: .55rem; }
.weight-chart { width: 100%; height: 170px; margin-top: 1rem; display: block; }
.trend-summary { display: flex; justify-content: space-between; gap: 1rem; padding-top: .7rem; border-top: 1px solid var(--line); font-size: .7rem; color: var(--muted); }
.trend-summary strong { color: var(--ink); }
.exercise-stats { margin-top: 1rem; }
.exercise-stats-head { display: flex; align-items: end; justify-content: space-between; gap: 1.2rem; }
.exercise-stats-head .kicker { margin: 0 0 .4rem; }
.exercise-stats-head h2 { font-size: clamp(1.7rem, 4vw, 2.4rem); }
.exercise-stats-head > div > p:last-child { max-width: 35rem; margin: .35rem 0 0; color: var(--muted); font-size: .7rem; line-height: 1.5; }
.stats-add-field { display: block; width: min(320px, 38%); flex: 0 0 auto; }
.stats-add-field > span { display: block; margin-bottom: .35rem; color: var(--quiet); font-family: var(--mono); font-size: .56rem; text-transform: uppercase; }
.stats-add-field .text-input { min-height: 44px; padding: .55rem; }
.stats-selected-series { display: flex; flex-wrap: wrap; gap: .45rem; margin: 1rem 0 .75rem; }
.stats-selected-series button { display: grid; grid-template-columns: 8px 1fr auto; gap: .55rem; align-items: center; min-width: min(100%, 230px); border: 1px solid var(--line); border-radius: 12px; padding: .55rem .65rem; color: var(--ink); background: white; text-align: left; }
.stats-selected-series i { width: 8px; height: 28px; border-radius: 99px; }
.stats-selected-series strong, .stats-selected-series small { display: block; }
.stats-selected-series strong { font-family: var(--display); font-size: .82rem; font-weight: 500; }
.stats-selected-series small { margin-top: .12rem; color: var(--quiet); font-size: .52rem; }
.stats-selected-series b { color: var(--quiet); font-size: .85rem; font-weight: 400; }
.exercise-chart-wrap { overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: linear-gradient(180deg, rgba(244,242,235,.42), rgba(255,255,255,.8)); }
.exercise-stats-chart { display: block; width: 100%; height: 320px; touch-action: pan-y; }
.stats-chart-detail { min-height: 46px; display: flex; align-items: center; gap: .7rem; padding: .65rem .9rem; border-top: 1px solid var(--line); color: var(--muted); background: white; font-size: .62rem; }
.stats-chart-detail strong { color: var(--ink); font-family: var(--display); font-size: .85rem; font-weight: 500; }
.stats-method { margin: .8rem 0 0; color: var(--muted); font-size: .62rem; line-height: 1.55; }
.stats-method strong { color: var(--ink); }
.progress-list { border-top: 1px solid var(--line); }
.progress-row { display: grid; grid-template-columns: minmax(150px, 1.25fr) .6fr .7fr 1.2fr; gap: .8rem; align-items: center; padding: .8rem 0; border-bottom: 1px solid var(--line); }
.progress-row strong, .progress-row small { display: block; }
.progress-row strong { font-family: var(--display); font-weight: 500; }
.progress-row small { color: var(--quiet); font-size: .62rem; }
.progress-value span { display: block; color: var(--quiet); font-family: var(--mono); font-size: .55rem; text-transform: uppercase; }
.progress-value b { display: block; margin-top: .18rem; font-size: .76rem; }
.action-pill { display: inline-block; border-radius: 999px; padding: .35rem .55rem; font-family: var(--mono); font-size: .56rem; text-transform: uppercase; }
.action-increase { color: var(--green); background: var(--green-soft); }
.action-reduce { color: var(--red); background: var(--red-soft); }
.action-confirm, .action-hold { color: #87652b; background: #f2e8cd; }
.action-choose { color: var(--muted); background: #e9e8e1; }
.history-list { margin-top: 1rem; }
.history-row { display: grid; grid-template-columns: 1fr auto auto; gap: 1rem; padding: .75rem 0; border-bottom: 1px solid var(--line); align-items: center; }
.history-row:last-child { border-bottom: 0; }
.history-row strong, .history-row small { display: block; }
.history-row strong { font-family: var(--display); font-weight: 500; }
.history-row small { color: var(--quiet); margin-top: .15rem; font-size: .62rem; }
.history-stat { color: var(--muted); font-family: var(--mono); font-size: .66rem; text-align: right; }

.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; padding-top: 2rem; }
.setting-card { min-height: 210px; border: 1px solid var(--line); border-radius: 20px; padding: 1.3rem; background: rgba(255,254,249,.8); }
.setting-card.dark { color: white; background: var(--ink); border-color: var(--ink); }
.setting-card .kicker { margin-bottom: .55rem; }
.setting-card h2 { margin: 0; font-family: var(--display); font-weight: 400; font-size: 1.7rem; }
.setting-card p { color: var(--muted); line-height: 1.6; font-size: .78rem; }
.setting-card.dark p { color: #acb0a5; }
.setting-card .button { margin-top: 1rem; }
.setting-actions .button { flex: 1; }
.profile-facts { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: 1rem; }
.profile-facts span { padding: .4rem .55rem; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: .65rem; }
.rule-list { margin: 1rem 0 0; padding: 0; list-style: none; }
.rule-list li { display: grid; grid-template-columns: 24px 1fr; gap: .55rem; padding: .45rem 0; color: #c5c8bf; font-size: .72rem; line-height: 1.45; }
.rule-list b { color: var(--acid); font-family: var(--mono); }
.archive-card { grid-column: 1 / -1; }
.routine-archive { margin-top: 1rem; border-top: 1px solid var(--line); }
.archive-row { display: grid; grid-template-columns: 1fr auto; gap: 1rem; align-items: center; padding: .85rem 0; border-bottom: 1px solid var(--line); }
.archive-row strong, .archive-row small { display: block; }
.archive-row strong { font-family: var(--display); font-weight: 500; }
.archive-row small { margin-top: .2rem; color: var(--quiet); font-size: .62rem; }
.archive-meta { display: flex; align-items: center; gap: .7rem; color: var(--muted); font-family: var(--mono); font-size: .6rem; }
.archive-meta b, .archive-meta button { border: 0; border-radius: 999px; padding: .38rem .55rem; font: inherit; }
.archive-meta b { color: var(--green); background: var(--green-soft); }
.archive-meta button { color: var(--ink); background: var(--acid); }
.empty-state { padding: 2.5rem; text-align: center; color: var(--muted); border: 1px dashed var(--line-dark); border-radius: 18px; }

.toast { position: fixed; z-index: 100; left: 50%; bottom: max(1rem, env(safe-area-inset-bottom)); transform: translate(-50%, 18px); max-width: calc(100% - 2rem); padding: .75rem 1rem; border-radius: 11px; color: white; background: var(--ink); box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: .2s; font-size: .78rem; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.loading { opacity: .58; pointer-events: none; }

@media (max-width: 850px) {
  .setup-shell { grid-template-columns: 1fr; }
  .setup-intro { position: static; }
  .routine-targets-grid { grid-template-columns: repeat(3, 1fr); }
  .exercise-prescription-grid { grid-template-columns: repeat(4, minmax(82px, 1fr)); }
  .workout-hero { grid-template-columns: 1fr; }
  .workout-hero-side { min-height: 230px; }
  .program-days, .progress-grid, .settings-grid { grid-template-columns: 1fr; }
  .anatomy-stage { grid-template-columns: 1fr; }
  .anatomy-figures { min-height: 520px; }
  .anatomy-ranking { min-height: auto; }
  .anatomy-region-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
  .topbar { height: 64px; }
  .brand small, .sync-state { display: none; }
  .page-shell { width: min(100% - 1rem, 1180px); padding-top: .55rem; }
  .tabs { top: 64px; margin: 0 -.15rem; padding-top: .3rem; }
  .setup-shell { width: min(100% - 1rem, 1080px); padding-top: 2rem; }
  .builder-shell { width: min(100% - 1rem, 1180px); padding-top: 1.5rem; }
  .builder-header { display: block; }
  .builder-header .button { margin-top: 1rem; }
  .routine-method-heading, .mesocycle-heading { display: block; }
  .routine-method-heading .button, .mesocycle-actions { margin-top: .75rem; }
  .routine-method-grid { grid-template-columns: 1fr 1fr; }
  .routine-targets-heading { display: block; }
  .routine-targets-heading p { margin-top: .5rem; text-align: left; }
  .routine-targets-grid { grid-template-columns: 1fr 1fr; }
  .routine-day-header { grid-template-columns: 28px minmax(110px, 1fr); padding: .75rem; }
  .routine-day-header > input { font-size: 1.05rem; }
  .routine-day-actions { grid-column: 2; justify-content: flex-end; }
  .routine-day-actions button, .exercise-editor-actions button { width: 30px; height: 32px; }
  .routine-exercises { padding: 0 .7rem; }
  .routine-exercise-top { grid-template-columns: 24px minmax(100px, 1fr); align-items: center; }
  .exercise-filter-field { grid-column: 2; }
  .exercise-editor-actions { grid-column: 2; }
  .custom-name, .exercise-prescription-grid, .exercise-method-note, .secondary-muscles { margin-left: 0; }
  .exercise-prescription-grid { grid-template-columns: 1fr 1fr; }
  .exercise-guidance { display: grid; gap: .25rem; }
  .exercise-guidance strong { white-space: normal; }
  .setup-columns, .option-grid { grid-template-columns: 1fr; }
  .option-card { min-height: 92px; }
  .workout-hero { border-radius: 21px; }
  .workout-picker { padding: .75rem; border-radius: 16px; }
  .workout-picker-heading { display: block; }
  .workout-picker-heading p { margin-top: .35rem; text-align: left; }
  .workout-day-options { grid-template-columns: 1fr 1fr; }
  .workout-hero-main { padding: 1.35rem; }
  .workout-hero-side { padding: 1.35rem; min-height: 215px; }
  .preview-row { grid-template-columns: 32px 1fr auto; gap: .6rem; }
  .preview-row .preview-stat:nth-of-type(2), .preview-row .recommendation { display: none; }
  .active-head { top: 117px; border-radius: 14px; }
  .active-head-actions { gap: .55rem; }
  .active-empty-button { padding-inline: .5rem; }
  .exercise-card-head { padding: 1rem; }
  .set-table { padding: .35rem .75rem .8rem; }
  .set-row { grid-template-columns: 32px minmax(64px, .85fr) minmax(58px, .7fr) minmax(52px, .6fr) 42px; gap: .3rem; }
  .set-row-head { font-size: .5rem; }
  .finish-grid { grid-template-columns: 1fr; }
  .program-header, .progress-header { display: block; padding-top: 1rem; }
  .program-header .button { margin-top: 1rem; }
  .volume-heading { display: block; }
  .volume-heading > p { margin-top: .5rem; text-align: left; }
  .balance-check { grid-template-columns: 1fr; }
  .volume-metrics { grid-template-columns: 1fr 1fr; }
  .volume-metric { min-height: 100px; }
  .muscle-volume-head { display: none; }
  .muscle-volume-row { grid-template-columns: 1fr 78px 44px 42px; gap: .45rem; padding: .8rem .2rem; }
  .muscle-volume-name { grid-column: 1 / -1; }
  .muscle-volume-row .volume-track { grid-column: 1 / -1; }
  .muscle-volume-row > b:nth-of-type(1)::before { content: "D+P "; color: var(--quiet); font-size: .5rem; }
  .muscle-volume-row > b:nth-of-type(2)::before { content: "Tot "; color: var(--quiet); font-size: .5rem; }
  .muscle-volume-row > b:nth-of-type(3)::before { content: "Seduta "; color: var(--quiet); font-size: .5rem; }
  .volume-evaluation { grid-column: 1 / -1; justify-items: start; }
  .volume-status { justify-self: start; }
  .session-volume-heading { display: block; }
  .session-volume-heading p { margin-top: .35rem; text-align: left; }
  .session-volume-grid { grid-template-columns: 1fr; }
  .exercise-stats-head { display: block; }
  .stats-add-field { width: 100%; margin-top: .8rem; }
  .stats-selected-series { display: grid; grid-template-columns: 1fr; }
  .stats-selected-series button { width: 100%; }
  .exercise-stats-chart { height: 260px; }
  .stats-chart-detail { display: grid; gap: .15rem; }
  .anatomy-map { border-radius: 22px; }
  .anatomy-map-head { display: block; }
  .anatomy-map-head > p { margin-top: .5rem; text-align: left; }
  .anatomy-controls { grid-template-columns: 1fr; }
  .anatomy-count { min-height: 66px; }
  .anatomy-figures { min-height: 390px; padding: .35rem; }
  .anatomy-svg { height: 375px; }
  .anatomy-ranking { padding: .8rem; }
  .anatomy-region-grid { grid-template-columns: 1fr; }
  .anatomy-method > div { grid-template-columns: 1fr; }
  .anatomy-method p:last-child { grid-column: auto; }
  .program-header-actions { flex-wrap: wrap; }
  .program-header-actions .button { flex: 1; }
  .archive-row { grid-template-columns: 1fr; }
  .archive-meta { justify-content: space-between; }
  .program-day-actions b { display: none; }
  .weight-form { grid-template-columns: 1fr 1fr; }
  .weight-form .button { grid-column: 1 / -1; }
  .progress-row { grid-template-columns: 1.2fr .65fr .75fr; }
  .progress-row > :last-child { grid-column: 1 / -1; }
}
