* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

/* Désactiver le délai de 300ms sur mobile et améliorer la réactivité tactile */
button, a, .btn, .nav-item, .exercise-card, .weight-entry, .calendar-day, .section-header, .category-header, .modal-overlay, [onclick], [role="button"] {
    touch-action: manipulation;
    cursor: pointer;
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

/* Désactiver toutes les transitions sur mobile pour améliorer la réactivité */
@media (hover: none) and (pointer: coarse) {
    * {
        transition: none !important;
        animation: none !important;
    }
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    background: #F5F6F8;
    color: #1A1A1A;
    overflow-x: hidden;
    transition: background-color 0.3s, color 0.3s;
}

/* Dark Mode */
body.dark-mode {
    background: #1A1A1A;
    color: #E8EAED;
}

body.dark-mode .app-container {
    background: #1A1A1A;
}

body.dark-mode .header {
    background: #2D2D2D;
    border-bottom: 1px solid #3D3D3D;
}

body.dark-mode .header h1 {
    color: #E8EAED;
}

body.dark-mode .btn-primary {
    background: #059669;
    color: white;
}

@media (hover: hover) and (pointer: fine) {
    body.dark-mode .btn-primary:hover {
        background: #047857;
    }
}

body.dark-mode .btn-secondary {
    background: #2D2D2D;
    color: #BDC1C6;
    border: 1px solid #3D3D3D;
}

@media (hover: hover) and (pointer: fine) {
    body.dark-mode .btn-secondary:hover {
        background: #3D3D3D;
    }
}

body.dark-mode .btn-icon {
    background: #3D3D3D;
}

@media (hover: hover) and (pointer: fine) {
    body.dark-mode .btn-icon:hover {
        background: #4D4D4D;
    }
}

body.dark-mode .category-filters {
    background: #2D2D2D;
    border-bottom: 1px solid #3D3D3D;
}

body.dark-mode .category-filter {
    background: #3D3D3D;
    color: #BDC1C6;
}

body.dark-mode .category-filter.active {
    background: #E8EAED;
    color: #1A1A1A;
}

body.dark-mode .exercise-card {
    background: #2D2D2D;
    border: 1px solid #3A3A3A;
}

body.dark-mode .exercise-title {
    color: #E8EAED;
}

body.dark-mode .exercise-subtitle {
    color: #80868B;
}

body.dark-mode .exercise-value {
    color: #BDC1C6;
}

body.dark-mode .action-btn {
    background: #3D3D3D;
    color: #E8EAED;
}

@media (hover: hover) and (pointer: fine) {
    body.dark-mode .action-btn:hover {
        background: #4D4D4D;
    }
}

body.dark-mode .action-btn.delete {
    background: #4D2020;
    color: #FCA5A5;
}

body.dark-mode .section-header {
    background: #2D2D2D;
}

body.dark-mode .section-title {
    color: #E8EAED;
}

body.dark-mode .section-arrow {
    color: #80868B;
}

body.dark-mode .bottom-nav {
    background: #2D2D2D;
    border-top: 1px solid #3D3D3D;
}

body.dark-mode .nav-item {
    color: #80868B;
}

body.dark-mode .nav-item.active {
    color: #E8EAED;
}

body.dark-mode .fab-center {
    background: #E8EAED;
    color: #1A1A1A;
}

body.dark-mode .modal {
    background: #2D2D2D;
}

body.dark-mode .modal-header {
    color: #E8EAED;
}

body.dark-mode .form-label {
    color: #BDC1C6;
}

body.dark-mode .form-input {
    background: #3D3D3D;
    border: 1px solid #4D4D4D;
    color: #E8EAED;
}

body.dark-mode .form-input:focus {
    border-color: #E8EAED;
}

body.dark-mode .form-input::placeholder {
    color: #5F6368;
}

body.dark-mode .login-card {
    background: #2D2D2D;
}

body.dark-mode .login-title {
    color: #E8EAED;
}

body.dark-mode .login-subtitle {
    color: #80868B;
}

body.dark-mode .login-link {
    color: #E8EAED;
}

body.dark-mode .stat-card {
    background: #2D2D2D;
    border: 1px solid #3A3A3A;
}

body.dark-mode .stat-value {
    color: #E8EAED;
}

body.dark-mode .stat-label {
    color: #80868B;
}

body.dark-mode .chart-container {
    background: #2D2D2D;
}

body.dark-mode .chart-title {
    color: #E8EAED;
}

body.dark-mode .session-timer {
    background-color: #2D2D2D !important;
    border-color: #4D4D4D !important;
}

body.dark-mode .session-timer.active {
    background-color: #1a2744 !important;
    border-color: #3b82f6 !important;
}

body.dark-mode .session-timer .timer-label {
    color: #80868B !important;
}

body.dark-mode .session-timer .timer-display {
    color: #E8EAED !important;
}

body.dark-mode .session-timer .timer-display.inactive {
    color: #5F6368 !important;
}

body.dark-mode .empty-title {
    color: #E8EAED;
}

body.dark-mode .empty-description {
    color: #80868B;
}

body.dark-mode .weight-input-section {
    background: #2D2D2D;
}

body.dark-mode .weight-chart-container {
    background: #2D2D2D;
}

body.dark-mode .weight-entry {
    background: #2D2D2D;
}

body.dark-mode .weight-value-large {
    color: #E8EAED;
}

body.dark-mode .weight-date {
    color: #80868B;
}

body.dark-mode .category-item {
    background: #2D2D2D;
}

body.dark-mode .category-item-name {
    color: #E8EAED;
}

body.dark-mode .calendar-grid {
    background: #2D2D2D;
}

body.dark-mode .calendar-day-header {
    color: #80868B;
}

body.dark-mode .calendar-month {
    color: #E8EAED;
}

body.dark-mode .calendar-day.none {
    background: #3D3D3D;
    color: #BDC1C6;
}

@media (hover: hover) and (pointer: fine) {
    body.dark-mode .calendar-day.none:hover {
        background: #4D4D4D;
    }
}

/* Design basé sur l'image - Couleurs pastels et cartes arrondies */
.app-container {
    max-width: 100%;
    min-height: 100vh;
    background: #F5F6F8;
}

/* Transitions fluides pour les vues */
.view-transition {
    animation: fadeSlideIn 0.3s ease-out;
}

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

/* Drag and drop */
.drag-handle {
    cursor: grab;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 18px;
    padding: 4px 8px;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    flex-shrink: 0;
}

.drag-handle:active {
    cursor: grabbing;
}

.sortable-ghost {
    opacity: 0.4;
}

.sortable-ghost.category-section {
    background: #e0e7ff;
    border-radius: 12px;
}


.sortable-chosen {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.sortable-drag {
    opacity: 1 !important;
}

body.dark-mode .drag-handle {
    color: #666;
}

body.dark-mode .sortable-ghost.category-section {
    background: #1a2744;
}


/* Header moderne */
.header {
    background: white;
    padding: 20px;
    border-bottom: 1px solid #E8EAED;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header h1 {
    font-size: 28px;
    font-weight: 700;
    color: #1A1A1A;
}

.header-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

/* Boutons pill-shaped comme dans l'image */
.btn {
    padding: 10px 20px;
    border-radius: 20px;
    border: none;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-align: center;
}

.btn-primary {
    background: #10B981;
    color: white;
}

@media (hover: hover) and (pointer: fine) {
    .btn-primary:hover {
        background: #059669;
    }
}

.btn-secondary {
    background: white;
    color: #5F6368;
    border: 1px solid #E8EAED;
}

@media (hover: hover) and (pointer: fine) {
    .btn-secondary:hover {
        background: #F8F9FA;
    }
}

.btn-icon {
    width: 40px;
    height: 40px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #E8EAED;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

@media (hover: hover) and (pointer: fine) {
    .btn-icon:hover {
        background: #D5D7DA;
    }
}

/* Filtres catégories - style pill */
.category-filters {
    display: flex;
    gap: 10px;
    padding: 16px 20px;
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    background: white;
    border-bottom: 1px solid #E8EAED;
}

.category-filters::-webkit-scrollbar {
    display: none;
}

.category-filter {
    padding: 8px 20px;
    border-radius: 20px;
    background: #F5F6F8;
    color: #5F6368;
    border: none;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

.category-filter.active {
    background: #1A1A1A;
    color: white;
}

/* Grille d'exercices - 2 colonnes */
.exercises-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 0 20px 12px 20px;
}

/* Cartes d'exercices - design carré */
.exercise-card {
    background: white;
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    display: flex;
    flex-direction: column;
    position: relative;
    transition: all 0.2s;
    min-height: 140px;
    border: 1px solid #E8EAED;
}

/* Désactiver hover sur tactile - appliquer uniquement sur desktop */
@media (hover: hover) and (pointer: fine) {
    .exercise-card:hover {
        box-shadow: 0 2px 8px rgba(0,0,0,0.12);
        transform: translateY(-2px);
    }
}

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

.exercise-info {
    flex: 1;
}

.exercise-title {
    font-size: 15px;
    font-weight: 600;
    color: #1A1A1A;
    margin-bottom: 8px;
    padding-right: 50px;
    line-height: 1.3;
    word-wrap: break-word;
}

.exercise-value {
    font-size: 20px;
    font-weight: 700;
    color: #1A1A1A;
    margin: auto 0;
    word-wrap: break-word;
    overflow-wrap: break-word;
    line-height: 1.3;
}

.exercise-subtitle {
    font-size: 12px;
    color: #80868B;
    margin-top: 8px;
}

/* Vue liste compacte */
.exercise-list-item {
    background: white;
    border-bottom: 1px solid #E8EAED;
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s;
}

.exercise-list-item:active {
    background: #F5F6F8;
}

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

.exercise-list-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
}

.exercise-list-title {
    font-size: 15px;
    font-weight: 600;
    color: #1A1A1A;
}

.exercise-list-meta {
    font-size: 13px;
    color: #80868B;
    margin-top: 2px;
}

.exercise-list-value {
    font-size: 15px;
    font-weight: 600;
    color: #1A1A1A;
    margin-right: 8px;
}

.view-toggle-btn {
    padding: 8px 12px;
    border-radius: 8px;
    background: #F5F6F8;
    border: none;
    cursor: pointer;
    font-size: 18px;
    transition: background 0.2s;
}

@media (hover: hover) and (pointer: fine) {
    .view-toggle-btn:hover {
        background: #E8EAED;
    }
}

.view-toggle-btn.active {
    background: #1A1A1A;
    color: white;
}

body.dark-mode .exercise-list-item {
    background: #2D2D2D;
    border-bottom: 1px solid #3D3D3D;
}

body.dark-mode .exercise-list-item:active {
    background: #3D3D3D;
}

body.dark-mode .exercise-list-title {
    color: #E8EAED;
}

body.dark-mode .exercise-list-value {
    color: #BDC1C6;
}

body.dark-mode .view-toggle-btn {
    background: #3D3D3D;
    color: #E8EAED;
}

@media (hover: hover) and (pointer: fine) {
    body.dark-mode .view-toggle-btn:hover {
        background: #4D4D4D;
    }
}

body.dark-mode .view-toggle-btn.active {
    background: #E8EAED;
    color: #1A1A1A;
}

.exercise-value {
    font-size: 14px;
    color: #5F6368;
}

/* Badge PR/OR compact pour coin supérieur droit */
.badge {
    min-width: 32px;
    height: 24px;
    padding: 0 8px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: white;
}

.badge-pr {
    background: #C4B5FD;
}

.badge-or {
    background: #FCA5A5;
}

.badge-default {
    background: #E8EAED;
    color: #5F6368;
}

/* Actions sur les cartes */
.card-actions {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    gap: 6px;
    align-items: center;
}

.action-btn {
    width: 28px;
    height: 28px;
    border-radius: 14px;
    background: #F5F6F8;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.2s;
}

@media (hover: hover) and (pointer: fine) {
    .action-btn:hover {
        background: #E8EAED;
        transform: scale(1.1);
    }

    .action-btn.delete:hover {
        background: #DC2626;
        color: white;
    }
}

.action-btn.delete {
    background: #FEE2E2;
    color: #DC2626;
}

/* Section groupée par catégorie */
.category-section {
    margin: 16px 0;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background: white;
    margin: 0 20px 12px 20px;
    cursor: pointer;
    border-bottom: 2px solid #E8EAED;
}

.section-title {
    font-size: 16px;
    font-weight: 600;
    color: #1A1A1A;
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
    padding-bottom: 8px;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 40px;
    height: 2px;
    background: #1A1A1A;
}

.section-arrow {
    font-size: 18px;
    color: #80868B;
    transition: transform 0.2s;
}

.section-arrow.open {
    transform: rotate(90deg);
}

/* Navigation en bas */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid #E8EAED;
    display: flex;
    justify-content: space-around;
    padding: 8px 0 20px 0;
    z-index: 100;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 20px;
    cursor: pointer;
    color: #80868B;
    transition: all 0.2s;
}

.nav-item.active {
    color: #1A1A1A;
}

.nav-icon {
    font-size: 24px;
}

.nav-label {
    font-size: 11px;
    font-weight: 500;
}

/* Bouton flottant d'ajout */
.fab {
    position: fixed;
    bottom: 80px;
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 28px;
    background: #1A1A1A;
    color: white;
    border: none;
    font-size: 28px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 99;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

@media (hover: hover) and (pointer: fine) {
    .fab:hover {
        transform: scale(1.05);
        box-shadow: 0 6px 16px rgba(0,0,0,0.2);
    }
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal {
    background: white;
    border-radius: 20px;
    padding: 24px;
    width: 100%;
    max-width: 400px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 20px;
    color: #1A1A1A;
}

.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #5F6368;
    margin-bottom: 8px;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #E8EAED;
    border-radius: 12px;
    font-size: 15px;
    color: #1A1A1A;
    transition: all 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: #1A1A1A;
}

.form-input::placeholder {
    color: #BDC1C6;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.form-actions .btn {
    flex: 1;
}

/* Login screen */
.login-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: #F5F6F8;
}

.login-card {
    background: white;
    border-radius: 20px;
    padding: 32px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.login-title {
    font-size: 28px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 32px;
    color: #1A1A1A;
}

.login-subtitle {
    text-align: center;
    color: #80868B;
    margin-top: 20px;
    font-size: 14px;
}

.login-link {
    color: #1A1A1A;
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
}

/* Stats cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    padding: 20px;
}

.stat-card {
    background: white;
    border-radius: 16px;
    padding: 16px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: #1A1A1A;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 12px;
    color: #80868B;
}

/* Chart container */
.chart-container {
    background: white;
    border-radius: 16px;
    padding: 20px;
    margin: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.chart-title {
    font-size: 16px;
    font-weight: 600;
    color: #1A1A1A;
    margin-bottom: 16px;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.empty-title {
    font-size: 18px;
    font-weight: 600;
    color: #1A1A1A;
    margin-bottom: 8px;
}

.empty-description {
    font-size: 14px;
    color: #80868B;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #F5F6F8;
}

::-webkit-scrollbar-thumb {
    background: #BDC1C6;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #80868B;
}

/* Responsive */
@media (max-width: 640px) {
    .header {
        padding: 16px;
    }

    .header h1 {
        font-size: 24px;
    }

    .exercise-card {
        margin: 8px 12px;
        padding: 14px;
    }

    .stats-grid {
        padding: 12px;
        gap: 8px;
    }
}

/* Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.fade-in {
    animation: fadeIn 0.3s ease-out;
}

/* Poids display */
.weight-display {
    display: inline-block;
    padding: 4px 10px;
    background: #F5F6F8;
    border-radius: 12px;
    font-size: 13px;
    color: #5F6368;
    margin-left: 8px;
}

/* Connection indicator */
.connection-status {
    position: fixed;
    top: 10px;
    right: 10px;
    padding: 6px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    z-index: 1001;
}

.connection-online {
    background: #D1FAE5;
    color: #059669;
}

.connection-offline {
    background: #FEE2E2;
    color: #DC2626;
}

/* Toggle Switch */
.toggle-container {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.toggle-switch {
    position: relative;
    width: 48px;
    height: 24px;
    background: #E8EAED;
    border-radius: 12px;
    transition: background 0.3s;
    cursor: pointer;
}

.toggle-switch.active {
    background: #1A1A1A;
}

.toggle-slider {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 10px;
    transition: transform 0.3s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.toggle-switch.active .toggle-slider {
    transform: translateX(24px);
}

body.dark-mode .toggle-switch {
    background: #3D3D3D;
}

body.dark-mode .toggle-switch.active {
    background: #E8EAED;
}

/* Progress filter section */
.progress-filter-section {
    padding: 20px;
    background: white;
    border-bottom: 1px solid #E8EAED;
}

body.dark-mode .progress-filter-section {
    background: #2D2D2D;
    border-bottom: 1px solid #3D3D3D;
}

/* Calendar legend section */
.calendar-legend {
    margin-top: 20px;
    background: white;
    padding: 16px;
    border-radius: 12px;
}

body.dark-mode .calendar-legend {
    background: #2D2D2D;
}

.calendar-legend-title {
    font-size: 14px;
    color: #5F6368;
    margin-bottom: 12px;
}

body.dark-mode .calendar-legend-title {
    color: #BDC1C6;
}

.calendar-legend-text {
    font-size: 14px;
    color: #1A1A1A;
}

body.dark-mode .calendar-legend-text {
    color: #E8EAED;
}

/* Exercise selection in comparison mode */
.exercise-selection-item {
    display: flex;
    align-items: center;
    padding: 8px 12px 8px 24px;
    cursor: pointer;
    background: transparent;
    border-radius: 8px;
    margin-bottom: 2px;
}

.exercise-selection-item.selected {
    background: #F0F7FF;
}

body.dark-mode .exercise-selection-item.selected {
    background: #2D3748;
}

.exercise-selection-name {
    font-size: 14px;
    color: #1A1A1A;
}

body.dark-mode .exercise-selection-name {
    color: #E8EAED;
}

.comparison-panel {
    padding: 20px;
    background: white;
    border-bottom: 1px solid #E8EAED;
}

body.dark-mode .comparison-panel {
    background: #1E1E1E;
    border-bottom-color: #3D3D3D;
}

.comparison-label {
    font-weight: 500;
    font-size: 14px;
    color: #5F6368;
}

body.dark-mode .comparison-label {
    color: #9AA0A6;
}

.comparison-category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: #F5F6F8;
    border-radius: 8px;
    cursor: pointer;
    margin-bottom: 4px;
}

body.dark-mode .comparison-category-header {
    background: #2D2D2D;
}

.comparison-category-name {
    font-size: 14px;
    font-weight: 600;
    color: #1A1A1A;
}

body.dark-mode .comparison-category-name {
    color: #E8EAED;
}

.comparison-category-count {
    font-size: 12px;
    color: #5F6368;
}

body.dark-mode .comparison-category-count {
    color: #9AA0A6;
}

.comparison-empty {
    padding: 40px 20px;
    text-align: center;
    color: #5F6368;
}

body.dark-mode .comparison-empty {
    color: #9AA0A6;
}

/* Dark mode fixes for inline-styled elements */
body.dark-mode .install-instruction-box {
    background: #2D2D2D !important;
    color: #9AA0A6 !important;
}
body.dark-mode .install-instruction-box h4 {
    color: #E8EAED !important;
}
body.dark-mode .install-instruction-box li {
    color: #9AA0A6 !important;
}
body.dark-mode .add-card {
    background: #2D2D2D !important;
    border-color: #3D3D3D !important;
}
body.dark-mode .add-card:hover {
    background: #3D3D3D !important;
}
body.dark-mode .series-row {
    background: #2D2D2D !important;
}
body.dark-mode .series-row span {
    color: #E8EAED !important;
}
body.dark-mode .series-row label {
    color: #9AA0A6 !important;
}
body.dark-mode .admin-user-email {
    color: #9AA0A6 !important;
}
body.dark-mode .admin-user-date {
    color: #666 !important;
}
body.dark-mode .admin-feedback-text {
    color: #E8EAED !important;
}
body.dark-mode .admin-feedback-date {
    color: #666 !important;
}
body.dark-mode .calendar-legend-indicator {
    opacity: 0.8;
}
body.dark-mode .info-box {
    background: #2D2D2D !important;
    color: #9AA0A6 !important;
}
body.dark-mode .text-secondary {
    color: #9AA0A6 !important;
}
body.dark-mode .text-primary {
    color: #E8EAED !important;
}
body.dark-mode .category-form-preview {
    background: #2D2D2D !important;
}

.pb-safe {
    padding-bottom: 100px;
}

/* Calendar styles */
.calendar-container {
    padding: 20px;
}

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

.calendar-month {
    font-size: 18px;
    font-weight: 600;
    color: #1A1A1A;
}

.calendar-nav {
    display: flex;
    gap: 8px;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    background: white;
    padding: 16px;
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.calendar-day-header {
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: #80868B;
    padding: 8px 0;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.calendar-day.empty {
    cursor: default;
}

.calendar-day.today {
    border: 2px solid #1A1A1A;
}

.calendar-day.done {
    background: #D1FAE5;
    color: #059669;
}

.calendar-day.missed {
    background: #FEE2E2;
    color: #DC2626;
}

.calendar-day.none {
    background: #F5F6F8;
    color: #5F6368;
}

@media (hover: hover) and (pointer: fine) {
    .calendar-day.none:hover {
        background: #E8EAED;
    }
}

/* FAB central avec icône + */
.fab-center {
    position: fixed;
    bottom: 70px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 60px;
    border-radius: 30px;
    background: #1A1A1A;
    color: white;
    border: none;
    font-size: 32px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    z-index: 101;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

@media (hover: hover) and (pointer: fine) {
    .fab-center:hover {
        transform: translateX(-50%) scale(1.05);
        box-shadow: 0 6px 16px rgba(0,0,0,0.25);
    }
}

.fab-center:active {
    transform: translateX(-50%) scale(0.95);
}

/* Weight tracker styles */
.weight-chart-container {
    background: white;
    border-radius: 16px;
    padding: 20px;
    margin: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.weight-input-section {
    background: white;
    border-radius: 16px;
    padding: 20px;
    margin: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.weight-history {
    padding: 20px;
}

.weight-entry {
    background: white;
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.weight-value-large {
    font-size: 20px;
    font-weight: 700;
    color: #1A1A1A;
}

.weight-date {
    font-size: 13px;
    color: #80868B;
    margin-top: 4px;
}

/* Category manager */
.category-list {
    margin-top: 20px;
}

.category-item {
    background: white;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.category-color-preview {
    width: 40px;
    height: 40px;
    border-radius: 20px;
    flex-shrink: 0;
}

/* Pastille réduite dans la liste « Catégories masquées » du dashboard */
.exercise-list-item .category-color-preview {
    width: 14px;
    height: 14px;
    border-radius: 7px;
}

.category-item-info {
    flex: 1;
}

.category-item-name {
    font-size: 16px;
    font-weight: 600;
    color: #1A1A1A;
}

.category-item-name.category-item-hidden {
    opacity: 0.45;
    text-decoration: line-through;
}

.color-picker-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    margin-top: 12px;
}

.color-option {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
}

.color-option.selected {
    border-color: #1A1A1A;
    transform: scale(1.1);
}

@media (hover: hover) and (pointer: fine) {
    .color-option:hover {
        transform: scale(1.05);
    }
}

/* Indicateur hors ligne (sorti du style en ligne de index.html) */
.offline-indicator {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 20px;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    z-index: 9999;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.offline-icon { font-size: 18px; }

/* ==========================================================================
   REFONTE « PLAQUES » (2026-10-03)
   Sol caoutchouc et craie en sombre, salle claire en clair. Les couleurs de séance sont celles des
   catégories (choisies dans le gestionnaire), comme les disques de compétition codent les charges.
   Chiffres en Big Shoulders Display (lisibles d'un coup d'œil en salle), texte en Archivo.
   ========================================================================== */
:root {
    --floor: #EDEFF1;
    --floor-2: #FFFFFF;
    --floor-3: #E1E4E8;
    --line: #D8DCE1;
    --chalk: #1E2227;
    --chalk-soft: #59606A;
    --chalk-dim: #848B95;
    --blue: #2F6BD6;
    --yellow: #F2C230;
    --yellow-ink: #8A6A00;
    --yellow-wash: rgba(242, 194, 48, 0.18);
    --on-yellow: #2A2410;
    --green: #2E9E5B;
    --green-ink: #1F7A45;
    --green-wash: rgba(46, 158, 91, 0.12);
    --down-ink: #B4532F;
    --num: 'Big Shoulders Display', 'Archivo', sans-serif;
    --text: 'Archivo', -apple-system, BlinkMacSystemFont, sans-serif;
}
body.dark-mode {
    --floor: #24272C;
    --floor-2: #2E3238;
    --floor-3: #3A3F46;
    --line: #3A3F46;
    --chalk: #F1F0EA;
    --chalk-soft: #A9ADB3;
    --chalk-dim: #727880;
    --blue: #3A78E0;
    --yellow-ink: #F2C230;
    --yellow-wash: rgba(242, 194, 48, 0.12);
    --green: #35AE62;
    --green-ink: #8EE2AE;
    --green-wash: rgba(53, 174, 98, 0.14);
    --down-ink: #F0A487;
}

/* Socle commun à toutes les vues */
body, body.dark-mode {
    font-family: var(--text);
    background: var(--floor);
    color: var(--chalk);
}
body .app-container, body.dark-mode .app-container { background: var(--floor); }
body .header, body.dark-mode .header { background: var(--floor); border-bottom: 1px solid var(--line); }
body .header h1, body.dark-mode .header h1 { font-family: var(--num); font-weight: 900; font-size: 36px; letter-spacing: 0; color: var(--chalk); }
body .btn-icon, body.dark-mode .btn-icon { background: var(--floor-3); color: var(--chalk); }
body .btn-primary, body.dark-mode .btn-primary { background: var(--blue); color: #fff; }
body .btn-secondary, body.dark-mode .btn-secondary { background: var(--floor-2); color: var(--chalk-soft); border: 1px solid var(--line); }
body .modal, body.dark-mode .modal { background: var(--floor-2); color: var(--chalk); }
body .modal-header, body.dark-mode .modal-header { color: var(--chalk); }
body .form-label, body.dark-mode .form-label { color: var(--chalk-soft); }
body .form-input, body.dark-mode .form-input { background: var(--floor); border-color: var(--line); color: var(--chalk); }
body .form-input:focus, body.dark-mode .form-input:focus { border-color: var(--chalk-soft); }

body .bottom-nav, body.dark-mode .bottom-nav {
    background: var(--floor-2);
    border-top: 1px solid var(--line);
    justify-content: space-around;
    padding: 6px 8px max(14px, env(safe-area-inset-bottom));
}
body .nav-item, body.dark-mode .nav-item {
    flex: 1;
    padding: 6px 0;
    background: none;
    border: none;
    font-family: var(--text);
    color: var(--chalk-dim);
}
body .nav-item.active, body.dark-mode .nav-item.active { color: var(--chalk); }
.nav-icon { width: 24px; height: 24px; }
.nav-label { font-size: 11px; font-weight: 600; }

/* Boutons d'en-tête (actualiser, stats, catégories, réglages) */
.top-actions { display: flex; align-items: center; gap: 6px; }
.top-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    min-width: 36px; height: 36px; padding: 0 8px; border-radius: 18px; border: none;
    background: var(--floor-3); color: var(--chalk); font: 600 13px var(--text); cursor: pointer;
}
.top-btn.is-label { padding: 0 12px; }

/* ---------- Séance ---------- */
.seance { padding: max(16px, env(safe-area-inset-top)) 20px 0; padding-bottom: 110px; min-height: 100vh; }
.seance-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding-top: 8px; }
.seance-date { font-size: 15px; color: var(--chalk-soft); }
.seance-date::first-letter { text-transform: uppercase; }

.week { display: flex; justify-content: space-between; margin-top: 18px; }
.week-day { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; color: var(--chalk-dim); }
.week-day.is-today { color: var(--chalk); font-weight: 700; }
.disc { width: 38px; height: 38px; border-radius: 50%; border: 2px solid var(--floor-3); position: relative; }
.disc::after { content: ''; position: absolute; inset: 12px; border-radius: 50%; background: var(--floor); }
.disc.is-done { background: var(--disc); border-color: var(--disc); }
.disc.is-today { border: 2px dashed var(--chalk-soft); }
.week-note { margin-top: 10px; font-size: 13px; color: var(--chalk-soft); }

.plates { display: flex; gap: 8px; margin-top: 20px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.plates::-webkit-scrollbar { display: none; }
.plate {
    flex-shrink: 0; display: flex; align-items: center; gap: 8px; padding: 8px 14px 8px 10px;
    border-radius: 999px; border: none; background: var(--floor-2); color: var(--chalk-soft);
    font: 600 14px var(--text); cursor: pointer;
}
.plate i { width: 12px; height: 12px; border-radius: 50%; background: var(--disc); }
.plate.is-on { background: var(--chalk); color: var(--floor); }

.seance-sub { margin-top: 14px; font-size: 14px; color: var(--chalk-soft); }

.ex-list { list-style: none; margin-top: 16px; }
.ex-row, .ex-add {
    display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 0;
    border: none; border-top: 1px solid var(--line); background: none; color: var(--chalk);
    font-family: var(--text); text-align: left; cursor: pointer;
}
.ex-bar { width: 4px; align-self: stretch; border-radius: 2px; background: var(--cat); flex-shrink: 0; }
.ex-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ex-name { font-size: 15px; font-weight: 600; }
.ex-last { font-family: var(--num); font-size: 21px; font-weight: 700; color: var(--chalk-soft); white-space: pre-wrap; margin-top: 1px; }
.ex-today { font-size: 13px; color: var(--green-ink); margin-top: 2px; white-space: pre-wrap; }
.ex-goal { display: flex; flex-direction: column; align-items: flex-end; flex-shrink: 0; }
.ex-goal b { font-family: var(--num); font-size: 26px; font-weight: 800; line-height: 1; color: var(--yellow-ink); }
.ex-goal small { font-size: 11px; color: var(--chalk-dim); }
.ex-goal.is-beaten b { color: var(--green); }
.ex-add { color: var(--chalk-soft); font-size: 14px; font-weight: 600; border-bottom: 1px solid var(--line); }
.ex-add .ico { margin-left: 4px; }

.seance-empty { margin-top: 28px; padding: 24px; border-radius: 18px; background: var(--floor-2); text-align: center; color: var(--chalk-soft); }
.plate-cta { margin-top: 14px; padding: 12px 18px; border: none; border-radius: 14px; background: var(--blue); color: #fff; font: 700 15px var(--text); cursor: pointer; }

.hidden-block { margin-top: 18px; }
.hidden-head {
    display: flex; justify-content: space-between; align-items: center; width: 100%; padding: 10px 0;
    border: none; background: none; color: var(--chalk-soft); font: 600 14px var(--text); cursor: pointer;
}
.hidden-head[aria-expanded="true"] .ico { transform: rotate(180deg); }
.hidden-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.hidden-name { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 600; }
.hidden-meta { display: block; font-size: 12px; color: var(--chalk-dim); }
.hidden-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--disc); }
.hidden-show { padding: 7px 12px; border-radius: 12px; border: 1px solid var(--line); background: none; color: var(--chalk); font: 600 13px var(--text); cursor: pointer; }

.seance-cta {
    position: fixed; left: 20px; right: 20px; bottom: calc(76px + env(safe-area-inset-bottom)); z-index: 90;
    height: 56px; border: none; border-radius: 16px; background: var(--cat, var(--blue)); color: #fff;
    font: 700 17px var(--text); cursor: pointer; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
}
.progres .seance-cta { background: var(--blue); }
/* ---------- Saisie d'une série ---------- */
.logger-layer {
    position: fixed; inset: 0; z-index: 500; display: flex; align-items: flex-end; justify-content: center;
    background: rgba(8, 10, 12, 0.62);
}
.logger {
    position: relative; width: 100%; max-width: 520px; max-height: 94vh; overflow-y: auto; overscroll-behavior: contain;
    padding: 12px 20px 0; border-radius: 24px 24px 0 0; background: var(--floor-2); color: var(--chalk);
    display: flex; flex-direction: column; box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.3);
}
.logger::before { content: ''; display: block; flex-shrink: 0; width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 8px; }
.logger-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.logger-back { padding: 6px 0; border: none; background: none; color: var(--chalk); font: 600 16px var(--text); cursor: pointer; }
.logger-menu { display: flex; flex-direction: column; margin-top: 8px; border-radius: 14px; overflow: hidden; background: var(--floor); border: 1px solid var(--line); }
.logger-menu button { padding: 13px 16px; border: none; background: none; color: var(--chalk); font: 600 15px var(--text); text-align: left; cursor: pointer; }
.logger-menu button + button { border-top: 1px solid var(--line); }
.logger-menu .is-danger { color: var(--down-ink); }
.logger-title { font-family: var(--num); font-weight: 900; font-size: 38px; line-height: 0.95; margin-top: 14px; overflow-wrap: anywhere; }
.logger-sets { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 14px; color: var(--chalk-soft); }
.logger-sets i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--floor-3); flex-shrink: 0; }
.logger-sets i.is-done { background: var(--green); border-color: var(--green); }
.logger-sets i.is-now { border-color: var(--yellow); box-shadow: 0 0 0 3px var(--yellow-wash); }

.last-cap { margin-top: 14px; font-size: 13px; color: var(--chalk-soft); }
.last-grid { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 8px; border-radius: 14px; overflow: hidden; background: var(--floor); }
.last-grid.is-dense { grid-template-columns: repeat(4, 1fr); }
.last-grid div { padding: 9px 12px; border-left: 1px solid var(--line); }
.last-grid div:nth-child(3n + 1) { border-left: none; }
.last-grid.is-dense div { border-left: 1px solid var(--line); }
.last-grid.is-dense div:nth-child(4n + 1) { border-left: none; }
.last-grid small { display: block; font-size: 11px; color: var(--chalk-dim); }
.last-grid b { font-family: var(--num); font-size: 20px; font-weight: 700; color: var(--chalk-soft); }
.last-grid .is-now { background: var(--yellow-wash); }
.last-grid .is-now b, .last-grid .is-now small { color: var(--yellow-ink); }

.stepper { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 14px; }
.stepper + .stepper { margin-top: 4px; }
.step-btn {
    width: 52px; height: 52px; flex-shrink: 0; border-radius: 50%; border: none;
    background: var(--floor-3); color: var(--chalk); font-size: 26px; line-height: 1; cursor: pointer;
}
.step-val { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; }
.step-input {
    width: 100%; border: none; background: none; color: var(--chalk); text-align: center;
    font-family: var(--num); font-weight: 900; font-size: 58px; line-height: 1; padding: 0;
}
.step-input:focus { outline: none; color: var(--yellow-ink); }
.step-val span { font-size: 13px; color: var(--chalk-dim); margin-top: -2px; }

.verdict { display: flex; align-items: center; gap: 10px; margin-top: 12px; padding: 10px 14px; border-radius: 14px; font-size: 14px; font-weight: 600; }
.verdict .ico { flex-shrink: 0; }
.verdict.is-up { background: var(--green-wash); color: var(--green-ink); }
.verdict.is-same { background: var(--floor); color: var(--chalk-soft); }
.verdict.is-down { background: var(--floor); color: var(--chalk-soft); }
.done-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin-top: 12px; font-size: 14px; color: var(--chalk-soft); }
.done-line b { font-family: var(--num); font-size: 17px; font-weight: 700; color: var(--chalk); }
.logger-error { margin-top: 10px; font-size: 14px; color: var(--down-ink); }

.logger-foot { padding: 18px 0 max(14px, env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 10px; }
.logger-cta {
    height: 58px; border: none; border-radius: 16px; background: var(--yellow); color: var(--on-yellow);
    font: 800 17px var(--text); cursor: pointer;
}
.logger-cta:disabled { opacity: 0.6; }
.logger-cta.is-quiet { height: 48px; background: var(--floor-3); color: var(--chalk); font-weight: 700; }
.logger-cta.is-next { background: var(--blue); color: #fff; }
.rest { display: flex; justify-content: space-between; align-items: center; height: 58px; padding: 0 10px 0 18px; border-radius: 16px; background: var(--green-wash); color: var(--green-ink); font-size: 15px; font-weight: 600; }
.rest b { font-family: var(--num); font-size: 24px; font-weight: 800; margin-left: 6px; }
.rest-skip { padding: 9px 14px; border-radius: 12px; border: none; background: var(--floor); color: var(--chalk); font: 600 14px var(--text); cursor: pointer; }
.rest-note { text-align: center; font-size: 12px; color: var(--chalk-dim); }

/* ---------- Progrès ---------- */
.progres { padding: max(16px, env(safe-area-inset-top)) 20px 0; padding-bottom: 170px; min-height: 100vh; }
.progres-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding-top: 8px; flex-wrap: wrap; }
.progres-h1 { font-family: var(--num); font-weight: 900; font-size: 52px; line-height: 0.9; }
.progres-top .top-actions .top-actions { gap: 6px; }
.progres-empty { margin-top: 24px; color: var(--chalk-soft); }
.seg { display: flex; gap: 4px; margin-top: 14px; padding: 4px; border-radius: 12px; background: var(--floor-3); overflow-x: auto; }
.seg button { flex: 1; min-width: 70px; padding: 8px 6px; border: none; border-radius: 9px; background: none; color: var(--chalk-soft); font: 600 14px var(--text); cursor: pointer; white-space: nowrap; }
.seg button.is-on { background: var(--floor-2); color: var(--chalk); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12); }
.lead { margin-top: 18px; font-size: 20px; line-height: 1.32; font-weight: 500; }
.lead b { font-weight: 800; }
.lead .is-up { color: var(--green-ink); font-weight: 800; }
.lead .is-down { color: var(--down-ink); font-weight: 800; }

.bars { display: flex; align-items: flex-end; gap: 10px; height: 150px; margin-top: 30px; padding-bottom: 22px; }
.bar { position: relative; flex: 1; height: var(--h); border-radius: 8px 8px 3px 3px; background: var(--floor-3); }
.bar.is-last { background: var(--blue); }
.bar span { position: absolute; top: -20px; left: -6px; right: -6px; text-align: center; font-family: var(--num); font-size: 15px; font-weight: 700; color: var(--chalk-soft); }
.bar.is-last span { color: var(--chalk); }
.bar em { position: absolute; bottom: -20px; left: -6px; right: -6px; text-align: center; font-style: normal; font-size: 11px; color: var(--chalk-dim); white-space: nowrap; }

.records { display: flex; gap: 8px; margin-top: 18px; }
.record { flex: 1; min-width: 0; padding: 10px 12px; border: none; border-radius: 14px; background: var(--yellow-wash); color: var(--chalk); text-align: left; font-family: var(--text); cursor: pointer; }
.record small { display: flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; color: var(--yellow-ink); }
.record span { display: block; margin-top: 3px; font-size: 14px; font-weight: 600; line-height: 1.25; }

.trend-list { list-style: none; margin-top: 14px; border-radius: 16px; overflow: hidden; background: var(--floor-2); }
.trend-list li + li { border-top: 1px solid var(--line); }
.trend-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; border: none; background: none; color: var(--chalk); text-align: left; font-family: var(--text); cursor: pointer; }
.trend-name { flex: 1; min-width: 0; font-size: 15px; font-weight: 600; }
.trend-name small { display: block; margin-top: 1px; font-size: 12px; font-weight: 500; color: var(--chalk-dim); white-space: pre-wrap; }
.spark, .spark-empty { width: 58px; height: 26px; flex-shrink: 0; }
.spark polyline { fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; stroke: var(--chalk-dim); }
.spark circle { fill: var(--chalk-dim); }
.spark.is-up polyline { stroke: var(--green); }
.spark.is-up circle { fill: var(--green); }
.spark.is-down polyline { stroke: var(--down-ink); }
.spark.is-down circle { fill: var(--down-ink); }
.trend-delta { width: 58px; text-align: right; font-family: var(--num); font-size: 20px; font-weight: 800; flex-shrink: 0; }
.trend-delta.is-up { color: var(--green-ink); }
.trend-delta.is-down { color: var(--down-ink); }
.trend-delta.is-flat { color: var(--chalk-dim); }
.progres-note { margin-top: 10px; font-size: 12px; color: var(--chalk-dim); }

.back-link { padding: 14px 0 6px; border: none; background: none; color: var(--chalk); font: 600 16px var(--text); cursor: pointer; }
.back-link.is-inline { padding: 0 8px 0 0; white-space: nowrap; font-size: 15px; }
body .header:has(.back-link) h1 { font-size: 28px; flex: 1; }
.progres-title { margin-top: 8px; font-family: var(--num); font-weight: 900; font-size: 50px; line-height: 0.92; overflow-wrap: anywhere; }
.progres-sub { margin-top: 6px; font-size: 14px; color: var(--chalk-soft); }
.sets-card { display: flex; gap: 12px; margin-top: 18px; padding: 26px 14px 12px; border-radius: 18px; background: var(--floor-2); }
.sets-session { flex: 1; min-width: 0; }
.sets-chart { display: flex; align-items: flex-end; gap: 3px; height: 110px; }
.set-bar { position: relative; flex: 1; height: var(--h); border-radius: 5px 5px 2px 2px; }
.set-bar b { font-style: normal; position: absolute; top: -18px; left: -4px; right: -4px; text-align: center; font-family: var(--num); font-size: 15px; font-weight: 700; color: var(--chalk-soft); }
.set-bar.w0 { background: var(--blue); }
.set-bar.w1 { background: color-mix(in srgb, var(--blue) 42%, var(--floor-2)); }
.set-bar.w2 { background: color-mix(in srgb, var(--blue) 22%, var(--floor-2)); }
.set-bar.w3 { background: var(--floor-3); }
.sets-session p { margin-top: 8px; text-align: center; font-size: 12px; color: var(--chalk-dim); white-space: nowrap; }
.sets-session.is-last p { color: var(--chalk); font-weight: 700; }
.sets-key { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; font-size: 12px; color: var(--chalk-soft); }
.sets-key span { display: flex; align-items: center; gap: 6px; }
.sets-key .set-bar { flex: none; width: 10px; height: 10px; border-radius: 3px; }
.insight { margin-top: 14px; padding: 14px 16px; border-radius: 16px; background: var(--floor-2); font-size: 15px; line-height: 1.45; }
.insight b { font-weight: 800; }
.target { margin-top: 10px; padding: 14px 16px; border-radius: 16px; background: var(--yellow-wash); }
.target small { font-size: 12px; color: var(--yellow-ink); font-weight: 700; }
.target p { margin-top: 2px; font-size: 18px; font-weight: 700; }
.history-title { margin-top: 22px; font-size: 17px; font-weight: 700; }
.history { list-style: none; margin-top: 8px; }
.history button { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; width: 100%; padding: 10px 2px; border: none; border-top: 1px solid var(--line); background: none; color: var(--chalk); font-family: var(--text); text-align: left; cursor: pointer; }
.history span { font-size: 14px; color: var(--chalk-soft); white-space: nowrap; }
.history b { font-family: var(--num); font-size: 19px; font-weight: 700; text-align: right; white-space: pre-wrap; }
.more-btn { width: 100%; margin-top: 8px; padding: 12px; border-radius: 14px; border: 1px solid var(--line); background: none; color: var(--chalk); font: 600 14px var(--text); cursor: pointer; }

/* ---------- Poids ---------- */
.poids, .cal { padding: max(16px, env(safe-area-inset-top)) 20px 0; padding-bottom: 110px; min-height: 100vh; }
.poids-hero { margin-top: 18px; }
.poids-now { display: flex; align-items: baseline; gap: 8px; }
.poids-now b { font-family: var(--num); font-weight: 900; font-size: 96px; line-height: 0.9; }
.poids-now span { font-family: var(--num); font-weight: 800; font-size: 34px; color: var(--chalk-soft); }
.poids-meta { margin-top: 6px; font-size: 14px; color: var(--chalk-soft); }
.poids-change { display: inline-block; margin-top: 10px; padding: 7px 12px; border-radius: 999px; font-size: 14px; font-weight: 600; background: var(--floor-2); color: var(--chalk-soft); }
.poids-change.is-up { background: var(--green-wash); color: var(--green-ink); }
.poids-change.is-down { background: var(--yellow-wash); color: var(--down-ink); }
.poids-empty { margin-top: 18px; font-size: 15px; color: var(--chalk-soft); }
.poids-label { font-size: 13px; color: var(--chalk-soft); }
.poids-add { margin-top: 22px; padding: 14px 14px 14px 16px; border-radius: 16px; background: var(--floor-2); }
.poids-add-row { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.poids-input {
    flex: 1; min-width: 0; padding: 4px 0; border: none; background: none; color: var(--chalk);
    font-family: var(--num); font-weight: 900; font-size: 44px; line-height: 1;
}
.poids-input::placeholder { color: var(--chalk-dim); opacity: 0.6; }
.poids-input:focus { outline: none; }
.poids-unit { font-family: var(--num); font-weight: 800; font-size: 24px; color: var(--chalk-soft); }
.poids-btn { padding: 13px 18px; border: none; border-radius: 14px; background: var(--blue); color: #fff; font: 700 15px var(--text); cursor: pointer; }
.poids-btn:disabled { opacity: 0.45; cursor: default; }
.poids-goal { margin-top: 18px; }
.poids-goal .seg { margin-top: 6px; }

.chart-card { margin-top: 18px; padding: 14px 14px 10px; border-radius: 16px; background: var(--floor-2); }
.chart-card.is-relative { position: relative; }
.card-head { display: flex; justify-content: space-between; align-items: center; }
.card-title { font-size: 15px; font-weight: 700; }
.chart-box { height: 220px; margin-top: 10px; }
.chart-box.is-tall { height: 270px; }
.switch-row {
    display: flex; justify-content: space-between; align-items: center; gap: 12px; width: 100%; margin-top: 14px;
    padding: 12px 2px; border: none; background: none; color: var(--chalk); font: 600 14px var(--text); text-align: left; cursor: pointer;
}
.switch { position: relative; width: 46px; height: 26px; border-radius: 13px; background: var(--floor-3); flex-shrink: 0; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3); }
.switch.is-on { background: var(--blue); }
.switch.is-on::after { left: 23px; }
.info-btn { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--chalk-dim); background: none; color: var(--chalk-soft); font: 700 13px var(--text); cursor: pointer; }
.info-pop {
    position: absolute; top: 46px; right: 10px; left: 10px; z-index: 10; padding: 14px 16px; border-radius: 14px;
    background: var(--floor); border: 1px solid var(--line); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25); font-size: 13px; line-height: 1.5;
}
.info-pop p + p { margin-top: 6px; }
.info-pop-title { font-weight: 700; font-size: 14px; }
.info-pop .is-blue { color: var(--blue); }
.info-pop .is-green { color: var(--green); }
.info-pop-note { color: var(--chalk-soft); }
.info-pop-close { width: 100%; margin-top: 12px; padding: 10px; border: none; border-radius: 10px; background: var(--blue); color: #fff; font: 600 14px var(--text); cursor: pointer; }
body .form-input:disabled, body.dark-mode .form-input:disabled { opacity: 0.7; cursor: not-allowed; }

/* ---------- Calendrier ---------- */
.cal-head { display: flex; justify-content: space-between; align-items: center; margin-top: 18px; }
.cal-head .top-btn { width: 44px; height: 44px; border-radius: 22px; font-size: 22px; }
.cal-month { font-family: var(--num); font-weight: 900; font-size: 40px; line-height: 1; }
.cal-sum { margin-top: 8px; text-align: center; font-size: 14px; color: var(--chalk-soft); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px 6px; margin-top: 18px; touch-action: pan-y; }
.cal-dow { text-align: center; font-size: 12px; font-weight: 600; color: var(--chalk-dim); padding-bottom: 2px; }
.cal-day {
    aspect-ratio: 1; display: grid; place-items: center; border: none; border-radius: 50%;
    background: var(--floor-2); color: var(--chalk-soft); font-family: var(--num); font-size: 19px; font-weight: 800; cursor: pointer;
}
.cal-day.is-done { background: color-mix(in srgb, var(--disc) 24%, var(--floor)); box-shadow: inset 0 0 0 3px var(--disc); color: var(--chalk); }
.cal-day.is-missed { background: none; box-shadow: inset 0 0 0 2px var(--down-ink); color: var(--down-ink); text-decoration: line-through; }
.cal-day.is-today { outline: 2px dashed var(--chalk-soft); outline-offset: 2px; color: var(--chalk); }
.cal-legend { display: flex; flex-direction: column; gap: 8px; margin-top: 22px; padding: 14px 16px; border-radius: 16px; background: var(--floor-2); font-size: 13px; color: var(--chalk-soft); }
.cal-legend span { display: flex; align-items: center; gap: 10px; }
.cal-sample { width: 22px; height: 22px; flex-shrink: 0; cursor: default; }
.cal-legend .cal-sample.is-none { background: var(--floor-3); }
.cal-legend .cal-sample.is-done { --disc: var(--blue); }

/* ---------- Fenêtres (modales) : feuilles qui montent du bas, comme la saisie ---------- */
body .modal-overlay { background: rgba(8, 10, 12, 0.62); align-items: flex-end; padding: 0; }
body .modal, body.dark-mode .modal {
    width: 100%; max-width: 520px !important; max-height: 92vh; overflow-y: auto; overscroll-behavior: contain;
    border-radius: 24px 24px 0 0; padding: 12px 20px max(22px, env(safe-area-inset-bottom));
    background: var(--floor-2); color: var(--chalk); box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.3);
}
body .modal::before { content: ''; display: block; width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 16px; }
body .modal-header, body.dark-mode .modal-header {
    font-family: var(--num); font-weight: 900; font-size: 34px; line-height: 0.95; letter-spacing: 0;
    color: var(--chalk); margin-bottom: 18px;
}
body .modal p, body.dark-mode .modal p { color: inherit; }
body .btn, body.dark-mode .btn { border-radius: 14px; padding: 13px 18px; font-family: var(--text); font-weight: 700; font-size: 15px; }
body .btn-primary, body.dark-mode .btn-primary { background: var(--blue); color: #fff; border: none; }
body .btn-secondary, body.dark-mode .btn-secondary { background: var(--floor-3); color: var(--chalk); border: none; }
.btn .ico { flex-shrink: 0; }
.btn-block { width: 100%; justify-content: center; margin-bottom: 10px; }
body .btn.is-danger, body.dark-mode .btn.is-danger { background: none; color: var(--down-ink); border: 1px solid var(--line); margin-top: 6px; }
body .form-actions, body.dark-mode .form-actions { display: flex; gap: 10px; margin-top: 18px; }
body .form-actions .btn { flex: 1; }
body .action-btn, body.dark-mode .action-btn {
    width: 38px; height: 38px; border-radius: 19px; border: none; background: var(--floor-3); color: var(--chalk);
    display: inline-grid; place-items: center; cursor: pointer;
}
body .action-btn.delete, body.dark-mode .action-btn.delete { background: var(--floor-3); color: var(--down-ink); }
body .form-input, body.dark-mode .form-input { border-radius: 12px; }
body input[type="checkbox"] { accent-color: var(--blue); }
/* Fenêtre ouverte : la page derrière ne défile pas */
body:has(.modal-overlay), body:has(.logger) { overflow: hidden; }

/* Statistiques */
body .stat-card, body.dark-mode .stat-card { background: var(--floor-2); border: none; border-radius: 16px; box-shadow: none; }
body .modal .stat-card, body.dark-mode .modal .stat-card { background: var(--floor); }
body .stat-value, body.dark-mode .stat-value { font-family: var(--num); font-weight: 900; font-size: 34px; color: var(--chalk); }
body .stat-label, body.dark-mode .stat-label { color: var(--chalk-soft); }

/* Catégories */
body .category-item, body.dark-mode .category-item { background: var(--floor); border-radius: 14px; box-shadow: none; padding: 12px; margin-bottom: 8px; }
body .category-item-name, body.dark-mode .category-item-name { color: var(--chalk); }
body .category-color-preview { width: 30px; height: 30px; }
body .drag-handle, body.dark-mode .drag-handle { color: var(--chalk-dim); display: grid; place-items: center; padding: 0 2px; }
body .color-option.selected, body.dark-mode .color-option.selected { border-color: var(--chalk); }
body .category-form-preview, body.dark-mode .category-form-preview { margin-top: 16px; padding: 16px; border-radius: 14px; background: var(--floor) !important; }

/* Réglages */
.profile-head { position: relative; text-align: center; padding: 4px 0 18px; }
.sheet-close { position: absolute; top: -6px; right: -4px; width: 38px; height: 38px; border-radius: 19px; border: none; background: var(--floor-3); color: var(--chalk); display: grid; place-items: center; cursor: pointer; }
.profile-avatar {
    width: 76px; height: 76px; margin: 0 auto 12px; border-radius: 50%; overflow: hidden; display: grid; place-items: center;
    background: var(--floor-3); color: var(--chalk); font-family: var(--num); font-weight: 900; font-size: 40px;
}
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-name { font-family: var(--num); font-weight: 900; font-size: 34px; line-height: 1; }
.profile-mail { margin-top: 4px; font-size: 14px; color: var(--chalk-soft); }
.notice { margin-bottom: 16px; padding: 12px 14px; border-radius: 12px; font-size: 14px; font-weight: 600; }
.notice.is-ok { background: var(--green-wash); color: var(--green-ink); }
.notice.is-error { background: var(--yellow-wash); color: var(--down-ink); }
.sheet-divider { margin: 16px 0; padding-top: 16px; border-top: 1px solid var(--line); }
.sheet-label { margin-bottom: 10px; font-size: 13px; font-weight: 600; color: var(--chalk-soft); }
.toggle-label { flex: 1; font-size: 15px; font-weight: 600; }
body .toggle-container { justify-content: space-between; }
body .toggle-switch, body.dark-mode .toggle-switch { width: 46px; height: 26px; border-radius: 13px; background: var(--floor-3); }
body .toggle-switch.active, body.dark-mode .toggle-switch.active { background: var(--blue); }
body .toggle-slider { top: 3px; left: 3px; }
body .toggle-switch.active .toggle-slider { transform: translateX(20px); }

@media (prefers-reduced-motion: reduce) {
    .view-transition { animation: none; }
}
