        :root {
            --neon-cyan: #06b6d4;
            --neon-amber: #f59e0b;
            --bg-dark: #020617;
            --panel-bg: rgba(7, 16, 38, 0.85);
        }

        body {
            background-color: var(--bg-dark);
            font-family: 'Rajdhani', 'Helvetica Neue', 'Hiragino Kaku Gothic ProN', sans-serif;
            color: #e2e8f0;
            overflow: hidden;
            margin: 0; padding: 0;
        }

        /* Auth0とFastAPI認可が完了するまでviewer本体を見せず、認可ゲートだけを表示する。 */
        #viewer-app[hidden],
        #auth-gate[hidden],
        .auth-gate-icon[hidden],
        .auth-gate-actions[hidden] {
            display: none !important;
        }

        #viewer-app {
            display: contents;
        }

        html[data-auth-gate="checking"] #viewer-app,
        html[data-auth-gate="denied"] #viewer-app,
        html[data-auth-gate="error"] #viewer-app {
            display: none !important;
        }

        html[data-auth-gate="authorized"] #auth-gate {
            display: none !important;
        }

        /* 認可ゲートは静的HTML配信でも使える、viewer本体とは独立した全画面状態表示。 */
        .auth-gate {
            position: fixed;
            inset: 0;
            z-index: 5000;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 1.5rem;
            background: #020617;
            color: #e2e8f0;
        }

        .auth-gate-panel {
            width: min(420px, 100%);
            border: 1px solid rgba(8, 145, 178, 0.55);
            border-radius: 8px;
            background: rgba(7, 16, 38, 0.96);
            box-shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
            padding: 1.5rem;
        }

        .auth-gate-icon {
            display: flex;
            align-items: center;
            justify-content: center;
            width: 2.75rem;
            height: 2.75rem;
            border: 1px solid rgba(8, 145, 178, 0.65);
            border-radius: 8px;
            color: #67e8f9;
            background: rgba(15, 23, 42, 0.8);
            margin-bottom: 1rem;
        }

        /* checkingとdenied/errorでアイコンを切り替え、状態の誤認を防ぐ。 */
        .auth-gate-icon-denied {
            display: none;
            color: #fda4af;
            border-color: rgba(244, 63, 94, 0.65);
        }

        html[data-auth-gate="denied"] .auth-gate-icon-checking,
        html[data-auth-gate="error"] .auth-gate-icon-checking {
            display: none;
        }

        html[data-auth-gate="denied"] .auth-gate-icon-denied,
        html[data-auth-gate="error"] .auth-gate-icon-denied {
            display: flex;
        }

        .auth-gate-kicker {
            margin: 0 0 0.4rem;
            color: #67e8f9;
            font-size: 0.72rem;
            letter-spacing: 0;
        }

        .auth-gate h1 {
            margin: 0;
            color: #f8fafc;
            font-size: 1.35rem;
            line-height: 1.25;
            letter-spacing: 0;
        }

        .auth-gate p {
            overflow-wrap: anywhere;
        }

        #auth-gate-message {
            margin: 0.75rem 0 0;
            color: #cbd5e1;
            font-size: 0.95rem;
            line-height: 1.65;
        }

        /* 操作ボタンは拒否・エラー時だけ出し、確認中は余計な操作を出さない。 */
        .auth-gate-actions {
            display: none;
            grid-template-columns: 1fr;
            gap: 0.65rem;
            margin-top: 1.25rem;
        }

        html[data-auth-gate="denied"] .auth-gate-actions,
        html[data-auth-gate="error"] .auth-gate-actions {
            display: grid;
        }

        .auth-gate-primary,
        .auth-gate-secondary {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 0.5rem;
            min-height: 2.65rem;
            border-radius: 6px;
            font-size: 0.95rem;
            font-weight: 700;
            letter-spacing: 0;
            transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
        }

        .auth-gate-primary {
            border: 1px solid #22d3ee;
            background: #0891b2;
            color: #02111a;
        }

        .auth-gate-primary:hover {
            background: #22d3ee;
        }

        .auth-gate-secondary {
            border: 1px solid rgba(148, 163, 184, 0.45);
            background: rgba(15, 23, 42, 0.88);
            color: #cbd5e1;
        }

        .auth-gate-secondary:hover {
            border-color: rgba(103, 232, 249, 0.75);
            color: #f8fafc;
        }

        .mono { font-family: 'Share Tech Mono', monospace; }
        .leaflet-marker-draggable { cursor: grab !important; }
        .leaflet-marker-draggable:active { cursor: grabbing !important; }

        .legend {
            background: rgba(7, 16, 38, 0.9) !important;
            border: 1px solid rgba(148, 163, 184, 0.45) !important;
            border-radius: 4px !important;
            box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35) !important;
            padding: 12px 16px !important;
            color: #e2e8f0 !important;
            font-family: 'Share Tech Mono', monospace !important;
            line-height: 22px !important;
            transition: all 0.3s ease;
            max-width: 280px;
        }

        /* 地図上の凡例はLeaflet control内で動的生成されるため、固定幅とsymbol classで地図操作を邪魔しない情報量に抑える。 */
        .gad-legend {
            min-width: 220px;
            max-width: min(280px, calc(100vw - 2rem));
            padding: 0 !important;
            line-height: 1.25 !important;
            overflow: hidden;
        }
        .gad-legend-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 0.75rem;
            padding: 0.55rem 0.7rem;
            border-bottom: 1px solid rgba(148, 163, 184, 0.22);
            color: #e2e8f0;
            font-size: 11px;
            font-weight: 700;
            letter-spacing: 0;
        }
        .gad-legend-toggle {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 1.35rem;
            height: 1.35rem;
            border: 1px solid rgba(148, 163, 184, 0.35);
            border-radius: 4px;
            background: rgba(15, 23, 42, 0.85);
            color: #cbd5e1;
            cursor: pointer;
        }
        .gad-legend-toggle:hover {
            background: rgba(30, 41, 59, 0.95);
            color: #f8fafc;
        }
        .gad-legend-body {
            max-height: min(52vh, 420px);
            overflow-y: auto;
            padding: 0.55rem 0.7rem 0.7rem;
        }
        .gad-legend-section + .gad-legend-section {
            margin-top: 0.65rem;
            padding-top: 0.55rem;
            border-top: 1px solid rgba(148, 163, 184, 0.18);
        }
        .gad-legend-title {
            margin-bottom: 0.35rem;
            color: #94a3b8;
            font-size: 10px;
            font-weight: 700;
        }
        .gad-legend-row {
            display: grid;
            grid-template-columns: 1.35rem minmax(0, 1fr);
            align-items: center;
            gap: 0.45rem;
            min-height: 1.25rem;
            color: #e2e8f0;
            font-size: 10px;
        }
        .gad-legend-row + .gad-legend-row { margin-top: 0.2rem; }
        .gad-legend-label {
            min-width: 0;
            overflow-wrap: anywhere;
        }
        .gad-legend-note {
            display: block;
            margin-top: 0.08rem;
            color: #94a3b8;
            font-size: 9px;
        }
        /* --legend-color はJS側の凡例modelから渡し、線・点・円の色を描画layerと同じ意味に揃える。 */
        .gad-legend-symbol {
            --legend-color: #94a3b8;
            width: 1.1rem;
            height: 0.9rem;
            position: relative;
            display: inline-flex;
            align-items: center;
            justify-content: center;
        }
        .gad-legend-symbol-line::before,
        .gad-legend-symbol-dashed-line::before {
            content: "";
            width: 1.1rem;
            border-top: 3px solid var(--legend-color);
            border-radius: 2px;
        }
        .gad-legend-symbol-dashed-line::before { border-top-style: dashed; }
        .gad-legend-symbol-circle,
        .gad-legend-symbol-dashed-circle {
            border: 2px dashed var(--legend-color);
            border-radius: 999px;
            background: rgba(15, 23, 42, 0.35);
        }
        .gad-legend-symbol-dashed-circle { border-style: dashed; }
        .gad-legend-symbol-dot,
        .gad-legend-symbol-dot-large {
            width: 0.68rem;
            height: 0.68rem;
            margin-left: 0.2rem;
            border-radius: 999px;
            background: var(--legend-color);
            border: 1px solid rgba(255, 255, 255, 0.85);
        }
        .gad-legend-symbol-dot-large {
            width: 0.9rem;
            height: 0.9rem;
            margin-left: 0.1rem;
        }
        .gad-legend-symbol-handle::before,
        .gad-legend-symbol-handle::after {
            content: "";
            position: absolute;
            border: 2px solid var(--legend-color);
            background: #fff;
        }
        .gad-legend-symbol-handle::before {
            width: 0.75rem;
            height: 0.75rem;
            border-radius: 999px;
            left: 0.05rem;
        }
        .gad-legend-symbol-handle::after {
            width: 0.55rem;
            height: 0.55rem;
            right: 0.05rem;
            transform: rotate(45deg);
        }
        .gad-legend-symbol-gradient-density,
        .gad-legend-symbol-gradient-senior {
            width: 1.15rem;
            height: 0.6rem;
            border-radius: 2px;
            border: 1px solid rgba(226, 232, 240, 0.55);
        }
        /* density / senior は値ごとの個別凡例ではなく、低→高の読み方だけを示すgradientに限定する。 */
        .gad-legend-symbol-gradient-density {
            background: linear-gradient(90deg, #0891b2, #22c55e, #f59e0b, #f97316, #dc2626);
        }
        .gad-legend-symbol-gradient-senior {
            background: linear-gradient(90deg, #0ea5e9, #6366f1, #a855f7, #d946ef, #e11d48);
        }

        /* ネオン廃止: 車両アイコンの発光リング（box-shadow halo）は非表示（アイコン本体は残る） */
        .vehicle-icon-emitter { cursor: crosshair !important; }

        /* ネオン発光は廃止: 色とボーダーは残し、グロー（text-shadow / box-shadow halo）のみ除去 */
        .neon-text-cyan { text-shadow: none; }
        .side-panel { background: var(--panel-bg); backdrop-filter: blur(10px); border-right: 1px solid rgba(148, 163, 184, 0.25); box-shadow: 2px 0 10px rgba(0,0,0,0.35); z-index: 1000; }
        header { background: rgba(1, 4, 18, 0.9); border-bottom: 1px solid rgba(148, 163, 184, 0.25); z-index: 2000; position: relative; }

        .route-path:hover { stroke-width: 10px !important; cursor: grab !important; }
        .route-path:active { cursor: grabbing !important; }
        .via-handle,
        .via-add-handle { cursor: grab !important; }

        /* GAD移動ニーズ線だけを流し、交通空白地帯円は標準表示に合わせて点線の静止表示にする。 */
        .laser-line {
            stroke-dasharray: 6 24;
            stroke-linecap: round;
            animation: dash-laser 0.6s linear infinite;
        }
        @keyframes dash-laser {
            to { stroke-dashoffset: -30; }
        }
        .radar-zone {
            animation: none;
        }

        /* マークアップ側の任意値グロー（shadow-[0_0_...]）と点滅演出を一括で無効化 */
        [class*="shadow-[0_0_"] { box-shadow: none !important; }
        .animate-pulse { animation: none !important; }

        /* 周囲のUIはダークのまま、背景地図はMapboxのpublish済みstyle 1種類に固定する。 */
        html { color-scheme: dark; }

        .map-background-status {
            position: absolute;
            z-index: 900;
            left: 50%;
            top: 1rem;
            transform: translateX(-50%);
            max-width: min(32rem, calc(100% - 2rem));
            padding: 0.6rem 0.85rem;
            border: 1px solid rgba(251, 191, 36, 0.75);
            border-radius: 0.5rem;
            background: rgba(15, 23, 42, 0.94);
            color: #fde68a;
            box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
            font: 600 12px/1.4 "Share Tech Mono", monospace;
            text-align: center;
            pointer-events: none;
        }
        .map-background-status[hidden] { display: none; }

        /* Mapbox GL JS公式CSSのロゴassetを無加工で使用する。 */
        .mapbox-logo {
            display: block;
            width: 88px;
            height: 23px;
            margin: 0 0 -4px -4px;
            overflow: hidden;
            background: transparent url("mapbox-logo.svg") no-repeat;
            cursor: pointer;
        }

        /* =========================================================================
           サイドバー開閉（マークアップ/JS は別途。ここでは CSS のみ）
           ========================================================================= */
        aside.side-panel { transition: width 0.25s ease, padding 0.25s ease, border-right-width 0.25s ease; }
        html[data-sidebar="collapsed"] aside.side-panel {
            width: 0 !important;
            min-width: 0 !important;
            padding-left: 0 !important;
            padding-right: 0 !important;
            border-right-width: 0 !important;
            overflow: hidden !important;
        }
        #sidebar-toggle .icon-open { display: none; }
        #sidebar-toggle .icon-close { display: inline; }
        html[data-sidebar="collapsed"] #sidebar-toggle .icon-open { display: inline; }
        html[data-sidebar="collapsed"] #sidebar-toggle .icon-close { display: none; }

        /* =========================================================================
           カスタムスクロールバー（.custom-scrollbar）
           マークアップで参照されているが未定義だったため、フラットなダークテーマで定義。
           ========================================================================= */
        .custom-scrollbar { scrollbar-width: thin; scrollbar-color: rgba(8, 145, 178, 0.55) transparent; }
        .custom-scrollbar::-webkit-scrollbar { width: 8px; height: 8px; }
        .custom-scrollbar::-webkit-scrollbar-track { background: transparent; }
        .custom-scrollbar::-webkit-scrollbar-thumb {
            background-color: rgba(8, 145, 178, 0.5);
            border-radius: 8px;
            border: 2px solid transparent;
            background-clip: padding-box;
        }
        .custom-scrollbar::-webkit-scrollbar-thumb:hover { background-color: rgba(6, 182, 212, 0.75); }

        /* =========================================================================
           フォーカス可視化（アクセシビリティ）
           キーボード操作時のみリングを出す。フラットなアウトラインで統一。
           ========================================================================= */
        a:focus-visible,
        button:focus-visible,
        summary:focus-visible,
        select:focus-visible,
        input:focus-visible,
        [tabindex]:focus-visible {
            outline: 2px solid #06b6d4;
            outline-offset: 2px;
            border-radius: 4px;
        }
        /* マウス操作では枠を出さない（focus-visible が効く環境ではノイズを抑制） */
        :focus:not(:focus-visible) { outline: none; }

        /* チェックボックス／レンジ等のポインタ操作を明示 */
        input[type="checkbox"], input[type="range"], select { cursor: pointer; }

        /* 操作系ボタンの押下フィードバック（フラット・グローなし） */
        aside button:active { transform: translateY(1px); }

        /* details の開閉に合わせてシェブロンを回転（情報階層の明確化） */
        .sim-settings-summary::-webkit-details-marker { display: none; }
        details > summary > .fa-chevron-down { transition: transform 0.2s ease; }
        details[open] > summary > .fa-chevron-down { transform: rotate(180deg); }

        /* =========================================================================
           レスポンシブ補強（styles.css は tailwind.css / CDN の後に読み込まれる）
           ユーティリティのレスポンシブ接頭辞は CDN 実行時生成に依存するため、
           レイアウトの要は実メディアクエリでも担保しておく。
           ========================================================================= */
        /* 極小画面：地図の可視領域を確保するためサイドバーをさらに狭く・上限付きに */
        @media (max-width: 400px) {
            aside.side-panel {
                width: 15rem;          /* w-72 より狭く */
                max-width: 78vw;        /* それでも地図領域を残す */
                padding: 0.75rem;
            }
        }
        /* 中画面以下：見出しのトラッキングを詰めて折返しを防ぐ */
        @media (max-width: 640px) {
            header h1 { letter-spacing: 0.02em; }
        }

        /* 時刻表モーダル：狭い画面では文字とセル余白を詰めて横溢れを防ぐ */
        @media (max-width: 520px) {
            #timetable-content table { font-size: 11px; }
            #timetable-content th,
            #timetable-content td { padding: 0.375rem 0.375rem; }
            #timetable-content td.truncate { max-width: 9rem; }
        }

        /* 入力フィールド：フォーカス時のトランジションを滑らかに（フラット維持） */
        aside input[type="text"],
        aside input[type="number"],
        aside select { transition: border-color 0.15s ease, box-shadow 0.15s ease; }

        /* リンク／ボタン等の最小タップ領域を確保（モバイル操作性） */
        /* =========================================================================
           Leafletクロームはダークな周辺UIと明るいMapbox背景の双方から識別できる
           固定配色とする。
           ========================================================================= */
        .leaflet-popup-content-wrapper,
        .leaflet-popup-tip {
            background: #0b1220;
            color: #e2e8f0;
            box-shadow: 0 1px 6px rgba(0, 0, 0, 0.5);
        }
        .leaflet-popup-content-wrapper { border: 1px solid rgba(148, 163, 184, 0.35); }
        .leaflet-popup-close-button { color: #94a3b8; }
        .leaflet-tooltip {
            background: #0b1220;
            color: #e2e8f0;
            border: 1px solid rgba(148, 163, 184, 0.35);
            box-shadow: 0 1px 6px rgba(0, 0, 0, 0.5);
        }
        .leaflet-tooltip-left::before { border-left-color: #0b1220; }
        .leaflet-tooltip-right::before { border-right-color: #0b1220; }
        .leaflet-tooltip-top::before { border-top-color: #0b1220; }
        .leaflet-tooltip-bottom::before { border-bottom-color: #0b1220; }
        .leaflet-control-zoom a {
            background: #0b1220;
            color: #e2e8f0;
            border-color: rgba(148, 163, 184, 0.35);
        }
        .leaflet-control-zoom a:hover { background: #16202f; }
        .leaflet-bar { border-color: rgba(148, 163, 184, 0.35); }
        .leaflet-control-attribution {
            background: rgba(11, 18, 32, 0.8);
            color: #94a3b8;
        }
        .leaflet-control-attribution a { color: #67e8f9; }

        /* =========================================================================
           ライトモード（theme-soft 配色を正本とする）

           ダーク配色は上記の基礎スタイルとして残す。body.theme-soft を外せば
           従来のダークUIへ戻せるが、背景地図はGEOTRAのMapbox style 1種類に固定する。
           ========================================================================= */
        body.theme-soft {
            --neon-cyan: #0070c0;
            --neon-amber: #E65100;
            --neon-danger: #C62828;
            --neon-purple: #4338ca;
            --bg-dark: #f4f7fa;
            --panel-bg: rgba(255,255,255,0.99);
            --border-glow: rgba(0,112,192,0.2);
            background-color: #f4f7fa !important;
            color: #0f172a !important;
            color-scheme: light;
        }
        body.theme-soft header {
            background: linear-gradient(135deg, #0033aa 0%, #0070c0 50%, #00bdf2 100%) !important;
            border-bottom: 2px solid #00bdf2 !important;
            box-shadow: 0 2px 16px rgba(0,51,170,0.3) !important;
        }
        body.theme-soft aside {
            background: #FFFFFF !important;
            border-right: 1px solid #e2e8f0 !important;
            box-shadow: 2px 0 8px rgba(15,23,42,0.04) !important;
            backdrop-filter: none !important;
            font-family: 'Hiragino Kaku Gothic ProN', 'Yu Gothic', 'Noto Sans JP',
                         -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif !important;
            font-weight: 500 !important;
        }
        body.theme-soft aside button,
        body.theme-soft aside select,
        body.theme-soft aside input,
        body.theme-soft aside label,
        body.theme-soft aside span,
        body.theme-soft aside p,
        body.theme-soft aside div {
            font-family: inherit !important;
        }
        body.theme-soft aside .font-medium { font-weight: 600 !important; }
        body.theme-soft h1 { color: #FFFFFF !important; text-shadow: none !important; }
        body.theme-soft h2 { color: #0f172a !important; }
        body.theme-soft .mono,
        body.theme-soft .text-xs.mono,
        body.theme-soft .text-sm.mono {
            font-family: 'Hiragino Kaku Gothic ProN', 'Yu Gothic', sans-serif !important;
        }
        body.theme-soft .legend {
            background: rgba(255,255,255,0.97) !important;
            border: 1.5px solid #cbd5e1 !important;
            box-shadow: 0 2px 10px rgba(15,23,42,0.08) !important;
            color: #0f172a !important;
        }
        body.theme-soft .neon-text-cyan { text-shadow: none !important; color: #0070c0 !important; }
        body.theme-soft header .neon-text-cyan {
            color: #FFFFFF !important;
            text-shadow: 0 0 10px rgba(0,189,242,0.6) !important;
        }
        body.theme-soft .neon-border-cyan { box-shadow: none !important; border-color: #0070c0 !important; }

        /* HTML構造は変えず、Tailwind utilityの上書きでライト配色へ揃える。 */
        body.theme-soft .bg-slate-950 { background-color: #ffffff !important; }
        body.theme-soft .bg-slate-900 { background-color: #f8fafc !important; }
        body.theme-soft .bg-slate-800 { background-color: #f1f5f9 !important; }
        body.theme-soft .border-cyan-900 { border-color: #e2e8f0 !important; }
        body.theme-soft .border-cyan-900\/50 { border-color: rgba(226,232,240,0.5) !important; }
        body.theme-soft .border-cyan-800 { border-color: #cbd5e1 !important; }
        body.theme-soft .border-cyan-700 { border-color: #60a5fa !important; }
        body.theme-soft .text-cyan-100 { color: #0c2d6b !important; }
        body.theme-soft .text-cyan-200 { color: #0033aa !important; }
        body.theme-soft .text-cyan-300 { color: #0050b3 !important; }
        body.theme-soft .text-cyan-400 { color: #0070c0 !important; }
        body.theme-soft .text-cyan-500 { color: #0086e0 !important; }
        body.theme-soft .text-cyan-700 { color: #0070c0 !important; }
        body.theme-soft .text-slate-200 { color: #334155 !important; }
        body.theme-soft .text-slate-300 { color: #1e293b !important; }
        body.theme-soft .text-slate-400 { color: #334155 !important; }
        body.theme-soft .text-slate-500 { color: #475569 !important; }
        body.theme-soft .text-slate-600 { color: #334155 !important; }
        body.theme-soft .text-slate-900 { color: #0f172a !important; }
        body.theme-soft select {
            color: #0f172a !important;
            background-color: #f8fafc !important;
            border-color: #cbd5e1 !important;
        }
        body.theme-soft .bg-slate-900 input,
        body.theme-soft .bg-slate-950 input {
            background-color: #f8fafc !important;
            color: #0f172a !important;
        }
        body.theme-soft .text-emerald-100 { color: #165520 !important; }
        body.theme-soft .text-emerald-200 { color: #1B6B2A !important; }
        body.theme-soft .text-emerald-300 { color: #2E7D32 !important; }
        body.theme-soft .text-emerald-400 { color: #388E3C !important; }
        body.theme-soft .text-emerald-500 { color: #2E7D32 !important; }
        body.theme-soft .text-amber-100 { color: #7B3500 !important; }
        body.theme-soft .text-amber-200 { color: #92400E !important; }
        body.theme-soft .text-amber-300 { color: #D84000 !important; }
        body.theme-soft .text-amber-400 { color: #B45309 !important; }
        body.theme-soft .text-amber-500,
        body.theme-soft .text-amber-600 { color: #BF3600 !important; }
        body.theme-soft .text-gray-300 { color: #2A4858 !important; }
        body.theme-soft .text-gray-500 { color: #4A6475 !important; }
        body.theme-soft .text-purple-200 { color: #4A0E7A !important; }
        body.theme-soft .text-purple-300,
        body.theme-soft .text-purple-500 { color: #6A1B9A !important; }
        body.theme-soft .text-orange-200 { color: #92400E !important; }
        body.theme-soft .text-orange-300 { color: #BF3600 !important; }
        body.theme-soft .text-indigo-200 { color: #1A2E8A !important; }
        body.theme-soft .text-indigo-300 { color: #243898 !important; }
        body.theme-soft .text-indigo-400 { color: #2F44AA !important; }
        body.theme-soft .text-rose-100 { color: #7A0A35 !important; }
        body.theme-soft .text-rose-200 { color: #9F1239 !important; }
        body.theme-soft .text-rose-300,
        body.theme-soft .text-rose-400,
        body.theme-soft .text-rose-500 { color: #BE123C !important; }
        body.theme-soft .text-sky-400 { color: #0369A1 !important; }

        body.theme-soft .border-rose-900 { border-color: #F5C2D0 !important; }
        body.theme-soft .border-emerald-900,
        body.theme-soft .border-emerald-800 { border-color: #81C784 !important; }
        body.theme-soft .border-purple-900,
        body.theme-soft .border-purple-700 { border-color: #E1BEE7 !important; }
        body.theme-soft .border-indigo-900 { border-color: #C5CAE9 !important; }
        body.theme-soft .border-amber-900,
        body.theme-soft .border-amber-800,
        body.theme-soft .border-orange-900 { border-color: #FFCC80 !important; }
        body.theme-soft .border-amber-700,
        body.theme-soft .border-orange-700 { border-color: #FFB74D !important; }
        body.theme-soft .border-slate-700 { border-color: #cbd5e1 !important; }
        body.theme-soft .border-slate-600 { border-color: #94a3b8 !important; }
        body.theme-soft .border-slate-950 { border-color: #e2e8f0 !important; }
        body.theme-soft .border-red-500 { border-color: #EF9A9A !important; }
        body.theme-soft .bg-cyan-700 { background-color: #0070c0 !important; }
        body.theme-soft .bg-emerald-700 { background-color: #2E7D32 !important; }
        body.theme-soft .bg-orange-700 { background-color: #D84000 !important; }
        body.theme-soft .bg-indigo-700 { background-color: #1A2E8A !important; }
        body.theme-soft .bg-purple-700 { background-color: #6A1B9A !important; }
        body.theme-soft .bg-rose-950 { background-color: #FCE4EC !important; }
        body.theme-soft .bg-emerald-950 { background-color: #E8F5E9 !important; }
        body.theme-soft .bg-amber-950 { background-color: #FFF8E1 !important; }
        body.theme-soft .bg-red-950\/40 { background-color: rgba(252,228,236,0.7) !important; }
        body.theme-soft .bg-black\/80 { background-color: rgba(248,250,252,0.92) !important; }
        body.theme-soft .hover\:text-cyan-100:hover { color: #FFFFFF !important; }
        body.theme-soft .hover\:text-cyan-200:hover { color: #0033aa !important; }
        body.theme-soft .hover\:text-cyan-300:hover { color: #0050b3 !important; }
        body.theme-soft .hover\:text-rose-400:hover { color: #BE123C !important; }
        body.theme-soft .hover\:bg-cyan-950\/20:hover { background-color: rgba(241,245,249,0.9) !important; }
        body.theme-soft .hover\:bg-cyan-950\/30:hover { background-color: rgba(226,232,240,0.8) !important; }
        body.theme-soft .hover\:bg-slate-900:hover { background-color: #f1f5f9 !important; }
        body.theme-soft .hover\:bg-slate-700:hover { background-color: #e2e8f0 !important; }
        body.theme-soft .hover\:bg-purple-600:hover { background-color: #7e22ce !important; }
        body.theme-soft .hover\:border-rose-500:hover { border-color: #C62828 !important; }
        body.theme-soft .hover\:border-cyan-500:hover { border-color: #0070c0 !important; }
        body.theme-soft .hover\:border-purple-500:hover { border-color: #6A1B9A !important; }
        body.theme-soft .focus\:border-cyan-400:focus,
        body.theme-soft .focus\:ring-cyan-400:focus { border-color: #0070c0 !important; }
        body.theme-soft .focus\:border-emerald-400:focus,
        body.theme-soft .focus\:ring-emerald-400:focus { border-color: #43A047 !important; }

        /* ヘッダーは濃色グラデーションなので、操作部品だけ白系に保つ。 */
        body.theme-soft header .bg-slate-950 { background: rgba(255,255,255,0.12) !important; }
        body.theme-soft header .border-cyan-900 { border-color: rgba(255,255,255,0.25) !important; }
        body.theme-soft header .text-cyan-200,
        body.theme-soft header .text-cyan-300 { color: rgba(255,255,255,0.9) !important; }
        body.theme-soft header .hover\:text-cyan-100:hover { color: #FFFFFF !important; }

        /* 認証ゲートも画面本体と同じ背景・文字・ブランド色へ合わせる。 */
        body.theme-soft .auth-gate { background: #f4f7fa; color: #0f172a; }
        body.theme-soft .auth-gate-panel {
            border-color: #cbd5e1;
            background: #FFFFFF;
            box-shadow: 0 2px 10px rgba(15,23,42,0.08);
        }
        body.theme-soft .auth-gate-icon {
            border-color: #cbd5e1;
            color: #0070c0;
            background: #f8fafc;
        }
        body.theme-soft .auth-gate-icon-denied { color: #C62828; border-color: #F5C2D0; }
        body.theme-soft .auth-gate-kicker { color: #0070c0; }
        body.theme-soft .auth-gate h1 { color: #0f172a !important; }
        body.theme-soft #auth-gate-message { color: #475569; }
        body.theme-soft .auth-gate-primary { border-color: #0070c0; background: #0070c0; color: #FFFFFF; }
        body.theme-soft .auth-gate-primary:hover { background: #0033aa; }
        body.theme-soft .auth-gate-secondary { border-color: #cbd5e1; background: #f8fafc; color: #334155; }
        body.theme-soft .auth-gate-secondary:hover { border-color: #0070c0; color: #0f172a; }

        /* GAD凡例も画面本体と同じ明色配色へ統一する。 */
        body.theme-soft .gad-legend-header {
            border-bottom-color: rgba(29,78,216,0.2);
            color: #0f172a;
        }
        body.theme-soft .gad-legend-toggle {
            border-color: #cbd5e1;
            background: #f8fafc;
            color: #334155;
        }
        body.theme-soft .gad-legend-toggle:hover { background: #f1f5f9; color: #0f172a; }
        body.theme-soft .gad-legend-section + .gad-legend-section { border-top-color: rgba(29,78,216,0.2); }
        body.theme-soft .gad-legend-title { color: #1d4ed8; }
        body.theme-soft .gad-legend-row { color: #1e293b; }
        body.theme-soft .gad-legend-note { color: #475569; }
        body.theme-soft .gad-legend-symbol-circle,
        body.theme-soft .gad-legend-symbol-dashed-circle { background: rgba(241,245,249,0.9); }
        body.theme-soft .gad-legend-symbol-gradient-density,
        body.theme-soft .gad-legend-symbol-gradient-senior { border-color: #cbd5e1; }

        body.theme-soft .map-background-status {
            border-color: #FFB74D;
            background: #FFF8E1;
            color: #7B3500;
            box-shadow: 0 2px 10px rgba(15,23,42,0.08);
        }
        body.theme-soft .custom-scrollbar { scrollbar-color: rgba(0,112,192,0.4) transparent; }
        body.theme-soft .custom-scrollbar::-webkit-scrollbar-thumb { background-color: rgba(0,112,192,0.3); }
        body.theme-soft .custom-scrollbar::-webkit-scrollbar-thumb:hover { background-color: rgba(0,112,192,0.5); }
        body.theme-soft a:focus-visible,
        body.theme-soft button:focus-visible,
        body.theme-soft summary:focus-visible,
        body.theme-soft select:focus-visible,
        body.theme-soft input:focus-visible,
        body.theme-soft [tabindex]:focus-visible { outline-color: #0070c0; }

        /* Mapboxの背景styleは変えず、Leafletの操作部品だけをライトUIへ合わせる。 */
        body.theme-soft .leaflet-container { background: #ffffff !important; }
        body.theme-soft .leaflet-tile-pane { background: transparent !important; }
        body.theme-soft .leaflet-popup-content-wrapper,
        body.theme-soft .leaflet-popup-tip {
            background: #FFFFFF;
            color: #0f172a;
            box-shadow: 0 2px 10px rgba(15,23,42,0.08);
        }
        body.theme-soft .leaflet-popup-content-wrapper { border-color: #cbd5e1; }
        body.theme-soft .leaflet-popup-close-button { color: #475569; }
        body.theme-soft .leaflet-tooltip {
            background: #FFFFFF;
            color: #0f172a;
            border-color: #cbd5e1;
            box-shadow: 0 2px 10px rgba(15,23,42,0.08);
        }
        body.theme-soft .leaflet-tooltip-left::before { border-left-color: #FFFFFF; }
        body.theme-soft .leaflet-tooltip-right::before { border-right-color: #FFFFFF; }
        body.theme-soft .leaflet-tooltip-top::before { border-top-color: #FFFFFF; }
        body.theme-soft .leaflet-tooltip-bottom::before { border-bottom-color: #FFFFFF; }
        body.theme-soft .leaflet-control-zoom a { background: #FFFFFF; color: #0f172a; border-color: #cbd5e1; }
        body.theme-soft .leaflet-control-zoom a:hover { background: #f1f5f9; }
        body.theme-soft .leaflet-bar { border-color: #cbd5e1; }
        body.theme-soft .leaflet-control-attribution { background: rgba(255,255,255,0.92); color: #475569; }
        body.theme-soft .leaflet-control-attribution a { color: #0070c0; }
