:root {
  --bg-dark: #0b0f14;
  --bg-card: #111720;
  --bg-card-hover: #141c28;

  --accent-blue: #3ecbff;
  --accent-orange: #ff9f43;
  --accent-purple: #7a6cff;

  --text-main: #ffffff;
  --text-muted: #7a8599;

  --border: rgba(255, 255, 255, 0.07);

  --header-h: 56px;
  --sidebar-w: 210px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: "Inter", system-ui, sans-serif;
}

body {
  background: var(--bg-dark);
  color: var(--text-main);
  display: grid;
  grid-template-rows: var(--header-h) 1fr;
  grid-template-columns: var(--sidebar-w) 1fr;
  height: 100vh;
  overflow: hidden;
}

.muted {
  color: var(--text-muted);
}

a {
  text-decoration: none;
  color: inherit;
}

/* ======================================
   TOP BAR
====================================== */

.dash-header {
  grid-column: 1 / -1;
  grid-row: 1;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0 1.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-dark);
  z-index: 50;
}

.dash-header-logo {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 700;
  font-size: 1rem;
  flex-shrink: 0;
}

.dash-header-logo img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.dash-header-divider {
  width: 1px;
  height: 18px;
  background: var(--border);
  flex-shrink: 0;
}

.dash-header-label {
  font-size: 0.9rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

.dash-beta {
  font-size: 0.7rem;
  background: rgba(255, 159, 67, 0.15);
  color: var(--accent-orange);
  border: 1px solid rgba(255, 159, 67, 0.3);
  padding: 2px 6px;
  border-radius: 4px;
  vertical-align: middle;
  margin-left: 4px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.dash-header-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* ======================================
   SIDEBAR
====================================== */

.sidebar {
  grid-column: 1;
  grid-row: 2;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 1.5rem 0;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 0.75rem;
  flex: 1;
}

.sidebar-link {
  display: block;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  font-size: 0.875rem;
  color: var(--text-muted);
  transition: color 0.15s, background 0.15s;
}

.sidebar-link:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.04);
}

.sidebar-link.active {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.06);
  font-weight: 500;
}

.sidebar-bottom {
  border-top: 1px solid var(--border);
  margin-top: 1rem;
  padding: 0.75rem 0.75rem 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-recap-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  font-size: 0.8rem;
  color: var(--accent-blue);
  background: none;
  border: none;
  cursor: pointer;
  width: 100%;
  text-align: left;
  transition: color 0.15s, background 0.15s;
}
.sidebar-recap-btn:hover { background: rgba(62,203,255,0.06); }
.sidebar-recap-btn svg { flex-shrink: 0; }
.sidebar-recap-hidden { display: none; }

/* Recap countdown widget */
.recap-status-widget {
  margin: 0 0.35rem 0.25rem;
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
}
.recap-status-header {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.3rem;
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.recap-status-msg {
  font-size: 0.78rem;
  color: var(--text-main);
  font-weight: 500;
}
.recap-status-bar-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
}
.recap-status-bar-track {
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: rgba(255,255,255,0.08);
  overflow: hidden;
}
.recap-status-bar-fill {
  height: 100%;
  border-radius: 2px;
  background: var(--accent-blue);
  transition: width 0.4s ease;
}
.recap-status-bar-label {
  font-size: 0.68rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.sidebar-settings-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  font-size: 0.875rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s, background 0.15s;
}
.sidebar-settings-link:hover {
  color: var(--text-main);
  background: rgba(255,255,255,0.04);
}
.sidebar-settings-link svg { flex-shrink: 0; }

.sidebar-admin-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  font-size: 0.875rem;
  color: var(--accent-orange);
  text-decoration: none;
  transition: color 0.15s, background 0.15s;
  opacity: 0.75;
}
.sidebar-admin-link:hover {
  opacity: 1;
  background: rgba(255, 159, 67, 0.08);
}
.sidebar-admin-link svg { flex-shrink: 0; }

.sidebar-back {
  display: block;
  padding: 0.5rem 0.75rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  transition: color 0.15s;
  border-radius: 8px;
}

.sidebar-back:hover {
  color: var(--text-main);
}

/* ======================================
   MAIN CONTENT
====================================== */

.dash-main {
  grid-column: 2;
  grid-row: 2;
  overflow-y: auto;
  padding: 2.5rem 2.5rem 6rem;
  scroll-behavior: smooth;
}

/* ======================================
   SECTIONS
====================================== */

.dash-section {
  padding-bottom: 4rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4rem;
}

.dash-section:last-child {
  border-bottom: none;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.75rem;
}

.section-header h2 {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 0.2rem;
  letter-spacing: -0.01em;
}

.section-header p {
  font-size: 0.875rem;
}

.welcome-text {
  font-size: 1.05rem;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.65);
  margin-top: 8px;
  max-width: 620px;
}

/* ======================================
   WEEKLY VOLUME STRIP
====================================== */

.vol-strip {
  display: flex;
  align-items: flex-end;
  gap: 1rem;
  padding: 1rem 0 0.25rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.25rem;
}

.vol-strip-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  white-space: nowrap;
  padding-bottom: 4px;
}

.vol-strip-bars {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 40px;
  flex: 1;
}

.vol-bar-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  gap: 3px;
  cursor: default;
}

.vol-bar {
  width: 100%;
  background: rgba(255,255,255,0.1);
  border-radius: 2px 2px 0 0;
  transition: background 0.2s;
  min-height: 2px;
}

.vol-bar-current {
  background: var(--accent-blue);
}

.vol-bar-wrap:hover .vol-bar { background: rgba(255,255,255,0.22); }
.vol-bar-wrap:hover .vol-bar-current { background: #6dd9ff; }

.vol-bar-label {
  font-size: 0.6rem;
  color: var(--text-muted);
  opacity: 0.6;
  height: 10px;
  line-height: 1;
}

.vol-strip-stat {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  padding-bottom: 14px;
  white-space: nowrap;
}

.vol-stat-main {
  font-size: 0.9rem;
  font-weight: 600;
}

.vol-stat-label {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.vol-stat-change,
.vol-stat-avg {
  font-size: 0.72rem;
}

.section-subheader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 2rem 0 1rem;
}

.section-subheader h3 {
  font-size: 1rem;
  font-weight: 600;
}

/* ======================================
   BUTTONS
====================================== */

.btn {
  padding: 0.7rem 1.1rem;
  border-radius: 8px;
  border: none;
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  transition: 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.btn-small {
  padding: 0.45rem 0.85rem;
  font-size: 0.8rem;
}

.btn-primary {
  background: var(--accent-blue);
  color: #0b0f14;
}

.btn-primary:hover {
  background: #5cd4ff;
}

.btn-secondary {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-main);
}

.btn-secondary:hover {
  border-color: rgba(255, 255, 255, 0.15);
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.btn-ghost:hover {
  color: var(--text-main);
  border-color: rgba(255, 255, 255, 0.15);
}

.premBtn {
  display: none;
  visibility: hidden;
}

#upgradeBtn {
  display: none;
  visibility: hidden;
}

/* ======================================
   USER INFO
====================================== */

.dash-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border);
}

.dash-user-info {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}

.dash-user-info strong {
  font-size: 0.875rem;
}

.user-tier-badge {
  display: inline-block;
  padding: 0.1rem 0.45rem;
  border-radius: 20px;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  vertical-align: middle;
  margin-top: 0.2rem;
  width: fit-content;
}
.user-tier-pro {
  background: rgba(62, 203, 255, 0.12);
  color: var(--accent);
  border: 1px solid rgba(62, 203, 255, 0.3);
}
.user-tier-free {
  background: rgba(255,255,255,0.05);
  color: var(--text-muted);
  border: 1px solid rgba(255,255,255,0.1);
}

.dash-user-info .muted {
  font-size: 0.75rem;
}

/* ======================================
   GRID & CARDS
====================================== */

.dash-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.dash-grid > *,
.ti-grid > * {
  min-width: 0;
}

.dash-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.4rem;
}

.label {
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.65rem;
}

.big {
  font-size: 1.9rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
}

.sub {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-top: 0.5rem;
  line-height: 1.4;
}

/* ======================================
   PILLS
====================================== */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  font-size: 0.8rem;
  background: rgba(62, 203, 255, 0.08);
  border: 1px solid rgba(62, 203, 255, 0.2);
  margin-top: 0.35rem;
}

/* ======================================
   TABLES
====================================== */

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

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  padding: 0.6rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  text-align: left;
  font-size: 0.875rem;
}

.table th {
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: rgba(255,255,255,0.015);
}

.table tbody tr:last-child td { border-bottom: none; }

/* Left accent bar per workout type */
.table tbody tr td:first-child { border-left: 3px solid transparent; transition: border-color 0.2s; }
.table tbody tr[data-wtype="PUSH"]    td:first-child { border-left-color: rgba(62,203,255,0.7); }
.table tbody tr[data-wtype="PULL"]    td:first-child { border-left-color: rgba(122,108,255,0.7); }
.table tbody tr[data-wtype="LEGS"]    td:first-child { border-left-color: rgba(255,159,67,0.7); }
.table tbody tr[data-wtype="CARDIO"]  td:first-child { border-left-color: rgba(74,222,128,0.7); }
.table tbody tr[data-wtype="GENERAL"] td:first-child { border-left-color: rgba(255,255,255,0.15); }

/* Hover */
.table tr:hover td {
  background: rgba(255,255,255,0.028);
}
.table tbody tr:hover td:first-child { filter: brightness(1.2); }

/* Date cell */
.rw-date-cell { white-space: nowrap; }
.rw-weekday {
  display: block;
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--text-main);
}
.rw-datestr {
  display: block;
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 1px;
}

/* Summary cell */
.rw-summary {
  color: var(--text-muted);
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Stats chips */
.rw-stats-cell { white-space: nowrap; }
.rw-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.5rem;
  border-radius: 5px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-right: 0.35rem;
}
.rw-chip-vol  { background: rgba(62,203,255,0.08);  color: var(--accent-blue); }
.rw-chip-dur  { background: rgba(255,255,255,0.05); color: var(--text-muted); font-weight: 500; }
.rw-chip-kcal { background: rgba(255,159,67,0.08);  color: var(--accent-orange); }
.rw-chip-est  { opacity: 0.7; }

/* Type pill colours */
.pill-type-push    { background: rgba(62,203,255,0.1);  border-color: rgba(62,203,255,0.25);  color: var(--accent-blue); }
.pill-type-pull    { background: rgba(122,108,255,0.1); border-color: rgba(122,108,255,0.25); color: var(--accent-purple); }
.pill-type-legs    { background: rgba(255,159,67,0.1);  border-color: rgba(255,159,67,0.25);  color: var(--accent-orange); }
.pill-type-cardio  { background: rgba(74,222,128,0.1);  border-color: rgba(74,222,128,0.25);  color: #4ade80; }
.pill-type-general { background: rgba(255,255,255,0.05); border-color: rgba(255,255,255,0.1); color: var(--text-muted); }

/* ======================================
   INPUTS & SELECTS
====================================== */

.dash-input {
  width: 100%;
  background: var(--bg-dark);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.6rem 0.9rem;
  color: var(--text-main);
  font-size: 0.875rem;
  outline: none;
  transition: border-color 0.15s;
}

.dash-input:focus {
  border-color: rgba(62, 203, 255, 0.4);
}

.dash-input::placeholder {
  color: var(--text-muted);
}

.dash-select {
  background: var(--bg-dark);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem 0.85rem;
  color: var(--text-main);
  font-size: 0.875rem;
  cursor: pointer;
  outline: none;
}

/* ======================================
   CHARTS
====================================== */

canvas {
  margin-top: 12px;
}

/* ======================================
   HEATMAP
====================================== */

.heatmap-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.heatmap-stats {
  display: flex;
  align-items: center;
  gap: 20px;
}

/* Consistency score block */
.heat-score-block {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
}
.heat-score-row {
  display: flex;
  align-items: baseline;
  gap: 5px;
}
.heat-score-val {
  font-size: 1.35rem;
  font-weight: 800;
  color: #fff;
  line-height: 1;
}
.heat-score-pct {
  font-size: 0.85rem;
  font-weight: 600;
  opacity: 0.6;
}
.heat-score-trend {
  font-size: 1rem;
  font-weight: 800;
  line-height: 1;
}
.heat-trend-up   { color: #4ade80; }
.heat-trend-down { color: #f87171; }
.heat-trend-flat { color: rgba(255,255,255,0.3); }
.heat-score-sub {
  font-size: 0.65rem;
  color: rgba(255,255,255,0.35);
  letter-spacing: 0.03em;
}

/* Streak block */
.heat-streak-block {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
  border-left: 1px solid rgba(255,255,255,0.07);
  padding-left: 20px;
}
.heat-streak-val {
  font-size: 1.05rem;
  font-weight: 700;
  color: rgba(255,255,255,0.8);
  line-height: 1;
}
.heat-streak-lbl {
  font-size: 0.65rem;
  color: rgba(255,255,255,0.35);
  letter-spacing: 0.03em;
}
.heat-streak-fire .heat-streak-val { color: var(--accent-orange); }

.heatmap-months-row {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  margin-top: 12px;
}

.heatmap-months {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 13px;
  gap: 3px;
  font-size: 9px;
  color: rgba(255, 255, 255, 0.3);
  overflow: hidden;
}

.heatmap-months span {
  white-space: nowrap;
  overflow: visible;
}

.heatmap-labels-spacer {
  width: 28px; /* matches heatmap-labels width */
  flex-shrink: 0;
}

.heatmap-wrapper {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 3px;
  overflow-x: auto;
}

.heatmap-labels {
  display: grid;
  grid-template-rows: repeat(7, 13px);
  gap: 3px;
  font-size: 10px;
  color: var(--text-muted);
  padding-top: 1px;
  flex-shrink: 0;
}

.heatmap {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 13px;
  grid-template-rows: repeat(7, 13px);
  gap: 3px;
}

.heatmap-legend {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 10px;
}

.heat-day {
  width: 13px;  /* overridden inline by JS */
  height: 13px; /* overridden inline by JS */
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.05);
  cursor: default;
  transition: transform 0.1s ease, opacity 0.1s ease;
}

.heat-day:hover { transform: scale(1.15); opacity: 0.85; }

.heat-l1 { background: rgba(62, 203, 255, 0.18); }
.heat-l2 { background: rgba(62, 203, 255, 0.38); }
.heat-l3 { background: rgba(62, 203, 255, 0.62); }
.heat-l4 { background: rgba(62, 203, 255, 0.88); }

.heat-today {
  box-shadow: 0 0 0 2px rgba(62, 203, 255, 0.7);
}

/* ======================================
   TRAINING INTELLIGENCE GRID
====================================== */

.ti-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.ti-grid > [data-span="2"] {
  grid-column: span 2;
}

.ti-grid > [data-span="4"] {
  grid-column: span 4;
}

/* ======================================
   METRICS
====================================== */

.metric {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.metric-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.metric-value {
  font-size: 1rem;
  font-weight: 600;
}

/* ======================================
   WEEKLY SUMMARY
====================================== */

.weekly-main {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.weekly-volume {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
}

.weekly-trend {
  font-size: 0.8rem;
}

.weekly-dots {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

.wdot-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.wdot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.wdot-active {
  background: rgba(62, 203, 255, 0.7);
  border-color: rgba(62, 203, 255, 0.5);
}

.wdot-today {
  outline: 2px solid rgba(62, 203, 255, 0.6);
  outline-offset: 2px;
}

.wdot-future {
  opacity: 0.25;
}

.wdot-label {
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.3);
}

.weekly-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

.weekly-spark-wrap {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

.weekly-spark {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 40px;
}

.spark-bar {
  flex: 1;
  border-radius: 3px 3px 0 0;
  background: rgba(62, 203, 255, 0.2);
  min-height: 3px;
  transition: height 0.4s ease;
  cursor: default;
}

.spark-bar-current {
  background: rgba(62, 203, 255, 0.65);
}

/* ======================================
   LOAD / FATIGUE
====================================== */

.load-main {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 12px;
}

.load-ratio {
  font-size: 3rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.04em;
  flex-shrink: 0;
}

.ratio-optimal    { color: #4ade80; }
.ratio-under      { color: #facc15; }
.ratio-caution    { color: #fb923c; }
.ratio-high       { color: #f87171; }

.load-status {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 3px 9px;
  border-radius: 999px;
  display: inline-block;
  margin-bottom: 5px;
}

.status-optimal { background: rgba(74,222,128,0.12);  color: #4ade80; border: 1px solid rgba(74,222,128,0.2); }
.status-under   { background: rgba(250,204,21,0.10);  color: #facc15; border: 1px solid rgba(250,204,21,0.2); }
.status-caution { background: rgba(251,146,60,0.12);  color: #fb923c; border: 1px solid rgba(251,146,60,0.25); }
.status-high    { background: rgba(248,113,113,0.10); color: #f87171; border: 1px solid rgba(248,113,113,0.2); }

.load-advice {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.45);
  line-height: 1.4;
  max-width: 180px;
}

/* Zone gauge */
.load-gauge-wrap {
  position: relative;
  margin: 18px 0 6px;
}

.load-gauge-track {
  display: flex;
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  gap: 2px;
}

.load-zone {
  height: 100%;
  border-radius: 999px;
}

/* 4 zones mapped to ratio 0–2.0:
   0–0.8   = 40%  undertrained
   0.8–1.3 = 25%  optimal
   1.3–1.5 = 10%  caution
   1.5–2.0 = 25%  danger  */
.lz-under   { width: 40%;  background: rgba(250,204,21,0.35); }
.lz-optimal { width: 25%;  background: rgba(74,222,128,0.50); }
.lz-caution { width: 10%;  background: rgba(251,146,60,0.50); }
.lz-danger  { width: 25%;  background: rgba(248,113,113,0.45); }

.load-needle {
  position: absolute;
  top: -4px;
  width: 3px;
  height: 16px;
  background: #fff;
  border-radius: 2px;
  transform: translateX(-50%);
  box-shadow: 0 0 6px rgba(255,255,255,0.5);
  transition: left 0.5s ease;
}

.load-gauge-labels {
  position: relative;
  display: flex;
  justify-content: space-between;
  font-size: 0.65rem;
  color: rgba(255,255,255,0.3);
  margin-top: 5px;
}

.load-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

/* ======================================
   MUSCLE INTEL
====================================== */

.balance-score-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.25rem;
}

.balance-score-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.balance-number {
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
}

.balance-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.balance-trend {
  font-size: 0.875rem;
  font-weight: 500;
}

.muscle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}

.muscle-bar {
  flex: 1;
  height: 7px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  overflow: hidden;
}

.muscle-bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.5s ease;
}

.muscle-name {
  font-size: 0.8rem;
  width: 80px;
  flex-shrink: 0;
  color: rgba(255, 255, 255, 0.7);
}

.muscle-vol {
  width: 56px;
  text-align: right;
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.35);
  flex-shrink: 0;
}

.muscle-percent {
  width: 44px;
  text-align: right;
  font-size: 0.78rem;
  font-weight: 700;
  flex-shrink: 0;
}

.muscle-up { background: linear-gradient(90deg, #4ade80, #22d3aa); }
.muscle-down { background: linear-gradient(90deg, #f87171, #fb923c); }
.muscle-neutral { background: rgba(255, 255, 255, 0.25); }

.muscle-percent.muscle-up    { background: none; color: #4ade80; }
.muscle-percent.muscle-down  { background: none; color: #f87171; }
.muscle-percent.muscle-neutral { background: none; color: rgba(255, 255, 255, 0.4); }

/* ======================================
   CARDIO CARD
====================================== */

.cardio-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.25rem;
}

.cardio-big {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
}

.cardio-hero-sub {
  font-size: 0.8rem;
  font-weight: 600;
  margin-left: 0.6rem;
}

.cardio-header-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5rem;
}

.cardio-activity-select {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  color: var(--text-main);
  font-size: 0.75rem;
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  cursor: pointer;
  outline: none;
}
.cardio-activity-select:hover { border-color: rgba(62,203,255,0.4); }
.cardio-activity-select option { background: #141921; }

.cardio-streak {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  background: rgba(255, 159, 67, 0.08);
  border: 1px solid rgba(255, 159, 67, 0.2);
  border-radius: 10px;
  padding: 0.6rem 1rem;
}

.cardio-streak-num {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent-orange);
  line-height: 1;
}

.cardio-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.25rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}

.cardio-prs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.25rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}

.cardio-pr-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.cardio-charts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1rem;
}

.cardio-chart-block {
  min-width: 0;
}

.cardio-insight {
  font-size: 0.82rem;
  line-height: 1.5;
}

/* Weekly volume chart header */
.vchart-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

.vchart-stats {
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.vchart-stat {
  font-size: 0.78rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.75);
  white-space: nowrap;
}

.vchart-stat-label {
  font-size: 0.68rem;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.35);
  margin-left: 2px;
}

.vchart-trend { font-size: 0.72rem; font-weight: 600; }
.vchart-up   { color: #4ade80; }
.vchart-down { color: #f87171; }

.score-high { color: #4ade80; }
.score-mid  { color: var(--accent-orange); }
.score-low  { color: #f87171; }

.muscle-breakdown {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-end;
}

.breakdown-item {
  display: flex;
  gap: 8px;
  align-items: baseline;
}

.breakdown-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  width: 32px;
}

.breakdown-val {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
}

.muscle-insight {
  margin-top: 14px;
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

/* ======================================
   RECOVERY CARD
====================================== */

/* Readiness headline */
.rec-readiness {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 14px;
}

.rec-readiness-score {
  font-size: 3rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  flex-shrink: 0;
}

.rec-readiness-unit {
  font-size: 1.4rem;
  font-weight: 600;
  opacity: 0.7;
}

.rec-readiness-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.rec-readiness-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.rec-readiness-line {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.5);
  line-height: 1.4;
}

.rec-ready-high { color: #4ade80; }
.rec-ready-mid  { color: var(--accent-orange); }
.rec-ready-low  { color: #f87171; }

.recovery-summary {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.rec-stat {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 4px;
  border-radius: 8px;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.rec-stat strong {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
}

.rec-fresh      { background: rgba(74, 222, 128, 0.08);  color: #4ade80; }
.rec-recovering { background: rgba(255, 159, 67, 0.08);  color: var(--accent-orange); }
.rec-fatigued   { background: rgba(248, 113, 113, 0.08); color: #f87171; }

.recovery-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.recovery-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.recovery-name {
  font-size: 0.8rem;
  width: 76px;
  flex-shrink: 0;
}

.rec-badge {
  font-size: 0.62rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 7px;
  border-radius: 4px;
  flex-shrink: 0;
  width: 74px;
  text-align: center;
}

.rec-badge-fresh      { background: rgba(74, 222, 128, 0.12);  color: #4ade80; }
.rec-badge-recovering { background: rgba(255, 159, 67, 0.12);  color: var(--accent-orange); }
.rec-badge-fatigued   { background: rgba(248, 113, 113, 0.12); color: #f87171; }

/* Recovery grouped layout */
.recovery-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rec-item {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.rec-item-top {
  display: flex;
  align-items: center;
  gap: 8px;
}

.rec-item-name {
  font-size: 0.82rem;
  flex: 1;
}

.rec-item-pct {
  font-size: 0.75rem;
  font-weight: 700;
  min-width: 34px;
  text-align: right;
}

.rec-pct-fresh      { color: #4ade80; }
.rec-pct-recovering { color: var(--accent-orange); }
.rec-pct-fatigued   { color: #f87171; }

.rec-item-time {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.3);
  min-width: 44px;
  text-align: right;
}

.rec-ready-in {
  font-size: 0.68rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  padding: 1px 5px;
  white-space: nowrap;
}

.rec-ready-now {
  color: #4ade80;
  background: rgba(74, 222, 128, 0.08);
  border-color: rgba(74, 222, 128, 0.2);
}

.rec-bar-track {
  height: 4px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  overflow: hidden;
}

.rec-bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.5s ease;
}

/* ======================================
   ONBOARDING
====================================== */

.ob-overlay {
  position: fixed;
  inset: 0;
  background: rgba(7, 10, 15, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 8000;
  padding: 1rem;
  transition: opacity 0.35s ease;
}

.ob-overlay.ob-hidden {
  display: none;
}

.ob-modal {
  background: #111820;
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 20px;
  width: 100%;
  max-width: 480px;
  padding: 2rem 2.25rem 2.25rem;
  position: relative;
  overflow: hidden;
}

/* progress bar */
.ob-progress-track {
  height: 3px;
  background: rgba(255,255,255,0.08);
  border-radius: 3px;
  margin-bottom: 1.75rem;
  overflow: hidden;
}

.ob-progress-fill {
  height: 100%;
  background: var(--accent-blue);
  border-radius: 3px;
  transition: width 0.45s cubic-bezier(0.4, 0, 0.2, 1);
  width: 0%;
}

/* skip */
.ob-skip-btn {
  position: absolute;
  top: 1.25rem;
  right: 1.5rem;
  background: none;
  border: none;
  color: rgba(255,255,255,0.3);
  font-size: 0.78rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: color 0.2s;
}

.ob-skip-btn:hover { color: rgba(255,255,255,0.6); }

/* step container */
.ob-step {
  animation: ob-slide-in 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.ob-step.ob-slide-out {
  animation: ob-slide-out 0.25s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes ob-slide-in {
  from { opacity: 0; transform: translateX(28px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes ob-slide-out {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(-28px); }
}

/* step icon */
.ob-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: rgba(62, 203, 255, 0.1);
  border: 1px solid rgba(62, 203, 255, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
}

.ob-icon svg { width: 24px; height: 24px; }

.ob-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: #fff;
  margin: 0 0 0.35rem;
  line-height: 1.3;
}

.ob-sub {
  font-size: 0.83rem;
  color: rgba(255,255,255,0.4);
  margin: 0 0 1.75rem;
}

/* text input */
.ob-input {
  width: 100%;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  color: #fff;
  font-size: 1rem;
  padding: 0.75rem 1rem;
  outline: none;
  transition: border-color 0.2s;
  box-sizing: border-box;
  margin-bottom: 1.5rem;
}

.ob-input:focus { border-color: var(--accent-blue); }
.ob-input::placeholder { color: rgba(255,255,255,0.2); }

/* number inputs side by side */
.ob-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.ob-field-label {
  font-size: 0.72rem;
  color: rgba(255,255,255,0.4);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 0.35rem;
}

/* option cards */
.ob-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  margin-bottom: 1.5rem;
}

.ob-options.ob-options-col {
  grid-template-columns: 1fr;
}

.ob-option {
  background: rgba(255,255,255,0.04);
  border: 1.5px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 0.9rem 1rem;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.15s;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.ob-option:hover {
  border-color: rgba(62, 203, 255, 0.35);
  background: rgba(62, 203, 255, 0.05);
  transform: translateY(-1px);
}

.ob-option.selected {
  border-color: var(--accent-blue);
  background: rgba(62, 203, 255, 0.1);
}

.ob-option:active { transform: scale(0.97); }

.ob-opt-label {
  font-size: 0.88rem;
  font-weight: 600;
  color: #fff;
}

.ob-opt-sub {
  font-size: 0.72rem;
  color: rgba(255,255,255,0.35);
}

.ob-option.selected .ob-opt-sub { color: rgba(62, 203, 255, 0.7); }

/* next / back buttons */
.ob-actions {
  display: flex;
  gap: 0.65rem;
  align-items: center;
}

.ob-next-btn {
  flex: 1;
  background: var(--accent-blue);
  color: #0b0f14;
  font-weight: 700;
  font-size: 0.9rem;
  border: none;
  border-radius: 10px;
  padding: 0.8rem 1.25rem;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s;
}

.ob-next-btn:hover { opacity: 0.88; transform: translateY(-1px); }
.ob-next-btn:active { transform: scale(0.97); }

.ob-back-btn {
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.5);
  border: none;
  border-radius: 10px;
  padding: 0.8rem 1rem;
  cursor: pointer;
  font-size: 0.85rem;
  transition: background 0.2s;
}

.ob-back-btn:hover { background: rgba(255,255,255,0.1); }

/* completion screen */
.ob-complete {
  text-align: center;
  padding: 0.5rem 0;
}

.ob-checkmark-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.ob-checkmark-circle {
  width: 72px;
  height: 72px;
}

.ob-checkmark-path {
  stroke-dasharray: 200;
  stroke-dashoffset: 200;
  animation: ob-check-draw 0.6s 0.2s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes ob-check-draw {
  to { stroke-dashoffset: 0; }
}

.ob-complete-title {
  font-size: 1.4rem;
  font-weight: 700;
  margin: 0 0 0.4rem;
}

.ob-complete-sub {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.4);
  margin: 0 0 1.75rem;
  line-height: 1.5;
}

.ob-summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-bottom: 1.75rem;
  text-align: left;
}

.ob-summary-item {
  background: rgba(255,255,255,0.04);
  border-radius: 10px;
  padding: 0.65rem 0.85rem;
}

.ob-summary-label {
  font-size: 0.68rem;
  color: rgba(255,255,255,0.35);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 2px;
}

.ob-summary-value {
  font-size: 0.9rem;
  font-weight: 600;
  color: #fff;
}

/* confetti particles */
.ob-confetti-wrap {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.ob-confetti-dot {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  animation: ob-confetti-fall 1.4s ease-in forwards;
  opacity: 0;
}

@keyframes ob-confetti-fall {
  0%   { opacity: 1; transform: translateY(0) rotate(0deg); }
  100% { opacity: 0; transform: translateY(260px) rotate(720deg); }
}

/* ======================================
   LOADING SCREEN
====================================== */

.dash-loader {
  position: fixed;
  inset: 0;
  background: var(--bg, #0b0f14);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.45s ease;
}

.dash-loader.hidden {
  opacity: 0;
  pointer-events: none;
}

.dash-loader-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.dash-loader-spinner {
  position: relative;
  width: 76px;
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dash-loader-spinner::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2.5px solid rgba(255, 255, 255, 0.07);
}

.dash-loader-spinner::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2.5px solid transparent;
  border-top-color: var(--accent-blue, #3ecbff);
  border-right-color: var(--accent-blue, #3ecbff);
  animation: loader-spin 0.85s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

@keyframes loader-spin {
  to { transform: rotate(360deg); }
}

.dash-loader-logo {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  object-fit: contain;
}

.dash-loader-name {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #fff;
  margin-top: 4px;
}

.dash-loader-sub {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.35);
  letter-spacing: 0.01em;
}

.dash-loader-bar-track {
  width: 160px;
  height: 2px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 6px;
}

.dash-loader-bar-fill {
  height: 100%;
  width: 0%;
  background: var(--accent-blue, #3ecbff);
  border-radius: 2px;
  transition: width 0.25s ease;
}

/* ======================================
   CARD SLIDE-IN
====================================== */

.dash-section {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.45s ease, transform 0.45s ease;
}

.dash-section.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ======================================
   LOCKED CARD STATE
====================================== */

.card-accuracy-banner {
  display: flex;
  flex-direction: column;
  gap: 7px;
  background: rgba(62, 203, 255, 0.05);
  border: 1px solid rgba(62, 203, 255, 0.15);
  border-radius: 8px;
  padding: 0.65rem 0.9rem;
  margin-bottom: 1.1rem;
}

.cab-text {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.cab-text strong {
  color: var(--accent-blue);
  font-weight: 600;
}

.cab-bar-track {
  position: relative;
  height: 4px;
  background: rgba(255, 255, 255, 0.07);
  border-radius: 2px;
  overflow: visible;
}

.cab-bar-fill {
  height: 100%;
  background: var(--accent-blue);
  border-radius: 2px;
  transition: width 0.6s ease;
}

.cab-bar-label {
  position: absolute;
  right: 0;
  top: -18px;
  font-size: 0.68rem;
  color: var(--text-muted);
}

/* Weakpoints embedded in muscle intel card */
.muscle-wp-section {
  display: flex;
  flex-direction: column;
}

.wp-divider {
  border-top: 1px solid rgba(255,255,255,0.07);
  margin: 14px 0 4px;
}

/* Weakpoints two-section layout */
.wp-list {
  display: flex;
  flex-direction: column;
}

.wp-section-label {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 14px;
  margin-bottom: 6px;
}

.wp-section-label:first-child { margin-top: 0; }

.wp-under { color: #f87171; }
.wp-over  { color: var(--accent-orange); }

.wp-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 7px;
}

.wp-muscle {
  font-size: 0.8rem;
  width: 72px;
  flex-shrink: 0;
}

.wp-bar-wrap {
  flex: 1;
  height: 3px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 2px;
  overflow: hidden;
}

.wp-bar { height: 100%; border-radius: 2px; }
.wp-bar-under { background: #f87171; }
.wp-bar-over  { background: var(--accent-orange); }

.wp-diff {
  font-size: 0.78rem;
  font-weight: 600;
  width: 44px;
  text-align: right;
  flex-shrink: 0;
}

.wp-vol {
  font-size: 0.7rem;
  width: 68px;
  text-align: right;
  flex-shrink: 0;
}

.wp-balanced {
  font-size: 0.82rem;
  color: #4ade80;
  padding: 16px 0 4px;
  text-align: center;
}

.recovery-time {
  font-size: 0.72rem;
  width: 40px;
  text-align: right;
  flex-shrink: 0;
}

/* ======================================
   INTEL LIST
====================================== */

.intel-list {
  margin-top: 12px;
}

.intel-divider {
  height: 1px;
  background: var(--border);
  margin: 14px 0;
}

.intel-description {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ======================================
   NUTRITION
====================================== */

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.5rem;
}

.nutrition-hero {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1.1rem 0 1.25rem;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.25rem;
}

.nutrition-hero-left {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  flex-shrink: 0;
  min-width: 130px;
}

.nutrition-kcal {
  font-size: 2.6rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
}

.nutrition-sub {
  font-size: 0.75rem;
}

.nutrition-adj-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 20px;
  margin-top: 0.2rem;
  width: fit-content;
}

.nutrition-bw-goal-tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.18rem 0.5rem;
  border-radius: 20px;
  margin-top: 0.35rem;
  width: fit-content;
  background: rgba(122, 108, 255, 0.15);
  color: var(--accent-purple, #7a6cff);
  border: 1px solid rgba(122, 108, 255, 0.25);
}

.nutrition-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem 1.25rem;
  flex: 1;
}

.nutrition-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nutrition-stat span {
  font-size: 0.72rem;
}

.nutrition-stat strong {
  font-size: 0.95rem;
}

.nutrition-no-profile {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: rgba(255, 159, 67, 0.08);
  border: 1px solid rgba(255, 159, 67, 0.2);
  border-radius: 8px;
  padding: 0.7rem 1rem;
  margin-bottom: 1rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.nutrition-profile-btn {
  background: var(--accent-orange);
  color: #000;
  border: none;
  border-radius: 6px;
  padding: 0.35rem 0.85rem;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.nutrition-breakdown {
  margin: 1.25rem 0;
  background: rgba(255,255,255,0.025);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.nb-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.nb-row span:last-child {
  font-weight: 600;
  color: var(--text);
}

.nutrition-insight {
  margin-top: 1rem;
  font-size: 0.825rem;
  line-height: 1.5;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  color: var(--text);
}

.nutrition-why {
  margin-top: 0.6rem;
  font-size: 0.78rem;
  line-height: 1.5;
}

.nutrition-bw-chart {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

/* Edit button on nutrition card */
.nutrition-edit-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 0.75rem;
  padding: 0.3rem 0.65rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.nutrition-edit-btn:hover {
  background: rgba(255,255,255,0.09);
  color: var(--text);
}

/* Nutrition edit modal */
.nem-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.nem-hidden { display: none !important; }

.nem-modal {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  width: 100%;
  max-width: 480px;
  overflow: hidden;
}

.nem-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.4rem;
  border-bottom: 1px solid var(--border);
}
.nem-title {
  font-size: 0.95rem;
  font-weight: 600;
}
.nem-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.3rem;
  cursor: pointer;
  line-height: 1;
  padding: 0;
}
.nem-close:hover { color: var(--text); }

.nem-body {
  padding: 1.2rem 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.nem-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.nem-field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.nem-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.nem-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.nem-opt {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 0.78rem;
  padding: 0.3rem 0.7rem;
  cursor: pointer;
  transition: all 0.15s;
}
.nem-opt:hover { background: rgba(255,255,255,0.08); color: var(--text); }
.nem-opt-active {
  background: rgba(62,203,255,0.12);
  border-color: var(--accent-blue);
  color: var(--accent-blue);
}

.nem-input {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 0.85rem;
  padding: 0.45rem 0.75rem;
  width: 100%;
  outline: none;
}
.nem-input:focus { border-color: var(--accent-blue); }

.nem-footer {
  padding: 1rem 1.4rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
}

.nem-save {
  background: var(--accent-blue);
  color: #000;
  border: none;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.55rem 1.4rem;
  cursor: pointer;
  transition: opacity 0.15s;
}
.nem-save:hover { opacity: 0.88; }
.nem-save:disabled { opacity: 0.5; cursor: not-allowed; }

.pr-stats {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.pr-stat .label {
  margin-bottom: 0.35rem;
}

/* ======================================
   LEADERBOARDS
====================================== */

/* ======================================
   LEADERBOARD
====================================== */

.lb-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.lb-tab {
  padding: 0.35rem 0.9rem;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.lb-tab:hover {
  color: var(--text-main);
  border-color: rgba(255,255,255,0.2);
}
.lb-tab-active {
  background: rgba(62,203,255,0.1);
  border-color: rgba(62,203,255,0.35);
  color: var(--accent-blue);
}

.lb-card {
  padding: 1.25rem 1.5rem;
}

.lb-subtitle {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.lb-loading, .lb-empty {
  color: var(--text-muted);
  font-size: 0.85rem;
  padding: 1.5rem 0;
  text-align: center;
}

.lb-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
}
.lb-row:last-child { border-bottom: none; }

.lb-row-top .lb-username { font-weight: 700; }

.lb-rank {
  font-size: 0.85rem;
  font-weight: 700;
  width: 24px;
  text-align: center;
  color: var(--text-muted);
  flex-shrink: 0;
}

.lb-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  flex-shrink: 0;
  object-fit: cover;
}

.lb-user {
  flex: 1;
  min-width: 0;
}
.lb-username {
  font-size: 0.85rem;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

.lb-value {
  font-size: 0.85rem;
  font-weight: 700;
  white-space: nowrap;
  color: var(--text-muted);
}

.lb-row-top .lb-value {
  color: inherit;
}

.leaderboard-controls {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 1rem;
}

/* ======================================
   TREND COLORS
====================================== */

.trend-up { color: #4ade80; }
.trend-down { color: #f87171; }
.trend-flat { color: var(--text-muted); }

.trend-arrow {
  margin-right: 4px;
  font-size: 0.8rem;
}

/* ======================================
   SKELETON
====================================== */

.skeleton {
  position: relative;
  overflow: hidden;
}

.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.04),
    transparent
  );
  transform: translateX(-100%);
  animation: shimmer 1.6s infinite;
}

@keyframes shimmer {
  100% { transform: translateX(100%); }
}

/* ======================================
   MODAL
====================================== */

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  backdrop-filter: blur(4px);
}

.modal-content {
  background: #0e1520;
  border: 1px solid var(--border);
  border-radius: 14px;
  width: 90%;
  max-width: 680px;
  max-height: 80vh;
  overflow-y: auto;
  padding: 1.75rem;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
}

.modal-header h3 {
  font-size: 1.1rem;
  font-weight: 600;
}

#closeModal {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.1rem;
  cursor: pointer;
  line-height: 1;
  transition: color 0.15s;
}

#closeModal:hover {
  color: var(--text-main);
}

.modal-header-btns {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.modal-hdr-btn {
  background: none;
  border: 1px solid rgba(255,255,255,0.12);
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.25rem 0.65rem;
  border-radius: 5px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.modal-hdr-btn:hover {
  border-color: rgba(255,255,255,0.3);
  color: var(--text-main);
}
.modal-hdr-btn-danger:hover {
  border-color: #f87171;
  color: #f87171;
}

/* View mode */
.modal-volume {
  margin-bottom: 1.1rem;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.workout-kcal-est {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 20px;
  background: rgba(255, 159, 67, 0.12);
  color: var(--accent-orange, #ff9f43);
  cursor: default;
  border: 1px solid rgba(255, 159, 67, 0.2);
  white-space: nowrap;
}

.modal-kcal-est {
  font-size: 0.75rem;
  padding: 0.18rem 0.55rem;
}

.kcal-est-approx {
  text-decoration: underline dotted rgba(255,159,67,0.5);
  text-underline-offset: 2px;
}

.modal-duration-pill {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-muted, #8b9ab1);
  border: 1px solid rgba(255,255,255,0.1);
  white-space: nowrap;
}
.modal-cardio-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem 1.5rem;
  margin-bottom: 0.25rem;
}
.modal-cardio-stat {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.modal-cardio-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.modal-cardio-val {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
}

.modal-ex-view {
  margin-bottom: 1rem;
}
.modal-ex-view-name {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.35rem;
}
.modal-set-view {
  font-size: 0.82rem;
  line-height: 1.6;
}

/* Edit mode */
.modal-ex-block {
  margin-bottom: 1.25rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.modal-ex-block:last-of-type {
  border-bottom: none;
}
.modal-ex-edit-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}
.modal-ex-name {
  flex: 1;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--text-main);
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.35rem 0.6rem;
  border-radius: 6px;
  outline: none;
}
.modal-ex-name:focus {
  border-color: var(--accent-blue);
}
.modal-rm-ex {
  background: none;
  border: 1px solid rgba(248,113,113,0.3);
  color: #f87171;
  font-size: 0.75rem;
  padding: 0.25rem 0.6rem;
  border-radius: 5px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}
.modal-rm-ex:hover {
  background: rgba(248,113,113,0.1);
}

.modal-sets-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 0.5rem;
}
.modal-set-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.modal-set-num {
  font-size: 0.75rem;
  color: var(--text-muted);
  min-width: 38px;
}
.modal-set-weight,
.modal-set-reps {
  width: 64px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--text-main);
  font-size: 0.85rem;
  padding: 0.3rem 0.4rem;
  border-radius: 5px;
  outline: none;
  text-align: center;
}
.modal-set-weight:focus,
.modal-set-reps:focus {
  border-color: var(--accent-blue);
}
.modal-set-sep {
  font-size: 0.78rem;
  color: var(--text-muted);
}
.modal-rm-set {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.95rem;
  cursor: pointer;
  padding: 0 0.15rem;
  line-height: 1;
  opacity: 0.5;
  transition: opacity 0.15s, color 0.15s;
}
.modal-rm-set:hover {
  opacity: 1;
  color: #f87171;
}

.modal-add-set-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.78rem;
  cursor: pointer;
  padding: 0.2rem 0;
  transition: color 0.15s;
}
.modal-add-set-btn:hover {
  color: var(--accent-blue);
}

.modal-add-ex-btn {
  background: none;
  border: 1px dashed rgba(255,255,255,0.15);
  color: var(--text-muted);
  font-size: 0.8rem;
  padding: 0.45rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  width: 100%;
  text-align: center;
  margin-top: 0.5rem;
  transition: border-color 0.15s, color 0.15s;
}
.modal-add-ex-btn:hover {
  border-color: var(--accent-blue);
  color: var(--accent-blue);
}

/* Edit footer */
.modal-edit-footer {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.modal-edit-footer.hidden {
  display: none;
}
.modal-save-btn {
  background: var(--accent-blue);
  color: #000;
  border: none;
  font-size: 0.83rem;
  font-weight: 600;
  padding: 0.45rem 1.1rem;
  border-radius: 6px;
  cursor: pointer;
  transition: opacity 0.15s;
}
.modal-save-btn:disabled {
  opacity: 0.6;
  cursor: default;
}
.modal-cancel-edit-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.83rem;
  cursor: pointer;
  padding: 0.45rem 0.5rem;
  transition: color 0.15s;
}
.modal-cancel-edit-btn:hover {
  color: var(--text-main);
}
.modal-edit-error {
  font-size: 0.78rem;
  color: #f87171;
  margin-left: auto;
}
.modal-edit-error.hidden {
  display: none;
}

/* ======================================
   WORKOUT SHARE PANEL
====================================== */

.modal-share-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.1rem;
  padding-top: 0.25rem;
}
.modal-share-panel.hidden {
  display: none;
}

.share-canvas-preview {
  width: 100%;
  max-width: 480px;
  height: auto;
  border-radius: 10px;
  display: block;
}

.share-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: center;
  width: 100%;
  max-width: 480px;
}

.share-btn {
  flex: 1;
  min-width: 100px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.12);
  color: var(--text-main);
  font-size: 0.82rem;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: 7px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.share-btn:hover {
  background: rgba(255,255,255,0.09);
  border-color: rgba(255,255,255,0.25);
}
.share-btn.hidden {
  display: none;
}
.share-btn-primary {
  background: var(--accent-blue);
  border-color: var(--accent-blue);
  color: #000;
  font-weight: 600;
}
.share-btn-primary:hover {
  background: #5dd6ff;
  border-color: #5dd6ff;
}

.share-back-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.8rem;
  cursor: pointer;
  padding: 0.25rem;
  transition: color 0.15s;
}
.share-back-btn:hover {
  color: var(--text-main);
}

/* ======================================
   EMPTY STATE
====================================== */

.empty-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
}

.empty-card {
  width: min(520px, 90%);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem;
}

.empty-card h2 {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}

.empty-card p {
  font-size: 0.9rem;
  line-height: 1.6;
}

.empty-actions {
  display: flex;
  gap: 10px;
  margin-top: 1.25rem;
}

.empty-foot {
  margin-top: 1rem;
  font-size: 0.8rem;
}

/* ======================================
   ACHIEVEMENTS
====================================== */

/* Achievement category colour tokens */
.ach-cat-streak   { --ach-color: #ff9f43; --ach-glow: rgba(255,159,67,0.25); }
.ach-cat-pr       { --ach-color: #3ecbff; --ach-glow: rgba(62,203,255,0.25); }
.ach-cat-volume   { --ach-color: #7a6cff; --ach-glow: rgba(122,108,255,0.25); }
.ach-cat-milestone{ --ach-color: #fbbf24; --ach-glow: rgba(251,191,36,0.25); }
.ach-cat-special  { --ach-color: #4ade80; --ach-glow: rgba(74,222,128,0.25); }

@keyframes ach-shimmer {
  0%   { background-position: -200% center; }
  100% { background-position:  200% center; }
}

.achievement-card {
  position: relative;
  cursor: default;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 20px 14px 16px;
  text-align: center;
  border-top: 2px solid var(--ach-color, var(--border));
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  overflow: hidden;
}

.achievement-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 0%, var(--ach-glow, transparent) 0%, transparent 70%);
  pointer-events: none;
}

.achievement-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.3), 0 0 0 1px var(--ach-color, transparent);
}

.achievement-latest {
  border-top-color: var(--ach-color, var(--accent-blue));
}

.achievement-latest::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 40%, rgba(255,255,255,0.06) 50%, transparent 60%);
  background-size: 200% 100%;
  animation: ach-shimmer 2.5s ease infinite;
  pointer-events: none;
}

.achievement-orb {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--ach-color, var(--accent-blue)) 15%, transparent);
  border: 1.5px solid color-mix(in srgb, var(--ach-color, var(--accent-blue)) 40%, transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ach-color, var(--accent-blue));
  box-shadow: 0 0 14px var(--ach-glow, transparent);
  flex-shrink: 0;
}

.achievement-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.achievement-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.3;
}

.achievement-desc {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.achievement-time {
  font-size: 0.68rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  justify-content: center;
}

.achievement-new {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ach-color, var(--accent-blue));
  background: var(--ach-glow, rgba(62,203,255,0.12));
  border: 1px solid color-mix(in srgb, var(--ach-color, var(--accent-blue)) 35%, transparent);
  padding: 1px 5px;
  border-radius: 4px;
}

.achievement-count {
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--ach-color, var(--accent-orange));
  color: #000;
  font-weight: 700;
  font-size: 0.65rem;
  padding: 2px 5px;
  border-radius: 5px;
  line-height: 1.4;
}

/* Locked state */
.ach-locked {
  --ach-color: rgba(255,255,255,0.15);
  --ach-glow: transparent;
  opacity: 0.55;
  border-top-color: rgba(255,255,255,0.08);
}
.ach-locked::before { display: none; }
.ach-locked:hover { transform: none; box-shadow: none; }

.ach-orb-locked {
  background: rgba(255,255,255,0.05);
  border-color: rgba(255,255,255,0.1);
  color: var(--text-muted);
  box-shadow: none;
}

/* Achievement detail modal */
.ach-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1200;
  backdrop-filter: blur(4px);
}
.ach-modal-backdrop.ach-modal-hidden {
  display: none;
}
.ach-modal {
  background: #141920;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  padding: 2rem 1.75rem 1.75rem;
  width: min(400px, 92vw);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.5rem;
  position: relative;
}
.ach-modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  background: none;
  border: none;
  color: rgba(255,255,255,0.35);
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
  padding: 0;
}
.ach-modal-close:hover { color: rgba(255,255,255,0.7); }
.ach-modal-orb {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--ach-color, #3ecbff) 18%, transparent);
  border: 1.5px solid color-mix(in srgb, var(--ach-color, #3ecbff) 35%, transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ach-color, #3ecbff);
  margin-bottom: 0.25rem;
}
.ach-modal-category {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.85;
}
.ach-modal-name {
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  margin-top: 0.1rem;
}
.ach-modal-desc {
  font-size: 0.875rem;
  color: rgba(255,255,255,0.5);
  margin-top: 0.1rem;
}
.ach-modal-date {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.3);
  margin-top: 0.25rem;
}
.ach-modal-share-btn {
  margin-top: 1.1rem;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  color: rgba(255,255,255,0.75);
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.6rem 1.5rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  width: 100%;
}
.ach-modal-share-btn:hover {
  background: rgba(255,255,255,0.12);
  color: #fff;
}

.ach-locked-label {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-style: italic;
}

/* Progress bar (shown on stack achievements) */
.ach-progress-wrap {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 2px;
}
.ach-progress-track {
  width: 100%;
  height: 3px;
  border-radius: 2px;
  background: rgba(255,255,255,0.08);
  overflow: hidden;
}
.ach-progress-fill {
  height: 100%;
  border-radius: 2px;
  background: var(--ach-color, var(--accent-blue));
  transition: width 0.5s ease;
}
.ach-progress-locked {
  background: rgba(255,255,255,0.2);
}
.ach-progress-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-align: center;
}

.achievements-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(11, 15, 20, 0.35);
  border-radius: 12px;
}

.achievements-soon {
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  border: 1px solid rgba(62, 203, 255, 0.3);
  background: rgba(62, 203, 255, 0.08);
  color: var(--accent-blue);
  font-size: 0.8rem;
}

/* ======================================
   GOALS
====================================== */

.goals-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.goals-empty {
  text-align: center;
  padding: 1.5rem 0;
}
.goals-empty.hidden {
  display: none;
}

.goals-empty-text {
  font-size: 0.95rem;
  font-weight: 500;
  margin-bottom: 0.4rem;
}

.goals-empty-sub {
  font-size: 0.82rem;
}

.goal-item {
  display: flex;
  flex-direction: column;
}

.goal-item-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.goal-item-label {
  font-size: 0.88rem;
  font-weight: 600;
}

.goal-item-pct {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
}

.goal-pct-close {
  color: #4ade80;
}

.goal-bar-track {
  height: 6px;
  background: rgba(255,255,255,0.07);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 0.4rem;
}

.goal-bar-fill {
  height: 100%;
  background: var(--accent-blue);
  border-radius: 6px;
  transition: width 0.4s ease;
}

.goal-bar-close {
  background: #4ade80;
}

.goal-item-sub {
  font-size: 0.75rem;
}

.goal-remove-btn {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1;
  padding: 0 0.15rem;
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 0.15s, color 0.15s;
  flex-shrink: 0;
}
.goal-remove-btn:hover {
  opacity: 1;
  color: #f87171;
}

.goal-add-btn {
  background: none;
  border: 1px solid rgba(255,255,255,0.15);
  color: var(--text-main);
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.35rem 0.85rem;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.15s, color 0.15s;
  align-self: flex-start;
}
.goal-add-btn:hover {
  border-color: var(--accent-blue);
  color: var(--accent-blue);
}

.goal-form {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(255,255,255,0.06);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.goal-form.hidden {
  display: none;
}

.goal-form-row {
  display: flex;
}

.goal-type-toggle {
  display: flex;
  gap: 0.4rem;
}

.goal-type-btn {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.3rem 0.8rem;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.goal-type-btn.active {
  background: rgba(62, 203, 255, 0.1);
  border-color: var(--accent-blue);
  color: var(--accent-blue);
}

.goal-input {
  width: 100%;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--text-main);
  font-size: 0.85rem;
  padding: 0.45rem 0.75rem;
  border-radius: 6px;
  outline: none;
  transition: border-color 0.15s;
}
.goal-input:focus {
  border-color: var(--accent-blue);
}
.goal-input-sm {
  max-width: 180px;
}

.goal-deadline-select {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%238b9ab1'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.7rem center;
  padding-right: 2rem;
}

.goal-deadline-chip {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.1rem 0.45rem;
  border-radius: 20px;
  background: rgba(255,255,255,0.07);
  color: var(--text-muted, #8b9ab1);
  border: 1px solid rgba(255,255,255,0.1);
  white-space: nowrap;
  letter-spacing: 0.01em;
}

.goal-deadline-soon {
  background: rgba(255, 159, 67, 0.12);
  color: var(--accent-orange, #ff9f43);
  border-color: rgba(255, 159, 67, 0.25);
}

.goal-deadline-urgent {
  background: rgba(248, 113, 113, 0.12);
  color: #f87171;
  border-color: rgba(248, 113, 113, 0.25);
}

.goal-deadline-overdue {
  background: rgba(248, 113, 113, 0.18);
  color: #f87171;
  border-color: rgba(248, 113, 113, 0.35);
}

.goal-form-actions {
  display: flex;
  gap: 0.6rem;
  align-items: center;
}

.goal-form-submit {
  background: var(--accent-blue);
  color: #000;
  border: none;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.4rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  transition: opacity 0.15s;
}
.goal-form-submit:disabled {
  opacity: 0.6;
  cursor: default;
}

.goal-form-cancel {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.82rem;
  cursor: pointer;
  padding: 0.4rem 0.5rem;
  transition: color 0.15s;
}
.goal-form-cancel:hover {
  color: var(--text-main);
}

.goal-form-error {
  font-size: 0.78rem;
  color: #f87171;
}
.goal-form-error.hidden {
  display: none;
}

/* Completed goals section */
.goal-completed-section {
  margin-top: 1.25rem;
  padding-top: 1.1rem;
  border-top: 1px solid rgba(255,255,255,0.06);
}

.goal-completed-heading {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.goal-item-done .goal-item-top {
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0;
}

.goal-done-check {
  color: #4ade80;
  font-size: 0.85rem;
  font-weight: 700;
  flex-shrink: 0;
}

.goal-item-done .goal-item-label {
  text-decoration: line-through;
  opacity: 0.5;
}

.goal-share-btn {
  background: none;
  border: 1px solid rgba(74,222,128,0.25);
  color: #4ade80;
  border-radius: 6px;
  padding: 0.15rem 0.45rem;
  font-size: 1rem;
  cursor: pointer;
  line-height: 1;
  transition: background 0.15s;
  flex-shrink: 0;
}
.goal-share-btn:hover {
  background: rgba(74,222,128,0.1);
}

/* Goal share overlay */
.goal-share-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.goal-share-overlay.hidden {
  display: none;
}
.goal-share-modal {
  background: #141920;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 1.25rem;
  width: 100%;
  max-width: 640px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.goal-share-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.goal-share-title {
  font-weight: 600;
  font-size: 0.95rem;
}
.goal-share-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.3rem;
  cursor: pointer;
  line-height: 1;
  padding: 0.1rem 0.3rem;
}
.goal-share-close:hover {
  color: #fff;
}

/* Goal reached toast */
.goal-toast {
  position: fixed;
  bottom: calc(1.5rem + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%) translateY(calc(100% + 2rem));
  background: #0e1a10;
  border: 1px solid #4ade80;
  color: var(--text-main);
  font-size: 0.85rem;
  padding: 0.7rem 1.25rem;
  border-radius: 8px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.5);
  z-index: 99999;
  max-width: calc(100vw - 2rem);
  width: max-content;
  text-align: center;
  word-break: break-word;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
}

.goal-toast.goal-toast-show {
  transform: translateX(-50%) translateY(0);
}

.goal-toast-icon {
  color: #4ade80;
  font-weight: 700;
  margin-right: 0.35rem;
}

/* ======================================
   NOTIFICATIONS
====================================== */

.notif-wrap {
  position: relative;
}

.notif-bell {
  position: relative;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.4rem;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s, background 0.15s;
}
.notif-bell:hover {
  color: var(--text-main);
  background: rgba(255,255,255,0.05);
}
.notif-bell-active {
  color: var(--accent-blue);
}

.notif-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  background: #f87171;
  color: #fff;
  font-size: 0.62rem;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  pointer-events: none;
}
.notif-badge.hidden {
  display: none;
}

.notif-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 340px;
  background: #0e1520;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  z-index: 9000;
  overflow: hidden;
  animation: notif-drop 0.18s ease;
}
.notif-panel.hidden {
  display: none;
}

@keyframes notif-drop {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.notif-panel-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1rem 0.75rem;
  border-bottom: 1px solid var(--border);
}
.notif-panel-title {
  font-size: 0.88rem;
  font-weight: 600;
}
.notif-hdr-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.notif-mark-all {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.75rem;
  cursor: pointer;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  transition: color 0.15s;
}
.notif-mark-all:hover {
  color: var(--accent-blue);
}

.notif-clear-all {
  background: none;
  border: none;
  font-size: 0.72rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
}
.notif-clear-all:hover {
  color: #f87171;
  background: rgba(248, 113, 113, 0.08);
}

.notif-delete-btn {
  background: none;
  border: none;
  color: transparent;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 0.15rem;
  flex-shrink: 0;
  border-radius: 4px;
  transition: color 0.12s, background 0.12s;
  align-self: center;
}
.notif-item:hover .notif-delete-btn {
  color: var(--text-muted);
}
.notif-delete-btn:hover {
  color: #f87171 !important;
  background: rgba(248, 113, 113, 0.1);
}

.notif-list {
  max-height: 380px;
  overflow-y: auto;
}

.notif-empty {
  padding: 2rem 1rem;
  text-align: center;
  font-size: 0.83rem;
  color: var(--text-muted);
}

.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  cursor: pointer;
  transition: background 0.12s;
}
.notif-item:last-child {
  border-bottom: none;
}
.notif-item:hover {
  background: rgba(255,255,255,0.03);
}
.notif-unread {
  background: rgba(62,203,255,0.04);
}
.notif-unread:hover {
  background: rgba(62,203,255,0.07);
}

.notif-type-dot {
  font-size: 1rem;
  line-height: 1.4;
  flex-shrink: 0;
  width: 18px;
  text-align: center;
}

.notif-content {
  flex: 1;
  min-width: 0;
}
.notif-title {
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 0.15rem;
}
.notif-body {
  font-size: 0.78rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.notif-time {
  font-size: 0.72rem;
  white-space: nowrap;
  padding-top: 0.15rem;
  flex-shrink: 0;
}

@media (max-width: 480px) {
  .notif-panel {
    position: fixed;
    top: 60px;
    right: 0.75rem;
    left: 0.75rem;
    width: auto;
  }
}

.inline-cmd {
  font-family: "SF Mono", "Fira Code", monospace;
  font-size: 0.82em;
  background: rgba(255,255,255,0.07);
  padding: 1px 5px;
  border-radius: 4px;
}

/* ======================================
   PR BOARD
====================================== */

.pr-board-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.pr-board-search {
  flex: 1;
  min-width: 200px;
  max-width: 300px;
}

.pr-board-sort {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.sort-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 6px;
  padding: 0.38rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: 0.15s;
}

.sort-btn:hover {
  color: var(--text-main);
  border-color: rgba(255, 255, 255, 0.18);
}

.sort-btn.active {
  background: rgba(62, 203, 255, 0.1);
  border-color: rgba(62, 203, 255, 0.35);
  color: var(--accent-blue);
}

.pr-board-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 16px;
  font-size: 0.85rem;
}

/* Clickable rows */
.pr-board-row {
  cursor: pointer;
  transition: background 0.12s;
}
.pr-board-row:hover {
  background: rgba(62, 203, 255, 0.04);
}
.pr-board-row .pr-row-hint {
  font-size: 0.7rem;
  color: var(--text-muted);
  opacity: 0;
  transition: opacity 0.15s;
  margin-left: 4px;
}
.pr-board-row:hover .pr-row-hint {
  opacity: 1;
}
.pr-row-active {
  background: rgba(62, 203, 255, 0.06) !important;
}
.pr-row-active td:first-child strong {
  color: var(--accent-blue);
}

/* Inline exercise detail panel */
.pr-detail-panel {
  margin-top: 1rem;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(62,203,255,0.15);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  animation: detail-slide-in 0.2s ease;
}
.pr-detail-panel.hidden {
  display: none;
}
@keyframes detail-slide-in {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.pr-detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1.1rem;
}
.pr-detail-name {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--accent-blue);
}
.pr-detail-sub {
  font-size: 0.78rem;
  margin-top: 0.2rem;
}
.pr-detail-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0.1rem 0.3rem;
  line-height: 1;
}
.pr-detail-close:hover {
  color: #fff;
}

/* ======================================
   HAMBURGER (hidden on desktop)
====================================== */

.dash-burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  flex-shrink: 0;
  order: -1;
}

.dash-burger span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text-main);
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
  transform-origin: center;
}

.dash-burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.dash-burger.open span:nth-child(2) { opacity: 0; }
.dash-burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Sidebar backdrop */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 48;
}

.sidebar-backdrop.open {
  display: block;
}

/* ======================================
   RECAP BANNER
====================================== */

.recap-banner {
  position: fixed;
  top: var(--header-h);
  left: 0;
  right: 0;
  z-index: 45;
  background: rgba(62, 203, 255, 0.08);
  border-bottom: 1px solid rgba(62, 203, 255, 0.2);
  padding: 0.6rem 1.5rem;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.recap-banner-hidden {
  transform: translateY(-100%);
  opacity: 0;
  pointer-events: none;
}

.recap-banner-inner {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.85rem;
}

.recap-banner-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-blue);
  flex-shrink: 0;
  animation: recapPulse 2s infinite;
}

@keyframes recapPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}

.recap-banner-btn {
  margin-left: auto;
  background: var(--accent-blue);
  color: #000;
  border: none;
  border-radius: 6px;
  padding: 0.3rem 0.85rem;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
}

.recap-banner-x {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0 0.25rem;
  line-height: 1;
  flex-shrink: 0;
}

.recap-banner-x:hover { color: var(--text-main); }

/* ======================================
   RECAP MODAL
====================================== */

.recap-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(11, 15, 20, 0.96);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.3s ease;
}

.recap-modal-hidden {
  opacity: 0;
  pointer-events: none;
}

.recap-modal-inner {
  position: relative;
  width: 100%;
  max-width: 480px;
  min-height: 520px;
  display: flex;
  flex-direction: column;
  padding: 0 1rem 1rem;
}

.recap-close {
  position: absolute;
  top: -2.5rem;
  right: 0;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
  z-index: 10;
}
.recap-close:hover { color: var(--text-main); }

.recap-progress {
  display: flex;
  gap: 4px;
  margin-bottom: 1.25rem;
}

.recap-prog-seg {
  flex: 1;
  height: 2px;
  background: rgba(255,255,255,0.15);
  border-radius: 2px;
  overflow: hidden;
}

.recap-prog-seg-fill {
  height: 100%;
  background: var(--accent-blue);
  width: 0%;
  transition: width 0.3s ease;
}

.recap-prog-seg.done .recap-prog-seg-fill { width: 100%; }
.recap-prog-seg.active .recap-prog-seg-fill { width: 50%; }

.recap-slides-wrap {
  flex: 1;
  position: relative;
  overflow: hidden;
  min-height: 420px;
}

.recap-slide {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 2rem 1.5rem;
  border-radius: 16px;
  opacity: 0;
  transform: translateX(40px);
  transition: opacity 0.35s ease, transform 0.35s ease;
  pointer-events: none;
}

.recap-slide.active {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

.recap-slide-prs.active {
  overflow-y: auto;
  justify-content: flex-start;
}

.recap-slide.exit-left {
  opacity: 0;
  transform: translateX(-40px);
}

/* Slide type backgrounds */
.recap-slide-cover    { background: linear-gradient(135deg, rgba(62,203,255,0.08) 0%, rgba(11,15,20,0) 60%); border: 1px solid rgba(62,203,255,0.12); }
.recap-slide-strength { background: linear-gradient(135deg, rgba(122,108,255,0.08) 0%, rgba(11,15,20,0) 60%); border: 1px solid rgba(122,108,255,0.12); }
.recap-slide-prs      { background: linear-gradient(135deg, rgba(255,159,67,0.08) 0%, rgba(11,15,20,0) 60%); border: 1px solid rgba(255,159,67,0.12); }
.recap-slide-cardio   { background: linear-gradient(135deg, rgba(74,222,128,0.08) 0%, rgba(11,15,20,0) 60%); border: 1px solid rgba(74,222,128,0.12); }
.recap-slide-weight   { background: linear-gradient(135deg, rgba(62,203,255,0.08) 0%, rgba(11,15,20,0) 60%); border: 1px solid rgba(62,203,255,0.12); }
.recap-slide-streak   { background: linear-gradient(135deg, rgba(255,159,67,0.08) 0%, rgba(11,15,20,0) 60%); border: 1px solid rgba(255,159,67,0.12); }
.recap-slide-closing  { background: linear-gradient(135deg, rgba(122,108,255,0.08) 0%, rgba(11,15,20,0) 60%); border: 1px solid rgba(122,108,255,0.12); }
.recap-slide-wow          { background: linear-gradient(135deg, rgba(251,191,36,0.1) 0%, rgba(11,15,20,0) 65%); border: 1px solid rgba(251,191,36,0.2); }
.recap-slide-consistency  { background: linear-gradient(135deg, rgba(74,222,128,0.07) 0%, rgba(11,15,20,0) 60%); border: 1px solid rgba(74,222,128,0.12); }
.recap-slide-goalprogress { background: linear-gradient(135deg, rgba(122,108,255,0.08) 0%, rgba(11,15,20,0) 60%); border: 1px solid rgba(122,108,255,0.12); }
.recap-slide-habits       { background: linear-gradient(135deg, rgba(62,203,255,0.07) 0%, rgba(11,15,20,0) 60%); border: 1px solid rgba(62,203,255,0.1); }

.recap-slide-eyebrow {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.75rem;
}

.recap-slide-cover .recap-slide-eyebrow   { color: var(--accent-blue); }
.recap-slide-strength .recap-slide-eyebrow { color: var(--accent-purple); }
.recap-slide-prs .recap-slide-eyebrow    { color: var(--accent-orange); }
.recap-slide-cardio .recap-slide-eyebrow  { color: #4ade80; }
.recap-slide-weight .recap-slide-eyebrow  { color: var(--accent-blue); }
.recap-slide-streak .recap-slide-eyebrow  { color: var(--accent-orange); }
.recap-slide-closing .recap-slide-eyebrow { color: var(--accent-purple); }
.recap-slide-wow .recap-slide-eyebrow          { color: #fbbf24; letter-spacing: 0.12em; }
.recap-slide-consistency .recap-slide-eyebrow  { color: #4ade80; }
.recap-slide-goalprogress .recap-slide-eyebrow { color: var(--accent-purple); }
.recap-slide-habits .recap-slide-eyebrow       { color: var(--accent-blue); }

/* Rhythm score hero row */
.recap-rhythm-hero {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
}
.recap-rhythm-grade {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
  opacity: 0.85;
}

/* Consistency stats row */
.recap-consistency-stats {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0.35rem 0 0;
}
.rcs-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.rcs-val {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  line-height: 1;
}
.rcs-lbl {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.rcs-divider {
  width: 1px;
  height: 28px;
  background: rgba(255,255,255,0.1);
}

/* Consistency heatmap inside recap slide */
.recap-heatmap {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
  margin: 1rem 0 0.75rem;
  width: 100%;
}

.recap-heatmap-yearly {
  gap: 2px;
}

.chm-cell {
  aspect-ratio: 1;
  border-radius: 2px;
  background: rgba(74, 222, 128, 0.18);
}

.chm-active {
  background: #4ade80;
}

.chm-out {
  background: rgba(255, 255, 255, 0.04);
}

/* Goal progress recap slide */
.recap-goal-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1.1rem;
  width: 100%;
  overflow-y: auto;
}

.recap-goal-row {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.recap-goal-name {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-main);
}

.recap-goal-bar-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.recap-goal-bar-track {
  position: relative;
  height: 6px;
  background: rgba(255,255,255,0.06);
  border-radius: 99px;
  overflow: hidden;
}

.recap-goal-bar-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  border-radius: 99px;
  background: var(--accent-purple, #7a6cff);
  transition: width 0.6s ease;
}

.recap-goal-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.72rem;
}

.recap-goal-pct {
  font-weight: 700;
  color: var(--text-main);
}

.recap-goal-pct-delta {
  font-weight: 600;
  padding: 0.05rem 0.3rem;
  border-radius: 99px;
}
.recap-goal-pct-delta.up   { color: #4ade80; background: rgba(74,222,128,0.1); }
.recap-goal-pct-delta.down { color: #f87171; background: rgba(248,113,113,0.1); }

.recap-goal-delta {
  margin-left: auto;
  font-weight: 600;
}

.recap-slide-goalprogress.active {
  overflow-y: auto;
  justify-content: flex-start;
}

.recap-habits-wrap {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-top: 1.5rem;
  width: 100%;
}

.recap-habit-row {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.recap-habit-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.recap-habit-val {
  font-size: 2rem;
  font-weight: 800;
  color: #fff;
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.recap-habit-time {
  font-size: 1rem;
  font-weight: 400;
  color: var(--accent-blue);
}

.recap-daily-streak {
  color: var(--accent-orange);
  font-weight: 600;
  margin-top: 0.3rem;
  letter-spacing: 0.01em;
  transition: opacity 0.2s;
}

.recap-wow-number {
  color: #fbbf24;
}
.recap-wow-number span {
  color: rgba(251,191,36,0.6);
}
.recap-wow-msg {
  border-left-color: rgba(251,191,36,0.35);
  color: rgba(251,191,36,0.85);
}

.recap-slide-hero {
  font-size: 3.2rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  margin-bottom: 0.4rem;
}

.recap-slide-hero span {
  font-size: 1rem;
  font-weight: 400;
  color: var(--text-muted);
  margin-left: 4px;
  letter-spacing: 0;
}

.recap-slide-sub {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.recap-slide-rows {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.recap-slide-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.85rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.recap-slide-row:last-child { border-bottom: none; }

.recap-slide-row-label { color: var(--text-muted); }
.recap-slide-row-val   { font-weight: 600; }

.recap-vs-chip {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 20px;
  margin-top: 0.5rem;
  display: inline-block;
}

.recap-vs-chip.up   { background: rgba(74,222,128,0.15); color: #4ade80; }
.recap-vs-chip.down { background: rgba(255,100,80,0.15); color: #ff6450; }
.recap-vs-chip.flat { background: rgba(255,255,255,0.06); color: var(--text-muted); }

.recap-pr-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.recap-pr-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255,159,67,0.06);
  border: 1px solid rgba(255,159,67,0.12);
  border-radius: 8px;
  padding: 0.5rem 0.85rem;
  font-size: 0.83rem;
}

.recap-pr-exercise { font-weight: 500; }
.recap-pr-stat     { color: var(--accent-orange); font-weight: 600; font-size: 0.82rem; }

.recap-closing-msg {
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
}

.recap-closing-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.recap-coach-msg {
  font-size: 0.83rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255,255,255,0.05);
  font-style: italic;
}

/* Workout breakdown slide */
.recap-breakdown-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  width: 100%;
}
.recap-breakdown-row {
  display: grid;
  grid-template-columns: 90px 1fr auto;
  align-items: center;
  gap: 0.6rem;
}
.recap-bdr-name {
  font-size: 0.78rem;
  font-weight: 600;
  color: rgba(255,255,255,0.75);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.recap-bdr-bar-wrap {
  height: 8px;
  background: rgba(255,255,255,0.07);
  border-radius: 4px;
  overflow: hidden;
}
.recap-bdr-bar {
  height: 100%;
  border-radius: 4px;
  transition: width 0.4s ease;
}
.recap-bdr-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0;
  min-width: 56px;
}
.recap-bdr-count {
  font-size: 0.72rem;
  font-weight: 700;
  color: rgba(255,255,255,0.8);
  line-height: 1.2;
}
.recap-bdr-vol {
  font-size: 0.65rem;
  color: var(--text-muted);
  line-height: 1.2;
}

.recap-footer-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1rem;
  position: relative;
}

.recap-share-btn {
  position: absolute;
  right: 0;
  bottom: 0;
  background: rgba(255,255,255,0.07);
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 8px;
  padding: 0.4rem 0.7rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s;
}
.recap-share-btn:hover {
  background: rgba(62, 203, 255, 0.1);
  color: var(--accent-blue);
  border-color: rgba(62, 203, 255, 0.3);
}

.recap-nav-btn {
  background: rgba(255,255,255,0.07);
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 8px;
  padding: 0.4rem 0.9rem;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.recap-nav-btn:hover { background: rgba(255,255,255,0.12); color: var(--text-main); }
.recap-nav-btn:disabled { opacity: 0.3; cursor: default; }

.recap-dots {
  display: flex;
  gap: 6px;
  align-items: center;
}

.recap-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  transition: background 0.2s, transform 0.2s;
}

.recap-dot.active {
  background: var(--accent-blue);
  transform: scale(1.3);
}

/* ======================================
   MOBILE
====================================== */

@media (max-width: 768px) {
  /* Switch from fixed-height app shell to normal document flow.
     100vh on mobile clips content behind the browser chrome. */
  body {
    display: block;
    height: auto;
    overflow: visible;
  }

  .dash-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
  }

  /* Hamburger visible on mobile */
  .dash-burger {
    display: flex;
  }

  /* Sidebar becomes a slide-in drawer */
  .sidebar {
    display: flex;
    position: fixed;
    top: var(--header-h);
    left: 0;
    bottom: 0;
    width: 220px;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    z-index: 49;
    background: var(--bg-dark);
    border-right: 1px solid var(--border);
    overflow-y: auto;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .dash-main {
    display: block;
    margin-top: var(--header-h);
    padding: 1.5rem 1rem 5rem;
    overflow-x: hidden;
    overflow-y: visible;
    min-height: calc(100vh - var(--header-h));
  }

  /* Header: compact on mobile */
  .dash-header-label,
  .dash-header-divider,
  .dash-user-info {
    display: none;
  }

  .dash-header-right {
    gap: 0.5rem;
  }

  /* Grids */
  .ti-grid {
    grid-template-columns: 1fr;
  }

  .ti-grid > * {
    grid-column: 1 !important;
    min-width: 0;
  }

  .dash-grid > * {
    min-width: 0;
  }

  /* Heatmap months row causes the card to expand to full heatmap width.
     Hide its overflow — heatmap-wrapper below it already scrolls. */
  .heatmap-months-row {
    overflow: hidden;
  }

  #heatmapCard {
    overflow: hidden;
  }

  /* Overview stats: 2×2 is fine for small cards */
  #statsGrid {
    grid-template-columns: repeat(2, 1fr);
  }


  /* Achievements: 2 columns is fine for badge cards */
  #achievementsGrid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Remove the global dash-grid override — handled per-grid above */
  .dash-grid {
    grid-template-columns: 1fr;
  }

  /* Allow these 2-column inner layouts to stay 2-col */
  .weekly-grid,
  .load-metrics,
  .nutrition-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Nutrition hero: stack vertically on small screens */
  .nutrition-hero {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .nutrition-hero-left {
    min-width: 0;
    width: 100%;
  }

  .nutrition-kcal {
    font-size: 2rem;
  }

  .nutrition-grid {
    width: 100%;
  }

  /* Vol strip: wrap label+stat above bars */
  .vol-strip {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .vol-strip-label {
    flex-basis: 100%;
  }

  .vol-strip-bars {
    flex: 1 1 60%;
    min-width: 0;
  }

  .vol-strip-stat {
    flex-shrink: 0;
    padding-bottom: 0;
    flex-wrap: wrap;
    gap: 0.25rem;
  }

  .vol-stat-main,
  .vol-stat-label,
  .vol-stat-change,
  .vol-stat-avg {
    font-size: 0.7rem;
  }

  /* PR stats: 2×2 grid instead of flex row */
  .pr-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }


  /* PR board */
  .pr-board-controls {
    flex-direction: column;
    align-items: stretch;
  }

  .pr-board-search {
    min-width: 0;
    max-width: none;
  }

  /* Tables: card layout on mobile */
  .table thead {
    display: none;
  }

  .table tr {
    display: block;
    background: var(--bg-card);
    border-radius: 10px;
    padding: 10px 12px 10px 14px;
    margin-bottom: 8px;
    border: 1px solid var(--border);
  }

  /* Keep accent bar on mobile */
  .table tbody tr[data-wtype="PUSH"]    { border-left: 3px solid rgba(62,203,255,0.7); }
  .table tbody tr[data-wtype="PULL"]    { border-left: 3px solid rgba(122,108,255,0.7); }
  .table tbody tr[data-wtype="LEGS"]    { border-left: 3px solid rgba(255,159,67,0.7); }
  .table tbody tr[data-wtype="CARDIO"]  { border-left: 3px solid rgba(74,222,128,0.7); }
  .table tbody tr[data-wtype="GENERAL"] { border-left: 3px solid rgba(255,255,255,0.12); }
  /* Override the first-child rule on mobile since tr is the block */
  .table tbody tr td:first-child { border-left: none; }

  .table td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
    border: none;
    font-size: 0.82rem;
  }

  .rw-date-cell { flex-direction: row; gap: 0.5rem; align-items: center; }
  .rw-weekday { font-size: 0.85rem; }
  .rw-datestr { margin-top: 0; }
  .rw-stats-cell { flex-wrap: wrap; gap: 0.25rem; justify-content: flex-end; }
  .rw-summary { max-width: none; white-space: normal; }

  .table-wrap {
    background: transparent;
    border: none;
  }

  /* Welcome text */
  .welcome-text {
    font-size: 0.9rem;
  }

  /* Cardio card */
  .cardio-metrics,
  .cardio-prs {
    grid-template-columns: repeat(2, 1fr);
  }

  .cardio-charts {
    grid-template-columns: 1fr;
  }
}

/* =====================
   AI COACH BUBBLE
   ===================== */

@keyframes ai-pulse {
  0%, 100% { box-shadow: 0 0 18px 4px rgba(62, 203, 255, 0.35), 0 0 40px 10px rgba(122, 108, 255, 0.2); }
  50%       { box-shadow: 0 0 28px 8px rgba(62, 203, 255, 0.55), 0 0 60px 18px rgba(122, 108, 255, 0.35); }
}

@keyframes ai-orb-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.ai-coach-btn {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 900;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #3ecbff 0%, #7a6cff 100%);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: ai-pulse 3s ease-in-out infinite;
  transition: transform 0.2s ease;
}

.ai-coach-btn:hover {
  transform: scale(1.1);
}

.ai-coach-orb {
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Backdrop */
.ai-coach-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1100;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.ai-coach-hidden {
  display: none !important;
}

/* Modal */
.ai-coach-modal {
  position: relative;
  background: #111720;
  border: 1px solid rgba(62, 203, 255, 0.2);
  border-radius: 18px;
  padding: 2rem;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 0 60px rgba(62, 203, 255, 0.12), 0 20px 60px rgba(0,0,0,0.5);
}

.ai-coach-close {
  position: absolute;
  top: 1rem;
  right: 1.1rem;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
  transition: color 0.2s;
}
.ai-coach-close:hover { color: var(--text-main); }

.ai-coach-modal-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.2rem;
}

.ai-coach-modal-orb {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3ecbff 0%, #7a6cff 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 0 20px rgba(62, 203, 255, 0.4);
}

.ai-coach-modal-title {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.ai-coach-modal-soon {
  display: inline-block;
  margin-top: 0.2rem;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-blue);
  background: rgba(62, 203, 255, 0.1);
  border-radius: 20px;
  padding: 0.15rem 0.55rem;
}

.ai-coach-modal-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 1.2rem;
}

.ai-coach-features {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.4rem;
}

.ai-coach-feature {
  font-size: 0.82rem;
  color: var(--text-muted);
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-left: 3px solid rgba(62, 203, 255, 0.4);
  border-radius: 6px;
  padding: 0.55rem 0.85rem;
  font-style: italic;
}

.ai-coach-footer {
  font-size: 0.75rem;
  color: rgba(122, 108, 255, 0.7);
  text-align: center;
}
