:root {
  --bg: #0f1115;
  --panel: #171a21;
  --panel-2: #1f2330;
  --border: #2a2f3d;
  --text: #e8eaf0;
  --muted: #8b91a3;
  --accent: #4f7cff;
  --bjj: #d9822b;
  --gym: #3fa76b;
  --rest: #6b7280;
  --done: #22c55e;
  --danger: #e0665f;
  --gold: #e6b93b;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
}
.hidden { display: none !important; }

header { padding: 20px 24px 4px; }
h1 { font-size: 22px; margin: 0 0 4px; }
.sub { color: var(--muted); font-size: 13px; }

/* nav tabs */
.tabs {
  display: flex;
  gap: 6px;
  padding: 14px 24px 0;
  border-bottom: 1px solid var(--border);
}
.tab-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  padding: 10px 14px;
  font-size: 13.5px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tab-btn.active { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }
.tab-btn:hover { color: var(--text); }

/* week nav */
.week-nav { display: flex; align-items: center; gap: 12px; padding: 16px 24px 8px; flex-wrap: wrap; }
.week-nav button {
  background: var(--panel-2); border: 1px solid var(--border); color: var(--text);
  border-radius: 8px; padding: 6px 12px; cursor: pointer; font-size: 14px;
}
.week-nav button:hover { background: var(--border); }
.week-label { font-weight: 600; font-size: 14px; }
.week-nav .today-btn { margin-left: auto; }

.stats-bar { display: flex; gap: 10px; padding: 0 24px 16px; flex-wrap: wrap; }
.stat-chip {
  background: var(--panel); border: 1px solid var(--border); border-radius: 999px;
  padding: 6px 14px; font-size: 12.5px; color: var(--muted);
}
.stat-chip b { color: var(--text); }

.week-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; padding: 0 24px 32px; }
@media (max-width: 900px) { .week-grid { grid-template-columns: 1fr; } }

.day-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px;
  min-height: 160px; display: flex; flex-direction: column;
}
.day-card.is-today { border-color: var(--accent); }
.day-head { padding: 10px 12px 6px; display: flex; justify-content: space-between; align-items: baseline; }
.day-name { font-weight: 600; font-size: 13px; }
.day-date { color: var(--muted); font-size: 11px; }

.sessions { flex: 1; padding: 4px 8px; display: flex; flex-direction: column; gap: 6px; }
.session-pill { border-radius: 8px; padding: 7px 9px; font-size: 12px; border: 1px solid transparent; position: relative; }
.session-pill.bjj { background: rgba(217,130,43,0.15); border-color: rgba(217,130,43,0.4); }
.session-pill.gym { background: rgba(63,167,107,0.15); border-color: rgba(63,167,107,0.4); }
.session-pill.rest { background: rgba(107,114,128,0.15); border-color: rgba(107,114,128,0.4); }
.session-pill .title { font-weight: 600; margin-bottom: 2px; cursor: pointer; }
.session-pill .meta { color: var(--muted); font-size: 11px; cursor: pointer; }
.session-pill .badges { display: flex; gap: 4px; margin-top: 4px; flex-wrap: wrap; }
.session-pill .badge { background: rgba(255,255,255,0.08); border-radius: 5px; padding: 1px 5px; font-size: 10px; color: var(--muted); }
.session-pill.done::after {
  content: "✓"; position: absolute; top: 6px; right: 8px; color: var(--done); font-weight: 700; font-size: 11px;
}
.session-pill.planned .title::before { content: "○ "; color: var(--muted); }
.session-pill .start-row { margin-top: 6px; }
.session-pill .start-btn {
  background: var(--accent); border: none; color: white; font-size: 11px; padding: 4px 8px;
  border-radius: 6px; cursor: pointer; font-weight: 600;
}

.add-btn {
  margin: 6px 8px 10px; background: transparent; border: 1px dashed var(--border); color: var(--muted);
  border-radius: 8px; padding: 7px; font-size: 12px; cursor: pointer;
}
.add-btn:hover { border-color: var(--accent); color: var(--text); }

/* overlay / modal */
.overlay {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.55);
  align-items: center; justify-content: center; z-index: 50; padding: 16px;
}
.overlay.open { display: flex; }
.modal {
  background: var(--panel); border: 1px solid var(--border); border-radius: 14px;
  width: 100%; max-width: 420px; max-height: 90vh; overflow-y: auto; padding: 20px;
}
.modal-wide { max-width: 640px; }
.modal h2 { margin: 0 0 14px; font-size: 17px; }
.modal h3 { margin: 18px 0 8px; font-size: 13.5px; color: var(--text); }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; }

.seg { display: flex; gap: 6px; flex-wrap: wrap; }
.seg button {
  flex: 1; min-width: 80px; background: var(--panel-2); border: 1px solid var(--border); color: var(--text);
  padding: 8px 6px; border-radius: 8px; cursor: pointer; font-size: 12.5px;
}
.seg button.active { background: var(--accent); border-color: var(--accent); color: white; }
/* Reads as a way in rather than as another sport sitting alongside the real ones. */
.seg button.more-types {
  flex: 0 0 auto; background: transparent; border-style: dashed; color: var(--muted);
}

input[type="text"], input[type="number"], input[type="search"], input[type="date"], select, textarea {
  width: 100%; background: var(--panel-2); border: 1px solid var(--border); color: var(--text);
  border-radius: 8px; padding: 9px 10px; font-size: 13.5px; font-family: inherit;
}
input[type="date"] { color-scheme: dark; }
textarea { min-height: 60px; resize: vertical; }
select { appearance: none; }

.exercise-row {
  display: grid; grid-template-columns: 1.8fr .75fr .75fr .85fr 58px .75fr .75fr auto;
  gap: 6px; margin-bottom: 6px; align-items: center;
}
.exercise-row input { padding: 7px 8px; font-size: 12.5px; }
.exercise-row button {
  background: var(--panel-2); border: 1px solid var(--border); color: var(--muted); border-radius: 6px; cursor: pointer;
}
.program-exercise-row { grid-template-columns: 2fr 1fr 1fr 1fr 1fr auto; }

.round-row, .technique-row {
  border: 1px solid var(--border); border-radius: 10px; padding: 10px; margin-bottom: 8px; background: var(--panel-2);
}
.round-row .row-top, .technique-row .row-top {
  display: grid; grid-template-columns: 2fr 1fr auto; gap: 6px; margin-bottom: 6px;
}
.technique-row .row-top { grid-template-columns: 1.4fr 1fr auto; }
.round-row textarea, .technique-row textarea { min-height: 44px; font-size: 12.5px; }
.round-row input, .round-row select, .technique-row input, .technique-row select { font-size: 12.5px; padding: 7px 8px; }

.small-btn {
  background: var(--panel-2); border: 1px solid var(--border); color: var(--text); border-radius: 8px;
  padding: 6px 10px; font-size: 12px; cursor: pointer;
}
.small-btn:hover { border-color: var(--accent); }
.remove-btn { color: var(--danger); border-color: rgba(224,102,95,0.4); }

.modal-actions { display: flex; gap: 8px; margin-top: 18px; }
.btn-primary {
  flex: 1; background: var(--accent); border: none; color: white; padding: 10px; border-radius: 8px;
  font-size: 14px; cursor: pointer; font-weight: 600;
}
.btn-danger {
  background: transparent; border: 1px solid #b3413a; color: var(--danger); padding: 10px 14px;
  border-radius: 8px; cursor: pointer; font-size: 13px;
}
.btn-ghost {
  background: transparent; border: 1px solid var(--border); color: var(--text); padding: 10px 14px;
  border-radius: 8px; cursor: pointer; font-size: 13px;
}
.toggle-row { display: flex; justify-content: space-between; align-items: center; margin-top: 4px; }
.switch { position: relative; width: 40px; height: 22px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute; cursor: pointer; inset: 0; background: var(--panel-2); border: 1px solid var(--border);
  border-radius: 999px; transition: 0.15s;
}
.slider::before {
  content: ""; position: absolute; height: 16px; width: 16px; left: 2px; top: 2px;
  background: var(--muted); border-radius: 50%; transition: 0.15s;
}
.switch input:checked + .slider { background: var(--accent); border-color: var(--accent); }
.switch input:checked + .slider::before { transform: translateX(18px); background: white; }

/* stats view */
.stats-toolbar { display: flex; justify-content: space-between; align-items: center; padding: 16px 24px; flex-wrap: wrap; gap: 10px; }
.stats-toolbar .seg { max-width: 440px; }
#statsContent { padding: 0 24px 40px; display: flex; flex-direction: column; gap: 20px; }
.card {
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 16px;
}
.card h3 { margin: 0 0 12px; font-size: 13.5px; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.summary-chips { display: flex; gap: 10px; flex-wrap: wrap; }
.summary-chips .stat-chip { font-size: 13px; padding: 8px 16px; }

.bar-chart { display: flex; align-items: flex-end; gap: 6px; height: 140px; padding-top: 10px; }
.bar-chart .bar-col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; height: 100%; }
.bar-chart .bar-stack { width: 100%; max-width: 28px; display: flex; flex-direction: column-reverse; border-radius: 4px 4px 0 0; overflow: hidden; }
.bar-chart .bar-seg.bjj { background: var(--bjj); }
.bar-chart .bar-seg.gym { background: var(--gym); }
.bar-chart .bar-label { font-size: 10px; color: var(--muted); }

.legend { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 10px; font-size: 11.5px; color: var(--muted); }
.legend-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 5px; }

.donut-wrap { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }

table.stat-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.stat-table th, table.stat-table td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--border); }
table.stat-table th { color: var(--muted); font-weight: 500; font-size: 11.5px; }
.pr-badge { color: var(--gold); font-weight: 700; font-size: 10.5px; }

.empty-note { color: var(--muted); font-size: 13px; padding: 20px 0; text-align: center; }

/* programs */
/* Outer wrapper is a plain block: it holds section headings and the
   .programs-row grids, so it must not be a grid container itself. */
.programs-grid { padding: 0 24px 40px; }
.program-card { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 14px; cursor: pointer; }
.program-card:hover { border-color: var(--accent); }
.program-card h4 { margin: 0 0 4px; font-size: 14.5px; }
.program-card .desc { color: var(--muted); font-size: 12px; margin-bottom: 8px; min-height: 16px; }
.program-card .days-count { font-size: 11.5px; color: var(--muted); }
.day-block { border: 1px solid var(--border); border-radius: 10px; padding: 12px; margin-bottom: 12px; background: var(--panel-2); }
.day-block .day-block-head { display: flex; gap: 8px; margin-bottom: 10px; align-items: center; }
.day-block .day-block-head input { flex: 1; }

/* live session */
.live-modal { max-width: 560px; }
.live-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.live-progress { font-size: 12px; color: var(--muted); }
.live-exercise-name { font-size: 19px; font-weight: 700; margin-bottom: 2px; }
.live-exercise-target { color: var(--muted); font-size: 12.5px; margin-bottom: 14px; }
.set-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.set-row {
  display: grid; grid-template-columns: 50px 1fr 1fr auto; gap: 8px; align-items: center;
  background: var(--panel-2); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px;
}
.set-row.logged { border-color: var(--done); }
.set-row .set-num { color: var(--muted); font-size: 12px; }
.set-row input { padding: 6px 8px; font-size: 13px; }
.set-row button { font-size: 12px; padding: 7px 10px; white-space: nowrap; }
.exercise-nav { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.exercise-nav button {
  background: var(--panel-2); border: 1px solid var(--border); color: var(--muted); border-radius: 8px;
  padding: 6px 10px; font-size: 11.5px; cursor: pointer;
}
.exercise-nav button.active { border-color: var(--accent); color: var(--text); }

/* The way into a live session from the week: big enough to hit between sets. */
.start-workout-btn { display: block; width: calc(100% - 24px); margin: 0 12px 12px; padding: 14px; font-size: 16px; }

/* Adding an exercise from inside live mode. */
.live-add-ex { display: flex; gap: 8px; margin-bottom: 14px; }
.live-add-ex input { flex: 1; min-width: 0; padding: 8px 10px; font-size: 13px; }
.live-add-ex button { white-space: nowrap; }

/* The sets actually done, under each exercise in the session form. */
.logged-sets { margin: 0 0 12px 12px; padding-left: 10px; border-left: 2px solid var(--border); }
.logged-set { display: grid; grid-template-columns: 28px 1fr 14px 1fr auto; gap: 6px; align-items: center; margin-bottom: 6px; }
.logged-set input { padding: 6px 8px; font-size: 12.5px; }
.logged-set.unlogged input { opacity: .6; }
.logged-sets-label { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 6px; }
.logged-set-num { color: var(--muted); font-size: 12px; text-align: center; }
.logged-set-x { color: var(--muted); font-size: 12px; text-align: center; }
.logged-set button {
  background: var(--panel-2); border: 1px solid var(--border); color: var(--muted); border-radius: 6px; cursor: pointer; padding: 6px 9px;
}
.exercise-nav button.complete { color: var(--done); }

.rest-timer {
  background: var(--panel-2); border: 1px solid var(--accent); border-radius: 12px; padding: 18px;
  text-align: center; margin-bottom: 16px;
}
.rest-timer .big-time { font-size: 40px; font-weight: 700; font-variant-numeric: tabular-nums; }
.rest-timer .rest-bar { height: 6px; background: var(--border); border-radius: 999px; overflow: hidden; margin: 10px 0; }
.rest-timer .rest-bar-fill { height: 100%; background: var(--accent); transition: width 1s linear; }
.rest-timer .rest-actions { display: flex; gap: 8px; justify-content: center; }

/* toast */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--panel-2); border: 1px solid var(--border); color: var(--text); padding: 10px 18px;
  border-radius: 999px; font-size: 13px; opacity: 0; pointer-events: none; transition: 0.2s; z-index: 100;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.clickable { pointer-events: auto; cursor: pointer; border-color: var(--accent); }
.unsaved-warning {
  position: fixed; top: 0; left: 0; right: 0; z-index: 101; padding: 10px 16px;
  padding-top: calc(10px + env(safe-area-inset-top, 0px));
  background: #8b1e1e; color: #fff; font-size: 13px; font-weight: 600; text-align: center;
}
.unsaved-warning[hidden] { display: none; }

/* export modal */
.export-option {
  display: flex; justify-content: space-between; align-items: center; padding: 12px; border: 1px solid var(--border);
  border-radius: 10px; margin-bottom: 10px; background: var(--panel-2);
}
.export-option .label { font-size: 13px; font-weight: 600; }

.modal-narrow { max-width: 340px; }

/* search */
.search-wrap { display: flex; gap: 8px; padding: 16px 24px 4px; align-items: center; }
.search-wrap input { flex: 1; }
#searchResults { padding: 8px 24px 32px; display: flex; flex-direction: column; gap: 10px; }
.result-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 12px; cursor: pointer;
}
.result-card:hover { border-color: var(--accent); }
.result-head { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.result-title { font-size: 13.5px; font-weight: 600; }
.result-date { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.result-hit { font-size: 12px; color: var(--muted); margin-top: 3px; line-height: 1.45; }
.result-hit .hit-field { color: var(--accent); }
.result-hit mark { background: rgba(79,124,255,0.28); color: var(--text); border-radius: 3px; padding: 0 2px; }

/* sub / tap chips inside a round */
.round-sub-block { margin-top: 8px; }
.round-sub-block .block-label { font-size: 11px; color: var(--muted); margin-bottom: 5px; }
.sub-row { display: grid; grid-template-columns: 1.3fr 1fr auto; gap: 5px; margin-bottom: 5px; }
.sub-row input { padding: 6px 8px; font-size: 12.5px; }
.sub-row button { background: var(--panel); border: 1px solid var(--border); color: var(--muted); border-radius: 6px; cursor: pointer; padding: 0 9px; }
.mini-btn {
  background: var(--panel); border: 1px dashed var(--border); color: var(--muted);
  border-radius: 6px; padding: 5px 9px; font-size: 11.5px; cursor: pointer;
}
.mini-btn:hover { border-color: var(--accent); color: var(--text); }
.mini-btn.for { border-color: rgba(63,167,107,0.5); color: #6fd39b; }
.mini-btn.against { border-color: rgba(224,102,95,0.45); color: #e8867f; }

/* match rows (competition) */
.match-row { border: 1px solid var(--border); border-radius: 10px; padding: 10px; margin-bottom: 8px; background: var(--panel-2); }
.match-row .row-top { display: grid; grid-template-columns: 1.4fr 90px auto; gap: 6px; margin-bottom: 6px; }
.match-row input, .match-row select { font-size: 12.5px; padding: 7px 8px; }
.match-row textarea { min-height: 40px; font-size: 12.5px; }

/* tags */
.tag-list { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 6px; }
.tag {
  background: rgba(79,124,255,0.14); border: 1px solid rgba(79,124,255,0.35); color: #a8bdff;
  border-radius: 999px; padding: 2px 9px; font-size: 10.5px;
}

/* set type button + rpe in live mode */
.set-row .set-type-btn {
  background: var(--panel); border: 1px solid var(--border); color: var(--muted);
  border-radius: 6px; font-size: 11px; font-weight: 700; cursor: pointer; padding: 7px 0; width: 100%;
}
.set-row .set-type-btn[data-type="warmup"] { color: var(--gold); border-color: rgba(230,185,59,0.4); }
.set-row .set-type-btn[data-type="drop"] { color: #c15fd0; border-color: rgba(193,95,208,0.4); }
.set-row .set-type-btn[data-type="failure"] { color: var(--danger); border-color: rgba(224,102,95,0.4); }
.set-row .set-type-btn[data-type="amrap"] { color: #4fb6d9; border-color: rgba(79,182,217,0.4); }
.set-row.has-rpe { grid-template-columns: 42px 1fr 1fr 60px auto; }
.live-tools { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.live-tools .small-btn.on { border-color: var(--accent); color: var(--text); }
.superset-badge {
  display: inline-block; background: rgba(79,124,255,0.18); border: 1px solid rgba(79,124,255,0.4);
  color: #a8bdff; border-radius: 5px; padding: 0 5px; font-size: 10px; font-weight: 700; margin-right: 5px;
}

/* rpe, niggles, load, muscle balance */
.template-bar { display: flex; gap: 8px; padding: 0 24px 10px; flex-wrap: wrap; }
.rpe-scale { display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; }
.rpe-scale button {
  background: var(--panel-2); border: 1px solid var(--border); color: var(--muted);
  border-radius: 6px; padding: 9px 0; font-size: 12.5px; cursor: pointer;
}
.rpe-scale button.active { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700; }

.niggle-row {
  border: 1px solid rgba(224,102,95,0.28); border-radius: 10px; padding: 10px;
  margin-bottom: 8px; background: rgba(224,102,95,0.05);
}
.niggle-top { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-bottom: 8px; }
.niggle-scale { display: flex; gap: 4px; align-items: center; margin-bottom: 8px; flex-wrap: wrap; }
.niggle-scale button {
  background: var(--panel-2); border: 1px solid var(--border); color: var(--muted);
  border-radius: 6px; width: 34px; padding: 7px 0; font-size: 12px; cursor: pointer;
}
.niggle-scale button.active.good { background: var(--gold); border-color: var(--gold); color: #16181d; font-weight: 700; }
.niggle-scale button.active.ok { background: #e08b3b; border-color: #e08b3b; color: #16181d; font-weight: 700; }
.niggle-scale button.active.weak { background: var(--danger); border-color: var(--danger); color: #fff; font-weight: 700; }
.niggle-label { font-size: 11.5px; color: var(--muted); margin-left: 6px; }
.niggle-pill { font-size: 10.5px; border-radius: 999px; padding: 2px 8px; border: 1px solid; white-space: nowrap; }
.niggle-pill.good { color: var(--gold); border-color: rgba(230,185,59,0.45); }
.niggle-pill.ok { color: #e08b3b; border-color: rgba(224,139,59,0.45); }
.niggle-pill.weak { color: var(--danger); border-color: rgba(224,102,95,0.45); }

.muscle-row { display: grid; grid-template-columns: 110px 1fr 70px; gap: 10px; align-items: center; margin-bottom: 6px; }
.muscle-name { font-size: 12px; text-transform: capitalize; }
.muscle-bar { height: 8px; background: var(--panel-2); border-radius: 999px; overflow: hidden; }
.muscle-bar span { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.muscle-val { font-size: 11.5px; color: var(--muted); text-align: right; }

@media (max-width: 480px) {
  .rpe-scale { grid-template-columns: repeat(5, 1fr); }
  .rpe-scale button { padding: 11px 0; font-size: 14px; }
  .muscle-row { grid-template-columns: 84px 1fr 58px; gap: 8px; }
  .template-bar { padding-left: 16px; padding-right: 16px; }
}

/* mobility */
.mob-item {
  border: 1px solid var(--border); border-radius: 10px; padding: 10px;
  margin-bottom: 8px; background: var(--panel-2);
}
.mob-top { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-bottom: 8px; }
.mob-row { display: grid; grid-template-columns: 96px 60px 70px 1fr; gap: 8px; align-items: center; }
.mob-row input { padding: 7px 6px; font-size: 12.5px; text-align: center; }
.mob-row .seg button { min-width: 0; padding: 7px 4px; font-size: 11.5px; }
.mob-side { display: flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--muted); cursor: pointer; }
.mob-side input { width: auto; }
.mob-note { margin-top: 8px; font-size: 12.5px; padding: 7px 9px; }
.mob-block {
  border: 1px dashed var(--border); border-radius: 10px; padding: 12px; margin-top: 16px;
}
.mob-block-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.mob-progress { font-size: 12px; color: var(--muted); text-align: center; margin-bottom: 8px; }
.mob-name { font-size: 20px; font-weight: 700; margin-bottom: 4px; }
.mob-dots { display: flex; gap: 4px; justify-content: center; flex-wrap: wrap; margin-top: 14px; }
.mob-dots .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--border); }
.mob-dots .dot.done { background: var(--done); }
.mob-dots .dot.active { background: var(--accent); transform: scale(1.4); }

@media (max-width: 480px) {
  .mob-row { grid-template-columns: 88px 52px 62px 1fr; gap: 6px; }
  .mob-row input { font-size: 16px; padding: 9px 4px; }
}

/* 1RM */
.onerm-input { display: grid; grid-template-columns: 1fr auto 90px; gap: 8px; align-items: center; }
.orm-headline {
  border-radius: 12px; padding: 16px; text-align: center; margin: 16px 0;
  border: 1px solid var(--border); background: var(--panel-2);
}
.orm-headline.good { border-color: rgba(34,197,94,0.45); background: rgba(34,197,94,0.08); }
.orm-headline.ok { border-color: rgba(230,185,59,0.45); background: rgba(230,185,59,0.08); }
.orm-headline.weak { border-color: rgba(224,102,95,0.4); background: rgba(224,102,95,0.07); }
.orm-label { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.orm-value { font-size: 34px; font-weight: 700; line-height: 1.15; margin: 2px 0; font-variant-numeric: tabular-nums; }
.orm-conf { font-size: 12px; color: var(--muted); }
.orm-spread { font-size: 11.5px; color: var(--muted); margin-top: 6px; }
.orm-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.orm-card {
  background: var(--panel-2); border: 1px solid var(--border); border-radius: 10px;
  padding: 12px; text-align: center;
}
.orm-card.has-value { border-color: var(--accent); }
.orm-card .orm-value { font-size: 22px; }
.orm-trend {
  border-radius: 8px; padding: 9px 12px; font-size: 12.5px; margin-bottom: 4px;
  background: var(--panel-2); border: 1px solid var(--border);
}
.orm-trend.good { color: var(--done); border-color: rgba(34,197,94,0.4); }
.orm-trend.ok { color: var(--gold); border-color: rgba(230,185,59,0.4); }
.orm-trend.weak { color: var(--danger); border-color: rgba(224,102,95,0.4); }
.orm-trend.neutral { color: var(--muted); }

.step-box {
  background: var(--panel-2); border: 1px solid var(--border); border-radius: 10px;
  padding: 12px; margin: 14px 0;
}
.step-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.step-edit { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.step-edit input { width: 74px; padding: 8px; text-align: center; }

/* weight units */
.unit-row { display: flex; align-items: center; gap: 10px; }
.unit-toggle { display: flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; flex-shrink: 0; }
.unit-toggle button {
  background: var(--panel-2); border: none; color: var(--muted);
  padding: 6px 12px; font-size: 12px; cursor: pointer; font-weight: 600;
}
.unit-toggle button.active { background: var(--accent); color: #fff; }
.conversion-strip {
  background: var(--panel-2); border: 1px solid var(--border); border-radius: 8px;
  padding: 8px 12px; font-size: 13px; color: var(--accent); text-align: center;
  margin: 10px 0; font-variant-numeric: tabular-nums; font-weight: 600;
}

/* programs */
.section-head { font-size: 13.5px; margin: 4px 0 10px; color: var(--text); }
.section-head-row {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  margin: 10px 0 12px; padding-top: 16px; border-top: 1px solid var(--border); flex-wrap: wrap;
}
.programs-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px,1fr)); gap: 14px; margin-bottom: 26px; }
.program-card.preset { border-style: dashed; }
.preset-author { font-size: 11px; color: var(--muted); margin-bottom: 6px; }
.week-head {
  display: flex; align-items: center; gap: 10px; font-size: 12.5px; font-weight: 700;
  color: var(--accent); margin: 16px 0 8px; padding-top: 10px; border-top: 1px solid var(--border);
}
.max-row {
  display: grid; grid-template-columns: 1fr 90px auto; gap: 8px; align-items: center; margin-bottom: 7px;
}
.max-row .max-name { font-size: 12.5px; }
.max-row input { padding: 7px 8px; font-size: 12.5px; }
.program-exercise-row.with-percent { grid-template-columns: 1.6fr .7fr .7fr .7fr 46px .8fr .7fr auto; }
.resolved-weight { font-size: 11.5px; color: var(--accent); text-align: center; white-space: nowrap; }
.import-status { border-radius: 8px; padding: 9px 12px; font-size: 12.5px; margin-bottom: 12px; }
.import-status.ok { background: rgba(34,197,94,0.12); border: 1px solid rgba(34,197,94,0.4); color: #8fe0ae; }
.import-status.warn { background: rgba(230,185,59,0.12); border: 1px solid rgba(230,185,59,0.4); color: var(--gold); }
.import-preview {
  background: var(--panel-2); border: 1px solid var(--border); border-radius: 10px;
  padding: 12px; max-height: 260px; overflow-y: auto;
}
.preview-day { margin-bottom: 12px; }
.preview-day:last-child { margin-bottom: 0; }
.preview-day-name { font-size: 12.5px; font-weight: 700; margin-bottom: 5px; }
.preview-ex { display: flex; justify-content: space-between; gap: 12px; font-size: 12px; padding: 3px 0; }
code { background: var(--panel-2); border: 1px solid var(--border); border-radius: 4px; padding: 1px 5px; font-size: 11.5px; }

/* cardio */
.distance-row { display: grid; grid-template-columns: 1fr 90px; gap: 8px; }
.hr-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.interval-spec { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.pace-readout {
  margin-top: 8px; font-size: 13px; color: var(--muted);
  background: var(--panel-2); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px;
}
.pace-readout b { color: var(--accent); font-size: 15px; }
.round-split {
  display: grid; grid-template-columns: 28px 1fr 90px; gap: 8px; align-items: center; margin-bottom: 6px;
}
.round-split .round-num { color: var(--muted); font-size: 12px; text-align: center; }
.round-split input { padding: 7px 8px; font-size: 12.5px; }

.interval-timer {
  border-radius: 14px; padding: 22px 18px; text-align: center;
  border: 1px solid var(--border); background: var(--panel-2); transition: background 0.2s, border-color 0.2s;
}
.interval-timer.work { border-color: var(--accent); background: rgba(79,124,255,0.12); }
.interval-timer.rest { border-color: var(--done); background: rgba(34,197,94,0.10); }
.interval-timer.done { border-color: var(--gold); background: rgba(230,185,59,0.10); }
.interval-round { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.interval-phase { font-size: 15px; font-weight: 700; letter-spacing: 0.08em; margin-bottom: 6px; }
.interval-timer.work .interval-phase { color: var(--accent); }
.interval-timer.rest .interval-phase { color: var(--done); }
.interval-timer .big-time { font-size: 58px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.05; }
.interval-timer .rest-bar { margin: 12px 0 6px; }
.interval-next { font-size: 12px; color: var(--muted); margin-bottom: 12px; }
.interval-actions { display: flex; justify-content: center; gap: 8px; margin-top: 10px; }
.interval-dots { display: flex; gap: 5px; justify-content: center; flex-wrap: wrap; margin-top: 14px; }
.interval-dots .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--border); }
.interval-dots .dot.done { background: var(--done); }
.interval-dots .dot.active { background: var(--accent); transform: scale(1.35); }
.impact-tag {
  font-size: 10px; border-radius: 999px; padding: 1px 7px; border: 1px solid;
  color: var(--gold); border-color: rgba(230,185,59,0.45);
}

/* whoop */
#whoopBanner { padding: 0 24px 12px; }
.whoop-banner {
  display: flex; align-items: center; gap: 14px; background: var(--panel);
  border: 1px solid var(--border); border-left: 3px solid var(--muted);
  border-radius: 12px; padding: 14px 16px; flex-wrap: wrap;
}
.whoop-banner.green { border-left-color: var(--done); }
.whoop-banner.yellow { border-left-color: var(--gold); }
.whoop-banner.red { border-left-color: var(--danger); }
.whoop-ring {
  width: 56px; height: 56px; border-radius: 50%; flex-shrink: 0;
  background: conic-gradient(var(--ring) calc(var(--pct) * 1%), var(--panel-2) 0);
  display: flex; align-items: center; justify-content: center; position: relative;
}
.whoop-ring::after {
  content: ''; position: absolute; inset: 6px; border-radius: 50%; background: var(--panel);
}
.whoop-ring span {
  position: relative; z-index: 1; font-size: 15px; font-weight: 700;
}
.whoop-ring small { font-size: 9px; font-weight: 500; color: var(--muted); }
.whoop-copy { flex: 1; min-width: 180px; }
.whoop-title { font-size: 14px; font-weight: 700; margin-bottom: 2px; }
.whoop-note { font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.whoop-metrics { font-size: 11.5px; color: var(--muted); margin-top: 5px; }
.day-recovery {
  font-size: 10px; padding: 1px 6px; border-radius: 999px; border: 1px solid;
  margin-left: 6px; vertical-align: middle; font-weight: 600;
}

.bw-list { display: flex; flex-direction: column; gap: 6px; }
.bw-row {
  display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center;
  background: var(--panel-2); border: 1px solid var(--border); border-radius: 8px;
  padding: 7px 10px; font-size: 12.5px;
}
.bw-row .remove-btn { padding: 4px 9px; }

.backup-nudge {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: 0 24px 14px; padding: 10px 14px; font-size: 12.5px;
  background: rgba(230,185,59,0.1); border: 1px solid rgba(230,185,59,0.4);
  border-radius: 10px; color: var(--text);
}
.backup-nudge span { flex: 1; min-width: 200px; }
@media (max-width: 480px) { .backup-nudge { margin: 0 12px 12px; } }

/* onboarding */
.onboard-modal { max-width: 460px; }
.onboard-modal h2 { font-size: 20px; margin: 4px 0 10px; }
.ob-lead { color: var(--muted); font-size: 13.5px; line-height: 1.6; margin: 0 0 16px; }
.ob-list { margin: 0 0 4px; padding-left: 18px; }
.ob-list li { font-size: 13.5px; line-height: 1.6; margin-bottom: 8px; }
.ob-picks { display: flex; flex-direction: column; gap: 8px; }
.ob-pick {
  display: flex; align-items: center; gap: 12px; text-align: left; width: 100%;
  background: var(--panel-2); border: 1px solid var(--border); color: var(--text);
  border-radius: 10px; padding: 12px; cursor: pointer;
}
.ob-pick.on { border-color: var(--accent); background: rgba(79,124,255,0.12); }
.ob-pick-icon { font-size: 22px; line-height: 1; }
.ob-pick b { display: block; font-size: 14px; margin-bottom: 2px; }
.ob-pick small { color: var(--muted); font-size: 12px; }
.ob-dots { display: flex; gap: 6px; justify-content: center; margin: 20px 0 4px; }
.ob-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--border); }
.ob-dot.on { background: var(--accent); }
.ob-sample {
  display: block; width: 100%; margin-top: 10px; background: none; border: none;
  color: var(--muted); font-size: 12.5px; cursor: pointer; text-decoration: underline;
}
.ob-sample:hover { color: var(--text); }

/* exercise bank */
.bank-group { margin-bottom: 14px; }
.bank-row {
  display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center;
  border: 1px solid var(--border); border-radius: 10px; padding: 4px 10px 4px 4px;
  margin-bottom: 6px; background: var(--panel-2);
}
.bank-row.avoided { border-color: rgba(224,102,95,0.4); background: rgba(224,102,95,0.06); }
.bank-main {
  background: none; border: none; color: var(--text); text-align: left;
  padding: 8px 10px; cursor: pointer; width: 100%;
}
.bank-name { font-size: 13.5px; font-weight: 600; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.bank-meta { font-size: 11.5px; color: var(--muted); margin-top: 3px; text-transform: capitalize; }
.bank-note { font-size: 11.5px; color: var(--muted); margin-top: 4px; font-style: italic; }
.bank-note.avoid { color: var(--danger); font-style: normal; }
.bank-tag { font-size: 9.5px; border-radius: 999px; padding: 1px 7px; border: 1px solid; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.bank-tag.custom { color: var(--accent); border-color: rgba(79,124,255,0.5); }
.bank-tag.edited { color: var(--gold); border-color: rgba(230,185,59,0.5); }
.bank-tag.avoid { color: var(--danger); border-color: rgba(224,102,95,0.5); }

.bank-tag.cues { color: var(--done); border-color: rgba(34,197,94,0.5); }
.bank-tag.video { color: #ff5a5f; border-color: rgba(255,90,95,0.5); }
.detail-meta {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px,1fr)); gap: 12px;
  background: var(--panel-2); border: 1px solid var(--border); border-radius: 10px;
  padding: 12px; margin-bottom: 14px; font-size: 12.5px;
}
.detail-meta .orm-label { display: block; margin-bottom: 3px; }
.video-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.video-btn { text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
a.btn-primary.video-btn { padding: 10px 16px; border-radius: 8px; flex: 0 0 auto; }
a.small-btn.video-btn { padding: 10px 14px; }
.cue-list { margin: 0 0 4px; padding-left: 18px; }
.cue-list li { font-size: 13px; line-height: 1.55; margin-bottom: 6px; color: var(--text); }

/* exercise swap */
.filter-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.filter-chip {
  background: var(--panel-2); border: 1px solid var(--border); color: var(--text);
  border-radius: 999px; padding: 6px 12px; font-size: 12px; cursor: pointer;
}
.filter-chip.off {
  background: rgba(224,102,95,0.12); border-color: rgba(224,102,95,0.5); color: var(--danger);
  text-decoration: line-through;
}
/* Multi-select chips (what a session included) need a selected state. */
.filter-chip.on {
  background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600;
}
.swap-card {
  background: var(--panel-2); border: 1px solid var(--border); border-radius: 10px;
  padding: 12px; margin-bottom: 10px;
}
.swap-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.swap-name { font-size: 14.5px; font-weight: 600; }
.swap-equip { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.swap-quality { font-size: 10.5px; border-radius: 999px; padding: 3px 9px; white-space: nowrap; border: 1px solid; }
.swap-quality.good { color: var(--done); border-color: rgba(34,197,94,0.45); background: rgba(34,197,94,0.1); }
.swap-quality.ok { color: var(--gold); border-color: rgba(230,185,59,0.45); background: rgba(230,185,59,0.1); }
.swap-quality.weak { color: var(--muted); border-color: var(--border); }
.swap-target { font-size: 17px; font-weight: 700; margin: 8px 0 4px; color: var(--accent); }
.swap-basis { font-size: 11.5px; color: var(--muted); line-height: 1.45; }
.swap-note { font-size: 11.5px; color: var(--muted); margin-top: 4px; padding-left: 10px; border-left: 2px solid var(--border); }
.swap-use { margin-top: 10px; width: 100%; padding: 9px; }
.sub-from {
  display: inline-block; font-size: 10.5px; color: var(--muted); background: var(--panel-2);
  border: 1px solid var(--border); border-radius: 5px; padding: 1px 6px; margin-left: 6px; vertical-align: middle;
}

/* plate calculator */
.plate-visual { display: flex; align-items: center; justify-content: center; gap: 3px; flex-wrap: wrap; margin: 14px 0; min-height: 60px; }
.plate {
  border-radius: 3px; display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; color: #0f1115; width: 26px;
}
.plate-bar { height: 6px; background: var(--muted); flex: 0 0 26px; border-radius: 2px; }
.plate-total { text-align: center; font-size: 13px; color: var(--muted); }
.plate-total b { color: var(--text); font-size: 15px; }
.plate-warn { color: var(--gold); font-size: 12px; text-align: center; margin-top: 8px; }

/* line chart */
.chart-svg { width: 100%; height: 170px; display: block; overflow: visible; }
.chart-svg .grid-line { stroke: var(--border); stroke-width: 1; }
.chart-svg .axis-label { fill: var(--muted); font-size: 10px; }
.chart-svg .series-line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart-svg .series-dot { fill: var(--accent); }
.chart-picker { margin-bottom: 12px; }

/* profile */
#profileContent { padding: 16px 24px 40px; display: flex; flex-direction: column; gap: 20px; }
.belt-display { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.belt-bar {
  width: 90px; height: 26px; border-radius: 5px; position: relative; border: 1px solid rgba(255,255,255,0.18);
  display: flex; align-items: center; justify-content: flex-end; padding-right: 5px; gap: 2px;
}
.belt-bar .stripe { width: 4px; height: 18px; background: #fff; border-radius: 1px; }
.belt-meta { font-size: 13px; }
.belt-meta .belt-name { font-weight: 700; font-size: 15px; }
.belt-meta .belt-since { color: var(--muted); font-size: 11.5px; margin-top: 2px; }
.promo-row {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 12.5px;
}
.promo-row:last-child { border-bottom: none; }
.promo-row .promo-note { color: var(--muted); font-size: 11.5px; }
.danger-zone { border-color: rgba(224,102,95,0.35); }

/* mobile touch targets — this screen gets used mid-workout, so make it thumb-friendly */
@media (max-width: 480px) {
  input[type="text"], input[type="number"], input[type="search"], input[type="date"], select, textarea { font-size: 16px; }
  .set-row { grid-template-columns: 36px 1fr 1fr auto; gap: 6px; }
  .set-row input { padding: 11px 8px; font-size: 16px; }
  .set-row .log-set-btn { padding: 11px 12px; font-size: 13px; }
  .exercise-nav button { padding: 9px 12px; font-size: 13px; }
  .rest-timer .rest-actions button { padding: 11px 16px; font-size: 13px; }
  .rest-timer .big-time { font-size: 46px; }
  .live-modal .modal-actions button { padding: 13px; }
  .add-btn, .session-pill .start-btn { padding: 10px; font-size: 13px; }
  .set-row.has-rpe { grid-template-columns: 36px 1fr 1fr 52px auto; gap: 4px; }
  .set-row.has-rpe input { padding: 11px 5px; }
  .set-row .set-type-btn { padding: 11px 0; }
  .sub-row { grid-template-columns: 1.2fr 1fr auto; }
  .match-row .row-top { grid-template-columns: 1fr 80px auto; }
  .search-wrap, #searchResults, #profileContent, .programs-grid { padding-left: 16px; padding-right: 16px; }

  /* Exercise rows have too many columns for a phone — put the name on its own
     line and let the numbers share the row beneath it. */
  .exercise-row {
    grid-template-columns: repeat(6, 1fr);
    gap: 6px;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
  }
  /* Explicit row placement, so the numeric fields start on a fresh line
     instead of flowing into the gap beside the name. */
  .exercise-row > input[data-field="name"] { grid-area: 1 / 1 / 2 / 6; }
  .exercise-row > button[data-remove], .exercise-row > button[data-remove-exercise] { grid-area: 1 / 6 / 2 / 7; }
  .exercise-row > input, .exercise-row > select { padding: 10px 6px; font-size: 15px; text-align: center; }
  .exercise-row > input[data-field="name"] { text-align: left; }

  .program-exercise-row, .program-exercise-row.with-percent { grid-template-columns: repeat(6, 1fr); }
  .program-exercise-row > input[data-field="name"] { grid-area: 1 / 1 / 2 / 6; }
  .program-exercise-row > button[data-remove-exercise] { grid-area: 1 / 6 / 2 / 7; }
  .resolved-weight { align-self: center; }

  .max-row { grid-template-columns: 1fr 80px auto; }
  .import-preview { max-height: 200px; }
}
.export-option .desc { font-size: 11.5px; color: var(--muted); margin-top: 2px; }

/* The fight, above everything else in the week it matters. */
.camp-strip {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; cursor: pointer;
  margin: 0 0 12px; padding: 10px 12px; border-radius: 10px;
  background: linear-gradient(90deg, rgba(224,102,95,0.18), rgba(224,102,95,0.04));
  border: 1px solid rgba(224,102,95,0.35);
}
.camp-strip .camp-when { font-weight: 700; font-size: 13px; }
.camp-strip .camp-name { color: var(--muted); font-size: 12.5px; flex: 1; }
.camp-strip .camp-weight { font-size: 12.5px; font-weight: 600; }

/* The commonest thing you do, one tap from the top of the form. */
.quick-log { display: flex; gap: 6px; flex-wrap: wrap; }
.quick-chip {
  background: var(--panel-2); border: 1px solid var(--border); color: var(--text);
  padding: 7px 11px; border-radius: 999px; cursor: pointer; font-size: 12.5px;
}
.quick-chip:hover { border-color: var(--accent); }

/* Four taps, on the way in. Compact enough not to be in the way once answered. */
.readiness-card .r-row { display: grid; grid-template-columns: 72px 1fr; gap: 8px 10px; align-items: center; margin-bottom: 8px; }
.readiness-card .r-name { font-size: 12.5px; color: var(--muted); }
.readiness-card .r-scale { display: flex; gap: 4px; }
.readiness-card .r-ends { grid-column: 2; font-size: 10.5px; color: var(--muted); margin-top: -4px; }
.readiness-done {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: 0 0 12px; padding: 8px 12px; border-radius: 10px;
  background: var(--panel); border: 1px solid var(--border);
}
.readiness-done .r-score { font-weight: 700; font-size: 15px; }
.readiness-done .r-score.good { color: var(--good, #3fa76b); }
.readiness-done .r-score.warn { color: var(--warn, #e6b93b); }
.readiness-done .r-label { flex: 1; font-size: 12.5px; color: var(--muted); }

/* One record per problem, with the part only a person can answer up front. */
.injury-row { padding: 10px 0; border-bottom: 1px solid var(--border); }
.injury-row:last-child { border-bottom: none; }
.injury-head { display: flex; align-items: center; gap: 8px; }
.injury-area { font-weight: 600; font-size: 13.5px; }
.injury-status { font-size: 11px; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--border); }
.injury-status.weak { color: #e0665f; border-color: rgba(224,102,95,0.4); }
.injury-status.ok { color: #e6b93b; border-color: rgba(230,185,59,0.4); }
.injury-status.good { color: #3fa76b; border-color: rgba(63,167,107,0.4); }
.injury-meta { font-size: 11.5px; color: var(--muted); margin: 4px 0 8px; }
.injury-actions { display: flex; gap: 5px; flex-wrap: wrap; }

/* One block per art, so two belts and a level read as three separate things. */
.rank-art { padding: 10px 0; border-bottom: 1px solid var(--border); }
.rank-art:last-child { border-bottom: none; }
.rank-art .promo-history { margin: 8px 0 0 0; padding-left: 12px; border-left: 2px solid var(--border); }

/* A bar in the cell, so a year of months reads as a shape not a column of digits. */
.month-bar { display: inline-block; width: 46px; height: 6px; border-radius: 3px;
  background: var(--panel-2); margin-right: 7px; vertical-align: middle; overflow: hidden; }
.month-bar > span { display: block; height: 100%; background: var(--accent); }

/* The way back, offered before anything is asked of a returning user. */
.ob-restore {
  margin-top: 16px; padding: 12px; border-radius: 10px; font-size: 12.5px;
  background: var(--panel-2); border: 1px dashed var(--border);
}
.ob-restore .small-btn { margin-top: 8px; }

/* The job, not the operation — so it reads before the three buttons under it. */
.export-option.move-phone { border-color: var(--accent); background: var(--panel-2); }
.move-steps { margin: 14px 0 0; padding-left: 20px; }
.move-steps li { margin-bottom: 14px; font-size: 13px; line-height: 1.5; }
.move-steps .small-btn { margin-top: 8px; }

/* Keyboard focus, visible. Without this a keyboard or switch user cannot tell
   where they are — and :focus-visible keeps it off mouse and touch taps, which
   is why the browser default was removed in the first place. */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Kept visually apart from the bug report, because sending one to the other
   address is the mistake this whole split exists to prevent. */
.contact-route { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.contact-route .label { font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.contact-route .desc { font-size: 12px; color: var(--muted); line-height: 1.5; }

/* Progress where it is seen, against the week being looked at. */
.goal-strip { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 12px; cursor: pointer; }
.goal-chip {
  display: inline-flex; align-items: baseline; gap: 5px; font-size: 12px;
  padding: 5px 10px; border-radius: 999px; background: var(--panel); border: 1px solid var(--border);
}
.goal-chip.done { border-color: rgba(63,167,107,0.5); color: #3fa76b; }
.goal-chip.missed { border-color: rgba(224,102,95,0.45); }
.goal-chip .sub { font-size: 11px; }
.goal-row { padding: 10px 0; border-bottom: 1px solid var(--border); }
.goal-row:last-child { border-bottom: none; }
.goal-head { display: flex; align-items: center; gap: 8px; }
.goal-name { font-weight: 600; font-size: 13.5px; flex: 1; }
.goal-state { font-size: 11px; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--border); }
.goal-state.good { color: #3fa76b; border-color: rgba(63,167,107,0.4); }
.goal-state.weak { color: #e0665f; border-color: rgba(224,102,95,0.4); }
.goal-meta { font-size: 11.5px; color: var(--muted); margin: 4px 0 8px; }
.goal-rate { font-size: 12px; margin-bottom: 6px; }
.goal-history { display: flex; gap: 5px; align-items: flex-end; margin-bottom: 10px; }
.goal-bar { display: flex; flex-direction: column; align-items: center; gap: 3px; width: 22px; }
.goal-bar-fill { width: 100%; border-radius: 3px; background: var(--panel-2); align-self: stretch; }
.goal-bar.on .goal-bar-fill { background: var(--accent); }
.goal-bar-count { font-size: 10px; color: var(--muted); line-height: 1; }
.goal-bar.on .goal-bar-count { color: var(--accent); }
.goal-actions { display: flex; gap: 5px; }

/* Editing the layout sits above the cards it rearranges, so the effect is visible. */
.layout-toggle { cursor: pointer; border-color: var(--accent); color: var(--accent); }
.layout-row { display: flex; align-items: center; gap: 6px; padding: 7px 0; border-bottom: 1px solid var(--border); }
.layout-row:last-of-type { border-bottom: none; }
.layout-name { flex: 1; font-size: 13px; }
.layout-name.off { color: var(--muted); text-decoration: line-through; }
.layout-row .small-btn[disabled] { opacity: 0.35; cursor: default; }

/* Load as bars, readiness as dots above them. Scaled separately and labelled,
   because two scales on one chart otherwise imply a relationship. */
.lr-chart { display: flex; align-items: flex-end; gap: 6px; height: 120px; overflow-x: auto; padding-top: 8px; }
.lr-col { position: relative; flex: 1; min-width: 22px; height: 100%;
  display: flex; flex-direction: column; justify-content: flex-end; align-items: center; }
.lr-bar { width: 100%; background: var(--accent); border-radius: 3px 3px 0 0; opacity: 0.75; }
.lr-dot { position: absolute; width: 8px; height: 8px; border-radius: 50%; background: #3fa76b;
  left: 50%; margin-left: -4px; }
.lr-label { font-size: 9.5px; color: var(--muted); margin-top: 4px; white-space: nowrap; }

/* The measure toggle sits in the card's own heading, so it reads as part of the
   chart rather than as a setting somewhere else. */
.seg.chart-mode { display: inline-flex; float: right; gap: 4px; }
.seg.chart-mode button { flex: 0 0 auto; min-width: 0; padding: 4px 10px; font-size: 11.5px; }

/* Start workout chooser: one tappable row per way to start. */
.start-section { margin-bottom: 14px; }
.start-section h3 { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 0 0 6px; font-weight: 600; }
.start-option {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; text-align: left;
  background: var(--panel-2); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px;
  margin-bottom: 6px; color: var(--text); cursor: pointer; font: inherit;
}
.start-option:hover { border-color: var(--accent); }
.start-option-title { font-weight: 600; font-size: 14px; }
.start-option-sub { color: var(--muted); font-size: 12px; }
.start-blank { width: 100%; margin-top: 4px; }

/* Workout templates in the Programs tab. */
.lift-template-row {
  display: flex; align-items: center; gap: 8px; background: var(--panel-2); border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 12px; margin-bottom: 8px;
}
.lift-template-text { flex: 1; min-width: 0; }
.lift-template-text .sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* A set already done reads as done, not as another button to press. */
.set-row .log-set-btn.is-done { color: var(--done); border-color: var(--done); background: transparent; }

/* Mat time calendar: one column per week, Monday at the top. */
.mat-year { float: right; width: auto; font-weight: 400; background: var(--panel-2); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px; padding: 3px 10px; font-size: 13px !important; }
.mat-scroll { overflow-x: auto; padding-bottom: 4px; }
.mat-grid { display: flex; gap: 3px; width: max-content; }
.mat-week { display: flex; flex-direction: column; gap: 3px; }
.mat-cell { display: inline-block; width: 11px; height: 11px; border-radius: 2px; background: var(--panel-2); }
.mat-cell.mat-blank { background: transparent; }
.mat-cell.mat-l1 { background: rgba(79, 124, 255, 0.35); }
.mat-cell.mat-l2 { background: rgba(79, 124, 255, 0.55); }
.mat-cell.mat-l3 { background: rgba(79, 124, 255, 0.78); }
.mat-cell.mat-l4 { background: var(--accent); }
.legend .mat-cell { margin: 0 1px; vertical-align: middle; }

/* Game plan: moves grouped by position. */
.move-group { margin-top: 12px; }
.move-group h4 { margin: 0 0 6px; font-size: 13px; font-weight: 600; }
.move-group h4 .sub { font-weight: 400; font-size: 12px; margin-left: 6px; }
.move-row { padding: 8px 0; border-bottom: 1px solid var(--border); }
.move-row:last-child { border-bottom: none; }
.move-main { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.link-btn { background: none; border: none; padding: 0; color: var(--text); font: inherit; font-size: 14px; font-weight: 600;
  cursor: pointer; text-align: left; }
.link-btn:hover, .link-btn:focus-visible { color: var(--accent); text-decoration: underline; }
.move-video { margin-left: auto; text-decoration: none; }
.move-counts { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.move-counts b { color: var(--text); }
.move-notes { font-size: 12.5px; margin-top: 4px; white-space: pre-wrap; color: var(--text); opacity: 0.85; }
.move-candidates { display: flex; flex-wrap: wrap; gap: 6px; }

/* Read out by screen readers, not shown. */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.class-notes { margin-top: 14px; }

/* Camp weight chart: raw weigh-ins, the class limit and the weigh-in day. */
.camp-raw { fill: var(--muted); opacity: 0.7; }
.camp-limit { stroke: var(--gold); stroke-width: 1.5; stroke-dasharray: 5 4; }
.camp-limit-label { fill: var(--gold); }
.camp-weighin { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; }
