/* Coach Parush — Weekly Volume Calculator */
.vol-tool-page {
  --brand-yellow: var(--blue);
  --brand-hover: var(--blue-dark);
  --accent: var(--blue);
  --accent-hover: var(--blue-dark);
  --accent-soft: var(--blue-dim);
  --accent-rgb: 13, 173, 242;
  --col-min: 11rem;
  --card-bg: var(--surface-2);
  --border-color: var(--border);
  --border-light: var(--border);
  --text-primary: var(--white);
  --text-muted: var(--muted);
  --panel-bg: var(--surface-2);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 80px rgba(13, 173, 242, 0.12);
}

.vol-tool-page .resource-main {
  position: relative;
  z-index: 1;
}

body.resource-page.vol-tool-page .resource-main {
  padding-top: calc(var(--nav-h) + 1.75rem);
}

.vol-page-wrap {
  width: min(72rem, var(--container));
  margin-inline: auto;
}

.vol-calculator {
  padding-bottom: 2rem;
}

.vol-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.vol-legal-banner,
.vol-howto-bar {
  margin-bottom: 1rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface-2);
}

.vol-howto-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.vol-howto-bar__text {
  margin: 0;
  font-size: 0.875rem;
  color: var(--muted);
  flex: 1;
  min-width: 12rem;
}

.vol-legal-banner__text {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--muted);
}

.vol-toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 500;
  padding: 0.75rem 1.25rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--white);
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}

.vol-toast.hidden { display: none; }
.vol-toast:not(.hidden) { display: flex; align-items: center; gap: 0.5rem; }

.vol-accent { background-color: var(--blue) !important; }
.vol-accent-text { color: var(--blue-bright) !important; }
.vol-accent-border { border-color: var(--blue) !important; }
.hover\:vol-accent-text:hover { color: var(--blue-bright) !important; }

.planner-weekly .glass-panel,
.planner-weekly .modal-content {
  background: var(--surface-2);
  border-color: var(--border);
}

.planner-weekly .text-neutral-200,
.planner-weekly .text-white { color: var(--white); }
.planner-weekly .text-neutral-400 { color: var(--muted); }

#app-sidebar,
#app-sidebar-overlay {
  display: none !important;
}

#planner-form.weekly-board {
  display: grid;
  grid-template-columns: repeat(7, minmax(var(--col-min), 1fr));
  gap: 0.75rem;
  direction: inherit;
  min-height: 50vh;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 0.5rem;
  scroll-snap-type: x proximity;
}

html[dir="rtl"] #planner-form.weekly-board {
  direction: rtl;
}

html[dir="ltr"] #planner-form.weekly-board {
  direction: ltr;
}

@media (max-width: 1200px) {
  #planner-form.weekly-board {
    grid-template-columns: repeat(7, minmax(10.5rem, 1fr));
  }
}

@media (max-width: 768px) {
  #planner-form.weekly-board {
    grid-template-columns: repeat(7, min(85vw, 18rem));
    scroll-snap-type: x mandatory;
  }

  #planner-form.weekly-board .day-column {
    scroll-snap-align: center;
  }
}

@media (max-width: 768px) {
  body.resource-page.vol-tool-page .resource-main {
    padding-top: calc(var(--nav-h) + 0.65rem);
  }

  .vol-quick-actions .btn {
    flex: 1 1 auto;
  }

  .volume-strip {
    flex-direction: column;
    align-items: stretch !important;
  }
}

        #global-tooltip .tooltip-subline--accent {
            color: rgba(var(--accent-rgb, 13, 173, 242), 0.92);
        }
        #global-tooltip .tooltip-subline--info {
            color: rgb(96 165 250 / 0.92);
        }
        #global-tooltip .tooltip-warn {
            color: rgb(251 146 60 / 0.95);
        }
        #global-tooltip strong,
        #global-tooltip b {
            font-weight: var(--fw-semibold);
            color: var(--text-primary);
        }
        .text-role-cta {
            font-size: var(--text-small);
            font-weight: var(--fw-bold);
            line-height: var(--lh-snug);
        }
        /* KPI / hero numbers (nutrition sliders, export totals) */
        .text-kpi {
            font-size: var(--text-heading);
            font-weight: var(--fw-bold);
            line-height: var(--lh-tight);
            color: var(--brand-yellow);
        }
        .text-kpi--on-dark {
            color: var(--text-primary);
        }

        input, select, textarea, button {
            font-family: 'Ploni', sans-serif;
            font-size: max(var(--text-body), 16px); /* Prevents iOS Safari auto-zoom */
            text-rendering: optimizeLegibility;
            font-kerning: normal;
        }
        
        /* Force bold weight for input fields */
        input[type="text"],
        input[type="number"],
        input[type="search"],
        input:not([type]),
        textarea {
            font-weight: 800 !important;
        }
        ::-webkit-scrollbar {
            width: 8px;
        }
        ::-webkit-scrollbar-track {
            background: rgba(38, 38, 38, 0.5);
            border-radius: 4px;
        }
        ::-webkit-scrollbar-thumb {
            background: #525252;
            border-radius: 4px;
        }
        ::-webkit-scrollbar-thumb:hover {
            background: #38bdf8;
        }
        .custom-scrollbar::-webkit-scrollbar {
            height: 6px;
        }
        .custom-scrollbar::-webkit-scrollbar-track {
            background: rgba(255, 255, 255, 0.05);
            border-radius: 10px;
        }
        .custom-scrollbar::-webkit-scrollbar-thumb {
            background: rgba(var(--accent-rgb), 0.2);
            border-radius: 10px;
        }
        .custom-scrollbar:hover::-webkit-scrollbar-thumb {
            background: rgba(var(--accent-rgb), 0.5);
        }
        @keyframes slideUp {
            from { transform: translateY(100%); opacity: 0; }
            to { transform: translateY(0); opacity: 1; }
        }
        .toast-enter {
            animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
        }
        
        /* ===== WEEKLY BOARD — Kanban Layout (see also #planner-form.weekly-board above) ===== */
        .weekly-board {
            display: grid;
            grid-template-columns: repeat(7, minmax(var(--col-min), 1fr));
            gap: 12px;
            direction: inherit;
            min-height: 55vh;
            padding: 0 0 1rem 0;
        }
        @media (max-width: 1200px) {
            .weekly-board {
                grid-template-columns: repeat(7, minmax(200px, 1fr));
                overflow-x: auto;
                -webkit-overflow-scrolling: touch;
                scroll-snap-type: x proximity;
                padding-bottom: 12px;
            }
        }
        @media (max-width: 768px) {
            .weekly-board {
                grid-template-columns: repeat(7, 85vw);
                scroll-snap-type: x mandatory;
            }
            .day-column { scroll-snap-align: center; }
        }

        .day-column {
            display: flex;
            flex-direction: column;
            background: var(--card-bg);
            backdrop-filter: blur(12px);
            border: 1px solid var(--border-color);
            border-radius: var(--radius-xl);
            overflow: hidden;
            transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
            min-height: 350px;
            box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), var(--shadow-sm);
        }
        .day-column:hover {
            border-color: rgba(var(--accent-rgb), 0.3);
            box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), var(--shadow-lg), var(--shadow-glow);
            transform: translateY(-2px);
        }
        .day-column.is-rest {
            opacity: 0.55;
            border-style: dashed;
        }
        .day-column.drag-over {
            border-color: var(--accent) !important;
            box-shadow: 0 0 0 2px var(--accent-soft), var(--shadow-lg) !important;
            opacity: 1 !important;
        }

        .day-column-header {
            padding: 14px 16px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            user-select: none;
            border-bottom: 1px solid var(--border-light);
            background: linear-gradient(180deg, rgba(255,255,255,0.03) 0%, transparent 100%);
            flex-shrink: 0;
        }

        .day-column-body {
            flex: 1;
            padding: 10px;
            display: flex;
            flex-direction: column;
            gap: 8px;
            overflow-y: auto;
            min-height: 0;
        }

        .day-column-footer {
            padding: 8px 10px;
            border-top: 1px solid var(--border-light);
            flex-shrink: 0;
        }

        /* ===== CONTROL BAR ===== */
        .control-bar {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
            padding: 12px 16px;
            background: var(--panel-bg);
            backdrop-filter: blur(20px);
            border: 1px solid var(--border-color);
            border-radius: 1rem;
            margin-bottom: 16px;
            flex-wrap: wrap;
            position: relative;
            z-index: 100; /* High z-index to keep dropdown above other content */
        }

        .volume-strip {
            display: flex;
            gap: 6px;
            padding: 12px 16px;
            background: var(--panel-bg);
            backdrop-filter: blur(20px);
            border: 1px solid var(--border-color);
            border-radius: 1rem;
            margin-bottom: 16px; /* Space below it before planner board */
            overflow-x: auto;
            flex-wrap: wrap;
            position: relative;
            z-index: 10; /* Stacks safely underneath control-bar popups */
        }

        /* ===== BULK EDIT ===== */
        .bulk-checkbox { display: none !important; }
        .bulk-edit-active .grab-handle { display: none !important; }
        .bulk-edit-active .bulk-checkbox { display: flex !important; }
        .bulk-edit-active .delete-btn { display: none !important; }

         .glass-panel {
             background: var(--panel-bg);
             backdrop-filter: blur(24px);
             -webkit-backdrop-filter: blur(24px);
             border: 1px solid var(--border-color);
             box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), var(--shadow-md);
             position: relative;
             z-index: 1;
             transition: z-index 0s, border-color 0.3s, box-shadow 0.3s;
         }
         .glass-panel:focus-within {
             z-index: 30;
         }
        
        .muscle-item {
            background: rgba(0, 0, 0, 0.2);
            border: 1px solid var(--border);
            padding: 10px 12px;
            border-radius: var(--radius-sm);
            display: flex;
            align-items: center;
            gap: 10px;
            transition: border-color 0.2s ease;
            position: relative;
            overflow: hidden;
        }

        .muscle-item--static {
            cursor: default;
            user-select: none;
        }

        .muscle-item--static .planner-muscle-name {
            font-weight: 600;
            color: var(--white);
        }

        .group-card {
            border: 1px solid var(--border);
            border-radius: var(--radius-sm);
            background: rgba(0, 0, 0, 0.15);
            overflow: hidden;
            margin-bottom: 0.35rem;
        }

        .group-card-header {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            padding: 0.65rem 0.75rem;
            border-bottom: 1px solid var(--border);
            background: rgba(255, 255, 255, 0.02);
        }

        .planner-group-name--static {
            flex: 1;
            min-width: 0;
            font-weight: 700;
            font-size: 0.875rem;
            color: var(--white);
        }
        .muscle-item::before {
            content: '';
            position: absolute;
            inset: 0;
            background: linear-gradient(90deg, rgba(var(--accent-rgb), 0) 0%, rgba(var(--accent-rgb), 0.04) 50%, rgba(var(--accent-rgb), 0) 100%);
            transform: translateX(-100%);
            transition: transform 0.4s ease;
        }
        .muscle-item:hover {
            border-color: rgba(var(--accent-rgb), 0.3);
            background: rgba(0, 0, 0, 0.4);
            transform: scale(1.01);
            box-shadow: 0 2px 8px rgba(0,0,0,0.2);
        }
        .muscle-item:hover::before {
            transform: translateX(100%);
        }
        .vol-chip {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 8px 14px;
            background: rgba(0, 0, 0, 0.4);
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: 2rem;
            font-size: var(--text-ui);
            font-weight: 600;
            white-space: nowrap;
            transition: all 0.2s ease;
        }
        .vol-chip:hover {
            border-color: rgba(var(--accent-rgb), 0.35);
        }

        .vol-summary-chip {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            padding: 4px 10px;
            border-radius: 999px;
            font-size: var(--text-caption);
            font-weight: var(--fw-semibold);
            background: rgba(255, 255, 255, 0.04);
            border: 1px solid rgba(255, 255, 255, 0.08);
            color: var(--text-secondary, rgba(255, 255, 255, 0.75));
        }
        .vol-summary-chip--ok    { background: rgba(34, 197, 94, 0.12);  border-color: rgba(34, 197, 94, 0.35);  color: #4ade80; }
        .vol-summary-chip--low   { background: rgba(234, 179, 8, 0.12);  border-color: rgba(234, 179, 8, 0.35);  color: #facc15; }
        .vol-summary-chip--high  { background: rgba(249, 115, 22, 0.12); border-color: rgba(249, 115, 22, 0.35); color: #fb923c; }
        .vol-summary-chip--ghost { background: rgba(120, 120, 120, 0.12);border-color: rgba(160, 160, 160, 0.25);color: rgba(255,255,255,0.6); }

        .vol-tile-status {
            font-size: var(--text-caption);
            font-weight: var(--fw-medium);
            line-height: 1.2;
        }

        .vol-tile {
            transition: border-color 200ms ease, box-shadow 200ms ease;
        }
        .vol-tile[data-status="optimal"] { box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.08) inset; }
        .vol-tile[data-status="over"]    { box-shadow: 0 0 0 1px rgba(249, 115, 22, 0.10) inset; }
        .vol-tile[data-status="low"],
        .vol-tile[data-status="below_target"] { box-shadow: 0 0 0 1px rgba(234, 179, 8, 0.10) inset; }
        
        /* Focus State Contrast */
        .glass-input:focus {
            background: rgba(0, 0, 0, 0.6);
            border-color: #38bdf8;
            box-shadow: 0 0 0 4px rgba(var(--accent-rgb), 0.1);
        }
        
        /* Animation Utilities */
        .animate-in {
            animation-duration: 0.3s;
            animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
            animation-fill-mode: both;
        }
        @keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
        @keyframes slideInDown { from { transform: translateY(-10px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
        .fade-in { animation-name: fadeIn; }
        .slide-in-from-top-2 { animation-name: slideInDown; }
        
        /* Accessibility Contrast Check */
        .text-neutral-400 { color: #a3a3a3; } /* Meets 4.5:1 on #171717 */
        .text-neutral-500 { color: #737373; } /* Might be low, bump up where critical */
        
        /* Remove arrows from number input */
        input[type=number]::-webkit-inner-spin-button, 
        input[type=number]::-webkit-outer-spin-button { 
            -webkit-appearance: none; 
            margin: 0; 
        }
        /* Drag and Drop Helpers */
        body.dragging-active .day-column-body * {
            pointer-events: none;
        }
        
        .glass-panel {
            background: var(--panel-bg);
            backdrop-filter: blur(20px);
            -webkit-backdrop-filter: blur(20px);
            border: 1px solid var(--border-color);
            box-shadow: var(--shadow-md);
        }
        
        .glass-input {
            background: rgba(10, 10, 10, 0.8);
            border: 1px solid rgba(255, 255, 255, 0.12);
            color: var(--text-primary);
            backdrop-filter: blur(10px);
            -webkit-backdrop-filter: blur(10px);
            padding: 0.625rem 0.75rem;
            border-radius: var(--radius-lg);
            font-size: var(--text-body);
            line-height: var(--lh-normal);
            min-height: 40px;
            transition: border-color 0.2s ease, box-shadow 0.2s ease;
        }
        .glass-input:focus {
            background: var(--input-bg);
            border-color: var(--accent);
            box-shadow: 0 0 0 2px var(--accent-soft);
            outline: none;
        }

        /* CRM create-client modal — consistent field sizing */
        #create-client-modal .crm-form-input,
        #create-client-modal .dropdown-trigger {
            width: 100%;
            min-height: 44px;
        }
        #create-client-modal .searchable-dropdown,
        #edit-client-modal .searchable-dropdown {
            z-index: 60;
        }
        #create-client-modal .dropdown-menu,
        #edit-client-modal .dropdown-menu {
            z-index: 300;
        }
        #create-client-modal .searchable-dropdown.is-open,
        #edit-client-modal .searchable-dropdown.is-open {
            z-index: 70;
        }
        #create-client-modal .dropdown-trigger .selected-text,
        #edit-client-modal .dropdown-trigger .selected-text {
            font-size: var(--text-ui);
            font-weight: var(--fw-semibold);
        }
        #create-client-modal .activity-factor-dropdown,
        #edit-client-modal .activity-factor-dropdown {
            position: relative;
        }
        #create-client-modal .activity-factor-trigger,
        #edit-client-modal .activity-factor-trigger {
            display: flex;
            align-items: center;
            gap: 0.35rem;
            padding-inline: 0.65rem 0.35rem;
            cursor: default;
            width: 100%;
            min-height: 44px;
        }
        #create-client-modal .activity-factor-menu,
        #edit-client-modal .activity-factor-menu,
        .dropdown-menu--portal.activity-factor-menu {
            width: 100%;
            min-width: min(16.25rem, 92vw);
            max-width: min(28rem, 92vw);
        }
        #create-client-modal .activity-factor-item,
        #edit-client-modal .activity-factor-item {
            align-items: flex-start;
            white-space: normal;
            line-height: var(--lh-snug);
        }
        #hub-client-bar-mount .client-bar-edit-btn,
        .planner-weekly #planner-client-bar .client-bar-edit-btn {
            opacity: 1;
        }
        #create-client-modal .activity-factor-input,
        #edit-client-modal .activity-factor-input {
            flex: 1 1 auto;
            min-width: 0;
            border: none;
            background: transparent;
            color: inherit;
            font-size: var(--text-ui);
            font-weight: var(--fw-semibold);
            outline: none;
            padding: 0;
            -moz-appearance: textfield;
        }
        #create-client-modal .activity-factor-input::-webkit-outer-spin-button,
        #create-client-modal .activity-factor-input::-webkit-inner-spin-button,
        #edit-client-modal .activity-factor-input::-webkit-outer-spin-button,
        #edit-client-modal .activity-factor-input::-webkit-inner-spin-button {
            -webkit-appearance: none;
            margin: 0;
        }
        #create-client-modal .activity-factor-chevron-btn,
        #edit-client-modal .activity-factor-chevron-btn {
            flex: 0 0 auto;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 0.35rem 0.5rem;
            margin: 0;
            border: none;
            background: transparent;
            color: inherit;
            cursor: pointer;
            border-radius: 0.5rem;
        }
        #create-client-modal .activity-factor-chevron-btn:hover,
        #edit-client-modal .activity-factor-chevron-btn:hover {
            background: rgba(255, 255, 255, 0.06);
        }

        /* Program summary — header card */
        #program-summary-view .ps-header-inner {
            display: flex;
            flex-wrap: wrap;
            align-items: center;
            gap: 0.65rem 0.85rem;
        }
        #program-summary-view .ps-header-main {
            flex: 1 1 12rem;
            min-width: 0;
            text-align: start;
        }
        #program-summary-view .ps-header-program-line {
            display: flex;
            flex-wrap: wrap;
            align-items: center;
            gap: 0.35rem 0.65rem;
            min-width: 0;
        }
        #program-summary-view .ps-block-title {
            margin: 0;
            font-size: var(--text-heading);
            font-weight: var(--fw-bold);
            line-height: var(--lh-tight);
            color: var(--text-primary, #fff);
            letter-spacing: -0.02em;
        }
        #program-summary-view .ps-client-name {
            font-size: var(--text-small);
            font-weight: var(--fw-semibold);
            color: var(--text-secondary);
            line-height: var(--lh-snug);
        }
        #program-summary-view .ps-header-sep {
            opacity: 0.45;
            color: var(--text-secondary);
        }
        #program-summary-view .ps-strategy {
            margin: 0.35rem 0 0;
            line-height: var(--lh-snug);
        }
        #program-summary-view .ps-export-bar {
            display: flex;
            flex-wrap: wrap;
            align-items: center;
            justify-content: space-between;
            gap: 0.75rem 1rem;
            padding: 0.85rem 1rem;
            border-radius: 1rem;
            background: rgba(var(--accent-rgb, 56 189 248), 0.07);
            border: 1px solid rgba(var(--accent-rgb, 56 189 248), 0.18);
        }
        #program-summary-view .ps-export-bar-text {
            display: flex;
            flex-direction: column;
            gap: 0.15rem;
            min-width: 0;
            flex: 1 1 12rem;
        }
        #program-summary-view .ps-export-bar-title {
            font-size: var(--text-small);
            font-weight: var(--fw-semibold);
            color: var(--text-primary, #fff);
            line-height: var(--lh-snug);
        }
        #program-summary-view .ps-export-bar-hint {
            font-size: var(--text-caption);
            font-weight: var(--fw-medium);
            color: var(--text-secondary);
            line-height: var(--lh-snug);
        }
        #program-summary-view .ps-export-btn {
            display: inline-flex;
            align-items: center;
            gap: 0.5rem;
            padding: 0.6rem 1rem;
            border-radius: 0.75rem;
            border: 1px solid rgba(var(--accent-rgb, 56 189 248), 0.45);
            background: rgba(var(--accent-rgb, 56 189 248), 0.18);
            color: var(--text-primary, #fff);
            font-size: var(--text-small);
            font-weight: var(--fw-semibold);
            line-height: var(--lh-snug);
            cursor: pointer;
            transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
            flex-shrink: 0;
        }
        #program-summary-view .ps-export-btn:hover {
            background: rgba(var(--accent-rgb, 56 189 248), 0.28);
            border-color: rgba(var(--accent-rgb, 56 189 248), 0.65);
        }
        #program-summary-view .ps-export-btn:active {
            transform: scale(0.98);
        }
        #program-summary-view .ps-export-btn__icon {
            width: 1.05rem;
            height: 1.05rem;
            flex-shrink: 0;
            opacity: 0.85;
        }
        .ps-export-textarea {
            line-height: 1.65;
            text-align: start;
            white-space: pre-wrap;
            word-break: break-word;
        }
        html[dir="rtl"] .ps-export-textarea,
        .ps-export-textarea.ps-export-textarea--rtl {
            direction: rtl;
            text-align: right;
            font-family: 'Ploni', sans-serif;
            letter-spacing: normal;
        }
        html[dir="ltr"] .ps-export-textarea,
        .ps-export-textarea.ps-export-textarea--ltr {
            direction: ltr;
            text-align: left;
            font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
            line-height: 1.55;
        }
        .ps-export-option {
            display: flex;
            align-items: flex-start;
            gap: 0.65rem;
            margin: 0.75rem 0 0.65rem;
            padding: 0.65rem 0.85rem;
            border-radius: 0.75rem;
            background: rgba(255, 255, 255, 0.04);
            border: 1px solid rgba(255, 255, 255, 0.08);
            cursor: pointer;
            flex-shrink: 0;
        }
        .ps-export-option__input {
            flex-shrink: 0;
            width: 1rem;
            height: 1rem;
            margin-top: 0.15rem;
            accent-color: rgb(var(--accent-rgb, 56 189 248));
            cursor: pointer;
        }
        .ps-export-option__label {
            font-size: var(--text-small);
            font-weight: var(--fw-medium);
            color: var(--text-secondary);
            line-height: var(--lh-snug);
            cursor: pointer;
        }
        #program-summary-view .ps-schedule-row {
            display: flex;
            flex-wrap: wrap;
            align-items: center;
            gap: 0.5rem 0.65rem;
            flex: 2 1 auto;
            min-width: 0;
        }
        #program-summary-view .ps-schedule-tile {
            display: flex;
            flex-direction: row;
            align-items: center;
            gap: 0.5rem 0.65rem;
            padding: 0.5rem 0.85rem;
            border-radius: 0.875rem;
            background: rgba(0, 0, 0, 0.28);
            border: 1px solid rgba(255, 255, 255, 0.08);
            min-width: 0;
            flex: 0 1 auto;
        }
        #program-summary-view .ps-schedule-label {
            display: block;
            margin: 0;
            flex-shrink: 0;
            white-space: nowrap;
            font-size: var(--text-caption);
            font-weight: var(--fw-medium);
            color: var(--text-secondary);
            letter-spacing: normal;
            text-transform: none;
        }
        #program-summary-view .ps-schedule-input {
            width: auto;
            min-width: 0;
            flex: 0 1 auto;
            min-height: auto;
            padding: 0;
            border: none;
            border-radius: 0;
            background: transparent;
            color: var(--text-primary, #fff);
            font-size: var(--text-subheading);
            font-weight: var(--fw-bold);
            line-height: var(--lh-snug);
            box-shadow: none;
        }
        #program-summary-view .ps-schedule-input:focus {
            outline: 2px solid rgba(var(--accent-rgb, 56 189 248), 0.55);
            outline-offset: 2px;
            border-radius: 0.25rem;
        }
        #program-summary-view .ps-schedule-input[type="date"] {
            width: 9.25rem;
            max-width: 100%;
        }
        #program-summary-view .ps-schedule-input--num {
            width: 2.75rem;
            flex: 0 0 auto;
            text-align: start;
        }
        #program-summary-view .ps-schedule-duration {
            display: flex;
            align-items: baseline;
            gap: 0.35rem;
            min-width: 0;
        }
        #program-summary-view .ps-schedule-unit {
            font-size: var(--text-small);
            font-weight: var(--fw-semibold);
            color: var(--text-secondary);
            white-space: nowrap;
        }
        #program-summary-view .ps-status-pill {
            display: inline-flex;
            align-items: center;
            padding: 0.3rem 0.75rem;
            border-radius: 999px;
            font-size: var(--text-small);
            font-weight: var(--fw-bold);
            border: 1px solid rgba(255, 255, 255, 0.12);
            background: rgba(0, 0, 0, 0.35);
            white-space: nowrap;
        }
        #program-summary-view .ps-status-pill--active {
            color: var(--brand-yellow, #38bdf8);
            border-color: rgba(56, 189, 248, 0.35);
            background: rgba(56, 189, 248, 0.1);
        }
        #program-summary-view .ps-status-pill--inactive {
            color: var(--text-secondary);
        }

        /* Legacy meta grid (section bodies) */
        #program-summary-view .ps-meta-grid {
            display: grid;
            grid-template-columns: repeat(2, minmax(0, 1fr));
            gap: 1rem 1.25rem;
            width: 100%;
            max-width: 32rem;
        }
        @media (min-width: 768px) {
            #program-summary-view .ps-meta-grid {
                grid-template-columns: repeat(4, minmax(0, 1fr));
                max-width: none;
            }
        }
        #program-summary-view .ps-meta-label {
            display: block;
            margin-bottom: 0.5rem;
        }
        #program-summary-view .ps-meta-label,
        #program-summary-view .ps-stat-label,
        #program-summary-view .ps-detail-title,
        #program-summary-view .ps-week-day-label,
        #program-summary-view .ps-macro-name {
            font-size: var(--text-caption);
            font-weight: var(--fw-medium);
            color: var(--text-secondary);
            letter-spacing: normal;
            text-transform: none;
        }
        #program-summary-view .ps-meta-input {
            width: 100%;
            min-height: 44px;
            font-size: var(--text-small);
            font-weight: 700;
        }
        #program-summary-view .ps-meta-input--narrow {
            width: 4.5rem;
            min-width: 4.5rem;
        }
        #program-summary-view .ps-meta-inline {
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }
        #program-summary-view .ps-meta-suffix {
            font-size: var(--text-caption);
            font-weight: 700;
            color: var(--text-secondary);
            white-space: nowrap;
        }
        #program-summary-view .ps-meta-status {
            display: flex;
            align-items: center;
            min-height: 44px;
            font-size: var(--text-small);
            font-weight: 800;
        }

        /* Planner — cloud save status */
        .planner-save-status {
            display: inline-flex;
            align-items: center;
            gap: 0.4rem;
            padding: 0.35rem 0.65rem;
            border-radius: 999px;
            font-size: var(--text-caption);
            font-weight: var(--fw-semibold);
            border: 1px solid rgba(255, 255, 255, 0.1);
            background: rgba(0, 0, 0, 0.35);
            color: var(--text-secondary);
            max-width: 14rem;
            line-height: 1.2;
        }
        .planner-save-status::before {
            content: '';
            width: 7px;
            height: 7px;
            border-radius: 50%;
            background: currentColor;
            flex-shrink: 0;
        }
        .planner-save-status[data-status="cloud"] {
            color: var(--brand-yellow, #38bdf8);
            border-color: rgba(56, 189, 248, 0.35);
            background: rgba(56, 189, 248, 0.08);
        }
        .planner-save-status[data-status="saving"],
        .planner-save-status[data-status="pending"] {
            color: rgb(250 204 21);
            border-color: rgba(250, 204, 21, 0.3);
        }
        .planner-save-status[data-status="local"] {
            color: var(--text-secondary);
        }
        .planner-save-status[data-status="auth"],
        .planner-save-status[data-status="error"] {
            color: rgb(248 113 113);
            border-color: rgba(248, 113, 113, 0.35);
            background: rgba(248, 113, 113, 0.08);
        }

        /* Program summary — section cards (hero + detail) */
        #program-summary-view .ps-section-body {
            display: flex;
            flex-direction: column;
            gap: 0.75rem;
        }
        #program-summary-view .ps-section-banner {
            font-size: var(--text-caption);
            font-weight: 700;
            margin: 0;
            line-height: 1.35;
        }
        #program-summary-view .ps-section-banner--draft {
            color: rgb(251 191 36 / 0.95);
        }
        #program-summary-view .ps-hero-grid {
            display: grid;
            gap: 0.65rem;
        }
        #program-summary-view .ps-hero-grid--nutrition {
            grid-template-columns: 1fr;
        }
        @media (min-width: 768px) {
            #program-summary-view .ps-hero-grid--nutrition {
                grid-template-columns: 2fr 1fr 1fr;
            }
        }
        #program-summary-view .ps-hero-grid--workout {
            grid-template-columns: 1fr 1fr;
        }
        @media (min-width: 768px) {
            #program-summary-view .ps-hero-grid--workout {
                grid-template-columns: 1fr 1fr 1.35fr;
            }
        }
        #program-summary-view .ps-stat-tile {
            background: rgba(0, 0, 0, 0.3);
            border: 1px solid rgba(255, 255, 255, 0.06);
            border-radius: 0.75rem;
            padding: 0.85rem 1rem;
            display: flex;
            flex-direction: column;
            justify-content: center;
            gap: 0.2rem;
            min-height: 4.5rem;
        }
        #program-summary-view .ps-stat-hero {
            border-color: rgba(56, 189, 248, 0.2);
            background: linear-gradient(135deg, rgba(56, 189, 248, 0.08), rgba(0, 0, 0, 0.35));
        }
        #program-summary-view .ps-stat-tile--stack {
            gap: 0.15rem;
        }
        #program-summary-view .ps-stat-label--secondary {
            margin-top: 0.35rem;
        }
        #program-summary-view .ps-stat-value {
            font-size: var(--text-stat-hero);
            font-weight: var(--fw-black);
            line-height: 1.1;
            color: #fff;
        }
        #program-summary-view .ps-stat-value--hero {
            color: var(--brand-yellow, #38bdf8);
        }
        #program-summary-view .ps-stat-value--accent {
            color: var(--brand-yellow, #38bdf8);
        }
        #program-summary-view .ps-stat-value--text {
            font-size: var(--text-body);
            font-weight: var(--fw-bold);
            line-height: 1.25;
        }
        #program-summary-view .ps-stat-value--sm {
            font-size: var(--text-small);
            color: rgb(212 212 212);
        }
        #program-summary-view .ps-stat-unit {
            font-size: var(--text-unit-scale);
            font-weight: var(--fw-semibold);
            color: var(--text-secondary);
            margin-inline-start: 0.2em;
        }
        #program-summary-view .ps-stat-sub {
            font-size: var(--text-caption);
            font-weight: var(--fw-medium);
            color: var(--text-secondary);
            line-height: 1.35;
            margin-top: 0.15rem;
        }
        #program-summary-view .ps-detail-panel {
            background: rgba(0, 0, 0, 0.3);
            border: 1px solid rgba(255, 255, 255, 0.06);
            border-radius: 0.75rem;
            padding: 0.85rem 1rem;
        }
        #program-summary-view .ps-detail-title {
            display: block;
            margin-bottom: 0.65rem;
        }
        #program-summary-view .ps-volume-chips {
            display: flex;
            flex-wrap: wrap;
            gap: 0.5rem;
        }
        #program-summary-view .ps-week-board {
            display: grid;
            grid-template-columns: repeat(2, minmax(0, 1fr));
            gap: 0.5rem;
        }
        @media (min-width: 640px) {
            #program-summary-view .ps-week-board {
                grid-template-columns: repeat(4, minmax(0, 1fr));

        .group-card-child + .group-card-child {
            border-top: 1px solid var(--border-light);
        }

        /* ===== WEEKLY PLANNER TYPOGRAPHY (.planner-weekly) ===== */
        .planner-weekly #view-split .text-neutral-500,
        .planner-weekly #view-split .text-neutral-400,
        .planner-weekly #planner-client-bar .text-neutral-500 {
            color: var(--text-secondary);
        }
        .planner-weekly #planner-client-bar .text-role-label,
        .planner-weekly #planner-client-bar .text-role-value,
        #hub-client-bar-mount #planner-client-bar .text-role-label,
        #hub-client-bar-mount #planner-client-bar .text-role-value {
            display: block;
        }
        .planner-weekly .planner-nav-link {
            font-size: var(--text-ui);
            font-weight: var(--fw-semibold);
        }
        .planner-weekly .planner-palette-search {
            font-size: var(--text-subheading);
            font-weight: var(--fw-semibold);
            line-height: var(--lh-snug);
        }
        .planner-weekly .planner-summary-text {
            font-size: var(--text-ui);
            font-weight: var(--fw-normal);
            line-height: var(--lh-relaxed);
            color: var(--text-secondary);
            font-family: 'Ploni', sans-serif;
        }
        .planner-weekly #bulk-action-bar {
            font-size: var(--text-ui);
        }
        .planner-weekly .planner-chart-label {
            font-size: var(--text-caption);
            font-weight: var(--fw-semibold);
        }
        .planner-weekly .planner-chart-target {
            font-size: var(--text-caption);
            font-weight: var(--fw-semibold);
            color: rgba(var(--accent-rgb), 0.85);
        }
        .planner-weekly .planner-chart-hover {
            font-size: var(--text-caption);
            font-weight: var(--fw-semibold);
            color: #fff;
        }
        .planner-weekly .planner-status-badge {
            font-size: var(--text-caption);
            font-weight: var(--fw-semibold);
        }
        .planner-weekly #view-split .planner-targets-label {
            font-size: var(--text-subheading);
            font-weight: var(--fw-semibold);
            color: var(--text-secondary);
        }
        .planner-weekly #view-split .planner-targets-badge {
            font-size: var(--text-caption);
            font-weight: var(--fw-medium);
            color: var(--text-secondary);
        }
        .planner-weekly #view-split .volume-legend-item {
            font-size: var(--text-caption);
            font-weight: var(--fw-medium);
            color: var(--text-secondary);
        }
        .planner-weekly #view-split .day-sets-total {
            font-size: var(--text-caption);
            font-weight: var(--fw-semibold);
        }
        .planner-weekly #view-split .vol-chip-name {
            font-size: var(--text-ui);
            font-weight: var(--fw-medium);
            color: var(--text-primary);
        }
        .planner-weekly #view-split .vol-chip-value {
            font-size: var(--text-body);
            font-weight: var(--fw-semibold);
        }
        .planner-weekly #view-split .planner-muscle-name {
            font-size: var(--text-ui);
            font-weight: var(--fw-semibold);
            color: var(--text-primary);
        }
        .planner-weekly #view-split .group-card-child .planner-muscle-name {
            font-size: var(--text-small);
        }
        .planner-weekly #view-split .planner-group-name {
            font-size: var(--text-ui);
            font-weight: var(--fw-semibold);
            color: var(--text-primary);
        }
        .planner-weekly #view-split input.planner-group-name {
            border: 1px solid transparent;
            border-radius: 0.5rem;
            padding: 0.125rem 0.375rem;
            margin: -0.125rem -0.375rem;
            transition: border-color 0.15s ease, background-color 0.15s ease;
        }
        .planner-weekly #view-split input.planner-group-name:hover,
        .planner-weekly #view-split input.planner-group-name:focus {
            border-color: rgba(255, 255, 255, 0.15);
            background-color: rgba(0, 0, 0, 0.25);
        }
        .planner-weekly #view-split .planner-sets-input {
            font-size: var(--text-ui);
            font-weight: var(--fw-bold);
        }
        .planner-weekly #view-split .planner-sets-label {
            font-size: var(--text-caption);
            font-weight: var(--fw-medium);
        }
        .planner-weekly #view-split .planner-macro-sets {
            font-size: var(--text-ui);
            font-weight: var(--fw-bold);
        }
        .planner-weekly #view-split .planner-event-title {
            font-size: var(--text-ui);
            font-weight: var(--fw-semibold);
            color: var(--brand-yellow);
        }
        .planner-weekly #view-split .planner-event-notes {
            font-size: var(--text-small);
            font-weight: var(--fw-normal);
            color: var(--text-secondary);
        }
        .planner-weekly #view-split .planner-footer-btn {
            font-size: var(--text-ui);
            font-weight: var(--fw-medium);
        }
        .planner-weekly #view-split .planner-toolbar-btn {
            font-size: var(--text-small);
            font-weight: var(--fw-semibold);
        }
        .planner-weekly #view-split .planner-toolbar-btn--muted {
            font-weight: var(--fw-medium);
            color: var(--text-secondary);
        }
        .planner-weekly #view-split .planner-session-cap-toggle {
            font-size: var(--text-small);
            user-select: none;
        }
        .planner-weekly #view-split .planner-session-cap-toggle--on {
            border-color: rgba(250, 204, 21, 0.45);
            background: rgba(250, 204, 21, 0.08);
        }
        .planner-weekly #view-split .planner-session-cap-toggle__input {
            width: 1rem;
            height: 1rem;
            accent-color: var(--brand-yellow, rgb(250, 204, 21));
            cursor: pointer;
        }

        /* RTL/LTR adjustments */
        html[dir="rtl"] .mr-2 { margin-right: 0.5rem; margin-left: 0; }
        html[dir="rtl"] .-mr-10 { margin-right: -2.5rem; margin-left: 0; }
        html[dir="rtl"] .right-0 { right: 0; left: auto; }
        
        html[dir="ltr"] .mr-2 { margin-right: 0; margin-left: 0.5rem; }
        html[dir="ltr"] .-mr-10 { margin-right: 0; margin-left: -2.5rem; }
        /* Do not remap .right-0 globally in LTR — breaks #library-sidebar */
        
        /* Premium Select Menu Styling */
        select {
            appearance: none;
            background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23facc15' stroke-width='3'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19 9l-7 7-7-7' /%3E%3C/svg%3E");
            background-repeat: no-repeat;
            background-position: left 1rem center;
            background-size: 1.25rem;
            padding-left: 3rem !important;
            box-shadow: inset 0 2px 10px rgba(0,0,0,0.1);
        }
        body.light-mode select {
            background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23ca8a04' stroke-width='3'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19 9l-7 7-7-7' /%3E%3C/svg%3E");
        }
        html[dir="ltr"] select {
            background-position: right 1rem center;
            padding-left: 1rem !important;
            padding-right: 3rem !important;
        }
        select option {
            background-color: var(--bg-start);
            color: var(--text-primary);
            padding: 12px;
        }
        
        /* Command Palette Styles */
        #command-palette {
            background: rgba(0, 0, 0, 0.5);
            backdrop-filter: blur(8px);
            display: none;
            z-index: 1000;
        }
        #command-palette .palette-content {
            background: var(--panel-bg);
            border: 1px solid var(--border-color);
            box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
            max-width: 600px;
            width: 90%;
            margin-top: 10vh;
        }
        .palette-item {
            padding: 0.75rem 1rem;
            border-radius: 0.75rem;
            cursor: pointer;
            transition: all 0.2s ease;
            display: flex;
            align-items: center;
            gap: 0.75rem;
            color: var(--text-secondary);
            font-size: var(--text-ui);
            font-weight: var(--fw-medium);
            line-height: var(--lh-snug);
        }
        .palette-item .palette-kbd {
            font-size: var(--text-caption);
            font-weight: var(--fw-medium);
            color: var(--text-muted);
        }
        .palette-item.active, .palette-item:hover {
            background: var(--accent-soft);
            color: var(--accent);
        }
        
        /* Template Sidebar (Drawer) */
        #template-sidebar {
            position: fixed;
            top: 0;
            left: -400px;

            margin-top: 0.75rem;
            padding: 0.55rem 0.75rem;
            border-radius: var(--radius-md, 0.65rem);
            background: rgba(255, 255, 255, 0.02);
            border: 1px dashed rgba(255, 255, 255, 0.08);
            flex-wrap: wrap;
        }
        .nut-kpi-dashboard .nut-journey-cheat-info-btn {
            flex-shrink: 0;
            cursor: pointer;
        }
        .nut-kpi-dashboard button.composition-cheat-info-btn {
            font: inherit;
        }
        .composition-cheat-modal__close {
            width: 2rem;
            height: 2rem;
            border-radius: 0.5rem;
            font-size: var(--text-heading);
            line-height: 1;
            color: var(--text-muted);
            background: rgba(255, 255, 255, 0.05);
            border: 1px solid rgba(255, 255, 255, 0.08);
            flex-shrink: 0;
        }
        /* Cheat-sheet modals: override .modal-content 450px cap (Tailwind max-w-* not in build) */
        .modal-content.composition-cheat-modal {
            max-width: min(72rem, calc(100vw - 2rem));
            width: 100%;
        }
        @media (min-width: 768px) {
            #volume-cheat-modal .modal-content.composition-cheat-modal {
                max-width: min(80rem, calc(100vw - 2.5rem));
            }
        }
        /* Volume landmarks grid — avoids RTL <table> column misalignment */
        #volume-cheat-modal .vol-cheat-grid-wrap {
            direction: ltr;
            max-height: min(52vh, 30rem);
            overflow: auto;
            -webkit-overflow-scrolling: touch;
            border-radius: var(--radius-md, 0.65rem);
            border: 1px solid rgba(255, 255, 255, 0.08);
        }
        #volume-cheat-modal .vol-cheat-grid {
            direction: ltr;
            min-width: 36rem;
        }
        #volume-cheat-modal .vol-cheat-grid__row {
            display: grid;
            grid-template-columns: minmax(5.5rem, 1.35fr) repeat(5, minmax(2.5rem, 0.72fr)) minmax(3.25rem, 0.9fr);
            align-items: stretch;
            border-bottom: 1px solid rgba(255, 255, 255, 0.06);
        }
        #volume-cheat-modal .vol-cheat-grid__row--head {
            position: sticky;
            top: 0;
            z-index: 2;
            background: rgba(0, 0, 0, 0.55);
            box-shadow: 0 1px 0 rgba(255, 255, 255, 0.08);
        }
        #volume-cheat-modal .vol-cheat-grid__cell {
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 0.65rem 0.45rem;
            text-align: center;
            font-size: var(--text-ui);
            font-variant-numeric: tabular-nums;
            min-width: 0;
        }
        #volume-cheat-modal .vol-cheat-grid__cell--muscle {
            justify-content: flex-start;
            text-align: start;
            padding-inline-start: 0.75rem;
            font-weight: var(--fw-semibold);
            color: var(--text-primary);
            white-space: normal;
        }
        #volume-cheat-modal .vol-cheat-grid__cell--head {
            flex-direction: column;
            align-items: center;
            justify-content: flex-end;
            padding-top: 0.75rem;
            padding-bottom: 0.55rem;
            font-weight: var(--fw-semibold);
            color: var(--text-secondary);
            background: transparent;
        }
        #volume-cheat-modal .vol-cheat-grid__cell--head.vol-cheat-grid__cell--muscle {
            align-items: flex-start;
        }
        #volume-cheat-modal .vol-cheat-grid__cell--target,
        #volume-cheat-modal .vol-cheat-grid__cell--target-hi {
            background: rgba(var(--accent-rgb, 56 189 248), 0.08);
            font-weight: var(--fw-semibold);
        }
        #volume-cheat-modal .vol-cheat-grid__row--head .vol-cheat-grid__cell--target {
            background: rgba(var(--accent-rgb, 56 189 248), 0.14);
        }
        #volume-cheat-modal .vol-cheat-grid__row--current {
            background: rgba(255, 255, 255, 0.02);
        }
        #volume-cheat-modal .vol-cheat-grid__row--current .vol-cheat-grid__cell--muscle {
            color: rgb(var(--accent-rgb, 56 189 248));
            font-weight: var(--fw-bold);
        }
        #volume-cheat-modal .vol-cheat-evidence-cards {
            display: grid;
            grid-template-columns: 1fr;
            gap: 0.75rem;
            margin-bottom: 0.85rem;
        }
        @media (min-width: 768px) {
            #volume-cheat-modal .vol-cheat-evidence-cards {
                grid-template-columns: repeat(3, minmax(0, 1fr));
            }
        }
        #volume-cheat-modal .vol-cheat-evidence-card {
            display: flex;
            flex-direction: column;
            gap: 0.55rem;
            padding: 0.85rem 0.95rem;
            border-radius: var(--radius-md, 0.65rem);
            background: rgba(255, 255, 255, 0.03);
            border: 1px solid rgba(255, 255, 255, 0.07);
            border-inline-start: 3px solid rgba(255, 255, 255, 0.12);
        }
        #volume-cheat-modal .vol-cheat-evidence-card--tier-a { border-inline-start-color: rgba(34, 197, 94, 0.55); }
        #volume-cheat-modal .vol-cheat-evidence-card--tier-b { border-inline-start-color: rgba(56, 189, 248, 0.55); }
        #volume-cheat-modal .vol-cheat-evidence-card--tier-c { border-inline-start-color: rgba(168, 85, 247, 0.55); }
        #volume-cheat-modal .vol-cheat-evidence-card__title {
            margin: 0 0 0.5rem;
        }
        #volume-cheat-modal .vol-cheat-sources-disclosure {
            margin-top: 0.25rem;
            padding: 0.85rem 1rem;
            border-radius: var(--radius-md, 0.65rem);
            background: rgba(0, 0, 0, 0.22);
            border: 1px solid rgba(255, 255, 255, 0.08);
        }
        #volume-cheat-modal .vol-cheat-sources-disclosure__summary {
            display: flex;
            align-items: flex-start;
            justify-content: space-between;
            gap: 0.75rem;
            cursor: pointer;
            list-style: none;
            user-select: none;
        }
        #volume-cheat-modal .vol-cheat-sources-disclosure__summary::-webkit-details-marker {
            display: none;
        }
        #volume-cheat-modal .vol-cheat-sources-disclosure__summary:hover .vol-cheat-sources-disclosure__label {
            color: var(--brand-yellow, rgb(250, 204, 21));
        }
        #volume-cheat-modal .vol-cheat-sources-disclosure__text {
            display: flex;
            flex-direction: column;
            gap: 0.2rem;
            min-width: 0;
        }
        #volume-cheat-modal .vol-cheat-sources-disclosure__chev {
            flex-shrink: 0;
            color: rgb(115, 115, 115);
            transition: transform 0.2s ease;
        }
        #volume-cheat-modal .vol-cheat-sources-disclosure[open] .vol-cheat-sources-disclosure__chev {
            transform: rotate(180deg);
        }
        #volume-cheat-modal .vol-cheat-sources-disclosure__body {
            margin-top: 1rem;
            padding-top: 1rem;
            border-top: 1px solid rgba(255, 255, 255, 0.08);
            display: flex;
            flex-direction: column;
            gap: 1.25rem;
        }
        #volume-cheat-modal .vol-cheat-sources-note {
            padding: 0.75rem 0.9rem;
            border-radius: var(--radius-md, 0.65rem);
            background: rgba(255, 255, 255, 0.03);
            border: 1px solid rgba(255, 255, 255, 0.06);
        }
        #volume-cheat-modal .vol-cheat-sources-note__heading {
            display: block;
            margin-bottom: 0.45rem;
        }
        #volume-cheat-modal .vol-cheat-population-section {
            display: flex;
            flex-direction: column;
            gap: 0.85rem;
        }
        #volume-cheat-modal .vol-cheat-pop-grid-wrap {
            direction: ltr;
            overflow: auto;
            -webkit-overflow-scrolling: touch;
            border-radius: var(--radius-md, 0.65rem);
            border: 1px solid rgba(255, 255, 255, 0.08);
        }
        #volume-cheat-modal .vol-cheat-pop-grid-wrap--compact {
            max-height: none;
        }
        #volume-cheat-modal .vol-cheat-pop-grid-wrap:not(.vol-cheat-pop-grid-wrap--compact) {
            max-height: min(40vh, 22rem);
        }
        #volume-cheat-modal .vol-cheat-pop-grid {
            direction: ltr;
            min-width: 22rem;
        }
        #volume-cheat-modal .vol-cheat-pop-grid--session,
        #volume-cheat-modal .vol-cheat-pop-grid--muscle {
            min-width: 28rem;
        }
        #volume-cheat-modal .vol-cheat-pop-grid__row {
            display: grid;
            grid-template-columns: minmax(5.5rem, 1.35fr) repeat(4, minmax(3rem, 1fr));
            align-items: stretch;
            border-bottom: 1px solid rgba(255, 255, 255, 0.06);
        }
        #volume-cheat-modal .vol-cheat-pop-grid--level-caps .vol-cheat-pop-grid__row {
            grid-template-columns: minmax(5.5rem, 1.2fr) repeat(3, minmax(4.5rem, 1fr));
        }
        #volume-cheat-modal .vol-cheat-pop-grid__row--head {
            position: sticky;
            top: 0;
            z-index: 2;
            background: rgba(23, 23, 23, 0.96);
            border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        }
        #volume-cheat-modal .vol-cheat-pop-grid__cell {
            padding: 0.45rem 0.55rem;
            display: flex;
            align-items: center;
            justify-content: center;
            text-align: center;
            border-inline-end: 1px solid rgba(255, 255, 255, 0.05);
        }
        #volume-cheat-modal .vol-cheat-pop-grid__cell--label,
        #volume-cheat-modal .vol-cheat-pop-grid__cell--muscle {
            justify-content: flex-start;
            text-align: start;
            font-weight: var(--fw-medium);
        }
        #volume-cheat-modal .vol-cheat-pop-grid__cell--label-current {
            color: var(--brand-yellow, rgb(250, 204, 21));
        }
        #volume-cheat-modal .vol-cheat-pop-grid__cell--head {
            font-weight: var(--fw-semibold);
            color: var(--text-secondary, rgb(163, 163, 163));
            font-size: var(--text-meta);
            line-height: var(--lh-snug);
        }
        #volume-cheat-modal .vol-cheat-pop-goal-groups {
            display: flex;
            flex-direction: column;
            gap: 0.5rem;
        }
        #volume-cheat-modal .vol-cheat-pop-goal-group {
            border-radius: var(--radius-md, 0.65rem);
            border: 1px solid rgba(255, 255, 255, 0.08);
            background: rgba(0, 0, 0, 0.18);
            overflow: hidden;
        }
        #volume-cheat-modal .vol-cheat-pop-goal-group__summary {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 0.75rem;
            padding: 0.65rem 0.85rem;
            cursor: pointer;
            list-style: none;
            user-select: none;
        }
        #volume-cheat-modal .vol-cheat-pop-goal-group__summary::-webkit-details-marker {
            display: none;
        }
        #volume-cheat-modal .vol-cheat-pop-goal-group__summary:hover {
            color: var(--brand-yellow, rgb(250, 204, 21));
        }
        #volume-cheat-modal .vol-cheat-pop-goal-group[open] .vol-cheat-pop-goal-group__chev {
            transform: rotate(180deg);
        }
        #volume-cheat-modal .vol-cheat-pop-goal-group__chev {
            color: rgb(115, 115, 115);
            transition: transform 0.2s ease;
        }
        #volume-cheat-modal .vol-cheat-pop-goal-group .vol-cheat-pop-grid-wrap {
            border: none;
            border-radius: 0;
            border-top: 1px solid rgba(255, 255, 255, 0.08);
        }
        #volume-cheat-modal .vol-cheat-evidence-card__source {
            margin: 0;
            padding-top: 0.35rem;
            border-top: 1px solid rgba(255, 255, 255, 0.06);
            line-height: var(--lh-snug);
        }
        #volume-cheat-modal .vol-cheat-bullets {
            margin: 0;
            padding-inline-start: 1.15rem;
            display: flex;
            flex-direction: column;
            gap: 0.35rem;
        }
        #volume-cheat-modal .vol-cheat-bullets li {
            line-height: var(--lh-snug);
        }
        #volume-cheat-modal .vol-cheat-callout {
            padding: 0.75rem 0.9rem;
            border-radius: var(--radius-md, 0.65rem);
            background: rgba(56, 189, 248, 0.06);
            border: 1px solid rgba(56, 189, 248, 0.14);
        }
        #volume-cheat-modal .vol-cheat-callout__label {
            display: block;
            margin-bottom: 0.45rem;
        }
        #volume-cheat-modal .vol-cheat-callout .vol-cheat-bullets {
            gap: 0.3rem;
        }
        #volume-cheat-modal .vol-cheat-tier-badge {
            flex-shrink: 0;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            min-width: 1.65rem;
            height: 1.65rem;
            padding: 0 0.35rem;
            border-radius: 999px;
            font-weight: var(--fw-bold);
            letter-spacing: 0.04em;
            background: rgba(255, 255, 255, 0.08);
        }
        #volume-cheat-modal .vol-cheat-tier-badge--sm {
            min-width: 1.45rem;
            height: 1.45rem;
            font-size: var(--text-meta);
        }
        #volume-cheat-modal .vol-cheat-tier-badge--a { background: rgba(34, 197, 94, 0.18); color: rgb(134, 239, 172); }
        #volume-cheat-modal .vol-cheat-tier-badge--b { background: rgba(56, 189, 248, 0.18); color: rgb(125, 211, 252); }
        #volume-cheat-modal .vol-cheat-tier-badge--c { background: rgba(168, 85, 247, 0.18); color: rgb(216, 180, 254); }
        #volume-cheat-modal .vol-cheat-tier-badge--d { background: rgba(251, 191, 36, 0.18); color: rgb(253, 224, 71); }
        #volume-cheat-modal .vol-cheat-tier-badge--e { background: rgba(248, 113, 113, 0.15); color: rgb(252, 165, 165); }
        #volume-cheat-modal .vol-cheat-subheading {
            margin: 0 0 0.55rem;
        }
        #volume-cheat-modal .vol-cheat-audit-tiers {
            display: flex;
            flex-direction: column;
            gap: 0.5rem;
            margin-bottom: 1rem;
        }
        #volume-cheat-modal .vol-cheat-audit-tier {
            display: flex;
            gap: 0.75rem;
            align-items: flex-start;
            padding: 0.65rem 0.75rem;
            border-radius: var(--radius-md, 0.65rem);
            border: 1px solid rgba(255, 255, 255, 0.06);
            background: rgba(255, 255, 255, 0.02);
        }
        #volume-cheat-modal .vol-cheat-audit-tier__text {
            display: flex;
            flex-direction: column;
            gap: 0.35rem;
            min-width: 0;
            flex: 1;
        }
        #volume-cheat-modal .vol-cheat-audit-tier__label {
            display: block;
        }
        #volume-cheat-modal .vol-cheat-audit-tier .vol-cheat-bullets {
            gap: 0.25rem;
        }
        #volume-cheat-modal .vol-cheat-audit-table {
            display: flex;
            flex-direction: column;
            gap: 0.35rem;
            margin-bottom: 0.65rem;
        }
        #volume-cheat-modal .vol-cheat-audit-row {
            display: grid;
            grid-template-columns: minmax(6.5rem, 1.2fr) auto minmax(7rem, 1.8fr);
            gap: 0.65rem 0.85rem;
            align-items: center;
            padding: 0.5rem 0.65rem;
            border-radius: var(--radius-sm, 0.35rem);
        }
        #volume-cheat-modal .vol-cheat-audit-row--head {
            background: rgba(255, 255, 255, 0.04);
            border-bottom: 1px solid rgba(255, 255, 255, 0.08);
            padding-bottom: 0.55rem;
        }
        #volume-cheat-modal .vol-cheat-audit-row:not(.vol-cheat-audit-row--head) {
            background: rgba(255, 255, 255, 0.02);
        }
        @media (min-width: 640px) {
            #volume-cheat-modal .vol-cheat-audit-row {
                grid-template-columns: minmax(8rem, 1fr) auto minmax(10rem, 2fr);
            }
        }
        .composition-cheat-modal__close:hover {
            color: var(--text-primary);
            background: rgba(255, 255, 255, 0.1);
        }
        /* Composition cheat modal typography — readable reference sheet (ADR-4) */
        .composition-cheat-modal__body {
            font-size: var(--text-ui);
            line-height: var(--lh-normal);
            color: var(--text-primary);
        }
        .composition-cheat-modal .text-role-body {
            color: var(--text-secondary);
        }
        .composition-cheat-modal .text-role-label {
            color: var(--text-muted);
        }
        .composition-cheat-glossary {
            display: flex;
            flex-wrap: wrap;
            align-items: baseline;
            gap: 0.3rem 0.4rem;
            margin-bottom: 0.85rem;
            padding: 0.65rem 0.85rem;
            border-radius: var(--radius-md, 0.65rem);
            background: rgba(255, 255, 255, 0.03);
            border: 1px solid rgba(255, 255, 255, 0.06);
            font-size: var(--text-small);
            line-height: var(--lh-snug);
            color: var(--text-secondary);
        }
        .composition-cheat-glossary__label {
            margin-inline-end: 0.15rem;
        }
        .composition-cheat-glossary__sep {
            color: rgba(255, 255, 255, 0.2);
            user-select: none;
        }
        .composition-cheat-intro {
            margin: 0 0 0.85rem;
        }
        .composition-cheat-section + .composition-cheat-section {
            margin-top: 1.35rem;
            padding-top: 1.35rem;
            border-top: 1px solid rgba(255, 255, 255, 0.08);
        }
        .composition-cheat-heading {
            margin: 0 0 0.45rem;
        }
        .composition-cheat-heading-row {
            display: flex;
            align-items: center;
            gap: 0.45rem;
            margin-bottom: 0.45rem;
        }
        .composition-cheat-heading-row .composition-cheat-heading {
            margin: 0;
            flex: 1 1 auto;
        }
        .composition-cheat-info-btn {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
            width: 1.65rem;
            height: 1.65rem;
            border-radius: 999px;
            color: rgb(var(--accent-rgb, 56 189 248));
            background: rgba(var(--accent-rgb, 56 189 248), 0.1);
            border: 1px solid rgba(var(--accent-rgb, 56 189 248), 0.28);
        }
        .composition-cheat-info-btn:hover {
            background: rgba(var(--accent-rgb, 56 189 248), 0.18);
            color: rgb(var(--accent-rgb, 56 189 248));
        }
        .composition-cheat-info-btn__icon {
            width: 1rem;
            height: 1rem;
        }
        .composition-cheat-table__head-cell.cursor-help,
        .composition-cheat-table__row-label.cursor-help,
        .composition-cheat-pct.cursor-help {
            text-decoration: underline dotted rgba(255, 255, 255, 0.22);
            text-underline-offset: 2px;
        }
        .composition-cheat-subheading {
            margin: 0 0 0.4rem;
        }
        .composition-cheat-lead {
            margin: 0 0 0.75rem;
        }
        .composition-cheat-your {
            display: flex;
            flex-wrap: wrap;
            align-items: center;
            gap: 0.55rem 0.85rem;
            margin-bottom: 1rem;
            padding: 0.65rem 0.85rem;
            border-radius: var(--radius-lg, 0.875rem);
            background: rgba(var(--accent-rgb, 56 189 248), 0.08);
            border: 1px solid rgba(var(--accent-rgb, 56 189 248), 0.25);
        }
        .composition-cheat-your__label {
            color: rgb(var(--accent-rgb, 56 189 248));
            font-weight: var(--fw-semibold);
        }
        .composition-cheat-your__chips {
            display: flex;
            flex-wrap: wrap;
            gap: 0.4rem;
        }
        .composition-cheat-chip {
            display: inline-flex;
            align-items: center;
            padding: 0.3rem 0.7rem;
            border-radius: 999px;
            font-size: var(--text-ui);
            font-weight: var(--fw-bold);
            background: rgba(0, 0, 0, 0.25);
            border: 1px solid rgba(255, 255, 255, 0.1);
            color: var(--text-primary);
        }
        .composition-cheat-chip--fm {
            border-color: rgba(251, 146, 60, 0.35);
            background: rgba(251, 146, 60, 0.1);
        }
        .composition-cheat-chip--lbm {
            border-color: rgba(74, 222, 128, 0.35);
            background: rgba(74, 222, 128, 0.08);
        }
        .composition-cheat-table-wrap {
            overflow-x: auto;
            -webkit-overflow-scrolling: touch;
            border-radius: var(--radius-md, 0.65rem);
            border: 1px solid rgba(255, 255, 255, 0.08);
        }
        .composition-cheat-table {
            width: 100%;
            border-collapse: collapse;
            font-size: var(--text-ui);
            table-layout: fixed;
        }
        .composition-cheat-table--t2 {
            min-width: 36rem;
        }
        .composition-cheat-table--t2 .composition-cheat-table__col-category {
            width: 17%;
        }
        .composition-cheat-table--t2 .composition-cheat-table__col-data {
            width: 20.75%;
        }
        .composition-cheat-table--gain {
            min-width: 16rem;
        }
        .composition-cheat-table th,
        .composition-cheat-table td {
            padding: 0.65rem 0.5rem;
            text-align: center;
            vertical-align: middle;
            border-bottom: 1px solid rgba(255, 255, 255, 0.06);
        }
        .composition-cheat-table thead th {
            font-weight: var(--fw-semibold);
            color: var(--text-secondary);
            background: rgba(0, 0, 0, 0.25);
            vertical-align: bottom;
        }
        .composition-cheat-table__head-cell--category,
        .composition-cheat-table__row-label {
            text-align: start;
            width: 5.5rem;
            min-width: 5.5rem;
        }
        .composition-cheat-th-main {
            display: block;
            font-size: var(--text-small);
            font-weight: var(--fw-semibold);
            line-height: var(--lh-snug);
        }
        .composition-cheat-th-sub {
            display: block;
            margin-top: 0.2rem;
            font-size: var(--text-caption);
            font-weight: var(--fw-medium);
            color: var(--text-muted);
            line-height: var(--lh-snug);
        }
        .composition-cheat-table__row-label {
            font-size: var(--text-ui);
            font-weight: var(--fw-semibold);
            color: var(--text-primary);
            white-space: nowrap;
            padding-inline-start: 0.75rem;
        }
        .composition-cheat-table__row--current .composition-cheat-table__row-label {
            color: rgb(var(--accent-rgb, 56 189 248));
        }
        .composition-cheat-table__cell--current {
            background: rgba(var(--accent-rgb, 56 189 248), 0.12);
        }
        .composition-cheat-table__cell--current .composition-cheat-split__num {
            color: var(--text-primary);
            font-weight: var(--fw-bold);
        }
        .composition-cheat-split {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 0.2rem;
        }
        .composition-cheat-split__line {
            display: inline-flex;
            align-items: baseline;
            gap: 0.25rem;
            line-height: 1.25;
        }
        .composition-cheat-split__num {
            font-size: var(--text-ui);
            font-weight: var(--fw-semibold);
            font-variant-numeric: tabular-nums;
            color: var(--text-primary);
        }
        .composition-cheat-split__tag {
            font-size: var(--text-caption);
            font-weight: var(--fw-medium);
            letter-spacing: 0.02em;
            color: var(--text-muted);
        }
        .composition-cheat-split__line--fm .composition-cheat-split__tag {
            color: rgba(251, 146, 60, 0.85);
        }
        .composition-cheat-split__line--lbm .composition-cheat-split__tag {
            color: rgba(74, 222, 128, 0.85);
        }
        .composition-cheat-pct {
            font-size: var(--text-ui);
            font-weight: var(--fw-semibold);
            font-variant-numeric: tabular-nums;
        }
        .composition-cheat-level-grid {
            display: grid;
            grid-template-columns: repeat(2, minmax(0, 1fr));
            gap: 0.5rem;
        }
        @media (min-width: 520px) {
            .composition-cheat-level-grid {
                grid-template-columns: repeat(4, minmax(0, 1fr));
            }
        }
        .composition-cheat-level-card {
            padding: 0.75rem;
            border-radius: var(--radius-sm);
            border: 1px solid var(--border);
            background: var(--surface-3);
        }

/* Library sidebar removed — templates only */

