:root {
  color-scheme: dark;
  --bg: #0b0d10;
  --surface: #13161b;
  --surface-2: #1a1e24;
  --line: rgba(255, 255, 255, 0.08);
  --muted: #9299a5;
  --text: #f7f8fa;
  --lime: #c8ff3d;
  --lime-soft: rgba(200, 255, 61, 0.12);
  --radius: 22px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { background: var(--bg); }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 95% -10%, rgba(200, 255, 61, 0.13), transparent 28rem),
    var(--bg);
  -webkit-font-smoothing: antialiased;
}

button { font: inherit; }

.app-shell {
  width: min(100%, 620px);
  min-height: 100vh;
  margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) 18px max(28px, env(safe-area-inset-bottom));
}

.hero { padding: 8px 2px 22px; }

.brand-row {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 15px;
  color: #0b0d10;
  background: var(--lime);
  font-size: 23px;
  font-weight: 950;
  transform: skew(-5deg);
  box-shadow: 0 10px 32px rgba(200, 255, 61, 0.17);
}

.eyebrow {
  margin: 0 0 3px;
  color: var(--lime);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .16em;
}

h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: 24px; letter-spacing: -.045em; }
h2 { margin-bottom: 0; font-size: 26px; letter-spacing: -.045em; }

.date-chip {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--muted);
  background: rgba(255,255,255,.025);
  font-size: 11px;
  font-weight: 750;
  text-transform: uppercase;
}

.progress-panel {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 12px;
  margin-top: 22px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(255,255,255,.055), rgba(255,255,255,.018));
}

.progress-count { display: block; font-size: 18px; font-weight: 900; }
.progress-label { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; line-height: 1.35; }
.progress-percent { color: var(--lime); font-size: 13px; font-weight: 900; }

.progress-track {
  grid-column: 1 / -1;
  height: 5px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(255,255,255,.08);
}

.progress-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--lime);
  box-shadow: 0 0 14px rgba(200, 255, 61, .6);
  transition: width .35s cubic-bezier(.2,.8,.2,1);
}

.day-tabs {
  position: sticky;
  z-index: 5;
  top: max(8px, env(safe-area-inset-top));
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(19, 22, 27, .9);
  box-shadow: 0 12px 30px rgba(0,0,0,.25);
  backdrop-filter: blur(18px);
}

.day-tab {
  display: flex;
  min-height: 47px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 0;
  border-radius: 13px;
  color: var(--muted);
  background: transparent;
  font-weight: 800;
  cursor: pointer;
}

.day-tab span {
  display: none;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 7px;
  color: #0b0d10;
  background: var(--lime);
  font-size: 11px;
}

.day-tab.active { color: var(--text); background: var(--surface-2); }
.day-tab.active span { display: grid; }
.day-tab.bonus-tab { font-size: 19px; }
.day-tab.bonus-tab.active { background: linear-gradient(145deg, rgba(200,255,61,.15), var(--surface-2)); }

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  padding: 28px 2px 14px;
}

.section-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 4px;
}

.reorder-toggle {
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--lime);
  background: var(--lime-soft);
  font-size: 10px;
  font-weight: 850;
  cursor: pointer;
}

.reorder-bar[hidden],
.reorder-controls[hidden] {
  display: none !important;
}

.reorder-bar {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 8px;
  margin-bottom: 10px;
}

.reorder-bar button {
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--text);
  background: rgba(255,255,255,.04);
  font-size: 11px;
  font-weight: 850;
  cursor: pointer;
}

.reorder-bar button:last-child {
  border-color: var(--lime);
  color: #0b0d10;
  background: var(--lime);
}

.reorder-bar button:disabled { opacity: .55; cursor: wait; }

body.reorder-mode .day-tabs { pointer-events: none; opacity: .55; }

.day-total { color: var(--muted); font-size: 12px; }
.exercise-list { display: grid; gap: 11px; }

.exercise-card.reorder-active .exercise-body {
  grid-template-columns: auto 1fr;
  gap: 8px;
}

.reorder-controls {
  display: grid;
  gap: 6px;
  align-content: center;
}

.reorder-controls button {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  background: rgba(255,255,255,.04);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

.reorder-controls button:disabled {
  opacity: .35;
  cursor: default;
}

.exercise-card.reorder-active .exercise-open,
.exercise-card.reorder-active .exercise-open-media {
  pointer-events: none;
}

.exercise-card {
  display: grid;
  grid-template-columns: 104px 1fr;
  min-height: 116px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color .2s, background .2s, transform .15s;
}

.exercise-card:active { transform: scale(.99); }
.exercise-card.completed { border-color: rgba(200,255,61,.28); background: linear-gradient(110deg, var(--lime-soft), var(--surface) 62%); }

.exercise-media {
  position: relative;
  display: block;
  width: 100%;
  min-height: 116px;
  padding: 0;
  overflow: hidden;
  border: 0;
  background: #e9eaec;
  cursor: pointer;
}

.pose {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  filter: saturate(.1) contrast(1.08);
}

.pose-end { animation: pose-cycle 3.2s ease-in-out infinite alternate; }

@keyframes pose-cycle {
  0%, 28% { opacity: 0; }
  72%, 100% { opacity: 1; }
}

.exercise-number {
  position: absolute;
  top: 8px;
  left: 8px;
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  border-radius: 8px;
  color: #0b0d10;
  background: rgba(200,255,61,.94);
  font-size: 10px;
  font-weight: 950;
  box-shadow: 0 3px 12px rgba(0,0,0,.16);
}

.media-hint {
  position: absolute;
  right: 7px;
  bottom: 7px;
  padding: 4px 7px;
  border-radius: 7px;
  color: white;
  background: rgba(11,13,16,.72);
  font-size: 8px;
  font-weight: 850;
  letter-spacing: .08em;
  text-transform: uppercase;
  backdrop-filter: blur(5px);
}

.exercise-body {
  display: grid;
  grid-template-columns: 1fr auto;
  width: 100%;
  align-items: center;
}

.exercise-open {
  align-self: stretch;
  min-width: 0;
  padding: 15px 8px 15px 16px;
  border: 0;
  color: inherit;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.exercise-copy { display: flex; min-width: 0; flex-direction: column; }
.exercise-muscle { margin-bottom: 4px; color: var(--lime); font-size: 9px; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }
.exercise-name { font-size: 15px; line-height: 1.18; }
.exercise-meta { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.exercise-prescription, .exercise-alternative { padding: 4px 7px; border-radius: 7px; background: rgba(255,255,255,.055); color: #bec3cb; font-size: 10px; font-weight: 700; }
.exercise-alternative:empty { display: none; }

.last-performance {
  margin-top: 9px;
  overflow: hidden;
  color: #8f97a2;
  font-size: 9px;
  font-weight: 650;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.last-performance.has-history { color: #c7cbd1; }

.check {
  display: grid;
  width: 31px;
  height: 31px;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 11px;
  background: rgba(255,255,255,.025);
  margin-right: 13px;
  transition: background .2s, border-color .2s, transform .2s;
  cursor: pointer;
}

.check svg { width: 18px; fill: none; stroke: transparent; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.completed .check { border-color: var(--lime); background: var(--lime); transform: rotate(-3deg) scale(1.04); }
.completed .check svg { stroke: #0b0d10; }
.completed .exercise-name { color: #dadddf; }

.rule-card {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  padding: 17px;
  border: 1px dashed rgba(200,255,61,.25);
  border-radius: 18px;
  background: rgba(200,255,61,.05);
}

.rule-icon { display: grid; width: 31px; height: 31px; flex: 0 0 auto; place-items: center; border-radius: 10px; color: #0b0d10; background: var(--lime); font-weight: 950; }
.rule-card h3 { margin-bottom: 4px; font-size: 14px; }
.rule-card p { margin-bottom: 0; color: var(--muted); font-size: 11px; line-height: 1.5; }

footer { display: flex; justify-content: space-between; padding: 30px 2px 4px; color: #606773; font-size: 10px; }
footer span:first-child { color: var(--lime); font-weight: 900; }

.loading-card {
  height: 116px;
  border-radius: var(--radius);
  background: linear-gradient(100deg, var(--surface) 20%, var(--surface-2) 40%, var(--surface) 60%);
  background-size: 200% 100%;
  animation: shimmer 1.3s infinite;
}

@keyframes shimmer { to { background-position-x: -200%; } }

.empty-state {
  padding: 34px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  background: var(--surface);
  text-align: center;
  line-height: 1.5;
}

.empty-state strong { display: block; margin-bottom: 5px; color: var(--text); }

.toast {
  position: fixed;
  z-index: 10;
  left: 50%;
  bottom: max(22px, env(safe-area-inset-bottom));
  max-width: calc(100vw - 36px);
  padding: 11px 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  background: #23272e;
  box-shadow: 0 12px 35px rgba(0,0,0,.4);
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity .2s, transform .2s;
}

.toast.show { opacity: 1; transform: translate(-50%, 0); }

body.sheet-open { overflow: hidden; }

.sheet-backdrop {
  position: fixed;
  z-index: 30;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(0,0,0,.7);
  opacity: 0;
  transition: opacity .25s ease;
  backdrop-filter: blur(4px);
}

.sheet-backdrop[hidden] { display: none; }
.sheet-backdrop.visible { opacity: 1; }

.exercise-sheet {
  position: relative;
  width: min(100%, 620px);
  height: min(92vh, 900px);
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.1);
  border-bottom: 0;
  border-radius: 28px 28px 0 0;
  background: var(--bg);
  box-shadow: 0 -20px 60px rgba(0,0,0,.55);
  transform: translateY(28px);
  transition: transform .28s cubic-bezier(.2,.8,.2,1);
}

.visible .exercise-sheet { transform: translateY(0); }
.sheet-scroll { height: 100%; overflow-y: auto; overscroll-behavior: contain; padding-bottom: max(28px, env(safe-area-inset-bottom)); }
.sheet-handle { position: absolute; z-index: 4; top: 9px; left: 50%; width: 42px; height: 4px; border-radius: 99px; background: rgba(255,255,255,.5); transform: translateX(-50%); }

.sheet-close {
  position: absolute;
  z-index: 5;
  top: 17px;
  right: 16px;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 12px;
  color: white;
  background: rgba(11,13,16,.72);
  font-size: 23px;
  line-height: 1;
  cursor: pointer;
  backdrop-filter: blur(8px);
}

.sheet-hero { position: relative; height: 230px; overflow: hidden; background: #e8e9eb; }
.sheet-hero .pose { object-fit: contain; }
.sheet-equipment { position: absolute; left: 16px; bottom: 14px; padding: 7px 10px; border-radius: 9px; color: white; background: rgba(11,13,16,.78); font-size: 10px; font-weight: 800; backdrop-filter: blur(8px); }
.sheet-content { padding: 21px 18px 0; }
.sheet-description { margin: 8px 0 12px; color: var(--muted); font-size: 12px; line-height: 1.55; }

.title-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.edit-exercise { flex: 0 0 auto; padding: 7px 10px; border: 1px solid var(--line); border-radius: 9px; color: var(--lime); background: var(--lime-soft); font-size: 10px; font-weight: 850; cursor: pointer; }

.sitio-panel {
  margin: 0 0 14px;
  padding: 14px 15px 13px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
}
.sitio-panel .panel-heading { margin-bottom: 10px; }
.sitio-panel h3 { margin: 0; font-size: 14px; letter-spacing: -.02em; }
.add-sitio {
  flex: 0 0 auto;
  padding: 7px 10px;
  border: 1px solid rgba(200,255,61,.35);
  border-radius: 9px;
  color: var(--lime);
  background: var(--lime-soft);
  font-size: 10px;
  font-weight: 850;
  cursor: pointer;
}
.sitio-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.sitio-chip {
  padding: 8px 11px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 999px;
  color: var(--text);
  background: rgba(255,255,255,.04);
  font-size: 11px;
  font-weight: 750;
  cursor: pointer;
}
.sitio-chip.active {
  border-color: rgba(200,255,61,.55);
  color: #0b0d10;
  background: var(--lime);
}
.sitio-hint { margin: 9px 0 0; color: var(--muted); font-size: 11px; line-height: 1.4; }

.logger-panel, .history-panel, .guide-panel, .edit-panel {
  margin-top: 14px;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
}

.edit-panel label { display: grid; gap: 5px; margin-top: 10px; color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.edit-panel input, .edit-panel textarea { width: 100%; padding: 10px 11px; border: 1px solid rgba(255,255,255,.1); border-radius: 10px; outline: none; color: var(--text); background: #0d1014; font: inherit; font-size: 12px; line-height: 1.4; resize: vertical; text-transform: none; }
.edit-panel input:focus, .edit-panel textarea:focus { border-color: var(--lime); box-shadow: 0 0 0 3px rgba(200,255,61,.08); }
.edit-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.edit-actions { display: grid; grid-template-columns: 1fr 1.5fr; gap: 8px; margin-top: 13px; }
.edit-actions button { padding: 11px; border: 1px solid var(--line); border-radius: 11px; color: var(--text); background: rgba(255,255,255,.04); font-size: 11px; font-weight: 850; cursor: pointer; }
.edit-actions button:last-child { border-color: var(--lime); color: #0b0d10; background: var(--lime); }
.edit-actions button:disabled { opacity: .55; cursor: wait; }

.goal-panel { margin: 14px 0; padding: 17px; border: 1px solid rgba(200,255,61,.25); border-radius: 20px; background: linear-gradient(145deg, rgba(200,255,61,.11), rgba(200,255,61,.025)); }
.goal-top { display: flex; align-items: end; justify-content: space-between; gap: 12px; }
.goal-top h3 { margin: 0; font-size: 20px; letter-spacing: -.035em; }
.goal-top > strong { color: var(--lime); font-size: 18px; }
.goal-track { height: 7px; margin: 14px 0 12px; overflow: hidden; border-radius: 99px; background: rgba(255,255,255,.09); }
.goal-track div { width: 0; height: 100%; border-radius: inherit; background: var(--lime); box-shadow: 0 0 14px rgba(200,255,61,.5); transition: width .35s ease; }
.goal-sets { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin-bottom: 12px; }
.goal-panel[data-status="reward"] .goal-sets { grid-template-columns: repeat(2, 1fr); }
.goal-set { display: flex; align-items: center; justify-content: space-between; gap: 5px; padding: 9px 10px; border: 1px solid rgba(255,255,255,.08); border-radius: 11px; background: rgba(11,13,16,.32); }
.goal-set span { color: var(--muted); font-size: 8px; font-weight: 850; letter-spacing: .08em; }
.goal-set strong { font-size: 15px; }
.goal-set small { margin-left: 1px; color: var(--muted); font-size: 9px; }
.goal-set.complete { border-color: rgba(200,255,61,.5); background: rgba(200,255,61,.13); }
.goal-set.complete strong, .goal-set.complete small { color: var(--lime); }
.goal-set.ineligible { border-color: rgba(255,190,70,.3); opacity: .65; }
.goal-panel > p { margin: 0; color: #dce0e5; font-size: 12px; line-height: 1.45; }
.goal-panel .goal-action { margin-top: 5px; color: var(--lime); font-size: 11px; font-weight: 800; }
.goal-panel[data-status="earned_increase"] { border-color: var(--lime); background: linear-gradient(145deg, rgba(200,255,61,.2), rgba(200,255,61,.05)); }
.goal-panel[data-status="mixed_weight"] { border-color: rgba(255,190,70,.35); background: rgba(255,190,70,.06); }
.goal-panel[data-status="mixed_weight"] .goal-action { color: #ffc96a; }

.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.panel-heading h3 { margin-bottom: 0; font-size: 17px; letter-spacing: -.025em; }
.prescription-chip, .history-count { padding: 6px 8px; border-radius: 8px; color: var(--lime); background: var(--lime-soft); font-size: 10px; font-weight: 850; }

.metric-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin: -2px 0 12px; padding: 4px; border-radius: 11px; background: rgba(255,255,255,.035); }
.metric-tabs button { padding: 8px; border: 0; border-radius: 8px; color: var(--muted); background: transparent; font-size: 10px; font-weight: 800; cursor: pointer; }
.metric-tabs button.active { color: var(--text); background: var(--surface-2); }

.set-head, .set-row {
  display: grid;
  grid-template-columns: 28px minmax(62px, 1fr) minmax(54px, 64px) minmax(54px, 64px);
  align-items: center;
  gap: 5px;
}

.set-head { padding: 0 2px 7px; color: #737b87; font-size: 9px; font-weight: 800; text-align: center; text-transform: uppercase; }
.set-row { padding: 6px 0; border-top: 1px solid rgba(255,255,255,.055); }
.exercise-sheet[data-mode="reps"] .set-head,
.exercise-sheet[data-mode="reps"] .set-row,
.exercise-sheet[data-mode="time"] .set-head,
.exercise-sheet[data-mode="time"] .set-row {
  grid-template-columns: 28px minmax(80px, 1fr) minmax(74px, 92px);
}
.exercise-sheet[data-mode="reps"] .weight-label,
.exercise-sheet[data-mode="reps"] .weight-input,
.exercise-sheet[data-mode="time"] .weight-label,
.exercise-sheet[data-mode="time"] .weight-input {
  display: none;
}
.set-number { display: grid; width: 27px; height: 27px; place-items: center; border-radius: 8px; color: var(--lime); background: var(--lime-soft); font-size: 10px; font-weight: 900; }
.previous-set { overflow: hidden; color: #949ba6; font-size: 10px; text-align: center; text-overflow: ellipsis; white-space: nowrap; }
.previous-set { padding: 7px 2px; border: 0; border-radius: 8px; background: transparent; cursor: pointer; }
.previous-set:active { background: rgba(200,255,61,.08); }
.previous-set strong { color: #d8dbe0; font-weight: 800; }

.set-input {
  width: 100%;
  min-width: 0;
  padding: 10px 5px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 10px;
  outline: none;
  color: white;
  background: #0d1014;
  font-size: 16px;
  font-weight: 800;
  text-align: center;
  -moz-appearance: textfield;
}

.set-input::-webkit-outer-spin-button, .set-input::-webkit-inner-spin-button { margin: 0; -webkit-appearance: none; }
.set-input:focus { border-color: var(--lime); box-shadow: 0 0 0 3px rgba(200,255,61,.08); }

.set-controls { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 10px; }
.set-controls button { padding: 9px; border: 1px solid var(--line); border-radius: 10px; color: #b8bec7; background: rgba(255,255,255,.03); font-size: 10px; font-weight: 800; cursor: pointer; }
.set-controls button:disabled { opacity: .35; cursor: default; }

.save-sets {
  width: 100%;
  margin-top: 13px;
  padding: 13px 16px;
  border: 0;
  border-radius: 13px;
  color: #0b0d10;
  background: var(--lime);
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}

.save-sets:disabled { opacity: .55; cursor: wait; }
.save-status { min-height: 14px; margin: 8px 0 0; color: var(--muted); font-size: 10px; text-align: center; }

.chart-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 12px; }
.chart-stat { padding: 11px; border-radius: 12px; background: rgba(255,255,255,.035); }
.chart-stat span { display: block; color: var(--muted); font-size: 9px; }
.chart-stat strong { display: block; margin-top: 3px; font-size: 16px; }
.chart-wrap { min-height: 155px; padding: 8px 0; overflow: hidden; }
.chart-wrap svg { display: block; width: 100%; height: 155px; overflow: visible; }
.chart-grid { stroke: rgba(255,255,255,.07); stroke-width: 1; }
.chart-line { fill: none; stroke: var(--lime); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 0 5px rgba(200,255,61,.35)); }
.chart-area { fill: url(#chartGradient); }
.chart-dot { fill: var(--lime); stroke: #0b0d10; stroke-width: 3; }
.chart-label { fill: #747c87; font-size: 9px; font-weight: 700; }
.chart-empty { display: grid; min-height: 135px; place-items: center; color: var(--muted); font-size: 11px; text-align: center; }

.history-list { display: grid; gap: 7px; }
.history-entry { display: grid; grid-template-columns: 62px 1fr auto; gap: 8px; align-items: center; padding: 10px; border-radius: 11px; background: rgba(255,255,255,.03); font-size: 10px; }
.history-entry time { color: var(--muted); }
.history-sets { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-e1rm { color: var(--lime); font-weight: 850; }

.instruction-list { display: grid; gap: 10px; margin: 0; padding-left: 25px; color: #d2d5da; font-size: 12px; line-height: 1.45; }
.instruction-list li::marker { color: var(--lime); font-weight: 900; }
.tip-list { display: grid; gap: 7px; margin-top: 14px; }
.tip { padding: 10px 11px; border-left: 2px solid var(--lime); border-radius: 0 9px 9px 0; color: #aab0b9; background: var(--lime-soft); font-size: 10px; line-height: 1.45; }

.weight-panel {
  margin-top: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.weight-panel .panel-heading { display: flex; align-items: end; justify-content: space-between; gap: 12px; }
.weight-panel h2 { font-size: 22px; }
.weight-change { color: var(--lime); font-size: 11px; font-weight: 850; text-align: right; }
.weight-explainer { margin: 10px 0 16px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.weight-form { display: grid; gap: 10px; padding: 13px; border-radius: 16px; background: rgba(255,255,255,.035); }
.weight-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.weight-form label { display: grid; gap: 5px; color: var(--muted); font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.weight-form input, .weight-form select {
  width: 100%; min-width: 0; padding: 11px; border: 1px solid var(--line); border-radius: 11px;
  color: var(--text); background: #111419; font-size: 13px; font-weight: 750; color-scheme: dark;
}
.weight-form input:focus, .weight-form select:focus { outline: none; border-color: var(--lime); box-shadow: 0 0 0 3px rgba(200,255,61,.08); }
.weight-form button { padding: 12px; border: 0; border-radius: 12px; color: #0b0d10; background: var(--lime); font-size: 12px; font-weight: 900; cursor: pointer; }
.weight-form button:disabled { opacity: .55; cursor: wait; }
.weight-filters { display: flex; gap: 6px; margin: 15px 0 12px; overflow-x: auto; scrollbar-width: none; }
.weight-filters::-webkit-scrollbar { display: none; }
.weight-filter { flex: 0 0 auto; padding: 8px 10px; border: 1px solid var(--line); border-radius: 99px; color: var(--muted); background: transparent; font-size: 10px; font-weight: 800; cursor: pointer; }
.weight-filter.active { border-color: rgba(200,255,61,.35); color: var(--text); background: var(--lime-soft); }
.weight-summary { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.weight-stat { padding: 11px; border-radius: 12px; background: rgba(255,255,255,.035); }
.weight-stat span { display: block; color: var(--muted); font-size: 9px; }
.weight-stat strong { display: block; margin-top: 3px; font-size: 17px; }
.weight-chart { min-height: 165px; margin-top: 8px; overflow: hidden; }
.weight-chart svg { display: block; width: 100%; height: 165px; overflow: visible; }
.weight-history { display: grid; gap: 6px; margin-top: 5px; }
.weight-history-row { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; padding: 9px 10px; border-radius: 10px; background: rgba(255,255,255,.025); font-size: 10px; }
.weight-history-row time { color: var(--muted); }
.weight-history-row strong { font-size: 12px; }
.weight-delta { min-width: 44px; color: var(--muted); font-weight: 800; text-align: right; }
.weight-delta.up { color: var(--lime); }
.weight-delta.down { color: #ff9b9b; }

.exercise-card.bilbo-hero {
  grid-template-columns: 92px 1fr;
  min-height: 168px;
  border-color: rgba(200, 255, 61, 0.28);
  background: linear-gradient(145deg, rgba(200, 255, 61, 0.09), var(--surface) 58%);
}

.exercise-card.bilbo-hero .exercise-media { min-height: 168px; }

.bilbo-card-load {
  display: grid;
  gap: 2px;
  margin-top: 6px;
  text-align: left;
}

.bilbo-card-kg {
  color: var(--lime);
  font-size: 34px;
  font-weight: 950;
  letter-spacing: -0.07em;
  line-height: 0.95;
}

.bilbo-card-recipe,
.bilbo-card-cue {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.35;
}

.bilbo-card-cue { color: #dce3ea; }

.bilbo-card-status {
  color: var(--lime);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

.bilbo-sleep {
  margin: 14px 0 4px;
  border: 1px dashed rgba(200, 255, 61, 0.22);
  border-radius: 18px;
  background:
    repeating-linear-gradient(
      -18deg,
      rgba(255, 255, 255, 0.015) 0 8px,
      transparent 8px 16px
    ),
    rgba(255, 255, 255, 0.02);
  overflow: hidden;
}

.bilbo-sleep.open {
  border-style: solid;
  border-color: rgba(200, 255, 61, 0.28);
  background: linear-gradient(165deg, rgba(200, 255, 61, 0.08), rgba(255, 255, 255, 0.02) 55%);
}

.bilbo-sleep-lid {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  width: 100%;
  padding: 12px 14px;
  border: 0;
  color: inherit;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.bilbo-sleep-zzz {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 14px;
  color: var(--lime);
  background: rgba(200, 255, 61, 0.1);
  font-size: 13px;
  font-weight: 950;
  letter-spacing: 0.04em;
  transform: rotate(-8deg);
}

.bilbo-sleep-zzz span {
  display: inline-block;
  opacity: 0.45;
  transform: translate(3px, -4px) scale(0.82);
}

.bilbo-sleep-zzz span + span {
  opacity: 0.25;
  transform: translate(7px, -9px) scale(0.68);
}

.bilbo-sleep.open .bilbo-sleep-zzz {
  transform: rotate(0deg);
  background: var(--lime);
  color: #0b0d10;
}

.bilbo-sleep-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.bilbo-sleep-copy strong {
  font-size: 14px;
  font-weight: 850;
  letter-spacing: -0.03em;
}

.bilbo-sleep-copy span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.bilbo-sleep-cta {
  padding: 6px 10px;
  border: 1px solid rgba(200, 255, 61, 0.28);
  border-radius: 999px;
  color: var(--lime);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: lowercase;
}

.bilbo-sleep.open .bilbo-sleep-cta {
  color: #0b0d10;
  background: var(--lime);
  border-color: transparent;
}

.bilbo-sleep-body {
  display: grid;
  gap: 4px;
  padding: 0 16px 14px 68px;
}

.bilbo-sleep-body .eyebrow { margin-bottom: 2px; }

#bilbo-sleep-kg {
  color: var(--lime);
  font-size: 32px;
  font-weight: 950;
  letter-spacing: -0.06em;
  line-height: 0.95;
}

#bilbo-sleep-name,
#bilbo-sleep-recipe,
#bilbo-sleep-last {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}

#bilbo-sleep-name { color: var(--text); font-size: 13px; }

#bilbo-sleep-open {
  margin-top: 8px;
  justify-self: start;
  min-height: 40px;
  padding: 0 14px;
  border: 0;
  border-radius: 12px;
  color: #0b0d10;
  background: var(--lime);
  font-size: 13px;
  font-weight: 850;
  cursor: pointer;
}

.bilbo-offday {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-size: 13px;
  font-weight: 750;
}

.bilbo-wave-panel {
  margin: 0 0 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.bilbo-wave-meta {
  display: grid;
  gap: 2px;
  margin-bottom: 10px;
}

.bilbo-wave-meta strong {
  font-size: 18px;
  font-weight: 900;
  letter-spacing: -0.03em;
}

#bilbo-wave-stats {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.bilbo-wave-chart {
  min-height: 150px;
  margin-bottom: 12px;
}

.bilbo-wave-chart svg { width: 100%; height: auto; display: block; }
.bilbo-wave-ghost { fill: none; stroke: rgba(232, 237, 243, 0.28); stroke-width: 2; stroke-dasharray: 4 4; }
.bilbo-wave-line { fill: none; stroke: var(--lime); stroke-width: 2.5; }
.bilbo-wave-area { fill: url(#bilboWaveGrad); }
.bilbo-wave-dot { fill: var(--lime); }
.bilbo-wave-dot.prev { fill: rgba(232, 237, 243, 0.45); }
.bilbo-wave-guide { stroke: rgba(255,255,255,0.12); stroke-width: 1; stroke-dasharray: 3 4; }
.bilbo-wave-label { fill: var(--muted); font-size: 10px; font-weight: 700; }

.bilbo-wave-track {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.bilbo-wave-bar {
  position: relative;
  height: 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  overflow: visible;
}

.bilbo-wave-bar i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(200,255,61,0.35), var(--lime));
}

.bilbo-wave-bar b {
  position: absolute;
  top: 50%;
  left: 0;
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
  border-radius: 50%;
  background: #0b0d10;
  border: 2px solid var(--lime);
}

.bilbo-after {
  margin: 0 0 16px;
  padding: 12px;
  border-radius: 16px;
  background: rgba(0,0,0,0.22);
}

.bilbo-next-row {
  display: grid;
  grid-template-columns: 48px 1fr 48px;
  gap: 10px;
  align-items: center;
  margin: 8px 0 12px;
}

.bilbo-next-row strong {
  text-align: center;
  font-size: 28px;
  font-weight: 950;
  letter-spacing: -0.04em;
  color: var(--lime);
}

.bilbo-next-row button,
.bilbo-pace button,
.bilbo-nudge-actions button,
#bilbo-close-cycle {
  min-height: 44px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.bilbo-next-row button {
  border: 1px solid var(--line);
  color: var(--text);
  background: transparent;
  font-size: 22px;
}

.bilbo-pace {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 10px;
}

.bilbo-pace button {
  border: 1px solid var(--line);
  color: var(--text);
  background: transparent;
}

.bilbo-pace button.active {
  border-color: var(--lime);
  color: #0b0d10;
  background: var(--lime);
}

.bilbo-nudge {
  margin: 0 0 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(200,255,61,0.1);
}

.bilbo-nudge p {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
}

.bilbo-nudge-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

#bilbo-nudge-dismiss {
  border: 1px solid var(--line);
  color: var(--text);
  background: transparent;
}

#bilbo-nudge-accept {
  border: 0;
  color: #0b0d10;
  background: var(--lime);
}

#bilbo-close-cycle {
  width: 100%;
  border: 1px solid var(--line);
  color: var(--muted);
  background: transparent;
}

.bilbo-advanced {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.bilbo-advanced summary {
  cursor: pointer;
  margin-bottom: 8px;
}

.bilbo-settings {
  display: grid;
  gap: 8px;
  margin-top: 4px;
}

.bilbo-settings label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.bilbo-settings input {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  background: #101318;
  font-size: 16px;
  font-weight: 800;
}

.bilbo-settings-actions {
  display: grid;
  gap: 8px;
}

.bilbo-settings-actions button {
  min-height: 44px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

#bilbo-save-adjust {
  border: 0;
  color: #0b0d10;
  background: var(--lime);
}

.bilbo-panel {
  margin: 14px 0;
  padding: 18px 16px 16px;
  border: 1px solid rgba(200, 255, 61, 0.28);
  border-radius: 22px;
  background: linear-gradient(145deg, rgba(200, 255, 61, 0.12), rgba(255, 255, 255, 0.02));
}

.bilbo-cues {
  margin: 0 0 16px;
  padding-left: 18px;
  color: #e8edf3;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.45;
}

.bilbo-cues li { margin: 0 0 6px; }

.bilbo-load { text-align: center; margin-bottom: 18px; }
.bilbo-load .eyebrow { margin-bottom: 4px; }
#bilbo-weight {
  display: block;
  color: var(--lime);
  font-size: 56px;
  font-weight: 950;
  letter-spacing: -0.07em;
  line-height: 0.92;
}
#bilbo-recipe, #bilbo-pr {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 750;
}
#bilbo-pr { color: var(--text); }

.bilbo-step-label {
  margin: 0 0 10px;
  text-align: center;
  font-size: 15px;
  font-weight: 800;
}

.bilbo-stepper {
  display: grid;
  grid-template-columns: 64px 1fr 64px;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}

.bilbo-stepper button {
  width: 64px;
  height: 64px;
  border: 1px solid var(--line);
  border-radius: 18px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
  font-size: 32px;
  font-weight: 400;
  line-height: 1;
  cursor: pointer;
}

.bilbo-stepper input {
  width: 100%;
  height: 64px;
  border: 1px solid var(--lime);
  border-radius: 18px;
  color: var(--text);
  background: #101318;
  font-size: 32px;
  font-weight: 900;
  text-align: center;
}

.bilbo-stepper.compact {
  grid-template-columns: 44px 1fr 44px;
  margin: 0;
}

.bilbo-stepper.compact button,
.bilbo-stepper.compact input {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  font-size: 20px;
}

.bilbo-stepper.compact input { width: 100%; }

.bilbo-primary {
  width: 100%;
  min-height: 54px;
  border: 0;
  border-radius: 16px;
  color: #0b0d10;
  background: var(--lime);
  font-size: 16px;
  font-weight: 900;
  cursor: pointer;
}

.bilbo-primary:disabled { opacity: 0.55; cursor: wait; }

.bilbo-rest { text-align: center; padding: 8px 0 4px; }
#bilbo-timer {
  display: block;
  margin: 6px 0 8px;
  font-size: 48px;
  font-weight: 950;
  letter-spacing: -0.06em;
}
.bilbo-rest p { color: var(--muted); }
#bilbo-skip-rest {
  margin-top: 8px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  background: transparent;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.bilbo-acc-recipe {
  margin: 0 0 12px;
  color: var(--lime);
  font-size: 16px;
  font-weight: 850;
}

.bilbo-acc-rows { display: grid; gap: 10px; margin-bottom: 14px; }

.bilbo-acc-row {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  gap: 8px;
  align-items: center;
}

.bilbo-acc-label { font-size: 13px; font-weight: 800; }
.bilbo-acc-prev { color: var(--muted); font-size: 11px; }

.exercise-sheet[data-mode="bilbo"] .sitio-panel {
  opacity: 0.72;
}

@media (min-width: 560px) {
  .exercise-card { grid-template-columns: 126px 1fr; }
  .exercise-card.bilbo-hero { grid-template-columns: 126px 1fr; }
  .exercise-name { font-size: 16px; }
  .bilbo-card-kg { font-size: 40px; }
  #bilbo-weight { font-size: 64px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .pose-end { opacity: 0; }
}
