/* ── Design tokens — Kairos brand (paleta Adobe oficial) ─────────────── */
:root {
  /* Surfaces */
  --bg:          #0c1419;        /* Fondo principal (dark navy) */
  --surface:     #111c24;        /* Card principal */
  --surface-2:   #172230;        /* Card anidada / input */
  --surface-3:   rgba(255,255,255,0.03);  /* Micro-item dentro de surface-2 */
  --border:      #1f3040;        /* Bordes sutiles */
  --border-strong: #2a4054;      /* Bordes de hover/activos */

  /* Brand — paleta oficial Kairos */
  --accent:      #2CBFB1;        /* Teal brillante — #2CBFB1 (oscuro) */
  --accent-dim:  #17A68C;        /* Teal medio — #17A68C (claro) */
  --accent-deep: #185359;        /* Teal oscuro — usado para fondos sutiles */
  --accent-light:#5EC8B9;        /* Teal claro — para secondary hovers */
  --accent-glow: rgba(44,191,177,0.15);
  --accent-glow-strong: rgba(44,191,177,0.28);

  /* Gold — reservado a logros, PRs, achievements, deload */
  --gold:        #D9AE5F;
  --gold-glow:   rgba(217,174,95,0.15);
  --gold-dim:    rgba(217,174,95,0.65);

  /* States */
  --warn:        #f5a623;
  --warn-glow:   rgba(245,166,35,0.12);
  --danger:      #ff453a;
  --danger-glow: rgba(255,69,58,0.12);
  --info:        #4fc3f7;
  --info-glow:   rgba(79,195,247,0.12);

  /* Text */
  --text:        #e2eaf0;
  --text-muted:  #4a6270;
  --text-dim:    #7a9aaa;
  --text-primary:#e2eaf0;        /* alias explícito (usado en algunos sitios) */

  /* Muscle group colors (chips en sesión/hero) */
  --m-chest:     #4fc3f7;        /* azul cielo */
  --m-back:      #2CBFB1;        /* teal accent */
  --m-legs:      #D9AE5F;        /* gold */
  --m-shoulders: #7C83FD;        /* lavanda */
  --m-arms:      #ff9500;        /* naranja */
  --m-core:      #5EC8B9;        /* teal claro */
  --m-glutes:    #D9AE5F;        /* gold */
  --m-calves:    #7a9aaa;        /* gris azulado */

  /* Dimensions */
  --radius:      14px;
  --radius-sm:   9px;
  --radius-xs:   6px;
  --nav-h:       64px;
  --top-h:       58px;

  /* Shadow */
  --shadow-sm:   0 1px 3px rgba(0,0,0,0.2);
  --shadow-md:   0 4px 14px rgba(0,0,0,0.28);
  --shadow-lg:   0 8px 28px rgba(0,0,0,0.4);

  --font:        -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;

  /* Alias legacy — algunos sitios usan --teal y --text-primary */
  --teal:        var(--accent);
}

/* ── Reset & base ────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button { cursor: pointer; border: none; background: none; font: inherit; color: inherit; }
input, select, textarea {
  font: inherit;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  width: 100%;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
input:hover:not(:focus), select:hover:not(:focus), textarea:hover:not(:focus) {
  border-color: rgba(44,191,177,0.35);
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(44,191,177,0.12);
  background: rgba(44,191,177,0.03);
}
input::placeholder, textarea::placeholder { color: var(--text-muted); opacity: 0.7; }
label { font-size: 12px; color: var(--text-muted); display: block; margin-bottom: 5px; font-weight: 600; letter-spacing: 0.2px; }

/* ── Top bar ─────────────────────────────────────────────────────────── */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--top-h);
  background: linear-gradient(180deg, #122029 0%, var(--surface) 100%);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 100;
  backdrop-filter: saturate(140%);
}
.topbar::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, var(--accent-glow) 50%, transparent 100%);
  pointer-events: none;
}
.topbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--accent);
  font-weight: 800;
  font-size: 16px;
  letter-spacing: 0.5px;
}
.topbar-brand::after {
  content: 'KAIROS';
  font-weight: 800;
  letter-spacing: 1.5px;
  font-size: 14px;
  color: var(--accent);
}
.topbar-logo {
  height: 32px;
  width: 32px;
  display: block;
  border-radius: 8px;
  filter: drop-shadow(0 0 8px rgba(44,191,177,0.25));
}
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.topbar-date { font-size: 13px; color: var(--text-muted); }
.btn-icon {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-dim);
  transition: background 0.15s, color 0.15s;
}
.btn-icon:hover { background: var(--surface-2); color: var(--text); }
.btn-icon.spinning svg { animation: spin 1s linear infinite; }
.btn-sync {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 20px;
  font-size: 13px; font-weight: 500; color: var(--text-dim);
  transition: background 0.15s, color 0.15s;
}
.btn-sync:hover { background: var(--surface-2); color: var(--text); }
.btn-sync.spinning svg { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Main content ────────────────────────────────────────────────────── */
#app-root {
  padding-top: calc(var(--top-h) + 16px);
  padding-bottom: calc(var(--nav-h) + 16px);
  min-height: 100vh;
}

/* ── Bottom nav ──────────────────────────────────────────────────────── */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: linear-gradient(180deg, var(--surface) 0%, #0e1820 100%);
  border-top: 1px solid var(--border);
  display: flex;
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  transition: color 0.2s, background 0.2s;
  padding: 6px 0 7px;
  position: relative;
  letter-spacing: 0.2px;
}
.nav-item svg {
  transition: transform 0.2s, stroke-width 0.2s;
}
.nav-item.active {
  color: var(--accent);
  background: linear-gradient(180deg, var(--accent-glow) 0%, transparent 80%);
}
.nav-item.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 18%; right: 18%;
  height: 3px;
  background: var(--accent);
  border-radius: 0 0 3px 3px;
  box-shadow: 0 0 10px var(--accent-glow-strong);
}
.nav-item.active svg { transform: translateY(-1px); }
.nav-item:hover:not(.active) { color: var(--text-dim); }
.nav-item:active { transform: scale(0.94); }

/* ── Shared screen layout ────────────────────────────────────────────── */
.screen { padding: 0 16px; }
.screen-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.4px;
  margin-bottom: 16px;
}

/* ── Cards ───────────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  animation: card-enter 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}
#app-root > .card:nth-child(1),
#app-root > * > .card:nth-child(1) { animation-delay: 0.02s; }
#app-root > .card:nth-child(2),
#app-root > * > .card:nth-child(2) { animation-delay: 0.06s; }
#app-root > .card:nth-child(3),
#app-root > * > .card:nth-child(3) { animation-delay: 0.10s; }
#app-root > .card:nth-child(4),
#app-root > * > .card:nth-child(4) { animation-delay: 0.14s; }
#app-root > .card:nth-child(5),
#app-root > * > .card:nth-child(5) { animation-delay: 0.18s; }
#app-root > .card:nth-child(n+6),
#app-root > * > .card:nth-child(n+6) { animation-delay: 0.22s; }

@keyframes card-enter {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .card { animation: none; }
}
.card-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

/* ── Readiness gauge ─────────────────────────────────────────────────── */
.readiness-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 16px;
  align-items: center;
}
.gauge-wrap { position: relative; width: 100px; height: 100px; flex-shrink: 0; }
.gauge-wrap svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.gauge-track { fill: none; stroke: var(--surface-2); stroke-width: 10; }
.gauge-fill  { fill: none; stroke-width: 10; stroke-linecap: round; transition: stroke-dashoffset 0.6s ease; }
.gauge-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.gauge-value { font-size: 26px; font-weight: 800; line-height: 1; }
.gauge-label { font-size: 10px; color: var(--text-muted); margin-top: 2px; }
.readiness-meta h2 { font-size: 22px; font-weight: 700; }
.readiness-meta p  { font-size: 13px; color: var(--text-dim); margin-top: 4px; }
.readiness-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip {
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 20px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  display: flex; align-items: center; gap: 4px;
}
.chip-label { color: var(--text-muted); }
.chip-value { color: var(--text); font-weight: 600; }

/* ── Metric row ──────────────────────────────────────────────────────── */
.metrics-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}
.metric-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  text-align: center;
}
.metric-icon { font-size: 18px; margin-bottom: 4px; }
.metric-value { font-size: 20px; font-weight: 700; }
.metric-unit  { font-size: 11px; color: var(--text-muted); }
.metric-name  { font-size: 11px; color: var(--text-dim); margin-top: 2px; }

/* ── Trend charts ────────────────────────────────────────────────────── */
.charts-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}
.chart-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
}
.chart-card canvas { display: block; }

/* ── Narrative / LLM analysis ────────────────────────────────────────── */
.narrative-card { margin-bottom: 12px; }
.narrative-text {
  font-size: 14px;
  color: var(--text-dim);
  line-height: 1.65;
}
.narrative-placeholder {
  font-size: 13px;
  color: var(--text-muted);
  font-style: italic;
}
.narrative-loading {
  display: flex;
  align-items: center;
  padding: 4px 0;
}
.narrative-loading .narrative-placeholder {
  font-style: normal;
  color: var(--text-muted);
}

/* ── Session screen ──────────────────────────────────────────────────── */
.session-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 12px;
  gap: 12px;
}
.session-type-badge {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 4px 12px;
  border-radius: 20px;
  text-transform: uppercase;
}
.badge-REST     { background: rgba(74,98,112,0.2); color: var(--text-dim); border: 1px solid var(--border); }
.badge-LIGHT    { background: rgba(245,166,35,0.12); color: #f5a623; border: 1px solid rgba(245,166,35,0.3); }
.badge-MODERATE { background: rgba(255,149,0,0.12); color: #ff9500; border: 1px solid rgba(255,149,0,0.3); }
.badge-FULL     { background: rgba(0,201,167,0.12); color: var(--accent); border: 1px solid rgba(0,201,167,0.3); }
.badge-DELOAD   { background: rgba(79,195,247,0.12); color: #4fc3f7; border: 1px solid rgba(79,195,247,0.3); }
.badge-BLOCKED  { background: rgba(255,69,58,0.12); color: var(--danger); border: 1px solid rgba(255,69,58,0.3); }

/* Achievement badge (PRs, records) */
.badge-pr {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(217,174,95,0.12);
  border: 1px solid rgba(217,174,95,0.4);
  color: var(--gold);
  border-radius: 20px;
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  box-shadow: 0 0 8px rgba(217,174,95,0.15);
}
.badge-pr::before {
  content: "★";
  font-size: 11px;
  line-height: 1;
}

.session-meta { font-size: 13px; color: var(--text-dim); margin-top: 4px; }

/* ── Reasoning collapsible ───────────────────────────────────────────── */
.collapsible-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
  padding: 4px 0;
  transition: color 0.15s;
}
.collapsible-header:hover { color: var(--text); }
.collapsible-arrow {
  width: 18px; height: 18px;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  color: var(--text-muted);
  flex-shrink: 0;
}
.collapsible-arrow.open { transform: rotate(180deg); color: var(--accent); }
.collapsible-body {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s, margin-top 0.25s;
}
.collapsible-body.open {
  max-height: 1200px;
  opacity: 1;
  margin-top: 12px;
}
/* ── Decision trace panel ─────────────────────────────────────────────── */
.decision-trace-grid { display: flex; flex-direction: column; gap: 6px; }
.dt-row { display: grid; grid-template-columns: 24px 1fr auto; gap: 8px; align-items: center; font-size: 13px; }
.dt-icon { text-align: center; font-size: 15px; }
.dt-label { color: var(--text-dim); }
.dt-value { font-weight: 700; white-space: nowrap; }
.reasoning-list { list-style: none; }
.reasoning-list li {
  font-size: 13px;
  color: var(--text-dim);
  padding: 4px 0 4px 16px;
  position: relative;
  line-height: 1.5;
}
.reasoning-list li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: var(--accent);
}

/* ── Exercise list ───────────────────────────────────────────────────── */
.exercise-list { display: flex; flex-direction: column; gap: 9px; }
.exercise-item {
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: 13px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: start;
  border: 1px solid transparent;
  border-left: 3px solid var(--_accent, var(--border));
  transition: border-color 0.15s, transform 0.1s;
  position: relative;
}
.exercise-item:active { transform: scale(0.995); }
.exercise-item.m-chest     { --_accent: var(--m-chest); }
.exercise-item.m-back      { --_accent: var(--m-back); }
.exercise-item.m-legs      { --_accent: var(--m-legs); }
.exercise-item.m-shoulders { --_accent: var(--m-shoulders); }
.exercise-item.m-arms      { --_accent: var(--m-arms); }
.exercise-item.m-core      { --_accent: var(--m-core); }
.exercise-item.m-glutes    { --_accent: var(--m-glutes); }
.exercise-item.m-calves    { --_accent: var(--m-calves); }
.exercise-rank {
  width: 26px; height: 26px;
  border-radius: 7px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.exercise-main { min-width: 0; }
.exercise-name { font-size: 14.5px; font-weight: 700; color: var(--text); letter-spacing: -0.1px; line-height: 1.25; }
.exercise-group { font-size: 11px; color: var(--text-muted); text-transform: capitalize; margin-top: 2px; }
.exercise-right { text-align: right; min-width: 0; }
.exercise-stats {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
  letter-spacing: -0.2px;
}
.exercise-weight {
  display: block;
  font-size: 15px;
  font-weight: 800;
  color: var(--accent);
  white-space: nowrap;
  letter-spacing: -0.3px;
  line-height: 1.1;
}
.exercise-rest {
  font-size: 11px;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-top: 2px;
}
.exercise-notes {
  grid-column: 2 / -1;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
  padding: 6px 8px;
  background: var(--surface-3);
  border-radius: var(--radius-xs);
  border-left: 2px solid var(--border);
  line-height: 1.45;
}

/* ── Progression signals ────────────────────────────────────────────── */
.progression-signal {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  letter-spacing: 0.3px;
  margin-top: 4px;
  white-space: nowrap;
}
.progression-signal.up {
  background: var(--accent-glow);
  color: var(--accent);
  border: 1px solid var(--accent-glow-strong);
}
.progression-signal.same {
  background: rgba(122,154,170,0.08);
  color: var(--text-dim);
  border: 1px solid var(--border);
}
.progression-signal.down {
  background: var(--warn-glow);
  color: var(--warn);
  border: 1px solid rgba(245,166,35,0.3);
}
.progression-signal svg { flex-shrink: 0; }

/* ── Session action buttons ──────────────────────────────────────────── */
.session-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.session-launcher-card {
  text-align: center;
  padding: 36px 20px;
  background: linear-gradient(165deg, var(--surface) 0%, #13222c 100%);
  border: 1px solid rgba(44,191,177,0.18);
  border-radius: var(--radius);
  position: relative;
  overflow: hidden;
}
.session-launcher-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 0%, rgba(44,191,177,0.1), transparent 60%);
  pointer-events: none;
}
.session-launcher-icon { display: flex; justify-content: center; margin-bottom: 16px; position: relative; }
.session-launcher-date {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
  letter-spacing: 0.2px;
  position: relative;
}
.session-launcher-hint {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 18px;
  line-height: 1.5;
  position: relative;
}
.session-launcher-btn {
  width: 100%;
  font-size: 16px;
  padding: 15px;
  margin-top: 4px;
  position: relative;
  box-shadow: 0 4px 18px rgba(44,191,177,0.18);
}
.session-launcher-warn {
  font-size: 12px;
  font-weight: 600;
  color: var(--warn);
  background: rgba(245,166,35,0.1);
  border: 1px solid rgba(245,166,35,0.3);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  margin-bottom: 14px;
  position: relative;
}
.btn-primary {
  background: var(--accent);
  color: #000;
  font-weight: 700;
  font-size: 15px;
  padding: 13px;
  border-radius: var(--radius);
  text-align: center;
  transition: opacity 0.15s;
}
.btn-primary:hover { opacity: 0.85; }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-secondary {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 14px;
  padding: 11px;
  border-radius: var(--radius);
  text-align: center;
  transition: background 0.15s;
}
.btn-secondary:hover { background: var(--border); }
/* ── Profile screen ──────────────────────────────────────────────────── */
.profile-grid { display: grid; gap: 8px; }
.profile-field { margin-bottom: 12px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.inferred-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
.inferred-item {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  transition: border-color 0.15s, background 0.15s;
}
.inferred-item:hover {
  border-color: rgba(44,191,177,0.3);
  background: rgba(44,191,177,0.04);
}
.inferred-item .val {
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.2px;
}
.inferred-item .lbl {
  font-size: 10.5px;
  color: var(--text-muted);
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

/* Coach notes (Profile screen) */
.coach-notes-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.coach-note-row {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  gap: 4px 10px;
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm, 8px);
  padding: 10px 12px;
  align-items: start;
}
.coach-note-row.stale {
  opacity: 0.55;
  border-style: dashed;
}
.coach-note-meta {
  grid-column: 1 / 2;
  font-size: 10.5px;
  color: var(--text-muted);
  letter-spacing: 0.4px;
  text-transform: uppercase;
  font-weight: 600;
  display: flex;
  gap: 8px;
  align-items: center;
}
.coach-note-stale {
  color: var(--warning, #ffa94d);
  font-weight: 600;
}
.coach-note-text {
  grid-column: 1 / 2;
  font-size: 13.5px;
  line-height: 1.4;
  color: var(--text);
  word-wrap: break-word;
}
.coach-note-del {
  grid-column: 2 / 3;
  grid-row: 1 / 3;
  padding: 4px 10px;
  font-size: 14px;
  align-self: center;
  color: var(--text-muted);
}
.coach-note-del:hover {
  color: var(--danger, #ff6b6b);
  border-color: rgba(255,107,107,0.4);
}

/* ── Days picker ──────────────────────────────────────────────────────── */
.days-picker { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; }
.day-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 5px 10px; border-radius: 20px; font-size: 13px; font-weight: 600;
  background: var(--surface-2); border: 1.5px solid var(--border);
  cursor: pointer; user-select: none; transition: all .15s;
}
.day-chip input { display: none; }
.day-chip.selected { background: var(--accent); border-color: var(--accent); color: #000; }
.day-chip:hover:not(.selected) { border-color: var(--accent); color: var(--accent); }

/* ── Training plan ────────────────────────────────────────────────────── */
.plan-banner { border-left: 3px solid var(--accent); }
.plan-week-badge {
  font-size: 11px;
  font-weight: 600;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 3px 10px;
  white-space: nowrap;
  color: var(--text-dim);
}
.plan-week-badge.deload {
  background: rgba(255,149,0,0.12);
  border-color: var(--warn);
  color: var(--warn);
}
.plan-schedule { display: flex; flex-direction: column; gap: 4px; }
.plan-day-row {
  display: grid;
  grid-template-columns: 80px 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  font-size: 13px;
}
.plan-day-row.rest { opacity: 0.45; }
.plan-day-row.cardio { background: rgba(44,191,177,0.07); border-left: 2px solid var(--accent); }
.plan-day-row.active { background: rgba(94,200,185,0.07); border-left: 2px solid var(--accent-light); }
.plan-day-dow { font-weight: 600; color: var(--text); text-transform: capitalize; }
.plan-day-session { color: var(--text-dim); }
.plan-day-groups { font-size: 11px; color: var(--text-muted); text-align: right; }
.plan-banner.cardio-banner { border-left-color: var(--accent); }
.plan-banner.active-banner { border-left-color: var(--accent-light); }

/* ── Session chat ─────────────────────────────────────────────────────── */
.chat-messages {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 340px;
  overflow-y: auto;
  padding-bottom: 4px;
  margin-bottom: 12px;
}
.chat-messages:empty { display: none; }
.chat-bubble {
  max-width: 85%;
  padding: 10px 13px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  line-height: 1.55;
  word-break: break-word;
}
.chat-bubble.user {
  align-self: flex-end;
  background: var(--accent);
  color: #000;
  font-weight: 500;
}
.chat-bubble.assistant {
  align-self: flex-start;
  background: var(--surface-2);
  color: var(--text-dim);
  border: 1px solid var(--border);
}
.chat-input-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}
.chat-input-row input {
  flex: 1;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 14px;
  color: var(--text);
  outline: none;
}
.chat-input-row input:focus { border-color: var(--accent); }
.chat-input-row .btn-send {
  background: var(--accent);
  color: #000;
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  padding: 0 16px;
  white-space: nowrap;
  transition: opacity 0.15s;
}
.chat-input-row .btn-send:disabled { opacity: 0.4; cursor: not-allowed; }

/* ── SVG body guide ──────────────────────────────────────────────────── */
.body-guide-wrap {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 18px;
  align-items: start;
  margin-bottom: 16px;
  padding: 14px;
  background: linear-gradient(180deg, rgba(44,191,177,0.04), transparent);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.body-guide-svg {
  display: block;
  width: 100%;
  max-width: 180px;
  height: auto;
  filter: drop-shadow(0 4px 12px rgba(44,191,177,0.08));
  margin: 0 auto;
}
.body-guide-legend {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 10px;
  align-content: start;
}
.measurement-hint {
  font-size: 11px;
  color: var(--text-dim);
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.02);
  border: 1px solid transparent;
  display: flex;
  gap: 7px;
  align-items: flex-start;
  transition: background 0.15s, border-color 0.15s;
}
.measurement-hint:hover {
  background: rgba(44,191,177,0.05);
  border-color: rgba(44,191,177,0.2);
}
.hint-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 3px;
  box-shadow: 0 0 6px var(--c, rgba(44,191,177,0.4));
}
.hint-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.hint-name { font-weight: 600; color: var(--text); font-size: 12px; }
.hint-desc { color: var(--text-muted); line-height: 1.35; font-size: 10.5px; }

/* ── Measurements form ───────────────────────────────────────────────── */
.measurements-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 12px;
}
.measurement-input-group label { font-size: 11px; color: var(--text-muted); margin-bottom: 3px; }
.measurement-input-group input { padding: 7px 10px; font-size: 14px; }

/* ── Delta badges ────────────────────────────────────────────────────── */
.delta-positive { color: var(--accent); }
.delta-negative { color: var(--danger); }
.delta-neutral  { color: var(--text-muted); }

/* ── Loading skeleton ────────────────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--surface) 25%, var(--surface-2) 50%, var(--surface) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--radius-sm);
}
@keyframes shimmer { to { background-position: -200% 0; } }
.skeleton-line { height: 14px; margin-bottom: 8px; }
.skeleton-line.tall { height: 80px; }

/* ── Toast ───────────────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: calc(var(--nav-h) + 12px);
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 13px;
  padding: 10px 18px;
  border-radius: 20px;
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
  white-space: nowrap;
  z-index: 200;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.toast.success { border-color: var(--accent); color: var(--accent); }
.toast.error   { border-color: var(--danger); color: var(--danger); }

/* ── Color helpers ───────────────────────────────────────────────────── */
.accent   { color: var(--accent); }
.warn     { color: var(--warn); }
.danger   { color: var(--danger); }
.muted    { color: var(--text-muted); }

/* ── Confidence bar ──────────────────────────────────────────────────── */
.confidence-row { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.confidence-bar-wrap { flex: 1; height: 4px; background: var(--surface-2); border-radius: 2px; }
.confidence-bar { height: 100%; border-radius: 2px; background: var(--accent); transition: width 0.4s; }

/* ── Section divider ─────────────────────────────────────────────────── */
.section-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 16px 0;
}

/* ── Empty state ─────────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
  background: rgba(255,255,255,0.02);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}
.empty-state svg { margin-bottom: 12px; opacity: 0.35; color: var(--accent); }
.empty-state p { font-size: 14px; line-height: 1.5; }

/* ── Scrollable chart container ──────────────────────────────────────── */
.chart-scroll { overflow-x: auto; }
.chart-scroll canvas { min-width: 300px; }

/* ── Nutrition screen ────────────────────────────────────────────────── */
.macro-row {
  margin-bottom: 10px;
}
.macro-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 4px;
}
.macro-name  { font-size: 13px; color: var(--text-dim); }
.macro-value { font-size: 14px; font-weight: 600; }
.macro-goal  { font-size: 12px; font-weight: 400; color: var(--text-muted); }
.macro-track {
  height: 6px;
  background: var(--surface-2);
  border-radius: 3px;
  overflow: hidden;
}
.macro-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.4s ease;
}
.calorie-ring-wrap {
  position: relative;
  flex-shrink: 0;
}
.calorie-ring-wrap .gauge-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.badge {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 20px;
  letter-spacing: 0.3px;
}
.badge-mfp    { background: rgba(0,232,122,0.15); color: var(--accent); }
.badge-manual { background: rgba(255,149,0,0.15);  color: var(--warn); }

.btn-danger-ghost {
  background: rgba(255,69,58,0.08);
  color: var(--danger);
  border: 1px solid rgba(255,69,58,0.25);
  border-radius: var(--radius-sm);
  padding: 8px 16px;
  font-size: 13px;
  transition: background 0.15s;
}
.btn-danger-ghost:hover { background: rgba(255,69,58,0.18); }

/* ── Session feedback buttons ────────────────────────────────────────── */
.btn-feedback {
  flex: 1;
  padding: 10px 8px;
  font-size: 13px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
  transition: opacity 0.15s, outline 0.1s;
  opacity: 0.5;
}
.btn-feedback:hover { opacity: 0.85; }

/* ── Mobile tweaks ───────────────────────────────────────────────────── */
@media (max-width: 360px) {
  .metrics-row { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .metric-value { font-size: 17px; }
  .charts-row { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .measurements-form-grid { grid-template-columns: 1fr; }
  .body-guide-wrap { grid-template-columns: 1fr; }
  .body-guide-svg { max-width: 140px; }
  .body-guide-legend { grid-template-columns: 1fr; }
}

/* ── Nutrition tracker ───────────────────────────────────────────────── */
.nut-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
  padding: 2px 2px 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.nut-tabs::-webkit-scrollbar { display: none; }
.nut-tab {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  padding: 9px 12px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.15s, border-color 0.15s;
  white-space: nowrap;
  letter-spacing: 0.2px;
}
.nut-tab:hover { color: var(--text); }
.nut-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.meal-section {
  margin-bottom: 14px;
  padding: 10px 12px;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-left: 3px solid var(--meal-color, var(--accent));
  border-radius: var(--radius-sm);
  transition: background 0.15s;
}
.meal-section:hover { background: rgba(44,191,177,0.03); }
.meal-section.meal-desayuno  { --meal-color: #D9AE5F; }
.meal-section.meal-almuerzo  { --meal-color: #5EC8B9; }
.meal-section.meal-comida    { --meal-color: #ff9500; }
.meal-section.meal-merienda  { --meal-color: #ff6b6b; }
.meal-section.meal-cena      { --meal-color: #7C83FD; }
.meal-section.meal-snack     { --meal-color: var(--text-muted); }
.meal-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
  gap: 8px;
}
.meal-section-header > span:first-child {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  letter-spacing: 0.2px;
}
.food-log-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  gap: 10px;
}
.food-log-item:last-child { border-bottom: none; }
.food-log-name { font-size: 13px; display: block; font-weight: 500; margin-bottom: 2px; }
.food-log-meta { font-size: 11px; color: var(--text-muted); }

.food-result {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  border: 1px solid transparent;
  border-bottom-color: rgba(255,255,255,0.05);
  margin-bottom: 2px;
}
.food-result:hover {
  background: rgba(44,191,177,0.06);
  border-color: rgba(44,191,177,0.2);
}
.food-result-name { font-size: 13px; font-weight: 500; margin-bottom: 2px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.food-result-brand { font-size: 11px; color: var(--text-muted); margin-bottom: 2px; }
.food-result-macros { font-size: 11px; color: var(--text-dim); }
.nut-results-label { font-size: 11px; color: var(--text-muted); font-weight: 600; letter-spacing: 0.3px; padding: 4px 0 6px; text-transform: uppercase; }
.food-source-badge { font-size: 9px; font-weight: 600; border-radius: 3px; padding: 1px 5px; letter-spacing: 0.3px; white-space: nowrap; }
.food-source-off { background: rgba(255,255,255,0.08); color: var(--text-muted); border: 1px solid rgba(255,255,255,0.12); }
.food-source-usda { background: rgba(79,195,247,0.12); color: #4fc3f7; border: 1px solid rgba(79,195,247,0.25); }
.food-source-custom { background: rgba(0,201,167,0.15); color: var(--teal); border: 1px solid rgba(0,201,167,0.3); }

/* ── Date navigation ─────────────────────────────────────────────────── */
.nut-date-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 14px;
  padding: 6px 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
}
.nut-date-btn {
  background: none;
  border: none;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  color: var(--text-muted);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.nut-date-btn:hover:not(.disabled) { background: rgba(44,191,177,0.15); color: var(--accent); }
.nut-date-btn.disabled { opacity: 0.25; cursor: default; }
.nut-date-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  min-width: 110px;
  text-align: center;
  letter-spacing: 0.2px;
  text-transform: capitalize;
}

/* ── Calorie hero card ───────────────────────────────────────────────── */
.nut-hero-card {
  padding: 16px;
  margin-bottom: 14px;
  background: linear-gradient(135deg, rgba(44,191,177,0.08), rgba(24,83,89,0.04) 60%, transparent);
  border: 1px solid rgba(44,191,177,0.22);
  border-radius: var(--radius);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}
.nut-hero-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 30%, rgba(44,191,177,0.1), transparent 60%);
  pointer-events: none;
}
.nut-hero-top { display: flex; align-items: center; gap: 16px; margin-bottom: 12px; position: relative; }
.nut-hero-info { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
.nut-remaining-value {
  font-size: 34px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -1px;
  text-shadow: 0 0 18px rgba(44,191,177,0.15);
}
.nut-remaining-label {
  font-size: 10.5px;
  color: var(--text-muted);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  font-weight: 600;
}
.nut-garmin-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--text-muted);
  background: rgba(0,0,0,0.25);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 10px;
  margin-top: 4px;
}
.nut-garmin-row strong { color: var(--text); }
.nut-garmin-balance { font-weight: 700; }

/* ── Macro mini-rings ────────────────────────────────────────────────── */
.macro-rings-row {
  display: flex;
  gap: 6px;
  justify-content: space-around;
  align-items: flex-end;
  position: relative;
  padding: 10px 4px 4px;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.macro-mini-ring {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  flex: 1;
  padding: 4px 0;
  border-radius: var(--radius-sm);
  transition: background 0.15s;
}
.macro-mini-ring:hover { background: rgba(255,255,255,0.03); }
.macro-mini-ring svg { overflow: visible; }
.macro-mini-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.nut-training-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--gold);
  background: rgba(217,174,95,0.1);
  border: 1px solid rgba(217,174,95,0.3);
  border-radius: 20px;
  padding: 4px 12px;
  margin-bottom: 10px;
  letter-spacing: 0.3px;
}
.nut-fiber-row {
  display: flex;
  gap: 10px;
  font-size: 11px;
  color: var(--text-muted);
  margin: 10px 0 4px;
  flex-wrap: wrap;
  padding: 8px 10px;
  background: rgba(255,255,255,0.025);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.nut-fiber-row strong { color: var(--text); }
.nut-fiber-row > span { display: inline-flex; align-items: center; gap: 4px; }

/* ── Weekly bar chart ────────────────────────────────────────────────── */
.week-chart {
  display: flex;
  gap: 6px;
  height: 64px;
  align-items: flex-end;
  margin: 12px 0 6px;
  padding: 8px 10px 6px;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.week-bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: transform 0.15s;
}
.week-bar-col:hover { transform: translateY(-2px); }
.week-bar-wrap { flex: 1; width: 100%; position: relative; display: flex; align-items: flex-end; }
.week-bar-fill {
  width: 100%;
  border-radius: 3px 3px 0 0;
  min-height: 3px;
  transition: height 0.3s, filter 0.15s;
  filter: saturate(0.85);
}
.week-bar-active .week-bar-fill {
  filter: saturate(1.2) drop-shadow(0 0 8px rgba(44,191,177,0.4));
}
.week-bar-goal {
  position: absolute;
  left: -2px; right: -2px;
  height: 1px;
  background: rgba(217,174,95,0.45);
  pointer-events: none;
}
.week-bar-label {
  font-size: 9px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
}
.week-bar-active .week-bar-label { color: var(--accent); font-weight: 800; }
.week-bar-col:hover .week-bar-fill { opacity: 1 !important; filter: saturate(1.2); }

/* ── Nutrition timeline (line chart per meal) ────────────────────────── */
.nut-timeline-card { padding: 14px; margin-top: 10px; }
.nut-timeline-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin-bottom: 10px;
  font-size: 11px;
  color: var(--text-dim);
  font-weight: 600;
}
.nut-timeline-legend .tl-lgd {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.nut-timeline-legend .tl-lgd i {
  width: 10px; height: 10px;
  border-radius: 2px;
  display: inline-block;
  box-shadow: 0 0 6px currentColor;
}
.nut-timeline-wrap {
  height: 190px;
  position: relative;
}

/* ── Biblioteca tab ──────────────────────────────────────────────────── */
.lib-section-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin: 14px 0 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(44,191,177,0.25);
}
.lib-food-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  transition: background 0.15s;
}
.lib-food-row:hover { background: rgba(255,255,255,0.02); }
.lib-food-name { font-size: 13px; font-weight: 500; }
.lib-food-brand { font-size: 11px; color: var(--text-muted); }
.lib-food-macros { font-size: 11px; color: var(--text-dim); margin-top: 1px; }
.btn-lib-edit { background: none; border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text-muted); padding: 3px 7px; font-size: 13px; cursor: pointer; transition: background 0.1s; flex-shrink: 0; }
.btn-lib-edit:hover { background: var(--surface-2); color: var(--text); }
.btn-lib-del { background: none; border: 1px solid transparent; border-radius: var(--radius-sm); color: var(--text-muted); padding: 3px 7px; font-size: 12px; cursor: pointer; transition: color 0.1s; flex-shrink: 0; }
.btn-lib-del:hover { color: #ff6b6b; }
.lib-edit-form { background: var(--surface-2); border-radius: var(--radius); padding: 12px; margin: 6px 0 10px; }

.btn-link-muted { background: none; border: none; color: var(--text-muted); font-size: 12px; cursor: pointer; padding: 4px 8px; border-radius: var(--radius-sm); transition: color 0.15s; }
.btn-link-muted:hover { color: var(--text-primary); }

.create-food-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.create-food-full { grid-column: 1 / -1; }
.create-food-field { display: flex; flex-direction: column; gap: 3px; }
.create-food-label { font-size: 11px; color: var(--text-muted); }

.food-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.food-chip {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
  white-space: nowrap;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.food-chip:hover {
  background: rgba(44,191,177,0.12);
  border-color: var(--accent);
  transform: translateY(-1px);
}

.meal-picker { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 4px; }
.meal-pill {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.meal-pill:hover { background: rgba(255,255,255,0.08); border-color: rgba(44,191,177,0.3); }
.meal-pill.active {
  background: rgba(44,191,177,0.15);
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 10px rgba(44,191,177,0.15);
}

.meal-pill-sm {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 4px 11px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.meal-pill-sm:hover { background: rgba(44,191,177,0.12); border-color: var(--accent); color: var(--accent); }

.btn-ghost {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: background 0.15s, color 0.15s;
}
.btn-ghost:hover {
  background: rgba(255,255,255,0.07);
  color: var(--text);
}

.btn-scan {
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.btn-icon-del {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 13px;
  padding: 4px 6px;
  border-radius: 4px;
  transition: color 0.1s, background 0.1s;
  flex-shrink: 0;
}
.btn-icon-del:hover { color: var(--danger); background: rgba(255,69,58,0.1); }

/* ── Kairos Dashboard: Alert banner ──────────────────────────────────── */
.alert-banner {
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 12px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 13px;
  line-height: 1.5;
}
.alert-banner.blocked {
  background: rgba(255,69,58,0.1);
  border: 1px solid rgba(255,69,58,0.35);
  color: #ff6b63;
}
.alert-banner.degraded {
  background: rgba(245,166,35,0.1);
  border: 1px solid rgba(245,166,35,0.35);
  color: var(--warn);
}
.alert-banner.flag {
  background: rgba(245,166,35,0.08);
  border: 1px solid rgba(245,166,35,0.25);
  color: var(--warn);
}
.alert-banner-icon { flex-shrink: 0; margin-top: 1px; }
.alert-banner-body strong { display: block; font-weight: 700; margin-bottom: 3px; }
.alert-banner-consult {
  font-size: 11px;
  opacity: 0.75;
  margin-top: 4px;
  font-style: italic;
}

/* ── Kairos Dashboard: Signal strip ─────────────────────────────────── */
.signal-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 7px;
  margin-bottom: 6px;
}
.signal-strip-5 {
  grid-template-columns: repeat(5, 1fr);
}
.context-sentence {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.1px;
  margin-bottom: 12px;
  padding: 0 2px;
  line-height: 1.4;
}
.signal-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 5px 9px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  position: relative;
  overflow: hidden;
  transition: transform 0.12s, border-color 0.15s;
}
.signal-item:active { transform: scale(0.96); }
.signal-item::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  border-radius: 2px 2px 0 0;
}
.signal-item::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-sm);
  background: radial-gradient(circle at top, var(--_glow, transparent) 0%, transparent 60%);
  opacity: 0.55;
  pointer-events: none;
}
.signal-item.ok   { --_glow: var(--accent-glow); }
.signal-item.warn { --_glow: var(--warn-glow); }
.signal-item.bad  { --_glow: var(--danger-glow); }
.signal-item.ok::before   { background: var(--accent); }
.signal-item.warn::before { background: var(--warn); }
.signal-item.bad::before  { background: var(--danger); }
.signal-item.none::before { background: var(--border); }
.signal-icon {
  color: var(--text-muted);
  opacity: 0.85;
  margin-bottom: 1px;
}
.signal-item.ok .signal-icon   { color: var(--accent); opacity: 1; }
.signal-item.warn .signal-icon { color: var(--warn); opacity: 1; }
.signal-item.bad .signal-icon  { color: var(--danger); opacity: 1; }
.signal-value {
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.1;
  letter-spacing: -0.3px;
  position: relative;
}
.signal-item.ok .signal-value   { color: var(--accent); }
.signal-item.warn .signal-value { color: var(--warn); }
.signal-item.bad .signal-value  { color: var(--danger); }
.signal-label {
  font-size: 9.5px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  text-align: center;
  position: relative;
}

/* ── Kairos Dashboard: Decision hero card ───────────────────────────── */
.decision-hero {
  background: linear-gradient(165deg, var(--surface) 0%, #13222c 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 16px 16px;
  margin-bottom: 14px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}
.decision-hero::after {
  content: '';
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, var(--accent) 0%, var(--accent-dim) 100%);
  border-radius: 2px 0 0 2px;
  box-shadow: 0 0 12px var(--accent-glow-strong);
}
.decision-hero::before {
  content: '';
  position: absolute;
  top: -40%; right: -20%;
  width: 240px; height: 240px;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
  pointer-events: none;
  opacity: 0.5;
}
.decision-hero.blocked::after { background: var(--danger); box-shadow: 0 0 12px var(--danger-glow); }
.decision-hero.blocked::before { background: radial-gradient(circle, var(--danger-glow) 0%, transparent 70%); }
.decision-hero.degraded::after { background: var(--warn); box-shadow: 0 0 12px var(--warn-glow); }
.decision-hero.degraded::before { background: radial-gradient(circle, var(--warn-glow) 0%, transparent 70%); }
.decision-hero.done::after { background: linear-gradient(180deg, #00e87a 0%, var(--accent) 100%); box-shadow: 0 0 12px rgba(0,232,122,0.3); }
.decision-hero.done::before { background: radial-gradient(circle, rgba(0,232,122,0.15) 0%, transparent 70%); }
.decision-hero.done .decision-title-icon,
.decision-title-icon.done {
  background: rgba(0,232,122,0.15);
  border-color: rgba(0,232,122,0.35);
  color: #00e87a;
}
.decision-exercise-rank.done {
  background: rgba(0,232,122,0.18);
  color: #00e87a;
  font-size: 13px;
}
.badge-DONE {
  background: rgba(0,232,122,0.12);
  color: #00e87a;
  border: 1px solid rgba(0,232,122,0.35);
}

/* Execution stats row (results hero) */
.execution-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
  position: relative;
}
.exec-stat {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  transition: border-color 0.15s;
}
.exec-stat:hover { border-color: rgba(0,232,122,0.3); }
.exec-stat-val {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.2px;
}
.exec-stat-lbl {
  font-size: 9.5px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.decision-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  gap: 8px;
  position: relative;
}
.decision-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.decision-title-icon {
  width: 32px; height: 32px;
  border-radius: 10px;
  background: var(--accent-glow);
  border: 1px solid var(--accent-glow-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  flex-shrink: 0;
}
.decision-hero.blocked .decision-title-icon {
  background: var(--danger-glow);
  border-color: rgba(255,69,58,0.28);
  color: var(--danger);
}
.decision-hero.degraded .decision-title-icon {
  background: var(--warn-glow);
  border-color: rgba(245,166,35,0.28);
  color: var(--warn);
}
.decision-title {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.9px;
  color: var(--text-muted);
}
.decision-title-sub {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.2px;
  margin-top: 1px;
}
.decision-badges { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.decision-muscles {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 12px;
  position: relative;
}
.decision-exercises {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 10px;
  position: relative;
}
.decision-exercise {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: 9px 11px;
  border: 1px solid transparent;
  transition: border-color 0.15s;
}
.decision-exercise:hover { border-color: var(--border); }
.decision-exercise-rank {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--accent-glow);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.decision-exercise-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.2;
}
.decision-exercise-group {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: capitalize;
  margin-top: 2px;
}
.decision-exercise-right {
  text-align: right;
}
.decision-exercise-weight {
  font-size: 14px;
  font-weight: 800;
  color: var(--accent);
  white-space: nowrap;
  letter-spacing: -0.2px;
}
.decision-exercise-sets {
  font-size: 11px;
  color: var(--text-muted);
}
.decision-meta {
  display: flex;
  gap: 14px;
  font-size: 12px;
  color: var(--text-muted);
  align-items: center;
  flex-wrap: wrap;
  position: relative;
  padding-top: 4px;
  border-top: 1px dashed var(--border);
  margin-top: 4px;
}
.decision-meta strong { color: var(--text-dim); font-weight: 700; }
.decision-cta { margin-top: 12px; position: relative; }
.decision-empty {
  text-align: center;
  padding: 20px 0 4px;
  color: var(--text-muted);
  font-size: 13px;
}
.decision-empty-btn {
  display: inline-block;
  margin-top: 10px;
  padding: 9px 20px;
  background: var(--accent-glow);
  border: 1px solid var(--accent-glow-strong);
  color: var(--accent);
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.decision-empty-btn:hover { background: var(--accent-glow-strong); }

/* ── Muscle group chips (colored) ───────────────────────────────────── */
.muscle-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 16px;
  font-size: 11.5px;
  font-weight: 600;
  text-transform: capitalize;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  color: var(--text-dim);
}
.muscle-chip::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--_mc, var(--text-muted));
  box-shadow: 0 0 6px var(--_mc, transparent);
}
.muscle-chip.m-chest     { --_mc: var(--m-chest); color: var(--m-chest); border-color: rgba(79,195,247,0.25); }
.muscle-chip.m-back      { --_mc: var(--m-back); color: var(--m-back); border-color: rgba(44,191,177,0.25); }
.muscle-chip.m-legs      { --_mc: var(--m-legs); color: var(--m-legs); border-color: rgba(217,174,95,0.3); }
.muscle-chip.m-shoulders { --_mc: var(--m-shoulders); color: var(--m-shoulders); border-color: rgba(124,131,253,0.3); }
.muscle-chip.m-arms      { --_mc: var(--m-arms); color: var(--m-arms); border-color: rgba(255,149,0,0.3); }
.muscle-chip.m-core      { --_mc: var(--m-core); color: var(--m-core); border-color: rgba(94,200,185,0.3); }
.muscle-chip.m-glutes    { --_mc: var(--m-glutes); color: var(--m-glutes); border-color: rgba(217,174,95,0.3); }
.muscle-chip.m-calves    { --_mc: var(--m-calves); color: var(--m-calves); border-color: rgba(122,154,170,0.3); }

/* ── Kairos Dashboard: ACWR zone bar ────────────────────────────────── */
.acwr-bar-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 12px;
}
.acwr-bar-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 8px;
  gap: 8px;
}
.acwr-bar-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
}
.acwr-bar-value {
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
}
.acwr-bar-status {
  font-size: 12px;
  color: var(--text-muted);
  margin-left: 6px;
}
.acwr-track {
  position: relative;
  height: 8px;
  border-radius: 4px;
  overflow: visible;
  margin-bottom: 4px;
}
.acwr-zone {
  position: absolute;
  top: 0;
  height: 100%;
}
.acwr-zone-danger-low  { background: rgba(255,69,58,0.35);  left: 0;    width: 11.4%; border-radius: 4px 0 0 4px; }
.acwr-zone-low         { background: rgba(245,166,35,0.3);  left: 11.4%; width: 11.4%; }
.acwr-zone-optimal     { background: rgba(0,201,167,0.3);   left: 22.8%; width: 34.3%; }
.acwr-zone-high        { background: rgba(245,166,35,0.3);  left: 57.1%; width: 22.8%; }
.acwr-zone-danger-high { background: rgba(255,69,58,0.35);  left: 79.9%; width: 20.1%; border-radius: 0 4px 4px 0; }
.acwr-cursor {
  position: absolute;
  top: -3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--bg);
  transform: translateX(-50%);
  z-index: 2;
  transition: left 0.5s ease;
}
.acwr-ticks {
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  color: var(--text-muted);
  margin-top: 2px;
  padding: 0 2px;
}
.adherence-row {
  display: flex;
  gap: 16px;
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-muted);
}
.adherence-row strong { color: var(--text-dim); font-weight: 600; }

/* ── Collapsible trends section ─────────────────────────────────────── */
.trends-collapse {
  margin-bottom: 14px;
}
.trends-toggle {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.2px;
  cursor: pointer;
  list-style: none;
  padding: 8px 2px;
  user-select: none;
}
.trends-toggle::-webkit-details-marker { display: none; }
.trends-collapse[open] .trends-toggle { color: var(--text); }
.trends-toggle svg { opacity: 0.6; flex-shrink: 0; }
.adherence-pill {
  margin-left: auto;
  background: rgba(44,191,177,0.10);
  border: 1px solid rgba(44,191,177,0.25);
  border-radius: 20px;
  padding: 2px 9px;
  font-size: 11px;
  color: var(--accent);
  font-weight: 600;
}

/* ── Kairos Dashboard: Sparklines row ───────────────────────────────── */
.sparklines-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}
.sparkline-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}
.sparkline-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 6px;
}
.sparkline-title {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
}
.sparkline-current {
  font-size: 14px;
  font-weight: 700;
}

/* ── Nutrition rings ─────────────────────────────────────────────────── */
.nut-ring-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  padding: 4px 2px;
  border-radius: var(--radius-sm);
  transition: background 0.15s;
}
.nut-ring-item:hover { background: rgba(255,255,255,0.04); }

/* ── Desktop layout ─────────────────────────────────────────────────── */
@media (min-width: 700px) {
  #app-root { max-width: 720px; margin: 0 auto; }
  .signal-strip { grid-template-columns: repeat(4, 1fr); }
  .signal-strip-5 { grid-template-columns: repeat(5, 1fr); }
  .sparklines-row { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 1024px) {
  #app-root { max-width: 900px; }
  .kairos-desktop-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    align-items: start;
  }
  .kairos-desktop-grid > * { margin-bottom: 0; }
}

/* Barcode scanner modal */
.scan-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
}
.scan-overlay {
  position: relative;
  width: min(320px, 90vw);
  height: min(320px, 90vw);
  border-radius: 12px;
  overflow: hidden;
}
.scan-overlay video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.scan-overlay canvas { display: none; }
.scan-overlay::after {
  content: '';
  position: absolute;
  inset: 20%;
  border: 2px solid var(--accent);
  border-radius: 8px;
  pointer-events: none;
}

/* ── Food vision results ──────────────────────────────────────────────── */
.vision-analyzing {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  font-size: 13px;
  color: var(--text-muted);
}
.vision-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}
.vision-unavailable {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  font-size: 12px;
  color: var(--text-muted);
  background: var(--bg-elev-2);
  border-radius: var(--r-md);
  margin-top: 8px;
}
.vision-results-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 12px;
  margin-top: 10px;
}
.vision-results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--text);
}
.vision-food-list { display: flex; flex-direction: column; gap: 6px; }
.vision-food-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 10px;
  background: var(--bg-elev-2);
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: background 0.15s;
}
.vision-food-row:hover { background: rgba(44,191,177,0.07); }
.vision-food-row input[type="checkbox"] {
  margin-top: 2px;
  accent-color: var(--accent);
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.vision-food-info { flex: 1; min-width: 0; }
.vision-food-name { font-size: 13px; font-weight: 500; margin-bottom: 2px; }
.vision-food-meta { font-size: 11px; color: var(--text-muted); }
.vision-macros { color: var(--accent); font-weight: 600; }

.badge-confidence {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.3px;
  border-radius: 4px;
  padding: 1px 5px;
  vertical-align: middle;
}
.badge-confidence-high   { background: rgba(44,191,177,0.15); color: var(--accent); }
.badge-confidence-medium { background: rgba(255,169,77,0.15);  color: var(--warning); }
.badge-confidence-low    { background: rgba(255,107,107,0.12); color: var(--danger); }

/* ── Login screen ─────────────────────────────────────────────────────── */
#login-screen {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 24px;
}
.login-card {
  width: 100%;
  max-width: 340px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 36px 28px 32px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.4);
}
.login-logo {
  width: 120px;
  object-fit: contain;
  margin-bottom: 4px;
}
.login-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0 0 8px;
  letter-spacing: 0.3px;
}
#login-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.login-input {
  width: 100%;
  padding: 12px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 16px; /* ≥16px prevents iOS auto-zoom */
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}
.login-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(44,191,177,0.12);
}
.login-btn {
  width: 100%;
  padding: 12px;
  font-size: 15px;
  font-weight: 600;
  margin-top: 2px;
}
.login-error {
  font-size: 13px;
  color: var(--danger);
  min-height: 18px;
  text-align: center;
  margin: 0;
}

/* ── iOS input fix: prevent auto-zoom on focus ───────────────────────── */
@media (max-width: 767px) {
  input[type="text"], input[type="number"], input[type="email"],
  input[type="password"], input[type="search"], select, textarea {
    font-size: 16px !important;
  }
}

/* ── Touch targets: all tappable elements ≥44px ─────────────────────── */
.nav-item, .btn-sync, .btn-primary, .btn-secondary, .btn-danger,
.btn-ghost, .btn-outline {
  min-height: 44px;
}

/* ── Session pre-workout mode ────────────────────────────────────────── */
.session-mode-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 20px;
  margin-bottom: 10px;
}
.session-mode-badge.pre   { background: rgba(44,191,177,0.12); color: var(--accent); }
.session-mode-badge.active { background: rgba(245,166,35,0.15); color: var(--warn); }
.session-mode-badge.done  { background: rgba(34,197,94,0.12); color: #22c55e; }

/* ── Tracking mode — exercise card ──────────────────────────────────── */
.track-exercise-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 10px;
  transition: border-color 0.2s;
}
.track-exercise-card.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-glow);
}
.track-exercise-card.completed-ex {
  opacity: 0.6;
  border-color: rgba(34,197,94,0.3);
}
.track-ex-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.track-ex-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}
.track-ex-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}
.track-ex-progress {
  font-size: 12px;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}

/* ── Set row ─────────────────────────────────────────────────────────── */
.track-sets {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.track-set-row {
  display: grid;
  grid-template-columns: 28px 1fr 1fr 44px;
  gap: 6px;
  align-items: center;
}
.set-num {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
  text-align: center;
}
.track-set-row input[type="number"] {
  text-align: center;
  padding: 8px 6px;
  min-height: 40px;
  font-size: 16px;
  font-weight: 600;
}
.btn-set-done {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  color: var(--text-dim);
  font-size: 18px;
  transition: all 0.15s;
  flex-shrink: 0;
}
.btn-set-done:hover { border-color: var(--accent); color: var(--accent); }
.btn-set-done.done  {
  background: rgba(44,191,177,0.12);
  border-color: var(--accent);
  color: var(--accent);
}

/* ── Add-set button ──────────────────────────────────────────────────── */
.btn-add-set {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  margin-top: 8px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  border: 1px dashed rgba(44,191,177,0.35);
  background: transparent;
  transition: background 0.15s;
}
.btn-add-set:hover { background: rgba(44,191,177,0.07); }

/* ── Rest timer ──────────────────────────────────────────────────────── */
.rest-timer-bar {
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
  margin: 8px 0 4px;
}
.rest-timer-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 1s linear;
}
.rest-timer-label {
  font-size: 11px;
  color: var(--text-muted);
  text-align: right;
}
.track-footer {
  position: sticky;
  bottom: calc(var(--nav-h) + 8px);
  left: 0; right: 0;
  background: linear-gradient(0deg, var(--bg) 70%, transparent 100%);
  padding: 12px 16px 0;
  display: flex; gap: 10px; z-index: 50;
}
.track-footer .btn-primary, .track-footer .btn-secondary { flex: 1; }
.session-progress-header { background: var(--surface); border-bottom: 1px solid var(--border); padding: 10px 16px; margin-bottom: 12px; }
.session-progress-track { height: 4px; background: var(--border); border-radius: 2px; overflow: hidden; margin-top: 8px; }
.session-progress-fill { height: 100%; background: linear-gradient(90deg, var(--accent-dim), var(--accent)); border-radius: 2px; transition: width 0.4s ease; }
.session-progress-meta { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-muted); }
.pr-flash { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700; color: var(--gold); background: rgba(217,174,95,0.12); border: 1px solid rgba(217,174,95,0.3); border-radius: 12px; padding: 2px 8px; animation: pr-pop 0.4s cubic-bezier(0.2,1.8,0.4,1); }
@keyframes pr-pop { from { transform: scale(0.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.post-hero { background: linear-gradient(135deg, var(--surface) 0%, rgba(44,191,177,0.05) 100%); border: 1px solid rgba(34,197,94,0.3); border-radius: var(--radius); padding: 20px 18px; margin-bottom: 12px; position: relative; overflow: hidden; }
.post-hero::before { content: ''; position: absolute; top: 0; left: 0; width: 4px; height: 100%; background: #22c55e; }
.post-hero-title { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.6px; color: #22c55e; margin-bottom: 12px; }
.post-stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.post-stat { text-align: center; }
.post-stat-value { font-size: 22px; font-weight: 800; color: var(--text); letter-spacing: -0.02em; }
.post-stat-label { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.3px; margin-top: 2px; }
.post-exercise-list { display: flex; flex-direction: column; gap: 8px; }
.post-exercise-row { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 14px; display: flex; align-items: center; justify-content: space-between; }
.post-ex-name { font-size: 14px; font-weight: 600; }
.post-ex-meta { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.post-ex-stats { text-align: right; }
.post-ex-weight { font-size: 14px; font-weight: 700; color: var(--accent); }
.post-ex-vol { font-size: 11px; color: var(--text-muted); }
.rpe-inline { display: flex; gap: 8px; margin-top: 8px; }
.rpe-btn { flex: 1; padding: 10px; border-radius: var(--radius-sm); border: 1.5px solid var(--border); font-size: 12px; font-weight: 600; text-align: center; transition: all 0.15s; background: transparent; }
.rpe-btn:hover, .rpe-btn.selected { border-color: var(--accent); background: rgba(44,191,177,0.08); color: var(--accent); }
.rpe-btn[data-value="too_easy"].selected { border-color: var(--info); background: rgba(79,195,247,0.08); color: var(--info); }
.rpe-btn[data-value="too_hard"].selected { border-color: var(--danger); background: rgba(255,69,58,0.08); color: var(--danger); }
.weekly-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 12px; }
.weekly-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.weekly-card-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); }
.weekly-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.weekly-stat { text-align: center; background: var(--surface-2); border-radius: var(--radius-xs); padding: 8px 6px; }
.weekly-stat-val { font-size: 20px; font-weight: 800; color: var(--text); letter-spacing: -0.02em; }
.weekly-stat-delta { font-size: 11px; font-weight: 600; }
.weekly-stat-delta.up { color: #22c55e; }
.weekly-stat-delta.down { color: var(--danger); }
.weekly-stat-delta.flat { color: var(--text-muted); }
.weekly-stat-lbl { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.3px; }
.streak-pill { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; background: rgba(217,174,95,0.1); border: 1px solid rgba(217,174,95,0.25); border-radius: 20px; font-size: 12px; font-weight: 700; color: var(--gold); }
.signal-strip-condensed { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 10px; }
.signal-mini { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 10px; text-align: center; transition: border-color 0.15s; }
.signal-mini:hover { border-color: var(--border-strong); }
.signal-mini-val { font-size: 16px; font-weight: 800; letter-spacing: -0.02em; }
.signal-mini-lbl { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.3px; margin-top: 1px; }
.signal-mini.ok .signal-mini-val { color: var(--accent); }
.signal-mini.warn .signal-mini-val { color: var(--warn); }
.signal-mini.danger .signal-mini-val { color: var(--danger); }
.signal-mini.muted .signal-mini-val { color: var(--text-muted); }
.btn-expand-signals { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; padding: 7px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 12px; font-weight: 600; color: var(--text-muted); margin-bottom: 12px; transition: color 0.15s, border-color 0.15s; }
.btn-expand-signals:hover { color: var(--text); border-color: var(--border-strong); }
.nut-tabs { display: flex; gap: 4px; background: var(--surface-2); border-radius: var(--radius-sm); padding: 4px; margin-bottom: 14px; }
.nut-tab { flex: 1; padding: 8px 4px; border-radius: 6px; font-size: 13px; font-weight: 600; color: var(--text-muted); transition: all 0.15s; text-align: center; min-height: 36px; }
.nut-tab.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.profile-tabs { display: flex; gap: 4px; margin-bottom: 14px; border-bottom: 1px solid var(--border); padding-bottom: 0; }
.profile-tab { padding: 8px 14px; font-size: 13px; font-weight: 600; color: var(--text-muted); border-bottom: 2px solid transparent; transition: all 0.15s; margin-bottom: -1px; white-space: nowrap; }
.profile-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.btn-logout { display: flex; align-items: center; gap: 8px; width: 100%; padding: 12px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--danger); font-size: 14px; font-weight: 600; transition: background 0.15s, border-color 0.15s; }
.btn-logout:hover { background: rgba(255,69,58,0.06); border-color: rgba(255,69,58,0.25); }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  .rest-timer-fill { transition: none !important; }
}
.clinical-doc-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.clinical-doc-row:last-child { border-bottom: none; }
.clinical-doc-info { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.clinical-doc-type { font-size: 10px; font-weight: 600; letter-spacing: 0.3px; color: var(--accent); text-transform: uppercase; }
.clinical-doc-title { font-size: 14px; font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.clinical-doc-date { font-size: 11px; color: var(--text-muted); }
.btn-icon-danger { flex-shrink: 0; background: none; border: 1px solid rgba(255,107,107,0.25); border-radius: var(--radius-sm); color: var(--danger); padding: 6px; cursor: pointer; transition: background 0.15s; display: flex; align-items: center; justify-content: center; min-width: 32px; min-height: 32px; font-size: 18px; line-height: 1; }
.btn-icon-danger:hover { background: rgba(255,107,107,0.1); }
.progression-row { display: flex; align-items: flex-start; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.progression-row:last-child { border-bottom: none; }
.prog-signal { font-size: 18px; font-weight: 700; min-width: 24px; text-align: center; line-height: 1.4; }
.prog-info { flex: 1; min-width: 0; }
.prog-name { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prog-meta { font-size: 11px; color: var(--text-muted); letter-spacing: 0.2px; }
.prog-note { font-size: 11px; color: var(--text-muted); font-style: italic; margin-top: 2px; }
.plan-meta-row { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--text-muted); margin-bottom: 12px; }
.plan-meta-row strong { color: var(--text); }
.plan-screen-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 10px; gap: 10px; }
.plan-screen-name { font-size: 16px; font-weight: 700; color: var(--text); line-height: 1.2; }
.plan-screen-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.plan-week-badge { background: rgba(44,191,177,0.12); border: 1px solid rgba(44,191,177,0.3); color: var(--accent); border-radius: 20px; padding: 4px 10px; font-size: 11px; font-weight: 700; white-space: nowrap; flex-shrink: 0; }
.plan-week-badge.deload { background: rgba(124,131,253,0.12); border-color: rgba(124,131,253,0.3); color: #7c83fd; }
.plan-week-progress { height: 4px; background: var(--border); border-radius: 2px; margin-bottom: 4px; overflow: hidden; }
.plan-week-bar { height: 100%; background: var(--accent); border-radius: 2px; transition: width 0.6s ease; }
.plan-today-callout { background: rgba(44,191,177,0.07); border: 1px solid rgba(44,191,177,0.2); border-radius: var(--radius-sm); padding: 10px 12px; margin-bottom: 10px; }
.plan-today-callout.rest { background: rgba(138,155,168,0.07); border-color: var(--border); }
.plan-today-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--accent); margin-bottom: 3px; }
.plan-today-callout.rest .plan-today-label { color: var(--text-muted); }
.plan-today-session { font-size: 15px; font-weight: 700; color: var(--text); }
.plan-today-groups { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.plan-day-row.today { background: rgba(44,191,177,0.07); border-left: 3px solid var(--accent); border-radius: 0 6px 6px 0; }
.today-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); margin-left: 4px; vertical-align: middle; }
.history-session-row { display: flex; justify-content: space-between; align-items: flex-start; padding: 9px 0; border-bottom: 1px solid var(--border); gap: 8px; }
.history-session-row:last-child { border-bottom: none; }
.history-session-left { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.history-session-date { font-size: 12px; font-weight: 600; color: var(--text); }
.history-session-exercises { font-size: 11px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
.history-session-right { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; flex-shrink: 0; }
.history-stat { font-size: 12px; font-weight: 600; color: var(--text); }
.history-stat.muted { color: var(--text-muted); font-weight: 400; }

/* Admin user management */
.admin-user-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.admin-user-row:last-child { border-bottom: none; }
.admin-user-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.admin-user-name { font-size: 14px; font-weight: 600; color: var(--text); }
.admin-user-email { font-size: 11px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-user-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; flex-shrink: 0; }
.badge-role { font-size: 10px; font-weight: 700; letter-spacing: 0.3px; text-transform: uppercase; color: var(--gold); background: rgba(217,174,95,0.12); border: 1px solid rgba(217,174,95,0.25); border-radius: 10px; padding: 2px 7px; }
.badge-garmin { font-size: 10px; font-weight: 600; color: var(--accent); background: rgba(44,191,177,0.1); border: 1px solid rgba(44,191,177,0.2); border-radius: 10px; padding: 2px 7px; }
.badge-garmin-off { color: var(--text-muted); background: transparent; border-color: var(--border); }

.btn-icon-reset { background: none; border: 1px solid rgba(44,191,177,0.25); border-radius: var(--radius-sm); color: var(--accent); padding: 6px; cursor: pointer; transition: background 0.15s; display: flex; align-items: center; justify-content: center; min-width: 32px; min-height: 32px; font-size: 14px; line-height: 1; }
.btn-icon-reset:hover { background: rgba(44,191,177,0.1); }
