.page-header .divider {
    border: 0;
    border-top: var(--glass-border);
    margin: 15px 0 0 0;
    width: 100%;
}

.divider {
    border: 0;
    border-top: 1px solid #3a3a3c;
    margin: 20px 0;
}

.divider.accordion {
    margin: 5px 0;
}

/* =========================
    Dropdown Menu
========================= */
.exercise-dropdown-container {
    position: relative;
    flex-direction: column;
    z-index: 1001;
}
.menu-trigger {
    background: none;
    border: none;
    color: var(--text);
    font-size: 2rem; /* Adjust size to match your header scale */
    font-weight: 600;
    height: 70px; /* Match header height for a larger hit-box */
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    line-height: 1;
    padding: 8px 12px;
    transition: opacity 0.2s;
}

.hamburger-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 2rem; /* Match font size */
}

.menu-trigger:active {
    opacity: 0.5;
}

.exercise-menu-list {
    position: absolute;
    top: 25px;
    left: 10px;
    min-width: 180px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 4px;
    border-radius: 12px;
    padding: 8px;
    background: var(--layer-4);
    -webkit-backdrop-filter: var(--glass-blur);
    backdrop-filter: var(--glass-blur);
    border: var(--glass-border);
    box-shadow: var(--shadow-2);

    pointer-events: none; /* Prevents clicks when hidden */
    transform-origin: top left;
    opacity: 0.5;
    visibility: hidden;
    clip-path: inset(0 100% 100% 0);
    transform: translate(10px, 10px); /* Appear from inside the button */
    transition:
        opacity 0.3s ease,
        transform 0.4s ease,
        clip-path 0.4s cubic-bezier(0.4, 0, 0.2, 1),
        visibility 0.4s;

    will-change: clip-path, opacity;
}

.exercise-menu-list.show {
    pointer-events: auto; /* Enables clicks when shown */
    opacity: 1;
    visibility: visible;
    clip-path: inset(0 0 0% 0); /* Reveals the full menu */
    transform: translate(0, 0); /* Aligns it perfectly with the trigger */
}

.exercise-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border-radius: 8px;
    color: var(--text);
    font-size: 15px;
    transition: background 0.2s;
    cursor: pointer;
}

.exercise-menu-item:active {
    background: var(--layer-1);
    box-shadow: inset var(--shadow-4);
}

.exercise-menu-item.active {
    background: var(--secondary-bg);
    border: var(--glass-border);
    box-shadow: var(--shadow-2);
    color: var(--fitness-green);
    font-weight: 600;
}

.menu-thumb-container {
    width: 24px;
    height: 24px;
    margin-right: 16px;
    border-radius: 8px;
    overflow: visible; /* Clips the image to the box */
    flex-shrink: 0; /* Keeps the square from squishing */
    display: flex;
    align-items: center;
    justify-content: center;
}
.menu-thumb {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    opacity: 0.8;
    transition: transform 0.3s ease;
}

/* =================================================
    GOOGLE LOGIN BUTTON
   ================================================= */
.btn-login-pill {
    z-index: 1002; /* Higher than everything else */
    display: flex;
    align-items: center;
    gap: 8px;
    height: 40px;
    padding: 0 0 0 10px;
    border-radius: 20px;
    border: var(--glass-border);
    background-color: white;
    box-shadow: var(--shadow-2);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: #000;
}

/* logged-in state */
.btn-login-pill.logged-in {
    padding: 0;
    width: 40px;
    border-radius: 50%;
    background-size: cover;
}

.btn-login-pill.logged-in .login-text,
.btn-login-pill.logged-in .google-icon {
    display: none;
}

/* =========================
     Install Banner 
   ========================= */
#install-text {
    font-weight: 600;
    font-size: 0.9rem;
    text-align: center;
    margin-left: auto;
    margin-right: auto;
}

#btn-install-close {
    font-size: large;
    margin-bottom: auto;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}
.ios-icon {
    display: inline-block;
    width: 22px;
    height: 22px;
    vertical-align: text-bottom;
    margin: 0 4px;
    border: 1.5px solid rgba(0, 123, 255, 0.137);
    background: rgba(255, 255, 255, 0.6);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    border-radius: 4px;
    position: relative;
    &::after {
        content: "";
        position: absolute;
        top: 2px;
        left: 2px;
        right: 2px;
        bottom: 2px;
        background-color: currentColor;
        -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 3v13m0-13l-4 4m4-4l4 4M5 11v10a1 1 0 001 1h12a1 1 0 001-1V11' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round' fill='none'/%3E%3C/svg%3E")
            no-repeat center;
        mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 3v13m0-13l-4 4m4-4l4 4M5 11v10a1 1 0 001 1h12a1 1 0 001-1V11' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round' fill='none'/%3E%3C/svg%3E")
            no-repeat center;
        -webkit-mask-size: contain;
        mask-size: contain;
    }
}
.ios-add-icon {
    display: inline-block;
    width: 18px;
    height: 18px;
    vertical-align: text-bottom;
    margin: 0 4px;
    border: 1.5px solid rgba(10, 10, 10, 0.959);
    background: rgba(255, 255, 255, 0.6);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    border-radius: 5px; /* Slightly more rounded to match Apple's UI */
    position: relative;
    &::after {
        content: "";
        position: absolute;
        top: 2px;
        left: 2px;
        right: 2px;
        bottom: 2px;
        background-color: currentColor;
        -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' stroke='black' stroke-width='3' stroke-linecap='round'%3E%3Cline x1='12' y1='5' x2='12' y2='19'%3E%3C/line%3E%3Cline x1='5' y1='12' x2='19' y2='12'%3E%3C/line%3E%3C/svg%3E")
            no-repeat center;
        mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' stroke='black' stroke-width='3' stroke-linecap='round'%3E%3Cline x1='12' y1='5' x2='12' y2='19'%3E%3C/line%3E%3Cline x1='5' y1='12' x2='19' y2='12'%3E%3C/line%3E%3C/svg%3E")
            no-repeat center;
        -webkit-mask-size: contain;
        mask-size: contain;
    }
}
/* ============================= */

.goal-description {
    padding-bottom: 8px;
    opacity: 0.6;
}

.lb-context-label {
    text-align: center;
    margin-top: 15px;
    margin-bottom: 15px;
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* =========================
     BUTTONS 
   ========================= */

.btn-primary {
    background: var(--primary);
    box-shadow: var(--shadow-4);
    border: var(--glass-border);
    color: white;
    padding: 15px;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
}

.floating-btn {
    position: fixed;
    bottom: 85px;
    bottom: calc(85px + env(safe-area-inset-bottom));
    left: 50%;
    transform: translateX(-50%);
    width: 85%;
    max-width: 360px;
    z-index: 100;
}

.btn-icon {
    background: none;
    border: none;
    font-size: 1.6rem;
    cursor: pointer;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    position: relative;
    z-index: 101;
}

.btn-delete {
    background: var(--danger);
    color: white;
    border: none;
    padding: 8px 14px;
    border-radius: 8px;
    font-weight: bold;
}
.btn-secondary,
.btn-primary-small {
    flex: 1;
    padding: 14px;
    border-radius: 12px;
    font-weight: bold;
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
    transition: opacity 0.2s;
}

.btn-secondary {
    background: var(--secondary-bg);
    border: var(--glass-border);
    color: var(--text);
    box-shadow: var(--shadow-1);
}
.btn-secondary:disabled {
    opacity: 0.5;
}

.btn-primary-small {
    background: var(--primary);
    box-shadow: var(--shadow-2);
    border: var(--glass-border);
    color: white;
}

#btn-add-past {
    width: 100%;
    margin-top: 15px;
}

.btn-danger {
    background: var(--secondary-bg);
    color: var(--danger);
    border: 1px solid var(--danger);
    box-shadow: var(--shadow-1);
    padding: 10px;
    border-radius: 8px;
    font-weight: bold;
    width: 100%;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-danger:active {
    background: var(--danger);
    color: white;
}

#btn-update-app {
    background: var(--layer-4);
}

.segmented-control {
    display: flex;
    background: var(--secondary-bg);
    border: var(--glass-border);
    -webkit-backdrop-filter: var(--glass-blur);
    backdrop-filter: var(--glass-blur);
    box-shadow: inset var(--shadow-1);
    border-radius: 12px;
    padding: 3px;
    gap: 2px;
}

.seg-btn {
    flex: 1;
    border: none;
    background: transparent;
    padding: 8px 10px;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 9px;
    transition: all 0.2s ease;
}

.seg-btn.active {
    background: var(--layer-4); /* The "floating" active pill */
    color: var(--fitness-green);
    box-shadow: var(--shadow-1);
    border: var(--glass-border);
}

#theme-selector .seg-btn.active {
    background: var(--layer-0); /* Match the current theme for a more integrated look */
    box-shadow: var(--shadow-1);
    border: var(--glass-border);
}

.input-inline-group input {
    flex: 1;
    min-width: 0;
    padding: 10px;
    border-radius: 8px;
    border: var(--glass-border);
    background: var(--secondary-bg);
    box-shadow: inset var(--shadow-1);
    color: var(--text);
    font-size: 1rem;
    text-align: center;
}

.input-inline-group button {
    flex: 0 0 auto;
    width: auto;
    padding: 10px 15px;
    white-space: nowrap;
}

.unit-label {
    align-self: center;
    font-size: 0.9rem;
    font-weight: bold;
    color: var(--text-muted);
}

.number-stepper {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--secondary-bg);
    border: var(--glass-border);
    box-shadow: inset var(--shadow-1);
    padding: 2px;
    border-radius: 10px;
}

.stepper-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: var(--glass-border);
    background: var(--layer-4);
    color: var(--primary);
    font-size: 1.2rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-1);
}

.stepper-btn:active {
    transform: scale(0.95);
    background: var(--secondary-bg);
}

#on-track-input {
    width: 30px;
    border: none;
    background: transparent;
    text-align: center;
    font-size: 1.1rem;
    font-weight: 700;
    font-family: inherit;
    color: inherit;
    /* Hide spin buttons */
    -webkit-appearance: none;
    -moz-appearance: textfield;
    appearance: none;
}
/* Extra safety to hide the "up/down" arrows in Chrome/Safari */
#on-track-input::-webkit-outer-spin-button,
#on-track-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

@keyframes shake {
    0%,
    100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-4px);
    }
    75% {
        transform: translateX(4px);
    }
}

.limit-shake {
    animation: shake 0.2s ease-in-out 0s 2;
    border: 1px solid rgba(255, 59, 48, 0.3); /* Subtle red tint */
}

/* =================================================
   Pill Toggle
   ================================================= */
/* Container for the switch */
.switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 24px;
    box-sizing: border-box;
}

/* Hide the default checkbox */
.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

/* The track of the switch */
.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    transition: 0.3s;
    border-radius: 999px;
    border: var(--glass-border);
    box-sizing: border-box;
    background-color: var(--secondary-bg);
    box-shadow: inset var(--shadow-2);
}

/* The white circle/knob */
.slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 30px;
    left: 0px;
    bottom: 0px;
    background-color: white;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 999px;
    border: var(--glass-border);
    box-shadow: var(--shadow-1);
}

/* Track color when "on" (checked) */
input:checked + .slider {
    background-color: var(--fitness-green);
}

/* Movement of the knob */
input:checked + .slider:before {
    transform: translateX(16px);
}

/* =================================================
   5. WIDGET CARDS (BENTO BOXES)
   ================================================= */
.widget-card {
    background: var(--layer-1);
    -webkit-backdrop-filter: var(--glass-blur);
    backdrop-filter: var(--glass-blur);
    border: var(--glass-border);
    box-shadow: var(--shadow-1);
    box-sizing: border-box;
    width: 100%;
    padding: 12px;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
}

/* Hide card by default */
.widget-card.collapsed {
    max-height: 0;
    overflow: hidden;
    padding-top: 0;
    padding-bottom: 0;
    margin-bottom: 0;
    opacity: 0;
    transition:
        max-height 0.3s cubic-bezier(0.25, 0.1, 0.25, 1),
        opacity 0.4s ease;
}

/* Expanded state */
.widget-card.expanded {
    max-height: 1000px; /* Large enough to hold content */
    opacity: 1;
    margin-bottom: 15px;
    transition:
        max-height 0.3s cubic-bezier(0.25, 0.1, 0.25, 1),
        opacity 0.4s ease;
    background: var(--layer-2);
    -webkit-backdrop-filter: var(--glass-blur);
    backdrop-filter: var(--glass-blur);
    border: var(--glass-border);
    box-shadow: var(--shadow-2);
}

/* The clickable row */
.accordion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    cursor: pointer;
    -webkit-user-select: none;
    user-select: none;
}

.accordion-header h3 {
    margin: 0;
    font-size: 0.8rem;
    letter-spacing: 1px;
    color: var(--text);
}

/* The arrow icon */
.chevron {
    font-size: 0.8rem;
    transition: transform 0.3s ease;
    opacity: 0.5;
}

/* Rotate arrow when open */
.accordion-item.active .chevron {
    transform: rotate(90deg);
    opacity: 1;
}

/* =================================================
   6. PROGRESS BARS & TRACKS
   ================================================= */
.progress-container {
    height: 16px;
    background: var(--track-bg);
    border-radius: 8px;
    position: relative;
    overflow: hidden;
    margin: 4px 0;
}

.bar-fill {
    height: 100%;
    position: absolute;
    left: 0;
    border-radius: 8px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.bar-fill.green {
    background: linear-gradient(to bottom, var(--fitness-green) 0%, var(--fitness-green-dark) 100%);
}

.bar-fill.blue {
    background: linear-gradient(to bottom, var(--primary) 0%, var(--primary-dark) 100%);
    z-index: 2;
}

/* Segmented Trends */
.segmented-track {
    height: 16px;
    display: flex;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    background: var(--layer-0);
    margin: 8px 0;
}

.segment {
    height: 100%;
}
.segment.red {
    width: 28%;
    background: rgba(231, 76, 60, 0.1);
}
.segment.yellow {
    width: 45%;
    background: rgba(241, 196, 15, 0.1);
}
.segment.green-bg {
    width: 27%;
    background: var(--track-bg);
}

.trend-fill {
    position: absolute;
    height: 100%;
    background: linear-gradient(to bottom, var(--fitness-green) 0%, var(--fitness-green-dark) 100%);
    border-radius: 8px;
    transition: width 0.5s ease;
}

/* =================================================
   CHARTS (WEEKLY & MONTHLY)
   ================================================= */
.bar-unit {
    width: 20px;
    background: linear-gradient(to bottom, var(--fitness-green), var(--fitness-green-dark));
    border-radius: 4px 4px 1px 1px;
    min-height: 2px;
    height: var(--bar-h, 0%);
    transition:
        height 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275),
        opacity 0.5s ease;
}

.bar-unit.legacy {
    width: 25px;
}

/* Axis Labels */
.axis {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    font-size: 0.6rem;
    color: var(--text-muted);
    width: 20px;
}

.day-label,
.month-name-label {
    font-size: 0.65rem;
    color: var(--text-muted);
    font-weight: bold;
    text-align: center;
}
/* The label at the very bottom (Jan, Feb, etc) */
.month-name-label {
    text-transform: uppercase;
}

.trend-label {
    font-weight: 600;
    font-size: 0.9rem;
}

#monthly-chart {
    overflow: visible; /* Prevents numbers from being clipped */
}

/* Container for each individual bar + label */
.monthly-bar-container {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    width: 100%; /* Or a fixed width like 30px depending on layout */
}

.monthly-bar-wrapper {
    height: 100%;
    width: 100%;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
}

/* The tiny value text above the Monthly bar */
.chart-value-label {
    font-size: 0.6rem;
    margin-bottom: 2px;
    line-height: 1;
    color: var(--text);
}

/* =================================================
   8. TAGS & BADGES
   ================================================= */
.streak-tag,
.rest-tag,
.rest-streak-tag {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: bold;
    border: var(--glass-border);
}

.streak-tag {
    background: rgba(255, 159, 10, 0.1);
    color: var(--orange);
    border-color: rgba(255, 159, 10, 0.2);
}

.rest-tag {
    background: rgba(10, 132, 255, 0.1);
    color: var(--primary);
    border-color: rgba(10, 132, 255, 0.2);
}

.rest-streak-tag {
    background: rgba(255, 10, 10, 0.1);
    color: var(--danger);
    border-color: rgba(255, 10, 10, 0.2);
}

/*=============================================*/
.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.dot.green {
    background: var(--fitness-green);
}
.dot.orange {
    background: var(--orange);
}
.dot.red {
    background: var(--danger);
}

/* =================================================
   LEADERBOARD
   ================================================= */
#lb-list {
    /* Create a massive buffer at the bottom of the SCROLLABLE area */
    padding-bottom: 250px !important;
    padding-top: 15px;
}
.lb-row {
    padding: 8px 15px;
    background: var(--layer-1);
    border: var(--glass-border);
    -webkit-backdrop-filter: var(--glass-blur);
    backdrop-filter: var(--glass-blur);
    box-shadow: var(--shadow-1);
    margin-bottom: 8px;
    border-radius: 12px;
}

.lb-row.is-me {
    border: 2px solid var(--primary-light);
}
.lb-rank {
    font-weight: bold;
    width: 30px;
}

.lb-score {
    font-weight: bold;
    color: var(--fitness-green);
}

/* Base container for the floating overlay */
/* The Container: Lift it up! */
.mini-podium {
    position: fixed;
    bottom: 155px; /* 🚀 Lifted high enough to clear the Log Set button */
    bottom: calc(155px + env(safe-area-inset-bottom));
    left: 50%;
    z-index: 10;
    width: 90%;
    max-width: 350px;
    /* 🚀 Initial State: Lowered and invisible */
    transform: translate(-50%, 300px);
    opacity: 0;
    /* 🕒 The Magic: Smooth transition for position and fade */
    transition:
        transform 1s cubic-bezier(0.175, 0.885, 0.32, 1.275),
        opacity 1s ease-out;
    pointer-events: none;
}
/* 🟢 The "Active" State: Slide up and fade in */
.mini-podium.active {
    transform: translate(-50%, 0) !important;
    opacity: 1;
    pointer-events: auto;
}

.podium-frame {
    background: var(--layer-2); /* Dark glass look */
    -webkit-backdrop-filter: var(--glass-blur);
    backdrop-filter: var(--glass-blur);
    border: var(--glass-border);
    border-radius: 16px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: var(--shadow-4);
}

.p-title {
    position: absolute;
    top: 8px;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    text-transform: uppercase;
    white-space: nowrap;
}
/* Individual slot styling */
.podium-slot {
    background: var(--layer-3);
    -webkit-backdrop-filter: var(--glass-blur);
    backdrop-filter: var(--glass-blur);
    border: var(--glass-border);
    padding: 6px 12px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: var(--shadow-4);
    white-space: nowrap;
    position: relative;
}

.rank-1 {
    margin-bottom: 6px;
    margin-top: 25px;
    padding: 8px 15px;
    background: rgba(255, 215, 0, 0.1); /* Subtle gold tint */
    border-radius: 12px;
}

/* Side-by-Side wrapper */
.lower-ranks {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 8px;
    width: 100%;
    margin-top: 5px;
}

.rank-2,
.rank-3 {
    flex: 1; /* Makes them equal width */
    min-width: 0;
    justify-content: center;
    font-size: 0.85rem;
    padding: 6px;
    border-radius: 8px;
}

.p-rank {
    font-weight: 900;
    opacity: 0.6;
    font-size: 0.8rem;
}
.p-name {
    font-weight: 600;
    max-width: 70px; /* Keeps names from pushing the box too wide */
    overflow: hidden;
    text-overflow: ellipsis;
}
.p-score {
    font-weight: 800;
    color: #f39c12; /* Gold color */
    font-size: 0.8rem;
    padding-left: 4px;
    border-left: var(--glass-border);
}
.crown {
    position: absolute;
    top: -18px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.2rem;
}
/* 1st Place - Gold */
.rank-1 .p-score {
    color: var(--podium-gold);
    text-shadow: 0 0 5px rgba(255, 215, 0, 0.3);
}

/* 2nd Place - Silver */
.rank-2 .p-score {
    color: var(--podium-rank-2);
    text-shadow: 0 0 5px rgba(192, 192, 192, 0.3);
}

/* 3rd Place - Bronze */
.rank-3 .p-score {
    color: #cd7f32;
    text-shadow: 0 0 5px rgba(205, 127, 50, 0.3);
}

/* Optional: Make the rank numbers match the metal too */
.rank-2 .p-rank {
    color: var(--podium-rank-2);
    opacity: 0.8;
}
.rank-3 .p-rank {
    color: #cd7f32;
    opacity: 0.8;
}
/* =================================================
   SETTINGS & EDITING
   ================================================= */
.date-picker-trigger {
    background: var(--secondary-bg);
    border: var(--glass-border);
    box-shadow: var(--shadow-1);
    border-radius: 10px;
}

.trigger-text {
    color: var(--primary);
    font-weight: 600;
    font-size: 0.9rem;
    pointer-events: none; /* Makes clicks pass through to input */
    z-index: 1;
}

#edit-date-picker {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0; /* Invisible but clickable */
    cursor: pointer;
    z-index: 2;
    -webkit-appearance: none;
    appearance: none;
}

/* Force the calendar icon to be huge so the whole box is clickable */
#edit-date-picker::-webkit-calendar-picker-indicator {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    cursor: pointer;
}

.edit-item {
    background: var(--layer-1);
    border: var(--glass-border);
    border-radius: 12px;
}

/* =================================================
   MODALS
   ================================================= */
.modal-overlay {
    background: var(--layer-1);
    -webkit-backdrop-filter: var(--glass-blur);
    backdrop-filter: var(--glass-blur);
}

.modal-content {
    background: var(--layer-1);
    padding: 30px;
    border-radius: 28px;
    box-shadow: var(--shadow-4);
    border: var(--glass-border);
    -webkit-backdrop-filter: var(--glass-blur);
    backdrop-filter: var(--glass-blur);
    width: 90%;
    max-width: 320px;
    text-align: center;
}

#modal-input {
    width: 100%;
    background: var(--secondary-bg);
    border: var(--glass-border);
    color: var(--text);
    box-shadow: inset var(--shadow-2);
    font-size: 3rem;
    padding: 10px;
    border-radius: 16px;
    margin: 20px 0;
    text-align: center;
}

#modal-input:focus {
    outline: none;
}

/* =================================================
   Symbols
   ================================================= */
/* The actual spinner */
#pull-to-refresh .spinner {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--fitness-green);
    border-radius: 50%;
    animation: ptr-spin 0.8s linear infinite;
}

@keyframes ptr-spin {
    to {
        transform: rotate(360deg);
    }
}

.icon-svg {
    width: 24px;
    height: 24px;
    fill: none; /* Usually SVGs use stroke for this 'outline' look */
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform 0.2s ease;
}

/* When the tab is active, make the icon pop */
.nav-item.active .icon-svg {
    filter: drop-shadow(0 0 8px var(--accent-color));
    transform: scale(1.1);
}

.loading-state {
    text-align: center;
    margin-top: 40px;
    opacity: 0.5;
    font-family: sans-serif; /* Or your app's main font */
}

.dots-container {
    display: inline-block;
    position: relative;
    /* We add padding to the right so 'Loading' stays centered 
       while the dots have a dedicated 'invisible' box to live in */
    padding-right: 1.2em;
    text-align: left;
}

.dots-container::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: 0;
    /* This ensures the dots align with the baseline of the text */
    width: 1em;
    text-align: left;
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%,
    20% {
        content: "";
    }
    40% {
        content: ".";
    }
    60% {
        content: "..";
    }
    80%,
    100% {
        content: "...";
    }
}
/* =================================================
   BACKGROUND IMAGE (FIXED & NON-INTERACTIVE)
   ================================================= */
#bg-fixed-img {
    /* Locks the div to the viewport */
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-height: 40vh;
    height: 100%;
    z-index: -1; /* Ensures it stays behind your text */
    /* IMPORTANT: Use scroll (default) instead of fixed here */
    background-attachment: scroll;
    /* Optional: Hardware acceleration to keep scrolling smooth on mobile */
    will-change: transform;
}

.bg-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    transition: opacity 0.5s ease-in-out;
    will-change: opacity;
    opacity: 0;
}

.bg-layer.active {
    opacity: 0.3; /* Your desired visibility */
}

/* =================================================
   TOAST NOTIFICATIONS
   ================================================= */
#toast-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9999;
}

.toast {
    background: var(--layer-4);
    -webkit-backdrop-filter: var(--glass-blur);
    backdrop-filter: var(--glass-blur);
    color: var(--text);
    text-align: center;
    padding: 20px;
    border-radius: 8px;
    box-shadow: var(--shadow-4);
    border: var(--glass-border);
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
