body {
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f9f9f9;
    padding: 32px;
    display: block;
    justify-content: center;
}

.header {
    margin: auto;
    text-align: center;
}

.container {
    max-width: 1200px;
    width: 100%;
    background: white;
    padding: 32px;
    border-radius: 8px;
    box-shadow: 0 0 15px rgba(0,0,0,0.1);
    margin: 0 auto;
}

.station-input-group {
    position: relative;  /* サジェストの絶対配置に必要 */
    margin-bottom: 16px;
}

.station-input-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
}

.station-input-group input[type="text"] {
    width: 100%;
    padding: 6px 10px;
    font-size: 16px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}

.time-input-group {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 16px;
}

.time-input-group label {
  width: auto; /* 固定幅解除 */
  font-weight: 600;
}

/* フォームの行をflexで横並びに */
form {
    display: flex;
    flex-wrap: wrap;
    gap: 16px 32px;
    margin-bottom: 32px;
}

/* ラベルは固定幅＆中央揃え */
form label {
    width: 100px;
    font-weight: 600;
    display: flex;
    align-items: center; /* 縦方向中央 */
}

/* 入力欄は伸びる */
form input[type="text"],
form input[type="number"] {
    flex-grow: 1;
    padding: 6px 10px;
    font-size: 16px;
    border: 1px solid #ccc;
    border-radius: 4px;
    min-width: 60px;
    box-sizing: border-box;
}

/* 時刻入力は横に詰めたい場合は小さく指定 */
/* input[name="hour"],
input[name="minute"] {
    max-width: 40px;
} */

/* ボタンは一行目に回るように調整 */
form button {
    padding: 10px 24px;
    background-color: #007bff;
    color: white;
    font-weight: 600;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    align-self: flex-start; /* フォームの最初の行に合わせる */
}

form button:hover {
    background-color: #0056b3;
}

/* サジェストボックス */
.suggestions {
    border: 1px solid #ccc;
    max-height: 150px;
    overflow-y: auto;
    position: absolute;
    background: white;
    width: 200px;
    display: none;
    z-index: 1000;
}

.suggestions div {
    padding: 5px;
    cursor: pointer;
}

.suggestions div:hover {
    background-color: #eee;
}

/* テーブル装飾 */
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

table th,
table td {
    border: 1px solid #ddd;
    padding: 10px 13px;
    text-align: center;
}

table th {
    background-color: #007bff;
    color: white;
    font-weight: 600;
}

table tbody tr:hover {
    background-color: #f1f9ff;
}

   .station-marker {
        background-color: #ff6f69; /* 赤っぽい色 */
        width: 18px; /* アイコンの幅 */
        height: 18px; /* アイコンの高さ */
        border-radius: 50%; /* 円形にする */
        display: flex; /* flexboxを使って内容を中央揃え */
        justify-content: center; /* 水平方向の中央揃え */
        align-items: center; /* 垂直方向の中央揃え */
        color: white; /* アイコン内の文字の色 */
        font-size: 12px; /* アイコン内の文字サイズ */
        font-weight: bold; /* 文字を太く */
        border: 1px solid #d4514a; /* 枠線の色 */
        box-shadow: 0 1px 3px rgba(0,0,0,0.2); /* 影 */
    }

    .station-marker-label {
        position: absolute;
        left: 30px; /* アイコンの右端から少しだけ離れるように調整 */
        top: 0px;  /* アイコンの上端とラベルの上端を合わせる */
        transform: translateY(-50%); /* 縦方向の中心に寄せる */
        white-space: nowrap; /* 駅名が改行されないようにする */
        background-color: white;
        padding: 2px 6px;
        border-radius: 4px;
        font-size: 15px;
        border: 1px solid #bbb;
        box-shadow: 0 1px 3px rgba(0,0,0,0.2);
        min-width: 40px;
        text-align: center;
        z-index: 10; /* 他の要素より手前に表示 */
    }

    /* Leafletが自動で追加するアイコンコンテナの不要な背景と枠線を消す */
    /* これがないと、デフォルトアイコンの白い四角が残る場合があります */
    .leaflet-div-icon {
        background: transparent !important;
        border: none !important;
    }
    /* Leafletが自動で追加するアイコンコンテナの不要な背景と枠線を消す */
    .leaflet-div-icon {
        background: transparent !important;
        border: none !important;
    }
    /* カスタムアイコンのコンテナ全体の位置調整 */
    .custom-station-icon-container {
        /* これにより、アイコンとラベル全体がマップの座標からずれる */
        margin-left: 10px; /* 左側に10pxずらす (路線の右側に表示されるイメージ) */
        margin-top: -10px; /* 上側に10pxずらす (縦位置を微調整) */
    }

    .table-wrapper {
        overflow-x: auto;
        width: 100%;
        margin-bottom: 24px;
    }

    .table-wrapper table {
        min-width: 800px; /* 横スクロールを発生させるための幅 */
    }

    #map {
    height: 500px;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
}

/* 駅名に使うフォントとサイズ */
.summary-box p.station-name {
    font-family: "Yu Gothic", "Meiryo", sans-serif;
    font-size: 1.8em;
    font-weight: bold;
    margin-bottom: 5px;
}

/* ボックス全体をフォームの下に配置（適度な余白を確保） */
.search-summary {
    display: flex;
    flex-direction: column; /* 横並び → 縦並び */
    gap: 20px;
    margin-top: 40px;
    align-items: flex-start;
}
.summary-box {
    border: 1px solid #ccc;
    padding: 8px 12px; /* 上下の余白を少し縮める */
    border-radius: 5px;
    background-color: #f9f9f9;
    width: 300px;
    line-height: 1.4;
}

.station-name {
    margin: 0 0 4px 0; /* 駅名と時刻の間をぎゅっと寄せる */
}

.time-info {
    font-size: 24px; /* 必要に応じてサイズ調整 */
    font-weight: bold;
    color: #333;
    margin: 0;
}

.time-input-group {
    display: flex;
    flex-direction: column;
    align-items: flex-start; /* 左寄せ（中央にしたい場合は center） */
    gap: 4px;
}

.time-inputs {
    display: flex;
    align-items: center;
    gap: 4px;
}

@media (max-width: 768px) {
    body {
        padding: 2px;
    }

    .container {
        width: 90%;
        padding: 10px;
        box-shadow: none;
        border-radius: 0;
        margin-top: 8px;
    }

    form {
        flex-direction: column;
        gap: 12px;
        margin-bottom: 4px;
    }

    form label {
        width: auto;
        justify-content: flex-start;
        margin-bottom: 4px;
    }

    .station-input-group {
        margin-bottom: 4px; /* 従来の16pxから縮小 */
    }

    .station-input-group label {
        margin-bottom: 4px; /* ラベル下の隙間も少し詰める */
    }
    .station-input-group input[type="text"] {
        width: 100%;
        padding: 4px 8px;
        font-size: 18px;
        border: 1px solid #ccc;
        border-radius: 4px;
        box-sizing: border-box;
}

    form input[type="text"],
    form input[type="number"],
    form button {
        width: 100%;
        min-width: 0;
    }

    .time-input-group {
        flex-direction: row;
        justify-content: flex-start;
        gap: 6px;
    }

    .suggestions {
        width: 100% !important;
        left: 0 !important;
    }

    .station-marker-label {
        font-size: 13px;
        left: 24px;
        padding: 1px 4px;
        min-width: auto;
    }

    table th,
    table td {
        font-size: 13px;
        padding: 6px;
    }
    #map {
        width: 90%;
        aspect-ratio: 1 / 1; /* 正方形 */
        height: auto; /* aspect-ratioを活かすため */
        margin: 0 auto; /* 中央寄せ */
    }

    .search-summary {
        margin-top: 10px; /* 従来40px → 少し詰める */
        gap: 12px;         
        margin-bottom: 6px;
}
    .summary-box {
        padding: 6px 10px; /* より密な印象に */
    }
}