/* ── Heart Rate Calculator Overlay ── */

.hr-popup-backdrop {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}
.hr-popup-backdrop.hr-popup-visible {
    opacity: 1;
}
.hr-popup-backdrop.hr-popup-hidden {
    pointer-events: none;
    opacity: 0;
}

/* ── Container ── */
.hr-popup-container {
    position: relative;
    width: 90%;
    max-width: 370px;
    max-height: 96vh;
    overflow-y: auto;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
    padding: 28px 22px 24px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #333;
}

/* ── Back / Close button ── */
.hr-popup-close {
    position: absolute;
    top: 12px;
    left: 12px;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background-color: #ffffff92;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    z-index: 1;
}
.hr-popup-close::before {
    content: '';
    display: block;
    width: 11px;
    height: 11px;
    border-top: 4px solid rgb(254, 153, 0);
    border-left: 4px solid rgb(254, 153, 0);
    transform: rotate(-45deg);
    margin-left: 3px;
}

/* ── Title ── */
.hr-popup-title {
    text-align: center;
    color: #3c6b64;
    font-size: 1.45rem;
    font-weight: 700;
    margin: 0 0 6px;
    font-family: 'Trebuchet MS', 'Lucida Sans Unicode', 'Lucida Grande', 'Lucida Sans', Arial, sans-serif;
}

/* ── Divider ── */
.hr-popup-divider {
    width: 70%;
    height: 3px;
    border: none;
    background-color: #e9a566;
    margin: 0 auto 18px;
}

/* ── Mode toggle ── */
.hr-popup-modes {
    display: flex;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 20px;
    border: 2px solid #65b0a5;
}
.hr-popup-mode-btn {
    flex: 1;
    padding: 10px 6px;
    font-size: 0.88rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    text-align: center;
    transition: background 0.2s, color 0.2s;
    background: #fff;
    color: #3c6b64;
    font-family: inherit;
}
.hr-popup-mode-btn.active {
    background: #65b0a5;
    color: #fff;
}

/* ── Slider groups ── */
.hr-popup-slider-group {
    margin-bottom: 16px;
}
.hr-popup-slider-group.hr-popup-disabled {
    opacity: 0.35;
    pointer-events: none;
}
.hr-popup-slider-label {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 0.95rem;
    font-weight: 600;
    color: #3c6b64;
    margin-bottom: 6px;
}
.hr-popup-slider-value {
    font-weight: 700;
    color: #e9a566;
}
/* ── Slider row with stepper buttons ── */
.hr-popup-slider-row {
    display: flex;
    align-items: center;
    gap: 8px;
}
.hr-popup-step-btn {
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 2px solid #65b0a5;
    background: #fff;
    color: #3c6b64;
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    transition: background 0.15s, color 0.15s;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}
.hr-popup-step-btn:active {
    background: #65b0a5;
    color: #fff;
}

.hr-popup-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    min-width: 0;
    flex: 1;
    height: 8px;
    border-radius: 4px;
    background: #d4ece8;
    outline: none;
}
.hr-popup-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #65b0a5;
    border: 3px solid #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.25);
    cursor: pointer;
}
.hr-popup-slider::-moz-range-thumb {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #65b0a5;
    border: 3px solid #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.25);
    cursor: pointer;
}

/* ── Beta blockers toggle ── */
.hr-popup-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    /* padding: 10px 0; */
    background: #f4faf9;
    border-radius: 10px;
    padding: 16px;
    border: 1px solid #d4ece8;
}
.hr-popup-toggle-label {
    font-size: 0.95rem;
    font-weight: 600;
    color: #3c6b64;
}
.hr-popup-switch {
    position: relative;
    width: 50px;
    height: 28px;
    flex-shrink: 0;
}
.hr-popup-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.hr-popup-switch-slider {
    position: absolute;
    inset: 0;
    background: #ccc;
    border-radius: 28px;
    cursor: pointer;
    transition: background 0.25s;
}
.hr-popup-switch-slider::before {
    content: '';
    position: absolute;
    width: 22px;
    height: 22px;
    left: 3px;
    bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.25s;
}
.hr-popup-switch input:checked + .hr-popup-switch-slider {
    background: #e9a566;
}
.hr-popup-switch input:checked + .hr-popup-switch-slider::before {
    transform: translateX(22px);
}

/* ── Results ── */
.hr-popup-results {
    background: #f4faf9;
    border-radius: 10px;
    padding: 16px;
    border: 1px solid #d4ece8;
}
.hr-popup-hrmax {
    text-align: center;
    font-size: 1.15rem;
    font-weight: 700;
    color: #3c6b64;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e9a566;
}
.hr-popup-hrmax span {
    color: #e9a566;
}
.hr-popup-zones-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: #65b0a5;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    text-align: center;
}
#hrp-zones {
    display: flex;
    justify-content: space-between;
    gap: 4px;
}
.hr-popup-zone-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    gap: 6px;
    padding: 12px 4px;
    background: #ffffff;
    border-radius: 8px;
    border: 2px solid #d4ece8;
    min-width: 0;
}
.hr-popup-zone-pct {
    font-size: 0.95rem;
    font-weight: 700;
    color: #65b0a5;
    white-space: nowrap;
}
.hr-popup-zone-bpm {
    font-size: clamp(1.0rem, 4vw, 1.8rem);
    font-weight: 700;
    color: #3c6b64;
    line-height: 1;
}