/* Phones and narrow windows (under 900px): icon buttons and a bottom sheet.
   Loaded last so it can override the files above. */

@media (max-width: 899px) {
    .top {
        top: 12px;
        left: 12px;
        right: 12px;
        justify-content: space-between;
    }
    .brand {
        height: 44px;
        padding: 0 16px 0 13px;
        gap: 9px;
    }
    .actions {
        height: auto;
        padding: 0;
        gap: 6px;
        background: none;
        border: 0;
        box-shadow: none;
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
    }
    .actions .sep,
    .act span {
        display: none;
    }
    .act {
        width: 44px;
        height: 44px;
        padding: 0;
        justify-content: center;
        background: rgba(44, 48, 60, .5);
        -webkit-backdrop-filter: blur(24px) saturate(170%);
        backdrop-filter: blur(24px) saturate(170%);
        border: 1px solid rgba(255, 255, 255, .12);
        box-shadow: 0 10px 30px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .08);
    }
    .act:disabled {
        background: rgba(44, 48, 60, .5);
        opacity: .5;
    }
    .hint {
        top: 64px;
        left: 12px;
        right: 12px;
        height: auto;
        min-height: 34px;
        padding: 7px 14px;
    }
    .upload {
        padding: 72px 16px 32px;
    }
    .up-card {
        width: 343px;
        padding: 28px 22px 26px;
        border-radius: 28px;
        gap: 18px;
    }
    .intro h1 {
        font-size: 34px;
    }
    .intro p {
        font-size: 15.5px;
    }
    .drop {
        min-height: 200px;
    }
    .panel {
        top: var(--sheet-top);
        left: 8px;
        right: 8px;
        bottom: 8px;
        width: auto;
        border-radius: 30px;
        transition: top .3s cubic-bezier(.2, .8, .2, 1);
    }
    body.sheet-up {
        --sheet-top: min(170px, 30%);
    }
    .panel.dragging {
        transition: none;
    }
    .grabber {
        display: flex;
        align-self: stretch;
        justify-content: center;
        border: 0;
        background: transparent;
        padding: 8px 0 4px;
        cursor: grab;
        touch-action: none;
    }
    .grabber span {
        width: 38px;
        height: 5px;
        border-radius: 3px;
        background: rgba(255, 255, 255, .28);
    }
    .panel-head {
        padding: 6px 14px 10px;
    }
    .panel-body {
        padding: 8px 16px 16px;
    }
    .big {
        font-size: 52px;
    }
    .big-unit {
        font-size: 19px;
    }
    .recap {
        font-size: 15px;
    }
    .bl {
        left: 12px;
        bottom: auto;
        top: calc(var(--sheet-top) - 48px);
        max-width: none;
        transition: top .3s cubic-bezier(.2, .8, .2, 1);
    }
    .legend {
        display: none;
    }
    .zoom {
        right: 12px;
        bottom: auto;
        top: calc(var(--sheet-top) - 164px);
        transition: top .3s cubic-bezier(.2, .8, .2, 1);
    }
    body.sheet-up .zoom,
    body.sheet-up .bl {
        visibility: hidden;
    }
    body.is-replay .zoom {
        right: 12px;
        top: auto;
        bottom: 230px;
        visibility: visible;
    }
    .replay {
        left: 8px;
        right: 8px;
        bottom: 8px;
        width: auto;
        max-width: none;
        transform: none;
        padding: 16px 18px 18px;
        border-radius: 26px;
        gap: 14px;
    }
    .rp-tile {
        width: 44px;
        height: 44px;
        border-radius: 12px;
    }
    .rp-route {
        font-size: 19px;
    }
    .rp-sofar {
        font-size: 24px;
    }
    .rp-months span:nth-child(even) {
        visibility: hidden;
    }
    .dialog {
        padding: 16px;
        border-radius: 28px;
        gap: 16px;
    }
    .card-frame {
        width: min(327px, calc(100vw - 48px), calc((100vh - 150px) * .8));
        border-radius: 20px;
    }
    .dlg-actions button {
        font-size: 14px;
        gap: 6px;
    }
    .seg button {
        padding: 0 4px;
        font-size: 12.5px;
    }
    .toasts {
        top: 64px;
        width: calc(100% - 24px);
    }
    .toast {
        border-radius: 22px;
        width: 100%;
    }
    .toast span {
        flex: 1;
    }
}
/* phones with a notch or a home bar */
.top {
    top: calc(16px + env(safe-area-inset-top, 0px));
}
@media (max-width: 899px) {
    .top {
        top: calc(12px + env(safe-area-inset-top, 0px));
    }
    .panel,
    .replay {
        bottom: calc(8px + env(safe-area-inset-bottom, 0px));
    }
    .upload {
        padding-top: calc(72px + env(safe-area-inset-top, 0px));
    }
}
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        transition: none !important;
        animation-duration: .001ms !important;
    }
}
