#rain-forecast-container{
    position: relative;
}
#map {
    width: 100%;
    height: 700px;
}

#control {
    position: absolute;
    top: 10px;
    left: 60px;
    right: 10px;

    z-index: 500;

    background: rgba(230,230,230,0.95);
    padding: 4px 6px;
    border-radius: 4px;

    display: flex;
    align-items: center;
    gap: 4px;

    font-size: 12px;
    line-height: 1.1;

    box-shadow: 0 2px 5px rgba(0,0,0,0.2);

    box-sizing: border-box;
    overflow: hidden;
}


#control button {
    padding: 2px 6px;
    font-size: 11px;
    line-height: 1.1;
}

#control input[type="range"] {
    width: 180px;
    max-width: 100%;
    box-sizing: border-box;
}

#control span {
    line-height: 1.1;
}


#timeLabel,
#enLabel {
    font-size: 12px;
    white-space: nowrap;
}


/* ボタンのデザイン調整 */
#playBtn {
    padding: 2px 10px;
    cursor: pointer;
    font-weight: bold;
}

/* 時刻表示のフォントを等幅にしてズレを防ぐ */
#timeLabel {
    font-family: "Helvetica Neue", Arial, "Hiragino Kaku Gothic ProN", "Meiryo", sans-serif;
    font-size: 12px;
    font-weight: bold;
    color: #333333;
    white-space: nowrap;
}

/* 気象情報パネル */
#precInfo {
    position: absolute;
    top: 60px;
    left: 30px;
    z-index: 1000;

    background: rgba(255,255,255,0.95);
    padding: 10px 15px;

    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);

    font-size: 10px;
    line-height: 1.6;
    min-width: 250px;
}

#precTitle {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 8px;
}

#disclaimer {
    position: absolute;
    bottom: 10px;
    right: 10px;
    z-index: 1000;

    background: rgba(255,255,255,0.9);
    padding: 4px 6px;

    font-size: 10px;
    line-height: 1.1;   /* 行間を狭くする */
    max-width: 400px;
}

/* カラーバー用 */
.legend{
    background: rgba(255,255,255,0.95);
    padding: 10px;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    font-size: 12px;
    line-height: 1.0;
}

.leaflet-bottom.leaflet-right {
    margin-bottom: 80px;
}

.test-banner {
    position: absolute;
    top: 140px;
    left: 50px;
    z-index: 1000;
    background: rgba(220,0,0,0.9);
    color: white;
    font-size: 18px;
    font-weight: bold;
    padding: 8px 16px;
    border-radius: 5px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    pointer-events: none;
}

.test-watermark {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-30deg);
    font-size: 90px;
    font-weight: bold;
    color: rgba(255,0,0,0.15);
    z-index: 999;
    pointer-events: none;
    user-select: none;
}

.leaflet-bottom.leaflet-right {
    bottom: 20px;
    right: 10px;
}

/* ============================================================
   ポップアップ内部スクロール
   ============================================================ */

.leaflet-popup-content {
    max-height: 60vh;
    overflow-y: auto;
    overflow-x: hidden;
}



/* ============================================================
 *    タブレット対応
 *       481px ～ 1024px
 *          ============================================================ */

@media screen and (min-width: 481px) and (max-width: 1024px) {

    /* --------------------------------------------------------
 *        スライダー・操作パネル
 *               -------------------------------------------------------- */

    #control {
        top: 8px !important;

        /* ズームボタンを避ける */
        left: 60px !important;

        /* 右端から少し余白 */
        right: 8px !important;

        width: auto !important;
        max-width: none !important;

        box-sizing: border-box;

        padding: 4px 6px;

        display: flex;
        align-items: center;

        gap: 5px;

        overflow: hidden;
    }


    /* --------------------------------------------------------
 *        スライダー
 *               -------------------------------------------------------- */

    #control input[type="range"] {

        width: 100px !important;

        min-width: 70px !important;
        max-width: 110px !important;

        flex: 1 1 100px;

        box-sizing: border-box;
    }


    /* --------------------------------------------------------
 *        ボタン
 *               -------------------------------------------------------- */

    #control button {

        flex: 0 0 auto;

        padding: 3px 6px;

        font-size: 10px;

        line-height: 1.1;

        white-space: nowrap;
    }


    /* --------------------------------------------------------
 *        時刻・メンバー表示
 *               -------------------------------------------------------- */

    #timeLabel,
    #enLabel {

        min-width: 0;

        max-width: 90px;

        overflow: hidden;

        text-overflow: ellipsis;

        white-space: nowrap;

        font-size: 7px;
    }
}


/* ============================================================
 *    スマートフォン対応
 *       ============================================================ */

@media screen and (max-width: 480px) {

    /* ==============================
 *        気象情報パネル
 *               ============================== */

    #precInfo {
        top: 75px;
        left: 8px;
        right: 30px;

        min-width: 0;
        width: auto;

        padding: 7px 10px;

        font-size: 7px;
        line-height: 1.0;
    }

    #precTitle {
        font-size: 10px;
        line-height: 1.25;
        margin-bottom: 4px;
    }


    /* ==============================
 *        予報停止メッセージ
 *               ============================== */

    .forecast-stop-message,
    #forecast-stop-message,
    .update-stop-message {

        max-width: calc(100% - 40px);

        font-size: 8px !important;
        line-height: 1.4 !important;

        padding: 10px 12px !important;
    }


    /* ==============================
 *        テスト版
 *               ============================== */

    .test-banner {

        top:135px;

        max-width: calc(100% - 40px);

        font-size: 7px;
        line-height: 1.25;

        padding: 6px 12px;
    }


    /* ==============================
 *        カラーバー
 *               ============================== */

    .legend {
        font-size: 8px;
        padding: 7px 9px;
    }


    /* ==============================
 *        注意書き
 *               ============================== */

    #disclaimer {
        font-size: 5px;
        line-height: 1.25;

        padding: 3px 5px;
    }
}


/* ============================================================
 *    スマホ：Leafletズームボタンとスライダーを分離
 *       ============================================================ */

@media screen and (max-width: 480px) {

/* --------------------------------------------------------
 *    Leaflet ズームボタンを標準位置に戻す
 *       -------------------------------------------------------- */

.leaflet-top.leaflet-left {
    top: 0 !important;
    left: 0 !important;
}

.leaflet-control-zoom {
    margin-top: 7px !important;
    margin-left: 7px !important;
}


    /* --------------------------------------------------------
 *        スライダーコントロールを右へ
 *               -------------------------------------------------------- */

    #control {
        top: 8px !important;

        /*
 *          * 左を大きくして、ズームボタンと重ならないようにする
 *                   */
        left: 40px !important;

        /*
 *          * 右側には必ず余白を残す
 *                   */
        right: 8px !important;

        width: auto !important;
        max-width: none !important;

        box-sizing: border-box;

        padding: 4px 5px;

        display: flex;
        align-items: center;
        justify-content: center;

        gap: 3px;

        overflow: hidden;
    }


    /* --------------------------------------------------------
 *        スライダー
 *               -------------------------------------------------------- */

    #control input[type="range"] {

        width: 55px !important;
        min-width: 45px !important;
        max-width: 55px !important;

        flex: 0 1 55px;

        box-sizing: border-box;
    }


    /* --------------------------------------------------------
 *        ボタン
 *               -------------------------------------------------------- */

    #control button {
        flex: 0 0 auto;

        padding: 2px 4px;

        font-size: 9px;
        line-height: 1.1;

        white-space: nowrap;
    }


    /* --------------------------------------------------------
 *        時刻表示
 *               -------------------------------------------------------- */

    #timeLabel,
    #enLabel {

        min-width: 0;
        max-width: 50px;

        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;

        font-size: 5px;
    }

}



