html,
body {
    height: 100%;
    margin: 0;
}

#map {
    height: 100vh;
    width: 100%;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}

/* ナビゲーションパネル */
#navPanel {
    position: fixed;
    top: 10px;
    left: 50px;
    width: 360px;
    /* 少し広げる */
    max-width: calc(100vw - 70px);
    height: calc(100vh - 60px);
    /* 固定高さにする */
    max-height: calc(100vh - 60px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    /* contentがパネル外へ漏れないように強制 */
    box-sizing: border-box;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    z-index: 3000;
    font-family: 'Segoe UI', 'Hiragino Sans', sans-serif;
    transition: all 0.3s ease;
}

#navPanel .nav-content::-webkit-scrollbar {
    width: 6px;
}

#navPanel .nav-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.45);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 3px;
}

.nav-header {
    padding: 16px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    flex-shrink: 0;
}

.nav-header h2 {
    margin: 0;
    font-size: 18px;
    color: white;
    font-weight: 600;
}

.nav-header p {
    margin: 6px 0 0;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.8);
}

.assumption-box {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.assumption-badge {
    display: inline-block;
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    font-size: 11px;
    color: white;
    font-weight: 600;
    backdrop-filter: blur(4px);
}

.progress-bar {
    position: absolute;
    right: 4px;
    /* パネルの内側右端 */
    top: 100px;
    bottom: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-around;
    /* 等間隁E*/
    padding: 10px 0;
    gap: 0;
    flex-wrap: nowrap;
    z-index: 3100;
    background: none;
    /* 背景削除 */
    backdrop-filter: none;
    width: 36px;
    border: none;
    /* 枠線削除 */
    box-shadow: none;
    /* 影削除 */
}

.progress-line {
    display: none;
    /* 縦型なので一旦非表示にするか、別途デザインする */
}

.progress-step {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2) !important;
    color: white !important;
    font-size: 11px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.progress-step:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.progress-step.active {
    background: #10b981 !important;
    color: white;
    transform: scale(1.15);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.5) !important;
    z-index: 2;
}

.progress-step.completed {
    background: rgba(255, 255, 255, 0.2) !important;
    color: white;
}

/* ─────────────────────────────────────────
 * ステップ番号インジケーター（丸アイコン）
 * id="step-N" パターン用
 * ───────────────────────────────────────── */
.step-circle {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background-color: #94a3b8;
    color: white;
    font-size: 11px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.3s, box-shadow 0.3s;
}

.step-circle:hover {
    background-color: #64748b;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* 選択中（緑） */
.step-circle.active {
    background-color: #22c55e !important;
    color: white;
    transform: scale(1.15);
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.5) !important;
    z-index: 2;
}

.nav-content {
    padding: 16px;
    margin-right: 40px;
    /* 等間隔ボタンの幅＋余白を確保 */
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.step-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.step-header {
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(to right, #f8fafc, #f1f5f9);
    border-bottom: 1px solid #e2e8f0;
}

.step-number {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: #667eea !important;
    color: white !important;
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}



.step-title {
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
}

.step-sub-header {
    margin: 15px 0 10px 0;
    padding-bottom: 5px;
    border-bottom: 1px solid #e2e8f0;
    font-size: 13px;
    font-weight: bold;
    color: #1e2937;
    display: block;
}

.step-body {
    padding: 16px;
}

.step-instruction {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-left: 4px solid #3b82f6;
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 12px;
    font-size: 13px;
    color: #1e3a8a;
    line-height: 1.6;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
}

.step-action-btn {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid rgba(0, 0, 0, 0.05);
    border-radius: 14px;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    position: relative;
    overflow: hidden;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.step-action-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(rgba(255, 255, 255, 0.15), transparent);
    pointer-events: none;
}

.step-action-btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    filter: brightness(1.1);
}

.step-action-btn:active {
    transform: translateY(-1px);
    box-shadow: 0 5px 10px -2px rgba(0, 0, 0, 0.1);
}

/* 記号・絵柄を強調するスタイル */
.step-action-btn .btn-emoji {
    font-size: 20px;
    background: rgba(255, 255, 255, 0.2);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.3);
    flex-shrink: 0;
}

/* Color Variants using Vibrant Gradients */
.step-action-btn.primary {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    border-color: #2563eb;
}

.step-action-btn.success {
    background: linear-gradient(135deg, #10b981 0%, #047857 100%);
    border-color: #059669;
}

.step-action-btn.warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    border-color: #d97706;
}

.step-action-btn.danger {
    background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
    border-color: #dc2626;
}

.step-action-btn.secondary,
.step-action-btn.soft-dark-blue {
    background: linear-gradient(135deg, #475569 0%, #1e293b 100%);
    border-color: #334155;
}

.step-action-btn.pink {
    background: linear-gradient(135deg, #ec4899 0%, #be185d 100%);
    border-color: #db2777;
}

.step-action-btn.sky-blue {
    background: linear-gradient(135deg, #0ea5e9 0%, #0369a1 100%);
    border-color: #0284c7;
}

.step-action-btn.mild-blue {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    color: #1e3a8a;
    border: 1px solid #3b82f6;
    text-shadow: none;
}

.step-action-btn.mild-blue:hover {
    background: #e0efff;
}

/* Specialized Animation Buttons (Kept consistent with new style) */
.step-action-btn.animation-btn {
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
    border: 2px solid rgba(255, 255, 255, 0.4);
    font-size: 15px;
    padding: 14px;
}

.step-action-btn.tsunami-animation-btn {
    background: linear-gradient(135deg, #7c3aed 0%, #5b21b6 100%);
    border: 2px solid rgba(255, 255, 255, 0.4);
    font-size: 15px;
    padding: 14px;
}

/* Shared Active/Toggle state */
.step-action-btn.active {
    background: linear-gradient(135deg, #064e3b 0%, #064e3b 100%) !important;
    color: white !important;
    border-color: #047857 !important;
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.3);
    transform: translateY(1px) !important;
}

.step-action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.anim-note {
    font-size: 10px;
    color: #64748b;
    margin-top: 4px;
    line-height: 1.3;
    text-align: left;
    padding: 0 4px;
}

.step-status {
    padding: 10px 12px;
    background: #f0fdf4;
    border-radius: 8px;
    font-size: 12px;
    color: #166534;
    text-align: center;
    margin-top: 8px;
}

.step-status.pending {
    background: #fef3c7;
    color: #92400e;
}

.step-status.error {
    background: #fee2e2;
    color: #991b1b;
}

.nav-buttons {
    display: flex;
    gap: 8px;
    padding: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.nav-btn {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.nav-btn.prev {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.nav-btn.next {
    background: white;
    color: #667eea;
}

.nav-btn:hover {
    transform: translateY(-2px);
}

.nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.thinking-box {
    background: linear-gradient(135deg, #faf5ff 0%, #f3e8ff 100%);
    border-left: 4px solid #a855f7;
    border-radius: 10px;
    padding: 14px;
    margin-top: 12px;
    font-size: 12px;
    color: #6b21a8;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
}

.thinking-box h4 {
    margin: 0 0 10px;
    font-size: 13px;
    font-weight: 800;
}

.thinking-box ul {
    margin: 0;
    padding-left: 20px;
}

.thinking-box li {
    margin-bottom: 6px;
}

.branch-box {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border-left: 4px solid #f59e0b;
    border-radius: 10px;
    padding: 14px;
    margin-top: 12px;
    font-size: 12px;
    color: #92400e;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
}

.branch-box h4 {
    margin: 0 0 10px;
    font-size: 13px;
    font-weight: 800;
}

/* 注釈・ヒントの折りたたみ表示 */
.collapsible-container {
    margin: 12px 0;
}

.hint-toggle-btn {
    width: 100%;
    padding: 10px 14px;
    background: linear-gradient(to bottom, #ffffff, #f8fafc);
    border: 1px solid #e2e8f0;
    border-bottom: 2px solid #cbd5e1;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
    color: #475569;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
    position: relative;
}

.hint-toggle-btn:hover {
    background: #f1f5f9;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border-color: #cbd5e1;
}

.hint-toggle-btn:active {
    transform: translateY(0);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

.hint-toggle-btn.active {
    background: #f1f5f9;
    border-bottom: 1px solid transparent;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    color: #1e3a8a;
}

.hint-toggle-btn::after {
    content: '▼';
    font-size: 8px;
    margin-left: auto;
    transition: transform 0.3s;
}

.hint-toggle-btn.active::after {
    transform: rotate(180deg);
}

.hint-content {
    display: none;
    border: 1px solid #e2e8f0;
    border-top: none;
    border-bottom-left-radius: 10px;
    border-bottom-right-radius: 10px;
    padding: 1px;
    background: #ffffff;
    overflow: hidden;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hint-content.show {
    display: block;
}

.hint-content>div {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

/* モバイル対応：メディアクエリ */
@media screen and (max-width: 600px) {
    #navPanel {
        left: 10px;
        top: 55px;
        width: calc(100vw - 20px);
        max-width: none;
        max-height: calc(85vh - 70px);
    }

    .toggle-nav-btn {
        top: 10px;
        left: 10px;
    }

    .step-header {
        padding: 10px 12px;
    }

    .step-body {
        padding: 12px;
    }

    .step-title {
        font-size: 13px;
    }

    .nav-header h2 {
        font-size: 16px;
    }
}

/* 著作権クレジット表示 */
.nav-footer {
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.1);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    flex-shrink: 0;
}

.copyright-text {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.7);
    margin: 0;
    line-height: 1.4;
}

.copyright-name {
    font-weight: 700;
    color: white;
    display: block;
    margin-bottom: 2px;
    font-size: 11px;
}

/* ナビゲーションプログレスバー */
.nav-progress-container {
    padding: 4px 16px 8px;
    background: rgba(0, 0, 0, 0.05);
}

.nav-progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
    font-size: 10px;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
}

.nav-progress-bar-bg {
    height: 6px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981, #34d399);
    width: 0%;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 1px 0 4px rgba(16, 185, 129, 0.5);
}

.toggle-nav-btn {
    position: fixed;
    top: 10px;
    left: 10px;
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 18px;
    cursor: pointer;
    z-index: 1002;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
}

.toggle-nav-btn:hover {
    transform: scale(1.05);
}



.home-marker,
.shelter-marker,
.temp-shelter-marker {
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid white;
    border-radius: 50%;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.home-marker {
    background: #10b981;
    animation: marker-pulse-green 2.5s infinite;
}

.shelter-marker {
    /* 指定緊急避難場所は「安全な目的地」として青色に変更 */
    background: #3b82f6;
    animation: marker-pulse-blue 2s infinite;
    border: 3px solid #eff6ff !important;
}

.temp-shelter-marker {
    /* 一次避難場所は「注意・中間地点」としてオレンジ色（アンバー）に変更 */
    background: #f59e0b;
    animation: marker-pulse-orange 2s infinite;
}

.caution-point-marker div {
    /* 要注意箇所は「危険」として赤色を維持しつつ、より強調 */
    background: #dc2626 !important;
    box-shadow: 0 0 10px rgba(220, 38, 38, 0.8) !important;
    animation: marker-pulse-red 1.5s infinite;
}

@keyframes marker-pulse-green {
    0% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }

    70% {
        box-shadow: 0 0 0 12px rgba(16, 185, 129, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

/* 避難経路の動く線（Ant Path）擬似実装 */
.leaflet-ant-path {
    stroke-dasharray: 12, 12;
    animation: leaflet-ant-path-animation 30s linear infinite;
}

@keyframes leaflet-ant-path-animation {
    from {
        stroke-dashoffset: 100%;
    }

    to {
        stroke-dashoffset: 0%;
    }
}

.leaflet-ant-path-decision {
    stroke-dasharray: 15, 10;
    animation: leaflet-ant-path-animation 15s linear infinite;
    stroke-width: 8 !important;
    filter: drop-shadow(0 0 8px rgba(220, 38, 38, 0.5));
}

@keyframes marker-pulse-orange {
    0% {
        box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7);
    }

    70% {
        box-shadow: 0 0 0 12px rgba(245, 158, 11, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(245, 158, 11, 0);
    }
}

@keyframes marker-pulse-blue {
    0% {
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.7);
    }

    70% {
        box-shadow: 0 0 0 15px rgba(59, 130, 246, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0);
    }
}

@keyframes marker-pulse-red {
    0% {
        box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.8);
    }

    70% {
        box-shadow: 0 0 0 15px rgba(220, 38, 38, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(220, 38, 38, 0);
    }
}

/* ルートのアニメーション (Ant Path風) */
.leaflet-ant-path {
    stroke-dasharray: 10, 10;
    animation: leaflet-ant-path-animation 10s linear infinite;
}

@keyframes leaflet-ant-path-animation {
    from {
        stroke-dashoffset: 100;
    }

    to {
        stroke-dashoffset: 0;
    }
}

#elevationChart {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 12px;
    padding: 0;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    position: fixed;
    bottom: 20px;
    left: 400px;
    width: 700px;
    height: 500px;
    max-width: 90vw;
    max-height: 80vh;
    z-index: 5000;
    display: none;
    transition: width 0.3s, height 0.3s, transform 0.3s, opacity 0.3s;
    resize: both;
    overflow: hidden;
    flex-direction: column;
}

#elevationChart.minimized {
    width: 320px !important;
    height: 48px !important;
    min-height: 48px !important;
    overflow: hidden;
    padding: 0;
    resize: none;
}

#elevationChart.minimized #elevationBody,
#elevationChart.minimized #chartRouteSelector,
#elevationChart.minimized #routeEvaluationSummary {
    display: none !important;
}

.elevation-header {
    cursor: move;
    font-weight: bold;
    font-size: 15px;
    margin-bottom: 12px;
    margin-right: 70px;
    /* ボタンとの重なり防止 */
    color: #1e293b;
    border-bottom: 2px solid #3b82f6;
    padding: 8px 10px 6px;
    user-select: none;
    border-radius: 4px;
    transition: background 0.2s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.elevation-header:hover {
    background: rgba(59, 130, 246, 0.08);
}

.elevation-header::before {
    content: '⠿ ';
    color: #94a3b8;
    font-size: 16px;
}

#elevationChart.minimized {
    height: 48px !important;
    width: 300px !important;
    overflow: hidden;
    resize: none;
}

.minimize-btn {
    position: absolute;
    top: 10px;
    right: 42px;
    width: 24px;
    height: 24px;
    cursor: pointer;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    color: #475569;
    z-index: 10;
    transition: all 0.2s;
}

.minimize-btn:hover {
    background: #e2e8f0;
    transform: scale(1.05);
}

#closeElevationBtn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 24px;
    height: 24px;
    padding: 0;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fee2e2;
    color: #ef4444;
    border: 1px solid #fecdd3;
    border-radius: 6px;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s;
    font-size: 16px;
}

#closeElevationBtn:hover {
    background: #fecaca;
    transform: scale(1.05);
}

#elevationCanvas {
    width: 100% !important;
    height: 520px !important;
    margin-bottom: 12px;
}

/* 堅牢建物マーカー (指定緊急避難場所の円形アイコンと共通のデザイン) */
.sturdy-marker-container {
    display: flex;
    align-items: center;
    justify-content: center;
}

.sturdy-marker-circle {
    width: 16px;
    /* 中身のサイズ */
    height: 16px;
    background: #7e22ce;
    /* 濃い紫 */
    border: 3px solid #ffffff;
    /* 枠緁E*/
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    transition: all 0.2s ease;
    box-sizing: content-box;
    /* 枠線をサイズの計算に含めなぁE*/
    flex-shrink: 0;
    /* 決して潰れさせない（正円を維持） */
}

.sturdy-marker-container:hover .sturdy-marker-circle {
    transform: scale(1.3);
    background: #9333ea;
    box-shadow: 0 0 10px rgba(126, 34, 206, 0.7);
}

.private-marker-circle {
    width: 14px;
    height: 14px;
    background: #64748b; /* Slate Gray */
    border: 3px solid #ffffff;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    transition: all 0.2s ease;
    box-sizing: content-box;
    flex-shrink: 0;
}

.sturdy-marker-container:hover .private-marker-circle {
    transform: scale(1.2);
    background: #475569;
    box-shadow: 0 0 8px rgba(100, 116, 139, 0.6);
}



select,
input,
button {
    width: 100%;
    font-size: 14px;
    padding: 5px;
    margin-top: 5px;
    box-sizing: border-box;
}

/* ドラッグ可能な凡例の共通スタイル */
.draggable-legend {
    display: none;
    position: fixed;
    z-index: 1002;
    background: white;
    border: 1px solid #ccc;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    cursor: default;
    width: 250px;
    right: 20px;
    bottom: 20px;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), max-height 0.3s ease;
}

.draggable-legend.expanded {
    width: 1000px;
    max-width: 95vw;
    max-height: 90vh;
    /* 初期表示を中央にするための指定。ドラッグ開始時にJSで解除します */
    left: calc(50% - 500px);
    top: 10vh;
    right: auto;
    bottom: auto;
}

/* 2倍拡大モード: パネル幅を物理的に2倍にし、中身も全て拡大 */
#dragLegendTopography.zoomed {
    width: 500px !important;
    max-width: 95vw;
    max-height: 90vh;
    z-index: 6000;
    transition: width 0.3s ease;
}

/* ヘッダーも拡大 */
#dragLegendTopography.zoomed .legend-header {
    padding: 14px 20px !important;
}

#dragLegendTopography.zoomed .legend-header span {
    font-size: 22px !important;
}

#dragLegendTopography.zoomed .close-legend-btn {
    font-size: 36px !important;
}

/* コンテンツエリア */
#dragLegendTopography.zoomed .legend-content {
    max-height: 85vh;
    overflow-y: auto;
    padding: 16px !important;
}

/* 画像凡例（標準版）の拡大 */
#dragLegendTopography.zoomed .legend-content img {
    width: 100% !important;
    max-width: 100% !important;
    height: auto;
}

/* 動的凡例アイテム（詳細版）のフォント・カラーボックスを2倍に */
#dragLegendTopography.zoomed .hazard-legend-item {
    font-size: 22px !important;
    padding: 8px 4px !important;
    margin-bottom: 8px !important;
    gap: 14px !important;
}

#dragLegendTopography.zoomed .hazard-color-box {
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    border-radius: 6px !important;
}

.draggable-legend.expanded .legend-content {
    max-height: 85vh;
    overflow-y: auto;
    overflow-x: auto;
}

.legend-header {
    padding: 8px 12px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    cursor: move;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    font-weight: bold;
    color: #475569;
}

.close-legend-btn {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 20px;
    font-weight: normal;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    margin-top: 0;
    width: auto;
    transition: color 0.2s;
}

.close-legend-btn:hover {
    color: #ef4444;
}

.legend-content {
    padding: 12px;
    max-height: 400px;
    overflow-y: auto;
}

/* 地形分類凡例の画像用スタイル */
#dragLegendTopography .legend-content img {
    width: 100%;
    max-width: 280px;
    /* デフォルトサイズ */
    height: auto;
    border-radius: 4px;
    cursor: zoom-in;
    display: block;
    margin: 0 auto;
}

/* 拡大時の画像スタイル */
#dragLegendTopography.expanded .legend-content img,
#dragLegendTopography.zoomed .legend-content img {
    max-width: 100%;
    width: auto;
    cursor: zoom-out;
}

.hazard-legend-item {
    display: flex;
    align-items: center;
    margin-bottom: 6px;
    font-size: 11px;
}

.hazard-color-box {
    width: 18px;
    height: 18px;
    margin-right: 8px;
    border: 1px solid #ccc;
    flex-shrink: 0;
}

#dragLegendTopography {
    bottom: 40px;
    right: 20px;
    top: auto;
    left: auto;
    width: auto;
    /* コンテンツに合わせて自動調整 */
    min-width: 220px;
}

#dragLegendTopography .legend-content {
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* 詳細版（自然・人工）の凡例アイテムが2列に並ぶように調整 */
#dragLegendTopography .legend-content:not(:has(img)) {
    display: grid;
    grid-template-columns: 1fr 1fr;
    /* 2列表示 */
    gap: 2px 6px;
    width: 320px;
    /* 2列にするため幅を少し広げるが、全体としては低くなる */
}

#dragLegendTopography .hazard-legend-item {
    margin-bottom: 2px;
    font-size: 9px;
    /* さらにもう少し小さぁE*/
    white-space: nowrap;
}


/* ハザード凡例: 右下配置・コンパクト化 */
#dragLegendFlood,
#dragLegendKeizoku,
#dragLegendTopography,
#dragLegendSediment,
#dragLegendWaterway {
    bottom: 20px;
    right: 20px;
    top: auto;
    left: auto;
    width: 320px;
}

/* 1. 【サイドバーの2列配置化】 */
.quick-action-container {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    margin-bottom: 8px !important;
    width: 100% !important;
}
.quick-action-container button.step-action-btn,
#navPanel .step-body div[style*="display:flex"][style*="flex-wrap:wrap"] button.step-action-btn,
#navPanel .step-body div[style*="display: flex"][style*="flex-wrap: wrap"] button.step-action-btn {
    width: calc(50% - 4px) !important;
    margin: 0 !important;
    font-size: 14px !important;
    padding: 10px 12px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 8px !important;
    border-radius: 12px !important;
    box-sizing: border-box !important;
}

/* 2. 【地図右下の凡例スタック（積み上げ）機能】 */
#map-legend-stack {
    position: fixed !important;
    right: 20px !important;
    bottom: 20px !important;
    z-index: 4500 !important;
    display: flex !important;
    flex-direction: column-reverse !important;
    gap: 8px !important;
    pointer-events: none !important;
}

#map-legend-stack .draggable-legend {
    position: relative !important;
    right: auto !important;
    bottom: auto !important;
    left: auto !important;
    top: auto !important;
    margin: 0 !important;
    pointer-events: auto !important;
}

#dragLegendFlood .legend-content,
#dragLegendKeizoku .legend-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px 10px;
    padding: 8px 12px;
}

#dragLegendFlood .hazard-legend-item,
#dragLegendKeizoku .hazard-legend-item {
    margin-bottom: 2px;
    font-size: 10px;
}

#controls,
#elevationControls {
    background: #ffe6e6;
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    font-family: Arial, sans-serif;
    width: 220px;
}

#elevationControls {
    background: #ffffff;
}

#controls h3,
#elevationControls h3 {
    margin: 10px 0;
    font-size: 16px;
    color: #333;
    text-align: center;
}

.dist-tool-panel {
    display: none !important;
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1001;
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: flex-end;
    pointer-events: none;
}

.dist-tool-panel>* {
    pointer-events: auto;
}

/* 統合された計測ボタン（アイコン＋テキスト） */
.dist-tool-btn-container {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    padding: 8px 16px;
    border-radius: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.4);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    gap: 10px;
    user-select: none;
    font-family: inherit;
}

.dist-tool-btn-container:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
    background: white;
}

.dist-tool-btn-container.active {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border-color: rgba(255, 255, 255, 0.3);
    animation: pulse-active-premium 2s infinite;
}

.dist-tool-btn-container .icon {
    font-size: 20px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.dist-tool-btn-container .text {
    font-size: 14px;
    font-weight: 700;
    color: #1e293b;
    letter-spacing: 0.05em;
}

.dist-tool-btn-container.active .text {
    color: white;
}

/* ステップ用シミュレーションパネルのシンプル化スタイル */
#floodAnimationStatus.compact-mode {
    padding: 12px !important;
    width: 280px !important;
    border: 2px solid #3b82f6 !important;
}
#floodAnimationStatus.compact-mode .anim-header {
    margin-bottom: 8px !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 6px;
}
#floodAnimationStatus.compact-mode .anim-control-group {
    margin-bottom: 10px !important;
}
#floodAnimationStatus.compact-mode .anim-label {
    font-size: 11px !important;
}
#floodAnimationStatus.compact-mode #rainfallSelect {
    font-size: 11px !important;
    padding: 4px !important;
}
#floodAnimationStatus.compact-mode #adminAlertStatus,
#floodAnimationStatus.compact-mode #evacuationWarning {
    padding: 6px !important;
    font-size: 12px !important;
}
#floodAnimationStatus.compact-mode .anim-slider {
    height: 6px !important;
}

@keyframes pulse-active-premium {
    0% {
        box-shadow: 0 8px 32px rgba(59, 130, 246, 0.4), 0 0 0 0 rgba(59, 130, 246, 0.4);
    }

    70% {
        box-shadow: 0 8px 32px rgba(59, 130, 246, 0.4), 0 0 0 15px rgba(59, 130, 246, 0);
    }

    100% {
        box-shadow: 0 8px 32px rgba(59, 130, 246, 0.4), 0 0 0 0 rgba(59, 130, 246, 0);
    }
}

/* 距離情報ボックスの改善 */
.dist-info-box {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(16px);
    padding: 16px;
    border-radius: 20px;
    box-shadow: 0 15px 45px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.6);
    display: none;
    min-width: 200px;
    animation: slideInDown 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes slideInDown {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes pulse {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.4;
    }

    100% {
        opacity: 1;
    }
}

.dist-info-label {
    display: block;
    font-size: 11px;
    font-weight: 800;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 6px;
}

.dist-info-value {
    display: block;
    font-size: 28px;
    font-weight: 900;
    color: #3b82f6;
    line-height: 1;
}

.dist-info-hint {
    font-size: 11px;
    color: #94a3b8;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px dashed #e2e8f0;
    line-height: 1.5;
}

/* 設置モード・距離計測・手動経路作成中のマーカー無効化（端点を設置しやすくするため） */
.dist-measuring .leaflet-marker-icon,
.dist-measuring .leaflet-marker-shadow,
.dist-measuring .leaflet-interactive,
.manual-route-drawing .leaflet-marker-icon,
.manual-route-drawing .leaflet-marker-shadow,
.manual-route-drawing .leaflet-interactive,
.marker-passthrough .leaflet-marker-icon,
.marker-passthrough .leaflet-marker-shadow,
.marker-passthrough .leaflet-interactive {
    pointer-events: none !important;
}

#controls button,
#elevationControls button {
    display: block;
    width: 100%;
    padding: 8px;
    margin: 5px 0;
    background: #ff9999;
    border: none;
    border-radius: 5px;
    color: white;
    cursor: pointer;
    font-size: 14px;
}

#controls button:hover,
#elevationControls button:hover {
    background: #ff8080;
}

#status {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgba(15, 23, 42, 0.9);
    color: white;
    padding: 12px 20px;
    border-radius: 12px;
    font-size: 13px;
    z-index: 10001;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

#routeNameModal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    z-index: 1003;
    width: 300px;
}

#routeNameModal label {
    display: block;
    margin-bottom: 10px;
    font-size: 14px;
}

#routeNameModal input[type="text"] {
    width: 100%;
    padding: 5px;
    margin-bottom: 15px;
}

#routeNameModal button {
    background: #ccffcc;
    margin: 5px;
    padding: 8px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

#routeNameModal button:hover {
    background: #b3e6b3;
}

.route-label {
    color: black;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 3px;
    padding: 3px 6px;
    text-align: center;
    font-family: Arial, sans-serif;
    border: 1px solid rgba(0, 0, 0, 0.2);
}



#closeElevationBtn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    cursor: pointer;
    color: #64748b;
    z-index: 1002;
    transition: all 0.2s;
    padding: 0;
    line-height: 1;
}

#closeElevationBtn:hover {
    background: #f1f5f9;
    color: #0f172a;
    border-color: #cbd5e1;
}

/* 浸水シミュレーター */
#inundationSimulator {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 260px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
    z-index: 3500;
    padding: 16px;
    display: none;
    /* 初期は非表示 */
    font-family: 'Segoe UI', 'Hiragino Sans', sans-serif;
    border: 1px solid rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* 洪水ボタンON（body.hazard-flood-active）かつ .active クラスがある場合のみ表示 */
body.hazard-flood-active #inundationSimulator.active {
    display: block;
    animation: slideUp 0.5s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(100px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.sim-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    border-bottom: 1px solid #eee;
    padding-bottom: 8px;
}

.sim-header h3 {
    margin: 0;
    font-size: 14px;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 6px;
}

.sim-close {
    cursor: pointer;
    font-size: 18px;
    color: #94a3b8;
}

.sim-visual-container {
    position: relative;
    height: 240px;
    background: linear-gradient(to bottom, #f0f9ff, #e0f2fe);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #bae6fd;
}

.sim-ruler {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 40px;
    border-right: 1px dashed #94a3b8;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 5px 0;
    font-size: 10px;
    color: #64748b;
    text-align: right;
    padding-right: 5px;
    pointer-events: none;
}

.sim-water {
    position: absolute;
    bottom: 0;
    left: 40px;
    right: 0;
    background: linear-gradient(to top, rgba(15, 23, 42, 0.9), rgba(29, 78, 216, 0.8));
    transition: height 1s ease-in-out;
    z-index: 10;
}

.sim-water::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: rgba(255, 255, 255, 0.4);
    animation: water-surface 2s infinite ease-in-out;
}

@keyframes water-surface {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-2px);
    }
}

.sim-person {
    position: absolute;
    bottom: 0;
    left: 60px;
    width: 20px;
    height: 20px;
    /* 1.7m相彁E(1m=12px) */
    z-index: 5;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23475569"><path d="M12 2c1.1 0 2 .9 2 2s-.9 2-2 2-2-.9-2-2 .9-2 2-2zm9 7h-6v13h-2v-6h-2v6H9V9H3V7h18v2z"/></svg>');
    background-repeat: no-repeat;
    background-size: contain;
}

.sim-house {
    position: absolute;
    bottom: 0;
    left: 100px;
    width: 80px;
    height: 60px;
    /* 紁Em相彁E(1m=12px) */
    z-index: 4;
    border: 2px solid #94a3b8;
    background: #f1f5f9;
    border-bottom: none;
}

.sim-house-roof {
    position: absolute;
    bottom: 60px;
    left: 90px;
    width: 100px;
    height: 20px;
    background: #475569;
    clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
    z-index: 4;
}

.sim-ceiling-line {
    position: absolute;
    bottom: 36px;
    /* 3m相彁E(1m=12px) */
    left: 40px;
    right: 0;
    border-top: 1px solid #ef4444;
    z-index: 15;
    display: flex;
    align-items: center;
}

.sim-ceiling-label {
    position: absolute;
    right: 5px;
    background: #ef4444;
    color: white;
    font-size: 9px;
    padding: 1px 4px;
    border-radius: 2px;
    top: -12px;
}

.sim-info {
    margin-top: 12px;
    font-size: 13px;
}

.sim-depth-value {
    font-size: 20px;
    font-weight: 800;
    color: #1e40af;
}

.sim-warning-msg {
    margin-top: 8px;
    padding: 8px;
    background: #fff1f2;
    border-radius: 6px;
    color: #be123c;
    font-size: 11px;
    border-left: 3px solid #f43f5e;
}

@media screen and (max-width: 600px) {
    #inundationSimulator {
        width: calc(100vw - 40px);
        bottom: 10px;
        right: 10px;
        left: 10px;
    }
}

/* 浸水アニメーション状況表示 */
#floodAnimationStatus {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(15, 23, 42, 0.95);
    color: white;
    padding: 16px;
    border-radius: 12px;
    z-index: 5000;
    font-family: 'Segoe UI', 'Noto Sans JP', sans-serif;
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    display: none;
    flex-direction: column;
    width: 320px;
    height: 700px;
    max-height: 90vh;
    resize: both;
    overflow: hidden;
    /* transition removed */
}

#floodAnimationStatus.minimized {
    width: 250px !important;
    height: 48px !important;
    padding: 12px 16px;
    resize: none;
}

#floodAnimationStatus.minimized .anim-control-group,
#floodAnimationStatus.minimized div[style*="flex-direction: column"],
#floodAnimationStatus.minimized div[style*="margin-top: 15px"],
#floodAnimationStatus.minimized div[style*="font-size: 9px"] {
    display: none !important;
}

#floodAnimationStatus.minimized .anim-header {
    margin-bottom: 0;
    border-bottom: none;
}

.anim-header {
    cursor: move;
    padding-bottom: 8px;
    margin-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.anim-control-group {
    width: 100%;
    margin-bottom: 12px;
}

.anim-label {
    font-size: 11px;
    font-weight: bold;
    color: #94a3b8;
    margin-bottom: 4px;
    display: flex;
    justify-content: space-between;
}

.anim-slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.1);
    outline: none;
    -webkit-appearance: none;
}

.anim-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #3b82f6;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
}

.anim-wave {
    font-size: 20px;
    animation: wave-float 2s infinite ease-in-out;
}

@keyframes wave-float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-5px);
    }
}

/* 水路の危険アニメーション */
@keyframes waterway-pulse {
    0% {
        stroke-width: 5;
        opacity: 0.8;
    }

    50% {
        stroke-width: 8;
        opacity: 1;
        filter: drop-shadow(0 0 8px #22d3ee);
    }

    100% {
        stroke-width: 5;
        opacity: 0.8;
    }
}

.waterway-danger-anim {
    animation: waterway-pulse 1.5s infinite ease-in-out;
}

/* 検索と現在地ボタンのデザイン */
.map-tools-container {
    position: fixed;
    top: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 4000;
}

.gps-btn {
    width: 48px;
    height: 48px;
    background: white;
    border: none;
    border-radius: 14px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: #3b82f6;
    margin-left: auto;
}

.gps-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(59, 130, 246, 0.2);
    background: #f0f9ff;
}

.gps-btn:active {
    transform: scale(0.95);
}

/* Geocoder のカスタマイズを適用 */
.leaflet-control-geocoder {
    margin-right: 0 !important;
    border-radius: 14px !important;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12) !important;
    border: 1px solid rgba(255, 255, 255, 0.8) !important;
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(8px);
    overflow: hidden;
    width: 300px !important;
    max-width: calc(100vw - 40px);
}

.leaflet-control-geocoder-icon {
    width: 48px !important;
    height: 48px !important;
    background-size: 20px !important;
    border-radius: 14px !important;
}

.leaflet-control-geocoder-form input {
    width: 100% !important;
    height: 48px !important;
    padding: 0 15px !important;
    font-size: 15px !important;
    border: none !important;
    background: transparent !important;
    outline: none !important;
    font-family: inherit;
}

.leaflet-control-geocoder-results {
    border-top: 1px solid #f1f5f9 !important;
    font-size: 13px !important;
}

.leaflet-control-geocoder-result {
    padding: 10px 15px !important;
    transition: background 0.2s;
}

.leaflet-control-geocoder-result:hover {
    background: #f8fafc !important;
}

/* 点滅アニメーション (Step 5用) */
.blink {
    animation: blink-animation 0.8s infinite alternate !important;
}
@keyframes blink-animation {
    0% { opacity: 1.0 !important; }
    100% { opacity: 0.2 !important; }
}
@-webkit-keyframes blink-animation {
    0% { opacity: 1.0 !important; }
    100% { opacity: 0.2 !important; }
}

/* 施設用（より強調した点滅）スタイル */
.blink-marker {
    animation: marker-blink 1s infinite alternate !important;
}
@keyframes marker-blink {
    0% { opacity: 1.0; filter: brightness(1); transform: scale(1); }
    100% { opacity: 0.4; filter: brightness(1.5); transform: scale(1.2); }

}

/* 避難先ポップアップ（吹き出し）のプレミアム・スタイリング */
.sturdy-popup .leaflet-popup-content-wrapper {
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.98);
}

.sturdy-popup .leaflet-popup-content {
    margin: 12px 16px;
    line-height: inherit;
}

.sturdy-popup .leaflet-popup-tip {
    background: white;
}

.sturdy-popup .leaflet-popup-close-button {
    padding: 8px 8px 0 0 !important;
    color: #94a3b8 !important;
    font-size: 16px !important;
}

.sturdy-popup .leaflet-popup-close-button:hover {
    color: #1e293b !important;
}

.sturdy-marker-suitable {
    filter: drop-shadow(0 0 1px #000000) drop-shadow(0 0 1px #000000);
}

@charset " UTF-8\;

/* --- Step 8 Rebuild Specialized Styles --- */
.btn-hazard-magenta {
 background: linear-gradient(135deg, #be185d 0%, #9d174d 100%);
 color: white;
 border: 1px solid rgba(255, 255, 255, 0.2);
 box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
 cursor: pointer;
 transition: all 0.2s ease;
}

.btn-hazard-magenta:hover {
 filter: brightness(1.2);
 transform: translateY(-1px);
}

.btn-hazard-magenta:active {
 transform: translateY(1px);
}

.btn-outline-custom {
 background: white;
 color: #2563eb;
 border: 2px solid #2563eb;
 cursor: pointer;
 transition: all 0.2s ease;
}

.btn-outline-custom:hover {
 background: #eff6ff;
 box-shadow: 0 4px 12px rgba(37, 99, 235, 0.1);
}

.btn-outline-custom:active {
 background: #dbeafe;
}

/* Global Layout Fix */
#navPanel *, #navPanel *:before, #navPanel *:after { box-sizing: border-box !important; }
.step-instruction, .step-card, .btn-hazard-magenta { width: 100% !important; max-width: 100% !important; }

/* 1. コンテナ：2/3のサイズに変更 */
.icon-container {
    position: absolute;
    width: 20px;  /* 30px → 20px */
    height: 20px;
    transform: translate(-50%, -100%); /* ←重要：これでアイコンの下端が ground に接地します */
    z-index: 100;
}

/* 2. 人物画像：サイズ自動追従 */
.person-icon {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background-color: white; /* 隙間を白で埋める */
    background-size: cover;
    background-position: center;
    z-index: 1;
    /* 画像のレンダリングを最適化 */
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    /* ぼやけを抑制 */
    -webkit-backface-visibility: hidden;
}

/* 3. 緑の枠：一次避難場所等に合わせ、太線の緑（#10b981）＋影を追加 */
.green-ring {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    border: 5px solid #10b981; /* 3px → 5pxに太くして隙間を埋める */
    border-radius: 50%;
    box-sizing: border-box;
    pointer-events: none;
    z-index: 2;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

/* アイコンの種類指定（assetsフォルダに入れた場合） */
.icon-adult {
    background-image: url('assets/female_20s.svg'); /* 20代画像のパス */
}
.icon-senior {
    background-image: url('assets/female_70s.svg'); /* 70代画像のパス */
}

/* マーカーを地面に密着させるCSSの修正 */
#adult-icon-container, #elder-icon-container {
    position: absolute;
    /* 中心を左上に合わせ、下端（-100%）を地面標高ピクセルに一致させる */
    transform: translate(-50%, -100%); 
    z-index: 1000;
}

/* 地図上のアイコンの視認性向上と二重線の改善 */
.sturdy-marker-suitable {
    /* 半透明の二重線を、太く不透明な一本の枠線に変更 */
    border: 5px solid #ffffff !important; 
    
    /* 影のぼかしを減らし、境界線をはっきりさせる */
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.3) !important; 
    
    /* 背景色を不透明に近づける */
    background-color: rgba(255, 255, 255, 1) !important;
    
    /* 念のため、外側の円の太さを確保 */
    outline: none !important;
}

/* アイコンが重なった時の優先順位を上げる */
.leaflet-marker-icon {
    z-index: 1000 !important;
}

/* シミュレーション画面がアクティブな間、土砂災害関連の凡例を非表示にする */
#inundationSimulator.active ~ #dragLegendSediment,
#inundationSimulator.active ~ #sedimentAnimLegend,
#inundationSimulator.active ~ .legend-container #dragLegendSediment,
#inundationSimulator.active ~ .legend-container #sedimentAnimLegend,
body:has(#inundationSimulator.active) #dragLegendSediment,
body:has(#inundationSimulator.active) #sedimentAnimLegend,
body:has(#inundationSimulator.active) .legend-container #dragLegendSediment,
body:has(#inundationSimulator.active) .legend-container #sedimentAnimLegend {
    display: none !important;
}

/* タイマー表示スタイル */
.timer-display {
    font-size: 24px !important;
    font-weight: bold !important;
    color: #FFD700 !important; /* 目立つ黄色 */
    text-shadow: 2px 2px 4px #000 !important; /* 視認性向上のための影 */
    background: rgba(0,0,0,0.5) !important; /* 読み取りやすくするための背景 */
    padding: 5px 10px !important;
    border-radius: 5px !important;
    position: absolute !important;
    z-index: 10000 !important;
    border: none !important;
    box-shadow: none !important;
    white-space: nowrap !important;
}

/* 断面図アイコンと統一した太線緑輪郭（#2e7d32）＋外側白線（1px）＋白背景のマップアイコン */
.map-icon-unified-green-bold {
    background-color: white !important;
    border: 3px solid #2e7d32 !important;
    box-shadow: 0 0 0 1px #ffffff, 0 2px 6px rgba(0, 0, 0, 0.4) !important;
    border-radius: 50% !important;
    box-sizing: border-box !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
}
.map-icon-unified-green-bold .person-icon {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    width: 100% !important;
    height: 100% !important;
    border-radius: 50% !important;
}

/* 🌊 浸水シミュレーターがアクティブな時、凡例の重なりを防ぐために位置を調整する */
body:has(#inundationSimulator.active) #dragLegendFlood,
body:has(#inundationSimulator.active) #dragLegendKeizoku,
body:has(#inundationSimulator.active) #dragLegendTsunami,
body:has(#inundationSimulator.active) #dragLegendTopography,
body:has(#inundationSimulator.active) #dragLegendSediment,
body:has(#inundationSimulator.active) #dragLegendWaterway {
    right: 300px !important;
}

@media screen and (max-width: 600px) {
    body:has(#inundationSimulator.active) #dragLegendFlood,
    body:has(#inundationSimulator.active) #dragLegendKeizoku,
    body:has(#inundationSimulator.active) #dragLegendTsunami,
    body:has(#inundationSimulator.active) #dragLegendTopography,
    body:has(#inundationSimulator.active) #dragLegendSediment,
    body:has(#inundationSimulator.active) #dragLegendWaterway {
        right: 10px !important;
        bottom: 370px !important;
        top: auto !important;
    }
}

/* ステップ8のパネルをデフォルトで隠す */
#step8-panel-container {
    display: none;
}

/* bodyに .step-active-8 が付いた時だけ表示する */
body.step-active-8 #step8-panel-container {
    display: block !important;
}

/* どの県・どの地点でもポップアップを確実に最前面へ出す */
.leaflet-popup {
    z-index: 10000 !important;
}

/* ポップアップが含まれるコンテナ自体も最前面に固定 */
.leaflet-popup-pane {
    z-index: 10000 !important;
}

/* マーカーの方が手前に来る現象を防ぐため、マーカーのZ-indexを相対的に下げる */
.leaflet-marker-icon {
    z-index: 500 !important;
}

/* ==========================================================================
   🛡️ 【完全排除】シミュレーター起動・終了時等に残留する「白い透明の四角」ゴーストボックス対策
   ========================================================================== */
/* キャンバス、SVG、オーバーレイパネル等の不要な背景・影を強制的に透明化 */
.leaflet-pane > svg,
.leaflet-pane > canvas,
.leaflet-tile-container > canvas,
.leaflet-overlay-pane svg,
.leaflet-overlay-pane canvas,
.leaflet-zoom-animated canvas {
    background-color: transparent !important;
    background: transparent !important;
    box-shadow: none !important;
    outline: none !important;
    border: none !important;
}

/* ゴースト化しやすいコンテナ自体も背景を排除 */
.leaflet-overlay-pane,
.leaflet-tile-pane {
    background: transparent !important;
    box-shadow: none !important;
}

/* ポップアップや凡例の後ろに生じる不要な矩形を消去 */
.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
    /* 必要なポップアップデザインは維持しつつ、余分な影や背景漏れを抑制する場合は個別に記述 */
    /* ここでは不要な矩形ラッパー背景を透明化し、.sturdy-popup等の内側要素で色をつける前提とする */
}

/* シミュレーターの不要な残存コンテナ非表示化 */
#inundationSimulator:not(.active) {
    display: none !important;
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* タワー図パネルの右下リサイズハンドルおよび不要なアイコンの非表示 */
.tower-simulation-panel, 
#tower-panel, 
.simulation-tower-container {
  resize: none !important; /* リサイズ機能を無効化 */
}

/* 擬似要素やリサイズ用アイコンの強制非表示 */
.tower-simulation-panel::-webkit-resizer {
  display: none !important;
}

/* 人口メッシュの凡例の位置と透明度を固定 */
#populationLegend,
#populationLegend .legend-header,
#populationLegend > div {
    opacity: 1 !important;
}

#populationLegend {
    transform: none !important;
    margin: 0 !important;
    z-index: 1002 !important;
    position: fixed !important;
    right: 20px !important;
    bottom: 80px !important;
    left: auto !important;
    top: auto !important;
}

#populationLegend.expanded {
    left: auto !important;
    top: auto !important;
    right: 20px !important;
    bottom: 80px !important;
    width: 220px !important;
    height: auto !important;
}
