:root {
    --color-brand--1: #ffb545;
    --color-brand--2: #00c46a;

    --color-dark--1: #2d3439;
    --color-dark--2: #42484d;
    --color-light--1: #aaa;
    --color-light--2: #ececec;
    --color-light--3: rgb(214, 222, 224);
}

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

html {
    font-size: 62.5%;
    box-sizing: border-box;
    background: var(--color-dark--1);
    height: 100%;
}

body {
    font-family: 'Manrope', sans-serif;
    color: var(--color-light--2);
    font-weight: 400;
    line-height: 1.6;
    height: 100vh;
    overscroll-behavior-y: none;

    background-color: var(--app-text-primary);
    padding: 2.5rem;

    display: flex;
}

a:link,
a:visited {
    color: var(--color-brand--1);
}

/* SIDEBAR */
.sidebar {
    flex-basis: 50rem;
    min-width: 0;
    background-color: var(--color-dark--1);
    padding: 3rem 2.5rem 4rem 2.5rem;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
}

.logo {
    height: 5.2rem;
    align-self: center;
    margin-bottom: 4rem;
}

.workouts {
    list-style: none;
    height: 77vh;
    overflow-y: scroll;
    overflow-x: hidden;
}

.workouts::-webkit-scrollbar {
    width: 0;
}

.workout {
    background-color: var(--color-dark--2);
    border-radius: 5px;
    padding: 1.5rem 2.25rem;
    margin-bottom: 1.75rem;
    cursor: pointer;

    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 0.75rem 1.5rem;
}
.workout--running {
    border-left: 5px solid var(--color-brand--2);
}
.workout--cycling {
    border-left: 5px solid var(--color-brand--1);
}

.workout__title {
    font-size: 1.7rem;
    font-weight: 600;
    grid-column: 1 / -1;
}

.workout__details {
    display: flex;
    align-items: baseline;
}

.workout__icon {
    font-size: 1.8rem;
    margin-right: 0.2rem;
    height: 0.28rem;
}

.workout__value {
    font-size: 1.5rem;
    margin-right: 0.5rem;
}

.workout__unit {
    font-size: 1.1rem;
    color: var(--color-light--1);
    text-transform: uppercase;
    font-weight: 800;
}

.form {
    background-color: var(--color-dark--2);
    border-radius: 5px;
    padding: 1.5rem 2.75rem;
    margin-bottom: 1.75rem;

    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem 2.5rem;

    height: 9.25rem;
    transition: all 0.5s, transform 1ms;
}

.form.hidden {
    transform: translateY(-30rem);
    height: 0;
    padding: 0 2.25rem;
    margin-bottom: 0;
    opacity: 0;
}

.form__row {
    display: flex;
    align-items: center;
}

.form__row--hidden {
    display: none;
}

.form__label {
    flex: 0 0 50%;
    font-size: 1.5rem;
    font-weight: 600;
}

.form__input {
    width: 100%;
    padding: 0.3rem 1.1rem;
    font-family: inherit;
    font-size: 1.4rem;
    border: none;
    border-radius: 3px;
    background-color: var(--color-light--3);
    transition: all 0.2s;
}

.form__input:focus {
    outline: none;
    background-color: var(--app-text-primary);
}

.form__btn {
    display: none;
}

.copyright {
    margin-top: auto;
    font-size: 1.3rem;
    text-align: center;
    color: var(--color-light--1);
}

.twitter-link:link,
.twitter-link:visited {
    color: var(--color-light--1);
    transition: all 0.2s;
}

.twitter-link:hover,
.twitter-link:active {
    color: var(--color-light--2);
}

/* MAP */
#map {
    flex: 1;
    height: 100%;
    background-color: var(--color-light--1);
}

.leaflet-popup .leaflet-popup-content-wrapper {
    background-color: var(--color-dark--1);
    color: var(--color-light--2);
    border-radius: 5px;
    padding-right: 0.6rem;
}

.leaflet-popup .leaflet-popup-content {
    font-size: 1.5rem;
}

.leaflet-popup .leaflet-popup-tip {
    background-color: var(--color-dark--1);
}

.running-popup .leaflet-popup-content-wrapper {
    border-left: 5px solid var(--color-brand--2);
}
.cycling-popup .leaflet-popup-content-wrapper {
    border-left: 5px solid var(--color-brand--1);
}
.walking-popup .leaflet-popup-content-wrapper {
    border-left: 5px solid #5badea;
}

/* ─── POI SEARCH ─── */
.poi-search {
    margin-bottom: 1.2rem;
}

.poi-search__bar {
    display: flex;
    gap: 0.6rem;
    margin-bottom: 0.8rem;
}

.poi-search__input {
    flex: 1;
    padding: 1.05rem 1.4rem;
    font-family: inherit;
    font-size: 1.4rem;
    border: none;
    border-radius: 14px;
    background-color: var(--color-light--3);
    color: var(--color-dark--1);
    transition: all 0.2s;
}

.poi-search__input:focus {
    outline: none;
    background-color: var(--app-text-primary);
    box-shadow: 0 0 0 2px var(--color-brand--2);
}

.poi-search__btn {
    padding: 0.9rem 1.2rem;
    background-color: var(--color-brand--2);
    border: none;
    border-radius: 14px;
    font-size: 1.4rem;
    cursor: pointer;
    transition: background-color 0.2s;
    line-height: 1;
    align-self: stretch;
}

.poi-search__btn:hover {
    background-color: #00a85a;
}

.poi-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.poi-filter-btn {
    padding: 0.5rem 1rem;
    background-color: var(--color-dark--1);
    border: 2px solid transparent;
    border-radius: 99px;
    color: var(--color-light--1);
    font-family: inherit;
    font-size: 1.25rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.poi-filter-btn:hover {
    border-color: var(--color-brand--2);
    color: var(--color-light--2);
}

.poi-filter-btn--active {
    border-color: var(--color-brand--2);
    background-color: rgba(0,196,106,0.12);
    color: var(--color-brand--2);
}

.poi-results {
    list-style: none;
    max-height: 22rem;
    overflow-y: auto;
    overflow-x: hidden;
    margin-top: 0.8rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.poi-results::-webkit-scrollbar { width: 0; }

.poi-result-item {
    background-color: var(--color-dark--2);
    border-radius: 5px;
    padding: 1rem 1.4rem;
    cursor: pointer;
    border-left: 3px solid transparent;
    transition: border-color 0.2s, background-color 0.2s;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.poi-result-item:hover {
    border-left-color: var(--color-brand--2);
    background-color: rgba(0,196,106,0.08);
}

.poi-result-item__name {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--color-light--2);
}

.poi-result-item__addr {
    font-size: 1.2rem;
    color: var(--color-light--1);
}

.poi-result-item__dist {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--color-brand--2);
}

.poi-empty {
    text-align: center;
    font-size: 1.3rem;
    color: var(--color-light--1);
    padding: 1.5rem 0;
}

.poi-loading {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 0;
    font-size: 1.3rem;
    color: var(--color-light--1);
}

/* ─── TRACKING CONTROLS ─── */
.tracking-controls {
    margin-bottom: 1.2rem;
}

.btn-track {
    width: 100%;
    padding: 1.1rem 1.5rem;
    background-color: var(--color-dark--2);
    color: var(--color-light--2);
    border: 2px solid transparent;
    border-radius: 5px;
    font-family: inherit;
    font-size: 1.4rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing: 0.3px;
    text-align: left;
}

.btn-track:hover {
    border-color: var(--color-brand--2);
}

.btn-track.tracking--active {
    border-color: var(--color-brand--2);
    background-color: rgba(0, 196, 106, 0.12);
    color: var(--color-brand--2);
}

/* ─── WAKE LOCK BADGE ─── */
.wake-lock-badge {
    display: inline-block;
    font-size: 1rem;
    padding: 0.2rem 0.5rem;
    border-radius: 3px;
    background-color: rgba(0, 196, 106, 0.2);
    color: var(--color-brand--2);
    margin-left: 0.6rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    vertical-align: middle;
}

/* ─── PULSING DOT (live tracking marker) ─── */
.tracking-dot {
    position: relative;
    width: 18px;
    height: 18px;
}

.tracking-dot__core {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background-color: #00c46a;
    border: 3px solid white;
    box-shadow: 0 0 0 2px rgba(0,196,106,0.4);
    z-index: 2;
}

.tracking-dot__pulse {
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    background-color: #00c46a;
    opacity: 0.35;
    animation: trackingPulse 2s ease-out infinite;
    z-index: 1;
}

@keyframes trackingPulse {
    0%   { transform: scale(1);   opacity: 0.35; }
    70%  { transform: scale(2.8); opacity: 0; }
    100% { transform: scale(2.8); opacity: 0; }
}

/* ─── ROUTE CONTROLS ─── */
.route-controls {
    margin-bottom: 1.5rem;
}

.btn-route {
    width: 100%;
    padding: 1.1rem 1.5rem;
    background-color: var(--color-brand--2);
    color: var(--app-text-primary);
    border: none;
    border-radius: 5px;
    font-family: inherit;
    font-size: 1.4rem;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    letter-spacing: 0.3px;
}

.btn-route:hover {
    background-color: #00a85a;
}

.btn-route:active {
    transform: scale(0.98);
}

.btn-route.hidden {
    display: none;
}

.route-info {
    background-color: var(--color-dark--2);
    border-radius: 5px;
    padding: 1.4rem 1.8rem;
}

.route-info__steps {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    margin-bottom: 1.2rem;
}

.route-info__step {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 1.3rem;
    color: var(--color-light--1);
    transition: color 0.3s;
}

.route-info__step--done {
    color: var(--color-light--2);
}

.route-info__badge {
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: 800;
    flex-shrink: 0;
}

.route-info__badge--a {
    background-color: var(--color-brand--2);
    color: var(--app-text-primary);
}

.route-info__badge--b {
    background-color: var(--color-brand--1);
    color: var(--app-text-primary);
}

.route-result {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.8rem;
    margin-bottom: 1.2rem;
    padding-top: 1.2rem;
    border-top: 1px solid #555;
}

.route-result__item {
    background-color: var(--color-dark--1);
    border-radius: 5px;
    padding: 1rem;
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
}

.route-result__icon {
    font-size: 1.6rem;
}

.route-result__value {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--color-light--2);
}

.route-result__unit {
    font-size: 1.1rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--color-light--1);
}

.btn-route-cancel {
    width: 100%;
    padding: 0.8rem;
    background: transparent;
    border: 1px solid #666;
    border-radius: 5px;
    color: var(--color-light--1);
    font-family: inherit;
    font-size: 1.3rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-route-cancel:hover {
    border-color: #ff6b6b;
    color: #ff6b6b;
}

.route-marker {
    width: 2.8rem;
    height: 2.8rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--app-text-primary);
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.route-marker--a {
    background-color: var(--color-brand--2);
}

.route-marker--b {
    background-color: var(--color-brand--1);
}

.leaflet-routing-container {
    display: none !important;
}

.hidden {
    display: none !important;
}

/* ─── ACTIVITY MODE SELECTOR ─── */
.route-mode-selector {
    display: flex;
    gap: 0.6rem;
    margin-bottom: 1.2rem;
}

.route-mode-btn {
    flex: 1;
    padding: 0.8rem;
    background-color: var(--color-dark--1);
    border: 2px solid transparent;
    border-radius: 5px;
    font-size: 1.8rem;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    line-height: 1;
}

.route-mode-btn:hover {
    border-color: var(--color-light--1);
}

.route-mode-btn--active {
    border-color: var(--color-brand--2);
    background-color: rgba(0, 196, 106, 0.12);
}

/* ─── ROUTE LOADING ANIMATION ─── */
.route-loading {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.2rem 0;
    margin-bottom: 0.8rem;
}

.route-loading__spinner {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.route-loading__dot {
    width: 0.8rem;
    height: 0.8rem;
    border-radius: 50%;
    background-color: var(--color-brand--2);
    animation: routeDotBounce 1.2s ease-in-out infinite;
}

.route-loading__dot:nth-child(2) {
    animation-delay: 0.2s;
    background-color: color-mix(in srgb, var(--color-brand--2) 70%, var(--color-brand--1));
}

.route-loading__dot:nth-child(3) {
    animation-delay: 0.4s;
    background-color: var(--color-brand--1);
}

@keyframes routeDotBounce {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.5;
    }
    30% {
        transform: translateY(-0.8rem);
        opacity: 1;
    }
}

.route-loading__text {
    font-size: 1.3rem;
    color: var(--color-light--1);
    animation: routeTextPulse 1.5s ease-in-out infinite;
}

@keyframes routeTextPulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* ════════════════════════════════════════
   MOBILE RESPONSIVE
   ════════════════════════════════════════ */
@media (max-width: 768px) {

    body {
        flex-direction: column;
        padding: 0;
        height: 100dvh;
        overflow: hidden;
    }

    #map {
        position: fixed;
        inset: 0;
        width: 100%;
        height: 100%;
        z-index: 1;
    }

    .sidebar {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 100;
        flex-basis: auto;
        width: 100%;
        height: 55vh;
        max-height: 100dvh;
        padding: 0 2rem 2rem 2rem;
        border-radius: 2rem 2rem 0 0;
        box-shadow: 0 -4px 24px rgba(0,0,0,0.35);
        overflow: hidden;
        transition: height 0.32s cubic-bezier(0.4, 0, 0.2, 1);
    }

    /* When user is done dragging and can scroll */
    .sidebar.is-scrollable {
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
    }

    .sidebar::before {
        content: '';
        display: block;
        width: 4rem;
        height: 0.45rem;
        background-color: var(--app-text-muted);
        border-radius: 99px;
        margin: 1.2rem auto 1.6rem auto;
        cursor: grab;
        flex-shrink: 0;
    }

    .logo {
        height: 3.6rem;
        margin-bottom: 1.6rem;
    }

    .workouts {
        height: auto;
        max-height: 40dvh;
        overflow-y: auto;
        overflow-x: hidden;
    }

    .form {
        padding: 1.2rem 1.6rem;
        gap: 0.4rem 1.5rem;
        height: auto;
        min-height: 9rem;
    }

    .form__label {
        font-size: 1.4rem;
    }

    .form__input {
        font-size: 1.3rem;
        padding: 0.5rem 0.9rem;
    }

    .workout {
        grid-template-columns: 1fr 1fr;
        padding: 1.2rem 1.6rem;
        gap: 0.6rem 1rem;
    }

    .workout__title {
        font-size: 1.5rem;
    }

    .workout__value {
        font-size: 1.4rem;
    }

    .btn-route {
        padding: 1.3rem 1.5rem;
        font-size: 1.5rem;
    }

    .route-info {
        padding: 1.2rem 1.4rem;
    }

    .route-mode-btn {
        padding: 1rem;
        font-size: 2rem;
    }

    .route-info__step {
        font-size: 1.4rem;
    }

    .route-result__value {
        font-size: 2rem;
    }

    .btn-route-cancel {
        padding: 1.1rem;
        font-size: 1.4rem;
    }

    .copyright {
        display: none;
    }

    .poi-results {
        max-height: 16rem;
    }

    .poi-filter-btn {
        font-size: 1.2rem;
        padding: 0.5rem 0.9rem;
    }

    .leaflet-control-zoom {
        margin-bottom: 15rem !important;
    }

    .leaflet-popup .leaflet-popup-content {
        font-size: 1.4rem;
    }
}

@media (max-width: 380px) {
    .sidebar {
        padding: 0 1.4rem 1.4rem 1.4rem;
    }

    .workout {
        grid-template-columns: 1fr 1fr;
        padding: 1rem 1.2rem;
    }

    .btn-route {
        font-size: 1.4rem;
    }
}

/* ─── WORKOUT DELETE BUTTON ─── */
.workout {
    position: relative;
}

.workout__delete {
    position: absolute;
    top: 0.8rem;
    right: 0.8rem;
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--color-light--1);
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s, background-color 0.2s, color 0.2s;
    line-height: 1;
}

.workout:hover .workout__delete {
    opacity: 1;
}

.workout__delete:hover {
    background-color: #ff6b6b22;
    color: #ff6b6b;
}

@media (max-width: 768px) {
    .workout__delete {
        opacity: 1;
        color: var(--color-light--1);
    }
}

/* ─── MOBILE SUBMIT BUTTON ─── */
@media (max-width: 768px) {
    .form__btn {
        display: block;
        grid-column: 1 / -1;
        width: 100%;
        padding: 1.1rem;
        margin-top: 0.4rem;
        background-color: var(--color-brand--2);
        color: var(--app-text-primary);
        border: none;
        border-radius: 5px;
        font-family: inherit;
        font-size: 1.5rem;
        font-weight: 700;
        cursor: pointer;
        transition: background-color 0.2s;
    }

    .form__btn:hover {
        background-color: #00a85a;
    }

    .form {
        height: auto;
    }
}

/* ─── POI FILTERS — single scrollable row ─── */
.poi-filters {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.6rem;
    padding: 0.4rem 0 0.8rem;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    cursor: grab;
    white-space: nowrap;
}
.poi-filters:active { cursor: grabbing; }
.poi-filters::-webkit-scrollbar { display: none; }

/* ─── SETTINGS PANEL ─── */
.settings-panel {
    background-color: var(--color-dark--2);
    border-radius: 5px;
    margin-bottom: 1.2rem;
    overflow: visible;
}
.settings-panel.hidden { display: none !important; }
.settings-panel__header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.4rem;
    border: 1px solid var(--app-border);
}
.settings-panel__title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--color-light--2);
    flex: 1;
}
.btn-settings-back {
    background: transparent;
    border: none;
    color: var(--color-light--1);
    font-size: 1.6rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}
.settings-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.4rem;
    border: 1px solid var(--app-border);
    cursor: pointer;
    transition: background-color 0.15s;
}
.settings-item:last-child { border-bottom: none; }
.settings-item:hover { background-color: rgba(255,255,255,0.04); }
.settings-item__icon { font-size: 1.6rem; width: 2.4rem; text-align: center; flex-shrink: 0; }
.settings-item__text { flex: 1; }
.settings-item__label { font-size: 1.3rem; font-weight: 700; color: var(--color-light--2); }
.settings-item__sub { font-size: 1.1rem; color: var(--color-light--1); }
.settings-item__arrow { font-size: 1.4rem; color: var(--color-light--1); opacity: 0.4; }

/* Night mode toggle switch */
.night-toggle {
    width: 3.6rem;
    height: 2rem;
    border-radius: 2rem;
    background: #555;
    position: relative;
    flex-shrink: 0;
    transition: background 0.25s;
    cursor: pointer;
}
.night-toggle.active { background: var(--color-brand--2); }
.night-toggle__knob {
    position: absolute;
    width: 1.4rem;
    height: 1.4rem;
    border-radius: 50%;
    background: #fff;
    top: 0.3rem;
    left: 0.3rem;
    transition: left 0.25s;
    pointer-events: none;
}
.night-toggle.active .night-toggle__knob { left: 1.9rem; }

/* Voice toggle switch — same as night but reused */
.voice-toggle {
    width: 3.6rem;
    height: 2rem;
    border-radius: 2rem;
    background: #555;
    position: relative;
    flex-shrink: 0;
    transition: background 0.25s;
    cursor: pointer;
}
.voice-toggle.active { background: var(--color-brand--2); }
.voice-toggle__knob {
    position: absolute;
    width: 1.4rem;
    height: 1.4rem;
    border-radius: 50%;
    background: #fff;
    top: 0.3rem;
    left: 0.3rem;
    transition: left 0.25s;
    pointer-events: none;
}
.voice-toggle.active .voice-toggle__knob { left: 1.9rem; }

/* Gear button next to search */
.btn-settings-gear {
    background: var(--color-dark--2);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 14px;
    color: var(--color-light--1);
    font-size: 1.4rem;
    padding: 0.9rem 1.0rem;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
    flex-shrink: 0;
    align-self: stretch;
}
.btn-settings-gear:hover { color: var(--color-light--2); }

/* ─── NIGHT MODE overrides ─── */
body.night-mode { background-color: #0f1923; }
body.night-mode .sidebar { background-color: #0f1923; }
body.night-mode .workout,
body.night-mode .form,
body.night-mode .route-info,
body.night-mode .settings-panel {
    background-color: #1a2a3a;
    border: 1px solid #2a3d5e;
}
body.night-mode .poi-search__input {
    background-color: #1a2a3a;
    border: 1px solid #2a3d5e;
    color: #b8c8d8;
}
body.night-mode .poi-filter-btn {
    background-color: #1a2a3a;
    border: 1px solid #2a3d5e;
    color: #6a8aaa;
}
body.night-mode .poi-filter-btn.poi-filter-btn--active {
    border-color: var(--color-brand--2);
    color: var(--color-brand--2);
    background-color: rgba(0,196,106,0.08);
}
body.night-mode .btn-settings-gear { background: #1a2a3a; border-color: #2a3d5e; }
body.night-mode .btn-track { background-color: #1a2a3a; border-color: #2a3d5e; color: #b8c8d8; }
body.night-mode .btn-route { background-color: #006e3a; border: 1px solid var(--color-brand--2); color: var(--color-brand--2); }
body.night-mode .form__input { background-color: #1a2a3a; color: #b8c8d8; }
body.night-mode .settings-item { border-bottom-color: rgba(100,160,220,0.08); }
body.night-mode .poi-result-item { background-color: #1a2a3a; border-color: #2a3d5e; }
body.night-mode .route-result__item { background-color: #0f1923; }
body.night-mode .route-mode-btn { background-color: #1a2a3a; }

/* ─── ARRIVAL TOAST ─── */
.arrival-toast {
    position: fixed;
    bottom: 3rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    background-color: var(--color-dark--1);
    border-left: 4px solid var(--color-brand--2);
    border-radius: 8px;
    padding: 1.4rem 1.8rem;
    display: flex;
    align-items: center;
    gap: 1.2rem;
    box-shadow: 0 4px 24px rgba(0,0,0,0.5);
    animation: toastSlideUp 0.3s ease;
    min-width: 26rem;
    max-width: 90vw;
}
@keyframes toastSlideUp {
    from { transform: translateX(-50%) translateY(2rem); opacity: 0; }
    to   { transform: translateX(-50%) translateY(0);    opacity: 1; }
}
.arrival-toast__icon { font-size: 2.4rem; flex-shrink: 0; }
.arrival-toast strong { display: block; font-size: 1.5rem; color: var(--color-light--2); font-weight: 800; }
.arrival-toast p { font-size: 1.2rem; color: var(--color-light--1); margin: 0; }
.arrival-toast__close { margin-left: auto; background: transparent; border: none; color: var(--color-light--1); font-size: 1.4rem; cursor: pointer; padding: 0.4rem; flex-shrink: 0; }
.arrival-toast__close:hover { color: var(--color-light--2); }

/* ─── WAKE LOCK BADGE ─── */
.wake-lock-badge {
    display: inline-block;
    font-size: 1rem;
    padding: 0.2rem 0.5rem;
    border-radius: 3px;
    background-color: rgba(0, 196, 106, 0.2);
    color: var(--color-brand--2);
    margin-left: 0.6rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    vertical-align: middle;
}

/* ─── STREAK BAR ─── */
.streak-bar {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    background: var(--color-dark--2);
    border-radius: 8px;
    padding: 0.9rem 1.4rem;
    margin-bottom: 1.2rem;
}
.streak-bar__flame {
    font-size: 2rem;
    line-height: 1;
    flex-shrink: 0;
}
.streak-bar__text {
    flex: 1;
}
.streak-bar__count {
    font-size: 1.6rem;
    font-weight: 800;
    color: #ffb545;
    line-height: 1.2;
}
.streak-bar__label {
    font-size: 1.1rem;
    color: var(--color-light--1);
}
.streak-bar__days {
    display: flex;
    gap: 0.4rem;
}
.streak-bar__dot {
    width: 0.9rem;
    height: 0.9rem;
    border-radius: 50%;
    background: var(--app-surface-2);
    transition: background 0.2s;
}
.streak-bar__dot.active {
    background: #ffb545;
}

/* ─── STATS PANEL ─── */
.stats-panel { background-color: var(--color-dark--2); border: 1.5px solid var(--color-brand--2); border-radius: 8px; padding: 1.4rem 1.6rem; margin-bottom: 1.2rem; cursor: pointer; transition: border-color 0.2s; }
.stats-panel:hover { border-color: #00a85a; }
.stats-panel__label { font-size: 1rem; font-weight: 800; color: var(--color-light--1); letter-spacing: 0.1em; text-align: center; margin-bottom: 1.2rem; }
.stats-panel__rings { display: flex; gap: 0.8rem; margin-bottom: 1.2rem; justify-content: space-between; align-items: center; }
.stats-ring-wrap { flex: 1; display: flex; flex-direction: column; align-items: center; }
.stats-ring-wrap svg { width: 100%; max-width: 9rem; height: auto; }
.stats-ring-arc { transition: stroke-dashoffset 0.9s cubic-bezier(0.4,0,0.2,1); }
.stats-panel__goal { border: 1px solid var(--app-border); padding-top: 1rem; }
.stats-panel__goal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.5rem; }
.stats-panel__goal-label { font-size: 1rem; font-weight: 800; color: var(--color-light--1); letter-spacing: 0.1em; }
.stats-panel__goal-pct { font-size: 1.3rem; font-weight: 800; color: var(--color-light--2); }
.stats-panel__goal-bar { height: 0.6rem; background: var(--app-surface-2); border-radius: 0.3rem; overflow: hidden; }
.stats-panel__goal-fill { height: 100%; background: var(--color-brand--2); border-radius: 0.3rem; transition: width 0.8s cubic-bezier(0.4,0,0.2,1); }
@keyframes goalBounce { 0%{transform:scale(1)} 30%{transform:scale(1.05)} 60%{transform:scale(0.98)} 100%{transform:scale(1)} }
.stats-panel.goal-reached { border-color: #ffb545; animation: goalBounce 0.7s ease; }
.stats-goal-toast { position: fixed; top: 50%; left: 50%; transform: translate(-50%,-50%) scale(0.8); z-index: 10001; background: var(--color-dark--1); border: 2px solid #ffb545; border-radius: 16px; padding: 2.4rem 3rem; text-align: center; max-width: 30rem; width: 90vw; animation: goalToastPop 0.4s cubic-bezier(0.34,1.56,0.64,1) forwards; pointer-events: none; }
@keyframes goalToastPop { from{transform:translate(-50%,-50%) scale(0.6);opacity:0} to{transform:translate(-50%,-50%) scale(1);opacity:1} }
.stats-goal-toast__emoji { font-size: 4rem; display: block; margin-bottom: 0.8rem; }
.stats-goal-toast__title { font-size: 2rem; font-weight: 800; color: #ffb545; display: block; margin-bottom: 0.4rem; }
.stats-goal-toast__sub { font-size: 1.3rem; color: var(--color-light--1); }
.stats-detail { background-color: var(--color-dark--2); border-radius: 8px; padding: 1.4rem 1.6rem; margin-bottom: 1.2rem; }
.stats-detail.hidden { display: none !important; }
.stats-detail__header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.2rem; }
.stats-detail__title { font-size: 1.3rem; font-weight: 800; color: var(--color-light--2); }
.stats-week-nav { display: flex; align-items: center; gap: 0.6rem; }
.stats-week-nav__btn { background: var(--color-dark--1); border: 1px solid rgba(255,255,255,0.12); border-radius: 4px; color: var(--color-light--1); font-size: 1.4rem; width: 2.6rem; height: 2.6rem; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.stats-week-nav__btn:hover { color: var(--color-light--2); }
.stats-week-nav__btn:disabled { opacity: 0.3; cursor: default; }
.stats-week-nav__label { font-size: 1rem; color: var(--color-light--1); font-weight: 700; min-width: 5rem; text-align: center; }
.stats-detail__bars { display: flex; align-items: flex-end; gap: 0.5rem; height: 5.6rem; margin-bottom: 0.6rem; }
.stats-detail__day-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 0.2rem; height: 100%; justify-content: flex-end; cursor: pointer; border-radius: 4px; padding: 2px; transition: background 0.15s; }
.stats-detail__day-col:hover { background: var(--app-surface-1); }
.stats-detail__day-col.active { background: rgba(255,255,255,0.09); }
.stats-detail__bar { width: 100%; border-radius: 0.3rem 0.3rem 0 0; transition: height 0.4s ease; }
.stats-detail__day-name { font-size: 0.95rem; color: var(--color-light--1); font-weight: 700; }
.stats-detail__day-date { font-size: 0.8rem; color: var(--color-light--1); opacity: 0.55; }
.stats-detail__day-col.active .stats-detail__day-name { color: var(--color-brand--2); }
.stats-detail__totals { display: flex; justify-content: space-between; padding-top: 1rem; border: 1px solid var(--app-border); margin-top: 0.4rem; }
.stats-detail__total-item { text-align: center; }
.stats-detail__total-val { font-size: 1.5rem; font-weight: 800; color: var(--color-brand--2); display: block; }
.stats-detail__total-val--amber { color: var(--color-brand--1); }
.stats-detail__total-val--gray  { color: var(--color-light--2); }
.stats-detail__total-val--blue  { color: #5badea; }
.stats-detail__total-label { font-size: 0.95rem; color: var(--color-light--1); }
.stats-goal-editor { background-color: var(--color-dark--2); border-radius: 8px; padding: 1.4rem 1.6rem; margin-bottom: 1.2rem; }
.stats-goal-editor.hidden { display: none !important; }
.stats-goal-editor__title { font-size: 1.1rem; font-weight: 800; color: var(--color-light--1); letter-spacing: 0.08em; margin-bottom: 1rem; }
.stats-goal-editor__row { display: flex; align-items: center; gap: 1rem; margin-bottom: 0.8rem; }
.stats-goal-editor__row:last-child { margin-bottom: 0; }
.stats-goal-editor__label { font-size: 1.2rem; color: var(--color-light--2); flex: 1; }
.stats-goal-editor__input { width: 6rem; background: var(--color-dark--1); border: 1px solid var(--color-light--1); border-radius: 4px; color: var(--color-light--2); font-family: inherit; font-size: 1.3rem; font-weight: 800; text-align: center; padding: 0.4rem 0.6rem; }
.stats-goal-editor__input:focus { outline: none; border-color: var(--color-brand--2); }
.stats-goal-editor__unit { font-size: 1.1rem; color: var(--color-light--1); min-width: 3rem; }

/* ─── POI FILTERS ─── */
.poi-filters { display: flex; flex-wrap: nowrap; gap: 0.6rem; padding: 0.4rem 0 0.8rem; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; -webkit-overflow-scrolling: touch; cursor: grab; white-space: nowrap; }
.poi-filters:active { cursor: grabbing; }
.poi-filters::-webkit-scrollbar { display: none; }

/* ─── iOS INSTALL BANNER ─── */
.ios-install-banner { position: fixed; bottom: 0; left: 0; right: 0; z-index: 9998; background: #1c2128; border-top: 1px solid rgba(255,255,255,0.14); padding: 1.4rem 1.6rem 2.8rem; display: flex; align-items: center; gap: 1.2rem; animation: iosBannerUp 0.35s ease; }
.ios-install-banner.hidden { display: none !important; }
@keyframes iosBannerUp { from{transform:translateY(100%)} to{transform:translateY(0)} }
.ios-install-banner__icon { width: 5rem; height: 5rem; border-radius: 14px; background: #1a3828; border: 1.5px solid var(--color-brand--2); display: flex; align-items: center; justify-content: center; flex-shrink: 0; overflow: hidden; }
.ios-install-banner__icon img { width: 100%; height: 100%; object-fit: cover; border-radius: 12px; }
.ios-install-banner__text { flex: 1; }
.ios-install-banner__title { font-size: 1.25rem; font-weight: 800; color: var(--color-light--2); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 0.3rem; }
.ios-install-banner__sub { font-size: 1.2rem; color: var(--color-light--1); line-height: 1.5; }
.ios-install-banner__close { background: var(--app-surface-2); border: none; border-radius: 50%; color: var(--color-light--1); font-size: 1.3rem; cursor: pointer; width: 2.8rem; height: 2.8rem; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }

/* ─── ARRIVAL TOAST ─── */
.arrival-toast { position: fixed; bottom: 3rem; left: 50%; transform: translateX(-50%); z-index: 9999; background-color: var(--color-dark--1); border-left: 4px solid var(--color-brand--2); border-radius: 8px; padding: 1.4rem 1.8rem; display: flex; align-items: center; gap: 1.2rem; box-shadow: 0 4px 24px rgba(0,0,0,0.5); animation: toastSlideUp 0.3s ease; min-width: 26rem; max-width: 90vw; }
@keyframes toastSlideUp { from{transform:translateX(-50%) translateY(2rem);opacity:0} to{transform:translateX(-50%) translateY(0);opacity:1} }
.arrival-toast__icon { font-size: 2.4rem; flex-shrink: 0; }
.arrival-toast strong { display: block; font-size: 1.5rem; color: var(--color-light--2); font-weight: 800; }
.arrival-toast p { font-size: 1.2rem; color: var(--color-light--1); margin: 0; }
.arrival-toast__close { margin-left: auto; background: transparent; border: none; color: var(--color-light--1); font-size: 1.4rem; cursor: pointer; padding: 0.4rem; flex-shrink: 0; }

/* ─── WAKE LOCK BADGE ─── */
.wake-lock-badge { display: inline-block; font-size: 1rem; padding: 0.2rem 0.5rem; border-radius: 3px; background-color: rgba(0,196,106,0.2); color: var(--color-brand--2); margin-left: 0.6rem; font-weight: 800; letter-spacing: 0.05em; vertical-align: middle; }

/* ─── ACTIVE WORKOUT HIGHLIGHT ─── */
.workout--active {
    border-left: 3px solid var(--color-brand--2);
    background-color: rgba(0, 196, 106, 0.06);
}
/* Walking active — blue border + blue tint */
.workout--walking.workout--active {
    border-left: 3px solid #5badea;
    background-color: rgba(91, 173, 234, 0.06);
}

/* ─── WORKOUT CLUSTER MARKER ─── */
.workout-cluster {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--color-dark--1);
    border: 3px solid var(--color-brand--2);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}
.workout-cluster span {
    color: var(--color-light--2);
    font-size: 1.3rem;
    font-weight: 800;
    font-family: 'Manrope', sans-serif;
}

/* ─── CUSTOM FILTER ADD BUTTON ─── */
.poi-filter-btn--add {
    background-color: var(--color-dark--2);
    border-color: var(--color-brand--2);
    color: var(--color-brand--2);
    font-size: 1.6rem;
    font-weight: 800;
    padding: 0.4rem 1rem;
    line-height: 1;
}
.poi-filter-btn--add:hover {
    background-color: rgba(0,196,106,0.15);
}
.poi-filter-btn--custom {
    position: relative;
}
.poi-filter-btn--custom::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 99px;
}

/* ─── CUSTOM FILTER MODAL ─── */
.custom-filter-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}
.custom-filter-modal__box {
    background: var(--color-dark--1);
    border-radius: 16px;
    padding: 2.4rem 2.4rem 2rem;
    width: 100%;
    max-width: 36rem;
    box-shadow: 0 8px 40px rgba(0,0,0,0.6);
}
.custom-filter-modal__title {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--color-light--2);
    margin-bottom: 1.6rem;
    text-align: center;
}
.custom-filter-modal__coord {
    font-size: 1.2rem;
    color: var(--color-brand--2);
    background: rgba(0,196,106,0.1);
    border-radius: 8px;
    padding: 0.8rem 1rem;
    margin-bottom: 1.6rem;
    text-align: center;
}
.custom-filter-modal__coord.no-coord {
    color: #ffb545;
    background: rgba(255,181,69,0.1);
}
.custom-filter-modal__field {
    margin-bottom: 1.6rem;
}
.custom-filter-modal__label {
    display: block;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--color-light--1);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.8rem;
}
.custom-filter-modal__input {
    width: 100%;
    background: var(--color-dark--2);
    border: 1.5px solid rgba(255,255,255,0.12);
    border-radius: 8px;
    color: var(--color-light--2);
    font-family: inherit;
    font-size: 1.4rem;
    padding: 0.9rem 1.2rem;
    outline: none;
    transition: border-color 0.2s;
}
.custom-filter-modal__input:focus {
    border-color: var(--color-brand--2);
}
.custom-filter-modal__emoji-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-bottom: 1rem;
}
.cf-emoji-btn {
    background: var(--color-dark--2);
    border: 1.5px solid transparent;
    border-radius: 8px;
    font-size: 2rem;
    width: 3.8rem;
    height: 3.8rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.15s, background 0.15s;
}
.cf-emoji-btn:hover { border-color: var(--color-brand--2); }
.cf-emoji-btn.active {
    border-color: var(--color-brand--2);
    background: rgba(0,196,106,0.15);
}
.custom-filter-modal__emoji-custom {
    margin-top: 0.6rem;
}
.custom-filter-modal__actions {
    display: flex;
    gap: 1rem;
    margin-top: 0.4rem;
}
.custom-filter-modal__btn {
    flex: 1;
    padding: 1.1rem;
    border-radius: 8px;
    border: none;
    font-family: inherit;
    font-size: 1.4rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
}
.custom-filter-modal__btn--cancel {
    background: var(--color-dark--2);
    color: var(--color-light--1);
}
.custom-filter-modal__btn--cancel:hover { background: var(--app-surface-2); }
.custom-filter-modal__btn--save {
    background: var(--color-brand--2);
    color: var(--app-text-primary);
}
.custom-filter-modal__btn--save:hover { background: #00a85a; }

/* ─── CUSTOM FILTER MODAL HINT ─── */
.custom-filter-modal__hint {
    font-size: 1.2rem;
    color: var(--color-light--1);
    background: var(--app-surface-1);
    border-radius: 8px;
    padding: 0.8rem 1rem;
    margin-bottom: 1rem;
    text-align: center;
    line-height: 1.5;
}
.custom-filter-modal__hint strong {
    color: var(--color-brand--2);
}

/* ─── WORKOUT MODAL (mobile map-click form) ─── */
.workout-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}
.workout-modal__box {
    background: var(--color-dark--1);
    border-radius: 16px;
    padding: 2.4rem 2.4rem 2rem;
    width: 100%;
    max-width: 36rem;
    box-shadow: 0 8px 40px rgba(0,0,0,0.6);
}
.workout-modal__title {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--color-light--2);
    margin-bottom: 1.8rem;
    text-align: center;
}
.workout-modal__row {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.2rem;
}
.workout-modal__row.hidden { display: none !important; }
.workout-modal__label {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--color-light--1);
    min-width: 7rem;
}
.workout-modal__input {
    flex: 1;
    background: var(--color-dark--2);
    border: 1.5px solid rgba(255,255,255,0.12);
    border-radius: 8px;
    color: var(--color-light--2);
    font-family: inherit;
    font-size: 1.4rem;
    padding: 0.85rem 1rem;
    outline: none;
    transition: border-color 0.2s;
    width: 100%;
}
.workout-modal__input:focus { border-color: var(--color-brand--2); }
.workout-modal__select { cursor: pointer; }
.workout-modal__actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.6rem;
}
.workout-modal__btn {
    flex: 1;
    padding: 1.1rem;
    border-radius: 8px;
    border: none;
    font-family: inherit;
    font-size: 1.4rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
}
.workout-modal__btn--cancel {
    background: var(--color-dark--2);
    color: var(--color-light--1);
}
.workout-modal__btn--cancel:hover { background: var(--app-surface-2); }
.workout-modal__btn--save {
    background: var(--color-brand--2);
    color: var(--app-text-primary);
}
.workout-modal__btn--save:hover { background: #00a85a; }

/* ─── WORKOUT HEADER WITH ROUTE THUMBNAIL ─── */
.workout__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    grid-column: 1 / -1;
    margin-bottom: 0.4rem;
}
.workout__header .workout__title {
    margin-bottom: 0;
    flex: 1;
}
.workout__thumb {
    flex-shrink: 0;
}
.workout__route-thumb {
    width: 6.4rem;
    height: 6.4rem;
    border-radius: 6px;
    display: block;
}

/* Walking type colour */
.workout--walking { border-left-color: #5badea; }


/* ─── ROUTE THUMBNAIL — absolute, doesn't affect grid layout ─── */

/* Remove previous thumbnail styles that were added */
.workout__header,
.workout__thumb,
.workout__route-thumb { display: none !important; }

.workout {
    position: relative; /* needed for absolute thumbnail */
}

/* Container sits absolute in top-right, no impact on grid */
.workout__thumb-container {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    right: 2.25rem;
    width: 6rem;
    height: 6rem;
    border-radius: 6px;
    overflow: hidden;
    pointer-events: none;
    z-index: 1;
}
.workout__thumb-wrap {
    position: relative;
    width: 100%;
    height: 100%;
}
.workout__thumb-map {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 6px;
    opacity: 0.85;
}
.workout__thumb-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

/* Walking — blue border matching the app's blue accent */
.workout--walking {
    border-left: 5px solid #5badea;
}
/* ══════════════════════════════════════════════════════
   3-TAB BOTTOM NAV + MAP OVERLAYS
══════════════════════════════════════════════════════ */

body {
    padding: 0 !important;
    flex-direction: column !important;
    height: 100dvh !important;
    overflow: hidden !important;
    background: var(--color-dark--1) !important;
}
#map {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important; right: 0 !important; bottom: 0 !important;
    width: 100% !important;
    height: 100dvh !important;
    z-index: 1 !important;
    flex: none !important;
}

/* ── Tab panels ── */
.tab-panel {
    position: fixed; inset: 0; bottom: 5.8rem;
    z-index: 50; display: none;
    flex-direction: column; justify-content: flex-end;
    pointer-events: none;   /* always pass-through except tab-scroll */
}
.tab-panel--active {
    display: flex;
    pointer-events: none;   /* STILL none — only .tab-scroll inside gets events */
}
.tab-panel--active .tab-scroll {
    pointer-events: all;    /* only the sheet itself is interactive */
}
.tab-panel--map,
.tab-panel--map.tab-panel--active {
    pointer-events: none !important; background: transparent !important;
}

/* ── Scrollable panel ── */
.tab-scroll {
    width: 100%;
    max-height: 88dvh;
    background: var(--color-dark--1);
    border-radius: 2rem 2rem 0 0;
    box-shadow: 0 -6px 40px rgba(0,0,0,0.55);
    overflow-y: auto; overflow-x: hidden;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    padding: 0 2rem 1.5rem;
    transition: max-height 0.3s cubic-bezier(0.4,0,0.2,1);
}
.tab-scroll::-webkit-scrollbar { display: none; }
/* Collapsed state: only drag bar visible */
.tab-scroll--collapsed {
    max-height: 0 !important;
    overflow: hidden !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}
/* Drag handle */
.tab-scroll::before {
    content: '';
    display: block;
    width: 4rem; height: 0.45rem;
    background: rgba(255,255,255,0.22);
    border-radius: 99px;
    margin: 1.1rem auto 1rem;
    flex-shrink: 0;
}
/* ── Tab header: logo + weather side by side ── */
.tab-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 0 1.2rem 0;
    min-height: 4.8rem;
}
.tab-scroll .logo {
    height: 3.8rem !important;
    display: block;
    margin: 0;
}

/* ── Weather widget ── */
.weather-widget {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.15rem;
    user-select: none;
}
.weather-widget__icon {
    font-size: 2rem;
    line-height: 1;
}
.weather-widget__sun {
    font-size: 1.1rem;
    font-weight: 700;
    font-family: 'Manrope', sans-serif;
    color: var(--color-light--1);
    letter-spacing: 0.04em;
}

/* ── Bottom nav ── */
.bottom-nav {
    position: fixed; bottom: 0; left: 0; right: 0;
    z-index: 200;
    height: 5.8rem;
    background: var(--color-dark--1);
    border: 1px solid var(--app-border);
    display: flex; align-items: stretch;
    box-shadow: 0 -2px 20px rgba(0,0,0,0.4);
    padding-bottom: env(safe-area-inset-bottom, 0px);
}
.bottom-nav__item {
    flex: 1; display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 0.25rem;
    background: none; border: none; cursor: pointer;
    color: var(--color-light--1); font-family: 'Manrope', sans-serif;
    padding: 0.6rem 0 0.9rem; transition: color 0.18s;
    -webkit-tap-highlight-color: transparent;
}
.bottom-nav__item--active { color: var(--color-brand--2) !important; }
.bottom-nav__icon { width: 2.2rem; height: 2.2rem; stroke: currentColor; }
.bottom-nav__label { font-size: 1.05rem; font-weight: 700; letter-spacing: 0.02em; }

/* ── Floating search bar ── */
.map-search-bar {
    position: fixed; top: 1.2rem; left: 1.2rem; right: 1.2rem;
    z-index: 150;
    transition: opacity 0.25s ease, transform 0.25s ease;
}
.map-search-bar.msb--hidden-tab { opacity: 0; transform: translateY(-12px); pointer-events: none; }
.map-search-bar.msb--hidden-route { opacity: 0; transform: translateY(-120%); pointer-events: none; }
.map-search-bar.msb--visible { opacity: 1; transform: translateY(0); pointer-events: all; }

.map-search-bar__inner {
    background: rgba(20,24,27,0.42);
    backdrop-filter: blur(0px);
    -webkit-backdrop-filter: blur(24px);
    border-radius: 1.6rem;
    padding: 1rem 1.2rem 1rem;
    box-shadow: 0 2px 20px rgba(0,0,0,0.45);
    border: 1px solid rgba(255,255,255,0.10);
}
.map-search-bar__row {
    display: flex; gap: 0.6rem; align-items: center;
}
/* More space between search row and filter pills */
.map-search-bar .poi-filters {
    margin-top: 1rem;
}
.map-search-bar .poi-results {
    margin-top: 0.8rem;
}

/* ── Route mini pill (when panel collapsed with active route) ── */
.route-mini-pill {
    position: fixed;
    bottom: 7rem; left: 50%; transform: translateX(-50%);
    z-index: 160;
    background: rgba(30,34,38,0.88);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(0,196,106,0.3);
    border-radius: 99px;
    padding: 0.7rem 1.6rem;
    display: flex; align-items: center; gap: 1rem;
    font-family: 'Manrope', sans-serif;
    font-size: 1.3rem; font-weight: 700;
    color: var(--color-light--2);
    box-shadow: 0 2px 12px rgba(0,0,0,0.4);
    white-space: nowrap;
    transition: opacity 0.25s ease;
}
.route-mini-pill.hidden { display: none; }
.route-mini-pill__sep { color: var(--app-text-muted); font-size: 1rem; }

/* ── Settings panel ── */
.settings-panel {
    position: fixed !important; inset: 0 !important;
    z-index: 400 !important; overflow-y: auto;
}

/* ── Cluster toggle ── */
.cluster-toggle {
    width: 3.6rem; height: 2rem;
    background: var(--color-dark--1); border: 2px solid var(--color-light--1);
    border-radius: 99px; position: relative; cursor: pointer;
    transition: background 0.2s, border-color 0.2s; flex-shrink: 0;
}
.cluster-toggle.active { background: var(--color-brand--2); border-color: var(--color-brand--2); }
.cluster-toggle__knob {
    position: absolute; top: 50%; left: 0.2rem; transform: translateY(-50%);
    width: 1.2rem; height: 1.2rem; background: var(--color-light--1);
    border-radius: 50%; transition: left 0.2s, background 0.2s;
}
.cluster-toggle.active .cluster-toggle__knob { left: 1.9rem; background: #fff; }

/* ── Workout cluster marker ── */
.workout-cluster {
    width: 40px; height: 40px; border-radius: 50%;
    background: var(--color-dark--1); border: 3px solid var(--color-brand--2);
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}
.workout-cluster span { color: var(--color-light--2); font-size: 1.3rem; font-weight: 800; font-family: 'Manrope',sans-serif; }

/* ── Skeleton loader ── */
.map-skeleton { position: absolute; inset: 0; z-index: 500; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2rem; pointer-events: none; overflow: hidden; }
.map-skeleton.hidden { display: none; }
.map-skeleton__bg { position: absolute; inset: 0; background: var(--color-dark--1); }
.map-skeleton__bg::after { content: ''; position: absolute; inset: 0; background: linear-gradient(135deg, transparent 0%, rgba(0,196,106,0.07) 40%, rgba(0,196,106,0.13) 50%, rgba(0,196,106,0.07) 60%, transparent 100%); background-size: 300% 300%; animation: mapWave 2.8s ease-in-out infinite; }
@keyframes mapWave { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }
.map-skeleton__loader { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 1.6rem; }
.map-skeleton__spinner { width: 5.6rem; height: 5.6rem; animation: spinnerRotate 1.1s linear infinite; }
@keyframes spinnerRotate { 100% { transform: rotate(360deg); } }
.map-skeleton__track { stroke: rgba(0,196,106,0.18); }
.map-skeleton__arc { stroke: var(--color-brand--2); }
.map-skeleton__label { color: var(--color-light--1); font-size: 1.35rem; font-weight: 600; font-family: 'Manrope',sans-serif; letter-spacing: 0.04em; }
.map-skeleton__msg { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 1.2rem; padding: 2rem 2.6rem; background: var(--app-bg-card, rgba(42,48,53,0.96)); border: 1px solid rgba(0,196,106,0.2); border-radius: 14px; pointer-events: all; }
.map-skeleton__msg.hidden { display: none; }
.map-skeleton__text { color: var(--app-text-primary, var(--color-light--2)); font-size: 1.4rem; font-weight: 600; font-family: 'Manrope',sans-serif; text-align: center; }
.map-skeleton__btn { background: var(--color-brand--2); color: var(--app-text-primary); border: none; border-radius: 8px; padding: 0.85rem 2rem; font-family: 'Manrope',sans-serif; font-size: 1.35rem; font-weight: 700; cursor: pointer; }

/* ── Offline badge + toast ── */
.offline-badge { position: absolute; top: 1.2rem; right: 1.2rem; z-index: 700; background: var(--color-dark--1); border: 1.5px solid var(--color-light--1); border-radius: 99px; padding: 0.5rem 1.1rem 0.5rem 0.7rem; display: flex; align-items: center; gap: 0.5rem; font-family: 'Manrope',sans-serif; font-size: 1.2rem; font-weight: 700; color: var(--color-light--1); box-shadow: 0 2px 8px rgba(0,0,0,0.35); }
.offline-badge.hidden { display: none; }
.offline-badge svg { width: 1.5rem; height: 1.5rem; stroke: var(--color-light--1); flex-shrink: 0; }
.offline-toast { position: absolute; top: 60%; left: 50%; transform: translateX(-50%) translateY(-10px); z-index: 800; background: var(--color-dark--1); border: 1.5px solid rgba(255,255,255,0.1); border-radius: 99px; padding: 1rem 2rem 1rem 1.4rem; display: flex; align-items: center; gap: 0.8rem; font-family: 'Manrope',sans-serif; font-size: 1.35rem; font-weight: 700; color: var(--color-light--1); box-shadow: 0 4px 20px rgba(0,0,0,0.5); opacity: 0; transition: opacity 0.4s ease, transform 0.4s ease; white-space: nowrap; pointer-events: none; }
.offline-toast--visible { opacity: 1; transform: translateX(-50%) translateY(0); }
.offline-toast svg { width: 1.7rem; height: 1.7rem; stroke: var(--color-light--1); flex-shrink: 0; }

/* ── Desktop ≥ 900px: restore classic sidebar ── */
@media (min-width: 900px) {
    body { padding: 2.5rem !important; flex-direction: row !important; overflow: visible !important; height: 100vh !important; background: #fff !important; }
    #map { position: static !important; flex: 1 !important; height: 100% !important; z-index: auto !important; }
    .tab-panel, .bottom-nav, .map-search-bar, .route-mini-pill { display: none !important; }
}

/* Fix 7: hide workout tiles in Workouts tab (visible only in Stats) */
.workouts--hidden-in-tab .workout { display: none; }
/* The form inside still works (rendered as modal on mobile) */


/* ═══════════════════════════════════════════════════════════
   WSZYSTKIE POPRAWKI
   ═══════════════════════════════════════════════════════════ */

@media (min-width: 900px) {
    body {
        flex-direction: row !important;
        padding: 2.5rem !important;
        height: 100vh !important;
        overflow: hidden !important;
        background: #fff !important;
    }
    #map {
        position: fixed !important;
        left: 55rem !important;
        top: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: auto !important;
        height: 100% !important;
        z-index: 1 !important;
    }
    .map-search-bar, .route-mini-pill,
    #tabStats:not(.tab-panel--active) { display: none !important; }

    #tabMap {
        position: static !important; inset: auto !important;
        z-index: auto !important; pointer-events: all !important;
        display: flex !important; flex-direction: column !important;
        flex: 0 0 50rem !important; width: 50rem !important;
        height: 100% !important;
        background-color: var(--color-dark--1) !important;
        padding: 3rem 2.5rem 7rem 2.5rem !important;
        overflow-y: auto !important; overflow-x: hidden !important;
        border-radius: 0 !important; box-shadow: none !important;
    }
    #tabMap .tab-scroll {
        max-height: none !important; border-radius: 0 !important;
        box-shadow: none !important; background: transparent !important;
        padding: 0 !important; overflow: hidden !important;
        display: flex !important; flex-direction: column !important;
        flex: 1 !important; pointer-events: all !important;
        transition: none !important;
    }
    #tabMap .tab-scroll::before { display: none !important; }
    #tabMap .tab-scroll .logo {
        height: 5.2rem !important; display: block !important;
        margin: 0 auto 3rem auto !important; align-self: center !important;
    }
    #tabMap .tab-header { justify-content: center !important; }
    #tabMap .workouts--hidden-in-tab .workout { display: grid !important; }
    #tabMap .workouts {
        height: auto !important; max-height: none !important;
        overflow-y: auto !important; flex: 1 !important;
    }
    #tabStats {
        position: fixed !important; top: 2.5rem !important;
        left: 2.5rem !important; width: 50rem !important;
        bottom: calc(2.5rem + 5.8rem) !important;
        z-index: 10 !important; pointer-events: all !important;
        display: none; flex-direction: column !important;
        background-color: var(--color-dark--1) !important;
        overflow-y: auto !important; overflow-x: hidden !important;
        border-radius: 0 !important; box-shadow: none !important;
    }
    #tabStats.tab-panel--active { display: flex !important; }
    #tabStats .tab-scroll {
        max-height: none !important; border-radius: 0 !important;
        box-shadow: none !important; background: transparent !important;
        padding: 2rem 2.5rem !important; overflow-y: auto !important;
        flex: 1 !important; display: flex !important;
        flex-direction: column !important; pointer-events: all !important;
        transition: none !important;
    }
    #tabStats .tab-scroll::before { display: none !important; }
    #tabStats .tab-header { display: none !important; }
    .bottom-nav {
        position: fixed !important; bottom: 2.5rem !important;
        left: 2.5rem !important; right: auto !important;
        width: 50rem !important; height: 5.8rem !important;
        z-index: 500 !important;
        background: var(--color-dark--2) !important;
        border-top: 1px solid rgba(255,255,255,0.10) !important;
        box-shadow: none !important; display: flex !important;
        padding: 0 !important;
    }
    .settings-panel {
        position: static !important; inset: auto !important;
        z-index: auto !important; overflow-y: visible !important;
    }
    .sidebar-search-bar {
        display: block !important; margin-bottom: 1.2rem !important;
    }
    .sidebar-search-bar .poi-search__bar {
        display: flex !important; gap: 0.6rem !important;
        align-items: stretch !important; margin-bottom: 0.8rem !important;
    }
    .sidebar-search-bar .poi-search__btn,
    .sidebar-search-bar .btn-settings-gear {
        align-self: stretch !important;
        padding-left: 1.1rem !important; padding-right: 1.1rem !important;
    }
    .sidebar-search-bar .poi-results {
        max-height: 22rem !important; overflow-y: auto !important;
        list-style: none !important;
    }
}

@media (max-width: 899px) {
    .sidebar-search-bar { display: none !important; }
    #mapSearchBarMobile {
        position: fixed !important;
        top: 0 !important; left: 0 !important; right: 0 !important;
        z-index: 1000 !important; pointer-events: all !important;
        display: block !important;
        opacity: 1 !important; transform: none !important;
        transition: none !important;
    }
    #mapSearchBarMobile.msb--hidden-tab,
    #mapSearchBarMobile.msb--hidden-route { display: none !important; }
    #mapSearchBarMobile.msb--visible { display: block !important; }
    #mapSearchBarMobile * { pointer-events: all !important; }
}

.sidebar-search-bar { display: none; }

/* ── Desktop search bar (sidebar only) ── */
.sidebar-search-bar { display: none; }
@media (min-width: 900px) {
    .sidebar-search-bar {
        display: block !important;
        margin-bottom: 1.2rem;
    }
    .sidebar-search-bar .poi-search__bar {
        display: flex;
        gap: 0.6rem;
        align-items: stretch;
        margin-bottom: 0.8rem;
    }
    .sidebar-search-bar .poi-search__btn,
    .sidebar-search-bar .btn-settings-gear {
        align-self: stretch;
        padding-left: 1.1rem;
        padding-right: 1.1rem;
    }
    .sidebar-search-bar .poi-results {
        list-style: none;
        max-height: 22rem;
        overflow-y: auto;
    }
}

/* ═══════════════════════════════════════════════════════════════
   TRACKER TAB — mapa widoczna w tle, panel na dole
   ═══════════════════════════════════════════════════════════════ */

/* Tab jest transparent — mapa (#map, z-index:1) przebija się przez */
.tab-panel--tracker {
    position: fixed !important;
    inset: 0 !important;
    bottom: 5.8rem !important;
    z-index: 2 !important;          /* ponad mapą (1) ale pod resztą UI */
    background: transparent !important;
    display: none;
    flex-direction: column;
    justify-content: flex-end;
    pointer-events: none;           /* kliknięcia przez do mapy domyślnie */
}
.tab-panel--tracker.tab-panel--active {
    display: flex !important;
}

/* ── Permission overlay ──────────────────────────────────── */
.trk-permission {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.65);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: flex-end;
    pointer-events: all;            /* blokuj kliknięcia gdy permission screen */
    z-index: 10;
}
.trk-permission.hidden { display: none !important; }

.trk-permission__sheet {
    width: 100%;
    background: var(--color-dark--1);
    border-radius: 2.8rem 2.8rem 0 0;
    padding: 3.2rem 2.8rem 4.8rem;
    text-align: center;
}
.trk-permission__icon  { font-size: 5rem; display: block; margin-bottom: 2rem; }
.trk-permission__title { font-size: 2.2rem; font-weight: 800; color: var(--color-light--1); margin-bottom: 1.2rem; }
.trk-permission__desc  { font-size: 1.5rem; color: var(--color-light--2); line-height: 1.6; margin-bottom: 2.8rem; }
.trk-permission__allow {
    display: block; width: 100%; padding: 1.8rem;
    background: var(--color-brand--2); color: var(--app-text-primary);
    font-size: 1.7rem; font-weight: 800;
    border: none; border-radius: 99px; cursor: pointer;
    margin-bottom: 1.2rem;
    box-shadow: 0 4px 20px rgba(0,196,106,0.4);
    transition: transform 0.15s;
}
.trk-permission__allow:active { transform: scale(0.97); }
.trk-permission__skip {
    display: block; width: 100%; padding: 1.2rem;
    background: transparent; color: var(--color-light--2);
    font-size: 1.5rem; font-weight: 600; border: none; cursor: pointer;
}

/* ── Bottom bar ──────────────────────────────────────────── */
.trk-bottom {
    position: relative;
    z-index: 3;                    /* above timer screen (1) */
    pointer-events: all;            /* klikalne */
    background: var(--color-dark--1);
    border: 1px solid var(--app-border);
    padding: 0.6rem 2rem 2.4rem;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    border-radius: 2rem 2rem 0 0;
    box-shadow: 0 -8px 32px rgba(0,0,0,0.5);
}
.trk-bottom__handle { display: flex; justify-content: center; padding: 0.8rem 0 1.2rem; cursor: grab; touch-action: none; }
.trk-bottom__handle span { width: 4rem; height: 0.5rem; border-radius: 1rem; background: var(--app-text-tertiary, rgba(255,255,255,0.3)); }
.trk-bottom__row { display: flex; flex-direction: row; align-items: center; justify-content: center; gap: 2.4rem; }

/* Round routes button (right of Start) — placeholder for now */
.trk-routes-btn {
  width: 5.6rem; height: 5.6rem; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  border: 2.5px solid var(--app-border, rgba(255,255,255,0.15));
  background: var(--app-surface-1, rgba(255,255,255,0.06));
  color: var(--app-text-secondary, #bbb);
  cursor: pointer;
  transition: transform 0.15s;
}
.trk-routes-btn:active { transform: scale(0.92); }

/* Slide-up panel */
.trk-bottom__panel {
  overflow: hidden;
  max-height: 0; opacity: 0; margin-top: 0;
  transition: max-height 0.3s ease, opacity 0.25s ease, margin-top 0.3s ease;
}
.trk-bottom.trk-bottom--expanded .trk-bottom__panel {
  max-height: 26rem; opacity: 1; margin-top: 1.4rem;
}
.trk-panel-row {
  display: flex; align-items: center; gap: 1.4rem;
  padding: 1.5rem 0.4rem;
  width: 100%;
  border: none; border-top: 1px solid var(--app-border, rgba(255,255,255,0.08));
  background: none; font-family: inherit; text-align: left;
}
.trk-panel-row--btn { cursor: pointer; }
.trk-panel-row__icon { color: var(--app-text-secondary, #bbb); display: flex; flex: 0 0 auto; }
.trk-panel-row__text { flex: 1; display: flex; flex-direction: column; gap: 0.2rem; }
.trk-panel-row__label { font-size: 1.5rem; font-weight: 600; color: var(--app-text-primary, #fff); }
.trk-panel-row__sub { font-size: 1.2rem; color: var(--app-text-tertiary, rgba(255,255,255,0.45)); }
.trk-panel-row__chevron { color: var(--app-text-tertiary); flex: 0 0 auto; }

/* Toggle */
.trk-toggle {
  width: 4.6rem; height: 2.6rem; flex: 0 0 auto;
  border-radius: 1.3rem; border: none; cursor: pointer; padding: 0;
  background: var(--app-toggle-off, rgba(255,255,255,0.28));
  position: relative; transition: background 0.2s;
}
.trk-toggle[aria-checked="true"] { background: #00c46a; }
.trk-toggle__knob {
  position: absolute; top: 0.3rem; left: 0.3rem;
  width: 2rem; height: 2rem; border-radius: 50%;
  background: #fff; transition: transform 0.2s;
}
.trk-toggle[aria-checked="true"] .trk-toggle__knob { transform: translateX(2rem); }

/* Sport tabs */
.trk-sport-tabs {
    display: flex;
    background: var(--color-dark--2);
    border-radius: 1.2rem;
    padding: 0.4rem;
    gap: 0.3rem;
}
.trk-sport-tab {
    flex: 1; display: flex; align-items: center; justify-content: center;
    gap: 0.5rem; padding: 0.9rem 0.4rem;
    border: none; border-radius: 0.9rem;
    background: transparent; color: var(--color-light--2);
    font-size: 1.3rem; font-weight: 700;
    cursor: pointer; transition: background 0.2s, color 0.2s, transform 0.15s;
}
.trk-sport-tab:active { transform: scale(0.96); }
.trk-sport-tab--active { background: var(--color-brand--2); color: var(--app-text-primary); }
.trk-sport-tab__emoji  { font-size: 1.6rem; }

/* Start button */
.trk-start-btn {
    width: 7.2rem; height: 7.2rem;
    border-radius: 50%; border: none;
    background: var(--color-brand--2); color: var(--app-text-primary);
    display: flex; align-items: center; justify-content: center;
    align-self: center; cursor: pointer;
    box-shadow: 0 6px 28px rgba(0,196,106,0.5);
    transition: transform 0.15s, box-shadow 0.2s;
}
.trk-start-btn:active { transform: scale(0.93); }

/* ── Sport selector button (round, Strava-style, left of Start) ── */
.trk-sport-btn {
  width: 5.6rem; height: 5.6rem;
  flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  border: 2.5px solid var(--trk-sport-color, #00c46a);
  background: color-mix(in srgb, var(--trk-sport-color, #00c46a) 16%, transparent);
  color: var(--app-text-primary, #fff);
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.15s, background 0.2s, border-color 0.2s;
}
.trk-sport-btn:active { transform: scale(0.92); }
.trk-sport-btn__emoji { font-size: 2.6rem; line-height: 1; }
.trk-sport-btn__label,
.trk-sport-btn__chevron { display: none; }   /* round icon-only button */

/* ── Timer-only screen ── */
.trk-timer-screen {
  position: fixed;
  inset: 0;
  z-index: 1;            /* above map, BELOW the control bar (.trk-bottom) */
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  background: var(--app-bg-base, #141417);
  pointer-events: none;
}
.trk-timer-screen.hidden { display: none !important; }
.trk-timer-screen__clock {
  font-size: 7rem; font-weight: 800; line-height: 1;
  color: var(--app-text-primary, #fff);
  font-variant-numeric: tabular-nums;
}
.trk-timer-screen__label {
  margin-top: 1.2rem;
  font-size: 1.6rem; font-weight: 600;
  color: var(--app-text-tertiary, rgba(255,255,255,0.45));
}

/* ── Sport picker (categorized + search) ── */
.trk-picker-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,0.6);
  display: flex; align-items: flex-end; justify-content: center;
}
.trk-picker {
  background: var(--app-bg-card, #1a1d24);
  border-radius: 20px 20px 0 0;
  width: 100%; max-width: 480px; max-height: 85vh;
  display: flex; flex-direction: column; overflow: hidden;
}
.trk-picker__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--app-border, rgba(255,255,255,0.08));
}
.trk-picker__title { font-size: 1.7rem; font-weight: 800; color: var(--app-text-primary, #fff); }
.trk-picker__close {
  background: none; border: none; cursor: pointer;
  font-size: 2rem; line-height: 1;
  color: var(--app-text-tertiary, rgba(255,255,255,0.5));
}
.trk-picker__search-wrap { padding: 12px 16px; }
.trk-picker__search {
  width: 100%; box-sizing: border-box;
  padding: 12px 16px; border-radius: 14px;
  border: 1.5px solid var(--app-border, rgba(255,255,255,0.1));
  background: var(--app-surface-1, rgba(255,255,255,0.05));
  color: var(--app-text-primary, #fff);
  font-family: inherit; font-size: 1.4rem; outline: none;
}
.trk-picker__list { overflow-y: auto; padding: 4px 12px 24px; -webkit-overflow-scrolling: touch; }
.trk-picker__cat {
  font-size: 1.2rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--app-text-tertiary, rgba(255,255,255,0.4));
  padding: 14px 8px 6px;
}
.trk-picker__item {
  width: 100%;
  display: flex; align-items: center; gap: 12px;
  padding: 12px 8px;
  background: none; border: none; cursor: pointer;
  border-radius: 12px;
  font-family: inherit;
}
.trk-picker__item:active { background: var(--app-surface-1, rgba(255,255,255,0.06)); }
.trk-picker__item-icon { font-size: 2rem; }
.trk-picker__item-label { flex: 1; text-align: left; font-size: 1.5rem; font-weight: 600; color: var(--app-text-primary, #fff); }
.trk-picker__item-tag { font-size: 1.3rem; opacity: 0.6; }
.trk-picker__item-del {
  font-size: 1.8rem; color: var(--app-text-tertiary, rgba(255,255,255,0.3));
  padding: 0 4px;
}
.trk-picker__empty { text-align: center; color: var(--app-text-tertiary); padding: 24px; }
.trk-picker__add {
  width: 100%; margin-top: 12px;
  padding: 14px; border-radius: 12px;
  border: 1.5px dashed var(--app-border, rgba(255,255,255,0.15));
  background: none; cursor: pointer;
  font-family: inherit; font-size: 1.4rem; font-weight: 600;
  color: var(--app-text-secondary, rgba(255,255,255,0.6));
}

/* ── Track settings grid ── */
.trk-set-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
  padding: 8px 16px 28px;
}
.trk-set-tile {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 22px 12px;
  border-radius: 16px;
  border: 1.5px solid var(--app-border, rgba(255,255,255,0.1));
  background: var(--app-surface-1, rgba(255,255,255,0.04));
  color: var(--app-text-primary, #fff);
  font-family: inherit; cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.trk-set-tile--on {
  border-color: #00c46a;
  background: color-mix(in srgb, #00c46a 12%, transparent);
}
.trk-set-tile__icon  { font-size: 2.6rem; line-height: 1; }
.trk-set-tile__label { font-size: 1.5rem; font-weight: 700; }
.trk-set-tile__sub   { font-size: 1.2rem; color: var(--app-text-tertiary, rgba(255,255,255,0.45)); }
.trk-set-tile--on .trk-set-tile__sub { color: #00c46a; }

/* ── Following-route pill ── */
.trk-ghost-pill {
  position: absolute; top: 1.4rem; left: 50%; transform: translateX(-50%);
  z-index: 1200; pointer-events: auto;
  display: flex; align-items: center; gap: 0.8rem;
  padding: 0.9rem 1rem 0.9rem 1.4rem;
  border-radius: 3rem;
  background: rgba(20,24,28,0.92);
  color: #fff; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 4px 18px rgba(0,0,0,0.35);
  max-width: 80vw;
}
.trk-ghost-pill.hidden { display: none !important; }
.trk-ghost-pill__txt { font-size: 1.4rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trk-ghost-pill__x {
  flex: 0 0 auto; width: 2.4rem; height: 2.4rem; border-radius: 50%;
  border: none; cursor: pointer; font-size: 1.3rem; line-height: 1;
  background: rgba(255,255,255,0.15); color: #fff;
}

/* ── Routes screen ── */
.trk-routes-tabs { display: flex; gap: 0.8rem; padding: 0 16px 12px; }
.trk-routes-tab {
  padding: 0.8rem 1.6rem; border-radius: 3rem;
  border: 1.5px solid var(--app-border, rgba(255,255,255,0.12));
  background: none; color: var(--app-text-secondary, #bbb);
  font-family: inherit; font-size: 1.35rem; font-weight: 600; cursor: pointer;
}
.trk-routes-tab--active { background: #ff5a1f; border-color: #ff5a1f; color: #fff; }
.trk-routes-tab:disabled { opacity: 0.4; cursor: default; }
.trk-routes-search {
  margin: 0 16px 12px; width: calc(100% - 32px);
  padding: 1.2rem 1.4rem; border-radius: 1.2rem;
  border: 1.5px solid var(--app-border, rgba(255,255,255,0.12));
  background: var(--app-surface-1, rgba(255,255,255,0.05));
  color: var(--app-text-primary, #fff); font-family: inherit; font-size: 1.4rem;
}
.trk-routes-list { padding: 0 16px 28px; display: flex; flex-direction: column; gap: 10px; max-height: 52vh; overflow-y: auto; }
.trk-route-card {
  display: flex; align-items: center; gap: 1.2rem; width: 100%;
  padding: 1.4rem; border-radius: 1.4rem;
  border: 1.5px solid var(--app-border, rgba(255,255,255,0.1));
  background: var(--app-surface-1, rgba(255,255,255,0.04));
  color: var(--app-text-primary, #fff);
  font-family: inherit; text-align: left; cursor: pointer;
}
.trk-route-card__icon { font-size: 2.4rem; flex: 0 0 auto; }
.trk-route-card__main { flex: 1; display: flex; flex-direction: column; gap: 0.3rem; }
.trk-route-card__title { font-size: 1.5rem; font-weight: 700; }
.trk-route-card__meta  { font-size: 1.25rem; color: var(--app-text-tertiary, rgba(255,255,255,0.5)); }
.trk-route-card__dist  { font-size: 1.8rem; font-weight: 800; flex: 0 0 auto; }
.trk-routes-empty { padding: 4rem 2rem; text-align: center; color: var(--app-text-tertiary, rgba(255,255,255,0.5)); font-size: 1.4rem; }
.trk-route-card__del {
  flex: 0 0 auto; width: 2.8rem; height: 2.8rem; border-radius: 50%;
  border: none; cursor: pointer; font-size: 1.3rem; line-height: 1;
  background: var(--app-surface-2, rgba(255,255,255,0.08));
  color: var(--app-text-tertiary, rgba(255,255,255,0.5));
}

/* Save-as-route star in the Finish modal */
.sam-route-star {
  display: flex; align-items: center; gap: 0.8rem;
  margin: 0 2.4rem 0.4rem; padding: 1rem 1.4rem;
  border-radius: 1.2rem; cursor: pointer;
  border: 1.5px solid #ffce1f;
  background: rgba(255,206,31,0.12); color: var(--app-text-primary, #fff);
  font-family: inherit; font-size: 1.45rem; font-weight: 700;
}
.sam-route-star__icon { font-size: 1.9rem; color: #ffce1f; }
.sam-route-star[aria-pressed="true"] { background: #ffce1f; color: #1a1a1a; }
.sam-route-star[aria-pressed="true"] .sam-route-star__icon { color: #1a1a1a; }

/* Community routes — share button, author avatar, publish dialog */
.trk-route-card__share {
  flex: 0 0 auto; width: 2.8rem; height: 2.8rem; border-radius: 50%;
  border: none; cursor: pointer; font-size: 1.4rem; line-height: 1;
  background: var(--app-surface-2, rgba(255,255,255,0.08));
  color: var(--app-text-secondary, #bbb);
}
.trk-route-card__avatar {
  flex: 0 0 auto; width: 3.6rem; height: 3.6rem; border-radius: 50%;
  object-fit: cover; display: flex; align-items: center; justify-content: center;
}
.trk-route-card__avatar--ph {
  background: #ff5a1f; color: #fff; font-weight: 800; font-size: 1.6rem;
}
.trk-publish__body { padding: 4px 16px 24px; display: flex; flex-direction: column; gap: 1rem; }
.trk-publish__label { font-size: 1.3rem; font-weight: 600; color: var(--app-text-secondary, #bbb); }
.trk-publish__note { font-size: 1.2rem; color: var(--app-text-tertiary, rgba(255,255,255,0.5)); margin: 0; }
.trk-publish__btn {
  margin-top: 0.6rem; padding: 1.5rem; border-radius: 3rem; border: none;
  background: #ff5a1f; color: #fff; font-family: inherit; font-size: 1.6rem; font-weight: 700; cursor: pointer;
}
.trk-publish__btn:disabled { opacity: 0.7; }

/* ── Route builder (Create mode) ── */
.trk-create-bar {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 5;
  pointer-events: auto;
  background: var(--color-dark--1); border-top: 1px solid var(--app-border);
  border-radius: 2rem 2rem 0 0; padding: 1.6rem 2rem 2.4rem;
  box-shadow: 0 -8px 32px rgba(0,0,0,0.5);
}
.trk-create-bar.hidden { display: none !important; }

/* Confirm dialog (Clear / Cancel) */
.trk-confirm-overlay { align-items: center; justify-content: center; }
.trk-confirm {
  width: min(86vw, 34rem);
  background: var(--app-bg-elevated, #fff);
  color: var(--app-text-primary, #1a1a1a);
  border-radius: 1.8rem; padding: 2.4rem 2rem 1.8rem;
  box-shadow: 0 20px 60px rgba(0,0,0,0.45); text-align: center;
}
.trk-confirm__title { margin: 0 0 0.6rem; font-size: 1.9rem; font-weight: 800; }
.trk-confirm__msg { margin: 0 0 1.8rem; font-size: 1.4rem; color: var(--app-text-secondary, #888); }
.trk-confirm__actions { display: flex; gap: 1rem; }
.trk-confirm__btn {
  flex: 1; padding: 1.4rem; border-radius: 1.2rem; border: none; cursor: pointer;
  font-family: inherit; font-size: 1.5rem; font-weight: 700;
  background: var(--app-surface-2, rgba(0,0,0,0.07)); color: var(--app-text-primary, #1a1a1a);
}
.trk-confirm__btn--yes { background: #ff3b30; color: #fff; }
.trk-create-bar__top { display: flex; align-items: center; justify-content: space-between; }
.trk-create-sport {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.9rem 1.4rem; border-radius: 3rem;
  border: 1.5px solid var(--app-border, rgba(255,255,255,0.15));
  background: var(--app-surface-1, rgba(255,255,255,0.06));
  color: var(--app-text-primary, #fff); font-family: inherit; font-size: 1.4rem; font-weight: 700; cursor: pointer;
}
.trk-create-dist { font-size: 1.6rem; color: var(--app-text-secondary, #bbb); }
.trk-create-dist strong { font-size: 2.4rem; color: var(--app-text-primary, #fff); font-variant-numeric: tabular-nums; }
.trk-create-hint { margin: 0.8rem 0 1.2rem; font-size: 1.25rem; color: var(--app-text-tertiary, rgba(255,255,255,0.45)); }
.trk-create-bar__actions { display: flex; gap: 0.8rem; }
.trk-create-act {
  flex: 1; padding: 1.3rem 0.6rem; border-radius: 1.2rem;
  border: 1.5px solid var(--app-border, rgba(255,255,255,0.12));
  background: var(--app-surface-1, rgba(255,255,255,0.05));
  color: var(--app-text-primary, #fff); font-family: inherit; font-size: 1.35rem; font-weight: 700; cursor: pointer;
}
.trk-create-act--save { background: #ff5a1f; border-color: #ff5a1f; color: #fff; flex: 1.4; }
.trk-create-loop {
  width: 100%; margin: 0 0 1.2rem; padding: 1.2rem;
  border-radius: 1.2rem; border: 1.5px dashed #ff5a1f;
  background: rgba(255,90,31,0.10); color: #ff5a1f;
  font-family: inherit; font-size: 1.4rem; font-weight: 700; cursor: pointer;
}
.trk-create-loop.hidden { display: none !important; }

/* History toggle */
.trk-history-toggle {
    pointer-events: all;
    position: absolute;
    top: 1.6rem; right: 1.6rem;
    display: flex; align-items: center; gap: 0.6rem;
    padding: 0.9rem 1.4rem;
    background: rgba(0,0,0,0.6); backdrop-filter: blur(8px);
    color: var(--app-text-primary); font-size: 1.3rem; font-weight: 600;
    border: 1px solid rgba(255,255,255,0.15); border-radius: 99px;
    cursor: pointer;
}

/* History panel */
.trk-history-panel {
    pointer-events: all;
    position: absolute;
    top: 0; left: 0; right: 0;
    max-height: 70%;
    background: var(--color-dark--1);
    border-radius: 0 0 2rem 2rem;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
    z-index: 5;
}
.trk-history-panel.hidden { display: none !important; }
.trk-history-panel__header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 1.6rem 2rem;
    border: 1px solid var(--app-border);
    position: sticky; top: 0; background: var(--color-dark--1); z-index: 1;
}
.trk-history-panel__header h3 {
    font-size: 1.5rem; font-weight: 700; color: var(--color-light--1);
}
.trk-history-panel__header button {
    background: none; border: none; color: var(--color-light--2);
    font-size: 1.6rem; cursor: pointer; padding: 0.4rem;
}
#activityHistoryList { padding: 1rem 1.2rem 2rem; }

/* ── Tracker OVERLAY (podczas nagrywania — fullscreen) ─── */
.tracker-overlay {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    pointer-events: none;
}
.tracker-overlay.hidden { display: none !important; }

/* Auto-pause / paused bar (yellow, prominent) */
.tracker-overlay__paused {
    pointer-events: all;
    align-self: stretch;
    margin: 0 1.2rem 0.8rem;
    background: #ffce1f;
    color: #1a1a1a;
    font-weight: 800;
    font-size: 1.6rem;
    text-align: center;
    padding: 1.2rem;
    border-radius: 1.4rem;
    letter-spacing: 0.02em;
    box-shadow: 0 4px 20px rgba(255,206,31,0.4);
}
.tracker-overlay__paused.hidden { display: none !important; }
.tracker-overlay__expand {
    position: absolute; top: 1rem; right: 1.2rem;
    color: var(--app-text-tertiary, rgba(255,255,255,0.4));
}
.tracker-overlay__stats { position: relative; cursor: pointer; }

/* Fullscreen expanded stats — covers the map */
.trk-expanded {
    position: fixed; inset: 0; z-index: 3500;
    background: var(--app-bg-base, #fff);
    display: flex; flex-direction: column;
}
.trk-expanded.hidden { display: none !important; }
.trk-expanded__header {
    background: var(--app-bg-elevated, #f2f2f7);
    color: var(--app-text-primary, #1a1a1a);
    padding: 2.4rem 2rem 2rem;
    text-align: center; position: relative;
    transition: background 0.25s;
}
.trk-expanded__header.trk-expanded__header--paused { background: #ffce1f; color: #1a1a1a; }
.trk-expanded__status { display: block; font-size: 1.6rem; font-weight: 700; opacity: 0.85; }
.trk-expanded__time   { display: block; font-size: 5.6rem; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.trk-expanded__collapse {
    position: absolute; top: 2rem; right: 2rem;
    background: none; border: none; cursor: pointer;
    color: currentColor;
}
.trk-expanded__body {
    flex: 1;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 3.5rem;
    overflow-y: auto; padding: 2rem 0;
}
.trk-expanded__metric { text-align: center; }
.trk-expanded__val {
    display: block; font-size: 5.4rem; font-weight: 800; line-height: 1;
    color: var(--app-text-primary, #1a1a1a); font-variant-numeric: tabular-nums;
}
.trk-expanded__val--big { font-size: 8rem; }
.trk-expanded__lbl { display: block; margin-top: 0.8rem; font-size: 1.6rem; font-weight: 600; color: var(--app-text-tertiary, #888); }
.trk-expanded__controls {
    display: flex; gap: 1.2rem; padding: 1.6rem 2rem 3.2rem;
}
.trk-expanded__btn {
    flex: 1; padding: 1.8rem; border-radius: 4rem; border: none;
    font-family: inherit; font-size: 1.7rem; font-weight: 700; cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 0.6rem;
}
.trk-expanded__btn--resume { background: #ff5a1f; color: #fff; }
.trk-expanded__btn--finish { background: #1a1a1a; color: #fff; }

/* Laps / splits */
.trk-expanded__laps { width: 100%; max-width: 44rem; padding: 0 2rem; }
.trk-expanded__laps[hidden] { display: none; }
.trk-expanded__laps-title { display: block; font-size: 1.4rem; font-weight: 600; color: var(--app-text-tertiary, #888); margin-bottom: 1rem; text-align: center; }
.trk-expanded__laps-list { display: flex; flex-direction: column; gap: 0.6rem; max-height: 24vh; overflow-y: auto; }
.trk-lap { display: flex; align-items: center; gap: 1rem; }
.trk-lap__num { width: 2.4rem; flex: 0 0 auto; text-align: right; font-size: 1.4rem; font-weight: 700; color: var(--app-text-primary, #1a1a1a); }
.trk-lap__bar-wrap { flex: 1; height: 1.8rem; background: var(--app-surface-2, rgba(0,0,0,0.07)); border-radius: 0.4rem; overflow: hidden; }
.trk-lap__bar { height: 100%; background: #ff5a1f; border-radius: 0.4rem; min-width: 4px; transition: width 0.3s; }
.trk-lap__val { width: 5.4rem; flex: 0 0 auto; font-size: 1.35rem; font-weight: 700; color: var(--app-text-primary, #1a1a1a); font-variant-numeric: tabular-nums; }

/* Stats bar na dole */
.tracker-overlay__stats {
    pointer-events: all;
    background: var(--trk-stats-bg, rgba(10,14,18,0.88));
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 1.6rem;
    margin: 0 1.2rem 1rem;
    padding: 1.6rem 1.2rem;
    display: flex;
    justify-content: space-around;
    border: 1px solid var(--app-border);
}
.tracker-overlay__stat {
    display: flex; flex-direction: column; align-items: center; gap: 0.3rem;
}
.tracker-overlay__val {
    font-size: 3.8rem; font-weight: 900; color: var(--app-text-primary);
    font-variant-numeric: tabular-nums; letter-spacing: -0.02em;
}
.tracker-overlay__lbl {
    font-size: 1.1rem; font-weight: 700;
    color: var(--app-text-tertiary, rgba(255,255,255,0.55)); text-transform: uppercase; letter-spacing: 0.08em;
}

/* Controls */
.tracker-overlay__controls {
    pointer-events: all;
    background: var(--trk-controls-bg, rgba(0,0,0,0.95));
    padding: 1.4rem 2rem 3.2rem;
    display: flex; gap: 1.2rem; align-items: center;
}
.tracker-overlay__pause {
    flex: 1; padding: 1.8rem;
    border: none; border-radius: 99px;
    font-size: 1.7rem; font-weight: 800; color: var(--app-text-primary);
    cursor: pointer; transition: transform 0.15s;
}
.tracker-overlay__pause:active { transform: scale(0.97); }
.tracker-overlay__stop {
    flex: 0 0 auto; padding: 1.8rem 2.4rem;
    border: 2px solid var(--app-border, rgba(255,255,255,0.3)); border-radius: 99px;
    background: transparent; font-size: 1.6rem; font-weight: 700; color: var(--app-text-primary);
    cursor: pointer; transition: transform 0.15s;
}
.tracker-overlay__stop:active  { transform: scale(0.97); }
.tracker-overlay__discard {
    flex: 0 0 auto; padding: 1.6rem;
    border: none; border-radius: 99px;
    background: var(--app-surface-2);
    font-size: 1.4rem; font-weight: 600; color: var(--app-text-tertiary, rgba(255,255,255,0.6));
    cursor: pointer;
}

@media (min-width: 900px) {
    .tab-panel--tracker,
    .tab-panel--tracker.tab-panel--active { display: none !important; }
}

/* FIX: overlay layout — stats jako pływający panel */
.tracker-overlay {
    padding-bottom: 0 !important;
    justify-content: flex-end !important;
}
.tracker-overlay__val { font-size: 3.2rem !important; }

/* ═══════════════════════════════════════════════════════════════
   GOOD JOB SPLASH
   ═══════════════════════════════════════════════════════════════ */
.goodjob-splash {
    position: fixed; inset: 0; z-index: 9000;
    display: flex; align-items: center; justify-content: center;
    opacity: 0; transition: opacity 0.4s ease;
    pointer-events: all;
}
.goodjob-splash--visible { opacity: 1; }
.goodjob-splash--fade    { opacity: 0; }

.goodjob-splash__bg {
    position: absolute; inset: 0; background: #0d1117;
}
.goodjob-splash__bg::before {
    content: ''; position: absolute;
    width: 200vmax; height: 200vmax;
    top: -120vmax; left: -60vmax; border-radius: 50%;
    background: radial-gradient(circle, #00c46a55 0%, transparent 60%);
    animation: splashPulse 1.8s ease-out forwards;
}
.goodjob-splash__bg::after {
    content: ''; position: absolute;
    width: 160vmax; height: 160vmax;
    bottom: -100vmax; right: -40vmax; border-radius: 50%;
    background: radial-gradient(circle, #00c46a22 0%, transparent 60%);
    animation: splashPulse 1.8s 0.2s ease-out forwards;
}
@keyframes splashPulse {
    0%   { transform: scale(0.6); opacity: 0; }
    40%  { opacity: 1; }
    100% { transform: scale(1.1); opacity: 0.5; }
}
.goodjob-splash__content {
    position: relative; text-align: center;
    animation: splashContent 0.5s cubic-bezier(0.34,1.56,0.64,1) forwards;
}
@keyframes splashContent {
    from { transform: scale(0.7) translateY(20px); opacity: 0; }
    to   { transform: scale(1) translateY(0); opacity: 1; }
}
.goodjob-splash__icon {
    font-size: 6rem; display: block; margin-bottom: 2rem;
    animation: splashBounce 0.6s 0.1s cubic-bezier(0.34,1.56,0.64,1) both;
}
@keyframes splashBounce {
    from { transform: scale(0) rotate(-20deg); }
    to   { transform: scale(1) rotate(0deg); }
}
.goodjob-splash__title {
    font-size: 5.6rem; font-weight: 900; color: var(--app-text-primary);
    letter-spacing: -0.03em; line-height: 1; margin-bottom: 1rem;
}
.goodjob-splash__sub {
    font-size: 2rem; color: var(--app-text-tertiary); font-weight: 600;
}

/* ═══════════════════════════════════════════════════════════════
   ACTIVITY SUMMARY MODAL
   ═══════════════════════════════════════════════════════════════ */
.act-sum {
    position: fixed; inset: 0; z-index: 8000;
    display: flex; align-items: flex-end;
    background: rgba(0,0,0,0.75); backdrop-filter: blur(6px);
    opacity: 0; transition: opacity 0.3s; pointer-events: none;
}
.act-sum--visible { opacity: 1; pointer-events: all; }

.act-sum__sheet {
    width: 100%; max-width: 56rem; margin: 0 auto;
    background: var(--color-dark--1);
    border-radius: 2.4rem 2.4rem 0 0; overflow: hidden;
    transform: translateY(60px);
    transition: transform 0.35s cubic-bezier(0.34,1.56,0.64,1);
}
.act-sum--visible .act-sum__sheet { transform: translateY(0); }

.act-sum__handle {
    width: 4rem; height: 0.4rem; border-radius: 99px;
    background: rgba(255,255,255,0.2);
    margin: 1.2rem auto 0;
}
.act-sum__header {
    display: flex; align-items: center; gap: 1.6rem;
    padding: 1.6rem 2.4rem;
}
.act-sum__badge {
    width: 5.6rem; height: 5.6rem; border-radius: 1.4rem;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.act-sum__name  { font-size: 1.9rem; font-weight: 800; color: var(--color-light--1); margin-bottom: 0.2rem; }
.act-sum__date  { font-size: 1.3rem; color: var(--color-light--2); }

.act-sum__map   { height: 22rem; background: var(--color-dark--2); }
.act-sum__no-map {
    height: 100%; display: flex; align-items: center; justify-content: center;
    color: var(--color-light--2); font-size: 1.4rem;
}
.act-sum__stats {
    display: flex; justify-content: space-around;
    padding: 2rem; border: 1px solid var(--app-border);
}
.act-sum__stat  { display: flex; flex-direction: column; align-items: center; gap: 0.3rem; }
.act-sum__stat--big .act-sum__val { font-size: 3.6rem; }
.act-sum__val   { font-size: 2.4rem; font-weight: 900; color: var(--color-light--1); font-variant-numeric: tabular-nums; }
.act-sum__lbl   { font-size: 1.1rem; font-weight: 700; color: var(--color-light--2); text-transform: uppercase; letter-spacing: 0.06em; }

.act-sum__actions {
    display: flex; gap: 1rem; padding: 1.6rem 2rem 3.6rem;
}
.act-sum__btn {
    padding: 1.5rem 1.2rem; border-radius: 1.2rem;
    font-size: 1.5rem; font-weight: 700; cursor: pointer; border: none;
    transition: transform 0.15s;
}
.act-sum__btn:active { transform: scale(0.97); }
.act-sum__btn--discard { background: var(--color-dark--2); color: var(--color-light--2); border: 1.5px solid rgba(255,255,255,0.1); }
.act-sum__btn--share   { background: var(--app-surface-2); color: var(--color-light--1); flex: 0 0 auto; }
.act-sum__btn--save    { flex: 1; color: var(--app-text-primary); }

@media (min-width: 900px) {
    .act-sum { align-items: center; }
    .act-sum__sheet { border-radius: 2rem; max-width: 48rem; }
}

/* ── Activity history fixes ──────────────────────────────── */
.act-history__item {
    transition: transform 0.2s, opacity 0.3s, background 0.2s !important;
}
.act-history__item--active {
    background: var(--app-surface-1) !important;
    border-color: rgba(255,255,255,0.12) !important;
}
.act-history__top {
    display: flex; align-items: center; gap: 0.8rem;
    margin-bottom: 0.5rem; flex-wrap: nowrap; overflow: hidden;
}
.act-history__name {
    flex: 1; white-space: nowrap; overflow: hidden;
    text-overflow: ellipsis; max-width: 16rem;
}
.act-history__stats {
    display: flex; gap: 1rem; font-size: 1.2rem;
    font-weight: 600; color: var(--color-light--2);
    flex-wrap: nowrap;
}
/* Usuń przycisk delete z historii - hover nie działa na mobile */
.act-history__del {
    opacity: 1 !important;
    background: var(--app-surface-1) !important;
}

/* ── Activity history — pełny redesign ──────────────────── */
.act-history__item {
    position: relative !important;
    display: flex !important;
    align-items: stretch !important;
    background: var(--color-dark--2) !important;
    border-radius: 1.2rem !important;
    overflow: hidden !important;
    cursor: pointer !important;
    border: 1px solid var(--app-border) !important;
    transition: transform 0.2s, opacity 0.3s, background 0.2s !important;
    min-height: 7rem !important;
}
.act-history__item:active { transform: scale(0.98) !important; }
.act-history__item--active {
    background: var(--app-surface-1) !important;
    border-color: rgba(255,255,255,0.12) !important;
}
.act-history__bar {
    width: 4px !important;
    flex-shrink: 0 !important;
    border-radius: 0 !important;
}
.act-history__body {
    flex: 1 !important;
    padding: 1.2rem 3.6rem 1.2rem 1.4rem !important;
    min-width: 0 !important;
}
.act-history__top {
    display: flex !important;
    align-items: center !important;
    gap: 0.6rem !important;
    margin-bottom: 0.6rem !important;
}
.act-history__top > span:first-child { font-size: 1.8rem !important; flex-shrink: 0 !important; }
.act-history__name {
    flex: 1 !important;
    font-size: 1.4rem !important;
    font-weight: 700 !important;
    color: var(--color-light--1) !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}
.act-history__date {
    font-size: 1.2rem !important;
    color: var(--color-light--2) !important;
    flex-shrink: 0 !important;
}
.act-history__stats {
    display: flex !important;
    gap: 1.4rem !important;
    font-size: 1.35rem !important;
    font-weight: 600 !important;
    color: var(--color-light--2) !important;
}

/* Delete button — identyczny styl jak workout__delete */
.act-history__del {
    position: absolute !important;
    top: 0.8rem !important;
    right: 0.8rem !important;
    width: 2.2rem !important;
    height: 2.2rem !important;
    border-radius: 50% !important;
    border: none !important;
    background: transparent !important;
    color: var(--color-light--1) !important;
    font-size: 1.2rem !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    opacity: 1 !important;
    transition: background-color 0.2s, color 0.2s !important;
    line-height: 1 !important;
}
.act-history__del:hover {
    background-color: #ff6b6b22 !important;
    color: #ff6b6b !important;
}

/* workout-wrapper — kontener dla kafelka + floating button X */
.workout-wrapper {
  position: relative;
  margin-bottom: 1.75rem;
}
.workout-wrapper .workout {
  margin-bottom: 0 !important;
}

/* X tylko na desktop, swipe na mobile */
@media (max-width: 899px) {
    .workout__delete {
        display: none !important;
    }
    .workout {
        touch-action: pan-y;
        overflow: hidden;
    }
}

/* ── Route mini pill nad tracker overlay ── */
.route-mini-pill.pill--above-tracker {
    bottom: 30vh;
}

/* ─── TAB-HEADER WEATHER BAR ──────────────────────────────────────────────────
   📍 Elbląg, Poland    [logo]    ☀️ 13°C  Clear sky
   ─────────────────────────────────────────────────────────────────────────── */

#weatherTopBar {
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: opacity 0.15s;
    user-select: none;
}
#weatherTopBar:active { opacity: 0.75; }

/* Left — location */
.tab-header__location {
    display:     flex;
    align-items: center;
    gap:         0.35rem;
    flex:        1;
    min-width:   0;
}
.tab-header__pin  { font-size: 1.2rem; flex-shrink: 0; }
.tab-header__city {
    font-size:     1.2rem;
    font-weight:   600;
    color: var(--app-text-tertiary);
    white-space:   nowrap;
    overflow:      hidden;
    text-overflow: ellipsis;
}

/* Right — weather */
.tab-header__weather {
    display:         flex;
    align-items:     center;
    justify-content: flex-end;
    gap:             0.4rem;
    flex:            1;
    min-width:       0;
}
.tab-header__wicon { font-size: 1.8rem; flex-shrink: 0; line-height: 1; }
.tab-header__temp  {
    font-size:   1.4rem;
    font-weight: 800;
    color:       var(--color-light--1);
    letter-spacing: -0.02em;
    flex-shrink: 0;
}
.tab-header__desc  {
    font-size:     1.1rem;
    color:         rgba(255,255,255,0.45);
    white-space:   nowrap;
    overflow:      hidden;
    text-overflow: ellipsis;
}

/* Narrow screens — hide description */
@media (max-width: 380px) {
    .tab-header__desc { display: none; }
    .tab-header__city { max-width: 8rem; }
}

/* ─── TAB-HEADER WEATHER — two-line layout ───────────────────────────────────
   ☀️  13°C  ┌ Clear sky
             └ Feels 7°
   ─────────────────────────────────────────────────────────────────────────── */

/* Weather right block: icon + temp + two-line text */
.tab-header__weather {
    display:     flex;
    align-items: center;
    gap:         0.4rem;
    flex:        1;
    justify-content: flex-end;
    min-width:   0;
}

/* Two-line text column */
.tab-header__weather-text {
    display:        flex;
    flex-direction: column;
    align-items:    flex-start;
    min-width:      0;
    line-height:    1.25;
}

.tab-header__desc {
    font-size:     1.15rem;
    font-weight:   600;
    color:         rgba(255,255,255,0.55);
    white-space:   nowrap;
    overflow:      hidden;
    text-overflow: ellipsis;
    max-width:     10rem;
}

.tab-header__feels {
    font-size:     1.05rem;
    font-weight:   500;
    color: var(--app-text-tertiary);
    white-space:   nowrap;
}

/* Stats tab — center logo only */
.tab-header--logo-only {
    justify-content: center !important;
}


/* ── Friends Feed ─────────────────────────────────────────────────────────── */

#friendsFeed {
  padding: 0 12px 80px;
}

.friends-feed__loading,
.friends-feed__empty {
  text-align:  center;
  color: var(--app-text-tertiary);
  font-size:   14px;
  padding:     32px 0;
}

.ff-card {
  background: var(--app-surface-1);
  border: 1px solid var(--app-border);
  border-radius: 16px;
  padding:       16px;
  margin-bottom: 12px;
}

.ff-card__header {
  display:        flex;
  align-items:    center;
  gap:            10px;
  margin-bottom:  10px;
}

.ff-card__avatar {
  width:           36px;
  height:          36px;
  border-radius:   50%;
  background: var(--app-surface-2);
  display:         flex;
  align-items:     center;
  justify-content: center;
  font-weight:     700;
  font-size:       16px;
  flex-shrink:     0;
}

.ff-card__meta {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ff-card__author {
  font-weight: 600;
  font-size:   14px;
}

.ff-card__date {
  font-size: 12px;
  color: var(--app-text-tertiary);
}

.ff-card__type {
  font-size: 18px;
}

.ff-card__title {
  font-weight:   600;
  font-size:     15px;
  margin-bottom: 6px;
}

.ff-card__body {
  font-size:     13px;
  color: var(--app-text-secondary);
  margin-bottom: 10px;
  line-height:   1.5;
}

.ff-card__photo {
  width:         100%;
  border-radius: 10px;
  margin-bottom: 10px;
  object-fit:    cover;
  max-height:    280px;
}

.ff-card__stats {
  display:       flex;
  gap:           16px;
  font-size:     13px;
  color:         rgba(255,255,255,0.6);
  margin-bottom: 10px;
}

.ff-card__actions {
  display:    flex;
  gap:        12px;
  padding-top: 10px;
  border: 1px solid var(--app-border);
}

.ff-card__like,
.ff-card__comment-btn {
  background:    none;
  border:        none;
  color: var(--app-text-tertiary);
  font-size:     14px;
  cursor:        pointer;
  padding:       6px 10px;
  border-radius: 8px;
  display:       flex;
  align-items:   center;
  gap:           6px;
}

.ff-card__like--liked {
  color: #f43f5e;
}

.ff-card__comments {
  margin-top:    10px;
  border: 1px solid var(--app-border);
  padding-top:   10px;
}

.ff-comment {
  display:       flex;
  gap:           8px;
  font-size:     13px;
  margin-bottom: 8px;
}

.ff-comment__author {
  font-weight: 600;
  flex-shrink: 0;
}

.ff-comment__text {
  color: var(--app-text-secondary);
}

.ff-comment__input-row {
  display: flex;
  gap:     8px;
  margin-top: 8px;
}

.ff-comment__input {
  flex:          1;
  background: var(--app-surface-1);
  border:        1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  padding:       8px 12px;
  color: var(--app-text-primary);
  font-size:     13px;
}

.ff-comment__send {
  background:    #00c46a;
  border:        none;
  border-radius: 8px;
  padding:       8px 14px;
  color: var(--app-text-primary);
  font-size:     13px;
  cursor:        pointer;
  font-weight:   600;
}

/* ── Recovery code ────────────────────────────────────────────────────────── */

.recovery-code__display {
  background: var(--app-surface-1);
  border:        1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  padding:       24px;
  margin:        16px 0;
  text-align:    center;
}

.recovery-code__digits {
  font-size:     56px;
  font-weight:   700;
  letter-spacing:14px;
  color:         #4ade80;
  font-family:   monospace;
  display:       block;
}

.name-modal__btn--secondary {
  background: var(--app-surface-2);
  color: var(--app-text-primary);
  margin-bottom:8px;
}

.name-modal__recover-link {
  background:    none;
  border:        none;
  color: var(--app-text-tertiary, rgba(255,255,255,0.45));
  font-size:     13px;
  cursor:        pointer;
  padding:       10px 16px;
  width:         100%;
  text-align:    center;
  margin-top:    8px;
  border-radius: 10px;
  display:       block;
  transition:    color 0.2s;
}

.name-modal__recover-link:hover,
.name-modal__recover-link:active {
  color: var(--app-text-secondary, rgba(255,255,255,0.75));
  background: var(--app-surface-1);
}

.name-modal__restore-status {
  text-align:    center;
  min-height:    20px;
  margin-bottom: 8px;
  font-size:     13px;
}

/* ── Public Profile Modal ─────────────────────────────────────────────────── */

.pp-overlay {
  position:   fixed;
  inset:      0;
  z-index:    3000;
  background: rgba(0,0,0,0);
  pointer-events: none;
  transition: background 0.3s;
}
.pp-overlay--visible {
  background:     rgba(0,0,0,0.6);
  pointer-events: all;
}

.pp-sheet {
  position:       absolute;
  bottom:         0;
  left:           0;
  right:          0;
  background: var(--app-bg-base);
  border-radius:  24px 24px 0 0;
  padding:        0 0 40px;
  transform:      translateY(100%);
  transition:     transform 0.35s cubic-bezier(0.32,0.72,0,1);
  min-height:     360px;
}
.pp-sheet--open { transform: translateY(0); }

.pp-handle {
  width:         40px;
  height:        4px;
  background:    rgba(255,255,255,0.2);
  border-radius: 2px;
  margin:        12px auto 0;
}

.pp-header {
  display:         flex;
  justify-content: flex-end;
  padding:         12px 16px 0;
}

.pp-close {
  background: var(--app-surface-2);
  border:        none;
  border-radius: 50%;
  color:         rgba(255,255,255,0.6);
  width:         30px;
  height:        30px;
  cursor:        pointer;
  font-size:     14px;
}

.pp-loading {
  display:         flex;
  align-items:     center;
  justify-content: center;
  padding:         60px;
}

.pp-body {
  display:        flex;
  flex-direction: column;
  align-items:    center;
  padding:        16px 24px 0;
  text-align:     center;
}

.pp-avatar {
  width:         88px;
  height:        88px;
  border-radius: 50%;
  overflow:      hidden;
  margin-bottom: 14px;
  border:        2px solid rgba(255,255,255,0.1);
}
.pp-avatar__img {
  width:      100%;
  height:     100%;
  object-fit: cover;
}
.pp-avatar__placeholder {
  width:           100%;
  height:          100%;
  background:      rgba(74,222,128,0.15);
  display:         flex;
  align-items:     center;
  justify-content: center;
  font-size:       36px;
  font-weight:     700;
  color:           #4ade80;
}

.pp-name {
  font-size:     20px;
  font-weight:   800;
  color:         #f0f4f8;
  margin:        0 0 6px;
}

.pp-bio {
  font-size:     14px;
  color: var(--app-text-tertiary);
  margin:        0 0 20px;
  line-height:   1.5;
}

.pp-stats {
  display:       flex;
  gap:           40px;
  margin-bottom: 24px;
}

.pp-stat {
  display:        flex;
  flex-direction: column;
  align-items:    center;
  gap:            2px;
}
.pp-stat__val {
  font-size:   20px;
  font-weight: 700;
  color:       #f0f4f8;
}
.pp-stat__lbl {
  font-size: 12px;
  color: var(--app-text-tertiary);
}

.pp-follow-btn {
  background:    #4ade80;
  border:        none;
  border-radius: 14px;
  color:         #0f1114;
  font-size:     16px;
  font-weight:   700;
  padding:       13px 48px;
  cursor:        pointer;
  font-family:   'Manrope', sans-serif;
  transition:    background 0.2s;
  width:         100%;
  max-width:     280px;
}
.pp-follow-btn--following {
  background: var(--app-surface-2);
  color:      rgba(255,255,255,0.6);
}

/* ── Static minimap image ─────────────────────────────────────────────────── */
.home-card__minimap-img {
  width:         100%;
  height:        100%;
  object-fit:    cover;
  border-radius: 12px;
  display:       block;
}

/* ── Map style picker button ─────────────────────────────────────────────────── */
.trk-map-style-btn {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--app-bg-card, rgba(26,31,35,0.9));
  border: 1px solid var(--app-border, rgba(255,255,255,0.12));
  color: var(--app-text-primary, #fff);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 2px 12px rgba(0,0,0,0.3);
  z-index: 10;
  pointer-events: all;
  transition: transform 0.15s, box-shadow 0.15s;
}
.trk-map-style-btn:active { transform: translateY(-50%) scale(0.93); }
.trk-map-style-btn--map {
  position: fixed;
  top: auto;
  bottom: calc(6.8rem + 16px);
  right: 16px;
  transform: none;
  z-index: 400;
}
.trk-map-style-btn--map:active { transform: scale(0.93); }

/* ── Map style picker panel ─────────────────────────────────────────────────── */
.map-style-panel {
  position: fixed;
  bottom: 5.8rem;
  left: 0; right: 0;
  z-index: 9000;
  pointer-events: none;
  opacity: 0;
  transform: translateY(100%);
  transition: opacity 0.25s, transform 0.3s cubic-bezier(0.32,0.72,0,1);
}
.map-style-panel.visible {
  pointer-events: all;
  opacity: 1;
  transform: translateY(0);
}
.map-style-panel.hidden {
  display: block !important;
  pointer-events: none;
  opacity: 0;
  transform: translateY(100%);
}
.map-style-panel__inner {
  background: var(--app-bg-card, #1a1f23);
  border-radius: 24px 24px 0 0;
  padding: 20px 20px 32px;
  box-shadow: 0 -4px 24px rgba(0,0,0,0.4);
}
.map-style-panel__title {
  font-size: 1.1rem; font-weight: 700;
  color: var(--app-text-tertiary, rgba(255,255,255,0.4));
  text-transform: uppercase; letter-spacing: 0.7px;
  margin-bottom: 16px;
}
.map-style-panel__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.map-style-card {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  background: var(--app-surface-1, rgba(255,255,255,0.05));
  border: 2px solid transparent;
  border-radius: 16px;
  padding: 12px 8px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.map-style-card--active {
  border-color: var(--color-brand--2, #00c46a);
  background: rgba(0,196,106,0.08);
}
.map-style-card__thumb {
  font-size: 2.4rem;
  line-height: 1;
}
.map-style-card__label {
  font-size: 1.2rem; font-weight: 600;
  color: var(--app-text-primary, #fff);
  text-align: center;
}

/* ── Unified workout markers ─────────────────────────────────────────────────── */
.wu-marker {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--app-bg-card, #1a1f23);
  border: 2px solid #00c46a;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem; line-height: 1;
  box-shadow: 0 2px 8px rgba(0,0,0,0.35);
  cursor: pointer;
  transition: transform 0.15s;
}
.wu-marker:hover { transform: scale(1.1); }
.wu-marker--running  { border-color: #00c46a; }
.wu-marker--cycling  { border-color: #f97316; }
.wu-marker--walking  { border-color: #3b82f6; }
.wu-marker--gym,
.wu-marker--other    { border-color: #8b5cf6; }

/* ── Unified workout popup ───────────────────────────────────────────────────── */
.wu-popup { min-width: 160px; max-width: 210px; padding: 2px 0; }
.wu-popup__header { font-size: 1.3rem; font-weight: 700; margin-bottom: 4px; color: var(--app-text-primary, #fff); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wu-popup__date   { font-size: 1.1rem; color: var(--app-text-tertiary, rgba(255,255,255,0.4)); margin-bottom: 6px; }
.wu-popup__stat   { font-size: 1.2rem; color: var(--app-text-secondary, rgba(255,255,255,0.7)); margin: 2px 0; }

/* ── Activity detail screen (Strava-style) ── */
.ad-overlay {
  position: fixed; inset: 0; z-index: 4000;
  background: var(--app-bg-base, #0f1114);
  overflow: hidden;
  animation: adIn 0.22s ease;
}
@keyframes adIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.ad-hero { position: absolute; top: 0; left: 0; right: 0; height: 100%; background: var(--app-bg-card, #1a1f23); }
.ad-hero-map { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; }
.ad-hero-map canvas { width: 100% !important; height: 100% !important; }
.ad-hero-empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 6rem; }
.ad-back {
  position: absolute; top: calc(1.2rem + env(safe-area-inset-top, 0px)); left: 1.4rem; z-index: 30;
  width: 4rem; height: 4rem; border-radius: 50%; border: none; cursor: pointer;
  background: rgba(20,24,28,0.85); color: #fff; display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(8px); box-shadow: 0 2px 10px rgba(0,0,0,0.35);
}
.ad-sheet {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 5;
  height: 100vh; height: 100dvh;
  background: var(--app-bg-base, #0f1114); border-radius: 2.2rem 2.2rem 0 0;
  padding: 0 2rem calc(3rem + env(safe-area-inset-bottom, 0px));
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  transform: translateY(0); transition: transform 0.25s ease;
  box-shadow: 0 -8px 30px rgba(0,0,0,0.32);
}
.ad-grab { width: 4.4rem; height: 0.5rem; box-sizing: content-box; padding: 1.2rem 3rem; margin: 0.4rem auto 0.8rem; border-radius: 1rem; background: var(--app-text-muted, rgba(255,255,255,0.25)); background-clip: content-box; touch-action: none; cursor: grab; }
.ad-footer { margin-top: 2rem; }
.ad-author { display: flex; align-items: center; gap: 1.2rem; margin-bottom: 1.4rem; }
.ad-avatar { width: 4.6rem; height: 4.6rem; border-radius: 50%; border: 2px solid; overflow: hidden; display: flex; align-items: center; justify-content: center; font-size: 2rem; flex-shrink: 0; }
.ad-avatar img { width: 100%; height: 100%; object-fit: cover; }
.ad-author-text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.ad-author-name { font-size: 1.55rem; font-weight: 800; color: var(--app-text-primary, #fff); }
.ad-date { font-size: 1.2rem; color: var(--app-text-secondary, #9aa0a6); }
.ad-sport { font-size: 1.3rem; font-weight: 700; }
.ad-title { font-size: 2.4rem; font-weight: 800; color: var(--app-text-primary, #fff); margin: 0 0 0.6rem; line-height: 1.15; }
.ad-desc { font-size: 1.45rem; color: var(--app-text-secondary, #c2c8ce); margin: 0 0 1.6rem; line-height: 1.45; }
.ad-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; margin: 1.6rem 0; }
.ad-stat { background: var(--app-bg-card, rgba(255,255,255,0.05)); border: 1px solid var(--app-border, rgba(255,255,255,0.08)); border-radius: 1.4rem; padding: 1.4rem; }
.ad-stat-v { display: block; font-size: 2.4rem; font-weight: 800; color: var(--app-text-primary, #fff); font-variant-numeric: tabular-nums; }
.ad-stat-l { display: block; font-size: 1.2rem; color: var(--app-text-tertiary, #8b9197); margin-top: 0.2rem; }
.ad-photo { margin: 1.6rem 0; border-radius: 1.4rem; overflow: hidden; }
.ad-photo img, .ad-photo video { width: 100%; display: block; }
.ad-section { margin: 2rem 0 0.6rem; }
.ad-section-title { font-size: 1.5rem; font-weight: 800; color: var(--app-text-primary, #fff); margin: 0 0 1rem; }
.ad-split { display: flex; align-items: center; gap: 1rem; margin-bottom: 0.7rem; }
.ad-split-km { width: 2.4rem; font-size: 1.3rem; font-weight: 700; color: var(--app-text-secondary, #9aa0a6); text-align: center; }
.ad-split-bar { flex: 1; height: 1.4rem; background: var(--app-surface-2, rgba(255,255,255,0.06)); border-radius: 0.8rem; overflow: hidden; }
.ad-split-fill { height: 100%; border-radius: 0.8rem; }
.ad-split-pace { width: 6rem; font-size: 1.3rem; font-weight: 700; color: var(--app-text-primary, #fff); text-align: right; font-variant-numeric: tabular-nums; }
.ad-notes { font-size: 1.4rem; color: var(--app-text-secondary, #c2c8ce); line-height: 1.5; margin: 0; }
.ad-actions { display: flex; gap: 1rem; margin-top: 2.4rem; }
.ad-act { flex: 1; padding: 1.3rem; border-radius: 1.2rem; border: 1px solid var(--app-border, rgba(255,255,255,0.1)); background: var(--app-bg-card, rgba(255,255,255,0.05)); color: var(--app-text-primary, #fff); font-family: inherit; font-size: 1.5rem; font-weight: 700; cursor: pointer; }

/* ── Fix: public profile tabs scroll (pv-content nested in non-flex #ppPrivateSection) ── */
#ppPrivateSection { flex: 1; min-height: 0; display: flex; flex-direction: column; }

/* ── Fix: Stats detail photo no longer cropped + tappable to zoom ── */
.sv-detail-photo { max-height: none !important; cursor: zoom-in; }
.sv-detail-photo img { object-fit: contain !important; height: auto !important; }
.ad-photo img { cursor: zoom-in; }

/* Fullscreen photo lightbox */
.sv-lightbox {
  position: fixed; inset: 0; z-index: 99999;
  background: rgba(0,0,0,0.92);
  display: flex; align-items: center; justify-content: center;
  padding: 20px; animation: adIn 0.18s ease;
}
.sv-lightbox img { max-width: 100%; max-height: 100%; border-radius: 8px; }

/* ── Community routes: Near me / Featured segment + heart like ── */
.trk-routes-seg { display: flex; gap: 0.6rem; margin: 0 0 1.2rem; }
.trk-routes-seg__btn {
  flex: 1; padding: 0.9rem; border-radius: 1rem;
  border: 1.5px solid var(--app-border, rgba(255,255,255,0.12));
  background: var(--app-bg-card, rgba(255,255,255,0.05));
  color: var(--app-text-secondary, #9aa0a6);
  font-family: inherit; font-size: 1.3rem; font-weight: 700; cursor: pointer;
}
.trk-routes-seg__btn--active { background: #ff5a1f; border-color: #ff5a1f; color: #fff; }
.trk-route-like {
  margin-left: auto; flex-shrink: 0;
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  background: none; border: none; cursor: pointer; padding: 4px 6px;
}
.trk-route-like__heart { font-size: 1.9rem; line-height: 1; color: var(--app-text-tertiary, #8b9197); transition: transform 0.15s, color 0.15s; }
.trk-route-like--on .trk-route-like__heart { color: #ff3b30; transform: scale(1.12); }
.trk-route-like__count { font-size: 1.1rem; font-weight: 700; color: var(--app-text-secondary, #9aa0a6); }

/* ── Notification deep-link affordance ── */
.hn-item--link { cursor: pointer; }
.hn-item--link:active { background: var(--app-surface-1, rgba(255,255,255,0.05)); }
.hn-item__chevron { margin-left: auto; align-self: center; flex-shrink: 0; font-size: 2.2rem; line-height: 1; color: var(--app-text-tertiary, #8b9197); padding: 0 4px 0 8px; }

/* ── Activity calendar (opened from the Home streak panel) ── */
.cal-overlay { position: fixed; inset: 0; z-index: 3600; background: var(--app-bg-base, #0f1114); display: flex; flex-direction: column; animation: adIn 0.2s ease; }
.cal-sheet { display: flex; flex-direction: column; height: 100%; padding: 0 1.4rem calc(2rem + env(safe-area-inset-bottom, 0px)); box-sizing: border-box; }
.cal-top { display: flex; justify-content: flex-end; padding-top: calc(1rem + env(safe-area-inset-top, 0px)); }
.cal-close { background: none; border: none; color: var(--app-text-secondary, #9aa0a6); font-size: 2.2rem; line-height: 1; cursor: pointer; padding: 0.4rem; }
.cal-header { display: flex; align-items: center; justify-content: space-between; margin: 0.2rem 0.2rem 1.4rem; }
.cal-header__title { font-size: 1.9rem; font-weight: 800; color: var(--app-text-primary, #fff); }
.cal-nav { background: var(--app-bg-card, rgba(255,255,255,0.06)); border: 1px solid var(--app-border, rgba(255,255,255,0.1)); color: var(--app-text-primary, #fff); width: 3.4rem; height: 3.4rem; border-radius: 50%; font-size: 1.9rem; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.cal-nav:disabled { opacity: 0.3; cursor: default; }
.cal-weekdays { display: grid; grid-template-columns: repeat(7, 1fr); gap: 0.4rem; margin-bottom: 0.6rem; }
.cal-weekdays span { text-align: center; font-size: 1.1rem; font-weight: 700; color: var(--app-text-tertiary, #8b9197); text-transform: uppercase; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 0.5rem; }
.cal-cell { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; border-radius: 50%; font-size: 1.4rem; font-weight: 600; color: var(--app-text-primary, #fff); background: var(--app-bg-card, rgba(255,255,255,0.05)); cursor: pointer; }
.cal-cell--empty { background: none; cursor: default; }
.cal-cell--future { opacity: 0.32; cursor: default; }
.cal-cell--active { background: #f97316; color: #fff; }
.cal-cell--today { box-shadow: inset 0 0 0 2px var(--app-text-primary, #fff); }
.cal-cell--active.cal-cell--today { box-shadow: inset 0 0 0 2px #fff; }
.cal-cell--sel { outline: 2px solid #f97316; outline-offset: 2px; }
.cal-detail { margin-top: 1.6rem; overflow-y: auto; flex: 1; min-height: 0; }
.cal-detail__date { font-size: 1.5rem; font-weight: 800; color: var(--app-text-primary, #fff); margin-bottom: 1rem; }
.cal-summary { display: flex; gap: 0.8rem; margin-bottom: 1.2rem; }
.cal-summary__item { flex: 1; background: var(--app-bg-card, rgba(255,255,255,0.05)); border-radius: 1rem; padding: 1rem 0.6rem; text-align: center; }
.cal-summary__val { font-size: 1.7rem; font-weight: 800; color: var(--app-text-primary, #fff); }
.cal-summary__lbl { font-size: 1.05rem; color: var(--app-text-tertiary, #8b9197); margin-top: 0.2rem; }
.cal-act { display: flex; align-items: center; gap: 1rem; padding: 1rem; border-radius: 1rem; background: var(--app-bg-card, rgba(255,255,255,0.05)); margin-bottom: 0.6rem; cursor: pointer; }
.cal-act__icon { font-size: 2rem; flex-shrink: 0; }
.cal-act__main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cal-act__title { font-size: 1.4rem; font-weight: 700; color: var(--app-text-primary, #fff); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-act__meta { font-size: 1.2rem; color: var(--app-text-secondary, #9aa0a6); }
.cal-act__chevron { font-size: 2rem; color: var(--app-text-tertiary, #8b9197); flex-shrink: 0; }
.cal-empty { text-align: center; color: var(--app-text-tertiary, #8b9197); padding: 2rem; font-size: 1.3rem; }

/* ── Public profile: tappable activities open the detail screen ── */
.pv-act-item { cursor: pointer; transition: background 0.15s, transform 0.1s; }
.pv-act-item:active { transform: scale(0.99); opacity: 0.85; }

/* ── Stats › Progress: refined chart panels (esp. light theme) ── */
.sv-chart-wrap {
  position: relative;
  height: 188px;
  width: 100%;
  border-radius: 16px;
  padding: 14px 12px 10px;
  box-sizing: border-box;
  overflow: hidden;
}
body.light-mode .sv-chart-wrap {
  background: linear-gradient(180deg, #ffffff 0%, #f7f9fb 100%);
  border: 1px solid rgba(15, 23, 42, 0.06);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 20px rgba(15, 23, 42, 0.05);
}
body.night-mode .sv-chart-wrap {
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

/* ── Friends: My link modal (in-app QR + copy + share) ── */
.mlink-overlay { position: fixed; inset: 0; z-index: 5000; background: rgba(0,0,0,0.55); display: flex; align-items: flex-end; justify-content: center; animation: adIn 0.2s ease; }
.mlink-sheet { position: relative; width: 100%; max-width: 460px; background: var(--app-bg-base, #14181c); border-radius: 2rem 2rem 0 0; padding: 2.2rem 2rem calc(2.4rem + env(safe-area-inset-bottom, 0px)); text-align: center; box-sizing: border-box; }
.mlink-close { position: absolute; top: 1.2rem; right: 1.4rem; background: none; border: none; color: var(--app-text-secondary, #9aa0a6); font-size: 2rem; line-height: 1; cursor: pointer; }
.mlink-title { font-size: 1.9rem; font-weight: 800; color: var(--app-text-primary, #fff); margin: 0 0 0.4rem; }
.mlink-sub { font-size: 1.3rem; color: var(--app-text-secondary, #9aa0a6); margin: 0 0 1.8rem; }
.mlink-qr { width: 190px; height: 190px; margin: 0 auto 1.8rem; border-radius: 1.4rem; background: #fff; display: flex; align-items: center; justify-content: center; overflow: hidden; padding: 10px; box-sizing: border-box; }
.mlink-qr__img { width: 100%; height: 100%; image-rendering: pixelated; }
.mlink-qr__msg { font-size: 1.3rem; color: #555; padding: 1.2rem; }
.mlink-actions { display: flex; gap: 1rem; }
.mlink-btn { flex: 1; padding: 1.1rem; border-radius: 1.2rem; border: 1.5px solid var(--app-border, rgba(255,255,255,0.12)); background: var(--app-bg-card, rgba(255,255,255,0.06)); color: var(--app-text-primary, #fff); font-family: inherit; font-size: 1.4rem; font-weight: 700; cursor: pointer; }
.mlink-btn--primary { background: #00c46a; border-color: #00c46a; color: #fff; }

/* ── Friends: QR scanner ── */
.qrscan-overlay { position: fixed; inset: 0; z-index: 5000; background: #000; display: flex; align-items: center; justify-content: center; animation: adIn 0.2s ease; }
.qrscan-sheet { position: relative; width: 100%; max-width: 460px; padding: calc(2rem + env(safe-area-inset-top, 0px)) 2rem calc(2.4rem + env(safe-area-inset-bottom, 0px)); text-align: center; box-sizing: border-box; }
.qrscan-close { position: absolute; top: calc(1.4rem + env(safe-area-inset-top, 0px)); right: 1.6rem; background: rgba(255,255,255,0.15); border: none; color: #fff; font-size: 1.8rem; width: 3.4rem; height: 3.4rem; border-radius: 50%; cursor: pointer; z-index: 2; }
.qrscan-title { color: #fff; font-size: 1.9rem; font-weight: 800; margin: 0 0 1.6rem; }
.qrscan-viewport { position: relative; width: 100%; aspect-ratio: 1; max-width: 320px; margin: 0 auto 1.4rem; border-radius: 1.6rem; overflow: hidden; background: #111; }
.qrscan-viewport video { width: 100%; height: 100%; object-fit: cover; }
.qrscan-frame { position: absolute; inset: 14%; border: 3px solid rgba(255,255,255,0.9); border-radius: 1.2rem; }
.qrscan-hint { color: rgba(255,255,255,0.8); font-size: 1.3rem; margin: 0 0 1.4rem; }

/* ── Profile: Activity Types horizontal ranking bars (restored) ── */
.pv-types-wrap { display: flex; flex-direction: column; gap: 10px; padding: 0 16px 16px; }
.pv-type-row { display: flex; align-items: center; gap: 10px; }
.pv-type-row__label { flex: 0 0 38%; font-size: 1.25rem; color: var(--app-text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pv-type-row__track { flex: 1; height: 12px; background: var(--app-surface-2, rgba(128,128,128,0.12)); border-radius: 6px; overflow: hidden; }
.pv-type-row__bar { height: 100%; background: var(--app-sport-other, var(--app-text-primary, #1a1a1a)); border-radius: 6px; opacity: 0.85; transition: width 0.5s cubic-bezier(0.4,0,0.2,1); }
.pv-type-row__count { flex: 0 0 auto; min-width: 22px; text-align: right; font-size: 1.3rem; font-weight: 700; color: var(--app-text-primary); }

/* ── My link QR: centered app logo ── */
.mlink-qr__inner { position: relative; width: 100%; height: 100%; }
.mlink-qr__logo { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 26%; height: 26%; background: #fff; border-radius: 22%; box-shadow: 0 0 0 4px #fff; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.mlink-qr__logo img { width: 100%; height: 100%; object-fit: contain; border-radius: 18%; }

/* ── My link QR: Telegram-style dotted SVG + periodic logo spin ── */
.mlink-qr__svg { display: block; width: 100%; height: 100%; }
.mlink-qr__logo img { animation: mlinkLogoSpin 5s ease-in-out infinite; }
@keyframes mlinkLogoSpin {
  0%, 72% { transform: rotate(0deg); }
  90%, 100% { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
  .mlink-qr__logo img { animation: none; }
}

/* ── Full-screen comments view (keyboard-safe) ── */
.cv-overlay { position: fixed; inset: 0; z-index: 100000; background: var(--app-bg-base, #0f1114); animation: adIn 0.2s ease; }
.cv-sheet { position: absolute; top: 0; left: 0; right: 0; height: 100%; display: flex; flex-direction: column; will-change: height, transform; }
.cv-header { display: flex; align-items: center; gap: 6px; padding: calc(12px + env(safe-area-inset-top, 0px)) 12px 12px; border-bottom: 1px solid var(--app-border, rgba(255,255,255,0.08)); flex-shrink: 0; }
.cv-back { background: none; border: none; color: var(--app-text-primary, #fff); font-size: 2.8rem; line-height: 1; cursor: pointer; width: 36px; padding: 0; }
.cv-title { font-size: 1.7rem; font-weight: 700; color: var(--app-text-primary, #fff); }
.cv-list { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 14px 16px; display: flex; flex-direction: column; gap: 14px; }
.cv-empty { color: var(--app-text-tertiary, rgba(255,255,255,0.5)); text-align: center; margin-top: 32px; font-size: 1.4rem; }
.cv-item { display: flex; flex-direction: column; gap: 2px; }
.cv-author { font-weight: 700; color: var(--app-text-primary, #fff); font-size: 1.35rem; }
.cv-text { color: var(--app-text-secondary, rgba(255,255,255,0.75)); font-size: 1.45rem; line-height: 1.4; word-break: break-word; }
.cv-form { flex-shrink: 0; display: flex; align-items: center; gap: 8px; padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--app-border, rgba(255,255,255,0.08)); background: var(--app-bg-card, #1a1f23); }
.cv-input { flex: 1; min-width: 0; background: var(--app-surface-1, rgba(255,255,255,0.06)); border: 1px solid var(--app-border, rgba(255,255,255,0.12)); border-radius: 22px; padding: 11px 16px; color: var(--app-text-primary, #fff); font-size: 1.6rem; font-family: inherit; outline: none; }
.cv-send { flex-shrink: 0; width: 44px; height: 44px; border-radius: 50%; border: none; background: #00c46a; color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; }

/* ── Saved route shared in community: frame + flag + like count ── */
.trk-route-card--community { border: 1.5px solid rgba(0,196,106,0.55); box-shadow: 0 0 0 1px rgba(0,196,106,0.15); }
.trk-route-card__cflag { display: inline-block; margin-left: 8px; padding: 1px 8px; font-size: 1rem; font-weight: 700; color: #00c46a; background: rgba(0,196,106,0.14); border-radius: 999px; vertical-align: middle; }
.trk-route-card__likes { display: inline-flex; align-items: center; gap: 4px; font-size: 1.3rem; font-weight: 700; color: var(--app-text-secondary, #9aa0a6); padding: 0 6px; white-space: nowrap; }
.trk-route-card__likes-heart { color: #ff4d6d; font-size: 1.4rem; }
.trk-route-card__owner { cursor: pointer; }

/* ── Confirm delete dialog ── */
.trk-confirm { max-width: 380px; }
.trk-confirm__body { padding: 24px 22px 20px; text-align: center; }
.trk-confirm__icon { font-size: 3.2rem; margin-bottom: 6px; }
.trk-confirm__title { font-size: 1.85rem; font-weight: 800; color: var(--app-text-primary, #fff); margin: 0 0 8px; }
.trk-confirm__text { font-size: 1.4rem; line-height: 1.45; color: var(--app-text-secondary, #9aa0a6); margin: 0 0 20px; }
.trk-confirm__text b { color: #00c46a; }
.trk-confirm__actions { display: flex; gap: 10px; }
.trk-confirm__btn { flex: 1; padding: 13px; border-radius: 14px; font-family: inherit; font-size: 1.5rem; font-weight: 700; cursor: pointer; border: none; }
.trk-confirm__btn--cancel { background: var(--app-surface-1, rgba(255,255,255,0.08)); color: var(--app-text-primary, #fff); }
.trk-confirm__btn--danger { background: #e5484d; color: #fff; }

/* ── Home streak carousel (swipeable: streak + weekly overview) ── */
.home-streak-carousel { margin: 10px 16px 0; }
.hsc-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.hsc-track::-webkit-scrollbar { display: none; }
.hsc-slide { flex: 0 0 100%; scroll-snap-align: start; box-sizing: border-box; background: var(--app-surface-1, rgba(255,255,255,0.04)); border: 1px solid var(--app-border, rgba(255,255,255,0.08)); border-radius: 20px; padding: 14px 16px; min-height: 124px; }
.hsc-streak__top { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.hsc-flame { position: relative; width: 30px; height: 34px; flex-shrink: 0; }
.hsc-flame svg { width: 100%; height: 100%; }
.hsc-flame__num { position: absolute; left: 0; right: 0; top: 13px; text-align: center; font-size: 1.2rem; font-weight: 800; color: #fff; }
.hsc-streak__title { font-size: 1.55rem; font-weight: 700; color: var(--app-text-primary, #fff); }
.hsc-week { display: flex; justify-content: space-between; gap: 4px; }
.hday-col { display: flex; flex-direction: column; align-items: center; gap: 6px; flex: 1; }
.hday-label { font-size: 1.05rem; color: var(--app-text-tertiary, rgba(255,255,255,0.45)); font-weight: 600; }
.hday-label--today { color: #f97316; }
.hday { width: 38px; height: 38px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--app-surface-2, rgba(255,255,255,0.08)); }
.hday-num { font-size: 1.3rem; font-weight: 700; color: var(--app-text-secondary, rgba(255,255,255,0.7)); }
.hday-ico { font-size: 1.5rem; line-height: 1; }
.hday--active { color: #fff; cursor: pointer; }
.hday--today { background: var(--app-text-primary, #111); }
.hday--today .hday-num { color: var(--app-bg-base, #fff); }
.hday--future { opacity: 0.4; }
.hsc-week-ov__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.hsc-week-ov__title { font-size: 1.55rem; font-weight: 700; color: var(--app-text-primary, #fff); }
.hsc-week-ov__more { background: none; border: none; color: #f97316; font-size: 1.3rem; font-weight: 700; cursor: pointer; font-family: inherit; }
.hsc-week-ov__stats { display: flex; justify-content: space-between; gap: 8px; }
.hsc-ovstat { display: flex; flex-direction: column; gap: 3px; }
.hsc-ovstat__v { font-size: 2.1rem; font-weight: 800; color: var(--app-text-primary, #fff); }
.hsc-ovstat__l { font-size: 1.15rem; color: var(--app-text-tertiary, rgba(255,255,255,0.5)); }
.hsc-dots { display: flex; justify-content: center; gap: 6px; margin-top: 9px; }
.hsc-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--app-text-tertiary, rgba(255,255,255,0.35)); opacity: 0.45; transition: all 0.2s ease; }
.hsc-dot--active { opacity: 1; width: 18px; border-radius: 3px; background: #f97316; }

/* ── Day details overlay ── */
.dd-overlay { position: fixed; inset: 0; z-index: 9700; background: rgba(0,0,0,0.5); display: flex; align-items: flex-end; justify-content: center; animation: adIn 0.2s ease; }
.dd-sheet { width: 100%; max-width: 480px; background: var(--app-bg-base, #14181c); border-radius: 22px 22px 0 0; padding: 8px 0 calc(16px + env(safe-area-inset-bottom, 0px)); max-height: 80vh; display: flex; flex-direction: column; }
.dd-header { display: flex; align-items: center; gap: 6px; padding: 8px 14px 12px; }
.dd-back { background: none; border: none; color: var(--app-text-primary, #fff); font-size: 2.6rem; line-height: 1; cursor: pointer; width: 36px; padding: 0; }
.dd-title { font-size: 1.7rem; font-weight: 700; color: var(--app-text-primary, #fff); text-transform: capitalize; }
.dd-summary { display: flex; justify-content: space-around; padding: 6px 16px 14px; border-bottom: 1px solid var(--app-border, rgba(255,255,255,0.08)); }
.dd-stat { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.dd-stat-v { font-size: 1.9rem; font-weight: 800; color: var(--app-text-primary, #fff); }
.dd-stat-l { font-size: 1.15rem; color: var(--app-text-tertiary, rgba(255,255,255,0.5)); }
.dd-list { overflow-y: auto; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.dd-empty { text-align: center; color: var(--app-text-tertiary, rgba(255,255,255,0.5)); padding: 26px; font-size: 1.4rem; }
.dd-item { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 14px; background: var(--app-surface-1, rgba(255,255,255,0.04)); cursor: pointer; }
.dd-item-icon { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.6rem; flex-shrink: 0; }
.dd-item-main { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.dd-item-title { font-size: 1.5rem; font-weight: 700; color: var(--app-text-primary, #fff); }
.dd-item-meta { font-size: 1.25rem; color: var(--app-text-secondary, rgba(255,255,255,0.6)); }
.dd-item-chev { font-size: 2rem; color: var(--app-text-tertiary, rgba(255,255,255,0.4)); }

/* ── Home pull-to-refresh (app-styled spinner) ── */
.home-ptr { position: absolute; top: 0; left: 50%; transform: translateX(-50%) translateY(0); margin-top: calc(env(safe-area-inset-top, 0px) + 6px); z-index: 60; width: 40px; height: 40px; border-radius: 50%; background: var(--app-bg-card, #1a1f23); box-shadow: 0 6px 18px rgba(0,0,0,0.28); display: flex; align-items: center; justify-content: center; opacity: 0; pointer-events: none; transition: opacity 0.2s ease; }
.home-ptr__spinner { width: 20px; height: 20px; border-radius: 50%; border: 2.5px solid var(--app-surface-2, rgba(255,255,255,0.18)); border-top-color: var(--color-brand--2, #00c46a); box-sizing: border-box; }
.home-ptr--active .home-ptr__spinner { animation: hptrspin 0.7s linear infinite; }
@keyframes hptrspin { to { transform: rotate(360deg); } }

/* ── Home section switcher (Home / Explore — style 3, sticky auto-hide) ── */
.home-switcher { position: sticky; top: 0; z-index: 30; display: flex; justify-content: center; gap: 40px; padding: 10px 0 14px; margin: 4px 0 2px; background: var(--color-dark--1, #f1f1f4); transition: transform .26s ease; will-change: transform; }
.home-switcher--hidden { transform: translateY(-120%); }
.home-switcher__tab { position: relative; font-size: 1.55rem; font-weight: 600; color: var(--app-text-tertiary, rgba(255,255,255,0.4)); background: none; border: none; cursor: pointer; padding: 2px 4px 0; font-family: inherit; -webkit-tap-highlight-color: transparent; transition: color .2s ease; }
.home-switcher__tab--active { color: var(--app-text-primary, #fff); }
.home-switcher__dot { position: absolute; bottom: 4px; left: 0; width: 6px; height: 6px; border-radius: 50%; background: #f97316; transform: translateX(-50%); transition: left .22s cubic-bezier(.4,0,.2,1); }

/* ── Views (impression) counter — non-interactive, near share ── */
.home-card__action--views { cursor: default; pointer-events: none; }

/* ── Activity detail: hero controls (bookmark + options) ── */
.ad-hero { position: relative; }
.ad-hero-ctrls { position: absolute; top: calc(env(safe-area-inset-top, 0px) + 12px); right: 14px; display: flex; gap: 8px; z-index: 6; }
.ad-ctrl { width: 38px; height: 38px; border-radius: 50%; border: none; background: rgba(0,0,0,0.45); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.ad-ctrl:active { transform: scale(0.92); }

/* visibility badge (author-only) */
.ad-vis { display: inline-flex; align-items: center; gap: 4px; margin: 2px 0 4px; padding: 4px 10px; border-radius: 999px; background: var(--app-surface-1, rgba(255,255,255,0.06)); color: var(--app-text-secondary, rgba(255,255,255,0.7)); font-size: 1.2rem; font-weight: 600; align-self: flex-start; width: -moz-fit-content; width: fit-content; }

/* toast */
.ad-toast { position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom, 0px) + 80px); transform: translateX(-50%) translateY(12px); z-index: 100001; background: #222; color: #fff; padding: 11px 18px; border-radius: 12px; font-size: 1.35rem; font-weight: 600; box-shadow: 0 8px 24px rgba(0,0,0,0.4); opacity: 0; transition: opacity .2s ease, transform .2s ease; pointer-events: none; max-width: 80vw; text-align: center; }
.ad-toast--show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* options menu (author-only) */
.adm-overlay { position: fixed; inset: 0; z-index: 100000; background: rgba(0,0,0,0.5); display: flex; align-items: flex-end; justify-content: center; animation: adIn .2s ease; }
.adm-sheet { width: 100%; max-width: 480px; background: var(--app-bg-base, #14181c); border-radius: 22px 22px 0 0; padding: 8px 10px calc(16px + env(safe-area-inset-bottom, 0px)); }
.adm-grab { width: 38px; height: 4px; border-radius: 2px; background: var(--app-border, rgba(255,255,255,0.2)); margin: 6px auto 10px; }
.adm-section-title { font-size: 1.15rem; font-weight: 700; color: var(--app-text-tertiary, rgba(255,255,255,0.45)); letter-spacing: .04em; padding: 4px 12px 8px; }
.adm-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px; border: none; background: none; cursor: pointer; border-radius: 14px; text-align: left; font-family: inherit; }
.adm-row:active { background: var(--app-surface-1, rgba(255,255,255,0.05)); }
.adm-row--active { background: var(--app-surface-1, rgba(255,255,255,0.06)); }
.adm-ic { font-size: 1.7rem; width: 28px; text-align: center; flex-shrink: 0; }
.adm-txt { flex: 1; display: flex; flex-direction: column; gap: 1px; }
.adm-t { font-size: 1.5rem; font-weight: 600; color: var(--app-text-primary, #fff); }
.adm-s { font-size: 1.2rem; color: var(--app-text-tertiary, rgba(255,255,255,0.5)); }
.adm-check { color: #16c47f; font-size: 1.6rem; font-weight: 700; width: 20px; text-align: center; }
.adm-divider { height: 1px; background: var(--app-border, rgba(255,255,255,0.08)); margin: 6px 12px; }
.adm-row--danger .adm-t { color: #ef4444; }
.adm-toggle { width: 44px; height: 26px; border-radius: 13px; background: rgba(120,120,128,0.4); position: relative; flex-shrink: 0; transition: background .2s; }
.adm-toggle--on { background: #16c47f; }
.adm-knob { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: left .2s; }
.adm-toggle--on .adm-knob { left: 21px; }

/* ── Reel creator: 'from workout' + grid + light theme ── */
.home-reel-creator__workout { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 14px; padding: 12px 20px; border-radius: 14px; border: 1.5px solid var(--color-brand--2, #00c46a); background: rgba(0,196,106,0.12); color: var(--color-brand--2, #00c46a); font-size: 1.4rem; font-weight: 700; cursor: pointer; font-family: inherit; }
.home-reel-creator__workout:active { transform: scale(0.97); }

.home-reel-creator__composing { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; color: #fff; font-size: 1.4rem; font-weight: 600; }
body.light-mode .home-reel-creator__composing { color: #16181c; }

/* alignment grid (rule of thirds + center) */
.home-reel-creator__grid { position: absolute; inset: 0; pointer-events: none; z-index: 4; }
.home-reel-creator__grid::before, .home-reel-creator__grid::after { content: ""; position: absolute; inset: 0; }
.home-reel-creator__grid::before { background-image: linear-gradient(rgba(255,255,255,0.5) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.5) 1px, transparent 1px); background-size: 33.333% 33.333%; background-position: center; }
.home-reel-creator__grid::after { background-image: linear-gradient(rgba(255,200,0,0.85) 1px, transparent 1px), linear-gradient(90deg, rgba(255,200,0,0.85) 1px, transparent 1px); background-size: 100% 50%, 50% 100%; background-position: center; }
.home-reel-creator__tool-btn--active { background: rgba(255,255,255,0.22) !important; border-radius: 12px; }

/* light theme for the creator chrome */
body.light-mode .home-reel-creator { background: #f4f5f7; }
body.light-mode .home-reel-creator__title { color: #16181c; }
body.light-mode .home-reel-creator__close { color: #16181c; }
body.light-mode .home-reel-creator__pick { color: #5a5d63; border-color: rgba(0,0,0,0.18); }
body.light-mode .home-reel-creator__hint { color: #8a8d93; }
body.light-mode .home-reel-creator__caption { color: #16181c; }

/* workout picker */
.rwp-overlay { position: fixed; inset: 0; z-index: 100002; background: rgba(0,0,0,0.55); display: flex; align-items: flex-end; justify-content: center; animation: adIn .2s ease; }
.rwp-sheet { width: 100%; max-width: 480px; max-height: 76vh; background: var(--app-bg-base, #14181c); border-radius: 22px 22px 0 0; padding: 8px 0 calc(14px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; }
.rwp-header { display: flex; align-items: center; justify-content: space-between; padding: 12px 18px; }
.rwp-title { font-size: 1.65rem; font-weight: 700; color: var(--app-text-primary, #fff); }
.rwp-close { background: none; border: none; font-size: 1.9rem; color: var(--app-text-secondary, rgba(255,255,255,0.6)); cursor: pointer; }
.rwp-list { overflow-y: auto; padding: 4px 10px; display: flex; flex-direction: column; gap: 6px; }
.rwp-item { display: flex; align-items: center; gap: 12px; padding: 11px; border: none; background: none; border-radius: 14px; cursor: pointer; text-align: left; font-family: inherit; }
.rwp-item:active { background: var(--app-surface-1, rgba(255,255,255,0.05)); }
.rwp-ic { width: 42px; height: 42px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.7rem; flex-shrink: 0; }
.rwp-main { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.rwp-name { font-size: 1.45rem; font-weight: 700; color: var(--app-text-primary, #fff); }
.rwp-meta { font-size: 1.2rem; color: var(--app-text-secondary, rgba(255,255,255,0.6)); }
.rwp-chev { font-size: 2rem; color: var(--app-text-tertiary, rgba(255,255,255,0.4)); }
.rwp-empty { text-align: center; color: var(--app-text-tertiary, rgba(255,255,255,0.5)); padding: 26px; font-size: 1.4rem; }

/* view-activity pill in viewer */
.home-reel-viewer__activity { position: absolute; left: 50%; bottom: 92px; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 7px; padding: 10px 18px; border-radius: 999px; border: none; background: rgba(0,0,0,0.55); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); color: #fff; font-size: 1.35rem; font-weight: 700; cursor: pointer; z-index: 7; }
.home-reel-viewer__activity:active { transform: translateX(-50%) scale(0.96); }

/* ── Reel creator: smart snapping guides (replaces static grid) ── */
.home-reel-creator__guides { position: absolute; inset: 0; pointer-events: none; z-index: 6; }
.rg-line { position: absolute; background: #f97316; box-shadow: 0 0 6px rgba(249,115,22,0.7); opacity: 0.95; }
.rg-line--v { top: 0; bottom: 0; width: 1.5px; transform: translateX(-50%); }
.rg-line--h { left: 0; right: 0; height: 1.5px; transform: translateY(-50%); }

/* ── Reel creator: audience selector ── */
.home-reel-creator__audience { display: flex; gap: 6px; background: rgba(120,120,128,0.24); padding: 4px; border-radius: 999px; }
body.light-mode .home-reel-creator__audience { background: rgba(0,0,0,0.06); }
.rca-opt { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border: none; background: none; border-radius: 999px; color: rgba(255,255,255,0.75); font-size: 1.3rem; font-weight: 700; cursor: pointer; font-family: inherit; }
body.light-mode .rca-opt { color: #5a5d63; }
.rca-opt--active { background: #fff; color: #16181c; }
body.light-mode .rca-opt--active { background: var(--color-brand--2, #00c46a); color: #fff; }

/* ── Reel creator: sticker layers ── */
.home-reel-creator__stickers { position: absolute; inset: 0; z-index: 5; }
.rst-layer { position: absolute; transform-origin: center; touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none; }
.rst-layer--sel { outline: 2px dashed rgba(249,115,22,0.9); outline-offset: 6px; border-radius: 6px; }
.rst-emoji { font-size: 64px; line-height: 1; filter: drop-shadow(0 2px 6px rgba(0,0,0,0.25)); pointer-events: none; }
.rst-pill { display: inline-block; white-space: nowrap; background: #fff; color: #16181c; font-size: 30px; font-weight: 700; padding: 8px 16px; border-radius: 999px; box-shadow: 0 4px 14px rgba(0,0,0,0.18); pointer-events: none; }
.rst-del { position: absolute; top: -14px; right: -14px; width: 28px; height: 28px; border-radius: 50%; border: none; background: #16181c; color: #fff; font-size: 14px; display: none; align-items: center; justify-content: center; cursor: pointer; line-height: 1; }
.rst-layer--sel .rst-del { display: flex; }

/* ── Reel creator: sticker tray ── */
.rst-tray { position: fixed; inset: 0; z-index: 100003; background: rgba(0,0,0,0.5); display: flex; align-items: flex-end; justify-content: center; animation: adIn .2s ease; }
.rst-tray__sheet { width: 100%; max-width: 480px; max-height: 72vh; overflow-y: auto; background: var(--app-bg-base, #1c2024); border-radius: 22px 22px 0 0; padding: 10px 16px calc(18px + env(safe-area-inset-bottom, 0px)); }
.rst-tray__bar { width: 40px; height: 4px; border-radius: 2px; background: var(--app-text-tertiary, rgba(255,255,255,0.3)); margin: 4px auto 14px; }
.rst-tray__row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.rst-opt { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border: none; border-radius: 16px; background: var(--app-surface-1, rgba(255,255,255,0.06)); color: var(--app-text-primary, #fff); font-size: 1.45rem; font-weight: 700; cursor: pointer; font-family: inherit; }
.rst-opt__ic { font-size: 1.8rem; font-weight: 800; }
.rst-tray__title { font-size: 1.3rem; font-weight: 700; color: var(--app-text-secondary, rgba(255,255,255,0.6)); margin: 18px 4px 8px; text-transform: uppercase; letter-spacing: 0.04em; }
.rst-tray__emoji { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.rst-emoji-btn { aspect-ratio: 1; border: none; background: var(--app-surface-1, rgba(255,255,255,0.05)); border-radius: 12px; font-size: 2.4rem; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.rst-emoji-btn:active { transform: scale(0.9); }
.rst-tray__note { text-align: center; font-size: 1.15rem; color: var(--app-text-tertiary, rgba(255,255,255,0.45)); margin: 16px 0 0; }

/* ── Reel: text layer ── */
.rst-layer { max-width: 86%; }
.rst-text { display: block; color: #fff; white-space: pre-wrap; word-break: break-word; line-height: 1.18; pointer-events: none; }

/* ── Reel: Instagram-style text editor ── */
.rte-overlay { position: fixed; inset: 0; z-index: 100004; background: rgba(0,0,0,0.55); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); display: flex; flex-direction: column; animation: adIn .18s ease; }
.rte-top { display: flex; align-items: center; justify-content: space-between; padding: calc(12px + env(safe-area-inset-top, 0px)) 16px 8px; }
.rte-top-tools { display: flex; gap: 8px; }
.rte-btn { background: none; border: none; color: #fff; font-size: 1.6rem; font-weight: 600; cursor: pointer; padding: 6px 8px; font-family: inherit; }
.rte-btn--done { font-weight: 800; }
.rte-icn { width: 38px; height: 38px; border-radius: 50%; border: none; background: rgba(255,255,255,0.18); color: #fff; font-size: 1.7rem; font-weight: 800; cursor: pointer; }
.rte-stage { flex: 1; display: flex; align-items: center; justify-content: center; padding: 20px; }
.rte-input { min-width: 40px; max-width: 90%; outline: none; font-size: 32px; line-height: 1.2; text-align: center; color: #fff; caret-color: #fff; }
.rte-fonts { display: flex; gap: 8px; overflow-x: auto; padding: 10px 16px; scrollbar-width: none; }
.rte-fonts::-webkit-scrollbar { display: none; }
.rte-font { flex: 0 0 auto; padding: 7px 16px; border-radius: 999px; border: 1.5px solid rgba(255,255,255,0.4); background: rgba(0,0,0,0.3); color: #fff; font-size: 1.4rem; cursor: pointer; }
.rte-font--on { background: #fff; color: #16181c; border-color: #fff; }
.rte-palette { padding: 6px 16px calc(18px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: 12px; }
.rte-hue { height: 26px; border-radius: 13px; cursor: pointer; touch-action: none; background: linear-gradient(to right, #fff, #000 6%, hsl(0,85%,55%) 12%, hsl(45,85%,55%), hsl(90,85%,55%), hsl(160,85%,55%), hsl(200,85%,55%), hsl(260,85%,55%), hsl(320,85%,55%), hsl(360,85%,55%)); border: 2px solid rgba(255,255,255,0.5); }
.rte-presets { display: flex; gap: 8px; justify-content: space-between; }
.rte-swatch { width: 30px; height: 30px; border-radius: 50%; border: 2px solid rgba(255,255,255,0.7); cursor: pointer; flex: 0 0 auto; }

/* ── Reel: draw ── */
.home-reel-creator__draw { position: absolute; inset: 0; z-index: 4; pointer-events: none; touch-action: none; }
.home-reel-creator__draw--active { z-index: 9; pointer-events: auto; }
.rdraw-bar { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 100005; display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 999px; background: rgba(0,0,0,0.7); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); flex-wrap: wrap; max-width: 92vw; justify-content: center; }
.rdraw-c { width: 26px; height: 26px; border-radius: 50%; border: 2px solid rgba(255,255,255,0.6); cursor: pointer; }
.rdraw-x { width: 34px; height: 34px; border-radius: 50%; border: none; background: rgba(255,255,255,0.16); color: #fff; font-size: 1.5rem; cursor: pointer; }
.rdraw-x--on { background: #fff; color: #16181c; }
.rdraw-done { border: none; background: #fff; color: #16181c; font-weight: 800; font-size: 1.4rem; padding: 8px 16px; border-radius: 999px; cursor: pointer; font-family: inherit; }

/* ── Reel text editor: vertical size slider (IG-style) ── */
.rte-stage { position: relative; }
.rte-size { position: absolute; left: 10px; top: 50%; transform: translateY(-50%) rotate(270deg); transform-origin: center; width: 190px; height: 5px; -webkit-appearance: none; appearance: none; background: rgba(255,255,255,0.45); border-radius: 3px; z-index: 3; }
.rte-size::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; border-radius: 50%; background: #fff; cursor: pointer; box-shadow: 0 1px 4px rgba(0,0,0,0.4); }
.rte-size::-moz-range-thumb { width: 22px; height: 22px; border: none; border-radius: 50%; background: #fff; }

/* ── Background tracking guide (native) ── */
.bgg-overlay { position: fixed; inset: 0; z-index: 100010; background: rgba(0,0,0,0.55); display: flex; align-items: flex-end; justify-content: center; animation: adIn .2s ease; }
.bgg-sheet { width: 100%; max-width: 480px; max-height: 86vh; overflow-y: auto; background: var(--app-bg-base, #1c2024); border-radius: 22px 22px 0 0; padding: 10px 20px calc(20px + env(safe-area-inset-bottom, 0px)); }
.bgg-bar { width: 40px; height: 4px; border-radius: 2px; background: var(--app-text-tertiary, rgba(255,255,255,0.3)); margin: 4px auto 14px; }
.bgg-title { font-size: 1.9rem; font-weight: 800; color: var(--app-text-primary, #fff); margin: 0 0 10px; }
.bgg-p { font-size: 1.35rem; line-height: 1.5; color: var(--app-text-secondary, rgba(255,255,255,0.65)); margin: 0 0 14px; }
.bgg-check { background: var(--app-surface-1, rgba(255,255,255,0.05)); border-radius: 14px; padding: 12px 14px; margin-bottom: 14px; }
.bgg-check__title { font-size: 1.35rem; font-weight: 700; color: var(--app-text-primary, #fff); margin: 0 0 8px; }
.bgg-list { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 10px; font-size: 1.3rem; color: var(--app-text-secondary, rgba(255,255,255,0.7)); }
.bgg-list b { color: var(--app-text-primary, #fff); }
.bgg-path { display: inline-block; margin-top: 2px; font-size: 1.15rem; color: var(--app-text-tertiary, rgba(255,255,255,0.45)); }
.bgg-btn { width: 100%; padding: 13px; border: none; border-radius: 14px; background: var(--color-brand--2, #00c46a); color: #fff; font-size: 1.5rem; font-weight: 800; cursor: pointer; font-family: inherit; margin-bottom: 10px; }
.bgg-note { font-size: 1.2rem; color: var(--app-text-tertiary, rgba(255,255,255,0.45)); text-align: center; margin: 0 0 10px; }
.bgg-close { width: 100%; padding: 11px; border: none; border-radius: 14px; background: var(--app-surface-1, rgba(255,255,255,0.07)); color: var(--app-text-primary, #fff); font-size: 1.4rem; font-weight: 700; cursor: pointer; font-family: inherit; }

/* ── Health import picker extras ── */
.hi-demo { text-align: center; font-size: 1.15rem; color: var(--app-text-tertiary, rgba(255,255,255,0.45)); margin: 2px 0 6px; }
.rwp-item.hi-done { opacity: 0.45; }
.rwp-item.hi-done .rwp-chev { color: var(--color-brand--2, #00c46a); font-weight: 800; }

/* ── Health import diagnostics ── */
.hi-diag { background: var(--app-surface-1, rgba(255,255,255,0.05)); border-radius: 14px; padding: 12px 14px; margin: 8px 12px 4px; }
.hi-diag__t { font-size: 1.3rem; font-weight: 700; color: var(--app-text-primary, #fff); margin: 0 0 8px; }
.hi-diag__p { font-size: 1.2rem; line-height: 1.5; color: var(--app-text-secondary, rgba(255,255,255,0.65)); margin: 0 0 8px; }
.hi-diag__p b { color: var(--app-text-primary, #fff); }
.hi-openhc { width: 100%; margin-top: 4px; padding: 11px; border: none; border-radius: 12px; background: var(--color-brand--2, #00c46a); color: #fff; font-size: 1.35rem; font-weight: 800; cursor: pointer; font-family: inherit; }

/* ── Activity detail: recording device badge (Strava-style) ── */
.ad-device { display: inline-flex; align-items: center; gap: 7px; margin: -6px 0 12px; padding: 6px 12px; border-radius: 999px; background: var(--app-surface-1, rgba(255,255,255,0.05)); color: var(--app-text-secondary, rgba(255,255,255,0.65)); font-size: 1.25rem; font-weight: 600; }

/* ── Activity detail: analytics charts (pace + HR) ── */
.ad-chart { width: 100%; height: auto; display: block; margin: 4px 0 6px; }
.adc-x { font-size: 10px; fill: var(--app-text-tertiary, rgba(255,255,255,0.45)); text-anchor: middle; font-weight: 600; }
.adc-v { font-size: 9px; fill: var(--app-text-secondary, rgba(255,255,255,0.6)); text-anchor: middle; font-weight: 700; font-variant-numeric: tabular-nums; }
.adc-y { font-size: 9px; fill: var(--app-text-tertiary, rgba(255,255,255,0.4)); font-variant-numeric: tabular-nums; }
.adc-avg { stroke: var(--app-text-secondary, rgba(255,255,255,0.55)); stroke-width: 1.4; stroke-dasharray: 5 4; }
.adc-grid { stroke: var(--app-border, rgba(255,255,255,0.09)); stroke-width: 1; }
.adc-hr-area { fill: rgba(239, 68, 68, 0.26); }
.adc-hr-line { fill: none; stroke: #ef4444; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.adc-meta { display: flex; justify-content: space-between; gap: 10px; font-size: 1.25rem; color: var(--app-text-secondary, rgba(255,255,255,0.6)); }
.adc-meta b { color: var(--app-text-primary, #fff); font-variant-numeric: tabular-nums; }

/* HR zones */
.adz-note { font-size: 1.15rem; color: var(--app-text-tertiary, rgba(255,255,255,0.45)); margin: 0 0 10px; }
.adz-row { display: grid; grid-template-columns: 28px 1fr 40px 96px; align-items: center; gap: 8px; margin-bottom: 8px; }
.adz-name { font-size: 1.25rem; font-weight: 800; color: var(--app-text-primary, #fff); }
.adz-bar { height: 16px; border-radius: 8px; background: var(--app-surface-1, rgba(255,255,255,0.06)); overflow: hidden; }
.adz-fill { height: 100%; border-radius: 8px; }
.adz-pct { font-size: 1.2rem; font-weight: 700; color: var(--app-text-primary, #fff); text-align: right; font-variant-numeric: tabular-nums; }
.adz-range { font-size: 1.1rem; color: var(--app-text-tertiary, rgba(255,255,255,0.45)); text-align: right; font-variant-numeric: tabular-nums; }

/* elevation profile (grey, Strava-style) */
.adc-elev-area { fill: rgba(148, 152, 158, 0.4); }
.adc-elev-line { fill: none; stroke: rgba(122, 126, 132, 0.95); stroke-width: 1.6; stroke-linejoin: round; }

/* ── Activity detail: Strava-style top bar (appears past ~80% expansion) ── */
.ad-topbar { position: fixed; top: 0; left: 0; right: 0; z-index: 60; display: flex; align-items: center; gap: 10px; padding: calc(env(safe-area-inset-top, 0px) + 8px) 14px 10px; background: var(--app-bg-base, #0f1114); border-bottom: 1px solid var(--app-border, rgba(255,255,255,0.08)); transform: translateY(-110%); transition: transform 0.22s ease; }
.ad-topbar--on { transform: translateY(0); }
.ad-topbar__title { flex: 1; font-size: 1.6rem; font-weight: 800; color: var(--app-text-primary, #fff); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ad-topbar__actions { display: inline-flex; gap: 6px; }
.ad-topbar__btn { width: 38px; height: 38px; border-radius: 50%; border: none; background: var(--app-surface-1, rgba(255,255,255,0.06)); color: var(--app-text-primary, #fff); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; }
.ad-topbar__btn:active { transform: scale(0.94); }

/* ═══════════════════════════════════════════════════════
   iOS SAFE AREA — natywna powłoka (Dynamic Island / notch)
   Wymaga viewport-fit=cover w <meta viewport> (index.html).
   Na Androidzie i desktopie env() = 0, więc nic się nie zmienia.
══════════════════════════════════════════════════════ */

/* Pasek wyszukiwania na mapie — zjedź poniżej zegara/wyspy */
.map-search-bar {
    top: calc(1.2rem + env(safe-area-inset-top, 0px));
}

/* Nagłówek ekranu Settings (pełnoekranowa lista w sidebarze) */
.settings-panel__header {
    padding-top: calc(1rem + env(safe-area-inset-top, 0px));
}

/* Sidebar (pełny ekran na mobile) — treść od góry poniżej wyspy */
@media (max-width: 899px) {
    .sidebar {
        padding-top: env(safe-area-inset-top, 0px);
    }
}

/* ── Dolna nawigacja: wysokość rośnie o "brodę" iPhone'a (ikony wracają) ── */
.bottom-nav {
    height: calc(5.8rem + env(safe-area-inset-bottom, 0px));
}
.bottom-nav__icon { flex-shrink: 0; }

/* Elementy zakotwiczone tuż nad nawigacją rosną razem z nią */
.tab-panel {
    bottom: calc(5.8rem + env(safe-area-inset-bottom, 0px));
}
.tab-panel--tracker {
    bottom: calc(5.8rem + env(safe-area-inset-bottom, 0px)) !important;
}
.map-style-panel {
    bottom: calc(5.8rem + env(safe-area-inset-bottom, 0px));
}

/* ═══ iOS SAFE AREA — elementy przyklejone do góry ekranu ═══
   Natywna powłoka rysuje pod zegarem/wyspą (viewport-fit=cover), więc każdy
   sticky/fixed nagłówek musi sam zarezerwować sobie górny margines.
   Na Androidzie/desktopie env() = 0 → zero zmian. */

/* Przełącznik Home | Explore — same przyciski, bez paska.
   1) top: przykleja się POD wyspą/zegarem (na Androidzie env()=0 → jak było),
   2) background: transparent — szary pas znika, zostają przyciski,
   3) --hidden: musi pokonać także offset safe-area, inaczej na iOS
      "chowa się" o wysokość paska i zatrzymuje wciąż na ekranie. */
.home-switcher {
    top: env(safe-area-inset-top, 0px);
    background: transparent;
}
.home-switcher--hidden {
    transform: translateY(calc(-120% - env(safe-area-inset-top, 0px)));
}

/* Nagłówek trybu Recording (Track) — status + przycisk minimalizacji */
.trk-expanded__header {
    padding-top: calc(2.4rem + env(safe-area-inset-top, 0px));
}

/* Przycisk minimalizacji w Recording — pozycjonowany absolutnie, więc padding
   nagłówka go nie przesuwa; potrzebuje własnego offsetu od wyspy. */
.trk-expanded__collapse {
    top: calc(2rem + env(safe-area-inset-top, 0px));
}

/* ── Weather section (activity detail) — Strava-style conditions ────────────── */
.adw {
  display: flex; align-items: center; gap: 1.4rem;
  background: var(--app-surface-1, rgba(255,255,255,0.04));
  border: 1px solid var(--app-border, rgba(255,255,255,0.08));
  border-radius: 16px; padding: 1.2rem 1.4rem;
}
.adw__main { display: flex; flex-direction: column; align-items: center; gap: 0.1rem; min-width: 92px; }
.adw__icon { font-size: 2.6rem; line-height: 1; }
.adw__icon img { width: 42px; height: 42px; }
.adw__emoji { font-size: 2.6rem; }
.adw__temp { font-size: 2.4rem; font-weight: 800; color: var(--app-text-primary, #fff); }
.adw__desc { font-size: 1.15rem; color: var(--app-text-muted, rgba(255,255,255,0.55)); text-align: center; }
.adw__grid { display: flex; gap: 1.8rem; flex: 1; flex-wrap: wrap; }
.adw__cell { display: flex; flex-direction: column; gap: 0.15rem; }
.adw__k { font-size: 1.1rem; color: var(--app-text-muted, rgba(255,255,255,0.5)); text-transform: uppercase; letter-spacing: 0.4px; }
.adw__v { font-size: 1.5rem; font-weight: 700; color: var(--app-text-primary, #fff); }
