*{
    margin:0;
    padding:0;
    box-sizing:border-box;
}

body{
    font-family:Inter,sans-serif;
    overflow:hidden;
    background:#fff;
}

#map{
    position:fixed;
    inset:0;
    z-index:1;
}

.map-gradient{
    position:fixed;
    left:0;
    right:0;
    bottom:0;
    height:220px;
    z-index:2;
    background:linear-gradient(
        to top,
        rgba(255,255,255,1),
        rgba(255,255,255,0)
    );
    pointer-events:none;
}

.sheet{
    position:fixed;
    left:0;
    right:0;
    bottom:0;
    z-index:30;
    background:#fff;
    border-radius:28px 28px 0 0;
    transition:.25s;

    padding-top:6px;
    padding-left:12px;
    padding-right:12px;
    padding-bottom:12px;

    height:82vh;
    overflow-y: auto;
    -ms-overflow-style: none;   /* IE/Edge */
    scrollbar-width: none;      /* Firefox */
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    box-shadow:0 -10px 40px rgba(0,0,0,.12);
}

.sheet.collapsed{
    height:245px;
    bottom:60px;
}


.sheet-drag{
    width:52px;
    height:5px;
    background:#d7dce6;
    border-radius:999px;
    margin:4px auto 10px;
}

.route-box{
    background:#f5f7fb;
    border-radius:16px;
    padding:8px;
}

.route-row{
    display:flex;
    align-items:center;
    gap:12px;
    position:relative;
}

.route-row + .route-row{
    margin-top:0px;
}


.route-input-wrap{
    position:relative;
    flex:1;
    display:flex;
    align-items:center;
}

.route-input{
    width:100%;
    border:0;
    background:#fff;
    height:40px;
    border-radius:10px;

    padding-left:10px;
    padding-right:50px;

    font-size:16px;
    outline:none;

    text-overflow:ellipsis;
}

.clear-btn{
    position:absolute;

    right:0px;
    top:50%;

    transform:translateY(-50%);

    width:32px;
    height:32px;

    display:flex;
    align-items:center;
    justify-content:center;

    font-size:28px;
    font-weight:500;
    line-height:1;

    color:#9ca3af;

    cursor:pointer;

    opacity:0;
    pointer-events:none;

    transition:.15s;
}

.clear-btn.visible{
    opacity:1;
    pointer-events:auto;
}

.extra-clear-visible{
    opacity:1 !important;
    pointer-events:auto !important;
}

.add-point-btn{
    position:absolute;

    right:6px;
    top:50%;

    transform:translateY(-50%);

    display:flex;
    align-items:center;
    justify-content:center;

    font-size:32px;
    font-weight:500;

    color:#8d96a7;

    cursor:pointer;

    opacity:0;
    pointer-events:none;

    transition:.15s;
}

@media (max-width: 768px){

    .add-point-btn{
        font-size:32px;
        font-weight:500;
    }

}

.add-point-btn.visible{
    opacity:1;
    pointer-events:auto;
}


.route-points{
    display:flex;
    flex-direction:column;
    gap:8px;
}

.suggest-list{
    position:absolute;
    left:0;
    right:0;
    top:44px;

    background:#fff;

    border-radius:14px;

    box-shadow:
        0 10px 30px rgba(0,0,0,.12);

    z-index:100;

    overflow:hidden;

    display:none;
}

.suggest-item{
    padding:12px 14px;
    font-size:15px;
    cursor:pointer;
    border-bottom:1px solid #f1f1f1;
}

.suggest-item:last-child{
    border-bottom:none;
}

.suggest-item:hover{
    background:#f7f8fb;
}


.route-dot{
    position:relative;

    width:14px;
    height:14px;

    border-radius:50%;

    flex-shrink:0;
}

.route-dot::after{
    content:'';

    position:absolute;

    top:50%;
    left:50%;

    width:6px;
    height:6px;

    border-radius:50%;

    background:#fff;

    transform:translate(-50%,-50%);
}

.route-dot.from{
    background:#ef4444;
    box-shadow:0 0 0 3px rgba(239,68,68,.15);
}

.route-dot.to{
    background:#3b82f6;
    box-shadow:0 0 0 3px rgba(59,130,246,.18);
}

.route-dot.extra{
    background:#22c55e;
    box-shadow:0 0 0 3px rgba(34,197,94,.15);
}


.map-drop {
    position: relative;
    width: 22px;
    height: 22px;
    background: currentColor;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    box-shadow: 0 4px 12px rgba(0,0,0,.18);
}

.map-drop::after {
    content: '';
    position: absolute;
    width: 8px;
    height: 8px;
    background: #fff;
    border-radius: 50%;
    top: 7px;
    left: 7px;
}


.route-meta{
    display:flex;
    gap:10px;
    margin-top:16px;
}

.meta-card{
    flex:1;
    background:#f6f7fb;
    border-radius:16px;
    padding:8px;
}

.meta-title{
    font-size:12px;
    color:#777;
}

.meta-value{
    margin-top:5px;
    font-size:17px;
    font-weight:700;
}

.tariffs-scroll{
    display:flex;
    gap:8px;
    overflow-x:auto;
    padding-top: 10px;
    padding-bottom: 10px;
    scrollbar-width:none;
}

.tariffs-scroll::-webkit-scrollbar{
    display:none;
}

.tariff-card{
    min-width:92px;

    background:#f7f8fb;

    border-radius:20px;

    padding-top:6px;
    padding-bottom:6px;
    padding-left:10px;
    padding-right:10px;

    text-align:center;

    border:2px solid transparent;

    transition:.2s;
    cursor:pointer;
    flex-shrink:0;
}

.tariff-card.active{
    background:#ffe066;
    color:#111;
    border-color:#f5c400;
}

.tariff-card.active .tariff-name{
    font-weight:700;
}

.tariff-card.active .tariff-price{
    font-weight:700;
}

.tariff-car{
    width:100px;
    height:44px;

    object-fit:contain;

    display:block;

    margin:0 auto;

    transform:translateY(-2px);
}

.tariff-name{
    margin-top:2px;
    font-size:16px;
    font-weight:400;
    line-height:1;
}

.tariff-price{
    margin-top:2px;
    font-size:16px;
    font-weight:400;
    line-height:1;
}

.details-block{
    margin-top:10px;
    opacity:1;
    transition:.25s;
}

.sheet.collapsed .details-block{
    opacity:0;
    pointer-events:none;
    height:0;
    overflow:hidden;
    margin:0;
}

.details-title{
    font-size:18px;
    font-weight:700;
    margin-bottom:14px;
}

.option-row{
    display:flex;
    justify-content:space-between;
    align-items:center;
    background:#f7f8fb;
    border-radius:18px;
    padding:10px;
    margin-bottom:6px;
}

.ride-time-icon{
    width:44px;
    height:44px;

    border-radius:14px;

    background:#fff;

    display:flex;
    align-items:center;
    justify-content:center;

    flex-shrink:0;

    cursor:pointer;

    box-shadow:
        0 2px 8px rgba(0,0,0,.05);
}

.ride-time-icon svg{
    display:block;
}



.ride-time-modal-overlay{
    position:fixed;
    inset:0;
    background:rgba(0,0,0,.35);
    z-index:85;
    opacity:0;
    pointer-events:none;
    transition:.2s;
}

.ride-time-modal-overlay.active{
    opacity:1;
    pointer-events:auto;
}

.ride-time-modal{
    position:fixed;
    left:0;
    right:0;
    bottom:-360px;
    background:#fff;
    z-index:90;
    border-radius:24px 24px 0 0;
    padding:14px;
    transition:.25s;
    box-shadow:0 -10px 40px rgba(0,0,0,.2);
}

.ride-time-modal.active{
    bottom:0;
}

.ride-time-modal-header{
    display:flex;
    justify-content:space-between;
    align-items:center;
    margin-bottom:10px;
}

.ride-time-modal-title{
    font-size:18px;
    font-weight:700;
}

.ride-time-modal-close{
    font-size:32px;
    cursor:pointer;
    color:#777;
}

.ride-time-modal-quick{
    display:flex;
    gap:8px;
    margin-bottom:12px;
}

.ride-time-btn-nearest{
    flex:1.5;
    background:#111;
    color:#fff;
    min-width:0;
}

.ride-time-modal-quick-small{
    display:flex;
    gap:8px;
    flex:1;
}

.ride-time-btn-quick{
    flex:1;
    min-width:0;
}

.ride-time-modal-grid{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:10px;
    margin-bottom:12px;
}

.ride-time-modal-row{
    display:flex;
    flex-direction:column;
    gap:6px;
}

.ride-time-modal-row label{
    font-size:16px;
    color:#666;
}

.ride-time-modal-row input{
    width:100%;
    height:42px;
    border:0;
    background:#f6f7fb;
    border-radius:14px;
    padding:0 12px;
    font-size:16px;
    font-weight:700;
    outline:none;
}

.ride-time-modal-actions{
    display:flex;
    gap:8px;
}

.ride-time-btn{
    width:100%;
    height:44px;
    border:0;
    border-radius:14px;
    font-size:16px;
    font-weight:700;
}

.ride-time-btn.primary{
    background:#111;
    color:#fff;
}

.ride-time-btn.secondary{
    background:#f6f7fb;
    color:#111;
}


.option-name{
    font-size:17px;
    font-weight:600;
    opacity:.60;
}

.option-desc{
    font-size:14px;
    color:#777;
    margin-top:4px;
}

.switch{
    width:48px;
    height:28px;
    border-radius:999px;
    background:#d5dae4;
    position:relative;
    transition:.2s;
}

.switch::before{
    content:'';
    position:absolute;
    top:3px;
    left:3px;
    width:22px;
    height:22px;
    border-radius:50%;
    background:#fff;
    transition:.2s;
}

.switch.active{
    background:#111;
}

.switch.active::before{
    transform:translateX(20px);
}


/* КНОПКА КОММЕНТАРИЯ */

.comment-action-btn{
    width:44px;
    height:44px;

    border-radius:14px;

    background:#fff;

    display:flex;
    align-items:center;
    justify-content:center;

    flex-shrink:0;

    position:relative;

    cursor:pointer;

    box-shadow:
        0 2px 8px rgba(0,0,0,.05);
}

.comment-icon{
    display:block;
}

.comment-clear-icon{
    position:absolute;

    inset:0;

    display:flex;
    align-items:center;
    justify-content:center;

    font-size:34px;
    font-weight:400;
    line-height:1;

    color:#111;

    opacity:0;
    pointer-events:none;

    transition:.15s;
}

.comment-action-btn.has-comment .comment-icon{
    opacity:0;
}

.comment-action-btn.has-comment .comment-clear-icon{
    opacity:1;
    pointer-events:auto;
}

.counter{
display:flex;
align-items:center;
gap:4px;
}

.counter-btn{
width:32px;
height:32px;

border:0;

border-radius:12px;

background:#fff;

display:flex;
align-items:center;
justify-content:center;

font-size:24px;
font-weight:500;

line-height:1;

cursor:pointer;

box-shadow:
    0 2px 8px rgba(0,0,0,.05);

transition:.15s;

user-select:none;


}

.counter-btn:active{
transform:scale(.96);
}

.counter-value{
min-width:18px;
text-align:center;
font-size:16px;
font-weight:700;
}


.bottom-action{
    position:fixed;
    left:0;
    right:0;
    bottom:0;
    z-index:60;
    padding:10px;
    display:flex;
    align-items:center;
    gap:10px;
    
    background:#fff;
/*    background:linear-gradient(
        to top,
        #fff,
        rgba(255,255,255,0)
    );*/
}

.order-btn{
    flex:1;
    width:100%;
    height:50px;
    border:0;
    border-radius:20px;
    background:#111;
    color:#fff;
    font-size:16px;
    font-weight:700;
}



.menu-btn{
    width:45px;
    height:45px;

    border:0;
    border-radius:18px;

    background:#fff;

    display:flex;
    flex-direction:column;
    justify-content:center;
    gap:8px;

    padding:0 12px;

    box-shadow:
        0 4px 18px rgba(0,0,0,.12);

    cursor:pointer;

    flex-shrink:0;
}

.menu-line{
    position:relative;

    width:100%;
    height:2px;

    background:#111;

    border-radius:999px;

    display:block;
}

.menu-line.top .menu-dot{
    left:0;
}

.menu-line.bottom .menu-dot{
    right:0;
}

.menu-dot{
    position:absolute;

    top:50%;

    width:8px;
    height:8px;

    border-radius:50%;

    background:#111;

    transform:translateY(-50%);
}

.map-top-info{
    position:fixed;
    top:10px;
    left:14px;
    right:14px;
    z-index:40;
    display:flex;
    gap:8px;
}

.top-info-card{
    flex:1;
    height:40px;
    background:rgba(255,255,255,.94);
    backdrop-filter:blur(12px);
    border-radius:14px;
    padding:0 14px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    box-shadow:0 4px 18px rgba(0,0,0,.08);
}

.top-info-icon{
    font-size:22px;
    opacity:.75;
}

.top-info-value{
    font-size:16px;
    font-weight:700;
}

/* ===== AUTH TOP BAR + SIDE MENU DUMMY ===== */

.map-top-info.auth-user{
    left:14px;
    right:14px;
}

.top-info-auth-wrap{
    flex:1;
    display:flex;
    align-items:center;
    gap:8px;
}

.map-top-info.auth-user .top-info-card{
    padding:0 10px;
    border-radius:12px;
}


.map-top-info.auth-user .top-info-icon{
    font-size:22px;
}

.map-top-info.auth-user .top-info-value{
    font-size:16px;
    font-weight:700;
}


.auth-top-menu-btn{
    width:40px;
    height:40px;
    border:0;
    border-radius:12px;
    background:#fff;
    display:flex;
    flex-direction:column;
    justify-content:center;
    gap:8px;
    padding:0 9px;
    box-shadow:0 4px 18px rgba(0,0,0,.08);
    cursor:pointer;
    flex-shrink:0;
}


.auth-top-menu-btn .menu-line{
    height:2px;
}

.side-dummy-overlay{
    position:fixed;
    inset:0;
    background:rgba(0,0,0,.25);
    z-index:92;
    opacity:0;
    pointer-events:none;
    transition:.2s;
}

.side-dummy-overlay.active{
    opacity:1;
    pointer-events:auto;
}

.side-dummy-panel{
    position:fixed;
    top:0;
    right:-110vw;
    width:100vw;
    height:100vh;
    background:#fff;
    z-index:95;
    transition:right .28s ease;
    box-shadow:-12px 0 40px rgba(0,0,0,.16);
    display:flex;
    flex-direction:column;
}

.side-dummy-panel.active{
    right:0;
}

.side-dummy-header{
    height:58px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    padding:0 14px;
    border-bottom:1px solid #eef1f6;
    flex-shrink:0;
}

.side-dummy-back-btn{
    width:40px;
    height:40px;
    border:0;
    border-radius:14px;
    background:#f6f7fb;
    display:flex;
    align-items:center;
    justify-content:center;
    font-size:24px;
    line-height:1;
    cursor:pointer;
    color:#111;
}

.side-dummy-title{
    font-size:17px;
    font-weight:700;
    color:#111;
    margin-right:auto;
    margin-left:10px;
}

.side-dummy-content{
    padding:16px 14px;
    overflow:auto;
    flex:1;
}

.side-dummy-card{
    background:#f7f8fb;
    border-radius:18px;
    padding:14px;
    font-size:16px;
    color:#111;
    line-height:1.35;
}



.comment-overlay{
    position:fixed;
    inset:0;
    background:rgba(0,0,0,.35);
    z-index:80;
    opacity:0;
    pointer-events:none;
    transition:.2s;
}

.comment-panel{
    position:fixed;
    left:0;
    right:0;
    bottom:-300px;
    background:#fff;
    z-index:90;
    border-radius:24px 24px 0 0;
    padding:14px;
    transition:.25s;
    box-shadow:0 -10px 40px rgba(0,0,0,.2);
}

.comment-panel.active{
    bottom:0;
}

.comment-overlay.active{
    opacity:1;
    pointer-events:auto;
}

.comment-panel-header{
    display:flex;
    justify-content:space-between;
    align-items:center;
    margin-bottom:10px;
}

.comment-title{
    font-size:18px;
    font-weight:700;
}

.comment-close{
    font-size:32px;
    cursor:pointer;
    color:#777;
}

.comment-input{
    width:100%;
    height:90px;
    resize:none;
    border:0;
    background:#f6f7fb;
    border-radius:14px;
    padding:10px;
    font-size:16px;
    outline:none;
}

.comment-ready-btn{
    width:100%;
    margin-top:10px;
    height:44px;
    border:0;
    border-radius:14px;
    background:#111;
    color:#fff;
    font-size:15px;
    font-weight:700;
}

.order-btn,
.comment-ready-btn,
.ride-time-btn,
.ride-time-icon,
.switch,
.tariff-card,
.comment-close,
.clear-btn,
.add-point-btn {
    cursor:pointer;
}


.locate-me-btn{

    position:fixed;

    right:14px;
    bottom:320px;

    width:52px;
    height:52px;

    border-radius:18px;

    background:rgba(255,255,255,.82);

    backdrop-filter:blur(12px);

    display:flex;
    align-items:center;
    justify-content:center;

    box-shadow:
        0 4px 18px rgba(0,0,0,.10);

    z-index:10;

    cursor:pointer;

    transition:
        opacity .2s,
        transform .2s;

}

.locate-me-btn.hidden{

    opacity:0;
    pointer-events:none;
    transform:scale(.92);

}









/* =====================================================
   DESKTOP WIDTH FIX
   ===================================================== */

@media (min-width:550px){

    :root{
        --app-width:550px;
    }

    body{
        background:
            linear-gradient(
                180deg,
                #eef2f7 0%,
                #dde5ef 100%
            );
    }

    /* ВСЕ ОСНОВНЫЕ FIXED-БЛОКИ */
    #map,
    .map-gradient,
    .map-top-info,
    .sheet,
    .bottom-action,
    .ride-time-modal,
    .comment-panel{

        width:var(--app-width) !important;

        left:50% !important;
        right:auto !important;

        margin-left:calc(var(--app-width) / -2);
    }

    /* OVERLAY НЕ ТРОГАЕМ */
    .comment-overlay,
    .ride-time-modal-overlay,
    .side-dummy-overlay{
        left:0 !important;
        right:0 !important;
        width:100% !important;
        margin-left:0 !important;
    }

    /* КНОПКА ГЕОЛОКАЦИИ */
    .locate-me-btn{
        right:calc(50% - (var(--app-width) / 2) + 14px) !important;
    }
    
    /* ВЕРХНЯЯ ПАНЕЛЬ */
.map-top-info{

    width:calc(var(--app-width) - 28px) !important;

    left:50% !important;
    right:auto !important;

    margin-left:calc((var(--app-width) - 28px) / -2);

    top:14px;
}

}