/* ==================================================
   WDHC Athlete Portal · Dashboard Styles v3.0
   Dark theme, gold accents, mobile-first responsive
   ================================================== */

/* === CSS Custom Properties === */
:root {
  --gold: #D4AF37;
  --gold-dark: #b8962f;
  --gold-light: #f4e4a6;
  --gold-glow: rgba(212, 175, 55, 0.15);
  --gold-glow-strong: rgba(212, 175, 55, 0.3);

  --bg-primary: #050505;
  --bg-secondary: #0a0a0a;
  --bg-tertiary: #0f0f0f;
  --bg-card: #111111;
  --bg-card-hover: #161616;
  --bg-input: #0d0d0d;

  --border-subtle: #1a1a1a;
  --border-default: #222222;
  --border-hover: #333333;
  --border-gold: rgba(212, 175, 55, 0.3);

  --text-primary: #ffffff;
  --text-secondary: #c8c8c8;
  --text-tertiary: #a8a8a8;
  --text-muted: #b5b5b5;

  --success: #22c55e;
  --success-bg: rgba(34, 197, 94, 0.1);
  --danger: #ef4444;
  --danger-bg: rgba(239, 68, 68, 0.1);
  --warning: #f59e0b;

  --font-heading: 'Oswald', sans-serif;
  --font-display: 'Rajdhani', sans-serif;
  --font-body: 'Source Sans 3', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-mono: 'Rajdhani', sans-serif;
  --wdhc-cta-gradient: linear-gradient(135deg, #D4AF37 0%, #cd7f32 100%);

  --sidebar-width: 300px;
  --bronze: #cd7f32;
  --accent-red: #ef4444;
  --accent-orange: #f59e0b;
  --accent-blue: #3b82f6;
  --mobile-header-height: 56px;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
  --transition-slow: 0.4s ease;
}

/* === Reset / Base === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* === Dashboard Page === */
.dashboard-page {
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-weight: 500;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* === Mobile Header === */
.mobile-header {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--mobile-header-height);
  background: rgba(5, 5, 5, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  z-index: 1001;
  align-items: center;
  padding: 0 16px;
  gap: 12px;
}

.mobile-menu-toggle {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  flex-shrink: 0;
}
.hamburger-line {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: var(--transition-fast);
}

.mobile-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  flex: 1;
  min-width: 0;
}
.mobile-logo-img { height: 28px; width: auto; max-width: 110px; object-fit: contain; flex-shrink: 0; }
.mobile-logo-text {
  font-family: var(--font-heading);
  font-size: 1rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mobile-logo-text em { color: var(--gold); font-style: normal; font-size: 0.75rem; margin-left: 4px; }

.mobile-logout {
  background: none;
  border: none;
  color: var(--text-tertiary);
  cursor: pointer;
  padding: 6px;
  flex-shrink: 0;
  transition: color var(--transition-fast);
}
.mobile-logout:hover { color: var(--text-primary); }

/* Promo screenshot capture (?promo=1) */
body.promo-capture #skeletonLoader,
body.promo-capture #errorState,
body.promo-capture .mobile-header,
body.promo-capture .toast-container {
  display: none !important;
}

body.promo-capture .dashboard-layout {
  min-height: auto;
}

body.promo-capture .dashboard-content {
  display: block !important;
}

/* === Layout === */
.dashboard-layout {
  display: flex;
  min-height: 100vh;
}

/* === Sidebar Overlay (mobile) === */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 999;
  backdrop-filter: blur(2px);
}
.sidebar-overlay.active { display: block; }

/* === Sidebar === */
.dashboard-sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  height: 100dvh;
  z-index: 1000;
  overflow: hidden;
  transition: transform var(--transition-normal);
}
.sidebar-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  padding: 0;
  overflow: hidden;
}

/* Sidebar Brand */
.sidebar-brand,
.sidebar-profile {
  flex-shrink: 0;
}
.sidebar-brand {
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border-subtle);
}
.sidebar-brand-link {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}
.sidebar-brand-logo {
  width: auto;
  height: 72px;
  max-width: 260px;
  object-fit: contain;
  flex-shrink: 0;
}
.sidebar-brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.sidebar-brand-name {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}
.sidebar-brand-sub {
  display: block;
  font-size: 0.72rem;
  color: var(--gold);
  letter-spacing: 1.2px;
  text-transform: uppercase;
  margin-top: 3px;
  font-weight: 600;
}

/* Sidebar Profile */
.sidebar-profile {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border-subtle);
}
.sidebar-profile-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--gold-glow);
  border: 2px solid var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-size: 1rem;
  color: var(--gold);
  flex-shrink: 0;
}
.sidebar-profile-name {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-profile-rank {
  font-size: 0.8rem;
  color: var(--gold);
  font-weight: 600;
}

/* Sidebar Nav */
.sidebar-nav {
  flex: 1 1 auto;
  min-height: 0;
  padding: 12px 0 4px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all var(--transition-fast);
  border-left: 3px solid transparent;
  white-space: nowrap;
}
.sidebar-link:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}
.sidebar-link.active {
  background: var(--gold-glow);
  color: var(--gold);
  border-left-color: var(--gold);
  font-weight: 600;
}
.sidebar-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* Sidebar Footer */
.sidebar-footer {
  flex-shrink: 0;
  margin-top: auto;
  padding: 16px 20px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--bg-secondary);
  position: relative;
  z-index: 2;
}

.sidebar-quick-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.sidebar-qs-item {
  text-align: center;
  padding: 8px 4px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
}
.sidebar-qs-label {
  display: block;
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.sidebar-qs-value {
  display: block;
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  color: var(--gold);
  margin-top: 2px;
}

/* Sidebar Buttons */
.btn-sidebar-primary,
.btn-sidebar-secondary,
.btn-sidebar-ghost {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  border: none;
  font-family: var(--font-body);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.btn-sidebar-primary {
  background: var(--wdhc-cta-gradient);
  color: #000;
  box-shadow: 0 2px 12px rgba(212, 175, 55, 0.25);
}
.btn-sidebar-primary:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(212, 175, 55, 0.35);
}
.btn-sidebar-secondary {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border: 1px solid var(--border-default);
}
.btn-sidebar-secondary:hover {
  border-color: var(--gold);
  color: var(--gold);
}
.btn-sidebar-ghost {
  background: transparent;
  color: var(--text-tertiary);
  border: 1px solid var(--border-default);
}
.btn-sidebar-ghost:hover {
  border-color: var(--text-secondary);
  color: var(--text-secondary);
}

.sidebar-actions-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.btn-sidebar-split {
  width: 100%;
  padding: 8px 8px;
  font-size: 0.68rem;
  letter-spacing: 0.35px;
  line-height: 1.2;
  gap: 5px;
  flex-direction: column;
}

.btn-sidebar-split span {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* === Main Content === */
.dashboard-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  padding: 32px;
  min-height: 100vh;
  background:
    radial-gradient(ellipse 90% 50% at 50% -10%, rgba(212, 175, 55, 0.06) 0%, transparent 55%),
    radial-gradient(ellipse 60% 40% at 100% 20%, rgba(205, 127, 50, 0.04) 0%, transparent 50%),
    var(--bg-primary);
}

/* === Welcome Banner === */
.welcome-banner {
  background:
    radial-gradient(ellipse 70% 80% at 100% 0%, rgba(212, 175, 55, 0.1) 0%, transparent 55%),
    linear-gradient(135deg, rgba(14, 14, 14, 0.98) 0%, rgba(8, 8, 8, 0.99) 100%);
  border: 1px solid rgba(212, 175, 55, 0.18);
  border-left: 4px solid var(--gold);
  border-radius: var(--radius-xl);
  padding: 32px 36px;
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.welcome-banner::after {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.25;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
  background-size: 128px 128px;
  pointer-events: none;
  border-radius: inherit;
}
.welcome-content { position: relative; z-index: 1; }
.welcome-tier { position: relative; z-index: 1; }
.welcome-eyebrow {
  font-size: 0.7rem;
  color: var(--gold);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 4px;
  padding-left: 3px;
  line-height: 1.45;
}
.welcome-title {
  font-family: var(--font-heading);
  font-size: clamp(1.65rem, 4vw, 2.15rem);
  color: var(--text-primary);
  line-height: 1.08;
  letter-spacing: 0.5px;
}
.welcome-subtitle {
  font-size: 0.9rem;
  color: var(--text-tertiary);
  margin-top: 4px;
}
.welcome-tier {
  flex-shrink: 0;
}

/* === Content Sections === */
.content-section { display: none; }
.content-section.active { display: block; }

.section-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 16px;
  flex-wrap: wrap;
}
.section-title {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  color: var(--text-primary);
  letter-spacing: 0.5px;
}

/* === Stats Grid === */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: linear-gradient(160deg, rgba(20, 20, 20, 0.95) 0%, rgba(12, 12, 12, 0.98) 100%);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}
.stat-card[data-stat="grippage"] {
  border-color: rgba(34, 197, 94, 0.25);
  background:
    radial-gradient(ellipse 80% 60% at 100% 0%, rgba(34, 197, 94, 0.08) 0%, transparent 55%),
    linear-gradient(160deg, rgba(20, 20, 20, 0.95) 0%, rgba(12, 12, 12, 0.98) 100%);
}
.stat-card[data-stat="grippage"] .stat-card-value {
  color: var(--success);
  font-size: 2rem;
}
.stat-card[data-stat="grippage"] .stat-card-icon {
  background: var(--success-bg);
  color: var(--success);
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gold);
  opacity: 0;
  transition: opacity var(--transition-normal);
}
.stat-card:hover {
  border-color: var(--border-gold);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}
.stat-card:hover::before { opacity: 1; }

.stat-card-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--gold-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--gold);
}
.stat-card-icon svg { width: 20px; height: 20px; }

.stat-card-body { flex: 1; min-width: 0; }
.stat-card-label {
  display: block;
  font-size: 0.72rem;
  color: #f0f0f0;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 600;
  margin-bottom: 6px;
}
.stat-card-value {
  display: block;
  font-family: var(--font-heading);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--gold);
  line-height: 1;
}
/* === Gym benchmark === */
.gym-benchmark-card { margin-bottom: 24px; }
.gym-benchmark-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.gym-benchmark-title {
  font-family: var(--font-heading);
  font-size: 1rem;
  color: var(--text-primary);
  margin: 0;
}
.gym-benchmark-name {
  font-size: 0.82rem;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 1px;
}
.gym-benchmark-lead { color: var(--text-secondary); font-size: 0.92rem; margin: 0 0 16px; line-height: 1.5; }
.gym-benchmark-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 14px;
}
.gym-benchmark-stats .label {
  display: block;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.gym-benchmark-stats .mono { font-size: 1.15rem; color: var(--gold); font-weight: 700; }
.gym-benchmark-link { font-size: 0.88rem; color: var(--gold); text-decoration: none; font-weight: 600; }
.gym-benchmark-link:hover { text-decoration: underline; }

/* === Tier Progress === */
.tier-progress-section {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
}
.tier-progress-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.tier-progress-title {
  font-family: var(--font-heading);
  font-size: 1rem;
  color: var(--text-primary);
}
.tier-progress-current {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}
.tier-progress-next-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
}
.tier-progress-next-text {
  font-size: 0.82rem;
  color: var(--text-secondary);
  font-weight: 600;
}
.stats-color-legend {
  margin: -8px 0 24px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.02);
}
.stats-color-legend-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
}
.stats-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--text-tertiary);
  line-height: 1.2;
}
.stats-legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.stats-legend-item--good .stats-legend-dot { background: var(--success); }
.stats-legend-item--elite .stats-legend-dot { background: var(--gold); }
.stats-legend-item--warn .stats-legend-dot { background: var(--warning); }
.stats-legend-item--bad .stats-legend-dot { background: var(--danger); }
@media (max-width: 768px) {
  .tier-progress-current { justify-content: flex-start; }
  .tier-progress-next-row { justify-content: flex-start; }
}
.tier-progress-bar-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
}
.tier-progress-bar {
  flex: 1;
  height: 8px;
  background: var(--bg-tertiary);
  border-radius: 4px;
  overflow: hidden;
}
.tier-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold-dark), var(--gold));
  border-radius: 4px;
  transition: width 0.8s ease;
  min-width: 0;
}
.tier-progress-pct {
  font-family: var(--font-heading);
  font-size: 0.8rem;
  color: var(--gold);
  font-weight: 600;
  white-space: nowrap;
  min-width: 36px;
  text-align: right;
}
.tier-progress-markers {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  padding: 0 2px;
}
.tier-marker {
  font-size: 0.6rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.tier-marker.active { color: var(--gold); font-weight: 700; }

/* === Streak Badges === */
.streak-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 24px;
}
.streak-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.3px;
}
.streak-badge--pr {
  background: linear-gradient(135deg, rgba(255, 107, 53, 0.15), rgba(255, 107, 53, 0.05));
  border: 1px solid rgba(255, 107, 53, 0.3);
  color: #ff6b35;
}
.streak-badge--monthly {
  background: var(--gold-glow);
  border: 1px solid var(--border-gold);
  color: var(--gold);
}

/* === Profile Summary Grid === */
.profile-summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

.profile-card,
.years-saved-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
}
.profile-card-title {
  font-family: var(--font-heading);
  font-size: 1rem;
  color: var(--gold);
  margin-bottom: 16px;
}
.profile-card-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.profile-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.profile-stat-label {
  font-size: 0.72rem;
  color: #ececec;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  font-weight: 600;
}
.profile-stat-value {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.years-saved-card {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  overflow: hidden;
  min-height: 200px;
  padding: 32px 28px;
  border: 1px solid rgba(212, 175, 55, 0.28);
  background:
    radial-gradient(ellipse 80% 70% at 50% 20%, rgba(212, 175, 55, 0.16) 0%, transparent 60%),
    linear-gradient(165deg, rgba(28, 22, 10, 0.98) 0%, rgba(10, 10, 10, 0.99) 100%);
}
.years-saved-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(212, 175, 55, 0.12) 0%, transparent 72%);
  pointer-events: none;
}
.years-saved-inner {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 22rem;
  margin: 0 auto;
}
.years-saved-eyebrow {
  margin: 0 0 12px;
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 600;
  color: #d4c4a0;
  text-transform: uppercase;
  letter-spacing: 2px;
}
.years-saved-label {
  display: block;
  font-size: 0.85rem;
  color: #d4c4a0;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 12px;
}
.years-saved-value {
  display: block;
  margin: 0;
  font-family: var(--font-heading);
  font-size: clamp(3.25rem, 8vw, 4.5rem);
  font-weight: 700;
  color: var(--gold);
  line-height: 0.95;
  letter-spacing: 0.02em;
  text-shadow: 0 0 28px rgba(212, 175, 55, 0.35);
}
.years-saved-caption {
  margin: 10px 0 0;
  font-family: var(--font-heading);
  font-size: clamp(1.15rem, 2.8vw, 1.45rem);
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: #f0e6c8;
}
.years-saved-sub {
  display: block;
  margin: 14px 0 0;
  font-size: 1rem;
  line-height: 1.45;
  color: #c8c8c8;
  font-weight: 500;
}
.years-saved-card.is-younger .years-saved-value { color: var(--gold); }
.years-saved-card.is-older .years-saved-value,
.years-saved-card.negative .years-saved-value { color: #e07070; }
.years-saved-card.is-older .years-saved-caption { color: #e8b0b0; }
.years-saved-card.is-match .years-saved-value { color: #d0d0d0; }
.years-saved-card.is-empty .years-saved-value { color: #666; text-shadow: none; }

/* === Table === */
.table-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
}
.data-table thead {
  background: var(--bg-tertiary);
}
.data-table th {
  padding: 12px 16px;
  text-align: left;
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
  cursor: default;
  user-select: none;
}
.data-table th.sortable { cursor: pointer; }
.data-table th.sortable:hover { color: var(--gold); }
.data-table td {
  padding: 12px 16px;
  font-size: 0.9rem;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}
.data-table tbody tr:hover { background: var(--bg-card-hover); }
.data-table tbody tr:last-child td { border-bottom: none; }
.table-empty {
  text-align: center;
  color: var(--text-muted);
  padding: 40px !important;
  font-style: italic;
}
.pr-badge {
  display: inline-block;
  padding: 2px 8px;
  background: var(--gold);
  color: #000;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.5px;
}
.verified-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8rem;
  color: var(--success);
  font-weight: 600;
}
.pending-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.mono { font-family: var(--font-heading); font-weight: 700; }

/* === Chart === */
.chart-container {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  position: relative;
  height: 360px;
}
.chart-controls {
  display: flex;
  gap: 6px;
}
.chart-btn {
  padding: 6px 14px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  font-family: var(--font-body);
}
.chart-btn:hover { border-color: var(--gold); color: var(--gold); }
.chart-btn.active {
  background: var(--gold);
  border-color: var(--gold);
  color: #000;
}

/* === Calculator === */
.calc-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.calc-inputs {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.calc-field { display: flex; flex-direction: column; gap: 6px; }
.calc-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
}
.calc-input {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.95rem;
  transition: border-color var(--transition-fast);
}
.calc-input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-glow);
}
.calc-select { cursor: pointer; appearance: auto; }
.calc-time-inputs { display: flex; align-items: center; gap: 8px; }
.calc-time { width: 80px !important; text-align: center; font-family: var(--font-heading); }
.calc-time-sep { color: var(--text-muted); font-size: 1.2rem; font-weight: 700; }

.calc-result {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.calc-result-card {
  background: var(--bg-card);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.calc-result-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, var(--gold-glow) 0%, transparent 70%);
  pointer-events: none;
}
.calc-result-label {
  display: block;
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 8px;
  position: relative;
}
.calc-result-value {
  display: block;
  font-family: var(--font-heading);
  font-size: 3.5rem;
  font-weight: 700;
  color: var(--gold);
  line-height: 1;
  position: relative;
}
.calc-result-years {
  display: block;
  font-size: 0.85rem;
  color: var(--text-tertiary);
  margin-top: 6px;
  position: relative;
}
.calc-result-details {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.calc-detail {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
}
.calc-detail span:first-child { color: var(--text-tertiary); }
.calc-detail span:last-child { color: var(--text-primary); font-weight: 600; }

/* === Achievements === */
.achievements-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
.achievement-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  text-align: center;
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}
.achievement-card.unlocked {
  border-color: var(--border-gold);
}
.achievement-card.unlocked::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top, var(--gold-glow) 0%, transparent 60%);
  pointer-events: none;
}
.achievement-card.locked {
  opacity: 0.45;
}
.achievement-icon {
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 88px;
}
.achievement-icon .ach-badge {
  margin: 0 auto;
}
.achievement-name {
  font-family: var(--font-heading);
  font-size: 0.9rem;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.achievement-desc {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  line-height: 1.4;
}
.achievement-status {
  display: inline-block;
  margin-top: 10px;
  padding: 3px 10px;
  border-radius: 10px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.achievement-card.unlocked .achievement-status {
  background: var(--gold);
  color: #000;
}
.achievement-card.locked .achievement-status {
  background: var(--bg-tertiary);
  color: var(--text-muted);
}

/* === Modals === */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.active { display: flex; }

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  padding: 32px;
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  animation: modalIn 0.25s ease;
}
.modal-sm { max-width: 440px; }

@keyframes modalIn {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
  padding: 4px;
  transition: color var(--transition-fast);
  z-index: 1;
}
.modal-close:hover { color: var(--text-primary); }

.modal-header { margin-bottom: 24px; }
.modal-title {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  color: var(--gold);
  margin-bottom: 4px;
}
.modal-subtitle {
  font-size: 0.85rem;
  color: var(--text-tertiary);
}

.modal-form { display: flex; flex-direction: column; gap: 16px; }

.form-row { display: flex; flex-direction: column; gap: 6px; }
.form-label {
  font-size: 0.7rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
}
.form-label .req { color: var(--danger); }

.form-input {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.95rem;
  transition: border-color var(--transition-fast);
}
.form-input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-glow);
}
.form-textarea { resize: vertical; min-height: 60px; }
.form-select { cursor: pointer; appearance: auto; }

.time-inputs { display: flex; align-items: center; gap: 10px; }
.time-input { width: 70px; text-align: center; font-family: var(--font-heading); font-size: 1.1rem; }
.time-sep { color: var(--text-muted); font-size: 1.4rem; font-weight: 700; }
.time-label { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }

.form-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 6px;
  line-height: 1.4;
}

.watch-visibility-card {
  padding: 14px 16px;
  background: rgba(212, 175, 55, 0.06);
  border: 1px solid rgba(212, 175, 55, 0.28);
  border-radius: var(--radius-sm);
}

.watch-visibility-default {
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.watch-visibility-default strong {
  display: block;
  color: var(--text-primary);
  font-size: 0.98rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.watch-visibility-default p {
  margin: 0;
  font-size: 0.86rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

.watch-opt-in-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.watch-opt-in-row input[type="checkbox"] {
  width: auto;
  margin-top: 3px;
  flex-shrink: 0;
  accent-color: var(--gold);
}
.watch-opt-in-row label {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.45;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
}
.watch-visibility-optout label strong {
  color: var(--text-primary);
}

.consent-block {
  margin-top: 4px;
  padding: 16px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--gold);
}

.consent-heading {
  font-family: 'Oswald', sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--gold);
  margin-bottom: 6px;
  font-size: 0.9rem;
}

.consent-intro,
.consent-hint {
  color: var(--text-muted);
  font-size: 0.82rem;
  margin-bottom: 12px;
  line-height: 1.45;
}

.consent-hint {
  text-align: center;
  margin-top: 10px;
  margin-bottom: 0;
}

.consent-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 12px;
}

.consent-item:last-child {
  margin-bottom: 0;
}

.consent-item input[type="checkbox"] {
  width: auto;
  margin-top: 3px;
  flex-shrink: 0;
  accent-color: var(--gold);
}

.consent-item label {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.45;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
}

.consent-item a {
  color: var(--gold);
  text-decoration: underline;
}

.minor-consent-block {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.minor-notice {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0 0 10px;
  line-height: 1.4;
}

#submitHangBtn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Modal Buttons */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  background: var(--wdhc-cta-gradient);
  color: #000;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: 0 2px 12px rgba(212, 175, 55, 0.22);
}
.btn-primary:hover { filter: brightness(1.06); transform: translateY(-1px); box-shadow: 0 4px 16px rgba(212, 175, 55, 0.32); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-full { width: 100%; }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
}
.btn-secondary:hover { border-color: var(--gold); color: var(--gold); }

.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.btn-outline:hover { border-color: var(--gold); color: var(--gold); }

.overview-header {
  margin-bottom: 20px;
}
.overview-title {
  font-family: var(--font-heading);
  font-size: 1.45rem;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}
.overview-subtitle {
  font-size: 0.9rem;
  color: var(--text-tertiary);
}
.overview-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0 0 20px;
}
.btn-twitter { background: #000; border-color: #333; color: #fff; }
.btn-twitter:hover { background: #111; border-color: #555; color: #fff; }

.btn-sm { padding: 6px 14px; font-size: 0.8rem; }
.btn-ghost {
  background: transparent;
  border: 1px solid var(--border-default);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: var(--font-body);
  font-weight: 600;
  transition: all var(--transition-fast);
}
.btn-ghost:hover { border-color: var(--gold); color: var(--gold); }

/* Modal Error */
.modal-error {
  display: none;
  padding: 12px 16px;
  background: var(--danger-bg);
  border: 1px solid var(--danger);
  border-radius: var(--radius-sm);
  color: var(--danger);
  font-size: 0.85rem;
  margin-bottom: 16px;
}
.modal-error.active { display: block; }

/* Modal Success */
.modal-success {
  display: none;
  text-align: center;
  padding: 20px 0;
}
.modal-success.active { display: block; }
.success-icon {
  font-size: 3rem;
  color: var(--success);
  margin-bottom: 12px;
}
.success-title {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  color: var(--gold);
  margin-bottom: 8px;
}
.success-text {
  font-size: 0.9rem;
  color: var(--text-tertiary);
  margin-bottom: 20px;
}

/* === Share Card === */
.share-card {
  background: #000;
  border: 2px solid var(--gold);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  text-align: center;
  margin-bottom: 16px;
}
.share-card-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 16px;
}
.share-card-logo { width: auto; height: 20px; max-width: 80px; object-fit: contain; }
.share-card-brand {
  font-family: var(--font-heading);
  font-size: 0.9rem;
  color: var(--gold);
  letter-spacing: 1px;
}
.share-card-name {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 4px;
}
.share-card-grippage {
  font-family: var(--font-heading);
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--gold);
  line-height: 1.1;
}
.share-card-meta {
  font-size: 0.9rem;
  color: var(--text-primary);
  margin-top: 6px;
}
.share-card-years {
  font-size: 0.85rem;
  color: var(--success);
  margin-top: 4px;
  font-weight: 600;
}
.share-card-url {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 10px;
}

.share-textarea {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.85rem;
  resize: none;
  margin-bottom: 14px;
}
.share-actions {
  display: flex;
  gap: 10px;
}
.share-actions > * { flex: 1; }

/* === Responsive === */

/* Tablet */
@media (max-width: 1024px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .profile-summary-grid { grid-template-columns: 1fr; }
  .calc-layout { grid-template-columns: 1fr; }
}

body.sidebar-open {
  overflow: hidden;
}

/* Mobile */
@media (max-width: 768px) {
  .mobile-header { display: flex; z-index: 1003; }

  .sidebar-overlay {
    top: var(--mobile-header-height);
    z-index: 1001;
  }

  .dashboard-sidebar {
    transform: translateX(-100%);
    top: var(--mobile-header-height);
    height: calc(100dvh - var(--mobile-header-height));
    z-index: 1002;
  }
  .dashboard-sidebar.open {
    transform: translateX(0);
  }

  .dashboard-content {
    margin-left: 0;
    padding: calc(var(--mobile-header-height) + 16px) 16px 32px;
  }

  .welcome-banner {
    flex-direction: column;
    align-items: flex-start;
    padding: 20px;
  }
  .welcome-title { font-size: 1.4rem; }

  .stats-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .stat-card { padding: 16px; }
  .stat-card-value { font-size: 1.4rem; }
  .stat-card-icon { width: 34px; height: 34px; }
  .stat-card-icon svg { width: 16px; height: 16px; }

  .profile-summary-grid { grid-template-columns: 1fr; }

  .chart-container { padding: 16px; height: 280px; }

  .achievements-grid { grid-template-columns: 1fr 1fr; }

  .modal { padding: 24px 20px; }
}

/* Small Mobile */
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  #section-overview .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .achievements-grid { grid-template-columns: 1fr; }
  .section-header-row { flex-direction: column; align-items: flex-start; }
  .chart-controls { width: 100%; overflow-x: auto; }
}

/* === Scrollbar === */
.sidebar-nav::-webkit-scrollbar,
.dashboard-content::-webkit-scrollbar { width: 6px; }
.sidebar-nav::-webkit-scrollbar-track,
.dashboard-content::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb,
.dashboard-content::-webkit-scrollbar-thumb { background: var(--border-default); border-radius: 3px; }
.sidebar-nav::-webkit-scrollbar-thumb:hover,
.dashboard-content::-webkit-scrollbar-thumb:hover { background: var(--border-hover); }

/* ==================================================
   WDHC Athlete Portal · Dashboard Styles v3.0
   Sections 18-21: Streak Card, GripAge Trend, Email Prefs (Gamification Additions)
   ================================================== */

/* === Weekly Streak Card === */
.streak-card {
  padding: 24px;
  margin-bottom: 24px;
  background: linear-gradient(135deg, #111 0%, #1a1a1a 100%);
  border: 1px solid var(--border-default);
}
.streak-card-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 16px;
}
.streak-card-title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  letter-spacing: 0.5px;
  margin: 0;
}
.streak-card-subtitle {
  font-size: 0.75rem;
  color: var(--text-tertiary);
}
.streak-main {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}
.streak-flame {
  font-size: 2.5rem;
  line-height: 1;
}
.streak-weeks {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--gold);
  line-height: 1;
}
.streak-label {
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 2px;
}
.streak-since {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  margin-top: 4px;
}
.streak-max-badge {
  margin-left: auto;
  background: linear-gradient(135deg, #D4AF37, #B8860B);
  color: #000;
  padding: 4px 12px;
  border-radius: 20px;
  font-family: var(--font-heading);
  font-size: 0.7rem;
  letter-spacing: 1px;
  font-weight: 700;
}
.streak-empty {
  color: var(--text-tertiary);
  font-size: 0.9rem;
  text-align: center;
  padding: 20px;
}

/* Milestone progress */
.streak-milestone-progress {
  margin-bottom: 16px;
}
.streak-milestone-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-tertiary);
  margin-bottom: 6px;
}
.streak-milestone-bar {
  background: var(--border-default);
  border-radius: 4px;
  height: 8px;
  overflow: hidden;
}
.streak-milestone-fill {
  background: linear-gradient(90deg, var(--gold), #22c55e);
  height: 100%;
  border-radius: 4px;
  transition: width 0.4s ease;
}
.streak-milestone-remaining {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 6px;
  text-align: center;
}
.streak-all-earned {
  text-align: center;
  color: var(--gold);
  font-family: var(--font-heading);
  font-size: 0.85rem;
  letter-spacing: 0.5px;
  padding: 8px;
}

/* Milestone badges row */
.streak-milestones-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}
.streak-milestone-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-default);
  background: var(--bg-tertiary);
  min-width: 68px;
  transition: var(--transition-fast);
}
.streak-milestone-badge.earned {
  border-color: var(--gold);
  background: var(--gold-glow);
}
.streak-milestone-badge.locked {
  opacity: 0.4;
}
.sm-icon { font-size: 1.1rem; }
.sm-label {
  font-size: 0.65rem;
  color: var(--text-tertiary);
  font-family: var(--font-body);
  text-align: center;
  line-height: 1.2;
}
.streak-milestone-badge.earned .sm-label {
  color: var(--text-secondary);
}

/* === Chart Empty State === */
.chart-container .chart-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-tertiary);
  font-size: 0.9rem;
  text-align: center;
  padding: 40px;
}

/* === Email Preferences === */
.email-pref-card {
  padding: 20px 24px;
}
.email-pref-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.email-pref-label {
  display: block;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 2px;
}
.email-pref-desc {
  display: block;
  font-size: 0.8rem;
  color: var(--text-tertiary);
}
.email-pref-note {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin: 12px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
}

/* Toggle switch */
.email-pref-toggle {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
  flex-shrink: 0;
}
.email-pref-toggle input { opacity: 0; width: 0; height: 0; }
.email-pref-toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--border-default);
  border-radius: 26px;
  transition: 0.3s;
}
.email-pref-toggle-slider::before {
  content: "";
  position: absolute;
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: 0.3s;
}
.email-pref-toggle input:checked + .email-pref-toggle-slider {
  background: var(--gold);
}
.email-pref-toggle input:checked + .email-pref-toggle-slider::before {
  transform: translateX(22px);
}

/* Toast notification */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-family: var(--font-body);
  font-weight: 600;
  animation: toast-in 0.3s ease, toast-out 0.3s ease 2.7s;
  max-width: 320px;
}
.toast-success { background: var(--success-bg); color: var(--success); border: 1px solid rgba(34,197,94,0.3); }
.toast-error { background: var(--danger-bg); color: var(--danger); border: 1px solid rgba(239,68,68,0.3); }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toast-out { from { opacity: 1; } to { opacity: 0; } }

/* === Training Log === */
.section-subtitle {
  font-size: 0.85rem;
  color: var(--text-tertiary);
  margin-top: 4px;
}
.section-title-sm {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  letter-spacing: 0.5px;
  color: var(--text-primary);
}

.tl-beta-tag {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.55em;
  font-weight: 700;
  letter-spacing: 1px;
  vertical-align: middle;
  color: var(--warning);
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.tl-source-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  margin-right: 8px;
}
.tl-source-api {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid rgba(34, 197, 94, 0.25);
}
.tl-source-local {
  background: rgba(245, 158, 11, 0.12);
  color: var(--warning);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.tl-stats-grid {
  grid-template-columns: repeat(4, 1fr);
  margin-bottom: 20px;
}

.tl-charts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}
.tl-chart-card {
  min-height: 0;
  padding: 16px 18px 12px;
  overflow: hidden;
}
.tl-chart-card .card-title {
  margin-bottom: 12px;
  font-size: 0.9rem;
}
.tl-chart-canvas-wrap {
  position: relative;
  width: 100%;
  height: 220px;
  min-height: 180px;
  overflow: hidden;
}
.tl-chart-canvas-wrap canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
  max-height: 220px;
}
.tl-chart-full {
  grid-column: 1 / -1;
}

.tl-set-times {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.tl-set-time-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.tl-set-time-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 600;
  min-width: 48px;
  flex-shrink: 0;
}
.tl-set-line {
  display: block;
  font-size: 0.82rem;
}
.tl-set-line.tl-set-best {
  color: var(--gold);
  font-weight: 600;
}
.form-hint {
  font-size: 0.78rem;
  color: var(--text-tertiary);
  margin: -4px 0 10px;
}

.tl-plans-section {
  margin-bottom: 8px;
}
.tl-plans-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: 12px;
}
.tl-plan-card {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.tl-plan-header {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.tl-plan-level {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--gold);
  font-weight: 600;
}
.tl-plan-title {
  font-family: var(--font-heading);
  font-size: 1rem;
  letter-spacing: 0.3px;
}
.tl-plan-desc {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.5;
  flex: 1;
}
.tl-plan-meta {
  display: flex;
  gap: 12px;
  font-size: 0.75rem;
  color: var(--text-tertiary);
  font-family: var(--font-heading);
}
.tl-plans-empty {
  color: var(--text-tertiary);
  font-size: 0.9rem;
}

.tl-plan-detail {
  display: none;
  margin-top: 16px;
  padding: 18px 20px;
  max-height: 420px;
  overflow-y: auto;
}
.tl-plan-detail.active {
  display: block;
}
.tl-plan-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
.tl-plan-week {
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-subtle);
}
.tl-plan-week:last-child {
  border-bottom: none;
  margin-bottom: 0;
}
.tl-plan-week-title {
  font-family: var(--font-heading);
  font-size: 0.9rem;
  color: var(--gold);
  margin-bottom: 8px;
}
.tl-plan-sessions {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.tl-plan-sessions li {
  display: grid;
  grid-template-columns: 40px 1fr auto auto;
  gap: 8px;
  align-items: center;
  font-size: 0.82rem;
  padding: 8px 10px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}
.tl-plan-day {
  font-weight: 700;
  color: var(--text-secondary);
}
.tl-plan-var {
  color: var(--text-primary);
}
.tl-plan-prescription {
  color: var(--gold);
  font-size: 0.78rem;
}

.tl-log-meta {
  display: block;
  font-size: 0.72rem;
  color: var(--text-tertiary);
  font-family: var(--font-heading);
}
.tl-log-notes {
  display: block;
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border-default);
  color: var(--text-tertiary);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.75rem;
  transition: var(--transition-fast);
}
.btn-ghost:hover {
  color: var(--text-primary);
  border-color: var(--border-hover);
}

/* === Responsive Additions for New Sections === */
@media (max-width: 768px) {
  .streak-card-header { flex-direction: column; align-items: flex-start; gap: 4px; }
  .streak-weeks { font-size: 1.4rem; }
  .streak-flame { font-size: 2rem; }
  .streak-milestone-badge { min-width: 56px; padding: 6px 8px; }
  .email-pref-row { flex-direction: column; align-items: flex-start; }
  .tl-stats-grid { grid-template-columns: repeat(2, 1fr); }
  .tl-charts-grid { grid-template-columns: 1fr; }
  .tl-chart-canvas-wrap { height: 200px; min-height: 160px; }
  .tl-filter-bar { flex-wrap: wrap; gap: 10px; }
  .section-header-row .section-actions { flex-wrap: wrap; gap: 8px; }
  .tl-plans-grid { grid-template-columns: 1fr; }
  .tl-plan-sessions li {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

/* === Loading / error states === */
.skeleton-wrapper {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: var(--bg-primary);
  padding: 24px;
  overflow: auto;
}
.skeleton-layout {
  display: flex;
  gap: 24px;
  max-width: 1200px;
  margin: 0 auto;
}
.skeleton-sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
}
.skeleton-main { flex: 1; min-width: 0; }
.skeleton-line,
.skeleton-circle {
  background: linear-gradient(90deg, #111 0%, #1a1a1a 50%, #111 100%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s ease-in-out infinite;
  border-radius: 6px;
}
.skeleton-circle { border-radius: 50%; }
@keyframes skeleton-shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}
.error-state {
  position: fixed;
  inset: 0;
  z-index: 2001;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-primary);
  padding: 24px;
}
.error-content {
  max-width: 420px;
  text-align: center;
  padding: 32px 28px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
}
.error-icon {
  width: 48px;
  height: 48px;
  color: var(--gold);
  margin-bottom: 16px;
}
.error-title {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  margin-bottom: 10px;
}
.error-message {
  color: var(--text-secondary);
  margin-bottom: 20px;
}
.btn-retry {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--gold);
  cursor: pointer;
  font-family: var(--font-body);
  font-weight: 600;
}

/* === Dashboard v4 · color accents, portal LB, training log, utilities === */
.sidebar-unit-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
}
.sidebar-unit-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-secondary);
  font-weight: 600;
}
.sidebar-unit-toggle {
  width: auto !important;
  margin: 0 !important;
  flex-shrink: 0;
}


#section-overview .stat-card.stat-tone--good { --card-accent: var(--success); }
#section-overview .stat-card.stat-tone--warn { --card-accent: var(--warning); }
#section-overview .stat-card.stat-tone--bad { --card-accent: var(--danger); }
#section-overview .stat-card.stat-tone--neutral { --card-accent: #9ca3af; }
#section-overview .stat-card.stat-tone--elite { --card-accent: var(--gold); }
#section-overview .stat-card::before {
  background: var(--card-accent, var(--gold));
  opacity: 1;
  height: 3px;
}
#section-overview .stat-card {
  border-color: color-mix(in srgb, var(--card-accent, var(--gold)) 28%, var(--border-subtle));
}
#section-overview .stat-card-icon {
  background: color-mix(in srgb, var(--card-accent, var(--gold)) 22%, transparent);
  color: var(--card-accent, var(--gold));
}

.overview-header {
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-subtle);
}
.overview-title {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
  margin: 0 0 6px;
  letter-spacing: 0.5px;
}
.overview-subtitle {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
}
#section-overview .stat-card.stat-tone--good .stat-card-value { color: var(--success); }
#section-overview .stat-card.stat-tone--warn .stat-card-value { color: var(--warning); }
#section-overview .stat-card.stat-tone--bad .stat-card-value { color: var(--danger); }
#section-overview .stat-card[data-stat="days"] .stat-card-value,
#section-overview .stat-card[data-stat="days"].stat-tone--bad .stat-card-value,
#section-overview .stat-card[data-stat="days"].stat-tone--warn .stat-card-value,
#section-overview .stat-card[data-stat="days"].stat-tone--good .stat-card-value {
  color: var(--text-primary);
}
#section-overview .stat-card.stat-tone--neutral .stat-card-value { color: #d1d5db; }
#section-overview .stat-card.stat-tone--elite .stat-card-value { color: var(--gold); }

.welcome-banner {
  border-left: 4px solid var(--gold);
  background: linear-gradient(135deg, #0a0a0a 0%, #12100c 50%, #0f0a08 100%);
}
.welcome-eyebrow { color: var(--accent-red); }
.card-title, .section-title, .tier-progress-title, .streak-card-title { color: #fff; }

.pending-review-banner {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 20px;
  margin-bottom: 20px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(245, 158, 11, 0.35);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.12), rgba(205, 127, 50, 0.08));
}
.pending-review-banner strong { display: block; color: #fff; margin-bottom: 4px; }
.pending-review-banner span { color: var(--text-secondary); font-size: 0.9rem; }
.pending-badge--review { color: var(--accent-orange); border-color: rgba(245, 158, 11, 0.4); }

.portal-lb-controls { display: flex; gap: 10px; flex-wrap: wrap; }
.portal-lb-search, .portal-lb-select, .tl-filter-select {
  background: var(--bg-input);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 8px 12px;
  font-family: var(--font-body);
  font-size: 0.9rem;
}
.portal-lb-search { min-width: 180px; }
.portal-lb-card { padding: 0; overflow: hidden; }
.portal-lb-meta {
  padding: 12px 20px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-subtle);
  font-family: var(--font-heading);
}
.portal-lb-table-wrap { max-height: 520px; overflow: auto; }
.portal-lb-tier-cell .tier-badge { margin: 0; }
.portal-lb-rank { color: var(--bronze); font-weight: 700; }
.portal-lb-time { color: var(--gold); font-weight: 700; }
.portal-lb-you { background: rgba(212, 175, 55, 0.08); }
.portal-lb-you td:first-child { box-shadow: inset 3px 0 0 var(--gold); }
.portal-lb-verified { color: var(--gold); margin-left: 4px; }
.portal-lb-more { margin: 16px 20px 20px; }
.portal-lb-loc { color: var(--text-secondary); font-size: 0.88rem; }

.tl-filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  padding: 16px 20px;
  margin-bottom: 20px;
}
.tl-filter-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #e8e8e8;
  font-weight: 600;
}
.tl-insight-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; }
.tl-pill {
  font-size: 0.72rem;
  padding: 5px 10px;
  border-radius: 999px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.tl-pill-gold { background: rgba(212, 175, 55, 0.15); color: var(--gold); }
.tl-pill-bronze { background: rgba(205, 127, 50, 0.15); color: var(--bronze); }
.tl-pill-blue { background: rgba(59, 130, 246, 0.15); color: var(--accent-blue); }
.tl-pill-muted { background: rgba(255,255,255,0.06); color: var(--text-secondary); }

.tl-stats-grid .stat-card:nth-child(1) { --card-accent: var(--gold); }
.tl-stats-grid .stat-card:nth-child(2) { --card-accent: var(--bronze); }
.tl-stats-grid .stat-card:nth-child(3) { --card-accent: var(--accent-blue); }
.tl-stats-grid .stat-card:nth-child(4) { --card-accent: var(--accent-orange); }

.content-section.active { animation: portalFadeIn 0.25s ease; }
@keyframes portalFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}
.card {
  border: 1px solid var(--border-subtle);
  background: linear-gradient(180deg, rgba(18, 18, 18, 0.98) 0%, rgba(10, 10, 10, 0.99) 100%);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.25);
  border-radius: var(--radius-lg);
}
.streak-card {
  border-color: rgba(239, 68, 68, 0.2);
  background: linear-gradient(135deg, #111 0%, #1a100c 100%);
}
.years-saved-card {
  border-color: rgba(34, 197, 94, 0.25);
  background: linear-gradient(135deg, #0c120c 0%, #111 100%);
}
.mobile-logo-img { height: 36px; max-width: 140px; }

@media (max-width: 768px) {
  .portal-lb-controls { width: 100%; }
  .portal-lb-search { flex: 1; min-width: 0; }
  .tl-insight-pills { margin-left: 0; width: 100%; }
}

/* === Status pills (no emoji) === */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  white-space: nowrap;
}
.status-pill .wdhc-icon {
  width: 0.9em;
  height: 0.9em;
}
.status-pill--verified {
  color: #22c55e;
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.3);
}
.status-pill--verified .wdhc-icon { color: #22c55e; }
.status-pill--pending {
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.35);
}
.status-pill--pending .wdhc-icon { color: #f59e0b; }
.status-pill--approved {
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.status-pill--approved .wdhc-icon { color: #666; }

.portal-lb-verified {
  display: inline-flex;
  color: var(--gold);
  vertical-align: middle;
  margin-left: 4px;
}
.portal-lb-verified .wdhc-icon {
  width: 0.95em;
  height: 0.95em;
}

/* === Sidebar streak indicator === */
.sidebar-streak-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 14px;
  margin-bottom: 12px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.1), rgba(0, 0, 0, 0.2));
  border: 1px solid rgba(212, 175, 55, 0.2);
}
.sidebar-streak-pill--inactive {
  border-color: var(--border-default);
  background: var(--bg-tertiary);
}
.sidebar-streak-label {
  font-size: 0.68rem;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}
.sidebar-streak-value {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--gold);
}
.sidebar-streak-pill--inactive .sidebar-streak-value {
  color: var(--text-muted);
}

/* === Monthly challenges panel === */
.challenges-panel {
  margin-bottom: 24px;
  padding: 24px;
  background: linear-gradient(135deg, #0c0c14 0%, #111118 100%);
  border: 1px solid rgba(100, 120, 200, 0.15);
}
.challenges-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.challenges-panel-title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  margin: 0;
  letter-spacing: 0.5px;
}
.challenges-panel-link {
  font-size: 0.8rem;
  color: var(--gold);
  text-decoration: none;
  font-weight: 600;
}
.challenges-panel-link:hover { text-decoration: underline; }
.challenges-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.challenge-item {
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: border-color var(--transition-fast);
}
.challenge-item:hover {
  border-color: rgba(212, 175, 55, 0.25);
}
.challenge-item-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 6px;
}
.challenge-item-title {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--text-primary);
}
.challenge-item-month {
  font-size: 0.7rem;
  color: var(--gold);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  flex-shrink: 0;
}
.challenge-item-criteria {
  font-size: 0.8rem;
  color: var(--text-tertiary);
  line-height: 1.45;
  margin-bottom: 10px;
}
.challenge-item-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.challenge-progress-label {
  font-family: var(--font-heading);
  font-size: 0.78rem;
  color: var(--text-secondary);
}
.challenge-progress-bar {
  flex: 1;
  min-width: 80px;
  max-width: 200px;
  height: 6px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 3px;
  overflow: hidden;
}
.challenge-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #6366f1, #D4AF37);
  border-radius: 3px;
  transition: width 0.4s ease;
}
.challenge-ends {
  font-size: 0.72rem;
  color: var(--text-muted);
}
.challenges-empty {
  font-size: 0.85rem;
  color: var(--text-tertiary);
  text-align: center;
  padding: 12px;
}
.challenges-wins-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.challenge-win-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 20px;
  background: rgba(212, 175, 55, 0.1);
  border: 1px solid rgba(212, 175, 55, 0.25);
  font-size: 0.75rem;
  color: var(--gold);
}

/* === Achievement polish === */
.achievement-card.unlocked {
  box-shadow: 0 4px 20px rgba(212, 175, 55, 0.08);
}
.achievement-card.unlocked .achievement-icon {
  background: radial-gradient(circle, rgba(212, 175, 55, 0.15), transparent 70%);
}

/* === Welcome chips === */
.welcome-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.welcome-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.78rem;
  color: var(--text-secondary);
}
.welcome-chip strong {
  font-family: var(--font-heading);
  color: var(--gold);
}

/* === Insights card === */
.insights-card {
  margin-bottom: 24px;
  padding: 22px 24px;
  background: linear-gradient(135deg, #0c1018 0%, #111 100%);
  border: 1px solid rgba(99, 102, 241, 0.15);
}
.insights-title {
  font-family: var(--font-heading);
  font-size: 1rem;
  margin: 0 0 14px;
  letter-spacing: 0.5px;
}
.insights-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.insight-item {
  padding: 14px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.insight-item-label {
  display: block;
  font-size: 0.68rem;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 6px;
}
.insight-item-value {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}
.insight-item-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* === Activity feed === */
.activity-feed {
  margin-bottom: 24px;
  padding: 20px 24px;
}
.activity-feed-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
.activity-feed-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.activity-feed-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: border-color var(--transition-fast);
}
.activity-feed-item:hover {
  border-color: rgba(212, 175, 55, 0.2);
}
.activity-feed-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.activity-feed-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--gold-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.activity-feed-title {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text-primary);
}
.activity-feed-sub {
  font-size: 0.75rem;
  color: var(--text-tertiary);
}
.activity-feed-right {
  text-align: right;
  flex-shrink: 0;
}
.activity-feed-time {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  color: var(--gold);
}
.activity-feed-date {
  font-size: 0.72rem;
  color: var(--text-muted);
}
.activity-feed-empty {
  color: var(--text-tertiary);
  font-size: 0.85rem;
  padding: 16px;
  text-align: center;
}

/* === Progress charts grid === */
.progress-charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.progress-chart-main {
  grid-column: 1 / -1;
}
.progress-chart-streak .streak-chart-wrap {
  height: 260px;
  position: relative;
}
.progress-charts-grid .card-title {
  margin-bottom: 16px;
  font-family: var(--font-heading);
  font-size: 0.95rem;
  letter-spacing: 0.5px;
}

/* === Share card v3 (trading-card / social export preview) === */
.modal-share {
  max-width: 520px;
  padding-bottom: 28px;
}
.modal-share .modal-header {
  text-align: center;
  margin-bottom: 20px;
}
.share-card-v3 {
  --share-tier-color: #D4AF37;
  position: relative;
  border-radius: var(--radius-xl);
  margin-bottom: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow:
    0 24px 56px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(212, 175, 55, 0.06) inset;
  overflow: hidden;
}
.share-card-v3-accent {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 5px;
  background: var(--share-tier-color);
  box-shadow: 0 0 24px color-mix(in srgb, var(--share-tier-color) 50%, transparent);
  z-index: 2;
}
.share-card-v3-inner {
  position: relative;
  padding: 22px 24px 20px 28px;
  background:
    radial-gradient(ellipse 80% 55% at 88% 0%, color-mix(in srgb, var(--share-tier-color) 12%, transparent) 0%, transparent 58%),
    radial-gradient(ellipse 45% 35% at 8% 100%, rgba(205, 127, 50, 0.05) 0%, transparent 50%),
    linear-gradient(165deg, rgba(18, 18, 20, 0.96) 0%, rgba(6, 6, 8, 0.99) 100%);
  overflow: hidden;
}
.share-card-v3-inner::after {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.28;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
  background-size: 128px 128px;
  pointer-events: none;
}
.share-card-v3-header,
.share-card-v3-hero,
.share-card-v3-body,
.share-card-v3-stats,
.share-card-v3-footer {
  position: relative;
  z-index: 1;
}
.share-card-v3-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}
.share-card-v3-logo {
  height: 34px;
  width: auto;
  opacity: 0.95;
}
.share-card-v3-tier {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
}
.share-card-v3-tier .tier-badge {
  margin: 0;
}
.share-card-v3-hero {
  text-align: center;
  padding: 12px 0 18px;
  margin-bottom: 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.share-card-v3-hero-label {
  display: block;
  font-family: var(--font-heading);
  font-size: 0.62rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-bottom: 4px;
}
.share-card-v3-hero-value {
  display: block;
  font-size: clamp(2.8rem, 12vw, 3.6rem);
  font-weight: 700;
  line-height: 1;
  color: var(--success);
  text-shadow: 0 0 40px rgba(34, 197, 94, 0.25);
}
.share-card-v3-hero-value.is-muted {
  color: var(--text-tertiary);
  font-size: 2rem;
  text-shadow: none;
}
.share-card-v3-years {
  font-size: 0.8rem;
  color: var(--success);
  font-weight: 600;
  margin-top: 8px;
}
.share-card-v3-body {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 16px;
  align-items: center;
  margin: 16px 0;
}
.share-card-v3-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(145deg, #1e1a16 0%, #101010 100%);
  border: 2px solid color-mix(in srgb, var(--share-tier-color) 40%, transparent);
  box-shadow:
    0 0 0 3px color-mix(in srgb, var(--share-tier-color) 10%, transparent),
    0 0 28px color-mix(in srgb, var(--share-tier-color) 20%, transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-size: 1.9rem;
  font-weight: 700;
  color: var(--share-tier-color);
}
.share-card-v3-name {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 8px;
}
.share-card-v3-first {
  font-family: var(--font-heading);
  font-size: 1.28rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  line-height: 1.1;
  color: var(--text-primary);
}
.share-card-v3-last {
  font-family: var(--font-heading);
  font-size: 1.02rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  line-height: 1.15;
}
.share-card-v3-last:empty { display: none; }
.share-card-v3-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  font-size: 0.88rem;
  color: #c8c8c8;
  align-items: center;
}
.share-card-v3-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}
.share-card-v3-stat {
  text-align: center;
  padding: 10px 8px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.share-card-v3-stat-label {
  display: block;
  font-size: 0.68rem;
  color: #b8b8b8;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 6px;
}
.share-card-v3-stat-value {
  display: block;
  font-size: 1.12rem;
  font-weight: 700;
  color: var(--text-primary);
}
.share-card-v3-stat-value--gold {
  color: var(--gold, #D4AF37);
  font-family: var(--font-heading);
  font-size: 1.2rem;
  text-shadow: 0 0 20px rgba(212, 175, 55, 0.2);
}
.share-card-streak-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px 3px 8px;
  border-radius: 999px;
  background: rgba(212, 175, 55, 0.1);
  border: 1px solid rgba(212, 175, 55, 0.28);
  color: var(--gold, #D4AF37);
  font-family: var(--font-heading);
  font-size: 0.72rem;
  font-weight: 700;
}
.share-card-streak-badge[hidden] { display: none; }
.share-card-v3-footer {
  text-align: center;
  font-family: var(--font-heading);
  font-size: 0.58rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.28);
}

/* Share card · hang video strip */
.share-card-v3-video {
  margin: 0 0 14px;
  padding: 0 0 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.share-card-v3-video[hidden] { display: none; }
.share-card-v3-video-label {
  display: block;
  font-family: var(--font-heading);
  font-size: 0.68rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-bottom: 8px;
}
.share-card-v3-video-frame {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: #000;
  border: 1px solid rgba(212, 175, 55, 0.2);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}
.share-card-v3-video-frame.is-portrait {
  aspect-ratio: 9 / 16;
  max-height: 340px;
  margin: 0 auto;
}
.share-card-v3-video-frame.is-landscape video,
.share-card-v3-video-frame.is-landscape img {
  object-fit: cover;
  object-position: center 35%;
}
.share-card-v3-video-bg {
  position: absolute;
  inset: -8%;
  width: 116%;
  height: 116%;
  object-fit: cover;
  filter: blur(20px) brightness(0.42) saturate(1.1);
  transform: scale(1.08);
  pointer-events: none;
  z-index: 0;
}
.share-card-v3-video-main {
  position: relative;
  z-index: 1;
}
.share-card-v3-video-frame video,
.share-card-v3-video-frame img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center center;
  display: block;
  background: #000;
}
.share-card-v3-video-frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}
.share-card-v3-video-play {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  border: 2px solid rgba(212, 175, 55, 0.6);
  pointer-events: none;
}
.share-card-v3-video-play::after {
  content: '';
  position: absolute;
  left: 19px;
  top: 14px;
  border-style: solid;
  border-width: 10px 0 10px 16px;
  border-color: transparent transparent transparent var(--gold);
}
.share-card-v3-video-time {
  display: block;
  margin-top: 8px;
  font-size: 0.88rem;
  color: var(--gold);
  text-align: right;
}

.share-card-v3-avatar.has-image .share-card-v3-avatar-initial { display: none; }
.share-card-v3-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.share-card-customize {
  margin-bottom: 16px;
  padding: 16px 18px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.share-card-customize-title {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  letter-spacing: 0.5px;
  color: var(--text-primary);
  margin: 0 0 4px;
}
.share-card-customize-sub {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin: 0 0 14px;
  line-height: 1.5;
}
.share-card-customize-row { margin-bottom: 12px; }
.share-card-customize-hint {
  font-size: 0.84rem;
  color: var(--text-tertiary);
  margin-top: 6px;
  line-height: 1.45;
}
.share-card-customize-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.share-card-customize-status {
  font-size: 0.88rem;
  color: var(--success);
}

/* Submission status banners */
.submission-status-banner {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 20px;
  margin-bottom: 20px;
  border-radius: var(--radius-lg);
}
.submission-status-banner--pending {
  border: 1px solid rgba(245, 158, 11, 0.35);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.12), rgba(205, 127, 50, 0.08));
}
.submission-status-banner--success {
  border: 1px solid rgba(34, 197, 94, 0.35);
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.12), rgba(16, 120, 60, 0.06));
}
.submission-status-banner--welcome {
  border: 1px solid rgba(212, 175, 55, 0.3);
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.1), rgba(0, 0, 0, 0.15));
}
.submission-status-banner strong {
  display: block;
  color: #fff;
  margin-bottom: 4px;
  font-size: 1rem;
}
.submission-status-banner span {
  color: var(--text-secondary);
  font-size: 0.96rem;
  line-height: 1.5;
}
.share-textarea {
  border-radius: var(--radius-md);
  background: var(--bg-input);
  border-color: var(--border-default);
  font-size: 0.88rem;
  line-height: 1.5;
  margin-bottom: 14px;
}
.share-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.share-actions .btn-primary {
  grid-column: 1 / -1;
}
.share-actions .btn-twitter {
  grid-column: 1 / -1;
}

/* Desktop sidebar compaction */
@media (min-width: 1025px) {
  .sidebar-brand {
    padding: 14px 16px 12px;
  }
  .sidebar-brand-logo {
    height: 58px;
    max-width: 220px;
  }
  .sidebar-profile {
    padding: 12px 16px;
  }
  .sidebar-profile-avatar {
    width: 38px;
    height: 38px;
    font-size: 0.9rem;
  }
  .sidebar-nav {
    padding: 8px 0 2px;
    gap: 1px;
  }
  .sidebar-link {
    padding: 8px 16px;
    font-size: 0.86rem;
    gap: 10px;
  }
  .sidebar-icon {
    width: 16px;
    height: 16px;
  }
  .sidebar-footer {
    padding: 12px 14px;
    gap: 8px;
  }
  .sidebar-qs-item {
    padding: 6px 4px;
  }
  .sidebar-qs-label {
    font-size: 0.6rem;
  }
  .sidebar-qs-value {
    font-size: 0.92rem;
  }
  .btn-sidebar-primary {
    padding: 9px 12px;
    font-size: 0.76rem;
  }
  .btn-sidebar-split {
    padding: 7px 6px;
    font-size: 0.64rem;
  }
  .sidebar-unit-row {
    padding-top: 2px;
  }
}

@media (max-width: 900px) {
  .insights-grid { grid-template-columns: 1fr; }
  .progress-charts-grid { grid-template-columns: 1fr; }
  .progress-chart-main { grid-column: auto; }
  .share-card-v3-body {
    grid-template-columns: 64px 1fr;
    gap: 12px;
  }
  .share-card-v3-avatar {
    width: 64px;
    height: 64px;
    font-size: 1.5rem;
  }
  .share-card-v3-first { font-size: 1.1rem; }
  .share-card-v3-last { font-size: 0.92rem; }
  .share-card-v3-hero-value { font-size: 2.6rem; }
  .modal-share { max-width: 100%; }
}

/* Achievement filter hide + chart empty */
.achievement-card[data-hidden="true"] { display: none !important; }
.chart-empty-msg {
  margin: 24px 12px;
  text-align: center;
  color: #a8a8a8;
  font-size: 0.98rem;
  line-height: 1.5;
}
