/* ═══════════════════════════════════════════════════════════════════════════════
   yourForma — Teal monochrome identity
   Intelligent coaching.  #1D9E75 accent, dark-first, Inter typography.
   ═══════════════════════════════════════════════════════════════════════════════ */

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

:root {
  --bg:          #000000;
  --bg-card:     #161616;
  --bg-hover:    #1F1F1F;
  --bg-inset:    #0D0D0D;
  --border:      #2A2A2A;
  --text:        #FFFFFF;
  --muted:       #8E8E93;
  --accent:      #1D9E75;
  --accent-h:    #5DCAA5;
  --accent-soft: rgba(29,158,117,.12);
  --execute:     #34C759;
  --modifique:   #FF9500;
  --descanse:    #FF3B30;
  --base-clr:    #0A84FF;
  --specific-clr:#FF6B35;
  --taper-clr:   #BF5AF2;
  --radius:      12px;
  --radius-sm:   8px;
  --shadow:      0 1px 3px rgba(0,0,0,.4);

  /* yourForma brand */
  --yf-light:    #9FE1CB;
  --yf-bold:     #E1F5EE;
  --yf-tagline:  #5DCAA5;
  --yf-primary:  #1D9E75;
  --yf-bg-soft:  rgba(29,158,117,.1);
  --yf-hover:    #0F6E56;
}

/* ── Light theme ───────────────────────────────────────────────────────────── */
[data-theme="light"] {
  --bg:          #F2F2F7;
  --bg-card:     #FFFFFF;
  --bg-hover:    #E5E5EA;
  --bg-inset:    #EFEFF4;
  --border:      #D1D1D6;
  --text:        #1C1C1E;
  --muted:       #636366;
  --accent:      #0F6E56;
  --accent-h:    #1D9E75;
  --accent-soft: rgba(15,110,86,.08);
  --execute:     #248A3D;
  --modifique:   #C93400;
  --descanse:    #D70015;
  --base-clr:    #0071E3;
  --specific-clr:#D45A1E;
  --taper-clr:   #9B38D9;
  --shadow:      0 1px 3px rgba(0,0,0,.08);

  --yf-light:    #5DCAA5;
  --yf-bold:     #0F6E56;
  --yf-tagline:  #1D9E75;
  --yf-primary:  #1D9E75;
  --yf-bg-soft:  #E1F5EE;
  --yf-hover:    #0F6E56;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: var(--accent); text-decoration: none; transition: color .15s; }
a:hover { color: var(--accent-h); }

/* ── Navigation ─────────────────────────────────────────────────────────────── */
nav {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  position: sticky;
  top: 0;
  z-index: 100;
  height: 56px;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  margin-right: .5rem;
}
.brand svg { width: 32px; height: 32px; flex-shrink: 0; }
.brand-text { font-size: 1.15rem; letter-spacing: -.02em; }
.brand-text .yf-l { font-weight: 300; color: var(--yf-light); }
.brand-text .yf-b { font-weight: 700; color: var(--yf-bold); }

.nav-links { display: flex; gap: .25rem; }
.nav-links a {
  color: var(--muted);
  font-size: .85rem;
  font-weight: 600;
  padding: .45rem .85rem;
  border-radius: var(--radius-sm);
  transition: color .15s, background .15s;
}
.nav-links a:hover { color: var(--text); background: var(--bg-hover); }
.nav-links a.active {
  color: var(--text);
  background: var(--bg-hover);
}

/* ── Language switcher ───────────────────────────────────────────────────────── */
.lang-switcher { display: flex; gap: .3rem; align-items: center; margin-left: auto; }
.lang-flag {
  font-size: 1.1rem;
  opacity: .35;
  border-radius: 4px;
  padding: .15rem .25rem;
  transition: opacity .15s;
  text-decoration: none;
}
.lang-flag:hover { opacity: .7; }
.lang-flag.lang-active { opacity: 1; box-shadow: 0 0 0 2px var(--accent); }

/* ── Theme toggle ──────────────────────────────────────────────────────────── */
.theme-toggle {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--muted);
  cursor: pointer;
  padding: 4px 7px;
  font-size: 1rem;
  line-height: 1;
  transition: border-color .15s, color .15s;
  flex-shrink: 0;
}
.theme-toggle:hover {
  border-color: var(--accent);
  color: var(--text);
}

/* ── Nav user ────────────────────────────────────────────────────────────────── */
.nav-user { display: flex; align-items: center; gap: .5rem; margin-left: .5rem; }
.nav-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
}
.nav-username { font-size: .82rem; color: var(--muted); font-weight: 500; }
.nav-logout {
  font-size: .75rem;
  color: var(--muted);
  padding: .2rem .5rem;
  border-radius: 4px;
  transition: color .15s;
}
.nav-logout:hover { color: var(--descanse); }

/* ── Live translation loading state ─────────────────────────────────────────── */
[data-original] { transition: opacity .2s; }
[data-original].translating { opacity: .35; }

/* ── Layout ──────────────────────────────────────────────────────────────────── */
main { max-width: 960px; margin: 0 auto; padding: 2rem 1.25rem 4rem; }

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.75rem;
  flex-wrap: wrap;
  gap: .75rem;
}
.page-title { font-size: 1.4rem; font-weight: 800; letter-spacing: -.02em; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }

@media (max-width: 768px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  nav { padding: 0 .75rem; height: 52px; gap: .5rem; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  nav::-webkit-scrollbar { display: none; }
  .nav-links a { padding: .4rem .5rem; font-size: .78rem; }
  .nav-chat-label { display: none; }
  .nav-username { display: none; }
  .lang-switcher { gap: .15rem; }
  .lang-flag { font-size: .95rem; padding: .1rem .15rem; }
  main { padding: 1.25rem 1rem 3rem; }
}

/* ── Cards ───────────────────────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}
.card-title {
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1rem;
}
.card-wide { grid-column: 1 / -1; }

/* ── Status badge ────────────────────────────────────────────────────────────── */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .25rem .7rem;
  border-radius: 20px;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.status-badge::before {
  content: "";
  width: 7px; height: 7px;
  border-radius: 50%;
  background: currentColor;
}
.status-EXECUTE  { color: var(--execute);  background: rgba(52,199,89,.12); }
.status-MODIFIQUE{ color: var(--modifique);background: rgba(255,149,0,.12); }
.status-DESCANSE { color: var(--descanse); background: rgba(255,59,48,.12); }

/* ── Recommendation text ─────────────────────────────────────────────────────── */
.rec-message {
  font-size: .9rem;
  line-height: 1.7;
  color: var(--text);
  white-space: pre-wrap;
  margin-top: .75rem;
}
.rec-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 1rem;
  margin-top: 1rem;
  padding-top: .75rem;
  border-top: 1px solid var(--border);
}
.rec-meta-item { font-size: .8rem; color: var(--muted); }
.rec-meta-item span { color: var(--text); font-weight: 600; }

/* ── PMC metrics ─────────────────────────────────────────────────────────────── */
.pmc-values {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.pmc-val { text-align: center; }
.pmc-val .num {
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.1;
}
.pmc-val .lbl { font-size: .7rem; color: var(--muted); text-transform: uppercase; }
.ctl-color  { color: var(--accent); }
.atl-color  { color: var(--descanse); }
.tsb-color  { color: var(--execute); }

/* ── Event card ──────────────────────────────────────────────────────────────── */
.event-name   { font-size: 1.1rem; font-weight: 700; margin-bottom: .25rem; }
.event-date   { font-size: .85rem; color: var(--muted); margin-bottom: .75rem; }
.event-days   { font-size: 2rem; font-weight: 700; color: var(--accent); line-height: 1; }
.event-days-lbl { font-size: .75rem; color: var(--muted); }
.event-rows   { display: flex; flex-direction: column; gap: .4rem; margin-top: .75rem; }
.event-row    { display: flex; justify-content: space-between; font-size: .85rem; }
.event-row span { color: var(--muted); }
.event-row strong { color: var(--text); }

/* ── Buttons ─────────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  padding: .55rem 1.1rem;
  border-radius: var(--radius-sm);
  font-size: .85rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all .15s;
  font-family: inherit;
}
.btn:active { transform: scale(.97); }
.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent-h); }
.btn-ghost {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}
.btn-ghost:hover { background: var(--accent-soft); }
.btn-secondary {
  background: var(--bg-hover);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }
.btn-sm { padding: .4rem .75rem; font-size: .78rem; }

/* ── Loading overlay ─────────────────────────────────────────────────────────── */
#loading {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.85);
  z-index: 999;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 1rem;
  color: var(--text);
  font-size: .95rem;
}
#loading.show { display: flex; }
.spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Block badges ────────────────────────────────────────────────────────────── */
.block-badge {
  display: inline-block;
  padding: .2rem .6rem;
  border-radius: 6px;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.block-BASE     { background: rgba(10,132,255,.15); color: var(--base-clr); }
.block-SPECIFIC { background: rgba(255,107,53,.15); color: var(--specific-clr); }
.block-TAPER    { background: rgba(191,90,242,.15); color: var(--taper-clr); }
/* Friel ATP phases */
.block-PREP     { background: rgba(142,142,147,.15); color: #8E8E93; }
.block-BASE1    { background: rgba(10,132,255,.10); color: var(--base-clr); }
.block-BASE2    { background: rgba(10,132,255,.15); color: var(--base-clr); }
.block-BASE3    { background: rgba(10,132,255,.22); color: var(--base-clr); }
.block-BUILD1   { background: rgba(255,107,53,.15); color: var(--specific-clr); }
.block-BUILD2   { background: rgba(255,107,53,.22); color: var(--specific-clr); }
.block-PEAK     { background: rgba(191,90,242,.15); color: var(--taper-clr); }
.block-RACE     { background: rgba(52,199,89,.15); color: var(--execute); }

/* ── Workout type badges ─────────────────────────────────────────────────────── */
.wt-badge {
  display: inline-block;
  padding: .2rem .6rem;
  border-radius: 6px;
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.wt-ENDURANCE  { background: rgba(52,199,89,.12);  color: var(--execute); }
.wt-TEMPO      { background: rgba(10,132,255,.12);  color: var(--base-clr); }
.wt-THRESHOLD  { background: rgba(255,107,53,.12);  color: var(--specific-clr); }
.wt-VO2MAX     { background: rgba(255,59,48,.12);   color: var(--descanse); }
.wt-SWEET_SPOT { background: rgba(255,149,0,.12);   color: var(--modifique); }
.wt-RECOVERY   { background: rgba(142,142,147,.1);  color: var(--muted); }
.wt-REST       { background: rgba(255,255,255,.04); color: #555; }
.wt-RACE_SIM   { background: rgba(191,90,242,.12); color: var(--taper-clr); }
.wt-ACTIVATION { background: rgba(52,199,89,.12);  color: var(--execute); }

/* ── Plan view ───────────────────────────────────────────────────────────────── */
.week-section { margin-bottom: 2rem; }
.week-header {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: .75rem;
}
.week-label {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text);
}
.week-dates { font-size: .78rem; color: var(--muted); }

.day-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: .5rem;
}
@media (max-width: 900px) {
  .day-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 500px) {
  .day-grid { grid-template-columns: 1fr 1fr; }
}

.day-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .85rem;
  font-size: .8rem;
  position: relative;
  transition: border-color .15s, transform .1s;
}
.day-card:hover { border-color: var(--accent); transform: translateY(-1px); }
.day-card.is-today { border-color: var(--accent); border-width: 2px; }
.day-card.is-rest { opacity: .45; }

.day-name {
  font-size: .65rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: .4rem;
}
.day-title {
  font-weight: 700;
  font-size: .82rem;
  color: var(--text);
  margin: .4rem 0 .25rem;
  line-height: 1.3;
}
.day-meta { color: var(--muted); font-size: .72rem; margin-top: .25rem; }

.completion-dot {
  position: absolute;
  top: .6rem; right: .6rem;
  width: 8px; height: 8px;
  border-radius: 50%;
}
.dot-done   { background: var(--execute); }
.dot-missed { background: var(--descanse); }
.dot-today  { background: var(--modifique); }
.dot-future { background: var(--border); }

.day-desc {
  margin-top: .5rem;
  font-size: .72rem;
  color: var(--muted);
  line-height: 1.5;
  display: none;
}
.day-card:hover .day-desc { display: block; }

/* ── History table ───────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: .82rem;
}
thead th {
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--muted);
  padding: .65rem .8rem;
  border-bottom: 2px solid var(--border);
  text-align: left;
  white-space: nowrap;
}
tbody tr { transition: background .1s; }
tbody tr:hover { background: var(--bg-hover); }
tbody td {
  padding: .6rem .8rem;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: middle;
}
.text-muted { color: var(--muted); }
.text-right { text-align: right; }

.no-data {
  text-align: center;
  padding: 3rem;
  color: var(--muted);
  font-size: .9rem;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   DASHBOARD — Performance cockpit (Strava-inspired)
   ═══════════════════════════════════════════════════════════════════════════════ */

/* ── Grid — 3-col metric blocks ─────────────────────────────────────────────── */
.elite-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

/* ── Block — base card ──────────────────────────────────────────────────────── */
.elite-block {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 24px;
}

/* ── Label — tiny uppercase ─────────────────────────────────────────────────── */
.elite-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--muted);
  margin-bottom: 6px;
  font-weight: 700;
}

/* ── Metric number — bold ───────────────────────────────────────────────────── */
.elite-num {
  font-size: 48px;
  font-weight: 800;
  line-height: 1;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  letter-spacing: -.03em;
}

/* ── Color utilities ────────────────────────────────────────────────────────── */
.elite-teal    { color: var(--execute); }
.elite-crimson { color: var(--descanse); }
.elite-blue    { color: var(--base-clr); }
.elite-muted   { color: var(--muted); }

/* ── Coach — full-width card ────────────────────────────────────────────────── */
.elite-coach {
  margin-bottom: 16px;
}
.elite-coach-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
}
.elite-coach-session {
  font-size: 15px;
  color: var(--text);
  font-weight: 700;
  margin-top: 4px;
}
.elite-coach-text {
  font-size: 14px;
  line-height: 1.7;
  color: var(--muted);
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  white-space: pre-wrap;
}

/* ── Status badges — solid pills ────────────────────────────────────────────── */
.elite-badge-EXECUTE {
  display: inline-block;
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  background: var(--execute);
  color: #000;
}
.elite-badge-MODIFIQUE {
  display: inline-block;
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  background: var(--modifique);
  color: #000;
}
.elite-badge-DESCANSE {
  display: inline-block;
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  background: var(--descanse);
  color: #fff;
}

/* ── Post-session status badges ─────────────────────────────────────────────── */
.elite-badge-EXECUTADO {
  display: inline-block;
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  background: var(--execute);
  color: #000;
}
.elite-badge-AJUSTADO {
  display: inline-block;
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  background: var(--modifique);
  color: #000;
}
.elite-badge-EXCEDIDO {
  display: inline-block;
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  background: #e85d04;
  color: #000;
}

/* ── Post-session comparison ───────────────────────────────────────────────── */
.coach-post-session {
  border-left: 3px solid var(--execute);
}
.post-session-comparison {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}
.comparison-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.comparison-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  min-width: 60px;
}
.comparison-bars {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
}
.comparison-bar-track {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.comparison-bar-planned {
  height: 8px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 6px;
  min-width: 20px;
  transition: width .6s ease;
}
.comparison-bar-actual {
  height: 8px;
  background: var(--accent);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 6px;
  min-width: 20px;
  transition: width .6s ease;
}
.comparison-bar-actual.bar-platinum { background: #c0c0c0; }
.comparison-bar-actual.bar-gold    { background: #d4a017; }
.comparison-bar-actual.bar-over    { background: #e85d04; }
.comparison-bar-actual.bar-under   { background: #6b7280; }
.bar-value {
  font-size: 10px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}
.comparison-bar-planned .bar-value {
  color: var(--muted);
}
.comparison-deviation {
  font-size: 12px;
  font-weight: 700;
  min-width: 40px;
  text-align: right;
}
.comparison-deviation::before { content: ''; }
.dev-ok    { color: var(--execute); }
.dev-over  { color: #e85d04; }
.dev-under { color: #6b7280; }

/* Post-session metrics */
.post-session-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: 8px;
}
.ps-metric {
  font-size: 12px;
  color: var(--muted);
}
.ps-metric strong {
  color: var(--text);
}
.ps-quality {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 8px;
  border-radius: 10px;
}
.ps-quality-platinum {
  background: rgba(192, 192, 192, 0.15);
  color: #c0c0c0;
}
.ps-quality-gold {
  background: rgba(212, 160, 23, 0.15);
  color: #d4a017;
}

/* ── Comparison bars ────────────────────────────────────────────────────────── */
.elite-bars {
  margin-bottom: 16px;
}
.elite-bar-track {
  height: 10px;
  background: var(--border);
  border-radius: 5px;
  overflow: hidden;
  margin-top: 6px;
}
.elite-bar-fill-solid {
  height: 10px;
  background: var(--accent);
  border-radius: 5px;
  margin-top: 6px;
  transition: width .6s ease;
}

/* ── Yesterday Review ──────────────────────────────────────────────────────── */
.review-card {
  margin-bottom: 16px;
}
.review-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.review-verdict {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  padding: 4px 10px;
  border-radius: 12px;
}
.review-ok      { background: rgba(52,199,89,.15); color: var(--execute); }
.review-partial { background: rgba(255,214,10,.15); color: var(--modifique); }
.review-missed  { background: rgba(255,59,48,.15);  color: var(--descanse); }
.review-warning { background: rgba(255,149,0,.15);  color: #FF9500; }

.review-comparison {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0;
  margin-bottom: 16px;
}
.review-col {
  padding: 12px;
  border-radius: 10px;
}
.review-planned { background: rgba(142,142,147,.06); }
.review-actual  { background: rgba(232,93,4,.04); }
.review-col-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--muted);
  margin-bottom: 10px;
}
.review-metric-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
  font-size: 13px;
}
.review-metric-label {
  color: var(--muted);
  font-size: 11px;
}
.review-metric-val {
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.review-activity-name {
  font-size: 11px;
  font-weight: 600;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.review-pct {
  font-size: 10px;
  font-weight: 600;
  margin-left: 4px;
  opacity: .7;
}
.review-val-ok      { color: var(--execute); }
.review-val-partial { color: var(--modifique); }
.review-val-low     { color: var(--descanse); }

.review-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
}
.review-vs {
  font-size: 10px;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .08em;
}
.review-no-activity {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 0;
  color: var(--muted);
  font-size: 12px;
}

.review-bar-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.review-bar-track {
  flex: 1;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}
.review-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width .6s ease;
}
.review-bar-fill.bar-ok      { background: var(--execute); }
.review-bar-fill.bar-partial { background: var(--modifique); }
.review-bar-fill.bar-low     { background: var(--descanse); }
.review-bar-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.review-insight {
  display: flex;
  gap: 10px;
  padding: 12px 14px;
  background: rgba(232,93,4,.04);
  border-left: 3px solid var(--accent);
  border-radius: 0 8px 8px 0;
  margin-top: 4px;
}
.review-insight-icon {
  flex-shrink: 0;
  margin-top: 1px;
}
.review-insight-text {
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
}

/* ── Bio context ────────────────────────────────────────────────────────────── */
.elite-bio {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 14px;
  font-size: 13px;
  font-weight: 600;
}

/* ── Readiness strip ────────────────────────────────────────────────────────── */
.elite-readiness-strip {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 16px;
}
.elite-readiness-ring {
  width: 56px;
  height: 56px;
  position: relative;
  flex-shrink: 0;
}
.elite-readiness-ring svg {
  width: 56px;
  height: 56px;
}
.elite-readiness-num {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 800;
}
.elite-readiness-comps {
  display: flex;
  gap: 20px;
  margin-left: auto;
}
.elite-readiness-comp {
  text-align: center;
}
.elite-readiness-comp-val {
  font-size: 15px;
  font-weight: 800;
  display: block;
  font-variant-numeric: tabular-nums;
}
.elite-readiness-comp-lbl {
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-top: 2px;
}

/* ── Actions row ────────────────────────────────────────────────────────────── */
.elite-actions {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  gap: 8px;
  margin-bottom: 16px;
  align-items: stretch;
}
.elite-actions form {
  display: flex;
}

/* ── Primary action button — accent fill ────────────────────────────────────── */
.elite-btn-teal {
  width: 100%;
  padding: 12px 16px;
  background: var(--accent);
  border: none;
  border-radius: var(--radius-sm);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s;
  font-family: inherit;
  white-space: nowrap;
}
.elite-btn-teal:hover {
  background: var(--accent-h);
}

/* ── Ghost button — secondary action ────────────────────────────────────────── */
.elite-btn-ghost {
  padding: 12px 16px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .15s, color .15s;
  font-family: inherit;
  white-space: nowrap;
}
.elite-btn-ghost:hover {
  border-color: var(--text);
  color: var(--text);
}

/* ── Charts — 60/40 grid ────────────────────────────────────────────────────── */
.elite-charts {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 16px;
  margin-bottom: 24px;
}
.elite-charts .elite-block {
  position: relative;
  height: 220px;
}
.elite-charts canvas {
  position: absolute;
  top: 40px;
  left: 24px;
  right: 24px;
  bottom: 24px;
  width: calc(100% - 48px) !important;
  height: calc(100% - 64px) !important;
}

/* ── Wizard — AdjustmentWizardModal ─────────────────────────────────────────── */
.wiz-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.85);
  z-index: 500;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.wiz-overlay.show { display: flex; }
.wiz-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: 100%;
  max-width: 880px;
  position: relative;
  overflow: hidden;
  animation: wizIn .25s ease-out;
}
@keyframes wizIn {
  from { opacity: 0; transform: translateY(12px) scale(.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.wiz-gradient {
  height: 3px;
  background: linear-gradient(90deg, var(--accent), transparent);
}
.wiz-close {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  transition: all .15s;
  z-index: 1;
}
.wiz-close:hover { border-color: var(--accent); color: var(--accent); }
.wiz-body {
  padding: 3rem;
}
.wiz-title-block {
  text-align: center;
  margin-bottom: 2.5rem;
}
.wiz-title {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -.02em;
  margin-bottom: .5rem;
}
.wiz-subtitle {
  font-size: .85rem;
  color: var(--muted);
  max-width: 500px;
  margin: 0 auto;
  line-height: 1.5;
}
.wiz-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}
.wiz-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 1.5rem;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color .2s, background .2s;
  color: var(--text);
  font-family: inherit;
  font-size: inherit;
}
.wiz-card:hover {
  border-color: var(--accent);
  background: var(--bg-hover);
}
.wiz-card-icon {
  color: var(--muted);
  margin-bottom: 1rem;
}
.wiz-card-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text);
}
.wiz-card-tsb-label {
  font-size: .6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .15em;
  color: var(--muted);
  margin-bottom: .25rem;
}
.wiz-card-tsb-val {
  font-size: 1.25rem;
  font-weight: 700;
  font-family: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;
  color: var(--execute);
}

@media (max-width: 768px) {
  .wiz-options { grid-template-columns: 1fr; }
  .wiz-body { padding: 1.5rem; }
  .wiz-title { font-size: 1.5rem; }
}

/* ── Responsive — Dashboard ────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .elite-grid { grid-template-columns: 1fr; gap: 10px; }
  .elite-num { font-size: 36px; }
  .elite-block { padding: 20px; }
  .elite-charts { grid-template-columns: 1fr; }
  .elite-charts .elite-block { height: 200px; }
  .elite-readiness-strip { flex-wrap: wrap; }
  .elite-readiness-comps {
    margin-left: 0; width: 100%;
    justify-content: space-around;
    padding-top: 12px;
    border-top: 1px solid var(--border);
  }
  .elite-actions {
    display: flex;
    gap: 6px;
  }
  .elite-actions form,
  .elite-actions > a,
  .elite-actions > button {
    flex: 1;
    min-width: 0;
  }
  .elite-btn-teal,
  .elite-btn-ghost {
    padding: 8px 6px;
    font-size: 12px;
    width: 100%;
  }
  .elite-coach-header { flex-direction: column; gap: 10px; }
  .review-comparison { grid-template-columns: 1fr; gap: 8px; }
  .review-divider { padding: 4px 0; }
  .review-activity-name { max-width: 100%; }
}

/* ── Chat Panel ──────────────────────────────────────────────────────────────── */
.nav-chat-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--accent);
  padding: 5px 12px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  transition: background .15s, border-color .15s;
}
.nav-chat-btn:hover {
  background: var(--bg-hover);
  border-color: var(--accent);
}

.chat-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 998;
}
.chat-overlay.show { display: block; }

.chat-panel {
  position: fixed;
  top: 0;
  right: -400px;
  width: 400px;
  height: 100vh;
  background: var(--bg);
  border-left: 1px solid var(--border);
  z-index: 999;
  display: flex;
  flex-direction: column;
  transition: right .3s cubic-bezier(.4,0,.2,1);
  box-shadow: -4px 0 24px rgba(0,0,0,.3);
}
.chat-panel.open { right: 0; }

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
  flex-shrink: 0;
}
.chat-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}
.chat-header-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}
.chat-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}
.chat-quota {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  background: var(--bg);
  padding: 2px 8px;
  border-radius: 10px;
}
.chat-quota-low {
  color: var(--descanse);
  background: rgba(255,59,48,.1);
}
.chat-close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 22px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}
.chat-close:hover { color: var(--text); }

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chat-welcome {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 32px 16px;
  gap: 16px;
}
.chat-welcome-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(232,93,4,.1);
  display: flex;
  align-items: center;
  justify-content: center;
}
.chat-welcome-text {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
  max-width: 280px;
}
.chat-suggestions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  max-width: 300px;
}
.chat-suggestion {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 12px;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: border-color .15s, background .15s;
}
.chat-suggestion:hover {
  border-color: var(--accent);
  background: var(--bg-hover);
}

.chat-msg {
  display: flex;
}
.chat-msg-user { justify-content: flex-end; }
.chat-msg-assistant { justify-content: flex-start; }

.chat-bubble {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.chat-bubble-user {
  background: var(--accent);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.chat-bubble-assistant {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  border-bottom-left-radius: 4px;
}

.chat-msg-enter {
  animation: chatSlideIn .25s ease-out;
}
@keyframes chatSlideIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Typing indicator */
.chat-typing {
  display: flex;
  gap: 4px;
  padding: 12px 16px;
}
.chat-typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted);
  animation: chatDot 1.2s infinite ease-in-out;
}
.chat-typing span:nth-child(2) { animation-delay: .2s; }
.chat-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes chatDot {
  0%, 80%, 100% { opacity: .3; transform: scale(.8); }
  40% { opacity: 1; transform: scale(1); }
}

.chat-input-wrap {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  background: var(--bg-card);
  flex-shrink: 0;
}
.chat-input {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 14px;
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  resize: none;
  outline: none;
  max-height: 100px;
  line-height: 1.5;
}
.chat-input:focus { border-color: var(--accent); }
.chat-input:disabled {
  opacity: .4;
  cursor: not-allowed;
}
.chat-send {
  background: var(--accent);
  border: none;
  border-radius: 10px;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #fff;
  flex-shrink: 0;
  transition: opacity .15s;
}
.chat-send:hover { opacity: .85; }
.chat-send:disabled { opacity: .3; cursor: not-allowed; }

.chat-limit-bar {
  padding: 10px 16px;
  background: rgba(255,59,48,.08);
  border-top: 1px solid rgba(255,59,48,.2);
  font-size: 11px;
  color: var(--descanse);
  text-align: center;
  font-weight: 600;
  flex-shrink: 0;
}

/* Mobile chat */
@media (max-width: 768px) {
  .chat-panel {
    width: 100%;
    right: -100%;
  }
  .nav-chat-label { display: none; }
  .nav-chat-btn { padding: 5px 8px; }
}

/* ═══════════════════════════════════════════════════════════════════════════════
   BIOFEEDBACK STATUS STRIP — Norwegian-Altini Method
   Visual priority over TSB: positioned at top of dashboard
   ═══════════════════════════════════════════════════════════════════════════════ */
.bio-status-strip {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  position: relative;
  overflow: hidden;
}
.bio-status-strip::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
}
.bio-green::before { background: var(--execute); }
.bio-yellow::before { background: var(--modifique); }
.bio-red::before { background: var(--descanse); }
.bio-red { border-color: rgba(255,59,48,.3); }
.bio-yellow { border-color: rgba(255,149,0,.3); }
.bio-green { border-color: rgba(52,199,89,.2); }

.bio-status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 120px;
}
.bio-dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}
.bio-dot-green { background: var(--execute); box-shadow: 0 0 8px rgba(52,199,89,.4); }
.bio-dot-yellow { background: var(--modifique); box-shadow: 0 0 8px rgba(255,149,0,.4); animation: pulse-yellow 2s infinite; }
.bio-dot-red { background: var(--descanse); box-shadow: 0 0 12px rgba(255,59,48,.5); animation: pulse-red 1.5s infinite; }
@keyframes pulse-red { 0%,100% { box-shadow: 0 0 8px rgba(255,59,48,.3); } 50% { box-shadow: 0 0 16px rgba(255,59,48,.6); } }
@keyframes pulse-yellow { 0%,100% { box-shadow: 0 0 6px rgba(255,149,0,.2); } 50% { box-shadow: 0 0 12px rgba(255,149,0,.4); } }

.bio-status-label {
  font-size: .75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .1em;
}
.bio-green .bio-status-label { color: var(--execute); }
.bio-yellow .bio-status-label { color: var(--modifique); }
.bio-red .bio-status-label { color: var(--descanse); }

.bio-status-metrics {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}
.bio-metric {
  font-size: .75rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.bio-metric strong { color: var(--text); font-weight: 700; }
.bio-metric-muted { opacity: .6; }
.bio-metric-red { color: var(--descanse); font-weight: 600; }
.bio-metric-yellow { color: var(--modifique); font-weight: 600; }

.bio-insight-text {
  font-size: .8rem;
  color: var(--muted);
  line-height: 1.5;
  width: 100%;
  margin-top: 4px;
  padding-left: 20px;
}
.bio-red .bio-insight-text { color: rgba(255,59,48,.85); }
.bio-yellow .bio-insight-text { color: rgba(255,149,0,.85); }

/* ── Positive Reinforcement Banner ──────────────────────────────────────────── */
.reinforcement-banner {
  background: linear-gradient(135deg, rgba(52,199,89,.08), rgba(52,199,89,.02));
  border: 1px solid rgba(52,199,89,.2);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: .85rem;
  color: var(--execute);
  font-weight: 600;
}
.reinforcement-banner svg { flex-shrink: 0; stroke: var(--execute); }

/* ═══════════════════════════════════════════════════════════════════════════════
   ROAD TO GLORY — Event countdown + Peak Performance Probability
   ═══════════════════════════════════════════════════════════════════════════════ */
.rtg-card {
  background: linear-gradient(135deg, var(--bg-card) 0%, rgba(232,93,4,.04) 100%);
  border: 1px solid var(--border);
}
.rtg-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 16px;
}
.rtg-event-name {
  font-size: .85rem;
  color: var(--accent);
  font-weight: 700;
}
.rtg-body {
  display: grid;
  grid-template-columns: auto 1fr 1fr;
  gap: 24px;
  align-items: center;
}
.rtg-countdown {
  text-align: center;
}
.rtg-days-num {
  font-size: 3rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.rtg-days-label {
  display: block;
  font-size: .6rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--muted);
  margin-top: 4px;
}
.rtg-probability {
  text-align: center;
}
.rtg-prob-ring {
  width: 64px; height: 64px;
  position: relative;
  margin: 0 auto 8px;
}
.rtg-prob-ring svg {
  width: 100%; height: 100%;
}
.rtg-prob-num {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-size: 1rem;
  font-weight: 800;
}
.rtg-prob-label {
  font-size: .7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.rtg-prob-subtitle {
  font-size: .6rem;
  color: var(--muted);
  margin-top: 2px;
}
.rtg-factors {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.rtg-factor {
  display: flex;
  align-items: center;
  gap: 8px;
}
.rtg-factor-label {
  font-size: .65rem;
  color: var(--muted);
  width: 60px;
  text-align: right;
  font-weight: 600;
}
.rtg-factor-bar {
  flex: 1;
  height: 6px;
  background: #2C2C2C;
  border-radius: 3px;
  overflow: hidden;
}
.rtg-factor-fill {
  height: 100%;
  border-radius: 3px;
  transition: width .6s ease;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   GAMIFICATION STRIP — Consistency Score + Badges
   ═══════════════════════════════════════════════════════════════════════════════ */
.gamif-strip {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}
.gamif-consistency {
  display: flex;
  align-items: center;
  gap: 12px;
}
.gamif-score-ring {
  width: 48px; height: 48px;
  position: relative;
  flex-shrink: 0;
}
.gamif-score-ring svg { width: 100%; height: 100%; }
.gamif-score-num {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-size: .85rem;
  font-weight: 800;
  color: var(--text);
}
.gamif-score-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.gamif-score-detail {
  font-size: .75rem;
  color: var(--muted);
}
.gamif-intel-pts {
  font-size: .7rem;
  color: var(--accent);
  font-weight: 700;
}
.gamif-badges {
  margin-left: auto;
}
.gamif-badge-list {
  display: flex;
  gap: 8px;
}
.gamif-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: .7rem;
  font-weight: 700;
  border: 1px solid transparent;
}
.gamif-badge-gold {
  background: rgba(212,175,55,.08);
  border-color: rgba(212,175,55,.3);
  color: #D4AF37;
}
.gamif-badge-gold svg { stroke: #D4AF37; }
.gamif-badge-platinum {
  background: rgba(229,228,226,.06);
  border-color: rgba(229,228,226,.25);
  color: #E5E4E2;
}
.gamif-badge-platinum svg { stroke: #E5E4E2; }
.gamif-badge-name { white-space: nowrap; }

/* ═══════════════════════════════════════════════════════════════════════════════
   GOLD / PLATINUM CARD GLOW — Session conformity ±5% / ±10%
   ═══════════════════════════════════════════════════════════════════════════════ */
.card-gold {
  border-color: rgba(212,175,55,.35) !important;
  box-shadow: 0 0 12px rgba(212,175,55,.1), inset 0 0 20px rgba(212,175,55,.03);
}
.card-gold::after {
  content: '';
  position: absolute;
  top: 8px; right: 12px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #D4AF37;
  box-shadow: 0 0 6px rgba(212,175,55,.5);
}
.card-platinum {
  border-color: rgba(229,228,226,.3) !important;
  box-shadow: 0 0 16px rgba(229,228,226,.08), inset 0 0 24px rgba(229,228,226,.03);
}
.card-platinum::after {
  content: '';
  position: absolute;
  top: 8px; right: 12px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #E5E4E2;
  box-shadow: 0 0 8px rgba(229,228,226,.6);
}
.review-card { position: relative; }
.rest-day-card {
  border-left: 3px solid var(--execute);
}

/* ═══════════════════════════════════════════════════════════════════════════════
   WEEKLY RECAP CARD
   ═══════════════════════════════════════════════════════════════════════════════ */
.weekly-recap-card {
  border-left: 3px solid var(--accent);
}
.recap-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 1rem;
}
.recap-stat { text-align: center; }
.recap-stat-num {
  font-size: 1.5rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}
.recap-stat-label {
  font-size: .7rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .06em;
}
.recap-stat-detail {
  font-size: .7rem;
  color: var(--muted);
  margin-top: 2px;
}
.recap-bar-bg {
  height: 6px;
  background: var(--bg-inset);
  border-radius: 3px;
  overflow: hidden;
}
.recap-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width .5s ease;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   RESPONSIVE — Biofeedback + Gamification mobile
   ═══════════════════════════════════════════════════════════════════════════════ */
@media (max-width: 600px) {
  .bio-status-strip { flex-direction: column; align-items: flex-start; padding-left: 24px; }
  .bio-status-metrics { gap: 8px; }
  .rtg-body { grid-template-columns: 1fr 1fr; gap: 16px; }
  .rtg-countdown { grid-column: 1 / -1; }
  .gamif-strip { flex-direction: column; align-items: flex-start; }
  .gamif-badges { margin-left: 0; }
  .gamif-badge-list { flex-wrap: wrap; }
}

/* ═══════════════════════════════════════════════════════════════════════════════
   RESPONSIVE — Navigation links (hide text on very small screens)
   ═══════════════════════════════════════════════════════════════════════════════ */
@media (max-width: 480px) {
  .nav-links { gap: .35rem; }
  .nav-links a { font-size: .7rem; padding: .2rem .35rem; }
  .nav-user { gap: .35rem; }
  .nav-username { font-size: .75rem; }
  .nav-logout { font-size: .65rem; }
  .nav-avatar { width: 24px; height: 24px; }
  .lang-switcher { gap: .15rem; }
  .lang-flag { font-size: .8rem; padding: .1rem; }
  .nav-chat-label { display: none; }
}

/* ═══════════════════════════════════════════════════════════════════════════════
   RESPONSIVE — Tables (history, zones)
   ═══════════════════════════════════════════════════════════════════════════════ */
@media (max-width: 600px) {
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .table-wrap table { min-width: 500px; }
  .recap-grid { grid-template-columns: 1fr 1fr; }
  .zones-grid .zone-row { grid-template-columns: 1fr auto; }
  .zones-grid .zone-desc { display: none; }
}

/* ── Activity Feed ────────────────────────────────────────────────────────── */

.feed {
  max-width: 640px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.feed-count {
  font-size: .82rem;
  color: var(--muted);
  font-weight: 500;
}

.feed-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

/* Header */
.feed-header {
  display: flex;
  align-items: center;
  padding: .875rem 1rem;
  gap: .75rem;
}

.feed-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
}

.feed-avatar-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
  font-size: .875rem;
}

.feed-meta {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.feed-athlete {
  font-weight: 600;
  font-size: .875rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.feed-datetime {
  font-size: .75rem;
  color: var(--muted);
}

.feed-sport-badge {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: .7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
  background: var(--bg-hover);
  border-radius: 20px;
  padding: .25rem .65rem;
  white-space: nowrap;
}

.feed-sport-badge svg { opacity: .8; }

/* Title */
.feed-title {
  display: block;
  padding: 0 1rem .5rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  line-height: 1.3;
}
.feed-title:hover { color: var(--accent); }

/* Stats grid */
.feed-stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 0;
  padding: 0 1rem .75rem;
  border-bottom: 1px solid var(--border);
}

.feed-stat {
  display: flex;
  flex-direction: column;
  padding: .5rem .25rem;
}

.feed-stat-label {
  font-size: .65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--muted);
  margin-bottom: .15rem;
}

.feed-stat-value {
  font-size: .95rem;
  font-weight: 700;
  color: var(--text);
}

/* Media (map + photo) */
.feed-media {
  position: relative;
  min-height: 200px;
}

.feed-media:not(.feed-media-split) .feed-map {
  height: 250px;
}

.feed-media:not(.feed-media-split) .feed-photo-wrap {
  max-height: 500px;
}

.feed-media-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: stretch;
}

.feed-media-split .feed-photo-wrap {
  position: relative;
}

.feed-media-split .feed-photo {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.feed-map {
  background: var(--bg-inset);
}

.feed-photo-wrap {
  overflow: hidden;
  background: var(--bg-inset);
  min-height: 250px;
}

.feed-photo {
  width: 100%;
  display: block;
}

/* Footer */
.feed-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .625rem 1rem;
}

.feed-reactions {
  display: flex;
  align-items: center;
  gap: .75rem;
}

.feed-kudos {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  font-size: .8rem;
  font-weight: 600;
  color: var(--accent);
}

.feed-links {
  display: flex;
  align-items: center;
  gap: .75rem;
}

.feed-strava-link {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  font-size: .75rem;
  font-weight: 600;
  color: var(--muted);
  transition: color .15s;
}
.feed-strava-link:hover { color: var(--accent); }

/* Responsive */
@media (max-width: 680px) {
  .feed { max-width: 100%; }

  .feed-stats {
    grid-template-columns: repeat(3, 1fr);
  }

  .feed-media-split { grid-template-columns: 1fr; }
  .feed-media .feed-map { min-height: 160px; }
}

@media (max-width: 400px) {
  .feed-stats {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ── Route Suggestion ────────────────────────────────────────────────────────── */
.route-card {
  padding: 8px 12px;
  background: var(--bg-inset);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
}
.route-name {
  font-size: .85rem;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.route-link {
  font-size: .8rem;
  color: var(--accent);
  text-decoration: none;
  flex-shrink: 0;
}
.route-meta {
  font-size: .72rem;
  color: var(--muted);
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.terrain-badge {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 10px;
  font-size: .65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.terrain-flat        { background: rgba(52,199,89,.15); color: var(--execute); }
.terrain-rolling     { background: rgba(0,132,255,.15); color: var(--base-clr); }
.terrain-hilly       { background: rgba(255,149,0,.15); color: var(--modifique); }
.terrain-mountainous { background: rgba(191,90,242,.15); color: var(--taper-clr); }

.day-route-hint {
  font-size: .62rem;
  color: var(--muted);
  margin-top: 6px;
  padding-top: 5px;
  border-top: 1px dashed var(--border);
  display: flex;
  align-items: center;
  gap: 4px;
  opacity: .7;
}

/* ── Utility ─────────────────────────────────────────────────────────────────── */
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.flex  { display: flex; }
.gap-1 { gap: .5rem; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
