:root{
    --primary:#111827;
    --green:#16a34a;
    --blue:#2563eb;
    --muted:#64748b;
    --surface:rgba(255,255,255,.96)
}
*{
    box-sizing:border-box
}
html,body{
    margin:0;
    width:100%;
    height:100%;
    font-family:Inter,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif
}
#map{
    position:fixed;
    inset:0;
    z-index:0
}
.leaflet-control-attribution{
    font-size:9px
}
.topbar{
    position:fixed;
    top:14px;
    left:14px;
    right:14px;
    z-index:1000;
    display:flex;
    justify-content:space-between;
    align-items:center;
    pointer-events:none
}
.brand,.gps-pill{
    background:var(--surface);
    box-shadow:0 4px 18px rgba(0,0,0,.12);
    border-radius:18px;
    padding:10px 14px;
    font-size:13px;
    pointer-events:auto
}
.brand{
    font-weight:800
}
.gps-pill{
    font-weight:700;
    color:#166534
}
.bottom-sheet{
    position:fixed;
    z-index:1001;
    left:0;
    right:0;
    bottom:0;
    margin:auto;
    max-width:560px;
    background:var(--surface);
    border-radius:26px 26px 0 0;
    box-shadow:0 -8px 30px rgba(0,0,0,.16);
    padding:14px 16px calc(16px + env(safe-area-inset-bottom));
    max-height:62vh;
    overflow:auto
}
.handle{
    width:42px;
    height:5px;
    border-radius:99px;
    background:#cbd5e1;
    margin:0 auto 14px
}
.input-wrap{
    display:flex;
    align-items:center;
    gap:10px;
    background:#f1f5f9;
    border-radius:16px;
    padding:0 14px;
    margin-bottom:10px
}
.input-wrap {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 0 12px;
    margin-bottom: 8px;
}

.input-wrap input {
    flex: 1;
    border: 0;
    outline: none;
    height: 46px;
    font-size: 15px;
    background: transparent;
}

.search-results {
    display: none;
    position: relative;
    z-index: 9999;
    background: #fff;
    border-radius: 12px;
    margin: -2px 0 10px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0,0,0,.15);
    border: 1px solid #e5e7eb;
    max-height: 300px;
    overflow-y: auto;
}

.search-results .result {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 14px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    background: #fff;
}

.search-results .result:last-child {
    border-bottom: 0;
}

.search-results .result:hover {
    background: #f5f7fa;
}

.search-results .result:active {
    background: #e9eef5;
}

.result-icon {
    width: 34px;
    height: 34px;
    min-width: 34px;
    border-radius: 50%;
    background: #f1f3f4;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
}

.result-content {
    min-width: 0;
    flex: 1;
}

.result-title {
    font-size: 14px;
    font-weight: 600;
    color: #202124;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.result-address {
    margin-top: 3px;
    font-size: 12px;
    line-height: 1.4;
    color: #70757a;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.search-loading {
    padding: 14px;
    text-align: center;
    color: #777;
    font-size: 13px;
}

.search-empty {
    padding: 16px;
    text-align: center;
    color: #777;
    font-size: 13px;
}

.search-results::-webkit-scrollbar {
    width: 5px;
}

.search-results::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 10px;
}
.route-summary{
    display:flex;
    justify-content:space-between;
    gap:10px;
    padding:12px 0;
    font-weight:700
}
.vehicles{
    display:grid;
    grid-template-columns:repeat(3,1fr);
    gap:8px
}
.vehicle{
    border:2px solid #e2e8f0;
    border-radius:16px;
    padding:10px;
    background:#fff;
    cursor:pointer
}
.vehicle.active{
    border-color:#111827;
    background:#f8fafc
}
.vehicle b{
    display:block;
    font-size:14px
}
.vehicle span{
    font-size:12px;
    color:var(--muted)
}
.vehicle strong{
    display:block;
    margin-top:6px;
    font-size:14px
}
.btn{
    border:0;
    border-radius:16px;
    padding:14px 16px;
    font-weight:800;
    cursor:pointer;
    width:100%;
    font-size:15px
}
.btn.green{
    background:var(--green);
    color:#fff
}
.btn.dark{
    background:#111827;
    color:#fff
}
.btn.gray{
    background:#e2e8f0;
    color:#0f172a
}
.btn:disabled{
    opacity:.45;
    cursor:not-allowed
}
.status{
    padding:10px 0;
    font-size:14px;
    color:#334155
}
.driver-card{
    display:grid;
    grid-template-columns:1fr auto;
    gap:4px 12px;
    padding:14px;
    border-radius:18px;
    background:#f8fafc;
    margin-bottom:10px
}
.driver-card .name{
    font-weight:800
}
.driver-card .sub{
    font-size:12px;
    color:var(--muted)
}
.badge{
    align-self:center;
    background:#dcfce7;
    color:#166534;
    border-radius:99px;
    padding:7px 10px;
    font-size:11px;
    font-weight:800
}
.trip-state{
    font-weight:900;
    font-size:18px;
    margin:3px 0 12px
}
.mini-actions{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:8px
}
.driver-panel{
    max-width:500px
}
.request{
    border:1px solid #e2e8f0;
    border-radius:18px;
    padding:14px;
    margin-bottom:10px
}
.request .fare{
    font-size:22px;
    font-weight:900;
    margin:6px 0
}
.online-toggle{
    display:flex;
    gap:8px
}
.map-vehicle-icon{
    background:transparent;
    border:0
}
.car-marker{
    width:36px;
    height:36px;
    border-radius:50%;
    background:#111827;
    color:white;
    display:flex;
    align-items:center;
    justify-content:center;
    box-shadow:0 4px 12px rgba(0,0,0,.25);
    font-size:18px;
    border:3px solid white;
    transform-origin:center
}
.pulse{
    width:16px;
    height:16px;
    border-radius:50%;
    background:#2563eb;
    border:3px solid white;
    box-shadow:0 0 0 8px rgba(37,99,235,.18)
}
@media(min-width:700px){
    .bottom-sheet{
        left:18px;
        right:auto;
        bottom:18px;
        border-radius:24px;
        width:430px
    }
    .driver-panel{
        left:auto;
        right:18px
    }
    .topbar{
        left:24px;
        right:24px
    }
}
.pickup-wrap {
    cursor: pointer;
}

.pickup-wrap input {
    cursor: pointer;
}

.location-btn {
    border: 0;
    background: #f1f5f9;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    flex-shrink: 0;
}

.location-btn:hover {
    background: #e2e8f0;
}

.pickup-mode {
    background: #ecfdf5;
    color: #047857;
    border-radius: 10px;
    padding: 9px 12px;
    margin: -3px 0 8px;
    font-size: 12px;
    text-align: center;
}
/* =========================================================
   SEARCH RESULT - PICKUP / DESTINATION
   ========================================================= */

.input-wrap {
    position: relative;
    z-index: 20;
}

.search-results {
    position: relative;
    z-index: 1000;

    width: 100%;
    max-height: 260px;

    margin-top: 6px;

    overflow-y: auto;
    overflow-x: hidden;

    background: #fff;

    border: 1px solid #e5e7eb;
    border-radius: 14px;

    box-shadow:
        0 8px 25px rgba(0, 0, 0, 0.12),
        0 2px 8px rgba(0, 0, 0, 0.06);

    -webkit-overflow-scrolling: touch;
}

/* =========================================================
   PICKUP RESULTS
   ========================================================= */

#pickupResults {
    display: none;

    margin: 6px 0 10px;

    max-height: 240px;

    background: #ffffff;

    border-radius: 14px;

    border: 1px solid #e5e7eb;

    box-shadow:
        0 10px 30px rgba(0, 0, 0, .14);

    overflow-y: auto;

    position: relative;

    z-index: 2000;
}

/* =========================================================
   RESULT ITEM
   ========================================================= */

.search-results .result {
    display: flex;

    align-items: center;

    gap: 12px;

    width: 100%;

    padding: 12px 14px;

    background: #fff;

    border-bottom: 1px solid #f1f5f9;

    cursor: pointer;

    transition:
        background .15s ease,
        transform .1s ease;
}

.search-results .result:last-child {
    border-bottom: none;
}

.search-results .result:hover {
    background: #f8fafc;
}

.search-results .result:active {
    background: #f1f5f9;

    transform: scale(.99);
}

/* =========================================================
   ICON
   ========================================================= */

.result-icon {
    flex: 0 0 38px;

    width: 38px;
    height: 38px;

    display: flex;

    align-items: center;
    justify-content: center;

    border-radius: 50%;

    background: #ecfdf5;

    color: #16a34a;

    font-size: 18px;
}

/* =========================================================
   CONTENT
   ========================================================= */

.result-content {
    min-width: 0;

    flex: 1;
}

.result-title {
    font-size: 14px;

    font-weight: 700;

    line-height: 1.35;

    color: #111827;

    white-space: nowrap;

    overflow: hidden;

    text-overflow: ellipsis;
}

.result-address {
    margin-top: 3px;

    font-size: 12px;

    line-height: 1.4;

    color: #6b7280;

    display: -webkit-box;

    -webkit-line-clamp: 2;

    -webkit-box-orient: vertical;

    overflow: hidden;
}

/* =========================================================
   LOADING
   ========================================================= */

.search-loading {
    padding: 18px 15px;

    text-align: center;

    font-size: 14px;

    color: #6b7280;

    background: #fff;
}

/* =========================================================
   EMPTY / ERROR
   ========================================================= */

.search-empty {
    padding: 18px 15px;

    text-align: center;

    font-size: 13px;

    color: #6b7280;

    background: #fff;
}

/* =========================================================
   PICKUP MODE
   ========================================================= */

.pickup-mode {
    margin: 6px 0 8px;

    padding: 9px 12px;

    border-radius: 10px;

    background: #ecfdf5;

    border: 1px solid #bbf7d0;

    color: #15803d;

    font-size: 12px;

    font-weight: 600;

    text-align: center;
}

/* =========================================================
   PICKUP INPUT
   ========================================================= */

#pickup {
    flex: 1;

    min-width: 0;

    border: none;

    outline: none;

    background: transparent;

    font-size: 14px;

    color: #111827;
}

#pickup::placeholder {
    color: #9ca3af;
}

/* =========================================================
   LOCATION BUTTON
   ========================================================= */

.location-btn {
    flex: 0 0 38px;

    width: 38px;
    height: 38px;

    display: flex;

    align-items: center;
    justify-content: center;

    border: none;

    border-radius: 10px;

    background: #ecfdf5;

    color: #16a34a;

    font-size: 18px;

    cursor: pointer;

    transition:
        background .15s ease,
        transform .1s ease;
}

.location-btn:hover {
    background: #dcfce7;
}

.location-btn:active {
    transform: scale(.92);
}

/* =========================================================
   INPUT WRAP
   ========================================================= */

.pickup-wrap {
    display: flex;

    align-items: center;

    gap: 8px;

    min-height: 48px;

    padding: 5px 7px 5px 13px;
}

/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 600px) {

    .search-results,
    #pickupResults {

        max-height: 220px;

        border-radius: 12px;

    }

    .search-results .result {

        padding: 11px 12px;

        gap: 10px;

    }

    .result-icon {

        width: 34px;
        height: 34px;

        flex-basis: 34px;

        font-size: 16px;

    }

    .result-title {

        font-size: 13px;

    }

    .result-address {

        font-size: 11px;

    }

}
/* =========================================================
   DRIVER INFO
   ========================================================= */

.driver-info {
    display: flex;

    align-items: center;

    gap: 12px;

    margin: 8px 0 12px;

    padding: 12px;

    background: #ffffff;

    border: 1px solid #e5e7eb;

    border-radius: 16px;

    box-shadow:
        0 4px 15px rgba(0, 0, 0, .08);
}

.driver-avatar {
    width: 50px;
    height: 50px;

    flex: 0 0 50px;

    display: flex;

    align-items: center;
    justify-content: center;

    border-radius: 50%;

    background: #dcfce7;

    font-size: 25px;
}

.driver-main {
    min-width: 0;

    flex: 1;
}

.driver-name {
    font-size: 16px;

    font-weight: 700;

    color: #111827;

    white-space: nowrap;

    overflow: hidden;

    text-overflow: ellipsis;
}

.driver-meta {
    margin-top: 3px;

    font-size: 12px;

    color: #6b7280;

    white-space: nowrap;

    overflow: hidden;

    text-overflow: ellipsis;
}

.driver-call {
    width: 44px;
    height: 44px;

    flex: 0 0 44px;

    display: flex;

    align-items: center;
    justify-content: center;

    border-radius: 50%;

    background: #16a34a;

    color: #ffffff;

    text-decoration: none;

    font-size: 20px;

    box-shadow:
        0 4px 10px rgba(22, 163, 74, .25);
}

.driver-call:active {
    transform: scale(.94);
}