/* ── GLOBAL TOKENS ────────────────────────────────────────────────────── */
:root {
  /* GUS — warm cream base, deep brindle browns, tiger-stripe orange accent */
  --bg: #F4EFE6;
  --surface: #FBF7F0;
  --surface-2: #EFE9DD;
  --surface-3: #E5DDCC;
  --border: #DDD3BE;
  --border-strong: #C5B89B;
  --text: #1A130C;
  --text-muted: #6B5B45;
  --text-dim: #9A8B70;

  --primary: #C8501F;          /* burnt tiger-orange (more brindle than the old) */
  --primary-soft: #F6E4D2;
  --primary-dark: #8B3712;
  --brindle: #3A2614;          /* deep brown — sidebar, headings */
  --brindle-2: #5C3D22;
  --tan: #C9A074;              /* warm fur tan */
  --pr: oklch(0.62 0.16 145);
  --danger: oklch(0.6 0.18 25);

  --radius: 10px;
  --radius-lg: 14px;
  --radius-sm: 6px;

  --font-sans: "Inter", -apple-system, system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Consolas, monospace;

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 4px 12px rgba(0,0,0,0.04);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.08);

  --sidebar-w: 240px;
}

/* Production auth shell */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
}
.input {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text);
  padding: 8px 10px;
  font: inherit;
  outline: none;
}
.input:focus {
  border-color: var(--primary);
}
.form-label {
  display: block;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 6px;
}
.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 9px;
}
.segmented button {
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  padding: 8px 10px;
  font-weight: 700;
  cursor: pointer;
}
.segmented button.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}
.spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; cursor: pointer; }
input { font-family: inherit; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -0.01em; font-weight: 650; }
h1 { font-size: 24px; letter-spacing: -0.02em; }
h2 { font-size: 16px; letter-spacing: -0.005em; }
h3 { font-size: 14px; }
.muted { color: var(--text-muted); }

/* ── APP SHELL ────────────────────────────────────────────────────────── */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
  background: var(--bg);
}

.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 16px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.sb-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}
.sb-brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.sb-brand-name { font-weight: 800; font-size: 17px; color: var(--brindle); letter-spacing: 0.12em; }
.sb-brand-sub { font-size: 9px; letter-spacing: 0.18em; color: var(--text-muted); text-transform: uppercase; }
.sb-brand-logo {
  width: 32px; height: 32px; border-radius: 8px; flex-shrink: 0;
  background: var(--brindle) center/contain no-repeat;
  border: 1px solid var(--brindle-2);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.04);
}
.sb-lang {
  margin-left: auto;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 3px 6px;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
}
.sb-lang:hover { background: var(--surface-3); }

.sb-section {
  padding: 12px 12px 4px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  text-transform: uppercase;
}
.sb-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: transparent;
  border: 0;
  color: var(--text);
  font-size: 13.5px;
  width: 100%;
  text-align: left;
  font-weight: 500;
  transition: background 0.1s;
}
.sb-link:hover { background: var(--surface-2); }
.sb-link.active {
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 600;
}
.sb-link.active svg { color: var(--primary); }
.sb-link svg { color: var(--text-muted); flex-shrink: 0; }

.sb-foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-top: 1px solid var(--border);
}
.sb-foot-info { line-height: 1.2; }
.sb-foot-name { font-weight: 600; font-size: 13px; }
.sb-foot-role { font-size: 11px; color: var(--text-muted); }
.sb-logout { margin-left: auto; background: transparent; border: 0; color: var(--text-muted); padding: 6px; border-radius: 6px; }
.sb-logout:hover { background: var(--surface-2); color: var(--text); }

/* ── PAGE ─────────────────────────────────────────────────────────────── */
.main {
  padding: 32px 40px 80px;
  min-width: 0;
  max-width: 1280px;
}
.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  margin-bottom: 28px;
}
.page-sub { color: var(--text-muted); margin: 4px 0 0; font-size: 13.5px; }

/* ── BUTTONS ──────────────────────────────────────────────────────────── */
.btn-primary {
  background: var(--primary);
  color: #fff;
  border: 0;
  padding: 10px 16px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 13.5px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 1px 0 rgba(255,255,255,0.2) inset, 0 1px 2px rgba(0,0,0,0.1);
}
.btn-primary:hover { background: oklch(0.6 0.16 45); }
.btn-primary.full { width: 100%; justify-content: center; padding: 12px; }
.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 8px 14px;
  border-radius: 8px;
  font-weight: 500;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-secondary:hover { background: var(--surface-2); border-color: var(--border-strong); }
.btn-ghost {
  background: transparent;
  border: 0;
  padding: 6px 10px;
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.icon-btn {
  background: transparent; border: 0; padding: 6px;
  border-radius: 6px; color: var(--text-muted);
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.link-btn {
  background: transparent; border: 0; color: var(--primary);
  font-weight: 500; font-size: 12.5px;
}

/* ── DASHBOARD ────────────────────────────────────────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.stat-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 6px;
}
.stat-value {
  font-family: var(--font-mono);
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1;
  margin-top: 4px;
}
.stat-value .stat-unit {
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 500;
  margin-left: 2px;
}
.stat-trend { font-size: 11px; font-weight: 500; margin-top: 2px; }
.stat-trend.pos { color: var(--pr); }
.stat-trend.muted { color: var(--text-muted); }

.dash-cols {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 24px;
}
.section-head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 12px;
}

.workout-list { display: flex; flex-direction: column; gap: 8px; }
.workout-row {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  display: grid;
  grid-template-columns: 48px 1fr auto;
  align-items: center;
  gap: 12px;
}
.wr-date {
  display: flex; flex-direction: column; align-items: center;
  background: var(--surface-2);
  border-radius: 8px;
  padding: 4px 8px;
}
.wr-day { font-family: var(--font-mono); font-size: 18px; font-weight: 600; line-height: 1; }
.wr-mon { font-size: 9px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; }
.wr-name { font-weight: 600; font-size: 14px; }
.wr-meta { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.wr-tags { display: flex; gap: 4px; flex-wrap: wrap; max-width: 240px; }
.chip-mini {
  background: var(--surface-2); padding: 3px 8px;
  border-radius: 999px; font-size: 11px; color: var(--text-muted);
  white-space: nowrap;
}

.quick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.quick-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
  overflow: hidden;
  transition: transform 0.1s, box-shadow 0.1s;
}
.quick-card:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.qc-stripe { position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--accent); }
.qc-name { font-weight: 600; font-size: 14px; }
.qc-meta { font-size: 12px; color: var(--text-muted); }

/* ── WORKOUTS LIST ────────────────────────────────────────────────────── */
.month-nav {
  display: flex; align-items: center; gap: 12px; margin-bottom: 16px;
}
.month-label {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.05em;
}
.empty-state {
  text-align: center;
  padding: 80px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.empty-state h3 { margin-top: 8px; }
.empty-state p { color: var(--text-muted); margin: 0 0 12px; }
.month-summary {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 16px;
  overflow: hidden;
}
.month-summary > div { background: var(--surface); padding: 14px 18px; }
.ms-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600; }
.ms-val { font-family: var(--font-mono); font-size: 22px; font-weight: 600; margin-top: 4px; }
.ms-val span { font-size: 13px; color: var(--text-muted); margin-left: 1px; }

.workout-detail {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.wd-head {
  width: 100%;
  background: transparent;
  border: 0;
  padding: 12px 14px;
  display: grid;
  grid-template-columns: 48px 1fr auto;
  align-items: center;
  gap: 12px;
  text-align: left;
}
.wd-body {
  border-top: 1px solid var(--border);
  padding: 12px 14px 14px 74px;
  display: flex; flex-direction: column; gap: 10px;
}
.wd-ex-name { font-weight: 600; font-size: 13px; margin-bottom: 4px; }
.wd-sets { display: flex; gap: 6px; flex-wrap: wrap; }
.wd-set {
  background: var(--surface-2);
  border-radius: 6px;
  padding: 4px 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.wd-set.pr { background: oklch(0.94 0.06 145); color: oklch(0.35 0.12 145); }
.wd-set-n { color: var(--text-muted); margin-right: 2px; }
.wd-set-w { font-weight: 600; }
.wd-set-x { color: var(--text-muted); }
.wd-pr {
  background: var(--pr); color: #fff; padding: 1px 5px;
  border-radius: 3px; font-size: 9px; font-weight: 700; margin-left: 4px; letter-spacing: 0.04em;
}

/* ── CALENDAR ─────────────────────────────────────────────────────────── */
.cal-layout { display: grid; grid-template-columns: 1fr 320px; gap: 20px; }
.cal-main {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
}
.cal-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.cal-title { font-weight: 650; font-size: 15px; letter-spacing: -0.005em; }
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.cal-dow {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  text-align: center;
  padding: 6px 0;
}
.cal-day {
  aspect-ratio: 1;
  background: var(--surface-2);
  border: 1px solid transparent;
  border-radius: 8px;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 6px 8px;
  font-size: 12px;
  color: var(--text);
  transition: background 0.1s;
}
.cal-day.empty { background: transparent; }
.cal-day:not(.empty):hover { background: var(--surface-3); }
.cal-day.has-workout { background: var(--surface); border-color: var(--border); }
.cal-day.today { box-shadow: 0 0 0 2px var(--primary); }
.cal-day.selected { background: var(--primary-soft); border-color: var(--primary); }
.cd-num { font-family: var(--font-mono); font-weight: 600; }
.cd-marker {
  position: absolute; bottom: 6px; left: 8px;
  width: 6px; height: 6px; border-radius: 50%;
}

.cal-side {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  height: fit-content;
}
.cs-day { font-weight: 650; font-size: 14px; margin-bottom: 12px; }
.cs-name { font-weight: 600; font-size: 16px; margin-bottom: 2px; }
.cs-meta { font-size: 12px; color: var(--text-muted); margin-bottom: 16px; }
.cs-list { display: flex; flex-direction: column; gap: 6px; }
.cs-ex {
  display: flex; justify-content: space-between;
  padding: 8px 10px;
  background: var(--surface-2); border-radius: 6px;
  font-size: 12.5px;
}
.cs-ex .cs-sets { font-family: var(--font-mono); color: var(--text-muted); }
.cs-empty { padding: 20px 0; text-align: center; }
.cs-empty p { color: var(--text-muted); margin: 0 0 12px; font-size: 12.5px; }

/* ── WORKOUT START ─────────────────────────────────────────────────────── */
.workout-start-layout {
  display: grid;
  grid-template-columns: minmax(320px, 1.1fr) minmax(300px, .9fr);
  gap: 16px;
  align-items: start;
}
.workout-start-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.workout-start-panel.photo-panel {
  grid-column: 1 / -1;
}
.workout-mode {
  width: fit-content;
}
.workout-template-start,
.workout-builder {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.workout-ex-results {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 8px;
  max-height: 420px;
  overflow-y: auto;
}
.workout-ex-pick {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  gap: 2px 8px;
  align-items: center;
  text-align: left;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  border-radius: 8px;
  padding: 8px;
}
.workout-ex-pick:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
}
.workout-ex-pick .ex-thumb { grid-row: 1 / 3; }
.workout-ex-pick span {
  font-weight: 650;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.workout-ex-pick small {
  color: var(--text-muted);
}
.workout-ex-pick svg {
  grid-row: 1 / 3;
  grid-column: 3;
  color: var(--primary);
}
.workout-draft-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 180px;
}
.workout-draft-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: 8px;
  padding: 8px;
}
.workout-draft-row strong,
.workout-draft-row span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.workout-draft-row span {
  color: var(--text-muted);
  font-size: 12px;
}
.photo-upload-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: fit-content;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  border-radius: 8px;
  padding: 10px 14px;
  font-weight: 650;
  cursor: pointer;
}
.photo-context-grid {
  display: grid;
  grid-template-columns: minmax(180px, .45fr) minmax(240px, 1fr);
  gap: 10px;
}
.photo-upload-btn input {
  display: none;
}
.photo-ready {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  border: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: 10px;
  padding: 8px;
  max-width: 520px;
}
.photo-ready img {
  width: 72px;
  height: 54px;
  object-fit: cover;
  border-radius: 7px;
  background: var(--surface-3);
}
.photo-ready strong,
.photo-ready span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.photo-ready span {
  color: var(--text-muted);
  font-size: 12px;
}
.photo-result {
  border: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: 10px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.photo-result span {
  color: var(--text-muted);
  font-size: 12px;
}
.photo-choice-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
}
.photo-choice {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 8px;
  padding: 10px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.photo-choice img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 7px;
  background: var(--surface-2);
  margin-bottom: 4px;
}
.photo-choice:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
}
.photo-choice strong,
.photo-choice span,
.photo-choice small {
  overflow: hidden;
  text-overflow: ellipsis;
}
.photo-choice small {
  color: var(--text-muted);
  line-height: 1.35;
}
.photo-local-match {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 9px;
  padding: 8px;
}
.photo-local-match img {
  width: 72px;
  height: 54px;
  object-fit: cover;
  border-radius: 7px;
  background: var(--surface-2);
}
.photo-local-match strong,
.photo-local-match span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.photo-local-match span {
  color: var(--text-muted);
  font-size: 12px;
}
.form-success {
  color: var(--pr);
  font-size: 13px;
  font-weight: 650;
}
@media (max-width: 900px) {
  .workout-start-layout { grid-template-columns: 1fr; }
  .workout-start-panel.photo-panel { grid-column: auto; }
  .photo-context-grid { grid-template-columns: 1fr; }
}

/* ── TEMPLATES ────────────────────────────────────────────────────────── */
.tpl-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}
.tpl-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.tpl-stripe {
  position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: var(--accent);
  border-radius: var(--radius-lg) 0 0 var(--radius-lg);
}
.tpl-head { display: flex; justify-content: space-between; align-items: flex-start; }
.tpl-menu {
  position: absolute;
  top: 44px;
  right: 14px;
  z-index: 30;
  min-width: 190px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.tpl-menu button {
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 13px;
}
.tpl-menu button:hover { background: var(--surface-2); }
.tpl-menu button.danger { color: var(--danger); }
.tpl-name { font-weight: 650; font-size: 15px; }
.tpl-cat {
  font-size: 11px;
  color: var(--accent);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.tpl-stats { font-size: 12px; color: var(--text-muted); display: flex; gap: 4px; }
.tpl-ex { display: flex; flex-direction: column; gap: 4px; padding-top: 4px; border-top: 1px solid var(--border); }
.tpl-ex-row { display: flex; justify-content: space-between; font-size: 12.5px; }
.tpl-ex-name { color: var(--text); }
.tpl-ex-sets { font-family: var(--font-mono); color: var(--text-muted); }
.tpl-start {
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: 8px;
  padding: 9px 12px;
  font-weight: 600;
  font-size: 13px;
  margin-top: 6px;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.tpl-start:hover { filter: brightness(1.05); }
.compact-modal { max-width: 520px; }
.form-error {
  color: var(--danger);
  font-size: 13px;
  margin-top: 10px;
}
.share-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 320px;
  overflow-y: auto;
}
.share-user {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2px 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
}
.share-user small {
  grid-column: 2;
  color: var(--text-muted);
}
.template-day-start-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.template-day-start {
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  border-radius: 8px;
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-align: left;
}
.template-day-start span {
  display: block;
  color: var(--text-muted);
  font-size: 12px;
  margin-top: 2px;
}
.template-ex-library {
  border: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: 10px;
  padding: 10px;
  margin-bottom: 14px;
}
.template-ex-library-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.template-ex-library-head span {
  display: block;
  color: var(--text-muted);
  font-size: 12px;
  margin-top: 2px;
}
.template-ex-library-head select {
  max-width: 210px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 8px;
  padding: 8px 10px;
}
.template-ex-library-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 6px;
  max-height: 280px;
  overflow-y: auto;
  padding-right: 4px;
}
.template-ex-pick {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 8px;
  padding: 7px;
  text-align: left;
}
.template-ex-pick span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12.5px;
  font-weight: 650;
}
.template-ex-pick small {
  color: var(--text-muted);
  font-size: 11px;
}
.profile-edit-avatar {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

/* ── EXERCISES BROWSER ────────────────────────────────────────────────── */
.ex-layout {
  display: grid;
  grid-template-columns: 280px 1fr 360px;
  gap: 16px;
  height: calc(100vh - 200px);
  min-height: 600px;
}
.ex-filters {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px;
  overflow-y: auto;
  display: flex; flex-direction: column; gap: 16px;
}
.search-wrap {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
}
.search-wrap input {
  border: 0; background: transparent; flex: 1; outline: none;
  font-size: 13px; color: var(--text);
}
.search-wrap.inline { background: var(--surface); }
.filter-section { display: flex; flex-direction: column; gap: 8px; }
.filter-label {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--text-muted);
}
.muscle-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chip {
  background: var(--surface-2); border: 1px solid transparent;
  padding: 5px 10px; border-radius: 999px; font-size: 11.5px;
  color: var(--text-muted); font-weight: 500;
}
.chip:hover { background: var(--surface-3); }
.chip.active { background: var(--primary); color: #fff; border-color: var(--primary); }

.ex-list {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow-y: auto;
}
.ex-list-head {
  position: sticky; top: 0; background: var(--surface);
  padding: 12px 14px; border-bottom: 1px solid var(--border);
  font-size: 11.5px; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.04em;
  z-index: 1;
}
.ex-row {
  width: 100%; background: transparent; border: 0;
  padding: 10px 14px; display: grid;
  grid-template-columns: 44px 1fr 24px;
  gap: 12px; align-items: center;
  border-bottom: 1px solid var(--border);
  text-align: left;
}
.ex-row:hover { background: var(--surface-2); }
.ex-row.active { background: var(--primary-soft); }
.ex-thumb {
  width: 44px; height: 44px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-3);
}
.ex-thumb.lg { width: 80px; height: 80px; border-radius: 12px; }
.ex-name { font-weight: 600; font-size: 13.5px; }
.ex-tags { display: flex; gap: 4px; margin-top: 2px; }
.ex-tag {
  font-size: 10.5px; padding: 1px 6px;
  background: var(--surface-2); border-radius: 4px;
  color: var(--text-muted); font-weight: 500;
}
.ex-tag.muscle { background: var(--primary-soft); color: var(--primary); }
.ex-tag-sm { font-size: 11px; color: var(--text-muted); }
.ex-tag.lv-beginner { background: oklch(0.94 0.06 145); color: oklch(0.35 0.12 145); }
.ex-tag.lv-intermediate { background: oklch(0.94 0.06 70); color: oklch(0.4 0.12 70); }
.ex-tag.lv-advanced { background: oklch(0.94 0.06 25); color: oklch(0.4 0.16 25); }
.ex-level {
  width: 22px; height: 22px; border-radius: 50%;
  font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.ex-level.lv-beginner { background: oklch(0.94 0.06 145); color: oklch(0.35 0.12 145); }
.ex-level.lv-intermediate { background: oklch(0.94 0.06 70); color: oklch(0.4 0.12 70); }
.ex-level.lv-advanced { background: oklch(0.94 0.06 25); color: oklch(0.4 0.16 25); }

.ex-detail {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex; flex-direction: column;
}
.ex-media {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--border);
}
.ex-video-placeholder, .ex-img-placeholder {
  background-image: repeating-linear-gradient(45deg,
    transparent 0, transparent 8px,
    oklch(0.95 0.005 70) 8px, oklch(0.95 0.005 70) 9px);
  background-color: oklch(0.96 0.005 70);
  aspect-ratio: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px;
}
.ex-video-placeholder.real-media,
.ex-img-placeholder.real-media {
  background-image: none;
  background: #0b0805;
  overflow: hidden;
}
.ex-video-placeholder.real-media iframe,
.ex-video-placeholder.real-media video,
.ex-img-placeholder.real-media img {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  object-fit: cover;
}
.ex-media-label {
  font-family: var(--font-mono); font-size: 10px;
  color: var(--text-muted); letter-spacing: 0.05em;
}
.ex-media-sub {
  font-family: var(--font-mono); font-size: 9px;
  color: var(--text-dim); margin-top: 2px;
}
.ex-detail-body { padding: 18px; flex: 1; display: flex; flex-direction: column; gap: 12px; }
.ex-detail-body h2 { font-size: 18px; }
.ex-detail-tags { display: flex; gap: 4px; flex-wrap: wrap; }
.ex-secondary { font-size: 12px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.ex-stats-mini {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  margin-top: 4px;
}
.ex-stats-mini > div { background: var(--surface-2); padding: 10px 12px; }
.esm-label { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600; }
.esm-val { font-family: var(--font-mono); font-size: 14px; font-weight: 600; margin-top: 2px; }

/* ── CHARTS ───────────────────────────────────────────────────────────── */
.chart-controls { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.seg {
  display: inline-flex;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 3px;
}
.seg button {
  background: transparent; border: 0;
  padding: 7px 14px; border-radius: 6px;
  font-size: 12.5px; font-weight: 500; color: var(--text-muted);
}
.seg button.active { background: var(--primary); color: #fff; }
.seg.sm button { padding: 6px 12px; font-size: 11.5px; }
.seg.sm button.active { background: var(--text); }

.chart-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 16px;
}
.chart-current { margin-bottom: 16px; }
.cc-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; }
.cc-val { font-family: var(--font-mono); font-size: 36px; font-weight: 600; letter-spacing: -0.02em; line-height: 1; margin: 6px 0; }
.cc-val span { font-size: 16px; color: var(--text-muted); margin-left: 4px; }
.cc-trend { font-size: 12px; }
.cc-trend.pos { color: var(--pr); }

.chart-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.chart-mini {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
}
.cm-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; }
.cm-val { font-family: var(--font-mono); font-size: 22px; font-weight: 600; margin: 4px 0 8px; }
.cm-val span { font-size: 12px; color: var(--text-muted); margin-left: 2px; }

/* ── BIOMETRICS ───────────────────────────────────────────────────────── */
.bio-hero { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.bio-stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
}
.bio-stat.hero { padding: 24px; }
.bs-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; }
.bs-val { font-family: var(--font-mono); font-size: 36px; font-weight: 600; letter-spacing: -0.02em; line-height: 1; margin: 8px 0; }
.bs-val.sm { font-size: 22px; }
.bs-val span { font-size: 14px; color: var(--text-muted); margin-left: 4px; }
.bs-change { font-size: 12px; font-weight: 500; margin-bottom: 12px; }
.bs-change.pos { color: var(--pr); }
.bs-change.neg { color: var(--pr); }
.bio-measures {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 12px; margin-bottom: 24px;
}
.bio-history { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px; }
.bio-history h2 { margin-bottom: 12px; }
.bio-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.bio-table th { text-align: left; font-weight: 600; color: var(--text-muted); padding: 8px 12px; border-bottom: 1px solid var(--border); font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; }
.bio-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); font-family: var(--font-mono); }
.bio-table td:first-child { font-family: var(--font-sans); }

/* ── NUTRITION ────────────────────────────────────────────────────────── */
.nut-rings {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
  margin-bottom: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}
.ring-wrap { display: flex; flex-direction: column; align-items: center; gap: 8px; position: relative; }
.ring-text {
  position: absolute; top: 36px; left: 0; right: 0;
  text-align: center; pointer-events: none;
}
.ring-val { font-family: var(--font-mono); font-size: 18px; font-weight: 600; line-height: 1; }
.ring-val span { font-size: 11px; }
.ring-goal { font-size: 10px; color: var(--text-muted); font-family: var(--font-mono); margin-top: 1px; }
.ring-label { font-size: 12px; color: var(--text-muted); font-weight: 500; margin-top: 4px; }

.meal-list { display: flex; flex-direction: column; gap: 10px; }
.meal-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
}
.meal-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 10px;
}
.meal-type { font-weight: 650; font-size: 14px; }
.meal-time { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); }
.meal-totals { text-align: right; font-size: 12.5px; }
.meal-totals span:first-child { font-weight: 600; font-family: var(--font-mono); }
.meal-totals .muted { font-size: 11px; display: block; font-family: var(--font-mono); margin-top: 1px; }
.meal-items { display: flex; flex-direction: column; gap: 4px; padding-top: 8px; border-top: 1px solid var(--border); }
.meal-item { display: flex; justify-content: space-between; font-size: 12.5px; padding: 2px 0; }
.meal-item .muted { font-family: var(--font-mono); }

/* ── PROFILE ──────────────────────────────────────────────────────────── */
.profile-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  max-width: 720px;
}
.profile-head {
  display: flex; align-items: center; gap: 16px;
  padding-bottom: 20px; border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}
.profile-name { font-weight: 650; font-size: 18px; }
.profile-email { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.profile-since { font-size: 11px; color: var(--text-dim); margin-top: 4px; }
.profile-head .btn-secondary { margin-left: auto; }
.profile-stats {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 1px; background: var(--border);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 20px;
}
.profile-stats > div { background: var(--surface-2); padding: 14px 16px; }
.ps-label { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600; }
.ps-val { font-family: var(--font-mono); font-size: 18px; font-weight: 600; margin-top: 4px; }
.profile-fields { display: flex; flex-direction: column; }
.pf-row { display: flex; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.pf-row label { color: var(--text-muted); }

/* ── ADMIN ────────────────────────────────────────────────────────────── */
.admin-tabs { display: flex; gap: 4px; margin-bottom: 16px; border-bottom: 1px solid var(--border); }
.admin-tabs button {
  background: transparent; border: 0; padding: 10px 14px;
  font-size: 13px; font-weight: 500; color: var(--text-muted);
  border-bottom: 2px solid transparent;
  display: inline-flex; align-items: center; gap: 6px;
}
.admin-tabs button.active { color: var(--text); border-bottom-color: var(--primary); }
.admin-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }

.admin-table-wrap {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
}
.admin-table-head {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 12px 16px; border-bottom: 1px solid var(--border);
}
.admin-table-head .search-wrap { width: 280px; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.admin-table th { text-align: left; padding: 10px 16px; font-weight: 600; font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; border-bottom: 1px solid var(--border); }
.admin-table td { padding: 12px 16px; border-bottom: 1px solid var(--border); }
.admin-table tr:last-child td { border-bottom: 0; }
.td-user { display: flex; align-items: center; gap: 10px; font-weight: 500; }
.role-tag { font-size: 11px; padding: 2px 8px; border-radius: 4px; background: var(--surface-2); font-weight: 600; }
.role-tag.coach { background: var(--primary-soft); color: var(--primary); }
.role-tag.admin { background: var(--brindle); color: #F4EFE6; }
.admin-role-select {
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  border-radius: 6px;
  padding: 5px 8px;
  font-size: 12px;
}
.admin-role-select:disabled {
  opacity: .55;
  cursor: not-allowed;
}
.exercise-request-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}
.exercise-request-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.exercise-request-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-2);
}
.request-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: auto;
}

/* ── MOBILE LOGGER FRAME ──────────────────────────────────────────────── */
.logger-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 100;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.logger-frame {
  width: 390px;
  max-width: 100%;
  height: 800px;
  max-height: calc(100vh - 40px);
  background: var(--bg);
  border-radius: 32px;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0,0,0,0.4);
  border: 8px solid #1a1a1a;
  position: relative;
  display: flex;
  flex-direction: column;
}
.logger { height: 100%; display: flex; flex-direction: column; overflow: hidden; }
.logger-head {
  background: var(--surface);
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.logger-head .hb {
  background: transparent; border: 0; padding: 6px;
  border-radius: 6px; color: var(--text-muted);
}
.lh-name { font-weight: 650; font-size: 14px; }
.lh-meta { font-size: 11px; color: var(--text-muted); display: flex; gap: 6px; align-items: center; }
.lh-timer { font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); }
.lh-center { flex: 1; }
.lh-progress { font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); font-weight: 600; }
.btn-finish {
  background: var(--text); color: #fff;
  border: 0; padding: 7px 14px; border-radius: 6px;
  font-size: 12px; font-weight: 600; margin-left: auto;
}

/* ── REST TIMER ───────────────────────────────────────────────────────── */
.rest-timer {
  background: var(--primary-soft);
  border-bottom: 1px solid oklch(0.92 0.04 50);
  flex-shrink: 0;
}
.rt-bar { height: 3px; background: oklch(0.92 0.04 50); }
.rt-bar-fill { height: 100%; background: var(--primary); transition: width 1s linear; }
.rt-row {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 16px;
}
.rt-label { font-size: 11px; font-weight: 600; color: var(--primary); text-transform: uppercase; letter-spacing: 0.05em; }
.rt-time { font-family: var(--font-mono); font-size: 16px; font-weight: 600; color: var(--primary); }
.rt-skip {
  margin-left: auto;
  background: transparent; border: 0;
  color: var(--primary); font-weight: 600; font-size: 12px;
  padding: 4px 8px; border-radius: 4px;
}
.rt-skip:hover { background: rgba(232,104,44,0.15); }

/* ── LOGGER COMMON ────────────────────────────────────────────────────── */
.logger-body {
  flex: 1; overflow-y: auto; padding: 16px;
  display: flex; flex-direction: column; gap: 14px;
}
.add-set, .add-ex {
  background: transparent; border: 1px dashed var(--border-strong);
  border-radius: 8px; padding: 10px;
  color: var(--text-muted); font-size: 12.5px; font-weight: 500;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.add-set:hover, .add-ex:hover { background: var(--surface-2); color: var(--text); }
.add-ex { width: 100%; padding: 14px; }

/* ── LOGGER STACK ─────────────────────────────────────────────────────── */
.ex-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px;
}
.ex-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.ex-target { font-size: 11px; color: var(--text-muted); margin-bottom: 10px; }
.set-table { width: 100%; border-collapse: collapse; }
.set-table th {
  font-size: 10px; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.05em;
  text-align: center; padding: 6px 4px;
}
.set-table th:first-child { text-align: center; width: 32px; }
.set-table th.prev-th { text-align: left; }
.set-table td { padding: 6px 4px; text-align: center; }
.set-table tr.done td input { color: var(--text-muted); }
.set-table .set-n {
  font-family: var(--font-mono); font-weight: 600;
  background: var(--surface-2); border-radius: 6px;
  width: 32px;
}
.set-table .prev-cell {
  font-family: var(--font-mono); font-size: 11px;
  color: var(--text-muted); text-align: left;
}
.set-table input {
  width: 100%; max-width: 60px;
  border: 1px solid var(--border); background: var(--surface);
  border-radius: 6px; padding: 8px 4px;
  text-align: center; font-family: var(--font-mono);
  font-size: 14px; font-weight: 600;
  color: var(--text); outline: none;
  -moz-appearance: textfield;
}
.set-table input::-webkit-outer-spin-button,
.set-table input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.set-table input:focus { border-color: var(--primary); }
.set-check {
  width: 32px; height: 32px;
  border: 1.5px solid var(--border-strong);
  background: var(--surface);
  border-radius: 8px;
  color: var(--text-muted);
  display: inline-flex; align-items: center; justify-content: center;
}
.set-check.done {
  background: var(--pr); border-color: var(--pr); color: #fff;
}

/* ── LOGGER FOCUS ─────────────────────────────────────────────────────── */
.logger-focus { background: var(--bg); }
.focus-progress { height: 3px; background: var(--surface-2); flex-shrink: 0; }
.fp-bar { height: 100%; background: var(--primary); transition: width 0.2s; }
.focus-body {
  flex: 1; padding: 24px 20px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 14px;
}
.focus-ex-name {
  font-size: 24px; font-weight: 650; letter-spacing: -0.02em;
  text-align: center; margin-top: 8px;
}
.focus-ex-meta {
  text-align: center; font-size: 12px; color: var(--text-muted);
  margin-bottom: 4px;
}
.focus-last {
  text-align: center; font-size: 13px;
  background: var(--surface); padding: 10px;
  border-radius: 8px; border: 1px solid var(--border);
}
.focus-last strong { font-family: var(--font-mono); margin-left: 6px; }
.focus-inputs { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.fi-block {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 14px;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.fi-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; }
.fi-stepper {
  display: flex; align-items: center; gap: 8px;
  width: 100%;
}
.fi-stepper button {
  width: 36px; height: 36px;
  border: 1px solid var(--border); background: var(--surface-2);
  border-radius: 8px; color: var(--text);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.fi-stepper button:hover { background: var(--surface-3); }
.fi-stepper input {
  flex: 1; min-width: 0;
  border: 0; background: transparent;
  font-family: var(--font-mono); font-size: 32px;
  font-weight: 600; text-align: center; outline: none;
  letter-spacing: -0.02em;
  -moz-appearance: textfield;
}
.fi-stepper input::-webkit-outer-spin-button,
.fi-stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.fi-unit { font-size: 11px; color: var(--text-muted); }
.focus-cta {
  background: var(--primary); color: #fff; border: 0;
  padding: 16px; border-radius: 12px;
  font-size: 15px; font-weight: 650;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin-top: 8px;
  box-shadow: 0 4px 12px rgba(232,104,44,0.25);
}
.focus-cta:hover { background: oklch(0.6 0.16 45); }
.focus-list {
  display: flex; gap: 6px; flex-wrap: wrap; justify-content: center;
  padding-top: 12px; border-top: 1px solid var(--border);
}
.fl-pill {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; padding: 6px 10px;
  font-family: var(--font-mono); font-size: 11px; font-weight: 600;
  color: var(--text-muted);
  display: inline-flex; align-items: center; gap: 6px;
}
.fl-pill.done { background: var(--pr); color: #fff; border-color: var(--pr); }
.fl-pill.active { box-shadow: 0 0 0 2px var(--primary); }
.fl-pill span { font-size: 10px; }
.focus-nav {
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px;
  background: var(--surface); border-top: 1px solid var(--border);
}
.focus-nav > button {
  background: transparent; border: 0; color: var(--text-muted);
  font-size: 12px; font-weight: 600;
  display: inline-flex; align-items: center; gap: 4px;
  padding: 6px 8px; border-radius: 6px;
}
.focus-nav > button:disabled { opacity: 0.3; }
.fn-list { display: flex; gap: 4px; }
.fn-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--border-strong); border: 0; padding: 0;
}
.fn-dot.done { background: var(--pr); }
.fn-dot.active { background: var(--primary); transform: scale(1.4); }

/* ── LOGGER CARD ──────────────────────────────────────────────────────── */
.card-pages { flex: 1; overflow-y: auto; padding: 0; }
.card-ex { padding: 20px 16px; display: flex; flex-direction: column; gap: 14px; }
.card-ex-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.card-ex-head h2 { font-size: 20px; }
.card-sets {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.cs-head-row {
  display: grid;
  grid-template-columns: 32px 60px 1fr 1fr 36px;
  gap: 8px; padding: 8px 12px;
  font-size: 10px; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.05em;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.cs-head-row > span { text-align: center; }
.cs-head-row > span:nth-child(2) { text-align: left; }
.card-set-row {
  display: grid;
  grid-template-columns: 32px 60px 1fr 1fr 36px;
  gap: 8px; padding: 10px 12px; align-items: center;
  border-bottom: 1px solid var(--border);
}
.card-set-row:last-child { border-bottom: 0; }
.card-set-row.done { background: oklch(0.97 0.02 145); }
.csr-n { font-family: var(--font-mono); font-weight: 700; text-align: center; }
.csr-prev { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); }
.card-set-row input {
  width: 100%; border: 1px solid var(--border); background: var(--surface-2);
  border-radius: 6px; padding: 8px;
  text-align: center; font-family: var(--font-mono);
  font-size: 15px; font-weight: 600;
  -moz-appearance: textfield; outline: none;
}
.card-set-row input::-webkit-outer-spin-button,
.card-set-row input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.card-set-row input:focus { border-color: var(--primary); background: var(--surface); }
.card-nav {
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px;
  background: var(--surface); border-top: 1px solid var(--border);
}
.card-nav button {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 50%; width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text);
}
.card-nav button:disabled { opacity: 0.3; }
.card-nav button.finish-btn { background: var(--pr); color: #fff; border-color: var(--pr); }
.cn-pages { display: flex; gap: 6px; }
.cn-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--border-strong); border: 0; padding: 0; }
.cn-dot.done { background: var(--pr); }
.cn-dot.active { background: var(--primary); transform: scale(1.4); }

/* ── LOGGER QUICK (numpad) ────────────────────────────────────────────── */
.logger-quick { background: var(--surface-2); }
.quick-progress { height: 3px; background: var(--surface-3); flex-shrink: 0; }
.qp-bar { height: 100%; background: var(--primary); transition: width 0.2s; }
.quick-body {
  flex: 1; padding: 16px 20px;
  display: flex; flex-direction: column; gap: 12px;
  overflow-y: auto;
}
.qb-set-info {
  text-align: center; font-size: 13px; font-weight: 600; color: var(--text-muted);
}
.qb-last {
  display: flex; gap: 6px; align-items: center; justify-content: center;
  font-size: 12px;
  background: var(--surface); padding: 8px 12px;
  border-radius: 8px; border: 1px solid var(--border);
}
.qb-last strong { font-family: var(--font-mono); }
.qb-display {
  display: flex; align-items: center; gap: 8px; justify-content: center;
  margin: 4px 0;
}
.qb-field {
  flex: 1;
  background: var(--surface); border: 2px solid var(--border);
  border-radius: 14px; padding: 12px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  min-width: 0;
}
.qb-field.active { border-color: var(--primary); background: var(--primary-soft); }
.qbf-label { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; }
.qbf-val { font-family: var(--font-mono); font-size: 36px; font-weight: 700; line-height: 1; letter-spacing: -0.02em; }
.qbf-val span { font-size: 14px; color: var(--text-muted); margin-left: 2px; font-weight: 500; }
.qb-x { font-family: var(--font-mono); font-size: 24px; color: var(--text-muted); }
.qb-sets-strip {
  display: flex; gap: 6px; flex-wrap: wrap; justify-content: center;
  margin-top: auto; padding: 8px 0;
}
.qbs-pill {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 999px; padding: 5px 10px;
  font-family: var(--font-mono); font-size: 11px; font-weight: 600;
  color: var(--text-muted);
}
.qbs-pill.done { background: var(--pr); color: #fff; border-color: var(--pr); }
.qbs-pill.active { box-shadow: 0 0 0 2px var(--primary); }

.numpad {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 4px; padding: 12px;
  background: var(--surface); border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.np-key {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 8px; padding: 14px;
  font-family: var(--font-mono); font-size: 22px; font-weight: 600;
  color: var(--text);
}
.np-key:hover { background: var(--surface-3); }
.np-key:active { background: var(--primary-soft); border-color: var(--primary); }

.quick-cta {
  background: var(--primary); color: #fff; border: 0;
  padding: 16px;
  font-size: 16px; font-weight: 650;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  flex-shrink: 0;
}
.quick-cta:hover { background: oklch(0.6 0.16 45); }


/* ── COACH MODULE ─────────────────────────────────────────────────────── */
.sb-role-switch {
  display: flex; gap: 4px; padding: 8px 12px; margin: 8px 8px 0;
  background: var(--surface-2); border-radius: 8px;
}
.sb-role {
  flex: 1; padding: 6px 8px; border: none; background: transparent;
  font-size: 11px; font-weight: 600; color: var(--text-muted); cursor: pointer;
  border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  font-family: inherit;
}
.sb-role.active { background: var(--brindle); color: #F4EFE6; }

/* Athletes grid */
.athletes-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px;
}
.athlete-card {
  display: flex; align-items: center; gap: 12px; padding: 14px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  text-align: left; cursor: pointer; transition: 0.15s; font-family: inherit;
}
.athlete-card:hover { border-color: var(--primary); background: var(--surface-2); }
.athlete-card-main { flex: 1; min-width: 0; }
.athlete-card-name { font-weight: 600; color: var(--text); font-size: 14px; }
.athlete-card-meta { font-size: 11px; color: var(--text-muted); margin: 2px 0 6px; }
.athlete-card-stats { display: flex; gap: 10px; font-size: 11px; color: var(--text-muted); }
.athlete-card-stats span { display: inline-flex; align-items: center; gap: 3px; }
.athlete-card-side { text-align: right; display: flex; align-items: center; gap: 8px; }
.athlete-card-last { font-size: 11px; color: var(--text-muted); white-space: nowrap; }

/* Athlete detail tabs */
.ath-tabs {
  display: flex; gap: 4px; border-bottom: 1px solid var(--border);
  margin-bottom: 20px; padding-bottom: 0;
}
.ath-tab {
  padding: 10px 16px; border: none; background: transparent;
  font-size: 13px; font-weight: 500; color: var(--text-muted); cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px; font-family: inherit;
}
.ath-tab:hover { color: var(--text); }
.ath-tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.ath-overview .stat-grid { gap: 12px; }

/* Body view tabs */
.body-view { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.body-view-tabs { display: flex; gap: 4px; padding: 4px; background: var(--surface-2); border-radius: 8px; }
.body-view-tabs.compact { margin-top: 4px; }
.bv-tab {
  padding: 6px 14px; border: none; background: transparent; font-family: inherit;
  font-size: 12px; font-weight: 600; color: var(--text-muted); cursor: pointer; border-radius: 6px;
}
.bv-tab.active { background: var(--brindle); color: #F4EFE6; }

/* Plan cards (sub) */
.plan-card { padding: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.plan-card-head { font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; display: inline-flex; align-items: center; gap: 6px; }
.plan-card-name { font-size: 18px; font-weight: 700; margin: 8px 0 4px; }
.plan-card-meta { font-size: 12px; color: var(--text-muted); }

/* Custom exercise grid */
.custom-ex-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 12px; }
.custom-ex-card {
  display: flex; align-items: center; gap: 14px; padding: 14px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
}
.custom-ex-thumb { position: relative; }
.custom-ex-badge {
  position: absolute; top: -4px; right: -4px;
  background: var(--primary); color: #fff; font-size: 10px; font-weight: 700;
  padding: 2px 6px; border-radius: 99px; display: inline-flex; align-items: center; gap: 3px;
}
.custom-ex-name { font-weight: 600; color: var(--text); }
.custom-ex-meta { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-size: 11px; }
.vis-tag {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px;
  border-radius: 99px; font-weight: 600; font-size: 10px;
}
.vis-private { background: var(--surface-3); color: var(--text-muted); }
.vis-shared { background: var(--primary-soft); color: var(--primary-dark); }
.vis-public { background: oklch(0.92 0.05 145); color: oklch(0.4 0.15 145); }

/* Modal (shared with custom-ex + meal-sheet) */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(26, 19, 12, 0.6); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; z-index: 1000; padding: 20px;
}
.modal-card {
  background: var(--surface); border-radius: 14px; width: 100%; max-width: 520px;
  max-height: 90vh; display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  border: 1px solid var(--border);
}
.modal-card.week-builder { max-width: 1120px; }
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.modal-head h2 { margin: 0; font-size: 16px; }
.modal-body { padding: 20px; overflow-y: auto; flex: 1; }
.modal-foot {
  padding: 14px 20px; border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: 8px;
}

.form-row { margin-bottom: 16px; }
.form-row label { display: block; font-size: 12px; font-weight: 600; color: var(--text-muted); margin-bottom: 6px; text-transform: uppercase; letter-spacing: .05em; }
.form-row input, .form-row select {
  width: 100%; padding: 8px 12px; font-size: 14px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font-family: inherit;
}
.form-row input:focus, .form-row select:focus { outline: 2px solid var(--primary); outline-offset: -1px; border-color: var(--primary); }
.form-row.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-row.two label { /* keep */ }
.form-row.four { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.form-row.three { display: grid; grid-template-columns: 1fr 1fr minmax(220px, .75fr); gap: 12px; }
.inline-rest-control {
  display: grid;
  grid-template-columns: minmax(70px, 1fr) auto;
  gap: 6px;
}
.inline-rest-control .btn-ghost {
  height: 36px;
  white-space: nowrap;
}

.week-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
  align-items: start;
}
.week-day {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  min-height: 220px;
}
.week-day-name {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text);
  font-weight: 700;
  font-size: 13px;
  margin-bottom: 8px;
  outline: none;
}
.week-ex-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 120px;
  margin-bottom: 8px;
}
.week-ex-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 42px 42px 64px 24px;
  align-items: center;
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 5px;
}
.week-ex-row span {
  font-size: 12px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.week-ex-row input {
  width: 100%;
  min-width: 0;
  padding: 4px 5px;
  font-size: 12px;
}
.rest-cell {
  display: flex;
  align-items: center;
  gap: 3px;
  min-width: 0;
}
.rest-cell span {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
}
.week-day select {
  width: 100%;
  padding: 7px 8px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 12px;
}
.week-grid.edit-grid {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}
.template-edit-hint {
  display: grid;
  grid-template-columns: 1fr 42px 42px 64px 24px;
  gap: 6px;
  align-items: center;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  margin: -4px 10px 8px;
}
.template-edit-hint span:first-child { grid-column: 2; }
@media (max-width: 1100px) {
  .week-grid { grid-template-columns: repeat(2, minmax(220px, 1fr)); }
}
@media (max-width: 640px) {
  .week-grid { grid-template-columns: 1fr; }
}

.upload-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.upload-slot {
  aspect-ratio: 1; border: 2px dashed var(--border-strong); border-radius: 8px;
  background: var(--surface-2); display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 6px; cursor: pointer;
  font-size: 11px; color: var(--text-muted); font-family: inherit;
}
.upload-slot:hover { border-color: var(--primary); color: var(--primary); }
.upload-video {
  width: 100%; padding: 16px; border: 2px dashed var(--border-strong); border-radius: 10px;
  background: var(--surface-2); display: flex; align-items: center; gap: 14px;
  cursor: pointer; text-align: left; font-family: inherit; color: var(--text);
}
.upload-video:hover { border-color: var(--primary); }

.vis-radio { display: grid; gap: 8px; }
.vis-opt {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2);
  cursor: pointer; text-align: left; font-family: inherit; color: var(--text);
}
.vis-opt:hover { border-color: var(--border-strong); }
.vis-opt.active { border-color: var(--primary); background: var(--primary-soft); }

/* Messages layout */
.msg-layout {
  display: grid; grid-template-columns: 320px 1fr; gap: 0;
  height: calc(100vh - 48px); margin: -20px;
  border-top: 1px solid var(--border);
}
.msg-list { border-right: 1px solid var(--border); overflow-y: auto; background: var(--surface); }
.msg-list-head { display: flex; align-items: center; justify-content: space-between; padding: 16px; border-bottom: 1px solid var(--border); }
.msg-list-head h2 { margin: 0; font-size: 16px; }
.msg-item {
  width: 100%; display: flex; align-items: center; gap: 10px; padding: 12px 14px;
  border: none; background: transparent; cursor: pointer; text-align: left;
  border-bottom: 1px solid var(--border); font-family: inherit;
}
.msg-item:hover { background: var(--surface-2); }
.msg-item.active { background: var(--primary-soft); }
.msg-item-name { font-weight: 600; font-size: 13px; color: var(--text); }
.msg-item-snip { font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 200px; }
.msg-item-time { font-size: 10px; color: var(--text-muted); }
.msg-unread {
  display: inline-block; min-width: 18px; padding: 2px 6px; margin-top: 4px;
  background: var(--primary); color: #fff; font-size: 10px; font-weight: 700;
  border-radius: 99px; text-align: center;
}
.msg-thread { display: flex; flex-direction: column; background: var(--surface-2); }
.msg-thread-head { display: flex; align-items: center; gap: 10px; padding: 16px; border-bottom: 1px solid var(--border); background: var(--surface); }
.msg-thread-body { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 10px; }
.msg-bubble { max-width: 70%; padding: 10px 14px; border-radius: 14px; }
.msg-bubble.from-coach { align-self: flex-end; background: var(--primary); color: #fff; }
.msg-bubble.from-coach .msg-bubble-time { color: rgba(255,255,255,0.7); }
.msg-bubble.from-athlete { align-self: flex-start; background: var(--surface); border: 1px solid var(--border); }
.msg-bubble-text { font-size: 14px; line-height: 1.4; }
.msg-bubble-time { font-size: 10px; color: var(--text-muted); margin-top: 4px; }
.msg-compose { display: flex; gap: 8px; padding: 14px; border-top: 1px solid var(--border); background: var(--surface); }
.msg-compose input { flex: 1; padding: 10px 14px; border-radius: 99px; border: 1px solid var(--border); background: var(--surface-2); font-family: inherit; }
.msg-compose input:focus { outline: 2px solid var(--primary); outline-offset: -1px; }

/* Meal log sheet */
.meal-sheet { max-width: 560px; height: 80vh; }
.meal-sheet-tabs { display: flex; padding: 0 12px; border-bottom: 1px solid var(--border); gap: 2px; }
.mst {
  padding: 10px 14px; border: none; background: transparent; font-family: inherit;
  font-size: 12px; font-weight: 600; color: var(--text-muted); cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px; border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.mst.active { color: var(--primary); border-bottom-color: var(--primary); }
.meal-sheet-body { flex: 1; overflow-y: auto; padding: 16px 20px; }
.food-list, .recipe-list { display: flex; flex-direction: column; }
.food-row, .recipe-row {
  display: flex; align-items: center; padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.food-name { font-weight: 500; font-size: 14px; color: var(--text); }
.add-btn {
  width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface-2); cursor: pointer; display: inline-flex;
  align-items: center; justify-content: center; color: var(--primary);
}
.add-btn:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.food-portion {
  display: flex;
  align-items: center;
  gap: 3px;
  margin-right: 8px;
}
.food-portion input {
  width: 62px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  border-radius: 7px;
  padding: 5px 6px;
  font-size: 12px;
}
.food-portion span { color: var(--text-muted); font-size: 11px; font-weight: 700; }
.meal-sheet-cart {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 20px; border-top: 1px solid var(--border); background: var(--surface-2);
}
.meal-sheet-cart select {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 8px;
  padding: 8px 10px;
}
.cart-summary div:first-child { font-size: 13px; }
.selected-foods {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 8px;
}
.selected-foods label {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) 62px 14px 116px;
  gap: 5px;
  align-items: center;
  font-size: 11px;
}
.selected-foods input,
.selected-foods select {
  width: 62px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 6px;
  padding: 4px 5px;
}
.selected-foods select {
  width: 116px;
}
.selected-foods em { font-style: normal; color: var(--text-muted); font-weight: 700; }
.nutrition-plan-modal {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 16px;
}
.nutrition-plan-form, .share-panel {
  border: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: 10px;
  padding: 12px;
}
.nutrition-plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}
.page-plan-grid {
  margin-top: 12px;
}
.meal-plan-card {
  min-height: 210px;
}
.macro-dots {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 8px 0 4px;
}
.macro-dot {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 2px solid var(--dot);
  background: var(--surface-2);
  color: var(--text);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.macro-dot strong {
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1;
}
.macro-dot span {
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  margin-top: 3px;
}
.nutrition-plan-workspace {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}
.meal-week-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  max-height: 520px;
  overflow-y: auto;
}
.meal-plan-food-picker { margin-top: 14px; }
.plan-food-results {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 240px;
  overflow-y: auto;
  margin-top: 8px;
}
.plan-food-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 58px 14px 28px;
  gap: 6px;
  align-items: center;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 8px;
  padding: 6px;
  font-size: 12px;
}
.plan-food-row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 650;
}
.plan-food-row small { color: var(--text-muted); }
.plan-food-row input {
  width: 58px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  border-radius: 6px;
  padding: 5px;
}
.plan-food-row em { font-style: normal; color: var(--text-muted); font-weight: 700; }
.meal-plan-day-block {
  border-top: 1px solid var(--border);
  padding-top: 7px;
  margin-top: 7px;
}
.meal-plan-day-block strong {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 4px;
}
.meal-plan-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 24px;
  gap: 4px;
  align-items: center;
  font-size: 11.5px;
  padding: 3px 0;
}
.meal-plan-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.meal-plan-item small { color: var(--text-muted); }
.gus-float-btn {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 900;
  border: 1px solid var(--border);
  background: var(--primary);
  color: #fff;
  border-radius: 999px;
  padding: 8px 13px 8px 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  box-shadow: var(--shadow-lg);
}
.gus-float-btn img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }
.gus-panel {
  position: fixed;
  right: 22px;
  bottom: 74px;
  width: min(420px, calc(100vw - 32px));
  height: min(620px, calc(100vh - 100px));
  z-index: 901;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.gus-head {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.gus-head span { display: block; color: var(--text-muted); font-size: 11px; }
.gus-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.gus-msg {
  max-width: 88%;
  border-radius: 10px;
  padding: 9px 11px;
  font-size: 13px;
  line-height: 1.45;
  white-space: pre-wrap;
}
.gus-msg.assistant { align-self: flex-start; background: var(--surface-2); border: 1px solid var(--border); }
.gus-msg.user { align-self: flex-end; background: var(--primary); color: #fff; }
.gus-preview {
  border-top: 1px solid var(--border);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.gus-compose {
  border-top: 1px solid var(--border);
  padding: 10px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}
.gus-compose textarea {
  resize: none;
  min-height: 44px;
  max-height: 100px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  border-radius: 8px;
  padding: 8px 10px;
  font-family: inherit;
}

.workout-edit-list { display: flex; flex-direction: column; gap: 12px; }
.workout-edit-ex {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
  padding: 10px;
}
.workout-edit-set {
  display: grid;
  grid-template-columns: 28px 90px 90px 1fr;
  gap: 8px;
  align-items: center;
  margin-top: 6px;
}
.workout-edit-set input[type="number"] {
  width: 100%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 6px;
  padding: 6px 8px;
}
.logger-rest-control {
  display: inline-grid;
  grid-template-columns: auto 72px auto;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: 12px;
  margin: 6px 0 10px;
}
.logger-rest-control input {
  width: 72px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  border-radius: 7px;
  padding: 5px 7px;
  font-size: 12px;
}
.logger-rest-control em {
  font-style: normal;
  font-weight: 700;
}

/* Barcode mock */
.barcode-mock { padding: 20px 0; display: flex; flex-direction: column; align-items: center; }
.barcode-frame {
  width: 280px; height: 180px; position: relative; background: #1a130c;
  border-radius: 12px; overflow: hidden;
}
.barcode-corner { position: absolute; width: 30px; height: 30px; border-color: var(--primary); border-style: solid; border-width: 0; }
.barcode-corner.tl { top: 16px; left: 16px; border-top-width: 3px; border-left-width: 3px; }
.barcode-corner.tr { top: 16px; right: 16px; border-top-width: 3px; border-right-width: 3px; }
.barcode-corner.bl { bottom: 16px; left: 16px; border-bottom-width: 3px; border-left-width: 3px; }
.barcode-corner.br { bottom: 16px; right: 16px; border-bottom-width: 3px; border-right-width: 3px; }
.barcode-line {
  position: absolute; left: 30px; right: 30px; top: 50%;
  height: 2px; background: var(--primary); box-shadow: 0 0 10px var(--primary);
  animation: scan 2s ease-in-out infinite;
}
@keyframes scan {
  0%, 100% { top: 30%; opacity: 0.3; }
  50% { top: 70%; opacity: 1; }
}

/* Empty state */
.empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 60px 20px; text-align: center; color: var(--text-muted);
}

/* Data table */
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th { text-align: left; padding: 10px 12px; background: var(--surface-2); color: var(--text-muted); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; border-bottom: 1px solid var(--border); }
.data-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); color: var(--text); }
.data-table tr:hover { background: var(--surface-2); }

/* Search wrap (reuse) */
.search-wrap { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.search-wrap input { flex: 1; border: none; background: transparent; font-family: inherit; font-size: 13px; outline: none; color: var(--text); }
