/* =========================================================================
   PENGUNCI SEBARIS COMPACT (Khas untuk Semua Skrin Peranti & Apple iOS)
   ========================================================================= */
.control-grid-inline {
    display: flex;
    flex-direction: row !important; /* Paksa kekal satu baris pada semua saiz skrin */
    flex-wrap: nowrap !important;   /* Alang pertukaran baris ke bawah */
    align-items: center;
    justify-content: space-between;
    gap: 8px; /* Jarak minimum yang rapat & selamat untuk mobile */
    width: 100%;
    box-sizing: border-box;
}

/* Item Komponen Bersifat Fleksibel (Ikut Lebar Skrin) */
.control-item-flex {
    display: flex;
    align-items: center;
    min-width: 0; /* Cegah elemenselect/input daripada melimpah keluar */
}

/* Agihan Lebar Ruang: Bandar dapat ruang lebih besar */
.city-box {
    flex: 2.5;
}

.speed-box {
    flex: 2;
    background: #1e293b; /* Latar belakang bar slider untuk kekemasan */
    padding: 0 8px;
    border-radius: 8px;
    height: 38px;
    border: 1px solid #334155;
    gap: 6px;
}

/* Item Komponen Bersifat Tetap (Kunci Saiz Butang) */
.control-item-static {
    display: flex;
    flex-direction: row;
    gap: 6px;
    flex-shrink: 0; /* Halang butang daripada mengecut/kemek */
}

/* Pembetulan Spesifikasi Input Pelayar Apple & Android Mobile */
#focus-city {
    width: 100%;
    height: 38px;
    background-color: #1e293b;
    border: 1px solid #334155;
    border-radius: 8px;
    color: #ffffff;
    padding: 0 4px;
    font-size: 11px; /* Saiz fon kompak untuk skrin sekecil iPhone SE */
    outline: none;
    cursor: pointer;
    text-overflow: ellipsis;
    -webkit-appearance: none; /* Buang gaya iOS Safari asal */
    appearance: none;
}

#speed-val {
    font-weight: bold;
    color: #38bdf8;
    font-size: 10px;
    min-width: 28px;
    text-align: center;
}

#speed-slider {
    flex: 1;
    height: 4px;
    background: #475569;
    border-radius: 2px;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    margin: 0;
}

/* Pembetulan Saiz Jari Sentuhan untuk Butang */
.control-item-static .btn {
    width: 36px !important; /* Saiz kotak dikecilkan sedikit untuk muat sebaris */
    height: 38px !important;
    border-radius: 8px;
    padding: 0;
    margin: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.control-item-static .icon-symbol {
    font-size: 1.1rem !important;
}

/* Media Query Kecemasan Khas untuk Skrin Telefon Pintar Sangat Kecil (Lebar < 360px) */
@media (max-width: 360px) {
    #focus-city {
        font-size: 10px;
    }
    #speed-val {
        font-size: 9px;
        min-width: 22px;
    }
    .control-item-static .btn {
        width: 32px !important;
    }
}
