:root {
  color-scheme: light;
  --page: #f9f9f7;
  --surface: #fcfcfb;
  --surface-2: #f0efec;
  --ink: #0b0b0b;
  --ink-2: #52514e;
  --muted: #898781;
  --grid: #e1e0d9;
  --axis: #c3c2b7;
  --border: rgba(11, 11, 11, 0.10);
  --accent: #2a78d6;
  --accent-ink: #ffffff;
  --series-1: #2a78d6;
  --series-2: #eb6834;
  --series-3: #1baf7a;
  --series-4: #eda100;
  --series-5: #e87ba4;
  --good: #0ca30c;
  --good-ink: #006300;
  --warning: #fab219;
  --serious: #ec835a;
  --critical: #d03b3b;
  --warn-bg: #fff6e0;
  --crit-bg: #fdecec;
  --info-bg: #eaf2fc;
  --radius: 14px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page: #0d0d0d;
    --surface: #1a1a19;
    --surface-2: #262624;
    --ink: #ffffff;
    --ink-2: #c3c2b7;
    --muted: #898781;
    --grid: #2c2c2a;
    --axis: #383835;
    --border: rgba(255, 255, 255, 0.10);
    --accent: #3987e5;
    --series-1: #3987e5;
    --series-2: #d95926;
    --series-3: #199e70;
    --series-4: #c98500;
    --series-5: #d55181;
    --good-ink: #0ca30c;
    --warn-bg: #2e2510;
    --crit-bg: #331616;
    --info-bg: #14233a;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0d0d0d;
  --surface: #1a1a19;
  --surface-2: #262624;
  --ink: #ffffff;
  --ink-2: #c3c2b7;
  --muted: #898781;
  --grid: #2c2c2a;
  --axis: #383835;
  --border: rgba(255, 255, 255, 0.10);
  --accent: #3987e5;
  --series-1: #3987e5;
  --series-2: #d95926;
  --series-3: #199e70;
  --series-4: #c98500;
  --series-5: #d55181;
  --good-ink: #0ca30c;
  --warn-bg: #2e2510;
  --crit-bg: #331616;
  --info-bg: #14233a;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--page);
  color: var(--ink);
  font: 16px/1.45 var(--font);
  -webkit-text-size-adjust: 100%;
}
[hidden] { display: none !important; }
h1, h2, h3 { margin: 0 0 8px; line-height: 1.2; }
h1 { font-size: 24px; }
h2 { font-size: 18px; }
h3 { font-size: 16px; }
p { margin: 0 0 8px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.ink2 { color: var(--ink-2); }
.num { font-variant-numeric: tabular-nums; }
.err { color: var(--critical); min-height: 1.2em; }

/* ---------- layout ---------- */
.top {
  position: sticky; top: 0; z-index: 5;
  display: flex; justify-content: space-between; align-items: center;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  background: var(--page);
  border-bottom: 1px solid var(--border);
}
.top-title { font-weight: 700; font-size: 17px; }
.top-sub { font-size: 13px; color: var(--ink-2); }
.top-right { display: flex; align-items: center; gap: 8px; }
.view {
  max-width: 760px; margin: 0 auto;
  padding: 16px 16px calc(96px + env(safe-area-inset-bottom));
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px;
}
html { overflow-x: hidden; }
button, .btn, .tab, select, input[type="date"] { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
body.resting .view { padding-bottom: calc(160px + env(safe-area-inset-bottom)); }
.tabs {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 5;
  display: grid; grid-template-columns: repeat(7, 1fr);
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
}
.tab {
  appearance: none; border: 0; background: none; color: var(--ink-2);
  font: 600 12px var(--font); padding: 14px 2px; min-height: 52px; cursor: pointer;
}
.tab.on { color: var(--accent); box-shadow: inset 0 3px 0 var(--accent); }
.tab svg { display: block; margin: 0 auto 3px; width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tab { padding: 8px 2px 10px; font-size: 11px; }
.icon-btn {
  appearance: none; border: 1px solid var(--border); background: var(--surface);
  border-radius: 10px; width: 42px; height: 42px; display: grid; place-items: center; cursor: pointer;
}
.ico { fill: none; stroke: var(--ink-2); stroke-width: 1.6; }
.sync { font-size: 12px; color: var(--muted); }
.sync.pend { color: var(--serious); }

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px;
  min-width: 0;
}
.card > h2 { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (min-width: 620px) { .grid-auto { grid-template-columns: repeat(4, 1fr); } }
.grid-auto { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ---------- stats ---------- */
.stat { background: var(--surface-2); border-radius: 12px; padding: 10px 12px; min-width: 0; }
.stat .k { font-size: 12px; color: var(--ink-2); }
.stat .v { font-size: 22px; font-weight: 700; overflow-wrap: anywhere; }
.stat .v small { font-size: 13px; font-weight: 500; color: var(--ink-2); }
.hero { font-size: 40px; font-weight: 800; line-height: 1; }
.hero small { font-size: 18px; font-weight: 600; color: var(--ink-2); }
.pill {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  background: var(--surface-2); font-size: 13px; font-weight: 600;
}
.pill.accent { background: var(--accent); color: var(--accent-ink); }

/* ---------- timeline ---------- */
.timeline { display: grid; grid-template-columns: repeat(20, 1fr); gap: 2px; margin: 12px 0 6px; }
.timeline .w { height: 14px; border-radius: 3px; opacity: .35; position: relative; }
.timeline .w.past { opacity: .8; }
.timeline .w.now { opacity: 1; outline: 2px solid var(--ink); outline-offset: 1px; }
.ph-0 { background: var(--series-1); }
.ph-1 { background: var(--series-2); }
.ph-2 { background: var(--series-3); }
.ph-3 { background: var(--series-4); }
.ph-4 { background: var(--series-5); }
.legend { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; color: var(--ink-2); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.legend i.line { height: 3px; border-radius: 2px; vertical-align: 3px; width: 14px; }

/* ---------- alerts ---------- */
.alert {
  display: flex; gap: 10px; align-items: flex-start;
  border-radius: 12px; padding: 12px; border: 1px solid var(--border);
  background: var(--surface);
}
.alert .ai {
  flex: none; width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 800; font-size: 14px; color: #fff;
}
.alert.crit { background: var(--crit-bg); border-color: var(--critical); }
.alert.crit .ai { background: var(--critical); }
.alert.warn { background: var(--warn-bg); border-color: var(--warning); }
.alert.warn .ai { background: var(--warning); color: #0b0b0b; }
.alert.info { background: var(--info-bg); }
.alert.info .ai { background: var(--accent); }
.alert.ok .ai { background: var(--good); }
.alert b { display: block; }
.alerts { display: grid; gap: 8px; }
.tag {
  display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700;
  padding: 2px 8px; border-radius: 999px; white-space: nowrap;
}
.tag.ok { color: var(--good-ink); background: color-mix(in srgb, var(--good) 14%, transparent); }
.tag.warn { color: var(--ink); background: color-mix(in srgb, var(--warning) 35%, transparent); }
.tag.crit { color: #fff; background: var(--critical); }
.tag.mute { color: var(--ink-2); background: var(--surface-2); }

/* ---------- forms ---------- */
label { display: grid; gap: 4px; font-size: 13px; color: var(--ink-2); font-weight: 600; min-width: 0; }
input, select, textarea {
  font: 16px var(--font); color: var(--ink);
  background: var(--page); border: 1px solid var(--axis); border-radius: 10px;
  padding: 10px 12px; min-height: 46px; width: 100%; min-width: 0;
}
textarea { min-height: 70px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
.checks { display: grid; gap: 6px; }
.check { display: flex; gap: 10px; align-items: center; font-weight: 500; color: var(--ink); font-size: 15px; }
.check input { width: 22px; height: 22px; min-height: 0; flex: none; }
form.stack { display: grid; gap: 12px; }
.btn {
  appearance: none; border: 1px solid var(--axis); background: var(--surface-2); color: var(--ink);
  font: 600 16px var(--font); border-radius: 12px; padding: 12px 16px; min-height: 48px; cursor: pointer;
}
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.btn.small { min-height: 36px; padding: 6px 12px; font-size: 14px; }
.btn.ghost { background: none; }
.btn.danger { color: var(--critical); background: none; border-color: transparent; }
.btn:disabled { opacity: .5; }
details > summary { cursor: pointer; font-weight: 600; padding: 4px 0; }

/* ---------- entreno ---------- */
.ex { display: grid; gap: 8px; }
.ex-head { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.ex-name { font-weight: 700; }
.ex-meta { font-size: 13px; color: var(--ink-2); white-space: nowrap; }
.ex-prev { font-size: 13px; color: var(--ink-2); }
.cue { font-size: 13px; font-weight: 700; color: var(--good-ink); }
.sets { display: grid; gap: 6px; }
.set { display: grid; grid-template-columns: 26px minmax(0,1.3fr) minmax(0,1fr) minmax(0,0.8fr) 12px; gap: 6px; align-items: center; }
.set .sn { font-size: 13px; color: var(--muted); font-weight: 700; }
.set input { text-align: center; padding: 8px 2px; min-height: 52px; font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.set input::placeholder { font-weight: 500; color: var(--muted); opacity: .7; }
.ex.done { opacity: .75; }
.ex.done .ex-name::before { content: "✓ "; color: var(--good-ink); }
.ex-count { font-size: 12px; font-weight: 700; color: var(--ink-2); }
.ent-bar {
  position: sticky; top: 63px; z-index: 4; margin: -4px 0 0;
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  background: var(--page); padding: 6px 0; font-size: 13px; color: var(--ink-2);
}
.progress { flex: 1; height: 6px; background: var(--surface-2); border-radius: 3px; overflow: hidden; }
.progress > div { height: 100%; background: var(--good); border-radius: 3px; width: 0; transition: width .3s; }
.jump { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.jump::-webkit-scrollbar { display: none; }
.jump a { flex: none; font-size: 13px; padding: 6px 10px; border-radius: 999px; background: var(--surface-2); color: var(--ink); text-decoration: none; }
.jump a.done { color: var(--good-ink); }
.ex { scroll-margin-top: 110px; }

/* ---------- temporizador de descanso ---------- */
.rest {
  position: fixed; left: 8px; right: 8px; z-index: 6;
  bottom: calc(66px + env(safe-area-inset-bottom));
  display: flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: 0 6px 24px rgba(0,0,0,.25); padding: 10px 10px 10px 14px; overflow: hidden;
}
.rest-bar { position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--surface-2); }
.rest-fill { height: 100%; width: 100%; background: var(--accent); }
.rest-lbl { font-size: 13px; color: var(--ink-2); }
.rest-time { font-size: 26px; font-weight: 800; flex: 1; }
.rest.over .rest-time { color: var(--good-ink); }
.rest.over .rest-fill { background: var(--good); }
.set-h { font-size: 11px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
.set-h span { text-align: center; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: transparent; }
.dot.saved { background: var(--good); }
.dot.pend { background: var(--warning); }
.dot.err { background: var(--critical); }
.set.top input[data-f="reps"] { border-color: var(--good); }

/* ---------- listas / tablas ---------- */
.list { display: grid; }
.li {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 10px 0; border-top: 1px solid var(--grid);
}
.li:first-child { border-top: 0; }
.li .main { min-width: 0; }
.li .sub { font-size: 13px; color: var(--ink-2); overflow-wrap: anywhere; }
.li.dim { opacity: .55; }
.table-wrap { overflow-x: auto; margin: 0 -16px; padding: 0 16px; }
table { border-collapse: collapse; width: 100%; font-size: 14px; font-variant-numeric: tabular-nums; }
th, td { padding: 8px 6px; text-align: right; border-bottom: 1px solid var(--grid); white-space: nowrap; }
th:first-child, td:first-child { text-align: left; position: sticky; left: 0; background: var(--surface); }
th { font-size: 12px; color: var(--ink-2); font-weight: 700; }
td .d { display: block; font-size: 11px; color: var(--muted); }

/* ---------- gráficos ---------- */
.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .gl { stroke: var(--grid); stroke-width: 1; }
.chart .ax { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.chart .th { stroke: var(--critical); stroke-width: 1.2; stroke-dasharray: 4 4; }
.chart .thl { fill: var(--critical); font-size: 11px; font-weight: 700; font-family: var(--font); }
.chart .ln { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .pt { stroke: var(--surface); stroke-width: 2; }
.chart .lbl { font-size: 11px; font-weight: 700; font-family: var(--font); fill: var(--ink-2); }
.chart .xh { stroke: var(--axis); stroke-width: 1; }
.s1 { stroke: var(--series-1); } .f1 { fill: var(--series-1); } i.s1 { background: var(--series-1); }
.s2 { stroke: var(--series-2); } .f2 { fill: var(--series-2); } i.s2 { background: var(--series-2); }
.tip {
  position: fixed; z-index: 20; pointer-events: none;
  background: var(--surface); color: var(--ink); border: 1px solid var(--border);
  box-shadow: 0 4px 16px rgba(0,0,0,.15); border-radius: 10px; padding: 8px 10px;
  font-size: 13px; font-variant-numeric: tabular-nums; min-width: 120px;
}
.tip b { display: block; margin-bottom: 2px; }

/* ---------- login ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-card { width: 100%; max-width: 360px; display: grid; gap: 12px; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(70px + env(safe-area-inset-bottom)); z-index: 30;
  background: var(--ink); color: var(--page); padding: 10px 16px; border-radius: 12px;
  font-size: 14px; font-weight: 600; max-width: calc(100vw - 32px);
}
.when { text-align: right; white-space: nowrap; flex: none; }

/* ---------- notas semanales ---------- */
.nota p { margin: 0 0 10px; line-height: 1.5; }
.vigila {
  border-left: 3px solid var(--warning); background: var(--warn-bg);
  border-radius: 0 10px 10px 0; padding: 8px 12px; font-size: 14px; line-height: 1.45;
}
.vigila b { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 2px; }
.nota details { border-top: 1px solid var(--border); padding: 8px 0; }
.nota details > summary { font-size: 15px; }
.nota details[open] > summary { margin-bottom: 8px; }

/* ---------- libido esperada ---------- */
.lb-chart { display: block; width: 100%; height: auto; margin: 4px 0 8px; }
.lb-chart .lb { opacity: .45; }
.lb-chart .lb.up { fill: var(--accent); }
.lb-chart .lb.eq { fill: var(--muted); }
.lb-chart .lb.down { fill: var(--series-2); }
.lb-chart .lb.now { opacity: 1; stroke: var(--ink); stroke-width: 1.5; }
.lb-chart .th { stroke: var(--ink-2); stroke-width: 1; stroke-dasharray: 4 4; }
.lb-chart .thl { fill: var(--ink-2); font-size: 11px; font-family: var(--font); }
.lb-chart .ax { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.lb-chart .ax.now { fill: var(--ink); font-weight: 700; }
.libido .row { margin-bottom: 8px; }
.lb-etapa { padding: 6px 0; }
.lb-etapa b { font-size: 14px; }
.lb-etapa p { margin: 2px 0 6px; }
.lb-etapa.now b { color: var(--accent); }

/* ---------- testosterona estimada ---------- */
.t-chart { display: block; width: 100%; height: auto; margin: 10px 0 6px; overflow: visible; touch-action: pan-y; }
.t-chart .gl { stroke: var(--grid); stroke-width: 1; }
.t-chart .ax { fill: var(--muted); font-size: 10px; font-family: var(--font); }
.t-chart .t-band { fill: var(--surface-2); }
.t-chart .t-bandl { fill: var(--muted); font-size: 10px; font-weight: 600; font-family: var(--font); }
.t-chart .t-area { fill: var(--accent); opacity: .16; }
.t-chart .t-line { fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linejoin: round; }
.t-chart .t-ref { stroke: var(--ink-2); stroke-width: 1; stroke-dasharray: 4 4; }
.t-chart .t-mark { stroke: var(--good); stroke-width: 1.2; stroke-dasharray: 2 3; }
.t-chart .t-markl { fill: var(--good-ink); font-size: 10px; font-weight: 700; font-family: var(--font); }
.t-chart .t-now { stroke: var(--ink); stroke-width: 1.2; }
.t-chart .t-nowl { fill: var(--ink); font-size: 11px; font-weight: 700; font-family: var(--font); }
.t-chart .t-dot { fill: var(--accent); stroke: var(--surface); stroke-width: 2; }
.t-chart .t-inj { fill: var(--surface); stroke: var(--accent); stroke-width: 1; }
.t-chart .t-inj.trt { stroke: var(--muted); }
.t-chart .t-inj.real { fill: var(--accent); }
.t-chart .xh { stroke: var(--axis); stroke-width: 1; }
.legend i.t-key-area { background: var(--accent); opacity: .35; }
.legend i.t-key-inj { width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid var(--accent); }
.legend i.t-key-inj.real { background: var(--accent); }
.legend i.t-key-ref { width: 14px; height: 0; border-radius: 0; border-top: 1.5px dashed var(--ink-2); vertical-align: 3px; }
.testo .row { margin-bottom: 2px; }
.testo .legend { margin-bottom: 6px; }

/* ---------- cuándo retomar el gym ---------- */
.gym { border-color: var(--accent); }
.gym-when { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 2px 0 10px; }
.hero-sm { font-size: 26px; font-weight: 800; line-height: 1.1; }
.gym-pts { margin: 0 0 12px; padding-left: 18px; display: grid; gap: 8px; font-size: 14px; line-height: 1.45; color: var(--ink-2); }
.gym-pts b { color: var(--ink); }
.gym .btn { width: 100%; }

/* ---------- barra de 7 pestañas ---------- */
.tab { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tab .tl-short { display: none; }
@media (max-width: 480px) {
  .tab { font-size: 10.5px; letter-spacing: -.01em; }
  .tab .tl-long { display: none; }
  .tab .tl-short { display: inline; }
}

/* ---------- agenda ---------- */
.ag-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.ag-head h2 { margin: 0; text-align: center; flex: 1; }
.ag-head .btn { min-width: 44px; font-size: 20px; line-height: 1; }
.ag-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
.ag-wd span { text-align: center; font-size: 11px; font-weight: 700; color: var(--muted); padding: 2px 0 4px; }
.ag-d {
  appearance: none; border: 1px solid transparent; border-radius: 9px; background: none; color: var(--ink);
  min-height: 48px; padding: 4px 0 5px; display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  font: 600 14px var(--font); font-variant-numeric: tabular-nums; cursor: pointer; touch-action: manipulation;
}
.ag-d.out { cursor: default; }
.ag-d.past .n { color: var(--ink-2); }
.ag-d.today { border-color: var(--ink); }
.ag-d.today .n { font-weight: 800; color: var(--ink); }
.ag-d.sel { outline: 2px solid var(--accent); outline-offset: -1px; }
.tint-0 { background: color-mix(in srgb, var(--series-1) 13%, transparent); }
.tint-1 { background: color-mix(in srgb, var(--series-2) 13%, transparent); }
.tint-2 { background: color-mix(in srgb, var(--series-3) 13%, transparent); }
.tint-3 { background: color-mix(in srgb, var(--series-4) 15%, transparent); }
.tint-4 { background: color-mix(in srgb, var(--series-5) 11%, transparent); }
.legend i.soft { opacity: .45; }
.mks { display: flex; gap: 3px; min-height: 7px; }
.mk { display: inline-block; width: 7px; height: 7px; border-radius: 50%; border: 1.5px solid var(--muted); }
.mk.ent.ok { background: var(--good); border-color: var(--good); }
.mk.ent.miss { border-color: var(--axis); }
.mk.iny { border-radius: 2px; border-color: var(--accent); }
.mk.iny.ok { background: var(--accent); }
.mk.iny.hoy { border-color: var(--warning); background: var(--warning); }
.mk.iny.miss { border-color: var(--critical); }
.mk.hito { border: 0; border-radius: 1px; width: 7px; height: 7px; background: var(--series-4); transform: rotate(45deg) scale(.85); }
.legend .mk { margin-right: 5px; vertical-align: 0; }
.ag-legend { margin: 10px 0 6px; }

/* ---------- progreso ---------- */
.v-chart { display: block; width: 100%; height: auto; margin: 4px 0 8px; }
.v-chart .gl { stroke: var(--grid); stroke-width: 1; }
.v-chart .ax { fill: var(--muted); font-size: 10px; font-family: var(--font); }
.v-chart .ax.now { fill: var(--ink); font-weight: 700; }
.v-chart .v-plan { opacity: .4; }
.v-chart .v-done { fill: var(--ink); opacity: .8; }
.v-chart .v-done.now { fill: var(--accent); opacity: 1; }
.legend i.v-key-plan { background: var(--series-1); opacity: .45; }
.legend i.v-key-done { background: var(--ink); opacity: .8; }
select.inline { width: auto; min-height: 36px; padding: 4px 8px; font-size: 14px; font-weight: 600; }
.gbars { display: grid; gap: 8px; }
.gb { display: grid; grid-template-columns: 112px minmax(0, 1fr) 44px; gap: 8px; align-items: center; font-size: 14px; }
.gb-n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gb-bar { height: 10px; background: var(--surface-2); border-radius: 5px; overflow: hidden; }
.gb-fill { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 5px; }
.gb-fill.full { background: var(--good); }
.gb-v { text-align: right; color: var(--ink-2); font-size: 13px; }

/* ---------- interruptor kg / lb por ejercicio ---------- */
.unit-sw { display: inline-flex; flex: none; border: 1px solid var(--axis); border-radius: 10px; overflow: hidden; }
.unit-sw button {
  appearance: none; border: 0; background: var(--surface-2); color: var(--ink-2);
  font: 700 14px var(--font); min-width: 46px; min-height: 36px; padding: 0 10px; cursor: pointer; touch-action: manipulation;
}
.unit-sw button + button { border-left: 1px solid var(--axis); }
.unit-sw button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
