/* =========================================
    基本設定
   ========================================= */
/* 1. body全体の高さを svh に変更 */
body {
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    height: 100svh; /* 100vh から 100svh に変更 */
    font-family: "Helvetica Neue", Arial, sans-serif;
    background: #fdf6e3;
    overflow: hidden; /* 全体のスクロールを禁止 */
}

html {
    height: 100svh;
}

/* 2. 地図レイアウトの計算も svh を基準にする */
#map-layout {
    /* ヘッダー(64px)を引いた残りをきっちり表示 */
    height: calc(100svh - 64px);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

/* サイドバー内の検索エリア設定 */
.sidebar-search-area {
    background: #f39c12;
    padding: 15px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    z-index: 10;
    flex-shrink: 0; /* フォームが潰れないように固定 */
}

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

.search-inner select,
.search-inner input {
    width: 100% !important;
    height: 40px;
    border-radius: 6px;
    border: 1px solid #ddd;
    padding: 0 10px;
    font-size: 0.9rem;
    box-sizing: border-box;
}

.search-input-group {
    display: flex;
    gap: 5px;
}

.btn-search-icon {
    background: #d35400;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 0 15px;
    cursor: pointer;
}

/* 地図切り替えボタンのスタイル */
.btn-route-toggle {
    background: #2980b9;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 5px;
}

/* リストエリアの高さ調整（検索フォームを除いた残り） */
#panel-list {
    flex-grow: 1;
    overflow-y: auto;
    position: relative; /* absoluteから変更 */
    height: auto;
}

/* 既存の .controls (画面上部のバー) が不要な場合は display:none か削除 */
.controls {
    display: none;
}

/* =========================================
    コントロール
   ========================================= */
.controls{
    padding:16px;
    background:#fff;
    display:flex;
    flex-wrap:wrap;
    gap:12px;
    justify-content:center;
    align-items:center;
    border-bottom:3px solid #e67e22;
    flex-shrink:0;
    width: 100%;
    box-sizing: border-box;
}

select,
input[type="text"],
input[type="number"]{
    padding:0 12px;
    font-size:1rem;
    height:48px;
    border:2px solid #ccc;
    border-radius:8px;
    box-sizing:border-box;
}
select{
    cursor:pointer;
    background:#fff;
}
input[type="text"],
input[type="number"]{
    flex-grow:1;
    max-width:420px;
}

/* 検索ボタン */
.btn-search{
    height:48px;
    padding:0 20px;
    font-size:1rem;
    font-weight:bold;
    color:#fff;
    background:#e67e22;
    border:none;
    border-radius:8px;
    cursor:pointer;
    box-shadow:0 4px 0 #d35400;
    transition:all 0.1s;
}

.btn-search:active{
    transform:translateY(4px);
    box-shadow:none;
}


/* =========================================
    ステータスバー
   ========================================= */
#status-bar{
    padding:10px;
    background:#333;
    color:#fff;
    font-size:0.9rem;
    text-align:center;
}
/* 戻るボタン：左端に固定した */
.btn-back {
    position: absolute;      /* 絶対配置 */
    left: 16px;              /* 左端からの距離 */
    top: 50%;                /* 上下中央 */
    transform: translateY(-50%); /* 位置の微調整 */

    background: none;
    border: none;
    color: #fff;
    font-size: 2rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    z-index: 10;
}
/* =========================================
メインコンテナ
   ========================================= */
.container{
    flex-grow: 1;
    display: flex;
    position: relative;

    /* 横幅の制限を解除して画面いっぱいに広げる設定 */
    width: 100% !important;
    max-width: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* =========================================
サイドバー本体
   ========================================= */
#sidebar{
    width:300px;
    background:#fff;
    border-right:2px solid #ddd;
    display:flex;
    flex-direction:column;
    position:relative;
    overflow:hidden;
    transition:margin-left 0.3s ease,transform 0.3s ease;

    z-index: 5;
}

/* PC用サイドバー閉 */
.container.sidebar-closed #sidebar{
    margin-left:-300px;
}

/* パネル */
#panel-list,
#panel-detail{
    width:100%;
    height:100%;
    overflow-y:auto;
    position:absolute;
    top:0;
    left:0;
    background:#fff;
    transition:transform 0.3s cubic-bezier(0.25,0.8,0.25,1);
}

/* パネル位置 */
#panel-list{ transform:translateX(0); z-index:1; }
#panel-detail{
    transform:translateX(100%);
    z-index:2;
    display:flex;
    flex-direction:column;
}
#panel-detail.active{
    transform:translateX(0);
}

/* =========================================
詳細ヘッダー
   ========================================= */
.detail-header {
    position: relative;      /* ボタンを配置する基準点にする */
    display: flex;
    align-items: center;
    justify-content: center; /* タイトルを中央揃えにする */
    padding: 12px 16px;
    background: #d35400;
    color: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    flex-shrink: 0;
    min-height: 30px;        /* レイアウト崩れ防止のための高さ確保 */
}


/* タイトル：中央配置 */
#detail-title {
    margin: 0;
    font-size: 1.2rem;
    font-weight: bold;
    white-space: nowrap;
    overflow: hidden;
    /*text-overflow: ellipsis;*/
    white-space: normal;    /* 複数行対応 */
    line-height: 1.0;       /* 行間調整 */
    max-width: 60%;
    text-align: center;
}

/* 詳細コンテンツ */
#detail-content{
    padding:24px;
    font-size:1rem;
}
.detail-label{
    font-size:0.9rem;
    color:#999;
    margin-top:14px;
    margin-bottom:4px;
}
.detail-value{
    font-size:1.2rem;
    color:#333;
    font-weight:bold;
    margin-bottom:8px;
    line-height:1.4;
}
.detail-link{
    color:#3498db;
    word-break:break-all;
    text-decoration:none;
}
.facility-link{
    display:inline-block;
    margin-top:8px;
    padding:6px 12px;
    background:#3498db;
    color:#fff;
    text-decoration:none;
    border-radius:4px;
    font-size:0.9rem;
}
.facility-link:hover{
    background:#2980b9;
}

/* サイドバー横にある開閉バー */
#sidebar-toggle-area {
    position: absolute;
    top: 0;
    left: 360px; /* サイドバー幅と合わせる */
    width: 40px;
    height: 100%;
    background: #d35400;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 9999;
    transition: left 0.3s ease;
    user-select: none;
}
/* ボタンの矢印アイコン */
#toggle-icon {
    font-size: 32px;
    font-weight: bold;
}

/* PC：サイドバーが閉じたときの位置 */
.container.sidebar-closed #sidebar-toggle-area {
    left: 0;
}


/* =========================================
マップ
   ========================================= */
#map{
    flex:1;
    z-index:1;

}

/* Leaflet zoom拡大 */
.leaflet-control-zoom{
    transform:scale(1.2);
    transform-origin:bottom left;
    margin-left: 45px !important;
    margin-bottom: 15px !important;
}
.leaflet-control-zoom a{
    width:40px!important;
    height:40px!important;
    line-height:40px!important;
    font-size:22px!important;
    margin: 10 10 10 10!important;
}

/* =========================================
    リストアイテム
   ========================================= */
.item{
    display: block; /* articleタグ用 */
    padding:16px;
    border-bottom:2px solid #eee;
    cursor:pointer;
    transition:background-color 0.2s;
}
.item:hover{ background-color:#fff3e0; }
.item-name{
    font-weight:bold;
    color:#d35400;
    font-size:1.2rem;
    /* h3タグになったためマージンをリセット */
    margin: 0 0 6px 0;
}
.item-meta{
    font-size:0.95rem;
    color:#555;
    margin-top:6px;
    line-height:1.4;
}

/* =========================================
サイドバー横にある水色の開閉バー
   ========================================= */
#sidebar-toggle-area {
    position: absolute;
    top: 0;
    left: 300px; /* サイドバー幅と合わせる */
    width: 40px;
    height: 100%;
    background: #58b7ff;  /* 画像のような水色 */
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 9999;
    transition: left 0.3s ease;
    user-select: none;

    border: none;
    padding: 0;
    margin: 0;
    appearance: none;
    -webkit-appearance: none;
    font-family: inherit;
}

/* ボタンの矢印アイコン */
#toggle-icon {
    font-size: 24px;
    font-weight: bold;

}

/* PC：サイドバーが閉じたときの位置 */
.container.sidebar-closed #sidebar-toggle-area {
    left: 0;
}

/* Googleマップボタンの基本スタイル（PC・スマホ共通） */
.btn-google-map {
    display: inline-block;
    margin-top: 5px;
    margin-bottom: 10px;
    color: #34a853;
    text-decoration: none;
    font-weight: bold;
    font-size: 1rem;
    border: 1px solid #34a853;
    padding: 4px 10px;
    border-radius: 4px;
    background: #fff; /* 背景色 */
    transition: background 0.2s;
}

/* ホバー時の動き（マウスを乗せたとき） */
.btn-google-map:hover {
    background: #e8f5e9;
}

/* 路線（地図切替）ボタン：検索ボタンのスタイルをベースに色を変更 */
.btn-route {
    height: 48px;
    padding: 0 20px;
    font-size: 1rem;
    font-weight: bold;
    color: #fff;
    background: #2980b9; /* 青色に変更 */
    border: none;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 4px 0 #1c5980;
    transition: all 0.1s;
    margin-left: 1px; /* 検索ボタンとの隙間 */
}
/* ボタンを囲むエリア */
.btn-row {
    display: flex;       /* 横並びにする */
    gap: 10px;           /* ボタンの間の隙間 */
    align-items: center; /* 上下中央揃え */
}

.btn-route:active {
    transform: translateY(4px);
    box-shadow: none;
}

/* 押されている状態（国土地理院表示中）のスタイル */
.btn-route.active {
    background: #1abc9c; /* 緑色っぽく変化 */
    box-shadow: 0 4px 0 #16a085;
}
.btn-route.active:active {
    transform: translateY(4px);
    box-shadow: none;
}
/* PC・スマホ共通：ボタンをまとめる枠 */
.search-btn-group {
    display: flex;       /* 横並びにする */
    gap: 8px;            /* ボタン同士の隙間 */
    align-items: center; /* 上下中央揃え */
}

/* PC表示時の微調整：既存のmarginを打ち消し */
.search-btn-group .btn-route {
    margin-left: 0 !important; /* gapで隙間を作るのでmarginは不要 */
}
.sidebar-search-accordion {
        width: 100%;           /* サイドバーの幅いっぱいに広げる */
        box-sizing: border-box; /* パディングを含めた幅計算にする */
}

.search-toggle-btn {
    width: 100%;
    padding: 10px;
    background: #ffffff; /* オレンジ系（お好みで） */
    color: rgb(0, 0, 0);
    border-bottom: 3px solid #e67e22;
    border: none;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

/* アコーディオンの中身の入力項目も横幅いっぱいに */
.search-inner {
    display: flex;
    flex-direction: column;
    padding: 10px;
    gap: 8px;
    background: #fcd79d;
}

.search-inner select,
.search-inner input {
    width: 100% !important; /* 強制的に横幅いっぱいにする */
    box-sizing: border-box;
}
    /* クリアボタン専用スタイル */
.btn-clear {
    color: rgb(0, 0, 0);
    border: none;
    padding: 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: opacity 0.2s;
    text-decoration: none;
}
.btn-clear:hover {
    color: #000;
    text-decoration: underline; /* ホバーで下線を消すとお洒落 */
}

.btn-clear:hover {
    opacity: 0.8;
}
/* =========================================
RESPONSIVE DESIGN - ENHANCED ALL SIZES
   ========================================= */

/* Extra Small Mobile (≤374px) - iPhone SE */
@media(max-width:374px){
    #status-bar {
        padding: 4px 8px;
        font-size: 0.75rem;
    }

    .controls{
        padding:10px;
        gap:8px;
    }

    select,
    input[type="text"],
    input[type="number"]{
        width: calc(50% - 4px);
        height: 40px;
        font-size: 0.85rem;
    }

    .btn-search{
        width: 100%;
        height: 40px;
        font-size: 0.8rem;
        padding: 0 12px;
    }

    #sidebar{
        width: calc(100vw - 35px);
    }

    .container.sidebar-closed #sidebar{
        margin-left: calc(35px - 100vw);
    }

    #sidebar-toggle-area {
        width: 35px;
    }

    .item-name{
        font-size: 0.85rem;
    }

    .item-meta{
        font-size: 0.7rem;
    }

    .list-item{
        padding: 8px 6px;
    }

    #detail-title{
        font-size: 0.9rem;
    }

    .detail-label{
        font-size: 0.75rem;
    }

    .detail-value{
        font-size: 0.85rem;
    }

    .btn-google-map{
        font-size: 0.5rem;
        padding: 3px 8px;
    }
}

/* Small Mobile (375px - 480px) - Most phones portrait */
@media(min-width:375px) and (max-width:480px){
    .controls{
        padding:12px;
        gap:10px;
    }

    select,
    input[type="text"]{
        width: calc(50% - 5px);
        height: 42px;
        font-size: 0.9rem;
    }

    .btn-search{
        width: 100%;
        max-width: 220px;
        height: 42px;
        font-size: 0.9rem;
    }

    #sidebar{
        width: calc(100vw - 40px);
    }

    .container.sidebar-closed #sidebar{
        margin-left: calc(40px - 100vw);
    }

    #sidebar-toggle-area {
        width: 40px;
    }

    .item-name{
        font-size: 1rem;
    }

    .item-meta{
        font-size: 0.8rem;
    }
}

/* Mobile Large (481px - 767px) - Phones landscape */
@media(min-width:481px) and (max-width:767px){
    .controls{
        padding:14px;
        gap:12px;
    }

    select{
        width: auto;
        min-width: 140px;
    }

    input[type="text"]{
        flex-grow: 1;
        max-width: 300px;
        height: 44px;
    }

    .btn-search{
        width: auto;
        min-width: 120px;
        height: 44px;
        padding: 0 18px;
    }

    #sidebar{
        width: 340px;
    }

    .container.sidebar-closed #sidebar{
        margin-left: -340px;
    }

    #sidebar-toggle-area{
        left: 340px;
    }
}

/* Tablet Portrait (768px - 1024px) - iPad */
@media(min-width:768px) and (max-width:1024px){
    .controls{
        padding:16px;
        gap:14px;
    }

    select{
        min-width: 150px;
        height: 46px;
    }

    input[type="text"]{
        max-width: 380px;
        height: 46px;
    }

    .btn-search{
        height: 46px;
        padding: 0 24px;
    }

    #sidebar{
        width: 380px;
    }

    .container.sidebar-closed #sidebar{
        margin-left: -380px;
    }

    #sidebar-toggle-area{
        width: 50px;
        left: 380px;
    }

    .item-name{
        font-size: 1.15rem;
    }

    .item-meta{
        font-size: 0.95rem;
    }

    #detail-title{
        font-size: 1.3rem;
    }

    .detail-value{
        font-size: 1.25rem;
    }
}

/* Tablet Landscape & Small Desktop (1025px - 1279px) */
@media(min-width:1025px) and (max-width:1279px){
    .controls{
        padding:18px;
        gap:16px;
    }

    select{
        min-width: 160px;
        height: 48px;
    }

    input[type="text"]{
        max-width: 420px;
        height: 48px;
    }

    .btn-search{
        height: 48px;
        padding: 0 26px;
    }

    #sidebar{
        width: 400px;
    }

    .container.sidebar-closed #sidebar{
        margin-left: -400px;
    }

    #sidebar-toggle-area{
        left: 400px;
    }
}

/* Desktop (1280px - 1919px) - HD */
@media(min-width:1280px) and (max-width:1919px){
    .controls{
        padding:20px;
        gap:18px;
    }

    select{
        min-width: 170px;
        height: 50px;
        font-size: 1.05rem;
    }

    input[type="text"]{
        max-width: 480px;
        height: 50px;
        font-size: 1.05rem;
    }

    .btn-search{
        height: 50px;
        padding: 0 28px;
        font-size: 1.05rem;
    }

    #sidebar{
        width: 420px;
    }

    .container.sidebar-closed #sidebar{
        margin-left: -420px;
    }

    #sidebar-toggle-area{
        left: 420px;
    }

    .item-name{
        font-size: 1.25rem;
    }

    .item-meta{
        font-size: 1rem;
    }

    #detail-title{
        font-size: 1.4rem;
    }

    .detail-value{
        font-size: 1.3rem;
    }
}

/* Large Desktop (≥1920px) - Full HD+ */
@media(min-width:1920px){
    .controls{
        padding:24px;
        gap:20px;
    }

    select{
        min-width: 180px;
        height: 52px;
        font-size: 1.1rem;
    }

    input[type="text"]{
        max-width: 540px;
        height: 52px;
        font-size: 1.1rem;
    }

    .btn-search{
        height: 52px;
        padding: 0 32px;
        font-size: 1.1rem;
    }

    #sidebar{
        width: 460px;
    }

    .container.sidebar-closed #sidebar{
        margin-left: -460px;
    }

    #sidebar-toggle-area{
        left: 460px;
        width: 60px;
    }

    .item-name{
        font-size: 1.3rem;
    }

    .item-meta{
        font-size: 1.05rem;
    }

    .list-item{
        padding: 16px 14px;
    }

    #detail-title{
        font-size: 1.5rem;
    }

    .detail-content{
        padding: 28px;
    }

    .detail-value{
        font-size: 1.4rem;
    }
}

/* Touch optimization */
@media (hover: none) and (pointer: coarse){
    select,
    input[type="text"],
    .btn-search{
        min-height: 44px;
        touch-action: manipulation;
    }

    .list-item{
        min-height: 60px;
        touch-action: manipulation;
    }

    .list-item:active{
        background: #f0f0f0;
    }

    #sidebar-toggle-area{
        min-width: 44px;
        min-height: 60px;
        touch-action: manipulation;
    }

    .btn-back{
        min-width: 44px;
        min-height: 44px;
        touch-action: manipulation;
    }

    .btn-google-map{
        min-height: 44px;
        touch-action: manipulation;
    }
}

/* Hover effects for desktop */
@media (hover: hover) and (pointer: fine){
    .list-item:hover{
        background: #f8f8f8;
        transform: translateX(4px);
    }

    .btn-search:hover{
        background: #d35400;
        box-shadow: 0 6px 0 #b8470b, 0 8px 16px rgba(211,84,0,0.3);
    }
    .btn-route:hover{
        background: #1c5980;
        box-shadow: 0 6px 0 #1c5980, 0 8px 16px rgba(211,84,0,0.3);
    }

    #sidebar-toggle-area:hover{
        background: #3daee9;
    }

    .facility-link:hover{
        background: #2980b9;
        transform: translateY(-2px);
        box-shadow: 0 4px 8px rgba(52,152,219,0.3);
    }
}

/* =========================================
レスポンシブ修正：画面幅が768px以下の場合
   ========================================= */
@media (max-width: 768px) {
    h1 {
        font-size: 1.2rem; /* タイトルが長すぎるとボタンと被るので少し小さく */
        margin: 0;
    }
    /* ヘッダー */
    header {
        padding: 5px 20px;
    }
    header h1 {
        font-size: 1.1rem;
    }

    /* 💡 スマホ版 #status-bar の調整 */
    #status-bar {
        padding: 5px 10px; /* 💡 縦パディングを縮小 */
        font-size: 0.8rem; /* 💡 フォントサイズ */
    }

    /* 施設名の文字サイズを小さくする */
    .item-name {
        font-size: 0.9rem;
        margin-bottom: 3px; /* 下の余白も少し詰める */
    }

    /* 住所や電話番号の文字サイズを小さくする */
    .item-meta {
        font-size: 0.75rem;
    }

    /* リスト項目全体の余白を調整してスッキリさせる */
    .list-item {
        padding: 10px 8px; /* 上下10px, 左右8px */
    }

    /* 施設名（オレンジ色の文字） */
    .item-name {
        font-size: 0.9rem;      /* 文字を少し小さく */
        line-height: 1.4;       /* 改行したときに行が開きすぎないように */
        margin-bottom: 4px;     /* 下の住所との隙間を少し詰める */
        font-weight: bold;      /* 小さくても読みやすいよう太字を維持 */
    }

    /* 住所・電話番号（グレーの文字） */
    .item-meta {
        font-size: 0.8rem;     /* 文字を小さく */
        line-height: 1.3;       /* 行間を少しタイトに */
        margin-bottom: 2px;     /* 各行の隙間を微調整 */
        color: #555;            /* 文字色を少し濃くして視認性を上げる */
    }

    /* もしアイコン（ピンや電話マーク）がある場合、それも少し小さくする */
    .item-meta i,
    .item-meta svg {
        font-size: 1.0rem;     /* アイコンサイズも文字に合わせる */
        margin-right: 4px;      /* アイコンと文字の間隔 */
    }
    /* オレンジ色のヘッダーにある施設名タイトル */
    #detail-title {
        font-size: 1.0rem;
    }

    /* 左上の「戻る」矢印ボタン */
    .btn-back {
        font-size: 1.0rem;
    }

    /* 「住所」「電話番号」などの項目ラベル */
    .detail-label {
        font-size: 0.8rem;
        margin-top: 10px;  /* 上の隙間も少し詰める */
    }

    /* 実際の住所や電話番号の文字 */
    .detail-value {
        font-size: 0.8rem;
        margin-bottom: 6px;
        line-height: 1.4;  /* 行間を調整して読みやすく */
    }

    /* 詳細ページへ飛ぶオレンジ色の大きなボタン */
    .detail-btn {
        padding: 12px;     /* 余白を少し小さく */
        font-size: 0.7rem;

    }

    .container {
        display: flex;
        flex-direction: row;
        overflow-x: hidden;
    }

    #sidebar{
        width:360px;
        background:#fff;
        border-right:2px solid #ddd;
        display:flex;
        flex-direction:column;
        position:relative;
        overflow:hidden;
        transition:margin-left 0.3s ease,transform 0.3s ease;
    }

    .container.sidebar-closed #sidebar {

        margin-left: -360px;
    }

    /* 水色のボタンの設定 */
    #sidebar-toggle-area {
        position: relative;
        left: auto;

        width: 25px;        /* 幅固定 */
        flex: 0 0 auto;     /* 伸縮しない */
    }

    /* 閉じた時、水色ボタンを画面左端（0）に配置する */
.container.sidebar-closed #sidebar-toggle-area {
    left: 0; /* これでボタンだけが画面に残る */
}
    /* 念のため（ボタン位置のリセット） */
    .container.sidebar-closed #sidebar-toggle-area {
        left: 0;
    }
    /* Googleマップボタンを小さくする */
    .btn-google-map {
        font-size: 0.5rem;   /* 文字サイズを小さく */
        padding: 3px 8px;    /* 余白を小さく */
        margin-top: 2px;     /* 上下の隙間も少し詰める */
        margin-bottom: 6px;
    }
    /* 検索ボタンエリア：サイドバーの幅に合わせる */
    .sidebar-search-accordion {
        width: 100% !important;
        position: relative; /* absoluteを解除 */
        z-index: 20;
        flex-shrink: 0; /* スクロール時に上に消えないように固定 */
        background: #fcd79d; /* 背景色を確実に指定 */
        font-style: black;
    }
    /* コンテンツ部分：絶対配置(absolute)を解除して、下のリストを押し下げるようにする */
    .search-content {
        position: static !important; /* 浮かせない */
        width: 100%;
        background: #f9f9f9;
        overflow: hidden;
        transition: max-height 0.3s ease;
    }

    .search-form-container {
        position: relative; /* 絶対配置を解除または調整 */
        width: 100% !important;
        top: 0 !important;
        left: 0 !important;
        z-index: 1000;
    }
    .search-toggle-btn {
        width: 100% !important;
        display: flex;
        justify-content: center;
        align-items: center;
        padding: 12px 0;
        margin: 0;
        border-bottom: 1px solid #eee;
        color: #000000 !important;
        background-color: #ffffff !important;
        border-bottom: 3px solid #e67e22;
        font-weight: bold;
        font-size: 1rem;
    }

    /* 閉じている時の高さを制御するクラス（もしなければ追加） */
    .search-content.collapsible {
        overflow: hidden;
        transition: max-height 0.3s ease-out;
    }

    .search-content.collapsible.closed {
        max-height: 0 !important;
        padding: 0 !important;
    }
    /* パネルの重なりを解消し、ボタンの下に出るようにする */
    .search-content {
        position: relative !important; /* 絶対配置を解除 */
        width: 100% !important;
        background: white;
        box-shadow: none; /* 重なりがないので影は不要 */
        overflow: hidden;
        transition: max-height 0.3s ease; /* アニメーション用 */
    }

    /* 閉じている時の設定 */
    .search-content.closed {
        display: none !important; /* 完全に消す場合 */
        /* または max-height: 0; overflow: hidden; */
    }
    .btn-clear {
        padding: 8px; /* タップしやすいように大きく */
        font-size: 16px;
    }

    #panel-list {
        position: relative !important; /* absoluteを上書きして解除 */
        top: 0 !important;             /* 位置固定を解除 */
        flex-grow: 1;                  /* 残りの高さをすべて使う */
        overflow-y: auto;              /* リスト内だけでスクロール */
        height: auto !important;       /* 高さを自動計算に任せる */
    }

    .btn-route-map {
        position: absolute;
        top: 80px;
        right: 12px;

        width: auto !important;
        margin: 0 !important;

        width: 40px;
        padding: 0 30px;
        font-size: 0.85rem;

        z-index: 2;
    }
}


/* =========================================
レスポンシブ修正：画面幅が400px以下の場合
   ========================================= */
@media (max-width: 400px) {

    /* 施設名の文字サイズを小さくする */
    .item-name {
        font-size: 0.9rem;
        margin-bottom: 3px; /* 下の余白も少し詰める */
    }

    /* 住所や電話番号の文字サイズを小さくする */
    .item-meta {
        font-size: 0.75rem;
    }

    /* リスト項目全体の余白を調整してスッキリさせる */
    .list-item {
        padding: 10px 8px; /* 上下10px, 左右8px */
    }

    /* 施設名（オレンジ色の文字） */
    .item-name {
        font-size: 0.9rem;      /* 文字を少し小さく */
        line-height: 1.4;       /* 改行したときに行が開きすぎないように */
        margin-bottom: 4px;     /* 下の住所との隙間を少し詰める */
        font-weight: bold;      /* 小さくても読みやすいよう太字を維持 */
    }

    /* 住所・電話番号（グレーの文字） */
    .item-meta {
        font-size: 0.8rem;     /* 文字を小さく */
        line-height: 1.3;       /* 行間を少しタイトに */
        margin-bottom: 2px;     /* 各行の隙間を微調整 */
        color: #555;            /* 文字色を少し濃くして視認性を上げる */
    }

    /* もしアイコン（ピンや電話マーク）がある場合、それも少し小さくする */
    .item-meta i,
    .item-meta svg {
        font-size: 1.0rem;     /* アイコンサイズも文字に合わせる */
        margin-right: 4px;      /* アイコンと文字の間隔 */
    }
    /* オレンジ色のヘッダーにある施設名タイトル */
    #detail-title {
        font-size: 1.0rem;
    }

    /* 左上の「戻る」矢印ボタン */
    .btn-back {
        font-size: 1.0rem;
    }

    /* 「住所」「電話番号」などの項目ラベル */
    .detail-label {
        font-size: 0.8rem;
        margin-top: 10px;  /* 上の隙間も少し詰める */
    }

    /* 実際の住所や電話番号の文字 */
    .detail-value {
        font-size: 0.8rem;
        margin-bottom: 6px;
        line-height: 1.4;  /* 行間を調整して読みやすく */
    }

    /* 詳細ページへ飛ぶオレンジ色の大きなボタン */
    .detail-btn {
        padding: 12px;     /* 余白を少し小さく */
        font-size: 0.7rem;

    }

    .container {
        display: flex;
        flex-direction: row;
        overflow-x: hidden;
    }

    #sidebar {
        /* flex自動調整をやめ、幅を計算式で確定させる */
        flex: 1;

        width: calc(100vw - 40px);
        min-width: 0;
        box-sizing: border-box;
    }
    /* 水色のボタンの設定 */
    #sidebar-toggle-area {
        position: relative;
        left: auto;

        width: 20px;        /* 幅固定 */
        flex: 0 0 auto;     /* 伸縮しない */
    }

    /* 閉じた時にずらす距離を、サイドバーの幅とぴったり合わせる */
    .container.sidebar-closed #sidebar {
        margin-left: calc(40px - 100vw);
    }

    /* 念のため（ボタン位置のリセット） */
    .container.sidebar-closed #sidebar-toggle-area {
        left: 0;
    }

    /* Googleマップボタンを小さくする */
    .btn-google-map {
        font-size: 0.5rem;   /* 文字サイズを小さく */
        padding: 3px 8px;    /* 余白を小さく */
        margin-top: 2px;     /* 上下の隙間も少し詰める */
        margin-bottom: 6px;
    }
    /* 検索ボタンエリア：サイドバーの幅に合わせる */
    .sidebar-search-accordion {
        width: 100% !important;
        position: relative; /* absoluteを解除 */
        z-index: 20;
        flex-shrink: 0; /* スクロール時に上に消えないように固定 */
        background: #fcd79d; /* 背景色を確実に指定 */
        font-style: black;
    }
    /* 、下のリストを押し下げるようにする */
    .search-content {
        position: static !important; /* 浮かせない */
        width: 100%;
        background: #f9f9f9;
        overflow: hidden;
        transition: max-height 0.3s ease;
    }

    .search-form-container {
        position: relative; /* 絶対配置を解除または調整 */
        width: 100% !important;
        top: 0 !important;
        left: 0 !important;
        z-index: 1000;
    }
    .search-toggle-btn {
        width: 100% !important;
        display: flex;
        justify-content: center;
        align-items: center;
        padding: 12px 0;
        margin: 0;
        border-bottom: 1px solid #eee;
        color: #000000 !important;
        background-color: #ffffff !important;
        border-bottom: 3px solid #e67e22;
        font-weight: bold;
        font-size: 0.7rem;
    }

    /* 閉じている時の高さを制御するクラス（もしなければ追加） */
    .search-content.collapsible {
        overflow: hidden;
        transition: max-height 0.3s ease-out;
    }

    .search-content.collapsible.closed {
        max-height: 0 !important;
        padding: 0 !important;
    }
    /* パネルの重なりを解消し、ボタンの下に出るようにする */
    .search-content {
        position: relative !important; /* 絶対配置を解除 */
        width: 100% !important;
        background: white;
        box-shadow: none; /* 重なりがないので影は不要 */
        overflow: hidden;
        transition: max-height 0.3s ease; /* アニメーション用 */
    }

    /* 閉じている時の設定 */
    .search-content.closed {
        display: none !important; /* 完全に消す場合 */
        /*  max-height: 0; overflow: hidden; */
    }




    #panel-list {
        position: relative !important; /* absoluteを上書きして解除 */
        top: 0 !important;             /* 位置固定を解除 */
        flex-grow: 1;                  /* 残りの高さをすべて使う */
        overflow-y: auto;              /* リスト内だけでスクロール */
        height: auto !important;       /* 高さを自動計算に任せる */
    }
}
/* =========================================
12/16 追加
   ========================================= */
/* PCでは通常表示 */
.search-body{
    display:flex;
    gap:12px;
    align-items:center;
}

/* スマホ専用制御～検索欄 */
@media(max-width:768px){

    /* スマホでは検索条件は初期非表示 */
    .search-body{
        display:none;
        width:100%;
        flex-wrap:wrap;
        gap:8px;
        margin-top:8px;
    }

    /* ボタンを押したときだけ表示 */
    .controls.open .search-body{
        display:flex;
    }

    /* スマホ専用ボタン表示 */
    .mobile-only{
        display:inline-block;
        width:100%;
        margin:0 auto;
        height:36px;
        font-size:0.85rem;
    }
    .leaflet-bottom {
        bottom: 10px;
    }
}

/* PCではスマホ用ボタンを非表示 */
@media(min-width:769px){
    .mobile-only{
        display:none;
    }
    .btn-clear {
        height:48px;
        padding:0 20px;
        font-size:1rem;
        font-weight:bold;
        color:#fff;
        background:#9a9797;
        border:none;
        border-radius:8px;
        cursor:pointer;
        box-shadow:0 4px 0 #757575;
        transition:all 0.1s;
    }

    /* ホバー時（マウスを乗せた時）の色 */
    .btn-clear:hover {
        background-color: #4d4d4d; /* 少し濃いオレンジ */
        text-decoration: none;
        color: #fff;
    }
}



/* =========================================
アクセシビリティ（キーボード操作用）
   ========================================= */
.item:focus-visible,
#sidebar-toggle-area:focus-visible,
.btn-home:focus-visible,
.btn-back:focus-visible {
    outline: 3px solid #d35400; /* 視認性の高い枠線を表示 */
    outline-offset: -3px;
    z-index: 10000;
}