@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Space+Grotesk:wght@400;500;600;700&display=swap');

/* ============================================
   FLOWROLL — PREMIUM DESIGN SYSTEM
   Inspired by modern sports training apps
   ============================================ */

:root {
  /* === BRAND IDENTITY COLORS === */
  --brand-red: #1db954;          /* Spotify Emerald Green — primary action */
  --brand-red-glow: rgba(29, 185, 84, 0.25);
  --brand-gold: #f5b041;         /* Championship Gold — accent */
  --brand-blue: #3b9eff;         /* Electric Blue — No-Gi */
  --brand-purple: #9b59f5;       /* Royal Purple — Gi */
  --brand-green: #1db954;        /* Emerald — success */
  --brand-orange: #ff7c3c;       /* Spark Orange — warning */

  /* === ACCENT GLOW & NAVIGATION PILL TOKENS (MILESTONE 1) === */
  --accent-glow: #43e67a;
  --accent-glow-rgb: 67, 230, 122;
  --accent-contrast: #000000;
  --nav-pill-bg: transparent;
  --nav-pill-border: transparent;
  --nav-pill-glow: none;

  /* === BELT COLORS === */
  --belt-white: #ffffff;
  --belt-blue: #1e88e5;
  --belt-purple: #9c27b0;
  --belt-brown: #8d6e63;
  --belt-black: #1f1f1f;

  /* === TYPOGRAPHY TOKENS === */
  --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
  --font-display: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 9999px;

  --ease-press: cubic-bezier(0.2, 0, 0, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-nav-dissolve: cubic-bezier(0.22, 1, 0.36, 1);
  --transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: all 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);

  /* === SPECULAR BEVELS === */
  --specular-rim-card: inset 0 1px 0 0 rgba(255, 255, 255, 0.085);
  --specular-bevel-primary: inset 0 1px 0 rgba(255, 255, 255, 0.35);

  /* === CONTROL BUTTONS === */
  --control-bg: rgba(255,255,255,0.04);
  --control-bg-hover: rgba(255,255,255,0.08);
  --control-border: rgba(255,255,255,0.08);
  --control-border-hover: rgba(255,255,255,0.16);
}

/* ============================================
   DARK THEME (Default — OLED Specular)
   ============================================ */
.dark-theme {
  --bg-base: #000000;
  --bg-surface: #090a0d;
  --bg-elevated: #111216;
  --bg-overlay: #16181f;
  --bg-card: rgba(10, 11, 14, 0.88);
  --bg-card-hover: rgba(18, 19, 24, 0.95);
  --bg-input: rgba(255, 255, 255, 0.035);
  --bg-input-focus: rgba(255, 255, 255, 0.065);

  --border: rgba(255, 255, 255, 0.07);
  --border-subtle: rgba(255, 255, 255, 0.045);
  --border-active: rgba(255, 255, 255, 0.14);
  --border-brand: rgba(29, 185, 84, 0.45);

  --text-primary: #f2f4f7;
  --text-secondary: #8c96a8;
  --text-muted: #546073;
  --text-placeholder: #3e4858;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.6);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.7);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.85);
  --shadow-xl: 0 20px 64px rgba(0, 0, 0, 0.95);
  --shadow-glow-red: 0 0 24px rgba(29, 185, 84, 0.32), 0 4px 12px rgba(0, 0, 0, 0.7);
  --shadow-glow-blue: 0 0 24px rgba(59, 158, 255, 0.28);
  
  --sidebar-gradient: linear-gradient(180deg, #090a0d 0%, #000000 100%);
  --header-bg: rgba(0, 0, 0, 0.85);
  --nav-bg: rgba(6, 6, 8, 0.82);
  --nav-border: rgba(255, 255, 255, 0.09);
  
  --belt-white: #ffffff;
  --belt-blue: #2196f3;
  --belt-purple: #9b59f5;
  --belt-brown: #8d6e63;
  --belt-black: #1a1a1a;

  --brand-accent: #1db954;
  --brand-accent-text: #ffffff;
  --brand-accent-bg: rgba(29, 185, 84, 0.1);
  --brand-accent-bg-subtle: rgba(29, 185, 84, 0.08);
  --brand-accent-border: rgba(29, 185, 84, 0.25);
  --brand-accent-shadow: 0 8px 24px rgba(29, 185, 84, 0.3);
}

/* ============================================
   LIGHT THEME (WCAG AA Emerald Unified)
   ============================================ */
.light-theme {
  --bg-base: #f0f2f7;
  --bg-surface: #ffffff;
  --bg-elevated: #f8f9fb;
  --bg-overlay: #f0f2f5;
  --bg-card: rgba(255, 255, 255, 0.92);
  --bg-card-hover: rgba(255, 255, 255, 1);
  --bg-input: rgba(0, 0, 0, 0.04);
  --bg-input-focus: rgba(0, 0, 0, 0.06);

  --border: rgba(0, 0, 0, 0.08);
  --border-subtle: rgba(0, 0, 0, 0.04);
  --border-active: rgba(0, 0, 0, 0.15);
  --border-brand: rgba(13, 130, 56, 0.30);

  --text-primary: #0d1117;
  --text-secondary: #4a5568;
  --text-muted: #64748b;
  --text-placeholder: #94a3b8;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.09);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.11);
  --shadow-xl: 0 20px 60px rgba(0, 0, 0, 0.14);
  --shadow-glow-red: 0 0 20px rgba(21, 163, 73, 0.24), 0 4px 12px rgba(0, 0, 0, 0.12);
  --shadow-glow-blue: 0 0 20px rgba(59, 158, 255, 0.15);

  --sidebar-gradient: linear-gradient(180deg, #ffffff 0%, #f8f9fb 100%);
  --header-bg: rgba(248, 249, 251, 0.84);
  --brand-red: #0d8238;
  --brand-green: #15a349;
  --brand-red-glow: rgba(21, 163, 73, 0.22);
  --nav-bg: rgba(250, 251, 253, 0.76);
  --nav-border: rgba(0, 0, 0, 0.09);
  --nav-inactive: #768396;

  --belt-white: #f8f9fa;
  --belt-blue: #1565c0;
  --belt-purple: #6a1b9a;
  --belt-brown: #4e342e;
  --belt-black: #0d0d0d;

  --belt-grey: #9e9e9e;
  --belt-yellow: #fbc02d;
  --belt-orange: #f57c00;
  --belt-green: #15a349;
  --belt-red: #d32f2f;

  /* === CONTROL BUTTONS === */
  --control-bg: rgba(0, 0, 0, 0.05);
  --control-bg-hover: rgba(0, 0, 0, 0.09);
  --control-border: rgba(0, 0, 0, 0.10);
  --control-border-hover: rgba(0, 0, 0, 0.16);

  --brand-accent: #0d8238;
  --brand-accent-text: #ffffff;
  --brand-accent-bg: rgba(13, 130, 56, 0.10);
  --brand-accent-bg-subtle: rgba(21, 163, 73, 0.06);
  --brand-accent-border: rgba(13, 130, 56, 0.25);
  --brand-accent-shadow: 0 8px 24px rgba(13, 130, 56, 0.25);

  /* === ACCENT GLOW & NAVIGATION PILL TOKENS (LIGHT THEME) === */
  --accent-glow: #16a34a;
  --accent-glow-rgb: 22, 163, 74;
  --accent-contrast: #ffffff;
  --nav-pill-bg: transparent;
  --nav-pill-border: transparent;
  --nav-pill-glow: none;
}

.light-theme .btn-primary {
  background: #0d8238;
  color: var(--brand-accent-text, #ffffff);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    0 8px 24px rgba(13, 130, 56, 0.25);
}

@media (hover: hover) and (pointer: fine) {
  .light-theme .btn-primary:not(:disabled):hover {
    background: #15a349;
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.38),
      0 8px 24px rgba(21, 163, 73, 0.34);
    color: #ffffff;
  }
}

.light-theme .header-role-select {
  background: rgba(13, 130, 56, 0.08);
  border-color: rgba(13, 130, 56, 0.22);
  color: #0d8238;
}

.light-theme .bottom-nav {
  box-shadow:
    inset 0 1px 0 0 rgba(255, 255, 255, 0.88),
    0 8px 32px rgba(0, 0, 0, 0.12),
    0 0 0 0.5px rgba(0, 0, 0, 0.05) inset;
}

.light-theme .bottom-nav-item.active .nav-icon-wrap {
  background: #15a349;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    0 4px 12px rgba(21, 163, 73, 0.32);
}

.light-theme .bottom-nav-item.active .nav-label {
  color: #0d8238;
}

.light-theme .nav-icon-wrap {
  transition:
    background 280ms var(--ease-spring),
    transform 280ms var(--ease-spring);
}

.light-theme .nav-icon-wrap {
  transition: background 0.22s cubic-bezier(0.34, 1.56, 0.64, 1), transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Light mode post cards */
.light-theme .post-card {
  background: #fff;
  border-bottom: 1px solid rgba(0,0,0,0.06);
}

.light-theme .post-author-name { color: #0d1117; }
.light-theme .post-meta { color: #8898aa; }
.light-theme .post-notes { color: #4a5568; }

.light-theme .post-topic {
  color: #7da300;
}

.light-theme .post-mood-chip {
  background: rgba(125,163,0,0.08);
  color: #7da300;
  border-color: rgba(125,163,0,0.2);
}

.light-theme .social-action-btn { color: #9a9a9a; }
.light-theme .social-action-btn:hover { background: rgba(0,0,0,0.04); color: #4a5568; }
.light-theme .social-action-btn.active { color: #7da300; background: rgba(125,163,0,0.08); }
.light-theme .social-action-btn.active svg { filter: drop-shadow(0 0 4px rgba(125,163,0,0.4)); }

.light-theme .comment-body { background: rgba(0,0,0,0.03); }
.light-theme .comment-author { color: #7da300; }
.light-theme .comment-text { color: #4a5568; }
.light-theme .comment-date { color: #9a9a9a; }
.light-theme .comment-input { background: rgba(0,0,0,0.04); border-color: rgba(0,0,0,0.08); color: #0d1117; }
.light-theme .comment-input:focus { border-color: rgba(125,163,0,0.3); background: rgba(125,163,0,0.03); }
.light-theme .send-comment-btn { background: #7da300; }
.light-theme .send-comment-btn:hover { background: #8ab800; }

.light-theme .lb-row { background: rgba(0,0,0,0.02); border-color: rgba(0,0,0,0.06); }
.light-theme .lb-row:hover { background: rgba(0,0,0,0.05); border-color: rgba(0,0,0,0.10); }
.light-theme .lb-rank { color: #9a9a9a; }
.light-theme .lb-name { color: #0d1117; }
.light-theme .lb-sessions { color: #7da300; background: rgba(125,163,0,0.08); border-color: rgba(125,163,0,0.2); }

.light-theme .roster-row { background: rgba(0,0,0,0.02); border-color: rgba(0,0,0,0.06); }
.light-theme .roster-row:hover { background: rgba(0,0,0,0.05); border-color: rgba(0,0,0,0.10); }
.light-theme .roster-chevron { color: #c0c0c0; }

.light-theme .community-tabs { background: rgba(0,0,0,0.04); }
.light-theme .community-tab-btn { color: #9a9a9a; }
.light-theme .community-tab-btn.active { background: #7da300; color: #fff; }

.light-theme .profile-modal-dialog { background: #fff; border-color: rgba(0,0,0,0.10); }
.light-theme .profile-stat-card { background: rgba(125,163,0,0.05); border-color: rgba(125,163,0,0.15); }
.light-theme .profile-stat-val { color: #7da300; }
.light-theme .profile-stat-label { color: #8898aa; }

/* Chat styles light mode */
.light-theme .chat-bubble-own { background: #7da300; color: #fff; }
.light-theme .chat-bubble-other { background: rgba(0,0,0,0.06); color: #0d1117; }
.light-theme .chat-channel-btn { color: #8898aa; }
.light-theme .chat-channel-btn.active { background: rgba(125,163,0,0.1); color: #7da300; }
.light-theme .chat-input-row { background: rgba(0,0,0,0.04); border-color: rgba(0,0,0,0.08); }
.light-theme .chat-send-btn { background: #7da300; }

/* Stats row light mode */
.light-theme #community-stats-row > div { background: rgba(0,0,0,0.03); border-color: rgba(0,0,0,0.07); }

/* High Contrast Light Mode Curriculum & Technique Styling */
.light-theme,
html.light-theme,
body.light-theme,
.light-theme #app-container,
.light-theme .main-content {
  background-color: #f0f2f7 !important;
  color: #0d1117;
}

.light-theme .week-curriculum-card {
  background: #ffffff !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04) !important;
}

.light-theme .week-curriculum-card.expanded {
  background: #ffffff !important;
  border-color: rgba(0, 0, 0, 0.16) !important;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.07) !important;
}

.light-theme .week-card-title {
  color: #0f172a !important;
  font-weight: 800 !important;
  font-size: 14.5px !important;
}

.light-theme .tech-row-text,
.light-theme .tech-text,
.light-theme .tech-tile-name {
  color: #0f172a !important;
  font-weight: 700 !important;
  font-size: 13px !important;
  line-height: 1.4 !important;
}

.light-theme .tech-row-num,
.light-theme .tech-tile-index {
  background: #eff6ff !important;
  color: #1d4ed8 !important;
  border: 1px solid #bfdbfe !important;
  font-weight: 900 !important;
}

.light-theme .tech-watch-btn {
  background: #16a34a !important;
  color: #ffffff !important;
  border: none !important;
  font-weight: 800 !important;
  box-shadow: 0 2px 6px rgba(22, 163, 74, 0.22) !important;
}

.light-theme .tech-watch-btn span {
  color: #ffffff !important;
}

.light-theme .tech-watch-btn svg,
.light-theme .tech-watch-btn .play-icon-svg {
  fill: #ffffff !important;
  stroke: none !important;
  color: #ffffff !important;
}

.light-theme .tech-watch-btn:hover {
  background: #15803d !important;
  color: #ffffff !important;
}

.light-theme .section-label {
  color: #334155 !important;
  font-weight: 800 !important;
  font-size: 11.5px !important;
  letter-spacing: 0.6px !important;
}

.light-theme .section-label svg {
  stroke: #334155 !important;
}

.light-theme .week-goal-block {
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
  color: #1e293b !important;
  font-weight: 600 !important;
}

.light-theme .week-goal-block strong {
  color: #0f172a !important;
  font-weight: 800 !important;
}

.light-theme .info-block {
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
  color: #1e293b !important;
}

.light-theme .info-block strong {
  color: #0f172a !important;
  font-weight: 800 !important;
}

.light-theme .tech-tile {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04) !important;
}

.light-theme .tech-item {
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
}

/* ============================================
   RESETS & BASE
   ============================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  overscroll-behavior-y: none;
  -webkit-tap-highlight-color: transparent;
  background-color: var(--bg-base);
}

body {
  font-family: var(--font-primary);
  background-color: var(--bg-base);
  color: var(--text-primary);
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.35s ease, color 0.35s ease;

  /* === NATIVE APP FEEL === */
  overscroll-behavior-y: none;        /* prevent rubber-band bounce */
  touch-action: manipulation;          /* kill 300ms tap delay */
  -webkit-user-select: none;           /* disable text selection */
  user-select: none;
  -webkit-touch-callout: none;         /* disable iOS long-press callout */
}

/* Re-enable text selection on user inputs */
input, textarea, [contenteditable="true"] {
  -webkit-user-select: auto;
  user-select: auto;
  -webkit-touch-callout: default;
}

/* Gorgeous Custom Scrollbars */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(120, 120, 120, 0.12);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(202, 253, 0, 0.3);
}

/* ============================================
   APP SHELL LAYOUT
   ============================================ */
.app-container {
  display: flex;
  width: 100%;
  max-width: 100%;
  height: 100%;
  height: 100dvh;
  min-height: 100%;
  overflow: hidden;
}

/* ============================================
   SIDEBAR (Desktop only)
   ============================================ */
.sidebar {
  display: none;
  width: 240px;
  flex-direction: column;
  background: var(--sidebar-gradient);
  border-right: 1px solid var(--border);
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
}

.sidebar-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 20px 16px;
}

/* Brand Logo */
.logo-container {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 32px;
  padding: 4px 0;
}

.logo-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: var(--brand-red);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 18px;
  color: #fff;
  letter-spacing: -1px;
  box-shadow: 0 0 16px rgba(202, 253, 0, 0.25);
  flex-shrink: 0;
}

.logo-text-wrap {
  display: flex;
  flex-direction: column;
}

.logo-name {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.4px;
  color: var(--text-primary);
}

.logo-sub {
  font-size: 9px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Sidebar Section Label */
.sidebar-section-label {
  font-size: 9px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  padding: 0 10px;
  margin-bottom: 8px;
  margin-top: 8px;
}

/* Nav Menu */
.nav-menu {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex-grow: 1;
}

.nav-item {
  border-radius: var(--radius-md);
  overflow: hidden;
}

.nav-item button {
  width: 100%;
  background: none;
  border: none;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  color: var(--text-secondary);
  transition: var(--transition);
  position: relative;
}

.nav-item button svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  transition: var(--transition);
}

.nav-item.active button {
  background: var(--brand-accent-bg, rgba(202, 253, 0, 0.08));
  color: var(--brand-accent, #cafd00);
  font-weight: 700;
}

.nav-item button:hover:not(.nav-item.active button) {
  background: var(--bg-input);
  color: var(--text-primary);
}

/* Sidebar bottom: user card */
.sidebar-user-card {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.sidebar-user-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: var(--radius-md);
  background: var(--bg-input);
  cursor: pointer;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-accent, #cafd00), var(--brand-red, #516700));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}

.user-info-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.user-name {
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role-text {
  font-size: 10px;
  color: var(--text-muted);
}

/* ============================================
   CONTENT WRAPPER
   ============================================ */
.content-wrapper {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  max-width: 100%;
  background-color: var(--bg-base);
  height: 100%;
  min-height: 0;
}

/* ============================================
   TOP HEADER
   ============================================ */
.app-header {
  position: sticky;
  top: 0;
  height: 56px;
  height: calc(56px + env(safe-area-inset-top, 0px));
  padding-top: env(safe-area-inset-top, 0px);
  background: var(--header-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-left: 16px;
  padding-right: 16px;
  flex-shrink: 0;
  z-index: 100;
}

.header-logo-mobile {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-logo-mobile .logo-name {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
}

.header-title-desktop {
  display: none;
}

.header-title-desktop h2 {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Control Pills — circular icon buttons */
.control-btn {
  background: var(--control-bg);
  border: 1px solid var(--control-border);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  transition: var(--transition);
}

.control-btn:hover {
  background: var(--control-bg-hover);
  border-color: var(--control-border-hover);
  color: var(--text-primary);
  transform: scale(1.05);
}

.control-btn svg {
  width: 16px;
  height: 16px;
}

.theme-toggle-btn { /* inherits control-btn */ }

/* Language Toggle */
.lang-toggle {
  display: flex;
  background: var(--control-bg);
  border: 1px solid var(--control-border);
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font-display);
  cursor: pointer;
  align-items: center;
  gap: 5px;
  user-select: none;
  height: 34px;
  letter-spacing: 0.3px;
  transition: var(--transition);
}
.lang-toggle:hover {
  background: var(--control-bg-hover);
  border-color: var(--control-border-hover);
}

.lang-opt { color: var(--text-muted); transition: var(--transition); }
.lang-opt.active { color: var(--text-primary); }
.lang-divider { color: var(--border-active); font-weight: 300; }

/* User Role Select */
.header-role-select {
  background: var(--brand-accent-bg-subtle, rgba(202,253,0,0.06));
  border: 1px solid var(--brand-accent-border, rgba(202,253,0,0.18));
  border-radius: 999px;
  padding: 6px 12px;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  outline: none;
  cursor: pointer;
  color: var(--brand-accent, #cafd00);
  height: 34px;
  max-width: 110px;
  -webkit-appearance: none;
  appearance: none;
}

/* ============================================
   MAIN CONTENT AREA
   ============================================ */
.app-main-content {
  flex: 1 1 0%;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  padding: 20px 16px calc(112px + env(safe-area-inset-bottom, 0px)) 16px;
  position: relative;
}

/* Native Mobile Navigation Transitions */
@keyframes ios-view-slide-in-right {
  0% { opacity: 0; transform: translate3d(28px, 0, 0); }
  100% { opacity: 1; transform: translate3d(0, 0, 0); }
}

@keyframes ios-view-slide-in-left {
  0% { opacity: 0; transform: translate3d(-28px, 0, 0); }
  100% { opacity: 1; transform: translate3d(0, 0, 0); }
}

@keyframes android-view-fade-up {
  0% { opacity: 0; transform: translate3d(0, 16px, 0) scale(0.985); }
  100% { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
}

.page-section {
  display: none;
  width: 100%;
  max-width: 100%;
  will-change: transform, opacity;
}

.page-section.active {
  display: block;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  position: relative;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
}

/* iOS Navigation Transitions */
.platform-ios .page-section.active.slide-right {
  animation: ios-view-slide-in-right 0.24s cubic-bezier(0.32, 0.72, 0, 1) forwards;
}
.platform-ios .page-section.active.slide-left {
  animation: ios-view-slide-in-left 0.24s cubic-bezier(0.32, 0.72, 0, 1) forwards;
}

/* Android Navigation Transitions */
.platform-android .page-section.active {
  animation: android-view-fade-up 0.22s cubic-bezier(0.05, 0.7, 0.1, 1.0) forwards;
}

/* Fallback Web Transitions */
body:not(.platform-ios):not(.platform-android) .page-section.active.slide-right,
:root:not(.platform-ios):not(.platform-android) .page-section.active.slide-right {
  animation: ios-view-slide-in-right 0.2s cubic-bezier(0.32, 0.72, 0, 1) forwards;
}
body:not(.platform-ios):not(.platform-android) .page-section.active.slide-left,
:root:not(.platform-ios):not(.platform-android) .page-section.active.slide-left {
  animation: ios-view-slide-in-left 0.2s cubic-bezier(0.32, 0.72, 0, 1) forwards;
}

.page-section > :first-child {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

/* ============================================
   SECTION HERO HEADERS
   ============================================ */
.section-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

.section-hero-text h2 {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.8px;
  line-height: 1.15;
}

.section-hero-text p {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 3px;
}

.section-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  border: 1px solid;
  white-space: nowrap;
}

.section-badge.curriculum { color: #3b9eff; border-color: rgba(59,158,255,0.22); background: rgba(59,158,255,0.07); }
.section-badge.tracker    { color: #1db954; border-color: rgba(29,185,84,0.22); background: rgba(29,185,84,0.07); }
.section-badge.coach      { color: #f5b041; border-color: rgba(245,176,65,0.22); background: rgba(245,176,65,0.07); }
.section-badge.social     { color: var(--brand-accent, #cafd00); border-color: var(--brand-accent-border, rgba(202,253,0,0.22)); background: var(--brand-accent-bg-subtle, rgba(202,253,0,0.07)); }
.section-badge.timer      { color: #ff7351; border-color: rgba(255,115,81,0.22); background: rgba(255,115,81,0.07); }

/* ============================================
   BOTTOM NAVIGATION BAR (Mobile) — Crystal Glass
   ============================================ */
.bottom-nav {
  display: flex;
  align-items: center;
  justify-content: space-around;
  position: fixed;
  bottom: max(28px, calc(env(safe-area-inset-bottom, 0px) + 12px));
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 24px);
  max-width: 440px;
  height: 58px;
  background: var(--nav-bg, rgba(13, 17, 26, 0.55));
  backdrop-filter: blur(28px) saturate(2.1);
  -webkit-backdrop-filter: blur(28px) saturate(2.1);
  border: 1px solid var(--nav-border, rgba(255, 255, 255, 0.18));
  border-radius: 999px;
  padding: 0 4px;
  z-index: 200;
  box-shadow: 0 16px 40px rgba(0,0,0,0.38), 0 1px 1px rgba(255,255,255,0.22) inset;
  transition: transform 0.3s cubic-bezier(0.4,0,0.2,1), bottom 0.3s ease;
}

/* ============================================
   PHASE 1 & 2 — NATIVE MOBILE HYGIENE, PHYSICS
   & LIQUID GLASS NAVIGATION
   ============================================ */

/* 1. Tabular Numerals: Timers, Stats, Leaderboards & Timestamps */
.tabular-nums,
time,
.timestamp,
.post-meta,
.post-date,
.comment-date,
.chat-time,
.message-time,
.stat-value,
.stat-num,
.stat-number,
.stat-count,
.kpi-value,
.metric-value,
.streak-count,
.mat-hours,
.xp-count,
.badge-count,
.social-action-btn span,
.lb-row,
.lb-rank,
.lb-score,
.lb-points,
.lb-stat,
.lb-count,
.timer-display,
#timer-display,
.timer-clock,
.timer-digits,
.timer-value,
.timer-round,
.round-timer,
[data-tabular] {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

/* 2. Touch Hygiene & iOS Input Auto-Zoom Prevention */
button,
[role="button"],
.btn,
.btn-primary,
.btn-secondary,
.btn-outline,
.btn-ghost,
.btn-danger,
.btn-icon,
.icon-btn,
.bottom-nav,
.bottom-nav-item,
.nav-item,
.social-action-btn,
.tab-btn,
.filter-chip,
.post-mood-chip {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
}

input,
textarea,
select,
.comment-input,
.header-role-select {
  font-size: max(16px, 1rem);
}

/* 3. Asymmetric Button Physics (60ms press compression / 280ms spring rebound) */
button:not(:disabled),
[role="button"]:not([aria-disabled="true"]),
.btn:not(:disabled),
.btn-primary:not(:disabled),
.btn-secondary:not(:disabled),
.btn-outline:not(:disabled),
.btn-ghost:not(:disabled),
.btn-icon:not(:disabled),
.social-action-btn:not(:disabled),
.bottom-nav-item,
.nav-item {
  transition:
    transform 280ms cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 220ms cubic-bezier(0.4, 0, 0.2, 1),
    background-color 200ms ease,
    border-color 200ms ease,
    color 180ms ease,
    opacity 180ms ease;
}

button:not(:disabled):active,
[role="button"]:not([aria-disabled="true"]):active,
.btn:not(:disabled):active,
.btn-primary:not(:disabled):active,
.btn-secondary:not(:disabled):active,
.btn-outline:not(:disabled):active,
.btn-ghost:not(:disabled):active,
.btn-icon:not(:disabled):active,
.social-action-btn:not(:disabled):active,
.bottom-nav-item:active,
.nav-item:active {
  transform: scale(0.965);
  transition:
    transform 60ms cubic-bezier(0.2, 0, 0, 1),
    box-shadow 60ms ease,
    background-color 60ms ease;
}

/* Top-lit Specular Bevel on Primary CTA */
.btn-primary {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    var(--brand-accent-shadow, 0 8px 24px rgba(29, 185, 84, 0.3));
}

@media (hover: hover) and (pointer: fine) {
  .btn-primary:not(:disabled):hover {
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.42),
      0 10px 28px rgba(29, 185, 84, 0.38);
  }
}

.btn-primary:not(:disabled):active {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    0 2px 8px var(--brand-red-glow);
}

/* 4. OLED Specular Surfaces & Pointer-Gated Hover States */
.card {
  box-shadow:
    inset 0 1px 0 0 rgba(255, 255, 255, 0.085),
    var(--shadow-md);
}

.post-card {
  box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.085);
}

.light-theme .card {
  box-shadow:
    inset 0 1px 0 0 rgba(255, 255, 255, 0.88),
    var(--shadow-sm);
}

/* Reset any sticky coarse-pointer hover bleed & gate hover to fine pointers */
@media (hover: none), (pointer: coarse) {
  .card:hover {
    background: var(--bg-card);
    border-color: var(--border);
  }
  .lb-row:hover {
    background: transparent;
  }
  .social-action-btn:not(.active):hover {
    background: transparent;
  }
}

@media (hover: hover) and (pointer: fine) {
  .card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-active);
  }

  .lb-row:hover {
    background: var(--control-bg-hover);
  }

  .social-action-btn:hover {
    background: var(--control-bg-hover);
    color: var(--text-primary);
  }
}

/* 5. Liquid Glass Bottom Navigation */
.bottom-nav {
  background: var(--nav-bg);
  -webkit-backdrop-filter: blur(24px) saturate(190%);
  backdrop-filter: blur(24px) saturate(190%);
  border-color: var(--nav-border);
  box-shadow:
    inset 0 1px 0 0 rgba(255, 255, 255, 0.10),
    0 12px 36px rgba(0, 0, 0, 0.65);
}

/* 6. 165ms Directional Micro-Parallax Tab Dissolve */
@keyframes tabEnterForward {
  0% {
    opacity: 0;
    transform: translate3d(10px, 0, 0);
  }
  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes tabEnterBackward {
  0% {
    opacity: 0;
    transform: translate3d(-10px, 0, 0);
  }
  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

.page-section.active.tab-enter-forward {
  animation: tabEnterForward 165ms var(--ease-nav-dissolve, cubic-bezier(0.22, 1, 0.36, 1));
}

.page-section.active.tab-enter-backward {
  animation: tabEnterBackward 165ms var(--ease-nav-dissolve, cubic-bezier(0.22, 1, 0.36, 1));
}

@media (prefers-reduced-motion: reduce) {
  .page-section.active.tab-enter-forward,
  .page-section.active.tab-enter-backward {
    animation: none;
  }
}

/* ============================================
   PHASE 3 — MAT-SIDE AMBIENT AURA & BJJ DELIGHT
   ============================================ */

/* 1. Sparring Round Timer Chromatic Ambient Aura */
#page-timer {
  position: relative;
  transition: background 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

#page-timer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 380px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.8s ease, background 0.8s ease;
  z-index: 0;
}

#page-timer.phase-work::before {
  opacity: 1;
  background: radial-gradient(circle at 50% 20%, rgba(29, 185, 84, 0.20) 0%, transparent 70%);
}

#page-timer.phase-warn::before {
  opacity: 1;
  background: radial-gradient(circle at 50% 20%, rgba(245, 176, 65, 0.26) 0%, transparent 70%);
  animation: timerAuraPulse 1.2s ease-in-out infinite alternate;
}

#page-timer.phase-rest::before {
  opacity: 1;
  background: radial-gradient(circle at 50% 20%, rgba(59, 158, 255, 0.22) 0%, transparent 70%);
}

@keyframes timerAuraPulse {
  0% { opacity: 0.7; }
  100% { opacity: 1; }
}

/* 2. Fist-Bump "Slap-Bump" Pop Keyframe */
@keyframes fistBumpPop {
  0% { transform: scale(1); }
  35% { transform: scale(1.38) rotate(-9deg); }
  65% { transform: scale(0.92) rotate(4deg); }
  100% { transform: scale(1) rotate(0deg); }
}

.social-action-btn.active svg,
.fistbump-btn.active svg,
.social-action-btn.bump-animate svg {
  animation: fistBumpPop 0.38s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* 3. Belt-Ranked Student Avatar Rings */
.avatar-belt-white, [data-belt="white"] .avatar-img, [data-belt="white"] .user-avatar {
  box-shadow: 0 0 0 2px #000, 0 0 0 3.5px #cbd5e1;
}
.avatar-belt-blue, [data-belt="blue"] .avatar-img, [data-belt="blue"] .user-avatar {
  box-shadow: 0 0 0 2px #000, 0 0 0 3.5px #2563eb;
}
.avatar-belt-purple, [data-belt="purple"] .avatar-img, [data-belt="purple"] .user-avatar {
  box-shadow: 0 0 0 2px #000, 0 0 0 3.5px #9333ea;
}
.avatar-belt-brown, [data-belt="brown"] .avatar-img, [data-belt="brown"] .user-avatar {
  box-shadow: 0 0 0 2px #000, 0 0 0 3.5px #854d0e;
}
.avatar-belt-black, [data-belt="black"] .avatar-img, [data-belt="black"] .user-avatar {
  box-shadow: 0 0 0 2px #000, 0 0 0 3.5px #dc2626;
}

/* 4. Tactile Woven Belt Bar Component */
.belt-visualizer-bar {
  background-image: repeating-linear-gradient(
    -45deg,
    rgba(255, 255, 255, 0.04) 0px,
    rgba(255, 255, 255, 0.04) 2px,
    transparent 2px,
    transparent 5px
  );
  box-shadow: inset 0 2px 3px rgba(255, 255, 255, 0.20), inset 0 -2px 4px rgba(0, 0, 0, 0.45);
}

/* 5. Mobile Bottom Sheet Native Ergonomics */
@media (max-width: 768px) {
  dialog.modal-sheet,
  #video-modal .modal-content,
  #chat-modal {
    border-radius: 28px 28px 0 0 !important;
  }
}

.light-theme .bottom-nav {
  background: rgba(255, 255, 255, 0.60) !important;
  border-color: rgba(255, 255, 255, 0.7) !important;
  box-shadow: 0 16px 40px rgba(0,0,0,0.10), 0 1px 1px rgba(255,255,255,0.9) inset !important;
}

.bottom-nav-item {
  background: none;
  border: none;
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  cursor: pointer;
  color: var(--nav-inactive, #555555);
  padding: 0;
  transition: color 0.2s cubic-bezier(0.16, 1, 0.3, 1), transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  -webkit-tap-highlight-color: transparent;
  position: relative;
  touch-action: manipulation;
}

/* Ambient glow halo capsule behind active tab (kept subtle and clean, zero blurry radio glow) */
.bottom-nav-item::after {
  content: '';
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 6px;
  right: 6px;
  border-radius: 16px;
  background: var(--nav-pill-bg);
  border: 1px solid transparent;
  pointer-events: none;
  opacity: 0 !important;
  display: none !important;
  transform: scale(0.88);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 0;
}

.bottom-nav-item.active::after {
  opacity: 0 !important;
  display: none !important;
  background: var(--nav-pill-bg);
  box-shadow: none !important;
}

/* Icon container — clean native rendering without fuzzy glows */
.nav-icon-wrap {
  width: 38px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  z-index: 1;
  background: transparent !important;
}

.nav-icon-wrap svg {
  width: 20px;
  height: 20px;
  stroke: #8c96a8;
  transition: stroke 0.2s cubic-bezier(0.16, 1, 0.3, 1), transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  stroke-width: 1.75;
}

.nav-avatar-badge {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 1.5px solid var(--border-active);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 800;
  color: var(--text-primary);
  font-family: var(--font-display);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.bottom-nav-item.active .nav-icon-wrap .nav-avatar-badge:not([style*="background-image"]) {
  background: var(--bg-elevated, #111216) !important;
  color: var(--accent-glow, #43e67a) !important;
  border-color: var(--accent-glow, #43e67a) !important;
  font-weight: 900;
  box-shadow: none !important;
}

.nav-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  font-family: var(--font-display);
  transition: color 0.2s cubic-bezier(0.16, 1, 0.3, 1), background 0.2s ease, opacity 0.2s ease;
  line-height: 1;
  position: relative;
  z-index: 1;
  color: var(--text-muted, #8c96a8);
  padding: 2px 4px;
  border-radius: 9999px;
  margin-top: 1px;
}

/* ── Active state — matching native reference app ── */
.bottom-nav-item.active {
  color: #ffffff;
}

.bottom-nav-item.active .nav-icon-wrap {
  background: transparent !important;
  color: var(--accent-glow, #43e67a) !important;
  transform: translateY(-1px);
  box-shadow: var(--nav-pill-glow) !important;
  border-radius: 12px;
}

.bottom-nav-item.active .nav-icon-wrap svg {
  stroke: var(--accent-glow, #43e67a) !important;
  stroke-width: 2.2 !important;
  transform: scale(1.08);
}

.bottom-nav-item.active .nav-label {
  color: var(--accent-contrast, #000000) !important;
  background: var(--accent-glow, #43e67a) !important;
  font-weight: 800 !important;
  letter-spacing: 0.4px;
  text-shadow: none !important;
  box-shadow: none !important;
}

.light-theme .bottom-nav-item.active .nav-label {
  color: #ffffff !important;
  background: #16a34a !important;
}

/* Hover (non-active) */
.bottom-nav-item:not(.active):hover .nav-icon-wrap {
  background: var(--bg-input);
  transform: translateY(-1px);
}

.bottom-nav-item:not(.active):hover {
  color: var(--text-secondary);
}

/* Press tap feedback */
.bottom-nav-item:active .nav-icon-wrap {
  transform: scale(0.92) translateY(-1px);
}



/* ============================================
   VERTICAL TECHNIQUES LIST & ITEMS
   ============================================ */
.techniques-list-vertical {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-top: 8px;
  width: 100%;
}

@media (min-width: 768px) {
  .techniques-list-vertical {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
}

.tech-item-row {
  content-visibility: auto;
  contain: content;
  contain-intrinsic-size: 0 120px;
  background: none;
  border: none;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  padding: 12px 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  transition: var(--transition);
  width: 100%;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

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

.tech-item-row:hover {
  background: none;
  border-bottom-color: var(--border-active);
}

.tech-check-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 1.5px solid var(--border-active, rgba(255, 255, 255, 0.2));
  background: rgba(255, 255, 255, 0.04);
  color: transparent;
  cursor: pointer;
  flex-shrink: 0;
  transition: var(--transition);
  padding: 0;
  position: relative;
  touch-action: manipulation;
}

.tech-check-btn::before {
  content: "";
  position: absolute;
  inset: -12px;
}

.tech-check-btn:hover {
  border-color: var(--brand-accent, #cafd00);
  background: rgba(202, 253, 0, 0.08);
}

.tech-check-btn.checked {
  background: var(--brand-accent, #cafd00);
  border-color: var(--brand-accent, #cafd00);
  color: #000000;
}

.tech-item-row.completed .tech-row-text {
  color: var(--text-muted);
  text-decoration: line-through;
  text-decoration-color: var(--brand-accent, #cafd00);
}

.tech-item-row.completed .tech-row-num {
  background: rgba(202, 253, 0, 0.15);
  color: var(--brand-accent, #cafd00);
}

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

.tech-item-row:hover {
  background: none;
  border-bottom-color: var(--border-active);
}

.tech-item-row-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.tech-row-num {
  font-size: 8px;
  font-weight: 900;
  color: var(--brand-blue);
  background: rgba(59, 158, 255, 0.1);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  letter-spacing: 0.5px;
  flex-shrink: 0;
}

.tech-row-text {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.35;
  white-space: normal;
  word-break: break-word;
}

.tech-item-row .tech-watch-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(202, 253, 0, 0.1);
  color: var(--brand-red);
  border: none;
  border-radius: var(--radius-sm);
  padding: 5px 10px;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  flex-shrink: 0;
}

.tech-item-row .tech-watch-btn:hover {
  background: var(--brand-red);
  color: #0e0e0e;
}

/* ============================================
   CARDS
   ============================================ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: var(--transition);
  box-shadow: 0 0 0 0.5px rgba(255,255,255,0.02) inset, 0 2px 12px rgba(0,0,0,0.3);
}

.card:hover {
  border-color: var(--border-active);
  box-shadow: var(--shadow-md);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.stat-card {
  padding: 14px !important;
  text-align: center;
  margin: 0 !important;
  background: var(--bg-surface) !important;
  border: 1px solid var(--border) !important;
}

.card-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 14px;
  letter-spacing: -0.2px;
}

/* Hero Card with Gradient */
.card-hero {
  background: linear-gradient(135deg, var(--bg-elevated) 0%, var(--bg-overlay) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 24px;
  position: relative;
  overflow: hidden;
}

.card-hero::before {
  content: '';
  position: absolute;
  top: -60px;
  right: -60px;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: rgba(202, 253, 0, 0.06);
  filter: blur(60px);
  pointer-events: none;
}

/* ============================================
   CURRICULUM SECTION
   ============================================ */
.curriculum-controls {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.search-input-wrapper {
  position: relative;
  flex-grow: 1;
}

.search-input-wrapper svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  color: var(--text-muted);
}

.search-input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 12px 10px 36px;
  font-family: var(--font-primary);
  font-size: 13px;
  color: var(--text-primary);
  outline: none;
  transition: var(--transition);
}

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

.search-input:focus {
  border-color: var(--brand-red);
  background: var(--bg-input-focus);
  box-shadow: 0 0 0 3px var(--brand-red-glow);
}

.filter-select {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  font-family: var(--font-primary);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  outline: none;
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
}

.filter-select:focus {
  border-color: var(--brand-red);
}

/* Phase Group */
.phase-group {
  margin-bottom: 28px;
}

.phase-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  padding: 0 2px;
}

.phase-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.phase-name {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-secondary);
}

.phase-range {
  font-size: 11px;
  color: var(--text-muted);
  margin-left: auto;
}

.phase-pill {
  font-size: 9px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Week Cards */
.weeks-container {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

details.week-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: var(--transition);
}

details.week-card:hover {
  border-color: var(--border-active);
}

details.week-card[open] {
  border-color: var(--border-active);
  box-shadow: var(--shadow-md);
}

summary.week-summary {
  list-style: none;
  padding: 13px 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

summary.week-summary::-webkit-details-marker { display: none; }

.week-summary-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.week-num-badge {
  font-size: 10px;
  font-weight: 800;
  width: 26px;
  height: 26px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-family: var(--font-display);
}

.week-summary-left.nogi .week-num-badge {
  background: rgba(59, 158, 255, 0.1);
  color: var(--brand-blue);
}

.week-summary-left.gi .week-num-badge {
  background: rgba(155, 89, 245, 0.1);
  color: var(--brand-purple);
}

.week-title-text {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

.week-summary-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.type-tag {
  font-size: 9px;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.type-tag.nogi {
  background: rgba(59, 158, 255, 0.1);
  color: var(--brand-blue);
}

.type-tag.gi {
  background: rgba(155, 89, 245, 0.1);
  color: var(--brand-purple);
}

.type-tag.video {
  background: rgba(232, 69, 60, 0.1);
  color: var(--brand-red);
}

.chevron-icon {
  width: 14px;
  height: 14px;
  color: var(--text-muted);
  transition: transform 0.22s ease;
  flex-shrink: 0;
}

details.week-card[open] .chevron-icon {
  transform: rotate(180deg);
}

/* Week Detail Panel */
.week-details-content {
  padding: 0 16px 16px 16px;
  border-top: 1px solid var(--border-subtle);
}

.week-goal-block {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.55;
  margin: 14px 0;
  padding: 10px 14px;
  background: var(--bg-input);
  border-radius: var(--radius-md);
  border-left: 3px solid var(--brand-red);
}

.week-goal-block strong {
  display: block;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--brand-red);
  margin-bottom: 4px;
}

.week-sections-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.section-label {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 1px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 5px;
}

/* Techniques List — each item as a "chip-row" */
.techniques-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.tech-item {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font-size: 12px;
  line-height: 1.4;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  transition: var(--transition);
}

.tech-item:hover {
  border-color: var(--border);
  background: var(--bg-input-focus);
}

.tech-text { flex: 1; color: var(--text-primary); }

.tech-watch-btn {
  background: rgba(232, 69, 60, 0.08);
  border: 1px solid rgba(232, 69, 60, 0.2);
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  font-size: 9px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--brand-red);
  letter-spacing: 0.3px;
  white-space: nowrap;
  flex-shrink: 0;
  transition: var(--transition-bounce);
}

.tech-watch-btn:hover {
  background: var(--brand-red);
  color: #fff;
  border-color: var(--brand-red);
  transform: scale(1.05);
}

.tech-watch-btn svg { width: 10px; height: 10px; fill: currentColor; stroke: none; }

.drills-and-sparring {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.info-block {
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.45;
  border-left: 2px solid var(--border-active);
}

.info-block.drills { border-left-color: var(--brand-blue); }
.info-block.sparring { border-left-color: var(--brand-purple); }
.info-block strong { font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; display: block; margin-bottom: 3px; }
.info-block.drills strong { color: var(--brand-blue); }
.info-block.sparring strong { color: var(--brand-purple); }

/* ============================================
   STUDENT DASHBOARD
   ============================================ */
.student-hero-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 20px;
  margin-bottom: 16px;
  position: relative;
  overflow: hidden;
}

.student-hero-card::after {
  display: none;
}

.student-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.student-name-block {
  display: flex;
  flex-direction: column;
}

.student-name {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.4px;
}

.student-subtitle {
  font-size: 12px;
  color: var(--text-secondary);
}

.belt-display-mini {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.belt-name-mini {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.belt-stripes-mini {
  display: flex;
  gap: 3px;
}

.stripe-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand-gold);
}

/* Belt Visual Bar */
.belt-bar-visual {
  width: 100%;
  height: 20px;
  border-radius: 5px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.belt-bar-color {
  position: absolute;
  left: 0; top: 0;
  width: 78%;
  height: 100%;
  border-radius: 5px 0 0 5px;
}

.belt-bar-black {
  position: absolute;
  right: 0; top: 0;
  width: 22%;
  height: 100%;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: space-evenly;
  padding: 0 3px;
  border-radius: 0 5px 5px 0;
}

.belt-bar-stripe-line {
  width: 2px;
  height: 13px;
  background: rgba(255,255,255,0.85);
  border-radius: 1px;
}

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

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  position: relative;
  overflow: hidden;
}

.stat-card-icon {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}

.stat-card-icon svg { width: 14px; height: 14px; }

.stat-card-icon.blue { background: rgba(59,158,255,0.1); color: var(--brand-blue); }
.stat-card-icon.purple { background: rgba(155,89,245,0.1); color: var(--brand-purple); }
.stat-card-icon.green { background: rgba(29,185,84,0.1); color: var(--brand-green); }

.stat-val {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1;
}

.stat-val.blue { color: var(--brand-blue); }
.stat-val.purple { color: var(--brand-purple); }
.stat-val.green { color: var(--brand-green); }

.stat-lbl {
  font-size: 9px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Attendance Progress bar */
.attendance-bar-block {
  margin-bottom: 16px;
}

.attendance-bar-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
}

.attendance-bar-label { font-size: 12px; font-weight: 600; }
.attendance-bar-count { font-size: 12px; color: var(--text-secondary); }

.progress-track {
  width: 100%;
  height: 6px;
  background: var(--bg-input);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--brand-blue), var(--brand-purple));
  border-radius: var(--radius-full);
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Journal Grid */
.journal-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 16px;
}

/* ============================================
   FORMS
   ============================================ */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.2px;
  text-transform: uppercase;
}

.form-input, .form-select, .form-textarea {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  font-family: var(--font-primary);
  font-size: 13px;
  color: var(--text-primary);
  outline: none;
  transition: var(--transition);
  width: 100%;
}

#journal-date {
  max-width: 160px;
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--text-placeholder);
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--brand-red);
  background: var(--bg-input-focus);
  box-shadow: 0 0 0 3px var(--brand-red-glow);
}

.form-select { cursor: pointer; }

.form-textarea {
  resize: vertical;
  min-height: 80px;
  line-height: 1.5;
}

.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.journal-form-inner {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Intensity slider — range input */
#intensity-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--brand-accent);
  cursor: pointer;
  box-shadow: 0 0 0 3px var(--brand-accent-bg), 0 2px 6px rgba(0,0,0,0.3);
  transition: box-shadow 0.15s, transform 0.15s;
  border: none;
}
#intensity-slider::-webkit-slider-thumb:hover {
  box-shadow: 0 0 0 5px var(--brand-accent-bg), 0 2px 8px rgba(0,0,0,0.3);
  transform: scale(1.1);
}
#intensity-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--brand-accent);
  cursor: pointer;
  border: none;
  box-shadow: 0 0 0 3px var(--brand-accent-bg), 0 2px 6px rgba(0,0,0,0.3);
}
#intensity-slider::-webkit-slider-runnable-track {
  border-radius: 10px;
  height: 6px;
}
#intensity-slider::-moz-range-track {
  border-radius: 10px;
  height: 6px;
  background: var(--bg-input);
}


/* Action Button — Pill style, matches 43gfm28.fit */
.btn-primary {
  background: #1db954;
  border: none;
  padding: 13px 22px;
  border-radius: 999px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  color: #ffffff;
  letter-spacing: 0.1px;
  transition: var(--transition-bounce);
  box-shadow: 0 4px 16px rgba(29, 185, 84, 0.22);
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-primary:hover {
  background: #d8ff3a;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(202, 253, 0, 0.35);
}

.btn-primary:active { transform: scale(0.97); }

.btn-secondary {
  background: var(--control-bg, rgba(255,255,255,0.05));
  border: 1px solid var(--control-border, rgba(255,255,255,0.10));
  padding: 11px 18px;
  border-radius: 999px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 12px;
  cursor: pointer;
  color: var(--text-primary);
  transition: var(--transition);
}

.btn-secondary:hover {
  background: var(--control-bg-hover, rgba(255,255,255,0.08));
  border-color: var(--control-border-hover, rgba(255,255,255,0.16));
}

/* ============================================
   TRAINING LOG FEED
   ============================================ */
.history-feed {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 380px;
  overflow-y: auto;
  padding-right: 2px;
}

.feed-item {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px;
  transition: var(--transition);
  cursor: pointer;
}

.feed-item:hover {
  border-color: var(--border-active);
  background: var(--bg-input-focus);
}

.feed-item.selected {
  border-color: var(--brand-purple);
  background: rgba(155,89,245,0.05);
}

.feed-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 5px;
}

.feed-date {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
}

.feed-mood {
  font-size: 11px;
  color: var(--brand-gold);
  font-weight: 600;
}

.feed-topic {
  font-size: 12px;
  font-weight: 700;
  color: var(--brand-blue);
  margin-bottom: 4px;
}

.feed-notes {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.feed-coach-reply {
  background: rgba(155,89,245,0.06);
  border-left: 2px solid var(--brand-purple);
  padding: 8px 10px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin-top: 8px;
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.feed-coach-reply strong {
  color: var(--brand-purple);
  display: block;
  margin-bottom: 2px;
  font-size: 10px;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  gap: 8px;
  color: var(--text-muted);
  text-align: center;
}

.empty-state svg {
  width: 32px;
  height: 32px;
  opacity: 0.4;
}

.empty-state p { font-size: 13px; }

/* ============================================
   COACH PANEL
   ============================================ */
.coach-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.coach-detail-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ============================================
   TIMER PANEL
   ============================================ */
.timer-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.timer-hero-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg, 20px);
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.timer-hero-card::before {
  display: none;
}

.timer-phase-badge {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  color: #fff;
  margin-bottom: 16px;
}

.timer-clock {
  font-family: var(--font-display);
  font-size: 72px;
  font-weight: 800;
  letter-spacing: -4px;
  line-height: 1;
  margin-bottom: 8px;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(to bottom, var(--text-primary) 40%, var(--text-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.timer-block-name {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 4px;
}

.timer-block-desc {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 20px;
  max-width: 280px;
}

.timer-progress {
  width: 100%;
  max-width: 300px;
  height: 4px;
  background: var(--bg-input);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: 20px;
}

.timer-progress-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, var(--brand-red), var(--brand-orange));
  transition: width 0.5s ease;
}

.timer-controls {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
}

.timer-btn {
  background: var(--bg-elevated);
  border: 1.5px solid var(--border-active);
  border-radius: 50%;
  width: 48px;
  height: 48px;
  min-width: 48px;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  touch-action: manipulation;
  transition: transform 0.10s cubic-bezier(0.2, 0, 0, 1), background-color 0.12s ease, border-color 0.12s ease;
  user-select: none;
  -webkit-user-select: none;
}

.timer-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-active);
  background: var(--bg-overlay);
}

.timer-btn:active {
  transform: scale(0.94);
  transition: transform 0.05s ease-out;
}

#timer-reset-btn {
  width: 48px;
  height: 48px;
  min-width: 48px;
  min-height: 48px;
  border-color: rgba(255, 255, 255, 0.22);
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

#timer-reset-btn svg {
  width: 20px;
  height: 20px;
}

.timer-btn.play-btn,
#timer-play-btn {
  width: 68px;
  height: 68px;
  min-width: 68px;
  min-height: 68px;
  border-radius: 50%;
  background: var(--brand-green, #1db954);
  border: 2px solid rgba(255, 255, 255, 0.25);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
  transition: transform 0.10s cubic-bezier(0.2, 0, 0, 1), box-shadow 0.12s ease, background-color 0.12s ease;
}

.timer-btn.play-btn:hover,
#timer-play-btn:hover {
  transform: scale(1.04);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45);
}

.timer-btn.play-btn:active,
#timer-play-btn:active {
  transform: scale(0.95);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
  transition: transform 0.05s ease-out;
}

.timer-btn svg {
  width: 20px;
  height: 20px;
  fill: none;
}

.timer-btn.play-btn svg,
#timer-play-btn svg {
  width: 28px;
  height: 28px;
  fill: currentColor;
  stroke: none;
}

.timer-fastmode-row {
  margin-top: 16px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-muted);
  cursor: pointer;
}

.timer-fastmode-row input { cursor: pointer; accent-color: var(--brand-red); }

/* Timer blocks schedule list */
.timer-blocks-card { }

.timer-block-rows {
  display: flex;
  flex-direction: column;
  gap: 5px;
  max-height: 300px;
  overflow-y: auto;
}

.timer-block-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
}

.timer-block-row:hover {
  border-color: var(--border);
  background: var(--bg-input-focus);
}

.timer-block-row.active {
  background: rgba(232,69,60,0.07);
  border-color: rgba(232,69,60,0.25);
}

.timer-block-row.completed {
  opacity: 0.35;
}

.block-row-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.block-row-num {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  width: 16px;
  flex-shrink: 0;
}

.block-row-name {
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.block-row-duration {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
  flex-shrink: 0;
}

/* ============================================
   VIDEO MODAL
   ============================================ */
dialog.video-overlay {
  background: var(--bg-elevated);
  border: 1px solid var(--border-active);
  border-radius: var(--radius-xl);
  padding: 20px;
  width: 92%;
  max-width: 520px;
  margin: auto;
  color: var(--text-primary);
  outline: none;
  box-shadow: var(--shadow-xl);
}

dialog.video-overlay::backdrop {
  background: rgba(0,0,0,0.88);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.video-overlay-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.video-overlay-header h3 {
  font-size: 15px;
  font-weight: 700;
}

.close-overlay-btn {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 48px;
  height: 48px;
  min-width: 48px;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  touch-action: manipulation;
  transition: transform 0.10s cubic-bezier(0.2, 0, 0, 1), background-color 0.12s ease, color 0.12s ease;
  user-select: none;
  -webkit-user-select: none;
}

.close-overlay-btn:active {
  transform: scale(0.94);
  transition: transform 0.05s ease-out;
}

.close-overlay-btn:hover { color: var(--text-primary); background: var(--bg-input-focus); }
.close-overlay-btn svg { width: 16px; height: 16px; }

.video-container {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #000;
  border: 1px solid var(--border);
}

.video-container iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border: none;
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */
.toast-container {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 200;
  pointer-events: none;
  width: 90%;
  max-width: 340px;
}

.toast {
  background: var(--bg-elevated);
  border: 1px solid var(--border-active);
  border-radius: var(--radius-md);
  padding: 11px 16px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.toast.success { border-left: 3px solid var(--brand-green); color: var(--text-primary); }
.toast.info    { border-left: 3px solid var(--brand-blue);  color: var(--text-primary); }
.toast.error   { border-left: 3px solid #ef4444;            color: var(--text-primary); }
.toast svg { width: 16px; height: 16px; flex-shrink: 0; stroke: currentColor; }

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

/* ============================================
   DESKTOP RESPONSIVE OVERRIDES (≥ 768px)
   ============================================ */
@media (min-width: 768px) {
  /* Hide sidebar completely */
  .sidebar { display: none !important; }

  /* Always keep bottom nav & header logo visible */
  .bottom-nav, .header-logo-mobile { display: flex !important; }

  /* Show desktop title */
  .header-title-desktop { display: block; }

  /* Content padding */
  .app-main-content {
    padding: 24px 28px 100px 28px;
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
  }

  /* Multi-column grids */
  .form-grid-2 { grid-template-columns: 1fr 1fr; }
  .journal-grid { grid-template-columns: 1.3fr 1fr; }
  .coach-layout { grid-template-columns: 1fr; }
  .timer-layout {
    grid-template-columns: 1fr;
    max-width: 480px;
    margin: 0 auto;
    width: 100%;
  }
  .stats-row { gap: 12px; }
  
  .week-sections-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  /* Toast position on desktop */
  .toast-container {
    bottom: 90px;
    left: 50%;
    transform: translateX(-50%);
  }

  @keyframes toastIn {
    from { opacity: 0; transform: translateY(12px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
  }
}


/* ============================================
   SHARED SELECT ELEMENT COLOR FIX (Dark/Light)
   ============================================ */
.filter-select,
.form-select,
.header-role-select,
select {
  color: var(--text-primary);
}

.dark-theme select option { background-color: #1e2330; color: #f0f2f5; }
.light-theme select option { background-color: #ffffff; color: #0d1117; }

/* ============================================
   INTERACTIVE TIMELINE ROADMAP & WEEKS GRID
   ============================================ */
.phase-stepper-track {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 5px;
  margin-bottom: 16px;
  background: rgba(0, 0, 0, 0.04);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 16px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.dark-theme .phase-stepper-track {
  background: rgba(255, 255, 255, 0.035);
  border-color: rgba(255, 255, 255, 0.07);
}

.phase-stepper-track::-webkit-scrollbar {
  display: none;
}

.phase-step-node {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 8px 14px;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}

.phase-step-node:hover {
  color: var(--text-primary);
  background: rgba(0, 0, 0, 0.03);
}

.dark-theme .phase-step-node:hover {
  background: rgba(255, 255, 255, 0.04);
}

.light-theme .phase-step-node.active {
  background: #ffffff !important;
  color: #0f172a !important;
  border-color: rgba(0, 0, 0, 0.08) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04) !important;
}

.dark-theme .phase-step-node.active {
  background: #181b24 !important;
  color: #f8fafc !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
}

.phase-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-block;
}

/* Light theme — white-belt is invisible on white backgrounds */
.light-theme .lb-avatar[style*="background:#c0c8d6"],
.light-theme .lb-avatar[style*="background: #c0c8d6"] {
  border: 1.5px solid rgba(0,0,0,0.15);
}

.light-theme .profile-avatar-circle-white {
  border: 2px solid rgba(0,0,0,0.15);
}

.phase-billboard-card {
  margin-bottom: 20px;
  border-radius: 20px;
  padding: 20px;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
}

.light-theme .phase-billboard-card {
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  border-color: rgba(0, 0, 0, 0.07);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.04);
}

.dark-theme .phase-billboard-card {
  background: linear-gradient(135deg, #131620 0%, #0d0f15 100%);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.phase-billboard-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.phase-billboard-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.weeks-grid-container {
  display: grid;
  grid-template-columns: 1fr !important;
  gap: 12px;
  align-items: start;
  will-change: transform;
  transform: translateZ(0);
}

.week-curriculum-card {
  width: 100% !important;
  box-sizing: border-box !important;
  content-visibility: auto;
  contain: content;
  contain-intrinsic-size: 0 120px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 16px 18px;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.light-theme .week-curriculum-card {
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.03), 0 8px 24px -4px rgba(15, 23, 42, 0.06);
}

.dark-theme .week-curriculum-card {
  background: #0f1117;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07), 0 8px 24px rgba(0, 0, 0, 0.45);
}

.week-curriculum-card:hover {
  border-color: var(--border-active);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.light-theme .week-curriculum-card:hover {
  border-color: rgba(15, 23, 42, 0.18);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06), 0 16px 32px -6px rgba(15, 23, 42, 0.10);
}

.dark-theme .week-curriculum-card:hover {
  border-color: rgba(255, 255, 255, 0.16);
  background: #141720;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.10), 0 12px 32px rgba(0, 0, 0, 0.6);
}

.week-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  cursor: pointer;
}

.week-card-header-left {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.week-card-num {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 800;
  min-width: 34px;
  height: 30px;
  padding: 0 6px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.week-card-title {
  font-family: var(--font-primary);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--text-primary);
  line-height: 1.3;
}

.type-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  line-height: 1.25;
  border: 1px solid transparent;
}

.type-tag.gi {
  background: rgba(59, 130, 246, 0.10);
  border-color: rgba(59, 130, 246, 0.22);
  color: #2563eb;
}

.dark-theme .type-tag.gi {
  background: rgba(59, 130, 246, 0.15);
  border-color: rgba(96, 165, 250, 0.28);
  color: #93c5fd;
}

.type-tag.nogi {
  background: rgba(245, 158, 11, 0.10);
  border-color: rgba(245, 158, 11, 0.22);
  color: #d97706;
}

.dark-theme .type-tag.nogi {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(251, 191, 36, 0.28);
  color: #fcd34d;
}

.type-tag.video {
  background: rgba(239, 68, 68, 0.10);
  border-color: rgba(239, 68, 68, 0.22);
  color: #dc2626;
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.15s ease;
}

.dark-theme .type-tag.video {
  background: rgba(244, 63, 94, 0.15);
  border-color: rgba(251, 113, 133, 0.28);
  color: #fda4af;
}

.type-tag.video:active {
  transform: scale(0.95);
}

.coach-edit-week-btn {
  background: rgba(16, 185, 129, 0.10) !important;
  border: 1px solid rgba(16, 185, 129, 0.22) !important;
  color: #059669 !important;
  border-radius: 8px !important;
  padding: 3px 9px !important;
  font-size: 10px !important;
  font-weight: 700 !important;
  transition: transform 0.15s ease, background 0.15s ease;
}

.dark-theme .coach-edit-week-btn {
  background: rgba(16, 185, 129, 0.15) !important;
  border-color: rgba(52, 211, 153, 0.28) !important;
  color: #34d399 !important;
}

.coach-edit-week-btn:active {
  transform: scale(0.95);
}

.week-card-title {
  font-size: 14.5px;
  font-weight: 800;
  font-family: var(--font-primary, sans-serif);
  color: var(--text-primary);
  line-height: 1.25;
  white-space: normal;
  word-break: normal;
  overflow-wrap: break-word;
  flex: 1;
  min-width: 0;
}

.week-card-header-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.week-card-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease;
  opacity: 0;
  border-top: 1px solid transparent;
  padding-top: 0;
}

.week-curriculum-card.expanded {
  border-color: var(--border-active);
  box-shadow: var(--shadow-lg);
  background: var(--bg-card-hover);
}

.week-curriculum-card.expanded .week-card-body {
  max-height: 1200px;
  opacity: 1;
  border-top-color: var(--border-subtle);
  padding-top: 12px;
  margin-top: 4px;
}

.week-curriculum-card.expanded .chevron-icon {
  transform: rotate(180deg);
}

@media (min-width: 992px) {
  .weeks-grid-container {
    grid-template-columns: 1fr;
    max-width: 680px;
    margin: 0 auto;
    gap: 14px;
  }
}

/* ============================================
   ANIMATED GRAPPLING POSITION ICONS
   ============================================ */
.position-icon-svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  stroke: currentColor;
  stroke-width: 1.8;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.3s ease;
}

/* Enforce SVG ViewBox coordinate system for transforms across all browsers */
.position-icon-svg .fig-left,
.position-icon-svg .fig-right,
.position-icon-svg .guard-legs,
.position-icon-svg .top-body,
.position-icon-svg .hooks,
.position-icon-svg .leg-joint,
.position-icon-svg path {
  transform-box: view-box;
}

/* Wrestling Swaying clinchers */
.icon-wrestling .fig-left {
  transform-origin: 8px 20px;
  animation: sway-left 3.5s ease-in-out infinite;
}
.icon-wrestling .fig-right {
  transform-origin: 16px 20px;
  animation: sway-right 3.5s ease-in-out infinite;
}
@keyframes sway-left {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(5deg); }
}
@keyframes sway-right {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(-5deg); }
}

/* Guard clamping motion */
.icon-guard .guard-legs {
  transform-origin: 12px 14px;
  animation: clamp-legs 2.5s ease-in-out infinite;
}
@keyframes clamp-legs {
  0%, 100% { transform: scaleX(1); }
  50% { transform: scaleX(0.85); }
}

/* Top control pressure push */
.icon-topcontrol .top-body {
  transform-origin: 14px 12px;
  animation: pressure-push 2s ease-in-out infinite;
}
@keyframes pressure-push {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(1.5px); }
}

/* Back Hooks glowing red */
.icon-back .hooks {
  animation: glow-hooks 2s ease-in-out infinite;
}
@keyframes glow-hooks {
  0%, 100% { opacity: 0.5; stroke-width: 1.5; stroke: var(--text-secondary); }
  50% { opacity: 1; stroke-width: 2.2; stroke: var(--brand-red); }
}

/* Escape rotating arrow on hover */
.icon-escape {
  transform-origin: center;
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.week-curriculum-card:hover .icon-escape {
  transform: rotate(180deg);
}

/* Leg Lock tension — restricted to active/hover/current cards */
.icon-leglock .leg-joint {
  transform-origin: 12px 14px;
}
.week-curriculum-card:hover .icon-leglock .leg-joint,
.week-curriculum-card.expanded .icon-leglock .leg-joint,
.week-curriculum-card.current-week-highlight .icon-leglock .leg-joint {
  animation: lock-stress 1.5s ease-in-out infinite;
}
@keyframes lock-stress {
  0%, 100% { transform: skewX(0); }
  50% { transform: skewX(5deg); }
}

/* Default flow breathing — restricted to active/hover/current cards */
.position-icon-svg path:last-child {
  transform-origin: center;
}
.week-curriculum-card:hover .position-icon-svg path:last-child,
.week-curriculum-card.expanded .position-icon-svg path:last-child,
.week-curriculum-card.current-week-highlight .position-icon-svg path:last-child {
  animation: flow-breathing 4s ease-in-out infinite;
}
@keyframes flow-breathing {
  0%, 100% { transform: scaleY(1); }
  50% { transform: scaleY(0.9) translateY(0.5px); }
}

/* Pause running animations during active scroll to eliminate GPU repaints */
body.is-scrolling .icon-leglock .leg-joint,
body.is-scrolling .position-icon-svg path:last-child {
  animation-play-state: paused !important;
}

/* ============================================
   CURRENT WEEK SPOTLIGHT HIGHLIGHTS
   ============================================ */
.week-curriculum-card.current-week-highlight {
  border-color: rgba(16, 185, 129, 0.45) !important;
  box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.20), 0 8px 24px -4px rgba(16, 185, 129, 0.16) !important;
  position: relative;
}

.dark-theme .week-curriculum-card.current-week-highlight {
  border-color: rgba(52, 211, 153, 0.42) !important;
  box-shadow: 0 0 0 1px rgba(52, 211, 153, 0.22), 0 12px 32px -4px rgba(16, 185, 129, 0.24) !important;
}

.current-week-badge-pill {
  position: static !important;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(16, 185, 129, 0.14);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #047857;
  font-size: 9.5px;
  font-weight: 800;
  padding: 4px 10px 4px 8px;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  pointer-events: none;
  white-space: nowrap;
  flex-shrink: 0;
}

.dark-theme .current-week-badge-pill {
  background: rgba(16, 185, 129, 0.16);
  border-color: rgba(52, 211, 153, 0.36);
  color: #34d399;
}

/* Horizontal swipeable technique tiles */
.tech-tiles-scroll-row {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 4px 4px 12px 4px;
  margin-top: 8px;
  -webkit-overflow-scrolling: touch;
  flex-wrap: nowrap;
}
.tech-tiles-scroll-row::-webkit-scrollbar {
  height: 4px;
}
.tech-tiles-scroll-row::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.02);
  border-radius: 4px;
}
.tech-tiles-scroll-row::-webkit-scrollbar-thumb {
  background: var(--border-active);
  border-radius: 4px;
}

.tech-tile {
  flex: 0 0 160px;
  scroll-snap-align: start;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 95px;
  transition: var(--transition);
}
.tech-tile:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--border-active);
  transform: translateY(-1px);
}
.tech-tile-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.tech-tile-index {
  font-size: 8px;
  font-weight: 800;
  color: var(--brand-blue);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.tech-tile-name {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.tech-tile .tech-watch-btn {
  margin-top: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: rgba(59, 158, 255, 0.08);
  color: var(--brand-blue);
  border: none;
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  font-size: 9px;
  font-weight: 700;
  cursor: pointer;
  width: 100%;
  transition: var(--transition);
}
.tech-tile .tech-watch-btn:hover {
  background: var(--brand-blue);
  color: #fff;
}
.play-icon-svg {
  width: 8px;
  height: 8px;
}

/* Drills & Sparring horizontal grid */
.drills-sparring-container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-top: 8px;
}
@media (min-width: 480px) {
  .drills-sparring-container {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
}
.info-block .block-content {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.35;
  margin-top: 2px;
}

@media (min-width: 768px) {
  .tech-tiles-scroll-row {
    flex-wrap: wrap;
    overflow-x: visible;
    padding-bottom: 4px;
  }
  .tech-tile {
    flex: 1 1 calc(25% - 10px);
    min-width: 140px;
  }
}

/* ============================================
   COMMUNITY FEED & SOCIAL STYLES — v3.0 Mobile-First
   ============================================ */

/* Feed container — smooth native scroll with gap */
.community-feed-scroll {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 12px;
  will-change: transform;
  transform: translateZ(0);
}

/* Post Card — Standalone Modern Card */
.post-card {
  content-visibility: auto;
  contain: content;
  contain-intrinsic-size: 0 120px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 16px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.22s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.22s ease, background 0.15s;
  animation: postFadeIn 0.3s ease both;
  overflow: hidden;
}

.post-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-brand);
}

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

/* Avatar + Name Row */
.post-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.post-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 800;
  font-family: var(--font-display);
  flex-shrink: 0;
  border: 2px solid rgba(255,255,255,0.08);
}

.post-author-name {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  font-family: var(--font-display);
}

.post-meta {
  font-size: 11px;
  color: #666666;
  margin-top: 1px;
}

.post-belt-chip {
  margin-left: auto;
  font-size: 9px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  font-family: var(--font-display);
  flex-shrink: 0;
}

/* Post content */
.post-topic {
  font-size: 12px;
  font-weight: 700;
  color: var(--brand-accent, #cafd00);
  margin-bottom: 6px;
  font-family: var(--font-display);
  display: flex;
  align-items: center;
  gap: 6px;
}

.post-notes {
  font-size: 13px;
  line-height: 1.5;
  color: #c4c9d1;
  margin-bottom: 10px;
}

.post-mood-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  background: var(--brand-accent-bg, rgba(202,253,0,0.08));
  color: var(--brand-accent, #cafd00);
  border: 1px solid var(--brand-accent-border, rgba(202,253,0,0.2));
  padding: 3px 10px;
  border-radius: 999px;
  margin-bottom: 10px;
  font-family: var(--font-display);
}

/* Social actions bar */
.post-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  padding-top: 8px;
  border-top: 1px solid rgba(255,255,255,0.04);
}

.social-action-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  background: none;
  border: none;
  color: #666666;
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font-display);
  cursor: pointer;
  padding: 7px 10px;
  border-radius: 999px;
  transition: var(--transition);
  -webkit-tap-highlight-color: transparent;
}

.social-action-btn svg {
  width: 18px;
  height: 18px;
  transition: var(--transition);
}

.social-action-btn:hover {
  background: rgba(255,255,255,0.05);
  color: #c4c9d1;
}

.social-action-btn.active {
  color: var(--brand-accent, #cafd00);
  background: var(--brand-accent-bg, rgba(202, 253, 0, 0.08));
}

.social-action-btn.active svg {
  filter: drop-shadow(0 0 5px var(--brand-accent-border, rgba(202,253,0,0.5)));
}

/* Fist bump animation */
.social-action-btn.bump-animate svg {
  animation: bumpPop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes bumpPop {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.6) rotate(-10deg); }
  100% { transform: scale(1); }
}

/* Comments section */
.post-comments {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 8px;
  border-top: 1px solid rgba(255,255,255,0.04);
}

.post-comment-row {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.comment-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 800;
  flex-shrink: 0;
  margin-top: 1px;
}

.comment-body {
  flex: 1;
  background: rgba(255,255,255,0.03);
  border-radius: 12px;
  padding: 7px 10px;
}

.comment-author {
  font-size: 11px;
  font-weight: 700;
  color: var(--brand-accent, #cafd00);
  cursor: pointer;
  font-family: var(--font-display);
}

.comment-text {
  font-size: 12px;
  color: #c4c9d1;
  line-height: 1.4;
  margin-top: 1px;
}

.comment-date {
  font-size: 9px;
  color: #666666;
  margin-top: 3px;
}

/* Inline comment input */
.comment-input-box {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(255,255,255,0.04);
}

.comment-avatar-self {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--brand-accent-bg, rgba(202,253,0,0.12));
  border: 1px solid var(--brand-accent-border, rgba(202,253,0,0.2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 800;
  color: var(--brand-accent, #cafd00);
  flex-shrink: 0;
  font-family: var(--font-display);
}

.comment-input {
  flex: 1;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 12px;
  font-family: var(--font-display);
  color: #fff;
  outline: none;
  transition: var(--transition);
  -webkit-appearance: none;
}

.comment-input::placeholder { color: #484847; }

.comment-input:focus {
  border-color: var(--brand-accent-border, rgba(202,253,0,0.3));
  background: var(--brand-accent-bg-subtle, rgba(202,253,0,0.03));
}

.send-comment-btn {
  background: var(--brand-accent, #cafd00);
  border: none;
  border-radius: 999px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brand-accent-text, #0e0e0e);
  cursor: pointer;
  flex-shrink: 0;
  transition: var(--transition-bounce);
  box-shadow: var(--brand-accent-shadow, 0 2px 8px rgba(202,253,0,0.2));
}

.send-comment-btn svg {
  width: 14px;
  height: 14px;
  stroke-width: 2.5;
}

.send-comment-btn:hover {
  background: #d8ff3a;
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(202,253,0,0.35);
}

/* Leaderboard row */
.lb-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.04);
  cursor: pointer;
  transition: var(--transition);
  -webkit-tap-highlight-color: transparent;
}

.lb-row:hover {
  background: rgba(255,255,255,0.05);
  border-color: rgba(255,255,255,0.09);
}

.lb-rank {
  font-size: 12px;
  font-weight: 800;
  color: #666666;
  min-width: 34px;
  width: auto;
  padding: 2px 6px;
  border-radius: 6px;
  text-align: center;
  flex-shrink: 0;
  font-family: var(--font-display);
  line-height: 1.2;
}

.lb-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  flex-shrink: 0;
  font-family: var(--font-display);
}

.lb-name {
  flex: 1;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  font-family: var(--font-display);
}

.lb-sessions {
  font-size: 11px;
  font-weight: 700;
  color: var(--brand-accent, #cafd00);
  background: var(--brand-accent-bg, rgba(202,253,0,0.08));
  border: 1px solid var(--brand-accent-border, rgba(202,253,0,0.2));
  padding: 3px 9px;
  border-radius: 999px;
  font-family: var(--font-display);
}

/* Roster */
.roster-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.04);
  cursor: pointer;
  transition: var(--transition);
  -webkit-tap-highlight-color: transparent;
}

.roster-row:hover {
  background: rgba(255,255,255,0.05);
  border-color: rgba(255,255,255,0.09);
}

.roster-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  font-family: var(--font-display);
}

.roster-chevron {
  width: 14px;
  height: 14px;
  color: var(--text-muted);
  flex-shrink: 0;
}

/* Community section tabs (Horizontal slider) */
.community-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
  background: var(--bg-input);
  border-radius: 12px;
  padding: 4px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.community-tabs::-webkit-scrollbar {
  display: none;
}

.community-tab-btn {
  flex: 1;
  background: none;
  border: none;
  padding: 8px 14px;
  border-radius: 9px;
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font-display);
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.community-tab-btn.active {
  background: var(--brand-accent, #cafd00);
  color: var(--brand-accent-text, #0e0e0e);
  box-shadow: var(--brand-accent-shadow, 0 2px 8px rgba(202,253,0,0.25));
}

.light-theme .community-tab-btn.active {
  background: #7da300;
  color: #fff;
  box-shadow: 0 2px 8px rgba(125,163,0,0.25);
}

/* Profile modal upgrade */
.profile-modal-dialog {
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 20px;
  background: #161616;
  padding: 0;
  max-width: 380px;
  width: calc(100% - 32px);
  margin: auto;
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(0,0,0,0.8);
}

.profile-modal-dialog::backdrop {
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
}

.profile-stat-card {
  background: var(--brand-accent-bg-subtle, rgba(202,253,0,0.05));
  border: 1px solid var(--brand-accent-border, rgba(202,253,0,0.12));
  border-radius: 14px;
  padding: 14px;
  text-align: center;
}

.profile-stat-val {
  font-size: 22px;
  font-weight: 800;
  color: var(--brand-accent, #cafd00);
  font-family: var(--font-display);
  line-height: 1;
}

.profile-stat-label {
  font-size: 9px;
  font-weight: 700;
  color: #666666;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 4px;
  font-family: var(--font-display);
}

.belt-bar-stripe-line {
  width: 3px;
  height: 12px;
  background: #fff;
  margin: 0 1px;
  box-shadow: 0 0 2px rgba(0, 0, 0, 0.5);
}

/* ============================================
   COMMUNITY GROUP CHAT STYLES (v3 Premium)
   ============================================ */
.chat-channels {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
}

.chat-channels::-webkit-scrollbar {
  display: none;
}

.chat-channel-btn {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.05);
  color: #8898aa;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font-display);
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
}

.chat-channel-btn.active {
  background: var(--brand-accent-bg, rgba(202,253,0,0.1));
  border-color: var(--brand-accent-border, rgba(202,253,0,0.25));
  color: var(--brand-accent, #cafd00);
}

.chat-channel-btn:hover:not(.active) {
  background: rgba(255,255,255,0.05);
  color: var(--text-primary);
}

.chat-messages {
  height: 550px;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: rgba(0,0,0,0.15);
}

/* Chat bubble alignments */
.chat-bubble-row {
  display: flex;
  flex-direction: column;
  max-width: 75%;
  opacity: 0;
  transform: translateY(10px);
  animation: bubbleFadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes bubbleFadeIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.chat-bubble-row.own {
  align-self: flex-end;
  align-items: flex-end;
}

.chat-bubble-row.other {
  align-self: flex-start;
  align-items: flex-start;
}

.chat-sender-name {
  font-size: 9px;
  font-weight: 700;
  color: #666;
  margin-bottom: 3px;
  font-family: var(--font-display);
}

.chat-bubble {
  padding: 10px 14px;
  font-size: 12px;
  line-height: 1.4;
  position: relative;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.chat-bubble-own {
  background: var(--brand-accent, #cafd00);
  color: var(--brand-accent-text, #0e0e0e);
  border-radius: 16px 16px 4px 16px;
  font-weight: 500;
}

.chat-bubble-other {
  background: var(--bg-input);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: 16px 16px 16px 4px;
}

.chat-bubble-time {
  font-size: 8px;
  opacity: 0.6;
  margin-top: 4px;
  text-align: right;
  display: block;
}

/* Chat attachments */
.chat-attachment-img {
  max-width: 100%;
  border-radius: 10px;
  margin-top: 6px;
  border: 1px solid rgba(255,255,255,0.1);
  display: block;
}

/* Input area */
.chat-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
}

.chat-photo-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
}

.chat-photo-btn:hover {
  background: var(--bg-input-focus);
  color: var(--text-primary);
}

.chat-text-field {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 10px 18px;
  font-size: 12px;
  color: var(--text-primary);
  outline: none;
  transition: var(--transition);
}

.chat-text-field:focus {
  background: var(--bg-input-focus);
  border-color: var(--brand-accent-border, rgba(202,253,0,0.4));
}

.chat-send-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--brand-accent, #cafd00);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brand-accent-text, #0e0e0e);
  cursor: pointer;
  transition: var(--transition);
}

.chat-send-btn:hover {
  transform: scale(1.05);
  box-shadow: var(--brand-accent-shadow, 0 0 12px rgba(202,253,0,0.4));
}

/* ============================================
   LAUNCHER DASHBOARD GRID STYLES (v3.0)
   ============================================ */
.launcher-section {
  margin-top: 24px;
}

.launcher-group-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
  font-family: var(--font-display);
}

.launcher-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.launcher-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
  -webkit-tap-highlight-color: transparent;
  box-shadow: var(--shadow-sm);
}

.launcher-card:hover {
  border-color: var(--border-active);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.launcher-card:active {
  transform: scale(0.96);
}

.launcher-icon-box {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--brand-accent-bg, rgba(202, 253, 0, 0.08));
  border: 1.5px solid var(--brand-accent-border, rgba(202, 253, 0, 0.25));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brand-accent, #cafd00);
}

.launcher-icon-box svg {
  width: 18px;
  height: 18px;
}

.launcher-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  font-family: var(--font-display);
}

/* Light mode modifications for launcher icons */
.light-theme .launcher-icon-box {
  background: rgba(125, 163, 0, 0.08);
  border-color: rgba(125, 163, 0, 0.25);
  color: #7da300;
}

/* Make sure clicks anywhere on phase timelines and watch buttons register correctly */
.phase-step-node *, .tech-watch-btn * {
  pointer-events: none !important;
}

/* Premium BJJ avatar outlines to ensure white belt is visible on all backgrounds */
.lb-avatar, .nav-avatar-badge, #profile-avatar-circle {
  border: 1.5px solid var(--border-active) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.post-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 800;
  font-family: var(--font-display);
  flex-shrink: 0;
  border: 1.5px solid var(--border-active) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Subtle border to the yearly belt graphic bar */
.belt-bar-visual {
  border: 1px solid var(--border-active);
}

/* ============================================
   MOBILE OPTIMIZATIONS — iPhone / Small Screen
   ============================================ */
/* Prevent double-tap zoom on all interactive elements */
* {
  touch-action: manipulation;
}

@media (max-width: 480px) {
  /* ---- Phase Stepper — compact on mobile ---- */
  .phase-step-node {
    padding: 7px 12px;
    font-size: 11px;
    min-height: 36px;
    gap: 5px;
  }
  .phase-dot {
    width: 7px !important;
    height: 7px !important;
  }

  /* ---- Phase Billboard — less padding ---- */
  .phase-billboard-card {
    padding: 12px !important;
    margin-bottom: 12px;
  }
  .phase-billboard-title {
    font-size: 13px;
  }
  .phase-billboard-desc {
    font-size: 11px;
  }

  /* ---- Curriculum controls row ---- */
  .curriculum-controls {
    gap: 6px;
    margin-bottom: 12px;
  }
  .filter-select {
    min-width: 72px;
    font-size: 12px;
    padding: 8px 10px;
  }

  /* ---- Week cards — match other pages' sizes ---- */
  .week-curriculum-card {
    padding: 14px;
    gap: 10px;
    border-radius: var(--radius-md);
  }
  .weeks-grid-container {
    gap: 12px;
  }

  /* ---- Week card header ---- */
  .week-card-header {
    gap: 8px;
  }
  .week-card-num {
    width: 26px;
    height: 26px;
    font-size: 11px;
    font-weight: 700;
  }
  .week-card-title {
    font-size: 14px;
  }
  .position-icon-svg {
    width: 18px;
    height: 18px;
  }
  .type-tag {
    font-size: 8px;
    padding: 1.5px 5px;
  }

  /* ---- Technique rows — use horizontal space better ---- */
  .tech-item-row {
    padding: 8px 0;
    gap: 8px;
  }
  .tech-check-btn {
    width: 18px;
    height: 18px;
    border-radius: 5px;
  }
  .tech-check-btn .check-icon-svg {
    width: 10px !important;
    height: 10px !important;
  }
  .tech-row-num {
    font-size: 7px;
    padding: 2px 4px;
  }
  .tech-row-text {
    font-size: 11px;
    line-height: 1.3;
  }
  .tech-item-row .tech-watch-btn {
    padding: 4px 8px;
    font-size: 9px;
    gap: 3px;
  }
  .tech-item-row .tech-watch-btn span {
    display: none; /* show only play icon on mobile to save space */
  }
  .tech-item-row .tech-watch-btn .play-icon-svg {
    width: 12px !important;
    height: 12px !important;
  }

  /* ---- Techniques list — single column on mobile ---- */
  .techniques-list-vertical {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  /* ---- Week sections grid — stack vertically ---- */
  .week-sections-grid {
    gap: 10px !important;
  }
  .week-goal-block {
    font-size: 11px;
    padding: 8px 10px !important;
    margin-bottom: 8px !important;
  }
  .section-label {
    font-size: 10px;
    margin-bottom: 6px !important;
  }
  .drills-sparring-container {
    flex-direction: column;
    gap: 6px;
  }
  .info-block {
    padding: 8px !important;
    font-size: 11px;
  }
  .block-content {
    font-size: 11px !important;
  }

  /* ---- Section hero — tighter ---- */
  .section-hero {
    margin-bottom: 14px !important;
    padding: 14px !important;
  }
  .section-hero h2 {
    font-size: 18px !important;
  }
  .section-hero p {
    font-size: 12px !important;
  }

  /* ---- App main content padding ---- */
  .app-main-content {
    padding: 16px 16px calc(112px + env(safe-area-inset-bottom, 0px)) 16px !important;
  }

  /* ---- Section padding ---- */
  .page-section {
    padding: 0 !important;
  }

  /* ---- Student hero card ---- */
  .student-hero-card {
    padding: 14px !important;
  }

  /* ---- Stats grid mobile optimizations ---- */
  .stats-grid {
    gap: 6px !important;
  }
  .stat-card {
    padding: 10px 4px !important;
  }

  /* ---- Timer section ---- */
  .timer-display {
    font-size: clamp(52px, 15vw, 80px) !important;
  }

  /* ---- Community / feed cards ---- */
  .lb-post-card {
    padding: 12px !important;
  }

  /* ---- Nav bottom bar — slightly smaller ---- */
  .bottom-nav-bar {
    padding: 4px 0 !important;
  }
  .nav-item {
    padding: 6px 4px !important;
    font-size: 9px !important;
  }
  .nav-icon-wrap {
    width: 34px !important;
    height: 34px !important;
  }
}

/* Premium Logout Button Red styling */
#dashboard-logout-btn {
  color: #ff3b30 !important;
  border-color: rgba(255, 59, 48, 0.2) !important;
  background: rgba(255, 59, 48, 0.05) !important;
  transition: var(--transition) !important;
}

#dashboard-logout-btn:hover {
  background: rgba(255, 59, 48, 0.15) !important;
  border-color: rgba(255, 59, 48, 0.4) !important;
  box-shadow: 0 0 12px rgba(255, 59, 48, 0.25) !important;
  transform: scale(1.05);
}

.light-theme #dashboard-logout-btn {
  background: rgba(255, 59, 48, 0.08) !important;
  border-color: rgba(255, 59, 48, 0.3) !important;
}

.light-theme #dashboard-logout-btn:hover {
  background: rgba(255, 59, 48, 0.18) !important;
  border-color: rgba(255, 59, 48, 0.5) !important;
}

/* ============================================
   COMMUNITY HUB GRID & FULLSCREEN VIEWS
   ============================================ */
.community-hub-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 10px;
}

.hub-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  cursor: pointer;
  transition: var(--transition-bounce);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.hub-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-brand);
  background: var(--bg-card-hover);
  box-shadow: var(--shadow-md);
}

.hub-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--brand-red), var(--brand-blue));
  opacity: 0;
  transition: var(--transition);
}

.hub-card:hover::before {
  opacity: 1;
}

.hub-card-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brand-red);
  transition: var(--transition);
}

.light-theme .hub-card-icon {
  background: rgba(0, 0, 0, 0.03);
}

.hub-card:hover .hub-card-icon {
  background: var(--brand-red-glow);
  transform: scale(1.08);
}

.hub-card-title {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.hub-card-desc {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.4;
  margin: 0;
  text-align: left;
}

/* Fullscreen Panel View Container */
.community-panel-view {
  display: flex;
  flex-direction: column;
  position: relative;
  min-height: calc(100vh - 160px);
}

.community-view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
}

.community-view-back {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-primary);
  cursor: pointer;
  transition: var(--transition);
}

.light-theme .community-view-back {
  background: rgba(0, 0, 0, 0.03);
}

.community-view-back:hover {
  background: var(--bg-input-focus);
  border-color: var(--border-active);
  transform: translateX(-2px);
}

.community-view-title {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-primary);
}

.community-view-quick-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(0, 0, 0, 0.2);
  padding: 3px;
  border-radius: 20px;
}

.light-theme .community-view-quick-tabs {
  background: rgba(0, 0, 0, 0.05);
}

.quick-tab-pill {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
  cursor: pointer;
  transition: var(--transition);
}

.quick-tab-pill:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.06);
}

.quick-tab-pill.active {
  background: var(--brand-red);
  color: #000 !important;
  box-shadow: 0 0 8px var(--brand-red-glow);
}

@media (max-width: 480px) {
  .community-hub-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

/* ============================================
   PREMIUM BJJ APP CUSTOM STYLES
   ============================================ */
.dashed-action-card {
  border: 2.5px dashed var(--border);
  border-radius: var(--radius-xl);
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: pointer;
  background: transparent;
  transition: var(--transition);
  gap: 10px;
  margin-top: 12px;
  margin-bottom: 20px;
}

.dashed-action-card:hover {
  border-color: var(--brand-green);
  background: rgba(202, 253, 0, 0.02);
}

.dashed-action-card .plus-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-surface);
  border: 1.5px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: var(--transition);
}

.dashed-action-card:hover .plus-icon {
  color: var(--brand-green);
  border-color: var(--brand-green);
}

.empty-state-dashed {
  border: 2.5px dashed var(--border);
  border-radius: var(--radius-xl);
  padding: 32px 20px;
  text-align: center;
  background: rgba(255, 255, 255, 0.01);
  margin-bottom: 12px;
}

.learn-help-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

@media (max-width: 768px) {
  .learn-help-grid {
    grid-template-columns: 1fr;
  }
}

.activity-filter-btn {
  background: transparent;
  color: var(--text-secondary);
  border: none;
  transition: var(--transition);
}

.activity-filter-btn.active {
  background: var(--brand-accent, #cafd00) !important;
  color: var(--brand-accent-text, #000) !important;
}

/* Modern Sliding Toggle Capsules in Header */
.toggle-capsule {
  transition: border-color 0.22s, background-color 0.22s;
  user-select: none;
}
.toggle-capsule:hover {
  border-color: var(--brand-red, #cafd00) !important;
  background: var(--bg-surface) !important;
}
.toggle-capsule-item {
  cursor: pointer;
  transition: color 0.22s;
}

/* Chat view dynamic scroll and bottom pin layout */
#cpanel-chat {
  height: 520px !important;
  min-height: 520px !important;
  max-height: 520px !important;
  display: flex;
  flex-direction: column !important;
}
#cpanel-chat > .card {
  height: 100% !important;
  display: flex !important;
  flex-direction: column !important;
}
#chat-messages {
  flex: 1 !important;
  overflow-y: auto !important;
  padding: 8px 12px !important;
  border-radius: var(--radius-md) !important;
}
.chat-input-row {
  margin-top: auto !important;
  position: sticky !important;
  bottom: 0 !important;
  background: var(--bg-surface) !important;
  z-index: 10 !important;
}

/* Technique Week SVGs animations on week card hover */
.icon-wrestling {
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.week-curriculum-card:hover .icon-wrestling {
  transform: scale(1.15) rotate(10deg);
}

.icon-guard .guard-legs {
  transform-origin: center;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.week-curriculum-card:hover .icon-guard .guard-legs {
  transform: scaleX(0.72) translateY(-0.5px);
}

.icon-topcontrol .top-body {
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.week-curriculum-card:hover .icon-topcontrol .top-body {
  transform: translateY(2.5px);
}

.week-curriculum-card:hover .icon-back {
  transform: scale(1.22);
}
.week-curriculum-card:hover .icon-back .hooks {
  animation: glow-hooks-fast 0.6s ease-in-out infinite;
}
@keyframes glow-hooks-fast {
  0%, 100% { stroke: var(--brand-red, #cafd00); stroke-width: 2.4; }
  50% { stroke: #fff; stroke-width: 2.8; }
}

.week-curriculum-card:hover .icon-leglock {
  transform: rotate(-18deg) scale(1.18);
}

/* Fix Timer section height to fit screen cleanly with generous bottom nav clearance */
#sec-timer.active {
  max-width: 480px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding-bottom: max(160px, calc(env(safe-area-inset-bottom, 0px) + 140px)) !important;
  overflow: visible !important;
}
@media (min-height: 740px) {
  #sec-timer.active {
    min-height: calc(100vh - 160px);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
  }
}

/* Eliminate top spacing when the tracker or coach is active to shift layout up, and ensure generous bottom clearance over the floating navigation bar */
.app-main-content:has(#sec-tracker.active),
.app-main-content:has(#sec-coach.active) {
  padding-top: 0px !important;
  padding-bottom: 120px !important;
}

/* Ensure generous bottom spacing & lock vertical scrolling on centered fixed views */
.app-main-content:has(#sec-timer.active) {
  padding-top: 10px !important;
  padding-bottom: 8px !important;
  overflow-y: hidden !important;
  display: flex !important;
  flex-direction: column !important;
}
#sec-timer.active {
  flex: 1 1 0%;
  min-height: 0;
  height: 100%;
  display: flex !important;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 86px) !important;
  scroll-padding-bottom: max(140px, calc(env(safe-area-inset-bottom, 0px) + 120px));
}
#sec-timer.active > div:first-child {
  margin-bottom: 8px !important;
}
#sec-timer.active .timer-hero-card {
  padding: 14px 18px !important;
}
#sec-timer.active .timer-circle-wrap {
  width: 164px !important;
  height: 164px !important;
  margin-top: 2px !important;
  margin-bottom: 8px !important;
}
#sec-timer.active .timer-clock {
  font-size: 36px !important;
}
#sec-timer.active .timer-block-name {
  font-size: 15px;
  margin-bottom: 2px;
}
#sec-timer.active .timer-block-desc {
  font-size: 11.5px;
  margin-bottom: 6px;
}
#sec-timer.active .timer-controls {
  margin-top: 2px !important;
}

.timer-custom-presets-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: nowrap;
  width: 100%;
}
.timer-custom-preset-chip {
  flex: 1 1 0;
  width: auto !important;
  height: 32px !important;
  min-height: 32px !important;
  padding: 0 6px !important;
  border-radius: 9999px !important;
  font-size: 11.5px;
  font-weight: 800;
  font-family: var(--font-display);
  white-space: nowrap;
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  cursor: pointer;
  margin: 0;
}

/* Allow full vertical page scroll on Community (Club) tab with bottom nav clearance */
.app-main-content:has(#sec-community.active) {
  padding-top: 12px !important;
  padding-bottom: max(120px, calc(env(safe-area-inset-bottom, 20px) + 100px)) !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch;
  display: block !important;
}
#sec-community.active {
  height: auto !important;
  min-height: 0;
  display: block !important;
  overflow: visible !important;
  padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 110px);
}
#sec-community.active > div:first-child {
  margin-bottom: 12px !important;
}
#sec-community.active #academy-active-banner {
  padding: 14px 16px !important;
  margin-bottom: 14px !important;
}
#sec-community.active #sparring-partners-hub {
  padding: 14px 16px !important;
  margin-bottom: 14px !important;
}
#sec-community.active #sparring-partners-list {
  padding-bottom: 6px !important;
}
#sec-community.active #community-filter-chips {
  margin-bottom: 12px !important;
  padding-bottom: 4px !important;
}
#sec-community.active #community-main-feed-wrap {
  display: block;
}
#sec-community.active #academy-social-feed {
  overflow: visible;
  padding-bottom: 24px;
}

/* Lock outer vertical scroll on ChainLab Matrix view */
.app-main-content:has(#sec-chainlab.active[data-chainlab-view="matrix"]) {
  padding-top: 12px !important;
  padding-bottom: 0 !important;
  overflow-y: hidden !important;
  display: flex !important;
  flex-direction: column !important;
}
#sec-chainlab.active[data-chainlab-view="matrix"] {
  flex: 1 1 0%;
  min-height: 0;
  height: 100%;
  display: flex !important;
  flex-direction: column;
  overflow: hidden;
  padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 88px);
}
#sec-chainlab.active[data-chainlab-view="matrix"] .chainlab-header-bar,
#sec-chainlab.active[data-chainlab-view="matrix"] .chainlab-coach-bar,
#sec-chainlab.active[data-chainlab-view="matrix"] .chainlab-systems-carousel {
  flex-shrink: 0;
}
#sec-chainlab.active[data-chainlab-view="matrix"] #chainlab-matrix-view {
  flex: 1 1 0%;
  min-height: 320px !important;
  height: auto !important;
  display: flex !important;
  flex-direction: column;
}
#sec-chainlab.active[data-chainlab-view="matrix"] .chainlab-matrix-canvas-wrap {
  flex: 1 1 0%;
  min-height: 0 !important;
  height: 100% !important;
  max-height: none !important;
}

#sec-timer.active .section-hero {
  margin-bottom: 2px !important;
}
#sec-timer.active .section-hero-text h2 {
  font-size: 19px !important;
}
#sec-timer.active .section-hero-text p {
  font-size: 11px !important;
  margin-top: 0px !important;
}
#sec-timer.active .timer-hero-card {
  padding: 14px 18px !important;
}

/* FULL-SCREEN CARD & ARTICLE READER DIALOG OVERRIDES */
dialog#knowledge-article-modal {
  position: fixed !important;
  top: 50% !important;
  left: 50% !important;
  width: min(680px, calc(100vw - 32px)) !important;
  height: auto !important;
  max-width: 680px !important;
  max-height: min(640px, calc(100dvh - 64px)) !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 1px solid var(--border) !important;
  outline: none !important;
  box-shadow: var(--shadow-xl) !important;
  background: var(--bg-surface) !important;
  border-radius: 20px !important;
  z-index: 999999 !important;
  transform: translate(-50%, -50%) !important;
  overflow-y: auto !important;
}

dialog#knowledge-article-modal::backdrop {
  background: transparent !important;
}

/* Pull-to-refresh spinner animation */
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ============================================
   MODERN COMMUNITY, CHAT, SLIDER & OFFLINE STYLES
   ============================================ */

/* 3D Radio Knob Slider - Centered & Compact */
#intensity-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 10px !important;
  border-radius: 999px !important;
  outline: none;
  cursor: pointer;
  background: linear-gradient(180deg, rgba(0,0,0,0.4) 0%, rgba(0,0,0,0.1) 100%), var(--bg-input);
  border: 1px solid var(--border);
  box-shadow: inset 0 1.5px 3px rgba(0,0,0,0.4);
  transition: background 0.15s ease;
  margin: 8px 0;
}

#intensity-slider::-webkit-slider-runnable-track {
  height: 10px;
  border-radius: 999px;
  border: none;
}

/* Compact 3D Tactile Radio Knob Thumb (Chrome/Safari) - Centered in middle of track line */
#intensity-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  margin-top: -5px; /* Centers 20px thumb vertically on 10px track */
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #ffffff 0%, #e2e8f0 40%, #cbd5e1 75%, #94a3b8 100%);
  border: 2px solid #ffffff;
  box-shadow:
    0 2px 6px rgba(0,0,0,0.35),
    0 1px 2px rgba(0,0,0,0.4),
    inset 0 1px 1px #ffffff,
    inset 0 -1px 2px rgba(0,0,0,0.3),
    0 0 0 2px var(--brand-green, #1db954);
  cursor: grab;
  transition: transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.15s ease;
}

#intensity-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  box-shadow:
    0 3px 10px rgba(0,0,0,0.45),
    0 0 10px rgba(29, 185, 84, 0.5),
    inset 0 1px 1px #ffffff,
    0 0 0 2px var(--brand-green, #1db954);
}

#intensity-slider::-webkit-slider-thumb:active {
  cursor: grabbing;
  transform: scale(1.22);
}

/* Compact 3D Tactile Radio Knob Thumb (Firefox) */
#intensity-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #ffffff 0%, #e2e8f0 40%, #cbd5e1 75%, #94a3b8 100%);
  border: 2px solid #ffffff;
  box-shadow:
    0 2px 6px rgba(0,0,0,0.35),
    0 1px 2px rgba(0,0,0,0.4),
    inset 0 1px 1px #ffffff,
    inset 0 -1px 2px rgba(0,0,0,0.3),
    0 0 0 2px var(--brand-green, #1db954);
  cursor: grab;
}

#intensity-slider::-moz-range-track {
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(0,0,0,0.4) 0%, rgba(0,0,0,0.1) 100%), var(--bg-input);
}

/* Modern Attendance Toggle Cards */
.attendance-toggle-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.attendance-card-choice {
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 12px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.attendance-card-choice.active-yes {
  background: rgba(29, 185, 84, 0.12);
  border-color: var(--brand-green, #1db954);
  box-shadow: 0 0 16px rgba(29, 185, 84, 0.2);
}
.attendance-card-choice.active-no {
  background: rgba(255, 69, 58, 0.12);
  border-color: #ff453a;
  box-shadow: 0 0 16px rgba(255, 69, 58, 0.2);
}

/* Modern Community Cards */
.modern-community-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}
.modern-community-card:hover {
  border-color: var(--border-active);
  box-shadow: var(--shadow-md);
}

/* Modern Chat Layout */
.chat-page-container {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 140px);
  min-height: 520px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}
.chat-channel-bar {
  display: flex;
  gap: 8px;
  padding: 12px 14px;
  background: var(--bg-input);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.chat-channel-pill {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 800;
  font-family: var(--font-display);
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
}
.chat-channel-pill.active {
  background: var(--brand-green, #1db954);
  color: #ffffff;
  border-color: var(--brand-green, #1db954);
  box-shadow: 0 4px 12px rgba(29, 185, 84, 0.3);
}

.chat-messages-area {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.chat-bubble-modern {
  max-width: 82%;
  padding: 10px 14px;
  border-radius: 18px;
  font-size: 13px;
  line-height: 1.45;
  position: relative;
  word-wrap: break-word;
}
.chat-bubble-modern.own {
  align-self: flex-end;
  background: var(--brand-green, #1db954);
  color: #ffffff;
  border-bottom-right-radius: 4px;
  box-shadow: 0 4px 12px rgba(29, 185, 84, 0.25);
}
.chat-bubble-modern.other {
  align-self: flex-start;
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-primary);
  border-bottom-left-radius: 4px;
}

.chat-composer-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--bg-input);
  border-top: 1px solid var(--border);
}
.chat-input-field {
  flex: 1;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-family: var(--font-primary);
  outline: none;
  transition: var(--transition);
}
.chat-input-field:focus {
  border-color: var(--brand-green, #1db954);
  box-shadow: 0 0 12px rgba(29, 185, 84, 0.2);
}

/* ============================================
   SCREENSHOT MATCHING MESSAGES & CHAT DESIGN
   ============================================ */
.msg-inbox-tab-bar {
  display: flex;
  gap: 24px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
  margin-bottom: 16px;
}
.msg-inbox-tab {
  background: none;
  border: none;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 800;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 6px 0;
  position: relative;
  transition: var(--transition);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.msg-inbox-tab.active {
  color: var(--text-primary);
}
.msg-inbox-tab.active::after {
  content: '';
  position: absolute;
  bottom: -9px;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--brand-green, #1db954);
  border-radius: 999px;
  box-shadow: 0 0 10px var(--brand-green, #1db954);
}

.msg-inbox-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: var(--transition);
  margin-bottom: 10px;
}
.msg-inbox-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-active);
}
.msg-inbox-card.pinned {
  background: linear-gradient(135deg, rgba(29,185,84,0.1), rgba(29,185,84,0.02));
  border-color: rgba(29,185,84,0.25);
}

.msg-bubble-screenshot {
  background: #18191c;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 16px;
  padding: 12px 14px;
  color: #e3e5e8;
  font-size: 13px;
  line-height: 1.45;
  margin-bottom: 10px;
  position: relative;
  max-width: 86%;
}
.msg-bubble-screenshot .sender-name {
  font-size: 12px;
  font-weight: 800;
  color: var(--brand-green, #1db954);
  margin-bottom: 4px;
}
.msg-bubble-screenshot .quote-box {
  background: rgba(29, 185, 84, 0.12);
  border-left: 3px solid var(--brand-green, #1db954);
  padding: 6px 10px;
  border-radius: 6px;
  margin-bottom: 8px;
  font-size: 11.5px;
  color: #a0aec0;
}
.msg-bubble-screenshot .time-tag {
  font-size: 9px;
  color: #718096;
  text-align: right;
  margin-top: 4px;
  font-family: var(--font-display);
}
.msg-bubble-screenshot .reaction-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 800;
  margin-top: 6px;
}

#messages-thread-view {
  width: 100%;
}

#messages-thread-view .chat-messages-area {
  flex: 1 1 auto;
  min-height: 0;
}

/* ============================================
   SUBSCRIPTION PAYWALL MODAL STYLES
   ============================================ */
#subscription-modal::backdrop {
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.light-theme #subscription-modal {
  background: #ffffff !important;
  border-color: rgba(0, 0, 0, 0.12) !important;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.15) !important;
}

.light-theme #subscription-modal .paywall-plan-card {
  background: #f8fafc !important;
  border-color: rgba(0, 0, 0, 0.08) !important;
}

.light-theme #subscription-modal .paywall-sticky-card {
  background: #ffffff !important;
  border-color: rgba(0, 0, 0, 0.08) !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04) !important;
}

/* ============================================
   PROFILE REDESIGN & QUICK ACTION CARDS
   ============================================ */
.quick-action-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  -webkit-tap-highlight-color: transparent;
}

.quick-action-card:hover {
  background: var(--bg-elevated);
  border-color: var(--border-active);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

.quick-action-card:active {
  transform: scale(0.98);
}

.squircle-icon-btn {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
}

.squircle-icon-btn:hover {
  background: var(--bg-elevated);
  border-color: var(--border-active);
}

.underlined-tab-bar {
  display: flex;
  align-items: center;
  justify-content: space-around;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 20px;
  padding: 0 4px;
}

.underlined-tab-btn {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-secondary);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  padding: 10px 12px;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease;
  margin-bottom: -1px;
}

.underlined-tab-btn:hover {
  color: var(--text-primary);
}

.underlined-tab-btn.active {
  color: var(--text-primary);
  border-bottom-color: var(--brand-green, #1db954);
}

/* Belt Picker Modal List Styles */
.belt-picker-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md, 12px);
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.15s ease;
}

.belt-picker-item:hover,
.belt-picker-item:active {
  background: var(--bg-input-focus);
  border-color: var(--border-active);
  transform: translateY(-1px);
}

.belt-picker-title {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

/* QR Scanner scan line animation */
@keyframes qrScanLine {
  0%   { top: 20%; opacity: 0.8; }
  50%  { top: 80%; opacity: 1;   }
  100% { top: 20%; opacity: 0.8; }
}

#qr-scan-line {
  animation: qrScanLine 2s ease-in-out infinite;
}

/* ============================================
   PERSONAL TRAINING LOG STYLING
   ============================================ */
.tlog-card, .club-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg, 18px);
  padding: 16px;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}
.tlog-card:hover, .club-card:hover {
  background: var(--bg-card-hover, rgba(28,28,28,0.9));
  border-color: var(--border-brand);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.tlog-tab, .club-tab {
  background: var(--control-bg);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font-display);
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
}
.tlog-tab:hover, .club-tab:hover {
  background: var(--control-bg-hover);
  color: var(--text-primary);
}
.tlog-tab.active, .club-tab.active {
  background: var(--brand-green);
  color: #ffffff;
  border-color: var(--brand-green);
}
.tlog-entry-card, .club-entry-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md, 14px);
  padding: 14px 16px;
  transition: var(--transition);
}
.tlog-entry-card:hover, .club-entry-card:hover {
  border-color: var(--border-active);
}
.tlog-entry-badge, .club-entry-badge {
  font-size: 9px;
  font-weight: 800;
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 3px 8px;
  border-radius: 999px;
}
.tlog-entry-badge.session-log, .club-entry-badge.session-log {
  background: rgba(29, 185, 84, 0.12);
  color: var(--brand-green);
  border: 1px solid rgba(29, 185, 84, 0.25);
}
.tlog-entry-badge.next-steps, .club-entry-badge.next-steps {
  background: rgba(245, 176, 65, 0.12);
  color: var(--brand-gold);
  border: 1px solid rgba(245, 176, 65, 0.25);
}
.tlog-entry-badge.workout-plan, .club-entry-badge.workout-plan {
  background: rgba(59, 158, 255, 0.12);
  color: var(--brand-blue);
  border: 1px solid rgba(59, 158, 255, 0.25);
}

.tlog-member-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--control-bg);
  border: 1px solid var(--border);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-primary);
}

.tlog-action-btn {
  background: var(--control-bg);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}
.tlog-action-btn:hover {
  background: var(--control-bg-hover);
  color: var(--text-primary);
}

/* Light Theme overrides for crisp contrast */
.light-theme .tlog-card, .light-theme .club-card {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.08);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}
.light-theme .tlog-card:hover, .light-theme .club-card:hover {
  background: #ffffff;
  border-color: rgba(22, 163, 74, 0.4);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}
.light-theme .tlog-entry-card, .light-theme .club-entry-card {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.08);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03);
}
.light-theme .tlog-tab, .light-theme .club-tab {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.08);
  color: var(--text-secondary);
}
.light-theme .tlog-tab.active, .light-theme .club-tab.active {
  background: #16a34a;
  color: #ffffff;
  border-color: #16a34a;
}
.light-theme .tlog-entry-badge.session-log, .light-theme .club-entry-badge.session-log {
  background: rgba(22, 163, 74, 0.1);
  color: #15803d;
  border-color: rgba(22, 163, 74, 0.25);
}
.light-theme .tlog-entry-badge.next-steps, .light-theme .club-entry-badge.next-steps {
  background: rgba(217, 119, 6, 0.1);
  color: #b45309;
  border-color: rgba(217, 119, 6, 0.25);
}
.light-theme .tlog-entry-badge.workout-plan, .light-theme .club-entry-badge.workout-plan {
  background: rgba(37, 99, 235, 0.1);
  color: #1d4ed8;
  border-color: rgba(37, 99, 235, 0.25);
}
.light-theme .tlog-member-chip {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.08);
}

/* Personal Training Log Section bottom spacing */
.tlog-section-container {
  padding-bottom: 40px;
  margin-bottom: 32px;
}

/* Scrollable entries container inside modal */
#tlog-entries-feed {
  max-height: 440px;
  overflow-y: auto;
  padding-right: 4px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
#tlog-entries-feed::-webkit-scrollbar {
  width: 5px;
}
#tlog-entries-feed::-webkit-scrollbar-track {
  background: transparent;
}
#tlog-entries-feed::-webkit-scrollbar-thumb {
  background: var(--border-active);
  border-radius: 4px;
}

/* Search and date filter bar */
.tlog-search-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  align-items: center;
  flex-wrap: wrap;
}
.tlog-search-input {
  flex: 1;
  min-width: 140px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 12px;
  font-family: var(--font-primary);
  outline: none;
  transition: var(--transition);
}
.tlog-search-input:focus {
  border-color: var(--brand-green);
}
.tlog-date-filter {
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 7px 10px;
  border-radius: 10px;
  font-size: 11px;
  font-family: var(--font-primary);
  outline: none;
  transition: var(--transition);
}
.tlog-date-filter:focus {
  border-color: var(--brand-green);
}
.tlog-clear-btn {
  background: var(--control-bg);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 7px 10px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--font-display);
  transition: var(--transition);
}
.tlog-clear-btn:hover {
  background: var(--control-bg-hover);
  color: var(--text-primary);
}

/* Month divider in feed */
.tlog-month-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 0 4px 0;
}
.tlog-month-divider-line {
  flex: 1;
  height: 1px;
  background: var(--border-subtle);
}
.tlog-month-divider-label {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  font-family: var(--font-display);
}

/* Calendar indicator dot for personal training log entries */
.tlog-cal-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #0ea5e9;
  display: inline-block;
  margin-top: 2px;
}
.light-theme .tlog-cal-dot {
  background: #0284c7;
}

.light-theme .tlog-search-input,
.light-theme .tlog-date-filter {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #0f172a;
}
.light-theme .tlog-clear-btn {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #64748b;
}

/* ============================================
   NATIVE BOTTOM SHEET MODALS & GESTURES (v1.0.3)
   Universal 3-Detent Modern Bottom Sheet Engine
   ============================================ */
.sheet-drag-handle {
  width: 100%;
  padding: 10px 0 12px 0;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  flex-shrink: 0;
}

.sheet-drag-handle::before {
  content: '';
  width: 36px;
  height: 4px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.32);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: background 0.2s cubic-bezier(0.16, 1, 0.3, 1), 
              width 0.2s cubic-bezier(0.16, 1, 0.3, 1), 
              transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.sheet-drag-handle:active::before {
  background: rgba(255, 255, 255, 0.65);
  transform: scale(1.22, 0.96);
}

.light-theme .sheet-drag-handle::before {
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.light-theme .sheet-drag-handle:active::before {
  background: rgba(0, 0, 0, 0.45);
}

@media (max-width: 768px) {
  @keyframes sheetSlideUp {
    from {
      transform: translateY(100%);
      opacity: 0;
    }
    to {
      transform: translateY(0);
      opacity: 1;
    }
  }

  dialog.video-overlay,
  dialog.profile-modal-dialog,
  dialog.bottom-sheet,
  dialog.flowroll-bottom-sheet,
  dialog.modal-sheet-modern {
    position: fixed !important;
    top: auto !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    max-height: 90vh !important;
    max-height: 90dvh !important;
    margin: 0 !important;
    border-radius: 28px 28px 0 0 !important;
    border: 1px solid var(--border-active, rgba(255, 255, 255, 0.12)) !important;
    border-bottom: none !important;
    border-left: none !important;
    border-right: none !important;
    padding-bottom: max(24px, env(safe-area-inset-bottom, 24px)) !important;
    box-shadow: 0 -16px 48px rgba(0, 0, 0, 0.75), 0 -1px 0 rgba(255, 255, 255, 0.08) inset !important;
    transform: translateY(0);
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), height 0.28s cubic-bezier(0.16, 1, 0.3, 1);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* 3-Detent Height Rules */
  dialog.bottom-sheet[data-detent="peek"],
  dialog.flowroll-bottom-sheet[data-detent="peek"],
  dialog.modal-sheet-modern[data-detent="peek"] {
    height: 25vh !important;
    height: 25dvh !important;
    max-height: 25dvh !important;
  }

  dialog.bottom-sheet[data-detent="medium"],
  dialog.flowroll-bottom-sheet[data-detent="medium"],
  dialog.modal-sheet-modern[data-detent="medium"] {
    height: 50vh !important;
    height: 50dvh !important;
    max-height: 50dvh !important;
  }

  dialog.bottom-sheet[data-detent="full"],
  dialog.flowroll-bottom-sheet[data-detent="full"],
  dialog.modal-sheet-modern[data-detent="full"],
  dialog.bottom-sheet:not([data-detent]) {
    height: 90vh !important;
    height: 90dvh !important;
    max-height: 90dvh !important;
  }

  /* Entrance Animation Attachment */
  dialog.video-overlay[open],
  dialog.profile-modal-dialog[open],
  dialog.bottom-sheet[open],
  dialog.flowroll-bottom-sheet[open],
  dialog.modal-sheet-modern[open],
  dialog[open] {
    animation: sheetSlideUp 0.28s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  }

  /* Glass Backdrop Blur */
  dialog.video-overlay::backdrop,
  dialog.profile-modal-dialog::backdrop,
  dialog.bottom-sheet::backdrop,
  dialog.flowroll-bottom-sheet::backdrop,
  dialog.modal-sheet-modern::backdrop {
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
  }
}

@media (prefers-reduced-motion: reduce) {
  dialog[open],
  dialog.video-overlay[open],
  dialog.profile-modal-dialog[open],
  dialog.bottom-sheet[open],
  dialog.flowroll-bottom-sheet[open],
  dialog.modal-sheet-modern[open] {
    animation: none !important;
  }
}

/* ========================================================
   SEGMENTED FILTER CHIP TOGGLE SYSTEM (v1.0.3)
   ======================================================== */
.segmented-chip-group {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  padding: 2px 2px 6px 2px;
  touch-action: pan-x manipulation;
}

.segmented-chip-group::-webkit-scrollbar {
  display: none;
}

/* Universal Filter Chip & Training Log Tab */
.filter-chip,
.tlog-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-surface, #090a0d);
  border: 1px solid var(--border-active, rgba(255, 255, 255, 0.14));
  color: var(--text-secondary, #8c96a8);
  border-radius: 9999px;
  padding: 7px 16px;
  font-size: 12px;
  font-weight: 700;
  font-family: var(--font-display);
  cursor: pointer;
  white-space: nowrap;
  min-height: 38px;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  transition:
    background-color 0.2s cubic-bezier(0.16, 1, 0.3, 1),
    border-color 0.2s cubic-bezier(0.16, 1, 0.3, 1),
    color 0.2s cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 0.2s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.08s cubic-bezier(0.2, 0, 0, 1);
}

.filter-chip:hover:not(.active),
.tlog-tab:hover:not(.active) {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.25);
  color: var(--text-primary, #f2f4f7);
}

/* High-Contrast Active State — Clean Flat Styling (Zero Fuzzy Glow) */
.filter-chip.active,
.tlog-tab.active {
  background: var(--accent-glow, #43e67a) !important;
  color: var(--accent-contrast, #000000) !important;
  border-color: var(--accent-glow, #43e67a) !important;
  font-weight: 800 !important;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25) !important;
  transform: translateY(-1px);
}

/* Tactile Micro-Press (<= 0.12s duration for Challenger suite compliance) */
.filter-chip:active,
.tlog-tab:active {
  transform: scale(0.95) !important;
  transition: transform 0.08s cubic-bezier(0.2, 0, 0, 1) !important;
}

/* Light Theme Overrides */
.light-theme .filter-chip,
.light-theme .tlog-tab {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.12);
  color: var(--text-secondary);
}

.light-theme .filter-chip.active,
.light-theme .tlog-tab.active {
  background: #16a34a !important;
  color: #ffffff !important;
  border-color: #16a34a !important;
  box-shadow: 0 4px 14px rgba(22, 163, 74, 0.32) !important;
}

/* ========================================================
   STICKY BOTTOM ACTION FOOTERS (One-Handed Thumb Reach)
   ======================================================== */
.sheet-action-footer,
.modal-action-footer,
.sticky-action-footer {
  position: sticky;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  box-sizing: border-box;
  padding: 14px 18px calc(14px + env(safe-area-inset-bottom, 0px)) 18px;
  background: linear-gradient(to top, var(--bg-elevated) 85%, rgba(17, 18, 22, 0.4) 100%);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border, rgba(255, 255, 255, 0.08));
  display: flex;
  gap: 12px;
  align-items: center;
  z-index: 50;
  margin-top: auto;
  flex-shrink: 0;
}

.light-theme .sheet-action-footer,
.light-theme .modal-action-footer {
  background: linear-gradient(to top, rgba(255, 255, 255, 0.95) 85%, rgba(255, 255, 255, 0.5) 100%);
  border-top-color: rgba(0, 0, 0, 0.08);
}

.sheet-action-footer .btn-primary,
.sheet-action-footer button[type="submit"],
.modal-action-footer .btn-primary {
  flex: 1;
  min-height: 52px;
  height: 52px;
  border-radius: var(--radius-full, 9999px);
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.2px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  cursor: pointer;
  background: var(--brand-green, #1db954);
  color: #ffffff;
  box-shadow: 0 4px 18px rgba(29, 185, 84, 0.35);
  touch-action: manipulation;
  transition: transform 0.10s cubic-bezier(0.2, 0, 0, 1), box-shadow 0.12s ease;
}

.sheet-action-footer .btn-primary:active,
.sheet-action-footer button[type="submit"]:active {
  transform: scale(0.97);
  box-shadow: 0 2px 8px rgba(29, 185, 84, 0.2);
  transition: transform 0.05s ease-out;
}

.sheet-action-footer .btn-secondary,
.sheet-action-footer .btn-cancel {
  min-height: 52px;
  height: 52px;
  padding: 0 18px;
  border-radius: var(--radius-full, 9999px);
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 0.10s cubic-bezier(0.2, 0, 0, 1);
}

.sheet-action-footer .btn-secondary:active,
.sheet-action-footer .btn-cancel:active {
  transform: scale(0.96);
  transition: transform 0.05s ease-out;
}

/* ========================================================
   HORIZONTAL CARD CAROUSELS WITH NATIVE MOMENTUM SNAPPING
   ======================================================== */
.flowroll-carousel-snap,
.card-carousel-horizontal {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-padding: 0 16px;
  padding: 8px 16px 16px 16px;
  margin: 0 -16px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
  list-style: none;
  touch-action: pan-x manipulation;
}

.flowroll-carousel-snap::-webkit-scrollbar,
.card-carousel-horizontal::-webkit-scrollbar {
  display: none;
}

.carousel-card-item,
.carousel-snap-item {
  flex: 0 0 auto;
  scroll-snap-align: start;
  scroll-snap-stop: normal;
  border-radius: var(--radius-lg, 20px);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  touch-action: pan-x manipulation;
  user-select: none;
  -webkit-user-select: none;
  transition: transform 0.10s cubic-bezier(0.2, 0, 0, 1), border-color 0.12s ease;
}

.carousel-card-item:active,
.carousel-snap-item:active {
  transform: scale(0.97);
  border-color: var(--border-active);
  transition: transform 0.05s ease-out;
}

.achievement-carousel-card {
  width: 140px;
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
}

.partner-carousel-card {
  width: 240px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.recommendation-carousel-card {
  width: 280px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ============================================
   SKELETON LOADING SHIMMER STATES
   ============================================ */
@keyframes skeleton-shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.skeleton-pulse {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.04) 25%, rgba(255, 255, 255, 0.10) 50%, rgba(255, 255, 255, 0.04) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.6s ease-in-out infinite;
  border-radius: var(--radius-md, 12px);
}

.light-theme .skeleton-pulse {
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.04) 25%, rgba(0, 0, 0, 0.09) 50%, rgba(0, 0, 0, 0.04) 75%);
  background-size: 200% 100%;
}

.skeleton-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.skeleton-line {
  height: 14px;
  border-radius: 6px;
}

/* ============================================
   FEATURE 11: TACTILE :active MICRO-INTERACTIONS
   Smooth, responsive touch feedback (<=0.12s)
   ============================================ */

/* Cards & Surface Containers */
.card:active {
  transform: scale(0.98);
  transition: transform 0.08s ease-out;
}

.stat-card:active,
.knowledge-card:active,
.news-card:active,
.phase-billboard-card:active {
  transform: scale(0.98);
  transition: transform 0.08s ease-out;
}

/* Post Cards & Feed Containers */
.feed-card:active,
.post-card:active,
.feed-item:active {
  transform: scale(0.98);
  border-color: var(--border-active);
  transition: transform 0.08s ease-out;
}

/* Curriculum Rows & Summaries */
.tech-item-row:active {
  transform: scale(0.98);
  transition: transform 0.08s ease-out;
}

.curriculum-week-card:active,
.week-curriculum-card:active {
  transform: scale(0.98);
  transition: transform 0.08s ease-out;
}

/* Interactive Buttons & Stepper Controls */
.btn:active,
.btn-primary:active,
.btn-secondary:active,
.primary-btn:active,
.action-btn:active,
.btn-social:active {
  transform: scale(0.97);
  transition: transform 0.06s ease-out;
}

.timer-stepper-btn:active,
.stepper-btn:active {
  transform: scale(0.92);
  transition: transform 0.05s ease-out;
}

.fistbump-btn:active,
.chat-reaction-btn:active {
  transform: scale(0.94);
  transition: transform 0.06s ease-out;
}

/* ==========================================================================
   MILESTONE 2: AUTHENTIC BJJ BELT COMPONENT & GAMIFIED ACHIEVEMENTS (v1.0.3)
   ========================================================================== */

/* 1. Authentic BJJ Belt Badge Component */
.bjj-belt-badge {
  display: inline-flex;
  align-items: center;
  height: 14px;
  width: 58px;
  border-radius: 3px;
  overflow: hidden;
  position: relative;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(0, 0, 0, 0.25);
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  flex-shrink: 0;
  transition: transform 0.08s ease-out, box-shadow 0.12s ease;
  vertical-align: middle;
}

.bjj-belt-badge:active {
  transform: scale(0.96);
  transition: transform 0.08s ease-out;
}

.bjj-belt-badge .belt-strap {
  flex: 1;
  height: 100%;
  background-image: repeating-linear-gradient(
    -45deg,
    rgba(255, 255, 255, 0.06) 0px,
    rgba(255, 255, 255, 0.06) 2px,
    transparent 2px,
    transparent 4px
  );
}

/* Belt Ranks */
.bjj-belt-badge.belt-white .belt-strap  { background-color: #ffffff; }
.bjj-belt-badge.belt-blue .belt-strap   { background-color: #1e88e5; }
.bjj-belt-badge.belt-purple .belt-strap { background-color: #9c27b0; }
.bjj-belt-badge.belt-brown .belt-strap  { background-color: #8d6e63; }
.bjj-belt-badge.belt-black .belt-strap  { background-color: #1f1f1f; }

/* White belt border protection */
.bjj-belt-badge.belt-white {
  border: 1px solid rgba(0, 0, 0, 0.22);
}
.light-theme .bjj-belt-badge.belt-white {
  border: 1px solid #cbd5e1;
}

/* Rank Bar (Sleeve / Tarja) */
.bjj-belt-badge .belt-rank-bar {
  width: 26%;
  height: 100%;
  background-color: #000000;
  display: flex;
  align-items: center;
  justify-content: space-evenly;
  padding: 0 1.5px;
  border-left: 1px solid rgba(0, 0, 0, 0.4);
  flex-shrink: 0;
}

/* Black Belt RED rank bar */
.bjj-belt-badge.belt-black .belt-rank-bar {
  background-color: #d32f2f;
}

/* White rank stripes */
.bjj-belt-badge .belt-stripe {
  width: 2px;
  height: 80%;
  background-color: #ffffff;
  border-radius: 0.5px;
  box-shadow: 0 0 1px rgba(0, 0, 0, 0.5);
  flex-shrink: 0;
}

/* Size Modifiers */
.bjj-belt-badge.belt-mini {
  height: 10px;
  width: 42px;
  border-radius: 2px;
}
.bjj-belt-badge.belt-mini .belt-stripe {
  width: 1.5px;
  height: 75%;
}

.bjj-belt-badge.belt-lg {
  height: 22px;
  width: 120px;
  border-radius: 5px;
}
.bjj-belt-badge.belt-lg .belt-stripe {
  width: 3px;
  height: 80%;
}

.bjj-belt-badge.belt-full {
  width: 100%;
  height: 24px;
  border-radius: 6px;
}
.bjj-belt-badge.belt-full .belt-rank-bar {
  width: 28%;
  padding: 0 4px;
}
.bjj-belt-badge.belt-full .belt-stripe {
  width: 3px;
  height: 80%;
}

/* 2. Achievement Carousel & Card Styling */
.achievement-carousel-card {
  width: 136px;
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  border-radius: var(--radius-lg, 20px);
  background: var(--bg-surface, #090a0d);
  border: 1px solid var(--border, rgba(255, 255, 255, 0.07));
  position: relative;
  transition: transform 0.08s ease-out, border-color 0.15s ease;
  cursor: pointer;
  scroll-snap-align: start;
  flex-shrink: 0;
}

.achievement-carousel-card:active {
  transform: scale(0.96);
  transition: transform 0.08s ease-out;
}

.achievement-carousel-card.unlocked {
  border-color: rgba(202, 253, 0, 0.4);
  background: linear-gradient(180deg, rgba(202, 253, 0, 0.06) 0%, var(--bg-surface, #090a0d) 100%);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}

.achievement-carousel-card.locked {
  opacity: 0.55;
  filter: grayscale(0.85);
}

.achievement-badge-icon-wrap {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  background: var(--bg-elevated, #111216);
  border: 1px solid var(--border-active, rgba(255, 255, 255, 0.14));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.achievement-carousel-card.unlocked .achievement-badge-icon-wrap {
  background: radial-gradient(circle at 30% 30%, rgba(202, 253, 0, 0.22), rgba(15, 17, 21, 0.95));
  border-color: var(--brand-accent, #cafd00);
  box-shadow: 0 0 12px rgba(202, 253, 0, 0.25);
}

.achievement-badge-title {
  font-family: var(--font-display, 'Space Grotesk', sans-serif);
  font-size: 11px;
  font-weight: 800;
  color: var(--text-primary, #f2f4f7);
  line-height: 1.25;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.achievement-badge-tier {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary, #8c96a8);
}

.achievement-progress-pill {
  font-size: 9.5px;
  font-weight: 800;
  font-family: var(--font-display, 'Space Grotesk', sans-serif);
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--bg-input, #16181f);
  color: var(--text-secondary, #8c96a8);
}

.achievement-carousel-card.unlocked .achievement-progress-pill {
  background: rgba(29, 185, 84, 0.15);
  color: var(--brand-green, #1db954);
}

/* 3. Rolling Style Persona Selector */
.persona-selector-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 8px;
}

.persona-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 14px 8px;
  border-radius: var(--radius-md, 14px);
  background: var(--bg-surface, #090a0d);
  border: 1.5px solid var(--border, rgba(255, 255, 255, 0.07));
  cursor: pointer;
  transition: transform 0.14s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  position: relative;
  overflow: hidden;
}

.light-theme .persona-card {
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.10);
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.04);
}

.persona-card:active {
  transform: scale(0.96);
  transition: transform 0.08s ease-out;
}

.persona-card.active {
  border-color: var(--brand-green, #1db954);
  background: linear-gradient(180deg, rgba(29, 185, 84, 0.12) 0%, var(--bg-surface, #090a0d) 100%);
  box-shadow: 0 0 16px rgba(29, 185, 84, 0.18);
}

.persona-card[data-persona="aggressive"].active {
  border-color: #ef4444;
  background: linear-gradient(180deg, rgba(239, 68, 68, 0.14) 0%, var(--bg-surface, #090a0d) 100%);
  box-shadow: 0 4px 16px rgba(239, 68, 68, 0.18);
}

.persona-card[data-persona="adaptive"].active {
  border-color: #3b82f6;
  background: linear-gradient(180deg, rgba(59, 130, 246, 0.14) 0%, var(--bg-surface, #090a0d) 100%);
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.18);
}

.light-theme .persona-card.active {
  background: linear-gradient(180deg, rgba(22, 163, 74, 0.09) 0%, #ffffff 100%);
  border-color: #16a34a;
  box-shadow: 0 4px 14px rgba(22, 163, 74, 0.14);
}

.light-theme .persona-card[data-persona="aggressive"].active {
  background: linear-gradient(180deg, rgba(239, 68, 68, 0.09) 0%, #ffffff 100%);
  border-color: #dc2626;
  box-shadow: 0 4px 14px rgba(220, 38, 38, 0.14);
}

.light-theme .persona-card[data-persona="adaptive"].active {
  background: linear-gradient(180deg, rgba(59, 130, 246, 0.09) 0%, #ffffff 100%);
  border-color: #2563eb;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.14);
}

.persona-icon {
  margin-bottom: 8px;
}

.persona-orb {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease;
}

.persona-svg {
  width: 34px;
  height: 34px;
  display: block;
}

.persona-orb-aggressive {
  color: #ef4444;
  background: radial-gradient(circle at 30% 25%, rgba(239, 68, 68, 0.20), rgba(239, 68, 68, 0.05));
  border: 1px solid rgba(239, 68, 68, 0.28);
}

.persona-orb-adaptive {
  color: #3b82f6;
  background: radial-gradient(circle at 30% 25%, rgba(59, 130, 246, 0.20), rgba(59, 130, 246, 0.05));
  border: 1px solid rgba(59, 130, 246, 0.28);
}

.persona-orb-friendly {
  color: #16a34a;
  background: radial-gradient(circle at 30% 25%, rgba(29, 185, 84, 0.20), rgba(29, 185, 84, 0.05));
  border: 1px solid rgba(29, 185, 84, 0.28);
}

.persona-card.active .persona-orb {
  transform: translateY(-1px) scale(1.04);
}

.persona-svg-aggressive .orb-ring-pulse {
  transform-origin: 22px 22px;
  animation: personaRingBreath 2.8s ease-in-out infinite;
}

.persona-svg-aggressive .chevron-t1 {
  animation: personaChevronDrive 1.9s ease-in-out infinite 0s;
}

.persona-svg-aggressive .chevron-t2 {
  animation: personaChevronDrive 1.9s ease-in-out infinite 0.18s;
}

.persona-svg-aggressive .chevron-t3 {
  animation: personaChevronDrive 1.9s ease-in-out infinite 0.36s;
}

.persona-svg-adaptive .orbit-cw {
  transform-origin: 22px 22px;
  animation: personaOrbitCW 6s linear infinite;
}

.persona-svg-adaptive .orbit-ccw {
  transform-origin: 22px 22px;
  animation: personaOrbitCCW 4.4s linear infinite;
}

.persona-svg-adaptive .pivot-core {
  transform-origin: 22px 22px;
  animation: personaPivotBreath 2.4s ease-in-out infinite;
}

.persona-svg-friendly .infinity-stream {
  animation: personaInfinityGlide 2.6s linear infinite;
}

.persona-svg-friendly .flow-halo {
  transform-origin: 22px 22px;
  animation: personaRingBreath 3.2s ease-in-out infinite;
}

@keyframes personaChevronDrive {
  0%, 100% { transform: translateY(0); opacity: 0.55; }
  50% { transform: translateY(-2.2px); opacity: 1; }
}

@keyframes personaOrbitCW {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes personaOrbitCCW {
  from { transform: rotate(360deg); }
  to { transform: rotate(0deg); }
}

@keyframes personaPivotBreath {
  0%, 100% { transform: scale(0.92); opacity: 0.78; }
  50% { transform: scale(1.14); opacity: 1; }
}

@keyframes personaInfinityGlide {
  from { stroke-dashoffset: 0; }
  to { stroke-dashoffset: -46; }
}

@keyframes personaRingBreath {
  0%, 100% { transform: scale(0.97); opacity: 0.55; }
  50% { transform: scale(1.03); opacity: 0.95; }
}

@media (prefers-reduced-motion: reduce) {
  .persona-svg-aggressive *,
  .persona-svg-adaptive *,
  .persona-svg-friendly * {
    animation: none !important;
  }
}

.persona-name {
  font-family: var(--font-display, 'Space Grotesk', sans-serif);
  font-size: 11px;
  font-weight: 800;
  color: var(--text-primary, #f2f4f7);
  line-height: 1.2;
}

.persona-desc {
  font-size: 9px;
  color: var(--text-secondary, #8c96a8);
  margin-top: 4px;
  line-height: 1.3;
}

.persona-badge-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-family: var(--font-display, 'Space Grotesk', sans-serif);
  font-size: 10.5px;
  font-weight: 800;
  border: 1px solid rgba(29, 185, 84, 0.35);
  background: rgba(29, 185, 84, 0.1);
  color: var(--brand-green, #1db954);
}

.persona-badge-chip[data-style="aggressive"] {
  border-color: rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
}

.persona-badge-chip[data-style="adaptive"] {
  border-color: rgba(59, 130, 246, 0.35);
  background: rgba(59, 130, 246, 0.1);
  color: #2563eb;
}

/* 4. Sparring Partner Finder & Carousel */
.sparring-partners-hub {
  background: var(--bg-surface, #090a0d);
  border: 1px solid var(--border, rgba(255, 255, 255, 0.07));
  border-radius: var(--radius-lg, 20px);
  padding: 16px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm, 0 2px 8px rgba(0, 0, 0, 0.3));
}

.sparring-partners-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: nowrap;
  margin-bottom: 10px;
  padding: 0 2px;
}

.sparring-partners-title-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  min-width: 0;
  flex: 1 1 auto;
}

.sparring-partners-title {
  font-family: var(--font-display, 'Space Grotesk', sans-serif);
  font-size: 14.5px;
  font-weight: 800;
  color: var(--text-primary, #f2f4f7);
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sparring-partners-subtitle {
  font-size: 11px;
  color: var(--text-secondary, #8c96a8);
  margin-top: 2px;
}

.badge-partner-count {
  font-size: 9.5px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 9999px;
  background: rgba(67, 230, 122, 0.12);
  color: var(--accent-glow, #43e67a);
  border: 1px solid rgba(67, 230, 122, 0.25);
  letter-spacing: 0.4px;
  text-transform: uppercase;
  white-space: nowrap;
  flex-shrink: 0;
}

.btn-filter-partners {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: 9999px;
  background: var(--bg-elevated, #111216);
  border: 1px solid var(--border-active, rgba(255, 255, 255, 0.14));
  color: var(--text-primary, #f2f4f7);
  font-family: var(--font-display, 'Space Grotesk', sans-serif);
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  touch-action: manipulation;
  transition: transform 0.08s ease-out, background 0.15s;
  position: relative;
}

.btn-filter-partners:active {
  transform: scale(0.95);
  transition: transform 0.08s ease-out;
}

.filter-active-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-glow, #43e67a);
}

.sparring-partners-carousel {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 4px 4px 16px 4px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.partner-card {
  width: 240px;
  min-width: 240px;
  background: var(--bg-elevated, #111216);
  border: 1px solid var(--border, rgba(255, 255, 255, 0.07));
  border-radius: 18px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scroll-snap-align: start;
  flex-shrink: 0;
  transition: transform 0.08s ease-out, border-color 0.15s;
  box-sizing: border-box;
}

.partner-card:active {
  transform: scale(0.98);
  transition: transform 0.08s ease-out;
}

.partner-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.partner-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 800;
  font-family: var(--font-display, 'Space Grotesk', sans-serif);
  flex-shrink: 0;
  border: 1.5px solid rgba(255, 255, 255, 0.12);
}

.partner-meta {
  flex: 1;
  min-width: 0;
}

.partner-name {
  font-family: var(--font-display, 'Space Grotesk', sans-serif);
  font-size: 13.5px;
  font-weight: 800;
  color: var(--text-primary, #f2f4f7);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}

.partner-stats {
  font-size: 11px;
  color: var(--text-secondary, #8c96a8);
  margin-top: 2px;
}

.partner-belt-row {
  display: flex;
  align-items: center;
  padding: 2px 0;
}

.partner-style-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.partner-style-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
  font-weight: 700;
  font-family: var(--font-display, 'Space Grotesk', sans-serif);
  padding: 3px 8px;
  border-radius: 6px;
  letter-spacing: 0.2px;
}

.partner-style-dot {
  display: none;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.partner-style-tag.style-aggressive .partner-style-dot {
  background: #ff453a;
}

.partner-style-tag.style-adaptive .partner-style-dot {
  background: #3b9eff;
}

.partner-style-tag.style-friendly .partner-style-dot,
.partner-style-tag.style-flow .partner-style-dot {
  background: var(--accent-glow, #43e67a);
}

.partner-style-tag.style-aggressive {
  background: rgba(255, 69, 58, 0.12);
  color: #ff453a;
  border: 1px solid rgba(255, 69, 58, 0.25);
}

.partner-style-tag.style-adaptive {
  background: rgba(59, 158, 255, 0.12);
  color: #3b9eff;
  border: 1px solid rgba(59, 158, 255, 0.25);
}

.partner-style-tag.style-friendly,
.partner-style-tag.style-flow {
  background: rgba(67, 230, 122, 0.12);
  color: var(--accent-glow, #43e67a);
  border: 1px solid rgba(67, 230, 122, 0.25);
}

.btn-request-roll {
  width: 100%;
  height: 40px;
  background: var(--bg-surface, #090a0d);
  border: 1px solid var(--border-active, rgba(255, 255, 255, 0.14));
  color: var(--text-primary, #f2f4f7);
  border-radius: 9999px;
  font-size: 11.5px;
  font-weight: 800;
  font-family: var(--font-display, 'Space Grotesk', sans-serif);
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 0.08s ease-out, background 0.15s, color 0.15s, border-color 0.15s;
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.btn-request-roll:active {
  transform: scale(0.95);
  transition: transform 0.08s ease-out;
}

.btn-request-roll.requested {
  background: rgba(67, 230, 122, 0.15);
  border-color: rgba(67, 230, 122, 0.4);
  color: var(--accent-glow, #43e67a);
}

/* 5. Enhanced Community Post Composer */
.composer-author-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.composer-author-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--accent-glow, #43e67a);
  color: var(--accent-contrast, #000000);
  font-weight: 800;
  font-size: 15px;
  font-family: var(--font-display, 'Space Grotesk', sans-serif);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid rgba(255, 255, 255, 0.15);
}

.composer-author-name {
  font-family: var(--font-display, 'Space Grotesk', sans-serif);
  font-size: 14px;
  font-weight: 800;
  color: var(--text-primary, #f2f4f7);
}

.composer-author-meta {
  font-size: 11px;
  color: var(--text-secondary, #8c96a8);
}

.composer-tag-selector {
  margin-bottom: 12px;
}

.composer-textarea-container {
  position: relative;
  margin-bottom: 8px;
}

.composer-textarea {
  width: 100%;
  box-sizing: border-box;
  background: var(--bg-surface, #090a0d);
  border: 1px solid var(--border, rgba(255, 255, 255, 0.07));
  border-radius: 18px;
  padding: 16px 16px 44px;
  color: var(--text-primary, #f2f4f7);
  font-family: var(--font-primary, 'Inter', sans-serif);
  font-size: 14px;
  line-height: 1.5;
  resize: none;
  outline: none;
  transition: border-color 0.2s, background 0.2s;
}

.composer-textarea:focus {
  border-color: var(--accent-glow, #43e67a);
  background: var(--bg-elevated, #111216);
}

.composer-done-pill {
  position: absolute;
  bottom: 12px;
  right: 12px;
  z-index: 5;
  background: var(--accent-glow, #43e67a);
  color: var(--accent-contrast, #000000);
  border: none;
  border-radius: 9999px;
  padding: 6px 14px;
  min-height: 28px;
  font-weight: 800;
  font-size: 12px;
  font-family: var(--font-display, 'Space Grotesk', sans-serif);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(67, 230, 122, 0.35);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  touch-action: manipulation;
  transition: transform 0.08s ease-out, filter 0.15s;
}

.composer-done-pill:active {
  transform: scale(0.92);
  filter: brightness(0.95);
  transition: transform 0.08s ease-out;
}

.composer-counter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px;
  margin-bottom: 14px;
}

.composer-counter-guideline {
  font-size: 11px;
  color: var(--text-secondary, #8c96a8);
}

.char-countdown-badge {
  font-size: 11.5px;
  font-weight: 700;
  font-family: var(--font-display, 'Space Grotesk', sans-serif);
  color: var(--text-muted, #546073);
  transition: color 0.2s;
}

.composer-media-section {
  margin-bottom: 16px;
}

.btn-attach-media {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-surface, #090a0d);
  border: 1px dashed var(--border-active, rgba(255, 255, 255, 0.14));
  border-radius: 14px;
  padding: 12px 16px;
  min-height: 48px;
  color: var(--text-secondary, #8c96a8);
  font-size: 12px;
  font-weight: 700;
  font-family: var(--font-display, 'Space Grotesk', sans-serif);
  cursor: pointer;
  width: 100%;
  box-sizing: border-box;
  touch-action: manipulation;
  transition: transform 0.08s ease-out, border-color 0.2s, color 0.2s;
}

.btn-attach-media:active {
  transform: scale(0.98);
  border-color: var(--accent-glow, #43e67a);
  color: var(--text-primary, #f2f4f7);
  transition: transform 0.08s ease-out;
}

.post-media-preview-container {
  position: relative;
  margin-top: 12px;
}

.post-media-preview-img {
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  border-radius: 14px;
  border: 1px solid var(--border, rgba(255, 255, 255, 0.07));
  display: block;
}

.post-media-remove-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 12px;
  touch-action: manipulation;
  transition: transform 0.08s ease-out;
}

.post-media-remove-btn:active {
  transform: scale(0.9);
  transition: transform 0.08s ease-out;
}

.btn-composer-cancel,
.btn-filter-reset {
  flex: 1;
  height: 52px;
  background: var(--bg-surface, #090a0d);
  border: 1px solid var(--border, rgba(255, 255, 255, 0.07));
  color: var(--text-secondary, #8c96a8);
  border-radius: 9999px;
  font-weight: 700;
  font-size: 13px;
  font-family: var(--font-display, 'Space Grotesk', sans-serif);
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 0.08s ease-out;
}

.btn-composer-cancel:active,
.btn-filter-reset:active {
  transform: scale(0.97);
  transition: transform 0.08s ease-out;
}

.btn-composer-publish,
.btn-filter-apply {
  flex: 2;
  height: 52px;
  background: var(--accent-glow, #43e67a);
  color: var(--accent-contrast, #000000);
  border: none;
  border-radius: 9999px;
  font-weight: 800;
  font-size: 14px;
  font-family: var(--font-display, 'Space Grotesk', sans-serif);
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(67, 230, 122, 0.3);
  touch-action: manipulation;
  transition: transform 0.08s ease-out, filter 0.15s;
}

.btn-composer-publish:active,
.btn-filter-apply:active {
  transform: scale(0.97);
  filter: brightness(0.95);
  transition: transform 0.08s ease-out;
}

.filter-section {
  margin-bottom: 20px;
}

.filter-label {
  font-family: var(--font-display, 'Space Grotesk', sans-serif);
  font-size: 12px;
  font-weight: 800;
  color: var(--text-primary, #f2f4f7);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: block;
  margin-bottom: 8px;
}

/* 6. Persistent Sticky Mini-Timer Island (#sticky-timer-island) */
#sticky-timer-island {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(-90px);
  height: 40px;
  min-width: 220px;
  max-width: calc(100% - 32px);
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 6px 0 14px;
  background: rgba(9, 10, 13, 0.88);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.65), 0 0 16px rgba(29, 185, 84, 0.18);
  z-index: 990;
  opacity: 0;
  pointer-events: none;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1),
              opacity 0.25s ease,
              border-color 0.25s ease,
              box-shadow 0.25s ease;
}

#sticky-timer-island[data-visible="true"] {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: auto;
}

#sticky-timer-island:active {
  transform: translateX(-50%) scale(0.97);
  transition: transform 0.08s ease-out;
}

.light-theme #sticky-timer-island {
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(0, 0, 0, 0.12);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12), 0 0 12px rgba(29, 185, 84, 0.15);
}

#sticky-timer-island .island-body {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
  height: 100%;
}

.mini-timer-pulse-dot {
  display: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--brand-green, #1db954);
  box-shadow: none;
  flex-shrink: 0;
  animation: none;
}

#sticky-timer-island[data-state="paused"] .mini-timer-pulse-dot {
  background-color: var(--brand-orange, #ff7c3c);
  box-shadow: none;
  animation: none;
}

#sticky-timer-island[data-state="warn"] .mini-timer-pulse-dot {
  background-color: #ff3b30;
  box-shadow: none;
  animation: none;
}

.mini-timer-label {
  font-family: var(--font-display, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: 0.4px;
  color: var(--text-primary, #f2f4f7);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: uppercase;
}

.light-theme .mini-timer-label {
  color: #111216;
}

.island-toggle-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-primary, #f2f4f7);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  margin-left: 6px;
  padding: 0;
  transition: transform 0.08s ease-out, background 0.2s ease;
  touch-action: manipulation;
}

.island-toggle-btn:active {
  transform: scale(0.92);
  background: rgba(255, 255, 255, 0.22);
  transition: transform 0.08s ease-out;
}

.light-theme .island-toggle-btn {
  background: rgba(0, 0, 0, 0.08);
  color: #111216;
}

.light-theme .island-toggle-btn:active {
  background: rgba(0, 0, 0, 0.15);
}

/* 7. 1-Tap Quick Roll Logger Modal Elements */
.quick-roll-metric-box {
  background: var(--bg-input, #16181f);
  border: 1px solid var(--border, rgba(255, 255, 255, 0.08));
  border-radius: 14px;
  padding: 10px 8px;
  text-align: center;
}

.quick-roll-metric-lbl {
  display: block;
  font-size: 9.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted, #546073);
  font-family: var(--font-display, 'Space Grotesk', sans-serif);
}

.quick-roll-metric-val {
  font-size: 18px;
  font-weight: 800;
  font-family: var(--font-display, 'Space Grotesk', sans-serif);
  color: var(--text-primary, #f2f4f7);
  margin-top: 2px;
}

.quick-roll-metric-sub {
  font-size: 10px;
  color: var(--text-secondary, #8c96a8);
}

.btn-save-quick-roll {
  width: 100%;
  height: 52px;
  border-radius: 9999px;
  background: var(--brand-green, #1db954);
  color: #ffffff;
  border: none;
  font-family: var(--font-display, 'Space Grotesk', sans-serif);
  font-size: 14px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(29, 185, 84, 0.35);
  touch-action: manipulation;
  transition: transform 0.08s ease-out, filter 0.15s;
}

.btn-save-quick-roll:active {
  transform: scale(0.97);
  filter: brightness(0.95);
  transition: transform 0.08s ease-out;
}

/* ── COMMUNITY & BUTTON ALIGNMENTS (PARITY WITH REFERENCE APP) ── */
.btn-new-post-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent-glow, #43e67a);
  color: var(--accent-contrast, #000000);
  border: none;
  border-radius: 9999px;
  padding: 8px 16px;
  font-family: var(--font-display, 'Space Grotesk', sans-serif);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
  touch-action: manipulation;
  transition: transform 0.08s ease-out, filter 0.15s;
}

.btn-new-post-pill:active {
  transform: scale(0.94);
  filter: brightness(0.92);
}

.sparring-partners-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}

/* ── 3D CRYSTAL SHIELD TROPHIES & BADGES ── */
.crystal-trophy-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 12px 6px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  transition: transform 0.12s cubic-bezier(0.2, 0, 0, 1), border-color 0.2s, background 0.2s;
  touch-action: manipulation;
  position: relative;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}

.crystal-trophy-card:active {
  transform: scale(0.95);
}

.crystal-trophy-card.unlocked {
  background: linear-gradient(180deg, rgba(67, 230, 122, 0.08) 0%, rgba(17, 18, 22, 0.95) 100%);
  border-color: rgba(67, 230, 122, 0.4);
}
.light-theme .crystal-trophy-card {
  background: var(--bg-surface);
  border-color: rgba(15, 23, 42, 0.09);
}
.light-theme .crystal-trophy-card.unlocked {
  background: linear-gradient(180deg, rgba(22, 163, 74, 0.10) 0%, #ffffff 100%);
  border-color: rgba(22, 163, 74, 0.35);
  box-shadow: 0 4px 12px rgba(22, 163, 74, 0.10);
}

.crystal-trophy-svg {
  width: 68px;
  height: 78px;
  display: block;
  margin: 0 auto;
}

.crystal-trophy-title {
  font-size: 10.5px;
  font-weight: 800;
  font-family: var(--font-display, 'Space Grotesk', sans-serif);
  color: var(--text-primary, #f2f4f7);
  margin-top: 6px;
  line-height: 1.2;
  max-width: 100%;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  white-space: normal;
  word-break: normal;
  overflow-wrap: break-word;
  min-height: 26px;
}

.crystal-trophy-progress {
  font-size: 9.5px;
  font-weight: 800;
  font-family: var(--font-primary, sans-serif);
  color: var(--text-muted, #8c96a8);
  background: rgba(255, 255, 255, 0.05);
  padding: 2px 7px;
  border-radius: 9999px;
  margin-top: 4px;
}

.crystal-trophy-card.unlocked .crystal-trophy-progress {
  color: #000000;
  background: var(--accent-glow, #43e67a);
  font-weight: 900;
}

/* ── 3 JAPANESE ROLLING STYLE MASKS ── */
.japanese-masks-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 12px 0 20px;
}

.japanese-mask-card {
  background: var(--bg-surface, #090a0d);
  border: 1.5px solid var(--border, rgba(255, 255, 255, 0.08));
  border-radius: 18px;
  padding: 12px 6px 10px;
  text-align: center;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 0.1s cubic-bezier(0.2, 0, 0, 1), border-color 0.2s, background 0.2s;
  position: relative;
  user-select: none;
  -webkit-user-select: none;
}

.japanese-mask-card:active {
  transform: scale(0.95);
}

.japanese-mask-card.selected {
  border-color: var(--accent-glow, #43e67a) !important;
  background: rgba(67, 230, 122, 0.08) !important;
}

.japanese-mask-svg {
  width: 54px;
  height: 60px;
  margin: 0 auto 6px;
  display: block;
}

.japanese-mask-name {
  font-size: 12px;
  font-weight: 800;
  font-family: var(--font-display, 'Space Grotesk', sans-serif);
  color: var(--text-primary, #f2f4f7);
}

.japanese-mask-role {
  font-size: 9px;
  font-weight: 700;
  color: var(--text-muted, #8c96a8);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 2px;
}

.japanese-mask-pill {
  display: inline-block;
  font-size: 8.5px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 9999px;
  margin-top: 4px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary, #8c96a8);
}

.japanese-mask-card.selected .japanese-mask-pill {
  background: var(--accent-glow, #43e67a);
  color: #000000;
  font-weight: 900;
}

.coach-badges-showcase-card {
  background: linear-gradient(145deg, rgba(17, 18, 22, 0.95), rgba(24, 26, 32, 0.95));
  border: 1px solid var(--border-active);
}
.light-theme .coach-badges-showcase-card {
  background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid rgba(15, 23, 42, 0.09);
  box-shadow: var(--shadow-sm);
}

.light-theme .crystal-trophy-progress {
  background: rgba(15, 23, 42, 0.06);
  color: #475569;
}
.light-theme .crystal-trophy-card.unlocked .crystal-trophy-progress {
  background: rgba(22, 163, 74, 0.14);
  color: #15803d;
}
.light-theme .japanese-mask-card {
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.10);
  box-shadow: var(--shadow-sm);
}

/* ── MARTIAL ARTS CARD WATERMARK DRAWINGS ── */
.bjj-card-watermark {
  display: none !important;
  visibility: hidden !important;
  position: absolute;
  right: -8px;
  bottom: -8px;
  width: 100px;
  height: 100px;
  opacity: 0 !important;
  pointer-events: none;
  z-index: 0;
  color: #ffffff;
}
.light-theme .bjj-card-watermark {
  display: none !important;
  color: #0f172a;
  opacity: 0 !important;
}

.bjj-watermark-gi {
  width: 100%;
  height: 100%;
}

/* ── ILLUSTRATED GYM DUFFLE BAG (EMPTY STATES) ── */
.bjj-duffle-empty-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px 16px 14px;
  text-align: center;
}

.bjj-duffle-svg {
  width: 64px;
  height: 54px;
  display: block;
}

.bjj-empty-title {
  font-size: 13.5px;
  font-weight: 800;
  font-family: var(--font-display, 'Space Grotesk', sans-serif);
  color: var(--text-primary, #f2f4f7);
  margin-top: 8px;
}

.bjj-empty-subtitle {
  font-size: 11px;
  color: var(--text-secondary, #8c96a8);
  margin-top: 3px;
  max-width: 260px;
  line-height: 1.35;
}

/* ==========================================================================
   MILESTONE 2: CHAINLAB™ POSITIONAL GAMEPLAN & REACTION ENGINE (v1.0.3)
   Hybrid Dual-Engine UI: Stream Drill-Down, Visual Node Matrix Canvas,
   and Tap-to-Inspect Detail Drawer
   ========================================================================== */

/* ── 1. CSS Design Tokens & Color Taxonomy ── */
:root {
  /* Node Type Colors (Authentic BJJ Grappling Taxonomy) */
  --node-position-color: #3b82f6;
  --node-position-bg: rgba(59, 130, 246, 0.12);
  --node-position-border: rgba(59, 130, 246, 0.35);

  --node-action-color: #f59e0b;
  --node-action-bg: rgba(245, 158, 11, 0.12);
  --node-action-border: rgba(245, 158, 11, 0.35);

  --node-reaction-color: #ff7c3c;
  --node-reaction-bg: rgba(255, 124, 60, 0.12);
  --node-reaction-border: rgba(255, 124, 60, 0.35);
  --node-reaction-alt: #8b5cf6;
  --node-reaction-alt-bg: rgba(139, 92, 246, 0.12);
  --node-reaction-alt-border: rgba(139, 92, 246, 0.35);

  --node-counter-color: #10b981;
  --node-counter-bg: rgba(16, 185, 129, 0.12);
  --node-counter-border: rgba(16, 185, 129, 0.35);

  --node-submission-color: #f43f5e;
  --node-submission-bg: rgba(244, 63, 94, 0.12);
  --node-submission-border: rgba(244, 63, 94, 0.35);

  --node-transition-color: #06b6d4;
  --node-transition-bg: rgba(6, 182, 212, 0.12);
  --node-transition-border: rgba(6, 182, 212, 0.35);

  /* Matrix Canvas Tokens */
  --chainlab-canvas-bg: #050608;
  --chainlab-grid-dot: rgba(255, 255, 255, 0.07);
  --chainlab-edge-stroke: rgba(255, 255, 255, 0.18);
  --chainlab-edge-active: #43e67a;
}

.light-theme {
  --chainlab-canvas-bg: #f8fafc;
  --chainlab-grid-dot: rgba(0, 0, 0, 0.08);
  --chainlab-edge-stroke: rgba(0, 0, 0, 0.20);
  --chainlab-edge-active: #16a34a;
}

/* ── 2. Navigation Integration (6-Tab Collision-Free Ergonomics) ── */
.bottom-nav-item {
  min-width: 0;
  flex: 1 1 0;
}

.bottom-nav-item .nav-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

@media (max-width: 375px) {
  .bottom-nav-item .nav-label {
    padding: 2px 4px;
    font-size: 8.5px;
    letter-spacing: 0.1px;
  }
  .bottom-nav-item .nav-icon-wrap {
    width: 34px;
    height: 28px;
  }
}

/* ── 3. Page Section & Header Chrome ── */
#sec-chainlab {
  padding-bottom: calc(112px + env(safe-area-inset-bottom, 0px));
}

.chainlab-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 12px;
  flex-wrap: wrap;
}

.chainlab-title-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.chainlab-title {
  font-size: 24px;
  font-weight: 800;
  font-family: var(--font-display);
  letter-spacing: -0.5px;
  color: var(--text-primary, #f2f4f7);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 2px;
}

.chainlab-tm {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-glow, #43e67a);
  vertical-align: super;
}

.chainlab-subtitle {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary, #8c96a8);
}

/* Dual-Engine Segmented View Switcher */
.chainlab-view-toggle-group {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  background: var(--bg-input, rgba(255, 255, 255, 0.035));
  border: 1px solid var(--border, rgba(255, 255, 255, 0.07));
  border-radius: var(--radius-full, 9999px);
}

.chainlab-view-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font-display);
  color: var(--text-secondary, #8c96a8);
  background: transparent;
  border: none;
  border-radius: var(--radius-full, 9999px);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.chainlab-view-toggle-btn svg {
  width: 15px;
  height: 15px;
  stroke-width: 2.2;
}

.chainlab-view-toggle-btn:active {
  transform: scale(0.96);
  transition: transform 60ms ease;
}

.chainlab-view-toggle-btn.active,
.chainlab-view-toggle-btn[aria-checked="true"] {
  background: var(--accent-glow, #43e67a);
  color: var(--accent-contrast, #000000);
  font-weight: 800;
  box-shadow: 0 2px 10px rgba(67, 230, 122, 0.32);
}

.chainlab-view-toggle-btn.active svg,
.chainlab-view-toggle-btn[aria-checked="true"] svg {
  stroke: var(--accent-contrast, #000000);
}

/* ── 4. System Selector Carousel ── */
.chainlab-systems-carousel {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  padding: 4px 2px 14px 2px;
  margin-bottom: 8px;
}

.chainlab-systems-carousel::-webkit-scrollbar,
.chainlab-systems-scroll-track::-webkit-scrollbar {
  display: none;
}

.chainlab-systems-scroll-track {
  display: flex;
  gap: 8px;
  width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  padding: 2px 0 4px 0;
}

.chainlab-system-pill,
.chainlab-sys-chip {
  flex-shrink: 0;
  min-width: 150px;
  max-width: 220px;
  padding: 10px 14px;
  background: var(--bg-surface, #090a0d);
  border: 1px solid var(--border, rgba(255, 255, 255, 0.07));
  border-radius: var(--radius-md, 14px);
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  gap: 5px;
  box-shadow: var(--shadow-sm);
  text-align: left;
}

.chainlab-system-pill:hover,
.chainlab-sys-chip:hover {
  border-color: var(--border-active);
  background: var(--bg-card-hover);
  transform: translateY(-1px);
}

.chainlab-system-pill:active,
.chainlab-sys-chip:active {
  transform: scale(0.97);
  transition: transform 60ms ease;
}

.chainlab-system-pill.active,
.chainlab-system-pill[aria-selected="true"],
.chainlab-sys-chip.active {
  border-color: var(--accent-glow, #43e67a);
  background: rgba(67, 230, 122, 0.08);
  box-shadow: 0 0 16px rgba(67, 230, 122, 0.16), var(--shadow-sm);
}

.chainlab-pill-title {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}
.light-theme .chainlab-system-pill,
.light-theme .chainlab-sys-chip {
  background: var(--bg-surface);
  border-color: rgba(15, 23, 42, 0.10);
}
.light-theme .chainlab-system-pill.active,
.light-theme .chainlab-system-pill[aria-selected="true"],
.light-theme .chainlab-sys-chip.active,
.light-theme .chainlab-sys-chip[aria-selected="true"] {
  border-color: #16a34a;
  background: rgba(22, 163, 74, 0.10);
  box-shadow: 0 4px 12px rgba(22, 163, 74, 0.16);
}

.chainlab-pill-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  color: var(--text-secondary);
}

.chainlab-pill-tag {
  padding: 1px 6px;
  border-radius: var(--radius-full);
  font-size: 9.5px;
  font-weight: 700;
  font-family: var(--font-display);
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.pill-tag-gi {
  background: rgba(155, 89, 245, 0.15);
  color: var(--brand-purple, #9b59f5);
  border: 1px solid rgba(155, 89, 245, 0.3);
}

.pill-tag-nogi {
  background: rgba(59, 158, 255, 0.15);
  color: var(--brand-blue, #3b9eff);
  border: 1px solid rgba(59, 158, 255, 0.3);
}

.pill-tag-both {
  background: rgba(67, 230, 122, 0.15);
  color: var(--accent-glow, #43e67a);
  border: 1px solid rgba(67, 230, 122, 0.3);
}

/* ── 5. Coach Authoring Bar ── */
.chainlab-coach-bar {
  background: rgba(245, 176, 65, 0.08);
  border: 1px solid rgba(245, 176, 65, 0.25);
  border-radius: var(--radius-md, 14px);
  padding: 8px 12px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.chainlab-coach-bar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 8px;
  flex-wrap: nowrap;
}

.chainlab-coach-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 800;
  font-family: var(--font-display);
  color: var(--text-primary);
  white-space: nowrap;
  flex-shrink: 0;
}
.chainlab-coach-pill svg {
  color: var(--brand-gold, #f5b041);
}

.chainlab-coach-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  flex-shrink: 0;
}

.btn-chainlab-coach-action,
.btn-coach-action {
  min-height: 32px;
  padding: 0 11px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 800;
  font-family: var(--font-display);
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  -webkit-tap-highlight-color: transparent;
  background: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.btn-chainlab-coach-action:active,
.btn-coach-action:active {
  transform: scale(0.96);
  transition: transform 60ms ease;
}

#btn-chainlab-add-system {
  background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
  color: #111827;
  border: none;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.28);
}

#btn-chainlab-reset-defaults {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

/* User Custom Chain & Node Modern Action Buttons */
#btn-chainlab-create-custom,
.chainlab-create-custom-btn {
  min-height: 36px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 9999px;
  font-size: 11.5px;
  font-weight: 800;
  font-family: var(--font-display);
  cursor: pointer;
  background: var(--brand-accent, #cafd00);
  color: var(--brand-accent-text, #000);
  border: none;
  box-shadow: var(--brand-accent-shadow, 0 4px 12px rgba(202, 253, 0, 0.25));
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  -webkit-tap-highlight-color: transparent;
}

#btn-chainlab-create-custom:active,
.chainlab-create-custom-btn:active {
  transform: scale(0.95);
  transition: transform 60ms ease;
}

.btn-chainlab-edit-node,
.btn-chainlab-add-branch,
.btn-chainlab-add-node,
.btn-chainlab-delete-node {
  min-height: 32px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font-display);
  cursor: pointer;
  background: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid var(--border);
  transition: all 0.18s ease;
  -webkit-tap-highlight-color: transparent;
}

.btn-chainlab-edit-node:active,
.btn-chainlab-add-branch:active,
.btn-chainlab-add-node:active,
.btn-chainlab-delete-node:active {
  transform: scale(0.95);
}

.btn-chainlab-delete-node {
  color: #ff453a;
  border-color: rgba(255, 69, 58, 0.3);
  background: rgba(255, 69, 58, 0.08);
}

/* Studied Status Tracking Styling */
.chainlab-system-pill[data-studied="true"],
.chainlab-system-card[data-studied="true"] {
  border-color: var(--brand-green, #1db954) !important;
  box-shadow: 0 0 12px rgba(29, 185, 84, 0.2) !important;
}

.chainlab-studied-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--brand-green, #1db954);
  background: rgba(29, 185, 84, 0.12);
  border: 1px solid rgba(29, 185, 84, 0.3);
  border-radius: 9999px;
  padding: 2px 7px;
  font-family: var(--font-display);
}

.btn-chainlab-toggle-studied {
  min-height: 34px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 800;
  font-family: var(--font-display);
  cursor: pointer;
  background: var(--bg-elevated);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-chainlab-toggle-studied.studied {
  background: rgba(29, 185, 84, 0.15);
  color: var(--brand-green, #1db954);
  border-color: var(--brand-green, #1db954);
  box-shadow: 0 0 12px rgba(29, 185, 84, 0.25);
}

/* Hover Details Tooltip */
#chainlab-matrix-hover-tooltip {
  position: absolute;
  z-index: 100;
  pointer-events: none;
  background: var(--bg-surface, #090a0d);
  border: 1px solid var(--border-active, rgba(255, 255, 255, 0.18));
  border-radius: 12px;
  padding: 10px 14px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
  max-width: 260px;
  display: none;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: opacity 0.15s ease;
}

/* ── 6. Stream Drill-Down View ── */
.chainlab-stream-container {
  display: flex;
  flex-direction: column;
}

/* Breadcrumb Navigation Bar */
.chainlab-breadcrumb-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--bg-surface, #090a0d);
  border: 1px solid var(--border, rgba(255, 255, 255, 0.07));
  border-radius: var(--radius-md, 14px);
  margin-bottom: 16px;
  gap: 10px;
}

.chainlab-breadcrumb-trail {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  flex: 1;
}

.chainlab-breadcrumb-pill {
  padding: 3px 8px;
  border-radius: var(--radius-full);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  white-space: nowrap;
  font-size: 11px;
}

.chainlab-breadcrumb-pill.active {
  background: rgba(67, 230, 122, 0.15);
  color: var(--accent-glow, #43e67a);
  font-weight: 700;
}

.chainlab-breadcrumb-step {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-glow, #43e67a);
  white-space: nowrap;
}

.chainlab-breadcrumb-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.btn-chainlab-back,
#btn-chainlab-back {
  min-height: 44px;
  min-width: 44px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-active);
  border-radius: var(--radius-sm, 8px);
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-chainlab-back:active,
#btn-chainlab-back:active {
  transform: scale(0.96);
  transition: transform 60ms ease;
}

.btn-chainlab-reset,
#btn-chainlab-reset {
  min-height: 44px;
  min-width: 44px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: rgba(244, 63, 94, 0.08);
  border: 1px solid rgba(244, 63, 94, 0.25);
  border-radius: var(--radius-sm, 8px);
  color: #f43f5e;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-chainlab-reset:active,
#btn-chainlab-reset:active {
  transform: scale(0.96);
  transition: transform 60ms ease;
}

/* Cascading Vertical Cards */
.chainlab-stream-card {
  background: var(--bg-surface, #090a0d);
  border: 1px solid var(--border, rgba(255, 255, 255, 0.07));
  border-radius: var(--radius-lg, 20px);
  padding: 18px 16px;
  margin: 0;
  box-shadow: var(--shadow-md);
  position: relative;
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1),
              border-color 0.22s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.chainlab-stream-card.active-step,
.chainlab-stream-card[data-active="true"] {
  border-color: rgba(67, 230, 122, 0.45);
  box-shadow: 0 0 20px rgba(67, 230, 122, 0.12), var(--shadow-md);
}

.chainlab-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.chainlab-card-title-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.card-title,
.chainlab-card-title {
  font-size: 16px;
  font-weight: 700;
  font-family: var(--font-display);
  color: var(--text-primary);
  line-height: 1.3;
}

/* Active Step Stage Badges */
.chainlab-stage-badge,
.stage-badge {
  font-size: 10px;
  font-weight: 800;
  font-family: var(--font-display);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  line-height: 1;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.stage-badge-0,
.chainlab-stage-badge.stage-0 {
  background: var(--node-position-bg);
  color: var(--node-position-color);
  border: 1px solid var(--node-position-border);
}

.stage-badge-1,
.chainlab-stage-badge.stage-1 {
  background: var(--node-action-bg);
  color: var(--node-action-color);
  border: 1px solid var(--node-action-border);
}

.stage-badge-2,
.chainlab-stage-badge.stage-2 {
  background: var(--node-reaction-bg);
  color: var(--node-reaction-color);
  border: 1px solid var(--node-reaction-border);
}

.stage-badge-3,
.chainlab-stage-badge.stage-3 {
  background: var(--node-counter-bg);
  color: var(--node-counter-color);
  border: 1px solid var(--node-counter-border);
}

.stage-badge-4,
.chainlab-stage-badge.stage-4 {
  background: var(--node-submission-bg);
  color: var(--node-submission-color);
  border: 1px solid var(--node-submission-border);
}

/* Card Body Content */
.chainlab-card-grips {
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.4;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.chainlab-card-cues {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
}

.chainlab-cue-bullet {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.chainlab-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.btn-inspect-node {
  min-height: 48px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-active);
  border-radius: var(--radius-sm, 8px);
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  -webkit-tap-highlight-color: transparent;
}

.btn-inspect-node:active {
  transform: scale(0.96);
  transition: transform 60ms ease;
}

/* Cascading Vertical Connector */
.chainlab-stream-connector {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 34px;
  position: relative;
  margin: -2px 0;
  z-index: 1;
}

.chainlab-stream-connector::before {
  content: "";
  width: 2px;
  height: 100%;
  background: linear-gradient(180deg, rgba(67, 230, 122, 0.6) 0%, rgba(255, 255, 255, 0.14) 100%);
}

.chainlab-connector-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 1.5px solid var(--accent-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  color: var(--accent-glow);
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
}

/* Dilemma Callout Card */
.chainlab-dilemma-card {
  background: linear-gradient(135deg, rgba(255, 124, 60, 0.09) 0%, rgba(13, 17, 26, 0.96) 100%);
  border: 1px solid rgba(255, 124, 60, 0.35);
  border-radius: var(--radius-lg, 20px);
  padding: 18px 16px;
  margin: 12px 0;
  box-shadow: 0 4px 24px rgba(255, 124, 60, 0.12);
}
.light-theme .chainlab-dilemma-card {
  background: linear-gradient(135deg, rgba(255, 124, 60, 0.10) 0%, #ffffff 100%);
  border-color: rgba(234, 88, 12, 0.28);
  box-shadow: 0 4px 16px rgba(234, 88, 12, 0.08);
}

.chainlab-dilemma-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 800;
  color: var(--brand-orange, #ff7c3c);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.chainlab-dilemma-container,
.dilemma-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chainlab-dilemma-btn,
.btn-branch-choice {
  width: 100%;
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md, 14px);
  color: var(--text-primary, #f2f4f7);
  font-size: 13.5px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.chainlab-dilemma-btn:hover,
.btn-branch-choice:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 124, 60, 0.5);
  transform: translateY(-1px);
}

.chainlab-dilemma-btn:active,
.btn-branch-choice:active {
  transform: scale(0.975);
  background: rgba(255, 124, 60, 0.18);
  border-color: var(--brand-orange);
  transition: transform 60ms ease, background 60ms ease;
}

.chainlab-dilemma-btn svg,
.btn-branch-choice svg {
  stroke: var(--brand-orange, #ff7c3c);
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-left: 8px;
  transition: transform 0.2s ease;
}

/* Terminal Outcome Card */
.chainlab-terminal-card {
  background: linear-gradient(135deg, rgba(244, 63, 94, 0.12) 0%, rgba(9, 10, 13, 0.96) 100%);
  border: 1.5px solid rgba(244, 63, 94, 0.45);
  border-radius: var(--radius-lg, 20px);
  padding: 22px 18px;
  box-shadow: 0 8px 32px rgba(244, 63, 94, 0.18);
  position: relative;
  overflow: hidden;
  margin-top: 8px;
}

.chainlab-terminal-card.terminal-transition {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.12) 0%, rgba(9, 10, 13, 0.96) 100%);
  border-color: rgba(6, 182, 212, 0.45);
  box-shadow: 0 8px 32px rgba(6, 182, 212, 0.18);
}

.light-theme .chainlab-terminal-card {
  background: linear-gradient(135deg, rgba(244, 63, 94, 0.08) 0%, #ffffff 100%);
  border-color: rgba(225, 29, 72, 0.30);
  box-shadow: 0 6px 20px rgba(225, 29, 72, 0.08);
}

.light-theme .chainlab-terminal-card.terminal-transition {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.08) 0%, #ffffff 100%);
  border-color: rgba(8, 145, 178, 0.30);
  box-shadow: 0 6px 20px rgba(8, 145, 178, 0.08);
}

.light-theme .chainlab-dilemma-btn,
.light-theme .btn-branch-choice,
.light-theme .btn-inspect-node,
.light-theme .btn-drill-branch,
.light-theme .counter-option-btn,
.light-theme .chainlab-branch-btn {
  background: var(--bg-surface);
  border-color: rgba(15, 23, 42, 0.12);
  color: var(--text-primary);
}

.light-theme .chainlab-dilemma-btn:hover,
.light-theme .btn-branch-choice:hover {
  background: rgba(234, 88, 12, 0.06);
  border-color: rgba(234, 88, 12, 0.45);
}

.chainlab-terminal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.chainlab-terminal-title {
  font-size: 18px;
  font-weight: 800;
  font-family: var(--font-display);
  color: var(--text-primary);
}

/* ── 7. Visual Node Matrix Canvas View ── */
.chainlab-matrix-container {
  position: relative;
  width: 100%;
}

.chainlab-matrix-canvas-wrap {
  position: relative;
  width: 100%;
  height: 560px;
  min-height: 480px;
  max-height: 75vh;
  border-radius: var(--radius-xl, 28px);
  background: var(--chainlab-canvas-bg, #050608);
  border: 1px solid var(--border, rgba(255, 255, 255, 0.07));
  touch-action: none;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  background-image: radial-gradient(circle, var(--chainlab-grid-dot) 1px, transparent 1px);
  background-size: 24px 24px;
  background-position: 0 0;
}

#chainlab-matrix-canvas,
#chainlab-matrix-svg,
.chainlab-matrix-canvas {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
  cursor: grab;
}

.chainlab-matrix-canvas.is-panning {
  cursor: grabbing !important;
}

.matrix-viewport,
#chainlab-matrix-viewport {
  transform-origin: 0 0;
  will-change: transform;
}

/* Bézier Connector Edges */
.matrix-edge,
.chainlab-matrix-edge,
.chainlab-edge-path {
  fill: none;
  stroke: var(--chainlab-edge-stroke, rgba(255, 255, 255, 0.18));
  stroke-width: 2px;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke 0.2s ease, stroke-width 0.2s ease;
}

marker#chainlab-arrow path {
  fill: var(--chainlab-edge-stroke, rgba(255, 255, 255, 0.35));
}

marker#chainlab-arrow-active path {
  fill: var(--accent-glow, #43e67a);
}

.edge-on-trail,
.matrix-edge.edge-on-trail {
  stroke: var(--accent-glow, #43e67a) !important;
  stroke-width: 3.5px !important;
  stroke-linecap: round;
  filter: drop-shadow(0 0 6px rgba(67, 230, 122, 0.65));
  stroke-dasharray: 8 4;
  animation: chainlabTrailFlow 1.2s linear infinite;
}

@keyframes chainlabTrailFlow {
  from { stroke-dashoffset: 24; }
  to { stroke-dashoffset: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .edge-on-trail,
  .matrix-edge.edge-on-trail {
    animation: none !important;
    stroke-dasharray: none !important;
  }
}

/* Node Elements on SVG Canvas */
.matrix-node {
  cursor: pointer;
}

.matrix-node-rect {
  fill: var(--bg-elevated, #111216);
  stroke: var(--border, rgba(255, 255, 255, 0.12));
  stroke-width: 1.5px;
  rx: 10px;
  ry: 10px;
  transition: stroke 0.2s ease, fill 0.2s ease, filter 0.2s ease;
}

/* Node Type Borders in Matrix */
.node-type-position .matrix-node-rect,
.node-position .matrix-node-rect,
[data-node-type="position"] .matrix-node-rect {
  stroke: rgba(59, 130, 246, 0.5);
}

.node-type-action .matrix-node-rect,
.node-action .matrix-node-rect,
[data-node-type="action"] .matrix-node-rect {
  stroke: rgba(245, 158, 11, 0.5);
}

.node-type-reaction .matrix-node-rect,
.node-reaction .matrix-node-rect,
[data-node-type="reaction"] .matrix-node-rect {
  stroke: rgba(255, 124, 60, 0.5);
}

.node-type-counter .matrix-node-rect,
.node-counter .matrix-node-rect,
[data-node-type="counter"] .matrix-node-rect {
  stroke: rgba(16, 185, 129, 0.5);
}

.node-type-submission .matrix-node-rect,
.node-submission .matrix-node-rect,
[data-node-type="submission"] .matrix-node-rect {
  stroke: rgba(244, 63, 94, 0.55);
}

.node-type-transition .matrix-node-rect,
.node-transition .matrix-node-rect,
[data-node-type="transition"] .matrix-node-rect {
  stroke: rgba(6, 182, 212, 0.5);
}

/* Active Trail Node Highlight */
.matrix-node.active-trail .matrix-node-rect,
.matrix-node[data-active="true"] .matrix-node-rect {
  stroke: var(--accent-glow, #43e67a) !important;
  stroke-width: 2.5px !important;
  filter: drop-shadow(0 0 10px rgba(67, 230, 122, 0.55));
  fill: #161a22 !important;
}

.matrix-node-text {
  font-family: var(--font-primary);
  font-size: 13px;
  font-weight: 700;
  fill: #f2f4f7;
  pointer-events: none;
}

.light-theme .matrix-node-rect {
  fill: #ffffff;
  stroke-width: 1.8px;
  filter: drop-shadow(0 2px 6px rgba(15, 23, 42, 0.08));
}

.light-theme .matrix-node.active-trail .matrix-node-rect,
.light-theme .matrix-node[data-active="true"] .matrix-node-rect {
  fill: #ecfdf5 !important;
  stroke: #16a34a !important;
  filter: drop-shadow(0 4px 12px rgba(22, 163, 74, 0.24));
}

.light-theme .matrix-node-text {
  fill: #0f172a;
}

.light-theme .matrix-node.active-trail .matrix-node-text,
.light-theme .matrix-node[data-active="true"] .matrix-node-text {
  fill: #064e3b;
}

.matrix-node-badge {
  font-family: var(--font-display);
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  pointer-events: none;
}

/* Floating Zoom & Pan Control Overlay */
.chainlab-matrix-controls {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 15;
  pointer-events: auto;
}

.chainlab-matrix-hover-tooltip {
  background: rgba(18, 20, 24, 0.94);
  border: 1px solid var(--border-brand, rgba(67, 230, 122, 0.4));
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  color: var(--text-primary);
}
.light-theme .chainlab-matrix-hover-tooltip {
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid rgba(22, 163, 74, 0.35);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.14);
}

.btn-matrix-ctrl {
  width: 38px;
  height: 38px;
  min-width: 38px;
  min-height: 38px;
  border-radius: 10px;
  background: rgba(13, 17, 26, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-active);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.38);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.light-theme .btn-matrix-ctrl {
  background: rgba(255, 255, 255, 0.94);
  border-color: rgba(15, 23, 42, 0.12);
  color: #0f172a;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.12);
}

.btn-matrix-ctrl:active {
  transform: scale(0.92);
  background: rgba(255, 255, 255, 0.12);
  transition: transform 60ms ease, background 60ms ease;
}
.light-theme .btn-matrix-ctrl:active {
  background: rgba(15, 23, 42, 0.08);
}

.btn-matrix-ctrl svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

/* ── 8. Centered Detail Inspector & Authoring Modal ── */
dialog#chainlab-detail-drawer:not([open]):not(.visible),
dialog#chainlab-author-modal:not([open]):not(.visible) {
  display: none !important;
}
dialog#chainlab-detail-drawer[open],
dialog#chainlab-detail-drawer.visible,
dialog#chainlab-author-modal[open],
dialog#chainlab-author-modal.visible {
  position: fixed !important;
  inset: 0 !important;
  top: 0 !important;
  bottom: 0 !important;
  left: 0 !important;
  right: 0 !important;
  margin: auto !important;
  width: min(440px, calc(100vw - 32px)) !important;
  max-width: 440px !important;
  height: fit-content !important;
  max-height: 84vh !important;
  max-height: 84dvh !important;
  border-radius: 24px !important;
  border: 1px solid var(--border-active) !important;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.36) !important;
  animation: none !important;
}
dialog#chainlab-detail-drawer,
dialog#chainlab-author-modal,
dialog.chainlab-detail-drawer,
dialog#chainlab-node-inspector,
.chainlab-detail-drawer {
  padding: 0;
  color: var(--text-primary);
  background: var(--bg-elevated, #ffffff);
  z-index: 9999;
}
.light-theme dialog#chainlab-detail-drawer,
.light-theme dialog#chainlab-author-modal {
  background: #ffffff !important;
  border: 1px solid rgba(15, 23, 42, 0.12) !important;
  box-shadow: 0 20px 56px rgba(15, 23, 42, 0.22) !important;
}

.chainlab-drawer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}

.chainlab-drawer-title-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.chainlab-drawer-title,
#chainlab-inspector-title {
  font-size: 18px;
  font-weight: 800;
  font-family: var(--font-display);
  line-height: 1.25;
  color: var(--text-primary);
  margin: 0;
}

.chainlab-drawer-badge,
#chainlab-inspector-type {
  font-size: 10px;
  font-weight: 800;
  font-family: var(--font-display);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  line-height: 1;
  background: rgba(59, 158, 255, 0.12);
  color: var(--brand-blue, #3b9eff);
}
.chainlab-type-badge.type-position {
  background: rgba(59, 158, 255, 0.12);
  color: var(--brand-blue, #3b9eff);
}
.chainlab-type-badge.type-action {
  background: rgba(155, 89, 245, 0.14);
  color: var(--brand-purple, #9b59f5);
}
.chainlab-type-badge.type-dilemma {
  background: rgba(245, 158, 11, 0.14);
  color: #d97706;
}
.chainlab-type-badge.type-counter {
  background: rgba(22, 163, 74, 0.14);
  color: #16a34a;
}
.chainlab-type-badge.type-submission {
  background: rgba(239, 68, 68, 0.14);
  color: #dc2626;
}
.chainlab-type-badge.type-transition {
  background: rgba(6, 182, 212, 0.14);
  color: #0891b2;
}

.chainlab-drawer-close,
.btn-close-inspector {
  min-width: 48px;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  -webkit-tap-highlight-color: transparent;
}

.chainlab-drawer-close:active,
.btn-close-inspector:active {
  transform: scale(0.92);
  transition: transform 60ms ease;
}

/* Grip Card */
.chainlab-grip-card,
#chainlab-inspector-grips {
  background: var(--bg-elevated, #111216);
  border: 1px solid var(--border);
  border-radius: var(--radius-md, 14px);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}

.chainlab-section-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 800;
  font-family: var(--font-display);
  color: var(--text-secondary);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.chainlab-grip-text {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.45;
}

/* Execution Cues Checklist */
.chainlab-cues-card {
  background: var(--bg-elevated, #111216);
  border: 1px solid var(--border);
  border-radius: var(--radius-md, 14px);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}

.chainlab-cues-list,
#chainlab-inspector-cues {
  display: flex;
  flex-direction: column;
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.chainlab-cue-item,
.cue-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  line-height: 1.4;
  color: var(--text-primary);
  cursor: pointer;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  transition: background 0.15s ease;
}

.chainlab-cue-checkbox {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1.5px solid var(--accent-glow, #43e67a);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
  color: var(--accent-glow);
}

.chainlab-cue-item.completed,
.cue-item.completed {
  opacity: 0.65;
  text-decoration: line-through;
}

/* Coaching Tip Callout */
.chainlab-tip-callout,
#chainlab-inspector-tips,
.chainlab-coaching-tip {
  background: rgba(245, 176, 65, 0.08);
  border-left: 3.5px solid var(--brand-gold, #f5b041);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.chainlab-tip-header {
  font-size: 11px;
  font-weight: 800;
  font-family: var(--font-display);
  color: var(--brand-gold, #f5b041);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 6px;
}

.chainlab-tip-text {
  font-size: 12.5px;
  color: var(--text-primary);
  line-height: 1.45;
}

/* Follow-up Branch Buttons */
.chainlab-counters-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}

.chainlab-counters-list,
#chainlab-inspector-counters {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.btn-drill-branch,
.counter-option-btn,
.chainlab-branch-btn {
  min-height: 48px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-active);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.btn-drill-branch:active,
.counter-option-btn:active,
.chainlab-branch-btn:active {
  transform: scale(0.975);
  background: rgba(67, 230, 122, 0.12);
  border-color: var(--accent-glow);
  transition: transform 60ms ease, background 60ms ease;
}

/* Video Breakdown Button */
.chainlab-video-btn {
  min-height: 48px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, rgba(67, 230, 122, 0.15) 0%, rgba(29, 185, 84, 0.25) 100%);
  border: 1px solid var(--accent-glow, #43e67a);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 13.5px;
  font-weight: 700;
  font-family: var(--font-display);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
#chainlab-inspector-video {
  width: 100%;
}
.light-theme .chainlab-video-btn {
  background: linear-gradient(135deg, rgba(22, 163, 74, 0.12) 0%, rgba(16, 185, 129, 0.20) 100%);
  border-color: rgba(22, 163, 74, 0.45);
  color: #065f46;
}
.light-theme .chainlab-tip-header {
  color: #b45309;
}
.light-theme .chainlab-cue-checkbox {
  border-color: #16a34a;
  color: #16a34a;
}

.chainlab-video-btn:active,
#chainlab-inspector-video:active {
  transform: scale(0.975);
  transition: transform 60ms ease;
}

/* ── 9. Knowledge Hub Jump Card ── */
.chainlab-jump-card,
.chainlab-jump-banner {
  background: linear-gradient(135deg, rgba(67, 230, 122, 0.08) 0%, rgba(13, 17, 26, 0.95) 100%);
  border: 1px solid rgba(67, 230, 122, 0.25);
  border-radius: var(--radius-lg, 20px);
  padding: 18px 16px;
  margin-bottom: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.light-theme .chainlab-jump-card,
.light-theme .chainlab-jump-banner {
  background: #ffffff;
  border: 1px solid rgba(22, 163, 74, 0.24);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.chainlab-jump-card:hover,
.chainlab-jump-banner:hover {
  border-color: var(--accent-glow, #43e67a);
  transform: translateY(-1px);
}

.chainlab-jump-card:active,
.chainlab-jump-banner:active {
  transform: scale(0.98);
  transition: transform 60ms ease;
}

