:root {
  color-scheme: dark;
  --bg: #071013;
  --bg-elevated: rgba(13, 24, 28, 0.88);
  --bg-soft: rgba(18, 31, 36, 0.92);
  --border: rgba(181, 227, 217, 0.14);
  --text: #edf7f5;
  --muted: #9ab3ad;
  --accent: #6ee7c8;
  --accent-strong: #37c8a4;
  --accent-warm: #f5b44c;
  --danger: #ff7a7a;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.38);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
}

* {
  box-sizing: border-box;
}

body, button, input, select, textarea, p, span, div, h1, h2, h3, h4, h5, h6, strong, a, label {
  overflow-wrap: break-word;
  word-break: normal;
}

html {
  background:
    radial-gradient(circle at top left, rgba(110, 231, 200, 0.2), transparent 32%),
    radial-gradient(circle at top right, rgba(245, 180, 76, 0.18), transparent 28%),
    var(--bg);
  overflow-x: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Space Grotesk', 'Trebuchet MS', sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, rgba(7, 16, 19, 0.96), rgba(7, 16, 19, 1));
  overflow-x: hidden;
}

body:not(.authenticated) .app-shell {
  display: none;
}

body.authenticated .auth-screen {
  display: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 1rem));
  margin: 0 auto;
  padding: 0.8rem 0 6.5rem;
}

.auth-screen {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  width: min(1180px, calc(100% - 1rem));
  margin: 0 auto;
  padding: 1rem 0 2rem;
  display: grid;
  align-items: center;
}

.auth-shell {
  padding: 1.2rem;
}

.auth-intro h1 {
  margin: 0.25rem 0 0.75rem;
  font-size: clamp(2rem, 7vw, 4.2rem);
  line-height: 0.96;
  letter-spacing: -0.05em;
  max-width: 12ch;
}

.auth-intro p {
  margin: 0;
  color: var(--muted);
  max-width: 62ch;
  line-height: 1.6;
}

.auth-grid {
  display: grid;
  gap: 0.9rem;
  margin-top: 1rem;
}

.auth-card {
  padding: 1rem;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.accordion-panel {
  margin-top: 1rem;
}

.dashboard-toolbar {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin: 1rem 0;
}

.bg-orb {
  position: fixed;
  inset: auto;
  border-radius: 999px;
  opacity: 0.65;
  pointer-events: none;
  transform: translateZ(0);
  will-change: transform;
}

.orb-a {
  top: -20px;
  left: -40px;
  width: 260px;
  height: 260px;
  background: radial-gradient(circle, rgba(110, 231, 200, 0.2) 0%, rgba(110, 231, 200, 0.08) 45%, transparent 70%);
}

.orb-b {
  top: 120px;
  right: -40px;
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, rgba(245, 180, 76, 0.18) 0%, rgba(245, 180, 76, 0.06) 45%, transparent 70%);
}

.panel {
  background: linear-gradient(180deg, var(--bg-elevated), rgba(8, 15, 18, 0.94));
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  padding: 1.25rem;
}

.hero {
  padding: 0.85rem;
  margin-bottom: 0.75rem;
  display: grid;
  gap: 0.7rem;
}

.eyebrow {
  margin: 0 0 0.4rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.76rem;
}

.hero h1 {
  margin: 0;
  font-size: clamp(1.35rem, 4vw, 2.25rem);
  line-height: 1.05;
  letter-spacing: -0.04em;
  max-width: 18ch;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
}

.stat-card-wide {
  grid-column: 1 / -1;
}

.audio-card {
  padding: 0.7rem;
  border-radius: var(--radius-md);
  background: rgba(245, 180, 76, 0.08);
  border: 1px solid rgba(245, 180, 76, 0.16);
  display: grid;
  gap: 0.35rem;
}

.audio-card span {
  display: block;
  color: var(--muted);
  font-size: 0.7rem;
}

.audio-card strong {
  font-size: 0.95rem;
}

.stat-card {
  padding: 0.7rem;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.stat-card span {
  display: block;
  color: var(--muted);
  font-size: 0.7rem;
  margin-bottom: 0.25rem;
}

.stat-card strong {
  font-size: 1rem;
}

.road-to-100-root {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  grid-column: 1 / -1;
  box-sizing: border-box;
}

.road-to-100-root * {
  box-sizing: border-box;
}

.road-milestone-labels {
  position: relative;
  width: 100%;
  max-width: 100%;
  height: 16px;
  font-size: 0.67rem;
  font-weight: 600;
  color: #94a3b8;
  pointer-events: none;
}

@media (max-width: 480px) {
  .road-milestone-labels {
    font-size: 0.58rem;
  }
}

#roadTo100ToggleBtn {
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

#roadTo100ToggleBtn:hover {
  background: rgba(255, 255, 255, 0.06) !important;
  border-color: rgba(56, 189, 248, 0.3) !important;
}

#roadTo100ToggleBtn:active {
  transform: translateY(1px);
}

.hero {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.hero > * {
  min-width: 0;
  max-width: 100%;
}

.hero .leaderboard-panel {
  padding: 0.75rem;
  margin: 0;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.025);
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.hero .leaderboard-panel .panel-header {
  margin-bottom: 0.6rem;
}

.hero .leaderboard-panel .panel-header h2 {
  font-size: 0.95rem;
}

.hero .leaderboard-panel .segmented {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  width: 100%;
  max-width: 100%;
}

@media (max-width: 420px) {
  .hero .leaderboard-panel .segmented {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.35rem;
  }
}

.hero .leaderboard-panel .segmented button {
  padding: 0.5rem 0.55rem;
  font-size: 0.7rem;
  min-width: 0;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

.hero .leaderboard-list {
  gap: 0.45rem;
  min-width: 0;
  max-width: 100%;
}

.layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  min-width: 0;
  max-width: 100%;
}

.tab-content {
  min-width: 0;
  max-width: 100%;
}

.form-panel,
.leaderboard-panel,
.versus-panel,
.alerts-panel,
.logs-panel,
.settings-panel {
  padding: 1.25rem;
}

.panel-header {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  margin-bottom: 1.1rem;
}

.panel-header.compact {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.panel-header h2 {
  margin: 0;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  border: 1px solid rgba(110, 231, 200, 0.2);
  background: rgba(110, 231, 200, 0.08);
  color: var(--accent);
  font-size: 0.76rem;
  line-height: 1.35;
  max-width: 100%;
  overflow-wrap: break-word;
  word-break: normal;
  text-align: center;
}

.stack-form {
  display: grid;
  gap: 0.85rem;
}

.stack-form label {
  display: grid;
  gap: 0.35rem;
}

.stack-form span,
.metric-label {
  color: var(--muted);
  font-size: 0.84rem;
}

input,
select,
textarea {
  width: 100%;
  padding: 0.85rem 1.05rem;
  border-radius: 12px;
  border: 1px solid rgba(154, 179, 173, 0.22);
  background: rgba(3, 9, 10, 0.88);
  color: var(--text);
  font-size: 0.92rem;
  line-height: 1.45;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

input:hover,
select:hover,
textarea:hover {
  border-color: rgba(154, 179, 173, 0.38);
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(110, 231, 200, 0.65);
  box-shadow: 0 0 0 3px rgba(110, 231, 200, 0.15);
  background: rgba(5, 14, 16, 0.96);
}

input::placeholder,
textarea::placeholder {
  color: rgba(154, 179, 173, 0.55);
  font-size: 0.88rem;
}

textarea {
  resize: vertical;
  min-height: 96px;
}

input[type='file'] {
  padding: 0.78rem;
}

.primary-btn,
.secondary-btn {
  border: 0;
  border-radius: 14px;
  padding: 0.95rem 1rem;
  font-weight: 700;
}

.primary-btn {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #072019;
}

.secondary-btn {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.compact-btn {
  padding: 0.6rem 0.75rem;
  align-self: start;
}

.metric-fields {
  display: grid;
  gap: 0.75rem;
}

.hidden-field {
  display: none !important;
}

.comments-box.hidden-field {
  display: none !important;
}

.metric-card {
  padding: 0.85rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.lifting-sets-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-top: 0.75rem;
}

.lifting-set-card {
  padding: 0.75rem 0.85rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.lifting-set-card:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
}

.lifting-set-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.set-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--accent);
  background: rgba(110, 231, 200, 0.12);
  border: 1px solid rgba(110, 231, 200, 0.25);
  border-radius: 6px;
  padding: 0.15rem 0.5rem;
}

.set-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.set-action-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--muted);
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  transition: all 0.15s ease;
}

.set-action-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.12);
}

.set-action-btn.delete-btn:hover {
  color: #f87171;
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.3);
}

.lifting-set-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}

@media (max-width: 440px) {
  .lifting-set-grid {
    grid-template-columns: 1fr;
    gap: 0.45rem;
  }
}

.bodyweight-set-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
}

@media (max-width: 540px) {
  .bodyweight-set-grid {
    grid-template-columns: 1fr;
    gap: 0.45rem;
  }
}

.bodyweight-set-grid label,
.lifting-set-grid label {
  min-width: 0;
  display: grid;
  gap: 0.25rem;
}

.bodyweight-set-grid label span,
.lifting-set-grid label span {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.25;
  overflow-wrap: break-word;
  white-space: normal;
}

.lifting-set-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  font-size: 0.78rem;
  color: var(--muted);
  padding-top: 0.2rem;
  width: 100%;
}

.set-calc-preview {
  display: inline-block;
  max-width: 100%;
  overflow-wrap: break-word;
  word-break: normal;
  line-height: 1.35;
}

.sets-total-summary-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.65rem 0.85rem;
  margin-top: 0.75rem;
  border-radius: 10px;
  background: rgba(110, 231, 200, 0.08);
  border: 1px solid rgba(110, 231, 200, 0.2);
  color: var(--text);
  font-size: 0.85rem;
}

.metric-calc-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  color: var(--accent);
  background: rgba(110, 231, 200, 0.12);
  border: 1px solid rgba(110, 231, 200, 0.25);
  border-radius: 8px;
  padding: 0.4rem 0.75rem;
  margin-top: 0.6rem;
  font-weight: 500;
}

.metric-card-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.metric-summary {
  color: var(--accent);
  font-size: 0.85rem;
  margin-top: 0.4rem;
}

.settings-panel {
  padding: 1rem;
  margin: 1rem 0;
}

.settings-grid {
  display: grid;
  gap: 0.85rem;
}

.settings-grid label {
  display: grid;
  gap: 0.35rem;
}

.settings-grid span,
.settings-copy {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.5;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  gap: 0.35rem;
  width: 100%;
}

.segmented button {
  padding: 0.55rem 0.65rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.25;
  text-align: center;
  overflow-wrap: break-word;
  word-break: normal;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
}

.segmented button.active {
  background: rgba(110, 231, 200, 0.12);
  color: var(--accent);
  border-color: rgba(110, 231, 200, 0.34);
  font-weight: 600;
}

#createExerciseTabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.4rem;
}

@media (max-width: 520px) {
  #createExerciseTabs {
    grid-template-columns: 1fr;
  }
}

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

@media (max-width: 560px) {
  #prCategorySelector {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

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

@media (max-width: 480px) {
  #leaderboardFilter {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

#workoutsFilterSegment {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.35rem;
}

.leaderboard-list,
.alerts-list,
.log-list {
  display: grid;
  gap: 0.7rem;
}

.entry-card,
.alert-card,
.log-card,
.versus-card {
  border-radius: 18px;
  padding: 0.9rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.entry-top,
.log-top,
.alert-top,
.versus-name {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
}

.rank-badge {
  min-width: 2rem;
  height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(245, 180, 76, 0.15);
  color: var(--accent-warm);
  border: 1px solid rgba(245, 180, 76, 0.2);
  font-weight: 700;
}

.entry-meta,
.log-meta,
.alert-meta,
.versus-meta {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.5;
}

.entry-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.8rem;
}

.chip {
  display: inline-flex;
  padding: 0.35rem 0.6rem;
  border-radius: 999px;
  background: rgba(110, 231, 200, 0.1);
  color: var(--accent);
  border: 1px solid rgba(110, 231, 200, 0.14);
  font-size: 0.76rem;
}

.chip-warn {
  background: rgba(245, 180, 76, 0.12);
  color: var(--accent-warm);
  border-color: rgba(245, 180, 76, 0.16);
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.checkbox-row input {
  width: 1rem;
  height: 1rem;
  margin: 0;
  padding: 0;
  accent-color: var(--accent);
}

.checkbox-row span {
  color: var(--text);
}

.versus-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
  margin-bottom: 1rem;
}

.versus-controls label {
  display: grid;
  gap: 0.35rem;
  min-width: 0;
}

.versus-controls button {
  grid-column: 1 / -1;
}

.versus-view {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.versus-side,
.versus-center {
  border-radius: 18px;
  padding: 0.9rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  min-width: 0;
}

.versus-center {
  grid-column: 1 / -1;
}

.versus-side h3,
.versus-center h3 {
  margin-top: 0;
  margin-bottom: 0.7rem;
}

.versus-side ul,
.versus-center ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.45rem;
}

.delta-positive {
  color: #4ade80;
}

.delta-negative {
  color: #f87171;
}

.delta-neutral {
  color: #94a3b8;
}

.delta-pill-lead {
  background: rgba(34, 197, 94, 0.16) !important;
  color: #4ade80 !important;
  border: 1px solid rgba(34, 197, 94, 0.38) !important;
}

.delta-pill-behind {
  background: rgba(239, 68, 68, 0.16) !important;
  color: #f87171 !important;
  border: 1px solid rgba(239, 68, 68, 0.38) !important;
}

.delta-pill-tie {
  background: rgba(148, 163, 184, 0.12) !important;
  color: #94a3b8 !important;
  border: 1px solid rgba(148, 163, 184, 0.25) !important;
}

/* BMI Health Status Indicators */
.bmi-pill-underweight {
  background: rgba(245, 158, 11, 0.16) !important;
  color: #fbbf24 !important;
  border: 1px solid rgba(245, 158, 11, 0.4) !important;
}

.bmi-pill-healthy {
  background: rgba(34, 197, 94, 0.16) !important;
  color: #4ade80 !important;
  border: 1px solid rgba(34, 197, 94, 0.4) !important;
}

.bmi-pill-overweight {
  background: rgba(249, 115, 22, 0.16) !important;
  color: #fb923c !important;
  border: 1px solid rgba(249, 115, 22, 0.4) !important;
}

.bmi-pill-obese {
  background: rgba(239, 68, 68, 0.16) !important;
  color: #f87171 !important;
  border: 1px solid rgba(239, 68, 68, 0.4) !important;
}

.versus-comparison-section {
  grid-column: 1 / -1;
  margin-top: 0.5rem;
}

.versus-tri-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 0.45rem;
  align-items: center;
  text-align: center;
  margin-top: 0.45rem;
  width: 100%;
}

.versus-sub {
  min-width: 0;
  padding: 0.55rem 0.55rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  text-align: center;
  overflow-wrap: break-word;
  word-break: normal;
  line-height: 1.3;
}

.versus-sub .versus-meta {
  font-size: 0.75rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  display: block;
}

.versus-sub strong {
  display: block;
  margin-top: 2px;
  overflow-wrap: break-word;
  word-break: normal;
  font-size: 0.84rem;
  line-height: 1.25;
  color: var(--text);
}

.versus-delta-col {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 0.2rem;
  flex-shrink: 0;
}

.versus-delta-pill {
  font-weight: 700;
  font-size: 0.78rem;
  white-space: nowrap;
  padding: 0.28rem 0.48rem;
  line-height: 1.2;
}

@media (max-width: 480px) {
  .versus-card {
    padding: 0.65rem 0.5rem;
  }

  .versus-tri-grid {
    gap: 0.25rem;
  }

  .versus-sub {
    padding: 0.4rem 0.35rem;
    border-radius: 8px;
  }

  .versus-sub strong {
    font-size: 0.76rem;
  }

  .versus-sub .versus-meta {
    font-size: 0.7rem;
  }

  .versus-delta-pill {
    font-size: 0.68rem;
    padding: 0.2rem 0.32rem;
  }
}

.leaderboard-places-grid {
  display: grid;
  gap: 0.5rem;
  margin-top: 0.65rem;
}

.leaderboard-place {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.55rem 0.75rem;
  border-radius: 12px;
  font-size: 0.84rem;
}

.place-first {
  background: rgba(110, 231, 200, 0.08);
  border: 1px solid rgba(110, 231, 200, 0.22);
}

.place-second {
  background: rgba(245, 180, 76, 0.06);
  border: 1px solid rgba(245, 180, 76, 0.16);
}

.place-volume {
  background: rgba(147, 197, 253, 0.08);
  border: 1px solid rgba(147, 197, 253, 0.22);
}

.place-volume .place-mark {
  color: #93c5fd;
}

.place-detail {
  font-size: 0.78rem;
  color: var(--muted);
  margin-left: auto;
}

.place-empty {
  opacity: 0.6;
}

.place-tag {
  font-weight: 700;
  font-size: 0.78rem;
  padding: 0.15rem 0.45rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
}

.place-user {
  color: var(--text);
}

.place-mark {
  color: var(--accent);

}

.place-second .place-mark {
  color: var(--accent-warm);
}

.place-gap {
  font-size: 0.76rem;
  color: var(--muted);
  font-style: italic;
  margin-left: auto;
}

.versus-comparison-section h3 {
  margin-top: 0;
  margin-bottom: 0.75rem;
  font-size: 1.05rem;
}

.versus-comparison-list {
  display: grid;
  gap: 0.75rem;
}

.versus-item-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 0.6rem;
}

.versus-sub {
  padding: 0.6rem 0.75rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.winner-sub {
  background: rgba(110, 231, 200, 0.06);
  border-color: rgba(110, 231, 200, 0.2);
}

.chip-win {
  background: rgba(110, 231, 200, 0.18);
  color: var(--accent);
  border-color: rgba(110, 231, 200, 0.35);
  font-weight: 700;
  align-self: start;
}

.thumb-grid {
  display: grid;
  gap: 0.5rem;
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  margin-top: 0.75rem;
}

.thumb-grid img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 1rem;
  transform: translateX(-50%) translateY(140%);
  background: rgba(5, 13, 14, 0.96);
  color: var(--text);
  border: 1px solid rgba(110, 231, 200, 0.2);
  border-radius: 999px;
  padding: 0.9rem 1rem;
  min-width: min(92vw, 420px);
  text-align: center;
  box-shadow: var(--shadow);
  transition: transform 180ms ease;
  z-index: 20;
}

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

.empty-state {
  color: var(--muted);
  text-align: center;
  padding: 1rem;
}

.tab-content {
  display: none;
  flex-direction: column;
  gap: 1.5rem;
  width: 100%;
  max-width: 880px;
  margin: 0 auto;
}

.tab-content.active-tab {
  display: flex !important;
  flex-direction: column;
  gap: 1.5rem;
  width: 100%;
  max-width: 880px;
  margin: 0 auto;
  animation: fade-in 0.2s ease-out;
}

.quick-tags {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.tag-btn {
  font-size: 0.75rem;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--muted);
  transition: all 0.15s ease;
}

.tag-btn:hover {
  background: rgba(110, 231, 200, 0.15);
  border-color: var(--accent);
  color: var(--text);
}

.metric-calc-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.75rem;
  border-radius: 10px;
  background: rgba(110, 231, 200, 0.1);
  border: 1px solid rgba(110, 231, 200, 0.25);
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 600;
  margin-top: 0.4rem;
}

.own-pr-card {
  padding: 1.15rem 1.25rem;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
  box-sizing: border-box;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.own-pr-card:hover {
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.045);
}

.own-pr-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.own-pr-header-left {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  flex: 1;
}

.own-pr-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}

.own-pr-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.own-pr-anatomy-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.35rem 0.55rem;
  background: radial-gradient(ellipse at center, rgba(255, 106, 0, 0.08) 0%, rgba(10, 14, 22, 0.75) 80%);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 12px;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.own-pr-anatomy-header {
  font-size: 0.62rem;
  font-weight: 800;
  color: #ffa033;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.own-pr-anatomy-figures {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  justify-content: center;
}

.anatomy-mini-pane {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.mini-view-tag {
  font-size: 0.58rem;
  font-weight: 700;
  color: #7b889b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 2px;
}

.own-pr-anatomy-box .muscle-body-svg {
  width: 38px;
  height: 76px;
  max-height: 76px;
}

.own-pr-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.55rem;
  margin: 0.15rem 0;
}

.own-pr-metric-pill {
  padding: 0.6rem 0.75rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.own-pr-metric-pill.highlight-accent {
  background: rgba(110, 231, 200, 0.07);
  border-color: rgba(110, 231, 200, 0.22);
}

.own-pr-metric-pill.highlight-warm {
  background: rgba(255, 160, 51, 0.07);
  border-color: rgba(255, 160, 51, 0.22);
}

.own-pr-metric-pill span.metric-label {
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.own-pr-metric-pill strong {
  font-size: 1.02rem;
  color: var(--text);
  font-weight: 700;
}

.own-pr-metric-pill strong.accent-num {
  color: var(--accent);
}

.own-pr-metric-pill strong.warm-num {
  color: #ffa033;
}

.own-pr-metric-pill small.metric-sub {
  font-size: 0.7rem;
  color: var(--muted);
  margin-top: 0.1rem;
}

/* ==========================================================================
   LOG ACTIVITY: CURRENT PR DISPLAY FOR SELECTED EXERCISE
   ========================================================================== */
.exercise-current-pr-container {
  margin: 0.65rem 0 0.85rem 0;
  width: 100%;
  animation: fadeInPrCard 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeInPrCard {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.exercise-pr-card {
  padding: 0.95rem 1.15rem;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(110, 231, 200, 0.09) 0%, rgba(13, 24, 28, 0.96) 65%, rgba(245, 180, 76, 0.05) 100%);
  border: 1px solid rgba(110, 231, 200, 0.28);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.28);
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.exercise-pr-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.exercise-pr-title-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.exercise-pr-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.exercise-pr-tag {
  font-size: 0.72rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: rgba(110, 231, 200, 0.15);
  color: var(--accent);
  border: 1px solid rgba(110, 231, 200, 0.3);
  font-weight: 600;
}

.exercise-pr-badges {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.exercise-pr-date {
  font-size: 0.76rem;
  color: var(--muted);
}

.exercise-pr-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 0.45rem;
}

.exercise-pr-metric-pill {
  padding: 0.45rem 0.65rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.07);
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.exercise-pr-metric-pill span {
  font-size: 0.68rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.exercise-pr-metric-pill strong {
  font-size: 0.95rem;
  color: var(--text);
  font-weight: 700;
  line-height: 1.2;
}

.exercise-pr-metric-pill strong.accent-num {
  color: var(--accent);
}

.exercise-pr-metric-pill strong.warm-num {
  color: var(--accent-warm);
}

.exercise-pr-target-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.45rem;
  padding: 0.45rem 0.75rem;
  border-radius: 8px;
  background: rgba(245, 180, 76, 0.08);
  border: 1px dashed rgba(245, 180, 76, 0.3);
  font-size: 0.8rem;
  color: var(--text);
}

.exercise-pr-target-text {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  color: #fce7b2;
}

.exercise-pr-prefill-btn {
  background: rgba(110, 231, 200, 0.14);
  border: 1px solid rgba(110, 231, 200, 0.35);
  color: var(--accent);
  padding: 0.28rem 0.65rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.exercise-pr-prefill-btn:hover {
  background: rgba(110, 231, 200, 0.26);
  border-color: var(--accent);
  transform: translateY(-1px);
}

.exercise-pr-global-note {
  font-size: 0.78rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding-top: 0.15rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.exercise-pr-empty-card {
  padding: 0.85rem 1.05rem;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed rgba(255, 255, 255, 0.12);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.exercise-pr-empty-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
}

.exercise-pr-empty-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.exercise-pr-empty-text {
  font-size: 0.82rem;
  color: var(--muted);
  margin: 0;
  line-height: 1.4;
}

/* ==========================================================================
   BOTTOM DOCK NAVIGATION BAR
   ========================================================================== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(8, 17, 20, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid rgba(181, 227, 217, 0.15);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  padding: 0.45rem 1rem max(0.6rem, env(safe-area-inset-bottom));
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.55);
  transform: translateZ(0);
  backface-visibility: hidden;
}

.bottom-nav-inner {
  display: flex;
  justify-content: space-around;
  align-items: center;
  width: 100%;
  max-width: 580px;
  gap: 0.35rem;
}

.nav-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.015em;
  cursor: pointer;
  padding: 0.4rem 0.75rem;
  border-radius: 12px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-width: 58px;
  user-select: none;
  text-decoration: none;
}

.nav-btn .nav-icon {
  font-size: 1.25rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-btn .nav-label {
  font-size: 0.72rem;
  line-height: 1;
  white-space: nowrap;
}

.nav-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  transform: translateY(-1px);
}

.nav-btn:active {
  transform: scale(0.96);
}

.nav-btn.active {
  color: var(--accent);
  background: rgba(110, 231, 200, 0.12);
  border: 1px solid rgba(110, 231, 200, 0.28);
  box-shadow: 0 0 16px rgba(110, 231, 200, 0.16);
}

.nav-btn.active .nav-icon {
  transform: scale(1.12);
}

/* ==========================================================================
   PWA INSTALL PANEL & BADGES
   ========================================================================== */
.pwa-install-panel {
  padding: 1rem;
  background: linear-gradient(135deg, rgba(14, 30, 36, 0.95), rgba(8, 17, 20, 0.95));
  border: 1px solid rgba(110, 231, 200, 0.2);
}

.pwa-install-content {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.pwa-icon-box {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.5rem 0;
}

.pwa-icon-box img {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

@media (min-width: 820px) {
  .auth-shell {
    padding: 1.4rem;
  }

  .auth-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }

  .hero {
    grid-template-columns: 1.3fr 0.9fr;
    align-items: end;
    padding: 1.4rem;
  }

  .hero-stats {
    grid-template-columns: 1fr 1fr;
  }

  .layout {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 880px;
    margin: 0 auto;
  }

  .tab-content.active-tab {
    display: flex !important;
    flex-direction: column;
    gap: 1.5rem;
    width: 100%;
    max-width: 880px;
    margin: 0 auto;
  }

  .form-panel,
  .leaderboard-panel,
  .versus-panel,
  .alerts-panel,
  .logs-panel,
  .settings-panel {
    width: 100%;
    padding: 1.35rem;
  }

  .settings-panel {
    padding: 1.35rem;
  }

  .versus-controls {
    grid-template-columns: 1fr 1fr auto;
    align-items: end;
  }

  .versus-controls button {
    grid-column: auto;
  }

  .versus-center {
    grid-column: auto;
  }

  .versus-view {
    grid-template-columns: 1fr 0.9fr 1fr;
    align-items: stretch;
  }
}



@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 0.5rem;
}

.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 4px;
  transition: width 0.3s;
}

/* CELEBRATION MODAL STYLES */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  animation: fade-in 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.hidden-field {
  display: none !important;
}

.modal-card {
  width: 100%;
  max-width: 440px;
  max-height: 90vh;
  overflow-y: auto;
  scrollbar-width: thin;
  background: linear-gradient(180deg, #102120 0%, #081012 100%);
  border: 2px solid var(--accent);
  border-radius: var(--radius-xl);
  padding: 2rem 1.5rem;
  text-align: center;
  box-shadow: 0 20px 50px rgba(110, 231, 200, 0.25), 0 0 30px rgba(0, 0, 0, 0.8);
  animation: pop-up 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.modal-header-sticky {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: -2rem; /* Matches negative padding */
  margin: -2rem -1.5rem 1rem -1.5rem;
  padding: 2rem 1.5rem 1rem 1.5rem;
  background: #102120;
  z-index: 50;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.workout-debrief-modal-card .modal-header-sticky {
  top: -1.5rem;
  margin: -1.5rem -1.5rem 1rem -1.5rem;
  padding: 1.5rem 1.5rem 1rem 1.5rem;
  background: #121921;
}

@keyframes pop-up {
  0% { opacity: 0; transform: scale(0.85) translateY(20px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-badge {
  font-size: 3.5rem;
  line-height: 1;
  padding: 1rem;
  border-radius: 999px;
  background: rgba(110, 231, 200, 0.12);
  border: 1px solid rgba(110, 231, 200, 0.3);
  box-shadow: 0 0 20px rgba(110, 231, 200, 0.2);
}

.modal-card h2 {
  margin: 0;
  font-size: 1.5rem;
  letter-spacing: -0.02em;
  color: #ffffff;
}

.pr-modal-details {
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 0.5rem 0;
}

.pr-detail-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.95rem;
}

.accent-text {
  color: var(--accent);
  font-size: 1.1rem;
}

.modal-btn {
  width: 100%;
  padding: 1rem;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
}

.image-preview-modal-card {
  max-width: 520px;
  width: 92vw;
  padding: 1.25rem;
  text-align: left;
  align-items: stretch;
  background: linear-gradient(180deg, #0f1d21 0%, #081013 100%);
  border: 1px solid rgba(110, 231, 200, 0.35);
  border-radius: var(--radius-xl);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.75), 0 0 30px rgba(110, 231, 200, 0.12);
  gap: 0.85rem;
}

.image-preview-body {
  width: 100%;
  max-height: 65vh;
  min-height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
  padding: 0.35rem;
}

.image-preview-body img {
  max-width: 100%;
  max-height: 60vh;
  object-fit: contain;
  border-radius: var(--radius-sm);
  display: block;
}

.image-preview-footer {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  width: 100%;
}

/* ==========================================================================
   WORKOUTS & GROUPED SESSION STYLES
   ========================================================================== */
.workout-card {
  position: relative;
  background: linear-gradient(180deg, rgba(16, 28, 33, 0.95), rgba(9, 17, 20, 0.98));
  border: 1px solid rgba(110, 231, 200, 0.18);
  border-radius: var(--radius-lg);
  padding: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.workout-card:hover {
  border-color: rgba(110, 231, 200, 0.32);
}

.workout-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.workout-title-area {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.workout-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.workout-meta {
  color: var(--muted);
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.workout-badge-strip {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  flex-wrap: wrap;
}

.workout-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 0.5rem;
  background: rgba(0, 0, 0, 0.25);
  padding: 0.65rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.workout-stat {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

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

.workout-stat-val {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
}

.workout-desc {
  font-size: 0.88rem;
  color: #c9ded9;
  line-height: 1.45;
  background: rgba(255, 255, 255, 0.03);
  padding: 0.6rem 0.75rem;
  border-radius: 10px;
  border-left: 3px solid var(--accent);
}

.workout-exercises-container {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.workout-exercise-item {
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 0.65rem 0.85rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.workout-exercise-detailed-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 12px;
  padding: 0.75rem 0.9rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  transition: all 0.2s ease;
}

.workout-exercise-detailed-card:hover {
  background: rgba(255, 255, 255, 0.045);
  border-color: rgba(255, 255, 255, 0.12);
}

.workout-ex-main-group {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex: 1;
  min-width: 0;
}

.workout-ex-anatomy-box {
  flex-shrink: 0;
  width: 52px;
  height: 86px;
  background: radial-gradient(ellipse at center, rgba(255, 106, 0, 0.09) 0%, rgba(10, 14, 22, 0.8) 75%);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3px;
  position: relative;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.workout-ex-anatomy-box .muscle-body-svg {
  width: 44px;
  height: 76px;
  max-height: 76px;
}

.workout-ex-anatomy-tag {
  position: absolute;
  bottom: 2px;
  font-size: 0.55rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.workout-ex-info-col {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
  flex: 1;
}

.workout-ex-musclegroup-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  font-size: 0.76rem;
}

.workout-ex-mg-badge {
  background: rgba(245, 180, 76, 0.14);
  color: var(--accent);
  border: 1px solid rgba(245, 180, 76, 0.25);
  padding: 0.1rem 0.4rem;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.72rem;
}

.workout-ex-muscles-text {
  color: #94a3b8;
  font-size: 0.75rem;
}

.workout-ex-records-badge-box {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.workout-ex-record-stat {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 0.35rem 0.55rem;
  min-width: 98px;
}

.workout-ex-record-stat .record-stat-label {
  font-size: 0.62rem;
  color: var(--muted);
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.workout-ex-record-stat .record-stat-val {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.2rem;
}

.workout-ex-record-stat .record-stat-val.is-current-pr {
  color: var(--accent);
}

@media (max-width: 640px) {
  .workout-exercise-detailed-card {
    flex-direction: column;
    align-items: stretch;
  }
  .workout-ex-records-badge-box {
    justify-content: space-between;
    width: 100%;
    margin-top: 0.35rem;
    padding-top: 0.35rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
  }
  .workout-ex-record-stat {
    align-items: flex-start;
    flex: 1;
  }
}

.workout-exercise-name {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  word-break: break-word;
  overflow-wrap: break-word;
}

.workout-exercise-metric {
  font-size: 0.88rem;
  color: var(--accent);
  font-weight: 600;
  word-break: break-word;
  overflow-wrap: break-word;
}

.workout-exercise-sub {
  font-size: 0.78rem;
  color: var(--muted);
  word-break: break-word;
  overflow-wrap: break-word;
}

.workout-actions-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding-top: 0.7rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  flex-wrap: wrap;
}

.btn-like {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 600;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
}

.btn-like:hover {
  background: rgba(255, 122, 122, 0.12);
  border-color: rgba(255, 122, 122, 0.3);
  color: #ff9595;
  transform: translateY(-1px);
}

.btn-like.liked {
  background: rgba(255, 122, 122, 0.18);
  border-color: rgba(255, 122, 122, 0.4);
  color: #ff7a7a;
  box-shadow: 0 0 12px rgba(255, 122, 122, 0.25);
}

.btn-like.liked .like-heart {
  animation: heart-pop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes heart-pop {
  0% { transform: scale(1); }
  50% { transform: scale(1.4); }
  100% { transform: scale(1); }
}

.btn-comment {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 600;
  transition: all 0.2s ease;
  cursor: pointer;
}

.btn-comment:hover {
  background: rgba(110, 231, 200, 0.1);
  border-color: rgba(110, 231, 200, 0.3);
  color: var(--accent);
}

.comments-box {
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  animation: fade-in 0.2s ease;
}

.comment-item {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 0.84rem;
}

.comment-item:last-child {
  border-bottom: none;
}

/* ==========================================================================
   WORKOUT MINIMIZATION & INTERACTIVE ANATOMY STYLES
   ========================================================================== */
.workout-card.workout-minimized .workout-exercises-container {
  display: none !important;
}

.workout-card.workout-minimized {
  gap: 0.65rem;
  border-color: rgba(110, 231, 200, 0.12);
}

.workout-card.workout-minimized .workout-desc {
  display: none;
}

.workout-toggle-btn {
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.15s ease;
}

.workout-toggle-btn:hover {
  background: rgba(110, 231, 200, 0.15);
  border-color: rgba(110, 231, 200, 0.4);
  color: var(--accent);
}

.muscle-body-svg polygon[data-muscle] {
  cursor: pointer;
  transition: filter 0.15s ease, opacity 0.15s ease;
}

.muscle-body-svg polygon[data-muscle]:hover {
  filter: brightness(1.5) drop-shadow(0 0 6px rgba(110, 231, 200, 0.7));
}

#anatomyPopover {
  position: absolute;
  z-index: 10000;
  background: #0d1b1f;
  background: linear-gradient(155deg, #132429 0%, #091215 100%);
  border: 1px solid rgba(110, 231, 200, 0.35);
  border-radius: 14px;
  padding: 1.1rem;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.85), 0 0 20px rgba(110, 231, 200, 0.12);
  width: 320px;
  max-width: calc(100vw - 32px);
  color: #edf7f5;
  pointer-events: auto;
}


.comment-author-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.comment-author {
  font-weight: 700;
  color: var(--accent);
  cursor: pointer;
}

.comment-time {
  font-size: 0.72rem;
  color: var(--muted);
}

.comment-text {
  color: var(--text);
  line-height: 1.4;
}

/* ==========================================================================
   SUPERADMIN PANEL STYLES
   ========================================================================== */
.admin-list-container {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-top: 0.5rem;
}

.admin-item-card {
  background: rgba(16, 28, 33, 0.9);
  border: 1px solid rgba(110, 231, 200, 0.15);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  transition: all 0.2s ease;
}

.admin-item-card:hover {
  border-color: rgba(110, 231, 200, 0.35);
}

.admin-item-main {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 200px;
  flex: 1;
}

.admin-item-actions {
  display: flex;
  gap: 0.45rem;
  align-items: center;
  flex-wrap: wrap;
}

.admin-danger-btn {
  background: rgba(255, 122, 122, 0.12);
  color: #ff9595;
  border: 1px solid rgba(255, 122, 122, 0.3);
  padding: 0.35rem 0.7rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.admin-danger-btn:hover {
  background: rgba(255, 122, 122, 0.25);
  color: #fff;
  border-color: #ff7a7a;
}

/* ==========================================================================
   USER AVATAR STYLES
   ========================================================================== */
.avatar-large {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.avatar-medium {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid rgba(110, 231, 200, 0.4);
  flex-shrink: 0;
}

.avatar-small {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(110, 231, 200, 0.35);
  flex-shrink: 0;
}

.avatar-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
  font-size: 1.8rem;
  user-select: none;
}

.avatar-fallback.avatar-medium {
  font-size: 1.1rem;
}

.avatar-fallback.avatar-small {
  font-size: 0.8rem;
}

/* ==========================================================================
   GATEKEEPER INVITE SCREEN STYLES
   ========================================================================== */
.invite-screen {
  z-index: 1000;
}

.password-input-wrapper {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.password-input-wrapper input {
  flex: 1;
}

/* ==========================================================================
   ANATOMICAL MUSCLE MAP & WORKOUT HEATMAP STYLES (MATCHING SCREENSHOT)
   ========================================================================== */

.workout-muscle-heatmap-container {
  background: #0d1016;
  border: 1px solid rgba(255, 106, 0, 0.28);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  position: relative;
  overflow: hidden;
}

.workout-muscle-heatmap-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.workout-muscle-heatmap-title {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}

.workout-muscle-heatmap-title .fire-icon {
  color: #ff6a00;
  filter: drop-shadow(0 0 8px rgba(255, 106, 0, 0.9));
}

.muscle-views-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
  align-items: center;
  justify-items: center;
  background: #07090c;
  border-radius: var(--radius-md);
  padding: 0.85rem 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.muscle-view-pane {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 165px;
}

.muscle-view-label {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: #7d889b;
  text-transform: uppercase;
  margin-bottom: 0.35rem;
}

.muscle-body-svg {
  width: 100%;
  height: auto;
  aspect-ratio: 108 / 225;
  max-height: 285px;
  display: block;
  transition: all 0.2s ease;
}

/* Neutral anatomical anchors (head, knees, hands) */
.svg-body-part {
  fill: #131926;
  stroke: #202b3d;
  stroke-width: 0.6;
}

/* Inactive body silhouette fallback */
.svg-body-base {
  fill: #15181f;
  stroke: #2a313d;
  stroke-width: 1.2;
}

.svg-body-inner-lines {
  stroke: #262b35;
  stroke-width: 0.75;
  fill: none;
}

/* Inactive muscle plates (crisp dark charcoal) */
.svg-muscle-inactive {
  fill: #182030;
  stroke: #273449;
  stroke-width: 0.65;
  transition: fill 0.2s ease, stroke 0.2s ease;
  cursor: pointer;
}

.svg-muscle-inactive:hover {
  fill: #26344d;
  stroke: #415577;
}

/* Active glowing muscle plate (intensity-colored: yellow -> amber -> fiery red -> crimson) */
.svg-muscle-active {
  opacity: 1;
  transition: fill 0.2s ease, stroke 0.2s ease;
  cursor: pointer;
}

.svg-muscle-active:hover {
  filter: brightness(1.2);
}

.svg-muscle-subtle {
  fill: rgba(255, 106, 0, 0.25);
  stroke: rgba(255, 106, 0, 0.5);
  stroke-width: 0.8;
}

/* Badges list under muscle map */
.muscle-hit-badges-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.muscle-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.6rem;
  border-radius: 9999px;
  font-size: 0.78rem;
  font-weight: 600;
  background: rgba(255, 106, 0, 0.12);
  border: 1px solid rgba(255, 106, 0, 0.3);
  color: #ff9b44;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.muscle-chip:hover {
  background: rgba(255, 106, 0, 0.22);
  border-color: #ff6a00;
  transform: translateY(-1px);
}

.muscle-chip-sets {
  font-size: 0.7rem;
  padding: 0.1rem 0.35rem;
  border-radius: 6px;
  background: rgba(255, 106, 0, 0.25);
  color: #fff;
  font-weight: 700;
}

/* Compact Muscle Target Preview Chips in Create & Edit Form */
.muscle-preview-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.5rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  background: rgba(255, 106, 0, 0.12);
  color: #ff9b44;
  border: 1px solid rgba(255, 106, 0, 0.25);
}

/* Selectable Target Muscle Tag (in Exercise Form & Admin Edit) */
.muscle-tag-select {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.65rem;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text);
  cursor: pointer;
  user-select: none;
  transition: all 0.15s ease;
}

.muscle-tag-select:hover {
  border-color: rgba(255, 106, 0, 0.4);
  background: rgba(255, 106, 0, 0.08);
}

.muscle-tag-select.selected {
  background: rgba(255, 106, 0, 0.22);
  border-color: #ff6a00;
  color: #ff9b44;
  box-shadow: 0 0 8px rgba(255, 106, 0, 0.25);
}

/* Superadmin Muscle Map Editor */
.adm-muscle-canvas-svg {
  cursor: crosshair;
  background: #07090c;
  border-radius: var(--radius-md);
  border: 1px dashed rgba(255, 106, 0, 0.3);
  max-height: 380px;
  width: 100%;
}

.adm-active-marker {
  animation: pulse-marker 1.5s infinite ease-in-out;
}

@keyframes pulse-marker {
  0% { transform: scale(1); opacity: 0.85; }
  50% { transform: scale(1.04); opacity: 1; stroke: #ffe485 !important; stroke-width: 1.4px !important; }
  100% { transform: scale(1); opacity: 0.85; }
}

/* Stats & Versus Tab Styling */
.stats-summary-strip .stat-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--radius-md);
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.stats-summary-strip .stat-card:hover {
  border-color: rgba(255, 255, 255, 0.15);
}

.stats-summary-strip .stat-card span {
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.25rem;
}

.stats-summary-strip .stat-card strong {
  font-size: 1.15rem;
  color: var(--text);
  font-weight: 800;
  line-height: 1.2;
}

.stats-summary-strip .stat-card small {
  font-size: 0.75rem;
  color: var(--accent);
  margin-top: 0.2rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.versus-pct-pill {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: 6px;
  line-height: 1.2;
  letter-spacing: 0.02em;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.delta-pct-inline {
  font-size: 0.8rem;
  font-weight: 700;
  opacity: 0.88;
  margin-left: 0.35rem;
  font-family: inherit;
  display: inline-block;
}

.versus-pct-text {
  font-size: 0.74rem;
  font-weight: 700;
  opacity: 0.92;
  margin-left: 0.2rem;
}

.profile-stats-shortcut-card {
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.profile-stats-shortcut-card:hover {
  transform: translateY(-1px);
  border-color: rgba(110, 231, 200, 0.45);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
}

/* ====== END WORKOUT & DEBRIEF MODAL STYLES ====== */
.workout-debrief-modal-card {
  max-width: 820px;
  width: 95vw;
  max-height: 92vh;
  overflow-y: auto;
  padding: 1.5rem;
  background: linear-gradient(180deg, #121921 0%, #0c1117 100%);
  border: 2px solid var(--accent);
  border-radius: var(--radius-xl);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.7), 0 0 30px rgba(245, 180, 76, 0.2);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.debrief-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 1rem;
}

.debrief-meta-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-top: 0.5rem;
}

.debrief-stat-badge {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.3rem 0.65rem;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.debrief-section {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--radius-lg);
  padding: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.debrief-section-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin: 0;
}

.debrief-anatomy-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
  padding: 1rem;
}

@media (max-width: 600px) {
  .debrief-anatomy-grid {
    grid-template-columns: 1fr;
  }
}

.debrief-muscle-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 0.65rem;
}

.debrief-muscle-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 0.7rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.debrief-muscle-card:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.debrief-muscle-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
}

.debrief-muscle-card-name {
  font-weight: 700;
  font-size: 0.88rem;
  color: #fff;
}

.debrief-muscle-card-sets {
  font-size: 0.75rem;
  font-weight: 700;
  color: #ffaa33;
  background: rgba(255, 170, 51, 0.15);
  padding: 0.15rem 0.45rem;
  border-radius: 6px;
}

.debrief-muscle-card-meta {
  font-size: 0.76rem;
  color: var(--muted);
  line-height: 1.35;
}

.debrief-untrained-groups-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 0.75rem;
}

.debrief-untrained-group {
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  padding: 0.75rem 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.debrief-untrained-group-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.debrief-untrained-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.78rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
  padding: 0.25rem 0.55rem;
  border-radius: 6px;
}

.debrief-insights-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.debrief-insight-card {
  padding: 0.9rem 1.1rem;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.88rem;
  line-height: 1.48;
}

.debrief-insight-card.type-warning {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #fef3c7;
}

.debrief-insight-card.type-success {
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.35);
  color: #dcfce7;
}

.debrief-insight-card.type-info {
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.35);
  color: #dbeafe;
}

.debrief-insight-card.type-tip {
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #e0f2fe;
}

.debrief-insight-card.type-next_step {
  background: rgba(168, 85, 247, 0.1);
  border: 1px solid rgba(168, 85, 247, 0.35);
  color: #f3e8ff;
}

.debrief-coaching-box {
  background: linear-gradient(135deg, rgba(245, 180, 76, 0.09) 0%, rgba(255, 106, 0, 0.04) 100%);
  border: 1px solid rgba(245, 180, 76, 0.28);
  border-radius: 12px;
  padding: 1.1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.debrief-coaching-item {
  font-size: 0.9rem;
  line-height: 1.55;
  color: #e2e8f0;
}

.debrief-coaching-item strong {
  color: var(--accent);
}

.active-workout-banner {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.18) 0%, rgba(245, 180, 76, 0.15) 100%);
  border: 1.5px solid rgba(239, 68, 68, 0.45);
  border-radius: var(--radius-lg);
  padding: 0.9rem 1.2rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  box-shadow: 0 4px 18px rgba(239, 68, 68, 0.12);
}

.active-workout-banner-text {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-weight: 600;
  font-size: 0.95rem;
  color: #fff;
}

/* Edit Workout Modal Styles */
.edit-workout-modal-card {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.edit-workout-ex-card {
  transition: border-color 0.15s ease, background 0.15s ease;
}

.edit-workout-ex-card:hover {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.045);
}

.edit-workout-ex-select {
  background: #121824;
  color: #f1f5f9;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 6px;
  outline: none;
}

.edit-workout-ex-select:focus {
  border-color: var(--accent);
}

#editWorkoutExercisesList::-webkit-scrollbar {
  width: 6px;
}

#editWorkoutExercisesList::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
}

/* ==========================================================================
   WORKOUTS & PROFILE RESPONSIVE MEDIA QUERIES & MOBILE ADJUSTMENTS
   Prevents horizontal overflow and enforces fluid scaling on mobile screens.
   ========================================================================== */

/* Universal container containment for Workouts and Profile tabs */
#tab-workouts,
#tab-profile {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
}

#tab-workouts *,
#tab-profile * {
  box-sizing: border-box;
}

/* Ensure code and pre elements wrap and never force scroll on mobile */
#tab-profile pre,
#tab-workouts pre {
  max-width: 100%;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

#tab-profile code,
#tab-workouts code {
  max-width: 100%;
  word-break: break-all;
  overflow-wrap: anywhere;
}

#webhookUrlDisplay {
  word-break: break-all !important;
  overflow-wrap: anywhere !important;
  white-space: normal !important;
  display: inline-block;
  max-width: 100%;
}

/* Workout heatmap legend base styles */
.workout-heatmap-legend-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--muted);
  margin-bottom: 0.4rem;
  padding: 0 0.25rem;
  flex-wrap: wrap;
  gap: 0.35rem;
  width: 100%;
}

.workout-heatmap-legend-scale {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
  max-width: 100%;
}

/* Base safeguard for muscle chips */
.muscle-chip {
  max-width: 100%;
}
.muscle-chip > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* TABLET & MOBILE (< 768px) */
@media (max-width: 768px) {
  #tab-home .panel,
  #tab-workouts .panel,
  #tab-profile .panel {
    padding: 0.9rem 0.8rem;
    max-width: 100%;
    min-width: 0;
  }

  .hero {
    padding: 0.85rem 0.75rem !important;
    gap: 0.65rem !important;
  }

  .workout-summary-grid {
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 0.45rem;
  }
}

/* MOBILE MEDIUM & SMALL (< 640px) */
@media (max-width: 640px) {
  /* Panels and headers */
  #tab-home .panel,
  #tab-workouts .panel,
  #tab-profile .panel {
    padding: 0.8rem 0.7rem;
    border-radius: var(--radius-lg);
    max-width: 100%;
    min-width: 0;
  }

  .hero {
    padding: 0.75rem 0.65rem !important;
  }

  .road-metrics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .road-rep-targets-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .road-assistance-grid {
    grid-template-columns: 1fr !important;
  }

  #tab-workouts .panel-header > div,
  #tab-profile .panel-header > div {
    flex-direction: column;
    align-items: stretch !important;
    gap: 0.5rem !important;
  }

  #tab-workouts .panel-header > div > div:last-child {
    display: flex;
    width: 100%;
    gap: 0.4rem;
    flex-wrap: wrap;
  }

  #tab-workouts .panel-header > div > div:last-child button {
    flex: 1 1 auto;
    min-width: 0;
    justify-content: center;
  }

  /* Active workout banner */
  .active-workout-banner {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    padding: 0.85rem 0.9rem;
  }

  .active-workout-banner-text {
    width: 100%;
    min-width: 0;
  }

  .active-workout-banner > div:last-child {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
  }

  .active-workout-banner > div:last-child button {
    width: 100%;
    justify-content: center;
  }

  /* Workout cards */
  .workout-card {
    padding: 0.85rem 0.75rem;
    border-radius: var(--radius-md);
    gap: 0.65rem;
  }

  .workout-header {
    flex-direction: column;
    align-items: stretch;
    gap: 0.6rem;
  }

  .workout-title-area {
    width: 100%;
    min-width: 0;
  }

  .workout-title {
    font-size: 1.05rem;
    word-break: break-word;
    overflow-wrap: break-word;
  }

  .workout-meta {
    font-size: 0.76rem;
    flex-wrap: wrap;
    gap: 0.3rem;
  }

  .workout-badge-strip {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    justify-content: flex-start;
  }

  .workout-badge-strip .pill,
  .workout-badge-strip .chip,
  .workout-badge-strip button {
    font-size: 0.72rem;
    padding: 0.25rem 0.5rem;
  }

  /* Summary grid: 2 equal fluid columns */
  .workout-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.4rem;
    padding: 0.5rem;
  }

  .workout-stat {
    min-width: 0;
  }

  .workout-stat-label {
    font-size: 0.65rem;
    word-break: break-word;
    overflow-wrap: break-word;
  }

  .workout-stat-val {
    font-size: 0.88rem;
    word-break: break-word;
    overflow-wrap: break-word;
  }

  /* Muscle heatmap container in workouts */
  .workout-muscle-heatmap-container {
    padding: 0.7rem 0.55rem;
    width: 100%;
    max-width: 100%;
  }

  .workout-heatmap-legend-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.3rem;
  }

  .workout-heatmap-legend-scale {
    font-size: 0.68rem;
    gap: 0.25rem;
    width: 100%;
  }

  .muscle-views-grid {
    gap: 0.5rem;
    padding: 0.6rem 0.35rem;
  }

  .muscle-view-pane {
    max-width: 100%;
    width: 100%;
  }

  .muscle-body-svg {
    max-height: 220px;
    width: 100%;
  }

  .muscle-chip {
    font-size: 0.72rem;
    padding: 0.2rem 0.45rem;
  }

  /* Workout actions bar */
  .workout-actions-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }

  .workout-actions-bar > div,
  .workout-actions-group {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
  }

  .workout-actions-bar button {
    flex: 1 1 auto;
    justify-content: center;
    min-width: 0;
    font-size: 0.74rem;
    padding: 0.3rem 0.5rem;
  }

  .workout-comment-form {
    flex-direction: row;
    width: 100%;
  }

  .workout-comment-form input {
    min-width: 0;
    flex: 1;
    font-size: 0.82rem;
    padding: 0.5rem 0.7rem;
  }

  /* Profile Tab adjustments */
  #tab-profile .hero-stats .stat-card-wide {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.8rem;
    padding: 0.95rem 0.75rem;
  }

  #tab-profile .hero-stats .stat-card-wide .profile-header-user-info,
  #tab-profile .hero-stats .stat-card-wide > div:last-child {
    min-width: 0 !important;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  #tab-profile .hero-stats .stat-card-wide div[style*="display:flex"] {
    justify-content: center;
    width: 100%;
  }

  .profile-stats-shortcut-card {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.75rem !important;
    padding: 0.85rem 0.75rem !important;
  }

  .profile-stats-shortcut-card button {
    width: 100% !important;
    justify-content: center;
  }

  /* Aesthetics & Balance Section */
  #aestheticsContainer {
    width: 100%;
  }

  .aesthetics-card {
    padding: 0.85rem 0.7rem !important;
    border-radius: 10px !important;
  }

  .aesthetics-baseline-header {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 0.25rem !important;
  }

  .aesthetics-sweetspot-label {
    font-size: 0.62rem !important;
    white-space: normal !important;
  }

  /* Anatomy recovery section */
  #anatomyContainer {
    width: 100%;
    overflow-x: hidden;
  }

  .recovery-readiness-panel {
    width: 100%;
    overflow-x: hidden;
  }

  /* Forms & Theme song */
  #updateProfileForm {
    width: 100%;
  }

  #updateProfileForm input {
    font-size: 0.88rem;
    padding: 0.65rem 0.85rem;
  }

  #profileThemeSection .panel-header > div {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 0.4rem;
  }

  #profileThemeSection div[style*="display:flex"] {
    width: 100%;
  }

  #profileThemeSection div[style*="display:flex"] button {
    flex: 1 1 auto;
    justify-content: center;
  }

  /* PWA & notifications */
  .pwa-icon-box {
    gap: 0.65rem;
  }

  .notification-box div[style*="display: flex"] {
    flex-direction: column;
    gap: 0.4rem;
    width: 100%;
  }

  .notification-box button {
    width: 100% !important;
    min-width: 0 !important;
  }

  /* Auto-sync watch panel */
  #autoSyncPanel .accordion-panel {
    padding: 0.75rem 0.65rem !important;
  }

  #autoSyncPanel ol {
    padding-left: 1rem !important;
  }

  #autoSyncPanel pre {
    padding: 0.4rem 0.5rem !important;
    font-size: 0.75rem !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    white-space: pre-wrap !important;
    word-break: break-all !important;
  }

  #autoSyncPanel code {
    word-break: break-all !important;
    overflow-wrap: anywhere !important;
    white-space: normal !important;
    max-width: 100% !important;
  }

  #autoSyncPanel div[style*="justify-content: space-between"] {
    flex-direction: column;
    align-items: stretch !important;
    gap: 0.6rem !important;
  }

  #autoSyncPanel div[style*="justify-content: space-between"] button {
    width: 100% !important;
  }
}

/* EXTRA SMALL MOBILE (< 440px) */
@media (max-width: 440px) {
  #tab-workouts .panel,
  #tab-profile .panel {
    padding: 0.75rem 0.6rem;
  }

  .workout-card {
    padding: 0.75rem 0.6rem;
  }

  .workout-ex-main-group {
    gap: 0.5rem;
  }

  .workout-ex-anatomy-box {
    width: 40px;
    height: 68px;
    padding: 2px;
  }

  .workout-ex-anatomy-box .muscle-body-svg {
    width: 34px;
    height: 58px;
  }

  .workout-ex-anatomy-tag {
    font-size: 0.55rem;
    padding: 0.05rem 0.2rem;
  }

  .workout-exercise-name {
    font-size: 0.84rem;
  }

  .workout-exercise-metric {
    font-size: 0.8rem;
  }

  .workout-ex-records-badge-box {
    grid-template-columns: 1fr;
    gap: 0.3rem;
  }

  .workout-ex-record-stat {
    padding: 0.25rem 0.4rem;
  }

  .anatomy-views-wrapper {
    gap: 0.4rem !important;
  }

  .anatomy-legend-grid {
    font-size: 0.72rem !important;
    gap: 0.3rem !important;
    padding: 0 !important;
  }

  .modal-overlay {
    padding: 0.5rem;
  }

  .modal-card {
    padding: 1.25rem 0.85rem;
    border-radius: var(--radius-lg);
  }
}

/* VERY NARROW SCREENS (< 360px) */
@media (max-width: 360px) {
  .workout-summary-grid {
    grid-template-columns: 1fr;
  }

  #workoutsFilterSegment {
    grid-template-columns: 1fr;
  }
}




