@font-face{font-family:'Inter';font-style:normal;font-weight:100 900;font-display:swap;
  src:url(../vendor/fonts/inter.3100e775e861.woff2) format('woff2');
  unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;}
        body { font-family: 'Inter', system-ui, -apple-system, sans-serif; font-size: 16px; }
        .custom-scrollbar::-webkit-scrollbar { width: 8px; height: 8px; }
        .custom-scrollbar::-webkit-scrollbar-track { background: #e2e8f0; }
        .custom-scrollbar::-webkit-scrollbar-thumb { background: #94a3b8; border-radius: 4px; }

        .moving-bus-icon {
            border: 3px solid #ffffff;
            border-radius: 50%;
            color: #ffffff;
            display: flex; align-items: center; justify-content: center;
            box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
            transition: transform 0.25s;
        }
        .moving-bus-icon:hover { transform: scale(1.25); z-index: 1000 !important; }
        .vehicle-marker-wrap {
            position: relative;
            width: 42px;
            height: 42px;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        .vehicle-heading-ring {
            position: absolute;
            inset: 0;
            pointer-events: none;
            transition: transform 0.35s ease-out;
        }
        .vehicle-heading-cone {
            position: absolute;
            top: -6px;
            left: 50%;
            transform: translateX(-50%);
            width: 0;
            height: 0;
            border-left: 7px solid transparent;
            border-right: 7px solid transparent;
            border-bottom: 11px solid #0f172a;
            filter: drop-shadow(0 1px 2px rgba(255,255,255,0.9));
        }
        .gps-btn { position: absolute; bottom: 28px; right: 20px; z-index: 1000; }
        .radar-btn { position: absolute; bottom: 96px; right: 20px; z-index: 1000; }
        .browse-btn { position: absolute; bottom: 164px; right: 20px; z-index: 1000; }

        .like-btn { cursor: pointer; transition: all 0.2s; }
        .like-btn:hover { transform: scale(1.08); }

        input, select, button { touch-action: manipulation; }

        @keyframes fadeIn {
            from { opacity: 0; transform: scale(0.96); }
            to { opacity: 1; transform: scale(1); }
        }
        .animate-fade-in { animation: fadeIn 0.2s ease-out forwards; }

        .leaflet-marker-icon.custom-bus {
            transition: transform var(--bus-move-transition, 1.7s) linear;
        }
        .station-marker-pill {
            transition: transform 0.2s ease, box-shadow 0.2s ease;
        }
        .station-marker-pill:hover {
            transform: scale(1.22);
            z-index: 2000 !important;
        }

body.hketa-simple-mode #stop-list li > div:first-child {
    padding-top: 14px;
    padding-bottom: 14px;
}
body.hketa-simple-mode [id^="stop-name-"] {
    font-size: 1.18rem !important;
    line-height: 1.35 !important;
}
body.hketa-simple-mode [id^="inline-eta-"] span {
    font-size: 1.05rem !important;
    padding: 6px 12px !important;
}

html[data-device="tablet"] #app-body { flex-direction: column; }
html[data-device="tablet"] #sidebar { width: 100%; height: 56vh; }

html[data-device="phone"] body { font-size: 15px; }
html[data-device="phone"] #app-body { flex-direction: column; }
html[data-device="phone"] #app-header { padding: 5px 8px; gap: 4px; }
html[data-device="phone"] #app-main-title { font-size: 12.5px; }
html[data-device="phone"] #company-subtitle { display: none; }
html[data-device="phone"] #sidebar { width: 100%; height: auto; flex: 1 1 auto; min-height: 0; }
html[data-device="phone"] #stop-list { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
html[data-device="phone"] #stop-list li { min-height: 54px; }
html[data-device="phone"] #gui-top-row { font-size: 13px; }
html[data-device="phone"] #loc-update-ctrl { top: 8px; left: 8px; right: 8px; padding: 5px 7px; gap: 6px; flex-wrap: wrap; font-size: 11px; }
html[data-device="phone"] .gps-btn { bottom: calc(80px + env(safe-area-inset-bottom)); right: 12px; }
html[data-device="phone"] .radar-btn { bottom: calc(148px + env(safe-area-inset-bottom)); right: 12px; }
html[data-device="phone"] .browse-btn { bottom: calc(216px + env(safe-area-inset-bottom)); right: 12px; }
html[data-device="phone"] #close-map-drawer-btn { top: auto; bottom: calc(82px + env(safe-area-inset-bottom)); left: 10px; }

html[data-device="phone"] #modal-overlay { padding: 0; }
html[data-device="phone"] #modal-overlay > div { max-width: 100%; width: 100%; height: 100dvh; max-height: 100dvh; border-radius: 0; border: 0; }
html[data-device="phone"] #modal-subbar { position: sticky; top: 0; z-index: 5; }
html[data-device="phone"] #modal-subbar input { font-size: 16px; }

html[data-device="phone"] #mobile-tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 1600;
    display: flex; align-items: stretch;
    background: rgba(15, 23, 42, 0.97);
    border-top: 1px solid #334155;
    padding-bottom: env(safe-area-inset-bottom);
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.35);
}
html[data-device="phone"] #mobile-tabbar button {
    flex: 1 1 0; min-height: 56px;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    color: #cbd5e1; font-size: 11px; font-weight: 800; letter-spacing: .02em;
}
html[data-device="phone"] #mobile-tabbar button i { font-size: 17px; }
html[data-device="phone"] #mobile-tabbar button.on { color: #10b981; }
html[data-device="phone"] #mobile-tabbar button:active { transform: scale(.94); }

#header-weather-btn { min-width: 34px; justify-content: center; }
#header-weather-btn #header-weather-btn-text { display: none; }
html[data-device="phone"] #header-weather-btn { min-width: 40px; min-height: 36px; }

html[data-device="phone"] #app-header {
    background: linear-gradient(180deg, #0b1220 0%, #16233a 100%);
    border-bottom: 1px solid rgba(148, 163, 184, .18);
    padding: 7px 10px 8px;
}
html[data-device="phone"] #app-main-title { font-weight: 900; letter-spacing: .01em; }
html[data-device="phone"] #sidebar {
    border-radius: 18px 18px 0 0;
    box-shadow: 0 -8px 24px rgba(2, 6, 23, .18);
    overflow: hidden;
}

html[data-device="phone"] #sidebar > div.px-3 { position: sticky; top: 0; z-index: 6; background: rgba(248, 250, 252, .96); backdrop-filter: blur(8px); border-bottom: 1px solid #e2e8f0; }

html[data-device="phone"] #stop-list { background: #f1f5f9; }
html[data-device="phone"] #stop-list.divide-y > li,
html[data-device="phone"] #stop-list > li { border: 0 !important; }
html[data-device="phone"] #stop-list > li { margin: 7px 9px; border-radius: 16px; background: #fff; box-shadow: 0 1px 2px rgba(2, 6, 23, .06), 0 1px 0 rgba(2,6,23,.03); overflow: hidden; }
html[data-device="phone"] #stop-list > li:active { transform: scale(.994); }
html[data-device="phone"] #stop-list > li > div:first-child { padding: 11px 12px; }
html[data-device="phone"] [id^="stop-name-"] { font-weight: 800; color: #0f172a; }
html[data-device="phone"] [id^="inline-eta-"] span,
html[data-device="phone"] [id^="inline-eta-"] > div > span { border-radius: 999px; padding: 5px 10px; font-weight: 800; letter-spacing: .01em; }
html[data-device="phone"] #route-title { font-weight: 900; }
html[data-device="phone"] #schedule-info span { border-radius: 999px; }
html[data-device="phone"] #bus-count { border-radius: 999px; }

html[data-device="phone"] #map-main { border-radius: 18px 18px 0 0; box-shadow: 0 -10px 30px rgba(2, 6, 23, .35); }
html[data-device="phone"] #map { border-radius: 18px 18px 0 0; }

html[data-device="phone"] .gps-btn, html[data-device="phone"] .radar-btn, html[data-device="phone"] .browse-btn {
    width: 48px; height: 48px; display: flex; align-items: center; justify-content: center;
    border-radius: 999px; box-shadow: 0 6px 18px rgba(2, 6, 23, .28);
}

html[data-device="phone"] #mobile-tabbar {
    background: rgba(11, 18, 32, .88);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid rgba(148, 163, 184, .22);
}
html[data-device="phone"] #mobile-tabbar button { padding: 6px 2px 7px; gap: 4px; transition: transform .14s ease-out, color .14s ease-out; }
html[data-device="phone"] #mobile-tabbar button i { font-size: 18px; }
html[data-device="phone"] #mobile-tabbar button.on { color: #10b981; }
html[data-device="phone"] #mobile-tabbar button.on::after {
    content: ''; position: absolute; transform: translateY(-26px);
    width: 26px; height: 3px; border-radius: 999px; background: #10b981;
}
html[data-device="phone"] #mobile-tabbar button { position: relative; }

html[data-device="phone"] #modal-subbar { background: rgba(241, 245, 249, .95); backdrop-filter: blur(8px); }
html[data-device="phone"] #modal-subbar input { border-radius: 14px; }
html[data-device="phone"] #modal-body { padding: 10px 8px calc(10px + env(safe-area-inset-bottom)); }
html[data-device="phone"] #modal-body > div { border-radius: 14px; margin: 0 0 6px; background: #fff; box-shadow: 0 1px 2px rgba(2, 6, 23, .06); }

html[data-welcome-ack="1"] #welcome-warning-modal { display: none !important; }
#welcome-warning-modal .hketa-legal-body { max-height: 58vh; }
html[data-device="phone"] #welcome-warning-modal { padding: 10px; align-items: flex-end; }
html[data-device="phone"] #welcome-warning-modal > div { max-height: 94vh; border-radius: 22px; }
html[data-device="phone"] #welcome-warning-modal .hketa-legal-body { max-height: 48vh; padding: 16px; font-size: 13px; }

html[data-device="phone"] #stop-list { padding-bottom: calc(78px + env(safe-area-inset-bottom)); -webkit-overflow-scrolling: touch; }

body.hketa-simple-mode #app-header { padding: 6px 10px; }
body.hketa-simple-mode #company-subtitle { display: none; }
body.hketa-simple-mode #welcome-list-sub { display: none; }
html[data-device="phone"] body.hketa-simple-mode #stop-list > li { padding: 13px 12px; min-height: 62px; }
html[data-device="phone"] body.hketa-simple-mode [id^="stop-name-"] { font-size: 16px; line-height: 1.25; }
html[data-device="phone"] body.hketa-simple-mode [id^="inline-eta-"] span { font-size: 15px; padding: 5px 10px; }
html[data-device="phone"] body.hketa-simple-mode #open-map-drawer-btn { bottom: calc(78px + env(safe-area-inset-bottom)); }

html[data-device="phone"][data-hand="right"] #hketa-hand-group { order: 1; }
html[data-device="phone"][data-hand="left"] #hketa-hand-group { order: 4; }

html[data-device="phone"] #hketa-hand-group { display: inline-flex; gap: 6px; align-items: center; }

html[data-device="phone"][data-hand="right"] #mobile-tabbar { flex-direction: row-reverse; }

html[data-device="phone"] #open-map-drawer-btn { display: none !important; }

html[data-device="phone"] .hketa-header-phone-hidden { display: none !important; }

html[data-device="phone"] #stop-list { padding-bottom: calc(140px + env(safe-area-inset-bottom)); }

html[data-mode="std"] #mode-pill-sim, html[data-mode="std"] #mode-pill-elder,
html[data-mode="simple"] #mode-pill-std, html[data-mode="simple"] #mode-pill-elder,
html[data-mode="elder"] #mode-pill-std, html[data-mode="elder"] #mode-pill-sim {
    background: transparent !important; color: #cbd5e1 !important;
}
html[data-mode="std"] #mode-pill-std, html[data-mode="simple"] #mode-pill-sim, html[data-mode="elder"] #mode-pill-elder {
    background: #34d399 !important; color: #052e21 !important; font-weight: 900 !important;
}

html[data-mode="elder"] { font-size: 18px; }
html[data-mode="elder"] [id^="stop-name-"] { font-size: 22px !important; line-height: 1.3; }
html[data-mode="elder"] [id^="inline-eta-"] span { font-size: 19px !important; padding: 6px 10px !important; }
html[data-mode="elder"] #stop-list > li { border-radius: 0 !important; box-shadow: none !important; background: #fff !important; margin: 0 !important; border: 0 !important; border-bottom: 2px solid #0f172a !important; min-height: 74px !important; }
html[data-mode="elder"] #stop-list > li:active { transform: none !important; }
html[data-mode="elder"] #app-header *, html[data-mode="elder"] #sidebar *, html[data-mode="elder"] #mobile-tabbar * { animation: none !important; transition: none !important; }
html[data-mode="elder"] .animate-pulse { animation: none !important; }
html[data-mode="elder"] #welcome-list-sub, html[data-mode="elder"] #company-subtitle { display: none !important; }
html[data-mode="elder"] [id^="stop-fare-pill-"], html[data-mode="elder"] [id^="stop-fare-pill-"] a {
    font-size: 15px !important; border-radius: 0 !important; background: #fff !important; color: #0f172a !important;
    border: 2px solid #0f172a !important; box-shadow: none !important;
}
html[data-device="phone"][data-mode="elder"] #mobile-tabbar button { min-height: 66px; font-size: 14px; }
html[data-device="phone"][data-mode="elder"] #mobile-tabbar button i { font-size: 24px; }

html[data-device="phone"] { --hketa-dock-h: 68px; }
html[data-device="phone"][data-mode="elder"] { --hketa-dock-h: 78px; }
html[data-device="phone"] #dir-container {
    position: fixed; left: 0; right: 0; z-index: 1655;
    bottom: calc(59px + var(--hketa-dock-h) + env(safe-area-inset-bottom));
    background: #fff; border-top: 2px solid #cbd5e1; border-bottom: 2px solid #cbd5e1;
    padding: 8px 10px; box-shadow: 0 -4px 14px rgba(2, 6, 23, .10);
}
html[data-device="phone"] #dir-container.hidden { display: none !important; }
html[data-device="phone"] #stop-list { padding-bottom: calc(59px + var(--hketa-dock-h) + 66px + env(safe-area-inset-bottom)); }

html[data-device="phone"] {
    --hketa-tab-h: 57px;
    --hketa-dock-h: 68px;
    --hketa-rail-h: 110px;
    --hketa-dir-h: 52px;
    --hketa-loc-h: 44px;
    --hketa-gap: 4px;
}
html[data-device="phone"][data-mode="elder"] {
    --hketa-tab-h: 67px;
    --hketa-dock-h: 78px;
    --hketa-rail-h: 136px;
    --hketa-dir-h: 70px;
    --hketa-loc-h: 70px;
    --hketa-gap: 4px;
}

html[data-device="phone"] #mobile-tabbar { z-index: 5101; }
html[data-device="phone"] #hketa-tool-rail { z-index: 5103; }
html[data-device="phone"] #dir-container { z-index: 5104; }
html[data-device="phone"] #loc-update-ctrl { z-index: 5105; }
html[data-device="phone"] #close-map-drawer-btn { z-index: 5106; }
html[data-device="phone"] #modal-overlay { z-index: 5500; }

html[data-device="phone"] #hketa-tool-rail {
    position: fixed; left: 0; right: 0; box-sizing: border-box;
    bottom: calc(var(--hketa-tab-h) + var(--hketa-dock-h));
    display: flex; flex-wrap: wrap; align-items: center; gap: 5px; padding: 4px 8px;
    background: rgba(11, 18, 32, .95); border-top: 1px solid rgba(148, 163, 184, .22);
}
html[data-device="phone"] #hketa-tool-rail > * { pointer-events: auto; }

html[data-device="phone"][data-hand="right"] #hketa-tool-rail { flex-direction: row; justify-content: flex-end; }
html[data-device="phone"][data-hand="left"] #hketa-tool-rail { flex-direction: row-reverse; justify-content: flex-end; }
html[data-device="phone"] #hketa-tool-rail #hketa-hand-group { order: 1; }
html[data-device="phone"] #hketa-tool-rail #simple-mode-btn { order: 2; }
html[data-device="phone"] #hketa-tool-rail #lang-toggle-group { order: 3; }
html[data-device="phone"] #hketa-tool-rail #header-traffic-btn { order: 4; }
html[data-device="phone"] #hketa-tool-rail .hketa-legal-btn { order: 5; }
html[data-device="phone"] #hketa-tool-rail #hketa-rail-refresh { order: 6; }
html[data-device="phone"] #hketa-tool-rail .hketa-like-btn { order: 7; }
html[data-device="phone"] #hketa-tool-rail .hketa-rail-btn,
html[data-device="phone"] #hketa-tool-rail .hketa-chrome-btn {
    min-width: 50px; min-height: 48px; padding: 0 8px; border-radius: 12px; border: 1px solid #475569;
    background: #1e293b; color: #e2e8f0; font-size: 11px; font-weight: 900;
    display: inline-flex; align-items: center; justify-content: center; gap: 5px;
}
html[data-device="phone"] #hketa-tool-rail .hketa-rail-btn i,
html[data-device="phone"] #hketa-tool-rail .hketa-chrome-btn i { font-size: 17px; }

html[data-device="phone"]:not([data-mode="elder"]) #hketa-tool-rail #hketa-rail-refresh span { display: none; }

html[data-device="phone"] #hketa-tool-rail #lang-toggle-group,
html[data-device="phone"] #hketa-tool-rail #simple-mode-btn { height: 48px; padding: 2px; }
html[data-device="phone"] #hketa-tool-rail #lang-toggle-group button,
html[data-device="phone"] #hketa-tool-rail #simple-mode-btn span {
    min-height: 44px; min-width: 44px; padding: 0 9px; font-size: 13px; display: inline-flex; align-items: center;
}

html[data-device="phone"] #hketa-tool-rail .hketa-hand-group { display: inline-flex; gap: 5px; order: 1; }
html[data-device="phone"] #hketa-tool-rail .hketa-hand-set {
    min-width: 62px; min-height: 48px; padding: 0 9px; font-size: 12px; font-weight: 900; border-radius: 12px;
    background: rgba(15, 23, 42, .94); color: #cbd5e1; border: 1px solid #475569;
    display: inline-flex; align-items: center; justify-content: center; gap: 4px;
}
html[data-device="phone"] #hketa-tool-rail .hketa-hand-set.on { background: #6ee7b7; color: #06281c; border-color: #047857; }
html[data-device="phone"] #hketa-tool-rail .hketa-hand-set.on::after { content: " ✓"; font-weight: 900; }
html[data-device="phone"] #hketa-tool-rail [data-hand-set="left"] i { transform: scaleX(-1); }

html[data-device="phone"] #dir-container {
    left: 0; right: 0; box-sizing: border-box; padding: 5px 8px;
    bottom: calc(var(--hketa-tab-h) + env(safe-area-inset-bottom));
    background: rgba(11, 18, 32, .95); border-top: 1px solid rgba(148, 163, 184, .22); border-bottom: 0; box-shadow: none;
}
html[data-device="phone"] #dir-container #dir-row { display: flex; gap: 6px; align-items: stretch; }
html[data-device="phone"] #dir-container .hketa-dir-btn {
    flex: 1 1 0; min-width: 0; min-height: 40px; padding: 0 10px; border-radius: 12px;
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    background: #10b981; color: #0f172a; border: 2px solid #059669; font-weight: 900; font-size: 13px;
}
html[data-device="phone"] #dir-container .hketa-dir-btn > span { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
html[data-device="phone"] #dir-container .hketa-dir-btn:active { transform: scale(.97); }

html[data-device="phone"] #stop-list {
    padding-bottom: calc(var(--hketa-tab-h) + var(--hketa-dock-h) + var(--hketa-rail-h) + var(--hketa-dir-h) + env(safe-area-inset-bottom));
    -webkit-overflow-scrolling: touch;
}

html[data-device="phone"][data-mobile-view="map"] #dir-container { display: none !important; }
html[data-device="phone"][data-mobile-view="map"] #hketa-tool-rail { bottom: var(--hketa-tab-h); }
html[data-device="phone"] #loc-update-ctrl {
    position: fixed; top: auto; left: 8px; right: 8px; box-sizing: border-box; padding: 5px 7px;
    bottom: calc(var(--hketa-tab-h) + var(--hketa-dock-h) + var(--hketa-rail-h) + var(--hketa-gap));
    border-radius: 12px; max-width: none;
}
html[data-device="phone"][data-mobile-view="map"] #loc-update-ctrl {
    bottom: calc(var(--hketa-tab-h) + var(--hketa-rail-h) + var(--hketa-gap));
}
html[data-device="phone"] #close-map-drawer-btn {
    top: auto; left: 8px; right: 8px; justify-content: center; min-height: 44px;
    bottom: calc(var(--hketa-tab-h) + var(--hketa-dock-h) + var(--hketa-rail-h) + var(--hketa-loc-h) + 2 * var(--hketa-gap));
}
html[data-device="phone"][data-mobile-view="map"] #close-map-drawer-btn {
    bottom: calc(var(--hketa-tab-h) + var(--hketa-rail-h) + var(--hketa-loc-h) + 2 * var(--hketa-gap));
}

html[data-device="phone"][data-mobile-view="map"] .gps-btn,
html[data-device="phone"][data-mobile-view="map"] .radar-btn,
html[data-device="phone"][data-mobile-view="map"] .browse-btn { display: none !important; }

html[data-device="phone"] #modal-overlay { padding: 0; align-items: flex-end; }
html[data-device="phone"] #modal-overlay > div {
    width: 100%; max-width: 100%; height: 92dvh; max-height: 92dvh; border: 0; border-radius: 20px 20px 0 0;
}
html[data-device="phone"] #modal-body { order: 1; flex: 1 1 auto; min-height: 0; padding: 10px 8px; }
html[data-device="phone"] #modal-subbar {
    order: 2; position: static; flex: 0 0 auto; background: #f8fafc;
    border-top: 2px solid #cbd5e1; border-bottom: 0; padding: 8px;
}
html[data-device="phone"] #modal-overlay > div > div:first-child {
    order: 3; flex: 0 0 auto; padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
}
html[data-device="phone"] #modal-overlay > div > div:first-child button { min-width: 60px; min-height: 56px; font-size: 22px; }
html[data-device="phone"][data-hand="left"] #modal-overlay > div > div:first-child { flex-direction: row-reverse; }

html[data-device="phone"] #modal-subbar > div { gap: 6px; }

html[data-device="phone"] #modal-subbar > div > div:first-child > button { min-height: 44px; flex: 1 1 30%; font-size: 13px; padding: 8px 10px; }
html[data-device="phone"] #dir-subcat-row button { min-height: 40px; font-size: 12px; padding: 6px 10px; }
html[data-device="phone"] #modal-subbar > div > div:last-child > button { flex: 0 0 auto; min-height: 44px; }
html[data-device="phone"] #modal-subbar .relative { flex: 1 1 auto; min-width: 0; }
html[data-device="phone"] #modal-subbar .relative > button { min-width: 40px; min-height: 40px; }
html[data-device="phone"] #modal-subbar #dir-filter-input { min-height: 48px; font-size: 16px; width: 100%; }
html[data-device="phone"][data-mode="elder"] #modal-subbar > div > div:first-child > button { min-height: 56px; font-size: 15px; }
html[data-device="phone"][data-mode="elder"] #modal-subbar > div > div:last-child > button { min-height: 56px; font-size: 14px; }
html[data-device="phone"][data-mode="elder"] #dir-subcat-row button { min-height: 48px; font-size: 14px; }
html[data-device="phone"][data-mode="elder"] #modal-subbar .relative > button { min-width: 48px; min-height: 48px; }
html[data-device="phone"][data-mode="elder"] #modal-subbar #dir-filter-input { min-height: 56px; font-size: 17px; }

html[data-device="desktop"] #dir-container, html[data-device="tablet"] #dir-container { display: none !important; }

html[data-mode="elder"] #app-header *, html[data-mode="elder"] #sidebar *, html[data-mode="elder"] #mobile-tabbar *,
html[data-mode="elder"] #hketa-tool-rail *, html[data-mode="elder"] #dir-container *,
html[data-mode="elder"] #loc-update-ctrl *, html[data-mode="elder"] #close-map-drawer-btn *, html[data-mode="elder"] #welcome-warning-modal * {
    animation: none !important; transition: none !important; box-shadow: none !important;
}
html[data-mode="elder"] #app-header *, html[data-mode="elder"] #mobile-tabbar *,
html[data-mode="elder"] #hketa-tool-rail *, html[data-mode="elder"] #dir-container *, html[data-mode="elder"] #loc-update-ctrl *,
html[data-mode="elder"] #close-map-drawer-btn * { border-radius: 0 !important; }
html[data-mode="elder"] #modal-overlay > div, html[data-mode="elder"] #modal-overlay > div * { border-radius: 0 !important; }
html[data-mode="elder"] #modal-overlay *, html[data-mode="elder"] #modal-overlay > div * { animation: none !important; }

html[data-device="phone"][data-mode="elder"] #hketa-tool-rail .hketa-rail-btn,
html[data-device="phone"][data-mode="elder"] #hketa-tool-rail .hketa-chrome-btn,
html[data-device="phone"][data-mode="elder"] #hketa-tool-rail .hketa-hand-set,
html[data-device="phone"][data-mode="elder"] #hketa-tool-rail #lang-toggle-group button,
html[data-device="phone"][data-mode="elder"] #hketa-tool-rail #simple-mode-btn span,
html[data-device="phone"][data-mode="elder"] #header-weather-btn, html[data-device="phone"][data-mode="elder"] #header-traffic-btn,
html[data-device="phone"][data-mode="elder"] #loc-update-ctrl .hketa-loc-btn,
html[data-device="phone"][data-mode="elder"] #loc-update-ctrl select,
html[data-device="phone"][data-mode="elder"] #close-map-drawer-btn,
html[data-device="phone"][data-mode="elder"] #dir-container .hketa-dir-btn {
    min-height: 56px !important; min-width: 56px !important; font-size: 15px !important;
}
html[data-device="phone"][data-mode="elder"] #hketa-tool-rail #lang-toggle-group,
html[data-device="phone"][data-mode="elder"] #hketa-tool-rail #simple-mode-btn { height: auto !important; min-height: 60px !important; padding: 2px !important; }
html[data-device="phone"][data-mode="elder"] #hketa-tool-rail #hketa-rail-refresh span { display: inline !important; }

html[data-mode="elder"] #loc-interval-group { display: none !important; }
html[data-device="phone"][data-mode="elder"] #loc-pause-text { display: none !important; }

html[data-mode="elder"] #hketa-tool-rail .hketa-hand-set i,
html[data-mode="elder"] #hketa-tool-rail #hketa-rail-refresh i { display: none !important; }
html[data-mode="elder"] #hketa-tool-rail #simple-mode-btn span { padding: 0 6px !important; }
html[data-mode="elder"] #hketa-tool-rail #lang-toggle-group button { min-width: 56px; padding: 0 4px; }
html[data-mode="elder"] #hketa-tool-rail .hketa-rail-btn,
html[data-mode="elder"] #hketa-tool-rail .hketa-chrome-btn { padding: 0 6px !important; }

html[data-device="phone"][data-mode="elder"] #loc-update-ctrl #loc-pause-btn {
    min-height: 56px !important; min-width: 56px !important; padding: 0 10px !important; font-size: 15px !important;
}

html[data-mode="elder"] #bus-count { display: none !important; }
html[data-mode="elder"] #loc-interval-group { display: none !important; }
html[data-mode="elder"] #loc-interval-select { display: none !important; }

html[data-device="phone"] { --hketa-dock-h: 0px; }
html[data-device="phone"] #hketa-tool-rail { flex-wrap: wrap !important; align-items: center; }
html[data-device="phone"] #hketa-tool-rail::-webkit-scrollbar { display: none; }
html[data-device="phone"] #hketa-tool-rail > * { flex: 0 0 auto; }

  #mobile-tabbar {
    display: grid !important;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 4px; padding: 6px 8px calc(8px + env(safe-area-inset-bottom));
    align-items: end;
  }
  #mobile-tabbar > button {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 2px; min-height: 44px; font-size: 11px; padding: 6px 2px;
  }
  #mobile-tabbar > button:nth-child(1) { order: 3; min-height: 60px; margin-top: -12px; font-weight: 900; }
  #mobile-tabbar > button:nth-child(2) { order: 1; }
  #mobile-tabbar > button:nth-child(3) { order: 2; }
  #mobile-tabbar > button:nth-child(4) { order: 4; }
  #mobile-tabbar > button:nth-child(5) { order: 5; }

  #mobile-tabbar > .hketa-tab-primary {
    background: #10b981 !important; color: #0f172a !important;
    border-color: #059669 !important; box-shadow: 0 8px 20px rgba(0,0,0,.30);
  }

  html[data-device="phone"] #hketa-tool-rail {
    top: auto !important;
    bottom: calc(80px + env(safe-area-inset-bottom)) !important;
    left: auto; right: auto;
    width: auto !important; max-width: 62vw;
    display: flex !important; flex-direction: column !important; align-items: flex-end;
    flex-wrap: nowrap !important; gap: 6px;
    padding: 6px; border-radius: 14px;
    transition: transform .16s ease, opacity .16s ease;
  }

  html[data-device="phone"][data-hand="right"] #hketa-tool-rail { right: 8px !important; left: auto !important; align-items: flex-end; }
  html[data-device="phone"][data-hand="left"] #hketa-tool-rail { left: 8px !important; right: auto !important; align-items: flex-start; }

  html[data-hand="right"] #hketa-hand-group [data-hand-set="right"] { display: none !important; }
  html[data-hand="left"] #hketa-hand-group [data-hand-set="left"] { display: none !important; }
  #hketa-hand-group { display: flex !important; gap: 4px; flex-direction: column; }
  #hketa-tool-rail > button { min-height: 40px; padding: 6px 10px; font-size: 11px; }

  #hketa-tool-rail > button { display: inline-flex; align-items: center; gap: 3px; line-height: 1.15; }
  #hketa-tool-rail .rail-label { font-size: 10px; font-weight: 800; letter-spacing: .2px; white-space: nowrap; }
  #hketa-tool-rail > button i { font-size: 13px; }
  #hketa-rail-tab { position: static !important; }

  html[data-rail-open="0"] #hketa-tool-rail > button:not(#hketa-rail-tab) { display: none !important; }
  html[data-rail-open="0"] #hketa-tool-rail #hketa-hand-group { display: none !important; }
  html[data-rail-open="0"] #hketa-tool-rail { padding: 0 !important; background: transparent !important; box-shadow: none !important; }
  html[data-rail-open="0"][data-hand="right"] #hketa-tool-rail { transform: translateX(10px); }
  html[data-rail-open="0"][data-hand="left"] #hketa-tool-rail { transform: translateX(-10px); }

  html[data-device="phone"][data-mode="elder"] #hketa-tool-rail > button { min-height: 52px; font-size: 13px; padding: 8px 12px; }
  html[data-device="phone"][data-mode="elder"] #hketa-tool-rail .rail-label { font-size: 12px; }
  html[data-device="phone"][data-mode="elder"] #hketa-tool-rail > button i { font-size: 15px; }
  html[data-device="phone"][data-mode="elder"] #hketa-tool-rail { gap: 8px; }

html[data-rail-open="0"] #hketa-tool-rail { display: none !important; }

html[data-rail-open="1"] #hketa-tool-rail {

    bottom: var(--hketa-tab-h, 57px) !important;
    background: rgba(255,255,255,.98) !important;
    border-top: 1px solid #cbd5e1 !important;
    box-shadow: 0 -8px 20px rgba(15,23,42,.20) !important;
    max-height: 40vh;
    overflow: hidden;
}

html[data-rail-open="1"] #hketa-tab-more { color: #10b981 !important; }

#map-main { isolation: isolate; }

#modal-overlay.hidden { display: none !important; }

html[data-device="phone"] #mobile-tabbar { z-index: 6000 !important; }

html[data-device="phone"] #modal-overlay { bottom: var(--hketa-tab-h, 57px) !important; }
html[data-device="phone"] #toast-container { z-index: 6100 !important; }

html[data-device="phone"] #toast-container {
    top: calc(var(--hketa-title-offset) + var(--hketa-title-h) + 8px);
}

#modal-subbar #dir-cat-row,
#modal-subbar > div:first-child > div:first-child {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .5rem;
    width: 100%;
}
#modal-subbar button[id^="dir-cat-btn-"],
#modal-subbar > div:first-child > div:first-child > button {
    flex: none !important;
    width: 100% !important;
    min-height: 52px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

#modal-subbar > div:first-child > div:first-child > button:not([id^="dir-cat-btn-"]) { grid-column: span 2; }
#modal-subbar #dir-subcat-row button[id^="dir-co-btn-"] {
    flex: 1 1 auto;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
#modal-subbar #dir-search-row > button {
    flex: 0 0 92px;
    min-height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding-left: .5rem;
    padding-right: .5rem;
}

html[data-mode="elder"] #modal-subbar button[id^="dir-cat-btn-"],
html[data-mode="elder"] #modal-subbar > div:first-child > div:first-child > button { min-height: 66px; font-size: 1.05rem; }
html[data-mode="elder"] #modal-subbar #dir-subcat-row button[id^="dir-co-btn-"] { min-height: 54px; font-size: 1.02rem; }
html[data-mode="elder"] #modal-subbar #dir-search-row > button { min-height: 58px; flex-basis: 108px; }
@media (min-width: 640px) {
    #modal-subbar #dir-cat-row,
    #modal-subbar > div:first-child > div:first-child { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

#modal-subbar > div:first-child > div:first-child > button:not([id^="dir-cat-btn-"]) { grid-column: auto !important; }

:root {

    --hketa-inset-top: env(safe-area-max-inset-top, env(safe-area-inset-top, 0px));
    --hketa-inset-bottom: env(safe-area-inset-bottom, 0px);
    --hketa-title-h: 44px;
    --hketa-title-gap: 6px;
    --hketa-title-offset: calc(var(--hketa-inset-top) + var(--hketa-title-gap));
}

html[data-device="phone"] #app-header {
    position: fixed;
    top: var(--hketa-title-offset);
    left: 8px;
    right: 8px;
    width: auto;
    z-index: 5200;
    padding: 5px 8px;
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.86);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.30);
}

html[data-device="phone"] #app-header #header-logo-img,
html[data-device="phone"] #app-header #header-icon-bg { width: 28px; height: 28px; }
html[data-device="phone"] #app-header #app-main-title { font-size: 12px; }

html[data-device="phone"] #app-header #lang-toggle-group button,
html[data-device="phone"] #app-header #simple-mode-btn { min-height: 30px; min-width: 30px; }

#layout-override-btn { display: none !important; }

.hketa-svc-live { animation: hketa-peak-blink 1.6s ease-in-out infinite; }
@keyframes hketa-peak-blink { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }

html[data-device="phone"] #sidebar {
    flex: 0 0 40vh;
    height: 40vh;
    min-height: 0;
    margin-top: calc(var(--hketa-title-offset) + var(--hketa-title-h) + 6px);
}

html[data-device="phone"][data-mode="std"] #map-main {
    flex: 1 1 auto;
    height: auto;
    min-height: 0;
    position: relative;
}

html[data-device="phone"] #map-main.hketa-map-strip {
    flex: 0 0 26vh;
    height: 26vh;
    min-height: 0;
    position: relative;
}

html[data-device="phone"] #map-main.hketa-map-sheet {
    position: fixed;
    inset: 0;
    z-index: 4500;
    height: auto;
    min-height: 0;
    transform: translateX(0);
    transition: transform .3s ease;
    pointer-events: auto;
    background: #0f172a;
}

html[data-device="phone"] body.hketa-simple-mode #sidebar {
    flex: 1 1 auto;
    height: auto;
    margin-top: calc(var(--hketa-title-offset) + var(--hketa-title-h) + 6px);
}
html[data-device="phone"] body.hketa-simple-mode #open-map-drawer-btn {
    top: calc(var(--hketa-inset-top) + 52px);
    bottom: auto;
}

.hketa-off { opacity: .58; filter: brightness(0.82); }
html[data-mode="elder"] .hketa-off { opacity: 1 !important; filter: none !important; }
html[data-mode="elder"] .opacity-60 { opacity: 1 !important; }

html[data-mode="elder"] #app-header #lang-toggle-group button,
html[data-mode="elder"] #app-header #simple-mode-btn {
    min-height: 44px;
    min-width: 44px;
    font-size: 1rem;
}
html[data-mode="elder"] #app-header #mode-label { font-size: 1rem; }
html[data-mode="elder"] #app-header #lang-toggle-group,
html[data-mode="elder"] #app-header #simple-mode-btn { padding: 2px; }

html[data-mode="elder"] .text-slate-400,
html[data-mode="elder"] .text-slate-500 { color: #334155 !important; }

html[data-mode="elder"] #search-dropdown > div.hketa-off,
html[data-mode="elder"] #stop-list li.hketa-off {
    border: 1.5px dashed #94a3b8;
    border-radius: 12px;
}

html[data-mode="elder"] body.hketa-simple-mode [id^="stop-name-"] {
    font-size: calc(1.18rem * max(1, env(preferred-text-scale, 1))) !important;
}

@media (prefers-reduced-motion: reduce) {
    html[data-device="phone"] * { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

:root { --hketa-shell-w: 430px; }
@supports (width: min(1px, 2px)) {
    :root { --hketa-shell-w: min(430px, 100vw); }
}
@media (min-width: 700px) {
    html[data-device="phone"] #app-body {
        width: var(--hketa-shell-w);
        max-width: var(--hketa-shell-w);
        margin-inline: auto;
        box-shadow: 0 0 0 1px #1e293b, 0 18px 46px rgba(0, 0, 0, .45);
    }

    html[data-device="phone"] #app-header {
        left: 50%;
        right: auto;
        transform: translateX(-50%);
        width: calc(var(--hketa-shell-w) - 16px);
    }

    html[data-device="phone"] #mobile-tabbar {
        left: 50%;
        right: auto;
        transform: translateX(-50%);
        width: var(--hketa-shell-w);
    }

    html[data-device="phone"] #toast-container {
        left: auto;
        right: calc(50% - (var(--hketa-shell-w) / 2) + 8px);
        top: calc(var(--hketa-title-offset) + var(--hketa-title-h) + 8px);
        width: calc(var(--hketa-shell-w) - 16px);
        max-width: calc(var(--hketa-shell-w) - 16px);
    }

    html[data-device="phone"] #modal-overlay > div {
        max-width: calc(var(--hketa-shell-w) - 24px);
        width: 100%;
    }

    html[data-device="phone"] #hketa-tool-rail {
        left: 50%;
        right: calc(50% - (var(--hketa-shell-w) / 2) + 8px);
        width: auto;
        max-width: calc(var(--hketa-shell-w) - 16px);
    }
    html[data-device="phone"][data-hand="right"] #hketa-tool-rail {
        left: auto !important;
        right: calc(50% - (var(--hketa-shell-w) / 2) + 8px) !important;
    }
    html[data-device="phone"][data-hand="left"] #hketa-tool-rail {
        right: auto !important;
        left: calc(50% - (var(--hketa-shell-w) / 2) + 8px) !important;
    }
}

.hketa-dir-window {
    display: block;
    margin-top: 2px;
    padding: 1px 4px;
    max-width: 100%;
    font-size: 10.5px;
    font-weight: 800;
    line-height: 1.15;
    color: #065f46;
    background: #ecfdf5;
    border: 1px solid #6ee7b7;
    border-radius: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.hketa-dir-window:empty { display: none; }
@media (prefers-reduced-motion: reduce) {
    .hketa-dir-window { animation: none !important; }
}

html[data-device="phone"] #app-header {
  background: linear-gradient(135deg, #065f46 0%, #047857 100%) !important;
}
html[data-device="phone"] #mobile-tabbar {
  background: #ffffff !important;
  border-top: 1px solid #d1fae5 !important;
  box-shadow: 0 -4px 20px rgba(16, 185, 129, 0.15) !important;
}
html[data-device="phone"] #mobile-tabbar button {
  color: #065f46 !important;
}
html[data-device="phone"] #mobile-tabbar button.on,
html[data-device="phone"] #mobile-tabbar .hketa-tab-primary {
  color: #ffffff !important;
  background: #10b981 !important;
  border-radius: 16px !important;
}
#stop-list > li:first-child {
  border: none !important;
}

html[data-device="phone"] #mobile-tabbar .hketa-tab-primary {
  background: #059669 !important;
  color: #ffffff !important;
  border-radius: 50% !important;
  width: 58px !important;
  height: 58px !important;
  min-height: 58px !important;
  margin-top: -8px !important;
  box-shadow: 0 4px 14px rgba(5, 150, 105, 0.45) !important;
  border: 3px solid #ffffff !important;
  flex-direction: column !important;
  gap: 0 !important;
  padding: 6px !important;
}
html[data-device="phone"] #mobile-tabbar .hketa-tab-primary i {
  font-size: 18px !important;
}
html[data-device="phone"] #mobile-tabbar .hketa-tab-primary span {
  font-size: 9px !important;
  line-height: 1.1 !important;
  font-weight: 800 !important;
}
html[data-device="phone"] #mobile-tabbar button span {
  font-size: 9px !important;
  line-height: 1.15 !important;
  text-align: center !important;
}
html[data-device="phone"] #mobile-tabbar {
  background: #ffffff !important;
  border-top: 1px solid #e5e7eb !important;
  padding-bottom: env(safe-area-inset-bottom, 8px) !important;
}

#dir-container { display: none !important; }

.hketa-logo-glow { filter: drop-shadow(0 2px 6px rgba(16, 185, 129, .45)); }
.hketa-stopname-mid { font-size: 15px; }

.hketa-home { list-style: none; padding: 12px; background: #f1f5f9; display: flex; flex-direction: column; gap: 12px; }
.hketa-home-card { background: #15803d; border-radius: 20px; padding: 10px; box-shadow: 0 6px 18px rgba(21,128,61,.28); display: flex; flex-direction: column; gap: 10px; }
.hketa-home-search { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 46px; padding: 0 14px; background: #fff; color: #334155; border-radius: 14px; font-weight: 800; font-size: 15px; text-align: left; box-shadow: 0 1px 3px rgba(0,0,0,.15); }
.hketa-home-search i:first-child { color: #15803d; }
.hketa-home-search span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hketa-home-dots { color: #94a3b8; }
.hketa-home-near { display: flex; align-items: stretch; gap: 8px; }
.hketa-home-near-main { flex: 1; min-width: 0; min-height: 46px; display: flex; align-items: center; gap: 8px; padding: 0 12px; background: #166534; color: #fff; border: 1px solid rgba(255,255,255,.25); border-radius: 14px; font-weight: 900; font-size: 14px; }
.hketa-home-chip { width: 58px; min-height: 46px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; background: #fff; color: #15803d; border-radius: 14px; font-weight: 900; font-size: 11px; flex-shrink: 0; }
.hketa-home-chip i { font-size: 15px; }
.hketa-home-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.hketa-home-tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 64px; padding: 8px 2px; background: #16a34a; color: #fff; border-radius: 14px; font-weight: 800; font-size: 12px; transition: transform .1s, background .15s; }
.hketa-home-tile i { font-size: 20px; }
.hketa-home-tile:hover { background: #22c55e; }
.hketa-home-tile:active, .hketa-home-search:active, .hketa-home-near-main:active, .hketa-home-chip:active, .hketa-home-go:active { transform: scale(.96); }
.hketa-home-trips-title { margin: 0 2px 6px; font-size: 12px; font-weight: 900; color: #475569; }
.hketa-home-trip { display: flex; align-items: center; gap: 10px; padding: 10px 12px; margin-bottom: 8px; background: #fff; border: 1px solid #e2e8f0; border-radius: 16px; box-shadow: 0 1px 2px rgba(15,23,42,.06); }
.hketa-home-badge { min-width: 48px; padding: 5px 8px; border-radius: 10px; color: #fff; font-weight: 900; font-size: 14px; text-align: center; }
.hketa-home-trip-name { flex: 1; min-width: 0; font-weight: 800; font-size: 13px; color: #334155; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hketa-home-go { background: #16a34a; color: #fff; font-weight: 900; font-size: 12px; padding: 8px 14px; border-radius: 12px; flex-shrink: 0; }
.hketa-home-empty { display: flex; align-items: center; gap: 10px; padding: 12px; background: #fff; border: 1px dashed #cbd5e1; border-radius: 16px; color: #64748b; font-size: 12px; font-weight: 700; }
.hketa-home-empty i { color: #ec4899; font-size: 16px; }
.hketa-home-sub { margin: 0; text-align: center; font-size: 10px; font-weight: 700; color: #94a3b8; }
html[data-mode="elder"] .hketa-home-tile { min-height: 76px; font-size: 15px; }
html[data-mode="elder"] .hketa-home-tile i { font-size: 26px; }
html[data-mode="elder"] .hketa-home-search, html[data-mode="elder"] .hketa-home-near-main, html[data-mode="elder"] .hketa-home-chip { min-height: 56px; font-size: 16px; }
html[data-mode="elder"] .hketa-home-go { min-height: 48px; font-size: 15px; }
html[data-mode="simple"] .hketa-home-near, html[data-mode="simple"] .hketa-home-sub { display: none; }
