body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    font-family: 'Helvetica Neue', Arial, sans-serif;
    overflow: hidden;
}

#header-bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50px;
    background-color: #2c3e50;
    color: white;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1001;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}
.site-title {
    margin: 0;
    font-size: 1.5em;
    font-weight: bold;
}
.update-info {
    font-size: 0.9em;
    opacity: 0.8;
}
#update-time {
    font-weight: bold;
}

#map {
    position: absolute;
    top: 50px;
    bottom: 0;
    width: 100%;
    height: auto;
}

.bus-marker {
    /* アイコン中心合わせのため空 */
}

/* .bus-icon は .bus-marker の中のカスタムHTML */
.bus-marker .bus-icon {
    background-color: #fff;
    color: #333;
    border-radius: 5px;
    border: 1px solid #ccc;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    padding: 3px 5px;
    white-space: nowrap;
    font-size: 11px;
    line-height: 1.2;
    text-align: left;
    display: flex;
    align-items: center;
    min-width: 60px;
    transform: translate(-50%, -50%); /* 中心合わせ */
}
.bus-marker .bus-icon .route-label {
    background-color: #4CAF50;
    color: white;
    padding: 1px 4px;
    border-radius: 3px;
    font-weight: bold;
    margin-right: 4px;
}
.bus-marker .bus-icon .destination-text {
    font-weight: bold;
    color: #333;
}
.bus-marker .bus-icon .details {
    display: none; /* 号車非表示 */
}
.bus-marker .bus-icon .vehicle-no {
    font-weight: bold;
}

/* ポップアップのスタイル */
.leaflet-popup-content-wrapper {
    border-radius: 8px;
    padding: 0;
}
.leaflet-popup-content {
    margin: 0;
    width: auto !important;
    font-family: 'Helvetica Neue', Arial, sans-serif;
    color: #333;
    line-height: 1.5;
}
.leaflet-popup-content b { font-size: 1.1em; }
.leaflet-popup-content small { color: #555; }


/* 左下パネルのスタイル */
#info-panel {
    position: absolute;
    bottom: 30px;
    left: 10px;
    background: #fff;
    padding: 0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    z-index: 1000;
    width: 320px;
    max-height: 80%;
    overflow-y: auto;
    display: none;
}
#info-panel .panel-header {
    background-color: #2c3e50;
    color: white;
    padding: 12px 15px;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    font-weight: bold;
    font-size: 1.2em;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
#info-panel .panel-header span { display: block; line-height: 1.2; }
#info-panel .panel-header .route-dest { font-size: 1.1em; }
#info-panel .panel-header .vehicle-id { font-size: 0.8em; opacity: 0.8; }
#info-panel .panel-body { padding: 15px; }
#info-panel .next-stop-info { font-size: 1.1em; margin-bottom: 10px; padding-bottom: 10px; border-bottom: 1px solid #eee; }
#info-panel .next-stop-info strong { color: #d35400; }
#info-panel .panel-body p { margin: 8px 0; font-size: 0.9em; }
#info-panel .stop-list { list-style: none; padding: 0; margin: 0; max-height: 250px; overflow-y: auto; border: 1px solid #eee; border-radius: 5px; }
#info-panel .stop-list li { padding: 8px 10px; border-bottom: 1px solid #f8f8f8; font-size: 0.9em; display: flex; justify-content: space-between; align-items: center; }
#info-panel .stop-list li:last-child { border-bottom: none; }
#info-panel .stop-list li.current-stop { background-color: #e6f7ff; font-weight: bold; }
#info-panel .stop-list li span.stop-name { flex-grow: 1; }
#info-panel .stop-list li span.arrival-time { font-weight: bold; color: #555; margin-left: 10px; }
#info-panel .stop-list li.past-stop { color: #999; text-decoration: line-through; }
#info-panel .stop-list li.past-stop .arrival-time { color: #bbb; }
#info-panel .close-button { background: none; border: none; color: white; font-size: 1.5em; cursor: pointer; padding: 0 5px; line-height: 1; }
#info-panel .close-button:hover { color: #ccc; }


/* バス停アイコン */
.emoji-stop-icon {
    font-size: 20px;
    text-shadow: 0 0 3px rgba(0,0,0,0.3);
    width: 24px;
    height: 24px;
    line-height: 24px;
    text-align: center;
}

/* エリア切り替え */
.header-controls {
    display: flex;
    align-items: center;
}
#depot-switcher {
    background-color: #4a6580;
    color: white;
    border: 1px solid #7a92a8;
    border-radius: 4px;
    padding: 5px 8px;
    font-size: 0.9em;
    font-weight: bold;
    margin-right: 15px;
    cursor: pointer;
}
#depot-switcher:hover {
    background-color: #5a7b9a;
}

/* 遅延表示用のスタイル */
.delay-info {
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 3px;
    display: inline-block;
    margin-left: 8px;
    font-size: 0.9em;
}
.delay-info.delayed { background-color: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.delay-info.early { /* 早着は定刻として表示されるので不要 */ }
.delay-info.on_time { background-color: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.delay-info.unknown { background-color: #e2e3e5; color: #383d41; border: 1px solid #d6d8db; }
.leaflet-popup-content .delay-info { font-size: 0.8em; margin-left: 0; margin-top: 4px; }

/* ★★★ バス停ハイライト用スタイル (新規追加) ★★★ */
.leaflet-marker-icon.current-route-stop .emoji-stop-icon {
    transform: scale(1.5); /* 少し大きくする */
    text-shadow: 0 0 5px #e74c3c, 0 0 10px #e74c3c; /* 赤い光彩 */
}