/* ═════════════════════════════════════════════════════════
   雪崩リスクマップ — モダン・シンプル・落ち着いたスタイル
   レイアウト: フル幅トップバー ＋ サイドバー ＋ 地図
   レスポンシブ: PC=固定サイドバー / タブレット=左ドロワー / スマホ=ボトムシート
   ═════════════════════════════════════════════════════════ */

*,
*::before,
*::after {
    box-sizing: border-box;
}

:root {
    /* ビューポート高さ（JS で実測 dvh を補完。--vh は 1% 相当） */
    --vh: 1vh;
    /* トップバー高さ（JS で実測。狭画面では折り返しで可変） */
    --topbar-h: 60px;
    /* ノッチ等のセーフエリア */
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-left: env(safe-area-inset-left, 0px);
    --safe-right: env(safe-area-inset-right, 0px);
}

html,
body {
    margin: 0;
    padding: 0;
    height: 100%;
    overflow: hidden;
    font-family:
        system-ui,
        -apple-system,
        "Hiragino Kaku Gothic ProN",
        "Noto Sans JP",
        sans-serif;
    font-size: 14px;
    background: #f1f5f9;
    color: #1e293b;
    -webkit-font-smoothing: antialiased;
    -webkit-text-size-adjust: 100%;
    overscroll-behavior: none;
}

/* タップ時の青いハイライトを抑制 */
button,
.pill,
.rp,
select,
input {
    -webkit-tap-highlight-color: transparent;
}

/* ═══ トップバー ═══ */

.topbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0 max(20px, var(--safe-right)) 0 max(20px, var(--safe-left));
    padding-top: var(--safe-top);
    height: calc(60px + var(--safe-top));
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    color: #1e293b;
}

/* 左端: ロゴ */
.tb-left {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-shrink: 0;
}
.tb-title {
    font-weight: 700;
    font-size: 17px;
    letter-spacing: 0.015em;
    color: #0f172a;
}

/* グループ共通 */
.tb-group {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}
.tb-label {
    font-size: 11px;
    font-weight: 500;
    color: #64748b;
    margin-right: 2px;
    letter-spacing: 0.01em;
}

/* セレクトボックス */
.tb-select {
    font: inherit;
    font-size: 13px;
    font-weight: 500;
    padding: 5px 10px;
    min-width: 90px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #fff;
    color: #1e293b;
    cursor: pointer;
    transition:
        border-color 0.15s,
        box-shadow 0.15s;
}
.tb-select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}
@media (hover: hover) {
    .tb-select:hover {
        border-color: #94a3b8;
    }
}

/* 地図切替ピル */
.tb-pills {
    display: flex;
    gap: 3px;
    flex-shrink: 0;
}
.tb-pills .pill {
    font-size: 12px;
    font-weight: 500;
    padding: 4px 12px;
    border-radius: 20px;
    cursor: pointer;
    user-select: none;
    background: #f1f5f9;
    color: #475569;
    border: 1px solid transparent;
    transition: all 0.15s;
}
.tb-pills .pill.on {
    background: #2563eb;
    color: #fff;
    box-shadow: 0 1px 3px rgba(37, 99, 235, 0.25);
}
@media (hover: hover) {
    .tb-pills .pill:hover {
        background: #e2e8f0;
        color: #334155;
    }
    .tb-pills .pill.on:hover {
        background: #1d4ed8;
    }
}

/* 操作ボタン */
.tb-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
    margin-left: auto;
}

.btn-primary {
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    padding: 7px 18px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    background: #2563eb;
    color: #fff;
    transition:
        background 0.15s,
        box-shadow 0.15s;
    box-shadow: 0 1px 3px rgba(37, 99, 235, 0.2);
}
.btn-primary:active {
    background: #1e40af;
    transform: translateY(1px);
}
@media (hover: hover) {
    .btn-primary:hover {
        background: #1d4ed8;
        box-shadow: 0 2px 6px rgba(37, 99, 235, 0.3);
    }
}

.btn-secondary {
    font: inherit;
    font-size: 13px;
    font-weight: 500;
    padding: 7px 16px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    cursor: pointer;
    background: #fff;
    color: #475569;
    transition: all 0.15s;
}
.btn-secondary:active {
    transform: translateY(1px);
}
@media (hover: hover) {
    .btn-secondary:hover {
        background: #f8fafc;
        border-color: #94a3b8;
        color: #1e293b;
    }
}

.btn-sm {
    font: inherit;
    font-size: 12px;
    font-weight: 500;
    padding: 4px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    cursor: pointer;
    background: #f8fafc;
    color: #475569;
    transition: all 0.15s;
    display: inline-block;
}
@media (hover: hover) {
    .btn-sm:hover {
        background: #f1f5f9;
        border-color: #94a3b8;
        color: #1e293b;
    }
}

.btn-danger {
    font: inherit;
    font-size: 12px;
    font-weight: 500;
    padding: 4px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    cursor: pointer;
    background: transparent;
    color: #94a3b8;
    transition: all 0.15s;
}
@media (hover: hover) {
    .btn-danger:hover {
        background: #fef2f2;
        border-color: #fca5a5;
        color: #dc2626;
    }
}

/* ═══ メインエリア ═══ */

#app {
    display: flex;
    height: calc(100 * var(--vh) - var(--topbar-h));
    width: 100%;
    overflow: hidden;
    position: relative;
}

/* ═══ サイドバー ═══ */

#sidebar {
    width: 320px;
    min-width: 320px;
    background: #fff;
    border-right: 1px solid #e2e8f0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 16px;
    padding-left: max(16px, var(--safe-left));
    display: flex;
    flex-direction: column;
    gap: 16px;
    z-index: 400;
}

/* サイドバー背景（visibility で管理し opacity をアニメーション） */
#sidebarBackdrop {
    visibility: hidden;
    pointer-events: none;
    position: absolute;
    inset: 0;
    z-index: 440;
    background: rgba(15, 23, 42, 0.35);
    opacity: 0;
    /* 閉じるとき: opacity を先に消し、その後 visibility を hidden に */
    transition: opacity 0.25s ease, visibility 0s linear 0.25s;
}

/* ボトムシートのドラッグハンドル（スマホ時のみ表示） */
#sidebarHandle {
    display: none;
}

.sidebar-title {
    font-size: 13px;
    font-weight: 600;
    margin: 0 0 10px;
    color: #334155;
    letter-spacing: 0.01em;
}

/* サイドバー開閉ボタン（地図の左端にフロート） */
#sidebarToggle {
    display: none;
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 430;
    width: 30px;
    height: 52px;
    padding: 0;
    margin: 0;
    border: none;
    border-radius: 0 10px 10px 0;
    background: #fff;
    color: #475569;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    box-shadow: 1px 1px 6px rgba(0, 0, 0, 0.12);
    transition:
        left 0.25s ease,
        opacity 0.2s ease;
}
@media (hover: hover) {
    #sidebarToggle:hover {
        color: #1e293b;
        background: #f8fafc;
    }
}

/* サイドバー内の閉じるボタン */
#sidebarClose {
    display: none;
    align-self: flex-end;
    width: 36px;
    height: 36px;
    padding: 0;
    margin: 0 0 4px 0;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    color: #94a3b8;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    transition: all 0.15s;
}
@media (hover: hover) {
    #sidebarClose:hover {
        background: #f1f5f9;
        color: #475569;
    }
}

/* ═══ 地図 ═══ */

#map {
    flex: 1;
    position: relative;
    height: 100%;
    min-height: 0;
}
.leaflet-container {
    width: 100% !important;
    height: 100% !important;
}

.map-subnote {
    display: none;
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 500;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(4px);
    border-radius: 24px;
    padding: 6px 18px;
    font-size: 12px;
    color: #64748b;
    pointer-events: none;
    white-space: nowrap;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

/* ═══ 雪崩問題カード ═══ */

.prob {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 10px 12px;
    margin-bottom: 10px;
    background: #fafbfc;
    transition: border-color 0.15s;
}
.prob:hover {
    border-color: #cbd5e1;
}

.prob-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.prob-head select {
    font: inherit;
    font-size: 13px;
    font-weight: 500;
    padding: 4px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #fff;
    color: #1e293b;
    cursor: pointer;
    transition:
        border-color 0.15s,
        box-shadow 0.15s;
}
.prob-head select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}
.prob-head .btn-danger {
    margin-left: auto;
}

.prob-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

/* ── 24セル スノーフレーク雪崩ローズ ── */

.rose24 {
    width: 200px;
    height: 200px;
    display: block;
    cursor: default;
    overflow: visible;
}
.rp {
    stroke-width: 1;
    cursor: pointer;
    transition:
        fill 0.18s,
        stroke 0.18s;
}
/* 未選択 */
.rp-alpine {
    fill: #b7cde0;
    stroke: #9bb6cc;
}
.rp-treeline {
    fill: #c8dcee;
    stroke: #aec7db;
}
.rp-below {
    fill: #d8eaf4;
    stroke: #bed7e9;
}
/* 未選択ホバー（ポインタ端末のみ） */
@media (hover: hover) {
    .rp-alpine:hover:not(.on) {
        fill: #9bb6cc;
    }
    .rp-treeline:hover:not(.on) {
        fill: #aec7db;
    }
    .rp-below:hover:not(.on) {
        fill: #bed7e9;
    }
    .rp-alpine.on:hover {
        fill: #1e40af;
    }
    .rp-treeline.on:hover {
        fill: #2563eb;
    }
    .rp-below.on:hover {
        fill: #3b82f6;
    }
}
/* 選択済み */
.rp-alpine.on {
    fill: #1d4ed8;
    stroke: #1e40af;
}
.rp-treeline.on {
    fill: #3b82f6;
    stroke: #2563eb;
}
.rp-below.on {
    fill: #60a5fa;
    stroke: #3b82f6;
}

.rdlbl {
    font-size: 9.5px;
    fill: #475569;
    font-weight: 600;
    letter-spacing: 0.03em;
}

.rose-legend {
    display: flex;
    gap: 12px;
    font-size: 10px;
    color: #64748b;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
}
.rleg-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    display: inline-block;
    vertical-align: middle;
    margin-right: 2px;
}
.rleg-alpine {
    background: #1d4ed8;
}
.rleg-treeline {
    background: #3b82f6;
}
.rleg-below {
    background: #60a5fa;
}

/* ═══ 凡例 ═══ */

.legend {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    font-size: 12px;
    align-items: center;
}
.lg {
    display: flex;
    align-items: center;
    gap: 5px;
}
.sw {
    width: 15px;
    height: 15px;
    border-radius: 4px;
    display: inline-block;
    border: 1px solid rgba(0, 0, 0, 0.12);
}
.note {
    font-size: 12px;
    color: #64748b;
    line-height: 1.6;
}

/* ═══ ステータス ═══ */

.status {
    font-size: 12px;
    font-weight: 500;
    color: #2563eb;
    min-height: 1em;
    margin: 4px 0;
}
.err {
    color: #dc2626;
}

/* ═══ サイドバー: 解析条件フォーム ═══ */

.sd-row {
    display: flex;
    align-items: center;
    gap: 6px;
}
.sd-inline {
    flex-wrap: wrap;
}
.sd-label {
    font-size: 12px;
    font-weight: 600;
    color: #334155;
}
.sd-desc {
    font-size: 11px;
    color: #64748b;
}
.sd-unit {
    font-size: 11px;
    color: #94a3b8;
}

.sd-dangers {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
}
.sd-danger {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
}

.sd-select {
    font: inherit;
    font-size: 13px;
    font-weight: 500;
    padding: 5px 8px;
    flex: 1;
    min-width: 0;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #fff;
    color: #1e293b;
    cursor: pointer;
    transition: border-color 0.15s;
}
.sd-select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}
@media (hover: hover) {
    .sd-select:hover {
        border-color: #94a3b8;
    }
}

.sd-num {
    font: inherit;
    font-size: 13px;
    font-weight: 500;
    padding: 4px 8px;
    width: 70px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #fff;
    color: #1e293b;
    text-align: center;
    transition:
        border-color 0.15s,
        box-shadow 0.15s;
    -moz-appearance: textfield;
}
.sd-num::-webkit-outer-spin-button,
.sd-num::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.sd-num:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}
@media (hover: hover) {
    .sd-num:hover {
        border-color: #94a3b8;
    }
}
.sd-num-sm {
    width: 60px;
}

.sd-elevtag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 22px;
    border-radius: 4px;
    font-size: 9px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
    letter-spacing: 0.02em;
}

/* 標高帯タグ色（sidebar + topbar 共通） */
.alpine-tag {
    background: #1d4ed8;
}
.treeline-tag {
    background: #3b82f6;
}
.below-tag {
    background: #60a5fa;
}

/* ═══════════════════════════════════════════════════════
   レスポンシブ
   ═══════════════════════════════════════════════════════ */

/* 中画面: サイドバーをやや縮小 */
@media (max-width: 1100px) {
    #sidebar {
        width: 290px;
        min-width: 290px;
    }
}

/* ═══ タブレット / 狭画面（≦820px） ═══
   トップバーは折り返して 2 段構成にし、横スクロールを排して
   すべての操作を常に表示。サイドバーは左ドロワー＋背景。 */
@media (max-width: 820px) {
    .topbar {
        flex-wrap: wrap;
        align-content: center;
        height: auto;
        padding: 8px max(12px, var(--safe-right)) 8px
            max(12px, var(--safe-left));
        padding-top: calc(8px + var(--safe-top));
        gap: 8px 10px;
        row-gap: 10px;
    }
    .tb-left {
        flex: 1 1 auto;
    }
    .tb-title {
        font-size: 16px;
    }
    .tb-label {
        display: none;
    }
    .tb-actions {
        margin-left: auto;
    }

    .tb-select {
        min-width: 96px;
        font-size: 16px; /* iOS のオートズーム防止 */
        padding: 7px 10px;
    }
    .tb-pills .pill {
        font-size: 13px;
        padding: 7px 13px;
    }
    .btn-primary {
        padding: 9px 18px;
        font-size: 14px;
    }
    .btn-secondary {
        padding: 9px 16px;
        font-size: 14px;
    }

    /* フォーム入力もタップしやすく＆iOS オートズーム防止 */
    .sd-select,
    .prob-head select {
        font-size: 16px;
        padding: 8px 10px;
    }
    .sd-num {
        font-size: 16px;
        padding: 7px 8px;
    }

    /* サイドバー → 左からスライドするオーバーレイ */
    #sidebar {
        position: absolute;
        left: 0;
        top: 0;
        height: 100%;
        width: min(340px, 86vw);
        min-width: 0;
        padding-bottom: max(16px, var(--safe-bottom));
        transform: translateX(-100%);
        transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
        box-shadow: 6px 0 24px rgba(15, 23, 42, 0.16);
        z-index: 450;
    }
    #sidebar.sidebar--open {
        transform: translateX(0);
    }

    /* 背景（オーバーレイ開中のみ表示） */
    #sidebarBackdrop.is-visible {
        visibility: visible;
        pointer-events: auto;
        opacity: 1;
        /* 開くとき: visibility を即座に、opacity をフェードイン */
        transition: opacity 0.25s ease, visibility 0s linear 0s;
    }

    #sidebarToggle {
        display: block;
    }
    #sidebarClose {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* サイドバーが開いたらトグルを隠す（背景タップで閉じる） */
    #sidebar.sidebar--open ~ #sidebarToggle {
        opacity: 0;
        pointer-events: none;
    }

    .map-subnote {
        display: block;
        max-width: calc(100vw - 32px);
        white-space: normal;
        text-align: center;
        bottom: calc(12px + var(--safe-bottom));
    }
}

/* ═══ スマホ（≦560px） ═══
   サイドバーを「ボトムシート」化（下からスライド）し片手操作しやすく。 */
@media (max-width: 560px) {
    .topbar {
        gap: 6px 8px;
    }
    .tb-select {
        min-width: 84px;
    }
    .tb-pills .pill {
        padding: 7px 11px;
    }

    /* ボトムシート */
    #sidebar {
        left: 0;
        right: 0;
        top: auto;
        bottom: 0;
        width: 100%;
        height: auto;
        max-height: 82%;
        border-right: none;
        border-top: 1px solid #e2e8f0;
        border-radius: 18px 18px 0 0;
        padding-top: 6px;
        transform: translateY(100%);
        transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
        box-shadow: 0 -6px 28px rgba(15, 23, 42, 0.18);
    }
    #sidebar.sidebar--open {
        transform: translateY(0);
    }

    /* ドラッグハンドル */
    #sidebarHandle {
        display: flex;
        justify-content: center;
        align-items: center;
        height: 22px;
        margin: 0 0 2px;
        flex-shrink: 0;
        cursor: grab;
        touch-action: none;
    }
    #sidebarHandle span {
        width: 40px;
        height: 4px;
        border-radius: 999px;
        background: #cbd5e1;
    }

    /* 左フロートトグルをやめ、下部に FAB を出す */
    #sidebarToggle {
        left: 50%;
        top: auto;
        bottom: calc(16px + var(--safe-bottom));
        transform: translateX(-50%);
        width: auto;
        height: 44px;
        padding: 0 20px;
        border-radius: 999px;
        font-size: 14px;
        font-weight: 600;
        display: flex;
        align-items: center;
        gap: 6px;
        box-shadow: 0 3px 12px rgba(15, 23, 42, 0.2);
    }
    #sidebarToggle::after {
        content: "設定";
    }

    .map-subnote {
        bottom: calc(72px + var(--safe-bottom));
        font-size: 11px;
    }

    /* ローズを少し大きくしてタップしやすく */
    .rose24 {
        width: min(240px, 72vw);
        height: auto;
    }
}

/* 横向き（低い高さ）ではボトムシートより左ドロワーが使いやすい */
@media (max-height: 480px) and (orientation: landscape) {
    #sidebar {
        left: 0;
        right: auto;
        top: 0;
        bottom: auto;
        height: 100%;
        width: min(340px, 70vw);
        max-height: none;
        border-radius: 0;
        border-top: none;
        border-right: 1px solid #e2e8f0;
        transform: translateX(-100%);
        transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
    }
    #sidebar.sidebar--open {
        transform: translateX(0);
    }
    #sidebarHandle {
        display: none;
    }
    #sidebarToggle {
        left: 0;
        top: 50%;
        bottom: auto;
        transform: translateY(-50%);
        width: 30px;
        height: 52px;
        padding: 0;
        border-radius: 0 10px 10px 0;
        font-size: 18px;
    }
    #sidebarToggle::after {
        content: none;
    }
}

/* アニメーションを抑えたいユーザーへの配慮 */
@media (prefers-reduced-motion: reduce) {
    #sidebar,
    #sidebarBackdrop,
    #sidebarToggle {
        transition: none !important;
    }
}

/* ═══════════════════════════════════════════════════════
   サイドバーセクション区切り
   ═══════════════════════════════════════════════════════ */

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

/* 2 番目以降のセクションは上に薄い区切り線 */
.sidebar-section + .sidebar-section {
    border-top: 1px solid #f0f4f8;
    padding-top: 6px;
}

/* ═══════════════════════════════════════════════════════
   サイドバー内 地図タイプ切替（モバイルのみ表示）
   ═══════════════════════════════════════════════════════ */

.sidebar-maptype {
    display: none; /* PC では非表示（トップバーで操作） */
    gap: 6px;
    flex-wrap: wrap;
}
.sidebar-maptype .pill {
    font-size: 13px;
    font-weight: 500;
    padding: 6px 16px;
    border-radius: 20px;
    cursor: pointer;
    user-select: none;
    background: #f1f5f9;
    color: #475569;
    border: 1px solid transparent;
    transition: all 0.15s;
    -webkit-tap-highlight-color: transparent;
}
.sidebar-maptype .pill.on {
    background: #2563eb;
    color: #fff;
    box-shadow: 0 1px 3px rgba(37, 99, 235, 0.25);
}
@media (hover: hover) {
    .sidebar-maptype .pill:hover { background: #e2e8f0; color: #334155; }
    .sidebar-maptype .pill.on:hover { background: #1d4ed8; }
}

/* ═══════════════════════════════════════════════════════
   タッチターゲット改善
   ═══════════════════════════════════════════════════════ */

/* タップしやすい最小高さを保証 */
.btn-primary,
.btn-secondary {
    min-height: 44px;
}
.btn-sm,
.btn-danger {
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* ═══════════════════════════════════════════════════════
   ≦ 560px: トップバーの地図切替ピルを隠し、
            サイドバー内のピルを表示
   ═══════════════════════════════════════════════════════ */

@media (max-width: 560px) {
    .tb-pills {
        display: none;
    }
    .sidebar-maptype {
        display: flex;
    }
}

/* ═══════════════════════════════════════════════════════
   ≦ 380px: トップバーが極小画面でも溢れないように
   ═══════════════════════════════════════════════════════ */

@media (max-width: 380px) {
    .tb-title {
        font-size: 14px;
    }
    .tb-select {
        min-width: 76px;
        font-size: 15px; /* iOS 自動ズーム抑制 */
        padding: 6px 8px;
    }
    .btn-primary,
    .btn-secondary {
        padding: 8px 13px;
        font-size: 13px;
    }
}

/* ═══════════════════════════════════════════════════════
   ローズカード: モバイルでセンタリングと余白の調整
   ═══════════════════════════════════════════════════════ */

@media (max-width: 560px) {
    .prob {
        padding: 10px;
    }
    /* 雪崩タイプのセレクトボックスを横幅いっぱいに */
    .prob-head {
        gap: 8px;
    }
    .prob-head select {
        flex: 1;
        min-width: 0;
    }
    /* ローズ凡例を横並びで中央揃え */
    .rose-legend {
        justify-content: center;
        gap: 10px;
    }
}

/* PC でサイドバー幅に合わせてローズを若干大きく表示 */
@media (min-width: 821px) {
    .rose24 {
        width: 220px;
        height: 220px;
    }
}

/* ═══════════════════════════════════════════════════════
   ステータス表示の視認性向上
   ═══════════════════════════════════════════════════════ */

#status:not(:empty) {
    padding: 6px 10px;
    border-radius: 6px;
    background: #eff6ff;
}
#status.err:not(:empty) {
    background: #fef2f2;
}
