/**
 * バスロケーションシステム用CSS
 */

/* バスロケーションモードでのUI非表示 */
body.buslocation-mode .js-header-update {
    display: none !important;
}

/* 路線・系統情報ヘッダー */
.info_head.buslocation {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 15px 20px;
}

.info_head.buslocation .route_info {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 10px;
    color: #fff;
}

.info_head.buslocation .route_info p {
    margin: 0;
    font-size: 16px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 5px;
}

.info_head.buslocation .route_info .route_label,
.info_head.buslocation .route_info .series_label,
.info_head.buslocation .route_info .service_label {
    font-size: 14px;
    opacity: 0.9;
    font-weight: normal;
}

/* 停留所一覧 */
.info_content.buslocation {
    background: #f8f9fa;
    flex: 1;
    overflow-y: auto;
}

/* ボタングループ（戻る＋出発ボタン） */
.info_content.buslocation .btn_group {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
}

/* 戻るボタン - テキスト改行防止 */
.info_content.buslocation .btn_group .btn_back_to_list {
    white-space: nowrap;
}

.info_content.buslocation .btn_group .btn_back_to_list .label {
    font-size: 3.6rem;
    white-space: nowrap;
}

/* 出発ボタン - フォントサイズ統一 */
.info_content.buslocation .btn_group .btn_service_start .label {
    font-size: 3.6rem;
}

/* 路線名ヘッダーのテキストスタイル */
.info_head.buslocation .route_info_combined {
    color: #fff !important;
}

.info_head.buslocation .route_name_value {
    font-size: 1.5rem;
    font-weight: bold;
    color: #fff;
}

.info_head.buslocation .service_name {
    font-size: 1.3rem;
    color: #fff;
    opacity: 0.95;
}

.stop_list {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* 停留所アイテム */
.stop_item {
    background: #fff;
    border-bottom: 2px solid #e9ecef;
    transition: all 0.3s ease;
}

.stop_item:hover {
    background: #f8f9fa;
}

.stop_item.arrived {
    background: #e8f5e9;
    opacity: 0.8;
}

.stop_item.next {
    border-left: 5px solid #ff9800;
    background: #fff8e1;
}

.stop_item_inner {
    padding: 15px;
}

/* 停留所ヘッダー */
.stop_header {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.stop_number {
    flex-shrink: 0;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 24px;
    font-weight: bold;
}

.stop_item.arrived .stop_number {
    background: linear-gradient(135deg, #66bb6a 0%, #43a047 100%);
}

.stop_info {
    flex: 1;
}

.stop_name {
    font-size: 18px;
    font-weight: bold;
    margin: 0 0 5px 0;
    color: #212529;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.stop_name:hover {
    color: #667eea;
}

.stop_address {
    font-size: 14px;
    color: #6c757d;
    margin: 0 0 5px 0;
}

.scheduled_time {
    font-size: 14px;
    margin: 0;
}

.scheduled_time .time_label {
    color: #6c757d;
}

.scheduled_time .time_value {
    font-weight: bold;
    color: #212529;
    font-size: 100%; /* inherit from parent (24px later) or just remove the small size */
}

/* バッジ */
.stop_name .badge {
    display: inline-block;
    padding: 2px 8px;
    font-size: 12px;
    font-weight: bold;
    border-radius: 4px;
    background: #ffc107;
    color: #000;
}

.stop_name .badge.departure {
    background: #4caf50;
    color: #fff;
}

.stop_name .badge.terminal {
    background: #f44336;
    color: #fff;
}

/* 停留所アクション */
.stop_actions {
    display: flex;
    flex-direction: row;
    gap: 15px;
}

/* 乗降客数入力 */
.passenger_input {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.input_group {
    flex: 1;
    min-width: 140px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f8f9fa;
    padding: 10px;
    border-radius: 8px;
}

.input_group label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
    font-weight: bold;
    color: #495057;
    margin: 0;
    white-space: nowrap;
}

.input_group .icon {
    width: 20px;
    height: 20px;
    display: inline-block;
}

.input_group .icon.boarding::before {
    content: "↑";
    font-size: 20px;
    color: #4caf50;
}

.input_group .icon.alighting::before {
    content: "↓";
    font-size: 20px;
    color: #2196f3;
}

.boarding_input,
.alighting_input {
    width: 60px;
    padding: 8px;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    font-size: 16px;
    font-weight: bold;
    text-align: center;
    transition: all 0.2s ease;
}

.boarding_input:focus,
.alighting_input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.boarding_input:disabled,
.alighting_input:disabled {
    background: #e9ecef;
    color: #6c757d;
    cursor: not-allowed;
}

.input_group .unit {
    font-size: 14px;
    color: #6c757d;
}

/* 停留所ボタン */
.stop_buttons {
    display: flex;
    gap: 10px;
}

.stop_buttons .btn {
    flex: 1;
}

.btn.arrival .btn_inner {
    background: linear-gradient(135deg, #4caf50 0%, #43a047 100%);
}

.btn.arrival:hover .btn_inner {
    background: linear-gradient(135deg, #43a047 0%, #388e3c 100%);
}

.btn.arrival.disabled .btn_inner {
    background: #9e9e9e;
    cursor: not-allowed;
    opacity: 0.5;
}

.btn.arrival .icon.arrival::before {
    content: "✓";
    font-size: 20px;
    font-weight: bold;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .passenger_input {
        flex-direction: column;
    }

    .input_group {
        min-width: 100%;
    }

    .stop_buttons {
        flex-direction: column;
    }
}

/* スクロールバーのスタイル */
.stop_list::-webkit-scrollbar,
.service_list::-webkit-scrollbar {
    width: 8px;
}

.stop_list::-webkit-scrollbar-track,
.service_list::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.stop_list::-webkit-scrollbar-thumb,
.service_list::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.stop_list::-webkit-scrollbar-thumb:hover,
.service_list::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* 便一覧スタイル */
.info_content.buslocation.services {
    background: #f8f9fa;
}

.service_list {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
}

/* 便アイテム */
.service_item {
    background: #fff;
    border-bottom: 2px solid #e9ecef;
    cursor: pointer;
    transition: all 0.3s ease;
}

.service_item:hover {
    background: #f8f9fa;
    transform: translateX(5px);
}

.service_item.active {
    background: #fff3e0;
    border-left: 5px solid #ff9800;
}

.service_item.departed {
    background: #e3f2fd;
    border-left: 5px solid #2196f3;
}

/* Googleロゴボタン非表示 */
.gm-style-cc,
.google_button {
    display: none !important;
}

.service_item.completed,
.service_item.finished {
    background: #f1f3f4;
    opacity: 0.8;
    border-left: 5px solid #bdc1c6;
}

.status_badge.finished {
    background-color: #607d8b;
}

.service_item.pending {
    background: #fff;
}

.service_item_inner {
    padding: 20px 25px;
    /* Increased padding */
}

/* 便・停留所一覧の二重スクロール解消 */
/* ヘッダー固定、中身を丸ごとスクロールさせる */
.info_content.buslocation {
    max-height: calc(100vh - 2vh);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.service_list,
.stop_list {
    overflow-y: visible;
    /* 親でスクロールするため */
}

/* 便一覧ヘッダー */
.service_header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.service_info {
    flex: 1;
}

.service_info .service_name {
    font-size: 27px;
    /* 18px * 1.5 */
    font-weight: bold;
    margin: 0 0 12px 0;
    color: #333;
    display: flex;
    align-items: center;
    gap: 12px;
}

.service_info .route_name {
    color: #667eea;
}

.service_info .series {
    color: #764ba2;
    font-size: 24px;
    /* 16px * 1.5 */
}

.service_info .name {
    color: #333;
}

.service_info .service_time {
    font-size: 24px;
    /* 16px * 1.5 */
    margin: 0 0 8px 0;
    color: #666;
}

.service_info .time_label {
    font-size: 21px;
    /* 14px * 1.5 */
    opacity: 0.8;
}

.service_info .time_value {
    font-weight: bold;
    color: #333;
}

.service_info .service_route {
    font-size: 21px;
    /* 14px * 1.5 */
    color: #666;
    margin: 0;
}

.service_info .arrow {
    margin: 0 8px;
    color: #999;
}

.service_info .from,
.service_info .to {
    font-weight: 500;
}

/* サービス一覧用バッジ */
.status_badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 18px;
    font-weight: bold;
    color: #fff;
    margin-left: 10px;
}

.status_badge.departed {
    background-color: #2196f3;
}

.service_stats {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.stat_item {
    text-align: right;
}

.stat_item .label {
    display: block;
    font-size: 18px;
    color: #999;
    margin-bottom: 4px;
}

.stat_item .value {
    display: block;
    font-size: 30px;
    font-weight: bold;
    color: #667eea;
}

/* 停留所ヘッダー */
.stop_header {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 20px;
}

.stop_number {
    background: #f1f3f4;
    color: #5f6368;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: bold;
    flex-shrink: 0;
}

.stop_name {
    font-size: 27px;
    /* 18px * 1.5 */
    font-weight: bold;
    color: #333;
    margin-bottom: 8px;
    line-height: 1.2;
}

.stop_address {
    font-size: 21px;
    /* 14px * 1.5 */
    color: #666;
    margin-bottom: 8px;
}

.scheduled_time {
    font-size: 24px;
    /* 16px * 1.5 */
    color: #666;
    margin: 0;
}

.scheduled_time .time_label {
    margin-right: 8px;
    opacity: 0.8;
}

.scheduled_time .time_value {
    font-weight: bold;
    color: #333;
}

/* 停留所アクション（3列横並び） */
.stop_actions {
    display: flex;
    gap: 15px;
    align-items: stretch;
}

.passenger_btn_group,
.arrival_btn_group {
    flex: 1;
    min-width: 0;
}

.passenger_btn_group {
    background: #fff;
    border: 3px solid #e0e0e0;
    border-radius: 12px;
    padding: 10px 5px;
    cursor: pointer;
    transition: all 0.2s;
}

.passenger_btn_group:active {
    background: #f8f9fa;
    transform: scale(0.98);
}

.passenger_btn_inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.passenger_btn_group .label {
    font-size: 18px;
    color: #666;
    font-weight: bold;
}

.passenger_btn_group .value {
    font-size: 36px;
    font-weight: bold;
    color: #333;
}

.passenger_btn_group .unit {
    font-size: 18px;
    color: #999;
}

.passenger_btn_group.boarding {
    border-color: #bbdefb; /* Darker blue than previous #e3f2fd */
}

.passenger_btn_group.alighting {
    border-color: #f8bbd0; /* Darker pink than previous #fce4ec */
}

/* Disabled state */
.passenger_btn_group.disabled {
    background: #f5f5f5;
    border-color: #e0e0e0;
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none; /* Prevent clicks on disabled elements */
}

/* 到着ボタン（ブロック形式） */
.arrival_btn_group {
    display: flex;
}

.arrival_btn_group .arrival.btn04 {
    width: 100%;
    height: 100%;
    min-height: 10rem;
    border-radius: 12px;
    overflow: hidden;
    margin: 0;
}

.arrival_btn_group .arrival.btn04 a {
    width: 100%;
    height: 100%;
    display: flex;
}

.arrival_btn_group .arrival.btn04 .btn_inner {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #607d8b;
    /* デフォルト: グレー */
}

.arrival_btn_group .arrival.btn04.status_arrived .btn_inner {
    background-color: #2196f3;
    /* 到着済: 青 */
}

.arrival_btn_group .arrival.btn04.status_passed .btn_inner {
    background-color: #ff9800;
    /* 通過: オレンジ */
}

.arrival_btn_group .arrival.btn04 .label {
    font-size: 24px;
    font-weight: bold;
    color: #fff;
}

/* 運行終了ボタン */
.btn_service_end {
    display: block;
    margin: 40px auto 100px auto !important;
    /* 下部に余白を確保 */
}


.stop_item {
    border-bottom: 1px solid #eee;
}

.stop_item_inner {
    padding: 30px;
}

@media (max-width: 768px) {
    .stop_item_inner {
        padding: 20px;
    }
}


/* テンキーパネル用スタイル */
.modal_overlay.numpad_modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal_overlay.numpad_modal.active {
    opacity: 1;
}

.modal_content.numpad_content {
    background: #fff;
    border-radius: 12px;
    padding: 0;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* テンキーパネル */
.numpad_panel {
    padding: 20px;
}

.numpad_header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e9ecef;
}

.numpad_title {
    font-size: 20px;
    font-weight: bold;
    color: #333;
    margin: 0;
}

.numpad_close {
    background: none;
    border: none;
    font-size: 32px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    line-height: 1;
    transition: color 0.2s;
}

.numpad_close:hover {
    color: #333;
}

/* テンキー表示部分 */
.numpad_display_container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 10px;
    padding: 16px 0px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px;
}

.numpad_display {
    font-size: 48px;
    font-weight: bold;
    color: #fff;
    text-align: center;
    min-width: 100px;
}

.numpad_unit {
    font-size: 24px;
    color: #fff;
    opacity: 0.9;
}

/* テンキーコントロール */
.numpad_controls {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.numpad_side_buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.numpad_grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    flex: 1;
}

/* テンキーボタン */
.numpad_button {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 24px;
    font-weight: bold;
    color: #333;
    padding: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
    height: 6rem;
}

.numpad_button:hover {
    background: #e9ecef;
    border-color: #667eea;
    transform: scale(1.05);
}

.numpad_button:active {
    transform: scale(0.95);
}

.numpad_button.number {
    background: #fff;
}

.numpad_button.clear {
    background: #ffc107;
    color: #fff;
    border-color: #ffc107;
}

.numpad_button.clear:hover {
    background: #ffb300;
}

.numpad_button.increment,
.numpad_button.decrement {
    background: #667eea;
    color: #fff;
    border-color: #667eea;
    height: 6rem;
}

.numpad_button.increment:hover,
.numpad_button.decrement:hover {
    background: #5568d3;
}

.numpad_button.increment .icon,
.numpad_button.decrement .icon {
    font-size: 32px;
}

.numpad_button.increment .label,
.numpad_button.decrement .label {
    font-size: 14px;
    font-weight: normal;
}

/* アクションボタン */
.numpad_actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.numpad_button.cancel,
.numpad_button.confirm {
    flex: 1;
    font-size: 18px;
    padding: 15px;
}

.numpad_button.cancel {
    background: #6c757d;
    color: #fff;
    border-color: #6c757d;
}

.numpad_button.cancel:hover {
    background: #5a6268;
}

.numpad_button.confirm {
    background: #28a745;
    color: #fff;
    border-color: #28a745;
}

.numpad_button.confirm:hover {
    background: #218838;
}

/* 入力フィールドをクリック可能にする */
.passenger_input input {
    cursor: pointer;
    user-select: none;
}

.passenger_input input:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .modal_content.numpad_content {
        width: 95%;
    }

    .numpad_display {
        font-size: 36px;
    }

    .numpad_button {
        padding: 15px;
        font-size: 20px;
    }
}

/* 戻るボタンをフッターボタンと同じスタイルに */
.btn_back_to_list.btn01 {
    width: 12rem !important;
    height: 6rem !important;
}

.btn_back_to_list.btn01 a {
    background-color: #9e9e9e !important;
    border-color: #757575 !important;
}

.btn_back_to_list.btn01 a:hover {
    background-color: #757575 !important;
}

/* 運行終了ボタンが他の要素の上に重ならないように */
.btn_service_end {
    position: static !important;
    display: block !important;
    margin: 40px auto 100px auto !important;
    clear: both !important;
    width: 40rem !important;
    height: 10rem !important;
}

/* スクロールコンテナ内の出発ボタンのスタイル */
.info_content.buslocation>.btn_service_start {
    width: 40rem !important;
    height: 10rem !important;
    margin: 20px auto !important;
    display: block !important;
}


/* 戻るボタンの色を地味にする */
.btn_back_to_list.btn03 a {
    background-color: #607d8b !important;
    border-color: #546e7a !important;
}

.btn_back_to_list.btn03 a:hover {
    background-color: #546e7a !important;
}

@media (orientation: landscape) {

    /* 全体レイアウト調整 - サイドメニュー分の余白 */
    body.buslocation-mode {
        padding-right: 100px !important;
        padding-bottom: 0 !important;
    }

    body.buslocation-mode.menu-left {
        padding-right: 0 !important;
        padding-left: 100px !important;
    }

    /* ヘッダー位置調整（左メニュー時） */
    body.buslocation-mode.menu-left #common_header {
        left: 0px ;
        width: 100% ;
    }

    /* フッター → サイドメニュー変換 (#common_footer) */
    #common_footer {
        position: fixed !important;
        z-index: 99 !important;
        /* ヘッダー(100)より下 */
        right: 0 !important;
        left: auto !important;
        height: 100% !important;
        top: 0 !important;
        padding-top: 15vh !important;
        max-width: 10vw !important;
        width: 10vw !important;
        min-width: 80px !important;
        bottom: auto !important;
    }

    /* 左配置の場合 */
    body.buslocation-mode.menu-left #common_footer {
        left: 0 !important;
        right: auto !important;
    }

    /* フッター内 .footer_inner - 縦配置 */
    #common_footer .footer_inner {
        flex-direction: column !important;
        flex-wrap: nowrap !important;
        align-items: center !important;
        justify-content: flex-start !important;
        height: auto !important;
        gap: 5vh;
        padding: 0vh 5px 4vh 5px !important;
    }

    /* フッター内アイテム - 縦配置用リセット */
    #common_footer .footer_inner .footer_item {
        width: 100% !important;
        max-width: none !important;
        min-width: unset !important;
        margin: 0 !important;
        padding: 0 !important;
        flex: 0 0 auto !important;
        border-right: none !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
    }

    #common_footer .footer_inner .footer_item:last-child {
        border-bottom: none !important;
    }

    /* ボタン形状調整（縦長・アイコン強調） */
    #common_footer .footer_item .btn {
        width: 100% !important;
    }

    #common_footer .footer_item .btn a {
        flex-direction: column !important;
        height: 6rem !important;
        padding: 10px 0 !important;
        gap: 4px !important;
        min-height: 6rem !important;
        justify-content: center !important;
        align-items: center !important;
    }

    /* 設定ボタンの下に余白を追加（PWA操作バー回避） */
    #common_footer .footer_item:has(.btn_setting),
    #common_footer .footer_item .btn_setting {
        margin-bottom: 6rem !important;
    }

    #common_footer .footer_item .btn .icon {
        margin: 0 2rem !important;
        width: 2.5rem !important;
        height: auto;
        position: static !important;
        transform: none !important;
        left: auto !important;
        top: auto !important;
    }

    #common_footer .footer_item .btn .label {
        font-size: 3rem !important;
        line-height: 1.1 !important;
        text-align: center !important;
        white-space: nowrap !important;
    }

    /* map, view などの複合アイテム */
    #common_footer .footer_item.map,
    #common_footer .footer_item.view {
        flex-direction: column !important;
        gap: 5px !important;
    }

    /* スクロールボタン(▲▼)を縦に配置 */
    #common_footer .footer_item.scroll {
        flex-direction: column !important;
        gap: 5px !important;
    }

    #common_footer .footer_item.scroll .btn {
        width: 100% !important;
    }

    /* 戻るボタン（停留所一覧表示時のみ表示、デフォルト非表示） */
    #common_footer .footer_item.back {
        visibility: hidden !important;
        pointer-events: none !important;
    }

    /* 停留所一覧表示時は戻るボタンを表示 */
    body.stoplist-mode #common_footer .footer_item.back {
        visibility: visible !important;
        pointer-events: auto !important;
    }

    /* 設定モーダルの文字サイズ縮小 (横レイアウト) */
    #modal_setting {
        font-size: 80% !important;
    }

    #modal_setting .modal_title .label {
        font-size: 2.8rem !important;
    }

    #modal_setting .modal_content .font_size_title {
        font-size: 2.8rem !important;
    }

    #modal_setting .modal_content .btn .label {
        font-size: 2.8rem !important;
    }

    /* サイドメニューのテキストを縦書き */
    #common_footer .footer_item .btn .label {
        writing-mode: vertical-rl !important;
        text-orientation: upright !important;
        letter-spacing: 0.1em !important;
    }

    /* 設定ボタンを下部に配置 */
    #common_footer .footer_inner .footer_item:last-child {
        margin-top: auto !important;
    }

    /* ========== メインコンテナ調整 ========== */
    body.buslocation-mode #common_main {
        height: calc(100vh - 9rem) !important;
        margin-top: 9rem !important;
        overflow: hidden !important;
        padding-bottom: 0 !important;
        position: relative !important;
    }

    /* 情報コンテンツ領域の高さ調整 (横レイアウトではフッターがないため) */
    body.buslocation-mode .pnl_info .info_content {
        flex: 1;
        overflow-y: auto !important;
        padding-bottom: 0 !important;
    }

    body.buslocation-mode .info_content.buslocation.services {
        flex: 1;
        overflow-y: auto !important;
        padding-bottom: 0 !important;
    }

    /* pnl_infoとその内部をflex配置に */
    body.buslocation-mode .pnl_info {
        display: flex !important;
        flex-direction: column !important;
        height: 100% !important;
    }

    body.buslocation-mode .pnl_info_inner {
        display: flex;
        flex-direction: column;
        height: 100% !important;
        flex: 1;
        overflow-y: hidden !important;
    }

    /* ========== 情報モード (mode-info) ========== */
    body.buslocation-mode.mode-info .pnl_info {
        width: calc(100vw - 10vw) !important;
        height: calc(100vh - 9rem) !important;
        left: 0 !important;
        top: 9rem !important;
        position: fixed !important;
    }

    body.buslocation-mode.menu-left.mode-info .pnl_info {
        left: 100px !important;
    }

    /* ========== 地図モード (mode-map) ========== */
    body.buslocation-mode.mode-map .pnl_map {
        width: calc(100vw - 10vw) !important;
        height: calc(100vh - 9rem) !important;
        left: 0 !important;
        top: 9rem !important;
        right: auto !important;
        position: fixed !important;
    }

    body.buslocation-mode.menu-left.mode-map .pnl_map {
        left: 100px !important;
    }

    /* ========== 分割モード (mode-split) - 50/50 ========== */
    body.buslocation-mode.mode-split .pnl_info {
        width: calc((100vw - 10vw) / 2) !important;
        height: calc(100vh - 9rem) !important;
        left: 0 !important;
        top: 9rem !important;
        position: fixed !important;
        border-right: 1px solid #ccc !important;
    }

    body.buslocation-mode.mode-split .pnl_map {
        width: calc((100vw - 10vw) / 2) !important;
        height: calc(100vh - 11rem) !important;
        left: calc((100vw - 10vw) / 2) !important;
        top: 9rem !important;
        right: auto !important;
        position: fixed !important;
    }

    /* 分割モード - 左メニュー時 */
    body.buslocation-mode.menu-left.mode-split .pnl_info {
        left: 100px !important;
    }

    body.buslocation-mode.menu-left.mode-split .pnl_map {
        left: calc(100px + (100vw - 10vw) / 2) !important;
    }

    /* js-mode-view-split クラスも同様に対応 */
    body.buslocation-mode.js-mode-view-split .pnl_list {
        width: calc((100vw - 10vw) / 2) !important;
        height: calc(100vh - 9rem) !important;
        left: 0 !important;
        top: 9rem !important;
        position: fixed !important;
        border-right: 1px solid #ccc !important;
        border-bottom: none !important;
    }

    body.buslocation-mode.js-mode-view-split .pnl_map {
        width: calc((100vw - 10vw) / 2) !important;
        height: calc(100vh - 9rem) !important;
        left: calc((100vw - 10vw) / 2) !important;
        top: 9rem !important;
        right: auto !important;
        position: fixed !important;
    }

    body.buslocation-mode.menu-left.js-mode-view-split .pnl_list {
        left: 100px !important;
    }

    body.buslocation-mode.menu-left.js-mode-view-split .pnl_map {
        left: calc(100px + (100vw - 10vw) / 2) !important;
    }

    /* マップコントロールの位置調整 - 地図の中央下部 */
    body.buslocation-mode .pnl_map .controller {
        left: 50% !important;
        right: auto !important;
        transform: translateX(-50%) !important;
    }

    /* 共通コンテナのスタイル上書き */
    body.buslocation-mode #wrapper,
    body.buslocation-mode .container {
        padding-bottom: 0 !important;
        height: calc(100vh - 9rem) !important;
        overflow: hidden !important;
    }

    /* メニュー配置ボタン用（Settings Modal） */
    .menu_position_btn {
        display: flex;
        gap: 10px;
    }

    .menu_position_btn .btn {
        flex: 1;
    }

    /* モーダル（設定・連絡事項パネル）の横幅・高さ調整 */
    .modal {
        width: calc(100vw - 10vw) !important;
        max-width: calc(100vw - 10vw) !important;
        height: calc(100vh - 9rem) !important;
    }

    /* 確認ダイアログは全画面表示を維持 */
    .modal#modal_confirm_dialog {
        width: 100vw !important;
        max-width: 100vw !important;
        height: 100vh !important;
        top: 0 !important;
        left: 0 !important;
        z-index: 2000 !important; /* Ensure it's on top of everything */
    }

    .modal_inner {
        height: 100% !important;
        overflow-y: auto !important;
    }

    /* タッチデバイスでのフォーカス状態リセット */
    #common_footer .footer_item .btn a:focus,
    #common_footer .footer_item .btn a:active {
        outline: none !important;
        background-color: inherit !important;
    }

    /* タップ後のハイライト除去 */
    #common_footer .footer_item .btn a {
        -webkit-tap-highlight-color: transparent !important;
    }

}

/* Map Compass Overlay */
#map_compass_container {
    position: absolute;
    top: 50px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    display: none;
    /* Initially hidden */
    pointer-events: none;
    /* Allow clicks to pass through to map */
}

#map_compass_image {
    width: 6rem;
    height: auto;
    transition: transform 0.1s linear;
    /* Smooth rotation */
    filter: drop-shadow(0px 2px 4px rgba(0, 0, 0, 0.5));
}

/*--------------- トースト通知（警告） ---------------*/
.toast-notification.warning {
    background-color: #ff9800; /* Orange for warning */
    color: #fff;
}

/*--------------- 無効化ボタン ---------------*/
.btn.disabled,
.passenger_btn_group.disabled,
.arrival_btn_group.disabled,
.btn_service_end.disabled {
    opacity: 0.6;
    filter: grayscale(100%);
    cursor: not-allowed;
    pointer-events: auto; /* Allow clicks to show toast */
}