/* ============================================================
   WORKOUT TRACKER - STYLES (Motion.dev-inspired)
   ============================================================ */

/* ============================================================
   SPLASH SCREEN
   ============================================================ */

.splash-screen {
    position: fixed;
    inset: 0;
    z-index: 500;
    background: var(--bg-primary, #0a0a0a);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.splash-screen.splash-exit {
    opacity: 0;
    transform: scale(1.05);
}

.splash-content {
    text-align: center;
}

.splash-title {
    font-size: 2.2rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    background: linear-gradient(135deg, #ef4444, #3b82f6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.splash-sub {
    color: #888;
    font-size: 0.95rem;
    margin-bottom: 2rem;
}

.splash-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.splash-btn {
    padding: 20px 32px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: #161616;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    text-align: center;
    min-width: 180px;
}

.splash-btn:hover {
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

.splash-btn-primary:hover {
    border-color: #ef4444;
    box-shadow: 0 8px 30px rgba(239, 68, 68, 0.15);
}

.splash-btn-secondary:hover {
    border-color: #3b82f6;
    box-shadow: 0 8px 30px rgba(59, 130, 246, 0.15);
}

.splash-btn-name {
    display: block;
    font-size: 1.2rem;
    font-weight: 700;
    color: #f0f0f0;
    margin-bottom: 4px;
}

.splash-btn-sub {
    display: block;
    font-size: 0.78rem;
    color: #888;
    font-style: italic;
}

/* ============================================================
   GUEST MODE - hide editing controls
   ============================================================ */

.guest-mode .owner-only,
.guest-mode .btn-new-workout,
.guest-mode .btn-edit-weights,
.guest-mode .weight-edit-hint {
    display: none !important;
}

.guest-mode .weight-card.clickable {
    cursor: default;
}

.guest-mode .weight-card.clickable:hover {
    transform: none;
    box-shadow: none;
    border-color: rgba(255, 255, 255, 0.08);
}

/* ============================================================
   WEIGHTS EDITOR
   ============================================================ */

.btn-edit-weights {
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: transparent;
    color: #888;
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-edit-weights:hover {
    border-color: rgba(255, 255, 255, 0.15);
    color: #f0f0f0;
}

.weights-editor-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 4px;
}

.weights-editor-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    color: #f0f0f0;
    transition: background 0.15s ease;
}

.weights-editor-item:hover {
    background: rgba(255, 255, 255, 0.04);
}

.weights-editor-checkbox,
.progression-editor-checkbox {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-secondary);
    cursor: pointer;
    flex-shrink: 0;
    position: relative;
    transition: border-color 0.2s ease, background 0.2s ease;
}
.weights-editor-checkbox:checked,
.progression-editor-checkbox:checked {
    background: var(--text-primary);
    border-color: var(--text-primary);
}
.weights-editor-checkbox:checked::after,
.progression-editor-checkbox:checked::after {
    content: "";
    position: absolute;
    left: 5px;
    top: 2px;
    width: 5px;
    height: 9px;
    border: solid var(--bg-primary);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

@media (max-width: 640px) {
    .splash-buttons {
        flex-direction: column;
        align-items: center;
    }
    .splash-btn {
        min-width: 220px;
    }
    .weights-editor-list {
        grid-template-columns: 1fr;
    }
}

:root {
    --bg-primary: #0a0a0a;
    --bg-secondary: #111;
    --bg-card: #161616;
    --bg-card-hover: #1c1c1c;
    --text-primary: #f0f0f0;
    --text-secondary: #888;
    --accent-push: #ef4444;
    --accent-pull: #3b82f6;
    --accent-legs: #22c55e;
    --border-color: rgba(255, 255, 255, 0.08);
    --border-color-hover: rgba(255, 255, 255, 0.15);
    --nav-bg: rgba(10, 10, 10, 0.85);
    --radius: 12px;
    --radius-sm: 8px;
    --transition-spring: cubic-bezier(0.16, 1, 0.3, 1);
    --transition-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* ---- NAVBAR ---- */

.navbar {
    background: var(--nav-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-brand {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, var(--accent-push), var(--accent-pull));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-links {
    display: flex;
    gap: 2px;
    background: rgba(255, 255, 255, 0.04);
    padding: 3px;
    border-radius: 10px;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 500;
    transition: all 0.25s var(--transition-spring);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-link:hover {
    color: var(--text-primary);
}

.nav-link.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

/* ---- LAYOUT ---- */

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

.page {
    display: none;
}

.page.active {
    display: block;
}

.page-header {
    margin-bottom: 1.5rem;
}

.page-header h1 {
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    margin-bottom: 0.25rem;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 0.88rem;
}

.hidden {
    display: none !important;
}

/* ---- BADGES ---- */

.workout-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-push {
    background: rgba(239, 68, 68, 0.12);
    color: var(--accent-push);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.badge-pull {
    background: rgba(59, 130, 246, 0.12);
    color: var(--accent-pull);
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.badge-legs {
    background: rgba(34, 197, 94, 0.12);
    color: var(--accent-legs);
    border: 1px solid rgba(34, 197, 94, 0.2);
}

/* ============================================================
   NEW WORKOUT FORM
   ============================================================ */

.btn-new-workout {
    width: 100%;
    padding: 14px;
    border: 1px dashed rgba(255, 255, 255, 0.15);
    border-radius: var(--radius);
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s var(--transition-spring);
    margin-bottom: 1.5rem;
}

.btn-new-workout:hover {
    border-color: rgba(255, 255, 255, 0.3);
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.03);
}

.new-workout-form {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.nw-step h2 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

.type-selector {
    display: flex;
    gap: 0.75rem;
}

.type-btn {
    flex: 1;
    padding: 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s var(--transition-spring);
}

.type-btn:hover {
    border-color: var(--border-color-hover);
    transform: translateY(-2px);
}

.type-btn[data-type="Push"]:hover { border-color: var(--accent-push); box-shadow: 0 4px 20px rgba(239, 68, 68, 0.15); }
.type-btn[data-type="Pull"]:hover { border-color: var(--accent-pull); box-shadow: 0 4px 20px rgba(59, 130, 246, 0.15); }
.type-btn[data-type="Legs"]:hover { border-color: var(--accent-legs); box-shadow: 0 4px 20px rgba(34, 197, 94, 0.15); }

.nw-step2-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.nw-date-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 1rem;
    padding: 12px 0 16px;
    border-bottom: 1px solid var(--border-color);
    overflow: visible;
    animation: dateRowSlideIn 0.4s var(--transition-spring) both;
}

@keyframes dateRowSlideIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
        max-height: 0;
        padding-top: 0;
        padding-bottom: 0;
        margin-bottom: 0;
    }
    to {
        opacity: 1;
        transform: translateY(0);
        max-height: 120px;
        padding-top: 12px;
        padding-bottom: 12px;
        margin-bottom: 1rem;
    }
}

.nw-date-row label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.nw-date-picker {
    display: flex;
    gap: 8px;
}

.nw-date-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.nw-date-value {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    min-width: 44px;
    text-align: center;
    padding: 4px 8px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    letter-spacing: -0.02em;
    transition: border-color 0.2s ease;
}

.nw-date-btn {
    background: none;
    border: 1px solid transparent;
    color: var(--text-tertiary);
    font-size: 0.6rem;
    cursor: pointer;
    padding: 4px 12px;
    border-radius: var(--radius-sm);
    transition: all 0.2s var(--transition-spring);
    line-height: 1;
}

.nw-date-btn:hover {
    color: var(--text-primary);
    background: var(--bg-secondary);
    border-color: var(--border-color);
}

.nw-date-btn:active {
    transform: scale(0.9);
}

.nw-exercise {
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

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

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

.nw-exercise-name {
    font-weight: 600;
    font-size: 0.9rem;
}

.nw-exercise-weight-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.nw-sets-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.nw-weight-adjust, .nw-sets-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nw-adj-btn {
    width: 42px;
    height: 30px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.nw-adj-btn:hover {
    border-color: var(--border-color-hover);
    color: var(--text-primary);
}

.nw-weight-val {
    font-size: 0.9rem;
    font-weight: 700;
    min-width: 40px;
    text-align: center;
}

.nw-set-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    line-height: 1;
}

.nw-set-btn:hover {
    border-color: var(--border-color-hover);
    color: var(--text-primary);
}

.nw-set-count {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    min-width: 45px;
    text-align: center;
}

/* ---- Per-Set UI ---- */

.nw-set-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 0;
}

.nw-set-label {
    font-size: 0.78rem;
    color: var(--text-secondary);
    font-weight: 500;
    min-width: 36px;
}

.nw-set-field {
    display: flex;
    align-items: center;
    gap: 2px;
}

.nw-set-field .nw-adj-btn {
    width: 32px;
    height: 28px;
    font-size: 0.7rem;
}

.nw-set-field .nw-weight-val {
    min-width: 36px;
    font-size: 0.85rem;
}

.nw-set-val-group {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 3px;
    min-width: 58px;
}

.nw-set-unit {
    font-size: 0.72rem;
    color: var(--text-secondary);
}

/* ---- Exercise Toggle ---- */

.nw-exercise-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.nw-exercise-checkbox {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-secondary);
    cursor: pointer;
    flex-shrink: 0;
    position: relative;
    transition: border-color 0.2s ease, background 0.2s ease;
}
.nw-exercise-checkbox:checked {
    background: var(--text-primary);
    border-color: var(--text-primary);
}
.nw-exercise-checkbox:checked::after {
    content: "";
    position: absolute;
    left: 5px;
    top: 2px;
    width: 5px;
    height: 9px;
    border: solid var(--bg-primary);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.nw-exercise-excluded {
    opacity: 0.4;
}

.nw-exercise-excluded .nw-exercise-name {
    text-decoration: line-through;
    color: var(--text-secondary);
}

/* ---- Add Exercise Dropdown ---- */

.nw-add-exercise-wrapper {
    padding: 12px 0 4px;
    position: relative;
}

.nw-add-exercise-trigger {
    width: 100%;
    padding: 12px;
    border-radius: var(--radius-sm);
    border: 1px dashed var(--border-color);
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s var(--transition-spring);
    text-align: center;
}

.nw-add-exercise-trigger:hover {
    border-color: var(--border-color-hover);
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.03);
}

.nw-add-exercise-menu {
    position: absolute;
    left: 0;
    right: 0;
    bottom: calc(100% - 8px);
    background: var(--bg-card);
    border: 1px solid var(--border-color-hover);
    border-radius: var(--radius);
    padding: 6px;
    z-index: 50;
    box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.4);
    max-height: 240px;
    overflow-y: auto;
}

.nw-add-exercise-item {
    display: block;
    width: 100%;
    padding: 10px 12px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--text-primary);
    font-size: 0.85rem;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s ease;
}

.nw-add-exercise-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.nw-add-exercise-item + .nw-add-exercise-item {
    margin-top: 2px;
}

.nw-add-set-btn {
    display: inline-block;
    margin-top: 4px;
    padding: 4px 12px;
    border-radius: 6px;
    border: 1px dashed var(--border-color);
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.nw-add-set-btn:hover {
    border-color: var(--border-color-hover);
    color: var(--text-primary);
}

.nw-remove-set-btn {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.nw-remove-set-btn:hover {
    border-color: rgba(239, 68, 68, 0.3);
    color: var(--accent-push);
    background: rgba(239, 68, 68, 0.08);
}

/* ---- Edit/Delete Icon Buttons ---- */

.btn-icon {
    width: 30px;
    height: 30px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.btn-icon:hover {
    border-color: var(--border-color-hover);
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.btn-icon-danger:hover {
    border-color: rgba(239, 68, 68, 0.3);
    color: var(--accent-push);
    background: rgba(239, 68, 68, 0.08);
}

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

.nw-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.25rem;
}

.btn-save {
    flex: 1;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    border: none;
    background: #fff;
    color: #000;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s var(--transition-spring);
}

.btn-save:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.btn-cancel, .btn-back {
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-cancel:hover, .btn-back:hover {
    border-color: var(--border-color-hover);
    color: var(--text-primary);
}

/* ============================================================
   WORKOUT LOG CARDS
   ============================================================ */

.workout-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1rem;
    transition: border-color 0.3s ease;
}

.workout-card:hover {
    border-color: var(--border-color-hover);
}

.workout-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.workout-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin-bottom: 2px;
}

.workout-date {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.workout-stats {
    display: flex;
    gap: 2rem;
    margin-bottom: 1rem;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.stat {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.stat-label {
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.exercise-table {
    width: 100%;
    border-collapse: collapse;
}

.exercise-table th {
    text-align: left;
    padding: 6px 10px;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
}

.exercise-table td {
    padding: 8px 10px;
    font-size: 0.85rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.025);
}

.exercise-table tr:last-child td {
    border-bottom: none;
}

/* ============================================================
   PROGRESSION CHARTS
   ============================================================ */

.progression-category {
    margin-bottom: 2rem;
}

.category-title {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin-bottom: 1rem;
}

.chart-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    margin-bottom: 0.75rem;
    transition: border-color 0.3s ease;
}

.chart-card:hover {
    border-color: var(--border-color-hover);
}

.chart-title {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    letter-spacing: -0.01em;
}

.chart-canvas {
    width: 100%;
    height: auto;
    display: block;
}

.chart-highlight {
    position: absolute;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2.5px solid;
    background: var(--bg-primary);
    transform: translate(-50%, -50%) scale(0);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s ease, transform 0.2s var(--transition-bounce);
    z-index: 5;
}
.chart-highlight.active {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
    animation: chartPulse 1.5s ease-in-out infinite;
}
@keyframes chartPulse {
    0%, 100% { box-shadow: 0 0 6px 2px var(--hl-color); }
    50% { box-shadow: 0 0 14px 5px var(--hl-color); }
}

.chart-tooltip {
    position: fixed;
    background: rgba(20, 20, 20, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 0.8rem;
    color: #fff;
    pointer-events: none;
    z-index: 1000;
    backdrop-filter: blur(10px);
    transition: opacity 0.15s ease;
    line-height: 1.4;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

.chart-tooltip-sub {
    display: block;
    font-size: 0.72rem;
    color: var(--text-secondary);
    font-weight: 400;
}

/* ============================================================
   CURRENT WEIGHTS
   ============================================================ */

.weight-category {
    margin-bottom: 2rem;
}

.weights-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.75rem;
}

.weight-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1.25rem 1rem;
    text-align: center;
    transition: all 0.25s var(--transition-spring);
    position: relative;
}

.weight-card.clickable {
    cursor: pointer;
}

.weight-card.clickable:hover {
    border-color: var(--border-color-hover);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.weight-card.clickable:hover .weight-edit-hint {
    opacity: 1;
}

.weight-exercise {
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin-bottom: 6px;
    font-weight: 500;
}

.weight-value {
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    margin-bottom: 4px;
}

.weight-notes {
    font-size: 0.72rem;
    color: var(--text-secondary);
}

.weight-edit-hint {
    font-size: 0.68rem;
    color: rgba(255, 255, 255, 0.3);
    margin-top: 6px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

/* ============================================================
   MODAL
   ============================================================ */

.modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: #1a1a1a;
    border: 1px solid var(--border-color-hover);
    border-radius: 16px;
    padding: 2rem;
    min-width: 300px;
    text-align: center;
    transform: scale(0.9);
    opacity: 0;
    transition: all 0.3s var(--transition-bounce);
}

.modal-content h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
    letter-spacing: -0.02em;
}

.modal-weight-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.modal-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s var(--transition-spring);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-btn:hover {
    border-color: #fff;
    transform: scale(1.05);
}

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

.modal-weight-display {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -0.04em;
    min-width: 80px;
}

.modal-actions {
    display: flex;
    gap: 0.75rem;
}

.modal-actions .btn-save {
    flex: 1;
}

.modal-actions .btn-cancel {
    flex: 1;
}

.delete-modal-content {
    max-width: 320px;
}

.delete-modal-sub {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 1.5rem;
    margin-top: -0.75rem;
}

.btn-delete-confirm {
    flex: 1;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    border: none;
    background: var(--accent-push);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s var(--transition-spring);
}

.btn-delete-confirm:hover {
    opacity: 0.85;
    transform: translateY(-1px);
}

/* ============================================================
   INSPIRE SAAHIL MODAL (Guest)
   ============================================================ */

.inspire-modal-content {
    max-width: 400px;
    text-align: left;
}

.inspire-modal-content h3 {
    text-align: center;
}

.inspire-modal-sub {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 1rem;
    margin-top: -0.75rem;
    text-align: center;
    white-space: nowrap;
}

@media (max-width: 640px) {
    .inspire-modal-sub {
        white-space: normal;
    }
}

.inspire-from-input {
    width: 100%;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
    padding: 10px 12px;
    margin-bottom: 10px;
    transition: border-color 0.2s ease;
}

.inspire-from-input:focus {
    outline: none;
    border-color: var(--border-color-hover);
}

.inspire-from-input::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}

.inspire-textarea {
    width: 100%;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
    padding: 12px;
    resize: vertical;
    min-height: 80px;
    transition: border-color 0.2s ease;
}

.inspire-textarea:focus {
    outline: none;
    border-color: var(--border-color-hover);
}

.inspire-textarea::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}

.inspire-char-count {
    text-align: right;
    font-size: 0.72rem;
    color: var(--text-secondary);
    margin-top: 4px;
    margin-bottom: 1rem;
}

/* ---- Sent Confirmation Animation ---- */

.inspire-sent {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 1.5rem 0;
}

.inspire-check-svg {
    width: 56px;
    height: 56px;
}

.inspire-check-circle {
    stroke: #36c87a;
    stroke-width: 2;
    stroke-dasharray: 157;
    stroke-dashoffset: 157;
    animation: inspire-circle 0.5s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.inspire-check-path {
    stroke: #36c87a;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    animation: inspire-check 0.35s cubic-bezier(0.65, 0, 0.45, 1) 0.4s forwards;
}

.inspire-sent-text {
    font-size: 1rem;
    font-weight: 600;
    color: #36c87a;
    letter-spacing: -0.01em;
}

@keyframes inspire-circle {
    to { stroke-dashoffset: 0; }
}

@keyframes inspire-check {
    to { stroke-dashoffset: 0; }
}

/* ============================================================
   MESSAGES MODAL (Saahil)
   ============================================================ */

.messages-modal-content {
    max-width: 420px;
    text-align: center;
}

.messages-list {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 1.25rem;
}

.message-bubble {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 14px 16px;
    margin-bottom: 10px;
    text-align: left;
}

.message-bubble:last-child {
    margin-bottom: 0;
}

.message-text {
    font-size: 0.9rem;
    color: var(--text-primary);
    line-height: 1.5;
    margin-bottom: 6px;
}

.message-from {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.message-meta {
    font-size: 0.72rem;
    color: var(--text-secondary);
}

/* ============================================================
   BODY MAP
   ============================================================ */

.bodymap-container {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin: 1rem 0 1.5rem;
    flex-wrap: wrap;
}

.bodymap-panel {
    text-align: center;
}

.bodymap-panel h2 {
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 500;
}

.body-figure {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

.body-figure svg {
    width: 260px;
    height: 420px;
}

.muscle-group {
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.legend {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
}

.legend h3 {
    font-size: 0.78rem;
    margin-bottom: 0.6rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.legend-items {
    display: flex;
    gap: 1.25rem;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ---- Body Map Tooltip ---- */

.bodymap-tooltip {
    position: fixed;
    background: rgba(20, 20, 20, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 0.82rem;
    color: #fff;
    pointer-events: none;
    z-index: 1000;
    backdrop-filter: blur(10px);
    line-height: 1.5;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
    max-width: 250px;
}

.bodymap-tooltip strong {
    display: block;
    margin-bottom: 2px;
    font-size: 0.85rem;
}

.tooltip-exercises {
    color: var(--text-secondary);
    font-size: 0.75rem;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 640px) {
    .navbar {
        flex-direction: column;
        align-items: center;
        height: auto;
        padding: 10px 1rem;
        gap: 8px;
    }

    .nav-links {
        width: 100%;
        justify-content: center;
    }

    .nav-link {
        font-size: 0.75rem;
        padding: 5px 10px;
        text-align: center;
    }

    .container {
        padding: 1.25rem 1rem;
    }

    .type-selector {
        flex-direction: column;
    }

    .bodymap-container {
        gap: 1rem;
    }

    .body-figure svg {
        width: 210px;
        height: 340px;
    }

    .splash-title {
        font-size: 1.75rem;
    }

    .workout-stats {
        gap: 1rem;
    }

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

    .nw-sets-row {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .nw-weight-adjust, .nw-sets-controls {
        justify-content: center;
    }

    .nw-set-row {
        flex-wrap: nowrap;
        gap: 5px;
        justify-content: flex-start;
    }

    .modal-content {
        margin: 1rem;
        min-width: auto;
        width: calc(100% - 2rem);
    }

    .page-header {
        text-align: center;
    }

    .page-header h1 {
        text-align: center;
    }

    .page-header > div {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }

    .category-title {
        justify-content: center;
    }

    .workout-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 8px;
    }

    .workout-header > div {
        text-align: center;
    }

    .chart-card {
        overflow: hidden;
    }
}

/* ============================================================
   ANIMATIONS (Motion.dev-inspired spring/ease)
   ============================================================ */

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

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.92);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}
