/* ============================================================
   PROTOCOL // Fitness Tracker — synthwave theme
   Palette & fonts carried over from fitness_protocol.html
   ============================================================ */
:root {
  --bg: #0a0a18;
  --surface: #120d24;
  --surface2: #1a1030;
  --pink: #ff2d78;
  --cyan: #00f0ff;
  --gold: #ffd700;
  --orange: #ff6b35;
  --purple: #b44fff;
  --green: #00ff9f;
  --red: #ff3355;
  --text: #e8e0f0;
  --muted: #a294c4;
  --border: rgba(0,240,255,0.15);
  --border-pink: rgba(255,45,120,0.25);
  /* Make native form controls (date picker, number spinners, dropdowns) dark. */
  color-scheme: dark;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Rajdhani', sans-serif;
  font-size: 18.5px;
  line-height: 1.55;
  min-height: 100vh;
  overflow-x: hidden;
  overscroll-behavior-y: contain; /* no accidental pull-to-refresh mid-workout */
}

/* Kill the 300ms double-tap zoom + grey tap flash on all controls — matters
   most for rapid ± stepper taps, which double-tap zoom would otherwise hijack. */
button, input, select, textarea, label {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

/* Grid + scanline ambiance */
body::before {
  content: ''; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(0,240,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,240,255,0.03) 1px, transparent 1px);
  background-size: 40px 40px;
}
body::after {
  content: ''; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0,0,0,0.07) 2px, rgba(0,0,0,0.07) 4px);
}

.hidden { display: none !important; }

/* ---------- Buttons ---------- */
.btn {
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  padding: 12px 20px;
  border-radius: 8px;
  cursor: pointer;
  transition: all .18s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-sm { padding: 7px 12px; font-size: 11px; }
.btn-primary {
  background: linear-gradient(135deg, var(--pink), var(--purple));
  border: none; color: #fff;
  box-shadow: 0 0 18px rgba(255,45,120,0.35);
}
.btn-primary:hover { box-shadow: 0 0 26px rgba(255,45,120,0.55); }
.btn-cyan {
  background: linear-gradient(135deg, var(--cyan), #0090ff);
  border: none; color: #04121a;
  box-shadow: 0 0 18px rgba(0,240,255,0.3);
}
.btn-ghost { background: transparent; }
.btn-ghost:hover { border-color: var(--pink); color: var(--pink); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

/* ---------- Auth gate ---------- */
.gate {
  position: fixed; inset: 0; z-index: 50;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 50% 30%, rgba(180,79,255,0.12), var(--bg) 60%);
}
.gate-box {
  position: relative; z-index: 1;
  width: min(360px, 88vw); text-align: center;
  background: var(--surface);
  border: 1px solid var(--border-pink);
  border-radius: 14px; padding: 40px 30px;
  box-shadow: 0 0 50px rgba(255,45,120,0.18);
}
.gate-title {
  font-family: 'Orbitron'; font-weight: 900; font-size: 20px;
  color: var(--pink); letter-spacing: 2px; margin-bottom: 8px;
}
.gate-sub { font-family: 'Share Tech Mono'; color: var(--muted); font-size: 13px; margin-bottom: 24px; }
.gate input {
  width: 100%; text-align: center; font-family: 'Share Tech Mono';
  font-size: 22px; letter-spacing: 6px; color: var(--cyan);
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 8px; padding: 14px; margin-bottom: 16px; outline: none;
}
.gate input:focus { border-color: var(--cyan); box-shadow: 0 0 16px rgba(0,240,255,0.25); }
.gate .btn { width: 100%; }
.gate-error {
  font-family: 'Share Tech Mono'; color: var(--red); font-size: 12px;
  margin-top: 14px; opacity: 0; transition: opacity .2s;
}
.gate-error.visible { opacity: 1; }

/* ---------- Top bar / tabs ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 18px;
  padding: 12px 22px;
  background: rgba(10,10,24,0.82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: baseline; gap: 8px; }
.brand-mark { color: var(--pink); font-size: 14px; filter: drop-shadow(0 0 6px var(--pink)); }
.brand-name { font-family: 'Orbitron'; font-weight: 900; font-size: 18px; letter-spacing: 2px;
  background: linear-gradient(135deg, var(--pink), var(--cyan)); -webkit-background-clip: text;
  background-clip: text; -webkit-text-fill-color: transparent; }
.brand-sub { font-family: 'Share Tech Mono'; font-size: 10px; color: var(--muted); letter-spacing: 2px; }
.tabs { display: flex; gap: 6px; margin-left: auto; }
.tab {
  font-family: 'Orbitron'; font-weight: 700; font-size: 13px; letter-spacing: 1.5px;
  background: transparent; color: var(--muted); border: none;
  padding: 9px 16px; border-radius: 7px; cursor: pointer; transition: all .18s;
}
.tab:hover { color: var(--text); }
.tab.active { color: #fff; background: var(--surface2); box-shadow: inset 0 -2px 0 var(--pink); }
#logout-btn { margin-left: 6px; }

/* ---------- Layout ---------- */
.container { max-width: 1040px; margin: 0 auto; padding: 28px 22px 80px; position: relative; z-index: 1; }
.view { display: none; animation: fade .25s ease; }
.view.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.view-head { margin-bottom: 22px; }
.view-title {
  font-family: 'Orbitron'; font-weight: 900; font-size: clamp(22px, 4vw, 32px);
  letter-spacing: 1px; margin-bottom: 4px;
}
.view-sub { font-family: 'Share Tech Mono'; color: var(--muted); font-size: 13px; letter-spacing: 1px; }

/* ---------- Cards ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 20px; margin-bottom: 18px;
}
.card-title {
  font-family: 'Orbitron'; font-weight: 700; font-size: 15px; letter-spacing: 1.5px;
  text-transform: uppercase; color: var(--cyan); margin-bottom: 14px;
  display: flex; align-items: center; gap: 8px;
}
.card-title .accent-pink { color: var(--pink); }
.card-action { margin-left: auto; width: auto; -webkit-appearance: none; appearance: none; cursor: pointer;
  font-family: 'Share Tech Mono'; font-size: 12px; letter-spacing: .5px; text-transform: none;
  background: var(--surface2); border: 1px solid var(--border); color: var(--cyan); border-radius: 7px; padding: 6px 11px; }
.card-action:hover { border-color: var(--cyan); }

/* ---------- Quick-log strip ---------- */
.quicklog .ql-tabs { display: flex; gap: 8px; }
.ql-tab { width: auto; flex: 1 1 0; -webkit-appearance: none; appearance: none; cursor: pointer;
  font-family: 'Share Tech Mono'; font-size: 13px; letter-spacing: .5px;
  background: var(--surface2); border: 1px solid var(--border); color: var(--text);
  border-radius: 8px; padding: 11px 8px; transition: all .15s; white-space: nowrap; }
.ql-tab:hover { border-color: var(--cyan); }
.ql-tab.active { color: #fff; border-color: var(--cyan); box-shadow: inset 0 -2px 0 var(--cyan); }
.ql-panel { margin-top: 14px; }
.recent-toggle { width: 100%; -webkit-appearance: none; appearance: none; cursor: pointer; margin-top: 10px;
  background: transparent; border: 1px dashed var(--border); color: var(--cyan); border-radius: 8px;
  padding: 9px; font-family: 'Share Tech Mono'; font-size: 12px; }
.recent-toggle:hover { border-color: var(--cyan); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 720px) { .grid-2 { grid-template-columns: 1fr; } }

/* ---------- Forms ---------- */
/* Theme ALL controls globally (incl. set-grid inputs that aren't inside .field). */
input, select, textarea {
  width: 100%; max-width: 100%; min-width: 0; box-sizing: border-box;
  font-family: 'Rajdhani', sans-serif; font-size: 17px; font-weight: 500;
  color: var(--text); background: var(--surface2); border: 1px solid var(--border);
  border-radius: 8px; padding: 11px 12px; outline: none; transition: border-color .15s, box-shadow .15s;
  -webkit-appearance: none; appearance: none;
}
input[type="checkbox"] { -webkit-appearance: auto; appearance: auto; accent-color: var(--pink); }
/* Hide the noisy native number spinners (we have our own flow). */
input[type="number"] { -moz-appearance: textfield; }
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .8; }
input:focus, select:focus, textarea:focus {
  border-color: var(--cyan); background: var(--bg); box-shadow: 0 0 12px rgba(0,240,255,0.18);
}
/* Dark native date-picker indicator */
input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(0.8); cursor: pointer; }

.field { margin-bottom: 14px; }
.field label {
  display: block; font-family: 'Share Tech Mono'; font-size: 12px;
  letter-spacing: 1px; text-transform: uppercase; color: var(--muted); margin-bottom: 6px;
}
.field-row { display: flex; gap: 12px; }
.field-row .field { flex: 1; min-width: 0; }
.inline-check { display: flex; align-items: center; gap: 8px; }
.inline-check input { width: auto; }

/* ---------- Exercise logging rows ---------- */
.exercise {
  border: 1px solid var(--border); border-radius: 10px;
  padding: 14px; margin-bottom: 12px; background: var(--surface2);
}
.exercise-head { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 6px; flex-wrap: nowrap;
  -webkit-user-select: none; user-select: none; } /* tap-to-collapse shouldn't trigger text selection */
.exercise-name { font-family: 'Orbitron'; font-weight: 700; font-size: 16px; flex: 1 1 auto; min-width: 0; line-height: 1.3; }
/* width:max-content forces the container to fit its buttons (Firefox otherwise
   sizes this flex item smaller than its content, spilling the last button).
   margin-left:auto pins it right; flex-wrap drops it to a new line if truly cramped. */
.ex-head-tools { display: flex; align-items: center; gap: 6px; flex: 0 0 auto;
  width: max-content; margin-left: auto; }

/* Uniform icon-only action buttons (consistent regardless of name length) */
.icon-btn { width: 38px; min-width: 38px; height: 38px; flex: 0 0 38px; display: inline-flex; align-items: center; justify-content: center;
  padding: 0; -webkit-appearance: none; appearance: none; cursor: pointer; line-height: 1;
  background: var(--surface2); border: 1px solid var(--border); color: var(--text);
  border-radius: 8px; font-family: 'Share Tech Mono'; font-size: 16px; transition: all .15s; }
.icon-btn.use-last, .icon-btn.ex-info { color: var(--cyan); }
.icon-btn.use-last:hover, .icon-btn.ex-info:hover { border-color: var(--cyan); background: rgba(0,240,255,0.08); }
.icon-btn.ex-remove { color: var(--muted); }
.icon-btn.ex-remove:hover { border-color: var(--red); color: var(--red); }
.icon-btn.ex-menu { color: var(--muted); }
.icon-btn.ex-menu:hover { border-color: var(--cyan); color: var(--cyan); }

/* ---------- Today banner ---------- */
.today-banner { font-family: 'Share Tech Mono'; font-size: 13px; color: var(--muted);
  border: 1px solid var(--border); border-left: 3px solid var(--cyan); border-radius: 8px;
  padding: 10px 14px; margin-bottom: 16px; }
.today-banner.done { color: var(--green); border-left-color: var(--green); }

/* ---------- Collapse + reorder ---------- */
.ex-collapse { width: auto; min-width: 0; -webkit-appearance: none; appearance: none; background: transparent;
  border: none; color: var(--muted); cursor: pointer; font-size: 13px; padding: 2px 6px 2px 0;
  flex: 0 0 auto; transition: transform .15s; }
.exercise.collapsed .ex-collapse { transform: rotate(-90deg); }
.exercise-name { cursor: pointer; }
.exercise.collapsed .ex-body { display: none; }
.ex-actions { display: flex; gap: 8px; margin: 6px 0 4px; flex-wrap: wrap; }
.ex-actions[hidden] { display: none; }
.ex-act { width: auto; -webkit-appearance: none; appearance: none; cursor: pointer;
  font-family: 'Share Tech Mono'; font-size: 13px; padding: 8px 12px; border-radius: 7px;
  background: var(--surface2); border: 1px solid var(--border); color: var(--text); }
.ex-act:hover { border-color: var(--cyan); color: var(--cyan); }
.ex-act-rm:hover { border-color: var(--red); color: var(--red); }

/* ---------- Warm-up calculator ---------- */
.wu-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.wu-row label { font-family: 'Share Tech Mono'; font-size: 12px; color: var(--muted); white-space: nowrap; }
.wu-row input { max-width: 130px; }
.wu-set { display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  padding: 6px 0; border-bottom: 1px solid var(--border); font-family: 'Rajdhani'; font-size: 15px; }
.wu-set b { font-weight: 700; }
.wu-set .muted { font-family: 'Share Tech Mono'; font-size: 12px; }
.wu-work b { color: var(--green); }
.exercise-target { font-family: 'Share Tech Mono'; font-size: 13px; color: var(--gold); }
.exercise-last { font-family: 'Share Tech Mono'; font-size: 13.5px; color: var(--muted); margin-bottom: 2px; line-height: 1.5; }
.exercise-last b { color: var(--green); }
.exercise-tgt { font-family: 'Share Tech Mono'; font-size: 12px; color: var(--gold); margin-bottom: 10px; }
.exercise-last b { color: var(--green); }
.set-grid { display: grid; grid-template-columns: 30px 1fr 1fr 44px; gap: 8px; align-items: center; }
.set-grid.done input[type="number"] { opacity: .55; border-color: var(--green); }
.set-grid input.beat { border-color: var(--green); box-shadow: inset 0 0 0 1px rgba(0,255,159,0.25); }
/* Done checkbox: 24px visual box inside a ≥44px label so the tap target is
   thumb-sized (it's the most-tapped control in the app). */
.set-done-wrap { display: flex; align-items: center; justify-content: center; align-self: stretch;
  min-height: 44px; cursor: pointer; -webkit-user-select: none; user-select: none; }
.set-done { width: 24px; height: 24px; accent-color: var(--green); cursor: pointer; }
.set-grid-head:last-child { text-align: center; }
/* ± steppers flanking weight/reps — faster than the keypad mid-set. */
.stp-wrap { display: flex; align-items: stretch; gap: 4px; min-width: 0; }
.stp-wrap input { flex: 1 1 auto; min-width: 0; text-align: center; padding-left: 4px; padding-right: 4px;
  font-variant-numeric: tabular-nums; } /* digits don't wobble while stepping */
.stp { flex: 0 0 32px; width: 32px; -webkit-appearance: none; appearance: none; cursor: pointer; padding: 0;
  background: var(--surface); border: 1px solid var(--border); color: var(--cyan); border-radius: 7px;
  font-family: 'Share Tech Mono'; font-size: 17px; line-height: 1;
  touch-action: manipulation; -webkit-user-select: none; user-select: none; }
.stp:hover { border-color: var(--cyan); }
.stp:active { background: rgba(0,240,255,0.14); border-color: var(--cyan); }
.use-last { width: auto; -webkit-appearance: none; appearance: none; cursor: pointer;
  font-family: 'Share Tech Mono'; font-size: 12px; letter-spacing: .5px;
  background: var(--surface2); border: 1px solid var(--cyan); color: var(--cyan);
  border-radius: 7px; padding: 5px 10px; }
.use-last:hover { background: rgba(0,240,255,0.1); }
.ex-note { margin-top: 9px; font-size: 14px !important; padding: 8px 10px !important; }
.session-elapsed { font-family: 'Share Tech Mono'; font-size: 13px; color: var(--green); margin-left: auto; font-weight: 400; }
.card-title { justify-content: flex-start; }
.set-grid .set-no { font-family: 'Share Tech Mono'; color: var(--muted); font-size: 12px; text-align: center; }
.set-grid input { padding: 8px; font-size: 15px; }
.set-grid-head { font-family: 'Share Tech Mono'; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }

/* ---------- Pills / badges ---------- */
.pill {
  display: inline-block; font-family: 'Share Tech Mono'; font-size: 11px;
  padding: 3px 9px; border-radius: 20px; letter-spacing: .5px;
  border: 1px solid var(--border);
}
.pill-pink { color: var(--pink); border-color: var(--border-pink); }
.pill-cyan { color: var(--cyan); }
.pill-gold { color: var(--gold); border-color: rgba(255,215,0,0.3); }
.pill-green { color: var(--green); }
.pill-red { color: var(--red); border-color: rgba(255,51,85,0.3); }

/* ---------- Day selector ---------- */
.day-select { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.day-btn {
  font-family: 'Orbitron'; font-weight: 700; font-size: 12px; letter-spacing: 1px;
  padding: 10px 16px; border-radius: 8px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border); color: var(--muted);
  transition: all .15s;
}
.day-btn:hover { color: var(--text); border-color: var(--cyan); }
.day-btn.active { color: #fff; background: linear-gradient(135deg, var(--purple), var(--pink)); border: none; }

/* ---------- Tables / history ---------- */
.table { width: 100%; border-collapse: collapse; font-size: 15px; }
.table th, .table td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--border); }
.table th { font-family: 'Share Tech Mono'; font-size: 10px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); }
.table td { font-family: 'Rajdhani'; font-weight: 500; }
.table tr:hover td { background: rgba(255,255,255,0.02); }
.del-x { color: var(--muted); cursor: pointer; font-family: 'Share Tech Mono'; }
.del-x:hover { color: var(--red); }

/* ---------- Stats row ---------- */
.stats { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 18px; }
.stat {
  flex: 1; min-width: 130px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px;
}
.stat-label { font-family: 'Share Tech Mono'; font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); }
.stat-value { font-family: 'Orbitron'; font-weight: 900; font-size: 26px; margin-top: 4px; }
.stat-value small { font-size: 13px; color: var(--muted); font-weight: 400; }
.c-pink { color: var(--pink); } .c-cyan { color: var(--cyan); } .c-gold { color: var(--gold); }
.c-green { color: var(--green); } .c-purple { color: var(--purple); } .c-orange { color: var(--orange); }

/* ---------- Charts ---------- */
.chart-wrap { position: relative; height: 320px; }
.chart-controls { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.range-btn {
  font-family: 'Share Tech Mono'; font-size: 11px; padding: 5px 12px; border-radius: 6px;
  background: var(--surface2); border: 1px solid var(--border); color: var(--muted); cursor: pointer;
}
.range-btn.active { color: var(--cyan); border-color: var(--cyan); }
.chart-select { max-width: 280px; }

/* ---------- Protocol reference ---------- */
.subnav { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 22px;
  border-bottom: 1px solid var(--border); padding-bottom: 12px; }
.subnav button {
  font-family: 'Orbitron'; font-weight: 700; font-size: 11px; letter-spacing: 1px;
  padding: 8px 13px; border-radius: 7px; cursor: pointer;
  background: transparent; border: 1px solid transparent; color: var(--muted); transition: all .15s;
}
.subnav button:hover { color: var(--text); }
.subnav button.active { color: #fff; background: var(--surface2); border-color: var(--border); }
.proto-table { width: 100%; border-collapse: collapse; font-size: 15px; margin-bottom: 8px; table-layout: fixed; }
.proto-table th, .proto-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: top; overflow-wrap: anywhere; }
.proto-table th { font-family: 'Share Tech Mono'; font-size: 10px; letter-spacing: 1px; text-transform: uppercase; color: var(--cyan); }
.proto-h { font-family: 'Orbitron'; font-weight: 700; font-size: 15px; letter-spacing: 1px;
  color: var(--pink); margin: 22px 0 10px; }
.muted { color: var(--muted); }
.flag-list { list-style: none; }
.flag-list li { padding: 7px 0 7px 22px; position: relative; border-bottom: 1px solid var(--border); font-size: 14px; }
.flag-list li::before { content: '▸'; position: absolute; left: 4px; color: var(--cyan); }
.flag-red li::before { color: var(--red); }
.flag-yellow li::before { color: var(--gold); }
.flag-green li::before { color: var(--green); }

/* ---------- Toast ---------- */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--surface2); border: 1px solid var(--cyan); color: var(--text);
  font-family: 'Share Tech Mono'; font-size: 13px; padding: 12px 22px; border-radius: 8px;
  opacity: 0; pointer-events: none; transition: all .25s; z-index: 60;
  box-shadow: 0 0 22px rgba(0,240,255,0.25);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { border-color: var(--red); box-shadow: 0 0 22px rgba(255,51,85,0.25); }
.toast .toast-msg { display: inline-flex; align-items: center; }
.toast .toast-undo { -webkit-appearance: none; appearance: none; cursor: pointer; margin-left: 14px;
  background: transparent; border: 1px solid var(--cyan); color: var(--cyan);
  border-radius: 6px; padding: 5px 12px; font-family: 'Share Tech Mono'; font-size: 12px; font-weight: 700;
  letter-spacing: .5px; pointer-events: auto; }
.toast .toast-undo:hover { background: rgba(0,240,255,0.12); }
/* When the toast carries an action it needs to receive taps. */
.toast.show { pointer-events: auto; }

/* ---------- Edit icon + modal ---------- */
.edit-x { color: var(--muted); cursor: pointer; font-family: 'Share Tech Mono'; margin-right: 14px; }
.edit-x:hover { color: var(--cyan); }
.modal-overlay { position: fixed; inset: 0; z-index: 80; background: rgba(5,5,12,0.72); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal { width: min(480px, 94vw); max-height: 88vh; overflow-y: auto; background: var(--surface);
  border: 1px solid var(--border-pink); border-radius: 14px; box-shadow: 0 0 50px rgba(255,45,120,0.2); }
/* Reaching the end of modal content must not chain-scroll the page behind it. */
.modal, .pick-list { overscroll-behavior: contain; }
.modal-head { font-family: 'Orbitron'; font-weight: 700; font-size: 16px; letter-spacing: 1px; color: var(--cyan);
  padding: 18px 20px; border-bottom: 1px solid var(--border); }
.modal-body { padding: 18px 20px; }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; padding: 14px 20px; border-top: 1px solid var(--border); }
.modal-foot .btn { width: auto; }
/* Workout editor — grouped by exercise */
.modal-set { display: grid; grid-template-columns: 20px 1fr 1fr 34px; gap: 8px; align-items: center; margin-bottom: 7px; counter-increment: meset; }
.modal-set::before { content: counter(meset); font-family: 'Share Tech Mono'; font-size: 12px; color: var(--muted); text-align: center; }
.modal-set input { padding: 9px 8px; }
.ms-rm { width: 34px; height: 34px; -webkit-appearance: none; appearance: none; cursor: pointer; padding: 0;
  background: transparent; border: 1px solid var(--border); color: var(--muted); border-radius: 6px; font-family: 'Share Tech Mono'; }
.ms-rm:hover { border-color: var(--red); color: var(--red); }
.me-ex { background: var(--surface2); border: 1px solid var(--border); border-radius: 10px; padding: 12px; margin-bottom: 12px; counter-reset: meset; }
.me-ex-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.me-ex-name { font-family: 'Orbitron'; font-weight: 700; font-size: 14px; }
.me-ex-tools { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.me-ex-mv { width: 30px; min-width: 30px; height: 30px; -webkit-appearance: none; appearance: none; cursor: pointer; padding: 0;
  background: transparent; border: 1px solid var(--border); color: var(--muted); border-radius: 6px; font-family: 'Share Tech Mono'; font-size: 13px; }
.me-ex-mv:hover { border-color: var(--cyan); color: var(--cyan); }
.me-ex-rm { width: auto; -webkit-appearance: none; appearance: none; cursor: pointer; background: transparent;
  border: 1px solid var(--border); color: var(--muted); border-radius: 6px; padding: 5px 10px; font-family: 'Share Tech Mono'; font-size: 12px; }
.me-ex-rm:hover { border-color: var(--red); color: var(--red); }
.me-addset { width: auto; -webkit-appearance: none; appearance: none; cursor: pointer; background: transparent;
  border: 1px dashed var(--border); color: var(--cyan); border-radius: 7px; padding: 7px 12px; font-family: 'Share Tech Mono'; font-size: 12px; margin-top: 4px; }
.me-addset:hover { border-color: var(--cyan); }
.me-add-ex { width: 100%; -webkit-appearance: none; appearance: none; cursor: pointer;
  background: transparent; border: 1px dashed var(--border-pink); color: var(--pink); border-radius: 8px;
  padding: 11px; font-family: 'Share Tech Mono'; font-size: 13px; margin-bottom: 14px; }
.me-add-ex:hover { border-color: var(--pink); }
.modal-delete { margin-right: auto; }
.modal-delete:hover { border-color: var(--red); color: var(--red); }

/* ---------- Day customization ---------- */
.day-tools { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.day-tools button { width: auto; -webkit-appearance: none; appearance: none; cursor: pointer;
  font-family: 'Share Tech Mono'; font-size: 12px; letter-spacing: .5px;
  background: var(--surface2); border: 1px solid var(--border); color: var(--text);
  border-radius: 7px; padding: 9px 13px; transition: all .15s; }
.day-tools button:hover { border-color: var(--cyan); color: var(--cyan); }
#add-ex { border-color: var(--cyan); color: var(--cyan); }
#reset-day:hover, #save-default:hover { border-color: var(--pink); color: var(--pink); }
.ex-head-tools { display: flex; gap: 8px; align-items: center; }
.ex-remove { width: auto; -webkit-appearance: none; appearance: none; cursor: pointer;
  background: transparent; border: 1px solid var(--border); color: var(--muted);
  border-radius: 6px; padding: 4px 10px; font-family: 'Share Tech Mono'; font-size: 13px; }
.ex-remove:hover { border-color: var(--red); color: var(--red); }

/* ---------- Exercise picker ---------- */
/* FIXED height, not max-height: while you type, the result count changes but the
   panel must not resize — on mobile the sheet is bottom-anchored, so a shrinking
   list drags the search box down out from under your finger. */
.pick-list { height: 52vh; overflow-y: auto; margin-top: 12px; }
/* dvh tracks the on-screen keyboard, so the list stays put when it opens. */
@supports (height: 50dvh) { .pick-list { height: 52dvh; } }
/* Keep the search field visible while scrolling the list. */
#pick-search { position: sticky; top: 0; z-index: 2; }
.pick-cat { font-family: 'Orbitron'; font-weight: 700; font-size: 12px; letter-spacing: 1px;
  color: var(--pink); margin: 14px 0 6px; }
.pick-cat:first-child { margin-top: 2px; }
.pick-item { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 10px;
  -webkit-appearance: none; appearance: none; cursor: pointer; text-align: left;
  background: var(--surface2); border: 1px solid var(--border); color: var(--text);
  border-radius: 8px; padding: 12px; margin-bottom: 6px; font-family: 'Rajdhani'; font-size: 15px; }
.pick-item:hover:not(:disabled) { border-color: var(--cyan); }
.pick-item.added, .pick-item:disabled { opacity: .5; cursor: default; }
.pick-meta { font-family: 'Share Tech Mono'; font-size: 12px; color: var(--muted); white-space: nowrap; }

/* ---------- Exercise info ---------- */
.ex-info { width: auto; -webkit-appearance: none; appearance: none; cursor: pointer;
  background: transparent; border: 1px solid var(--border); color: var(--cyan);
  border-radius: 6px; padding: 4px 9px; font-family: 'Share Tech Mono'; font-size: 14px; }
.ex-info:hover { border-color: var(--cyan); background: rgba(0,240,255,0.08); }
.info-sec { margin-bottom: 13px; }
.info-h { font-family: 'Orbitron'; font-weight: 700; font-size: 13px; letter-spacing: 1px; margin-bottom: 5px; }
.info-how { font-size: 15px; line-height: 1.5; }
.info-list { list-style: none; }
.info-list li { padding: 3px 0 3px 16px; position: relative; font-size: 14px; line-height: 1.45; }
.info-list li::before { content: '▸'; position: absolute; left: 2px; color: var(--muted); }
.info-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.info-links { display: flex; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
.info-links a { font-family: 'Share Tech Mono'; font-size: 13px; color: var(--cyan); text-decoration: none;
  border: 1px solid var(--border); border-radius: 8px; padding: 10px 14px; }
.info-links a:hover { border-color: var(--cyan); background: rgba(0,240,255,0.08); }

/* ---------- Anatomy muscle map ---------- */
.anatomy { display: flex; justify-content: center; align-items: flex-end; gap: 10px; flex-wrap: wrap;
  background: radial-gradient(circle at 50% 35%, rgba(180,79,255,0.07), var(--bg) 70%);
  border: 1px solid var(--border); border-radius: 10px; padding: 14px 8px 8px; }
.anat-svg { height: 215px; width: auto; }
.anat-label { font-family: 'Share Tech Mono'; font-size: 8px; fill: var(--muted); text-anchor: middle; letter-spacing: 1.5px; }
.anat-names { margin-top: 10px; font-family: 'Rajdhani'; font-size: 14.5px; line-height: 1.7; }
.anat-names .nm-pri { color: var(--pink); font-weight: 600; margin-right: 5px; }
.anat-names .nm-sec { color: var(--cyan); font-weight: 600; margin-right: 5px; }

/* ---------- Alternatives chips ---------- */
.alt-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.alt-chip { width: auto; -webkit-appearance: none; appearance: none; cursor: pointer;
  font-family: 'Rajdhani'; font-weight: 500; font-size: 14px;
  background: var(--surface2); border: 1px solid var(--border-pink); color: var(--text);
  border-radius: 20px; padding: 8px 14px; transition: all .15s; }
.alt-chip:hover { border-color: var(--pink); color: var(--pink); }

/* ---------- Rest timer (fixed, persists across re-renders) ---------- */
.rest-timer { position: fixed; left: 16px; bottom: 16px; z-index: 55; display: flex; align-items: center; gap: 6px;
  background: var(--surface2); border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.45); font-family: 'Share Tech Mono'; }
.rest-timer .rt-label { color: var(--cyan); font-size: 12px; letter-spacing: 1px; margin-right: 2px; }
.rest-timer button { width: auto; -webkit-appearance: none; appearance: none; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border); color: var(--text); border-radius: 7px;
  padding: 7px 9px; font-family: 'Share Tech Mono'; font-size: 13px; transition: all .15s; }
.rest-timer button:hover { border-color: var(--cyan); color: var(--cyan); }
.rest-timer.running { border-color: var(--pink); box-shadow: 0 0 22px rgba(255,45,120,0.35); }
.rest-timer .rt-time { font-family: 'Orbitron'; font-weight: 700; font-size: 22px; color: var(--pink); min-width: 62px; text-align: center; font-variant-numeric: tabular-nums; }
.rest-timer .rt-cancel { color: var(--muted); }
.rest-timer .rt-add { color: var(--gold); }
/* Thin drain bar along the bottom edge — glanceable rest progress. */
.rest-timer.running { overflow: hidden; }
.rest-timer .rt-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255,45,120,0.15); }
.rest-timer .rt-fill { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(90deg, var(--pink), var(--gold)); }

@media (max-width: 560px) {
  /* Bottom-chrome stacking ladder (so nothing overlaps on a phone):
     nav 0–54 · sticky Save 64–114 · rest-timer 128 · sync-pill 184 · update-pill 240
     — each offset by env(safe-area-inset-bottom): the tab bar grows by the home-
     indicator inset on iPhones, so the whole ladder shifts up with it. */
  .rest-timer { left: auto; right: 8px; bottom: calc(128px + env(safe-area-inset-bottom, 0px)); justify-content: center; padding: 7px 8px; gap: 5px; }
  .rest-timer .rt-label { display: none; }
  .rest-timer.running .rt-label { display: inline; }
  .rest-timer button { padding: 9px 9px; font-size: 13px; }
  .modal-set { grid-template-columns: 18px 1fr 1fr 32px; }
  .info-cols { grid-template-columns: 1fr; gap: 0; }
}

.empty { font-family: 'Share Tech Mono'; color: var(--muted); font-size: 13px; padding: 18px 0; text-align: center; }
.muted-note { font-family: 'Share Tech Mono'; font-size: 11px; color: var(--muted); margin-top: 10px; }

/* draft-restored banner */
.draft-note {
  font-family: 'Share Tech Mono'; font-size: 12px; color: var(--gold);
  border: 1px dashed rgba(255,215,0,0.4); border-radius: 8px;
  padding: 8px 12px; margin-bottom: 14px; display: flex; justify-content: space-between; align-items: center; gap: 10px;
}
.draft-note button { width: auto; padding: 5px 10px; font-size: 11px; }

/* ============================================================
   MOBILE — the logging side must look right on a phone first
   ============================================================ */
@media (max-width: 560px) {
  body { font-size: 17px; }
  .container { padding: 16px 12px 150px; } /* clear bottom nav + sticky save */

  /* Top bar: just brand + exit (tabs move to a bottom bar).
     CRITICAL: no backdrop-filter here — a filter/backdrop-filter/transform on
     an ancestor makes it the containing block for position:fixed descendants,
     which pins the "fixed to viewport bottom" .tabs to the TOPBAR's bottom
     edge (i.e. the top of the screen) and leaves the whole bottom-chrome
     ladder floating above a nav that isn't there. Near-opaque bg instead. */
  .topbar { gap: 10px; padding: 10px 12px;
    backdrop-filter: none; -webkit-backdrop-filter: none; background: rgba(10,10,24,0.97); }
  .brand { flex: 1; }
  .brand-sub { display: none; }
  #logout-btn { margin-left: auto; }

  /* Bottom tab bar — thumb-reachable one-handed nav */
  .tabs {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; margin: 0; gap: 0;
    background: rgba(10,10,24,0.97); backdrop-filter: blur(10px);
    border-top: 1px solid var(--border);
    padding: 4px 6px env(safe-area-inset-bottom);
  }
  /* Six tabs at 390px — drop size/tracking so nothing wraps or clips. */
  .tab { flex: 1; padding: 13px 1px; font-size: 9px; letter-spacing: 0; text-align: center; border-radius: 0;
    min-width: 0; overflow: hidden; text-overflow: clip; white-space: nowrap; }
  .tab.active { background: transparent; color: #fff; box-shadow: inset 0 2px 0 var(--pink); }

  .view-title { font-size: 26px; }
  .card { padding: 15px 13px; }

  .field-row { flex-direction: column; gap: 0; }
  .field-row .field { margin-bottom: 12px; }
  .grid-2 { grid-template-columns: 1fr; }

  /* Set rows incl. the done checkbox */
  .set-grid { grid-template-columns: 24px 1fr 1fr 40px; gap: 6px; }
  .set-grid input[type="number"] { padding: 12px 4px; font-size: 16px; } /* 16px avoids iOS zoom */
  .stp-wrap { gap: 3px; }
  .stp { flex-basis: 28px; width: 28px; }

  /* Tighter exercise cards + larger tap targets on phones */
  .exercise { padding: 12px 11px; margin-bottom: 10px; }
  .exercise-name { font-size: 15px; }
  .ex-note { margin-top: 7px; }
  .icon-btn { width: 40px; min-width: 40px; height: 40px; flex-basis: 40px; }
  .ex-head-tools { display: flex; gap: 6px; }
  .anat-svg { height: 168px; }

  .day-select { gap: 6px; }
  .day-btn { flex: 1 1 28%; text-align: center; padding: 11px 6px; }

  input, select, textarea { padding: 13px 12px; font-size: 16px; }

  .btn { width: 100%; padding: 15px 20px; }
  .btn-sm { width: auto; }

  /* Sticky Save for the long workout form — always reachable above the nav */
  #save-workout { position: sticky; bottom: calc(64px + env(safe-area-inset-bottom, 0px)); z-index: 30; box-shadow: 0 -6px 18px rgba(10,10,24,0.7); }

  .chart-wrap { height: 260px; }
  .table { font-size: 14px; }
  .table th, .table td { padding: 7px 6px; }

  /* Modals present as bottom sheets: full-width, pinned in thumb reach, with
     an iOS-style grab handle — pairs with the swipe-to-dismiss gesture. */
  .modal-overlay { align-items: flex-end; padding: 0; }
  .modal { width: 100%; max-width: 100%; max-height: 92vh; border-radius: 18px 18px 0 0;
    border-bottom: none; padding-bottom: env(safe-area-inset-bottom, 0px);
    animation: sheetup .22s ease; }
  .modal-head { position: relative; padding-top: 24px; }
  .modal-head::before { content: ''; position: absolute; top: 9px; left: 50%; transform: translateX(-50%);
    width: 40px; height: 4px; border-radius: 2px; background: var(--muted); opacity: .5; }
}
@keyframes sheetup { from { transform: translateY(48px); opacity: .5; } to { transform: none; opacity: 1; } }

/* ---------- Settings screen ---------- */
.icon-gear { font-size: 16px; padding: 6px 10px; line-height: 1; }
.icon-gear:hover { color: var(--cyan); border-color: var(--cyan); }
.rest-picker { display: flex; gap: 8px; flex-wrap: wrap; }
.rest-pick { width: auto; flex: 1 1 0; min-width: 60px; -webkit-appearance: none; appearance: none; cursor: pointer;
  font-family: 'Share Tech Mono'; font-size: 14px; letter-spacing: .5px;
  background: var(--surface2); border: 1px solid var(--border); color: var(--text);
  border-radius: 8px; padding: 11px 8px; transition: all .15s; }
.rest-pick:hover { border-color: var(--cyan); }
.rest-pick.active { color: #fff; border-color: var(--cyan); box-shadow: inset 0 -2px 0 var(--cyan); }
.settings-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.settings-actions .btn { width: auto; flex: 1 1 auto; }
.card code { font-family: 'Share Tech Mono'; color: var(--gold); font-size: 12px; }

/* ---------- Progress section sub-nav ---------- */
.prog-nav { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.prog-chip { width: auto; flex: 1 1 0; min-width: 70px; -webkit-appearance: none; appearance: none; cursor: pointer;
  font-family: 'Share Tech Mono'; font-size: 12px; letter-spacing: 1px; text-transform: uppercase;
  background: var(--surface2); border: 1px solid var(--border); color: var(--muted);
  border-radius: 999px; padding: 9px 12px; transition: all .15s; }
.prog-chip:hover { border-color: var(--cyan); color: var(--text); }
.prog-chip.active { color: #fff; border-color: var(--cyan); box-shadow: 0 0 12px rgba(0,240,255,0.2); }

/* ---------- Offline sync pill (pending queued saves) ---------- */
.sync-pill { position: fixed; right: 16px; bottom: 16px; z-index: 56; cursor: pointer;
  background: var(--surface2); border: 1px solid rgba(255,215,0,0.5); color: var(--gold);
  border-radius: 999px; padding: 9px 14px; font-family: 'Share Tech Mono'; font-size: 12px;
  letter-spacing: .5px; box-shadow: 0 6px 20px rgba(0,0,0,0.45), 0 0 16px rgba(255,215,0,0.18);
  animation: syncpulse 1.8s ease-in-out infinite; max-width: 70vw; }
.sync-pill:hover { border-color: var(--gold); color: #fff; }
@keyframes syncpulse { 0%,100% { opacity: .78; } 50% { opacity: 1; } }
@media (max-width: 560px) { .sync-pill { bottom: calc(184px + env(safe-area-inset-bottom, 0px)); right: 8px; } }

/* ---------- New-version update banner ---------- */
.update-pill { position: fixed; left: 50%; transform: translateX(-50%); bottom: 16px; z-index: 60;
  display: flex; align-items: center; gap: 12px;
  background: var(--surface2); border: 1px solid var(--cyan); color: var(--text);
  border-radius: 999px; padding: 9px 10px 9px 16px; font-family: 'Share Tech Mono'; font-size: 13px;
  box-shadow: 0 6px 22px rgba(0,0,0,0.5), 0 0 18px rgba(0,240,255,0.22); }
.update-pill span { color: var(--cyan); letter-spacing: .5px; white-space: nowrap; }
.update-pill button { -webkit-appearance: none; appearance: none; cursor: pointer;
  background: linear-gradient(135deg, var(--cyan), #0090ff); color: #04121a; border: 0;
  border-radius: 999px; padding: 7px 14px; font-family: 'Share Tech Mono'; font-weight: 700; font-size: 12px; }
.update-pill button:hover { filter: brightness(1.1); }
@media (max-width: 560px) { .update-pill { bottom: calc(240px + env(safe-area-inset-bottom, 0px)); } }

/* ---------- PT / rehab tab ---------- */
.pt-info { -webkit-appearance: none; appearance: none; cursor: pointer; width: auto;
  background: transparent; border: none; color: var(--cyan); font-size: 13px; padding: 0 0 0 4px; line-height: 1; }
.pt-info:hover { color: #fff; }
.pt-cue { color: var(--text); font-size: 13.5px; line-height: 1.45; }

/* ---------- Calculator tab ---------- */
.c-modes { display: flex; gap: 8px; margin-bottom: 12px; }
.c-mode { flex: 1 1 0; width: auto; -webkit-appearance: none; appearance: none; cursor: pointer;
  font-family: 'Orbitron'; font-weight: 700; font-size: 12px; letter-spacing: 1px;
  background: var(--surface2); border: 1px solid var(--border); color: var(--muted);
  border-radius: 8px; padding: 12px 8px; transition: all .15s; }
.c-mode.active { color: #fff; border-color: var(--cyan); box-shadow: inset 0 -2px 0 var(--cyan); }

/* one-tap presets — horizontally scrollable so they never wrap */
.c-chips { display: flex; gap: 7px; overflow-x: auto; padding-bottom: 10px; margin-bottom: 6px;
  scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.c-chips::-webkit-scrollbar { display: none; }
.c-chip { flex: 0 0 auto; width: auto; -webkit-appearance: none; appearance: none; cursor: pointer;
  font-family: 'Share Tech Mono'; font-size: 12.5px; white-space: nowrap;
  background: var(--surface2); border: 1px solid var(--border); color: var(--cyan);
  border-radius: 999px; padding: 9px 14px; }
.c-chip:hover { border-color: var(--cyan); background: rgba(0,240,255,0.08); }

.c-two { display: grid; grid-template-columns: 1fr 96px; gap: 10px; align-items: end; }
.c-two .field { margin-bottom: 0; }
.c-blendtog { display: flex; align-items: center; justify-content: center; gap: 7px; height: 46px;
  font-family: 'Share Tech Mono'; font-size: 13px; color: var(--text); cursor: pointer;
  background: var(--surface2); border: 1px solid var(--border); border-radius: 8px; padding: 0 10px; }
.c-blendtog input { width: 18px; height: 18px; accent-color: var(--cyan); }

.c-blendhead { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 9px;
  font-family: 'Share Tech Mono'; font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); }
.c-comp { display: grid; grid-template-columns: 1fr 84px 38px; gap: 8px; margin-bottom: 7px; }
.c-oilhead { display: grid; grid-template-columns: 1fr 72px 72px 72px 38px; gap: 6px; margin-bottom: 6px;
  font-family: 'Share Tech Mono'; font-size: 10.5px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
.c-oil { display: grid; grid-template-columns: 1fr 72px 72px 72px 38px; gap: 6px; margin-bottom: 7px; }
.c-comp input, .c-oil input { padding: 11px 9px; font-size: 16px; }
.c-x { width: 38px; min-width: 38px; height: 44px; -webkit-appearance: none; appearance: none; cursor: pointer;
  background: var(--surface2); border: 1px solid var(--border); color: var(--muted);
  border-radius: 8px; font-family: 'Share Tech Mono'; font-size: 13px; padding: 0; }
.c-x:hover { border-color: var(--red); color: var(--red); }
.c-add { width: 100%; -webkit-appearance: none; appearance: none; cursor: pointer; margin-top: 4px;
  background: transparent; border: 1px dashed var(--border); color: var(--cyan);
  border-radius: 8px; padding: 10px; font-family: 'Share Tech Mono'; font-size: 12px; }

/* the two-way dose <-> units pair */
.c-bi { display: grid; grid-template-columns: 1fr 30px 1fr; gap: 8px; align-items: end; margin-top: 14px; }
.c-bi .field { margin-bottom: 0; }
.c-swap { text-align: center; padding-bottom: 13px; color: var(--cyan); font-size: 17px; }
.c-inline { display: flex; gap: 6px; }
.c-inline input { flex: 1 1 auto; min-width: 0; }
.c-inline select { flex: 0 0 68px; padding-left: 8px; padding-right: 4px; }
.c-syr { -webkit-appearance: none; appearance: none; cursor: pointer; width: auto; margin-left: 6px;
  background: var(--surface2); border: 1px solid var(--border); color: var(--cyan);
  border-radius: 5px; padding: 2px 7px; font-family: 'Share Tech Mono'; font-size: 10px; letter-spacing: 0; }
.c-syr:hover { border-color: var(--cyan); }

/* result, pinned directly under the inputs in the same card */
.c-res { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); }
.c-res.empty { font-family: 'Share Tech Mono'; font-size: 12.5px; color: var(--muted); }
.c-big { font-family: 'Orbitron'; font-weight: 900; font-size: clamp(38px, 12vw, 54px);
  color: var(--cyan); line-height: 1; text-shadow: 0 0 24px rgba(0,240,255,0.35); }
.c-big small { font-family: 'Share Tech Mono'; font-size: 15px; font-weight: 400; color: var(--muted); margin-left: 8px; }
.c-meta { font-family: 'Share Tech Mono'; font-size: 12.5px; color: var(--muted); margin-top: 7px; }
.c-split { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 14px; margin-top: 14px; }
.c-split div { display: flex; justify-content: space-between; gap: 8px;
  font-family: 'Share Tech Mono'; font-size: 12.5px; color: var(--muted);
  border-bottom: 1px solid var(--border); padding: 5px 0; }
.c-split b { color: var(--gold); font-weight: 400; }
.c-warn { font-family: 'Share Tech Mono'; font-size: 12px; line-height: 1.45; color: var(--gold);
  border: 1px solid rgba(255,215,0,0.35); border-radius: 8px; padding: 8px 11px; margin-top: 10px; }

@media (max-width: 560px) {
  .c-oilhead, .c-oil { grid-template-columns: 1fr 60px 60px 60px 34px; gap: 5px; }
  .c-oil input { padding: 11px 6px; font-size: 16px; }
  .c-comp { grid-template-columns: 1fr 74px 34px; }
  .c-x { width: 34px; min-width: 34px; }
  .c-split { grid-template-columns: 1fr; }
}

/* Picker sizing on phones: leave room for the sheet header, search field and
   footer once the keyboard is up, and track the keyboard via dvh where supported. */
@media (max-width: 560px) {
  .pick-list { height: 44vh; }
  @supports (height: 50dvh) { .pick-list { height: 44dvh; } }
  @supports (max-height: 50dvh) { .modal { max-height: 92dvh; } }
}

/* ---------- Skeleton placeholders (first paint before data lands) ---------- */
.skel { background: linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.11) 37%, rgba(255,255,255,0.04) 63%);
  background-size: 400% 100%; animation: shimmer 1.4s ease-in-out infinite; border-radius: 7px; }
.skel-title { height: 30px; width: 46%; }
.skel-card { pointer-events: none; }
.skel-line { height: 14px; margin-bottom: 12px; }
.skel-line:last-child { margin-bottom: 0; }
.skel-card .skel-line:nth-child(odd) { width: 92%; }
.skel-card .skel-line:nth-child(even) { width: 68%; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }

/* ---------- Touch feedback: everything tappable should answer the thumb ---- */
.btn, .tab, .c-chip, .c-mode, .pick-item, .day-btn, .icon-btn, .ql-tab,
.rest-pick, .prog-chip, .c-add, .c-x, .calc-add, .recent-toggle, .ex-act {
  transition: transform .08s ease, border-color .15s ease, background .15s ease, color .15s ease;
}
.btn:active, .tab:active, .c-chip:active, .c-mode:active, .pick-item:not(:disabled):active,
.day-btn:active, .icon-btn:active, .ql-tab:active, .rest-pick:active, .prog-chip:active,
.c-add:active, .c-x:active, .recent-toggle:active, .ex-act:active { transform: scale(.96); }

/* Bottom nav is icon-over-label on phones; text-only on desktop. */
.tab-ico { display: none; }

@media (prefers-reduced-motion: reduce) {
  .skel { animation: none; }
  .view, .modal { animation: none !important; }
  .btn:active, .tab:active, .c-chip:active, .pick-item:active { transform: none; }
}

@media (max-width: 560px) {
  .tab { display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 3px; padding: 8px 1px 7px; }
  .tab-ico { display: block; font-size: 15px; line-height: 1; }
  .tab-txt { font-size: 9px; letter-spacing: 0; }
  .tab.active .tab-ico { filter: drop-shadow(0 0 6px var(--cyan)); }
}

/* ---------- Per-exercise set add/remove ---------- */
.set-tools { display: flex; gap: 8px; margin-top: 9px; }
.set-tool { flex: 1 1 0; width: auto; -webkit-appearance: none; appearance: none; cursor: pointer;
  background: transparent; border: 1px dashed var(--border); color: var(--cyan);
  border-radius: 8px; padding: 9px 6px; font-family: 'Share Tech Mono'; font-size: 12px;
  transition: transform .08s ease, border-color .15s ease, color .15s ease; }
.set-tool:hover:not(:disabled) { border-color: var(--cyan); }
.set-tool:active:not(:disabled) { transform: scale(.96); }
.set-tool:disabled { opacity: .35; cursor: default; }
@media (max-width: 560px) { .set-tool { padding: 11px 6px; } }
