/* Hide marks and dots for annotation range slider */
#annotation-range .rc-slider-mark,
#annotation-range .rc-slider-mark-text,
#annotation-range .rc-slider-step,
#annotation-range .rc-slider-dot {
  display: none !important;
}
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Rubik:ital,wght@0,300..900;1,300..900&display=swap');

/* Custom Scrollbar Styling */
/* Webkit browsers (Chrome, Safari, Edge) */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #1a1a2e;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb {
    background: #795EB6;
    border-radius: 5px;
    border: 2px solid #1a1a2e;
}

::-webkit-scrollbar-thumb:hover {
    background: #8B6FC7;
}

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: #795EB6 #1a1a2e;
}

/* 🌑 General Theme - Dark but with Earthy Undertones */
body {
    background-color: #1C1C1C; /* Deep Rock Grey */
    color: #B8B8B8; /* Soft Chalk White */
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* BoulderFlow Title - Full-width Header Panel */
.boulderflow-title-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 25px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    border-bottom: 3px solid #795EB6;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    width: 100%;
    box-sizing: border-box;
    position: relative;
    z-index: 1000;
    flex-shrink: 0;
}

.title-b {
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: #795EB6; /* Purple from profile radial plots */
    letter-spacing: 1px;
    font-weight: 600;
    font-size: 72px; /* Larger than the 'f' */
}

.title-eta-breakers {
    font-family: "Rubik", sans-serif !important;
    font-optical-sizing: auto;
    font-weight: 600;
    font-style: normal;
    color: #20B2AA; /* Teal color */
    letter-spacing: 1px;
    font-size: 40px;
    vertical-align: middle;
}

.title-network {
    font-family: "Rubik", sans-serif !important;
    font-optical-sizing: auto;
    font-weight: 400;
    font-style: italic;
    color: #F5F5DC; /* Off-white color */
    letter-spacing: 1px;
    font-size: 40px;
    vertical-align: middle;
}

.title-f {
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-style: italic;
    font-weight: 600;
    color: #FFA800; /* Gold from profile radial plots */
    font-size: 72px; /* Much larger for the 'f' */
}


.title-low {
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-style: italic;
    color: #FFA800; /* Gold from profile radial plots */
    font-weight: 600;
    font-size: 52px;
    /*text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.6);*/
    transform: translateY(-3px); /* Fine-tune vertical alignment */
}

/* Logo image responsive sizing */
.boulderflow-title-header img {
    max-width: 100%;
    height: auto;
    object-fit: contain;
}

/* Responsive design for mobile */
@media (max-width: 768px) {
    .boulderflow-title-header {
        padding: 10px;
        gap: 0px;
    }
    
    .boulderflow-title-header img {
        max-width: 90%;
        height: auto;
        max-height: 60px;
    }
    
    .title-b {
        font-size: clamp(28px, 8vw, 48px);
        letter-spacing: 0.5px;
    }
    
    .title-boulder {
        font-size: clamp(28px, 8vw, 48px);
        letter-spacing: 0.5px;
    }
    
    .title-eta-breakers {
        font-size: clamp(20px, 5vw, 32px);
    }
    
    .title-network {
        font-size: clamp(20px, 5vw, 32px);
    }
    
    .title-f {
        font-size: clamp(32px, 9vw, 54px);
    }
    
    .title-low {
        font-size: clamp(24px, 7vw, 40px);
    }
}

/* Extra small screens - more aggressive scaling */
@media (max-width: 400px) {
    .boulderflow-title-header {
        padding: 8px 5px;
        gap: 0px;
    }
    
    .boulderflow-title-header img {
        max-width: 95%;
        max-height: 45px;
    }
    
    .title-b,
    .title-boulder {
        font-size: clamp(20px, 7vw, 32px);
    }
    
    .title-eta-breakers,
    .title-network {
        font-size: clamp(16px, 4.5vw, 24px);
    }
    
    .title-f {
        font-size: clamp(24px, 8vw, 40px);
    }
    
    .title-low {
        font-size: clamp(18px, 6vw, 28px);
    }
}

/* Keep the old sidebar title styling for backward compatibility */
.boulderflow-title {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 6px;
    font-size: 22px;
    font-weight: 800;
}

/* 📊 Analytics Dashboard - Rough Texture, Industrial Look */
.analytics-dashboard {
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-weight: 400;
    font-size: 46px;
    color: #76C297; /* Earthy Pastel Green */
    text-shadow: 4px 4px 6px rgba(0, 0, 0, 0.5);
}

/* 🧗 Subtle Climbing Grip Texture for Headers */
.section-header {
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 40px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #B8B8B8;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
}

.video-container {
    position: relative;
    max-width: 900px;
    margin: auto;
}

#video-player {
    width: 100%;
    display: block;
}

#marker-bar {
    position: absolute;
    height: 12px;
    z-index: 1000;
    pointer-events: none;
}

.marker {
    position: absolute;
    top: 0;
    width: 2px;
    height: 100%;
    background-color: red;
    opacity: 0.9;
    pointer-events: auto;
    cursor: pointer;
}



#marker-bar {
    position: absolute;
    bottom: 0;
    height: 12px;
    z-index: 100;
    pointer-events: none;
    /* background debugging */
    background: linear-gradient(to right, red, blue);
    /* DO NOT set width/left/right here */
}


.marker {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    font-size: 20px;
    pointer-events: auto;
    cursor: pointer;
    z-index: 1001;
    user-select: none;
    line-height: 1;
    background: none !important;
    border: none !important;
    width: auto !important;
    height: auto !important;

}


.marker:hover {
    opacity: 1;
    background-color: orange;
}

*/
/* Exec line hover *//*

#exec-list-col span:hover { color: orange; }

*/
/* arm‑emoji list: light text, no background *//*

#exec-list-col span { color: #ddd; background: transparent; }


*/
/* 🌒 Sidebar Container *//*

#sidebar {
    background-color: #111; */
/* Dark matte *//*

    padding: 20px;
    color: white;
    min-height: 100vh;
    width: 220px;
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    box-shadow: 4px 0 6px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    gap: 20px;
}

*/
/* 🧭 Sidebar Links *//*

.sidebar-link {
    font-size: 18px;
    color: #ccc;
    text-decoration: none;
    padding: 8px 0;
    transition: all 0.2s ease-in-out;
    display: block;
    border-left: 4px solid transparent;
}

.sidebar-link:hover {
    color: #F48FB1;
    border-left: 4px solid #F48FB1;
    background-color: #1f1f1f;
    padding-left: 8px;
    cursor: pointer;
}

*/
/* ✅ Active Link (if you want to add .active manually or with JS) *//*

.sidebar-link.active {
    color: #76C297;
    font-weight: bold;
    border-left: 4px solid #76C297;
    background-color: #202020;
    padding-left: 8px;
}


*/
/* Main content pane *//*

.main-content {
    flex-grow: 1;
    padding: 30px;
    background-color: #1C1C1C;
    color: #ccc;
}


@media (max-width: 768px) {
    #sidebar {
        width: 100%;
        flex-direction: row;
        overflow-x: auto;
        min-height: auto;
    }

    .sidebar-link {
        flex: 1;
        text-align: center;
        border-left: none;
        border-bottom: 2px solid transparent;
    }

    .sidebar-link:hover {
        border-left: none;
        border-bottom: 2px solid #F48FB1;
    }

    */
/* 🌑 Main content area beside the sidebar *//*

.main-content {
    background-color: #1C1C1C;  */
/* Match body background *//*

    color: #B8B8B8;            */
/* Light text *//*

    padding: 30px;
    flex-grow: 1;
    overflow-y: auto;
}

}


*/
/* Default (desktop) *//*

.climb-layout {
  flex-direction: row;
}

*/
/* Mobile breakpoint *//*

@media (max-width: 768px) {
  .climb-layout {
    flex-direction: row;   */
/* keep side-by-side *//*

  }
  .climb-layout > div:nth-child(2) {
    flex: 0 0 60px;        */
/* shrink metrics column *//*

    max-width: 60px;
    font-size: 10px;       */
/* shrink text *//*

    overflow-x: hidden;
  }
}

*/
/* Video Layout System *//*

.climb-layout {
  display: flex;
  gap: 30px;
  align-items: flex-start;
  padding-top: 20px;
  flex-wrap: wrap;
}

.video-section {
  flex: 0 0 auto;
  min-width: 300px;
  padding-right: 10px;
}

.metrics-section {
  flex: 1 1 auto;
  min-width: 250px;
  color: white;
  padding-right: 20px;
}

.video-wrapper {
  position: relative;
  width: auto;
  height: auto;
  max-height: 80vh;
  overflow: hidden;
}

.video-element {
  width: auto;
  height: auto;
  max-height: 80vh;
  max-width: 100vw;
  display: block;
  object-fit: contain;
}

.overlay-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
}

*/
/* Mobile responsive adjustments *//*

@media (max-width: 768px) {
  .climb-layout {
    flex-direction: column;
    gap: 20px;
  }

  .video-section {
    flex: 0 0 auto;
    min-width: auto;
    max-width: 100%;
  }

  .metrics-section {
    flex: 1 1 100%;
    min-width: auto;
    max-width: 100%;
  }

  .video-wrapper {
    max-height: 50vh;
  }

  .video-element {
    max-height: 50vh;
    max-width: 100vw;
  }
}

*/
/* Landscape orientation adjustments *//*

@media (orientation: landscape) and (max-height: 600px) {
  .video-wrapper {
    max-height: 80vh;
  }

  .video-element {
    max-height: 80vh;
  }
}


*/
/* === Page Container === *//*

.bf-root {
  box-sizing: border-box;   */
/* prevent padding/borders from breaking width *//*

  padding: 16px;            */
/* breathing room around content *//*

  background-color: #111;   */
/* dark background (adjust as needed) *//*

  min-height: 100vh;        */
/* full viewport height *//*

  overflow-x: hidden;       */
/* prevent horizontal scrollbars *//*

}

*/
/* === Main Row: video + sidebar === *//*

.bf-main-row {
  display: flex;            */
/* place video + sidebar side by side *//*

  gap: 20px;                */
/* space between the two columns *//*

  align-items: flex-start;  */
/* keep both columns top-aligned *//*

  padding-top: 16px;
  flex-wrap: nowrap;        */
/* keep side by side (mobile behavior later) *//*

}

*/
/* === Video Wrapper === *//*

.bf-video-wrapper {
  position: relative;       */
/* makes overlay position absolute inside here *//*

  display: inline-block;    */
/* shrink-wrap around video *//*

  width: fit-content;       */
/* match the video's rendered width *//*

  max-width: 100%;          */
/* never exceed parent column *//*

  max-height: 80vh;         */
/* cap at 80% of viewport height *//*

  overflow: hidden;         */
/* no scrollbars if rounding causes mismatch *//*

  align-self: flex-start;   */
/* stay aligned at the top of its column *//*

}

*/
/* === Video Element === *//*

.bf-video {
  display: block;        */
/* remove inline spacing quirks *//*

  width: auto;           */
/* let height drive scaling *//*

  height: auto;          */
/* let width drive scaling *//*

  max-width: 100%;       */
/* can’t overflow parent column *//*

  max-height: 80vh;      */
/* scale down if taller than viewport *//*

  object-fit: contain;   */
/* preserve aspect ratio, no cropping *//*

}

*/
/* === Pose Overlay === *//*

.bf-overlay {
  position: absolute;   */
/* sit on top of the video *//*

  top: 0;
  left: 0;
  right: 0;
  bottom: 0;            */
/* cover entire wrapper box *//*

  pointer-events: none; */
/* don’t block video controls *//*

  z-index: 2;           */
/* always above video *//*

}

*/
/* === Sidebar: metrics + executions === *//*

.bf-sidebar {
  flex: 0 1 350px;      */
/* sidebar can shrink, but not grow past 350px *//*

  max-width: 350px;     */
/* cap desktop width *//*

  color: white;         */
/* default text color *//*

  overflow-y: auto;     */
/* scroll if content taller than viewport *//*

  align-self: flex-start; */
/* align top with video *//*

}

*/
/* Title inside sidebar *//*

.bf-metrics-title {
  font-weight: bold;
  font-size: 16px;
  margin-bottom: 10px;
}

*/
/* Metrics content area *//*

.bf-metrics-content {
  margin-bottom: 20px;
}

*/
/* Execution list area *//*

.bf-exec-list {
  margin-top: 30px;
}

*/
/* === Page Container === *//*

.profile-root {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: #232337;
  color: #EEE;
  padding: 30px;
  min-height: 100vh;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}

*/
/* Title *//*

.profile-title {
  margin-bottom: 20px;
  font-size: 1.8em;
  text-align: left;
}

/* Profile page: gear icon overlay on large avatar - only visible on hover */
.profile-avatar-wrap .profile-avatar-edit-icon {
  opacity: 0;
  transition: opacity 0.2s ease, background-color 0.2s ease, transform 0.2s ease;
}
.profile-avatar-wrap:hover .profile-avatar-edit-icon {
  opacity: 1;
}
.profile-avatar-edit-icon:hover {
  background-color: rgba(121, 94, 182, 1) !important;
  transform: scale(1.05);
}

*/
/* === Top Summary Panel (dropdown/meta + two small plots) === *//*

.profile-summary-panel {
  display: flex;
  flex-direction: row;
  gap: 24px;                  */
/* space between left + right parts *//*

  align-items: flex-start;
  background: #28284a;
  border-radius: 16px;
  padding: 22px 32px;
  margin-bottom: 34px;
  width: 100%;
  min-height: 20%;
  box-shadow: 0 2px 8px #0003;
}

*/
/* === Main row container for radial + metrics === *//*

.profile-main-row {
  display: flex;
  flex-direction: row;   */
/* side by side on desktop *//*

  gap: 24px;
  width: 100%;
  min-height: 340px;
  align-items: flex-start;
}

*/
/* Radial plot sizing *//*

.profile-metrics-plot {
  width: 720px !important;
  height: 720px !important;
  flex: 0 0 auto;
  margin: 0 auto;
}

*/
/* Gauge metrics panel *//*

.profile-gauge-panel {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

*/
/* --- Mobile breakpoint --- *//*

@media (max-width: 768px) {
  .profile-main-row {
    flex-direction: column;   */
/* stack plot + metrics *//*

    align-items: flex-start;   */
/* ✅ align left & top, no centering *//*

    gap: 8px;
  }

  .profile-metrics-plot {
    width: 360px !important;
    height: 360px !important;
  }

  .profile-gauge-panel {
    margin-top: 8px;
    width: 100%;
  }
}

*/
/* === Gauge panel container === *//*

.profile-gauge-panel-content {
  height: 100%;
  overflow-y: auto;
  background: #232337;
  padding: 18px;
  border-radius: 18px;
  box-shadow: 0 2px 12px #0004;
  display: flex;
  flex-direction: column;
}

*/
/* Category headings *//*

.profile-gauge-panel-content > div:first-child {
  font-weight: bold;
  font-size: 1.1em;
  margin: 14px 0 4px 0;
}

*/
/* Metric row *//*

.profile-gauge-panel-content .metric-row {
  display: flex;
  align-items: center;
  margin-bottom: 4px;
  font-weight: bold;
  color: #EEE;
}

*/
/* Percentile bar background *//*

.profile-gauge-panel-content .metric-bar-bg {
  width: 100%;
  background: #393959;
  border-radius: 10px;
  height: 18px;
  margin-bottom: 16px;
}

*/
/* Percentile bar fill *//*

.profile-gauge-panel-content .metric-bar-fill {
  height: 18px;
  border-radius: 10px;
}

.metric-category {
  font-weight: 700;    */
/* force bold *//*

  font-size: 1.1em;
  margin: 14px 0 4px 0;
}


*/
/* --- Mobile overrides --- *//*

@media (max-width: 768px) {
  .profile-gauge-panel-content {
    padding: 12px;
  }

  .profile-gauge-panel-content > div:first-child {
    font-size: 0.9em;   */
/* smaller headings *//*

  }

  .profile-gauge-panel-content .metric-row {
    font-size: 0.8em;   */
/* shrink text *//*

  }

  .profile-gauge-panel-content .metric-bar-bg,
  .profile-gauge-panel-content .metric-bar-fill {
    height: 8px;       */
/* thinner bars on mobile *//*

    margin-bottom: 8px;
  }

  .profile-main-row {
    flex-direction: column;
    align-items: center;
    gap: 12px;   */
/* smaller gap *//*

  }

  .profile-gauge-panel {
    margin-top: 0;   */
/* remove the extra margin *//*

    width: 100%;
  }

}


.metric-row {
  display: flex;
  align-items: center;
  margin-bottom: 4px;
  font-weight: bold;
}

.metric-label {
  flex: 1;   */
/* takes up all available space *//*

}

.metric-value {
  text-align: right;   */
/* force right align *//*

  min-width: 40px;     */
/* ensures space for numbers *//*

}
*/

/* Main content pane */
.main-content {
    flex-grow: 1;
    padding: 30px;
    background-color: #1C1C1C;
    color: #ccc;
}

@media (max-width: 768px) {
    #sidebar {
        width: 100%;
        flex-direction: row;
        overflow-x: auto;
        min-height: auto;
    }

    .sidebar-link {
        flex: 1;
        text-align: center;
        border-left: none;
        border-bottom: 2px solid transparent;
    }

    .sidebar-link:hover {
        border-left: none;
        border-bottom: 2px solid transparent;
    }

    .sidebar-link.active {
        border-bottom: none !important;
    }

    .main-content {
        background-color: #1C1C1C;
        color: #B8B8B8;
        padding: 30px;
        flex-grow: 1;
        overflow-y: auto;
    }
}

/* Default (desktop) */
.climb-layout { flex-direction: row; }

/* Mobile climb view adjustments */
@media (max-width: 768px) {
  .climb-layout { flex-direction: row; }
  .climb-layout > div:nth-child(2) {
    flex: 0 0 60px;
    max-width: 60px;
    font-size: 10px;
    overflow-x: hidden;
  }
}

/* Video Layout System */
.climb-layout {
  display: flex;
  gap: 30px;
  align-items: flex-start;
  padding-top: 20px;
  flex-wrap: wrap;
}
.video-section { flex: 0 0 auto; min-width: 300px; padding-right: 10px; }
.metrics-section { flex: 1 1 auto; min-width: 250px; color: white; padding-right: 20px; }
.video-wrapper { position: relative; width: auto; height: auto; max-height: 80vh; overflow: hidden; }
.video-element { width: auto; height: auto; max-height: 80vh; max-width: 100vw; display: block; object-fit: contain; }
.overlay-container { position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 2; }

@media (max-width: 768px) {
  .climb-layout { flex-direction: column; gap: 20px; }
  .video-section { flex: 0 0 auto; max-width: 100%; }
  .metrics-section { flex: 1 1 100%; max-width: 100%; }
  .video-wrapper { max-height: 50vh; }
  .video-element { max-height: 50vh; max-width: 100vw; }
}
@media (orientation: landscape) and (max-height: 600px) {
  .video-wrapper { max-height: 80vh; }
  .video-element { max-height: 80vh; }
}

/* === Climb view (new system) === */
.bf-root {
  box-sizing: border-box;
  padding: 16px;
  background-color: #111;
  min-height: 100vh;
  overflow-x: hidden;
}
.bf-main-row {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  padding-top: 16px;
  flex-wrap: nowrap;
}
.bf-video-wrapper {
  position: relative;
  display: block;  /* Changed from inline-block to prevent subpixel oscillation */
  width: 100%;  /* Changed from fit-content - stable layout */
  max-width: 100%;
  max-height: 80vh;
  overflow: hidden;
  align-self: flex-start;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Pose overlay container fills wrapper using CSS only - prevents feedback loop */
#pose-overlay-container {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 2;
}
.bf-video {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
}
.bf-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none !important;  /* Always none - never flip to auto */
  z-index: 2;
  /* Use clip-path to exclude bottom 50px where video controls are */
  clip-path: inset(0 0 50px 0);
}
.bf-sidebar {
  flex: 0 1 350px;
  max-width: 350px;
  color: white;
  overflow-y: auto;
  align-self: flex-start;
}
/* Metrics Section */
.bf-metrics-section {
  margin-bottom: 20px;
  padding: 16px 20px;
  background: rgba(255,255,255,0.05);
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.bf-metrics-content { 
  margin: 0;
  padding: 0;
}

/* Exec Section */
.bf-exec-section {
  margin-top: 20px;
  padding: 16px 20px;
  background: rgba(255,255,255,0.05);
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.bf-exec-list { 
  margin: 0;
  padding: 0;
}

/* Radial Column */
.bf-radial-column {
  flex: 1; /* Expand to fill available space */
  min-width: 300px;
  max-width: 500px;
  color: white;
  overflow-y: auto;
  align-self: flex-start;
}

/* Radial Section */
.bf-radial-section {
  padding: 16px 20px;
  background: #232337;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.bf-radial-plot {
  width: 100%;
  height: 500px;
}

/* === Profile page === */
.profile-root {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: #232337;
  color: #EEE;
  padding: 30px;
  min-height: 100vh;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}
.profile-title { margin-bottom: 20px; font-size: 1.8em; text-align: left; }

.profile-summary-panel {
  display: flex;
  flex-direction: row;
  gap: 24px;
  align-items: flex-start;
  background: #28284a;
  border-radius: 16px;
  padding: 22px 32px;
  margin-bottom: 34px;
  width: 100%;
  min-height: 20%;
  box-shadow: 0 2px 8px #0003;
}

/* Main row: radial + metrics */
.profile-main-row {
  display: flex;
  flex-direction: row;
  gap: 24px;
  width: 100%;
  min-height: 340px;
  align-items: flex-start;
}
.profile-metrics-plot {
  width: 720px !important;
  height: 720px !important;
  flex: 0 0 auto;
  margin: 0 auto;
}
.profile-gauge-panel {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* Key insights strip above radial + gauge – same box style as controls and gauge panel */
.profile-key-insights-strip {
  display: flex;
  gap: 24px;
  padding: 18px;
  background: #1e1e2e;
  border-radius: 18px;
  box-shadow: 0 2px 12px #0004;
  margin-bottom: 12px;
}
.profile-key-insights-title {
  font-weight: 600;
  font-size: 1.15em;
}
.profile-key-insights-col {
  flex: 1;
  min-width: 0;
}
.profile-key-insights-label {
  font-size: 1.05em;
}
.profile-key-insights-explanation {
  font-size: 1em;
  line-height: 1.4;
}
.profile-key-insights-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 12px;
}
.profile-key-insights-bullet {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* --- Mobile breakpoint --- */
@media (max-width: 768px) {
  .profile-key-insights-strip {
    flex-direction: column;
    gap: 12px;
    padding: 12px 14px;
  }
  .profile-key-insights-bullet {
    width: 8px;
    height: 8px;
  }
  .profile-key-insights-title {
    font-size: 1.05em;
  }
  .profile-key-insights-label,
  .profile-key-insights-explanation {
    font-size: 0.95em;
  }
  .profile-main-row {
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-height: 520px;     /* extra height so radial can be vertically centered */
  }
  /* Prevent gauge wrapper from growing so radial's margin:auto can take the space */
  .profile-main-row > div:last-child,
  .profile-analytics-gauge-wrapper {
    flex: 0 0 auto !important;
  }
  .profile-metrics-plot {
    width: 320px !important;
    height: 320px !important;
    margin: auto 0;  /* vertical auto margins center the plot in the card */
  }
  .profile-metrics-plot .js-plotly-plot,
  .profile-metrics-plot .plotly {
    margin: 0 auto;
  }
  .profile-gauge-panel {
    margin-top: 0;
    width: 100%;
  }
  .profile-gauge-panel-content {
    padding: 12px;
  }
  .metric-category { font-size: 0.9em; }
  .metric-row { font-size: 0.8em; }
  .metric-bar-bg, .metric-bar-fill {
    height: 8px;
    margin-bottom: 8px;
  }
}

/* Gauge panel box – same background as controls and key insights (#1e1e2e) */
.profile-gauge-panel-content {
  height: 100%;
  overflow-y: auto;
  background: #1e1e2e;
  padding: 18px;
  border-radius: 18px;
  box-shadow: 0 2px 12px #0004;
  display: flex;
  flex-direction: column;
}

/* Controls panel (filters) – same box style and background as gauge and key insights */
.profile-analytics-controls-container {
  background: #1e1e2e;
  padding: 18px;
  border-radius: 18px;
  box-shadow: 0 2px 12px #0004;
  margin-bottom: 12px;
}
.profile-gauge-panel-summary {
  font-weight: normal;
  font-size: 0.95em;
  color: #CCC;
}

/* Categories + metrics */
.metric-category {
  font-weight: 700;
  font-size: 1.1em;
  margin: 14px 0 4px 0;
}
.metric-row {
  display: flex;
  align-items: center;
  margin-bottom: 4px;
  font-weight: bold;
}
.metric-label { flex: 1; }
.metric-value {
  text-align: right;
  min-width: 40px;
}
.metric-bar-bg {
  width: 100%;
  background: #393959;
  border-radius: 10px;
  height: 18px;
  margin-bottom: 16px;
}
.metric-bar-fill {
  height: 18px;
  border-radius: 10px;
}

/* Clickable metric row (opens explanation) – hover: shadow + nudge */
.metric-block-clickable:hover {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  transform: translateX(4px);
}
.profile-gauge-panel-content .metric-block-clickable {
  padding: 4px 8px;
  margin: 2px 0;
  border-radius: 8px;
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

/* Video Selection Controls */
.bf-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 20px;
  padding: 20px;
  background: rgba(255,255,255,0.05);
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.1);
}

/* Section Titles */
.bf-section-title {
  font-weight: 600;
  font-size: 14px;
  color: #e6e9f0;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Overlay Controls Section */
.bf-overlay-section {
  margin-bottom: 20px;
  padding: 16px 20px;
  background: rgba(255,255,255,0.05);
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.bf-checklist {
  margin: 0;
  padding: 0;
}

.bf-dropdown-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 150px;
}

.bf-sublabel {
  font-size: 14px;
  font-weight: 600;
  color: #e6e9f0;
  margin: 0;
}

.bf-dropdown {
  min-width: 150px;
}

/* Dropdown option styling - darker text when selected */
.Select-control {
  background-color: rgba(255,255,255,0.1) !important;
  border: 1px solid rgba(255,255,255,0.2) !important;
  color: #e6e9f0 !important;
}

.Select-menu-outer {
  background-color: #2a2a2a !important;
  border: 1px solid rgba(255,255,255,0.2) !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
}

.Select-option {
  background-color: transparent !important;
  color: #e6e9f0 !important;
  padding: 8px 12px !important;
}

.Select-option:hover {
  background-color: rgba(255,255,255,0.1) !important;
  color: #ffffff !important;
}

.Select-option.is-selected {
  background-color: rgba(244, 143, 177, 0.3) !important;
  color: #ffffff !important;
  font-weight: 600 !important;
}

.Select-option.is-focused {
  background-color: rgba(255,255,255,0.15) !important;
  color: #ffffff !important;
}

.Select-placeholder {
  color: #888 !important;
}

.Select-input {
  color: #e6e9f0 !important;
}

.Select-value-label {
  color: #e6e9f0 !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .bf-controls {
    flex-direction: column;
    gap: 15px;
  }
  
  .bf-dropdown-group {
    min-width: 100%;
  }
}

/* App Shell Layout */
#app-shell {
    overflow: hidden !important;
    flex: 1 !important;
    min-height: 0 !important;
}

/* Sidebar Styling */
#sidebar {
    min-width: 0 !important;
    transition: width 0.2s ease !important;
}

/* Sidebar Toggle Button */
#sidebar-toggle {
    z-index: 1001 !important;
    right: -30px !important;
}

/* Main Content Area */
#main-content {
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
}

/* Routed Page Content */
#routed-page {
    flex: 1 !important;
    overflow: auto !important;
    min-height: 0 !important;
}

/* Sidebar States - Exactly 2 states */
#sidebar {
    width: 200px !important; /* Default expanded state */
    padding: 10px !important;
}

#sidebar.collapsed {
    width: 60px !important; /* Collapsed state - thin bar with icons */
    padding: 10px 5px !important; /* Reduced padding for narrow width */
}

/* Hide text labels when collapsed */
#sidebar.collapsed .sidebar-text {
    display: none !important;
}

/* Show emojis when collapsed */
#sidebar.collapsed .sidebar-emoji {
    font-size: 20px !important;
    text-align: center !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    #sidebar-toggle {
        right: -25px !important; /* Adjust button position for mobile */
    }
}

/* Mobile Swipeable Sidebar */
@media (max-width: 900px) {
    #app-shell {
        position: relative !important;
        overflow: hidden !important;
    }
    
    #sidebar {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        height: 100vh !important;
        width: min(75vw, 260px) !important;
        max-width: 260px !important;
        z-index: 1000 !important;
        transform: translateX(-100%) !important;
        transition: transform 0.3s ease !important;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.5) !important;
        background: #28284a !important;
        padding: 6px !important;
    }
    
    #sidebar.collapsed {
        width: min(75vw, 260px) !important;
        max-width: 260px !important;
        padding: 6px !important;
    }
    
    #sidebar.collapsed .sidebar-text {
        display: block !important;
    }
    
    #sidebar .nav-links {
        margin-top: 12px !important;
        gap: 4px !important;
    }
    
    #sidebar .sidebar-link {
        padding: 10px 16px !important;
        font-size: 16px !important;
        line-height: 1.3 !important;
        min-height: auto !important;
        height: auto !important;
        border-radius: 8px !important;
    }
    #sidebar .sidebar-link:hover {
        border-bottom: none !important;
        background-color: #3a3a5e !important;
        color: #FFF !important;
    }
    #sidebar .sidebar-link.active {
        border-bottom: none !important;
        background-color: #3a3a5e !important;
        color: #FFF !important;
    }
    
    #sidebar .sidebar-link .sidebar-text {
        font-size: 16px !important;
    }
    
    /* Sidebar visible state */
    body.mobile-sidebar-visible #sidebar {
        transform: translateX(0) !important;
    }
    
    /* Main content fills viewport when sidebar is hidden */
    #main-content {
        width: 100vw !important;
        margin-left: 0 !important;
    }
    
    /* Overlay backdrop when sidebar is open */
    body.mobile-sidebar-visible::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
        pointer-events: auto;
    }
    
    /* Sidebar toggle tab - MAXIMUM SPECIFICITY to override desktop rules */
    body #app-shell #sidebar #sidebar-toggle,
    body #sidebar-toggle,
    #app-shell #sidebar-toggle,
    .sidebar #sidebar-toggle,
    #sidebar-toggle.sidebar-toggle,
    #sidebar-toggle {
        position: fixed !important;
        top: 50% !important;
        left: 0 !important;
        right: auto !important;
        bottom: auto !important;
        transform: translateY(-50%) !important;
        width: 36px !important;
        height: 60px !important;
        margin: 0 !important;
        padding: 0 !important;
        background: #795EB6 !important;
        color: white !important;
        border-radius: 0 8px 8px 0 !important;
        box-shadow: 2px 0 8px rgba(0, 0, 0, 0.4) !important;
        z-index: 1003 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        font-size: 24px !important;
        font-weight: bold !important;
        cursor: pointer !important;
        transition: background 0.2s ease !important;
    }
    
    /* Hide toggle tab when sidebar is open */
    body.mobile-sidebar-visible #sidebar-toggle {
        opacity: 0 !important;
        pointer-events: none !important;
        transform: translateY(-50%) translateX(-50px) !important;
    }
    
    /* Active/pressed state */
    #sidebar-toggle:active {
        background: #8a6ec6 !important;
    }
}

/* === App Shell Layout === */
.app-shell {
    display: flex;
    flex: 1;
    min-height: 0;
    background: #0a0a12;
    color: #EEE;
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    overflow: hidden;
}

/* Prevent children from forcing app-shell taller */
.app-shell,
.sidebar,
.main-content,
.routed-page {
  min-height: 0;   /* critical in flexbox to allow shrinking */
}


/* === Sidebar (library sleek style: #28284a panel, #3a3a5e active) === */
.sidebar {
    width: 250px;
    background: #28284a;
    display: flex;
    flex-direction: column;
    padding: 12px;
    box-sizing: border-box;
    position: relative;
    transition: width 0.2s ease;
    overflow: hidden;
    flex-shrink: 0;
    min-height: 0;
    max-height: 100%;
}
.sidebar.collapsed {
    width: 60px;
    padding: 10px 5px;
}
.sidebar.collapsed .sidebar-text { display: none; }
.sidebar.collapsed .sidebar-link-avatar { display: none; }
.sidebar.collapsed .sidebar-emoji { font-size: 20px; text-align: center; }

.sidebar-toggle {
    position: absolute;
    top: 10px;
    right: -24px;
    width: 24px;
    height: 24px;
    border-radius: 12px;
    background: #795EB6;
    color: #EEE;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.35);
    user-select: none;
    font-weight: 700;
    z-index: 1001;
}

.nav-links {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 40px;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
}
.sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    text-decoration: none;
    color: #AAA;
    font-size: 16px;
    font-weight: 500;
    border-radius: 8px;
    transition: background-color 0.15s ease, color 0.15s ease;
    background-color: transparent;
    border: none;
}
.sidebar-link .sidebar-text {
    font-size: 16px;
    font-weight: 500;
}
.sidebar-link-avatar {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
}
.sidebar-link:hover {
    background-color: #3a3a5e;
    color: #FFF;
}
.sidebar-link.active {
    background-color: #3a3a5e;
    color: #FFF;
}

/* Indented sub-page under Profile (e.g. Example Profile - Chris) */
.sidebar-subnav {
    padding-left: 12px;
    margin-top: 0;
    margin-bottom: 0;
}
.sidebar-subnav .sidebar-sublink {
    font-size: 15px;
    padding: 8px 16px;
}

.sidebar-logout {
    margin: 8px 6px 4px;
    padding: 10px 16px;
    background: transparent;
    color: #AAA;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: background-color 0.15s ease, color 0.15s ease;
}
.sidebar-logout:hover {
    background-color: #3a3a5e;
    color: #FFF;
}
.sidebar-spacer { 
    display: none;
}
.sidebar-bottom-nav {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 8px 6px 4px;
    flex-shrink: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* Library directory breadcrumb in switch bar */
.library-directory-chain {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    min-width: 0;
    text-align: left;
}
.library-directory-chain-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    color: #AAA;
}
.library-directory-sep {
    color: #555;
    user-select: none;
    margin: 0 0.45em;
}
.library-directory-segment {
    color: #AAA;
    text-decoration: none;
    transition: color 0.15s ease;
}
a.library-directory-segment:hover {
    color: #FFF;
}
.library-directory-current {
    color: #EEE;
}
.library-nav-back-btn {
    flex-shrink: 0;
    min-width: 72px;
    font-size: 14px;
    padding: 8px 14px;
    font-weight: 500;
    color: #AAA;
    background-color: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.library-nav-back-btn:hover:not(:disabled) {
    color: #FFF;
    background-color: #3a3a5e;
}
.library-nav-back-btn:disabled {
    opacity: 0.35;
    cursor: default;
}

/* === Main Content Area === */
.main-content {
    flex: 1;
    min-height: 0;
    padding: 16px;
    box-sizing: border-box;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.routed-page {
    flex: 1;
    overflow: auto;
    min-height: 0; /* allow shrinking in flex */
}

/* === Responsive === */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        flex-direction: row;
        overflow-x: auto;
        min-height: auto;
    }
    .sidebar-toggle {
        right: -25px;
    }
    .main-content {
        padding: 12px;
    }
}

/* =========================
   GLOBAL + HEIGHT CONTRACT
   ========================= */

/* Eliminate default body scrollbars and margins */
html, body {
  height: 100vh;
  margin: 0;
  padding: 0;
  overflow: hidden;         /* page itself never scrolls */
  background: #0a0a12;
  display: flex;
  flex-direction: column;
}
*, *::before, *::after { box-sizing: border-box; }

/* Header height token (keeps math consistent) */
:root { --header-h: 80px; }

/* Header occupies fixed height equal to --header-h */
.boulderflow-title-header {
  height: var(--header-h);
  flex: 0 0 var(--header-h);
  display: flex;
  align-items: center;
  padding: 0 16px;
  box-sizing: border-box;
  /* (optional visual styles for your header can go here) */
}

/* App shell fills the rest of the viewport under the header */
.app-shell {
  display: flex;
  height: calc(100vh - var(--header-h));
  min-height: 0;           /* allow flex children to shrink */
  overflow: hidden;        /* internal panes manage their own scroll */
  background: #0a0a12;
  color: #EEE;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Critical: prevent any child from forcing extra page height */
.app-shell,
.sidebar,
.main-content,
.routed-page {
  min-height: 0;           /* flexbox shrink fix */
}

/* =========================
   SIDEBAR
   ========================= */
.sidebar {
  width: 250px;
  background: #111;
  display: flex;
  flex-direction: column;
  padding: 10px;
  position: relative;
  transition: width 0.2s ease;
  overflow-y: auto;        /* sidebar scrolls if it needs to */
  overflow-x: hidden;
}
.sidebar.collapsed { width: 60px; padding: 10px 5px; }
.sidebar.collapsed .sidebar-text { display: none; }
.sidebar.collapsed .sidebar-emoji { font-size: 20px; text-align: center; }

.sidebar-toggle {
  position: absolute;
  top: 10px;
  right: -24px;
  width: 24px;
  height: 24px;
  border-radius: 12px;
  background: #F48FB1;
  color: #0a0a12;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.35);
  user-select: none;
  font-weight: 700;
  z-index: 1001;
}

.nav-links { display: flex; flex-direction: column; gap: 6px; margin-top: 40px; }
/* Removed duplicate sidebar-link definition - using the one at line 1354 */

.sidebar-logout {
  margin: 8px 6px;
  padding: 8px 12px;
  background: transparent;
  color: #EEE;
  border: 1px solid #795EB6;
  border-radius: 6px;
  cursor: pointer;
}
.sidebar-spacer { flex: 1 1 auto; }

/* =========================
   MAIN CONTENT (SCROLL HOST)
   ========================= */
.main-content {
  flex: 1 1 auto;
  padding: 0px;
  display: flex;
  flex-direction: column;
  overflow: hidden;        /* only .routed-page scrolls */
  min-width: 0;            /* prevent overflow in flex rows */
  box-sizing: border-box;
}
.routed-page {
  flex: 1 1 auto;
  overflow: auto;          /* the ONLY vertical scroll container */
  min-height: 0;           /* allow shrink within app-shell height */
}

/* =========================
   RESPONSIVE
   ========================= */
@media (max-width: 768px) {
  .sidebar {
    width: 260px;
    max-width: 85vw;
    flex-direction: column;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 6px;
  }
  .nav-links {
    margin-top: 12px;
    gap: 4px;
  }
  .sidebar-link {
    padding: 10px 16px;
    font-size: 16px;
    line-height: 1.3;
    min-height: auto;
    height: auto;
    border-radius: 8px;
  }
  .sidebar-link:hover {
    border-bottom: none !important;
    background-color: #3a3a5e;
    color: #FFF;
  }
  .sidebar-link.active {
    border-bottom: none !important;
    background-color: #3a3a5e;
    color: #FFF;
  }
  .sidebar-link .sidebar-text {
    font-size: 16px;
  }
  .sidebar-toggle { right: -25px; }
  .main-content { padding: 12px; }
}

/* =========================
   PAGE ROOTS INSIDE ROUTER
   (override any old 100vh rules)
   ========================= */
.bf-root,
.profile-root {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  display: flex;
  flex-direction: column;
  /* keep your own paddings/backgrounds as needed */
}

/* =========================
   EXECUTION LIST HOVER EFFECTS
   ========================= */
/* Hover effect for execution list items */
[data-type="exec-item"]:hover {
  background-color: rgba(255, 255, 255, 0.1) !important;
  border-color: rgba(255, 255, 255, 0.3) !important;
  transform: translateX(2px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Smooth transition for hover effects */
[data-type="exec-item"] {
  transition: all 0.2s ease !important;
}

/* =========================
   MOTION TRACE OVERLAY
   ========================= */

/* Motion trace circles with glow effect */
.motion-trace-circle {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  z-index: 4;
  transition: opacity 0.1s ease;
}

/* Motion trace lines */
.motion-trace-line {
  position: absolute;
  pointer-events: none;
  z-index: 3;
  transition: opacity 0.1s ease;
}

/* =========================
   NOTES SECTION STYLING
   ========================= */

/* Notes Column */
.bf-notes-column {
  flex: 0 1 300px;
  max-width: 300px;
  color: white;
  overflow-y: auto;
  align-self: flex-start;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Trainer Notes Section */
.bf-trainer-notes-section {
  padding: 16px 20px;
  background: rgba(255,255,255,0.05);
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  flex: 0 0 auto;
}

.bf-trainer-notes-text {
  color: #e6e9f0;
  font-size: 14px;
  line-height: 1.5;
  margin: 0;
  padding: 0;
}

.bf-notes-placeholder {
  color: #888;
  font-style: italic;
  font-size: 14px;
  margin: 0;
  padding: 0;
}

/* User Notes Section */
.bf-user-notes-section {
  padding: 16px 20px;
  background: rgba(255,255,255,0.05);
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
}

/* Notes Header */
.bf-notes-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

/* Edit Notes Button */
.bf-edit-notes-btn {
  padding: 4px 12px;
  background: rgba(244, 143, 177, 0.2);
  color: #F48FB1;
  border: 1px solid #F48FB1;
  border-radius: 4px;
  font-weight: 500;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  flex: 0 0 auto;
}

.bf-edit-notes-btn:hover {
  background: rgba(244, 143, 177, 0.3);
  transform: translateY(-1px);
}

/* Cancel Notes Button */
.bf-cancel-notes-btn {
  padding: 4px 12px;
  background: rgba(255, 107, 107, 0.2);
  color: #ff6b6b;
  border: 1px solid #ff6b6b;
  border-radius: 4px;
  font-weight: 500;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  flex: 0 0 auto;
}

.bf-cancel-notes-btn:hover {
  background: rgba(255, 107, 107, 0.3);
  transform: translateY(-1px);
}

.bf-user-notes-content {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Notes Display (Read-only) */
.bf-notes-display {
  flex: 1 1 auto;
  min-height: 120px;
  padding: 12px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  overflow-y: auto;
}

.bf-user-notes-text {
  color: #e6e9f0;
  font-size: 14px;
  line-height: 1.5;
  margin: 0;
  padding: 0;
  white-space: pre-wrap;
}

/* User Notes Edit Section */
.bf-user-notes-edit {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Notes Textarea */
.bf-notes-textarea {
  width: 100%;
  min-height: 120px;
  padding: 12px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 8px;
  color: #e6e9f0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.4;
  resize: vertical;
  box-sizing: border-box;
}

.bf-notes-textarea:focus {
  outline: none;
  border-color: #F48FB1;
  box-shadow: 0 0 0 2px rgba(244, 143, 177, 0.2);
}

.bf-notes-textarea::placeholder {
  color: #888;
  font-style: italic;
}

/* Notes Actions */
.bf-notes-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  flex-wrap: wrap;
}

.bf-save-notes-btn {
  padding: 8px 16px;
  background: #F48FB1;
  color: #0a0a12;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  flex: 0 0 auto;
}

.bf-save-notes-btn:hover {
  background: #e67e9a;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(244, 143, 177, 0.3);
}

.bf-save-notes-btn:active {
  transform: translateY(0);
  box-shadow: 0 1px 4px rgba(244, 143, 177, 0.3);
}

.bf-notes-status {
  font-size: 12px;
  font-weight: 500;
  flex: 1 1 auto;
}

/* Responsive adjustments for notes */
@media (max-width: 1200px) {
  .bf-notes-column {
    flex: 0 1 250px;
    max-width: 250px;
  }
}

@media (max-width: 768px) {
  .bf-main-row {
    flex-direction: column;
    gap: 16px;
  }
  
  .bf-notes-column {
    flex: 0 0 auto;
    max-width: 100%;
    order: 3; /* Move notes to bottom on mobile */
  }
  
  .bf-notes-textarea {
    min-height: 100px;
  }
}


/* Hold Usage Page Styles */
.bf-hold-metrics-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 20px;
}

.hold-metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    padding: 20px;
}

.hold-metric-column {
    background: linear-gradient(135deg, #2a2a2a 0%, #1e1e1e 100%);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #444;
}

.hold-metric-column:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

.hold-type-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #444;
}

.hold-type-image {
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.hold-type-title {
    font-size: 18px;
    font-weight: 600;
    color: #fff;
    margin-top: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.limb-metric {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #333;
}

.limb-metric:last-child {
    border-bottom: none;
}

.limb-label {
    font-size: 14px;
    color: #aaa;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.metric-value {
    font-size: 20px;
    font-weight: 700;
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.bf-hold-summary-content {
    padding: 20px;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    padding: 20px;
}

.summary-item {
    background: linear-gradient(135deg, #2a2a2a 0%, #1e1e1e 100%);
    border-radius: 8px;
    padding: 15px;
    border: 1px solid #444;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.summary-label {
    font-size: 12px;
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.summary-value {
    font-size: 18px;
    font-weight: 600;
    color: #fff;
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.bf-placeholder {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 40px;
    background: #2a2a2a;
    border-radius: 8px;
    border: 1px solid #444;
}

/* Responsive design for hold metrics */
@media (max-width: 768px) {
    .hold-metrics-grid {
        grid-template-columns: 1fr;
        gap: 15px;
        padding: 10px;
    }
    
    .summary-grid {
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 10px;
    }
    
    .hold-metric-column {
        padding: 15px;
    }
    
    .hold-type-image {
        width: 50px;
        height: 50px;
    }
}

.sidebar-icon {
    border-radius: 4px;
    filter: brightness(0.8);
    transition: filter 0.2s ease;
}

.sidebar-icon:hover {
    filter: brightness(1.2);
}

/* Expandable Metric Sections */
.metric-sections-container {
    margin-top: 15px;
}

.metric-section {
    margin-bottom: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    overflow: hidden;
}

.metric-header {
    background-color: #444;
    padding: 10px 15px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.2s ease;
}

.metric-header:hover {
    background-color: #555;
}

.metric-header-label {
    font-size: 0.9em;
    font-weight: bold;
    color: #E0E0E0;
}

.metric-expand-icon {
    font-size: 0.8em;
    color: #A0A0A0;
    transition: transform 0.2s ease;
}

.metric-content {
    background-color: #333;
    padding: 15px;
}

.limb-subsection {
    margin-bottom: 15px;
}

.limb-subsection:last-child {
    margin-bottom: 0;
}

.limb-subsection-label {
    font-size: 0.8em;
    font-weight: bold;
    color: #B0B0B0;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.limb-sides-container {
    display: flex;
    gap: 15px;
}

.limb-side-metric {
    flex: 1;
    background-color: #2a2a2a;
    padding: 10px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.limb-side-label {
    font-size: 0.75em;
    color: #A0A0A0;
    margin-bottom: 5px;
    text-align: center;
}

.metric-value-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.metric-value {
    font-size: 1.1em;
    font-weight: bold;
    color: #E0E0E0;
}

.metric-arrow {
    font-size: 1.2em;
    font-weight: bold;
}

/* Arrow color coding */
.metric-arrow:contains("↗️") {
    color: #4CAF50; /* Green for higher values */
}

.metric-arrow:contains("↘️") {
    color: #F44336; /* Red for lower values */
}

.metric-arrow:contains("↔️") {
    color: #FFC107; /* Yellow for equal values */
}

/* Responsive adjustments for expandable sections */
@media (max-width: 768px) {
    .limb-sides-container {
        flex-direction: column;
        gap: 10px;
    }
    
    .metric-content {
        padding: 10px;
    }
    
    .limb-side-metric {
        padding: 8px;
    }
}


/* Main Metrics Display (Always Visible) */
.metric-main-header {
    background-color: #444;
    padding: 12px 15px;
    border-radius: 6px;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.metric-main-label {
    font-size: 0.9em;
    font-weight: bold;
    color: #E0E0E0;
    margin-bottom: 8px;
}

.main-metrics-container {
    display: flex;
    gap: 20px;
    flex: 1;
}

.limb-main-metric {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
}

.limb-main-label {
    font-size: 0.8em;
    color: #A0A0A0;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.metric-main-value {
    font-size: 1.3em;
    font-weight: bold;
    /* Color set dynamically by callback */
}

.metric-expand-button {
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 4px;
    background-color: #555;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
}

.metric-expand-button:hover {
    background-color: #666;
}

.metric-expand-icon {
    font-size: 0.8em;
    color: #A0A0A0;
    transition: transform 0.2s ease;
}

/* Responsive adjustments for main metrics */
@media (max-width: 768px) {
    .main-metrics-container {
        flex-direction: column;
        gap: 10px;
    }
    
    .metric-main-header {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .metric-expand-button {
        align-self: center;
    }
}


/* Updated Main Metrics Display - No Grey Box */
.metric-main-header {
    background-color: transparent;
    padding: 8px 0;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: none;
}

.metric-main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.metric-main-label {
    font-size: 0.9em;
    font-weight: bold;
    color: #E0E0E0;
    margin-bottom: 4px;
}

.main-metrics-container {
    display: flex;
    gap: 20px;
}

.limb-main-metric {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
}

.limb-main-label {
    font-size: 0.8em;
    color: #A0A0A0;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.metric-main-value {
    font-size: 1.3em;
    font-weight: bold;
    /* Color set dynamically by callback */
}

.metric-expand-button {
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 4px;
    background-color: #444;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    margin-left: 10px;
}

.metric-expand-button:hover {
    background-color: #555;
}

.metric-expand-icon {
    font-size: 0.9em;
    color: #A0A0A0;
    transition: transform 0.2s ease;
}

/* Remove the grey box from metric sections */
.metric-section {
    margin-bottom: 10px;
    border: none;
    border-radius: 0;
    overflow: visible;
}

/* Responsive adjustments for main metrics */
@media (max-width: 768px) {
    .main-metrics-container {
        flex-direction: column;
        gap: 10px;
    }
    
    .metric-main-header {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .metric-expand-button {
        align-self: center;
        margin-left: 0;
    }
}


/* Profile Tab Structure */
.profile-selector {
    margin-bottom: 20px;
    padding: 15px;
    background-color: #2a2a2a;
    border-radius: 8px;
}

.profile-tabs-container {
    margin-bottom: 20px;
}

.profile-tab {
    background-color: #333;
    color: #A0A0A0;
    border: 1px solid #555;
    border-radius: 6px 6px 0 0;
    padding: 12px 24px;
    margin-right: 5px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.profile-tab--selected {
    background-color: #444;
    color: #E0E0E0;
    border-bottom: 1px solid #444;
}

.profile-tab:hover {
    background-color: #3a3a3a;
    color: #C0C0C0;
}

.profile-tab-content {
    background-color: #2a2a2a;
    border-radius: 0 8px 8px 8px;
    padding: 20px;
    min-height: 400px;
}

.profile-subtitle {
    color: #E0E0E0;
    font-size: 1.5em;
    font-weight: bold;
    margin-bottom: 20px;
    text-align: center;
}

.hold-usage-content {
    background-color: transparent;
    padding: 0;
}

/* Responsive adjustments for tabs */
@media (max-width: 768px) {
    .profile-tab {
        padding: 10px 16px;
        font-size: 0.9em;
    }
    
    .profile-tab-content {
        padding: 15px;
    }
}


/* Sidebar Sub-link Styling */
.sidebar-sub-link {
.sidebar-sub-link {
    margin-left: 24px;
    padding: 8px 12px;
    border-radius: 6px;
    transition: all 0.2s ease;
    background-color: transparent;
}

.sidebar-sub-link:hover {
    background: rgba(255,255,255,0.05);
}

.sidebar-sub-link.active {
    background: rgba(255,255,255,0.08);
    color: #76C297;
}

.sidebar-sub-link .sidebar-text {
    font-size: 0.95em;
}


/* Hold Usage Page - Single Column Layout */
.bf-main-content {
    margin-top: 20px;
}


/* Simplified metric display without expandable sections */
.hold-metric-column {
    background-color: #2a2a2a;
    border-radius: 8px;
    padding: 15px;
    border: 1px solid #444;
    margin-bottom: 15px;
}

.hold-type-image {
    width: 40px;
    height: 40px;
    object-fit: contain;
    margin-bottom: 10px;
}

.hold-type-title {
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 15px;
    text-align: center;
}

.metric-display {
    margin-bottom: 20px;
}

.metric-label {
    color: #ccc;
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.metric-value {
    color: #fff;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.limb-split {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    padding: 8px;
    background-color: #333;
    border-radius: 4px;
    border: 1px solid #555;
}

.limb-side {
    display: flex;
    align-items: center;
    gap: 5px;
}

.limb-side-label {
    color: #ccc;
    font-size: 11px;
    font-weight: 500;
}

.limb-side-value {
    color: #fff;
    font-size: 13px;
    font-weight: 600;
}

.metric-arrow {
    font-size: 14px;
    font-weight: bold;
}

.arrow-up {
    color: #28a745;
}

.arrow-down {
    color: #dc3545;
}

.arrow-equal {
    color: #ffc107;
}


/* Inline Metric Display */
.metric-display-inline {
    margin-bottom: 15px;
    padding: 10px;
    background-color: #333;
    border-radius: 6px;
    border: 1px solid #555;
}

.metric-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.metric-header .metric-label {
    color: #ccc;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.metric-header .metric-value {
    color: #fff;
    font-size: 16px;
    font-weight: 600;
}

.metric-split-inline {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
}

.metric-split-inline .limb-side-label {
    color: #999;
    font-weight: 500;
}

.metric-split-inline .limb-side-value {
    color: #fff;
    font-weight: 600;
}

.metric-split-inline .metric-arrow {
    font-size: 14px;
    font-weight: bold;
    margin: 0 4px;
}

.arrow-up {
    color: #28a745;
}

.arrow-down {
    color: #dc3545;
}

.arrow-equal {
    color: #ffc107;
}


/* ==========================================
   Annotation System Styles
   ========================================== */

/* Annotation Section Container */
.bf-annotations-section {
    padding: 15px;
    background-color: #2a2a2a;
    border-radius: 8px;
    margin-top: 20px;
    border: 1px solid #444;
}

/* Annotation Header */
.bf-annotation-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

/* Annotation Toggle Button */
.bf-annotation-toggle {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.bf-annotation-toggle:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(52, 152, 219, 0.3);
}

.bf-annotation-toggle:active {
    transform: translateY(0);
}

/* Annotation Status */
.bf-annotation-status {
    padding: 5px 12px;
    background-color: #555;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 600;
    color: #ccc;
}

/* Annotation Tools Panel */
.bf-annotation-panel {
    margin-top: 15px;
    padding: 15px;
    background-color: #333;
    border-radius: 5px;
    border: 1px solid #555;
}

/* Annotation Tools Radio Items */
.bf-annotation-tools {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.bf-annotation-tools label {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    padding: 8px 12px;
    background-color: #444;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.bf-annotation-tools label:hover {
    background-color: #555;
}

.bf-annotation-tools input[type="radio"] {
    cursor: pointer;
}

.bf-annotation-tools input[type="radio"]:checked + label {
    background-color: #3498db;
    color: white;
}

/* Frame Range Section */
.bf-frame-range-section {
    margin: 15px 0;
}

.bf-frame-range-slider {
    width: 100%;
    margin-top: 10px;
}

.bf-frame-range-slider .rc-slider-track {
    background-color: #3498db;
}

.bf-frame-range-slider .rc-slider-handle {
    border-color: #3498db;
    background-color: #3498db;
}

/* Color Picker Section */
.bf-color-picker-section {
    margin: 15px 0;
}

/* Annotation Note Input */
.bf-annotation-note-section {
    margin: 15px 0;
}

.bf-annotation-note-input {
    width: 100%;
    padding: 8px 12px;
    background-color: #444;
    border: 1px solid #666;
    border-radius: 4px;
    color: #e6e9f0;
    font-size: 14px;
}

.bf-annotation-note-input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 5px rgba(52, 152, 219, 0.3);
}

/* Annotation Actions */
.bf-annotation-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.bf-save-annotation-btn {
    flex: 1;
    background-color: #27ae60;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.bf-save-annotation-btn:hover {
    background-color: #229954;
    transform: translateY(-2px);
}

.bf-cancel-annotation-btn {
    flex: 1;
    background-color: #e74c3c;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.bf-cancel-annotation-btn:hover {
    background-color: #c0392b;
    transform: translateY(-2px);
}

/* Annotations List Section */
.bf-annotations-list-section {
    margin-top: 20px;
}

.bf-annotations-list {
    max-height: 300px;
    overflow-y: auto;
    margin-top: 10px;
    padding-right: 5px;
}

/* Custom scrollbar for annotations list (uses global scrollbar colors) */
.bf-annotations-list::-webkit-scrollbar {
    width: 10px;
}

.bf-annotations-list::-webkit-scrollbar-track {
    background: #1a1a2e;
    border-radius: 5px;
}

.bf-annotations-list::-webkit-scrollbar-thumb {
    background: #795EB6;
    border-radius: 5px;
    border: 2px solid #1a1a2e;
}

.bf-annotations-list::-webkit-scrollbar-thumb:hover {
    background: #8B6FC7;
}

/* Annotation List Item */
.anno-item {
    padding: 12px;
    background-color: #444;
    border-radius: 5px;
    margin-bottom: 10px;
    border-left: 4px solid transparent;
    transition: all 0.3s ease;
    position: relative;
}

.anno-item:hover {
    background-color: #4a4a4a;
    transform: translateX(2px);
}

.anno-item.anno-active {
    background-color: #4a4a4a;
    border-left-color: #3498db;
    box-shadow: 0 0 10px rgba(52, 152, 219, 0.2);
}

/* Edit mode: yellow border */
.anno-item.anno-editing {
    border: 3px solid #F1C40F !important;  /* Yellow border for edit mode */
    border-left: 3px solid #F1C40F !important;
    box-shadow: 0 0 15px rgba(241, 196, 15, 0.4);
}

/* Save flash: blue border animation */
.anno-item.anno-saved {
    border: 3px solid #3498db !important;  /* Blue border flash on save */
    border-left: 3px solid #3498db !important;
    box-shadow: 0 0 20px rgba(52, 152, 219, 0.6);
    animation: saveFlash 0.5s ease-out;
}

@keyframes saveFlash {
    0% {
        border-color: #3498db;
        box-shadow: 0 0 20px rgba(52, 152, 219, 0.8);
    }
    100% {
        border-color: #F1C40F;  /* Return to yellow edit mode */
        box-shadow: 0 0 15px rgba(241, 196, 15, 0.4);
    }
}

/* Annotation Item Header */
.anno-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    flex-wrap: wrap;
    gap: 8px;
}

.anno-type {
    font-weight: bold;
    font-size: 14px;
    color: #e6e9f0;
    text-transform: capitalize;
}

.anno-frames {
    font-size: 12px;
    color: #aaa;
    background-color: #555;
    padding: 2px 8px;
    border-radius: 3px;
}

.anno-color-indicator {
    font-size: 20px;
    margin-left: auto;
}

/* Annotation Note */
.anno-note {
    font-size: 13px;
    color: #ccc;
    margin: 5px 0;
    font-style: italic;
}

/* Annotation Delete Button */
.anno-delete-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    opacity: 0.5;
    transition: opacity 0.3s;
    padding: 4px;
}

.anno-delete-btn:hover {
    opacity: 1;
    transform: scale(1.1);
}

/* Video Wrapper Annotation Mode */
.video-wrapper-annotation-mode {
    cursor: crosshair !important;
}

#video-wrapper.video-wrapper-annotation-mode,
#projects-video-wrapper.video-wrapper-annotation-mode {
    cursor: crosshair !important;
}

/* Temporary Annotation Preview Elements */
.temp-annotation-element {
    position: absolute;
    pointer-events: none;
    z-index: 9999;
}

.temp-annotation-line {
    background-color: rgba(255, 87, 51, 0.6);
    pointer-events: none;
    z-index: 9999;
}

/* SVG Annotation Styles */
.annotation-arrow,
.annotation-line,
.annotation-circle,
.annotation-text {
    pointer-events: none;
    transition: opacity 0.3s;
}

/* Annotation Creator Badge */
.anno-creator-badge {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: 600;
    text-transform: uppercase;
}

.anno-creator-badge.trainer {
    background-color: #9b59b6;
    color: white;
}

.anno-creator-badge.user {
    background-color: #3498db;
    color: white;
}

/* Responsive adjustments */
@media (max-width: 1200px) {
    .bf-annotation-tools {
        flex-direction: column;
    }
    
    .bf-annotations-list {
        max-height: 200px;
    }
}


/* Time Range Display */
.bf-time-range-display {
    margin-top: 8px;
    padding: 5px 10px;
    background-color: #444;
    border-radius: 4px;
    font-size: 12px;
    color: #aaa;
    text-align: center;
}

.bf-time-range-slider {
    width: 100%;
    margin-top: 10px;
}


/* Duration Controls */
.bf-duration-section {
    margin: 15px 0;
}

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

.duration-btn {
    width: 32px;
    height: 32px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.duration-btn:hover {
    background-color: #2980b9;
    transform: scale(1.1);
}

.duration-btn:active {
    transform: scale(0.95);
}

.bf-duration-input {
    flex: 1;
    padding: 8px 12px;
    background-color: #444;
    border: 1px solid #666;
    border-radius: 4px;
    color: #e6e9f0;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
}

.bf-duration-input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 5px rgba(52, 152, 219, 0.3);
}

.bf-duration-info {
    margin-top: 8px;
    font-size: 12px;
    color: #aaa;
    text-align: center;
}

.duration-value {
    color: #3498db;
    font-weight: 600;
}


/* Coordinate Controls */
.bf-coords-section {
    margin: 15px 0;
    padding: 10px;
    background-color: #3a3a3a;
    border-radius: 5px;
}

.coords-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-top: 8px;
}

.coord-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.coord-input {
    padding: 6px 8px;
    background-color: #444;
    border: 1px solid #666;
    border-radius: 4px;
    color: #e6e9f0;
    font-size: 14px;
    text-align: center;
}

.coord-input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 5px rgba(52, 152, 219, 0.3);
}

.bf-quick-annotate-section {
    margin: 15px 0;
}

.bf-quick-annotate-btn {
    width: 100%;
    background-color: #9b59b6;
    color: white;
    border: none;
    padding: 12px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.bf-quick-annotate-btn:hover {
    background-color: #8e44ad;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(155, 89, 182, 0.3);
}


/* Annotation Mode Visual Indicators */
.annotation-mode-active .bf-overlay {
    border: 3px dashed #3498db;
    box-shadow: 0 0 20px rgba(52, 152, 219, 0.5);
}

.annotation-mode-active {
    position: relative;
}

.annotation-mode-active::after {
    content: "🎨 DRAWING MODE - Click & Drag on Overlay";
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #3498db;
    color: white;
    padding: 5px 15px;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 600;
    z-index: 1000;
    white-space: nowrap;
}

.bf-drawing-info {
    margin: 10px 0;
    padding: 10px;
    background-color: #3a3a3a;
    border-radius: 5px;
}

.bf-drawing-instruction {
    font-size: 13px;
    color: #3498db;
    margin: 0 0 5px 0;
    font-weight: 600;
}

.bf-drawing-status {
    font-size: 12px;
    color: #aaa;
    margin: 0;
    font-style: italic;
}

/* ------------------------------
   Annotation Capture Layer (for drawing)
   ------------------------------ */
#annotation-wrapper,
#projects-annotation-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;  /* Default: disabled, enabled only in annotation mode */
    z-index: 3;  /* Above video (z:1) and pose overlay (z:2), below annotations (z:5) */
    cursor: crosshair;
    background: transparent;  /* Ensure it doesn't block visibility */
    /* Use clip-path to exclude bottom 50px where video controls are */
    clip-path: inset(0 0 50px 0);
}

#annotation-wrapper.annotation-mode-active,
#projects-annotation-wrapper.annotation-mode-active {
    pointer-events: auto;
    background: transparent;  /* Still transparent even when active */
}

/* ------------------------------
   Annotation Overlay Interaction (for rendered annotations)
   ------------------------------ */
.bf-annotation-wrapper {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;  /* Annotations themselves don't capture events */
    z-index: 4;  /* Above capture layer but below handles */
    /* Use clip-path to exclude bottom 50px where video controls are */
    clip-path: inset(0 0 50px 0);
}

.bf-annotation-wrapper .bf-annotation-shape {
    pointer-events: auto;
    transition: box-shadow 0.15s ease, opacity 0.15s ease;
}

.bf-annotation-wrapper .bf-annotation-handle {
    display: none;
    border: 2px solid currentColor;
    background: rgba(10, 10, 20, 0.65);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35);
    opacity: 0;
    cursor: pointer;
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.bf-annotation-wrapper.annotation-active .bf-annotation-handle {
    display: block;
    pointer-events: auto;
    opacity: 0.9;
    transform: translate(-50%, -50%) scale(1.05);
}

.bf-annotation-wrapper.annotation-active .bf-annotation-handle:hover {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.2);
}

.bf-annotation-wrapper.annotation-active .bf-annotation-shape {
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.25);
}



/* =========================
   Tag Suggestion Dropdown
   ========================= */
.tag-suggestion-item {
    transition: background-color 0.2s ease;
    position: relative;
}

/* First item (highlighted by default) */
.tag-suggestion-item[data-highlighted="true"] {
    background-color: rgba(74, 144, 226, 0.3) !important;
    color: #FFF !important;
}

/* Hover on highlighted item */
.tag-suggestion-item[data-highlighted="true"]:hover {
    background-color: rgba(74, 144, 226, 0.5) !important;
}

/* Hover on any item */
.tag-suggestion-item:hover {
    background-color: rgba(74, 144, 226, 0.4) !important;
    color: #FFF !important;
}

/* Custom scrollbar for tag dropdown */
#edit-meta-tags-dropdown::-webkit-scrollbar {
    width: 10px;
}

#edit-meta-tags-dropdown::-webkit-scrollbar-track {
    background: #1a1a2e;
    border-radius: 5px;
}

#edit-meta-tags-dropdown::-webkit-scrollbar-thumb {
    background: #795EB6;
    border-radius: 5px;
    border: 2px solid #1a1a2e;
}

#edit-meta-tags-dropdown::-webkit-scrollbar-thumb:hover {
    background: #8B6FC7;
}

/* =========================
   Forum Page Styles
   ========================= */
/* Avatar tag on forum posts (circle + @username) */
.forum-post-avatar-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #444;
    padding: 2px 8px 2px 2px;
    border-radius: 999px;
}

.forum-category-item:hover {
    background-color: #252540 !important;
    border-color: #795EB6 !important;
}

.forum-category-item.active {
    background-color: #795EB6 !important;
    border-color: #795EB6 !important;
    color: #FFF !important;
}

#forum-submit-reply:hover {
    background-color: #8B6FC7 !important;
}

#forum-submit-reply:active {
    background-color: #6B4E96 !important;
}

/* Tag checkbox labels hover */
label[for^="tag-"]:hover {
    background-color: #1a1a2e !important;
}

/* Textarea focus */
#forum-reply-text:focus {
    outline: none;
    border-color: #795EB6 !important;
    box-shadow: 0 0 0 2px rgba(121, 94, 182, 0.2);
}

#edit-meta-tags-dropdown::-webkit-scrollbar {
    width: 10px;
}

#edit-meta-tags-dropdown::-webkit-scrollbar-track {
    background: #1a1a2e;
    border-radius: 5px;
}

#edit-meta-tags-dropdown::-webkit-scrollbar-thumb {
    background: #795EB6;
    border-radius: 5px;
    border: 2px solid #1a1a2e;
}

#edit-meta-tags-dropdown::-webkit-scrollbar-thumb:hover {
    background: #8B6FC7;
}

/* =========================
   Forum Page Styles
   ========================= */
/* Avatar tag on forum posts (circle + @username) */
.forum-post-avatar-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #444;
    padding: 2px 8px 2px 2px;
    border-radius: 999px;
}

.forum-category-item:hover {
    background-color: #252540 !important;
    border-color: #795EB6 !important;
}

.forum-category-item.active {
    background-color: #795EB6 !important;
    border-color: #795EB6 !important;
    color: #FFF !important;
}

#forum-submit-reply:hover {
    background-color: #8B6FC7 !important;
}

#forum-submit-reply:active {
    background-color: #6B4E96 !important;
}

/* Tag checkbox labels hover */
label[for^="tag-"]:hover {
    background-color: #1a1a2e !important;
}

/* Textarea focus */
#forum-reply-text:focus {
    outline: none;
    border-color: #795EB6 !important;
    box-shadow: 0 0 0 2px rgba(121, 94, 182, 0.2);
}





/* Custom scrollbar for tag dropdown */
#edit-meta-tags-dropdown::-webkit-scrollbar {
    width: 10px;
}

#edit-meta-tags-dropdown::-webkit-scrollbar-track {
    background: #1a1a2e;
    border-radius: 5px;
}

#edit-meta-tags-dropdown::-webkit-scrollbar-thumb {
    background: #795EB6;
    border-radius: 5px;
    border: 2px solid #1a1a2e;
}

#edit-meta-tags-dropdown::-webkit-scrollbar-thumb:hover {
    background: #8B6FC7;
}

/* =========================
   Forum Page Styles
   ========================= */
/* Avatar tag on forum posts (circle + @username) */
.forum-post-avatar-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #444;
    padding: 2px 8px 2px 2px;
    border-radius: 999px;
}

.forum-category-item:hover {
    background-color: #252540 !important;
    border-color: #795EB6 !important;
}

.forum-category-item.active {
    background-color: #795EB6 !important;
    border-color: #795EB6 !important;
    color: #FFF !important;
}

#forum-submit-reply:hover {
    background-color: #8B6FC7 !important;
}

#forum-submit-reply:active {
    background-color: #6B4E96 !important;
}

/* Tag checkbox labels hover */
label[for^="tag-"]:hover {
    background-color: #1a1a2e !important;
}

/* Textarea focus */
#forum-reply-text:focus {
    outline: none;
    border-color: #795EB6 !important;
    box-shadow: 0 0 0 2px rgba(121, 94, 182, 0.2);
}

/* =========================
   iOS Safari URL Bar Safe Area Fix
   Ensures video controls are not covered by URL bar
   ========================= */

@supports (-webkit-touch-callout: none) {
    /* iOS-specific: Reduce video height to make room for URL bar */
    @media (max-width: 768px) {
        /* Reduce max video height significantly on mobile iOS */
        .bf-video-wrapper,
        .video-wrapper {
            max-height: calc(100vh - 200px) !important;
        }
        
        .bf-video,
        .video-element,
        video {
            max-height: calc(100vh - 200px) !important;
        }
        
        /* Add bottom padding to page content */
        .routed-page {
            padding-bottom: 120px !important;
        }
        
        /* Ensure video containers don't overflow */
        .bf-video-wrapper {
            margin-bottom: 80px !important;
        }
    }
}
}

/* ============================================================================
   Profile Page Redesign - Basic Analytics & Clear Sections
   ============================================================================ */

.profile-root-redesigned {
    font-family: "Inter", -apple-system, sans-serif;
    color: #E0E0E0;
    width: 100%;
    max-width: 100%;
    min-width: 0;           /* allow shrink in flex */
    box-sizing: border-box;
    overflow-x: hidden;
}

.profile-page-title {
    color: #F0F0F0;
    font-size: 2.2em;
    font-weight: 600;
    margin-bottom: 30px;
    letter-spacing: -0.5px;
}

/* Profile Cards */
.profile-card {
    background: #28284a;
    border-radius: 16px;
    padding: 24px 32px;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Quick Stats */
.profile-quick-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.profile-quick-card {
    background: #1a1a2e;
    border: 1px solid #252540;
    border-radius: 12px;
    padding: 14px;
}

.profile-quick-label {
    color: #AAA;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.profile-quick-value {
    color: #EEE;
    font-size: 20px;
    font-weight: 700;
    margin-top: 6px;
}

/* Two-column layout for patterns */
.profile-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.profile-donut-column {
    display: flex;
    flex-direction: column;
    align-items: flex-start; /* Align to start for consistent positioning */
    gap: 5px; /* Match the marginTop spacing */
}

/* Pill rows */
.profile-pill-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.profile-pill {
    background: #0a0a12;
    border: 1px solid #252540;
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 12px;
    color: #EEE;
    display: inline-flex;
    align-items: center;
}

.profile-pill .count {
    color: #AAA;
    margin-left: 6px;
}

.profile-card-placeholder {
    opacity: 0.7;
}

.profile-card-collapsed {
    cursor: pointer;
}

.profile-card-collapsed summary {
    cursor: pointer;
    user-select: none;
}

/* Section Titles */
.profile-section-title {
    color: #F0F0F0;
    font-size: 1.5em;
    font-weight: 600;
    margin: 0 0 8px 0;
    letter-spacing: -0.3px;
}

.profile-section-title-collapsible {
    color: #F0F0F0;
    font-size: 1.5em;
    font-weight: 600;
    margin: 0;
    padding: 0;
    letter-spacing: -0.3px;
    list-style: none;
}

.profile-section-title-collapsible::-webkit-details-marker {
    display: none;
}

.profile-section-subtitle {
    color: #A0A0A0;
    font-size: 0.95em;
    margin-bottom: 4px;
}

.profile-subsection-title {
    color: #D0D0D0;
    font-size: 1.1em;
    font-weight: 500;
    margin-bottom: 6px;
}

/* Filter Section */
.profile-filter-section {
    display: flex;
    justify-content: flex-start; /* Left align instead of space-between */
    align-items: center;
    gap: 20px;
    margin-bottom: 16px;
    padding: 0;
    background: transparent;
    border: none;
    flex-wrap: wrap; /* Allow wrapping on smaller screens */
}

.profile-filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.profile-filter-label {
    font-size: 0.7em;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    font-weight: 500;
}

.profile-filter-strip {
    display: flex !important;
    background: transparent;
    border-radius: 0;
    padding: 0;
    border: none;
    gap: 4px;
    width: fit-content;
}

.profile-filter-strip label {
    margin: 0 !important;
    padding: 0 !important;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s ease;
    display: flex !important;
    align-items: center;
    justify-content: center;
}

.profile-filter-strip label span {
    padding: 6px 14px;
    border-radius: 4px;
    font-size: 0.85em;
    color: #AAA;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1a1a2e;
    border: 1px solid #333;
    min-width: 70px;
    text-align: center;
    line-height: 1;
}


.profile-filter-strip label:hover span {
    color: #FFF;
    background: #28284a;
}

.profile-filter-strip input[type="radio"] {
    display: none !important;
}

.profile-filter-strip input[type="radio"]:checked + span {
    background: #795EB6 !important;
    color: #FFF !important;
    font-weight: 500;
}

.profile-climbers-like-me-btn {
    padding: 6px 14px;
    font-size: 0.85em;
    color: #AAA;
    background: #1a1a2e;
    border: 1px solid #333;
    border-radius: 4px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
}
.profile-climbers-like-me-btn:hover {
    color: #FFF;
    background: #28284a;
}

.profile-tag-dropdown {
    min-width: 150px;
    max-width: 180px;
}

.profile-tag-dropdown .Select-control {
    background-color: #1a1a2e !important;
    border: 1px solid #333 !important;
    border-radius: 4px !important;
    min-height: 32px !important;
    height: 32px !important;
}

.profile-tag-dropdown .Select-value-label, 
.profile-tag-dropdown .Select-placeholder {
    color: #EEE !important;
    font-size: 0.85em !important;
    line-height: 32px !important;
}

.profile-tag-dropdown .Select-menu-outer {
    background-color: #1a1a2e !important;
    border: 1px solid #333 !important;
    border-radius: 8px !important;
    margin-top: 5px !important;
}

.profile-tag-dropdown .VirtualizedSelectFocusedOption {
    background-color: #795EB6 !important;
    color: #FFF !important;
}

/* Identity Section */
.profile-username {
    font-size: 1.8em;
    font-weight: 600;
    color: #F0F0F0;
    margin-bottom: 4px;
}

.profile-bio {
    color: #B0B0B0;
    font-size: 1em;
    line-height: 1.6;
}

/* Avatar: circular frame, default = initial letter */
.avatar-circle {
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.avatar-initial {
    background: rgba(121, 94, 182, 0.4);
    color: #EEE;
    font-weight: 600;
    border: 2px solid rgba(121, 94, 182, 0.6);
}
.avatar-initial-letter {
    user-select: none;
    line-height: 1;
}
.avatar-img img {
    display: block;
}

/* Summary Text */
.profile-summary-text {
    color: #C0C0C0;
    font-size: 1.05em;
    line-height: 1.7;
    margin-bottom: 8px;
}

/* Tags Container & Bars */
.profile-tags-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Donut Chart Container */
.profile-chart-list {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.profile-donut-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 250px;
}

/* Donut charts: legend not scrollable, show all labels (all layouts) */
#profile-patterns-hold-types .legend,
#profile-patterns-disciplines .legend,
#profile-patterns-hold-types .legend .scrollbox,
#profile-patterns-disciplines .legend .scrollbox,
#profile-patterns-hold-types .infolayer .legend,
#profile-patterns-disciplines .infolayer .legend {
    overflow-y: visible !important;
    overflow-x: visible !important;
    max-height: none !important;
    overflow: visible !important;
    clip-path: none !important;
}

/* Remove clip-path from legend scrollbox (Plotly sets it via attribute) */
#profile-patterns-hold-types .legend [clip-path],
#profile-patterns-disciplines .legend [clip-path],
#profile-patterns-hold-types g.scrollbox,
#profile-patterns-disciplines g.scrollbox {
    clip-path: none !important;
}

/* Mobile: ensure donut legend never scrolls, show all items */
@media (max-width: 900px) {
    #profile-patterns-hold-types .legend,
    #profile-patterns-disciplines .legend,
    #profile-patterns-hold-types .legend .scrollbox,
    #profile-patterns-disciplines .legend .scrollbox,
    #profile-patterns-hold-types .infolayer g.legend,
    #profile-patterns-disciplines .infolayer g.legend,
    #profile-patterns-hold-types g.scrollbox,
    #profile-patterns-disciplines g.scrollbox {
        overflow: visible !important;
        max-height: none !important;
        clip-path: none !important;
    }
    /* Fallback: any legend inside profile donut column (in case ID is on wrapper) */
    .profile-donut-column .legend,
    .profile-donut-column g.scrollbox,
    .profile-donut-column [class*="legend"] {
        overflow: visible !important;
        max-height: none !important;
        clip-path: none !important;
    }
    /* Hide scrollbar if Plotly still renders one */
    #profile-patterns-hold-types .legend rect.scrollbar,
    #profile-patterns-disciplines .legend rect.scrollbar,
    .profile-donut-column .legend rect.scrollbar {
        display: none !important;
    }
}

.mini-bar-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.mini-bar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.95em;
}

.mini-bar-label {
    color: #E0E0E0;
    font-weight: 500;
}

.mini-bar-count {
    color: #A0A0A0;
    font-size: 0.9em;
}

.mini-bar-bg {
    height: 8px;
    background: #1a1a2e;
    border-radius: 4px;
    overflow: hidden;
}

/* Grades Container - Vertical Histogram */
.profile-grades-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.grade-histogram-wrapper {
    display: flex;
    position: relative;
    width: 100%;
}

.grade-y-axis {
    position: relative;
    width: 35px;
    height: 360px;
    margin-right: 10px;
    flex-shrink: 0;
}

.grade-y-axis-tick {
    position: absolute;
    right: 5px;
    font-size: 0.75em;
    color: #999;
    transform: translateY(50%);
    white-space: nowrap;
}

.grade-histogram {
    display: flex;
    align-items: flex-end; /* Bars start from bottom */
    gap: 8px;
    height: 360px; /* Doubled height for taller bars */
    padding-bottom: 5px; /* Space between labels and axis */
    flex: 1;
}

.grade-bar-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end; /* Push bar and count to the bottom */
    flex: 1; /* Distribute bars evenly */
    height: 100%;
    position: relative;
    transition: transform 0.2s ease;
}

.grade-bar-wrapper:hover {
    transform: translateY(-2px);
}

.grade-bar-wrapper.grade-bar-selected {
    transform: scale(1.05);
}

.grade-bar-fill {
    width: 80%; /* Width of each bar */
    background-color: #795EB6;
    border-radius: 4px 4px 0 0; /* Rounded top corners */
    transition: height 0.3s ease; /* Smooth height transitions */
    min-height: 2px; /* Smallest visible bar */
}

.grade-bar-count {
    position: absolute;
    top: -18px; /* Position above the bar */
    font-size: 0.75em;
    color: #AAA;
    white-space: nowrap;
}

.grade-bar-label {
    font-size: 0.8em;
    color: #F0F0F0;
    font-weight: 500;
    margin-top: 5px; /* Space between bar and label */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* Mobile: bar chart full width, 50% height of desktop (180px), y-axis same space */
@media (max-width: 768px) {
    .profile-grades-container {
        min-height: 220px;  /* Room for 180px chart + axis labels */
        height: auto !important;
    }
    .grade-histogram-wrapper {
        width: 100%;
        min-width: 0;
    }
    .grade-y-axis {
        height: 180px;  /* 50% of desktop 360px */
        flex-shrink: 0;
    }
    .grade-histogram {
        height: 180px;  /* 50% of desktop 360px */
        gap: 6px;
        flex: 1;
        min-width: 0;
    }
    .grade-bar-label,
    .grade-bar-count {
        font-size: 0.7em;
    }
}

/* Environment Pills */
.profile-env-container {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.pill {
    background: #795EB6;
    color: #FFFFFF;
    padding: 8px 16px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95em;
}

.pill-label {
    font-weight: 500;
}

.pill-count {
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.9em;
}

/* Empty States */
.profile-empty-state {
    color: #A0A0A0;
    font-size: 1em;
    text-align: center;
    padding: 40px 20px;
}

.profile-empty-text {
    color: #808080;
    font-size: 0.95em;
    font-style: italic;
}

.profile-placeholder-text {
    color: #A0A0A0;
    font-size: 1em;
    line-height: 1.6;
    margin: 8px 0;
}

/* Links */
.profile-link {
    color: #795EB6;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.profile-link:hover {
    color: #8B6FC7;
    text-decoration: underline;
}

/* Tablet Responsiveness */
@media (max-width: 1024px) {
    .profile-filter-section {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        width: 100%;
    }
    
    .profile-filter-group {
        display: grid;
        grid-template-columns: auto 1fr; /* Label column (auto width) + control column (flexible) */
        gap: 8px;
        align-items: center;
        width: 100%;
    }
    
    .profile-filter-label {
        text-align: right; /* Right-align labels */
        justify-self: end; /* Ensure labels align to the right of their column */
    }
    
    .profile-filter-strip,
    .profile-tag-dropdown,
    .profile-grade-dropdown {
        justify-self: start; /* Left-align controls to the start of their column */
    }
    
    .profile-2col {
        gap: 20px;
    }
}

/* Mobile Responsiveness - Profile Overview (match other pages) */
@media (max-width: 900px) {
    /* Constrain profile page to viewport like bb-responsive does for #routed-page */
    #routed-page:has(.profile-root-redesigned) {
        max-width: 100vw !important;
        overflow-x: hidden !important;
        width: 100% !important;
        min-width: 0 !important;
    }
    
    .profile-root-redesigned {
        padding: 16px 12px !important;
        max-width: 100% !important;
        width: 100% !important;
        min-width: 0 !important;
        overflow-x: hidden !important;
        box-sizing: border-box !important;
    }
    
    .profile-card {
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
    }
    
    /* Allow graphs and fixed-width children to shrink */
    .profile-root-redesigned .js-plotly-plot,
    .profile-root-redesigned .plotly,
    .profile-donut-column .js-plotly-plot {
        max-width: 100% !important;
        width: 100% !important;
    }
    
    .profile-main-row {
        flex-direction: column;
        min-width: 0;
    }
    
    .profile-metrics-plot,
    .profile-gauge-panel {
        max-width: 100%;
        min-width: 0;
    }
}

@media (max-width: 768px) {
    .profile-root-redesigned {
        padding: 20px 16px !important;
    }
    
    .profile-card {
        padding: 20px;
    }

    .profile-quick-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .profile-2col {
        grid-template-columns: 1fr;  /* Donuts stack underneath */
    }

    /* Advanced Analytics card: content area participates in flex so row can center radial */
    .profile-analytics-content {
        display: flex;
        flex-direction: column;
        min-height: 560px;
    }
    .profile-main-row {
        flex: 1;
        align-items: center;
        justify-content: center;
        min-height: 520px;
    }
    .profile-analytics-gauge-wrapper {
        flex: 0 0 auto !important;
    }
    .profile-metrics-plot {
        margin: auto 0;
    }
    /* Plotly graph container: ensure it doesn't add extra offset */
    .profile-metrics-plot .js-plotly-plot,
    .profile-metrics-plot .plotly {
        margin: 0 auto;
    }
    
    .profile-filter-section {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        width: 100%;
    }
    
    .profile-filter-group {
        display: grid;
        grid-template-columns: auto 1fr; /* Label column (auto width) + control column (flexible) */
        gap: 8px;
        align-items: center;
        width: 100%;
    }
    
    .profile-filter-label {
        text-align: right; /* Right-align labels */
        justify-self: end; /* Ensure labels align to the right of their column */
    }
    
    .profile-filter-strip,
    .profile-tag-dropdown,
    .profile-grade-dropdown {
        justify-self: start; /* Left-align controls to the start of their column */
    }
    
    /* Time range buttons: fit text, wrap below if they don't fit */
    .profile-filter-strip {
        flex-wrap: wrap !important;
        width: 100% !important;
        max-width: 100% !important;
        gap: 8px !important;
    }
    .profile-filter-strip label span {
        min-width: 0 !important;
        width: auto !important;
        padding: 6px 12px !important;
    }
    
    /* Donut charts: stacked underneath, scale to fit width */
    .profile-donut-column {
        max-width: 100%;
        width: 100%;
    }
    .profile-donut-column .js-plotly-plot,
    .profile-donut-column .plotly {
        width: 100% !important;
        max-width: 100% !important;
    }
    .profile-donut-column .svg-container {
        width: 100% !important;
        max-width: 100% !important;
    }
    
    .profile-page-title {
        font-size: 1.8em;
    }
    
    .profile-username {
        font-size: 1.5em;
    }
    
    .profile-section-title {
        font-size: 1.3em;
    }
    
    .profile-grades-container {
        gap: 8px;
    }
    
    .grade-item {
        padding: 6px 12px;
    }
    
    .pill {
        padding: 6px 12px;
    }
}

/* Projects v2: View block buttons and Gallery */
/* Surface nav: instant Library / Logbook bar visibility (no server round-trip flash) */
#library-switch-bar-wrap,
#logbook-switch-bar-wrap {
    display: none !important;
    padding: 20px 20px 0 20px;
    flex-shrink: 0;
    box-sizing: border-box;
}

html[data-bf-surface="library"] #library-switch-bar-wrap {
    display: block !important;
}

html[data-bf-surface="logbook"] #logbook-switch-bar-wrap {
    display: block !important;
}

.bf-surface-toolbar--library,
.bf-surface-toolbar--logbook {
    display: none !important;
}

html[data-bf-surface="library"] .bf-surface-toolbar--library {
    display: block !important;
}

html[data-bf-surface="logbook"] .bf-surface-toolbar--logbook {
    display: block !important;
}

.bf-gallery-toolbar-row {
    display: inline-flex;
    gap: 4px;
    align-items: center;
    flex-wrap: wrap;
}

html[data-bf-surface="library"] #projects-v2-gallery-columns-bar {
    display: inline-flex !important;
}

html[data-bf-surface="library"] #library-filters-panel {
    display: flex !important;
}

html[data-bf-surface="logbook"] #projects-v2-gallery-columns-bar,
html[data-bf-surface="logbook"] #library-filters-panel {
    display: none !important;
}

/* Logbook Progress widgets */
.logbook-progress-wrap {
    width: 100%;
    padding: 8px 4px 24px;
    --bf-progress-bar-gap: 6px;
    --bf-progress-purple: #795EB6;
    --bf-progress-purple-light: #8B6FC7;
    --bf-progress-teal: #20B2AA;
    --bf-progress-gold: #FFA800;
    --bf-progress-green: #76C297;
    --bf-progress-muted: #B8B8B8;
    --bf-progress-panel: #28284a;
    --bf-progress-track: rgba(121, 94, 182, 0.22);
}

.logbook-progress-sections {
    display: flex;
    flex-direction: column;
    gap: 24px;
    width: 100%;
}
.logbook-progress-section {
    width: 100%;
}
.logbook-progress-section-header {
    font-size: 16px;
    font-weight: 600;
    color: #e0e0e0;
    margin: 0 0 12px 0;
    padding: 0;
    border-bottom: none;
}
.logbook-progress-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    width: 100%;
    align-items: stretch;
}

.logbook-progress-widget--quarter {
    grid-column: span 1;
}

.logbook-progress-widget--half {
    grid-column: span 2;
}

.logbook-progress-widget--full {
    grid-column: span 4;
}

@media (max-width: 900px) {
    .logbook-progress-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .logbook-progress-widget--quarter {
        grid-column: span 1;
    }
    .logbook-progress-widget--half,
    .logbook-progress-widget--full {
        grid-column: span 2;
    }
}

@media (max-width: 560px) {
    .logbook-progress-grid {
        grid-template-columns: 1fr;
    }
    .logbook-progress-widget--quarter,
    .logbook-progress-widget--half,
    .logbook-progress-widget--full {
        grid-column: span 1;
    }
}

.logbook-progress-widget {
    background: var(--bf-progress-panel, #28284a);
    border: none;
    border-radius: 10px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 140px;
}

.logbook-progress-widget-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.logbook-progress-widget-title {
    font-size: 13px;
    font-weight: 600;
    color: #e8e8f0;
}

.logbook-progress-widget-remove {
    display: none;
}

.logbook-progress-widget-menu {
    position: relative;
    flex-shrink: 0;
}

.logbook-progress-widget-menu-btn {
    list-style: none;
    cursor: pointer;
    color: #8888aa;
    font-size: 18px;
    line-height: 1;
    padding: 2px 8px;
    border-radius: 6px;
    user-select: none;
}

.logbook-progress-widget-menu-btn::-webkit-details-marker {
    display: none;
}

.logbook-progress-widget-menu-btn:hover {
    color: #e8e8f0;
    background: rgba(58, 58, 94, 0.65);
}

.logbook-progress-widget-menu-body {
    position: absolute;
    right: 0;
    top: calc(100% + 4px);
    z-index: 20;
    min-width: 260px;
    background: #1e1e36;
    border: 1px solid #3a3a5e;
    border-radius: 10px;
    padding: 10px 12px 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.logbook-progress-widget-remove-btn {
    width: 100%;
    text-align: left;
    background: transparent;
    border: none;
    color: #f48fb1;
    cursor: pointer;
    font-size: 12px;
    padding: 4px 2px 10px;
    margin-bottom: 6px;
    border-bottom: 1px solid #3a3a5e;
}

.logbook-progress-widget-remove-btn:hover {
    color: #ffb3cc;
}

.logbook-progress-widget-menu-body .logbook-progress-widget-controls {
    border-top: none;
    padding-top: 0;
    margin-top: 0;
}

.logbook-progress-widget-value,
.logbook-progress-widget-measure {
    font-size: 22px;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
}

.logbook-progress-widget-measure {
    font-size: 20px;
}

.logbook-progress-widget-delta-row {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 22px;
    font-size: 13px;
    line-height: 1.35;
}

.logbook-progress-delta {
    font-size: 14px;
    font-weight: 600;
}

.logbook-progress-delta--up {
    color: #7dcea0;
}

.logbook-progress-delta--down {
    color: #f48fb1;
}

.logbook-progress-delta--flat {
    color: #8888aa;
}

.logbook-progress-sparkline-text {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 15px;
    letter-spacing: 0.02em;
    color: #c8c8e8;
    line-height: 1.4;
    white-space: pre;
    overflow-x: auto;
}

.logbook-progress-grade-chart {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 8px 0 4px;
    min-height: 72px;
}

.logbook-progress-control-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.logbook-progress-knocker {
    display: inline-flex;
    border: 1px solid #3a3a5e;
    border-radius: 6px;
    overflow: hidden;
}

.logbook-progress-knocker-btn {
    border-radius: 0 !important;
    border: none !important;
    margin: 0 !important;
}

.logbook-progress-knocker-btn + .logbook-progress-knocker-btn {
    border-left: 1px solid #3a3a5e !important;
}

.logbook-progress-widget-controls--grade {
    justify-content: space-between;
    align-items: flex-end;
}

.logbook-progress-widget--stat {
    min-height: 120px;
}

.logbook-progress-widget--grade-dist {
    min-height: 160px;
}

.logbook-progress-sparkline {
    display: flex;
    align-items: flex-end;
    gap: var(--bf-progress-bar-gap, 6px);
    min-height: 64px;
    height: 64px;
    padding: 2px 0 0;
    flex: 1;
}

.logbook-progress-sparkline--with-axis {
    height: auto;
    min-height: 78px;
    align-items: stretch;
}

.logbook-progress-spark-bar-wrap {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    flex: 1 1 0;
    min-width: 0;
    height: 100%;
    gap: 4px;
}

.logbook-progress-spark-chart {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-end;
    flex: 1 1 auto;
    min-height: 56px;
    height: 56px;
    position: relative;
}

.logbook-progress-sparkline--with-axis .logbook-progress-spark-bar-wrap {
    min-height: 78px;
    height: auto;
}

.logbook-progress-sparkline--with-axis .logbook-progress-spark-chart {
    height: 56px;
    min-height: 56px;
    flex: 0 0 56px;
}

.logbook-progress-spark-bar-label {
    font-size: 9px;
    font-weight: 600;
    color: var(--bf-progress-muted, #B8B8B8);
    line-height: 1;
    white-space: nowrap;
    text-align: center;
}

.logbook-progress-spark-axis-label {
    font-size: 9px;
    font-weight: 500;
    color: var(--bf-progress-muted, #B8B8B8);
    line-height: 1.1;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: clip;
    flex: 0 0 auto;
}

.logbook-progress-spark-bar {
    display: block;
    width: 100%;
    min-width: 0;
    min-height: 4px;
    margin: 0;
    background: linear-gradient(180deg, var(--bf-progress-purple-light, #8B6FC7) 0%, var(--bf-progress-purple, #795EB6) 100%);
    border-radius: 2px 2px 0 0;
    flex-shrink: 0;
}

.logbook-progress-sparkline--grade-row .logbook-progress-spark-bar-wrap {
    flex: 1 1 0;
    min-width: 0;
}

.logbook-progress-sparkline--grade-row .logbook-progress-spark-chart {
    height: 96px;
    min-height: 96px;
}

.logbook-progress-spark-bar--current {
    background: linear-gradient(180deg, var(--bf-progress-gold, #FFA800) 0%, var(--bf-progress-purple, #795EB6) 100%);
    box-shadow: none;
}

.logbook-progress-spark-bar--empty {
    background: var(--bf-progress-track, rgba(121, 94, 182, 0.22));
    height: 4px !important;
}

.logbook-progress-spark-bar--grade {
    background: linear-gradient(180deg, #3ecfc6 0%, var(--bf-progress-teal, #20B2AA) 100%);
}

.logbook-progress-spark-bar--grade.logbook-progress-spark-bar--current {
    background: linear-gradient(180deg, var(--bf-progress-gold, #FFA800) 0%, var(--bf-progress-teal, #20B2AA) 100%);
}

.logbook-progress-grade-vchart {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
}

.logbook-progress-grade-vbody {
    display: flex;
    align-items: stretch;
    gap: 8px;
    width: 100%;
}

.logbook-progress-grade-yaxis {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex-shrink: 0;
    width: 24px;
    min-height: 96px;
    padding: 2px 0 0;
}

.logbook-progress-grade-ynum {
    font-size: 10px;
    color: #8888aa;
    line-height: 1;
    text-align: right;
}

.logbook-progress-grade-vrows {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.logbook-progress-grade-vrow {
    display: grid;
    grid-template-columns: 56px 1fr;
    align-items: end;
    gap: 8px;
    border-top: none;
    padding-top: 6px;
}

.logbook-progress-grade-vrow:first-child {
    border-top: none;
    padding-top: 0;
}

.logbook-progress-grade-vrow--current .logbook-progress-spark-bar--grade:not(.logbook-progress-spark-bar--empty) {
    background: linear-gradient(180deg, var(--bf-progress-gold, #FFA800) 0%, var(--bf-progress-teal, #20B2AA) 100%);
    box-shadow: none;
}

.logbook-progress-grade-vlabel {
    font-size: 10px;
    color: #8888aa;
    text-align: right;
    white-space: nowrap;
    padding-bottom: 2px;
}

.logbook-progress-sparkline--grade-row {
    min-height: 96px;
    height: 96px;
}

.logbook-progress-grade-xaxis-wrap {
    display: grid;
    grid-template-columns: 24px 56px 1fr;
    gap: 8px;
    align-items: start;
}

.logbook-progress-grade-ypad,
.logbook-progress-grade-xpad {
    display: block;
}

.logbook-progress-grade-xaxis {
    grid-column: 3;
    display: flex;
    align-items: flex-start;
    gap: var(--bf-progress-bar-gap, 6px);
    padding-top: 4px;
    border-top: none;
}

.logbook-progress-grade-xnum {
    flex: 1 1 0;
    min-width: 0;
    font-size: 10px;
    color: #8888aa;
    text-align: center;
    line-height: 1.1;
    padding: 0 1px;
}

.logbook-progress-grade-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    width: 100%;
}

.logbook-progress-grade-year {
    width: 40px;
    flex-shrink: 0;
    color: #aaaacc;
    font-weight: 600;
    font-size: 13px;
    padding-top: 24px;
}

.logbook-progress-sparkline-empty {
    font-size: 12px;
    color: #8888aa;
    padding: 8px 0;
}

.logbook-progress-widget-summary {
    font-size: 11px;
    color: #8888aa;
}

.logbook-progress-widget-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 16px;
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid #3a3a5e;
}

.logbook-progress-control-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.logbook-progress-control-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #8888aa;
}

.logbook-progress-control-btns {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.logbook-progress-ctrl-btn {
    cursor: pointer;
}

.logbook-progress-pyramid {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-height: 80px;
}

.logbook-progress-pyramid-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.logbook-progress-pyramid-label {
    width: 28px;
    font-size: 11px;
    color: #aaaacc;
    flex-shrink: 0;
}

.logbook-progress-pyramid-bar-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.logbook-progress-pyramid-bar {
    height: 10px;
    background: linear-gradient(90deg, #9c7fd4 0%, #f48fb1 100%);
    border-radius: 3px;
    min-width: 4px;
    transition: width 0.2s ease;
}

.logbook-progress-pyramid-count {
    font-size: 10px;
    color: #8888aa;
    min-width: 16px;
}

.logbook-progress-picker-category {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #8888aa;
    margin-top: 12px;
    margin-bottom: 4px;
}

.logbook-progress-picker-category:first-child {
    margin-top: 0;
}

.logbook-progress-picker-plus {
    width: 16px;
    color: #f48fb1;
    font-weight: 700;
}

.logbook-progress-picker-option--active,
.logbook-progress-picker-option:disabled {
    opacity: 1;
    cursor: pointer;
}

.logbook-progress-empty {
    padding: 48px 24px;
    text-align: center;
    color: #aaaacc;
}

.logbook-progress-empty-lead {
    font-size: 16px;
    font-weight: 600;
    color: #e8e8f0;
    margin-bottom: 8px;
}

.logbook-progress-empty-sub {
    font-size: 13px;
    color: #8888aa;
}

.logbook-progress-picker {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: none;
    align-items: center;
    justify-content: center;
}

.logbook-progress-picker-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(10, 10, 18, 0.72);
}

.logbook-progress-picker-panel {
    position: relative;
    background: #1e1e36;
    border: 1px solid #3a3a5e;
    border-radius: 12px;
    padding: 20px 24px;
    width: min(480px, 92vw);
    max-height: 80vh;
    overflow-y: auto;
    z-index: 1;
}

.logbook-progress-picker-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.logbook-progress-picker-header h4 {
    margin: 0;
    font-size: 16px;
    color: #fff;
}

.logbook-progress-picker-close {
    background: transparent;
    border: none;
    color: #8888aa;
    font-size: 18px;
    cursor: pointer;
    padding: 4px 8px;
}

.logbook-progress-picker-lead {
    font-size: 13px;
    color: #8888aa;
    margin-bottom: 16px;
}

.logbook-progress-picker-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.logbook-progress-picker-option {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    text-align: left;
    background: #28284a;
    border: 1px solid #3a3a5e;
    border-radius: 8px;
    padding: 12px 14px;
    color: #e8e8f0;
    cursor: pointer;
    font-size: 14px;
}

.logbook-progress-picker-option:hover:not(:disabled) {
    background: #3a3a5e;
    border-color: #f48fb1;
}

.logbook-progress-picker-check {
    width: 16px;
    color: #f48fb1;
    font-weight: 700;
}

.logbook-progress-picker-label {
    flex: 1;
}

/* Insight modal + varied card visuals */
.logbook-progress-picker-panel {
    width: min(560px, 94vw);
}

.logbook-progress-insight-options {
    gap: 10px;
}

.logbook-progress-insight-option {
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    gap: 14px;
    width: 100%;
    text-align: left;
    background: #28284a;
    border: 1px solid #3a3a5e;
    border-radius: 10px;
    padding: 12px 14px;
    color: #e8e8f0;
    cursor: pointer;
}

.logbook-progress-insight-option:hover {
    background: #3a3a5e;
    border-color: #f48fb1;
}

.logbook-progress-insight-option-main {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    flex: 1;
}

.logbook-progress-insight-question {
    font-size: 12px;
    color: #aaaacc;
    font-style: italic;
}

.logbook-progress-insight-example {
    font-size: 12px;
    color: #f48fb1;
    margin-top: 2px;
}

.logbook-progress-preview-chart {
    width: 88px;
    height: 52px;
    flex-shrink: 0;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 3px;
    background: rgba(10, 10, 18, 0.35);
    border-radius: 6px;
    padding: 6px;
    position: relative;
}

.logbook-progress-preview-bar {
    flex: 1;
    background: linear-gradient(180deg, var(--bf-progress-purple-light, #8B6FC7), var(--bf-progress-purple, #795EB6));
    border-radius: 2px 2px 0 0;
    min-height: 4px;
}

.logbook-progress-preview-chart--milestone {
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    color: #fff;
}

.logbook-progress-preview-chart--gauge {
    align-items: center;
}

.logbook-progress-preview-gauge-track,
.logbook-progress-gauge-track {
    width: 100%;
    height: 8px;
    background: var(--bf-progress-track, rgba(121, 94, 182, 0.22));
    border-radius: 999px;
    overflow: hidden;
}

.logbook-progress-preview-gauge-fill,
.logbook-progress-gauge-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--bf-progress-purple, #795EB6), var(--bf-progress-teal, #20B2AA));
    border-radius: 999px;
}

.logbook-progress-preview-chart--line {
    align-items: stretch;
}

.logbook-progress-preview-line-dot {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--bf-progress-purple, #795EB6);
    transform: translate(-50%, 50%);
}

.logbook-progress-gauge {
    margin: 6px 0 10px;
}

.logbook-progress-line-chart {
    position: relative;
    height: 64px;
    margin-top: 8px;
}

.logbook-progress-line-chart--with-axis {
    height: 80px;
    display: flex;
    flex-direction: column;
}

.logbook-progress-line-dots {
    position: absolute;
    inset: 0 0 18px 0;
}

.logbook-progress-line-axis {
    display: flex;
    align-items: flex-start;
    gap: var(--bf-progress-bar-gap, 6px);
    margin-top: auto;
    padding-top: 4px;
}

.logbook-progress-line-axis .logbook-progress-spark-axis-label {
    flex: 1 1 0;
    min-width: 0;
}

.logbook-progress-line-dot {
    position: absolute;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--bf-progress-purple-light, #8B6FC7);
    transform: translate(-50%, 50%);
}

.logbook-progress-line-dot--current {
    background: var(--bf-progress-gold, #FFA800);
    width: 9px;
    height: 9px;
}

.logbook-progress-milestone-value {
    font-size: 28px !important;
}

.logbook-progress-milestone-sparse {
    margin-top: 8px;
}

.logbook-progress-milestone-grade {
    font-size: 22px;
    font-weight: 700;
    color: #fff;
}

.logbook-progress-milestone-note,
.logbook-progress-sparse-note {
    font-size: 12px;
    color: #8888aa;
    margin-top: 8px;
    line-height: 1.4;
}

.logbook-progress-dist {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 8px;
}

.logbook-progress-dist-row {
    display: grid;
    grid-template-columns: 72px 1fr 28px;
    gap: 8px;
    align-items: center;
}

.logbook-progress-dist-label {
    font-size: 11px;
    color: #aaaacc;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.logbook-progress-dist-bar-track {
    height: 8px;
    background: #3a3a5e;
    border-radius: 999px;
    overflow: hidden;
}

.logbook-progress-dist-bar {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, var(--bf-progress-purple, #795EB6), var(--bf-progress-teal, #20B2AA));
    border-radius: 999px;
}

.logbook-progress-dist-count {
    font-size: 11px;
    color: #e8e8f0;
    text-align: right;
}

.logbook-progress-widget-menu-action {
    width: 100%;
    text-align: left;
    background: transparent;
    border: none;
    color: #e8e8f0;
    cursor: pointer;
    font-size: 12px;
    padding: 4px 2px 8px;
}

.logbook-progress-widget-menu-action:hover {
    color: #f48fb1;
}

.logbook-progress-menu-resize {
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid #3a3a5e;
}

.logbook-progress-inline-config {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #3a3a5e;
}

.logbook-progress-picker-back {
    background: transparent;
    border: none;
    color: #aaaacc;
    cursor: pointer;
    font-size: 12px;
    padding: 0 0 8px;
}

.logbook-progress-picker-back:hover {
    color: #f48fb1;
}

.logbook-progress-config-title {
    margin: 0 0 4px;
    color: #fff;
    font-size: 15px;
}

.logbook-progress-confirm-add {
    margin-top: 16px;
    width: 100%;
    background: #f48fb1;
    color: #1e1e36;
    border: none;
    border-radius: 8px;
    padding: 10px 14px;
    font-weight: 700;
    cursor: pointer;
}

.logbook-progress-confirm-add:hover {
    filter: brightness(1.05);
}

#projects-v2-view-buttons-wrap button:hover,
#projects-v2-view-buttons-wrap a:hover,
#library-switch-bar-wrap a:hover,
#logbook-switch-bar-wrap a:hover,
#projects-v2-gallery-filter-panel button:hover:not(.projects-v2-gallery-thumb):not(.projects-v2-gallery-collection-card):not(.project-attempt-thumb-btn):not(.project-attempt-select-btn),
#projects-v2-gallery-projects-filters button:hover,
#library-filter-type-menu button:hover:not(:disabled) {
    background-color: #3a3a5e !important;
    color: #FFF !important;
}
#projects-v2-gallery-filter-panel button.projects-v2-gallery-thumb:hover,
#projects-v2-gallery-filter-panel button.projects-v2-gallery-thumb:focus,
#projects-v2-gallery-filter-panel button.projects-v2-gallery-collection-card:hover,
#projects-v2-gallery-filter-panel button.projects-v2-gallery-collection-card:focus,
#projects-v2-gallery-filter-panel button.project-attempt-thumb-btn:hover,
#projects-v2-gallery-filter-panel button.project-attempt-thumb-btn:focus {
    background-color: transparent !important;
    color: inherit !important;
}
#library-filter-type-menu-items,
#library-filters-toolbar,
#library-filter-chips {
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
}
#library-filter-pending-wrap {
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
}
#library-filter-pending-chip {
    flex-shrink: 0;
}
#projects-v2-attempts-bar.projects-v2-attempts-panel,
.projects-v2-attempts-panel {
    border-radius: 8px;
    overflow-x: hidden;
}
#projects-v2-video-list-scroll {
    overflow-x: hidden;
}
#projects-v2-my-videos-list,
#projects-v2-public-videos-list {
    min-width: 0;
    max-width: 100%;
    width: 100%;
    align-items: stretch;
    text-align: left;
}
#projects-v2-video-tabs-wrap {
    margin-bottom: 2px;
}
#projects-v2-video-tabs-wrap button:hover,
#projects-v2-attempts-bar button:hover {
    background-color: #3a3a5e !important;
    color: #FFF !important;
}
#projects-v2-video-filter-chips {
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
}
.projects-v2-video-header {
    flex: 1;
    min-width: 0;
}
.projects-v2-video-header-inner {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    text-align: left;
}
.projects-v2-header-identity,
.projects-v2-header-identity-fallback {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    font-size: 22px;
    font-weight: 600;
    color: #EEE;
    text-align: left;
    cursor: pointer;
    line-height: 1.25;
}
.projects-v2-header-identity:hover {
    color: #4a90e2;
}
.projects-v2-header-identity-fallback {
    cursor: default;
}
.projects-v2-header-climber-row {
    display: flex;
    align-items: center;
    gap: 8px;
}
.projects-v2-header-climber-avatar {
    display: inline-flex;
    flex-shrink: 0;
}
.projects-v2-header-climber {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    font-size: 14px;
    font-weight: 500;
    color: #AAA;
    cursor: pointer;
    line-height: 1.3;
}
.projects-v2-header-climber:hover,
.projects-v2-header-climber.active {
    color: #4a90e2;
}
.projects-v2-header-facts-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}
.projects-v2-header-fact-chip {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    background-color: #4a4a62;
    color: #CCC;
    transition: background-color 0.15s ease, color 0.15s ease;
}
.projects-v2-header-fact-chip:hover {
    filter: brightness(1.08);
}
.projects-v2-header-fact-chip.active {
    background-color: #4a90e2;
    color: #FFF;
}
.projects-v2-header-divider {
    border: none;
    border-top: 1px solid #444;
    margin: 2px 0 0;
    width: 100%;
}
.projects-v2-header-tags-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    line-height: 1.5;
}
.projects-v2-header-tag-chip {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    font-size: 13px;
    font-weight: 400;
    color: #AAA;
    cursor: pointer;
    transition: color 0.15s ease;
}
.projects-v2-header-tag-chip:hover,
.projects-v2-header-tag-chip.active {
    color: #4a90e2;
}
.projects-v2-header-tag-sep {
    color: #666;
    font-size: 13px;
    user-select: none;
}
.projects-v2-video-list-row {
    display: flex;
    align-items: center;
    width: 100%;
    min-width: 0;
}
.projects-v2-video-list-avatar {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: 30px;
    margin-right: 4px;
}
.projects-v2-video-list-item {
    flex: 1;
    display: flex;
    align-items: center;
    min-width: 0;
    overflow: hidden;
    padding: 8px 12px;
    border-radius: 8px;
    background: transparent;
    color: #AAA;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
    box-sizing: border-box;
    text-align: left;
}
.projects-v2-video-list-body {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    min-width: 0;
    width: 100%;
    text-align: left;
    gap: 2px;
}
.projects-v2-video-list-title,
.projects-v2-video-list-subtitle {
    display: block;
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: left;
}
.projects-v2-video-list-title {
    color: #EEE;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.25;
}
.projects-v2-video-list-subtitle {
    font-size: 11px;
    font-weight: 500;
    line-height: 1.25;
    color: #888;
    margin-top: 1px;
}
.projects-v2-video-list-item:hover {
    background-color: #3a3a5e;
    color: #FFF;
}
.projects-v2-video-list-item:hover .projects-v2-video-list-subtitle {
    color: #CCC;
}
.projects-v2-video-list-item.selected {
    background-color: #3a3a5e;
    color: #FFF;
}
.projects-v2-video-list-item.selected .projects-v2-video-list-subtitle {
    color: #CCC;
}
.projects-v2-video-list-edit-btn {
    flex-shrink: 0;
    padding: 4px 10px;
    background: transparent;
    color: #CCC;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px;
    margin-left: 6px;
    position: relative;
    z-index: 1;
}
.projects-v2-video-list-edit-btn:hover {
    background-color: #28284a;
    color: #FFF;
}
#projects-v2-gallery-filter-panel button:disabled:hover,
#library-filter-type-menu button:disabled:hover {
    background-color: transparent !important;
    color: #AAA !important;
    opacity: 0.45;
}
.library-filter-chip-remove {
    background: transparent !important;
    border: none !important;
    color: #CCC !important;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    padding: 0 2px;
    margin-left: 2px;
}
.library-filter-chip-remove:hover {
    color: #FFF !important;
    background: transparent !important;
}
#projects-v2-gallery-filter-panel .library-filter-dropdown .Select-control,
#projects-v2-gallery-projects-filters .library-filter-dropdown .Select-control {
    background-color: transparent !important;
    border: none !important;
    border-radius: 8px !important;
    min-height: 38px !important;
    box-shadow: none !important;
}
#projects-v2-gallery-filter-panel .library-filter-dropdown .Select-value-label,
#projects-v2-gallery-filter-panel .library-filter-dropdown .Select-placeholder,
#projects-v2-gallery-projects-filters .library-filter-dropdown .Select-value-label,
#projects-v2-gallery-projects-filters .library-filter-dropdown .Select-placeholder {
    color: #AAA !important;
    font-size: 14px !important;
}
#projects-v2-gallery-filter-panel .library-filter-dropdown .Select-control:hover,
#projects-v2-gallery-projects-filters .library-filter-dropdown .Select-control:hover {
    background-color: #3a3a5e !important;
}
#projects-v2-gallery-filter-panel .library-filter-dropdown .Select-control:hover .Select-value-label,
#projects-v2-gallery-filter-panel .library-filter-dropdown .Select-control:hover .Select-placeholder,
#projects-v2-gallery-projects-filters .library-filter-dropdown .Select-control:hover .Select-value-label,
#projects-v2-gallery-projects-filters .library-filter-dropdown .Select-control:hover .Select-placeholder {
    color: #FFF !important;
}
.library-filter-input {
    padding: 10px 14px;
    font-size: 14px;
    font-weight: 500;
    background-color: transparent;
    color: #AAA;
    border: none;
    border-radius: 8px;
    min-width: 140px;
}
.library-filter-input:focus {
    outline: none;
    background-color: #3a3a5e;
    color: #FFF;
}
.projects-v2-gallery-collection-card:hover,
.projects-v2-gallery-collection-card:focus {
    outline: none;
}
.projects-v2-gallery-thumb:hover > div,
.projects-v2-gallery-collection-card:not(.project-attempt-thumb-btn):hover > div {
    outline: 2px solid rgba(74, 144, 226, 0.55);
    outline-offset: 1px;
}
.project-attempt-thumb-btn:hover {
    box-shadow: none;
}
.project-attempt-thumb-shell:has(.project-attempt-thumb-btn:hover) .project-attempt-thumb-wrap {
    outline: 2px solid rgba(74, 144, 226, 0.55);
    outline-offset: 1px;
}
.projects-v2-gallery-thumb:focus {
    outline: 2px solid rgba(121, 94, 182, 0.6);
    outline-offset: 2px;
}

.library-card-meta-row {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    width: 100%;
    margin-top: 6px;
    padding: 0 4px;
    box-sizing: border-box;
}
.library-card-meta-avatar {
    flex-shrink: 0;
    margin-top: 1px;
}
.library-card-meta-lines {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.library-card-meta-title {
    color: #EEE;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: left;
}
.library-card-meta-subtitle,
.library-card-meta-footer {
    color: #888;
    font-size: 10px;
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: left;
}
.library-card-meta-trailing {
    flex-shrink: 0;
    margin-left: 4px;
    color: #888;
    font-size: 12px;
}
.library-card-meta-trailing-icon {
    font-size: 14px;
    color: #888;
}

.library-avatar-profile-link {
    display: inline-flex;
    flex-shrink: 0;
    text-decoration: none;
    cursor: pointer;
}
.library-avatar-profile-link:hover {
    opacity: 0.85;
}
/* Projects v2: fit View panel + gallery in space below header; only the card grid scrolls */
.routed-page:has(#projects-v2-page) {
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
    min-height: 0;
}
#projects-v2-page {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

#projects-v2-gallery-grid {
    align-content: start;
}
#projects-v2-gallery-grid > * {
    min-width: 0;
}
.projects-v2-gallery-grid--logs {
    width: 100%;
    max-width: 100%;
    scrollbar-color: #795EB6 transparent;
}
.projects-v2-gallery-grid--logs::-webkit-scrollbar-track {
    background: transparent;
}
.library-logs-timeline-wrap {
    width: 100%;
    max-width: 100%;
    --bf-logbook-timeline-bg: #28284a;
}

.library-log-entries-panel {
    margin-bottom: 8px;
}
.library-log-entries-form {
    background: #1a1a2e;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 14px 16px;
}
.library-log-entries-form-top {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}
.library-log-entries-form-top .library-log-entries-field {
    margin-bottom: 0;
    flex: 1;
    min-width: 0;
}
.library-log-entries-cancel-btn {
    flex-shrink: 0;
    margin-bottom: 2px;
}
.library-log-entries-form-title,
.library-log-entries-section-label {
    font-size: 15px;
    font-weight: 600;
    color: #eee;
    margin-bottom: 6px;
}
.library-log-entries-validate-wrap--invalid .library-log-entries-input,
.library-log-entries-validate-wrap--invalid .library-log-entries-textarea {
    border-color: rgba(220, 80, 80, 0.9);
    box-shadow: 0 0 0 1px rgba(220, 80, 80, 0.35);
}
.library-log-entries-validate-wrap--invalid .library-log-entries-toggle-row button {
    outline: 1px solid rgba(220, 80, 80, 0.9);
    outline-offset: 1px;
}
.library-log-entries-validate-wrap--invalid.library-log-entries-validate-wrap {
    border-radius: 8px;
}
.library-log-entries-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
    margin-bottom: 14px;
}
.library-log-entries-grip-stack {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.library-log-entries-inline-label {
    color: #888;
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 2px;
}
.library-log-entries-field--wide {
    width: 100%;
}
.library-log-entries-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 14px;
}
@media (max-width: 640px) {
    .library-log-entries-form-grid {
        grid-template-columns: 1fr;
    }
}
.library-log-entries-label {
    color: #888;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.library-log-entries-input,
.library-log-entries-textarea {
    width: 100%;
    padding: 10px 12px;
    font-size: 14px;
    font-weight: 500;
    color: #eee;
    background-color: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    box-sizing: border-box;
}
.library-log-entries-input:focus,
.library-log-entries-textarea:focus {
    outline: none;
    border-color: rgba(121, 94, 182, 0.55);
    background-color: rgba(255, 255, 255, 0.06);
}
.library-log-entries-textarea {
    min-height: 64px;
    resize: vertical;
    font-family: inherit;
}
.library-log-entries-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 4px;
}

.library-log-app-data-credentials {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.library-log-app-data-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 8px 0 16px;
}

.library-log-app-data-count {
    margin: 0 0 8px;
    color: #a8adc0;
    font-size: 13px;
}

.library-log-app-data-empty {
    margin: 0;
    color: #a8adc0;
    font-size: 14px;
}

.library-log-app-data-table-wrap {
    margin-top: 8px;
}

.library-log-app-data-table-scroll {
    overflow-x: auto;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
}

.library-log-app-data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 720px;
}

.library-log-app-data-table tbody tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.03);
}

.library-log-entries-status {
    color: #888;
    font-size: 13px;
}
.library-log-entries-load-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.library-log-entries-input--compact {
    width: 140px;
    max-width: 140px;
    flex: 0 0 auto;
}
.library-log-entries-input--datetime {
    width: auto;
    max-width: 220px;
    flex: 0 0 auto;
}
.library-log-entries-pct-value {
    font-size: 22px;
    font-weight: 600;
    color: #eee;
    line-height: 1.2;
}
#log-entry-generic-measurement-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 14px;
    margin-bottom: 10px;
}
.library-log-entries-exercise-variant {
    margin-bottom: 14px;
}
.library-log-entries-training-rows {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.library-log-entries-training-field {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 0 0 auto;
}
.library-log-entries-favourites-empty {
    color: #888;
    font-size: 13px;
}
.library-log-entries-favourite-save-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
#log-entry-edit-exercise-btn-wrap {
    margin-bottom: 14px;
}
.library-log-entries-toggle-row {
    flex-wrap: wrap;
}
.library-log-media-row {
    display: flex;
    gap: 16px;
    align-items: stretch;
}
.library-log-media-col {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}
.library-log-video-picker,
.library-log-photo-picker {
    display: flex;
    flex-direction: column;
    gap: 8px;
    height: 100%;
}
.library-log-media-drop-zone {
    width: 100%;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px dashed #444;
    border-radius: 8px;
    color: #aaa;
    background-color: #1a1a2e;
    cursor: pointer;
    text-align: center;
    padding: 16px 12px;
    box-sizing: border-box;
    transition: border-color 0.15s, background-color 0.15s;
}
.library-log-media-drop-zone:hover {
    border-color: #4a9eff;
    background-color: #161633;
    color: #ddd;
}
.library-log-media-drop-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
}
.library-log-media-drop-icon {
    width: 32px;
    height: 32px;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    opacity: 0.85;
}
.library-log-media-drop-icon--video {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234a9eff' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2' y='5' width='14' height='14' rx='2'/%3E%3Cpath d='M16 9l6-3v12l-6-3z'/%3E%3C/svg%3E");
}
.library-log-media-drop-icon--photo {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234a9eff' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='14' rx='2'/%3E%3Ccircle cx='8.5' cy='10.5' r='1.5'/%3E%3Cpath d='M21 16l-5-5-4 4-2-2-5 5'/%3E%3C/svg%3E");
}
.library-log-media-drop-label {
    font-size: 14px;
    font-weight: 600;
    color: #ddd;
}
.library-log-media-drop-hint {
    font-size: 13px;
    color: #888;
    line-height: 1.4;
}
.library-log-media-drop-hint-text {
    color: #888;
}
.library-log-media-select-link {
    color: #4a9eff;
    text-decoration: underline;
    cursor: pointer;
}
.library-log-media-file-label {
    margin-top: 8px;
    font-size: 13px;
    color: #888;
    min-height: 18px;
}
.library-log-route-field {
    position: relative;
}
.library-log-route-autocomplete {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 30;
    max-height: 260px;
    overflow-y: auto;
    background: #1a1a2e;
    border: 1px solid #3a3a5a;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}
.library-log-route-autocomplete-header {
    padding: 8px 12px 4px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #888;
}
.library-log-route-autocomplete-divider {
    height: 1px;
    margin: 4px 0;
    background: #333;
}
.library-log-route-autocomplete-item {
    display: block;
    width: 100%;
    text-align: left;
    border: none;
    background: transparent;
    color: #ddd;
    font-size: 14px;
    padding: 10px 12px;
    cursor: pointer;
}
.library-log-route-autocomplete-item:hover,
.library-log-route-autocomplete-item--active {
    background: #252545;
    color: #fff;
}
.library-log-entries-validate-wrap--invalid .library-log-media-drop-zone {
    border-color: #c44;
}
.library-log-video-upload-status {
    display: block;
    margin-top: 6px;
    font-size: 13px;
    color: #888;
    min-height: 18px;
}
.library-log-video-preview-details,
.library-log-video-more-details {
    margin-bottom: 14px;
}
.library-log-video-preview-details summary,
.library-log-video-more-details summary {
    color: #aaa;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 8px;
    list-style: none;
}
.library-log-video-trim-mount {
    width: 100%;
    flex-shrink: 0;
}
.library-log-video-trim-mount .upload-trim-root {
    width: 100%;
}
.library-log-video-trim-mount .upload-trim-timeline {
    margin: 0;
}
.library-log-video-preview-wrap {
    width: 100%;
    display: flex;
    flex-direction: column;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
}
.library-log-video-preview {
    width: 100%;
    max-height: 220px;
    object-fit: contain;
    display: block;
    cursor: pointer;
    flex-shrink: 0;
}
.library-log-photo-preview-wrap {
    margin-top: 4px;
}
.library-log-photo-preview {
    max-width: 100%;
    max-height: 160px;
    border-radius: 6px;
    object-fit: contain;
    display: block;
}
.library-log-video-more-wrap {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-top: 8px;
}
.library-log-video-hold-types {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}
.library-log-video-hold-types-label {
    color: #aaa;
    font-size: 13px;
    cursor: pointer;
}
.library-log-entries-grade-toggle-row button {
    min-width: 48px;
    padding: 6px 10px;
    font-size: 12px;
}
#library-log-entries-panel .library-filter-dropdown .Select-control {
    min-height: 40px;
    border-radius: 8px;
}

/* Collection detail prototype (Routes / Projects) */
.collection-detail-page {
    padding: 0 0 20px;
    gap: 12px;
}
.collection-detail-header {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-bottom: 4px;
}
.collection-detail-header-top {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    flex-wrap: wrap;
}
.collection-detail-title-wrap {
    flex: 1;
    min-width: 0;
}
.collection-detail-title {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #fff;
    line-height: 1.25;
    letter-spacing: -0.01em;
}
.collection-detail-subtitle {
    color: #888;
    font-size: 13px;
    margin-top: 4px;
}
.collection-detail-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
}
.project-header-chips {
    margin-top: 2px;
}
.project-filter-chip {
    flex-shrink: 0;
}
.project-chip-gear {
    padding: 0 2px;
    margin-left: 2px;
    font-size: 11px;
    line-height: 1;
    color: rgba(255, 255, 255, 0.85);
    background: transparent;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}
.project-chip-gear:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
}
.project-progress-filter-chips-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}
.project-progress-filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
}
.project-chip-settings-panel,
.project-type-settings-panel {
    margin-top: 8px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.collection-detail-chip {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 500;
    color: #ccc;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 999px;
}
.collection-detail-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.collection-detail-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.collection-detail-metric-card {
    background: #1a1a2e;
    border: 1px solid #444;
    border-radius: 8px;
    padding: 10px 14px;
    min-width: 88px;
}
.collection-detail-metric-value {
    font-size: 18px;
    font-weight: 600;
    color: #eee;
    line-height: 1.2;
}
.collection-detail-metric-label {
    font-size: 11px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-top: 2px;
}
.collection-detail-gallery-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.collection-detail-section-title {
    font-size: 14px;
    font-weight: 600;
    color: #ccc;
}
.collection-detail-video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    align-content: start;
}
.collection-detail-tabs-wrap {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 4px;
}
.collection-detail-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}
.collection-detail-tab {
    padding: 7px 14px;
    font-size: 13px;
    font-weight: 500;
    color: #888;
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: color 0.15s ease, background 0.15s ease;
}
.collection-detail-tab:hover {
    color: #ddd;
    background: rgba(255, 255, 255, 0.04);
}
.collection-detail-tab.active,
.collection-detail-tab:disabled {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
    border: none;
    opacity: 1;
}
.project-detail-tabs-wrap {
    margin-top: 2px;
}
.project-detail-tab-panels-wrap {
    min-height: 0;
}
.project-detail-tab-panel {
    padding-top: 4px;
}
.collection-detail-tab-panels {
    min-height: 0;
}
.collection-detail-panel {
    background: #1a1a2e;
    border: 1px solid #444;
    border-radius: 8px;
    padding: 14px 16px;
}
.collection-detail-panel-title {
    font-size: 13px;
    font-weight: 600;
    color: #ccc;
    margin-bottom: 8px;
}

/* Project detail: Goal → Progress → Evidence */
.project-detail-page {
    gap: 10px;
}
.project-detail-header {
    gap: 6px;
}
.project-detail-header-top {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}
.project-detail-header-thumb {
    position: relative;
    flex-shrink: 0;
    width: 144px;
    height: 144px;
    border-radius: 8px;
    overflow: hidden;
    background: #1a1a2e;
}
.project-detail-header-thumb-inner {
    width: 100%;
    height: 100%;
}
.project-detail-thumb-gear {
    position: absolute;
    top: 6px;
    right: 6px;
    z-index: 3;
    width: 24px;
    height: 24px;
    padding: 0;
    border: none;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-size: 12px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.project-detail-thumb-gear:hover {
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
}
.project-detail-header-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.project-detail-header-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}
.project-detail-header-desc {
    color: #777;
    font-size: 13px;
    line-height: 1.45;
}
.project-detail-stats {
    display: flex;
    gap: 8px;
    margin-top: 4px;
}
.project-detail-stat {
    font-size: 12px;
    color: #777;
}
.project-detail-actions {
    flex-shrink: 0;
}
.project-header-btn {
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 500;
    color: #ccc;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}
.project-header-btn:hover:not(:disabled) {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}
.project-header-btn:disabled {
    opacity: 0.4;
    cursor: default;
}
.project-header-btn--ghost {
    background: transparent;
    border-color: transparent;
    color: #888;
}
.project-header-btn--ghost:hover:not(:disabled) {
    color: #ccc;
    background: rgba(255, 255, 255, 0.04);
}
.project-panel-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    padding: 14px 16px;
}
.project-panel-section-header {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 10px;
}
.project-panel-section-heading {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.project-panel-section-title {
    font-size: 13px;
    font-weight: 600;
    color: #eee;
    line-height: 1.3;
}
.project-panel-section-hint {
    font-size: 12px;
    color: #666;
    line-height: 1.35;
}
.project-action-btn {
    padding: 7px 14px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.06);
    color: #ddd;
    cursor: pointer;
    transition: background 0.15s ease;
}
.project-action-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}
.project-action-btn--primary {
    background: rgba(74, 144, 226, 0.18);
    border-color: rgba(74, 144, 226, 0.35);
    color: #d8e8ff;
}
.project-action-btn--primary:hover {
    background: rgba(74, 144, 226, 0.28);
}
.project-action-btn--danger {
    background: rgba(200, 80, 80, 0.12);
    border-color: rgba(200, 80, 80, 0.3);
    color: #ffb8b8;
}
.project-action-btn--danger:hover {
    background: rgba(200, 80, 80, 0.22);
}
.project-detail-goal-top {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 8px;
}
.project-detail-goal-emoji {
    font-size: 20px;
    line-height: 1;
    flex-shrink: 0;
}
.project-detail-goal-card,
.project-detail-progress-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    padding: 14px 16px;
}
.project-detail-goal-card--compact,
.project-detail-progress-card--compact {
    padding: 10px 12px;
    background: transparent;
    border: none;
    padding-left: 0;
    padding-right: 0;
}
.project-detail-goal-text {
    color: #bbb;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.45;
}
.project-detail-goal-empty {
    color: #777;
    font-size: 14px;
    font-style: italic;
}
.project-detail-progress-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}
.project-detail-method-badge {
    display: inline-flex;
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 600;
    color: #bbb;
    background: #2a2a4a;
    border: 1px solid #555;
    border-radius: 999px;
}
.project-detail-progress-empty {
    color: #aaa;
    font-size: 14px;
    margin-bottom: 10px;
}
.project-detail-secondary-btn {
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 500;
    color: #ccc;
    background: #2a2a4a;
    border: 1px solid #555;
    border-radius: 8px;
    cursor: not-allowed;
    opacity: 0.85;
}
.project-detail-checklist {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.project-detail-checklist-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #ccc;
}
.project-detail-checklist-row.done {
    color: #eee;
}
.project-detail-check-mark {
    width: 1.2em;
    flex-shrink: 0;
}
.project-detail-progress-summary {
    margin-top: 10px;
    font-size: 13px;
    font-weight: 600;
    color: #4a90e2;
}
.project-detail-numeric-row {
    display: flex;
    align-items: flex-end;
    gap: 16px;
    margin-bottom: 12px;
}
.project-detail-numeric-col {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.project-detail-numeric-label {
    font-size: 11px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.project-detail-numeric-value {
    font-size: 22px;
    font-weight: 600;
    color: #eee;
    line-height: 1.1;
}
.project-detail-numeric-arrow {
    color: #666;
    font-size: 18px;
    padding-bottom: 4px;
}
.project-detail-progress-bar {
    height: 8px;
    background: #2a2a4a;
    border-radius: 999px;
    overflow: hidden;
}
.project-detail-progress-bar > div {
    height: 100%;
    background: linear-gradient(90deg, #4a90e2, #6ab0ff);
    border-radius: 999px;
    min-width: 4px;
}
.project-detail-manual-quote {
    margin: 0 0 12px;
    padding: 10px 12px;
    border-left: 3px solid #4a90e2;
    color: #ddd;
    font-size: 14px;
    line-height: 1.45;
    background: #22223a;
    border-radius: 0 6px 6px 0;
}
.project-detail-videos-only-count {
    font-size: 20px;
    font-weight: 600;
    color: #eee;
}
.project-detail-evidence-summary {
    font-size: 13px;
    color: #aaa;
    margin: 8px 0 12px;
}
.project-detail-overview-tab .project-detail-section-label {
    margin-bottom: 4px;
}
.project-detail-section-label {
    font-size: 20px;
    font-weight: 600;
    color: #fff;
    line-height: 1.25;
    letter-spacing: -0.01em;
    margin: 0 0 6px;
}
.project-detail-goal-progress-block {
    margin-bottom: 18px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.project-detail-goal-progress-block .project-inline-edit-row {
    margin-bottom: 0;
}
.project-detail-progress-prompt {
    margin-top: 10px;
    padding: 14px 16px;
    background: #1a1a2e;
    border: 1px solid #4a90e2;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.project-detail-progress-prompt-title {
    font-size: 14px;
    font-weight: 600;
    color: #eee;
}
.project-detail-progress-prompt-sub {
    font-size: 12px;
    color: #888;
}
.project-detail-progress-prompt-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}
.collection-detail-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}
.project-detail-edit-panel {
    background: #1a1a2e;
    border: 1px solid #4a90e2;
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.project-detail-edit-label {
    display: block;
    color: #aaa;
    font-size: 12px;
    margin-bottom: 4px;
}
.project-detail-edit-field {
    display: flex;
    flex-direction: column;
}
.project-detail-edit-field--half {
    flex: 1;
    min-width: 140px;
}
.project-detail-edit-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}
.project-detail-edit-textarea {
    min-height: 64px;
    resize: vertical;
    width: 100%;
}
.project-detail-edit-actions {
    display: flex;
    gap: 8px;
    margin-top: 4px;
}

/* Project journey wizard & type layouts */
.project-create-wizard {
    background: #1a1a2e;
    border: 1px solid #555;
    border-radius: 10px;
    padding: 16px 18px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
}
.project-wizard-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.project-wizard-title {
    font-size: 18px;
    font-weight: 600;
    color: #eee;
}
.project-wizard-close {
    background: none;
    border: none;
    color: #aaa;
    font-size: 22px;
    cursor: pointer;
    line-height: 1;
    padding: 0 4px;
}
.project-wizard-header {
    margin-bottom: 12px;
}
.project-wizard-step-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.project-wizard-step-num {
    font-size: 11px;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.project-wizard-step-title {
    font-size: 16px;
    font-weight: 600;
    color: #eee;
    margin-top: 4px;
}
.project-wizard-intro {
    color: #aaa;
    font-size: 14px;
    margin-bottom: 12px;
    line-height: 1.45;
}
.project-wizard-hint {
    color: #777;
    font-size: 12px;
    margin-top: 6px;
}
.project-wizard-actions {
    display: flex;
    gap: 8px;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid #444;
}
.project-journey-type-badge {
    display: inline-flex;
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 600;
    color: #ccc;
    background: #2a2a4a;
    border-radius: 999px;
}
.project-journey-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}
.project-journey-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    padding: 14px 16px;
    background: #22223a;
    border: 1px solid #444;
    border-radius: 10px;
    cursor: pointer;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}
.project-journey-card:hover {
    border-color: #4a90e2;
    background: #28284a;
}
.project-journey-card-title {
    font-size: 15px;
    font-weight: 600;
    color: #eee;
    margin-bottom: 4px;
}
.project-journey-card-tagline {
    font-size: 13px;
    color: #aaa;
    margin-bottom: 8px;
    line-height: 1.35;
}
.project-journey-card-examples {
    margin: 0;
    padding-left: 18px;
    font-size: 12px;
    color: #888;
    line-height: 1.4;
}
.project-wizard-checklist {
    color: #ccc;
    font-size: 13px;
}
.project-goal-header {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 6px;
}
.project-goal-prompt-hint {
    font-size: 11px;
    color: #777;
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
}
.project-journey-body {
    background: #1a1a2e;
    border: 1px solid #444;
    border-radius: 8px;
    padding: 14px 16px;
}
.project-achievement-count {
    font-size: 28px;
    font-weight: 700;
    color: #eee;
    margin-bottom: 10px;
}
.project-achievement-current {
    color: #4a90e2;
}
.project-achievement-target {
    color: #888;
    font-size: 20px;
}
.project-achievement-bar {
    height: 12px;
    margin-bottom: 10px;
}
.project-achievement-metric-suffix {
    font-size: 18px;
    font-weight: 500;
    color: #888;
}
.project-achievement-stats {
    font-size: 15px;
    font-weight: 500;
    color: #bbb;
    margin-top: 4px;
    line-height: 1.45;
}
.project-achievement-recent-section {
    margin-top: 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.project-detail-subsection-label {
    font-size: 12px;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.project-progress-filter-hint {
    font-size: 15px;
    font-weight: 500;
    color: #bbb;
    margin-bottom: 0;
    line-height: 1.45;
}
.project-progress-filter-hint-row {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
}
.project-completion-list,
.project-session-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.project-completion-row,
.project-session-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #ccc;
}
.project-completion-mark {
    color: #4a90e2;
    font-weight: 700;
}
.project-completion-date {
    margin-left: auto;
    font-size: 11px;
    color: #777;
}
.project-streak-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 12px;
}
.project-streak-card {
    flex: 1;
    min-width: 88px;
    background: #22223a;
    border-radius: 8px;
    padding: 10px 12px;
    text-align: center;
}
.project-streak-value {
    font-size: 24px;
    font-weight: 700;
    color: #4a90e2;
    line-height: 1.1;
}
.project-streak-label {
    font-size: 11px;
    color: #888;
    margin-top: 2px;
}
.project-training-measurements-block {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.project-measurements-header-row {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    margin-bottom: 8px;
}
.project-measurements-header-row .project-detail-section-label {
    margin-bottom: 0;
    flex: 0 0 auto;
}
.project-training-measurements-toggles,
.project-training-measurements-selected {
    flex-wrap: wrap;
}
.project-training-measurement-chip {
    display: inline-flex;
    align-items: center;
    cursor: default;
}
.project-training-measurements-empty {
    color: #888;
    font-size: 14px;
    font-style: italic;
}
.project-training-metrics-row {
    margin-bottom: 12px;
}
.project-training-metric-card .project-streak-label {
    font-size: 11px;
    line-height: 1.25;
}
.project-habit-consistency {
    font-size: 13px;
    color: #aaa;
    margin-bottom: 12px;
}
.project-improvement-summary {
    color: #ddd;
    font-size: 14px;
    line-height: 1.5;
    margin: 0 0 8px;
}
.project-improvement-sources {
    font-size: 12px;
    color: #888;
    margin-bottom: 12px;
}
.project-timeline-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.project-timeline-vertical {
    display: flex;
    flex-direction: column;
    background: #1a1a2e;
    border: 1px solid #444;
    border-radius: 8px;
    padding: 12px 14px 12px 8px;
}
.project-timeline-session {
    display: flex;
    flex-direction: column;
}
.project-timeline-session-header {
    display: flex;
    gap: 12px;
    align-items: center;
    width: fit-content;
    max-width: 100%;
    padding: 2px 0 6px;
    pointer-events: auto;
}
.project-timeline-session-heading {
    font-size: 12px;
    font-weight: 600;
    color: #888;
    letter-spacing: 0.02em;
    line-height: 1.35;
}
.project-timeline-group {
    display: flex;
    flex-direction: column;
}
.project-timeline-group--stacked {
    width: fit-content;
    max-width: 100%;
}
.project-timeline-group--stacked .project-timeline-row {
    position: relative;
    z-index: 1;
    width: fit-content;
    max-width: 100%;
    pointer-events: none;
    transition: margin-top 0.18s ease, z-index 0s;
}
.project-timeline-group--stacked .project-timeline-row .project-timeline-entry-body,
.project-timeline-group--stacked .project-timeline-row .project-timeline-track {
    pointer-events: auto;
}
.project-timeline-group--stacked .project-timeline-entry-body {
    flex: 0 1 auto;
}
.project-timeline-group--stacked .project-timeline-row ~ .project-timeline-row {
    margin-top: -56px;
}
.project-timeline-group--stacked:has(.project-timeline-row:hover) .project-timeline-row ~ .project-timeline-row,
.project-timeline-session:has(.project-timeline-session-header:hover) .project-timeline-group--stacked .project-timeline-row ~ .project-timeline-row,
.project-timeline-group--stacked:has(.project-timeline-entry-details[open]) .project-timeline-row ~ .project-timeline-row {
    margin-top: 0;
}
.project-timeline-group--stacked:has(.project-timeline-row:hover) .project-timeline-row,
.project-timeline-session:has(.project-timeline-session-header:hover) .project-timeline-group--stacked .project-timeline-row,
.project-timeline-group--stacked:has(.project-timeline-entry-details[open]) .project-timeline-row {
    z-index: 5;
}
.project-timeline-group--text .project-timeline-row {
    align-items: flex-start;
    min-height: 36px;
}
.project-timeline-group--text .project-timeline-entry-body {
    padding: 2px 0 8px;
}
.project-timeline-gap {
    display: flex;
    min-height: 28px;
    margin: 4px 0 8px;
}
.project-timeline-gap .project-timeline-track {
    align-self: stretch;
}
.project-timeline-gap .project-timeline-line {
    top: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        to bottom,
        #444 0,
        #444 4px,
        transparent 4px,
        transparent 8px
    );
    width: 2px;
}
.project-timeline-row {
    display: flex;
    gap: 12px;
    align-items: center;
    min-height: 48px;
}
.project-timeline-track {
    width: 28px;
    flex-shrink: 0;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    align-self: stretch;
}
.project-timeline-line {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 2px;
    margin-left: -1px;
    background: #444;
    z-index: 0;
}
.project-timeline-line--last {
    bottom: 50%;
}
.project-timeline-node {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #4a90e2;
    border: 2px solid #1a1a2e;
    box-shadow: 0 0 0 1px #4a90e2;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}
.project-timeline-node--add {
    width: 22px;
    height: 22px;
    margin-top: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    background: #3a3a5e;
    box-shadow: 0 0 0 1px #666;
    border-color: #1a1a2e;
}
.project-timeline-node--attempt {
    width: 8px;
    height: 8px;
}
.project-timeline-node--send {
    width: 22px;
    height: 22px;
    border-radius: 4px;
    background: transparent;
    border: none;
    box-shadow: none;
    color: #22c55e;
    font-size: 20px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}
.project-timeline-node--send::before {
    content: "✓";
    line-height: 1;
}
.project-timeline-node--muted {
    background: #555;
    box-shadow: 0 0 0 1px #666;
}
.project-timeline-entry-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    padding: 4px 0 16px;
    flex: 1;
}
.project-timeline-row--add .project-timeline-entry-body {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0;
    padding-bottom: 12px;
}
.project-timeline-entry-body--with-thumb {
    flex-direction: row;
    align-items: center;
    gap: 12px;
    padding: 8px 0 16px;
}
.project-timeline-thumb-wrap {
    width: 88px;
    height: 66px;
    flex-shrink: 0;
    overflow: hidden;
    border-radius: 6px;
    background: #111;
}
.project-timeline-thumb-btn {
    width: 88px;
    height: 66px;
    padding: 0;
    border: 1px solid #444;
    border-radius: 6px;
    background: transparent;
    cursor: pointer;
    overflow: hidden;
    flex-shrink: 0;
}
.project-timeline-thumb-btn:hover {
    border-color: #4a90e2;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}
.project-timeline-session--stacked .project-timeline-row ~ .project-timeline-row .project-timeline-thumb-btn {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}
.project-timeline-session--stacked:has(.project-timeline-row:hover) .project-timeline-thumb-btn,
.project-timeline-session--stacked:has(.project-timeline-session-header:hover) .project-timeline-thumb-btn {
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}
.project-timeline-group--stacked .project-timeline-row ~ .project-timeline-row .project-timeline-thumb-btn,
.project-timeline-group--stacked .project-timeline-row ~ .project-timeline-row .project-timeline-thumb-wrap--photo {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}
.project-timeline-group--stacked:has(.project-timeline-row:hover) .project-timeline-thumb-btn,
.project-timeline-group--stacked:has(.project-timeline-row:hover) .project-timeline-thumb-wrap--photo,
.project-timeline-session:has(.project-timeline-session-header:hover) .project-timeline-group--stacked .project-timeline-thumb-btn,
.project-timeline-session:has(.project-timeline-session-header:hover) .project-timeline-group--stacked .project-timeline-thumb-wrap--photo {
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}
.project-timeline-entry-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
}
.project-timeline-entry-label {
    font-size: 14px;
    font-weight: 500;
    color: #eee;
    line-height: 1.35;
}
.project-timeline-entry-details {
    min-width: 0;
    width: 100%;
}
.project-timeline-entry-details > summary.project-timeline-entry-label {
    cursor: pointer;
    list-style: none;
}
.project-timeline-entry-details > summary.project-timeline-entry-label::-webkit-details-marker {
    display: none;
}
.project-timeline-entry-details > summary.project-timeline-entry-label::marker {
    content: "";
}
.project-timeline-entry-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: 4px;
}
.project-timeline-entry-meta-line {
    font-size: 12px;
    color: #888;
    line-height: 1.35;
}
.project-timeline-entry-actions {
    position: absolute;
    top: 0;
    right: 0;
    margin-top: 0;
    display: flex;
    justify-content: flex-end;
}
.project-timeline-entry-menu-wrap {
    position: relative;
    display: inline-flex;
    justify-content: flex-end;
}
.project-timeline-entry-menu-btn {
    width: 28px;
    height: 28px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.04);
    color: #bbb;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
}
.project-timeline-entry-menu-btn:hover {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.08);
}
.project-timeline-entry-menu-panel {
    position: absolute;
    top: 100%;
    right: 0;
    z-index: 5;
    display: none;
    flex-direction: column;
    gap: 2px;
    min-width: 108px;
    margin-top: 4px;
    padding: 6px;
    border: 1px solid #555;
    border-radius: 6px;
    background: #333;
}
.project-timeline-entry-menu-item {
    display: block;
    width: 100%;
    padding: 6px 10px;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: #eee;
    font-size: 12px;
    text-align: left;
    cursor: pointer;
}
.project-timeline-entry-menu-item:hover {
    background: rgba(255, 255, 255, 0.08);
}
.project-timeline-entry-menu-item--danger {
    color: #fca5a5;
}
.project-timeline-entry-menu-item--danger:hover {
    background: rgba(220, 80, 80, 0.18);
}
.project-timeline-entry-delete-btn {
    padding: 4px 8px;
    font-size: 12px;
    font-weight: 500;
    color: #fca5a5;
    background: rgba(220, 80, 80, 0.12);
    border: 1px solid rgba(220, 80, 80, 0.35);
    border-radius: 4px;
    cursor: pointer;
}
.project-timeline-entry-delete-btn:hover {
    color: #fff;
    background: rgba(220, 80, 80, 0.35);
    border-color: rgba(220, 80, 80, 0.7);
}
.project-timeline-entry-notes {
    font-size: 12px;
    color: #888;
    line-height: 1.35;
    margin-top: 2px;
}
.project-timeline-thumb-wrap--photo {
    border: 1px solid #444;
    border-radius: 6px;
}
.project-timeline-thumb-wrap--photo img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.project-timeline-entry-link {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    font-size: 14px;
    font-weight: 500;
    color: #eee;
    text-align: left;
    cursor: pointer;
    line-height: 1.35;
}
.project-timeline-entry-link:hover {
    color: #4a90e2;
}
.project-timeline-date {
    font-size: 12px;
    color: #888;
}
.project-timeline-add-link {
    font-size: 14px;
    font-weight: 500;
    color: #4a90e2;
    text-decoration: none;
}
.project-timeline-add-link:hover {
    text-decoration: underline;
}
.project-timeline-add-hint {
    font-size: 12px;
    color: #777;
}
.project-timeline-empty {
    font-size: 13px;
    color: #777;
    font-style: italic;
    line-height: 1.45;
}

/* Logbook diary timeline */
.project-timeline-vertical--diary {
    position: relative;
    gap: 0;
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    isolation: isolate;
}
/*
 * Main spine: solid by default. Dashed only while parallel to an expanded branch
 * (see .project-timeline-branch-main-dash).
 * Geometry (session padding-left 12px + 28px track):
 *   main spine left edge = 25px (center 26px)
 *   branch spine center   = 40px from session content (= 52px from vertical)
 */
.project-timeline-vertical--diary::before {
    content: "";
    position: absolute;
    left: 25px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #666;
    z-index: 1;
    pointer-events: none;
}
.project-timeline-vertical--diary .project-timeline-line {
    display: none;
}
.project-timeline-session--diary {
    position: relative;
    z-index: 2;
    background: linear-gradient(90deg, transparent 0 40px, #28284a 40px);
    border-radius: 10px;
    padding: 10px 12px 8px;
    margin-bottom: 6px;
}
.project-timeline-session-branch {
    position: relative;
    display: block;
}
.project-timeline-session--collapsed > .project-timeline-session-branch {
    display: none;
}
/*
 * Dashed main spine for the parallel branch section only.
 * Full branch height so dashes meet the S-curve joins.
 * 2px page-color base hides the solid spine underneath; gaps stay the
 * same width as the line so no dark strip appears.
 */
.project-timeline-branch-main-dash {
    position: absolute;
    left: 13px;
    top: 0;
    bottom: 0;
    width: 2px;
    z-index: 3;
    pointer-events: none;
    background-color: var(--bf-logbook-timeline-bg, #28284a);
    background-image: repeating-linear-gradient(
        to bottom,
        #666 0,
        #666 3px,
        transparent 3px,
        transparent 7px
    );
}
/* S-curve: margin-left 13px + path x=1 → center at content 14 = vertical 26 (main) */
.project-timeline-branch-s {
    display: block;
    width: 28px;
    height: 28px;
    margin: 0 0 0 13px;
    padding: 0;
    border: 0;
    pointer-events: none;
    position: relative;
    z-index: 4;
    flex-shrink: 0;
    line-height: 0;
    vertical-align: top;
}
.project-timeline-session-body {
    position: relative;
    display: block;
    /* Track center at 26+14=40 = branch center */
    padding-left: 26px;
    padding-top: 0;
    padding-bottom: 0;
}
/* Branch spine: left 39 → center 40 = S-curve end (13+27) */
.project-timeline-session-body::before {
    content: "";
    position: absolute;
    left: 39px;
    top: -1px;
    bottom: -1px;
    width: 2px;
    background: #666;
    z-index: 1;
    pointer-events: none;
}
.project-timeline-session-header--diary {
    display: flex;
    gap: 10px;
    align-items: stretch;
    width: 100%;
    max-width: 100%;
    padding: 2px 0 8px;
    margin: 0;
    background: transparent;
    border: none;
    color: inherit;
    text-align: left;
    cursor: pointer;
    font: inherit;
}
.project-timeline-session--collapsed .project-timeline-session-header--diary {
    padding-bottom: 2px;
}
.project-timeline-session-header--diary .project-timeline-track {
    align-self: stretch;
    min-height: 100%;
    background: transparent;
}
.project-timeline-vertical--diary .project-timeline-track {
    background: transparent;
}
.project-timeline-node--session {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #1a1a2e;
    border: 2px solid #4a90e2;
    box-shadow: 0 0 0 1px #4a90e2;
    flex-shrink: 0;
    position: relative;
    z-index: 3;
}
.project-timeline-node--session::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 4px;
    height: 4px;
    margin: -2px 0 0 -2px;
    border-radius: 50%;
    background: #4a90e2;
}
.project-timeline-vertical--diary .project-timeline-node {
    z-index: 3;
}
.project-timeline-session-header--diary:hover .project-timeline-session-title {
    color: #fff;
}
.project-timeline-session-heading-block {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
}
.project-timeline-session-date-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.project-timeline-session-date {
    font-size: 13px;
    font-weight: 600;
    color: #e8e8f0;
}
.project-timeline-session-title {
    font-size: 13px;
    font-weight: 500;
    color: #c8c8e0;
    padding-left: 0;
}
.project-timeline-session-summary {
    font-size: 12px;
    color: #8888aa;
    padding-left: 0;
    line-height: 1.35;
}
.project-timeline-session-highlight {
    font-size: 10px;
    font-weight: 600;
    color: #FFA800;
    background: rgba(255, 168, 0, 0.12);
    border: 1px solid rgba(255, 168, 0, 0.35);
    border-radius: 999px;
    padding: 1px 8px;
    letter-spacing: 0.02em;
}
.project-timeline-month {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 14px 4px 6px 48px;
}
.project-timeline-month-heading {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: #8888aa;
}
.project-timeline-month-summary {
    font-size: 12px;
    color: #666688;
}
.project-timeline-entry-structured {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    padding-right: 40px;
}
.project-timeline-entry-title {
    font-size: 14px;
    font-weight: 600;
    color: #e8e8f0;
    line-height: 1.3;
}
.project-timeline-entry-value-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
}
.project-timeline-entry-value {
    font-size: 15px;
    font-weight: 700;
    color: #fff;
}
.project-timeline-entry-pb {
    font-size: 10px;
    font-weight: 700;
    color: #FFA800;
    background: rgba(255, 168, 0, 0.14);
    border-radius: 4px;
    padding: 1px 6px;
    letter-spacing: 0.04em;
}
.project-timeline-entry-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}
.project-timeline-chip {
    display: inline-flex;
    align-items: center;
    font-size: 11px;
    font-weight: 500;
    color: #c8c8e0;
    background: #3a3a5e;
    border: 1px solid #4a4a6e;
    border-radius: 999px;
    padding: 1px 8px;
    line-height: 1.4;
}
.project-timeline-chip--send {
    color: #76C297;
    border-color: rgba(118, 194, 151, 0.45);
    background: rgba(118, 194, 151, 0.12);
}
.project-timeline-chip--attempt {
    color: #8ab4f8;
    border-color: rgba(74, 144, 226, 0.45);
    background: rgba(74, 144, 226, 0.1);
}
.project-timeline-entry-note {
    font-size: 12px;
    color: #8888aa;
    line-height: 1.35;
}
.project-timeline-row--diary {
    align-items: flex-start;
    min-height: 40px;
}
.project-timeline-row--diary .project-timeline-entry-body {
    padding: 4px 0 12px;
    width: min(100%, 760px);
    max-width: 760px;
    flex: 0 1 760px;
}
.project-timeline-row--measurement .project-timeline-entry-title {
    color: #d4c4f0;
}
.project-timeline-node--measurement {
    background: #795EB6;
    box-shadow: 0 0 0 1px #8B6FC7;
    border-color: #1a1a2e;
}
.library-logs-timeline-wrap .project-timeline-section {
    gap: 0;
}

.project-detail-header-desc--empty,
.project-inline-edit-empty {
    font-style: italic;
    opacity: 0.7;
}
.project-detail-hero {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 2px;
}
.project-detail-goal-section {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 2px;
}
.project-detail-goal-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #666;
}
.project-inline-edit-pencil {
    padding: 2px 6px;
    font-size: 13px;
    line-height: 1;
    color: #888;
    background: transparent;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    flex-shrink: 0;
    transition: color 0.15s ease, background 0.15s ease;
}
.project-inline-edit-pencil:hover {
    color: #ccc;
    background: rgba(255, 255, 255, 0.06);
}
.project-inline-edit-row {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 100%;
}
.project-inline-edit-content {
    flex: 0 1 auto;
    min-width: 0;
}
.project-inline-edit-toolbar {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}
.project-inline-edit-gear {
    padding: 2px 6px;
    font-size: 13px;
    line-height: 1;
    color: #888;
    background: transparent;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    flex-shrink: 0;
}
.project-inline-edit-gear:hover {
    color: #ccc;
    background: rgba(255, 255, 255, 0.06);
}
.project-achievement-count-inline {
    display: inline-flex;
    align-items: baseline;
    gap: 0;
    flex-wrap: wrap;
    margin-bottom: 10px;
}
.project-achievement-count-inline--edit {
    align-items: center;
    gap: 6px;
}
.project-inline-edit-input--target {
    font-size: 20px;
    font-weight: 700;
    color: #888;
    width: 3.5ch;
    min-width: 2ch;
    display: inline-block;
    text-align: center;
    padding: 0 2px;
}
.project-inline-edit-metric {
    display: inline-flex;
    align-items: baseline;
    gap: 8px;
    margin: 0;
    padding: 0;
}
.project-inline-edit-metric-label {
    font-size: 18px;
    font-weight: 500;
    color: #888;
    cursor: pointer;
    margin: 0;
    padding: 0;
}
.project-inline-edit-metric-input {
    margin-right: 4px;
}
.project-progress-filter-block {
    margin-bottom: 8px;
}
.project-progress-filter-hint-inline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.project-progress-filter-hint-text {
    font-size: 12px;
    color: #4a90e2;
    line-height: 1.35;
}
.project-progress-filter-settings {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.project-inline-edit-input {
    display: block;
    width: 100%;
    box-sizing: border-box;
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 0;
    padding: 0;
    margin: 0;
    outline: none;
    font-family: inherit;
    resize: vertical;
}
.project-inline-edit-input:focus {
    border-bottom-color: rgba(255, 255, 255, 0.35);
}
.project-inline-edit-input--title {
    font-size: 20px;
    font-weight: 600;
    color: #fff;
    line-height: 1.25;
    letter-spacing: -0.01em;
}
.project-inline-edit-input--desc {
    font-size: 13px;
    color: #777;
    line-height: 1.45;
    min-height: 1.45em;
}
.project-inline-edit-input--goal {
    font-size: 15px;
    font-weight: 500;
    color: #bbb;
    line-height: 1.45;
    min-height: 1.45em;
}
.project-inline-edit-save,
.project-inline-edit-cancel {
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 500;
    border-radius: 4px;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.1);
    line-height: 1.4;
}
.project-inline-edit-save {
    color: #fff;
    background: rgba(99, 102, 241, 0.35);
}
.project-inline-edit-save:hover {
    background: rgba(99, 102, 241, 0.5);
}
.project-inline-edit-cancel {
    color: #aaa;
    background: transparent;
}
.project-inline-edit-cancel:hover {
    color: #ddd;
    background: rgba(255, 255, 255, 0.04);
}
.project-achievement-count-row {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
}
.project-achievement-count-row .project-achievement-count {
    margin-bottom: 0;
}
.project-progress-settings-gear {
    padding: 4px 8px;
    font-size: 14px;
    line-height: 1;
    color: #888;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    cursor: pointer;
    flex-shrink: 0;
}
.project-progress-settings-gear:hover {
    color: #ccc;
    background: rgba(255, 255, 255, 0.06);
}
.project-progress-settings-panel {
    margin-top: 10px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.project-progress-settings-input {
    max-width: 120px;
}
.project-achievement-metric {
    font-size: 11px;
    color: #777;
    margin-top: 2px;
}
.project-attempts-add-wrap {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 4px;
}
.project-attempts-add-panel {
    display: none;
    flex-direction: column;
    gap: 10px;
}
.project-attempts-add-toggle {
    align-self: flex-start;
}
.project-attempts-panel {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.project-attempt-filters-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}
.project-attempt-filter-type-menu {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}
.project-attempt-filter-pending-wrap {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.project-attempt-pending-chip {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 500;
    color: #4a90e2;
    background: rgba(74, 144, 226, 0.12);
    border: 1px solid rgba(74, 144, 226, 0.25);
    border-radius: 999px;
}
.project-attempt-filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    flex: 1;
    min-width: 0;
}
.project-attempt-filter-dropdown {
    min-width: 160px;
}
.project-attempt-filter-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.project-attempt-keep-updated {
    margin: 0;
}
.project-attempt-manual-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}
.project-attempt-library-dropdown {
    flex: 1;
    min-width: 220px;
}
.project-attempt-upload-link {
    font-size: 13px;
    color: #4a90e2;
    text-decoration: none;
    white-space: nowrap;
}
.project-attempt-upload-link:hover {
    text-decoration: underline;
}
.project-attempts-grid-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.project-attempts-grid-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}
.project-attempts-selection-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}
.project-attempts-video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
    gap: 10px;
    align-content: start;
}
.project-attempt-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}
.project-attempt-card--selected .project-attempt-thumb-shell,
.project-attempt-card:has(.project-attempt-select-btn.selected) .project-attempt-thumb-shell,
.project-gallery-card:has(.project-attempt-select-btn.selected) .project-attempt-thumb-shell {
    outline: 2px solid #4a90e2;
    outline-offset: 1px;
    border-radius: 8px;
}
.project-attempt-thumb-shell {
    position: relative;
    width: 100%;
}
.project-attempt-thumb-wrap {
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 8px;
    background: #111;
}
.project-attempt-thumb-btn {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 8px;
}
.project-attempt-select-btn {
    position: absolute;
    top: 6px;
    left: 6px;
    z-index: 2;
    width: 22px;
    height: 22px;
    padding: 0;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-size: 12px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.project-attempt-select-btn.selected {
    background: #4a90e2;
    border-color: #4a90e2;
}
.project-attempt-card-meta {
    padding: 0 2px;
}
.project-attempts-empty {
    grid-column: 1 / -1;
    color: #666;
    font-size: 13px;
    font-style: italic;
    padding: 12px 0;
}
.project-journey-placeholder {
    color: #777;
    font-size: 13px;
    font-style: italic;
}

.projects-v2-gallery-columns-bar {
    margin-left: auto;
    justify-content: flex-end;
}
.projects-v2-gallery-columns-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    padding: 10px 4px;
    font-size: 14px;
    font-weight: 500;
    color: #888;
    user-select: none;
}
.projects-v2-gallery-columns-label.active {
    color: #FFF;
}
#projects-v2-gallery-columns-dec,
#projects-v2-gallery-columns-inc {
    min-width: 40px;
    padding-left: 12px;
    padding-right: 12px;
}

/* Gallery grid children shrink correctly on narrow screens */
@media (max-width: 768px) {
    #projects-v2-gallery-grid {
        max-width: 100%;
        min-width: 0;
    }
    #projects-v2-gallery-grid > * {
        min-width: 0;
    }
    .projects-v2-gallery-columns-bar {
        width: 100%;
        justify-content: flex-end;
    }
}

/* ── Upload page: loading spinner (client-side during XHR) ─────────── */
.upload-spinner-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: #4a9eff;
    animation: upload-spinner-pulse 0.8s ease-in-out infinite;
}
@keyframes upload-spinner-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.85); }
}

/* ── Upload page: clip trim UI ────────────────────────────────────── */
.upload-trim-section {
    margin-top: 12px;
    padding: 14px 16px;
    background: #0e0e20;
    border: 1px solid #2a2a4a;
    border-radius: 10px;
}
.upload-trim-header {
    color: #4a9eff;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.upload-trim-strip {
    height: 52px;
    background: #1a1a2e;
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    align-items: stretch;
    margin-bottom: 10px;
    border: 1px solid #2a2a4a;
}
/* Integrated timeline: frames + vertical trim handles + darkened exclusions */
.upload-trim-timeline {
    position: relative;
    height: 52px;
    margin-bottom: 10px;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #2a2a4a;
    background: #1a1a2e;
    touch-action: none;
    user-select: none;
    cursor: pointer;
}
.upload-trim-timeline--embedded {
    width: 100%;
    height: 48px;
    margin-bottom: 0;
    border-radius: 0;
    border: none;
    border-top: 1px solid #2a2a4a;
}
.upload-trim-timeline .upload-trim-strip {
    position: absolute;
    inset: 0;
    height: 100%;
    margin: 0;
    border: none;
    border-radius: 0;
    z-index: 1;
}
.upload-trim-overlay {
    position: absolute;
    top: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.68);
    pointer-events: none;
    z-index: 2;
}
.upload-trim-overlay--left {
    left: 0;
}
.upload-trim-overlay--right {
    right: 0;
}
.upload-trim-handle {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 3px;
    transform: translateX(-50%);
    background: #4a9eff;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.4), 0 0 10px rgba(74, 158, 255, 0.45);
    cursor: ew-resize;
    z-index: 3;
    touch-action: none;
}
.upload-trim-handle::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: -10px;
    right: -10px;
}
.upload-trim-handle--playhead {
    background: #fff;
    width: 2px;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35), 0 0 8px rgba(255, 255, 255, 0.35);
    cursor: grab;
    z-index: 4;
}
.upload-trim-handle--playhead:active {
    cursor: grabbing;
}
.upload-trim-handle--playhead::after {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid #fff;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.45));
}
.upload-trim-input-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
    padding: 0;
    margin: -1px;
}
/* Legacy dual-range slider container (upload page until migrated) */
.upload-trim-slider-wrap {
    position: relative;
    height: 36px;
    margin: 4px 0 8px;
    user-select: none;
}
.upload-trim-track {
    position: absolute;
    top: 14px;
    left: 0;
    right: 0;
    height: 8px;
    background: #2a2a4a;
    border-radius: 4px;
    pointer-events: none;
}
.upload-trim-range-highlight {
    position: absolute;
    top: 0;
    height: 8px;
    background: #4a9eff;
    border-radius: 4px;
}
.upload-trim-slider {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 36px;
    background: transparent;
    -webkit-appearance: none;
    appearance: none;
    pointer-events: none;
    outline: none;
    cursor: pointer;
}
.upload-trim-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    pointer-events: all;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #4a9eff;
    border: 3px solid #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.5);
    cursor: ew-resize;
    margin-top: 7px;
}
.upload-trim-slider::-moz-range-thumb {
    pointer-events: all;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #4a9eff;
    border: 3px solid #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.5);
    cursor: ew-resize;
}
.upload-trim-slider::-webkit-slider-runnable-track {
    background: transparent;
}
.upload-trim-labels {
    color: #888;
    font-size: 12px;
    text-align: center;
    margin-top: 2px;
    margin-bottom: 8px;
    letter-spacing: 0.3px;
}
.upload-trim-reset {
    display: block;
    width: 100%;
    padding: 6px;
    background: transparent;
    border: 1px solid #2a2a4a;
    border-radius: 6px;
    color: #666;
    font-size: 11px;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s;
}
.upload-trim-reset:hover {
    border-color: #4a9eff;
    color: #4a9eff;
}

/* ── Upload page: touch-friendly controls and dropdowns; unified colour scheme ───────────── */
#upload-video-page {
    touch-action: manipulation; /* reduce 300ms tap delay, allow scroll/pan */
    background-color: #1a1a2e;
    color: #EEE;
}
#upload-save-button {
    min-height: 48px !important;
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(74, 158, 255, 0.2);
    cursor: pointer;
}
/* Thumbnail row: allow horizontal scroll but make card tap immediate */
#upload-video-thumbnails {
    touch-action: pan-x manipulation;
}
.upload-thumb-card {
    min-height: 72px !important;
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(74, 158, 255, 0.15);
    user-select: none;
}
/* Metadata form and columns: stay tappable during upload (no overlay blocking) */
.projects-v2-metadata-form-scroll,
.projects-v2-metadata-edit-form {
    min-height: 0;
}
.projects-v2-metadata-edit-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.projects-v2-metadata-section {
    flex-shrink: 0;
}
.projects-v2-metadata-section > summary {
    cursor: pointer;
    user-select: none;
    padding: 2px 0;
}
.projects-v2-metadata-section > summary::-webkit-details-marker {
    display: none;
}
#projects-v2-metadata-editor .library-filter-dropdown .Select-control {
    min-height: 38px !important;
    background-color: #1a1a2e !important;
    border-color: #444 !important;
}
#projects-v2-metadata-editor .library-filter-dropdown .Select-value-label,
#projects-v2-metadata-editor .library-filter-dropdown .Select-placeholder {
    color: #EEE !important;
}
#upload-metadata-form,
#upload-metadata-columns,
#upload-metadata-columns-inner,
.upload-metadata-col {
    touch-action: manipulation;
    position: relative;
    z-index: 2;
}
/* Grid layout: 7 columns (apply, spacer, 5 metadata). Spacer 0 on desktop; mobile gives it width. */
.upload-metadata-columns-grid {
    display: grid;
    grid-template-columns: 72px 0 repeat(5, minmax(320px, 400px));
    grid-auto-rows: minmax(min-content, auto);
    gap: 16px;
    align-items: start;
}
.upload-metadata-columns-grid .upload-metadata-spacer-cell {
    min-width: 0;
    box-sizing: border-box;
}
.upload-metadata-columns-grid .upload-metadata-col {
    display: contents;
}
.upload-metadata-columns-grid .upload-metadata-section-cell {
    min-width: 0;
}
/* Apply column: align apply boxes with data content boxes (below section headings); no overflow so "Apply" text is visible. */
.upload-metadata-columns-grid .upload-metadata-apply-cell {
    min-width: 0;
    padding: 15px 8px;
    padding-top: 48px; /* align with data content box (below section heading) */
    box-sizing: border-box;
    overflow: visible;
}
.upload-metadata-columns-grid .upload-metadata-apply-cell:empty {
    padding-top: 15px;
}
/* Apply button is the whole box; no extra border on cell */
.upload-metadata-columns-grid .upload-metadata-apply-cell button {
    min-height: 44px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(74, 158, 255, 0.2);
}
/* Metadata columns expand to full content height (no scroll constraint). */
.upload-metadata-col {
    overflow: visible;
}
/* Ensure dropdown menus appear above other content and are tappable on mobile */
#upload-metadata-form .Select-menu-outer,
#upload-video-page .Select-menu-outer {
    z-index: 9999 !important;
    min-height: 44px;
}
#upload-metadata-form .Select-control,
#upload-video-page .Select-control {
    min-height: 44px !important;
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(255,255,255,0.1);
}
#upload-metadata-form .Select-option,
#upload-video-page .Select-option {
    min-height: 44px !important;
    padding: 12px 14px !important;
    display: flex !important;
    align-items: center !important;
    cursor: pointer !important;
    pointer-events: auto !important;
    touch-action: manipulation !important;
    -webkit-tap-highlight-color: rgba(74, 158, 255, 0.2) !important;
}
#upload-video-page .upload-metadata-col .Select-control,
#upload-video-page .upload-metadata-col .Select-option {
    min-height: 44px !important;
}
/* Quick Meta: always tappable during upload; isolate from thumbnail row touch/scroll */
#upload-quick-metadata-section,
#upload-video-page [id*="upload-quick-meta-col-wrap"] {
    position: relative;
    z-index: 20;
    isolation: isolate;
    touch-action: manipulation;
}
#upload-metadata-columns,
.upload-metadata-col {
    isolation: isolate;
    position: relative;
    z-index: 5;
}
.upload-quick-meta-btn-touch {
    min-height: 48px !important;
    min-width: 48px !important;
    touch-action: manipulation !important;
    -webkit-tap-highlight-color: rgba(74, 158, 255, 0.25) !important;
    pointer-events: auto !important;
}
#upload-video-page.quick-meta-cooldown .upload-quick-meta-btn-touch {
    pointer-events: none !important;
    opacity: 0.85;
}

.upload-recent-route-btn-touch {
    min-height: 44px !important;
    min-width: 44px !important;
    touch-action: manipulation !important;
    -webkit-tap-highlight-color: rgba(74, 158, 255, 0.25) !important;
    pointer-events: auto !important;
}

/* Apply to all videos: touch-friendly during upload (same stacking and tap targets as rest of form) */
#upload-video-page [id^="replicate-"] {
    position: relative;
    z-index: 10;
    touch-action: manipulation !important;
    -webkit-tap-highlight-color: rgba(74, 158, 255, 0.15) !important;
    pointer-events: auto !important;
}
#upload-video-page [id^="replicate-"] label,
#upload-video-page [id^="replicate-"] [role="checkbox"] {
    min-height: 44px !important;
    padding: 10px 8px 10px 0 !important;
    margin: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    touch-action: manipulation !important;
    cursor: pointer !important;
}
#upload-video-page [id^="replicate-"] input[type="checkbox"] {
    min-width: 22px !important;
    min-height: 22px !important;
    margin: 0 8px 0 0 !important;
}

/* ── Upload page: mobile layout (same colour scheme as desktop) ─────────────────────────── */
@media (max-width: 768px) {
    /* Remove the outer .main-content / .routed-page padding so the upload
       page can fill the full viewport width; unify background with desktop. */
    .main-content:has(#upload-video-page),
    .routed-page:has(#upload-video-page) {
        padding: 0 !important;
        background-color: #1a1a2e !important;
        color: #EEE;
    }

    /* Replace with a small direct padding on the page root itself. */
    #upload-video-page {
        padding: 12px !important;
        box-sizing: border-box;
        background-color: #1a1a2e;
        color: #EEE;
    }

    /* Shrink the preview height on small screens — 400px min is too tall. */
    #upload-preview-container {
        min-height: 220px !important;
        height: 40vh !important;
    }

    /* Trim panel: tighter padding on mobile. */
    .upload-trim-section {
        padding: 10px 10px !important;
    }

    /* Metadata columns: fill width + padding, swipeable; one column per view. */
    #upload-metadata-columns {
        overflow-x: auto !important;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x mandatory;
        scroll-behavior: smooth;
        width: 100%;
        max-width: calc(100vw - 24px); /* match page padding so first card fills exactly */
        box-sizing: border-box;
    }

    /* Focus 0: apply left-aligned (72px) + col 1 content to the right (overflow). Cards 1–5 = one metadata column each, full width. */
    .upload-metadata-columns-grid {
        --upload-card-width: calc(100vw - 24px);
        grid-template-columns: 72px 0 repeat(5, var(--upload-card-width));
        width: max-content;
        min-width: 100%;
        box-sizing: border-box;
    }

    .upload-metadata-columns-grid .upload-metadata-section-cell,
    .upload-metadata-columns-grid .upload-metadata-spacer-cell {
        min-width: 0;
        box-sizing: border-box;
    }

    /* Snap to start of first card (apply only). */
    .upload-metadata-columns-grid .upload-metadata-apply-cell.first-apply-cell {
        scroll-snap-align: start;
        scroll-snap-stop: normal;
        min-width: 72px;
    }
    .upload-metadata-columns-grid .upload-metadata-apply-cell.first-apply-cell::before {
        content: "\00a0";
        display: block;
        height: 0;
        overflow: hidden;
    }

    /* Snap to start of each metadata column (cards 1, 2, …). */
    .upload-metadata-columns-grid .upload-metadata-section-cell.first-in-col {
        scroll-snap-align: start;
        scroll-margin-left: 0;
    }

    .upload-metadata-columns-grid .upload-metadata-apply-cell {
        scroll-snap-align: none;
    }

    /* Prevent "Apply to all" rows from forcing the column wider than the viewport. */
    .upload-metadata-col [style*="flexWrap"],
    .upload-metadata-col .dash-checklist,
    .upload-metadata-col [id*="replicate"] {
        min-width: 0 !important;
        flex-shrink: 1 !important;
    }
}
